Commit | Line | Data |
---|---|---|
f49ff000 YQ |
1 | /* Copyright (C) 2006-2017 Free Software Foundation, Inc. |
2 | ||
3 | This file is part of GDB. | |
4 | ||
5 | This program is free software; you can redistribute it and/or modify | |
6 | it under the terms of the GNU General Public License as published by | |
7 | the Free Software Foundation; either version 3 of the License, or | |
8 | (at your option) any later version. | |
9 | ||
10 | This program 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 | |
13 | GNU General Public License for more details. | |
14 | ||
15 | You should have received a copy of the GNU General Public License | |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. */ | |
17 | ||
18 | #ifndef ARCH_TDESC_H | |
19 | #define ARCH_TDESC_H 1 | |
20 | ||
21 | struct tdesc_feature; | |
22 | struct tdesc_type; | |
23 | struct tdesc_reg; | |
24 | struct target_desc; | |
25 | ||
26 | /* Return the type associated with ID in the context of FEATURE, or | |
27 | NULL if none. */ | |
28 | struct tdesc_type *tdesc_named_type (const struct tdesc_feature *feature, | |
29 | const char *id); | |
30 | ||
31 | /* Return the created feature named NAME in target description TDESC. */ | |
32 | struct tdesc_feature *tdesc_create_feature (struct target_desc *tdesc, | |
33 | const char *name); | |
34 | ||
35 | /* Return the created vector tdesc_type named NAME in FEATURE. */ | |
36 | struct tdesc_type *tdesc_create_vector (struct tdesc_feature *feature, | |
37 | const char *name, | |
38 | struct tdesc_type *field_type, | |
39 | int count); | |
40 | ||
41 | /* Return the created struct tdesc_type named NAME in FEATURE. */ | |
42 | struct tdesc_type *tdesc_create_struct (struct tdesc_feature *feature, | |
43 | const char *name); | |
44 | ||
45 | /* Return the created union tdesc_type named NAME in FEATURE. */ | |
46 | struct tdesc_type *tdesc_create_union (struct tdesc_feature *feature, | |
47 | const char *name); | |
48 | ||
49 | /* Return the created flags tdesc_type named NAME in FEATURE. */ | |
50 | struct tdesc_type *tdesc_create_flags (struct tdesc_feature *feature, | |
51 | const char *name, | |
52 | int size); | |
53 | ||
54 | /* Add a new field to TYPE. FIELD_NAME is its name, and FIELD_TYPE is | |
55 | its type. */ | |
56 | void tdesc_add_field (struct tdesc_type *type, const char *field_name, | |
57 | struct tdesc_type *field_type); | |
58 | ||
59 | /* Set the total length of TYPE. Structs which contain bitfields may | |
60 | omit the reserved bits, so the end of the last field may not | |
61 | suffice. */ | |
62 | void tdesc_set_struct_size (struct tdesc_type *type, int size); | |
63 | ||
64 | /* Add a new untyped bitfield to TYPE. | |
65 | Untyped bitfields become either uint32 or uint64 depending on the size | |
66 | of the underlying type. */ | |
67 | void tdesc_add_bitfield (struct tdesc_type *type, const char *field_name, | |
68 | int start, int end); | |
69 | ||
70 | /* A flag is just a typed(bool) single-bit bitfield. | |
71 | This function is kept to minimize changes in generated files. */ | |
72 | void tdesc_add_flag (struct tdesc_type *type, int start, | |
73 | const char *flag_name); | |
74 | ||
75 | /* Create a register in feature FEATURE. */ | |
76 | void tdesc_create_reg (struct tdesc_feature *feature, const char *name, | |
77 | int regnum, int save_restore, const char *group, | |
78 | int bitsize, const char *type); | |
79 | ||
80 | #endif /* ARCH_TDESC_H */ |