Split tdesc_type into multiple classes
[deliverable/binutils-gdb.git] / gdb / features / i386 / 32bit-mpx.c
1 /* THIS FILE IS GENERATED. -*- buffer-read-only: t -*- vi:set ro:
2 Original: 32bit-mpx.xml */
3
4 #include "arch/tdesc.h"
5
6 static int
7 create_feature_i386_32bit_mpx (struct target_desc *result, long regnum)
8 {
9 struct tdesc_feature *feature;
10
11 feature = tdesc_create_feature (result, "org.gnu.gdb.i386.mpx", "32bit-mpx.xml");
12 tdesc_type_with_fields *type_with_fields;
13 tdesc_type *field_type;
14 type_with_fields = tdesc_create_struct (feature, "br128");
15 field_type = tdesc_named_type (feature, "uint64");
16 tdesc_add_field (type_with_fields, "lbound", field_type);
17 field_type = tdesc_named_type (feature, "uint64");
18 tdesc_add_field (type_with_fields, "ubound_raw", field_type);
19
20 type_with_fields = tdesc_create_struct (feature, "_bndstatus");
21 tdesc_set_struct_size (type_with_fields, 8);
22 tdesc_add_bitfield (type_with_fields, "bde", 2, 31);
23 tdesc_add_bitfield (type_with_fields, "error", 0, 1);
24
25 type_with_fields = tdesc_create_union (feature, "status");
26 field_type = tdesc_named_type (feature, "data_ptr");
27 tdesc_add_field (type_with_fields, "raw", field_type);
28 field_type = tdesc_named_type (feature, "_bndstatus");
29 tdesc_add_field (type_with_fields, "status", field_type);
30
31 type_with_fields = tdesc_create_struct (feature, "_bndcfgu");
32 tdesc_set_struct_size (type_with_fields, 8);
33 tdesc_add_bitfield (type_with_fields, "base", 12, 31);
34 tdesc_add_bitfield (type_with_fields, "reserved", 2, 11);
35 tdesc_add_bitfield (type_with_fields, "preserved", 1, 1);
36 tdesc_add_bitfield (type_with_fields, "enabled", 0, 0);
37
38 type_with_fields = tdesc_create_union (feature, "cfgu");
39 field_type = tdesc_named_type (feature, "data_ptr");
40 tdesc_add_field (type_with_fields, "raw", field_type);
41 field_type = tdesc_named_type (feature, "_bndcfgu");
42 tdesc_add_field (type_with_fields, "config", field_type);
43
44 tdesc_create_reg (feature, "bnd0raw", regnum++, 1, NULL, 128, "br128");
45 tdesc_create_reg (feature, "bnd1raw", regnum++, 1, NULL, 128, "br128");
46 tdesc_create_reg (feature, "bnd2raw", regnum++, 1, NULL, 128, "br128");
47 tdesc_create_reg (feature, "bnd3raw", regnum++, 1, NULL, 128, "br128");
48 tdesc_create_reg (feature, "bndcfgu", regnum++, 1, NULL, 64, "cfgu");
49 tdesc_create_reg (feature, "bndstatus", regnum++, 1, NULL, 64, "status");
50 return regnum;
51 }
This page took 0.032975 seconds and 4 git commands to generate.