pthread_spin_lock.S 371 B

123456789101112131415161718192021
  1. /*
  2. * Copyright (C) 2013 Synopsys, Inc. (www.synopsys.com)
  3. *
  4. * Licensed under LGPL v2.1 or later, see the file COPYING.LIB in this tarball.
  5. */
  6. #include <sysdep.h>
  7. ; int pthread_spin_lock(pthread_spinlock_t *lock)
  8. ; 1 - locked, 0 - unlocked
  9. ENTRY(pthread_spin_lock)
  10. mov_s r1, 1
  11. nop_s
  12. 1:
  13. ex r1, [r0]
  14. breq r1, 1, 1b
  15. j.d [blink]
  16. mov r0, 0
  17. END(pthread_spin_lock)