xref: /titanic_41/usr/src/lib/libc/amd64/threads/amd64.il (revision cc52cd5b16ec3b8334f7db84aa4d148f1e4391d3)
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	.inline	_curthread, 0
28	movq	%fs:0, %rax
29	.end
30
31	.inline	__curthread, 0
32	movq	%fs:0, %rax
33	.end
34
35	.inline	stkptr, 0
36	movq	%rsp, %rax
37	.end
38
39	.inline	gethrtime, 0
40	movl	$3, %eax
41	int	$0xd2
42	.end
43
44	.inline	set_lock_byte, 0
45	movl	$1, %eax
46	xchgb	%al, (%rdi)
47	.end
48
49	.inline	cas32, 0
50	movl	%esi, %eax
51	lock
52	cmpxchgl %edx, (%rdi)
53	.end
54
55	.inline	swap32, 0
56	movl	%esi, %eax
57	xchgl	(%rdi), %eax
58	.end
59
60	.inline	incr32, 0
61	lock
62	incl	(%rdi)
63	.end
64
65	.inline	decr32, 0
66	lock
67	decl	(%rdi)
68	.end
69
70	.inline ht_pause, 0
71	rep			/ "rep nop" is equivalent to "pause"
72	nop
73	.end
74