Line data Source code
1 :
2 : struct device;
3 :
4 : void *ldv_dev_get_drvdata(const struct device *dev);
5 : int ldv_dev_set_drvdata(struct device *dev, void *data);
6 :
7 : struct spi_master;
8 : struct device;
9 : struct spi_master *ldv_spi_alloc_master(struct device *host, unsigned size);
10 :
11 : #include <linux/ldv/err.h>
12 :
13 : #include <linux/types.h>
14 : void *ldv_kzalloc(size_t size, gfp_t flags);
15 :
16 : struct clk;
17 :
18 : extern void ldv_clk_disable(struct clk *clk);
19 : extern int ldv_clk_enable(void);
20 :
21 : #include <linux/ldv/common.h>
22 : #include <linux/ldv/irq.h>
23 : #include <verifier/common.h>
24 : #include <verifier/nondet.h>
25 : #include <verifier/memory.h>
26 : #include <verifier/thread.h>
27 :
28 : #include <linux/cdev.h>
29 : #include <linux/miscdevice.h>
30 : #include <linux/seq_file.h>
31 : #include <linux/fs.h>
32 : #include <linux/pagemap.h>
33 :
34 :
35 : struct ldv_struct_insmod_8 {
36 : int signal_pending;
37 : };
38 :
39 : /* EMG Function declarations */
40 : void ldv_character_driver_scenario_2(void *);
41 : void ldv_character_driver_scenario_callback_1_28(int (*)(struct file *, struct dentry *, int), struct file *, struct dentry *, int);
42 : void ldv_character_driver_scenario_callback_1_34(loff_t (*)(struct file *, loff_t , int), struct file *, long long int, int);
43 : void ldv_character_driver_scenario_callback_2_22(ssize_t (*)(struct kiocb *, struct iovec *, long unsigned int, loff_t ), struct kiocb *, struct iovec *, long unsigned int, long long int);
44 : extern void ldv_character_driver_scenario_callback_2_25(long int (*)(struct file *, unsigned int, long unsigned int), struct file *, unsigned int, long unsigned int);
45 : void ldv_character_driver_scenario_callback_2_28(int (*)(struct file *, struct dentry *, int), struct file *, struct dentry *, int);
46 : void ldv_character_driver_scenario_callback_2_31(int (*)(struct inode *, struct file *, unsigned int, long unsigned int), struct inode *, struct file *, unsigned int, long unsigned int);
47 : void ldv_character_driver_scenario_callback_2_34(loff_t (*)(struct file *, loff_t , int), struct file *, long long int, int);
48 : void ldv_character_driver_scenario_callback_2_37(int (*)(struct file *, struct vm_area_struct *), struct file *, struct vm_area_struct *);
49 : void ldv_character_driver_scenario_callback_2_38(ssize_t (*)(struct file *, char *, long unsigned int, loff_t *), struct file *, char *, long unsigned int, loff_t *);
50 : extern void ldv_character_driver_scenario_callback_2_41(int (*)(struct file *, void *, filldir_t ), struct file *, void *, int (*)(void *, char *, int, loff_t , u64 , unsigned int));
51 : void ldv_character_driver_scenario_callback_2_42(ssize_t (*)(struct file *, loff_t *, struct pipe_inode_info *, long unsigned int, unsigned int), struct file *, loff_t *, struct pipe_inode_info *, long unsigned int, unsigned int);
52 : void ldv_character_driver_scenario_callback_2_5(ssize_t (*)(struct kiocb *, struct iovec *, long unsigned int, loff_t ), struct kiocb *, struct iovec *, long unsigned int, long long int);
53 : extern int ldv_character_driver_scenario_probe_2_13(int (*)(struct inode *, struct file *), struct inode *, struct file *);
54 : void ldv_character_driver_scenario_release_2_2(int (*)(struct inode *, struct file *), struct inode *, struct file *);
55 : void ldv_character_driver_scenario_write_2_4(ssize_t (*)(struct file *, char *, long unsigned int, loff_t *), struct file *, char *, long unsigned int, loff_t *);
56 : void ldv_random_containerless_scenario_callback_7_11(int (*)(struct vfsmount *, struct dentry *, struct kstat *), struct vfsmount *, struct dentry *, struct kstat *);
57 : void ldv_random_containerless_scenario_callback_7_16(int (*)(struct dentry *, struct iattr *), struct dentry *, struct iattr *);
58 : void ldv_random_containerless_scenario_callback_7_22(void (*)(struct inode *), struct inode *);
59 :
60 : /* EMG variable declarations */
61 1 : struct ldv_thread ldv_thread_2;
62 :
63 : /* EMG variable initialization */
64 :
65 : /* EMG function definitions */
66 : /* AUX_FUNC ldv_character_driver_scenario_2 */
67 : void ldv_character_driver_scenario_2(void *arg0) {
68 : /* LDV {"thread": 2, "type": "CONTROL_FUNCTION_BEGIN", "comment": "Control function 'character_driver_scenario(file_operations)'", "function": "ldv_character_driver_scenario_2"} */
69 1 : /* LDV {"type": "CONTROL_FUNCTION_INIT_BEGIN", "comment": "Declare auxiliary variables."} */
70 : ssize_t (*ldv_2_callback_aio_read)(struct kiocb *, struct iovec *, long unsigned int, loff_t );
71 1 : ssize_t (*ldv_2_callback_aio_write)(struct kiocb *, struct iovec *, long unsigned int, loff_t );
72 : long int (*ldv_2_callback_compat_ioctl)(struct file *, unsigned int, long unsigned int);
73 1 : int (*ldv_2_callback_fsync)(struct file *, struct dentry *, int);
74 1 : int (*ldv_2_callback_ioctl)(struct inode *, struct file *, unsigned int, long unsigned int);
75 1 : loff_t (*ldv_2_callback_llseek)(struct file *, loff_t , int);
76 1 : int (*ldv_2_callback_mmap)(struct file *, struct vm_area_struct *);
77 1 : ssize_t (*ldv_2_callback_read)(struct file *, char *, long unsigned int, loff_t *);
78 1 : int (*ldv_2_callback_readdir)(struct file *, void *, filldir_t );
79 1 : ssize_t (*ldv_2_callback_splice_read)(struct file *, loff_t *, struct pipe_inode_info *, long unsigned int, unsigned int);
80 : struct file_operations *ldv_2_container_file_operations;
81 : long long int ldv_2_ldv_param_22_3_default;
82 1 : unsigned int ldv_2_ldv_param_25_1_default;
83 : int ldv_2_ldv_param_28_2_default;
84 1 : unsigned int ldv_2_ldv_param_31_2_default;
85 1 : long long int ldv_2_ldv_param_34_1_default;
86 1 : int ldv_2_ldv_param_34_2_default;
87 1 : char *ldv_2_ldv_param_38_1_default;
88 1 : long long int *ldv_2_ldv_param_38_3_default;
89 1 : long long int *ldv_2_ldv_param_42_1_default;
90 1 : unsigned int ldv_2_ldv_param_42_4_default;
91 1 : char *ldv_2_ldv_param_4_1_default;
92 1 : long long int *ldv_2_ldv_param_4_3_default;
93 1 : long long int ldv_2_ldv_param_5_3_default;
94 1 : struct file *ldv_2_resource_file;
95 1 : struct inode *ldv_2_resource_inode;
96 1 : struct kiocb *ldv_2_resource_struct_kiocb_ptr;
97 1 : int ldv_2_ret_default;
98 1 : int (*ldv_2_size_cnt_func_1_ptr)(void *, char *, int, loff_t , u64 , unsigned int);
99 1 : struct dentry *ldv_2_size_cnt_struct_dentry_ptr;
100 1 : struct iovec *ldv_2_size_cnt_struct_iovec_ptr;
101 1 : struct pipe_inode_info *ldv_2_size_cnt_struct_pipe_inode_info_ptr;
102 1 : struct vm_area_struct *ldv_2_size_cnt_struct_vm_area_struct_ptr;
103 1 : long unsigned int ldv_2_size_cnt_write_size;
104 1 : /* LDV {"type": "CONTROL_FUNCTION_INIT_END", "comment": "Declare auxiliary variables."} */
105 1 : /* Initialize automaton variables */
106 2 : ldv_2_ret_default = 1;
107 1 : /* LDV {"action": "DEFAULT_REGISTER_1", "type": "RECEIVE_BEGIN", "comment": "Begin FILE_OPERATIONS callbacks invocations scenario."} */
108 3 : ldv_free(arg0);
109 1 : /* LDV {"action": "DEFAULT_REGISTER_1", "type": "RECEIVE_END"} */
110 1 :
111 1 : /* LDV {"action": "DEFAULT_ALLOC_1", "type": "CONDITION_BEGIN", "comment": "Allocate memory after default registration."} */
112 4 : ldv_2_container_file_operations = ldv_xmalloc_unknown_size(0);
113 1 : /* LDV {"action": "DEFAULT_ALLOC_1", "type": "CONDITION_END"} */
114 1 :
115 1 : /* LDV {"action": "INIT", "type": "CONDITION_BEGIN", "comment": "Allocate memory for file and inode structures."} */
116 4 : ldv_2_resource_file = ldv_xmalloc(sizeof(struct file));
117 4 : ldv_2_resource_inode = ldv_xmalloc(sizeof(struct inode));
118 4 : ldv_2_resource_struct_kiocb_ptr = ldv_xmalloc_unknown_size(0);
119 4 : ldv_2_size_cnt_func_1_ptr = ldv_undef_int();
120 1 : /* LDV {"action": "INIT", "type": "CONDITION_END"} */
121 1 :
122 : /* LDV {"action": "MAIN", "type": "SUBPROCESS_BEGIN", "comment": "Device appeared in the system."} */
123 : /* LDV {"action": "MAIN", "type": "SUBPROCESS_END"} */
124 :
125 : /* Jump to a subprocess 'main' initial state */
126 1 : goto ldv_main_2;
127 : /* End of the process */
128 : return;
129 1 :
130 : /* Sbprocess main */
131 : ldv_main_2:
132 : /* LDV {"action": null, "type": "ARTIFICIAL", "comment": "Artificial state in scenario"} */
133 :
134 4 : if (ldv_undef_int()) {
135 : /* LDV {"action": "PROBE", "type": "CALL_BEGIN", "callback": true, "comment": "Open the device file. Invoke callback probe from FILE_OPERATIONS."} */
136 3 : if (ldv_2_container_file_operations->open) {
137 : /* LDV {"type": "CALLBACK", "call": "ldv_2_ret_default = (ldv_2_container_file_operations->open)(ldv_2_resource_inode, ldv_2_resource_file);", "comment": "probe"} */
138 2 : ldv_2_ret_default = ldv_character_driver_scenario_probe_2_13(ldv_2_container_file_operations->open, ldv_2_resource_inode, ldv_2_resource_file);
139 : }
140 : /* Callback post-call */
141 4 : ldv_2_ret_default = ldv_filter_err_code(ldv_2_ret_default);
142 : /* LDV {"action": "PROBE", "type": "CALL_END"} */
143 :
144 4 : if (ldv_undef_int()) {
145 : /* LDV {"action": "PROBE_SUCCESS", "type": "CONDITION_BEGIN", "comment": "Device file is opened successfully."} */
146 2 : ldv_assume(ldv_2_ret_default == 0);
147 : /* LDV {"action": "PROBE_SUCCESS", "type": "CONDITION_END"} */
148 :
149 : /* LDV {"action": "CALL", "type": "SUBPROCESS_BEGIN", "comment": "Device file is opened, ready to read and write."} */
150 : /* LDV {"action": "CALL", "type": "SUBPROCESS_END"} */
151 :
152 : /* Jump to a subprocess 'call' initial state */
153 1 : goto ldv_call_2;
154 : }
155 : else {
156 : /* LDV {"action": "PROBE_FAIL", "type": "CONDITION_BEGIN", "comment": "Failed to open devices file."} */
157 2 : ldv_assume(ldv_2_ret_default != 0);
158 : /* LDV {"action": "PROBE_FAIL", "type": "CONDITION_END"} */
159 :
160 : /* LDV {"action": "MAIN", "type": "SUBPROCESS_BEGIN", "comment": "Device appeared in the system."} */
161 : /* LDV {"action": "MAIN", "type": "SUBPROCESS_END"} */
162 :
163 : /* Jump to a subprocess 'main' initial state */
164 1 : goto ldv_main_2;
165 : }
166 : }
167 : else {
168 : /* LDV {"action": "FREE", "type": "CONDITION_BEGIN", "comment": "Free memory of file and inode structures."} */
169 2 : ldv_free(ldv_2_resource_file);
170 2 : ldv_free(ldv_2_resource_inode);
171 2 : ldv_free(ldv_2_resource_struct_kiocb_ptr);
172 : /* LDV {"action": "FREE", "type": "CONDITION_END"} */
173 :
174 : /* LDV {"action": "DEFAULT_FREE_1", "type": "CONDITION_BEGIN", "comment": "Free memory before default deregistration."} */
175 2 : ldv_free(ldv_2_container_file_operations);
176 : /* LDV {"action": "DEFAULT_FREE_1", "type": "CONDITION_END"} */
177 :
178 : /* LDV {"action": "DEFAULT_DEREGISTER_1", "type": "RECEIVE_BEGIN", "comment": "Finish FILE_OPERATIONS callbacks invocations scenario."} */
179 : /* Skip a non-replicative signal receiving */
180 : /* LDV {"action": "DEFAULT_DEREGISTER_1", "type": "RECEIVE_END"} */
181 :
182 : /* Exit function at a terminal state */
183 1 : return;
184 : }
185 : /* End of the subprocess 'main' */
186 : return;
187 1 :
188 : /* Sbprocess call */
189 : ldv_call_2:
190 : /* LDV {"action": null, "type": "ARTIFICIAL", "comment": "Artificial state in scenario"} */
191 :
192 2 : switch (ldv_undef_int()) {
193 3 : case 1: {
194 : /* LDV {"action": "PRE_CALL_4", "type": "CONDITION_BEGIN", "comment": "Allocate memory for adhoc callback parameters."} */
195 3 : ldv_2_ldv_param_4_1_default = ldv_xmalloc_unknown_size(0);
196 3 : ldv_2_ldv_param_4_3_default = ldv_xmalloc_unknown_size(0);
197 : /* LDV {"action": "PRE_CALL_4", "type": "CONDITION_END"} */
198 :
199 : /* LDV {"action": "WRITE", "type": "CALL_BEGIN", "callback": true, "comment": "Write data to the device. Invoke callback write from file_operations."} */
200 : /* Callback pre-call */
201 2 : ldv_assume(ldv_2_size_cnt_func_1_ptr <= (INT_MAX & PAGE_CACHE_MASK));
202 : /* LDV {"type": "CALLBACK", "call": "((& do_sync_write))(ldv_2_resource_file, ldv_2_ldv_param_4_1_default, ldv_2_size_cnt_write_size, ldv_2_ldv_param_4_3_default);", "comment": "write"} */
203 3 : ldv_character_driver_scenario_write_2_4(ldv_2_container_file_operations->write, ldv_2_resource_file, ldv_2_ldv_param_4_1_default, ldv_2_size_cnt_write_size, ldv_2_ldv_param_4_3_default);
204 : /* LDV {"action": "WRITE", "type": "CALL_END"} */
205 :
206 : /* LDV {"action": "POST_CALL_4", "type": "CONDITION_BEGIN", "comment": "Free memory of adhoc callback parameters."} */
207 2 : ldv_free(ldv_2_ldv_param_4_1_default);
208 2 : ldv_free(ldv_2_ldv_param_4_3_default);
209 : /* LDV {"action": "POST_CALL_4", "type": "CONDITION_END"} */
210 :
211 : /* LDV {"action": "CALL", "type": "SUBPROCESS_BEGIN", "comment": "Device file is opened, ready to read and write."} */
212 : /* LDV {"action": "CALL", "type": "SUBPROCESS_END"} */
213 :
214 : /* Jump to a subprocess 'call' initial state */
215 1 : goto ldv_call_2;
216 1 : break;
217 : }
218 3 : case 2: {
219 : /* LDV {"action": "RELEASE", "type": "CALL_BEGIN", "callback": true, "comment": "File structure is released. Invoke callback release from file_operations."} */
220 : /* LDV {"type": "CALLBACK", "call": "((& fat_file_release))(ldv_2_resource_inode, ldv_2_resource_file);", "comment": "release"} */
221 2 : ldv_character_driver_scenario_release_2_2(ldv_2_container_file_operations->release, ldv_2_resource_inode, ldv_2_resource_file);
222 : /* LDV {"action": "RELEASE", "type": "CALL_END"} */
223 :
224 : /* LDV {"action": "MAIN", "type": "SUBPROCESS_BEGIN", "comment": "Device appeared in the system."} */
225 : /* LDV {"action": "MAIN", "type": "SUBPROCESS_END"} */
226 :
227 : /* Jump to a subprocess 'main' initial state */
228 1 : goto ldv_main_2;
229 1 : break;
230 : }
231 3 : case 3: {
232 : /* LDV {"action": "PRE_CALL_5", "type": "CONDITION_BEGIN", "comment": "Allocate memory for adhoc callback parameters."} */
233 : /* LDV {"action": "PRE_CALL_5", "type": "CONDITION_END"} */
234 :
235 2 : switch (ldv_undef_int()) {
236 3 : case 1: {
237 : /* LDV {"action": "PRE_CALL_42", "type": "CONDITION_BEGIN", "comment": "Allocate memory for adhoc callback parameters."} */
238 3 : ldv_2_ldv_param_42_1_default = ldv_xmalloc_unknown_size(0);
239 : /* LDV {"action": "PRE_CALL_42", "type": "CONDITION_END"} */
240 :
241 : /* LDV {"action": "CALLBACK", "type": "CALL_BEGIN", "callback": true, "comment": "Invoke callback splice_read from file_operations."} */
242 : /* LDV {"type": "CALLBACK", "call": "((& generic_file_splice_read))(ldv_2_resource_file, ldv_2_ldv_param_42_1_default, ldv_2_size_cnt_struct_pipe_inode_info_ptr, ldv_2_size_cnt_write_size, ldv_2_ldv_param_42_4_default);", "comment": "callback"} */
243 2 : ldv_character_driver_scenario_callback_2_42(ldv_2_callback_splice_read, ldv_2_resource_file, ldv_2_ldv_param_42_1_default, ldv_2_size_cnt_struct_pipe_inode_info_ptr, ldv_2_size_cnt_write_size, ldv_2_ldv_param_42_4_default);
244 : /* LDV {"action": "CALLBACK", "type": "CALL_END"} */
245 :
246 : /* LDV {"action": "POST_CALL_42", "type": "CONDITION_BEGIN", "comment": "Free memory of adhoc callback parameters."} */
247 2 : ldv_free(ldv_2_ldv_param_42_1_default);
248 : /* LDV {"action": "POST_CALL_42", "type": "CONDITION_END"} */
249 :
250 1 : break;
251 1 : }
252 3 : case 2: {
253 : /* LDV {"action": "CALLBACK", "type": "CALL_BEGIN", "callback": true, "comment": "Invoke callback callback from FILE_OPERATIONS."} */
254 2 : if (ldv_2_callback_readdir) {
255 : /* LDV {"type": "CALLBACK", "call": "(ldv_2_callback_readdir)(ldv_2_resource_file, ldv_2_resource_inode, ldv_2_size_cnt_func_1_ptr);", "comment": "callback"} */
256 2 : ldv_character_driver_scenario_callback_2_41(ldv_2_callback_readdir, ldv_2_resource_file, ldv_2_resource_inode, ldv_2_size_cnt_func_1_ptr);
257 : }
258 : /* LDV {"action": "CALLBACK", "type": "CALL_END"} */
259 :
260 2 : break;
261 1 : }
262 3 : case 3: {
263 : /* LDV {"action": "PRE_CALL_38", "type": "CONDITION_BEGIN", "comment": "Allocate memory for adhoc callback parameters."} */
264 3 : ldv_2_ldv_param_38_1_default = ldv_xmalloc_unknown_size(0);
265 3 : ldv_2_ldv_param_38_3_default = ldv_xmalloc_unknown_size(0);
266 : /* LDV {"action": "PRE_CALL_38", "type": "CONDITION_END"} */
267 :
268 : /* LDV {"action": "CALLBACK", "type": "CALL_BEGIN", "callback": true, "comment": "Invoke callback read from file_operations."} */
269 : /* LDV {"type": "CALLBACK", "call": "((& do_sync_read))(ldv_2_resource_file, ldv_2_ldv_param_38_1_default, ldv_2_size_cnt_write_size, ldv_2_ldv_param_38_3_default);", "comment": "callback"} */
270 2 : ldv_character_driver_scenario_callback_2_38(ldv_2_callback_read, ldv_2_resource_file, ldv_2_ldv_param_38_1_default, ldv_2_size_cnt_write_size, ldv_2_ldv_param_38_3_default);
271 : /* LDV {"action": "CALLBACK", "type": "CALL_END"} */
272 :
273 : /* LDV {"action": "POST_CALL_38", "type": "CONDITION_BEGIN", "comment": "Free memory of adhoc callback parameters."} */
274 2 : ldv_free(ldv_2_ldv_param_38_1_default);
275 2 : ldv_free(ldv_2_ldv_param_38_3_default);
276 : /* LDV {"action": "POST_CALL_38", "type": "CONDITION_END"} */
277 :
278 1 : break;
279 1 : }
280 3 : case 4: {
281 : /* LDV {"action": "CALLBACK", "type": "CALL_BEGIN", "callback": true, "comment": "Invoke callback mmap from file_operations."} */
282 : /* LDV {"type": "CALLBACK", "call": "((& generic_file_mmap))(ldv_2_resource_file, ldv_2_size_cnt_struct_vm_area_struct_ptr);", "comment": "callback"} */
283 2 : ldv_character_driver_scenario_callback_2_37(ldv_2_callback_mmap, ldv_2_resource_file, ldv_2_size_cnt_struct_vm_area_struct_ptr);
284 : /* LDV {"action": "CALLBACK", "type": "CALL_END"} */
285 :
286 1 : break;
287 1 : }
288 3 : case 5: {
289 : /* LDV {"action": "PRE_CALL_34", "type": "CONDITION_BEGIN", "comment": "Allocate memory for adhoc callback parameters."} */
290 : /* LDV {"action": "PRE_CALL_34", "type": "CONDITION_END"} */
291 :
292 : /* LDV {"action": "CALLBACK", "type": "CALL_BEGIN", "callback": true, "comment": "Invoke callback llseek from file_operations."} */
293 : /* LDV {"type": "CALLBACK", "call": "((& generic_file_llseek))(ldv_2_resource_file, ldv_2_ldv_param_34_1_default, ldv_2_ldv_param_34_2_default);", "comment": "callback"} */
294 2 : ldv_character_driver_scenario_callback_2_34(ldv_2_callback_llseek, ldv_2_resource_file, ldv_2_ldv_param_34_1_default, ldv_2_ldv_param_34_2_default);
295 : /* LDV {"action": "CALLBACK", "type": "CALL_END"} */
296 :
297 : /* LDV {"action": "POST_CALL_34", "type": "CONDITION_BEGIN", "comment": "Free memory of adhoc callback parameters."} */
298 : /* LDV {"action": "POST_CALL_34", "type": "CONDITION_END"} */
299 :
300 1 : break;
301 1 : }
302 3 : case 6: {
303 : /* LDV {"action": "PRE_CALL_31", "type": "CONDITION_BEGIN", "comment": "Allocate memory for adhoc callback parameters."} */
304 : /* LDV {"action": "PRE_CALL_31", "type": "CONDITION_END"} */
305 :
306 : /* LDV {"action": "CALLBACK", "type": "CALL_BEGIN", "callback": true, "comment": "Invoke callback ioctl from file_operations."} */
307 : /* LDV {"type": "CALLBACK", "call": "((& fat_generic_ioctl))(ldv_2_resource_inode, ldv_2_resource_file, ldv_2_ldv_param_31_2_default, ldv_2_size_cnt_write_size);", "comment": "callback"} */
308 2 : ldv_character_driver_scenario_callback_2_31(ldv_2_callback_ioctl, ldv_2_resource_inode, ldv_2_resource_file, ldv_2_ldv_param_31_2_default, ldv_2_size_cnt_write_size);
309 : /* LDV {"action": "CALLBACK", "type": "CALL_END"} */
310 :
311 : /* LDV {"action": "POST_CALL_31", "type": "CONDITION_BEGIN", "comment": "Free memory of adhoc callback parameters."} */
312 : /* LDV {"action": "POST_CALL_31", "type": "CONDITION_END"} */
313 :
314 1 : break;
315 1 : }
316 3 : case 7: {
317 : /* LDV {"action": "PRE_CALL_28", "type": "CONDITION_BEGIN", "comment": "Allocate memory for adhoc callback parameters."} */
318 : /* LDV {"action": "PRE_CALL_28", "type": "CONDITION_END"} */
319 :
320 : /* LDV {"action": "CALLBACK", "type": "CALL_BEGIN", "callback": true, "comment": "Invoke callback fsync from file_operations."} */
321 : /* LDV {"type": "CALLBACK", "call": "((& fat_file_fsync))(ldv_2_resource_file, ldv_2_size_cnt_struct_dentry_ptr, ldv_2_ldv_param_28_2_default);", "comment": "callback"} */
322 2 : ldv_character_driver_scenario_callback_2_28(ldv_2_callback_fsync, ldv_2_resource_file, ldv_2_size_cnt_struct_dentry_ptr, ldv_2_ldv_param_28_2_default);
323 : /* LDV {"action": "CALLBACK", "type": "CALL_END"} */
324 :
325 : /* LDV {"action": "POST_CALL_28", "type": "CONDITION_BEGIN", "comment": "Free memory of adhoc callback parameters."} */
326 : /* LDV {"action": "POST_CALL_28", "type": "CONDITION_END"} */
327 :
328 1 : break;
329 1 : }
330 3 : case 8: {
331 : /* LDV {"action": "PRE_CALL_25", "type": "CONDITION_BEGIN", "comment": "Allocate memory for adhoc callback parameters."} */
332 : /* LDV {"action": "PRE_CALL_25", "type": "CONDITION_END"} */
333 :
334 : /* LDV {"action": "CALLBACK", "type": "CALL_BEGIN", "callback": true, "comment": "Invoke callback callback from FILE_OPERATIONS."} */
335 2 : if (ldv_2_callback_compat_ioctl) {
336 : /* LDV {"type": "CALLBACK", "call": "(ldv_2_callback_compat_ioctl)(ldv_2_resource_file, ldv_2_ldv_param_25_1_default, ldv_2_size_cnt_write_size);", "comment": "callback"} */
337 2 : ldv_character_driver_scenario_callback_2_25(ldv_2_callback_compat_ioctl, ldv_2_resource_file, ldv_2_ldv_param_25_1_default, ldv_2_size_cnt_write_size);
338 : }
339 : /* LDV {"action": "CALLBACK", "type": "CALL_END"} */
340 :
341 : /* LDV {"action": "POST_CALL_25", "type": "CONDITION_BEGIN", "comment": "Free memory of adhoc callback parameters."} */
342 : /* LDV {"action": "POST_CALL_25", "type": "CONDITION_END"} */
343 :
344 2 : break;
345 1 : }
346 3 : case 9: {
347 : /* LDV {"action": "PRE_CALL_22", "type": "CONDITION_BEGIN", "comment": "Allocate memory for adhoc callback parameters."} */
348 : /* LDV {"action": "PRE_CALL_22", "type": "CONDITION_END"} */
349 :
350 : /* LDV {"action": "CALLBACK", "type": "CALL_BEGIN", "callback": true, "comment": "Invoke callback aio_write from file_operations."} */
351 : /* LDV {"type": "CALLBACK", "call": "((& generic_file_aio_write))(ldv_2_resource_struct_kiocb_ptr, ldv_2_size_cnt_struct_iovec_ptr, ldv_2_size_cnt_write_size, ldv_2_ldv_param_22_3_default);", "comment": "callback"} */
352 2 : ldv_character_driver_scenario_callback_2_22(ldv_2_callback_aio_write, ldv_2_resource_struct_kiocb_ptr, ldv_2_size_cnt_struct_iovec_ptr, ldv_2_size_cnt_write_size, ldv_2_ldv_param_22_3_default);
353 : /* LDV {"action": "CALLBACK", "type": "CALL_END"} */
354 :
355 : /* LDV {"action": "POST_CALL_22", "type": "CONDITION_BEGIN", "comment": "Free memory of adhoc callback parameters."} */
356 : /* LDV {"action": "POST_CALL_22", "type": "CONDITION_END"} */
357 :
358 1 : break;
359 1 : }
360 3 : case 10: {
361 : /* LDV {"action": "CALLBACK", "type": "CALL_BEGIN", "callback": true, "comment": "Invoke callback aio_read from file_operations."} */
362 : /* LDV {"type": "CALLBACK", "call": "((& generic_file_aio_read))(ldv_2_resource_struct_kiocb_ptr, ldv_2_size_cnt_struct_iovec_ptr, ldv_2_size_cnt_write_size, ldv_2_ldv_param_5_3_default);", "comment": "callback"} */
363 2 : ldv_character_driver_scenario_callback_2_5(ldv_2_callback_aio_read, ldv_2_resource_struct_kiocb_ptr, ldv_2_size_cnt_struct_iovec_ptr, ldv_2_size_cnt_write_size, ldv_2_ldv_param_5_3_default);
364 : /* LDV {"action": "CALLBACK", "type": "CALL_END"} */
365 :
366 1 : break;
367 1 : }
368 2 : default: ldv_stop();
369 1 : }
370 11 : break;
371 1 : }
372 2 : default: ldv_stop();
373 1 : }
374 0 : /* LDV {"action": "POST_CALL_5", "type": "CONDITION_BEGIN", "comment": "Free memory of adhoc callback parameters."} */
375 : /* LDV {"action": "POST_CALL_5", "type": "CONDITION_END"} */
376 0 :
377 : /* LDV {"action": "CALL", "type": "SUBPROCESS_BEGIN", "comment": "Device file is opened, ready to read and write."} */
378 : /* LDV {"action": "CALL", "type": "SUBPROCESS_END"} */
379 :
380 : /* Jump to a subprocess 'call' initial state */
381 11 : goto ldv_call_2;
382 : /* Jump to a subprocess 'call' initial state */
383 : goto ldv_call_2;
384 : /* End of the subprocess 'call' */
385 : return;
386 : /* LDV {"comment": "End of control function based on process 'character_driver_scenario(file_operations)'", "type": "CONTROL_FUNCTION_END", "function": "ldv_character_driver_scenario_2"} */
387 : }
388 :
389 : /* AUX_FUNC_CALLBACK ldv_character_driver_scenario_callback_1_28 */
390 : void ldv_character_driver_scenario_callback_1_28(int (*arg0)(struct file *, struct dentry *, int), struct file *arg1, struct dentry *arg2, int arg3) {
391 2 : ((& fat_file_fsync))(arg1, arg2, arg3);
392 1 : }
393 :
394 : /* AUX_FUNC_CALLBACK ldv_character_driver_scenario_callback_1_34 */
395 : void ldv_character_driver_scenario_callback_1_34(loff_t (*arg0)(struct file *, loff_t , int), struct file *arg1, long long int arg2, int arg3) {
396 1 : ((& generic_file_llseek))(arg1, arg2, arg3);
397 1 : }
398 :
399 : /* AUX_FUNC_CALLBACK ldv_character_driver_scenario_callback_2_22 */
400 : void ldv_character_driver_scenario_callback_2_22(ssize_t (*arg0)(struct kiocb *, struct iovec *, long unsigned int, loff_t ), struct kiocb *arg1, struct iovec *arg2, long unsigned int arg3, long long int arg4) {
401 1 : ((& generic_file_aio_write))(arg1, arg2, arg3, arg4);
402 1 : }
403 :
404 : /* AUX_FUNC_CALLBACK ldv_character_driver_scenario_callback_2_28 */
405 : void ldv_character_driver_scenario_callback_2_28(int (*arg0)(struct file *, struct dentry *, int), struct file *arg1, struct dentry *arg2, int arg3) {
406 2 : ((& fat_file_fsync))(arg1, arg2, arg3);
407 1 : }
408 :
409 : /* AUX_FUNC_CALLBACK ldv_character_driver_scenario_callback_2_31 */
410 : void ldv_character_driver_scenario_callback_2_31(int (*arg0)(struct inode *, struct file *, unsigned int, long unsigned int), struct inode *arg1, struct file *arg2, unsigned int arg3, long unsigned int arg4) {
411 4 : ((& fat_generic_ioctl))(arg1, arg2, arg3, arg4);
412 1 : }
413 :
414 : /* AUX_FUNC_CALLBACK ldv_character_driver_scenario_callback_2_34 */
415 : void ldv_character_driver_scenario_callback_2_34(loff_t (*arg0)(struct file *, loff_t , int), struct file *arg1, long long int arg2, int arg3) {
416 1 : ((& generic_file_llseek))(arg1, arg2, arg3);
417 1 : }
418 :
419 : /* AUX_FUNC_CALLBACK ldv_character_driver_scenario_callback_2_37 */
420 : void ldv_character_driver_scenario_callback_2_37(int (*arg0)(struct file *, struct vm_area_struct *), struct file *arg1, struct vm_area_struct *arg2) {
421 1 : ((& generic_file_mmap))(arg1, arg2);
422 1 : }
423 :
424 : /* AUX_FUNC_CALLBACK ldv_character_driver_scenario_callback_2_38 */
425 : void ldv_character_driver_scenario_callback_2_38(ssize_t (*arg0)(struct file *, char *, long unsigned int, loff_t *), struct file *arg1, char *arg2, long unsigned int arg3, long long int *arg4) {
426 1 : ((& do_sync_read))(arg1, arg2, arg3, arg4);
427 1 : }
428 :
429 : /* AUX_FUNC_CALLBACK ldv_character_driver_scenario_callback_2_42 */
430 : void ldv_character_driver_scenario_callback_2_42(ssize_t (*arg0)(struct file *, loff_t *, struct pipe_inode_info *, long unsigned int, unsigned int), struct file *arg1, long long int *arg2, struct pipe_inode_info *arg3, long unsigned int arg4, unsigned int arg5) {
431 1 : ((& generic_file_splice_read))(arg1, arg2, arg3, arg4, arg5);
432 1 : }
433 :
434 : /* AUX_FUNC_CALLBACK ldv_character_driver_scenario_callback_2_5 */
435 : void ldv_character_driver_scenario_callback_2_5(ssize_t (*arg0)(struct kiocb *, struct iovec *, long unsigned int, loff_t ), struct kiocb *arg1, struct iovec *arg2, long unsigned int arg3, long long int arg4) {
436 1 : ((& generic_file_aio_read))(arg1, arg2, arg3, arg4);
437 1 : }
438 :
439 : /* AUX_FUNC_CALLBACK ldv_character_driver_scenario_release_2_2 */
440 : void ldv_character_driver_scenario_release_2_2(int (*arg0)(struct inode *, struct file *), struct inode *arg1, struct file *arg2) {
441 4 : ((& fat_file_release))(arg1, arg2);
442 1 : }
443 :
444 : /* AUX_FUNC_CALLBACK ldv_character_driver_scenario_write_2_4 */
445 : void ldv_character_driver_scenario_write_2_4(ssize_t (*arg0)(struct file *, char *, long unsigned int, loff_t *), struct file *arg1, char *arg2, long unsigned int arg3, long long int *arg4) {
446 1 : ((& do_sync_write))(arg1, arg2, arg3, arg4);
447 1 : }
448 :
449 : /* AUX_FUNC_CALLBACK ldv_random_containerless_scenario_callback_7_11 */
450 : void ldv_random_containerless_scenario_callback_7_11(int (*arg0)(struct vfsmount *, struct dentry *, struct kstat *), struct vfsmount *arg1, struct dentry *arg2, struct kstat *arg3) {
451 2 : ((& fat_getattr))(arg1, arg2, arg3);
452 1 : }
453 :
454 : /* AUX_FUNC_CALLBACK ldv_random_containerless_scenario_callback_7_16 */
455 : void ldv_random_containerless_scenario_callback_7_16(int (*arg0)(struct dentry *, struct iattr *), struct dentry *arg1, struct iattr *arg2) {
456 5 : ((& fat_setattr))(arg1, arg2);
457 1 : }
458 :
459 : /* AUX_FUNC_CALLBACK ldv_random_containerless_scenario_callback_7_22 */
460 : void ldv_random_containerless_scenario_callback_7_22(void (*arg0)(struct inode *), struct inode *arg1) {
461 2 : ((& fat_truncate))(arg1);
462 1 : }
463 :
464 :
465 : /* AUX_FUNC ERR_PTR */
466 : static inline void *ERR_PTR (long int error)
467 : {
468 :
469 : return ldv_err_ptr(error);
470 : }
471 :
472 : /* AUX_FUNC PTR_ERR */
473 : static inline long int PTR_ERR (void const *ptr)
474 : {
475 :
476 : return ldv_ptr_err(ptr);
477 : }
478 :
479 : /* AUX_FUNC IS_ERR */
480 : static inline long int IS_ERR (void const *ptr)
481 : {
482 :
483 : return ldv_is_err(ptr);
484 : }
485 :
486 : /* AUX_FUNC IS_ERR_OR_NULL */
487 : static inline long int IS_ERR_OR_NULL (void const *ptr)
488 : {
489 :
490 : return ldv_is_err_or_null(ptr);
491 : }
492 :
493 : /* AUX_FUNC kzalloc */
494 : static inline void *kzalloc (size_t size, gfp_t flags)
495 : {
496 :
497 : return ldv_kzalloc(size, flags);
498 : }
|