xref: /titanic_50/usr/src/lib/libsaveargs/common/saveargs.h (revision 702941cd97e30d600c2c1275823bc58231b2c361)
1*702941cdSRichard Lowe /*
2*702941cdSRichard Lowe  * CDDL HEADER START
3*702941cdSRichard Lowe  *
4*702941cdSRichard Lowe  * The contents of this file are subject to the terms of the
5*702941cdSRichard Lowe  * Common Development and Distribution License (the "License").
6*702941cdSRichard Lowe  * You may not use this file except in compliance with the License.
7*702941cdSRichard Lowe  *
8*702941cdSRichard Lowe  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*702941cdSRichard Lowe  * or http://www.opensolaris.org/os/licensing.
10*702941cdSRichard Lowe  * See the License for the specific language governing permissions
11*702941cdSRichard Lowe  * and limitations under the License.
12*702941cdSRichard Lowe  *
13*702941cdSRichard Lowe  * When distributing Covered Code, include this CDDL HEADER in each
14*702941cdSRichard Lowe  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*702941cdSRichard Lowe  * If applicable, add the following below this CDDL HEADER, with the
16*702941cdSRichard Lowe  * fields enclosed by brackets "[]" replaced with your own identifying
17*702941cdSRichard Lowe  * information: Portions Copyright [yyyy] [name of copyright owner]
18*702941cdSRichard Lowe  *
19*702941cdSRichard Lowe  * CDDL HEADER END
20*702941cdSRichard Lowe  */
21*702941cdSRichard Lowe /*
22*702941cdSRichard Lowe  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
23*702941cdSRichard Lowe  * Use is subject to license terms.
24*702941cdSRichard Lowe  */
25*702941cdSRichard Lowe 
26*702941cdSRichard Lowe #ifndef	_SAVEARGS_H
27*702941cdSRichard Lowe #define	_SAVEARGS_H
28*702941cdSRichard Lowe 
29*702941cdSRichard Lowe #ifdef __cplusplus
30*702941cdSRichard Lowe extern "C" {
31*702941cdSRichard Lowe #endif
32*702941cdSRichard Lowe 
33*702941cdSRichard Lowe #include <sys/types.h>
34*702941cdSRichard Lowe 
35*702941cdSRichard Lowe /*
36*702941cdSRichard Lowe  * The longest instruction sequence in bytes before all 6 arguments are
37*702941cdSRichard Lowe  * saved on the stack.  This value depends on compiler implementation,
38*702941cdSRichard Lowe  * therefore it should be examined periodically to guarantee accuracy.
39*702941cdSRichard Lowe  */
40*702941cdSRichard Lowe #define	SAVEARGS_INSN_SEQ_LEN	256
41*702941cdSRichard Lowe 
42*702941cdSRichard Lowe #define	SAVEARGS_NO_ARGS	0	/* no saved arguments */
43*702941cdSRichard Lowe #define	SAVEARGS_TRAD_ARGS	1	/* traditionally located arguments */
44*702941cdSRichard Lowe #define	SAVEARGS_STRUCT_ARGS	2	/* struct return addr pushed as arg0 */
45*702941cdSRichard Lowe 
46*702941cdSRichard Lowe int saveargs_has_args(uint8_t *, size_t, uint_t, int);
47*702941cdSRichard Lowe 
48*702941cdSRichard Lowe #ifdef __cplusplus
49*702941cdSRichard Lowe }
50*702941cdSRichard Lowe #endif
51*702941cdSRichard Lowe 
52*702941cdSRichard Lowe #endif	/* _SAVEARGS_H */
53