]> git.karo-electronics.de Git - karo-tx-linux.git/commit
metag: Atomics, locks and bitops
authorJames Hogan <james.hogan@imgtec.com>
Tue, 9 Oct 2012 10:00:24 +0000 (11:00 +0100)
committerJames Hogan <james.hogan@imgtec.com>
Fri, 8 Feb 2013 09:53:04 +0000 (09:53 +0000)
commit4b0919788324b4e19a8871edba441bef4c7f53bd
treeb7e02e36054bd0e7dc7134c5b243fabae7a18378
parent825b58a91ac80e9cea75f78d03bd7e945c21de12
metag: Atomics, locks and bitops

Add header files to implement Meta hardware thread locks (used by some
other atomic operations), atomics, spinlocks, and bitops.

There are 2 main types of atomic primitives for metag (in addition to
IRQs off on UP):
 - LOCK instructions provide locking between hardware threads.
 - LNKGET/LNKSET instructions provide load-linked/store-conditional
   operations allowing for lighter weight atomics on Meta2

LOCK instructions allow for hardware threads to acquire voluntary or
exclusive hardware thread locks:
 - LOCK0 releases exclusive and voluntary lock from the running hardware
   thread.
 - LOCK1 acquires the voluntary hardware lock, blocking until it becomes
   available.
 - LOCK2 implies LOCK1, and additionally acquires the exclusive hardware
   lock, blocking all other hardware threads from executing.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
13 files changed:
arch/metag/include/asm/atomic.h [new file with mode: 0644]
arch/metag/include/asm/atomic_lnkget.h [new file with mode: 0644]
arch/metag/include/asm/atomic_lock1.h [new file with mode: 0644]
arch/metag/include/asm/bitops.h [new file with mode: 0644]
arch/metag/include/asm/cmpxchg.h [new file with mode: 0644]
arch/metag/include/asm/cmpxchg_irq.h [new file with mode: 0644]
arch/metag/include/asm/cmpxchg_lnkget.h [new file with mode: 0644]
arch/metag/include/asm/cmpxchg_lock1.h [new file with mode: 0644]
arch/metag/include/asm/global_lock.h [new file with mode: 0644]
arch/metag/include/asm/spinlock.h [new file with mode: 0644]
arch/metag/include/asm/spinlock_lnkget.h [new file with mode: 0644]
arch/metag/include/asm/spinlock_lock1.h [new file with mode: 0644]
arch/metag/include/asm/spinlock_types.h [new file with mode: 0644]