Skip to content

Commit

Permalink
[S390] fix futex_atomic_cmpxchg_inatomic
Browse files Browse the repository at this point in the history
futex_atomic_cmpxchg_inatomic has the same bug as the other
atomic futex operations: the operation needs to be done in the
user address space, not the kernel address space. Add the missing
sacf 256 & sacf 0.

Signed-off-by: Martin Schwidefsky <[email protected]>
  • Loading branch information
Martin Schwidefsky committed Jul 12, 2006
1 parent 6ab4879 commit 13492c5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions include/asm-s390/futex.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,10 @@ futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval)

if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int)))
return -EFAULT;
asm volatile(" cs %1,%4,0(%5)\n"
asm volatile(" sacf 256\n"
" cs %1,%4,0(%5)\n"
"0: lr %0,%1\n"
"1:\n"
"1: sacf 0\n"
#ifndef __s390x__
".section __ex_table,\"a\"\n"
" .align 4\n"
Expand Down

0 comments on commit 13492c5

Please sign in to comment.