Skip to contentSkip to conversation

ARCv2: Implement atomic64 based on LLOCKD/SCONDD instructions

PATCH New Vineet Gupta 1 participant 1 message Sep 9, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 ARCv2: Implement atomic64 based on LLOCKD/SCONDD instructions

ARCv2 ISA provides 64-bit exclusive load/stores so use them to implement the 64-bit atomics and elide the spinlock based generic 64-bit atomics

boot tested with atomic64 self-test (and GOD bless the person who wrote them, I realized my inline assmebly is sloppy as hell)

Cc Peter Zijlstra <peterz at infradead.org>
Cc Will Deacon <will.deacon at arm.com>
Cc linux-snps-arc at lists.infradead.org
Cc linux-kernel at vger.kernel.org
Signed-off-by Vineet Gupta <vgupta at synopsys.com>

---
changes since v2
- Removed questions aboutt compiler barrier from changelog
- added some comments to same effect in atomic64_set()
- fixes a few spellos in comment/changelog

---
 arch/arc/Kconfig              |   2 +-
 arch/arc/include/asm/atomic.h | 262 +++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 261 insertions(+), 3 deletions(-)
arch/arc/Kconfig +1 -1
index 0d3e59f56974..073b3582544b 100644
@@ -13,7 +13,7 @@ config ARC
 	select CLKSRC_OF
 	select CLONE_BACKWARDS
 	select COMMON_CLK
-	select GENERIC_ATOMIC64
+	select GENERIC_ATOMIC64 if !ISA_ARCV2 || !(ARC_HAS_LL64 && ARC_HAS_LLSC)
 	select GENERIC_CLOCKEVENTS
 	select GENERIC_FIND_FIRST_BIT
 	# for now, we don't need GENERIC_IRQ_PROBE, CONFIG_GENERIC_IRQ_CHIP
arch/arc/include/asm/atomic.h +260 -2

276 lines not on this page · raw message

Signature · 1 line
2.7.4