remarkable-linux/lib
Paul Mackerras 09d4e0edd4 lib: Provide generic atomic64_t implementation
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 <paulus@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2009-06-15 13:27:38 +10:00
..
lzo
reed_solomon
zlib_deflate
zlib_inflate bzip2/lzma: library support for gzip, bzip2 and lzma decompression 2009-01-04 15:53:34 -08:00
.gitignore
argv_split.c
atomic64.c lib: Provide generic atomic64_t implementation 2009-06-15 13:27:38 +10:00
audit.c
bcd.c
bitmap.c bitmap: fix end condition in bitmap_find_free_region 2009-03-12 19:32:51 -07:00
bitrev.c
bug.c allow bug table entries to use relative pointers (and use it on x86-64) 2008-12-16 18:40:32 +01:00
bust_spinlocks.c oops handling: ensure that any oops is flushed to the mtdoops console 2009-01-06 15:59:11 -08:00
check_signature.c
checksum.c add generic lib/checksum.c 2009-06-11 21:02:51 +02:00
cmdline.c generic, memparse(): constify argument 2008-07-28 15:05:23 +02:00
cpumask.c x86: remove some alloc_bootmem_cpumask_var calling 2009-06-11 19:27:07 +03:00
crc-ccitt.c
crc-itu-t.c
crc-t10dif.c
crc7.c
crc16.c
crc32.c
crc32defs.h
ctype.c
debug_locks.c lockdep: warn about lockdep disabling after kernel taint 2009-04-12 16:10:51 +02:00
debugobjects.c debugobjects: delay free of internal objects 2009-03-17 12:28:30 +01:00
dec_and_lock.c
decompress.c bzip2/lzma: don't stop search at first unconfigured compression 2009-02-19 13:36:55 -08:00
decompress_bunzip2.c kmemtrace, kbuild: fix slab.h dependency problem in lib/decompress_bunzip2.c 2009-04-03 12:22:45 +02:00
decompress_inflate.c kmemtrace, kbuild: fix slab.h dependency problem in lib/decompress_inflate.c 2009-04-03 12:21:36 +02:00
decompress_unlzma.c kmemtrace, kbuild: fix slab.h dependency problem in lib/decompress_unlzma.c 2009-04-03 12:22:59 +02:00
devres.c
div64.c
dma-debug.c dma-debug: simplify logic in driver_filter() 2009-06-08 15:53:46 +02:00
dump_stack.c
dynamic_debug.c Dynamic debug: allow simple quoting of words 2009-03-24 16:38:27 -07:00
extable.c module: trim exception table on init free. 2009-06-12 21:47:04 +09:30
fault-inject.c Remove remaining unwinder code 2009-01-06 15:59:11 -08:00
find_last_bit.c bitmap: find_last_bit() 2009-01-01 10:12:19 +10:30
find_next_bit.c
gen_crc32table.c
genalloc.c
halfmd4.c
hexdump.c
hweight.c
idr.c cgroup: CSS ID support 2009-04-02 19:04:53 -07:00
inflate.c
int_sqrt.c
iomap.c Use WARN() in lib/ 2008-07-26 12:00:07 -07:00
iomap_copy.c
iommu-helper.c introduce generic iommu_num_pages function 2008-10-16 11:21:33 -07:00
ioremap.c
irq_regs.c
is_single_threaded.c CRED: Rename is_single_threaded() to is_wq_single_threaded() 2008-11-14 10:39:21 +11:00
kasprintf.c
Kconfig lib: Provide generic atomic64_t implementation 2009-06-15 13:27:38 +10:00
Kconfig.debug kmemleak: Simple testing module for kmemleak 2009-06-11 17:04:19 +01:00
Kconfig.kgdb kgdb: remove the requirement for CONFIG_FRAME_POINTER 2008-08-01 08:39:34 -05:00
kernel_lock.c sched: TIF_NEED_RESCHED -> need_reshed() cleanup 2009-03-06 12:48:55 +01:00
klist.c driver core: Remove completion from struct klist_node 2009-01-06 10:44:30 -08:00
kobject.c driver: dont update dev_name via device_add path 2009-04-20 08:12:58 -07:00
kobject_uevent.c driver core: allow non-root users to listen to uevents 2009-04-16 16:17:09 -07:00
kref.c
libcrc32c.c libcrc32c: Fix "crc32c undefined" compilation error 2008-12-25 11:01:42 +11:00
list_debug.c
lmb.c lmb: Rework lmb_dump_all() output 2009-02-11 13:38:00 +11:00
locking-selftest-hardirq.h
locking-selftest-mutex.h
locking-selftest-rlock-hardirq.h
locking-selftest-rlock-softirq.h
locking-selftest-rlock.h
locking-selftest-rsem.h
locking-selftest-softirq.h
locking-selftest-spin-hardirq.h
locking-selftest-spin-softirq.h
locking-selftest-spin.h
locking-selftest-wlock-hardirq.h
locking-selftest-wlock-softirq.h
locking-selftest-wlock.h
locking-selftest-wsem.h
locking-selftest.c locking: rename trace_softirq_[enter|exit] => lockdep_softirq_[enter|exit] 2009-03-13 01:32:36 +01:00
Makefile lib: Provide generic atomic64_t implementation 2009-06-15 13:27:38 +10:00
nlattr.c Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/kaber/nf-next-2.6 2009-03-26 22:45:23 -07:00
parser.c vfs: Use const for kernel parser table 2008-10-13 10:10:37 -07:00
percpu_counter.c Merge branch 'core-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2009-01-06 17:10:04 -08:00
plist.c Use WARN() in lib/ 2008-07-26 12:00:07 -07:00
prio_heap.c lib: fix sparse shadowed variable warning 2009-01-06 15:59:11 -08:00
prio_tree.c
proportions.c Merge branch 'core-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2009-01-06 17:10:04 -08:00
radix-tree.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2009-01-07 11:31:52 -08:00
random32.c random32: seeding improvement 2008-07-30 16:29:19 -07:00
ratelimit.c __ratelimit() cpu flags can't be static 2008-07-28 16:30:20 -07:00
rational.c lib: isolate rational fractions helper function 2009-06-11 08:51:08 -07:00
rbtree.c lib/rbtree.c: optimize rb_erase() 2009-04-01 08:59:17 -07:00
reciprocal_div.c
rwsem-spinlock.c
rwsem.c
scatterlist.c scatterlist: make sure sg_miter_next() doesn't return 0 sized mappings 2009-04-22 08:35:09 +02:00
sha1.c
show_mem.c lib: generic show_mem() 2008-07-26 12:00:10 -07:00
smp_processor_id.c cpumask: convert lib/smp_processor_id to new cpumask ops 2009-01-30 15:47:34 +01:00
sort.c generic swap(): lib/sort.c: rename swap to swap_func 2009-01-08 08:31:14 -08:00
spinlock_debug.c
string.c
string_helpers.c [SCSI] lib: string_get_size(): don't hang on zero; no decimals on exact 2008-10-23 11:42:20 -05:00
swiotlb.c swiotlb: change swiotlb_bus_to[phys,virt] prototypes 2009-04-08 16:18:38 +02:00
syscall.c task_current_syscall 2008-07-26 12:00:10 -07:00
textsearch.c
ts_bm.c
ts_fsm.c
ts_kmp.c
vsprintf.c vsprintf: introduce %pf format specifier 2009-04-29 20:55:55 +02:00