futex.patch 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. diff -Nur linux-3.10-nds32.orig/arch/nds32/include/asm/futex.h linux-3.10-nds32/arch/nds32/include/asm/futex.h
  2. --- linux-3.10-nds32.orig/arch/nds32/include/asm/futex.h 2017-07-31 07:41:18.000000000 +0200
  3. +++ linux-3.10-nds32/arch/nds32/include/asm/futex.h 2019-10-15 22:59:44.514997184 +0200
  4. @@ -24,10 +24,10 @@
  5. #define __futex_atomic_op(insn, ret, oldval, tmp, uaddr, oparg) \
  6. smp_mb(); \
  7. asm volatile( \
  8. - " movi $r15, #0\n" \
  9. - "1: llw %1, [%2+$r15]\n" \
  10. + " movi $ta, #0\n" \
  11. + "1: llw %1, [%2+$ta]\n" \
  12. " " insn "\n" \
  13. - "2: scw %0, [%2+$r15]\n" \
  14. + "2: scw %0, [%2+$ta]\n" \
  15. " beqz %0, 1b\n" \
  16. " movi %0, #0\n" \
  17. "3:\n" \
  18. @@ -47,18 +47,18 @@
  19. smp_mb();
  20. asm volatile(
  21. - " movi $r15, #0\n"
  22. - "1: llw %1, [%6 + $r15]\n"
  23. + " movi $ta, #0\n"
  24. + "1: llw %1, [%6 + $ta]\n"
  25. " sub %3, %1, %4\n"
  26. " cmovz %2, %5, %3\n"
  27. " cmovn %2, %1, %3\n"
  28. - "2: scw %2, [%6 + $r15]\n"
  29. + "2: scw %2, [%6 + $ta]\n"
  30. " beqz %2, 1b\n"
  31. "3:\n "
  32. __futex_atomic_ex_table("%7")
  33. : "+&r" (ret), "=&r" (val), "=&r" (tmp), "=&r" (flags)
  34. : "r" (oldval), "r" (newval), "r" (uaddr), "i" (-EFAULT)
  35. - : "$r15", "memory");
  36. + : "$ta", "memory");
  37. smp_mb();
  38. *uval = val;