Motr  M0
alloc_internal_xc.c
Go to the documentation of this file.
1 /* This file is automatically generated from be/alloc_internal.h */
2 
3 #include "lib/misc.h" /* offsetof */
4 #include "lib/assert.h"
5 #include "xcode/xcode.h"
6 
7 #include "be/alloc_internal.h"
8 #include "be/alloc_internal_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__)
25  ._type = {
27  .xct_name = "m0_be_allocator_header",
28  .xct_sizeof = sizeof (struct m0_be_allocator_header),
29  .xct_nr = 5,
30  .xct_flags = M0_XCODE_TYPE_FLAG_DOM_BE,
31  }
32 };
33 
35 M0_BASSERT(offsetof(struct _m0_be_allocator_header_s, _child[0]) ==
36  offsetof(struct m0_xcode_type, xct_child[0]));
37 #endif
38 
39 #if !defined(__KERNEL__)
40 static struct _be_alloc_chunk_s {
42  struct m0_xcode_field _child[10];
43 } _be_alloc_chunk = {
44  ._type = {
46  .xct_name = "be_alloc_chunk",
47  .xct_sizeof = sizeof (struct be_alloc_chunk),
48  .xct_nr = 10,
49  .xct_flags = M0_XCODE_TYPE_FLAG_DOM_BE,
50  }
51 };
52 
54 M0_BASSERT(offsetof(struct _be_alloc_chunk_s, _child[0]) ==
55  offsetof(struct m0_xcode_type, xct_child[0]));
56 #endif
57 
58 #if !defined(__KERNEL__)
59 static struct _m0_be_alloc_zone_s {
63  ._type = {
65  .xct_name = "m0_be_alloc_zone",
66  .xct_sizeof = sizeof (struct m0_be_alloc_zone),
67  .xct_nr = 2,
68  .xct_flags = M0_XCODE_TYPE_FLAG_DOM_BE,
69  }
70 };
71 
73 M0_BASSERT(offsetof(struct _m0_be_alloc_zone_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_be_allocator_header) == 7512U);
80 #endif
81 
82 #if !defined(__KERNEL__)
83 M0_BASSERT(sizeof ((struct m0_be_allocator_header *)0)->bah_chunks == 56U);
85 #endif
86 #if !defined(__KERNEL__)
87 M0_BASSERT(sizeof ((struct m0_be_allocator_header *)0)->bah_fl == 7224U);
89 #endif
90 #if !defined(__KERNEL__)
91 M0_BASSERT(sizeof ((struct m0_be_allocator_header *)0)->bah_stats == 216U);
93 #endif
94 #if !defined(__KERNEL__)
95 M0_BASSERT(sizeof ((struct m0_be_allocator_header *)0)->bah_size == 8U);
97 #endif
98 #if !defined(__KERNEL__)
99 M0_BASSERT(sizeof ((struct m0_be_allocator_header *)0)->bah_addr == 8U);
101 #endif
102 
103 #if !defined(__KERNEL__)
104 M0_BASSERT(sizeof(struct be_alloc_chunk) == 80U);
105 #endif
106 
107 #if !defined(__KERNEL__)
108 M0_BASSERT(sizeof ((struct be_alloc_chunk *)0)->bac_magic0 == 8U);
110 #endif
111 #if !defined(__KERNEL__)
112 M0_BASSERT(sizeof ((struct be_alloc_chunk *)0)->bac_linkage == 16U);
114 #endif
115 #if !defined(__KERNEL__)
116 M0_BASSERT(sizeof ((struct be_alloc_chunk *)0)->bac_magic == 8U);
118 #endif
119 #if !defined(__KERNEL__)
120 M0_BASSERT(sizeof ((struct be_alloc_chunk *)0)->bac_linkage_free == 16U);
122 #endif
123 #if !defined(__KERNEL__)
124 M0_BASSERT(sizeof ((struct be_alloc_chunk *)0)->bac_magic_free == 8U);
126 #endif
127 #if !defined(__KERNEL__)
128 M0_BASSERT(sizeof ((struct be_alloc_chunk *)0)->bac_size == 8U);
129 M0_BASSERT(offsetof(struct be_alloc_chunk, bac_size) == 56U);
130 #endif
131 #if !defined(__KERNEL__)
132 M0_BASSERT(sizeof ((struct be_alloc_chunk *)0)->bac_free == 1U);
133 M0_BASSERT(offsetof(struct be_alloc_chunk, bac_free) == 64U);
134 #endif
135 #if !defined(__KERNEL__)
136 M0_BASSERT(sizeof ((struct be_alloc_chunk *)0)->bac_zone == 4U);
137 M0_BASSERT(offsetof(struct be_alloc_chunk, bac_zone) == 68U);
138 #endif
139 #if !defined(__KERNEL__)
140 M0_BASSERT(sizeof ((struct be_alloc_chunk *)0)->bac_magic1 == 8U);
142 #endif
143 #if !defined(__KERNEL__)
144 M0_BASSERT(sizeof ((struct be_alloc_chunk *)0)->bac_mem == 0U);
145 M0_BASSERT(offsetof(struct be_alloc_chunk, bac_mem) == 80U);
146 #endif
147 
148 #if !defined(__KERNEL__)
149 M0_BASSERT(sizeof(struct m0_be_alloc_zone) == 16U);
150 #endif
151 
152 #if !defined(__KERNEL__)
153 M0_BASSERT(sizeof ((struct m0_be_alloc_zone *)0)->baz_size == 8U);
155 #endif
156 #if !defined(__KERNEL__)
157 M0_BASSERT(sizeof ((struct m0_be_alloc_zone *)0)->baz_free == 8U);
159 #endif
160 
161 
162 
163 #if !defined(__KERNEL__)
165 {
167  .xf_name = "bah_chunks",
168 #ifdef __KERNEL__
169  .xf_type = &M0_XT_VOID,
170 #else
171 
172  .xf_type = m0_be_list_xc,
173 #endif
174  .xf_tag = 0,
175  .xf_opaque = NULL,
176  .xf_offset = offsetof(struct m0_be_allocator_header, bah_chunks),
177  .xf_read = NULL,
178  .xf_decor = {
180  }
181  };
182 #if !defined(__KERNEL__)
184 #endif
185 
187  .xf_name = "bah_fl",
188 #ifdef __KERNEL__
189  .xf_type = &M0_XT_VOID,
190 #else
191 
192  .xf_type = m0_be_fl_xc,
193 #endif
194  .xf_tag = 0,
195  .xf_opaque = NULL,
196  .xf_offset = offsetof(struct m0_be_allocator_header, bah_fl),
197  .xf_read = NULL,
198  .xf_decor = {
200  }
201  };
202 #if !defined(__KERNEL__)
204 #endif
205 
207  .xf_name = "bah_stats",
208 #ifdef __KERNEL__
209  .xf_type = &M0_XT_VOID,
210 #else
211 
212  .xf_type = m0_be_allocator_stats_xc,
213 #endif
214  .xf_tag = 0,
215  .xf_opaque = NULL,
216  .xf_offset = offsetof(struct m0_be_allocator_header, bah_stats),
217  .xf_read = NULL,
218  .xf_decor = {
220  }
221  };
222 #if !defined(__KERNEL__)
224 #endif
225 
227  .xf_name = "bah_size",
228 
229  .xf_type = &M0_XT_U64,
230 
231  .xf_tag = 0,
232  .xf_opaque = NULL,
233  .xf_offset = offsetof(struct m0_be_allocator_header, bah_size),
234  .xf_read = NULL,
235  .xf_decor = {
237  }
238  };
239  m0_xc_u64_init();
240 
242  .xf_name = "bah_addr",
243 
244  .xf_type = &M0_XT_U64,
245 
246  .xf_tag = 0,
247  .xf_opaque = NULL,
248  .xf_offset = offsetof(struct m0_be_allocator_header, bah_addr),
249  .xf_read = NULL,
250  .xf_decor = {
252  }
253  };
254  m0_xc_u64_init();
255 
257 }
258 #endif
259 
260 #if !defined(__KERNEL__)
261 M0_INTERNAL void m0_xc_be_alloc_chunk_struct_init(void)
262 {
263  _be_alloc_chunk._child[0] = (struct m0_xcode_field) {
264  .xf_name = "bac_magic0",
265 
266  .xf_type = &M0_XT_U64,
267 
268  .xf_tag = 0,
269  .xf_opaque = NULL,
270  .xf_offset = offsetof(struct be_alloc_chunk, bac_magic0),
271  .xf_read = NULL,
272  .xf_decor = {
274  }
275  };
276  m0_xc_u64_init();
277 
278  _be_alloc_chunk._child[1] = (struct m0_xcode_field) {
279  .xf_name = "bac_linkage",
280 #ifdef __KERNEL__
281  .xf_type = &M0_XT_VOID,
282 #else
283 
284  .xf_type = m0_be_list_link_xc,
285 #endif
286  .xf_tag = 0,
287  .xf_opaque = NULL,
288  .xf_offset = offsetof(struct be_alloc_chunk, bac_linkage),
289  .xf_read = NULL,
290  .xf_decor = {
292  }
293  };
294 #if !defined(__KERNEL__)
296 #endif
297 
298  _be_alloc_chunk._child[2] = (struct m0_xcode_field) {
299  .xf_name = "bac_magic",
300 
301  .xf_type = &M0_XT_U64,
302 
303  .xf_tag = 0,
304  .xf_opaque = NULL,
305  .xf_offset = offsetof(struct be_alloc_chunk, bac_magic),
306  .xf_read = NULL,
307  .xf_decor = {
309  }
310  };
311  m0_xc_u64_init();
312 
313  _be_alloc_chunk._child[3] = (struct m0_xcode_field) {
314  .xf_name = "bac_linkage_free",
315 #ifdef __KERNEL__
316  .xf_type = &M0_XT_VOID,
317 #else
318 
319  .xf_type = m0_be_list_link_xc,
320 #endif
321  .xf_tag = 0,
322  .xf_opaque = NULL,
323  .xf_offset = offsetof(struct be_alloc_chunk, bac_linkage_free),
324  .xf_read = NULL,
325  .xf_decor = {
327  }
328  };
329 #if !defined(__KERNEL__)
331 #endif
332 
333  _be_alloc_chunk._child[4] = (struct m0_xcode_field) {
334  .xf_name = "bac_magic_free",
335 
336  .xf_type = &M0_XT_U64,
337 
338  .xf_tag = 0,
339  .xf_opaque = NULL,
340  .xf_offset = offsetof(struct be_alloc_chunk, bac_magic_free),
341  .xf_read = NULL,
342  .xf_decor = {
344  }
345  };
346  m0_xc_u64_init();
347 
348  _be_alloc_chunk._child[5] = (struct m0_xcode_field) {
349  .xf_name = "bac_size",
350 
351  .xf_type = &M0_XT_U64,
352 
353  .xf_tag = 0,
354  .xf_opaque = NULL,
355  .xf_offset = offsetof(struct be_alloc_chunk, bac_size),
356  .xf_read = NULL,
357  .xf_decor = {
359  }
360  };
361  m0_xc_u64_init();
362 
363  _be_alloc_chunk._child[6] = (struct m0_xcode_field) {
364  .xf_name = "bac_free",
365 
366  .xf_type = &M0_XT_U8,
367 
368  .xf_tag = 0,
369  .xf_opaque = NULL,
370  .xf_offset = offsetof(struct be_alloc_chunk, bac_free),
371  .xf_read = NULL,
372  .xf_decor = {
374  }
375  };
376  m0_xc_u8_init();
377 
378  _be_alloc_chunk._child[7] = (struct m0_xcode_field) {
379  .xf_name = "bac_zone",
380 
381  .xf_type = &M0_XT_U32,
382 
383  .xf_tag = 0,
384  .xf_opaque = NULL,
385  .xf_offset = offsetof(struct be_alloc_chunk, bac_zone),
386  .xf_read = &m0_xcode_enum_field_read,
387  .xf_decor = {
389  }
390  };
391  m0_xc_u32_init();
392 
393  _be_alloc_chunk._child[8] = (struct m0_xcode_field) {
394  .xf_name = "bac_magic1",
395 
396  .xf_type = &M0_XT_U64,
397 
398  .xf_tag = 0,
399  .xf_opaque = NULL,
400  .xf_offset = offsetof(struct be_alloc_chunk, bac_magic1),
401  .xf_read = NULL,
402  .xf_decor = {
404  }
405  };
406  m0_xc_u64_init();
407 
408  _be_alloc_chunk._child[9] = (struct m0_xcode_field) {
409  .xf_name = "bac_mem",
410 
411  .xf_type = &M0_XT_VOID,
412 
413  .xf_tag = 0,
414  .xf_opaque = NULL,
415  .xf_offset = offsetof(struct be_alloc_chunk, bac_mem),
416  .xf_read = NULL,
417  .xf_decor = {
419  }
420  };
421  m0_xc_void_init();
422 
424 }
425 #endif
426 
427 #if !defined(__KERNEL__)
429 {
430  _m0_be_alloc_zone._child[0] = (struct m0_xcode_field) {
431  .xf_name = "baz_size",
432 
433  .xf_type = &M0_XT_U64,
434 
435  .xf_tag = 0,
436  .xf_opaque = NULL,
437  .xf_offset = offsetof(struct m0_be_alloc_zone, baz_size),
438  .xf_read = NULL,
439  .xf_decor = {
441  }
442  };
443  m0_xc_u64_init();
444 
445  _m0_be_alloc_zone._child[1] = (struct m0_xcode_field) {
446  .xf_name = "baz_free",
447 
448  .xf_type = &M0_XT_U64,
449 
450  .xf_tag = 0,
451  .xf_opaque = NULL,
452  .xf_offset = offsetof(struct m0_be_alloc_zone, baz_free),
453  .xf_read = NULL,
454  .xf_decor = {
456  }
457  };
458  m0_xc_u64_init();
459 
461 }
462 #endif
463 
464 M0_INTERNAL void m0_xc_be_alloc_internal_init(void)
465 {
466 #if !defined(__KERNEL__)
468 #endif
469 #if !defined(__KERNEL__)
471 #endif
472 #if !defined(__KERNEL__)
474 #endif
475 }
476 
477 M0_INTERNAL void m0_xc_be_alloc_internal_fini(void)
478 {
479 }
M0_INTERNAL void m0_xc_be_alloc_internal_fini(void)
M0_INTERNAL void m0_xc_m0_be_fl_struct_init(void)
Definition: fl_xc.c:104
Allocator header.
struct m0_xcode_type * m0_be_allocator_stats_xc
Definition: alloc_xc.c:20
#define NULL
Definition: misc.h:38
void * bah_addr
m0_bcount_t bac_size
static struct _m0_be_allocator_header_s _m0_be_allocator_header
M0_INTERNAL void m0_xc_m0_be_list_link_struct_init(void)
Definition: list_xc.c:128
struct m0_xcode_type * m0_be_fl_xc
Definition: fl_xc.c:14
struct m0_xcode_enum m0_xc_m0_be_alloc_zone_type_enum
Definition: alloc_xc.c:216
struct m0_xcode_field xct_child[0]
Definition: xcode.h:345
struct m0_xcode_type * m0_be_list_link_xc
Definition: list_xc.c:11
void m0_xc_void_init(void)
Definition: xcode.c:908
struct m0_xcode_type _type
uint64_t bac_magic
m0_bcount_t baz_free
bool bac_free
struct m0_be_list_link bac_linkage_free
struct m0_xcode_field _child[10]
M0_INTERNAL void m0_xc_m0_be_alloc_zone_struct_init(void)
struct m0_xcode_type _type
struct m0_be_allocator_stats bah_stats
char bac_mem[0]
struct m0_xcode_field _child[2]
uint64_t bac_magic0
m0_bcount_t baz_size
struct m0_be_list bah_chunks
Allocator chunk.
M0_INTERNAL void m0_xc_be_alloc_chunk_struct_init(void)
uint64_t bac_magic_free
struct m0_be_list_link bac_linkage
const struct m0_xcode_type M0_XT_VOID
Definition: xcode.c:916
struct m0_be_fl bah_fl
#define M0_POST(cond)
struct m0_xcode_type _type
uint64_t bac_magic1
bool m0_xcode_type_invariant(const struct m0_xcode_type *xt)
Definition: xcode.c:74
void m0_xc_u64_init(void)
Definition: xcode.c:904
M0_INTERNAL void m0_xc_m0_be_list_struct_init(void)
Definition: list_xc.c:222
const struct m0_xcode_type M0_XT_U32
Definition: xcode.c:932
enum m0_xcode_aggr xct_aggr
Definition: xcode.h:316
M0_INTERNAL void m0_xc_be_alloc_internal_init(void)
struct m0_xcode_type * m0_be_allocator_header_xc
static struct _m0_be_alloc_zone_s _m0_be_alloc_zone
M0_BASSERT(offsetof(struct _m0_be_allocator_header_s, _child[0])==offsetof(struct m0_xcode_type, xct_child[0]))
static struct _be_alloc_chunk_s _be_alloc_chunk
const struct m0_xcode_type M0_XT_U8
Definition: xcode.c:924
struct m0_xcode_type * m0_be_list_xc
Definition: list_xc.c:17
M0_INTERNAL void m0_xc_m0_be_allocator_stats_struct_init(void)
Definition: alloc_xc.c:415
void m0_xc_u8_init(void)
Definition: xcode.c:892
struct m0_xcode_type * m0_be_alloc_zone_xc
void m0_xc_u32_init(void)
Definition: xcode.c:900
const char * xf_name
Definition: xcode.h:251
M0_INTERNAL void m0_xc_m0_be_allocator_header_struct_init(void)
struct m0_xcode_type * be_alloc_chunk_xc
m0_bcount_t bah_size
const struct m0_xcode_type M0_XT_U64
Definition: xcode.c:940
struct m0_xcode_field _child[5]
#define offsetof(typ, memb)
Definition: misc.h:29
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
Allocator memory zone.