Pre-2.0 release, MFC firewire disk changes to properly detach SIMs.
[dragonfly.git] / test / sysperf / mtx.s
blob2ac10b6445869bf049a216c6d0c080d43091ceb3
1 /*
2 * $DragonFly: src/test/sysperf/mtx.s,v 1.2 2006/04/22 22:32:52 dillon Exp $
3 */
4 .text
5 .globl get_mtx
6 .globl rel_mtx
7 .globl try_spin_mtx
8 .globl rel_spin_mtx
10 get_mtx:
11 movl mtx,%edx
12 movl 4(%esp),%ecx
13 1: subl %eax,%eax
14 lock cmpxchgl %ecx,(%edx)
15 jnz 1b
16 ret
18 rel_mtx:
19 movl mtx,%edx
20 movl $0,(%edx)
21 ret
23 try_spin_mtx:
24 movl mtx,%edx
25 movl $1,%eax
26 xchgl %eax,(%edx)
27 ret
29 rel_spin_mtx:
30 movl mtx,%edx
31 movl $0,(%edx)
32 ret