diff options
author | Heiko Carstens <heiko.carstens@de.ibm.com> | 2012-09-17 09:37:13 +0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2012-09-26 17:45:25 +0400 |
commit | b1d6b40cbd0d6ff475b6a0a7a807a1e3bee7c033 (patch) | |
tree | cbf954a69355fcee23cc775d0f0fef06ab37c8e6 /arch/s390/include/asm/percpu.h | |
parent | ba6f5c2a8da8f7d6e14702d8c9b99b5767f6db49 (diff) | |
download | linux-b1d6b40cbd0d6ff475b6a0a7a807a1e3bee7c033.tar.xz |
s390/cmpxchg,percpu: implement cmpxchg_double()
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/include/asm/percpu.h')
-rw-r--r-- | arch/s390/include/asm/percpu.h | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/arch/s390/include/asm/percpu.h b/arch/s390/include/asm/percpu.h index 964e7ee872f7..86fe0ee2cee5 100644 --- a/arch/s390/include/asm/percpu.h +++ b/arch/s390/include/asm/percpu.h @@ -67,7 +67,7 @@ #define this_cpu_xor_4(pcp, val) arch_this_cpu_to_op(pcp, val, ^) #define this_cpu_xor_8(pcp, val) arch_this_cpu_to_op(pcp, val, ^) -#define arch_this_cpu_cmpxchg(pcp, oval, nval) \ +#define arch_this_cpu_cmpxchg(pcp, oval, nval) \ ({ \ typedef typeof(pcp) pcp_op_T__; \ pcp_op_T__ ret__; \ @@ -108,6 +108,26 @@ #define this_cpu_xchg_8(pcp, nval) arch_this_cpu_xchg(pcp, nval) #endif +#define arch_this_cpu_cmpxchg_double(pcp1, pcp2, o1, o2, n1, n2) \ +({ \ + typeof(pcp1) o1__ = (o1), n1__ = (n1); \ + typeof(pcp2) o2__ = (o2), n2__ = (n2); \ + typeof(pcp1) *p1__; \ + typeof(pcp2) *p2__; \ + int ret__; \ + preempt_disable(); \ + p1__ = __this_cpu_ptr(&(pcp1)); \ + p2__ = __this_cpu_ptr(&(pcp2)); \ + ret__ = __cmpxchg_double(p1__, p2__, o1__, o2__, n1__, n2__); \ + preempt_enable(); \ + ret__; \ +}) + +#define this_cpu_cmpxchg_double_4 arch_this_cpu_cmpxchg_double +#ifdef CONFIG_64BIT +#define this_cpu_cmpxchg_double_8 arch_this_cpu_cmpxchg_double +#endif + #include <asm-generic/percpu.h> #endif /* __ARCH_S390_PERCPU__ */ |