123456789101112131415161718192021222324252627282930313233343536373839 |
- #include "pthreadP.h"
- int
- pthread_spin_lock (pthread_spinlock_t *lock)
- {
- __asm__ __volatile__
- ("1: ldstub [%0], %%g2\n"
- " orcc %%g2, 0x0, %%g0\n"
- " bne,a 2f\n"
- " ldub [%0], %%g2\n"
- ".subsection 2\n"
- "2: orcc %%g2, 0x0, %%g0\n"
- " bne,a 2b\n"
- " ldub [%0], %%g2\n"
- " b,a 1b\n"
- ".previous"
- :
- : "r" (lock)
- : "g2", "memory", "cc");
- return 0;
- }
|