1 /* Copyright (C) 2006-2018 Free Software Foundation, Inc.
3 This file is part of GDB.
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.
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.
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/>. */
19 #define ARCH_TDESC_H 1
23 struct tdesc_type_builtin
;
24 struct tdesc_type_vector
;
25 struct tdesc_type_with_fields
;
29 /* Allocate a new target_desc. */
30 target_desc
*allocate_target_description (void);
32 /* Set TARGET_DESC's architecture by NAME. */
33 void set_tdesc_architecture (target_desc
*target_desc
,
36 /* Set TARGET_DESC's osabi by NAME. */
37 void set_tdesc_osabi (target_desc
*target_desc
, const char *name
);
39 /* Return the type associated with ID in the context of FEATURE, or
41 struct tdesc_type
*tdesc_named_type (const struct tdesc_feature
*feature
,
44 /* Return the created feature named NAME in target description TDESC. */
45 struct tdesc_feature
*tdesc_create_feature (struct target_desc
*tdesc
,
47 const char *xml
= nullptr);
50 /* Return the created vector tdesc_type named NAME in FEATURE. */
51 struct tdesc_type
*tdesc_create_vector (struct tdesc_feature
*feature
,
53 struct tdesc_type
*field_type
,
56 /* Return the created struct tdesc_type named NAME in FEATURE. */
57 tdesc_type_with_fields
*tdesc_create_struct (struct tdesc_feature
*feature
,
60 /* Return the created union tdesc_type named NAME in FEATURE. */
61 tdesc_type_with_fields
*tdesc_create_union (struct tdesc_feature
*feature
,
64 /* Return the created flags tdesc_type named NAME in FEATURE. */
65 tdesc_type_with_fields
*tdesc_create_flags (struct tdesc_feature
*feature
,
69 /* Add a new field to TYPE. FIELD_NAME is its name, and FIELD_TYPE is
71 void tdesc_add_field (tdesc_type_with_fields
*type
, const char *field_name
,
72 struct tdesc_type
*field_type
);
74 /* Set the total length of TYPE. Structs which contain bitfields may
75 omit the reserved bits, so the end of the last field may not
77 void tdesc_set_struct_size (tdesc_type_with_fields
*type
, int size
);
79 /* Add a new untyped bitfield to TYPE.
80 Untyped bitfields become either uint32 or uint64 depending on the size
81 of the underlying type. */
82 void tdesc_add_bitfield (tdesc_type_with_fields
*type
, const char *field_name
,
85 /* A flag is just a typed(bool) single-bit bitfield.
86 This function is kept to minimize changes in generated files. */
87 void tdesc_add_flag (tdesc_type_with_fields
*type
, int start
,
88 const char *flag_name
);
90 /* Create a register in feature FEATURE. */
91 void tdesc_create_reg (struct tdesc_feature
*feature
, const char *name
,
92 int regnum
, int save_restore
, const char *group
,
93 int bitsize
, const char *type
);
95 #endif /* ARCH_TDESC_H */
This page took 0.033007 seconds and 4 git commands to generate.