extern _Bool __VERIFIER_nondet_bool(void) ; extern void *malloc(size_t) ; __inline static IS_ERR(void const *ptr ) ; extern void abort(void); void assume_abort_if_not(int cond) { if(!cond) {abort();} } void *ldv_malloc(size_t size ) { if(__VERIFIER_nondet_bool()) return 0; void *p = malloc(size); assume_abort_if_not(IS_ERR(p) == 0); return p; } // Skip function: __VERIFIER_error // Skip function: __VERIFIER_nondet_int // Function: __kmalloc // with type: void *__kmalloc(size_t , gfp_t ) // with return type: (void)* void *__kmalloc(size_t arg0, gfp_t arg1) { // Pointer type return ldv_malloc(arg0); } // Function: __mutex_init // with type: void __mutex_init(struct mutex *, const char *, struct lock_class_key *) // with return type: void void __mutex_init(struct mutex *arg0, const char *arg1, struct lock_class_key *arg2) { // Void type return; } // Function: __release_region // with type: void __release_region(struct resource *, resource_size_t , resource_size_t ) // with return type: void void __release_region(struct resource *arg0, resource_size_t arg1, resource_size_t arg2) { // Void type return; } // Function: __request_region // with type: struct resource *__request_region(struct resource *, resource_size_t , resource_size_t , const char *, int) // with return type: (struct resource)* struct resource *__request_region(struct resource *arg0, resource_size_t arg1, resource_size_t arg2, const char *arg3, int arg4) { // Pointer type return ldv_malloc(sizeof(struct resource)); } // Function: _dev_info // with type: int _dev_info(const struct device *, const char *, ...) // with return type: int int __VERIFIER_nondet_int(void); int _dev_info(const struct device *arg0, const char *arg1, ...) { // Simple type return __VERIFIER_nondet_int(); } // Function: acpi_check_resource_conflict // with type: int acpi_check_resource_conflict(const struct resource *) // with return type: int int __VERIFIER_nondet_int(void); int acpi_check_resource_conflict(const struct resource *arg0) { // Simple type return __VERIFIER_nondet_int(); } // Function: dev_err // with type: int dev_err(const struct device *, const char *, ...) // with return type: int int __VERIFIER_nondet_int(void); int dev_err(const struct device *arg0, const char *arg1, ...) { // Simple type return __VERIFIER_nondet_int(); } // Function: dev_get_drvdata // with type: void *dev_get_drvdata(const struct device *) // with return type: (void)* void *dev_get_drvdata(const struct device *arg0) { // Pointer type return ldv_malloc(0UL); } // Function: dev_notice // with type: int dev_notice(const struct device *, const char *, ...) // with return type: int int __VERIFIER_nondet_int(void); int dev_notice(const struct device *arg0, const char *arg1, ...) { // Simple type return __VERIFIER_nondet_int(); } // Function: dev_printk // with type: int dev_printk(const char *, const struct device *, const char *, ...) // with return type: int int __VERIFIER_nondet_int(void); int dev_printk(const char *arg0, const struct device *arg1, const char *arg2, ...) { // Simple type return __VERIFIER_nondet_int(); } // Function: dev_set_drvdata // with type: int dev_set_drvdata(struct device *, void *) // with return type: int int __VERIFIER_nondet_int(void); int dev_set_drvdata(struct device *arg0, void *arg1) { // Simple type return __VERIFIER_nondet_int(); } // Function: dev_warn // with type: int dev_warn(const struct device *, const char *, ...) // with return type: int int __VERIFIER_nondet_int(void); int dev_warn(const struct device *arg0, const char *arg1, ...) { // Simple type return __VERIFIER_nondet_int(); } // Function: dmi_get_system_info // with type: const char *dmi_get_system_info(int) // with return type: (const char)* const char *dmi_get_system_info(int arg0) { // Pointer type return ldv_malloc(sizeof(char)); } // Function: hwmon_device_register // with type: struct device *hwmon_device_register(struct device *) // with return type: (struct device)* struct device *hwmon_device_register(struct device *arg0) { // Pointer type return ldv_malloc(sizeof(struct device)); } // Function: hwmon_device_unregister // with type: void hwmon_device_unregister(struct device *) // with return type: void void hwmon_device_unregister(struct device *arg0) { // Void type return; } // Skip function: kfree // Function: kstrtoll // with type: int kstrtoll(const char *, unsigned int, long long *) // with return type: int int __VERIFIER_nondet_int(void); int kstrtoll(const char *arg0, unsigned int arg1, long long *arg2) { // Simple type return __VERIFIER_nondet_int(); } // Function: kstrtoull // with type: int kstrtoull(const char *, unsigned int, unsigned long long *) // with return type: int int __VERIFIER_nondet_int(void); int kstrtoull(const char *arg0, unsigned int arg1, unsigned long long *arg2) { // Simple type return __VERIFIER_nondet_int(); } // Function: ldv_check_return_value // with type: void ldv_check_return_value(int) // with return type: void void ldv_check_return_value(int arg0) { // Void type return; } // Function: ldv_initialize // with type: void ldv_initialize() // with return type: void void ldv_initialize() { // Void type return; } // Function: ldv_undefined_int // with type: int ldv_undefined_int() // with return type: int int __VERIFIER_nondet_int(void); int ldv_undefined_int() { // Simple type return __VERIFIER_nondet_int(); } // Skip function: memset // Function: mutex_lock_nested // with type: void mutex_lock_nested(struct mutex *, unsigned int) // with return type: void void mutex_lock_nested(struct mutex *arg0, unsigned int arg1) { // Void type return; } // Function: mutex_unlock // with type: void mutex_unlock(struct mutex *) // with return type: void void mutex_unlock(struct mutex *arg0) { // Void type return; } // Function: platform_device_add // with type: int platform_device_add(struct platform_device *) // with return type: int int __VERIFIER_nondet_int(void); int platform_device_add(struct platform_device *arg0) { // Simple type return __VERIFIER_nondet_int(); } // Function: platform_device_add_data // with type: int platform_device_add_data(struct platform_device *, const void *, size_t ) // with return type: int int __VERIFIER_nondet_int(void); int platform_device_add_data(struct platform_device *arg0, const void *arg1, size_t arg2) { // Simple type return __VERIFIER_nondet_int(); } // Function: platform_device_add_resources // with type: int platform_device_add_resources(struct platform_device *, const struct resource *, unsigned int) // with return type: int int __VERIFIER_nondet_int(void); int platform_device_add_resources(struct platform_device *arg0, const struct resource *arg1, unsigned int arg2) { // Simple type return __VERIFIER_nondet_int(); } // Function: platform_device_alloc // with type: struct platform_device *platform_device_alloc(const char *, int) // with return type: (struct platform_device)* struct platform_device *platform_device_alloc(const char *arg0, int arg1) { // Pointer type return ldv_malloc(sizeof(struct platform_device)); } // Function: platform_device_put // with type: void platform_device_put(struct platform_device *) // with return type: void void platform_device_put(struct platform_device *arg0) { // Void type return; } // Function: platform_device_unregister // with type: void platform_device_unregister(struct platform_device *) // with return type: void void platform_device_unregister(struct platform_device *arg0) { // Void type return; } // Function: platform_driver_register // with type: int platform_driver_register(struct platform_driver *) // with return type: int int __VERIFIER_nondet_int(void); int platform_driver_register(struct platform_driver *arg0) { // Simple type return __VERIFIER_nondet_int(); } // Function: platform_driver_unregister // with type: void platform_driver_unregister(struct platform_driver *) // with return type: void void platform_driver_unregister(struct platform_driver *arg0) { // Void type return; } // Function: platform_get_resource // with type: struct resource *platform_get_resource(struct platform_device *, unsigned int, unsigned int) // with return type: (struct resource)* struct resource *platform_get_resource(struct platform_device *arg0, unsigned int arg1, unsigned int arg2) { // Pointer type return ldv_malloc(sizeof(struct resource)); } // Function: printk // with type: int printk(const char *, ...) // with return type: int int __VERIFIER_nondet_int(void); int printk(const char *arg0, ...) { // Simple type return __VERIFIER_nondet_int(); } // Skip function: sprintf // Skip function: strcmp // Function: sysfs_chmod_file // with type: int sysfs_chmod_file(struct kobject *, const struct attribute *, mode_t ) // with return type: int int __VERIFIER_nondet_int(void); int sysfs_chmod_file(struct kobject *arg0, const struct attribute *arg1, mode_t arg2) { // Simple type return __VERIFIER_nondet_int(); } // Function: sysfs_create_file // with type: int sysfs_create_file(struct kobject *, const struct attribute *) // with return type: int int __VERIFIER_nondet_int(void); int sysfs_create_file(struct kobject *arg0, const struct attribute *arg1) { // Simple type return __VERIFIER_nondet_int(); } // Function: sysfs_create_group // with type: int sysfs_create_group(struct kobject *, const struct attribute_group *) // with return type: int int __VERIFIER_nondet_int(void); int sysfs_create_group(struct kobject *arg0, const struct attribute_group *arg1) { // Simple type return __VERIFIER_nondet_int(); } // Function: sysfs_remove_file // with type: void sysfs_remove_file(struct kobject *, const struct attribute *) // with return type: void void sysfs_remove_file(struct kobject *arg0, const struct attribute *arg1) { // Void type return; } // Function: sysfs_remove_group // with type: void sysfs_remove_group(struct kobject *, const struct attribute_group *) // with return type: void void sysfs_remove_group(struct kobject *arg0, const struct attribute_group *arg1) { // Void type return; } // Function: vid_from_reg // with type: int vid_from_reg(int, u8 ) // with return type: int int __VERIFIER_nondet_int(void); int vid_from_reg(int arg0, u8 arg1) { // Simple type return __VERIFIER_nondet_int(); } // Function: vid_which_vrm // with type: u8 vid_which_vrm() // with return type: u8 unsigned char __VERIFIER_nondet_uchar(void); u8 vid_which_vrm() { // Typedef type // Real type: unsigned char // Simple type return __VERIFIER_nondet_uchar(); }