Bug

[В начало]

Ошибка # 184

Показать/спрятать трассу ошибок
Error trace
Function bodies
Blocks
  • Others...
    Function bodies without model function calls
    Initialization function calls
    Initialization function bodies
    Entry point
    Entry point body
    Function calls
    Skipped function calls
    Formal parameter names
    Declarations
    Assumes
    Assume conditions
    Returns
    Return values
    DEG initialization
    DEG function calls
    Model function calls
    Model function bodies
    Model asserts
    Model state changes
    Model function function calls
    Model function function bodies
    Model returns
    Model others
    Identation
    Line numbers
    Expand signs
-__CPAchecker_initialize()
{
20 typedef unsigned char __u8;
23 typedef unsigned short __u16;
25 typedef int __s32;
26 typedef unsigned int __u32;
29 typedef long long __s64;
30 typedef unsigned long long __u64;
15 typedef signed char s8;
16 typedef unsigned char u8;
18 typedef short s16;
19 typedef unsigned short u16;
21 typedef int s32;
22 typedef unsigned int u32;
24 typedef long long s64;
25 typedef unsigned long long u64;
14 typedef long __kernel_long_t;
15 typedef unsigned long __kernel_ulong_t;
27 typedef int __kernel_pid_t;
48 typedef unsigned int __kernel_uid32_t;
49 typedef unsigned int __kernel_gid32_t;
71 typedef __kernel_ulong_t __kernel_size_t;
72 typedef __kernel_long_t __kernel_ssize_t;
87 typedef long long __kernel_loff_t;
88 typedef __kernel_long_t __kernel_time_t;
89 typedef __kernel_long_t __kernel_clock_t;
90 typedef int __kernel_timer_t;
91 typedef int __kernel_clockid_t;
287 struct kernel_symbol { unsigned long value; const char *name; } ;
34 struct module ;
12 typedef __u32 __kernel_dev_t;
15 typedef __kernel_dev_t dev_t;
18 typedef unsigned short umode_t;
21 typedef __kernel_pid_t pid_t;
26 typedef __kernel_clockid_t clockid_t;
29 typedef _Bool bool;
31 typedef __kernel_uid32_t uid_t;
32 typedef __kernel_gid32_t gid_t;
45 typedef __kernel_loff_t loff_t;
54 typedef __kernel_size_t size_t;
59 typedef __kernel_ssize_t ssize_t;
69 typedef __kernel_time_t time_t;
102 typedef __s32 int32_t;
108 typedef __u32 uint32_t;
133 typedef unsigned long sector_t;
134 typedef unsigned long blkcnt_t;
157 typedef unsigned int gfp_t;
158 typedef unsigned int fmode_t;
161 typedef u64 phys_addr_t;
166 typedef phys_addr_t resource_size_t;
176 struct __anonstruct_atomic_t_6 { int counter; } ;
176 typedef struct __anonstruct_atomic_t_6 atomic_t;
181 struct __anonstruct_atomic64_t_7 { long counter; } ;
181 typedef struct __anonstruct_atomic64_t_7 atomic64_t;
182 struct list_head { struct list_head *next; struct list_head *prev; } ;
187 struct hlist_node ;
187 struct hlist_head { struct hlist_node *first; } ;
191 struct hlist_node { struct hlist_node *next; struct hlist_node **pprev; } ;
202 struct callback_head { struct callback_head *next; void (*func)(struct callback_head *); } ;
117 typedef void (*ctor_fn_t)();
58 struct device ;
474 struct file_operations ;
486 struct completion ;
487 struct pt_regs ;
21 struct resource { resource_size_t start; resource_size_t end; const char *name; unsigned long flags; unsigned long desc; struct resource *parent; struct resource *sibling; struct resource *child; } ;
65 union __anonunion___u_11 { struct list_head *__val; char __c[1U]; } ;
105 union __anonunion___u_13 { struct list_head *__val; char __c[1U]; } ;
546 struct task_struct ;
20 struct qspinlock { atomic_t val; } ;
33 typedef struct qspinlock arch_spinlock_t;
34 struct qrwlock { atomic_t cnts; arch_spinlock_t wait_lock; } ;
14 typedef struct qrwlock arch_rwlock_t;
15 struct lockdep_map ;
23 typedef atomic64_t atomic_long_t;
242 struct bug_entry { int bug_addr_disp; int file_disp; unsigned short line; unsigned short flags; } ;
55 struct stack_trace { unsigned int nr_entries; unsigned int max_entries; unsigned long *entries; int skip; } ;
30 struct lockdep_subclass_key { char __one_byte; } ;
53 struct lock_class_key { struct lockdep_subclass_key subkeys[8U]; } ;
59 struct lock_class { struct hlist_node hash_entry; struct list_head lock_entry; struct lockdep_subclass_key *key; unsigned int subclass; unsigned int dep_gen_id; unsigned long usage_mask; struct stack_trace usage_traces[13U]; struct list_head locks_after; struct list_head locks_before; unsigned int version; unsigned long ops; const char *name; int name_version; unsigned long contention_point[4U]; unsigned long contending_point[4U]; } ;
144 struct lockdep_map { struct lock_class_key *key; struct lock_class *class_cache[2U]; const char *name; int cpu; unsigned long ip; } ;
207 struct held_lock { u64 prev_chain_key; unsigned long acquire_ip; struct lockdep_map *instance; struct lockdep_map *nest_lock; u64 waittime_stamp; u64 holdtime_stamp; unsigned short class_idx; unsigned char irq_context; unsigned char trylock; unsigned char read; unsigned char check; unsigned char hardirqs_off; unsigned short references; unsigned int pin_count; } ;
596 struct raw_spinlock { arch_spinlock_t raw_lock; unsigned int magic; unsigned int owner_cpu; void *owner; struct lockdep_map dep_map; } ;
32 typedef struct raw_spinlock raw_spinlock_t;
33 struct __anonstruct____missing_field_name_39 { u8 __padding[24U]; struct lockdep_map dep_map; } ;
33 union __anonunion____missing_field_name_38 { struct raw_spinlock rlock; struct __anonstruct____missing_field_name_39 __annonCompField4; } ;
33 struct spinlock { union __anonunion____missing_field_name_38 __annonCompField5; } ;
76 typedef struct spinlock spinlock_t;
23 struct __anonstruct_rwlock_t_40 { arch_rwlock_t raw_lock; unsigned int magic; unsigned int owner_cpu; void *owner; struct lockdep_map dep_map; } ;
23 typedef struct __anonstruct_rwlock_t_40 rwlock_t;
23 struct mm_struct ;
72 struct pt_regs { unsigned long r15; unsigned long r14; unsigned long r13; unsigned long r12; unsigned long bp; unsigned long bx; unsigned long r11; unsigned long r10; unsigned long r9; unsigned long r8; unsigned long ax; unsigned long cx; unsigned long dx; unsigned long si; unsigned long di; unsigned long orig_ax; unsigned long ip; unsigned long cs; unsigned long flags; unsigned long sp; unsigned long ss; } ;
66 struct __anonstruct____missing_field_name_42 { unsigned int a; unsigned int b; } ;
66 struct __anonstruct____missing_field_name_43 { u16 limit0; u16 base0; unsigned char base1; unsigned char type; unsigned char s; unsigned char dpl; unsigned char p; unsigned char limit; unsigned char avl; unsigned char l; unsigned char d; unsigned char g; unsigned char base2; } ;
66 union __anonunion____missing_field_name_41 { struct __anonstruct____missing_field_name_42 __annonCompField6; struct __anonstruct____missing_field_name_43 __annonCompField7; } ;
66 struct desc_struct { union __anonunion____missing_field_name_41 __annonCompField8; } ;
17 typedef unsigned long pgdval_t;
18 typedef unsigned long pgprotval_t;
22 struct pgprot { pgprotval_t pgprot; } ;
256 typedef struct pgprot pgprot_t;
258 struct __anonstruct_pgd_t_45 { pgdval_t pgd; } ;
258 typedef struct __anonstruct_pgd_t_45 pgd_t;
460 struct page ;
460 typedef struct page *pgtable_t;
471 struct file ;
482 struct seq_file ;
519 struct thread_struct ;
521 struct cpumask ;
247 struct math_emu_info { long ___orig_eip; struct pt_regs *regs; } ;
83 struct static_key { atomic_t enabled; } ;
380 struct cpumask { unsigned long bits[128U]; } ;
15 typedef struct cpumask cpumask_t;
685 typedef struct cpumask *cpumask_var_t;
22 struct tracepoint_func { void *func; void *data; int prio; } ;
28 struct tracepoint { const char *name; struct static_key key; int (*regfunc)(); void (*unregfunc)(); struct tracepoint_func *funcs; } ;
237 struct fregs_state { u32 cwd; u32 swd; u32 twd; u32 fip; u32 fcs; u32 foo; u32 fos; u32 st_space[20U]; u32 status; } ;
26 struct __anonstruct____missing_field_name_61 { u64 rip; u64 rdp; } ;
26 struct __anonstruct____missing_field_name_62 { u32 fip; u32 fcs; u32 foo; u32 fos; } ;
26 union __anonunion____missing_field_name_60 { struct __anonstruct____missing_field_name_61 __annonCompField14; struct __anonstruct____missing_field_name_62 __annonCompField15; } ;
26 union __anonunion____missing_field_name_63 { u32 padding1[12U]; u32 sw_reserved[12U]; } ;
26 struct fxregs_state { u16 cwd; u16 swd; u16 twd; u16 fop; union __anonunion____missing_field_name_60 __annonCompField16; u32 mxcsr; u32 mxcsr_mask; u32 st_space[32U]; u32 xmm_space[64U]; u32 padding[12U]; union __anonunion____missing_field_name_63 __annonCompField17; } ;
66 struct swregs_state { u32 cwd; u32 swd; u32 twd; u32 fip; u32 fcs; u32 foo; u32 fos; u32 st_space[20U]; u8 ftop; u8 changed; u8 lookahead; u8 no_update; u8 rm; u8 alimit; struct math_emu_info *info; u32 entry_eip; } ;
227 struct xstate_header { u64 xfeatures; u64 xcomp_bv; u64 reserved[6U]; } ;
233 struct xregs_state { struct fxregs_state i387; struct xstate_header header; u8 extended_state_area[0U]; } ;
254 union fpregs_state { struct fregs_state fsave; struct fxregs_state fxsave; struct swregs_state soft; struct xregs_state xsave; u8 __padding[4096U]; } ;
271 struct fpu { unsigned int last_cpu; unsigned char fpstate_active; unsigned char fpregs_active; union fpregs_state state; } ;
174 struct seq_operations ;
416 struct perf_event ;
421 struct __anonstruct_mm_segment_t_75 { unsigned long seg; } ;
421 typedef struct __anonstruct_mm_segment_t_75 mm_segment_t;
422 struct thread_struct { struct desc_struct tls_array[3U]; unsigned long sp0; unsigned long sp; unsigned short es; unsigned short ds; unsigned short fsindex; unsigned short gsindex; u32 status; unsigned long fsbase; unsigned long gsbase; struct perf_event *ptrace_bps[4U]; unsigned long debugreg6; unsigned long ptrace_dr7; unsigned long cr2; unsigned long trap_nr; unsigned long error_code; unsigned long *io_bitmap_ptr; unsigned long iopl; unsigned int io_bitmap_max; mm_segment_t addr_limit; unsigned char sig_on_uaccess_err; unsigned char uaccess_err; struct fpu fpu; } ;
13 struct optimistic_spin_queue { atomic_t tail; } ;
39 struct ww_acquire_ctx ;
40 struct mutex { atomic_long_t owner; spinlock_t wait_lock; struct optimistic_spin_queue osq; struct list_head wait_list; void *magic; struct lockdep_map dep_map; } ;
72 struct mutex_waiter { struct list_head list; struct task_struct *task; struct ww_acquire_ctx *ww_ctx; void *magic; } ;
229 struct timespec ;
230 struct compat_timespec ;
231 struct pollfd ;
232 enum timespec_type { TT_NONE = 0, TT_NATIVE = 1, TT_COMPAT = 2 } ;
238 struct __anonstruct_futex_77 { u32 *uaddr; u32 val; u32 flags; u32 bitset; u64 time; u32 *uaddr2; } ;
238 union __anonunion____missing_field_name_79 { struct timespec *rmtp; struct compat_timespec *compat_rmtp; } ;
238 struct __anonstruct_nanosleep_78 { clockid_t clockid; enum timespec_type type; union __anonunion____missing_field_name_79 __annonCompField20; u64 expires; } ;
238 struct __anonstruct_poll_80 { struct pollfd *ufds; int nfds; int has_timeout; unsigned long tv_sec; unsigned long tv_nsec; } ;
238 union __anonunion____missing_field_name_76 { struct __anonstruct_futex_77 futex; struct __anonstruct_nanosleep_78 nanosleep; struct __anonstruct_poll_80 poll; } ;
238 struct restart_block { long int (*fn)(struct restart_block *); union __anonunion____missing_field_name_76 __annonCompField21; } ;
48 struct thread_info { unsigned long flags; } ;
65 struct radix_tree_root ;
65 union __anonunion____missing_field_name_87 { struct list_head private_list; struct callback_head callback_head; } ;
65 struct radix_tree_node { unsigned char shift; unsigned char offset; unsigned char count; unsigned char exceptional; struct radix_tree_node *parent; struct radix_tree_root *root; union __anonunion____missing_field_name_87 __annonCompField22; void *slots[64U]; unsigned long tags[3U][1U]; } ;
107 struct radix_tree_root { gfp_t gfp_mask; struct radix_tree_node *rnode; } ;
566 struct vm_area_struct ;
31 struct wait_queue_head { spinlock_t lock; struct list_head head; } ;
36 typedef struct wait_queue_head wait_queue_head_t;
950 struct seqcount { unsigned int sequence; struct lockdep_map dep_map; } ;
52 typedef struct seqcount seqcount_t;
97 struct __anonstruct_nodemask_t_101 { unsigned long bits[16U]; } ;
97 typedef struct __anonstruct_nodemask_t_101 nodemask_t;
253 typedef unsigned int isolate_mode_t;
764 struct rw_semaphore ;
765 struct rw_semaphore { atomic_long_t count; struct list_head wait_list; raw_spinlock_t wait_lock; struct optimistic_spin_queue osq; struct task_struct *owner; struct lockdep_map dep_map; } ;
178 struct timespec { __kernel_time_t tv_sec; long tv_nsec; } ;
7 typedef __s64 time64_t;
28 typedef s64 ktime_t;
109 struct timer_list { struct hlist_node entry; unsigned long expires; void (*function)(unsigned long); unsigned long data; u32 flags; struct lockdep_map lockdep_map; } ;
211 struct hrtimer ;
212 enum hrtimer_restart ;
235 struct workqueue_struct ;
236 struct work_struct ;
54 struct work_struct { atomic_long_t data; struct list_head entry; void (*func)(struct work_struct *); struct lockdep_map lockdep_map; } ;
107 struct delayed_work { struct work_struct work; struct timer_list timer; struct workqueue_struct *wq; int cpu; } ;
42 struct completion { unsigned int done; wait_queue_head_t wait; } ;
38 struct ldt_struct ;
38 struct vdso_image ;
38 struct __anonstruct_mm_context_t_166 { struct ldt_struct *ldt; unsigned short ia32_compat; struct mutex lock; void *vdso; const struct vdso_image *vdso_image; atomic_t perf_rdpmc_allowed; u16 pkey_allocation_map; s16 execute_only_pkey; void *bd_addr; } ;
38 typedef struct __anonstruct_mm_context_t_166 mm_context_t;
1314 struct llist_node ;
69 struct llist_node { struct llist_node *next; } ;
176 struct ida { struct radix_tree_root ida_rt; } ;
216 struct rb_node { unsigned long __rb_parent_color; struct rb_node *rb_right; struct rb_node *rb_left; } ;
41 struct rb_root { struct rb_node *rb_node; } ;
100 struct dentry ;
101 struct iattr ;
102 struct super_block ;
103 struct file_system_type ;
104 struct kernfs_open_node ;
105 struct kernfs_iattrs ;
129 struct kernfs_root ;
129 struct kernfs_elem_dir { unsigned long subdirs; struct rb_root children; struct kernfs_root *root; } ;
86 struct kernfs_node ;
86 struct kernfs_elem_symlink { struct kernfs_node *target_kn; } ;
90 struct kernfs_ops ;
90 struct kernfs_elem_attr { const struct kernfs_ops *ops; struct kernfs_open_node *open; loff_t size; struct kernfs_node *notify_next; } ;
97 union __anonunion____missing_field_name_216 { struct kernfs_elem_dir dir; struct kernfs_elem_symlink symlink; struct kernfs_elem_attr attr; } ;
97 struct kernfs_node { atomic_t count; atomic_t active; struct lockdep_map dep_map; struct kernfs_node *parent; const char *name; struct rb_node rb; const void *ns; unsigned int hash; union __anonunion____missing_field_name_216 __annonCompField33; void *priv; unsigned short flags; umode_t mode; unsigned int ino; struct kernfs_iattrs *iattr; } ;
139 struct kernfs_syscall_ops { int (*remount_fs)(struct kernfs_root *, int *, char *); int (*show_options)(struct seq_file *, struct kernfs_root *); int (*mkdir)(struct kernfs_node *, const char *, umode_t ); int (*rmdir)(struct kernfs_node *); int (*rename)(struct kernfs_node *, struct kernfs_node *, const char *); int (*show_path)(struct seq_file *, struct kernfs_node *, struct kernfs_root *); } ;
158 struct kernfs_root { struct kernfs_node *kn; unsigned int flags; struct ida ino_ida; struct kernfs_syscall_ops *syscall_ops; struct list_head supers; wait_queue_head_t deactivate_waitq; } ;
174 struct vm_operations_struct ;
174 struct kernfs_open_file { struct kernfs_node *kn; struct file *file; struct seq_file *seq_file; void *priv; struct mutex mutex; struct mutex prealloc_mutex; int event; struct list_head list; char *prealloc_buf; size_t atomic_write_len; bool mmapped; bool released; const struct vm_operations_struct *vm_ops; } ;
194 struct kernfs_ops { int (*open)(struct kernfs_open_file *); void (*release)(struct kernfs_open_file *); int (*seq_show)(struct seq_file *, void *); void * (*seq_start)(struct seq_file *, loff_t *); void * (*seq_next)(struct seq_file *, void *, loff_t *); void (*seq_stop)(struct seq_file *, void *); ssize_t (*read)(struct kernfs_open_file *, char *, size_t , loff_t ); size_t atomic_write_len; bool prealloc; ssize_t (*write)(struct kernfs_open_file *, char *, size_t , loff_t ); int (*mmap)(struct kernfs_open_file *, struct vm_area_struct *); struct lock_class_key lockdep_key; } ;
296 struct inode ;
521 struct sock ;
522 struct kobject ;
523 enum kobj_ns_type { KOBJ_NS_TYPE_NONE = 0, KOBJ_NS_TYPE_NET = 1, KOBJ_NS_TYPES = 2 } ;
529 struct kobj_ns_type_operations { enum kobj_ns_type type; bool (*current_may_mount)(); void * (*grab_current_ns)(); const void * (*netlink_ns)(struct sock *); const void * (*initial_ns)(); void (*drop_ns)(void *); } ;
83 struct user_namespace ;
22 struct __anonstruct_kuid_t_219 { uid_t val; } ;
22 typedef struct __anonstruct_kuid_t_219 kuid_t;
27 struct __anonstruct_kgid_t_220 { gid_t val; } ;
27 typedef struct __anonstruct_kgid_t_220 kgid_t;
139 struct kstat { u32 result_mask; umode_t mode; unsigned int nlink; uint32_t blksize; u64 attributes; u64 attributes_mask; u64 ino; dev_t dev; dev_t rdev; kuid_t uid; kgid_t gid; loff_t size; struct timespec atime; struct timespec mtime; struct timespec ctime; struct timespec btime; u64 blocks; } ;
49 struct bin_attribute ;
50 struct attribute { const char *name; umode_t mode; bool ignore_lockdep; struct lock_class_key *key; struct lock_class_key skey; } ;
37 struct attribute_group { const char *name; umode_t (*is_visible)(struct kobject *, struct attribute *, int); umode_t (*is_bin_visible)(struct kobject *, struct bin_attribute *, int); struct attribute **attrs; struct bin_attribute **bin_attrs; } ;
92 struct bin_attribute { struct attribute attr; size_t size; void *private; ssize_t (*read)(struct file *, struct kobject *, struct bin_attribute *, char *, loff_t , size_t ); ssize_t (*write)(struct file *, struct kobject *, struct bin_attribute *, char *, loff_t , size_t ); int (*mmap)(struct file *, struct kobject *, struct bin_attribute *, struct vm_area_struct *); } ;
165 struct sysfs_ops { ssize_t (*show)(struct kobject *, struct attribute *, char *); ssize_t (*store)(struct kobject *, struct attribute *, const char *, size_t ); } ;
530 struct refcount_struct { atomic_t refs; } ;
19 typedef struct refcount_struct refcount_t;
96 struct kref { refcount_t refcount; } ;
52 struct kset ;
52 struct kobj_type ;
52 struct kobject { const char *name; struct list_head entry; struct kobject *parent; struct kset *kset; struct kobj_type *ktype; struct kernfs_node *sd; struct kref kref; struct delayed_work release; unsigned char state_initialized; unsigned char state_in_sysfs; unsigned char state_add_uevent_sent; unsigned char state_remove_uevent_sent; unsigned char uevent_suppress; } ;
117 struct kobj_type { void (*release)(struct kobject *); const struct sysfs_ops *sysfs_ops; struct attribute **default_attrs; const struct kobj_ns_type_operations * (*child_ns_type)(struct kobject *); const void * (*namespace)(struct kobject *); } ;
125 struct kobj_uevent_env { char *argv[3U]; char *envp[32U]; int envp_idx; char buf[2048U]; int buflen; } ;
133 struct kset_uevent_ops { const int (*filter)(struct kset *, struct kobject *); const const char * (*name)(struct kset *, struct kobject *); const int (*uevent)(struct kset *, struct kobject *, struct kobj_uevent_env *); } ;
150 struct kset { struct list_head list; spinlock_t list_lock; struct kobject kobj; const struct kset_uevent_ops *uevent_ops; } ;
224 struct klist_node ;
37 struct klist_node { void *n_klist; struct list_head n_node; struct kref n_ref; } ;
93 struct hlist_bl_node ;
93 struct hlist_bl_head { struct hlist_bl_node *first; } ;
36 struct hlist_bl_node { struct hlist_bl_node *next; struct hlist_bl_node **pprev; } ;
114 struct __anonstruct____missing_field_name_268 { spinlock_t lock; int count; } ;
114 union __anonunion____missing_field_name_267 { struct __anonstruct____missing_field_name_268 __annonCompField34; } ;
114 struct lockref { union __anonunion____missing_field_name_267 __annonCompField35; } ;
77 struct path ;
78 struct vfsmount ;
79 struct __anonstruct____missing_field_name_270 { u32 hash; u32 len; } ;
79 union __anonunion____missing_field_name_269 { struct __anonstruct____missing_field_name_270 __annonCompField36; u64 hash_len; } ;
79 struct qstr { union __anonunion____missing_field_name_269 __annonCompField37; const unsigned char *name; } ;
71 struct dentry_operations ;
71 union __anonunion____missing_field_name_271 { struct list_head d_lru; wait_queue_head_t *d_wait; } ;
71 union __anonunion_d_u_272 { struct hlist_node d_alias; struct hlist_bl_node d_in_lookup_hash; struct callback_head d_rcu; } ;
71 struct dentry { unsigned int d_flags; seqcount_t d_seq; struct hlist_bl_node d_hash; struct dentry *d_parent; struct qstr d_name; struct inode *d_inode; unsigned char d_iname[32U]; struct lockref d_lockref; const struct dentry_operations *d_op; struct super_block *d_sb; unsigned long d_time; void *d_fsdata; union __anonunion____missing_field_name_271 __annonCompField38; struct list_head d_child; struct list_head d_subdirs; union __anonunion_d_u_272 d_u; } ;
127 struct dentry_operations { int (*d_revalidate)(struct dentry *, unsigned int); int (*d_weak_revalidate)(struct dentry *, unsigned int); int (*d_hash)(const struct dentry *, struct qstr *); int (*d_compare)(const struct dentry *, unsigned int, const char *, const struct qstr *); int (*d_delete)(const struct dentry *); int (*d_init)(struct dentry *); void (*d_release)(struct dentry *); void (*d_prune)(struct dentry *); void (*d_iput)(struct dentry *, struct inode *); char * (*d_dname)(struct dentry *, char *, int); struct vfsmount * (*d_automount)(struct path *); int (*d_manage)(const struct path *, bool ); struct dentry * (*d_real)(struct dentry *, const struct inode *, unsigned int); } ;
605 struct path { struct vfsmount *mnt; struct dentry *dentry; } ;
19 struct mem_cgroup ;
19 struct shrink_control { gfp_t gfp_mask; unsigned long nr_to_scan; int nid; struct mem_cgroup *memcg; } ;
27 struct shrinker { unsigned long int (*count_objects)(struct shrinker *, struct shrink_control *); unsigned long int (*scan_objects)(struct shrinker *, struct shrink_control *); int seeks; long batch; unsigned long flags; struct list_head list; atomic_long_t *nr_deferred; } ;
80 struct list_lru_one { struct list_head list; long nr_items; } ;
32 struct list_lru_memcg { struct list_lru_one *lru[0U]; } ;
37 struct list_lru_node { spinlock_t lock; struct list_lru_one lru; struct list_lru_memcg *memcg_lrus; long nr_items; } ;
49 struct list_lru { struct list_lru_node *node; struct list_head list; } ;
190 enum pid_type { PIDTYPE_PID = 0, PIDTYPE_PGID = 1, PIDTYPE_SID = 2, PIDTYPE_MAX = 3 } ;
197 struct pid_namespace ;
197 struct upid { int nr; struct pid_namespace *ns; struct hlist_node pid_chain; } ;
56 struct pid { atomic_t count; unsigned int level; struct hlist_head tasks[3U]; struct callback_head rcu; struct upid numbers[1U]; } ;
68 struct pid_link { struct hlist_node node; struct pid *pid; } ;
174 struct arch_tlbflush_unmap_batch { struct cpumask cpumask; } ;
13 struct vmacache { u32 seqnum; struct vm_area_struct *vmas[4U]; } ;
45 struct task_rss_stat { int events; int count[4U]; } ;
53 struct mm_rss_stat { atomic_long_t count[4U]; } ;
58 struct page_frag { struct page *page; __u32 offset; __u32 size; } ;
65 struct tlbflush_unmap_batch { struct arch_tlbflush_unmap_batch arch; bool flush_required; bool writable; } ;
58 struct arch_uprobe_task { unsigned long saved_scratch_register; unsigned int saved_trap_nr; unsigned int saved_tf; } ;
66 enum uprobe_task_state { UTASK_RUNNING = 0, UTASK_SSTEP = 1, UTASK_SSTEP_ACK = 2, UTASK_SSTEP_TRAPPED = 3 } ;
73 struct __anonstruct____missing_field_name_278 { struct arch_uprobe_task autask; unsigned long vaddr; } ;
73 struct __anonstruct____missing_field_name_279 { struct callback_head dup_xol_work; unsigned long dup_xol_addr; } ;
73 union __anonunion____missing_field_name_277 { struct __anonstruct____missing_field_name_278 __annonCompField41; struct __anonstruct____missing_field_name_279 __annonCompField42; } ;
73 struct uprobe ;
73 struct return_instance ;
73 struct uprobe_task { enum uprobe_task_state state; union __anonunion____missing_field_name_277 __annonCompField43; struct uprobe *active_uprobe; unsigned long xol_vaddr; struct return_instance *return_instances; unsigned int depth; } ;
95 struct return_instance { struct uprobe *uprobe; unsigned long func; unsigned long stack; unsigned long orig_ret_vaddr; bool chained; struct return_instance *next; } ;
111 struct xol_area ;
112 struct uprobes_state { struct xol_area *xol_area; } ;
151 struct address_space ;
152 union __anonunion____missing_field_name_280 { struct address_space *mapping; void *s_mem; atomic_t compound_mapcount; } ;
152 union __anonunion____missing_field_name_281 { unsigned long index; void *freelist; } ;
152 struct __anonstruct____missing_field_name_285 { unsigned short inuse; unsigned short objects; unsigned char frozen; } ;
152 union __anonunion____missing_field_name_284 { atomic_t _mapcount; unsigned int active; struct __anonstruct____missing_field_name_285 __annonCompField46; int units; } ;
152 struct __anonstruct____missing_field_name_283 { union __anonunion____missing_field_name_284 __annonCompField47; atomic_t _refcount; } ;
152 union __anonunion____missing_field_name_282 { unsigned long counters; struct __anonstruct____missing_field_name_283 __annonCompField48; } ;
152 struct dev_pagemap ;
152 struct __anonstruct____missing_field_name_287 { struct page *next; int pages; int pobjects; } ;
152 struct __anonstruct____missing_field_name_288 { unsigned long compound_head; unsigned int compound_dtor; unsigned int compound_order; } ;
152 struct __anonstruct____missing_field_name_289 { unsigned long __pad; pgtable_t pmd_huge_pte; } ;
152 union __anonunion____missing_field_name_286 { struct list_head lru; struct dev_pagemap *pgmap; struct __anonstruct____missing_field_name_287 __annonCompField50; struct callback_head callback_head; struct __anonstruct____missing_field_name_288 __annonCompField51; struct __anonstruct____missing_field_name_289 __annonCompField52; } ;
152 struct kmem_cache ;
152 union __anonunion____missing_field_name_290 { unsigned long private; spinlock_t *ptl; struct kmem_cache *slab_cache; } ;
152 struct page { unsigned long flags; union __anonunion____missing_field_name_280 __annonCompField44; union __anonunion____missing_field_name_281 __annonCompField45; union __anonunion____missing_field_name_282 __annonCompField49; union __anonunion____missing_field_name_286 __annonCompField53; union __anonunion____missing_field_name_290 __annonCompField54; struct mem_cgroup *mem_cgroup; } ;
266 struct userfaultfd_ctx ;
266 struct vm_userfaultfd_ctx { struct userfaultfd_ctx *ctx; } ;
273 struct __anonstruct_shared_291 { struct rb_node rb; unsigned long rb_subtree_last; } ;
273 struct anon_vma ;
273 struct mempolicy ;
273 struct vm_area_struct { unsigned long vm_start; unsigned long vm_end; struct vm_area_struct *vm_next; struct vm_area_struct *vm_prev; struct rb_node vm_rb; unsigned long rb_subtree_gap; struct mm_struct *vm_mm; pgprot_t vm_page_prot; unsigned long vm_flags; struct __anonstruct_shared_291 shared; struct list_head anon_vma_chain; struct anon_vma *anon_vma; const struct vm_operations_struct *vm_ops; unsigned long vm_pgoff; struct file *vm_file; void *vm_private_data; struct mempolicy *vm_policy; struct vm_userfaultfd_ctx vm_userfaultfd_ctx; } ;
346 struct core_thread { struct task_struct *task; struct core_thread *next; } ;
351 struct core_state { atomic_t nr_threads; struct core_thread dumper; struct completion startup; } ;
357 struct kioctx_table ;
358 struct linux_binfmt ;
358 struct mmu_notifier_mm ;
358 struct mm_struct { struct vm_area_struct *mmap; struct rb_root mm_rb; u32 vmacache_seqnum; unsigned long int (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long); unsigned long mmap_base; unsigned long mmap_legacy_base; unsigned long mmap_compat_base; unsigned long mmap_compat_legacy_base; unsigned long task_size; unsigned long highest_vm_end; pgd_t *pgd; atomic_t mm_users; atomic_t mm_count; atomic_long_t nr_ptes; atomic_long_t nr_pmds; int map_count; spinlock_t page_table_lock; struct rw_semaphore mmap_sem; struct list_head mmlist; unsigned long hiwater_rss; unsigned long hiwater_vm; unsigned long total_vm; unsigned long locked_vm; unsigned long pinned_vm; unsigned long data_vm; unsigned long exec_vm; unsigned long stack_vm; unsigned long def_flags; unsigned long start_code; unsigned long end_code; unsigned long start_data; unsigned long end_data; unsigned long start_brk; unsigned long brk; unsigned long start_stack; unsigned long arg_start; unsigned long arg_end; unsigned long env_start; unsigned long env_end; unsigned long saved_auxv[46U]; struct mm_rss_stat rss_stat; struct linux_binfmt *binfmt; cpumask_var_t cpu_vm_mask_var; mm_context_t context; unsigned long flags; struct core_state *core_state; spinlock_t ioctx_lock; struct kioctx_table *ioctx_table; struct task_struct *owner; struct user_namespace *user_ns; struct file *exe_file; struct mmu_notifier_mm *mmu_notifier_mm; struct cpumask cpumask_allocation; unsigned long numa_next_scan; unsigned long numa_scan_offset; int numa_scan_seq; bool tlb_flush_pending; struct uprobes_state uprobes_state; atomic_long_t hugetlb_usage; struct work_struct async_put_work; } ;
22 struct kernel_cap_struct { __u32 cap[2U]; } ;
25 typedef struct kernel_cap_struct kernel_cap_t;
217 struct fiemap_extent { __u64 fe_logical; __u64 fe_physical; __u64 fe_length; __u64 fe_reserved64[2U]; __u32 fe_flags; __u32 fe_reserved[3U]; } ;
38 enum migrate_mode { MIGRATE_ASYNC = 0, MIGRATE_SYNC_LIGHT = 1, MIGRATE_SYNC = 2 } ;
44 struct rcuwait { struct task_struct *task; } ;
32 enum rcu_sync_type { RCU_SYNC = 0, RCU_SCHED_SYNC = 1, RCU_BH_SYNC = 2 } ;
38 struct rcu_sync { int gp_state; int gp_count; wait_queue_head_t gp_wait; int cb_state; struct callback_head cb_head; enum rcu_sync_type gp_type; } ;
66 struct percpu_rw_semaphore { struct rcu_sync rss; unsigned int *read_count; struct rw_semaphore rw_sem; struct rcuwait writer; int readers_block; } ;
144 struct delayed_call { void (*fn)(void *); void *arg; } ;
25 struct __anonstruct_guid_t_294 { __u8 b[16U]; } ;
25 typedef struct __anonstruct_guid_t_294 guid_t;
35 typedef guid_t uuid_le;
25 struct __anonstruct_uuid_t_295 { __u8 b[16U]; } ;
25 typedef struct __anonstruct_uuid_t_295 uuid_t;
6 typedef u32 errseq_t;
302 struct backing_dev_info ;
303 struct bdi_writeback ;
305 struct export_operations ;
308 struct kiocb ;
309 struct pipe_inode_info ;
310 struct poll_table_struct ;
311 struct kstatfs ;
312 struct cred ;
313 struct swap_info_struct ;
314 struct iov_iter ;
315 struct fscrypt_info ;
316 struct fscrypt_operations ;
79 struct iattr { unsigned int ia_valid; umode_t ia_mode; kuid_t ia_uid; kgid_t ia_gid; loff_t ia_size; struct timespec ia_atime; struct timespec ia_mtime; struct timespec ia_ctime; struct file *ia_file; } ;
213 struct dquot ;
214 struct kqid ;
19 typedef __kernel_uid32_t projid_t;
23 struct __anonstruct_kprojid_t_296 { projid_t val; } ;
23 typedef struct __anonstruct_kprojid_t_296 kprojid_t;
181 enum quota_type { USRQUOTA = 0, GRPQUOTA = 1, PRJQUOTA = 2 } ;
66 typedef long long qsize_t;
67 union __anonunion____missing_field_name_297 { kuid_t uid; kgid_t gid; kprojid_t projid; } ;
67 struct kqid { union __anonunion____missing_field_name_297 __annonCompField55; enum quota_type type; } ;
194 struct mem_dqblk { qsize_t dqb_bhardlimit; qsize_t dqb_bsoftlimit; qsize_t dqb_curspace; qsize_t dqb_rsvspace; qsize_t dqb_ihardlimit; qsize_t dqb_isoftlimit; qsize_t dqb_curinodes; time64_t dqb_btime; time64_t dqb_itime; } ;
216 struct quota_format_type ;
217 struct mem_dqinfo { struct quota_format_type *dqi_format; int dqi_fmt_id; struct list_head dqi_dirty_list; unsigned long dqi_flags; unsigned int dqi_bgrace; unsigned int dqi_igrace; qsize_t dqi_max_spc_limit; qsize_t dqi_max_ino_limit; void *dqi_priv; } ;
282 struct dquot { struct hlist_node dq_hash; struct list_head dq_inuse; struct list_head dq_free; struct list_head dq_dirty; struct mutex dq_lock; atomic_t dq_count; wait_queue_head_t dq_wait_unused; struct super_block *dq_sb; struct kqid dq_id; loff_t dq_off; unsigned long dq_flags; struct mem_dqblk dq_dqb; } ;
309 struct quota_format_ops { int (*check_quota_file)(struct super_block *, int); int (*read_file_info)(struct super_block *, int); int (*write_file_info)(struct super_block *, int); int (*free_file_info)(struct super_block *, int); int (*read_dqblk)(struct dquot *); int (*commit_dqblk)(struct dquot *); int (*release_dqblk)(struct dquot *); int (*get_next_id)(struct super_block *, struct kqid *); } ;
321 struct dquot_operations { int (*write_dquot)(struct dquot *); struct dquot * (*alloc_dquot)(struct super_block *, int); void (*destroy_dquot)(struct dquot *); int (*acquire_dquot)(struct dquot *); int (*release_dquot)(struct dquot *); int (*mark_dirty)(struct dquot *); int (*write_info)(struct super_block *, int); qsize_t * (*get_reserved_space)(struct inode *); int (*get_projid)(struct inode *, kprojid_t *); int (*get_inode_usage)(struct inode *, qsize_t *); int (*get_next_id)(struct super_block *, struct kqid *); } ;
340 struct qc_dqblk { int d_fieldmask; u64 d_spc_hardlimit; u64 d_spc_softlimit; u64 d_ino_hardlimit; u64 d_ino_softlimit; u64 d_space; u64 d_ino_count; s64 d_ino_timer; s64 d_spc_timer; int d_ino_warns; int d_spc_warns; u64 d_rt_spc_hardlimit; u64 d_rt_spc_softlimit; u64 d_rt_space; s64 d_rt_spc_timer; int d_rt_spc_warns; } ;
363 struct qc_type_state { unsigned int flags; unsigned int spc_timelimit; unsigned int ino_timelimit; unsigned int rt_spc_timelimit; unsigned int spc_warnlimit; unsigned int ino_warnlimit; unsigned int rt_spc_warnlimit; unsigned long long ino; blkcnt_t blocks; blkcnt_t nextents; } ;
409 struct qc_state { unsigned int s_incoredqs; struct qc_type_state s_state[3U]; } ;
420 struct qc_info { int i_fieldmask; unsigned int i_flags; unsigned int i_spc_timelimit; unsigned int i_ino_timelimit; unsigned int i_rt_spc_timelimit; unsigned int i_spc_warnlimit; unsigned int i_ino_warnlimit; unsigned int i_rt_spc_warnlimit; } ;
433 struct quotactl_ops { int (*quota_on)(struct super_block *, int, int, const struct path *); int (*quota_off)(struct super_block *, int); int (*quota_enable)(struct super_block *, unsigned int); int (*quota_disable)(struct super_block *, unsigned int); int (*quota_sync)(struct super_block *, int); int (*set_info)(struct super_block *, int, struct qc_info *); int (*get_dqblk)(struct super_block *, struct kqid , struct qc_dqblk *); int (*get_nextdqblk)(struct super_block *, struct kqid *, struct qc_dqblk *); int (*set_dqblk)(struct super_block *, struct kqid , struct qc_dqblk *); int (*get_state)(struct super_block *, struct qc_state *); int (*rm_xquota)(struct super_block *, unsigned int); } ;
449 struct quota_format_type { int qf_fmt_id; const struct quota_format_ops *qf_ops; struct module *qf_owner; struct quota_format_type *qf_next; } ;
513 struct quota_info { unsigned int flags; struct mutex dqio_mutex; struct inode *files[3U]; struct mem_dqinfo info[3U]; const struct quota_format_ops *ops[3U]; } ;
542 struct writeback_control ;
543 enum rw_hint { WRITE_LIFE_NOT_SET = 0, WRITE_LIFE_NONE = 1, WRITE_LIFE_SHORT = 2, WRITE_LIFE_MEDIUM = 3, WRITE_LIFE_LONG = 4, WRITE_LIFE_EXTREME = 5 } ;
552 struct kiocb { struct file *ki_filp; loff_t ki_pos; void (*ki_complete)(struct kiocb *, long, long); void *private; int ki_flags; enum rw_hint ki_hint; } ;
326 struct address_space_operations { int (*writepage)(struct page *, struct writeback_control *); int (*readpage)(struct file *, struct page *); int (*writepages)(struct address_space *, struct writeback_control *); int (*set_page_dirty)(struct page *); int (*readpages)(struct file *, struct address_space *, struct list_head *, unsigned int); int (*write_begin)(struct file *, struct address_space *, loff_t , unsigned int, unsigned int, struct page **, void **); int (*write_end)(struct file *, struct address_space *, loff_t , unsigned int, unsigned int, struct page *, void *); sector_t (*bmap)(struct address_space *, sector_t ); void (*invalidatepage)(struct page *, unsigned int, unsigned int); int (*releasepage)(struct page *, gfp_t ); void (*freepage)(struct page *); ssize_t (*direct_IO)(struct kiocb *, struct iov_iter *); int (*migratepage)(struct address_space *, struct page *, struct page *, enum migrate_mode ); bool (*isolate_page)(struct page *, isolate_mode_t ); void (*putback_page)(struct page *); int (*launder_page)(struct page *); int (*is_partially_uptodate)(struct page *, unsigned long, unsigned long); void (*is_dirty_writeback)(struct page *, bool *, bool *); int (*error_remove_page)(struct address_space *, struct page *); int (*swap_activate)(struct swap_info_struct *, struct file *, sector_t *); void (*swap_deactivate)(struct file *); } ;
385 struct address_space { struct inode *host; struct radix_tree_root page_tree; spinlock_t tree_lock; atomic_t i_mmap_writable; struct rb_root i_mmap; struct rw_semaphore i_mmap_rwsem; unsigned long nrpages; unsigned long nrexceptional; unsigned long writeback_index; const struct address_space_operations *a_ops; unsigned long flags; spinlock_t private_lock; gfp_t gfp_mask; struct list_head private_list; void *private_data; errseq_t wb_err; } ;
408 struct request_queue ;
409 struct hd_struct ;
409 struct gendisk ;
409 struct block_device { dev_t bd_dev; int bd_openers; struct inode *bd_inode; struct super_block *bd_super; struct mutex bd_mutex; void *bd_claiming; void *bd_holder; int bd_holders; bool bd_write_holder; struct list_head bd_holder_disks; struct block_device *bd_contains; unsigned int bd_block_size; struct hd_struct *bd_part; unsigned int bd_part_count; int bd_invalidated; struct gendisk *bd_disk; struct request_queue *bd_queue; struct backing_dev_info *bd_bdi; struct list_head bd_list; unsigned long bd_private; int bd_fsfreeze_count; struct mutex bd_fsfreeze_mutex; } ;
525 struct posix_acl ;
552 struct fsnotify_mark_connector ;
553 struct inode_operations ;
553 union __anonunion____missing_field_name_302 { const unsigned int i_nlink; unsigned int __i_nlink; } ;
553 union __anonunion____missing_field_name_303 { struct hlist_head i_dentry; struct callback_head i_rcu; } ;
553 struct file_lock_context ;
553 struct cdev ;
553 union __anonunion____missing_field_name_304 { struct pipe_inode_info *i_pipe; struct block_device *i_bdev; struct cdev *i_cdev; char *i_link; unsigned int i_dir_seq; } ;
553 struct inode { umode_t i_mode; unsigned short i_opflags; kuid_t i_uid; kgid_t i_gid; unsigned int i_flags; struct posix_acl *i_acl; struct posix_acl *i_default_acl; const struct inode_operations *i_op; struct super_block *i_sb; struct address_space *i_mapping; void *i_security; unsigned long i_ino; union __anonunion____missing_field_name_302 __annonCompField56; dev_t i_rdev; loff_t i_size; struct timespec i_atime; struct timespec i_mtime; struct timespec i_ctime; spinlock_t i_lock; unsigned short i_bytes; unsigned int i_blkbits; enum rw_hint i_write_hint; blkcnt_t i_blocks; unsigned long i_state; struct rw_semaphore i_rwsem; unsigned long dirtied_when; unsigned long dirtied_time_when; struct hlist_node i_hash; struct list_head i_io_list; struct bdi_writeback *i_wb; int i_wb_frn_winner; u16 i_wb_frn_avg_time; u16 i_wb_frn_history; struct list_head i_lru; struct list_head i_sb_list; struct list_head i_wb_list; union __anonunion____missing_field_name_303 __annonCompField57; u64 i_version; atomic_t i_count; atomic_t i_dio_count; atomic_t i_writecount; atomic_t i_readcount; const struct file_operations *i_fop; struct file_lock_context *i_flctx; struct address_space i_data; struct list_head i_devices; union __anonunion____missing_field_name_304 __annonCompField58; __u32 i_generation; __u32 i_fsnotify_mask; struct fsnotify_mark_connector *i_fsnotify_marks; struct fscrypt_info *i_crypt_info; void *i_private; } ;
816 struct fown_struct { rwlock_t lock; struct pid *pid; enum pid_type pid_type; kuid_t uid; kuid_t euid; int signum; } ;
824 struct file_ra_state { unsigned long start; unsigned int size; unsigned int async_size; unsigned int ra_pages; unsigned int mmap_miss; loff_t prev_pos; } ;
847 union __anonunion_f_u_305 { struct llist_node fu_llist; struct callback_head fu_rcuhead; } ;
847 struct file { union __anonunion_f_u_305 f_u; struct path f_path; struct inode *f_inode; const struct file_operations *f_op; spinlock_t f_lock; enum rw_hint f_write_hint; atomic_long_t f_count; unsigned int f_flags; fmode_t f_mode; struct mutex f_pos_lock; loff_t f_pos; struct fown_struct f_owner; const struct cred *f_cred; struct file_ra_state f_ra; u64 f_version; void *f_security; void *private_data; struct list_head f_ep_links; struct list_head f_tfile_llink; struct address_space *f_mapping; errseq_t f_wb_err; } ;
936 typedef void *fl_owner_t;
937 struct file_lock ;
938 struct file_lock_operations { void (*fl_copy_lock)(struct file_lock *, struct file_lock *); void (*fl_release_private)(struct file_lock *); } ;
944 struct lock_manager_operations { int (*lm_compare_owner)(struct file_lock *, struct file_lock *); unsigned long int (*lm_owner_key)(struct file_lock *); fl_owner_t (*lm_get_owner)(fl_owner_t ); void (*lm_put_owner)(fl_owner_t ); void (*lm_notify)(struct file_lock *); int (*lm_grant)(struct file_lock *, int); bool (*lm_break)(struct file_lock *); int (*lm_change)(struct file_lock *, int, struct list_head *); void (*lm_setup)(struct file_lock *, void **); } ;
971 struct nlm_lockowner ;
972 struct nfs_lock_info { u32 state; struct nlm_lockowner *owner; struct list_head list; } ;
14 struct nfs4_lock_state ;
15 struct nfs4_lock_info { struct nfs4_lock_state *owner; } ;
19 struct fasync_struct ;
19 struct __anonstruct_afs_307 { struct list_head link; int state; } ;
19 union __anonunion_fl_u_306 { struct nfs_lock_info nfs_fl; struct nfs4_lock_info nfs4_fl; struct __anonstruct_afs_307 afs; } ;
19 struct file_lock { struct file_lock *fl_next; struct list_head fl_list; struct hlist_node fl_link; struct list_head fl_block; fl_owner_t fl_owner; unsigned int fl_flags; unsigned char fl_type; unsigned int fl_pid; int fl_link_cpu; struct pid *fl_nspid; wait_queue_head_t fl_wait; struct file *fl_file; loff_t fl_start; loff_t fl_end; struct fasync_struct *fl_fasync; unsigned long fl_break_time; unsigned long fl_downgrade_time; const struct file_lock_operations *fl_ops; const struct lock_manager_operations *fl_lmops; union __anonunion_fl_u_306 fl_u; } ;
1024 struct file_lock_context { spinlock_t flc_lock; struct list_head flc_flock; struct list_head flc_posix; struct list_head flc_lease; } ;
1089 struct files_struct ;
1242 struct fasync_struct { spinlock_t fa_lock; int magic; int fa_fd; struct fasync_struct *fa_next; struct file *fa_file; struct callback_head fa_rcu; } ;
1277 struct sb_writers { int frozen; wait_queue_head_t wait_unfrozen; struct percpu_rw_semaphore rw_sem[3U]; } ;
1307 struct super_operations ;
1307 struct xattr_handler ;
1307 struct mtd_info ;
1307 struct super_block { struct list_head s_list; dev_t s_dev; unsigned char s_blocksize_bits; unsigned long s_blocksize; loff_t s_maxbytes; struct file_system_type *s_type; const struct super_operations *s_op; const struct dquot_operations *dq_op; const struct quotactl_ops *s_qcop; const struct export_operations *s_export_op; unsigned long s_flags; unsigned long s_iflags; unsigned long s_magic; struct dentry *s_root; struct rw_semaphore s_umount; int s_count; atomic_t s_active; void *s_security; const struct xattr_handler **s_xattr; const struct fscrypt_operations *s_cop; struct hlist_bl_head s_anon; struct list_head s_mounts; struct block_device *s_bdev; struct backing_dev_info *s_bdi; struct mtd_info *s_mtd; struct hlist_node s_instances; unsigned int s_quota_types; struct quota_info s_dquot; struct sb_writers s_writers; char s_id[32U]; uuid_t s_uuid; void *s_fs_info; unsigned int s_max_links; fmode_t s_mode; u32 s_time_gran; struct mutex s_vfs_rename_mutex; char *s_subtype; const struct dentry_operations *s_d_op; int cleancache_poolid; struct shrinker s_shrink; atomic_long_t s_remove_count; int s_readonly_remount; struct workqueue_struct *s_dio_done_wq; struct hlist_head s_pins; struct user_namespace *s_user_ns; struct list_lru s_dentry_lru; struct list_lru s_inode_lru; struct callback_head rcu; struct work_struct destroy_work; struct mutex s_sync_lock; int s_stack_depth; spinlock_t s_inode_list_lock; struct list_head s_inodes; spinlock_t s_inode_wblist_lock; struct list_head s_inodes_wb; } ;
1588 struct fiemap_extent_info { unsigned int fi_flags; unsigned int fi_extents_mapped; unsigned int fi_extents_max; struct fiemap_extent *fi_extents_start; } ;
1601 struct dir_context ;
1626 struct dir_context { int (*actor)(struct dir_context *, const char *, int, loff_t , u64 , unsigned int); loff_t pos; } ;
1633 struct file_operations { struct module *owner; loff_t (*llseek)(struct file *, loff_t , int); ssize_t (*read)(struct file *, char *, size_t , loff_t *); ssize_t (*write)(struct file *, const char *, size_t , loff_t *); ssize_t (*read_iter)(struct kiocb *, struct iov_iter *); ssize_t (*write_iter)(struct kiocb *, struct iov_iter *); int (*iterate)(struct file *, struct dir_context *); int (*iterate_shared)(struct file *, struct dir_context *); unsigned int (*poll)(struct file *, struct poll_table_struct *); long int (*unlocked_ioctl)(struct file *, unsigned int, unsigned long); long int (*compat_ioctl)(struct file *, unsigned int, unsigned long); int (*mmap)(struct file *, struct vm_area_struct *); int (*open)(struct inode *, struct file *); int (*flush)(struct file *, fl_owner_t ); int (*release)(struct inode *, struct file *); int (*fsync)(struct file *, loff_t , loff_t , int); int (*fasync)(int, struct file *, int); int (*lock)(struct file *, int, struct file_lock *); ssize_t (*sendpage)(struct file *, struct page *, int, size_t , loff_t *, int); unsigned long int (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long); int (*check_flags)(int); int (*flock)(struct file *, int, struct file_lock *); ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, loff_t *, size_t , unsigned int); ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *, size_t , unsigned int); int (*setlease)(struct file *, long, struct file_lock **, void **); long int (*fallocate)(struct file *, int, loff_t , loff_t ); void (*show_fdinfo)(struct seq_file *, struct file *); ssize_t (*copy_file_range)(struct file *, loff_t , struct file *, loff_t , size_t , unsigned int); int (*clone_file_range)(struct file *, loff_t , struct file *, loff_t , u64 ); ssize_t (*dedupe_file_range)(struct file *, u64 , u64 , struct file *, u64 ); } ;
1701 struct inode_operations { struct dentry * (*lookup)(struct inode *, struct dentry *, unsigned int); const char * (*get_link)(struct dentry *, struct inode *, struct delayed_call *); int (*permission)(struct inode *, int); struct posix_acl * (*get_acl)(struct inode *, int); int (*readlink)(struct dentry *, char *, int); int (*create)(struct inode *, struct dentry *, umode_t , bool ); int (*link)(struct dentry *, struct inode *, struct dentry *); int (*unlink)(struct inode *, struct dentry *); int (*symlink)(struct inode *, struct dentry *, const char *); int (*mkdir)(struct inode *, struct dentry *, umode_t ); int (*rmdir)(struct inode *, struct dentry *); int (*mknod)(struct inode *, struct dentry *, umode_t , dev_t ); int (*rename)(struct inode *, struct dentry *, struct inode *, struct dentry *, unsigned int); int (*setattr)(struct dentry *, struct iattr *); int (*getattr)(const struct path *, struct kstat *, u32 , unsigned int); ssize_t (*listxattr)(struct dentry *, char *, size_t ); int (*fiemap)(struct inode *, struct fiemap_extent_info *, u64 , u64 ); int (*update_time)(struct inode *, struct timespec *, int); int (*atomic_open)(struct inode *, struct dentry *, struct file *, unsigned int, umode_t , int *); int (*tmpfile)(struct inode *, struct dentry *, umode_t ); int (*set_acl)(struct inode *, struct posix_acl *, int); } ;
1774 struct super_operations { struct inode * (*alloc_inode)(struct super_block *); void (*destroy_inode)(struct inode *); void (*dirty_inode)(struct inode *, int); int (*write_inode)(struct inode *, struct writeback_control *); int (*drop_inode)(struct inode *); void (*evict_inode)(struct inode *); void (*put_super)(struct super_block *); int (*sync_fs)(struct super_block *, int); int (*freeze_super)(struct super_block *); int (*freeze_fs)(struct super_block *); int (*thaw_super)(struct super_block *); int (*unfreeze_fs)(struct super_block *); int (*statfs)(struct dentry *, struct kstatfs *); int (*remount_fs)(struct super_block *, int *, char *); void (*umount_begin)(struct super_block *); int (*show_options)(struct seq_file *, struct dentry *); int (*show_devname)(struct seq_file *, struct dentry *); int (*show_path)(struct seq_file *, struct dentry *); int (*show_stats)(struct seq_file *, struct dentry *); ssize_t (*quota_read)(struct super_block *, int, char *, size_t , loff_t ); ssize_t (*quota_write)(struct super_block *, int, const char *, size_t , loff_t ); struct dquot ** (*get_dquots)(struct inode *); int (*bdev_try_to_free_page)(struct super_block *, struct page *, gfp_t ); long int (*nr_cached_objects)(struct super_block *, struct shrink_control *); long int (*free_cached_objects)(struct super_block *, struct shrink_control *); } ;
2040 struct file_system_type { const char *name; int fs_flags; struct dentry * (*mount)(struct file_system_type *, int, const char *, void *); void (*kill_sb)(struct super_block *); struct module *owner; struct file_system_type *next; struct hlist_head fs_supers; struct lock_class_key s_lock_key; struct lock_class_key s_umount_key; struct lock_class_key s_vfs_rename_key; struct lock_class_key s_writers_key[3U]; struct lock_class_key i_lock_key; struct lock_class_key i_mutex_key; struct lock_class_key i_mutex_dir_key; } ;
836 struct nsproxy ;
228 struct assoc_array_ptr ;
228 struct assoc_array { struct assoc_array_ptr *root; unsigned long nr_leaves_on_tree; } ;
32 typedef int32_t key_serial_t;
35 typedef uint32_t key_perm_t;
36 struct key ;
37 struct user_struct ;
38 struct signal_struct ;
39 struct key_type ;
43 struct keyring_index_key { struct key_type *type; const char *description; size_t desc_len; } ;
92 union key_payload { void *rcu_data0; void *data[4U]; } ;
131 struct key_restriction { int (*check)(struct key *, const struct key_type *, const union key_payload *, struct key *); struct key *key; struct key_type *keytype; } ;
140 union __anonunion____missing_field_name_310 { struct list_head graveyard_link; struct rb_node serial_node; } ;
140 struct key_user ;
140 union __anonunion____missing_field_name_311 { time_t expiry; time_t revoked_at; } ;
140 struct __anonstruct____missing_field_name_313 { struct key_type *type; char *description; } ;
140 union __anonunion____missing_field_name_312 { struct keyring_index_key index_key; struct __anonstruct____missing_field_name_313 __annonCompField63; } ;
140 struct __anonstruct____missing_field_name_315 { struct list_head name_link; struct assoc_array keys; } ;
140 union __anonunion____missing_field_name_314 { union key_payload payload; struct __anonstruct____missing_field_name_315 __annonCompField65; int reject_error; } ;
140 struct key { refcount_t usage; key_serial_t serial; union __anonunion____missing_field_name_310 __annonCompField61; struct rw_semaphore sem; struct key_user *user; void *security; union __anonunion____missing_field_name_311 __annonCompField62; time_t last_used_at; kuid_t uid; kgid_t gid; key_perm_t perm; unsigned short quotalen; unsigned short datalen; unsigned long flags; union __anonunion____missing_field_name_312 __annonCompField64; union __anonunion____missing_field_name_314 __annonCompField66; struct key_restriction *restrict_link; } ;
390 struct audit_context ;
45 struct sem_undo_list ;
45 struct sysv_sem { struct sem_undo_list *undo_list; } ;
26 struct sysv_shm { struct list_head shm_clist; } ;
12 enum kcov_mode { KCOV_MODE_DISABLED = 0, KCOV_MODE_TRACE = 1 } ;
84 struct plist_node { int prio; struct list_head prio_list; struct list_head node_list; } ;
299 struct timerqueue_node { struct rb_node node; ktime_t expires; } ;
12 struct timerqueue_head { struct rb_root head; struct timerqueue_node *next; } ;
50 struct hrtimer_clock_base ;
51 struct hrtimer_cpu_base ;
60 enum hrtimer_restart { HRTIMER_NORESTART = 0, HRTIMER_RESTART = 1 } ;
65 struct hrtimer { struct timerqueue_node node; ktime_t _softexpires; enum hrtimer_restart (*function)(struct hrtimer *); struct hrtimer_clock_base *base; u8 state; u8 is_rel; } ;
113 struct hrtimer_clock_base { struct hrtimer_cpu_base *cpu_base; int index; clockid_t clockid; struct timerqueue_head active; ktime_t (*get_time)(); ktime_t offset; } ;
146 struct hrtimer_cpu_base { raw_spinlock_t lock; seqcount_t seq; struct hrtimer *running; unsigned int cpu; unsigned int active_bases; unsigned int clock_was_set_seq; bool migration_enabled; bool nohz_active; unsigned char in_hrtirq; unsigned char hres_active; unsigned char hang_detected; ktime_t expires_next; struct hrtimer *next_timer; unsigned int nr_events; unsigned int nr_retries; unsigned int nr_hangs; unsigned int max_hang_time; struct hrtimer_clock_base clock_base[4U]; } ;
43 struct seccomp_filter ;
44 struct seccomp { int mode; struct seccomp_filter *filter; } ;
11 struct latency_record { unsigned long backtrace[12U]; unsigned int count; unsigned long time; unsigned long max; } ;
24 struct __anonstruct_sigset_t_316 { unsigned long sig[1U]; } ;
24 typedef struct __anonstruct_sigset_t_316 sigset_t;
25 struct siginfo ;
38 union sigval { int sival_int; void *sival_ptr; } ;
10 typedef union sigval sigval_t;
11 struct __anonstruct__kill_318 { __kernel_pid_t _pid; __kernel_uid32_t _uid; } ;
11 struct __anonstruct__timer_319 { __kernel_timer_t _tid; int _overrun; char _pad[0U]; sigval_t _sigval; int _sys_private; } ;
11 struct __anonstruct__rt_320 { __kernel_pid_t _pid; __kernel_uid32_t _uid; sigval_t _sigval; } ;
11 struct __anonstruct__sigchld_321 { __kernel_pid_t _pid; __kernel_uid32_t _uid; int _status; __kernel_clock_t _utime; __kernel_clock_t _stime; } ;
11 struct __anonstruct__addr_bnd_324 { void *_lower; void *_upper; } ;
11 union __anonunion____missing_field_name_323 { struct __anonstruct__addr_bnd_324 _addr_bnd; __u32 _pkey; } ;
11 struct __anonstruct__sigfault_322 { void *_addr; short _addr_lsb; union __anonunion____missing_field_name_323 __annonCompField67; } ;
11 struct __anonstruct__sigpoll_325 { long _band; int _fd; } ;
11 struct __anonstruct__sigsys_326 { void *_call_addr; int _syscall; unsigned int _arch; } ;
11 union __anonunion__sifields_317 { int _pad[28U]; struct __anonstruct__kill_318 _kill; struct __anonstruct__timer_319 _timer; struct __anonstruct__rt_320 _rt; struct __anonstruct__sigchld_321 _sigchld; struct __anonstruct__sigfault_322 _sigfault; struct __anonstruct__sigpoll_325 _sigpoll; struct __anonstruct__sigsys_326 _sigsys; } ;
11 struct siginfo { int si_signo; int si_errno; int si_code; union __anonunion__sifields_317 _sifields; } ;
118 typedef struct siginfo siginfo_t;
21 struct sigpending { struct list_head list; sigset_t signal; } ;
65 struct task_io_accounting { u64 rchar; u64 wchar; u64 syscr; u64 syscw; u64 read_bytes; u64 write_bytes; u64 cancelled_write_bytes; } ;
45 struct bio_list ;
46 struct blk_plug ;
47 struct cfs_rq ;
48 struct fs_struct ;
49 struct futex_pi_state ;
50 struct io_context ;
51 struct nameidata ;
52 struct perf_event_context ;
54 struct reclaim_state ;
55 struct robust_list_head ;
58 struct sighand_struct ;
59 struct task_delay_info ;
60 struct task_group ;
187 struct prev_cputime { u64 utime; u64 stime; raw_spinlock_t lock; } ;
203 struct task_cputime { u64 utime; u64 stime; unsigned long long sum_exec_runtime; } ;
243 struct sched_info { unsigned long pcount; unsigned long long run_delay; unsigned long long last_arrival; unsigned long long last_queued; } ;
262 struct load_weight { unsigned long weight; u32 inv_weight; } ;
279 struct sched_avg { u64 last_update_time; u64 load_sum; u32 util_sum; u32 period_contrib; unsigned long load_avg; unsigned long util_avg; } ;
340 struct sched_statistics { u64 wait_start; u64 wait_max; u64 wait_count; u64 wait_sum; u64 iowait_count; u64 iowait_sum; u64 sleep_start; u64 sleep_max; s64 sum_sleep_runtime; u64 block_start; u64 block_max; u64 exec_max; u64 slice_max; u64 nr_migrations_cold; u64 nr_failed_migrations_affine; u64 nr_failed_migrations_running; u64 nr_failed_migrations_hot; u64 nr_forced_migrations; u64 nr_wakeups; u64 nr_wakeups_sync; u64 nr_wakeups_migrate; u64 nr_wakeups_local; u64 nr_wakeups_remote; u64 nr_wakeups_affine; u64 nr_wakeups_affine_attempts; u64 nr_wakeups_passive; u64 nr_wakeups_idle; } ;
375 struct sched_entity { struct load_weight load; struct rb_node run_node; struct list_head group_node; unsigned int on_rq; u64 exec_start; u64 sum_exec_runtime; u64 vruntime; u64 prev_sum_exec_runtime; u64 nr_migrations; struct sched_statistics statistics; int depth; struct sched_entity *parent; struct cfs_rq *cfs_rq; struct cfs_rq *my_q; struct sched_avg avg; } ;
411 struct rt_rq ;
411 struct sched_rt_entity { struct list_head run_list; unsigned long timeout; unsigned long watchdog_stamp; unsigned int time_slice; unsigned short on_rq; unsigned short on_list; struct sched_rt_entity *back; struct sched_rt_entity *parent; struct rt_rq *rt_rq; struct rt_rq *my_q; } ;
429 struct sched_dl_entity { struct rb_node rb_node; u64 dl_runtime; u64 dl_deadline; u64 dl_period; u64 dl_bw; u64 dl_density; s64 runtime; u64 deadline; unsigned int flags; int dl_throttled; int dl_boosted; int dl_yielded; int dl_non_contending; struct hrtimer dl_timer; struct hrtimer inactive_timer; } ;
514 struct wake_q_node { struct wake_q_node *next; } ;
518 struct sched_class ;
518 struct rt_mutex_waiter ;
518 struct css_set ;
518 struct compat_robust_list_head ;
518 struct numa_group ;
518 struct kcov ;
518 struct task_struct { struct thread_info thread_info; volatile long state; void *stack; atomic_t usage; unsigned int flags; unsigned int ptrace; struct llist_node wake_entry; int on_cpu; unsigned int cpu; unsigned int wakee_flips; unsigned long wakee_flip_decay_ts; struct task_struct *last_wakee; int wake_cpu; int on_rq; int prio; int static_prio; int normal_prio; unsigned int rt_priority; const struct sched_class *sched_class; struct sched_entity se; struct sched_rt_entity rt; struct task_group *sched_task_group; struct sched_dl_entity dl; struct hlist_head preempt_notifiers; unsigned int policy; int nr_cpus_allowed; cpumask_t cpus_allowed; unsigned long rcu_tasks_nvcsw; bool rcu_tasks_holdout; struct list_head rcu_tasks_holdout_list; int rcu_tasks_idle_cpu; struct sched_info sched_info; struct list_head tasks; struct plist_node pushable_tasks; struct rb_node pushable_dl_tasks; struct mm_struct *mm; struct mm_struct *active_mm; struct vmacache vmacache; struct task_rss_stat rss_stat; int exit_state; int exit_code; int exit_signal; int pdeath_signal; unsigned long jobctl; unsigned int personality; unsigned char sched_reset_on_fork; unsigned char sched_contributes_to_load; unsigned char sched_migrated; unsigned char sched_remote_wakeup; unsigned char; unsigned char in_execve; unsigned char in_iowait; unsigned char restore_sigmask; unsigned char memcg_may_oom; unsigned char memcg_kmem_skip_account; unsigned char brk_randomized; unsigned char no_cgroup_migration; unsigned long atomic_flags; struct restart_block restart_block; pid_t pid; pid_t tgid; struct task_struct *real_parent; struct task_struct *parent; struct list_head children; struct list_head sibling; struct task_struct *group_leader; struct list_head ptraced; struct list_head ptrace_entry; struct pid_link pids[3U]; struct list_head thread_group; struct list_head thread_node; struct completion *vfork_done; int *set_child_tid; int *clear_child_tid; u64 utime; u64 stime; u64 gtime; struct prev_cputime prev_cputime; unsigned long nvcsw; unsigned long nivcsw; u64 start_time; u64 real_start_time; unsigned long min_flt; unsigned long maj_flt; struct task_cputime cputime_expires; struct list_head cpu_timers[3U]; const struct cred *ptracer_cred; const struct cred *real_cred; const struct cred *cred; char comm[16U]; struct nameidata *nameidata; struct sysv_sem sysvsem; struct sysv_shm sysvshm; unsigned long last_switch_count; struct fs_struct *fs; struct files_struct *files; struct nsproxy *nsproxy; struct signal_struct *signal; struct sighand_struct *sighand; sigset_t blocked; sigset_t real_blocked; sigset_t saved_sigmask; struct sigpending pending; unsigned long sas_ss_sp; size_t sas_ss_size; unsigned int sas_ss_flags; struct callback_head *task_works; struct audit_context *audit_context; kuid_t loginuid; unsigned int sessionid; struct seccomp seccomp; u32 parent_exec_id; u32 self_exec_id; spinlock_t alloc_lock; raw_spinlock_t pi_lock; struct wake_q_node wake_q; struct rb_root pi_waiters; struct rb_node *pi_waiters_leftmost; struct task_struct *pi_top_task; struct rt_mutex_waiter *pi_blocked_on; struct mutex_waiter *blocked_on; unsigned int irq_events; unsigned long hardirq_enable_ip; unsigned long hardirq_disable_ip; unsigned int hardirq_enable_event; unsigned int hardirq_disable_event; int hardirqs_enabled; int hardirq_context; unsigned long softirq_disable_ip; unsigned long softirq_enable_ip; unsigned int softirq_disable_event; unsigned int softirq_enable_event; int softirqs_enabled; int softirq_context; u64 curr_chain_key; int lockdep_depth; unsigned int lockdep_recursion; struct held_lock held_locks[48U]; gfp_t lockdep_reclaim_gfp; unsigned int in_ubsan; void *journal_info; struct bio_list *bio_list; struct blk_plug *plug; struct reclaim_state *reclaim_state; struct backing_dev_info *backing_dev_info; struct io_context *io_context; unsigned long ptrace_message; siginfo_t *last_siginfo; struct task_io_accounting ioac; u64 acct_rss_mem1; u64 acct_vm_mem1; u64 acct_timexpd; nodemask_t mems_allowed; seqcount_t mems_allowed_seq; int cpuset_mem_spread_rotor; int cpuset_slab_spread_rotor; struct css_set *cgroups; struct list_head cg_list; int closid; struct robust_list_head *robust_list; struct compat_robust_list_head *compat_robust_list; struct list_head pi_state_list; struct futex_pi_state *pi_state_cache; struct perf_event_context *perf_event_ctxp[2U]; struct mutex perf_event_mutex; struct list_head perf_event_list; struct mempolicy *mempolicy; short il_prev; short pref_node_fork; int numa_scan_seq; unsigned int numa_scan_period; unsigned int numa_scan_period_max; int numa_preferred_nid; unsigned long numa_migrate_retry; u64 node_stamp; u64 last_task_numa_placement; u64 last_sum_exec_runtime; struct callback_head numa_work; struct list_head numa_entry; struct numa_group *numa_group; unsigned long *numa_faults; unsigned long total_numa_faults; unsigned long numa_faults_locality[3U]; unsigned long numa_pages_migrated; struct tlbflush_unmap_batch tlb_ubc; struct callback_head rcu; struct pipe_inode_info *splice_pipe; struct page_frag task_frag; struct task_delay_info *delays; int make_it_fail; unsigned int fail_nth; int nr_dirtied; int nr_dirtied_pause; unsigned long dirty_paused_when; int latency_record_count; struct latency_record latency_record[32U]; u64 timer_slack_ns; u64 default_timer_slack_ns; unsigned int kasan_depth; unsigned long trace; unsigned long trace_recursion; enum kcov_mode kcov_mode; unsigned int kcov_size; void *kcov_area; struct kcov *kcov; struct mem_cgroup *memcg_in_oom; gfp_t memcg_oom_gfp_mask; int memcg_oom_order; unsigned int memcg_nr_pages_over_high; struct uprobe_task *utask; unsigned int sequential_io; unsigned int sequential_io_avg; unsigned long task_state_change; int pagefault_disabled; struct task_struct *oom_reaper_list; atomic_t stack_refcount; int patch_state; void *security; struct thread_struct thread; } ;
1607 struct user_struct { atomic_t __count; atomic_t processes; atomic_t sigpending; atomic_t fanotify_listeners; atomic_long_t epoll_watches; unsigned long mq_bytes; unsigned long locked_shm; unsigned long unix_inflight; atomic_long_t pipe_bufs; struct key *uid_keyring; struct key *session_keyring; struct hlist_node uidhash_node; kuid_t uid; atomic_long_t locked_vm; } ;
60 struct group_info { atomic_t usage; int ngroups; kgid_t gid[0U]; } ;
86 struct cred { atomic_t usage; atomic_t subscribers; void *put_addr; unsigned int magic; kuid_t uid; kgid_t gid; kuid_t suid; kgid_t sgid; kuid_t euid; kgid_t egid; kuid_t fsuid; kgid_t fsgid; unsigned int securebits; kernel_cap_t cap_inheritable; kernel_cap_t cap_permitted; kernel_cap_t cap_effective; kernel_cap_t cap_bset; kernel_cap_t cap_ambient; unsigned char jit_keyring; struct key *session_keyring; struct key *process_keyring; struct key *thread_keyring; struct key *request_key_auth; void *security; struct user_struct *user; struct user_namespace *user_ns; struct group_info *group_info; struct callback_head rcu; } ;
369 struct seq_file { char *buf; size_t size; size_t from; size_t count; size_t pad_until; loff_t index; loff_t read_pos; u64 version; struct mutex lock; const struct seq_operations *op; int poll_event; const struct file *file; void *private; } ;
30 struct seq_operations { void * (*start)(struct seq_file *, loff_t *); void (*stop)(struct seq_file *, void *); void * (*next)(struct seq_file *, void *, loff_t *); int (*show)(struct seq_file *, void *); } ;
222 struct pinctrl ;
223 struct pinctrl_state ;
200 struct dev_pin_info { struct pinctrl *p; struct pinctrl_state *default_state; struct pinctrl_state *init_state; struct pinctrl_state *sleep_state; struct pinctrl_state *idle_state; } ;
58 struct pm_message { int event; } ;
64 typedef struct pm_message pm_message_t;
65 struct dev_pm_ops { int (*prepare)(struct device *); void (*complete)(struct device *); int (*suspend)(struct device *); int (*resume)(struct device *); int (*freeze)(struct device *); int (*thaw)(struct device *); int (*poweroff)(struct device *); int (*restore)(struct device *); int (*suspend_late)(struct device *); int (*resume_early)(struct device *); int (*freeze_late)(struct device *); int (*thaw_early)(struct device *); int (*poweroff_late)(struct device *); int (*restore_early)(struct device *); int (*suspend_noirq)(struct device *); int (*resume_noirq)(struct device *); int (*freeze_noirq)(struct device *); int (*thaw_noirq)(struct device *); int (*poweroff_noirq)(struct device *); int (*restore_noirq)(struct device *); int (*runtime_suspend)(struct device *); int (*runtime_resume)(struct device *); int (*runtime_idle)(struct device *); } ;
315 enum rpm_status { RPM_ACTIVE = 0, RPM_RESUMING = 1, RPM_SUSPENDED = 2, RPM_SUSPENDING = 3 } ;
322 enum rpm_request { RPM_REQ_NONE = 0, RPM_REQ_IDLE = 1, RPM_REQ_SUSPEND = 2, RPM_REQ_AUTOSUSPEND = 3, RPM_REQ_RESUME = 4 } ;
330 struct wakeup_source ;
331 struct wake_irq ;
332 struct pm_domain_data ;
333 struct pm_subsys_data { spinlock_t lock; unsigned int refcount; struct list_head clock_list; struct pm_domain_data *domain_data; } ;
551 struct dev_pm_qos ;
551 struct dev_pm_info { pm_message_t power_state; unsigned char can_wakeup; unsigned char async_suspend; bool in_dpm_list; bool is_prepared; bool is_suspended; bool is_noirq_suspended; bool is_late_suspended; bool early_init; bool direct_complete; spinlock_t lock; struct list_head entry; struct completion completion; struct wakeup_source *wakeup; bool wakeup_path; bool syscore; bool no_pm_callbacks; struct timer_list suspend_timer; unsigned long timer_expires; struct work_struct work; wait_queue_head_t wait_queue; struct wake_irq *wakeirq; atomic_t usage_count; atomic_t child_count; unsigned char disable_depth; unsigned char idle_notification; unsigned char request_pending; unsigned char deferred_resume; unsigned char runtime_auto; bool ignore_children; unsigned char no_callbacks; unsigned char irq_safe; unsigned char use_autosuspend; unsigned char timer_autosuspends; unsigned char memalloc_noio; unsigned int links_count; enum rpm_request request; enum rpm_status runtime_status; int runtime_error; int autosuspend_delay; unsigned long last_busy; unsigned long active_jiffies; unsigned long suspended_jiffies; unsigned long accounting_timestamp; struct pm_subsys_data *subsys_data; void (*set_latency_tolerance)(struct device *, s32 ); struct dev_pm_qos *qos; } ;
612 struct dev_pm_domain { struct dev_pm_ops ops; void (*detach)(struct device *, bool ); int (*activate)(struct device *); void (*sync)(struct device *); void (*dismiss)(struct device *); } ;
76 struct dev_archdata { void *iommu; } ;
8 struct dma_map_ops ;
18 struct pdev_archdata { } ;
21 struct device_private ;
22 struct device_driver ;
23 struct driver_private ;
24 struct class ;
25 struct subsys_private ;
26 struct bus_type ;
27 struct device_node ;
28 struct fwnode_handle ;
29 struct iommu_ops ;
30 struct iommu_group ;
31 struct iommu_fwspec ;
62 struct bus_type { const char *name; const char *dev_name; struct device *dev_root; const struct attribute_group **bus_groups; const struct attribute_group **dev_groups; const struct attribute_group **drv_groups; int (*match)(struct device *, struct device_driver *); int (*uevent)(struct device *, struct kobj_uevent_env *); int (*probe)(struct device *); int (*remove)(struct device *); void (*shutdown)(struct device *); int (*online)(struct device *); int (*offline)(struct device *); int (*suspend)(struct device *, pm_message_t ); int (*resume)(struct device *); int (*num_vf)(struct device *); const struct dev_pm_ops *pm; const struct iommu_ops *iommu_ops; struct subsys_private *p; struct lock_class_key lock_key; } ;
145 struct device_type ;
204 enum probe_type { PROBE_DEFAULT_STRATEGY = 0, PROBE_PREFER_ASYNCHRONOUS = 1, PROBE_FORCE_SYNCHRONOUS = 2 } ;
210 struct of_device_id ;
210 struct acpi_device_id ;
210 struct device_driver { const char *name; struct bus_type *bus; struct module *owner; const char *mod_name; bool suppress_bind_attrs; enum probe_type probe_type; const struct of_device_id *of_match_table; const struct acpi_device_id *acpi_match_table; int (*probe)(struct device *); int (*remove)(struct device *); void (*shutdown)(struct device *); int (*suspend)(struct device *, pm_message_t ); int (*resume)(struct device *); const struct attribute_group **groups; const struct dev_pm_ops *pm; struct driver_private *p; } ;
360 struct class { const char *name; struct module *owner; const struct attribute_group **class_groups; const struct attribute_group **dev_groups; struct kobject *dev_kobj; int (*dev_uevent)(struct device *, struct kobj_uevent_env *); char * (*devnode)(struct device *, umode_t *); void (*class_release)(struct class *); void (*dev_release)(struct device *); int (*suspend)(struct device *, pm_message_t ); int (*resume)(struct device *); int (*shutdown)(struct device *); const struct kobj_ns_type_operations *ns_type; const void * (*namespace)(struct device *); const struct dev_pm_ops *pm; struct subsys_private *p; } ;
523 struct device_type { const char *name; const struct attribute_group **groups; int (*uevent)(struct device *, struct kobj_uevent_env *); char * (*devnode)(struct device *, umode_t *, kuid_t *, kgid_t *); void (*release)(struct device *); const struct dev_pm_ops *pm; } ;
551 struct device_attribute { struct attribute attr; ssize_t (*show)(struct device *, struct device_attribute *, char *); ssize_t (*store)(struct device *, struct device_attribute *, const char *, size_t ); } ;
723 struct device_dma_parameters { unsigned int max_segment_size; unsigned long segment_boundary_mask; } ;
786 enum dl_dev_state { DL_DEV_NO_DRIVER = 0, DL_DEV_PROBING = 1, DL_DEV_DRIVER_BOUND = 2, DL_DEV_UNBINDING = 3 } ;
793 struct dev_links_info { struct list_head suppliers; struct list_head consumers; enum dl_dev_state status; } ;
813 struct irq_domain ;
813 struct dma_coherent_mem ;
813 struct cma ;
813 struct device { struct device *parent; struct device_private *p; struct kobject kobj; const char *init_name; const struct device_type *type; struct mutex mutex; struct bus_type *bus; struct device_driver *driver; void *platform_data; void *driver_data; struct dev_links_info links; struct dev_pm_info power; struct dev_pm_domain *pm_domain; struct irq_domain *msi_domain; struct dev_pin_info *pins; struct list_head msi_list; int numa_node; const struct dma_map_ops *dma_ops; u64 *dma_mask; u64 coherent_dma_mask; unsigned long dma_pfn_offset; struct device_dma_parameters *dma_parms; struct list_head dma_pools; struct dma_coherent_mem *dma_mem; struct cma *cma_area; struct dev_archdata archdata; struct device_node *of_node; struct fwnode_handle *fwnode; dev_t devt; u32 id; spinlock_t devres_lock; struct list_head devres_head; struct klist_node knode_class; struct class *class; const struct attribute_group **groups; void (*release)(struct device *); struct iommu_group *iommu_group; struct iommu_fwspec *iommu_fwspec; bool offline_disabled; bool offline; bool of_node_reused; } ;
975 struct wakeup_source { const char *name; struct list_head entry; spinlock_t lock; struct wake_irq *wakeirq; struct timer_list timer; unsigned long timer_expires; ktime_t total_time; ktime_t max_time; ktime_t last_time; ktime_t start_prevent_time; ktime_t prevent_sleep_time; unsigned long event_count; unsigned long active_count; unsigned long relax_count; unsigned long expire_count; unsigned long wakeup_count; bool active; bool autosleep_enabled; } ;
70 enum fwnode_type { FWNODE_INVALID = 0, FWNODE_OF = 1, FWNODE_ACPI = 2, FWNODE_ACPI_DATA = 3, FWNODE_ACPI_STATIC = 4, FWNODE_PDATA = 5, FWNODE_IRQCHIP = 6 } ;
80 struct fwnode_operations ;
81 struct fwnode_handle { enum fwnode_type type; struct fwnode_handle *secondary; const struct fwnode_operations *ops; } ;
34 struct fwnode_endpoint { unsigned int port; unsigned int id; const struct fwnode_handle *local_fwnode; } ;
46 struct fwnode_operations { void (*get)(struct fwnode_handle *); void (*put)(struct fwnode_handle *); bool (*device_is_available)(struct fwnode_handle *); bool (*property_present)(struct fwnode_handle *, const char *); int (*property_read_int_array)(struct fwnode_handle *, const char *, unsigned int, void *, size_t ); int (*property_read_string_array)(struct fwnode_handle *, const char *, const char **, size_t ); struct fwnode_handle * (*get_parent)(struct fwnode_handle *); struct fwnode_handle * (*get_next_child_node)(struct fwnode_handle *, struct fwnode_handle *); struct fwnode_handle * (*get_named_child_node)(struct fwnode_handle *, const char *); struct fwnode_handle * (*graph_get_next_endpoint)(struct fwnode_handle *, struct fwnode_handle *); struct fwnode_handle * (*graph_get_remote_endpoint)(struct fwnode_handle *); struct fwnode_handle * (*graph_get_port_parent)(struct fwnode_handle *); int (*graph_parse_endpoint)(struct fwnode_handle *, struct fwnode_endpoint *); } ;
161 typedef u64 acpi_size;
162 typedef u64 acpi_io_address;
163 typedef u64 acpi_physical_address;
450 typedef u32 acpi_status;
452 typedef char *acpi_string;
453 typedef void *acpi_handle;
649 typedef u32 acpi_object_type;
817 typedef u8 acpi_adr_space_type;
910 struct __anonstruct_integer_345 { acpi_object_type type; u64 value; } ;
910 struct __anonstruct_string_346 { acpi_object_type type; u32 length; char *pointer; } ;
910 struct __anonstruct_buffer_347 { acpi_object_type type; u32 length; u8 *pointer; } ;
910 struct __anonstruct_package_348 { acpi_object_type type; u32 count; union acpi_object *elements; } ;
910 struct __anonstruct_reference_349 { acpi_object_type type; acpi_object_type actual_type; acpi_handle handle; } ;
910 struct __anonstruct_processor_350 { acpi_object_type type; u32 proc_id; acpi_io_address pblk_address; u32 pblk_length; } ;
910 struct __anonstruct_power_resource_351 { acpi_object_type type; u32 system_level; u32 resource_order; } ;
910 union acpi_object { acpi_object_type type; struct __anonstruct_integer_345 integer; struct __anonstruct_string_346 string; struct __anonstruct_buffer_347 buffer; struct __anonstruct_package_348 package; struct __anonstruct_reference_349 reference; struct __anonstruct_processor_350 processor; struct __anonstruct_power_resource_351 power_resource; } ;
963 struct acpi_object_list { u32 count; union acpi_object *pointer; } ;
971 struct acpi_buffer { acpi_size length; void *pointer; } ;
1137 struct acpi_pnp_device_id { u32 length; char *string; } ;
1165 struct acpi_pnp_device_id_list { u32 count; u32 list_size; struct acpi_pnp_device_id ids[1U]; } ;
1171 struct acpi_device_info { u32 info_size; u32 name; acpi_object_type type; u8 param_count; u16 valid; u8 flags; u8 highest_dstates[4U]; u8 lowest_dstates[5U]; u32 current_status; u64 address; struct acpi_pnp_device_id hardware_id; struct acpi_pnp_device_id unique_id; struct acpi_pnp_device_id class_code; struct acpi_pnp_device_id_list compatible_id_list; } ;
13 typedef unsigned long kernel_ulong_t;
187 struct acpi_device_id { __u8 id[9U]; kernel_ulong_t driver_data; __u32 cls; __u32 cls_msk; } ;
230 struct of_device_id { char name[32U]; char type[32U]; char compatible[128U]; const void *data; } ;
496 struct platform_device_id { char name[20U]; kernel_ulong_t driver_data; } ;
19 struct vdso_image { void *data; unsigned long size; unsigned long alt; unsigned long alt_len; long sym_vvar_start; long sym_vvar_page; long sym_hpet_page; long sym_pvclock_page; long sym_hvclock_page; long sym_VDSO32_NOTE_MASK; long sym___kernel_sigreturn; long sym___kernel_rt_sigreturn; long sym___kernel_vsyscall; long sym_int80_landing_pad; } ;
15 typedef __u64 Elf64_Addr;
16 typedef __u16 Elf64_Half;
18 typedef __u64 Elf64_Off;
20 typedef __u32 Elf64_Word;
21 typedef __u64 Elf64_Xword;
190 struct elf64_sym { Elf64_Word st_name; unsigned char st_info; unsigned char st_other; Elf64_Half st_shndx; Elf64_Addr st_value; Elf64_Xword st_size; } ;
198 typedef struct elf64_sym Elf64_Sym;
219 struct elf64_hdr { unsigned char e_ident[16U]; Elf64_Half e_type; Elf64_Half e_machine; Elf64_Word e_version; Elf64_Addr e_entry; Elf64_Off e_phoff; Elf64_Off e_shoff; Elf64_Word e_flags; Elf64_Half e_ehsize; Elf64_Half e_phentsize; Elf64_Half e_phnum; Elf64_Half e_shentsize; Elf64_Half e_shnum; Elf64_Half e_shstrndx; } ;
235 typedef struct elf64_hdr Elf64_Ehdr;
314 struct elf64_shdr { Elf64_Word sh_name; Elf64_Word sh_type; Elf64_Xword sh_flags; Elf64_Addr sh_addr; Elf64_Off sh_offset; Elf64_Xword sh_size; Elf64_Word sh_link; Elf64_Word sh_info; Elf64_Xword sh_addralign; Elf64_Xword sh_entsize; } ;
326 typedef struct elf64_shdr Elf64_Shdr;
55 struct kernel_param ;
60 struct kernel_param_ops { unsigned int flags; int (*set)(const char *, const struct kernel_param *); int (*get)(char *, const struct kernel_param *); void (*free)(void *); } ;
63 struct kparam_string ;
63 struct kparam_array ;
63 union __anonunion____missing_field_name_357 { void *arg; const struct kparam_string *str; const struct kparam_array *arr; } ;
63 struct kernel_param { const char *name; struct module *mod; const struct kernel_param_ops *ops; const u16 perm; s8 level; u8 flags; union __anonunion____missing_field_name_357 __annonCompField73; } ;
85 struct kparam_string { unsigned int maxlen; char *string; } ;
91 struct kparam_array { unsigned int max; unsigned int elemsize; unsigned int *num; const struct kernel_param_ops *ops; void *elem; } ;
533 struct latch_tree_node { struct rb_node node[2U]; } ;
211 struct mod_arch_specific { } ;
38 struct exception_table_entry ;
39 struct module_param_attrs ;
39 struct module_kobject { struct kobject kobj; struct module *mod; struct kobject *drivers_dir; struct module_param_attrs *mp; struct completion *kobj_completion; } ;
49 struct module_attribute { struct attribute attr; ssize_t (*show)(struct module_attribute *, struct module_kobject *, char *); ssize_t (*store)(struct module_attribute *, struct module_kobject *, const char *, size_t ); void (*setup)(struct module *, const char *); int (*test)(struct module *); void (*free)(struct module *); } ;
276 enum module_state { MODULE_STATE_LIVE = 0, MODULE_STATE_COMING = 1, MODULE_STATE_GOING = 2, MODULE_STATE_UNFORMED = 3 } ;
283 struct mod_tree_node { struct module *mod; struct latch_tree_node node; } ;
288 struct module_layout { void *base; unsigned int size; unsigned int text_size; unsigned int ro_size; unsigned int ro_after_init_size; struct mod_tree_node mtn; } ;
304 struct mod_kallsyms { Elf64_Sym *symtab; unsigned int num_symtab; char *strtab; } ;
318 struct klp_modinfo { Elf64_Ehdr hdr; Elf64_Shdr *sechdrs; char *secstrings; unsigned int symndx; } ;
326 struct module_sect_attrs ;
326 struct module_notes_attrs ;
326 struct trace_event_call ;
326 struct trace_eval_map ;
326 struct module { enum module_state state; struct list_head list; char name[56U]; struct module_kobject mkobj; struct module_attribute *modinfo_attrs; const char *version; const char *srcversion; struct kobject *holders_dir; const struct kernel_symbol *syms; const s32 *crcs; unsigned int num_syms; struct mutex param_lock; struct kernel_param *kp; unsigned int num_kp; unsigned int num_gpl_syms; const struct kernel_symbol *gpl_syms; const s32 *gpl_crcs; const struct kernel_symbol *unused_syms; const s32 *unused_crcs; unsigned int num_unused_syms; unsigned int num_unused_gpl_syms; const struct kernel_symbol *unused_gpl_syms; const s32 *unused_gpl_crcs; bool sig_ok; bool async_probe_requested; const struct kernel_symbol *gpl_future_syms; const s32 *gpl_future_crcs; unsigned int num_gpl_future_syms; unsigned int num_exentries; struct exception_table_entry *extable; int (*init)(); struct module_layout core_layout; struct module_layout init_layout; struct mod_arch_specific arch; unsigned long taints; unsigned int num_bugs; struct list_head bug_list; struct bug_entry *bug_table; struct mod_kallsyms *kallsyms; struct mod_kallsyms core_kallsyms; struct module_sect_attrs *sect_attrs; struct module_notes_attrs *notes_attrs; char *args; void *percpu; unsigned int percpu_size; unsigned int num_tracepoints; const struct tracepoint **tracepoints_ptrs; unsigned int num_trace_bprintk_fmt; const char **trace_bprintk_fmt_start; struct trace_event_call **trace_events; unsigned int num_trace_events; struct trace_eval_map **trace_evals; unsigned int num_trace_evals; bool klp; bool klp_alive; struct klp_modinfo *klp_info; struct list_head source_list; struct list_head target_list; void (*exit)(); atomic_t refcnt; ctor_fn_t (**ctors)(); unsigned int num_ctors; } ;
93 struct proc_dir_entry ;
110 struct acpi_driver ;
111 struct acpi_device ;
112 struct acpi_hotplug_profile { struct kobject kobj; int (*scan_dependent)(struct acpi_device *); void (*notify_online)(struct acpi_device *); bool enabled; bool demand_offline; } ;
133 struct acpi_scan_handler { const struct acpi_device_id *ids; struct list_head list_node; bool (*match)(const char *, const struct acpi_device_id **); int (*attach)(struct acpi_device *, const struct acpi_device_id *); void (*detach)(struct acpi_device *); void (*bind)(struct device *); void (*unbind)(struct device *); struct acpi_hotplug_profile hotplug; } ;
143 struct acpi_hotplug_context { struct acpi_device *self; int (*notify)(struct acpi_device *, u32 ); void (*uevent)(struct acpi_device *, u32 ); void (*fixup)(struct acpi_device *); } ;
164 struct acpi_device_ops { int (*add)(struct acpi_device *); int (*remove)(struct acpi_device *); void (*notify)(struct acpi_device *, u32 ); } ;
170 struct acpi_driver { char name[80U]; char class[80U]; const struct acpi_device_id *ids; unsigned int flags; struct acpi_device_ops ops; struct device_driver drv; struct module *owner; } ;
182 struct acpi_device_status { unsigned char present; unsigned char enabled; unsigned char show_in_ui; unsigned char functional; unsigned char battery_present; unsigned int reserved; } ;
198 struct acpi_device_flags { unsigned char dynamic_status; unsigned char removable; unsigned char ejectable; unsigned char power_manageable; unsigned char match_driver; unsigned char initialized; unsigned char visited; unsigned char hotplug_notify; unsigned char is_dock_station; unsigned char of_compatible_ok; unsigned char coherent_dma; unsigned char cca_seen; unsigned char spi_i2c_slave; unsigned int reserved; } ;
217 struct acpi_device_dir { struct proc_dir_entry *entry; } ;
228 typedef char acpi_bus_id[8U];
229 typedef unsigned long acpi_bus_address;
230 typedef char acpi_device_name[40U];
231 typedef char acpi_device_class[20U];
237 struct acpi_pnp_type { unsigned char hardware_id; unsigned char bus_address; unsigned char platform_id; unsigned int reserved; } ;
244 struct acpi_device_pnp { acpi_bus_id bus_id; struct acpi_pnp_type type; acpi_bus_address bus_address; char *unique_id; struct list_head ids; acpi_device_name device_name; acpi_device_class device_class; union acpi_object *str_obj; } ;
259 struct acpi_device_power_flags { unsigned char explicit_get; unsigned char power_resources; unsigned char inrush_current; unsigned char power_removed; unsigned char ignore_parent; unsigned char dsw_present; unsigned int reserved; } ;
274 struct __anonstruct_flags_364 { unsigned char valid; unsigned char explicit_set; unsigned char reserved; } ;
274 struct acpi_device_power_state { struct __anonstruct_flags_364 flags; int power; int latency; struct list_head resources; } ;
285 struct acpi_device_power { int state; struct acpi_device_power_flags flags; struct acpi_device_power_state states[5U]; } ;
291 struct acpi_device_perf_flags { u8 reserved; } ;
297 struct __anonstruct_flags_365 { unsigned char valid; unsigned char reserved; } ;
297 struct acpi_device_perf_state { struct __anonstruct_flags_365 flags; u8 power; u8 performance; int latency; } ;
307 struct acpi_device_perf { int state; struct acpi_device_perf_flags flags; int state_count; struct acpi_device_perf_state *states; } ;
314 struct acpi_device_wakeup_flags { unsigned char valid; unsigned char notifier_present; unsigned char enabled; } ;
321 struct acpi_device_wakeup_context { void (*func)(struct acpi_device_wakeup_context *); struct device *dev; } ;
326 struct acpi_device_wakeup { acpi_handle gpe_device; u64 gpe_number; u64 sleep_state; struct list_head resources; struct acpi_device_wakeup_flags flags; struct acpi_device_wakeup_context context; struct wakeup_source *ws; int prepare_count; } ;
344 struct acpi_device_data { const union acpi_object *pointer; const union acpi_object *properties; const union acpi_object *of_compatible; struct list_head subnodes; } ;
352 struct acpi_gpio_mapping ;
353 struct acpi_device { int device_type; acpi_handle handle; struct fwnode_handle fwnode; struct acpi_device *parent; struct list_head children; struct list_head node; struct list_head wakeup_list; struct list_head del_list; struct acpi_device_status status; struct acpi_device_flags flags; struct acpi_device_pnp pnp; struct acpi_device_power power; struct acpi_device_wakeup wakeup; struct acpi_device_perf performance; struct acpi_device_dir dir; struct acpi_device_data data; struct acpi_scan_handler *handler; struct acpi_hotplug_context *hp; struct acpi_driver *driver; const struct acpi_gpio_mapping *driver_gpios; void *driver_data; struct device dev; unsigned int physical_node_count; unsigned int dep_unmet; struct list_head physical_node_list; struct mutex physical_node_lock; void (*remove)(struct acpi_device *); } ;
576 struct platform_device ;
897 struct acpi_gpio_params { unsigned int crs_entry_index; unsigned int line_index; bool active_low; } ;
950 struct acpi_gpio_mapping { const char *name; const struct acpi_gpio_params *data; unsigned int size; } ;
1225 struct mfd_cell ;
1226 struct platform_device { const char *name; int id; bool id_auto; struct device dev; u32 num_resources; struct resource *resource; const struct platform_device_id *id_entry; char *driver_override; struct mfd_cell *mfd_cell; struct pdev_archdata archdata; } ;
179 struct platform_driver { int (*probe)(struct platform_device *); int (*remove)(struct platform_device *); void (*shutdown)(struct platform_device *); int (*suspend)(struct platform_device *, pm_message_t ); int (*resume)(struct platform_device *); struct device_driver driver; const struct platform_device_id *id_table; bool prevent_deferred_probe; } ;
352 struct wmi_device { struct device dev; bool setable; } ;
35 struct wmi_device_id { const char *guid_string; } ;
40 struct wmi_driver { struct device_driver driver; const struct wmi_device_id *id_table; int (*probe)(struct wmi_device *); int (*remove)(struct wmi_device *); void (*notify)(struct wmi_device *, union acpi_object *); } ;
55 struct __anonstruct____missing_field_name_368 { unsigned char notify_id; unsigned char reserved; } ;
55 union __anonunion____missing_field_name_367 { char object_id[2U]; struct __anonstruct____missing_field_name_368 __annonCompField75; } ;
55 struct guid_block { char guid[16U]; union __anonunion____missing_field_name_367 __annonCompField76; u8 instance_count; u8 flags; } ;
68 struct wmi_block { struct wmi_device dev; struct list_head list; struct guid_block gblock; struct acpi_device *acpi_device; void (*handler)(u32 , void *); void *handler_data; bool read_takes_no_args; } ;
1 void * __builtin_memcpy(void *, const void *, unsigned long);
1 long int __builtin_expect(long, long);
273 void __write_once_size(volatile void *p, void *res, int size);
34 extern struct module __this_module;
172 int printk(const char *, ...);
417 int sprintf(char *, const char *, ...);
420 int snprintf(char *, size_t , const char *, ...);
3 bool ldv_is_err(const void *ptr);
4 bool ldv_is_err_or_null(const void *ptr);
6 long int ldv_ptr_err(const void *ptr);
12 int ldv_register_class();
13 void ldv_unregister_class();
32 bool __list_add_valid(struct list_head *, struct list_head *, struct list_head *);
35 bool __list_del_entry_valid(struct list_head *);
55 void __list_add(struct list_head *new, struct list_head *prev, struct list_head *next);
90 void list_add_tail(struct list_head *new, struct list_head *head);
102 void __list_del(struct list_head *prev, struct list_head *next);
114 void __list_del_entry(struct list_head *entry);
122 void list_del(struct list_head *entry);
32 long int PTR_ERR(const void *ptr);
41 bool IS_ERR(const void *ptr);
50 bool IS_ERR_OR_NULL(const void *ptr);
65 int memcmp(const void *, const void *, size_t );
67 char * strcpy(char *, const char *);
36 char * strncat(char *, const char *, __kernel_size_t );
44 extern int acpi_disabled;
87 const char * kobject_name(const struct kobject *kobj);
223 int add_uevent_var(struct kobj_uevent_env *, const char *, ...);
83 int guid_parse(const char *, guid_t *);
140 int bus_register(struct bus_type *);
142 void bus_unregister(struct bus_type *);
292 int driver_register(struct device_driver *);
293 void driver_unregister(struct device_driver *);
426 void class_unregister(struct class *);
429 void ldv_class_unregister_7(struct class *ldv_func_arg1);
433 void ldv_class_unregister_8(struct class *ldv_func_arg1);
978 const char * dev_name(const struct device *dev);
988 int dev_set_name(struct device *, const char *, ...);
1025 void * dev_get_drvdata(const struct device *dev);
1030 void dev_set_drvdata(struct device *dev, void *data);
1117 void device_unregister(struct device *);
1118 void device_initialize(struct device *);
1119 int device_add(struct device *);
1193 struct device * device_create(struct class *, struct device *, dev_t , void *, const char *, ...);
1218 struct device * get_device(struct device *);
1219 void put_device(struct device *);
1260 void dev_err(const struct device *, const char *, ...);
1262 void dev_warn(const struct device *, const char *, ...);
156 void kfree(const void *);
332 void * __kmalloc(size_t , gfp_t );
481 void * kmalloc(size_t size, gfp_t flags);
664 void * kzalloc(size_t size, gfp_t flags);
550 acpi_status acpi_get_handle(acpi_handle , acpi_string , acpi_handle **);
572 acpi_status acpi_evaluate_object(acpi_handle , acpi_string , struct acpi_object_list *, struct acpi_buffer *);
588 acpi_status acpi_get_object_info(acpi_handle , struct acpi_device_info **);
657 acpi_status acpi_install_notify_handler(acpi_handle , u32 , void (*)(acpi_handle , u32 , void *), void *);
663 acpi_status acpi_remove_notify_handler(acpi_handle , u32 , void (*)(acpi_handle , u32 , void *));
668 acpi_status acpi_install_address_space_handler(acpi_handle , acpi_adr_space_type , acpi_status (*)(u32 , acpi_physical_address , u32 , u64 *, void *, void *), acpi_status (*)(acpi_handle , u32 , void *, void **), void *);
678 acpi_status acpi_remove_address_space_handler(acpi_handle , acpi_adr_space_type , acpi_status (*)(u32 , acpi_physical_address , u32 , u64 *, void *, void *));
55 bool acpi_has_method(acpi_handle , char *);
56 acpi_status acpi_execute_simple_method(acpi_handle , char *, u64 );
404 bool is_acpi_device_node(struct fwnode_handle *fwnode);
412 void __compiletime_assert_412();
409 struct acpi_device * to_acpi_device_node(struct fwnode_handle *fwnode);
480 int acpi_bus_generate_netlink_event(const char *, const char *, u8 , int);
348 int ec_read(u8 , u8 *);
349 int ec_write(u8 , u8 );
361 acpi_status wmi_evaluate_method(const char *guid_string, u8 instance, u32 method_id, const struct acpi_buffer *in, struct acpi_buffer *out);
365 acpi_status wmi_query_block(const char *guid_string, u8 instance, struct acpi_buffer *out);
367 acpi_status wmi_set_block(const char *guid_string, u8 instance, const struct acpi_buffer *in);
369 acpi_status wmi_install_notify_handler(const char *guid, void (*handler)(u32 , void *), void *data);
371 acpi_status wmi_remove_notify_handler(const char *guid);
372 acpi_status wmi_get_event_data(u32 event, struct acpi_buffer *out);
373 bool wmi_has_guid(const char *guid_string);
199 int __platform_driver_register(struct platform_driver *, struct module *);
201 void platform_driver_unregister(struct platform_driver *);
30 union acpi_object * wmidev_block_query(struct wmi_device *wdev, u8 instance);
34 struct wmi_device * wmidev_get_other_guid(struct wmi_device *wdev, const char *guid_string);
50 int __wmi_driver_register(struct wmi_driver *driver, struct module *owner);
52 void wmi_driver_unregister(struct wmi_driver *driver);
54 struct list_head wmi_block_list = { &wmi_block_list, &wmi_block_list };
90 _Bool debug_event = 0;
95 _Bool debug_dump_wdg = 0;
100 int acpi_wmi_remove(struct platform_device *device);
101 int acpi_wmi_probe(struct platform_device *device);
103 const struct acpi_device_id wmi_device_ids[3U] = { { { 'P', 'N', 'P', '0', 'C', '1', '4', '\x0' }, 0UL, 0U, 0U }, { { 'p', 'n', 'p', '0', 'c', '1', '4', '\x0' }, 0UL, 0U, 0U }, { { '\x0' }, 0UL, 0U, 0U } };
108 const struct acpi_device_id __mod_acpi__wmi_device_ids_device_table[3U] = { };
110 struct platform_driver acpi_wmi_driver = { &acpi_wmi_probe, &acpi_wmi_remove, 0, 0, 0, { "acpi-wmi", 0, 0, 0, (_Bool)0, 0, 0, (const struct acpi_device_id *)(&wmi_device_ids), 0, 0, 0, 0, 0, 0, 0, 0 }, 0, (_Bool)0 };
134 void __compiletime_assert_134();
123 bool find_guid(const char *guid_string, struct wmi_block **out);
146 int get_subobj_info(acpi_handle handle, const char *pathname, struct acpi_device_info **info);
170 acpi_status wmi_method_enable(struct wmi_block *wblock, int enable);
252 acpi_status __query_block(struct wmi_block *wblock, u8 instance, struct acpi_buffer *out);
343 void __compiletime_assert_343();
355 void __compiletime_assert_355();
422 void wmi_dump_wdg(const struct guid_block *g);
445 void wmi_notify_debug(u32 value, void *context);
505 void __compiletime_assert_505();
546 void __compiletime_assert_546();
594 void __compiletime_assert_594();
621 void __compiletime_assert_621();
619 struct wmi_block * dev_to_wblock(struct device *dev);
626 void __compiletime_assert_626();
624 struct wmi_device * dev_to_wdev(struct device *dev);
632 ssize_t modalias_show(struct device *dev, struct device_attribute *attr, char *buf);
639 struct device_attribute dev_attr_modalias = { { "modalias", 292U, (_Bool)0, 0, { { { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 } } } }, &modalias_show, 0 };
641 ssize_t guid_show(struct device *dev, struct device_attribute *attr, char *buf);
648 struct device_attribute dev_attr_guid = { { "guid", 292U, (_Bool)0, 0, { { { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 } } } }, &guid_show, 0 };
650 ssize_t instance_count_show(struct device *dev, struct device_attribute *attr, char *buf);
657 struct device_attribute dev_attr_instance_count = { { "instance_count", 292U, (_Bool)0, 0, { { { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 } } } }, &instance_count_show, 0 };
659 ssize_t expensive_show(struct device *dev, struct device_attribute *attr, char *buf);
667 struct device_attribute dev_attr_expensive = { { "expensive", 292U, (_Bool)0, 0, { { { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 } } } }, &expensive_show, 0 };
669 struct attribute *wmi_attrs[5U] = { &(dev_attr_modalias.attr), &(dev_attr_guid.attr), &(dev_attr_instance_count.attr), &(dev_attr_expensive.attr), (struct attribute *)0 };
676 const struct attribute_group wmi_group = { 0, 0, 0, (struct attribute **)(&wmi_attrs), 0 };
676 const struct attribute_group *wmi_groups[2U] = { &wmi_group, (const struct attribute_group *)0 };
678 ssize_t notify_id_show(struct device *dev, struct device_attribute *attr, char *buf);
685 struct device_attribute dev_attr_notify_id = { { "notify_id", 292U, (_Bool)0, 0, { { { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 } } } }, ¬ify_id_show, 0 };
687 struct attribute *wmi_event_attrs[2U] = { &(dev_attr_notify_id.attr), (struct attribute *)0 };
691 const struct attribute_group wmi_event_group = { 0, 0, 0, (struct attribute **)(&wmi_event_attrs), 0 };
691 const struct attribute_group *wmi_event_groups[2U] = { &wmi_event_group, (const struct attribute_group *)0 };
693 ssize_t object_id_show(struct device *dev, struct device_attribute *attr, char *buf);
701 struct device_attribute dev_attr_object_id = { { "object_id", 292U, (_Bool)0, 0, { { { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 } } } }, &object_id_show, 0 };
703 ssize_t setable_show(struct device *dev, struct device_attribute *attr, char *buf);
710 struct device_attribute dev_attr_setable = { { "setable", 292U, (_Bool)0, 0, { { { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 } } } }, &setable_show, 0 };
712 struct attribute *wmi_data_attrs[3U] = { &(dev_attr_object_id.attr), &(dev_attr_setable.attr), (struct attribute *)0 };
717 const struct attribute_group wmi_data_group = { 0, 0, 0, (struct attribute **)(&wmi_data_attrs), 0 };
717 const struct attribute_group *wmi_data_groups[2U] = { &wmi_data_group, (const struct attribute_group *)0 };
719 struct attribute *wmi_method_attrs[2U] = { &(dev_attr_object_id.attr), (struct attribute *)0 };
723 const struct attribute_group wmi_method_group = { 0, 0, 0, (struct attribute **)(&wmi_method_attrs), 0 };
723 const struct attribute_group *wmi_method_groups[2U] = { &wmi_method_group, (const struct attribute_group *)0 };
725 int wmi_dev_uevent(struct device *dev, struct kobj_uevent_env *env);
738 void wmi_dev_release(struct device *dev);
748 void __compiletime_assert_748();
745 int wmi_dev_match(struct device *dev, struct device_driver *driver);
770 void __compiletime_assert_770();
766 int wmi_dev_probe(struct device *dev);
789 void __compiletime_assert_789();
785 int wmi_dev_remove(struct device *dev);
801 struct class wmi_bus_class = { "wmi_bus", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
805 struct bus_type wmi_bus_type = { "wmi", 0, 0, 0, (const struct attribute_group **)(&wmi_groups), 0, &wmi_dev_match, &wmi_dev_uevent, &wmi_dev_probe, &wmi_dev_remove, 0, 0, 0, 0, 0, 0, 0, 0, 0, { { { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 } } } };
814 struct device_type wmi_type_event = { "event", (const struct attribute_group **)(&wmi_event_groups), 0, 0, &wmi_dev_release, 0 };
820 struct device_type wmi_type_method = { "method", (const struct attribute_group **)(&wmi_method_groups), 0, 0, &wmi_dev_release, 0 };
826 struct device_type wmi_type_data = { "data", (const struct attribute_group **)(&wmi_data_groups), 0, 0, &wmi_dev_release, 0 };
832 int wmi_create_device(struct device *wmi_bus_dev, const struct guid_block *gblock, struct wmi_block *wblock, struct acpi_device *device);
907 void __compiletime_assert_907();
902 void wmi_free_devices(struct acpi_device *device);
920 void __compiletime_assert_920();
915 bool guid_already_parsed(struct acpi_device *device, const u8 *guid);
1006 void __compiletime_assert_1006();
940 int parse_wdg(struct device *wmi_bus_dev, struct acpi_device *device);
1031 acpi_status acpi_wmi_ec_space_handler(u32 function, acpi_physical_address address, u32 bits, u64 *value, void *handler_context, void *region_context);
1079 void __compiletime_assert_1079();
1103 void __compiletime_assert_1103();
1070 void acpi_wmi_notify_handler(acpi_handle handle, u32 event, void *context);
1233 int acpi_wmi_init();
1265 void acpi_wmi_exit();
1291 void ldv_check_final_state();
1294 void ldv_check_return_value(int);
1297 void ldv_check_return_value_probe(int);
1300 void ldv_initialize();
1303 void ldv_handler_precall();
1306 int nondet_int();
1309 int LDV_IN_INTERRUPT = 0;
1312 void ldv_main0_sequence_infinite_withcheck_stateful();
10 void ldv_error();
20 void ldv_stop();
25 int ldv_undef_int();
26 void * ldv_undef_ptr();
39 int ldv_undef_int_nonpositive();
14 void * ldv_err_ptr(long error);
28 int ldv_usb_gadget_class = 0;
31 int ldv_usb_gadget_chrdev = 0;
34 int ldv_usb_gadget = 0;
38 void * ldv_create_class();
95 int ldv_register_chrdev(int major);
124 int ldv_register_chrdev_region();
147 void ldv_unregister_chrdev_region();
158 int ldv_register_usb_gadget();
179 void ldv_unregister_usb_gadget();
return ;
}
-entry_point
{
1314 struct platform_device *var_group1;
1315 int res_acpi_wmi_probe_36;
1316 struct device *var_group2;
1317 struct device_driver *var_group3;
1318 struct kobj_uevent_env *var_group4;
1319 int res_wmi_dev_probe_27;
1320 int ldv_s_acpi_wmi_driver_platform_driver;
1321 int ldv_s_wmi_bus_type_bus_type;
1322 int ldv_s_wmi_type_event_device_type;
1323 int ldv_s_wmi_type_method_device_type;
1324 int ldv_s_wmi_type_data_device_type;
1325 int tmp;
1326 int tmp___0;
1327 int tmp___1;
1442 ldv_s_acpi_wmi_driver_platform_driver = 0;
1444 ldv_s_wmi_bus_type_bus_type = 0;
1447 ldv_s_wmi_type_event_device_type = 0;
1449 ldv_s_wmi_type_method_device_type = 0;
1451 ldv_s_wmi_type_data_device_type = 0;
1418 LDV_IN_INTERRUPT = 1;
1427 ldv_initialize() { /* Function call is skipped due to function is undefined */}
1439 ldv_handler_precall() { /* Function call is skipped due to function is undefined */}
1440 -acpi_wmi_init()
{
1235 int error;
1237 assume(!(acpi_disabled != 0));
1240 -ldv_register_class()
{
63 int is_reg;
66 -ldv_undef_int_nonpositive()
{
41 int ret;
42 int tmp;
41 tmp = ldv_undef_int() { /* Function call is skipped due to function is undefined */}
41 ret = tmp;
43 assume(!(ret > 0));
45 return ret;;
}
69 assume(is_reg == 0);
72 assume(!(ldv_usb_gadget != 0));
74 assume(!(ldv_usb_gadget_class != 0));
76 ldv_usb_gadget_class = 1;
80 return is_reg;;
}
1241 assume(!(error != 0));
1244 error = bus_register(&wmi_bus_type) { /* Function call is skipped due to function is undefined */}
1245 assume(!(error != 0));
1248 error = __platform_driver_register(&acpi_wmi_driver, &__this_module) { /* Function call is skipped due to function is undefined */}
1249 assume(error != 0);
1250 printk("\vwmi: Error loading mapper\n") { /* Function call is skipped due to function is undefined */}
1251 goto err_unreg_bus;
1260 bus_unregister(&wmi_bus_type) { /* Function call is skipped due to function is undefined */}
1262 return error;;
}
1440 assume(tmp != 0);
1441 goto ldv_final;
1699 -ldv_check_final_state()
{
191 assume(ldv_usb_gadget_class != 0);
191 -ldv_error()
{
15 LDV_ERROR:;
}
}
}
Source code
1 2 /* 3 * ACPI-WMI mapping driver 4 * 5 * Copyright (C) 2007-2008 Carlos Corbacho <carlos@strangeworlds.co.uk> 6 * 7 * GUID parsing code from ldm.c is: 8 * Copyright (C) 2001,2002 Richard Russon <ldm@flatcap.org> 9 * Copyright (c) 2001-2007 Anton Altaparmakov 10 * Copyright (C) 2001,2002 Jakob Kemi <jakob.kemi@telia.com> 11 * 12 * WMI bus infrastructure by Andrew Lutomirski and Darren Hart: 13 * Copyright (C) 2015 Andrew Lutomirski 14 * Copyright (C) 2017 VMware, Inc. All Rights Reserved. 15 * 16 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 17 * 18 * This program is free software; you can redistribute it and/or modify 19 * it under the terms of the GNU General Public License as published by 20 * the Free Software Foundation; either version 2 of the License, or (at 21 * your option) any later version. 22 * 23 * This program is distributed in the hope that it will be useful, but 24 * WITHOUT ANY WARRANTY; without even the implied warranty of 25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 26 * General Public License for more details. 27 * 28 * You should have received a copy of the GNU General Public License along 29 * with this program; if not, write to the Free Software Foundation, Inc., 30 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. 31 * 32 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 33 */ 34 35 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 36 37 #include <linux/kernel.h> 38 #include <linux/init.h> 39 #include <linux/types.h> 40 #include <linux/device.h> 41 #include <linux/list.h> 42 #include <linux/acpi.h> 43 #include <linux/slab.h> 44 #include <linux/module.h> 45 #include <linux/platform_device.h> 46 #include <linux/wmi.h> 47 #include <linux/uuid.h> 48 49 ACPI_MODULE_NAME("wmi"); 50 MODULE_AUTHOR("Carlos Corbacho"); 51 MODULE_DESCRIPTION("ACPI-WMI Mapping Driver"); 52 MODULE_LICENSE("GPL"); 53 54 static LIST_HEAD(wmi_block_list); 55 56 struct guid_block { 57 char guid[16]; 58 union { 59 char object_id[2]; 60 struct { 61 unsigned char notify_id; 62 unsigned char reserved; 63 }; 64 }; 65 u8 instance_count; 66 u8 flags; 67 }; 68 69 struct wmi_block { 70 struct wmi_device dev; 71 struct list_head list; 72 struct guid_block gblock; 73 struct acpi_device *acpi_device; 74 wmi_notify_handler handler; 75 void *handler_data; 76 77 bool read_takes_no_args; 78 }; 79 80 81 /* 82 * If the GUID data block is marked as expensive, we must enable and 83 * explicitily disable data collection. 84 */ 85 #define ACPI_WMI_EXPENSIVE 0x1 86 #define ACPI_WMI_METHOD 0x2 /* GUID is a method */ 87 #define ACPI_WMI_STRING 0x4 /* GUID takes & returns a string */ 88 #define ACPI_WMI_EVENT 0x8 /* GUID is an event */ 89 90 static bool debug_event; 91 module_param(debug_event, bool, 0444); 92 MODULE_PARM_DESC(debug_event, 93 "Log WMI Events [0/1]"); 94 95 static bool debug_dump_wdg; 96 module_param(debug_dump_wdg, bool, 0444); 97 MODULE_PARM_DESC(debug_dump_wdg, 98 "Dump available WMI interfaces [0/1]"); 99 100 static int acpi_wmi_remove(struct platform_device *device); 101 static int acpi_wmi_probe(struct platform_device *device); 102 103 static const struct acpi_device_id wmi_device_ids[] = { 104 {"PNP0C14", 0}, 105 {"pnp0c14", 0}, 106 {"", 0}, 107 }; 108 MODULE_DEVICE_TABLE(acpi, wmi_device_ids); 109 110 static struct platform_driver acpi_wmi_driver = { 111 .driver = { 112 .name = "acpi-wmi", 113 .acpi_match_table = wmi_device_ids, 114 }, 115 .probe = acpi_wmi_probe, 116 .remove = acpi_wmi_remove, 117 }; 118 119 /* 120 * GUID parsing functions 121 */ 122 123 static bool find_guid(const char *guid_string, struct wmi_block **out) 124 { 125 uuid_le guid_input; 126 struct wmi_block *wblock; 127 struct guid_block *block; 128 struct list_head *p; 129 130 if (uuid_le_to_bin(guid_string, &guid_input)) 131 return false; 132 133 list_for_each(p, &wmi_block_list) { 134 wblock = list_entry(p, struct wmi_block, list); 135 block = &wblock->gblock; 136 137 if (memcmp(block->guid, &guid_input, 16) == 0) { 138 if (out) 139 *out = wblock; 140 return true; 141 } 142 } 143 return false; 144 } 145 146 static int get_subobj_info(acpi_handle handle, const char *pathname, 147 struct acpi_device_info **info) 148 { 149 struct acpi_device_info *dummy_info, **info_ptr; 150 acpi_handle subobj_handle; 151 acpi_status status; 152 153 status = acpi_get_handle(handle, (char *)pathname, &subobj_handle); 154 if (status == AE_NOT_FOUND) 155 return -ENOENT; 156 else if (ACPI_FAILURE(status)) 157 return -EIO; 158 159 info_ptr = info ? info : &dummy_info; 160 status = acpi_get_object_info(subobj_handle, info_ptr); 161 if (ACPI_FAILURE(status)) 162 return -EIO; 163 164 if (!info) 165 kfree(dummy_info); 166 167 return 0; 168 } 169 170 static acpi_status wmi_method_enable(struct wmi_block *wblock, int enable) 171 { 172 struct guid_block *block = NULL; 173 char method[5]; 174 acpi_status status; 175 acpi_handle handle; 176 177 block = &wblock->gblock; 178 handle = wblock->acpi_device->handle; 179 180 snprintf(method, 5, "WE%02X", block->notify_id); 181 status = acpi_execute_simple_method(handle, method, enable); 182 183 if (status != AE_OK && status != AE_NOT_FOUND) 184 return status; 185 else 186 return AE_OK; 187 } 188 189 /* 190 * Exported WMI functions 191 */ 192 /** 193 * wmi_evaluate_method - Evaluate a WMI method 194 * @guid_string: 36 char string of the form fa50ff2b-f2e8-45de-83fa-65417f2f49ba 195 * @instance: Instance index 196 * @method_id: Method ID to call 197 * &in: Buffer containing input for the method call 198 * &out: Empty buffer to return the method results 199 * 200 * Call an ACPI-WMI method 201 */ 202 acpi_status wmi_evaluate_method(const char *guid_string, u8 instance, 203 u32 method_id, const struct acpi_buffer *in, struct acpi_buffer *out) 204 { 205 struct guid_block *block = NULL; 206 struct wmi_block *wblock = NULL; 207 acpi_handle handle; 208 acpi_status status; 209 struct acpi_object_list input; 210 union acpi_object params[3]; 211 char method[5] = "WM"; 212 213 if (!find_guid(guid_string, &wblock)) 214 return AE_ERROR; 215 216 block = &wblock->gblock; 217 handle = wblock->acpi_device->handle; 218 219 if (!(block->flags & ACPI_WMI_METHOD)) 220 return AE_BAD_DATA; 221 222 if (block->instance_count < instance) 223 return AE_BAD_PARAMETER; 224 225 input.count = 2; 226 input.pointer = params; 227 params[0].type = ACPI_TYPE_INTEGER; 228 params[0].integer.value = instance; 229 params[1].type = ACPI_TYPE_INTEGER; 230 params[1].integer.value = method_id; 231 232 if (in) { 233 input.count = 3; 234 235 if (block->flags & ACPI_WMI_STRING) { 236 params[2].type = ACPI_TYPE_STRING; 237 } else { 238 params[2].type = ACPI_TYPE_BUFFER; 239 } 240 params[2].buffer.length = in->length; 241 params[2].buffer.pointer = in->pointer; 242 } 243 244 strncat(method, block->object_id, 2); 245 246 status = acpi_evaluate_object(handle, method, &input, out); 247 248 return status; 249 } 250 EXPORT_SYMBOL_GPL(wmi_evaluate_method); 251 252 static acpi_status __query_block(struct wmi_block *wblock, u8 instance, 253 struct acpi_buffer *out) 254 { 255 struct guid_block *block = NULL; 256 acpi_handle handle; 257 acpi_status status, wc_status = AE_ERROR; 258 struct acpi_object_list input; 259 union acpi_object wq_params[1]; 260 char method[5]; 261 char wc_method[5] = "WC"; 262 263 if (!out) 264 return AE_BAD_PARAMETER; 265 266 block = &wblock->gblock; 267 handle = wblock->acpi_device->handle; 268 269 if (block->instance_count < instance) 270 return AE_BAD_PARAMETER; 271 272 /* Check GUID is a data block */ 273 if (block->flags & (ACPI_WMI_EVENT | ACPI_WMI_METHOD)) 274 return AE_ERROR; 275 276 input.count = 1; 277 input.pointer = wq_params; 278 wq_params[0].type = ACPI_TYPE_INTEGER; 279 wq_params[0].integer.value = instance; 280 281 if (instance == 0 && wblock->read_takes_no_args) 282 input.count = 0; 283 284 /* 285 * If ACPI_WMI_EXPENSIVE, call the relevant WCxx method first to 286 * enable collection. 287 */ 288 if (block->flags & ACPI_WMI_EXPENSIVE) { 289 strncat(wc_method, block->object_id, 2); 290 291 /* 292 * Some GUIDs break the specification by declaring themselves 293 * expensive, but have no corresponding WCxx method. So we 294 * should not fail if this happens. 295 */ 296 if (acpi_has_method(handle, wc_method)) 297 wc_status = acpi_execute_simple_method(handle, 298 wc_method, 1); 299 } 300 301 strcpy(method, "WQ"); 302 strncat(method, block->object_id, 2); 303 304 status = acpi_evaluate_object(handle, method, &input, out); 305 306 /* 307 * If ACPI_WMI_EXPENSIVE, call the relevant WCxx method, even if 308 * the WQxx method failed - we should disable collection anyway. 309 */ 310 if ((block->flags & ACPI_WMI_EXPENSIVE) && ACPI_SUCCESS(wc_status)) { 311 status = acpi_execute_simple_method(handle, wc_method, 0); 312 } 313 314 return status; 315 } 316 317 /** 318 * wmi_query_block - Return contents of a WMI block (deprecated) 319 * @guid_string: 36 char string of the form fa50ff2b-f2e8-45de-83fa-65417f2f49ba 320 * @instance: Instance index 321 * &out: Empty buffer to return the contents of the data block to 322 * 323 * Return the contents of an ACPI-WMI data block to a buffer 324 */ 325 acpi_status wmi_query_block(const char *guid_string, u8 instance, 326 struct acpi_buffer *out) 327 { 328 struct wmi_block *wblock; 329 330 if (!guid_string) 331 return AE_BAD_PARAMETER; 332 333 if (!find_guid(guid_string, &wblock)) 334 return AE_ERROR; 335 336 return __query_block(wblock, instance, out); 337 } 338 EXPORT_SYMBOL_GPL(wmi_query_block); 339 340 union acpi_object *wmidev_block_query(struct wmi_device *wdev, u8 instance) 341 { 342 struct acpi_buffer out = { ACPI_ALLOCATE_BUFFER, NULL }; 343 struct wmi_block *wblock = container_of(wdev, struct wmi_block, dev); 344 345 if (ACPI_FAILURE(__query_block(wblock, instance, &out))) 346 return NULL; 347 348 return (union acpi_object *)out.pointer; 349 } 350 EXPORT_SYMBOL_GPL(wmidev_block_query); 351 352 struct wmi_device *wmidev_get_other_guid(struct wmi_device *wdev, 353 const char *guid_string) 354 { 355 struct wmi_block *this_wb = container_of(wdev, struct wmi_block, dev); 356 struct wmi_block *other_wb; 357 358 if (!find_guid(guid_string, &other_wb)) 359 return NULL; 360 361 if (other_wb->acpi_device != this_wb->acpi_device) 362 return NULL; 363 364 get_device(&other_wb->dev.dev); 365 return &other_wb->dev; 366 } 367 EXPORT_SYMBOL_GPL(wmidev_get_other_guid); 368 369 /** 370 * wmi_set_block - Write to a WMI block 371 * @guid_string: 36 char string of the form fa50ff2b-f2e8-45de-83fa-65417f2f49ba 372 * @instance: Instance index 373 * &in: Buffer containing new values for the data block 374 * 375 * Write the contents of the input buffer to an ACPI-WMI data block 376 */ 377 acpi_status wmi_set_block(const char *guid_string, u8 instance, 378 const struct acpi_buffer *in) 379 { 380 struct guid_block *block = NULL; 381 struct wmi_block *wblock = NULL; 382 acpi_handle handle; 383 struct acpi_object_list input; 384 union acpi_object params[2]; 385 char method[5] = "WS"; 386 387 if (!guid_string || !in) 388 return AE_BAD_DATA; 389 390 if (!find_guid(guid_string, &wblock)) 391 return AE_ERROR; 392 393 block = &wblock->gblock; 394 handle = wblock->acpi_device->handle; 395 396 if (block->instance_count < instance) 397 return AE_BAD_PARAMETER; 398 399 /* Check GUID is a data block */ 400 if (block->flags & (ACPI_WMI_EVENT | ACPI_WMI_METHOD)) 401 return AE_ERROR; 402 403 input.count = 2; 404 input.pointer = params; 405 params[0].type = ACPI_TYPE_INTEGER; 406 params[0].integer.value = instance; 407 408 if (block->flags & ACPI_WMI_STRING) { 409 params[1].type = ACPI_TYPE_STRING; 410 } else { 411 params[1].type = ACPI_TYPE_BUFFER; 412 } 413 params[1].buffer.length = in->length; 414 params[1].buffer.pointer = in->pointer; 415 416 strncat(method, block->object_id, 2); 417 418 return acpi_evaluate_object(handle, method, &input, NULL); 419 } 420 EXPORT_SYMBOL_GPL(wmi_set_block); 421 422 static void wmi_dump_wdg(const struct guid_block *g) 423 { 424 pr_info("%pUL:\n", g->guid); 425 if (g->flags & ACPI_WMI_EVENT) 426 pr_info("\tnotify_id: 0x%02X\n", g->notify_id); 427 else 428 pr_info("\tobject_id: %2pE\n", g->object_id); 429 pr_info("\tinstance_count: %d\n", g->instance_count); 430 pr_info("\tflags: %#x", g->flags); 431 if (g->flags) { 432 if (g->flags & ACPI_WMI_EXPENSIVE) 433 pr_cont(" ACPI_WMI_EXPENSIVE"); 434 if (g->flags & ACPI_WMI_METHOD) 435 pr_cont(" ACPI_WMI_METHOD"); 436 if (g->flags & ACPI_WMI_STRING) 437 pr_cont(" ACPI_WMI_STRING"); 438 if (g->flags & ACPI_WMI_EVENT) 439 pr_cont(" ACPI_WMI_EVENT"); 440 } 441 pr_cont("\n"); 442 443 } 444 445 static void wmi_notify_debug(u32 value, void *context) 446 { 447 struct acpi_buffer response = { ACPI_ALLOCATE_BUFFER, NULL }; 448 union acpi_object *obj; 449 acpi_status status; 450 451 status = wmi_get_event_data(value, &response); 452 if (status != AE_OK) { 453 pr_info("bad event status 0x%x\n", status); 454 return; 455 } 456 457 obj = (union acpi_object *)response.pointer; 458 459 if (!obj) 460 return; 461 462 pr_info("DEBUG Event "); 463 switch(obj->type) { 464 case ACPI_TYPE_BUFFER: 465 pr_cont("BUFFER_TYPE - length %d\n", obj->buffer.length); 466 break; 467 case ACPI_TYPE_STRING: 468 pr_cont("STRING_TYPE - %s\n", obj->string.pointer); 469 break; 470 case ACPI_TYPE_INTEGER: 471 pr_cont("INTEGER_TYPE - %llu\n", obj->integer.value); 472 break; 473 case ACPI_TYPE_PACKAGE: 474 pr_cont("PACKAGE_TYPE - %d elements\n", obj->package.count); 475 break; 476 default: 477 pr_cont("object type 0x%X\n", obj->type); 478 } 479 kfree(obj); 480 } 481 482 /** 483 * wmi_install_notify_handler - Register handler for WMI events 484 * @handler: Function to handle notifications 485 * @data: Data to be returned to handler when event is fired 486 * 487 * Register a handler for events sent to the ACPI-WMI mapper device. 488 */ 489 acpi_status wmi_install_notify_handler(const char *guid, 490 wmi_notify_handler handler, void *data) 491 { 492 struct wmi_block *block; 493 acpi_status status = AE_NOT_EXIST; 494 uuid_le guid_input; 495 struct list_head *p; 496 497 if (!guid || !handler) 498 return AE_BAD_PARAMETER; 499 500 if (uuid_le_to_bin(guid, &guid_input)) 501 return AE_BAD_PARAMETER; 502 503 list_for_each(p, &wmi_block_list) { 504 acpi_status wmi_status; 505 block = list_entry(p, struct wmi_block, list); 506 507 if (memcmp(block->gblock.guid, &guid_input, 16) == 0) { 508 if (block->handler && 509 block->handler != wmi_notify_debug) 510 return AE_ALREADY_ACQUIRED; 511 512 block->handler = handler; 513 block->handler_data = data; 514 515 wmi_status = wmi_method_enable(block, 1); 516 if ((wmi_status != AE_OK) || 517 ((wmi_status == AE_OK) && (status == AE_NOT_EXIST))) 518 status = wmi_status; 519 } 520 } 521 522 return status; 523 } 524 EXPORT_SYMBOL_GPL(wmi_install_notify_handler); 525 526 /** 527 * wmi_uninstall_notify_handler - Unregister handler for WMI events 528 * 529 * Unregister handler for events sent to the ACPI-WMI mapper device. 530 */ 531 acpi_status wmi_remove_notify_handler(const char *guid) 532 { 533 struct wmi_block *block; 534 acpi_status status = AE_NOT_EXIST; 535 uuid_le guid_input; 536 struct list_head *p; 537 538 if (!guid) 539 return AE_BAD_PARAMETER; 540 541 if (uuid_le_to_bin(guid, &guid_input)) 542 return AE_BAD_PARAMETER; 543 544 list_for_each(p, &wmi_block_list) { 545 acpi_status wmi_status; 546 block = list_entry(p, struct wmi_block, list); 547 548 if (memcmp(block->gblock.guid, &guid_input, 16) == 0) { 549 if (!block->handler || 550 block->handler == wmi_notify_debug) 551 return AE_NULL_ENTRY; 552 553 if (debug_event) { 554 block->handler = wmi_notify_debug; 555 status = AE_OK; 556 } else { 557 wmi_status = wmi_method_enable(block, 0); 558 block->handler = NULL; 559 block->handler_data = NULL; 560 if ((wmi_status != AE_OK) || 561 ((wmi_status == AE_OK) && 562 (status == AE_NOT_EXIST))) 563 status = wmi_status; 564 } 565 } 566 } 567 568 return status; 569 } 570 EXPORT_SYMBOL_GPL(wmi_remove_notify_handler); 571 572 /** 573 * wmi_get_event_data - Get WMI data associated with an event 574 * 575 * @event: Event to find 576 * @out: Buffer to hold event data. out->pointer should be freed with kfree() 577 * 578 * Returns extra data associated with an event in WMI. 579 */ 580 acpi_status wmi_get_event_data(u32 event, struct acpi_buffer *out) 581 { 582 struct acpi_object_list input; 583 union acpi_object params[1]; 584 struct guid_block *gblock; 585 struct wmi_block *wblock; 586 struct list_head *p; 587 588 input.count = 1; 589 input.pointer = params; 590 params[0].type = ACPI_TYPE_INTEGER; 591 params[0].integer.value = event; 592 593 list_for_each(p, &wmi_block_list) { 594 wblock = list_entry(p, struct wmi_block, list); 595 gblock = &wblock->gblock; 596 597 if ((gblock->flags & ACPI_WMI_EVENT) && 598 (gblock->notify_id == event)) 599 return acpi_evaluate_object(wblock->acpi_device->handle, 600 "_WED", &input, out); 601 } 602 603 return AE_NOT_FOUND; 604 } 605 EXPORT_SYMBOL_GPL(wmi_get_event_data); 606 607 /** 608 * wmi_has_guid - Check if a GUID is available 609 * @guid_string: 36 char string of the form fa50ff2b-f2e8-45de-83fa-65417f2f49ba 610 * 611 * Check if a given GUID is defined by _WDG 612 */ 613 bool wmi_has_guid(const char *guid_string) 614 { 615 return find_guid(guid_string, NULL); 616 } 617 EXPORT_SYMBOL_GPL(wmi_has_guid); 618 619 static struct wmi_block *dev_to_wblock(struct device *dev) 620 { 621 return container_of(dev, struct wmi_block, dev.dev); 622 } 623 624 static struct wmi_device *dev_to_wdev(struct device *dev) 625 { 626 return container_of(dev, struct wmi_device, dev); 627 } 628 629 /* 630 * sysfs interface 631 */ 632 static ssize_t modalias_show(struct device *dev, struct device_attribute *attr, 633 char *buf) 634 { 635 struct wmi_block *wblock = dev_to_wblock(dev); 636 637 return sprintf(buf, "wmi:%pUL\n", wblock->gblock.guid); 638 } 639 static DEVICE_ATTR_RO(modalias); 640 641 static ssize_t guid_show(struct device *dev, struct device_attribute *attr, 642 char *buf) 643 { 644 struct wmi_block *wblock = dev_to_wblock(dev); 645 646 return sprintf(buf, "%pUL\n", wblock->gblock.guid); 647 } 648 static DEVICE_ATTR_RO(guid); 649 650 static ssize_t instance_count_show(struct device *dev, 651 struct device_attribute *attr, char *buf) 652 { 653 struct wmi_block *wblock = dev_to_wblock(dev); 654 655 return sprintf(buf, "%d\n", (int)wblock->gblock.instance_count); 656 } 657 static DEVICE_ATTR_RO(instance_count); 658 659 static ssize_t expensive_show(struct device *dev, 660 struct device_attribute *attr, char *buf) 661 { 662 struct wmi_block *wblock = dev_to_wblock(dev); 663 664 return sprintf(buf, "%d\n", 665 (wblock->gblock.flags & ACPI_WMI_EXPENSIVE) != 0); 666 } 667 static DEVICE_ATTR_RO(expensive); 668 669 static struct attribute *wmi_attrs[] = { 670 &dev_attr_modalias.attr, 671 &dev_attr_guid.attr, 672 &dev_attr_instance_count.attr, 673 &dev_attr_expensive.attr, 674 NULL, 675 }; 676 ATTRIBUTE_GROUPS(wmi); 677 678 static ssize_t notify_id_show(struct device *dev, struct device_attribute *attr, 679 char *buf) 680 { 681 struct wmi_block *wblock = dev_to_wblock(dev); 682 683 return sprintf(buf, "%02X\n", (unsigned int)wblock->gblock.notify_id); 684 } 685 static DEVICE_ATTR_RO(notify_id); 686 687 static struct attribute *wmi_event_attrs[] = { 688 &dev_attr_notify_id.attr, 689 NULL, 690 }; 691 ATTRIBUTE_GROUPS(wmi_event); 692 693 static ssize_t object_id_show(struct device *dev, struct device_attribute *attr, 694 char *buf) 695 { 696 struct wmi_block *wblock = dev_to_wblock(dev); 697 698 return sprintf(buf, "%c%c\n", wblock->gblock.object_id[0], 699 wblock->gblock.object_id[1]); 700 } 701 static DEVICE_ATTR_RO(object_id); 702 703 static ssize_t setable_show(struct device *dev, struct device_attribute *attr, 704 char *buf) 705 { 706 struct wmi_device *wdev = dev_to_wdev(dev); 707 708 return sprintf(buf, "%d\n", (int)wdev->setable); 709 } 710 static DEVICE_ATTR_RO(setable); 711 712 static struct attribute *wmi_data_attrs[] = { 713 &dev_attr_object_id.attr, 714 &dev_attr_setable.attr, 715 NULL, 716 }; 717 ATTRIBUTE_GROUPS(wmi_data); 718 719 static struct attribute *wmi_method_attrs[] = { 720 &dev_attr_object_id.attr, 721 NULL, 722 }; 723 ATTRIBUTE_GROUPS(wmi_method); 724 725 static int wmi_dev_uevent(struct device *dev, struct kobj_uevent_env *env) 726 { 727 struct wmi_block *wblock = dev_to_wblock(dev); 728 729 if (add_uevent_var(env, "MODALIAS=wmi:%pUL", wblock->gblock.guid)) 730 return -ENOMEM; 731 732 if (add_uevent_var(env, "WMI_GUID=%pUL", wblock->gblock.guid)) 733 return -ENOMEM; 734 735 return 0; 736 } 737 738 static void wmi_dev_release(struct device *dev) 739 { 740 struct wmi_block *wblock = dev_to_wblock(dev); 741 742 kfree(wblock); 743 } 744 745 static int wmi_dev_match(struct device *dev, struct device_driver *driver) 746 { 747 struct wmi_driver *wmi_driver = 748 container_of(driver, struct wmi_driver, driver); 749 struct wmi_block *wblock = dev_to_wblock(dev); 750 const struct wmi_device_id *id = wmi_driver->id_table; 751 752 while (id->guid_string) { 753 uuid_le driver_guid; 754 755 if (WARN_ON(uuid_le_to_bin(id->guid_string, &driver_guid))) 756 continue; 757 if (!memcmp(&driver_guid, wblock->gblock.guid, 16)) 758 return 1; 759 760 id++; 761 } 762 763 return 0; 764 } 765 766 static int wmi_dev_probe(struct device *dev) 767 { 768 struct wmi_block *wblock = dev_to_wblock(dev); 769 struct wmi_driver *wdriver = 770 container_of(dev->driver, struct wmi_driver, driver); 771 int ret = 0; 772 773 if (ACPI_FAILURE(wmi_method_enable(wblock, 1))) 774 dev_warn(dev, "failed to enable device -- probing anyway\n"); 775 776 if (wdriver->probe) { 777 ret = wdriver->probe(dev_to_wdev(dev)); 778 if (ret != 0 && ACPI_FAILURE(wmi_method_enable(wblock, 0))) 779 dev_warn(dev, "failed to disable device\n"); 780 } 781 782 return ret; 783 } 784 785 static int wmi_dev_remove(struct device *dev) 786 { 787 struct wmi_block *wblock = dev_to_wblock(dev); 788 struct wmi_driver *wdriver = 789 container_of(dev->driver, struct wmi_driver, driver); 790 int ret = 0; 791 792 if (wdriver->remove) 793 ret = wdriver->remove(dev_to_wdev(dev)); 794 795 if (ACPI_FAILURE(wmi_method_enable(wblock, 0))) 796 dev_warn(dev, "failed to disable device\n"); 797 798 return ret; 799 } 800 801 static struct class wmi_bus_class = { 802 .name = "wmi_bus", 803 }; 804 805 static struct bus_type wmi_bus_type = { 806 .name = "wmi", 807 .dev_groups = wmi_groups, 808 .match = wmi_dev_match, 809 .uevent = wmi_dev_uevent, 810 .probe = wmi_dev_probe, 811 .remove = wmi_dev_remove, 812 }; 813 814 static struct device_type wmi_type_event = { 815 .name = "event", 816 .groups = wmi_event_groups, 817 .release = wmi_dev_release, 818 }; 819 820 static struct device_type wmi_type_method = { 821 .name = "method", 822 .groups = wmi_method_groups, 823 .release = wmi_dev_release, 824 }; 825 826 static struct device_type wmi_type_data = { 827 .name = "data", 828 .groups = wmi_data_groups, 829 .release = wmi_dev_release, 830 }; 831 832 static int wmi_create_device(struct device *wmi_bus_dev, 833 const struct guid_block *gblock, 834 struct wmi_block *wblock, 835 struct acpi_device *device) 836 { 837 struct acpi_device_info *info; 838 char method[5]; 839 int result; 840 841 if (gblock->flags & ACPI_WMI_EVENT) { 842 wblock->dev.dev.type = &wmi_type_event; 843 goto out_init; 844 } 845 846 if (gblock->flags & ACPI_WMI_METHOD) { 847 wblock->dev.dev.type = &wmi_type_method; 848 goto out_init; 849 } 850 851 /* 852 * Data Block Query Control Method (WQxx by convention) is 853 * required per the WMI documentation. If it is not present, 854 * we ignore this data block. 855 */ 856 strcpy(method, "WQ"); 857 strncat(method, wblock->gblock.object_id, 2); 858 result = get_subobj_info(device->handle, method, &info); 859 860 if (result) { 861 dev_warn(wmi_bus_dev, 862 "%s data block query control method not found", 863 method); 864 return result; 865 } 866 867 wblock->dev.dev.type = &wmi_type_data; 868 869 /* 870 * The Microsoft documentation specifically states: 871 * 872 * Data blocks registered with only a single instance 873 * can ignore the parameter. 874 * 875 * ACPICA will get mad at us if we call the method with the wrong number 876 * of arguments, so check what our method expects. (On some Dell 877 * laptops, WQxx may not be a method at all.) 878 */ 879 if (info->type != ACPI_TYPE_METHOD || info->param_count == 0) 880 wblock->read_takes_no_args = true; 881 882 kfree(info); 883 884 strcpy(method, "WS"); 885 strncat(method, wblock->gblock.object_id, 2); 886 result = get_subobj_info(device->handle, method, NULL); 887 888 if (result == 0) 889 wblock->dev.setable = true; 890 891 out_init: 892 wblock->dev.dev.bus = &wmi_bus_type; 893 wblock->dev.dev.parent = wmi_bus_dev; 894 895 dev_set_name(&wblock->dev.dev, "%pUL", gblock->guid); 896 897 device_initialize(&wblock->dev.dev); 898 899 return 0; 900 } 901 902 static void wmi_free_devices(struct acpi_device *device) 903 { 904 struct wmi_block *wblock, *next; 905 906 /* Delete devices for all the GUIDs */ 907 list_for_each_entry_safe(wblock, next, &wmi_block_list, list) { 908 if (wblock->acpi_device == device) { 909 list_del(&wblock->list); 910 device_unregister(&wblock->dev.dev); 911 } 912 } 913 } 914 915 static bool guid_already_parsed(struct acpi_device *device, 916 const u8 *guid) 917 { 918 struct wmi_block *wblock; 919 920 list_for_each_entry(wblock, &wmi_block_list, list) { 921 if (memcmp(wblock->gblock.guid, guid, 16) == 0) { 922 /* 923 * Because we historically didn't track the relationship 924 * between GUIDs and ACPI nodes, we don't know whether 925 * we need to suppress GUIDs that are unique on a 926 * given node but duplicated across nodes. 927 */ 928 dev_warn(&device->dev, "duplicate WMI GUID %pUL (first instance was on %s)\n", 929 guid, dev_name(&wblock->acpi_device->dev)); 930 return true; 931 } 932 } 933 934 return false; 935 } 936 937 /* 938 * Parse the _WDG method for the GUID data blocks 939 */ 940 static int parse_wdg(struct device *wmi_bus_dev, struct acpi_device *device) 941 { 942 struct acpi_buffer out = {ACPI_ALLOCATE_BUFFER, NULL}; 943 const struct guid_block *gblock; 944 struct wmi_block *wblock, *next; 945 union acpi_object *obj; 946 acpi_status status; 947 int retval = 0; 948 u32 i, total; 949 950 status = acpi_evaluate_object(device->handle, "_WDG", NULL, &out); 951 if (ACPI_FAILURE(status)) 952 return -ENXIO; 953 954 obj = (union acpi_object *) out.pointer; 955 if (!obj) 956 return -ENXIO; 957 958 if (obj->type != ACPI_TYPE_BUFFER) { 959 retval = -ENXIO; 960 goto out_free_pointer; 961 } 962 963 gblock = (const struct guid_block *)obj->buffer.pointer; 964 total = obj->buffer.length / sizeof(struct guid_block); 965 966 for (i = 0; i < total; i++) { 967 if (debug_dump_wdg) 968 wmi_dump_wdg(&gblock[i]); 969 970 /* 971 * Some WMI devices, like those for nVidia hooks, have a 972 * duplicate GUID. It's not clear what we should do in this 973 * case yet, so for now, we'll just ignore the duplicate 974 * for device creation. 975 */ 976 if (guid_already_parsed(device, gblock[i].guid)) 977 continue; 978 979 wblock = kzalloc(sizeof(struct wmi_block), GFP_KERNEL); 980 if (!wblock) { 981 retval = -ENOMEM; 982 break; 983 } 984 985 wblock->acpi_device = device; 986 wblock->gblock = gblock[i]; 987 988 retval = wmi_create_device(wmi_bus_dev, &gblock[i], wblock, device); 989 if (retval) { 990 kfree(wblock); 991 continue; 992 } 993 994 list_add_tail(&wblock->list, &wmi_block_list); 995 996 if (debug_event) { 997 wblock->handler = wmi_notify_debug; 998 wmi_method_enable(wblock, 1); 999 } 1000 } 1001 1002 /* 1003 * Now that all of the devices are created, add them to the 1004 * device tree and probe subdrivers. 1005 */ 1006 list_for_each_entry_safe(wblock, next, &wmi_block_list, list) { 1007 if (wblock->acpi_device != device) 1008 continue; 1009 1010 retval = device_add(&wblock->dev.dev); 1011 if (retval) { 1012 dev_err(wmi_bus_dev, "failed to register %pULL\n", 1013 wblock->gblock.guid); 1014 if (debug_event) 1015 wmi_method_enable(wblock, 0); 1016 list_del(&wblock->list); 1017 put_device(&wblock->dev.dev); 1018 } 1019 } 1020 1021 out_free_pointer: 1022 kfree(out.pointer); 1023 return retval; 1024 } 1025 1026 /* 1027 * WMI can have EmbeddedControl access regions. In which case, we just want to 1028 * hand these off to the EC driver. 1029 */ 1030 static acpi_status 1031 acpi_wmi_ec_space_handler(u32 function, acpi_physical_address address, 1032 u32 bits, u64 *value, 1033 void *handler_context, void *region_context) 1034 { 1035 int result = 0, i = 0; 1036 u8 temp = 0; 1037 1038 if ((address > 0xFF) || !value) 1039 return AE_BAD_PARAMETER; 1040 1041 if (function != ACPI_READ && function != ACPI_WRITE) 1042 return AE_BAD_PARAMETER; 1043 1044 if (bits != 8) 1045 return AE_BAD_PARAMETER; 1046 1047 if (function == ACPI_READ) { 1048 result = ec_read(address, &temp); 1049 (*value) |= ((u64)temp) << i; 1050 } else { 1051 temp = 0xff & ((*value) >> i); 1052 result = ec_write(address, temp); 1053 } 1054 1055 switch (result) { 1056 case -EINVAL: 1057 return AE_BAD_PARAMETER; 1058 break; 1059 case -ENODEV: 1060 return AE_NOT_FOUND; 1061 break; 1062 case -ETIME: 1063 return AE_TIME; 1064 break; 1065 default: 1066 return AE_OK; 1067 } 1068 } 1069 1070 static void acpi_wmi_notify_handler(acpi_handle handle, u32 event, 1071 void *context) 1072 { 1073 struct guid_block *block; 1074 struct wmi_block *wblock; 1075 struct list_head *p; 1076 bool found_it = false; 1077 1078 list_for_each(p, &wmi_block_list) { 1079 wblock = list_entry(p, struct wmi_block, list); 1080 block = &wblock->gblock; 1081 1082 if (wblock->acpi_device->handle == handle && 1083 (block->flags & ACPI_WMI_EVENT) && 1084 (block->notify_id == event)) 1085 { 1086 found_it = true; 1087 break; 1088 } 1089 } 1090 1091 if (!found_it) 1092 return; 1093 1094 /* If a driver is bound, then notify the driver. */ 1095 if (wblock->dev.dev.driver) { 1096 struct wmi_driver *driver; 1097 struct acpi_object_list input; 1098 union acpi_object params[1]; 1099 struct acpi_buffer evdata = { ACPI_ALLOCATE_BUFFER, NULL }; 1100 acpi_status status; 1101 1102 driver = container_of(wblock->dev.dev.driver, 1103 struct wmi_driver, driver); 1104 1105 input.count = 1; 1106 input.pointer = params; 1107 params[0].type = ACPI_TYPE_INTEGER; 1108 params[0].integer.value = event; 1109 1110 status = acpi_evaluate_object(wblock->acpi_device->handle, 1111 "_WED", &input, &evdata); 1112 if (ACPI_FAILURE(status)) { 1113 dev_warn(&wblock->dev.dev, 1114 "failed to get event data\n"); 1115 return; 1116 } 1117 1118 if (driver->notify) 1119 driver->notify(&wblock->dev, 1120 (union acpi_object *)evdata.pointer); 1121 1122 kfree(evdata.pointer); 1123 } else if (wblock->handler) { 1124 /* Legacy handler */ 1125 wblock->handler(event, wblock->handler_data); 1126 } 1127 1128 if (debug_event) { 1129 pr_info("DEBUG Event GUID: %pUL\n", 1130 wblock->gblock.guid); 1131 } 1132 1133 acpi_bus_generate_netlink_event( 1134 wblock->acpi_device->pnp.device_class, 1135 dev_name(&wblock->dev.dev), 1136 event, 0); 1137 1138 } 1139 1140 static int acpi_wmi_remove(struct platform_device *device) 1141 { 1142 struct acpi_device *acpi_device = ACPI_COMPANION(&device->dev); 1143 1144 acpi_remove_notify_handler(acpi_device->handle, ACPI_DEVICE_NOTIFY, 1145 acpi_wmi_notify_handler); 1146 acpi_remove_address_space_handler(acpi_device->handle, 1147 ACPI_ADR_SPACE_EC, &acpi_wmi_ec_space_handler); 1148 wmi_free_devices(acpi_device); 1149 device_unregister((struct device *)dev_get_drvdata(&device->dev)); 1150 1151 return 0; 1152 } 1153 1154 static int acpi_wmi_probe(struct platform_device *device) 1155 { 1156 struct acpi_device *acpi_device; 1157 struct device *wmi_bus_dev; 1158 acpi_status status; 1159 int error; 1160 1161 acpi_device = ACPI_COMPANION(&device->dev); 1162 if (!acpi_device) { 1163 dev_err(&device->dev, "ACPI companion is missing\n"); 1164 return -ENODEV; 1165 } 1166 1167 status = acpi_install_address_space_handler(acpi_device->handle, 1168 ACPI_ADR_SPACE_EC, 1169 &acpi_wmi_ec_space_handler, 1170 NULL, NULL); 1171 if (ACPI_FAILURE(status)) { 1172 dev_err(&device->dev, "Error installing EC region handler\n"); 1173 return -ENODEV; 1174 } 1175 1176 status = acpi_install_notify_handler(acpi_device->handle, 1177 ACPI_DEVICE_NOTIFY, 1178 acpi_wmi_notify_handler, 1179 NULL); 1180 if (ACPI_FAILURE(status)) { 1181 dev_err(&device->dev, "Error installing notify handler\n"); 1182 error = -ENODEV; 1183 goto err_remove_ec_handler; 1184 } 1185 1186 wmi_bus_dev = device_create(&wmi_bus_class, &device->dev, MKDEV(0, 0), 1187 NULL, "wmi_bus-%s", dev_name(&device->dev)); 1188 if (IS_ERR(wmi_bus_dev)) { 1189 error = PTR_ERR(wmi_bus_dev); 1190 goto err_remove_notify_handler; 1191 } 1192 dev_set_drvdata(&device->dev, wmi_bus_dev); 1193 1194 error = parse_wdg(wmi_bus_dev, acpi_device); 1195 if (error) { 1196 pr_err("Failed to parse WDG method\n"); 1197 goto err_remove_busdev; 1198 } 1199 1200 return 0; 1201 1202 err_remove_busdev: 1203 device_unregister(wmi_bus_dev); 1204 1205 err_remove_notify_handler: 1206 acpi_remove_notify_handler(acpi_device->handle, ACPI_DEVICE_NOTIFY, 1207 acpi_wmi_notify_handler); 1208 1209 err_remove_ec_handler: 1210 acpi_remove_address_space_handler(acpi_device->handle, 1211 ACPI_ADR_SPACE_EC, 1212 &acpi_wmi_ec_space_handler); 1213 1214 return error; 1215 } 1216 1217 int __must_check __wmi_driver_register(struct wmi_driver *driver, 1218 struct module *owner) 1219 { 1220 driver->driver.owner = owner; 1221 driver->driver.bus = &wmi_bus_type; 1222 1223 return driver_register(&driver->driver); 1224 } 1225 EXPORT_SYMBOL(__wmi_driver_register); 1226 1227 void wmi_driver_unregister(struct wmi_driver *driver) 1228 { 1229 driver_unregister(&driver->driver); 1230 } 1231 EXPORT_SYMBOL(wmi_driver_unregister); 1232 1233 static int __init acpi_wmi_init(void) 1234 { 1235 int error; 1236 1237 if (acpi_disabled) 1238 return -ENODEV; 1239 1240 error = class_register(&wmi_bus_class); 1241 if (error) 1242 return error; 1243 1244 error = bus_register(&wmi_bus_type); 1245 if (error) 1246 goto err_unreg_class; 1247 1248 error = platform_driver_register(&acpi_wmi_driver); 1249 if (error) { 1250 pr_err("Error loading mapper\n"); 1251 goto err_unreg_bus; 1252 } 1253 1254 return 0; 1255 1256 err_unreg_class: 1257 class_unregister(&wmi_bus_class); 1258 1259 err_unreg_bus: 1260 bus_unregister(&wmi_bus_type); 1261 1262 return error; 1263 } 1264 1265 static void __exit acpi_wmi_exit(void) 1266 { 1267 platform_driver_unregister(&acpi_wmi_driver); 1268 class_unregister(&wmi_bus_class); 1269 bus_unregister(&wmi_bus_type); 1270 } 1271 1272 subsys_initcall(acpi_wmi_init); 1273 module_exit(acpi_wmi_exit); 1274 1275 1276 1277 1278 1279 /* LDV_COMMENT_BEGIN_MAIN */ 1280 #ifdef LDV_MAIN0_sequence_infinite_withcheck_stateful 1281 1282 /*###########################################################################*/ 1283 1284 /*############## Driver Environment Generator 0.2 output ####################*/ 1285 1286 /*###########################################################################*/ 1287 1288 1289 1290 /* LDV_COMMENT_FUNCTION_DECLARE_LDV Special function for LDV verifier. Test if all kernel resources are correctly released by driver before driver will be unloaded. */ 1291 void ldv_check_final_state(void); 1292 1293 /* LDV_COMMENT_FUNCTION_DECLARE_LDV Special function for LDV verifier. Test correct return result. */ 1294 void ldv_check_return_value(int res); 1295 1296 /* LDV_COMMENT_FUNCTION_DECLARE_LDV Special function for LDV verifier. Test correct return result of probe() function. */ 1297 void ldv_check_return_value_probe(int res); 1298 1299 /* LDV_COMMENT_FUNCTION_DECLARE_LDV Special function for LDV verifier. Initializes the model. */ 1300 void ldv_initialize(void); 1301 1302 /* LDV_COMMENT_FUNCTION_DECLARE_LDV Special function for LDV verifier. Reinitializes the model between distinct model function calls. */ 1303 void ldv_handler_precall(void); 1304 1305 /* LDV_COMMENT_FUNCTION_DECLARE_LDV Special function for LDV verifier. Returns arbitrary interger value. */ 1306 int nondet_int(void); 1307 1308 /* LDV_COMMENT_VAR_DECLARE_LDV Special variable for LDV verifier. */ 1309 int LDV_IN_INTERRUPT; 1310 1311 /* LDV_COMMENT_FUNCTION_MAIN Main function for LDV verifier. */ 1312 void ldv_main0_sequence_infinite_withcheck_stateful(void) { 1313 1314 1315 1316 /* LDV_COMMENT_BEGIN_VARIABLE_DECLARATION_PART */ 1317 /*============================= VARIABLE DECLARATION PART =============================*/ 1318 /** STRUCT: struct type: platform_driver, struct name: acpi_wmi_driver **/ 1319 /* content: static int acpi_wmi_probe(struct platform_device *device)*/ 1320 /* LDV_COMMENT_BEGIN_PREP */ 1321 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 1322 #define ACPI_WMI_EXPENSIVE 0x1 1323 #define ACPI_WMI_METHOD 0x2 1324 #define ACPI_WMI_STRING 0x4 1325 #define ACPI_WMI_EVENT 0x8 1326 /* LDV_COMMENT_END_PREP */ 1327 /* LDV_COMMENT_VAR_DECLARE Variable declaration for function "acpi_wmi_probe" */ 1328 struct platform_device * var_group1; 1329 /* LDV_COMMENT_VAR_DECLARE Variable declaration for test return result from function call "acpi_wmi_probe" */ 1330 static int res_acpi_wmi_probe_36; 1331 /* content: static int acpi_wmi_remove(struct platform_device *device)*/ 1332 /* LDV_COMMENT_BEGIN_PREP */ 1333 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 1334 #define ACPI_WMI_EXPENSIVE 0x1 1335 #define ACPI_WMI_METHOD 0x2 1336 #define ACPI_WMI_STRING 0x4 1337 #define ACPI_WMI_EVENT 0x8 1338 /* LDV_COMMENT_END_PREP */ 1339 1340 /** STRUCT: struct type: bus_type, struct name: wmi_bus_type **/ 1341 /* content: static int wmi_dev_match(struct device *dev, struct device_driver *driver)*/ 1342 /* LDV_COMMENT_BEGIN_PREP */ 1343 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 1344 #define ACPI_WMI_EXPENSIVE 0x1 1345 #define ACPI_WMI_METHOD 0x2 1346 #define ACPI_WMI_STRING 0x4 1347 #define ACPI_WMI_EVENT 0x8 1348 /* LDV_COMMENT_END_PREP */ 1349 /* LDV_COMMENT_VAR_DECLARE Variable declaration for function "wmi_dev_match" */ 1350 struct device * var_group2; 1351 /* LDV_COMMENT_VAR_DECLARE Variable declaration for function "wmi_dev_match" */ 1352 struct device_driver * var_group3; 1353 /* content: static int wmi_dev_uevent(struct device *dev, struct kobj_uevent_env *env)*/ 1354 /* LDV_COMMENT_BEGIN_PREP */ 1355 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 1356 #define ACPI_WMI_EXPENSIVE 0x1 1357 #define ACPI_WMI_METHOD 0x2 1358 #define ACPI_WMI_STRING 0x4 1359 #define ACPI_WMI_EVENT 0x8 1360 /* LDV_COMMENT_END_PREP */ 1361 /* LDV_COMMENT_VAR_DECLARE Variable declaration for function "wmi_dev_uevent" */ 1362 struct kobj_uevent_env * var_group4; 1363 /* content: static int wmi_dev_probe(struct device *dev)*/ 1364 /* LDV_COMMENT_BEGIN_PREP */ 1365 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 1366 #define ACPI_WMI_EXPENSIVE 0x1 1367 #define ACPI_WMI_METHOD 0x2 1368 #define ACPI_WMI_STRING 0x4 1369 #define ACPI_WMI_EVENT 0x8 1370 /* LDV_COMMENT_END_PREP */ 1371 /* LDV_COMMENT_VAR_DECLARE Variable declaration for test return result from function call "wmi_dev_probe" */ 1372 static int res_wmi_dev_probe_27; 1373 /* content: static int wmi_dev_remove(struct device *dev)*/ 1374 /* LDV_COMMENT_BEGIN_PREP */ 1375 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 1376 #define ACPI_WMI_EXPENSIVE 0x1 1377 #define ACPI_WMI_METHOD 0x2 1378 #define ACPI_WMI_STRING 0x4 1379 #define ACPI_WMI_EVENT 0x8 1380 /* LDV_COMMENT_END_PREP */ 1381 1382 /** STRUCT: struct type: device_type, struct name: wmi_type_event **/ 1383 /* content: static void wmi_dev_release(struct device *dev)*/ 1384 /* LDV_COMMENT_BEGIN_PREP */ 1385 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 1386 #define ACPI_WMI_EXPENSIVE 0x1 1387 #define ACPI_WMI_METHOD 0x2 1388 #define ACPI_WMI_STRING 0x4 1389 #define ACPI_WMI_EVENT 0x8 1390 /* LDV_COMMENT_END_PREP */ 1391 1392 /** STRUCT: struct type: device_type, struct name: wmi_type_method **/ 1393 /* content: static void wmi_dev_release(struct device *dev)*/ 1394 /* LDV_COMMENT_BEGIN_PREP */ 1395 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 1396 #define ACPI_WMI_EXPENSIVE 0x1 1397 #define ACPI_WMI_METHOD 0x2 1398 #define ACPI_WMI_STRING 0x4 1399 #define ACPI_WMI_EVENT 0x8 1400 /* LDV_COMMENT_END_PREP */ 1401 1402 /** STRUCT: struct type: device_type, struct name: wmi_type_data **/ 1403 /* content: static void wmi_dev_release(struct device *dev)*/ 1404 /* LDV_COMMENT_BEGIN_PREP */ 1405 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 1406 #define ACPI_WMI_EXPENSIVE 0x1 1407 #define ACPI_WMI_METHOD 0x2 1408 #define ACPI_WMI_STRING 0x4 1409 #define ACPI_WMI_EVENT 0x8 1410 /* LDV_COMMENT_END_PREP */ 1411 1412 1413 1414 1415 /* LDV_COMMENT_END_VARIABLE_DECLARATION_PART */ 1416 /* LDV_COMMENT_BEGIN_VARIABLE_INITIALIZING_PART */ 1417 /*============================= VARIABLE INITIALIZING PART =============================*/ 1418 LDV_IN_INTERRUPT=1; 1419 1420 1421 1422 1423 /* LDV_COMMENT_END_VARIABLE_INITIALIZING_PART */ 1424 /* LDV_COMMENT_BEGIN_FUNCTION_CALL_SECTION */ 1425 /*============================= FUNCTION CALL SECTION =============================*/ 1426 /* LDV_COMMENT_FUNCTION_CALL Initialize LDV model. */ 1427 ldv_initialize(); 1428 1429 /** INIT: init_type: ST_MODULE_INIT **/ 1430 /* content: static int __init acpi_wmi_init(void)*/ 1431 /* LDV_COMMENT_BEGIN_PREP */ 1432 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 1433 #define ACPI_WMI_EXPENSIVE 0x1 1434 #define ACPI_WMI_METHOD 0x2 1435 #define ACPI_WMI_STRING 0x4 1436 #define ACPI_WMI_EVENT 0x8 1437 /* LDV_COMMENT_END_PREP */ 1438 /* LDV_COMMENT_FUNCTION_CALL Kernel calls driver init function after driver loading to kernel. This function declared as "MODULE_INIT(function name)". */ 1439 ldv_handler_precall(); 1440 if(acpi_wmi_init()) 1441 goto ldv_final; 1442 int ldv_s_acpi_wmi_driver_platform_driver = 0; 1443 1444 int ldv_s_wmi_bus_type_bus_type = 0; 1445 1446 1447 int ldv_s_wmi_type_event_device_type = 0; 1448 1449 int ldv_s_wmi_type_method_device_type = 0; 1450 1451 int ldv_s_wmi_type_data_device_type = 0; 1452 1453 1454 while( nondet_int() 1455 || !(ldv_s_acpi_wmi_driver_platform_driver == 0) 1456 || !(ldv_s_wmi_bus_type_bus_type == 0) 1457 || !(ldv_s_wmi_type_event_device_type == 0) 1458 || !(ldv_s_wmi_type_method_device_type == 0) 1459 || !(ldv_s_wmi_type_data_device_type == 0) 1460 ) { 1461 1462 switch(nondet_int()) { 1463 1464 case 0: { 1465 1466 /** STRUCT: struct type: platform_driver, struct name: acpi_wmi_driver **/ 1467 if(ldv_s_acpi_wmi_driver_platform_driver==0) { 1468 1469 /* content: static int acpi_wmi_probe(struct platform_device *device)*/ 1470 /* LDV_COMMENT_BEGIN_PREP */ 1471 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 1472 #define ACPI_WMI_EXPENSIVE 0x1 1473 #define ACPI_WMI_METHOD 0x2 1474 #define ACPI_WMI_STRING 0x4 1475 #define ACPI_WMI_EVENT 0x8 1476 /* LDV_COMMENT_END_PREP */ 1477 /* LDV_COMMENT_FUNCTION_CALL Function from field "probe" from driver structure with callbacks "acpi_wmi_driver". Standart function test for correct return result. */ 1478 res_acpi_wmi_probe_36 = acpi_wmi_probe( var_group1); 1479 ldv_check_return_value(res_acpi_wmi_probe_36); 1480 ldv_check_return_value_probe(res_acpi_wmi_probe_36); 1481 if(res_acpi_wmi_probe_36) 1482 goto ldv_module_exit; 1483 ldv_s_acpi_wmi_driver_platform_driver++; 1484 1485 } 1486 1487 } 1488 1489 break; 1490 case 1: { 1491 1492 /** STRUCT: struct type: platform_driver, struct name: acpi_wmi_driver **/ 1493 if(ldv_s_acpi_wmi_driver_platform_driver==1) { 1494 1495 /* content: static int acpi_wmi_remove(struct platform_device *device)*/ 1496 /* LDV_COMMENT_BEGIN_PREP */ 1497 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 1498 #define ACPI_WMI_EXPENSIVE 0x1 1499 #define ACPI_WMI_METHOD 0x2 1500 #define ACPI_WMI_STRING 0x4 1501 #define ACPI_WMI_EVENT 0x8 1502 /* LDV_COMMENT_END_PREP */ 1503 /* LDV_COMMENT_FUNCTION_CALL Function from field "remove" from driver structure with callbacks "acpi_wmi_driver" */ 1504 ldv_handler_precall(); 1505 acpi_wmi_remove( var_group1); 1506 ldv_s_acpi_wmi_driver_platform_driver=0; 1507 1508 } 1509 1510 } 1511 1512 break; 1513 case 2: { 1514 1515 /** STRUCT: struct type: bus_type, struct name: wmi_bus_type **/ 1516 if(ldv_s_wmi_bus_type_bus_type==0) { 1517 1518 /* content: static int wmi_dev_probe(struct device *dev)*/ 1519 /* LDV_COMMENT_BEGIN_PREP */ 1520 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 1521 #define ACPI_WMI_EXPENSIVE 0x1 1522 #define ACPI_WMI_METHOD 0x2 1523 #define ACPI_WMI_STRING 0x4 1524 #define ACPI_WMI_EVENT 0x8 1525 /* LDV_COMMENT_END_PREP */ 1526 /* LDV_COMMENT_FUNCTION_CALL Function from field "probe" from driver structure with callbacks "wmi_bus_type". Standart function test for correct return result. */ 1527 res_wmi_dev_probe_27 = wmi_dev_probe( var_group2); 1528 ldv_check_return_value(res_wmi_dev_probe_27); 1529 ldv_check_return_value_probe(res_wmi_dev_probe_27); 1530 if(res_wmi_dev_probe_27) 1531 goto ldv_module_exit; 1532 ldv_s_wmi_bus_type_bus_type++; 1533 1534 } 1535 1536 } 1537 1538 break; 1539 case 3: { 1540 1541 /** STRUCT: struct type: bus_type, struct name: wmi_bus_type **/ 1542 if(ldv_s_wmi_bus_type_bus_type==1) { 1543 1544 /* content: static int wmi_dev_remove(struct device *dev)*/ 1545 /* LDV_COMMENT_BEGIN_PREP */ 1546 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 1547 #define ACPI_WMI_EXPENSIVE 0x1 1548 #define ACPI_WMI_METHOD 0x2 1549 #define ACPI_WMI_STRING 0x4 1550 #define ACPI_WMI_EVENT 0x8 1551 /* LDV_COMMENT_END_PREP */ 1552 /* LDV_COMMENT_FUNCTION_CALL Function from field "remove" from driver structure with callbacks "wmi_bus_type" */ 1553 ldv_handler_precall(); 1554 wmi_dev_remove( var_group2); 1555 ldv_s_wmi_bus_type_bus_type=0; 1556 1557 } 1558 1559 } 1560 1561 break; 1562 case 4: { 1563 1564 /** STRUCT: struct type: bus_type, struct name: wmi_bus_type **/ 1565 1566 1567 /* content: static int wmi_dev_match(struct device *dev, struct device_driver *driver)*/ 1568 /* LDV_COMMENT_BEGIN_PREP */ 1569 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 1570 #define ACPI_WMI_EXPENSIVE 0x1 1571 #define ACPI_WMI_METHOD 0x2 1572 #define ACPI_WMI_STRING 0x4 1573 #define ACPI_WMI_EVENT 0x8 1574 /* LDV_COMMENT_END_PREP */ 1575 /* LDV_COMMENT_FUNCTION_CALL Function from field "match" from driver structure with callbacks "wmi_bus_type" */ 1576 ldv_handler_precall(); 1577 wmi_dev_match( var_group2, var_group3); 1578 1579 1580 1581 1582 } 1583 1584 break; 1585 case 5: { 1586 1587 /** STRUCT: struct type: bus_type, struct name: wmi_bus_type **/ 1588 1589 1590 /* content: static int wmi_dev_uevent(struct device *dev, struct kobj_uevent_env *env)*/ 1591 /* LDV_COMMENT_BEGIN_PREP */ 1592 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 1593 #define ACPI_WMI_EXPENSIVE 0x1 1594 #define ACPI_WMI_METHOD 0x2 1595 #define ACPI_WMI_STRING 0x4 1596 #define ACPI_WMI_EVENT 0x8 1597 /* LDV_COMMENT_END_PREP */ 1598 /* LDV_COMMENT_FUNCTION_CALL Function from field "uevent" from driver structure with callbacks "wmi_bus_type" */ 1599 ldv_handler_precall(); 1600 wmi_dev_uevent( var_group2, var_group4); 1601 1602 1603 1604 1605 } 1606 1607 break; 1608 case 6: { 1609 1610 /** STRUCT: struct type: device_type, struct name: wmi_type_event **/ 1611 if(ldv_s_wmi_type_event_device_type==0) { 1612 1613 /* content: static void wmi_dev_release(struct device *dev)*/ 1614 /* LDV_COMMENT_BEGIN_PREP */ 1615 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 1616 #define ACPI_WMI_EXPENSIVE 0x1 1617 #define ACPI_WMI_METHOD 0x2 1618 #define ACPI_WMI_STRING 0x4 1619 #define ACPI_WMI_EVENT 0x8 1620 /* LDV_COMMENT_END_PREP */ 1621 /* LDV_COMMENT_FUNCTION_CALL Function from field "release" from driver structure with callbacks "wmi_type_event" */ 1622 ldv_handler_precall(); 1623 wmi_dev_release( var_group2); 1624 ldv_s_wmi_type_event_device_type=0; 1625 1626 } 1627 1628 } 1629 1630 break; 1631 case 7: { 1632 1633 /** STRUCT: struct type: device_type, struct name: wmi_type_method **/ 1634 if(ldv_s_wmi_type_method_device_type==0) { 1635 1636 /* content: static void wmi_dev_release(struct device *dev)*/ 1637 /* LDV_COMMENT_BEGIN_PREP */ 1638 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 1639 #define ACPI_WMI_EXPENSIVE 0x1 1640 #define ACPI_WMI_METHOD 0x2 1641 #define ACPI_WMI_STRING 0x4 1642 #define ACPI_WMI_EVENT 0x8 1643 /* LDV_COMMENT_END_PREP */ 1644 /* LDV_COMMENT_FUNCTION_CALL Function from field "release" from driver structure with callbacks "wmi_type_method" */ 1645 ldv_handler_precall(); 1646 wmi_dev_release( var_group2); 1647 ldv_s_wmi_type_method_device_type=0; 1648 1649 } 1650 1651 } 1652 1653 break; 1654 case 8: { 1655 1656 /** STRUCT: struct type: device_type, struct name: wmi_type_data **/ 1657 if(ldv_s_wmi_type_data_device_type==0) { 1658 1659 /* content: static void wmi_dev_release(struct device *dev)*/ 1660 /* LDV_COMMENT_BEGIN_PREP */ 1661 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 1662 #define ACPI_WMI_EXPENSIVE 0x1 1663 #define ACPI_WMI_METHOD 0x2 1664 #define ACPI_WMI_STRING 0x4 1665 #define ACPI_WMI_EVENT 0x8 1666 /* LDV_COMMENT_END_PREP */ 1667 /* LDV_COMMENT_FUNCTION_CALL Function from field "release" from driver structure with callbacks "wmi_type_data" */ 1668 ldv_handler_precall(); 1669 wmi_dev_release( var_group2); 1670 ldv_s_wmi_type_data_device_type=0; 1671 1672 } 1673 1674 } 1675 1676 break; 1677 default: break; 1678 1679 } 1680 1681 } 1682 1683 ldv_module_exit: 1684 1685 /** INIT: init_type: ST_MODULE_EXIT **/ 1686 /* content: static void __exit acpi_wmi_exit(void)*/ 1687 /* LDV_COMMENT_BEGIN_PREP */ 1688 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 1689 #define ACPI_WMI_EXPENSIVE 0x1 1690 #define ACPI_WMI_METHOD 0x2 1691 #define ACPI_WMI_STRING 0x4 1692 #define ACPI_WMI_EVENT 0x8 1693 /* LDV_COMMENT_END_PREP */ 1694 /* LDV_COMMENT_FUNCTION_CALL Kernel calls driver release function before driver will be uploaded from kernel. This function declared as "MODULE_EXIT(function name)". */ 1695 ldv_handler_precall(); 1696 acpi_wmi_exit(); 1697 1698 /* LDV_COMMENT_FUNCTION_CALL Checks that all resources and locks are correctly released before the driver will be unloaded. */ 1699 ldv_final: ldv_check_final_state(); 1700 1701 /* LDV_COMMENT_END_FUNCTION_CALL_SECTION */ 1702 return; 1703 1704 } 1705 #endif 1706 1707 /* LDV_COMMENT_END_MAIN */
1 2 3 #include <verifier/rcv.h> 4 #include <kernel-model/ERR.inc> 5 6 // There are 2 possible states of usb gadget class registration. 7 enum 8 { 9 LDV_USB_GADGET_CLASS_ZERO_STATE, // Usb gadget class is not registered. 10 LDV_USB_GADGET_CLASS_REGISTERED // Usb gadget class is registered. 11 }; 12 13 // There are 2 possible states of char device region registration. 14 enum 15 { 16 LDV_USB_GADGET_CHRDEV_ZERO_STATE, // Char device region is not registered for usb gadget. 17 LDV_USB_GADGET_CHRDEV_REGISTERED // Char device region is registered for usb gadget. 18 }; 19 20 // There are 2 possible states of usb gadget registration. 21 enum 22 { 23 LDV_USB_GADGET_ZERO_STATE, // Usb gadget is not registered. 24 LDV_USB_GADGET_REGISTERED // Usb gadget is registered. 25 }; 26 27 /* LDV_COMMENT_CHANGE_STATE Usb gadget class is not registered at the beginning. */ 28 int ldv_usb_gadget_class = LDV_USB_GADGET_CLASS_ZERO_STATE; 29 30 /* LDV_COMMENT_CHANGE_STATE Char device region is not registered at the beginning. */ 31 int ldv_usb_gadget_chrdev = LDV_USB_GADGET_CHRDEV_ZERO_STATE; 32 33 /* LDV_COMMENT_CHANGE_STATE Usb gadget is not registered at the beginning. */ 34 int ldv_usb_gadget = LDV_USB_GADGET_ZERO_STATE; 35 36 37 /* LDV_COMMENT_MODEL_FUNCTION_DEFINITION(name='ldv_create_class') Check that usb gadget class was not registered. Then create and register class for it. */ 38 void *ldv_create_class(void) 39 { 40 void *is_got; 41 42 /* LDV_COMMENT_OTHER Get blk request in the nondeterministic way. */ 43 is_got = ldv_undef_ptr(); 44 45 /* LDV_COMMENT_ASSERT Get blk request just in case when an error did not happen. */ 46 if (is_got <= LDV_PTR_MAX) 47 { 48 /* LDV_COMMENT_ASSERT Registring usb gadget class is only allowed if usb gadget is not registered. */ 49 ldv_assert(ldv_usb_gadget == LDV_USB_GADGET_ZERO_STATE); 50 /* LDV_COMMENT_ASSERT Check that usb gadget class is unregistered. */ 51 ldv_assert(ldv_usb_gadget_class == LDV_USB_GADGET_CLASS_ZERO_STATE); 52 /* LDV_COMMENT_CHANGE_STATE Register class for usb gadget. */ 53 ldv_usb_gadget_class = LDV_USB_GADGET_CLASS_REGISTERED; 54 } 55 56 /* LDV_COMMENT_RETURN Return obtained blk request. */ 57 return is_got; 58 } 59 60 /* LDV_COMMENT_MODEL_FUNCTION_DEFINITION(name='ldv_register_class') Check that usb gadget class was not registered and register class for it. */ 61 int ldv_register_class(void) 62 { 63 int is_reg; 64 65 /* LDV_COMMENT_OTHER Register gadget class in the nondeterministic way. */ 66 is_reg = ldv_undef_int_nonpositive(); 67 68 /* LDV_COMMENT_ASSERT Get blk request just in case when an error did not happen. */ 69 if (!is_reg) 70 { 71 /* LDV_COMMENT_ASSERT Registering usb gadget class is only allowed if usb gadget is not registered. */ 72 ldv_assert(ldv_usb_gadget == LDV_USB_GADGET_ZERO_STATE); 73 /* LDV_COMMENT_ASSERT Check that usb gadget class is unregistered. */ 74 ldv_assert(ldv_usb_gadget_class == LDV_USB_GADGET_CLASS_ZERO_STATE); 75 /* LDV_COMMENT_CHANGE_STATE Register class for usb gadget. */ 76 ldv_usb_gadget_class = LDV_USB_GADGET_CLASS_REGISTERED; 77 } 78 79 /* LDV_COMMENT_RETURN Return registration status (0 is success). */ 80 return is_reg; 81 } 82 83 /* LDV_COMMENT_MODEL_FUNCTION_DEFINITION(name='ldv_unregister_class') Check that usb gadget class was registered and unregister it. */ 84 void ldv_unregister_class(void) 85 { 86 /* LDV_COMMENT_ASSERT Unregistering usb gadget class is only allowed if usb gadget is not registered. */ 87 ldv_assert(ldv_usb_gadget == LDV_USB_GADGET_ZERO_STATE); 88 /* LDV_COMMENT_ASSERT Check that usb gadget class is registered. */ 89 ldv_assert(ldv_usb_gadget_class == LDV_USB_GADGET_CLASS_REGISTERED); 90 /* LDV_COMMENT_CHANGE_STATE Unregister class for usb gadget. */ 91 ldv_usb_gadget_class = LDV_USB_GADGET_CLASS_ZERO_STATE; 92 } 93 94 /* LDV_COMMENT_MODEL_FUNCTION_DEFINITION(name='ldv_register_chrdev') Check that chrdev region was not registered and register it. */ 95 int ldv_register_chrdev(int major) 96 { 97 int is_reg; 98 99 /* LDV_COMMENT_OTHER Register chrdev in the nondeterministic way. */ 100 is_reg = ldv_undef_int_nonpositive(); 101 102 /* LDV_COMMENT_ASSERT Register chrdev just in case when an error did not happen. */ 103 if (!is_reg) 104 { 105 /* LDV_COMMENT_ASSERT Usb gadget should be unregistered at this point. */ 106 ldv_assert(ldv_usb_gadget == LDV_USB_GADGET_ZERO_STATE); 107 /* LDV_COMMENT_ASSERT Check that chrdev region is unregistered. */ 108 ldv_assert(ldv_usb_gadget_chrdev == LDV_USB_GADGET_CHRDEV_ZERO_STATE); 109 /* LDV_COMMENT_CHANGE_STATE Register chrdev region for usb gadget. */ 110 ldv_usb_gadget_chrdev = LDV_USB_GADGET_CHRDEV_REGISTERED; 111 if (major == 0) 112 { 113 /* LDV_COMMENT_OTHER Function returns allocated major number. */ 114 is_reg = ldv_undef_int(); 115 ldv_assume (is_reg > 0); 116 } 117 } 118 119 /* LDV_COMMENT_RETURN Return registration status (0 is success). */ 120 return is_reg; 121 } 122 123 /* LDV_COMMENT_MODEL_FUNCTION_DEFINITION(name='ldv_register_chrdev_region') Check that chrdev region was not registered and register it. */ 124 int ldv_register_chrdev_region(void) 125 { 126 int is_reg; 127 128 /* LDV_COMMENT_OTHER Register chrdev in the nondeterministic way. */ 129 is_reg = ldv_undef_int_nonpositive(); 130 131 /* LDV_COMMENT_ASSERT Register chrdev just in case when an error did not happen. */ 132 if (!is_reg) 133 { 134 /* LDV_COMMENT_ASSERT Usb gadget should be unregistered at this point. */ 135 ldv_assert(ldv_usb_gadget == LDV_USB_GADGET_ZERO_STATE); 136 /* LDV_COMMENT_ASSERT Check that chrdev region is unregistered. */ 137 ldv_assert(ldv_usb_gadget_chrdev == LDV_USB_GADGET_CHRDEV_ZERO_STATE); 138 /* LDV_COMMENT_CHANGE_STATE Register chrdev region for usb gadget. */ 139 ldv_usb_gadget_chrdev = LDV_USB_GADGET_CHRDEV_REGISTERED; 140 } 141 142 /* LDV_COMMENT_RETURN Return registration status (0 is success). */ 143 return is_reg; 144 } 145 146 /* LDV_COMMENT_MODEL_FUNCTION_DEFINITION(name='ldv_unregister_chrdev_region') Check that chrdev region was registered and unregister it. */ 147 void ldv_unregister_chrdev_region(void) 148 { 149 /* LDV_COMMENT_ASSERT Usb gadget should not be registered at this point. */ 150 ldv_assert(ldv_usb_gadget == LDV_USB_GADGET_ZERO_STATE); 151 /* LDV_COMMENT_ASSERT Check that chrdev region is registered. */ 152 ldv_assert(ldv_usb_gadget_chrdev == LDV_USB_GADGET_CHRDEV_REGISTERED); 153 /* LDV_COMMENT_CHANGE_STATE Unregister chrdev. */ 154 ldv_usb_gadget_chrdev = LDV_USB_GADGET_CHRDEV_ZERO_STATE; 155 } 156 157 /* LDV_COMMENT_MODEL_FUNCTION_DEFINITION(name='ldv_register_usb_gadget') Check that usb gadget was not registered and register it. */ 158 int ldv_register_usb_gadget(void) 159 { 160 int is_reg; 161 162 /* LDV_COMMENT_OTHER Register usb gadget in the nondeterministic way. */ 163 is_reg = ldv_undef_int_nonpositive(); 164 165 /* LDV_COMMENT_ASSERT Register usb gadget just in case when an error did not happen. */ 166 if (!is_reg) 167 { 168 /* LDV_COMMENT_ASSERT Gadget should not be registered at this point. */ 169 ldv_assert(ldv_usb_gadget == LDV_USB_GADGET_ZERO_STATE); 170 /* LDV_COMMENT_CHANGE_STATE Register usb gadget. */ 171 ldv_usb_gadget = LDV_USB_GADGET_REGISTERED; 172 } 173 174 /* LDV_COMMENT_RETURN Return registration status (0 is success). */ 175 return is_reg; 176 } 177 178 /* LDV_COMMENT_MODEL_FUNCTION_DEFINITION(name='ldv_unregister_usb_gadget') Check that usb gadget was registered and unregister it. */ 179 void ldv_unregister_usb_gadget(void) 180 { 181 /* LDV_COMMENT_ASSERT Usb gadget should be registered at this point. */ 182 ldv_assert(ldv_usb_gadget == LDV_USB_GADGET_REGISTERED); 183 /* LDV_COMMENT_CHANGE_STATE Unregister usb gadget. */ 184 ldv_usb_gadget = LDV_USB_GADGET_ZERO_STATE; 185 } 186 187 /* LDV_COMMENT_MODEL_FUNCTION_DEFINITION(name='ldv_check_final_state') Check that usb gadget is fully unregistered at the end. */ 188 void ldv_check_final_state(void) 189 { 190 /* LDV_COMMENT_ASSERT Usb gadget class should be unregistered at the end. */ 191 ldv_assert(ldv_usb_gadget_class == LDV_USB_GADGET_CLASS_ZERO_STATE); 192 /* LDV_COMMENT_ASSERT Chrdev region should be unregistered at the end. */ 193 ldv_assert(ldv_usb_gadget_chrdev == LDV_USB_GADGET_CHRDEV_ZERO_STATE); 194 /* LDV_COMMENT_ASSERT Usb gadget should be unregistered at the end. */ 195 ldv_assert(ldv_usb_gadget == LDV_USB_GADGET_ZERO_STATE); 196 }
1 #ifndef _LDV_RCV_H_ 2 #define _LDV_RCV_H_ 3 4 /* If expr evaluates to zero, ldv_assert() causes a program to reach the error 5 label like the standard assert(). */ 6 #define ldv_assert(expr) ((expr) ? 0 : ldv_error()) 7 8 /* The error label wrapper. It is used because of some static verifiers (like 9 BLAST) don't accept multiple error labels through a program. */ 10 static inline void ldv_error(void) 11 { 12 LDV_ERROR: goto LDV_ERROR; 13 } 14 15 /* If expr evaluates to zero, ldv_assume() causes an infinite loop that is 16 avoided by verifiers. */ 17 #define ldv_assume(expr) ((expr) ? 0 : ldv_stop()) 18 19 /* Infinite loop, that causes verifiers to skip such paths. */ 20 static inline void ldv_stop(void) { 21 LDV_STOP: goto LDV_STOP; 22 } 23 24 /* Special nondeterministic functions. */ 25 int ldv_undef_int(void); 26 void *ldv_undef_ptr(void); 27 unsigned long ldv_undef_ulong(void); 28 long ldv_undef_long(void); 29 /* Return nondeterministic negative integer number. */ 30 static inline int ldv_undef_int_negative(void) 31 { 32 int ret = ldv_undef_int(); 33 34 ldv_assume(ret < 0); 35 36 return ret; 37 } 38 /* Return nondeterministic nonpositive integer number. */ 39 static inline int ldv_undef_int_nonpositive(void) 40 { 41 int ret = ldv_undef_int(); 42 43 ldv_assume(ret <= 0); 44 45 return ret; 46 } 47 48 /* Add explicit model for __builin_expect GCC function. Without the model a 49 return value will be treated as nondetermined by verifiers. */ 50 static inline long __builtin_expect(long exp, long c) 51 { 52 return exp; 53 } 54 55 /* This function causes the program to exit abnormally. GCC implements this 56 function by using a target-dependent mechanism (such as intentionally executing 57 an illegal instruction) or by calling abort. The mechanism used may vary from 58 release to release so you should not rely on any particular implementation. 59 http://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html */ 60 static inline void __builtin_trap(void) 61 { 62 ldv_assert(0); 63 } 64 65 /* The constant is for simulating an error of ldv_undef_ptr() function. */ 66 #define LDV_PTR_MAX 2012 67 68 #endif /* _LDV_RCV_H_ */

Here is an explanation of a rule violation arisen while checking your driver against a corresponding kernel.

Note that it may be false positive, i.e. there isn't a real error indeed. Please analyze a given error trace and related source code to understand whether there is an error in your driver.

Error trace column contains a path on which the given rule is violated. You can expand/collapse some entity classes by clicking on corresponding checkboxes in a main menu or in an advanced Others menu. Also you can expand/collapse each particular entity by clicking on +/-. In hovering on some entities you can see some tips. Also the error trace is bound with related source code. Line numbers may be shown as links on the left. You can click on them to open corresponding lines in source code.

Source code column contains a content of files related with the error trace. There is source code of your driver (note that there are some LDV modifications at the end), kernel headers and rule model. Tabs show a currently opened file and other available files. In hovering on them you can see full file names. On clicking a corresponding file content will be shown.

Ядро Модуль Правило Верификатор Вердикт Статус Время создания Описание проблемы
linux-4.13-rc1 drivers/platform/x86/wmi.ko 106_1a CPAchecker Bug Fixed 2017-07-21 14:04:56 L0279

Комментарий

Reported: 22 Jul 2017

[В начало]