Commit 19f7f130 authored by Kir Kolyshkin's avatar Kir Kolyshkin Committed by Pavel Emelyanov

ppc asm/bitops.h: fix for clang

clang-3.8 fails to compile inline asm having ldarx with 4 args.

Quoting [1]:
'''
Recent versions of the PowerPC architecture added a hint bit to the larx
instructions to differentiate between an atomic operation and a lock
operation:

> 0 Other programs might attempt to modify the word in storage addressed by EA
> even if the subsequent Store Conditional succeeds.
>
> 1 Other programs will not attempt to modify the word in storage addressed by
> EA until the program that has acquired the lock performs a subsequent
> store releasing the lock.
'''

I also found some more info about this in [2].

Anyway, we could either construct some preprocessor logic to omit this
argument for clang, or just drop it. This patch does the latter.

[1] https://patchwork.ozlabs.org/patch/45008/
[2] https://sourceware.org/ml/libc-alpha/2015-03/msg00085.html

travis-ci: success for PPC+clang compile fixes
Cc: Laurent Dufour <ldufour@linux.vnet.ibm.com>
Signed-off-by: 's avatarKir Kolyshkin <kir@openvz.org>
Acked-by: 's avatarLaurent Dufour <ldufour@linux.vnet.ibm.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent 22ecc7d5
...@@ -68,7 +68,7 @@ static __inline__ void fn(unsigned long mask, \ ...@@ -68,7 +68,7 @@ static __inline__ void fn(unsigned long mask, \
unsigned long old; \ unsigned long old; \
unsigned long *p = (unsigned long *)_p; \ unsigned long *p = (unsigned long *)_p; \
__asm__ __volatile__ ( \ __asm__ __volatile__ ( \
"1: ldarx %0,0,%3,0\n" \ "1: ldarx %0,0,%3\n" \
stringify_in_c(op) "%0,%0,%2\n" \ stringify_in_c(op) "%0,%0,%2\n" \
"stdcx. %0,0,%3\n" \ "stdcx. %0,0,%3\n" \
"bne- 1b\n" \ "bne- 1b\n" \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment