<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/include/asm-generic/atomic64.h, branch v3.4-rc2</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/include/asm-generic/atomic64.h?h=v3.4-rc2</id>
<link rel='self' href='https://git.amat.us/linux/atom/include/asm-generic/atomic64.h?h=v3.4-rc2'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2009-06-15T03:27:38Z</updated>
<entry>
<title>lib: Provide generic atomic64_t implementation</title>
<updated>2009-06-15T03:27:38Z</updated>
<author>
<name>Paul Mackerras</name>
<email>paulus@samba.org</email>
</author>
<published>2009-06-12T21:10:05Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=09d4e0edd4614e787393acc582ac701c6ec3565b'/>
<id>urn:sha1:09d4e0edd4614e787393acc582ac701c6ec3565b</id>
<content type='text'>
Many processor architectures have no 64-bit atomic instructions, but
we need atomic64_t in order to support the perf_counter subsystem.

This adds an implementation of 64-bit atomic operations using hashed
spinlocks to provide atomicity.  For each atomic operation, the address
of the atomic64_t variable is hashed to an index into an array of 16
spinlocks.  That spinlock is taken (with interrupts disabled) around the
operation, which can then be coded non-atomically within the lock.

On UP, all the spinlock manipulation goes away and we simply disable
interrupts around each operation.  In fact gcc eliminates the whole
atomic64_lock variable as well.

Signed-off-by: Paul Mackerras &lt;paulus@samba.org&gt;
Signed-off-by: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
</content>
</entry>
</feed>
