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 <scsi/scsi_host.h>
29 : #include <linux/usb.h>
30 :
31 :
32 : struct ldv_struct_insmod_12 {
33 : int signal_pending;
34 : };
35 :
36 : struct ldv_struct_scsi_LLDd_scenario_1 {
37 : struct Scsi_Host *arg0;
38 : int signal_pending;
39 : };
40 :
41 : struct ldv_struct_usb_scenario_11 {
42 : struct usb_driver *arg0;
43 : int signal_pending;
44 : };
45 :
46 : /* EMG Function declarations */
47 : void ldv_random_containerless_scenario_3(void *);
48 : extern void ldv_random_containerless_scenario_callback_3_10(ssize_t (*)(struct device *, struct device_attribute *, char *, size_t ), struct device *, struct device_attribute *, char *, long unsigned int);
49 : void ldv_random_containerless_scenario_callback_3_4(ssize_t (*)(struct device *, struct device_attribute *, char *), struct device *, struct device_attribute *, char *);
50 :
51 : /* EMG variable declarations */
52 1 : struct ldv_thread ldv_thread_3;
53 :
54 : /* EMG variable initialization */
55 :
56 : /* EMG function definitions */
57 : /* AUX_FUNC ldv_random_containerless_scenario_3 */
58 : void ldv_random_containerless_scenario_3(void *arg0) {
59 : /* LDV {"thread": 3, "type": "CONTROL_FUNCTION_BEGIN", "comment": "Control function 'random_containerless_scenario(struct_device_attribute)'", "function": "ldv_random_containerless_scenario_3"} */
60 1 : /* LDV {"type": "CONTROL_FUNCTION_INIT_BEGIN", "comment": "Declare auxiliary variables."} */
61 1 : ssize_t (*ldv_3_callback_show)(struct device *, struct device_attribute *, char *);
62 : ssize_t (*ldv_3_callback_store)(struct device *, struct device_attribute *, char *, size_t );
63 1 : struct device_attribute *ldv_3_container_struct_device_attribute;
64 1 : struct device *ldv_3_container_struct_device_ptr;
65 1 : char *ldv_3_ldv_param_10_2_default;
66 1 : long unsigned int ldv_3_ldv_param_10_3_default;
67 1 : char *ldv_3_ldv_param_4_2_default;
68 1 : /* LDV {"type": "CONTROL_FUNCTION_INIT_END", "comment": "Declare auxiliary variables."} */
69 1 : /* LDV {"action": "DEFAULT_REGISTER_7", "type": "RECEIVE_BEGIN", "comment": "Begin STRUCT_DEVICE_ATTRIBUTE callbacks invocations scenario."} */
70 3 : ldv_free(arg0);
71 1 : /* LDV {"action": "DEFAULT_REGISTER_7", "type": "RECEIVE_END"} */
72 1 :
73 1 : /* LDV {"action": "DEFAULT_ALLOC_7", "type": "CONDITION_BEGIN", "comment": "Allocate memory after default registration."} */
74 3 : ldv_3_container_struct_device_attribute = ldv_xmalloc_unknown_size(0);
75 3 : ldv_3_container_struct_device_ptr = ldv_xmalloc_unknown_size(0);
76 : /* LDV {"action": "DEFAULT_ALLOC_7", "type": "CONDITION_END"} */
77 :
78 : /* LDV {"action": "CALL", "type": "SUBPROCESS_BEGIN", "comment": "Prepare to call a random callback or deregister the callbacks."} */
79 : /* LDV {"action": "CALL", "type": "SUBPROCESS_END"} */
80 :
81 : /* Jump to a subprocess 'call' initial state */
82 1 : goto ldv_call_3;
83 : /* End of the process */
84 : return;
85 1 :
86 : /* Sbprocess call */
87 : ldv_call_3:
88 : /* LDV {"action": null, "type": "ARTIFICIAL", "comment": "Artificial state in scenario"} */
89 :
90 4 : if (ldv_undef_int()) {
91 : /* LDV {"action": "PRE_CALL_4", "type": "CONDITION_BEGIN", "comment": "Allocate memory for adhoc callback parameters."} */
92 3 : ldv_3_ldv_param_4_2_default = ldv_xmalloc_unknown_size(0);
93 : /* LDV {"action": "PRE_CALL_4", "type": "CONDITION_END"} */
94 :
95 4 : if (ldv_undef_int()) {
96 : /* LDV {"action": "PRE_CALL_10", "type": "CONDITION_BEGIN", "comment": "Allocate memory for adhoc callback parameters."} */
97 3 : ldv_3_ldv_param_10_2_default = ldv_xmalloc_unknown_size(0);
98 : /* LDV {"action": "PRE_CALL_10", "type": "CONDITION_END"} */
99 :
100 : /* LDV {"action": "CALLBACK", "type": "CALL_BEGIN", "callback": true, "comment": "Call any random callback. Invoke callback callback from STRUCT_DEVICE_ATTRIBUTE."} */
101 2 : if (ldv_3_callback_store) {
102 : /* LDV {"type": "CALLBACK", "call": "(ldv_3_callback_store)(ldv_3_container_struct_device_ptr, ldv_3_container_struct_device_attribute, ldv_3_ldv_param_10_2_default, ldv_3_ldv_param_10_3_default);", "comment": "callback"} */
103 2 : ldv_random_containerless_scenario_callback_3_10(ldv_3_callback_store, ldv_3_container_struct_device_ptr, ldv_3_container_struct_device_attribute, ldv_3_ldv_param_10_2_default, ldv_3_ldv_param_10_3_default);
104 : }
105 : /* LDV {"action": "CALLBACK", "type": "CALL_END"} */
106 :
107 : /* LDV {"action": "POST_CALL_10", "type": "CONDITION_BEGIN", "comment": "Free memory of adhoc callback parameters."} */
108 4 : ldv_free(ldv_3_ldv_param_10_2_default);
109 : /* LDV {"action": "POST_CALL_10", "type": "CONDITION_END"} */
110 :
111 : }
112 : else {
113 : /* LDV {"action": "CALLBACK", "type": "CALL_BEGIN", "callback": true, "comment": "Call any random callback. Invoke callback show from device_attribute."} */
114 : /* LDV {"type": "CALLBACK", "call": "((& show_truinst))(ldv_3_container_struct_device_ptr, ldv_3_container_struct_device_attribute, ldv_3_ldv_param_4_2_default);", "comment": "callback"} */
115 2 : ldv_random_containerless_scenario_callback_3_4(ldv_3_callback_show, ldv_3_container_struct_device_ptr, ldv_3_container_struct_device_attribute, ldv_3_ldv_param_4_2_default);
116 : /* LDV {"action": "CALLBACK", "type": "CALL_END"} */
117 :
118 : }
119 : /* LDV {"action": "POST_CALL_4", "type": "CONDITION_BEGIN", "comment": "Free memory of adhoc callback parameters."} */
120 4 : ldv_free(ldv_3_ldv_param_4_2_default);
121 : /* LDV {"action": "POST_CALL_4", "type": "CONDITION_END"} */
122 :
123 : /* LDV {"action": "CALL", "type": "SUBPROCESS_BEGIN", "comment": "Prepare to call a random callback or deregister the callbacks."} */
124 : /* LDV {"action": "CALL", "type": "SUBPROCESS_END"} */
125 :
126 : /* Jump to a subprocess 'call' initial state */
127 1 : goto ldv_call_3;
128 : }
129 : else {
130 : /* LDV {"action": "DEFAULT_FREE_7", "type": "CONDITION_BEGIN", "comment": "Free memory before default deregistration."} */
131 2 : ldv_free(ldv_3_container_struct_device_attribute);
132 2 : ldv_free(ldv_3_container_struct_device_ptr);
133 : /* LDV {"action": "DEFAULT_FREE_7", "type": "CONDITION_END"} */
134 :
135 : /* LDV {"action": "DEFAULT_DEREGISTER_7", "type": "RECEIVE_BEGIN", "comment": "Finish STRUCT_DEVICE_ATTRIBUTE callbacks invocations scenario."} */
136 : /* Skip a non-replicative signal receiving */
137 : /* LDV {"action": "DEFAULT_DEREGISTER_7", "type": "RECEIVE_END"} */
138 :
139 : /* Exit function at a terminal state */
140 1 : return;
141 : }
142 : /* End of the subprocess 'call' */
143 : return;
144 : /* LDV {"comment": "End of control function based on process 'random_containerless_scenario(struct_device_attribute)'", "type": "CONTROL_FUNCTION_END", "function": "ldv_random_containerless_scenario_3"} */
145 : }
146 :
147 : /* AUX_FUNC_CALLBACK ldv_random_containerless_scenario_callback_3_4 */
148 : void ldv_random_containerless_scenario_callback_3_4(ssize_t (*arg0)(struct device *, struct device_attribute *, char *), struct device *arg1, struct device_attribute *arg2, char *arg3) {
149 5 : ((& show_truinst))(arg1, arg2, arg3);
150 1 : }
151 :
152 :
153 : /* AUX_FUNC ERR_PTR */
154 : static inline void *ERR_PTR (long int error)
155 : {
156 :
157 : return ldv_err_ptr(error);
158 : }
159 :
160 : /* AUX_FUNC PTR_ERR */
161 : static inline long int PTR_ERR (void const *ptr)
162 : {
163 :
164 : return ldv_ptr_err(ptr);
165 : }
166 :
167 : /* AUX_FUNC IS_ERR */
168 : static inline long int IS_ERR (void const *ptr)
169 : {
170 :
171 : return ldv_is_err(ptr);
172 : }
173 :
174 : /* AUX_FUNC IS_ERR_OR_NULL */
175 : static inline long int IS_ERR_OR_NULL (void const *ptr)
176 : {
177 :
178 : return ldv_is_err_or_null(ptr);
179 : }
180 :
181 : /* AUX_FUNC kzalloc */
182 : static inline void *kzalloc (size_t size, gfp_t flags)
183 : {
184 :
185 : return ldv_kzalloc(size, flags);
186 : }
187 :
188 : /* AUX_FUNC ldv_dev_get_drvdata_6 */
189 : void *ldv_dev_get_drvdata_6 (struct device const *dev)
190 : {
191 :
192 : return ldv_dev_get_drvdata(dev);
193 : }
|