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/device.h>
29 : #include <linux/cdev.h>
30 : #include <linux/miscdevice.h>
31 : #include <linux/platform_device.h>
32 : #include <linux/pm.h>
33 : #include <linux/rtc.h>
34 : #include <scsi/scsi_host.h>
35 : #include <linux/fs.h>
36 : #include <linux/seq_file.h>
37 : #include <linux/pagemap.h>
38 :
39 :
40 : struct ldv_struct_platform_instance_4 {
41 : int signal_pending;
42 : };
43 :
44 : struct ldv_struct_traverse_kernel_items_scenario_10 {
45 : struct seq_file *arg0;
46 : struct seq_operations *arg1;
47 : int signal_pending;
48 : };
49 :
50 : /* EMG Function declarations */
51 : int ldv_insmod_scsi_complete_async_scans_46_18(int (*)(void));
52 : void ldv_random_containerless_scenario_45(void *);
53 : void ldv_random_containerless_scenario_callback_44_10(int (*)(char *, struct kernel_param *), char *, struct kernel_param *);
54 : void ldv_random_containerless_scenario_callback_44_4(int (*)(char *, struct kernel_param *), char *, struct kernel_param *);
55 : void ldv_random_containerless_scenario_callback_45_10(int (*)(char *, struct kernel_param *), char *, struct kernel_param *);
56 : void ldv_random_containerless_scenario_callback_45_4(int (*)(char *, struct kernel_param *), char *, struct kernel_param *);
57 : void ldv_rtc_class_scenario_release_9_2(void (*)(struct device *), struct device *);
58 :
59 : /* EMG variable declarations */
60 1 : struct ldv_thread ldv_thread_45;
61 :
62 : /* EMG variable initialization */
63 :
64 : /* EMG function definitions */
65 : /* AUX_FUNC_CALLBACK ldv_insmod_scsi_complete_async_scans_46_18 */
66 : int ldv_insmod_scsi_complete_async_scans_46_18(int (*arg0)(void)) {
67 4 : return (scsi_complete_async_scans)();
68 1 : }
69 :
70 : /* AUX_FUNC ldv_random_containerless_scenario_45 */
71 : void ldv_random_containerless_scenario_45(void *arg0) {
72 : /* LDV {"thread": 45, "type": "CONTROL_FUNCTION_BEGIN", "comment": "Control function 'random_containerless_scenario(struct_kernel_param)'", "function": "ldv_random_containerless_scenario_45"} */
73 1 : /* LDV {"type": "CONTROL_FUNCTION_INIT_BEGIN", "comment": "Declare auxiliary variables."} */
74 1 : int (*ldv_45_callback_get)(char *, struct kernel_param *);
75 1 : int (*ldv_45_callback_set)(char *, struct kernel_param *);
76 1 : struct kernel_param *ldv_45_container_struct_kernel_param;
77 1 : char *ldv_45_ldv_param_10_0_default;
78 1 : char *ldv_45_ldv_param_4_0_default;
79 1 : /* LDV {"type": "CONTROL_FUNCTION_INIT_END", "comment": "Declare auxiliary variables."} */
80 1 : /* LDV {"action": "DEFAULT_REGISTER_8", "type": "RECEIVE_BEGIN", "comment": "Begin STRUCT_KERNEL_PARAM callbacks invocations scenario."} */
81 3 : ldv_free(arg0);
82 1 : /* LDV {"action": "DEFAULT_REGISTER_8", "type": "RECEIVE_END"} */
83 :
84 : /* LDV {"action": "DEFAULT_ALLOC_8", "type": "CONDITION_BEGIN", "comment": "Allocate memory after default registration."} */
85 3 : ldv_45_container_struct_kernel_param = ldv_xmalloc_unknown_size(0);
86 : /* LDV {"action": "DEFAULT_ALLOC_8", "type": "CONDITION_END"} */
87 :
88 : /* LDV {"action": "CALL", "type": "SUBPROCESS_BEGIN", "comment": "Prepare to call a random callback or deregister the callbacks."} */
89 : /* LDV {"action": "CALL", "type": "SUBPROCESS_END"} */
90 :
91 : /* Jump to a subprocess 'call' initial state */
92 1 : goto ldv_call_45;
93 : /* End of the process */
94 : return;
95 1 :
96 : /* Sbprocess call */
97 : ldv_call_45:
98 : /* LDV {"action": null, "type": "ARTIFICIAL", "comment": "Artificial state in scenario"} */
99 :
100 4 : if (ldv_undef_int()) {
101 : /* LDV {"action": "PRE_CALL_4", "type": "CONDITION_BEGIN", "comment": "Allocate memory for adhoc callback parameters."} */
102 3 : ldv_45_ldv_param_4_0_default = ldv_xmalloc_unknown_size(0);
103 : /* LDV {"action": "PRE_CALL_4", "type": "CONDITION_END"} */
104 :
105 4 : if (ldv_undef_int()) {
106 : /* LDV {"action": "PRE_CALL_10", "type": "CONDITION_BEGIN", "comment": "Allocate memory for adhoc callback parameters."} */
107 3 : ldv_45_ldv_param_10_0_default = ldv_xmalloc_unknown_size(0);
108 : /* LDV {"action": "PRE_CALL_10", "type": "CONDITION_END"} */
109 :
110 : /* LDV {"action": "CALLBACK", "type": "CALL_BEGIN", "callback": true, "comment": "Call any random callback. Invoke callback set from kernel_param."} */
111 : /* LDV {"type": "CALLBACK", "call": "((& param_set_uint))(ldv_45_ldv_param_10_0_default, ldv_45_container_struct_kernel_param);", "comment": "callback"} */
112 2 : ldv_random_containerless_scenario_callback_45_10(ldv_45_callback_set, ldv_45_ldv_param_10_0_default, ldv_45_container_struct_kernel_param);
113 : /* LDV {"action": "CALLBACK", "type": "CALL_END"} */
114 :
115 : /* LDV {"action": "POST_CALL_10", "type": "CONDITION_BEGIN", "comment": "Free memory of adhoc callback parameters."} */
116 2 : ldv_free(ldv_45_ldv_param_10_0_default);
117 : /* LDV {"action": "POST_CALL_10", "type": "CONDITION_END"} */
118 :
119 : }
120 : else {
121 : /* LDV {"action": "CALLBACK", "type": "CALL_BEGIN", "callback": true, "comment": "Call any random callback. Invoke callback get from kernel_param."} */
122 : /* LDV {"type": "CALLBACK", "call": "((& param_get_uint))(ldv_45_ldv_param_4_0_default, ldv_45_container_struct_kernel_param);", "comment": "callback"} */
123 2 : ldv_random_containerless_scenario_callback_45_4(ldv_45_callback_get, ldv_45_ldv_param_4_0_default, ldv_45_container_struct_kernel_param);
124 : /* LDV {"action": "CALLBACK", "type": "CALL_END"} */
125 :
126 : }
127 : /* LDV {"action": "POST_CALL_4", "type": "CONDITION_BEGIN", "comment": "Free memory of adhoc callback parameters."} */
128 4 : ldv_free(ldv_45_ldv_param_4_0_default);
129 : /* LDV {"action": "POST_CALL_4", "type": "CONDITION_END"} */
130 :
131 : /* LDV {"action": "CALL", "type": "SUBPROCESS_BEGIN", "comment": "Prepare to call a random callback or deregister the callbacks."} */
132 : /* LDV {"action": "CALL", "type": "SUBPROCESS_END"} */
133 :
134 : /* Jump to a subprocess 'call' initial state */
135 1 : goto ldv_call_45;
136 : }
137 : else {
138 : /* LDV {"action": "DEFAULT_FREE_8", "type": "CONDITION_BEGIN", "comment": "Free memory before default deregistration."} */
139 2 : ldv_free(ldv_45_container_struct_kernel_param);
140 : /* LDV {"action": "DEFAULT_FREE_8", "type": "CONDITION_END"} */
141 :
142 : /* LDV {"action": "DEFAULT_DEREGISTER_8", "type": "RECEIVE_BEGIN", "comment": "Finish STRUCT_KERNEL_PARAM callbacks invocations scenario."} */
143 : /* Skip a non-replicative signal receiving */
144 : /* LDV {"action": "DEFAULT_DEREGISTER_8", "type": "RECEIVE_END"} */
145 :
146 : /* Exit function at a terminal state */
147 1 : return;
148 : }
149 : /* End of the subprocess 'call' */
150 : return;
151 : /* LDV {"comment": "End of control function based on process 'random_containerless_scenario(struct_kernel_param)'", "type": "CONTROL_FUNCTION_END", "function": "ldv_random_containerless_scenario_45"} */
152 : }
153 :
154 : /* AUX_FUNC_CALLBACK ldv_random_containerless_scenario_callback_44_10 */
155 : void ldv_random_containerless_scenario_callback_44_10(int (*arg0)(char *, struct kernel_param *), char *arg1, struct kernel_param *arg2) {
156 1 : ((& param_set_copystring))(arg1, arg2);
157 1 : }
158 :
159 : /* AUX_FUNC_CALLBACK ldv_random_containerless_scenario_callback_44_4 */
160 : void ldv_random_containerless_scenario_callback_44_4(int (*arg0)(char *, struct kernel_param *), char *arg1, struct kernel_param *arg2) {
161 1 : ((& param_get_string))(arg1, arg2);
162 1 : }
163 :
164 : /* AUX_FUNC_CALLBACK ldv_random_containerless_scenario_callback_45_10 */
165 : void ldv_random_containerless_scenario_callback_45_10(int (*arg0)(char *, struct kernel_param *), char *arg1, struct kernel_param *arg2) {
166 1 : ((& param_set_uint))(arg1, arg2);
167 1 : }
168 :
169 : /* AUX_FUNC_CALLBACK ldv_random_containerless_scenario_callback_45_4 */
170 : void ldv_random_containerless_scenario_callback_45_4(int (*arg0)(char *, struct kernel_param *), char *arg1, struct kernel_param *arg2) {
171 1 : ((& param_get_uint))(arg1, arg2);
172 1 : }
173 :
174 : /* AUX_FUNC_CALLBACK ldv_rtc_class_scenario_release_9_2 */
175 : void ldv_rtc_class_scenario_release_9_2(void (*arg0)(struct device *), struct device *arg1) {
176 2 : ((& scsi_target_dev_release))(arg1);
177 1 : }
178 :
179 :
180 : /* AUX_FUNC ERR_PTR */
181 : static inline void *ERR_PTR (long int error)
182 : {
183 139 :
184 417 : return ldv_err_ptr(error);
185 : }
186 :
187 : /* AUX_FUNC PTR_ERR */
188 : static inline long int PTR_ERR (void const *ptr)
189 : {
190 :
191 : return ldv_ptr_err(ptr);
192 : }
193 :
194 : /* AUX_FUNC IS_ERR */
195 : static inline long int IS_ERR (void const *ptr)
196 : {
197 :
198 : return ldv_is_err(ptr);
199 : }
200 :
201 : /* AUX_FUNC IS_ERR_OR_NULL */
202 : static inline long int IS_ERR_OR_NULL (void const *ptr)
203 : {
204 :
205 : return ldv_is_err_or_null(ptr);
206 : }
207 :
208 : /* AUX_FUNC kzalloc */
209 : static inline void *kzalloc (size_t size, gfp_t flags)
210 : {
211 :
212 : return ldv_kzalloc(size, flags);
213 : }
|