From: Mathieu Desnoyers Date: Mon, 7 Dec 2009 03:26:23 +0000 (-0500) Subject: s390 uatomic arch fix X-Git-Tag: v0.3.2~3 X-Git-Url: https://git.liburcu.org/?p=urcu.git;a=commitdiff_plain;h=53b8ed6836363dc7c5a5356e01609bdaac4868e2 s390 uatomic arch fix In file included from urcu-static.h:40, from urcu.c:35: ./urcu/uatomic_arch.h: In function ‘_uatomic_exchange’: ./urcu/uatomic_arch.h:88: warning: dereferencing ‘void *’ pointer ./urcu/uatomic_arch.h:89: warning: dereferencing ‘void *’ pointer ./urcu/uatomic_arch.h:89: error: expected ‘:’ or ‘)’ before ‘(’ token ./urcu/uatomic_arch.h: In function ‘_uatomic_cmpxchg’: ./urcu/uatomic_arch.h:131: warning: dereferencing ‘void *’ pointer ./urcu/uatomic_arch.h:132: warning: dereferencing ‘void *’ pointer ./urcu/uatomic_arch.h:132: error: expected ‘:’ or ‘)’ before ‘(’ token Use same hidden pointer technique used for x86. Signed-off-by: Mathieu Desnoyers --- diff --git a/urcu/uatomic_arch_s390.h b/urcu/uatomic_arch_s390.h index c4ca056..ab7e942 100644 --- a/urcu/uatomic_arch_s390.h +++ b/urcu/uatomic_arch_s390.h @@ -69,6 +69,11 @@ #endif /* !COMPILER_HAVE_SHORT_MEM_OPERAND */ +struct __uatomic_dummy { + unsigned long v[10]; +}; +#define __hp(x) ((struct __uatomic_dummy *)(x)) + #define uatomic_set(addr, v) STORE_SHARED(*(addr), (v)) #define uatomic_read(addr) LOAD_SHARED(*(addr)) @@ -85,8 +90,8 @@ unsigned long _uatomic_exchange(volatile void *addr, unsigned long val, int len) __asm__ __volatile__( "0: cs %0,%2," MEMOP_REF(%3) "\n" " brc 4,0b\n" - : "=&r" (old_val), MEMOP_OUT (addr) - : "r" (val), MEMOP_IN (addr) + : "=&r" (old_val), MEMOP_OUT (__hp(addr)) + : "r" (val), MEMOP_IN (__hp(addr)) : "memory", "cc"); return old_val; } @@ -98,8 +103,8 @@ unsigned long _uatomic_exchange(volatile void *addr, unsigned long val, int len) __asm__ __volatile__( "0: csg %0,%2," MEMOP_REF(%3) "\n" " brc 4,0b\n" - : "=&r" (old_val), MEMOP_OUT (addr) - : "r" (val), MEMOP_IN (addr) + : "=&r" (old_val), MEMOP_OUT (__hp(addr)) + : "r" (val), MEMOP_IN (__hp(addr)) : "memory", "cc"); return old_val; } @@ -128,8 +133,8 @@ unsigned long _uatomic_cmpxchg(void *addr, unsigned long old, __asm__ __volatile__( " cs %0,%2," MEMOP_REF(%3) "\n" - : "+r" (old_val), MEMOP_OUT (addr) - : "r" (_new), MEMOP_IN (addr) + : "+r" (old_val), MEMOP_OUT (__hp(addr)) + : "r" (_new), MEMOP_IN (__hp(addr)) : "memory", "cc"); return old_val; } @@ -138,8 +143,8 @@ unsigned long _uatomic_cmpxchg(void *addr, unsigned long old, { __asm__ __volatile__( " csg %0,%2," MEMOP_REF(%3) "\n" - : "+r" (old), MEMOP_OUT (addr) - : "r" (_new), MEMOP_IN (addr) + : "+r" (old), MEMOP_OUT (__hp(addr)) + : "r" (_new), MEMOP_IN (__hp(addr)) : "memory", "cc"); return old; }