xref: /titanic_41/usr/src/lib/libtnfctl/i386_assm.s (revision 2449e17f82f6097fd2c665b64723e31ceecbeca6)
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, Version 1.0 only
6 * (the "License").  You may not use this file except in compliance
7 * with the License.
8 *
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
13 *
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 *
20 * CDDL HEADER END
21 */
22/*
23 * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
24 * Use is subject to license terms.
25 */
26
27/*
28 * The following c routine has appropriate interface semantics
29 * for the chaining combination template.  On the sparc architecture
30 * the assembly routine is further tuned to make it tail recursive.
31 *
32 * void
33 * prb_chain_entry(void *a, void *b, void *c)
34 * {
35 * 	prb_chain_down(a, b, c);
36 * 	prb_chain_next(a, b, c);
37 * }
38 */
39
40	.ident	"%Z%%M%	%I%	%E% SMI"
41	.file	"%M%"
42	.data
43	.align	4
44	.globl	prb_callinfo
45prb_callinfo:
46	.4byte	1		/* offset */
47	.4byte	0		/* shift right */
48	.4byte	0xffffffff	/* mask */
49
50	.text
51	.align	4
52	.globl	prb_chain_entry
53	.globl	prb_chain_down
54	.local	chain_down
55	.globl	prb_chain_next
56	.local	chain_next
57	.globl	prb_chain_end
58prb_chain_entry:
59#if defined(__amd64)
60	/* XX64 -- fix me */
61#else
62	pushl	%ebp
63	movl	%esp, %ebp
64	pushl	%edi
65	pushl	%esi
66	pushl	%ebx
67	movl	16(%ebp), %ebx
68	pushl	%ebx
69	movl	12(%ebp), %edi
70	pushl	%edi
71	movl	8(%ebp), %esi
72	pushl	%esi
73#endif
74prb_chain_down:
75chain_down:
76#if defined(__amd64)
77	/* XX64 -- fix me */
78#else
79	call	chain_down
80	addl	$12, %esp
81	pushl	%ebx
82	pushl	%edi
83	pushl	%esi
84#endif
85prb_chain_next:
86chain_next:
87#if defined(__amd64)
88	/* XX64 -- fix me */
89#else
90	call	chain_next
91	addl	$12, %esp
92	popl	%ebx
93	popl	%esi
94	popl	%edi
95	leave
96#endif
97	ret
98prb_chain_end:
99	nop
100