1 /* SPDX-License-Identifier: GPL-2.0 */
2 // Copyright (C) 2018 Hangzhou C-SKY Microsystems co.,ltd.
4 #include <linux/linkage.h>
10 * int csky_cmpxchg(int oldval, int newval, int *ptr)
12 * If *ptr != oldval && return 1,
13 * else *ptr = newval return 0.
28 #ifdef CONFIG_CPU_HAS_LDSTEX
59 #ifndef CONFIG_CPU_HAS_LDSTEX
61 * Called from tlbmodified exception
63 ENTRY(csky_cmpxchg_fixup)
69 stw a1, (sp, LSAVE_PC)
72 END(csky_cmpxchg_fixup)