Motr  M0
list_xc.c
Go to the documentation of this file.
1 /* This file is automatically generated from lib/list.h */
2 
3 #include "lib/misc.h" /* offsetof */
4 #include "lib/assert.h"
5 #include "xcode/xcode.h"
6 
7 #include "lib/list.h"
8 #include "lib/list_xc.h"
9 
10 #if !defined(__KERNEL__)
12 #endif
13 #if !defined(__KERNEL__)
15 #endif
16 
17 #if !defined(__KERNEL__)
18 static struct _m0_list_link_s {
21 } _m0_list_link = {
22  ._type = {
24  .xct_name = "m0_list_link",
25  .xct_sizeof = sizeof (struct m0_list_link),
26  .xct_nr = 2,
27  .xct_flags = M0_XCODE_TYPE_FLAG_DOM_BE,
28  }
29 };
30 
32 M0_BASSERT(offsetof(struct _m0_list_link_s, _child[0]) ==
33  offsetof(struct m0_xcode_type, xct_child[0]));
34 #endif
35 
36 #if !defined(__KERNEL__)
37 static struct _m0_list_s {
40 } _m0_list = {
41  ._type = {
43  .xct_name = "m0_list",
44  .xct_sizeof = sizeof (struct m0_list),
45  .xct_nr = 2,
46  .xct_flags = M0_XCODE_TYPE_FLAG_DOM_BE,
47  }
48 };
49 
51 M0_BASSERT(offsetof(struct _m0_list_s, _child[0]) ==
52  offsetof(struct m0_xcode_type, xct_child[0]));
53 #endif
54 
55 
56 #if !defined(__KERNEL__)
57 M0_BASSERT(sizeof(struct m0_list_link) == 16U);
58 #endif
59 
60 #if !defined(__KERNEL__)
61 M0_BASSERT(sizeof ((struct m0_list_link *)0)->ll_next == 8U);
62 M0_BASSERT(offsetof(struct m0_list_link, ll_next) == 0U);
63 #endif
64 #if !defined(__KERNEL__)
65 M0_BASSERT(sizeof ((struct m0_list_link *)0)->ll_prev == 8U);
66 M0_BASSERT(offsetof(struct m0_list_link, ll_prev) == 8U);
67 #endif
68 
69 #if !defined(__KERNEL__)
70 M0_BASSERT(sizeof(struct m0_list) == 16U);
71 #endif
72 
73 #if !defined(__KERNEL__)
74 M0_BASSERT(sizeof ((struct m0_list *)0)->l_head == 8U);
75 M0_BASSERT(offsetof(struct m0_list, l_head) == 0U);
76 #endif
77 #if !defined(__KERNEL__)
78 M0_BASSERT(sizeof ((struct m0_list *)0)->l_tail == 8U);
79 M0_BASSERT(offsetof(struct m0_list, l_tail) == 8U);
80 #endif
81 
82 
83 
84 #if !defined(__KERNEL__)
85 M0_INTERNAL void m0_xc_m0_list_link_struct_init(void)
86 {
87  _m0_list_link._child[0] = (struct m0_xcode_field) {
88  .xf_name = "ll_next",
89 #ifdef __KERNEL__
90  .xf_type = &M0_XT_VOID,
91 #else
92 
93  .xf_type = &M0_XT_U64,
94 #endif
95  .xf_tag = 0,
96  .xf_opaque = NULL,
97  .xf_offset = offsetof(struct m0_list_link, ll_next),
98  .xf_read = NULL,
99  .xf_decor = {
101  }
102  };
103 #if !defined(__KERNEL__)
104  m0_xc_u64_init();
105 #endif
106 
107  _m0_list_link._child[1] = (struct m0_xcode_field) {
108  .xf_name = "ll_prev",
109 #ifdef __KERNEL__
110  .xf_type = &M0_XT_VOID,
111 #else
112 
113  .xf_type = &M0_XT_U64,
114 #endif
115  .xf_tag = 0,
116  .xf_opaque = NULL,
117  .xf_offset = offsetof(struct m0_list_link, ll_prev),
118  .xf_read = NULL,
119  .xf_decor = {
121  }
122  };
123 #if !defined(__KERNEL__)
124  m0_xc_u64_init();
125 #endif
126 
128 }
129 #endif
130 
131 #if !defined(__KERNEL__)
132 M0_INTERNAL void m0_xc_m0_list_struct_init(void)
133 {
134  _m0_list._child[0] = (struct m0_xcode_field) {
135  .xf_name = "l_head",
136 #ifdef __KERNEL__
137  .xf_type = &M0_XT_VOID,
138 #else
139 
140  .xf_type = &M0_XT_U64,
141 #endif
142  .xf_tag = 0,
143  .xf_opaque = NULL,
144  .xf_offset = offsetof(struct m0_list, l_head),
145  .xf_read = NULL,
146  .xf_decor = {
148  }
149  };
150 #if !defined(__KERNEL__)
151  m0_xc_u64_init();
152 #endif
153 
154  _m0_list._child[1] = (struct m0_xcode_field) {
155  .xf_name = "l_tail",
156 #ifdef __KERNEL__
157  .xf_type = &M0_XT_VOID,
158 #else
159 
160  .xf_type = &M0_XT_U64,
161 #endif
162  .xf_tag = 0,
163  .xf_opaque = NULL,
164  .xf_offset = offsetof(struct m0_list, l_tail),
165  .xf_read = NULL,
166  .xf_decor = {
168  }
169  };
170 #if !defined(__KERNEL__)
171  m0_xc_u64_init();
172 #endif
173 
175 }
176 #endif
177 
178 M0_INTERNAL void m0_xc_lib_list_init(void)
179 {
180 #if !defined(__KERNEL__)
182 #endif
183 #if !defined(__KERNEL__)
185 #endif
186 }
187 
188 M0_INTERNAL void m0_xc_lib_list_fini(void)
189 {
190 }
#define NULL
Definition: misc.h:38
static struct _m0_list_link_s _m0_list_link
struct m0_xcode_field xct_child[0]
Definition: xcode.h:345
struct m0_list_link * ll_prev
Definition: list.h:194
struct m0_list_link * l_tail
Definition: list.h:75
M0_BASSERT(offsetof(struct _m0_be_list_link_s, _child[0])==offsetof(struct m0_xcode_type, xct_child[0]))
struct m0_list_link * l_head
Definition: list.h:71
M0_INTERNAL void m0_xc_lib_list_init(void)
Definition: list_xc.c:178
const struct m0_xcode_type M0_XT_VOID
Definition: xcode.c:916
struct m0_list_link * ll_next
Definition: list.h:190
#define M0_POST(cond)
bool m0_xcode_type_invariant(const struct m0_xcode_type *xt)
Definition: xcode.c:74
struct m0_xcode_type * m0_list_link_xc
Definition: list_xc.c:11
void m0_xc_u64_init(void)
Definition: xcode.c:904
Definition: list.h:72
enum m0_xcode_aggr xct_aggr
Definition: xcode.h:316
static struct _m0_list_s _m0_list
M0_INTERNAL void m0_xc_m0_list_struct_init(void)
Definition: list_xc.c:132
struct m0_xcode_type _type
Definition: list_xc.c:38
const char * xf_name
Definition: xcode.h:251
struct m0_xcode_field _child[2]
Definition: list_xc.c:39
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
M0_INTERNAL void m0_xc_lib_list_fini(void)
Definition: list_xc.c:188
M0_INTERNAL void m0_xc_m0_list_link_struct_init(void)
Definition: list_xc.c:85