pthread_spin_lock.S 377 B

12345678910111213141516171819202122232425
  1. /*
  2. * Copyright (C) 2017 Hangzhou C-SKY Microsystems co.,ltd.
  3. *
  4. * Licensed under the LGPL v2.1 or later, see the file COPYING.LIB
  5. * in this tarball.
  6. */
  7. #include <sysdep.h>
  8. .text
  9. .align 4
  10. ENTRY (pthread_spin_lock)
  11. mov a2, a0
  12. 1:
  13. movi a0, 0
  14. movi a1, 1
  15. trap 2 // trap 2 use to cmpxchg
  16. cmpnei a0, 0
  17. bt 1b
  18. movi a0, 0
  19. jmp r15
  20. /* TODO */
  21. END (pthread_spin_lock)