]>
git.proxmox.com Git - mirror_zfs.git/blob - lib/libspl/include/os/freebsd/sys/ia32/asm_linkage.h
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 https://opensource.org/licenses/CDDL-1.0.
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 #if defined(__linux__) && defined(CONFIG_SLS)
36 /* Tell compiler to call assembler like Unix */
38 #define ASMABI __attribute__((sysv_abi))
42 #define SECTION_TEXT .text
43 #define SECTION_STATIC .data
49 #ifdef _ASM /* The remainder of this file is only for assembly files */
52 * make annoying differences in assembler syntax go away
56 * D16 and A16 are used to insert instructions prefixes; the
57 * macros help the assembler code be slightly more portable.
59 #if !defined(__GNUC_AS__)
61 * /usr/ccs/bin/as prefixes are parsed as separate instructions
67 * (There are some weird constructs in constant expressions)
69 #define _CONST(const) [const]
70 #define _BITNOT(const) -1!_CONST(const)
71 #define _MUL(a, b) _CONST(a \* b)
75 * Why not use the 'data16' and 'addr16' prefixes .. well, the
76 * assembler doesn't quite believe in real mode, and thus argues with
77 * us about what we're trying to do.
79 #define D16 .byte 0x66;
80 #define A16 .byte 0x67;
82 #define _CONST(const) (const)
83 #define _BITNOT(const) ~_CONST(const)
84 #define _MUL(a, b) _CONST(a * b)
89 * C pointers are different sizes between i386 and amd64.
90 * These constants can be used to compute offsets into pointer arrays.
103 * Since we know we're either ILP32 or LP64 ..
105 #define CPTRSHIFT CLONGSHIFT
106 #define CPTRSIZE CLONGSIZE
107 #define CPTRMASK CLONGMASK
109 #if CPTRSIZE != (1 << CPTRSHIFT) || CLONGSIZE != (1 << CLONGSHIFT)
110 #error "inconsistent shift constants"
113 #if CPTRMASK != (CPTRSIZE - 1) || CLONGMASK != (CLONGSIZE - 1)
114 #error "inconsistent mask constants"
117 #define ASM_ENTRY_ALIGN 16
120 * SSE register alignment and save areas
127 * ENTRY provides the standard procedure entry code and an easy way to
128 * insert the calls to mcount for profiling. ENTRY_NP is identical, but
129 * never calls mcount.
133 .balign ASM_ENTRY_ALIGN; \
137 #define ENTRY_NP(x) \
139 .balign ASM_ENTRY_ALIGN; \
143 #define ENTRY_ALIGN(x, a) \
149 #define FUNCTION(x) \
150 .type x, @function; \
154 * ENTRY2 is identical to ENTRY but provides two labels for the entry point.
156 #define ENTRY2(x, y) \
158 .balign ASM_ENTRY_ALIGN; \
163 #define ENTRY_NP2(x, y) \
165 .balign ASM_ENTRY_ALIGN; \
172 * SET_SIZE trails a function and set the size for the ELF symbol table.
184 #endif /* _IA32_SYS_ASM_LINKAGE_H */