Date: Fri, 20 Oct 2000 00:00:49 -0700 (PDT) From: John Baldwin <jhb@FreeBSD.org> 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 Message-ID: <200010200700.AAA28573@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200010200700.AAA28573>