xref: /dragonfly/test/sysperf/mtx.s (revision 9dbf638f)
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
8get_mtx:
9		movl	mtx,%edx
10		movl	4(%esp),%ecx
111:		subl	%eax,%eax
12		lock cmpxchgl %ecx,(%edx)
13		jnz	1b
14		ret
15
16rel_mtx:
17		movl	mtx,%edx
18		movl $0,(%edx)
19		ret
20