Merge from vendor branch OPENSSL:
[dragonfly.git] / test / sysperf / mtx.s
1                 /*
2                  * $DragonFly: src/test/sysperf/mtx.s,v 1.1 2003/08/12 02:29:44 dillon Exp $
3                  */
4                 .text
5                 .globl  get_mtx
6                 .globl  rel_mtx
7
8 get_mtx:
9                 movl    mtx,%edx
10                 movl    4(%esp),%ecx
11 1:              subl    %eax,%eax
12                 lock cmpxchgl %ecx,(%edx)
13                 jnz     1b
14                 ret
15
16 rel_mtx:
17                 movl    mtx,%edx
18                 movl $0,(%edx)
19                 ret