i386: Remove CET support
[glibc.git] / sysdeps / x86 / sysdep.h
blob85d0a8c943cbb218a7ce7bee4810a8bf040d6332
1 /* Assembler macros for x86.
2 Copyright (C) 2017-2024 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, see
17 <https://www.gnu.org/licenses/>. */
19 #ifndef _X86_SYSDEP_H
20 #define _X86_SYSDEP_H 1
22 #include <sysdeps/generic/sysdep.h>
24 /* Offset for fxsave/xsave area used by _dl_runtime_resolve. Also need
25 space to preserve RCX, RDX, RSI, RDI, R8, R9 and RAX. It must be
26 aligned to 16 bytes for fxsave and 64 bytes for xsave. */
27 #define STATE_SAVE_OFFSET (8 * 7 + 8)
29 /* Save SSE, AVX, AVX512, mask and bound registers. */
30 #define STATE_SAVE_MASK \
31 ((1 << 1) | (1 << 2) | (1 << 3) | (1 << 5) | (1 << 6) | (1 << 7))
33 /* Constants for bits in __x86_string_control: */
35 /* Avoid short distance REP MOVSB. */
36 #define X86_STRING_CONTROL_AVOID_SHORT_DISTANCE_REP_MOVSB (1 << 0)
38 #ifdef __ASSEMBLER__
40 /* Syntactic details of assembler. */
42 /* ELF uses byte-counts for .align, most others use log2 of count of bytes. */
43 #define ALIGNARG(log2) 1<<log2
44 #define ASM_SIZE_DIRECTIVE(name) .size name,.-name;
46 /* Common entry 16 byte aligns. */
47 #define ENTRY(name) ENTRY_P2ALIGN (name, 4)
49 #undef END
50 #define END(name) \
51 cfi_endproc; \
52 ASM_SIZE_DIRECTIVE(name)
54 #define ENTRY_CHK(name) ENTRY (name)
55 #define END_CHK(name) END (name)
57 /* Since C identifiers are not normally prefixed with an underscore
58 on this system, the asm identifier `syscall_error' intrudes on the
59 C name space. Make sure we use an innocuous name. */
60 #define syscall_error __syscall_error
61 #define mcount _mcount
63 #undef PSEUDO_END
64 #define PSEUDO_END(name) \
65 END (name)
67 /* Local label name for asm code. */
68 #ifndef L
69 /* ELF-like local names start with `.L'. */
70 # define LOCAL_LABEL(name) .L##name
71 # define L(name) LOCAL_LABEL(name)
72 #endif
74 #define atom_text_section .section ".text.atom", "ax"
76 #endif /* __ASSEMBLER__ */
78 #endif /* _X86_SYSDEP_H */