From owner-cvs-all Fri Oct 20 0: 0:54 2000 Delivered-To: cvs-all@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id BAC3F37B4CF; Fri, 20 Oct 2000 00:00:49 -0700 (PDT) Received: (from jhb@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id AAA28573; Fri, 20 Oct 2000 00:00:49 -0700 (PDT) (envelope-from jhb@FreeBSD.org) Message-Id: <200010200700.AAA28573@freefall.freebsd.org> From: John Baldwin Date: Fri, 20 Oct 2000 00:00:49 -0700 (PDT) To: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/sys/i386/include atomic.h src/sys/alpha/include atomic.h src/sys/ia64/include atomic.h X-FreeBSD-CVS-Branch: HEAD Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG jhb 2000/10/20 00:00:49 PDT Modified files: sys/i386/include atomic.h sys/alpha/include atomic.h sys/ia64/include atomic.h Log: - Expand the set of atomic operations to optionally include memory barriers in most of the atomic operations. Now for these operations, you can use the normal atomic operation, you can use the operation with a read barrier, or you can use the operation with a write barrier. The function names follow the same semantics used in the ia64 instruction set. An atomic operation with a read barrier has the extra suffix 'acq', due to it having "acquire" semantics. An atomic operation with a write barrier has the extra suffix 'rel'. These suffixes are inserted between the name of the operation to perform and the typename. For example, the atomic_add_int() function now has 3 variants: - atomic_add_int() - this is the same as the previous function - atomic_add_acq_int() - this function combines the add operation with a read memory barrier - atomic_add_rel_int() - this function combines the add operation with a write memory barrier - Add 'ptr' to the list of types that we can perform atomic operations on. This allows one to do atomic operations on uintptr_t's. This is useful in the mutex code, for example, because the actual mutex lock is a pointer. - Add two new operations for doing loads and stores with memory barriers. The new load operations use a read barrier before the load, and the new store operations use a write barrier after the load. For example, atomic_load_acq_int() will atomically load an integer as well as enforcing a read barrier. Revision Changes Path 1.14 +109 -3 src/sys/i386/include/atomic.h 1.6 +170 -1 src/sys/alpha/include/atomic.h 1.3 +214 -64 src/sys/ia64/include/atomic.h To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message