xref: /titanic_52/usr/src/lib/libc/i386/threads/i386.il (revision a99982a76d4cc12b1e9021e88531cf425d1e7369)
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21/*
22 * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
23 * Use is subject to license terms.
24 */
25
26#pragma ident	"%Z%%M%	%I%	%E% SMI"
27
28	.inline	_curthread, 0
29	movl	%gs:0, %eax
30	.end
31
32	.inline	__curthread, 0
33	movl	%gs:0, %eax
34	.end
35
36	.inline	stkptr, 0
37	movl	%esp, %eax
38	.end
39
40	.inline	gethrtime, 0
41	movl	$3, %eax
42	int	$0xd2
43	.end
44
45	.inline	set_lock_byte, 0
46	movl	$1, %eax
47	movl	(%esp), %ecx
48	xchgb	%al, (%ecx)
49	.end
50
51	.inline	cas32, 0
52	movl	0(%esp), %edx
53	movl	4(%esp), %eax
54	movl	8(%esp), %ecx
55	lock
56	cmpxchgl %ecx, (%edx)
57	.end
58
59	.inline	swap32, 0
60	movl	0(%esp), %ecx
61	movl	4(%esp), %eax
62	xchgl	(%ecx), %eax
63	.end
64
65	.inline	incr32, 0
66	movl	0(%esp), %eax
67	lock
68	incl	(%eax)
69	.end
70
71	.inline	decr32, 0
72	movl	0(%esp), %eax
73	lock
74	decl	(%eax)
75	.end
76
77	.inline ht_pause, 0
78	rep			/ "rep nop" is equivalent to "pause"
79	nop
80	.end
81