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/*
23 * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
24 * Use is subject to license terms.
25 */
26
27#include <sys/asm_linkage.h>
28
29	DGDEF(__fsr_init_value)
30	.long 0
31
32	ENTRY(ret1)
33	ret
34	SET_SIZE(ret1)
35
36	ENTRY(ret2)
37	repz
38	ret
39	SET_SIZE(ret2)
40
41	ENTRY(ret3)
42	ret	$0
43	SET_SIZE(ret3)
44
45	ENTRY(ret4)
46	repz
47	ret	$0
48	SET_SIZE(ret4)
49
50	ENTRY(ret5)
51	pushl	(%esp)
52	ret	$4
53	SET_SIZE(ret5)
54
55	ENTRY(ret6)
56	pushl	(%esp)
57	repz
58	ret	$4
59	SET_SIZE(ret6)
60
61	ENTRY(waiting)
62	pushl	%ebp
63	movl	%esp, %ebp
64	movl	8(%ebp), %eax
65	movl	(%eax), %eax
66	movl	%ebp, %esp
67	popl	%ebp
68	ret
69	SET_SIZE(waiting)
70
71	ENTRY(main)
72	pushl	%ebp
73	movl	%esp, %ebp
74	subl	$0x4, %esp
75	movl	$0x0, -4(%ebp)
76
771:
78	leal	-4(%ebp), %eax
79	pushl	%eax
80	call	waiting
81	addl	$0x4, %esp
82
83	testl	%eax, %eax
84	jz	1b
85
86	movl	%esp, %esi
87
88	call	ret1
89	call	ret2
90	call	ret3
91	call	ret4
92	call	ret5
93	call	ret6
94
95	cmpl	%esp, %esi
96	jne	1f
97
98	ALTENTRY(done)
99	nop
100	SET_SIZE(done)
101
102	movl	$0, %eax
103	movl	%ebp, %esp
104	popl	%ebp
105	ret
106
1071:
108	movl	$1, %eax
109	movl	%ebp, %esp
110	popl	%ebp
111	ret
112	SET_SIZE(main)
113