Motr  M0
tx_desc_xc.c
Go to the documentation of this file.
1 /* This file is automatically generated from dtm0/tx_desc.h */
2 
3 #include "lib/misc.h" /* offsetof */
4 #include "lib/assert.h"
5 #include "xcode/xcode.h"
6 
7 #include "dtm0/tx_desc.h"
8 #include "dtm0/tx_desc_xc.h"
9 
14 
15 static struct _m0_dtm0_tid_s {
18 } _m0_dtm0_tid = {
19  ._type = {
21  .xct_name = "m0_dtm0_tid",
22  .xct_sizeof = sizeof (struct m0_dtm0_tid),
23  .xct_nr = 2,
25  }
26 };
27 
29 M0_BASSERT(offsetof(struct _m0_dtm0_tid_s, _child[0]) ==
30  offsetof(struct m0_xcode_type, xct_child[0]));
31 
32 static struct _m0_dtm0_tx_pa_s {
35 } _m0_dtm0_tx_pa = {
36  ._type = {
38  .xct_name = "m0_dtm0_tx_pa",
39  .xct_sizeof = sizeof (struct m0_dtm0_tx_pa),
40  .xct_nr = 2,
42  }
43 };
44 
46 M0_BASSERT(offsetof(struct _m0_dtm0_tx_pa_s, _child[0]) ==
47  offsetof(struct m0_xcode_type, xct_child[0]));
48 
53  ._type = {
55  .xct_name = "m0_dtm0_tx_participants",
56  .xct_sizeof = sizeof (struct m0_dtm0_tx_participants),
57  .xct_nr = 2,
59  }
60 };
61 
64  offsetof(struct m0_xcode_type, xct_child[0]));
65 
66 static struct _m0_dtm0_tx_desc_s {
69 } _m0_dtm0_tx_desc = {
70  ._type = {
72  .xct_name = "m0_dtm0_tx_desc",
73  .xct_sizeof = sizeof (struct m0_dtm0_tx_desc),
74  .xct_nr = 2,
76  }
77 };
78 
80 M0_BASSERT(offsetof(struct _m0_dtm0_tx_desc_s, _child[0]) ==
81  offsetof(struct m0_xcode_type, xct_child[0]));
82 
83 
84 M0_BASSERT(sizeof(struct m0_dtm0_tid) == 24U);
85 
86 M0_BASSERT(sizeof ((struct m0_dtm0_tid *)0)->dti_ts == 8U);
87 M0_BASSERT(offsetof(struct m0_dtm0_tid, dti_ts) == 0U);
88 M0_BASSERT(sizeof ((struct m0_dtm0_tid *)0)->dti_fid == 16U);
89 M0_BASSERT(offsetof(struct m0_dtm0_tid, dti_fid) == 8U);
90 
91 M0_BASSERT(sizeof(struct m0_dtm0_tx_pa) == 24U);
92 
93 M0_BASSERT(sizeof ((struct m0_dtm0_tx_pa *)0)->p_fid == 16U);
94 M0_BASSERT(offsetof(struct m0_dtm0_tx_pa, p_fid) == 0U);
95 M0_BASSERT(sizeof ((struct m0_dtm0_tx_pa *)0)->p_state == 4U);
96 M0_BASSERT(offsetof(struct m0_dtm0_tx_pa, p_state) == 16U);
97 
98 M0_BASSERT(sizeof(struct m0_dtm0_tx_participants) == 16U);
99 
100 M0_BASSERT(sizeof ((struct m0_dtm0_tx_participants *)0)->dtp_nr == 4U);
102 M0_BASSERT(sizeof ((struct m0_dtm0_tx_participants *)0)->dtp_pa == 8U);
104 
105 M0_BASSERT(sizeof(struct m0_dtm0_tx_desc) == 40U);
106 
107 M0_BASSERT(sizeof ((struct m0_dtm0_tx_desc *)0)->dtd_id == 24U);
108 M0_BASSERT(offsetof(struct m0_dtm0_tx_desc, dtd_id) == 0U);
109 M0_BASSERT(sizeof ((struct m0_dtm0_tx_desc *)0)->dtd_ps == 16U);
110 M0_BASSERT(offsetof(struct m0_dtm0_tx_desc, dtd_ps) == 24U);
111 
112 
114  { .xev_idx = 0, .xev_name = "M0_DTPS_INIT", .xev_val = 0 },
115  { .xev_idx = 1, .xev_name = "M0_DTPS_INPROGRESS", .xev_val = 1 },
116  { .xev_idx = 2, .xev_name = "M0_DTPS_EXECUTED", .xev_val = 2 },
117  { .xev_idx = 3, .xev_name = "M0_DTPS_PERSISTENT", .xev_val = 3 },
118  { .xev_idx = 4, .xev_name = "M0_DTPS_NR", .xev_val = 4 },
119  { .xev_idx = -1, .xev_name = "Invalid value of enum 'm0_dtm0_tx_pa_state'." }
120 };
121 
123  .xe_name = "m0_dtm0_tx_pa_state",
124  .xe_nr = 5,
125  .xe_val = m0_dtm0_tx_pa_state_data,
126  .xe_maxlen = 18
127 };
128 
129 M0_INTERNAL void m0_xc_m0_dtm0_tid_struct_init(void)
130 {
131  _m0_dtm0_tid._child[0] = (struct m0_xcode_field) {
132  .xf_name = "dti_ts",
133 
134  .xf_type = m0_dtm0_ts_xc,
135 
136  .xf_tag = 0,
137  .xf_opaque = NULL,
138  .xf_offset = offsetof(struct m0_dtm0_tid, dti_ts),
139  .xf_read = NULL,
140  .xf_decor = {
142  }
143  };
145 
146  _m0_dtm0_tid._child[1] = (struct m0_xcode_field) {
147  .xf_name = "dti_fid",
148 
149  .xf_type = m0_fid_xc,
150 
151  .xf_tag = 0,
152  .xf_opaque = NULL,
153  .xf_offset = offsetof(struct m0_dtm0_tid, dti_fid),
154  .xf_read = NULL,
155  .xf_decor = {
157  }
158  };
160 
162 }
163 
164 M0_INTERNAL void m0_xc_m0_dtm0_tx_pa_struct_init(void)
165 {
166  _m0_dtm0_tx_pa._child[0] = (struct m0_xcode_field) {
167  .xf_name = "p_fid",
168 
169  .xf_type = m0_fid_xc,
170 
171  .xf_tag = 0,
172  .xf_opaque = NULL,
173  .xf_offset = offsetof(struct m0_dtm0_tx_pa, p_fid),
174  .xf_read = NULL,
175  .xf_decor = {
177  }
178  };
180 
181  _m0_dtm0_tx_pa._child[1] = (struct m0_xcode_field) {
182  .xf_name = "p_state",
183 
184  .xf_type = &M0_XT_U32,
185 
186  .xf_tag = 0,
187  .xf_opaque = NULL,
188  .xf_offset = offsetof(struct m0_dtm0_tx_pa, p_state),
189  .xf_read = &m0_xcode_enum_field_read,
190  .xf_decor = {
192  }
193  };
194  m0_xc_u32_init();
195 
197 }
198 
200 {
202  .xf_name = "dtp_nr",
203 
204  .xf_type = &M0_XT_U32,
205 
206  .xf_tag = 0,
207  .xf_opaque = NULL,
208  .xf_offset = offsetof(struct m0_dtm0_tx_participants, dtp_nr),
209  .xf_read = NULL,
210  .xf_decor = {
212  }
213  };
214  m0_xc_u32_init();
215 
217  .xf_name = "dtp_pa",
218 
219  .xf_type = m0_dtm0_tx_pa_xc,
220 
221  .xf_tag = 0,
222  .xf_opaque = NULL,
223  .xf_offset = offsetof(struct m0_dtm0_tx_participants, dtp_pa),
224  .xf_read = NULL,
225  .xf_decor = {
227  }
228  };
230 
232 }
233 
234 M0_INTERNAL void m0_xc_m0_dtm0_tx_desc_struct_init(void)
235 {
236  _m0_dtm0_tx_desc._child[0] = (struct m0_xcode_field) {
237  .xf_name = "dtd_id",
238 
239  .xf_type = m0_dtm0_tid_xc,
240 
241  .xf_tag = 0,
242  .xf_opaque = NULL,
243  .xf_offset = offsetof(struct m0_dtm0_tx_desc, dtd_id),
244  .xf_read = NULL,
245  .xf_decor = {
247  }
248  };
250 
251  _m0_dtm0_tx_desc._child[1] = (struct m0_xcode_field) {
252  .xf_name = "dtd_ps",
253 
254  .xf_type = m0_dtm0_tx_participants_xc,
255 
256  .xf_tag = 0,
257  .xf_opaque = NULL,
258  .xf_offset = offsetof(struct m0_dtm0_tx_desc, dtd_ps),
259  .xf_read = NULL,
260  .xf_decor = {
262  }
263  };
265 
267 }
268 
269 M0_INTERNAL void m0_xc_dtm0_tx_desc_init(void)
270 {
275 }
276 
277 M0_INTERNAL void m0_xc_dtm0_tx_desc_fini(void)
278 {
279 }
static struct _m0_dtm0_tx_pa_s _m0_dtm0_tx_pa
const struct m0_xcode_enum_val m0_dtm0_tx_pa_state_data[]
Definition: tx_desc_xc.c:113
struct m0_xcode_field _child[2]
Definition: tx_desc_xc.c:17
struct m0_xcode_field _child[2]
Definition: tx_desc_xc.c:51
#define NULL
Definition: misc.h:38
struct m0_xcode_field _child[2]
Definition: tx_desc_xc.c:34
M0_INTERNAL void m0_xc_dtm0_tx_desc_init(void)
Definition: tx_desc_xc.c:269
struct m0_xcode_type _type
Definition: tx_desc_xc.c:50
M0_INTERNAL void m0_xc_m0_dtm0_tx_pa_struct_init(void)
Definition: tx_desc_xc.c:164
static struct _m0_dtm0_tx_participants_s _m0_dtm0_tx_participants
M0_INTERNAL void m0_xc_m0_dtm0_ts_struct_init(void)
Definition: clk_src_xc.c:37
struct m0_xcode_field xct_child[0]
Definition: xcode.h:345
struct m0_xcode_type * m0_dtm0_tx_participants_xc
Definition: tx_desc_xc.c:12
M0_INTERNAL void m0_xc_m0_fid_struct_init(void)
Definition: fid_xc.c:64
const char * xe_name
Definition: enum.h:58
struct m0_xcode_type * m0_dtm0_tx_pa_xc
Definition: tx_desc_xc.c:11
M0_INTERNAL void m0_xc_m0_dtm0_tx_desc_struct_init(void)
Definition: tx_desc_xc.c:234
M0_INTERNAL void m0_xc_m0_dtm0_tid_struct_init(void)
Definition: tx_desc_xc.c:129
#define M0_POST(cond)
struct m0_xcode_type * m0_dtm0_tx_desc_xc
Definition: tx_desc_xc.c:13
bool m0_xcode_type_invariant(const struct m0_xcode_type *xt)
Definition: xcode.c:74
struct m0_xcode_enum m0_xc_m0_dtm0_tx_pa_state_enum
Definition: tx_desc_xc.c:122
struct m0_xcode_type _type
Definition: tx_desc_xc.c:67
struct m0_xcode_field _child[2]
Definition: tx_desc_xc.c:68
struct m0_dtm0_tx_participants dtd_ps
Definition: tx_desc.h:172
struct m0_xcode_type * m0_dtm0_tid_xc
Definition: tx_desc_xc.c:10
const struct m0_xcode_type M0_XT_U32
Definition: xcode.c:932
static struct _m0_dtm0_tx_desc_s _m0_dtm0_tx_desc
enum m0_xcode_aggr xct_aggr
Definition: xcode.h:316
struct m0_xcode_type _type
Definition: tx_desc_xc.c:16
struct m0_xcode_type * m0_dtm0_ts_xc
Definition: clk_src_xc.c:10
static struct _m0_dtm0_tid_s _m0_dtm0_tid
struct m0_fid p_fid
Definition: tx_desc.h:171
void m0_xc_u32_init(void)
Definition: xcode.c:900
M0_INTERNAL void m0_xc_m0_dtm0_tx_participants_struct_init(void)
Definition: tx_desc_xc.c:199
const char * xf_name
Definition: xcode.h:251
M0_BASSERT(offsetof(struct _m0_dtm0_tid_s, _child[0])==offsetof(struct m0_xcode_type, xct_child[0]))
struct m0_xcode_type * m0_fid_xc
Definition: fid_xc.c:10
uint32_t dtp_nr
Definition: tx_desc.h:171
struct m0_fid dti_fid
Definition: tx_desc.h:172
#define offsetof(typ, memb)
Definition: misc.h:29
M0_INTERNAL void m0_xc_dtm0_tx_desc_fini(void)
Definition: tx_desc_xc.c:277
struct m0_dtm0_ts dti_ts
Definition: tx_desc.h:171
struct m0_dtm0_tid dtd_id
Definition: tx_desc.h:171
M0_INTERNAL int m0_xcode_enum_field_read(const struct m0_xcode_cursor *it, struct m0_xcode_obj *obj, const char *str)
Definition: enum.c:142
struct m0_xcode_type _type
Definition: tx_desc_xc.c:33
struct m0_dtm0_tx_pa * dtp_pa
Definition: tx_desc.h:172