]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/config/arm/aarch-common.h
8a1964fdf17d5e596c02d448b3f6f2e10d816aea
[thirdparty/gcc.git] / gcc / config / arm / aarch-common.h
1 /* Types shared between arm and aarch64.
2
3 Copyright (C) 2009-2024 Free Software Foundation, Inc.
4 Contributed by Arm Ltd.
5
6 This file is part of GCC.
7
8 GCC is free software; you can redistribute it and/or modify it
9 under the terms of the GNU General Public License as published
10 by the Free Software Foundation; either version 3, or (at your
11 option) any later version.
12
13 GCC is distributed in the hope that it will be useful, but WITHOUT
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
16 License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with GCC; see the file COPYING3. If not see
20 <http://www.gnu.org/licenses/>. */
21
22 #ifndef GCC_AARCH_COMMON_H
23 #define GCC_AARCH_COMMON_H
24
25 /* Enum describing the various ways that the
26 aarch*_parse_{arch,tune,cpu,extension,fmv_extension} functions can fail.
27 This way their callers can choose what kind of error to give. */
28
29 enum aarch_parse_opt_result
30 {
31 AARCH_PARSE_OK, /* Parsing was successful. */
32 AARCH_PARSE_MISSING_ARG, /* Missing argument. */
33 AARCH_PARSE_INVALID_FEATURE, /* Invalid feature modifier. */
34 AARCH_PARSE_INVALID_ARG, /* Invalid arch, tune, cpu arg. */
35 AARCH_PARSE_DUPLICATE_FEATURE /* Duplicate feature modifier. */
36 };
37
38 /* Function types -msign-return-address should sign. */
39 enum aarch_function_type {
40 /* Don't sign any function. */
41 AARCH_FUNCTION_NONE,
42 /* Non-leaf functions. */
43 AARCH_FUNCTION_NON_LEAF,
44 /* All functions. */
45 AARCH_FUNCTION_ALL
46 };
47
48 /* The key type that -msign-return-address should use. */
49 enum aarch_key_type {
50 AARCH_KEY_A,
51 AARCH_KEY_B
52 };
53
54 struct aarch_branch_protect_type
55 {
56 /* The type's name that the user passes to the branch-protection option
57 string. */
58 const char* name;
59 /* The type can only appear alone, other types should be rejected. */
60 int alone;
61 /* Function to handle the protection type and set global variables. */
62 void (*handler)(void);
63 /* A list of types that can follow this type in the option string. */
64 const struct aarch_branch_protect_type* subtypes;
65 unsigned int num_subtypes;
66 };
67
68 #endif /* GCC_AARCH_COMMON_H */