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#pragma ident "%Z%%M% %I% %E% SMI" 28 29#include <sys/asm_linkage.h> 30 31 DGDEF(__fsr_init_value) 32 .long 0 33 34 ENTRY(ret1) 35 ret 36 SET_SIZE(ret1) 37 38 ENTRY(ret2) 39 repz 40 ret 41 SET_SIZE(ret2) 42 43 ENTRY(ret3) 44 ret $0 45 SET_SIZE(ret3) 46 47 ENTRY(ret4) 48 repz 49 ret $0 50 SET_SIZE(ret4) 51 52 ENTRY(ret5) 53 pushl (%esp) 54 ret $4 55 SET_SIZE(ret5) 56 57 ENTRY(ret6) 58 pushl (%esp) 59 repz 60 ret $4 61 SET_SIZE(ret6) 62 63 ENTRY(waiting) 64 pushl %ebp 65 movl %esp, %ebp 66 movl 8(%ebp), %eax 67 movl (%eax), %eax 68 movl %ebp, %esp 69 popl %ebp 70 ret 71 SET_SIZE(waiting) 72 73 ENTRY(main) 74 pushl %ebp 75 movl %esp, %ebp 76 subl $0x4, %esp 77 movl $0x0, -4(%ebp) 78 791: 80 leal -4(%ebp), %eax 81 pushl %eax 82 call waiting 83 addl $0x4, %esp 84 85 testl %eax, %eax 86 jz 1b 87 88 movl %esp, %esi 89 90 call ret1 91 call ret2 92 call ret3 93 call ret4 94 call ret5 95 call ret6 96 97 cmpl %esp, %esi 98 jne 1f 99 100 ALTENTRY(done) 101 nop 102 SET_SIZE(done) 103 104 movl $0, %eax 105 movl %ebp, %esp 106 popl %ebp 107 ret 108 1091: 110 movl $1, %eax 111 movl %ebp, %esp 112 popl %ebp 113 ret 114 SET_SIZE(main) 115