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.
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.
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]
23 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #ifndef _IA32_SYS_ASM_LINKAGE_H
28 #define _IA32_SYS_ASM_LINKAGE_H
30 #include <sys/stack.h>
33 #if defined(__linux__) && defined(CONFIG_SLS)
43 #ifdef _ASM /* The remainder of this file is only for assembly files */
46 * make annoying differences in assembler syntax go away
50 * D16 and A16 are used to insert instructions prefixes; the
51 * macros help the assembler code be slightly more portable.
53 #if !defined(__GNUC_AS__)
55 * /usr/ccs/bin/as prefixes are parsed as separate instructions
61 * (There are some weird constructs in constant expressions)
63 #define _CONST(const) [const]
64 #define _BITNOT(const) -1!_CONST(const)
65 #define _MUL(a, b) _CONST(a \* b)
69 * Why not use the 'data16' and 'addr16' prefixes .. well, the
70 * assembler doesn't quite believe in real mode, and thus argues with
71 * us about what we're trying to do.
73 #define D16 .byte 0x66;
74 #define A16 .byte 0x67;
76 #define _CONST(const) (const)
77 #define _BITNOT(const) ~_CONST(const)
78 #define _MUL(a, b) _CONST(a * b)
83 * C pointers are different sizes between i386 and amd64.
84 * These constants can be used to compute offsets into pointer arrays.
97 * Since we know we're either ILP32 or LP64 ..
99 #define CPTRSHIFT CLONGSHIFT
100 #define CPTRSIZE CLONGSIZE
101 #define CPTRMASK CLONGMASK
103 #if CPTRSIZE != (1 << CPTRSHIFT) || CLONGSIZE != (1 << CLONGSHIFT)
104 #error "inconsistent shift constants"
107 #if CPTRMASK != (CPTRSIZE - 1) || CLONGMASK != (CLONGSIZE - 1)
108 #error "inconsistent mask constants"
111 #define ASM_ENTRY_ALIGN 16
114 * SSE register alignment and save areas
121 * ENTRY provides the standard procedure entry code and an easy way to
122 * insert the calls to mcount for profiling. ENTRY_NP is identical, but
123 * never calls mcount.
127 .align ASM_ENTRY_ALIGN; \
129 .type x, @function; \
132 #define ENTRY_NP(x) \
134 .align ASM_ENTRY_ALIGN; \
136 .type x, @function; \
140 * ENTRY2 is identical to ENTRY but provides two labels for the entry point.
142 #define ENTRY2(x, y) \
144 .align ASM_ENTRY_ALIGN; \
146 .type x, @function; \
147 .type y, @function; \
151 #define ENTRY_NP2(x, y) \
153 .align ASM_ENTRY_ALIGN; \
155 .type x, @function; \
156 .type y, @function; \
162 * SET_SIZE trails a function and set the size for the ELF symbol table.
164 #define SET_SIZE(x) \
173 #endif /* _IA32_SYS_ASM_LINKAGE_H */