Commit 9407913f authored by Joe Perches's avatar Joe Perches Committed by Ingo Molnar

include/asm-x86/futex.h: checkpatch cleanups - formatting only

Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 4637bc07
...@@ -12,35 +12,32 @@ ...@@ -12,35 +12,32 @@
#include <asm/uaccess.h> #include <asm/uaccess.h>
#define __futex_atomic_op1(insn, ret, oldval, uaddr, oparg) \ #define __futex_atomic_op1(insn, ret, oldval, uaddr, oparg) \
__asm__ __volatile( \ asm volatile("1:\t" insn "\n" \
"1: " insn "\n" \ "2:\t.section .fixup,\"ax\"\n" \
"2: .section .fixup,\"ax\"\n \ "3:\tmov\t%3, %1\n" \
3: mov %3, %1\n \ "\tjmp\t2b\n" \
jmp 2b\n \ "\t.previous\n" \
.previous\n" \ _ASM_EXTABLE(1b, 3b) \
_ASM_EXTABLE(1b,3b) \ : "=r" (oldval), "=r" (ret), "+m" (*uaddr) \
: "=r" (oldval), "=r" (ret), "+m" (*uaddr) \ : "i" (-EFAULT), "0" (oparg), "1" (0))
: "i" (-EFAULT), "0" (oparg), "1" (0))
#define __futex_atomic_op2(insn, ret, oldval, uaddr, oparg) \ #define __futex_atomic_op2(insn, ret, oldval, uaddr, oparg) \
__asm__ __volatile( \ asm volatile("1:\tmovl %2, %0\n" \
"1: movl %2, %0\n \ "\tmovl\t%0, %3\n" \
movl %0, %3\n" \ "\t" insn "\n" \
insn "\n" \ "2:\tlock; cmpxchgl %3, %2\n" \
"2: lock; cmpxchgl %3, %2\n \ "\tjnz\t1b\n" \
jnz 1b\n \ "3:\t.section .fixup,\"ax\"\n" \
3: .section .fixup,\"ax\"\n \ "4:\tmov\t%5, %1\n" \
4: mov %5, %1\n \ "\tjmp\t3b\n" \
jmp 3b\n \ "\t.previous\n" \
.previous\n" \ _ASM_EXTABLE(1b, 4b) \
_ASM_EXTABLE(1b,4b) \ _ASM_EXTABLE(2b, 4b) \
_ASM_EXTABLE(2b,4b) \ : "=&a" (oldval), "=&r" (ret), \
: "=&a" (oldval), "=&r" (ret), "+m" (*uaddr), \ "+m" (*uaddr), "=&r" (tem) \
"=&r" (tem) \ : "r" (oparg), "i" (-EFAULT), "1" (0))
: "r" (oparg), "i" (-EFAULT), "1" (0))
static inline int futex_atomic_op_inuser(int encoded_op, int __user *uaddr)
static inline int
futex_atomic_op_inuser(int encoded_op, int __user *uaddr)
{ {
int op = (encoded_op >> 28) & 7; int op = (encoded_op >> 28) & 7;
int cmp = (encoded_op >> 24) & 15; int cmp = (encoded_op >> 24) & 15;
...@@ -87,20 +84,33 @@ futex_atomic_op_inuser(int encoded_op, int __user *uaddr) ...@@ -87,20 +84,33 @@ futex_atomic_op_inuser(int encoded_op, int __user *uaddr)
if (!ret) { if (!ret) {
switch (cmp) { switch (cmp) {
case FUTEX_OP_CMP_EQ: ret = (oldval == cmparg); break; case FUTEX_OP_CMP_EQ:
case FUTEX_OP_CMP_NE: ret = (oldval != cmparg); break; ret = (oldval == cmparg);
case FUTEX_OP_CMP_LT: ret = (oldval < cmparg); break; break;
case FUTEX_OP_CMP_GE: ret = (oldval >= cmparg); break; case FUTEX_OP_CMP_NE:
case FUTEX_OP_CMP_LE: ret = (oldval <= cmparg); break; ret = (oldval != cmparg);
case FUTEX_OP_CMP_GT: ret = (oldval > cmparg); break; break;
default: ret = -ENOSYS; case FUTEX_OP_CMP_LT:
ret = (oldval < cmparg);
break;
case FUTEX_OP_CMP_GE:
ret = (oldval >= cmparg);
break;
case FUTEX_OP_CMP_LE:
ret = (oldval <= cmparg);
break;
case FUTEX_OP_CMP_GT:
ret = (oldval > cmparg);
break;
default:
ret = -ENOSYS;
} }
} }
return ret; return ret;
} }
static inline int static inline int futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval,
futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval) int newval)
{ {
#if defined(CONFIG_X86_32) && !defined(CONFIG_X86_BSWAP) #if defined(CONFIG_X86_32) && !defined(CONFIG_X86_BSWAP)
...@@ -112,16 +122,15 @@ futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval) ...@@ -112,16 +122,15 @@ futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval)
if (!access_ok(VERIFY_WRITE, uaddr, sizeof(int))) if (!access_ok(VERIFY_WRITE, uaddr, sizeof(int)))
return -EFAULT; return -EFAULT;
__asm__ __volatile__( asm volatile("1:\tlock; cmpxchgl %3, %1\n"
"1: lock; cmpxchgl %3, %1 \n" "2:\t.section .fixup, \"ax\"\n"
"2: .section .fixup, \"ax\" \n" "3:\tmov %2, %0\n"
"3: mov %2, %0 \n" "\tjmp 2b\n"
" jmp 2b \n" "\t.previous\n"
" .previous \n" _ASM_EXTABLE(1b, 3b)
_ASM_EXTABLE(1b,3b) : "=a" (oldval), "+m" (*uaddr)
: "=a" (oldval), "+m" (*uaddr) : "i" (-EFAULT), "r" (newval), "0" (oldval)
: "i" (-EFAULT), "r" (newval), "0" (oldval) : "memory"
: "memory"
); );
return oldval; return oldval;
......
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