Skip to contentSkip to conversation

frv: cmpxchg: implement cmpxchg64()

PATCH New [email protected] 1 participant 1 message Jul 10, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 72/115 frv: cmpxchg: implement cmpxchg64()

From: Will Deacon <[email protected]>
Subject: frv: cmpxchg: implement cmpxchg64()

FRV supports 64-bit cmpxchg, which is provided by the arch code as __cmpxchg_64 and subsequently used to implement atomic64_cmpxchg.

This patch hooks up the generic cmpxchg64 API using the same function, which also provides default definitions of the relaxed, acquire and release variants. This fixes the build when COMPILE_TEST=y and IOMMU_IO_PGTABLE_LPAE=y.

---

 arch/frv/include/asm/cmpxchg.h |    1 +
 1 file changed, 1 insertion(+)
arch/frv/include/asm/cmpxchg.h renamed from arch/frv/include/asm/cmpxchg.h~frv-cmpxchg-implement-cmpxchg64 +1 -0
diff -puN arch/frv/include/asm/cmpxchg.h~frv-cmpxchg-implement-cmpxchg64 arch/frv/include/asm/cmpxchg.h
@@ -76,6 +76,7 @@ extern uint32_t __xchg_32(uint32_t i, vo
  * - if (*ptr != test) then orig = *ptr;
  */
 extern uint64_t __cmpxchg_64(uint64_t test, uint64_t new, volatile uint64_t *v);
+#define cmpxchg64(p, o, n)	__cmpxchg_64((o), (n), (p))
 
 #ifndef CONFIG_FRV_OUTOFLINE_ATOMIC_OPS
 

_