Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: define local_xchg from xchg_local to atomic_long_xchg

Perf-events is now using local_t helper functions internally. There is a
use of local_xchg(). On MIPS, this is defined to xchg_local() which is
missing in asm/system.h. This patch re-defines local_xchg() in asm/local.h
to atomic_long_xchg(). Then Perf-events can pass the build.

Signed-off-by: Deng-Cheng Zhu <dengcheng.zhu@gmail.com>
To: linux-mips@linux-mips.org
Cc: a.p.zijlstra@chello.nl
Cc: paulus@samba.org
Cc: mingo@elte.hu
Cc: acme@redhat.com
Cc: jamie.iles@picochip.com
Cc: ddaney@caviumnetworks.com
Cc: matt@console-pimps.org
Patchwork: https://patchwork.linux-mips.org/patch/1687/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

authored by

Deng-Cheng Zhu and committed by
Ralf Baechle
6dbd9728 238dd317

+1 -1
+1 -1
arch/mips/include/asm/local.h
··· 117 117 118 118 #define local_cmpxchg(l, o, n) \ 119 119 ((long)cmpxchg_local(&((l)->a.counter), (o), (n))) 120 - #define local_xchg(l, n) (xchg_local(&((l)->a.counter), (n))) 120 + #define local_xchg(l, n) (atomic_long_xchg((&(l)->a), (n))) 121 121 122 122 /** 123 123 * local_add_unless - add unless the number is a given value