Motr  M0
tlist_xc.c
Go to the documentation of this file.
1 /* This file is automatically generated from lib/tlist.h */
2 
3 #include "lib/misc.h" /* offsetof */
4 #include "lib/assert.h"
5 #include "xcode/xcode.h"
6 
7 #include "lib/tlist.h"
8 #include "lib/tlist_xc.h"
9 
10 #if !defined(__KERNEL__)
12 #endif
13 #if !defined(__KERNEL__)
15 #endif
16 #if !defined(__KERNEL__)
18 #endif
19 
20 #if !defined(__KERNEL__)
21 static struct _m0_tl_descr_s {
24 } _m0_tl_descr = {
25  ._type = {
27  .xct_name = "m0_tl_descr",
28  .xct_sizeof = sizeof (struct m0_tl_descr),
29  .xct_nr = 6,
30  .xct_flags = M0_XCODE_TYPE_FLAG_DOM_BE,
31  }
32 };
33 
35 M0_BASSERT(offsetof(struct _m0_tl_descr_s, _child[0]) ==
36  offsetof(struct m0_xcode_type, xct_child[0]));
37 #endif
38 
39 #if !defined(__KERNEL__)
40 static struct _m0_tl_s {
43 } _m0_tl = {
44  ._type = {
46  .xct_name = "m0_tl",
47  .xct_sizeof = sizeof (struct m0_tl),
48  .xct_nr = 2,
49  .xct_flags = M0_XCODE_TYPE_FLAG_DOM_BE,
50  }
51 };
52 
54 M0_BASSERT(offsetof(struct _m0_tl_s, _child[0]) ==
55  offsetof(struct m0_xcode_type, xct_child[0]));
56 #endif
57 
58 #if !defined(__KERNEL__)
59 static struct _m0_tlink_s {
62 } _m0_tlink = {
63  ._type = {
65  .xct_name = "m0_tlink",
66  .xct_sizeof = sizeof (struct m0_tlink),
67  .xct_nr = 1,
68  .xct_flags = M0_XCODE_TYPE_FLAG_DOM_BE,
69  }
70 };
71 
73 M0_BASSERT(offsetof(struct _m0_tlink_s, _child[0]) ==
74  offsetof(struct m0_xcode_type, xct_child[0]));
75 #endif
76 
77 
78 #if !defined(__KERNEL__)
79 M0_BASSERT(sizeof(struct m0_tl_descr) == 40U);
80 #endif
81 
82 #if !defined(__KERNEL__)
83 M0_BASSERT(sizeof ((struct m0_tl_descr *)0)->td_name == 8U);
84 M0_BASSERT(offsetof(struct m0_tl_descr, td_name) == 0U);
85 #endif
86 #if !defined(__KERNEL__)
87 M0_BASSERT(sizeof ((struct m0_tl_descr *)0)->td_link_offset == 4U);
89 #endif
90 #if !defined(__KERNEL__)
91 M0_BASSERT(sizeof ((struct m0_tl_descr *)0)->td_link_magic_offset == 4U);
93 #endif
94 #if !defined(__KERNEL__)
95 M0_BASSERT(sizeof ((struct m0_tl_descr *)0)->td_link_magic == 8U);
97 #endif
98 #if !defined(__KERNEL__)
99 M0_BASSERT(sizeof ((struct m0_tl_descr *)0)->td_head_magic == 8U);
101 #endif
102 #if !defined(__KERNEL__)
103 M0_BASSERT(sizeof ((struct m0_tl_descr *)0)->td_container_size == 8U);
105 #endif
106 
107 #if !defined(__KERNEL__)
108 M0_BASSERT(sizeof(struct m0_tl) == 24U);
109 #endif
110 
111 #if !defined(__KERNEL__)
112 M0_BASSERT(sizeof ((struct m0_tl *)0)->t_magic == 8U);
113 M0_BASSERT(offsetof(struct m0_tl, t_magic) == 0U);
114 #endif
115 #if !defined(__KERNEL__)
116 M0_BASSERT(sizeof ((struct m0_tl *)0)->t_head == 16U);
117 M0_BASSERT(offsetof(struct m0_tl, t_head) == 8U);
118 #endif
119 
120 #if !defined(__KERNEL__)
121 M0_BASSERT(sizeof(struct m0_tlink) == 16U);
122 #endif
123 
124 #if !defined(__KERNEL__)
125 M0_BASSERT(sizeof ((struct m0_tlink *)0)->t_link == 16U);
126 M0_BASSERT(offsetof(struct m0_tlink, t_link) == 0U);
127 #endif
128 
129 
130 
131 #if !defined(__KERNEL__)
132 M0_INTERNAL void m0_xc_m0_tl_descr_struct_init(void)
133 {
134  _m0_tl_descr._child[0] = (struct m0_xcode_field) {
135  .xf_name = "td_name",
136 
137  .xf_type = &M0_XT_U64,
138 
139  .xf_tag = 0,
140  .xf_opaque = NULL,
141  .xf_offset = offsetof(struct m0_tl_descr, td_name),
142  .xf_read = NULL,
143  .xf_decor = {
145  }
146  };
147  m0_xc_u64_init();
148 
149  _m0_tl_descr._child[1] = (struct m0_xcode_field) {
150  .xf_name = "td_link_offset",
151 
152  .xf_type = &M0_XT_U32,
153 
154  .xf_tag = 0,
155  .xf_opaque = NULL,
156  .xf_offset = offsetof(struct m0_tl_descr, td_link_offset),
157  .xf_read = NULL,
158  .xf_decor = {
160  }
161  };
162  m0_xc_u32_init();
163 
164  _m0_tl_descr._child[2] = (struct m0_xcode_field) {
165  .xf_name = "td_link_magic_offset",
166 
167  .xf_type = &M0_XT_U32,
168 
169  .xf_tag = 0,
170  .xf_opaque = NULL,
171  .xf_offset = offsetof(struct m0_tl_descr, td_link_magic_offset),
172  .xf_read = NULL,
173  .xf_decor = {
175  }
176  };
177  m0_xc_u32_init();
178 
179  _m0_tl_descr._child[3] = (struct m0_xcode_field) {
180  .xf_name = "td_link_magic",
181 
182  .xf_type = &M0_XT_U64,
183 
184  .xf_tag = 0,
185  .xf_opaque = NULL,
186  .xf_offset = offsetof(struct m0_tl_descr, td_link_magic),
187  .xf_read = NULL,
188  .xf_decor = {
190  }
191  };
192  m0_xc_u64_init();
193 
194  _m0_tl_descr._child[4] = (struct m0_xcode_field) {
195  .xf_name = "td_head_magic",
196 
197  .xf_type = &M0_XT_U64,
198 
199  .xf_tag = 0,
200  .xf_opaque = NULL,
201  .xf_offset = offsetof(struct m0_tl_descr, td_head_magic),
202  .xf_read = NULL,
203  .xf_decor = {
205  }
206  };
207  m0_xc_u64_init();
208 
209  _m0_tl_descr._child[5] = (struct m0_xcode_field) {
210  .xf_name = "td_container_size",
211 
212  .xf_type = &M0_XT_U64,
213 
214  .xf_tag = 0,
215  .xf_opaque = NULL,
216  .xf_offset = offsetof(struct m0_tl_descr, td_container_size),
217  .xf_read = NULL,
218  .xf_decor = {
220  }
221  };
222  m0_xc_u64_init();
223 
225 }
226 #endif
227 
228 #if !defined(__KERNEL__)
229 M0_INTERNAL void m0_xc_m0_tl_struct_init(void)
230 {
231  _m0_tl._child[0] = (struct m0_xcode_field) {
232  .xf_name = "t_magic",
233 
234  .xf_type = &M0_XT_U64,
235 
236  .xf_tag = 0,
237  .xf_opaque = NULL,
238  .xf_offset = offsetof(struct m0_tl, t_magic),
239  .xf_read = NULL,
240  .xf_decor = {
242  }
243  };
244  m0_xc_u64_init();
245 
246  _m0_tl._child[1] = (struct m0_xcode_field) {
247  .xf_name = "t_head",
248 #ifdef __KERNEL__
249  .xf_type = &M0_XT_VOID,
250 #else
251 
252  .xf_type = m0_list_xc,
253 #endif
254  .xf_tag = 0,
255  .xf_opaque = NULL,
256  .xf_offset = offsetof(struct m0_tl, t_head),
257  .xf_read = NULL,
258  .xf_decor = {
260  }
261  };
262 #if !defined(__KERNEL__)
264 #endif
265 
267 }
268 #endif
269 
270 #if !defined(__KERNEL__)
271 M0_INTERNAL void m0_xc_m0_tlink_struct_init(void)
272 {
273  _m0_tlink._child[0] = (struct m0_xcode_field) {
274  .xf_name = "t_link",
275 #ifdef __KERNEL__
276  .xf_type = &M0_XT_VOID,
277 #else
278 
279  .xf_type = m0_list_link_xc,
280 #endif
281  .xf_tag = 0,
282  .xf_opaque = NULL,
283  .xf_offset = offsetof(struct m0_tlink, t_link),
284  .xf_read = NULL,
285  .xf_decor = {
287  }
288  };
289 #if !defined(__KERNEL__)
291 #endif
292 
294 }
295 #endif
296 
297 M0_INTERNAL void m0_xc_lib_tlist_init(void)
298 {
299 #if !defined(__KERNEL__)
301 #endif
302 #if !defined(__KERNEL__)
304 #endif
305 #if !defined(__KERNEL__)
307 #endif
308 }
309 
310 M0_INTERNAL void m0_xc_lib_tlist_fini(void)
311 {
312 }
int td_link_magic_offset
Definition: tlist.h:302
#define NULL
Definition: misc.h:38
M0_INTERNAL void m0_xc_m0_tl_struct_init(void)
Definition: tlist_xc.c:229
M0_INTERNAL void m0_xc_m0_tlink_struct_init(void)
Definition: tlist_xc.c:271
struct m0_xcode_type * m0_tl_xc
Definition: tlist_xc.c:14
struct m0_xcode_field _child[6]
Definition: tlist_xc.c:23
uint64_t t_magic
Definition: tlist.h:296
struct m0_xcode_type _type
Definition: tlist_xc.c:41
struct m0_xcode_field xct_child[0]
Definition: xcode.h:345
struct m0_list t_head
Definition: tlist.h:298
struct m0_xcode_field _child[2]
Definition: tlist_xc.c:42
static struct _m0_tl_descr_s _m0_tl_descr
M0_INTERNAL void m0_xc_lib_tlist_fini(void)
Definition: tlist_xc.c:310
const struct m0_xcode_type M0_XT_VOID
Definition: xcode.c:916
Definition: tlist.h:251
static struct _m0_tl_s _m0_tl
M0_BASSERT(offsetof(struct _m0_tl_descr_s, _child[0])==offsetof(struct m0_xcode_type, xct_child[0]))
#define M0_POST(cond)
uint64_t td_link_magic
Definition: tlist.h:308
size_t td_container_size
Definition: tlist.h:315
bool m0_xcode_type_invariant(const struct m0_xcode_type *xt)
Definition: xcode.c:74
uint64_t td_head_magic
Definition: tlist.h:313
struct m0_xcode_type * m0_list_link_xc
Definition: list_xc.c:11
static struct _m0_tlink_s _m0_tlink
void m0_xc_u64_init(void)
Definition: xcode.c:904
M0_INTERNAL void m0_xc_m0_tl_descr_struct_init(void)
Definition: tlist_xc.c:132
struct m0_xcode_type _type
Definition: tlist_xc.c:22
int td_link_offset
Definition: tlist.h:295
const struct m0_xcode_type M0_XT_U32
Definition: xcode.c:932
enum m0_xcode_aggr xct_aggr
Definition: xcode.h:316
struct m0_list_link t_link
Definition: tlist.h:293
M0_INTERNAL void m0_xc_m0_list_struct_init(void)
Definition: list_xc.c:132
M0_INTERNAL void m0_xc_lib_tlist_init(void)
Definition: tlist_xc.c:297
struct m0_xcode_type * m0_tlink_xc
Definition: tlist_xc.c:17
void m0_xc_u32_init(void)
Definition: xcode.c:900
struct m0_xcode_type * m0_tl_descr_xc
Definition: tlist_xc.c:11
const char * xf_name
Definition: xcode.h:251
const struct m0_xcode_type M0_XT_U64
Definition: xcode.c:940
struct m0_xcode_type * m0_list_xc
Definition: list_xc.c:14
#define offsetof(typ, memb)
Definition: misc.h:29
const char * td_name
Definition: tlist.h:293
M0_INTERNAL void m0_xc_m0_list_link_struct_init(void)
Definition: list_xc.c:85