1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __ASM_SH_CMPXCHG_LLSC_H
3 #define __ASM_SH_CMPXCHG_LLSC_H
5 static inline unsigned long xchg_u32(volatile u32
*m
, unsigned long val
)
10 __asm__
__volatile__ (
12 "movli.l @%2, %0 ! xchg_u32 \n\t"
15 "movco.l %0, @%2 \n\t"
18 : "=&z"(tmp
), "=&r" (retval
)
26 static inline unsigned long
27 __cmpxchg_u32(volatile u32
*m
, unsigned long old
, unsigned long new)
32 __asm__
__volatile__ (
34 "movli.l @%2, %0 ! __cmpxchg_u32 \n\t"
40 "movco.l %0, @%2 \n\t"
43 : "=&z" (tmp
), "=&r" (retval
)
44 : "r" (m
), "r" (old
), "r" (new)
51 #include <asm/cmpxchg-xchg.h>
53 #endif /* __ASM_SH_CMPXCHG_LLSC_H */