projects
/
userspace-rcu.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: x86 and s390: uatomic __hp() macro clang support
[userspace-rcu.git]
/
include
/
urcu
/
uatomic
/
s390.h
diff --git
a/include/urcu/uatomic/s390.h
b/include/urcu/uatomic/s390.h
index 47b97b1da08159e26abc727679f33c9815768461..d7d545ad8f869ede493edef727233d7e9edc42ad 100644
(file)
--- a/
include/urcu/uatomic/s390.h
+++ b/
include/urcu/uatomic/s390.h
@@
-62,10
+62,11
@@
extern "C" {
#endif /* !COMPILER_HAVE_SHORT_MEM_OPERAND */
/*
#endif /* !COMPILER_HAVE_SHORT_MEM_OPERAND */
/*
- * The __hp() macro casts the void pointer
"x"
to a pointer to a structure
+ * The __hp() macro casts the void pointer
@x
to a pointer to a structure
* containing an array of char of the specified size. This allows passing the
* @addr arguments of the following inline functions as "m" and "+m" operands
* containing an array of char of the specified size. This allows passing the
* @addr arguments of the following inline functions as "m" and "+m" operands
- * to the assembly.
+ * to the assembly. The @size parameter should be a constant to support
+ * compilers such as clang which do not support VLA.
*/
#define __hp(size, x) ((struct { char v[size]; } *)(x))
*/
#define __hp(size, x) ((struct { char v[size]; } *)(x))
@@
-83,8
+84,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"
__asm__ __volatile__(
"0: cs %0,%2," MEMOP_REF(%3) "\n"
" brc 4,0b\n"
- : "=&r" (old_val), MEMOP_OUT (__hp(
len
, addr))
- : "r" (val), MEMOP_IN (__hp(
len
, addr))
+ : "=&r" (old_val), MEMOP_OUT (__hp(
4
, addr))
+ : "r" (val), MEMOP_IN (__hp(
4
, addr))
: "memory", "cc");
return old_val;
}
: "memory", "cc");
return old_val;
}
@@
-96,8
+97,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"
__asm__ __volatile__(
"0: csg %0,%2," MEMOP_REF(%3) "\n"
" brc 4,0b\n"
- : "=&r" (old_val), MEMOP_OUT (__hp(
len
, addr))
- : "r" (val), MEMOP_IN (__hp(
len
, addr))
+ : "=&r" (old_val), MEMOP_OUT (__hp(
8
, addr))
+ : "r" (val), MEMOP_IN (__hp(
8
, addr))
: "memory", "cc");
return old_val;
}
: "memory", "cc");
return old_val;
}
@@
-127,8
+128,8
@@
unsigned long _uatomic_cmpxchg(void *addr, unsigned long old,
__asm__ __volatile__(
" cs %0,%2," MEMOP_REF(%3) "\n"
__asm__ __volatile__(
" cs %0,%2," MEMOP_REF(%3) "\n"
- : "+r" (old_val), MEMOP_OUT (__hp(
len
, addr))
- : "r" (_new), MEMOP_IN (__hp(
len
, addr))
+ : "+r" (old_val), MEMOP_OUT (__hp(
4
, addr))
+ : "r" (_new), MEMOP_IN (__hp(
4
, addr))
: "memory", "cc");
return old_val;
}
: "memory", "cc");
return old_val;
}
@@
-137,8
+138,8
@@
unsigned long _uatomic_cmpxchg(void *addr, unsigned long old,
{
__asm__ __volatile__(
" csg %0,%2," MEMOP_REF(%3) "\n"
{
__asm__ __volatile__(
" csg %0,%2," MEMOP_REF(%3) "\n"
- : "+r" (old), MEMOP_OUT (__hp(
len
, addr))
- : "r" (_new), MEMOP_IN (__hp(
len
, addr))
+ : "+r" (old), MEMOP_OUT (__hp(
8
, addr))
+ : "r" (_new), MEMOP_IN (__hp(
8
, addr))
: "memory", "cc");
return old;
}
: "memory", "cc");
return old;
}
This page took
0.024526 seconds
and
4
git commands to generate.