pthread_spin_lock.S 504 B

1234567891011121314151617181920
  1. ! Copyright (C) 2013 Imagination Technologies Ltd.
  2. ! Licensed under LGPL v2.1 or later, see the file COPYING.LIB in this tarball.
  3. .text
  4. .global _pthread_spin_lock
  5. .type _pthread_spin_lock,function
  6. _pthread_spin_lock:
  7. 1: LNKGETD D0Ar2, [D1Ar1]
  8. CMP D0Ar2, #0
  9. ADD D0Ar2, D0Ar2, #1
  10. LNKSETDEQ [D1Ar1], D0Ar2
  11. BNE 1b
  12. DEFR D0Ar2, TXSTAT
  13. ANDT D0Ar2, D0Ar2, #HI(0x3f000000)
  14. CMPT D0Ar2, #HI(0x02000000)
  15. BNZ 1b
  16. MOV D0Re0, #0
  17. MOV PC, D1RtP
  18. .size _pthread_spin_lock,.-_pthread_spin_lock