1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __ASM_SH_CMPXCHG_CAS_H
3 #define __ASM_SH_CMPXCHG_CAS_H
5 static inline unsigned long
6 __cmpxchg_u32(volatile u32 *m, unsigned long old, unsigned long new)
8 __asm__ __volatile__("cas.l %1,%0,@r0"
15 static inline unsigned long xchg_u32(volatile u32 *m, unsigned long val)
19 while (__cmpxchg_u32(m, old, val) != old);
23 #include <asm/cmpxchg-xchg.h>
25 #endif /* __ASM_SH_CMPXCHG_CAS_H */