提交 b57838ea 编写于 作者: M Martin Schwidefsky

[S390] Fix __ctl_load/__ctl_store inline assembly constraints

__ctl_load/__ctl_store are called with either an array of unsigned long or
a single unsigned long value. Add an address operator to the "m"/"=m"
contraints to make them work for unsigned long arguments as well.
Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
上级 24d3e210
...@@ -315,14 +315,14 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size) ...@@ -315,14 +315,14 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size)
asm volatile( \ asm volatile( \
" lctlg %1,%2,0(%0)\n" \ " lctlg %1,%2,0(%0)\n" \
: : "a" (&array), "i" (low), "i" (high), \ : : "a" (&array), "i" (low), "i" (high), \
"m" (*(addrtype *)(array))); \ "m" (*(addrtype *)(&array))); \
}) })
#define __ctl_store(array, low, high) ({ \ #define __ctl_store(array, low, high) ({ \
typedef struct { char _[sizeof(array)]; } addrtype; \ typedef struct { char _[sizeof(array)]; } addrtype; \
asm volatile( \ asm volatile( \
" stctg %2,%3,0(%1)\n" \ " stctg %2,%3,0(%1)\n" \
: "=m" (*(addrtype *)(array)) \ : "=m" (*(addrtype *)(&array)) \
: "a" (&array), "i" (low), "i" (high)); \ : "a" (&array), "i" (low), "i" (high)); \
}) })
...@@ -333,14 +333,14 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size) ...@@ -333,14 +333,14 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size)
asm volatile( \ asm volatile( \
" lctl %1,%2,0(%0)\n" \ " lctl %1,%2,0(%0)\n" \
: : "a" (&array), "i" (low), "i" (high), \ : : "a" (&array), "i" (low), "i" (high), \
"m" (*(addrtype *)(array))); \ "m" (*(addrtype *)(&array))); \
}) })
#define __ctl_store(array, low, high) ({ \ #define __ctl_store(array, low, high) ({ \
typedef struct { char _[sizeof(array)]; } addrtype; \ typedef struct { char _[sizeof(array)]; } addrtype; \
asm volatile( \ asm volatile( \
" stctl %2,%3,0(%1)\n" \ " stctl %2,%3,0(%1)\n" \
: "=m" (*(addrtype *)(array)) \ : "=m" (*(addrtype *)(&array)) \
: "a" (&array), "i" (low), "i" (high)); \ : "a" (&array), "i" (low), "i" (high)); \
}) })
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册