Error Trace

[Home]

Bug # 42

Show/hide error trace
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()
{
95 struct kernel_symbol { unsigned long value; const char *name; } ;
33 struct module ;
19 typedef signed char __s8;
20 typedef unsigned char __u8;
22 typedef short __s16;
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;
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;
40 typedef __kernel_long_t __kernel_suseconds_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;
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;
147 typedef u64 dma_addr_t;
158 typedef unsigned int gfp_t;
159 typedef unsigned int fmode_t;
160 typedef unsigned int oom_flags_t;
163 typedef u64 phys_addr_t;
168 typedef phys_addr_t resource_size_t;
178 struct __anonstruct_atomic_t_6 { int counter; } ;
178 typedef struct __anonstruct_atomic_t_6 atomic_t;
183 struct __anonstruct_atomic64_t_7 { long counter; } ;
183 typedef struct __anonstruct_atomic64_t_7 atomic64_t;
184 struct list_head { struct list_head *next; struct list_head *prev; } ;
189 struct hlist_node ;
189 struct hlist_head { struct hlist_node *first; } ;
193 struct hlist_node { struct hlist_node *next; struct hlist_node **pprev; } ;
204 struct callback_head { struct callback_head *next; void (*func)(struct callback_head *); } ;
65 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; } ;
59 struct __anonstruct_ldv_1016_9 { unsigned int a; unsigned int b; } ;
59 struct __anonstruct_ldv_1031_10 { 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; } ;
59 union __anonunion_ldv_1032_8 { struct __anonstruct_ldv_1016_9 ldv_1016; struct __anonstruct_ldv_1031_10 ldv_1031; } ;
59 struct desc_struct { union __anonunion_ldv_1032_8 ldv_1032; } ;
12 typedef unsigned long pteval_t;
15 typedef unsigned long pgdval_t;
16 typedef unsigned long pgprotval_t;
18 struct __anonstruct_pte_t_11 { pteval_t pte; } ;
18 typedef struct __anonstruct_pte_t_11 pte_t;
20 struct pgprot { pgprotval_t pgprot; } ;
242 typedef struct pgprot pgprot_t;
244 struct __anonstruct_pgd_t_12 { pgdval_t pgd; } ;
244 typedef struct __anonstruct_pgd_t_12 pgd_t;
332 struct page ;
332 typedef struct page *pgtable_t;
340 struct file ;
353 struct seq_file ;
390 struct thread_struct ;
392 struct mm_struct ;
393 struct task_struct ;
394 struct cpumask ;
327 struct arch_spinlock ;
18 typedef u16 __ticket_t;
19 typedef u32 __ticketpair_t;
20 struct __raw_tickets { __ticket_t head; __ticket_t tail; } ;
32 union __anonunion_ldv_1452_15 { __ticketpair_t head_tail; struct __raw_tickets tickets; } ;
32 struct arch_spinlock { union __anonunion_ldv_1452_15 ldv_1452; } ;
33 typedef struct arch_spinlock arch_spinlock_t;
34 struct qrwlock { atomic_t cnts; arch_spinlock_t lock; } ;
14 typedef struct qrwlock arch_rwlock_t;
142 typedef void (*ctor_fn_t)();
222 struct _ddebug { const char *modname; const char *function; const char *filename; const char *format; unsigned int lineno; unsigned char flags; } ;
48 struct device ;
403 struct file_operations ;
415 struct completion ;
416 struct pid ;
526 struct bug_entry { int bug_addr_disp; int file_disp; unsigned short line; unsigned short flags; } ;
102 struct timespec ;
127 struct kernel_vm86_regs { struct pt_regs pt; unsigned short es; unsigned short __esh; unsigned short ds; unsigned short __dsh; unsigned short fs; unsigned short __fsh; unsigned short gs; unsigned short __gsh; } ;
79 union __anonunion_ldv_3051_20 { struct pt_regs *regs; struct kernel_vm86_regs *vm86; } ;
79 struct math_emu_info { long ___orig_eip; union __anonunion_ldv_3051_20 ldv_3051; } ;
306 struct cpumask { unsigned long bits[128U]; } ;
14 typedef struct cpumask cpumask_t;
671 typedef struct cpumask *cpumask_var_t;
161 struct seq_operations ;
293 struct i387_fsave_struct { u32 cwd; u32 swd; u32 twd; u32 fip; u32 fcs; u32 foo; u32 fos; u32 st_space[20U]; u32 status; } ;
311 struct __anonstruct_ldv_5357_25 { u64 rip; u64 rdp; } ;
311 struct __anonstruct_ldv_5363_26 { u32 fip; u32 fcs; u32 foo; u32 fos; } ;
311 union __anonunion_ldv_5364_24 { struct __anonstruct_ldv_5357_25 ldv_5357; struct __anonstruct_ldv_5363_26 ldv_5363; } ;
311 union __anonunion_ldv_5373_27 { u32 padding1[12U]; u32 sw_reserved[12U]; } ;
311 struct i387_fxsave_struct { u16 cwd; u16 swd; u16 twd; u16 fop; union __anonunion_ldv_5364_24 ldv_5364; u32 mxcsr; u32 mxcsr_mask; u32 st_space[32U]; u32 xmm_space[64U]; u32 padding[12U]; union __anonunion_ldv_5373_27 ldv_5373; } ;
345 struct i387_soft_struct { 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; } ;
366 struct ymmh_struct { u32 ymmh_space[64U]; } ;
371 struct lwp_struct { u8 reserved[128U]; } ;
376 struct bndregs_struct { u64 bndregs[8U]; } ;
380 struct bndcsr_struct { u64 cfg_reg_u; u64 status_reg; } ;
385 struct xsave_hdr_struct { u64 xstate_bv; u64 xcomp_bv; u64 reserved[6U]; } ;
391 struct xsave_struct { struct i387_fxsave_struct i387; struct xsave_hdr_struct xsave_hdr; struct ymmh_struct ymmh; struct lwp_struct lwp; struct bndregs_struct bndregs; struct bndcsr_struct bndcsr; } ;
400 union thread_xstate { struct i387_fsave_struct fsave; struct i387_fxsave_struct fxsave; struct i387_soft_struct soft; struct xsave_struct xsave; } ;
408 struct fpu { unsigned int last_cpu; unsigned int has_fpu; union thread_xstate *state; } ;
464 struct kmem_cache ;
465 struct perf_event ;
466 struct thread_struct { struct desc_struct tls_array[3U]; unsigned long sp0; unsigned long sp; unsigned long usersp; unsigned short es; unsigned short ds; unsigned short fsindex; unsigned short gsindex; unsigned long fs; unsigned long gs; struct perf_event *ptrace_bps[4U]; unsigned long debugreg6; unsigned long ptrace_dr7; unsigned long cr2; unsigned long trap_nr; unsigned long error_code; struct fpu fpu; unsigned long *io_bitmap_ptr; unsigned long iopl; unsigned int io_bitmap_max; unsigned char fpu_counter; } ;
23 typedef atomic64_t atomic_long_t;
34 struct lockdep_map ;
55 struct stack_trace { unsigned int nr_entries; unsigned int max_entries; unsigned long *entries; int skip; } ;
26 struct lockdep_subclass_key { char __one_byte; } ;
53 struct lock_class_key { struct lockdep_subclass_key subkeys[8U]; } ;
59 struct lock_class { struct list_head 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; } ;
205 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; } ;
530 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_ldv_6410_31 { u8 __padding[24U]; struct lockdep_map dep_map; } ;
33 union __anonunion_ldv_6411_30 { struct raw_spinlock rlock; struct __anonstruct_ldv_6410_31 ldv_6410; } ;
33 struct spinlock { union __anonunion_ldv_6411_30 ldv_6411; } ;
76 typedef struct spinlock spinlock_t;
23 struct __anonstruct_rwlock_t_32 { 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_32 rwlock_t;
35 struct __wait_queue_head { spinlock_t lock; struct list_head task_list; } ;
40 typedef struct __wait_queue_head wait_queue_head_t;
1029 struct seqcount { unsigned int sequence; struct lockdep_map dep_map; } ;
51 typedef struct seqcount seqcount_t;
98 struct __anonstruct_nodemask_t_34 { unsigned long bits[16U]; } ;
98 typedef struct __anonstruct_nodemask_t_34 nodemask_t;
825 struct optimistic_spin_queue { atomic_t tail; } ;
26 struct mutex { atomic_t count; spinlock_t wait_lock; struct list_head wait_list; struct task_struct *owner; const char *name; void *magic; struct lockdep_map dep_map; } ;
68 struct mutex_waiter { struct list_head list; struct task_struct *task; void *magic; } ;
178 struct rw_semaphore ;
179 struct rw_semaphore { long 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; } ;
172 struct completion { unsigned int done; wait_queue_head_t wait; } ;
1112 struct timespec { __kernel_time_t tv_sec; long tv_nsec; } ;
13 struct timeval { __kernel_time_t tv_sec; __kernel_suseconds_t tv_usec; } ;
323 union ktime { s64 tv64; } ;
41 typedef union ktime ktime_t;
207 struct tvec_base ;
208 struct timer_list { struct list_head entry; unsigned long expires; struct tvec_base *base; void (*function)(unsigned long); unsigned long data; int slack; int start_pid; void *start_site; char start_comm[16U]; struct lockdep_map lockdep_map; } ;
254 struct hrtimer ;
255 enum hrtimer_restart ;
266 struct workqueue_struct ;
267 struct work_struct ;
53 struct work_struct { atomic_long_t data; struct list_head entry; void (*func)(struct work_struct *); struct lockdep_map lockdep_map; } ;
106 struct delayed_work { struct work_struct work; struct timer_list timer; struct workqueue_struct *wq; int cpu; } ;
72 struct resource { resource_size_t start; resource_size_t end; const char *name; unsigned long flags; struct resource *parent; struct resource *sibling; struct resource *child; } ;
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 *); } ;
320 enum rpm_status { RPM_ACTIVE = 0, RPM_RESUMING = 1, RPM_SUSPENDED = 2, RPM_SUSPENDING = 3 } ;
327 enum rpm_request { RPM_REQ_NONE = 0, RPM_REQ_IDLE = 1, RPM_REQ_SUSPEND = 2, RPM_REQ_AUTOSUSPEND = 3, RPM_REQ_RESUME = 4 } ;
335 struct wakeup_source ;
546 struct pm_subsys_data { spinlock_t lock; unsigned int refcount; struct list_head clock_list; } ;
553 struct dev_pm_qos ;
553 struct dev_pm_info { pm_message_t power_state; unsigned char can_wakeup; unsigned char async_suspend; bool is_prepared; bool is_suspended; bool is_noirq_suspended; bool is_late_suspended; bool ignore_children; 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; struct timer_list suspend_timer; unsigned long timer_expires; struct work_struct work; wait_queue_head_t wait_queue; 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 run_wake; unsigned char runtime_auto; unsigned char no_callbacks; unsigned char irq_safe; unsigned char use_autosuspend; unsigned char timer_autosuspends; unsigned char memalloc_noio; 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; } ;
614 struct dev_pm_domain { struct dev_pm_ops ops; } ;
22 struct __anonstruct_mm_context_t_99 { void *ldt; int size; unsigned short ia32_compat; struct mutex lock; void *vdso; } ;
22 typedef struct __anonstruct_mm_context_t_99 mm_context_t;
18 struct rb_node { unsigned long __rb_parent_color; struct rb_node *rb_right; struct rb_node *rb_left; } ;
40 struct rb_root { struct rb_node *rb_node; } ;
87 struct vm_area_struct ;
169 struct device_node ;
1304 struct llist_node ;
64 struct llist_node { struct llist_node *next; } ;
57 struct mem_cgroup ;
338 union __anonunion_ldv_13039_126 { unsigned long bitmap[4U]; struct callback_head callback_head; } ;
338 struct idr_layer { int prefix; int layer; struct idr_layer *ary[256U]; int count; union __anonunion_ldv_13039_126 ldv_13039; } ;
41 struct idr { struct idr_layer *hint; struct idr_layer *top; int layers; int cur; spinlock_t lock; int id_free_cnt; struct idr_layer *id_free; } ;
124 struct ida_bitmap { long nr_busy; unsigned long bitmap[15U]; } ;
153 struct ida { struct idr idr; struct ida_bitmap *free_bitmap; } ;
185 struct dentry ;
186 struct iattr ;
187 struct super_block ;
188 struct file_system_type ;
189 struct kernfs_open_node ;
190 struct kernfs_iattrs ;
213 struct kernfs_root ;
213 struct kernfs_elem_dir { unsigned long subdirs; struct rb_root children; struct kernfs_root *root; } ;
85 struct kernfs_node ;
85 struct kernfs_elem_symlink { struct kernfs_node *target_kn; } ;
89 struct kernfs_ops ;
89 struct kernfs_elem_attr { const struct kernfs_ops *ops; struct kernfs_open_node *open; loff_t size; struct kernfs_node *notify_next; } ;
96 union __anonunion_ldv_13184_127 { struct kernfs_elem_dir dir; struct kernfs_elem_symlink symlink; struct kernfs_elem_attr attr; } ;
96 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_ldv_13184_127 ldv_13184; void *priv; unsigned short flags; umode_t mode; unsigned int ino; struct kernfs_iattrs *iattr; } ;
138 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 *); } ;
155 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; } ;
171 struct vm_operations_struct ;
171 struct kernfs_open_file { struct kernfs_node *kn; struct file *file; void *priv; struct mutex mutex; int event; struct list_head list; size_t atomic_write_len; bool mmapped; const struct vm_operations_struct *vm_ops; } ;
187 struct kernfs_ops { 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; 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; } ;
464 struct sock ;
465 struct kobject ;
466 enum kobj_ns_type { KOBJ_NS_TYPE_NONE = 0, KOBJ_NS_TYPE_NET = 1, KOBJ_NS_TYPES = 2 } ;
472 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_128 { uid_t val; } ;
22 typedef struct __anonstruct_kuid_t_128 kuid_t;
27 struct __anonstruct_kgid_t_129 { gid_t val; } ;
27 typedef struct __anonstruct_kgid_t_129 kgid_t;
127 struct kstat { u64 ino; dev_t dev; umode_t mode; unsigned int nlink; kuid_t uid; kgid_t gid; dev_t rdev; loff_t size; struct timespec atime; struct timespec mtime; struct timespec ctime; unsigned long blksize; unsigned long long blocks; } ;
36 struct bin_attribute ;
37 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); struct attribute **attrs; struct bin_attribute **bin_attrs; } ;
67 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 *); } ;
131 struct sysfs_ops { ssize_t (*show)(struct kobject *, struct attribute *, char *); ssize_t (*store)(struct kobject *, struct attribute *, const char *, size_t ); } ;
470 struct kref { atomic_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; } ;
114 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 *); } ;
122 struct kobj_uevent_env { char *argv[3U]; char *envp[32U]; int envp_idx; char buf[2048U]; int buflen; } ;
130 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 *); } ;
147 struct kset { struct list_head list; spinlock_t list_lock; struct kobject kobj; const struct kset_uevent_ops *uevent_ops; } ;
252 struct kmem_cache_cpu { void **freelist; unsigned long tid; struct page *page; struct page *partial; unsigned int stat[26U]; } ;
48 struct kmem_cache_order_objects { unsigned long x; } ;
58 struct memcg_cache_params ;
58 struct kmem_cache_node ;
58 struct kmem_cache { struct kmem_cache_cpu *cpu_slab; unsigned long flags; unsigned long min_partial; int size; int object_size; int offset; int cpu_partial; struct kmem_cache_order_objects oo; struct kmem_cache_order_objects max; struct kmem_cache_order_objects min; gfp_t allocflags; int refcount; void (*ctor)(void *); int inuse; int align; int reserved; const char *name; struct list_head list; struct kobject kobj; struct memcg_cache_params *memcg_params; int max_attr_size; struct kset *memcg_kset; int remote_node_defrag_ratio; struct kmem_cache_node *node[1024U]; } ;
505 struct __anonstruct_ldv_14089_131 { struct callback_head callback_head; struct kmem_cache *memcg_caches[0U]; } ;
505 struct __anonstruct_ldv_14095_132 { struct mem_cgroup *memcg; struct list_head list; struct kmem_cache *root_cache; atomic_t nr_pages; } ;
505 union __anonunion_ldv_14096_130 { struct __anonstruct_ldv_14089_131 ldv_14089; struct __anonstruct_ldv_14095_132 ldv_14095; } ;
505 struct memcg_cache_params { bool is_root_cache; union __anonunion_ldv_14096_130 ldv_14096; } ;
33 struct v4l2_format ;
37 struct videobuf_queue ;
40 struct platform_device ;
47 struct v4l2_buffer ;
48 struct videobuf_buffer ;
55 struct klist_node ;
37 struct klist_node { void *n_klist; struct list_head n_node; struct kref n_ref; } ;
67 struct path ;
68 struct inode ;
69 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; struct user_namespace *user_ns; void *private; } ;
35 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 *); } ;
196 struct pinctrl ;
197 struct pinctrl_state ;
194 struct dev_pin_info { struct pinctrl *p; struct pinctrl_state *default_state; struct pinctrl_state *sleep_state; struct pinctrl_state *idle_state; } ;
42 struct dma_map_ops ;
42 struct dev_archdata { struct dma_map_ops *dma_ops; void *iommu; } ;
11 struct pdev_archdata { } ;
14 struct device_private ;
15 struct device_driver ;
16 struct driver_private ;
17 struct class ;
18 struct subsys_private ;
19 struct bus_type ;
20 struct iommu_ops ;
21 struct iommu_group ;
60 struct device_attribute ;
60 struct bus_type { const char *name; const char *dev_name; struct device *dev_root; struct device_attribute *dev_attrs; 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 *); const struct dev_pm_ops *pm; const struct iommu_ops *iommu_ops; struct subsys_private *p; struct lock_class_key lock_key; } ;
138 struct device_type ;
195 struct of_device_id ;
195 struct acpi_device_id ;
195 struct device_driver { const char *name; struct bus_type *bus; struct module *owner; const char *mod_name; bool suppress_bind_attrs; 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; } ;
321 struct class_attribute ;
321 struct class { const char *name; struct module *owner; struct class_attribute *class_attrs; 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 *); const struct kobj_ns_type_operations *ns_type; const void * (*namespace)(struct device *); const struct dev_pm_ops *pm; struct subsys_private *p; } ;
414 struct class_attribute { struct attribute attr; ssize_t (*show)(struct class *, struct class_attribute *, char *); ssize_t (*store)(struct class *, struct class_attribute *, const char *, size_t ); } ;
482 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; } ;
510 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 ); } ;
642 struct device_dma_parameters { unsigned int max_segment_size; unsigned long segment_boundary_mask; } ;
651 struct acpi_device ;
652 struct acpi_dev_node { struct acpi_device *companion; } ;
658 struct dma_coherent_mem ;
658 struct cma ;
658 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_pm_info power; struct dev_pm_domain *pm_domain; struct dev_pin_info *pins; int numa_node; 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 acpi_dev_node acpi_node; 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; bool offline_disabled; bool offline; } ;
805 struct wakeup_source { const char *name; struct list_head entry; spinlock_t lock; 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; } ;
1211 struct dma_attrs { unsigned long flags[1U]; } ;
70 enum dma_data_direction { DMA_BIDIRECTIONAL = 0, DMA_TO_DEVICE = 1, DMA_FROM_DEVICE = 2, DMA_NONE = 3 } ;
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_ldv_15463_138 { struct arch_uprobe_task autask; unsigned long vaddr; } ;
73 struct __anonstruct_ldv_15467_139 { struct callback_head dup_xol_work; unsigned long dup_xol_addr; } ;
73 union __anonunion_ldv_15468_137 { struct __anonstruct_ldv_15463_138 ldv_15463; struct __anonstruct_ldv_15467_139 ldv_15467; } ;
73 struct uprobe ;
73 struct return_instance ;
73 struct uprobe_task { enum uprobe_task_state state; union __anonunion_ldv_15468_137 ldv_15468; struct uprobe *active_uprobe; unsigned long xol_vaddr; struct return_instance *return_instances; unsigned int depth; } ;
94 struct xol_area ;
95 struct uprobes_state { struct xol_area *xol_area; } ;
133 struct address_space ;
134 union __anonunion_ldv_15577_140 { struct address_space *mapping; void *s_mem; } ;
134 union __anonunion_ldv_15583_142 { unsigned long index; void *freelist; bool pfmemalloc; } ;
134 struct __anonstruct_ldv_15593_146 { unsigned short inuse; unsigned short objects; unsigned char frozen; } ;
134 union __anonunion_ldv_15595_145 { atomic_t _mapcount; struct __anonstruct_ldv_15593_146 ldv_15593; int units; } ;
134 struct __anonstruct_ldv_15597_144 { union __anonunion_ldv_15595_145 ldv_15595; atomic_t _count; } ;
134 union __anonunion_ldv_15599_143 { unsigned long counters; struct __anonstruct_ldv_15597_144 ldv_15597; unsigned int active; } ;
134 struct __anonstruct_ldv_15600_141 { union __anonunion_ldv_15583_142 ldv_15583; union __anonunion_ldv_15599_143 ldv_15599; } ;
134 struct __anonstruct_ldv_15607_148 { struct page *next; int pages; int pobjects; } ;
134 struct slab ;
134 union __anonunion_ldv_15612_147 { struct list_head lru; struct __anonstruct_ldv_15607_148 ldv_15607; struct slab *slab_page; struct callback_head callback_head; pgtable_t pmd_huge_pte; } ;
134 union __anonunion_ldv_15618_149 { unsigned long private; spinlock_t *ptl; struct kmem_cache *slab_cache; struct page *first_page; } ;
134 struct page { unsigned long flags; union __anonunion_ldv_15577_140 ldv_15577; struct __anonstruct_ldv_15600_141 ldv_15600; union __anonunion_ldv_15612_147 ldv_15612; union __anonunion_ldv_15618_149 ldv_15618; unsigned long debug_flags; } ;
187 struct page_frag { struct page *page; __u32 offset; __u32 size; } ;
239 struct __anonstruct_linear_151 { struct rb_node rb; unsigned long rb_subtree_last; } ;
239 union __anonunion_shared_150 { struct __anonstruct_linear_151 linear; struct list_head nonlinear; } ;
239 struct anon_vma ;
239 struct mempolicy ;
239 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; union __anonunion_shared_150 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; } ;
311 struct core_thread { struct task_struct *task; struct core_thread *next; } ;
317 struct core_state { atomic_t nr_threads; struct core_thread dumper; struct completion startup; } ;
330 struct task_rss_stat { int events; int count[3U]; } ;
338 struct mm_rss_stat { atomic_long_t count[3U]; } ;
343 struct kioctx_table ;
344 struct linux_binfmt ;
344 struct mmu_notifier_mm ;
344 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 task_size; unsigned long highest_vm_end; pgd_t *pgd; atomic_t mm_users; atomic_t mm_count; atomic_long_t nr_ptes; 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 shared_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 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; } ;
93 struct shrink_control { gfp_t gfp_mask; unsigned long nr_to_scan; nodemask_t nodes_to_scan; int nid; } ;
26 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; } ;
71 struct file_ra_state ;
72 struct user_struct ;
73 struct writeback_control ;
188 struct vm_fault { unsigned int flags; unsigned long pgoff; void *virtual_address; struct page *page; unsigned long max_pgoff; pte_t *pte; } ;
221 struct vm_operations_struct { void (*open)(struct vm_area_struct *); void (*close)(struct vm_area_struct *); int (*fault)(struct vm_area_struct *, struct vm_fault *); void (*map_pages)(struct vm_area_struct *, struct vm_fault *); int (*page_mkwrite)(struct vm_area_struct *, struct vm_fault *); int (*access)(struct vm_area_struct *, unsigned long, void *, int, int); const char * (*name)(struct vm_area_struct *); int (*set_policy)(struct vm_area_struct *, struct mempolicy *); struct mempolicy * (*get_policy)(struct vm_area_struct *, unsigned long); int (*migrate)(struct vm_area_struct *, const nodemask_t *, const nodemask_t *, unsigned long); int (*remap_pages)(struct vm_area_struct *, unsigned long, unsigned long, unsigned long); } ;
2119 struct scatterlist { unsigned long sg_magic; unsigned long page_link; unsigned int offset; unsigned int length; dma_addr_t dma_address; unsigned int dma_length; } ;
17 struct sg_table { struct scatterlist *sgl; unsigned int nents; unsigned int orig_nents; } ;
351 struct dma_map_ops { void * (*alloc)(struct device *, size_t , dma_addr_t *, gfp_t , struct dma_attrs *); void (*free)(struct device *, size_t , void *, dma_addr_t , struct dma_attrs *); int (*mmap)(struct device *, struct vm_area_struct *, void *, dma_addr_t , size_t , struct dma_attrs *); int (*get_sgtable)(struct device *, struct sg_table *, void *, dma_addr_t , size_t , struct dma_attrs *); dma_addr_t (*map_page)(struct device *, struct page *, unsigned long, size_t , enum dma_data_direction , struct dma_attrs *); void (*unmap_page)(struct device *, dma_addr_t , size_t , enum dma_data_direction , struct dma_attrs *); int (*map_sg)(struct device *, struct scatterlist *, int, enum dma_data_direction , struct dma_attrs *); void (*unmap_sg)(struct device *, struct scatterlist *, int, enum dma_data_direction , struct dma_attrs *); void (*sync_single_for_cpu)(struct device *, dma_addr_t , size_t , enum dma_data_direction ); void (*sync_single_for_device)(struct device *, dma_addr_t , size_t , enum dma_data_direction ); void (*sync_sg_for_cpu)(struct device *, struct scatterlist *, int, enum dma_data_direction ); void (*sync_sg_for_device)(struct device *, struct scatterlist *, int, enum dma_data_direction ); int (*mapping_error)(struct device *, dma_addr_t ); int (*dma_supported)(struct device *, u64 ); int (*set_dma_mask)(struct device *, u64 ); int is_phys; } ;
461 struct hlist_bl_node ;
461 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_ldv_19720_153 { spinlock_t lock; unsigned int count; } ;
114 union __anonunion_ldv_19721_152 { struct __anonstruct_ldv_19720_153 ldv_19720; } ;
114 struct lockref { union __anonunion_ldv_19721_152 ldv_19721; } ;
49 struct nameidata ;
50 struct vfsmount ;
51 struct __anonstruct_ldv_19744_155 { u32 hash; u32 len; } ;
51 union __anonunion_ldv_19746_154 { struct __anonstruct_ldv_19744_155 ldv_19744; u64 hash_len; } ;
51 struct qstr { union __anonunion_ldv_19746_154 ldv_19746; const unsigned char *name; } ;
90 struct dentry_operations ;
90 union __anonunion_d_u_156 { struct list_head d_child; struct callback_head d_rcu; } ;
90 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; struct list_head d_lru; union __anonunion_d_u_156 d_u; struct list_head d_subdirs; struct hlist_node d_alias; } ;
142 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 *, const struct dentry *, unsigned int, const char *, const struct qstr *); int (*d_delete)(const 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)(struct dentry *, bool ); } ;
478 struct path { struct vfsmount *mnt; struct dentry *dentry; } ;
27 struct list_lru_node { spinlock_t lock; struct list_head list; long nr_items; } ;
30 struct list_lru { struct list_lru_node *node; nodemask_t active_nodes; } ;
58 struct __anonstruct_ldv_20109_158 { struct radix_tree_node *parent; void *private_data; } ;
58 union __anonunion_ldv_20111_157 { struct __anonstruct_ldv_20109_158 ldv_20109; struct callback_head callback_head; } ;
58 struct radix_tree_node { unsigned int path; unsigned int count; union __anonunion_ldv_20111_157 ldv_20111; struct list_head private_list; void *slots[64U]; unsigned long tags[3U][1U]; } ;
105 struct radix_tree_root { unsigned int height; gfp_t gfp_mask; struct radix_tree_node *rnode; } ;
428 enum pid_type { PIDTYPE_PID = 0, PIDTYPE_PGID = 1, PIDTYPE_SID = 2, PIDTYPE_MAX = 3 } ;
435 struct pid_namespace ;
435 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; } ;
22 struct kernel_cap_struct { __u32 cap[2U]; } ;
25 typedef struct kernel_cap_struct kernel_cap_t;
45 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 } ;
30 struct block_device ;
31 struct io_context ;
59 struct export_operations ;
61 struct iovec ;
62 struct kiocb ;
63 struct pipe_inode_info ;
64 struct poll_table_struct ;
65 struct kstatfs ;
66 struct cred ;
67 struct swap_info_struct ;
68 struct iov_iter ;
69 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; } ;
253 struct percpu_counter { raw_spinlock_t lock; s64 count; struct list_head list; s32 *counters; } ;
176 struct fs_disk_quota { __s8 d_version; __s8 d_flags; __u16 d_fieldmask; __u32 d_id; __u64 d_blk_hardlimit; __u64 d_blk_softlimit; __u64 d_ino_hardlimit; __u64 d_ino_softlimit; __u64 d_bcount; __u64 d_icount; __s32 d_itimer; __s32 d_btimer; __u16 d_iwarns; __u16 d_bwarns; __s32 d_padding2; __u64 d_rtb_hardlimit; __u64 d_rtb_softlimit; __u64 d_rtbcount; __s32 d_rtbtimer; __u16 d_rtbwarns; __s16 d_padding3; char d_padding4[8U]; } ;
76 struct fs_qfilestat { __u64 qfs_ino; __u64 qfs_nblks; __u32 qfs_nextents; } ;
151 typedef struct fs_qfilestat fs_qfilestat_t;
152 struct fs_quota_stat { __s8 qs_version; __u16 qs_flags; __s8 qs_pad; fs_qfilestat_t qs_uquota; fs_qfilestat_t qs_gquota; __u32 qs_incoredqs; __s32 qs_btimelimit; __s32 qs_itimelimit; __s32 qs_rtbtimelimit; __u16 qs_bwarnlimit; __u16 qs_iwarnlimit; } ;
166 struct fs_qfilestatv { __u64 qfs_ino; __u64 qfs_nblks; __u32 qfs_nextents; __u32 qfs_pad; } ;
196 struct fs_quota_statv { __s8 qs_version; __u8 qs_pad1; __u16 qs_flags; __u32 qs_incoredqs; struct fs_qfilestatv qs_uquota; struct fs_qfilestatv qs_gquota; struct fs_qfilestatv qs_pquota; __s32 qs_btimelimit; __s32 qs_itimelimit; __s32 qs_rtbtimelimit; __u16 qs_bwarnlimit; __u16 qs_iwarnlimit; __u64 qs_pad2[8U]; } ;
212 struct dquot ;
19 typedef __kernel_uid32_t projid_t;
23 struct __anonstruct_kprojid_t_160 { projid_t val; } ;
23 typedef struct __anonstruct_kprojid_t_160 kprojid_t;
119 struct if_dqinfo { __u64 dqi_bgrace; __u64 dqi_igrace; __u32 dqi_flags; __u32 dqi_valid; } ;
152 enum quota_type { USRQUOTA = 0, GRPQUOTA = 1, PRJQUOTA = 2 } ;
60 typedef long long qsize_t;
61 union __anonunion_ldv_20911_161 { kuid_t uid; kgid_t gid; kprojid_t projid; } ;
61 struct kqid { union __anonunion_ldv_20911_161 ldv_20911; enum quota_type type; } ;
178 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; time_t dqb_btime; time_t dqb_itime; } ;
200 struct quota_format_type ;
201 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_maxblimit; qsize_t dqi_maxilimit; void *dqi_priv; } ;
264 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; } ;
291 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 *); } ;
302 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 *); } ;
316 struct quotactl_ops { int (*quota_on)(struct super_block *, int, int, struct path *); int (*quota_on_meta)(struct super_block *, int, int); int (*quota_off)(struct super_block *, int); int (*quota_sync)(struct super_block *, int); int (*get_info)(struct super_block *, int, struct if_dqinfo *); int (*set_info)(struct super_block *, int, struct if_dqinfo *); int (*get_dqblk)(struct super_block *, struct kqid , struct fs_disk_quota *); int (*set_dqblk)(struct super_block *, struct kqid , struct fs_disk_quota *); int (*get_xstate)(struct super_block *, struct fs_quota_stat *); int (*set_xstate)(struct super_block *, unsigned int, int); int (*get_xstatev)(struct super_block *, struct fs_quota_statv *); int (*rm_xquota)(struct super_block *, unsigned int); } ;
334 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; } ;
380 struct quota_info { unsigned int flags; struct mutex dqio_mutex; struct mutex dqonoff_mutex; struct inode *files[2U]; struct mem_dqinfo info[2U]; const struct quota_format_ops *ops[2U]; } ;
323 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)(int, struct kiocb *, struct iov_iter *, loff_t ); int (*get_xip_mem)(struct address_space *, unsigned long, int, void **, unsigned long *); int (*migratepage)(struct address_space *, struct page *, struct page *, enum migrate_mode ); 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 *); } ;
382 struct backing_dev_info ;
383 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 list_head i_mmap_nonlinear; struct mutex i_mmap_mutex; unsigned long nrpages; unsigned long nrshadows; unsigned long writeback_index; const struct address_space_operations *a_ops; unsigned long flags; struct backing_dev_info *backing_dev_info; spinlock_t private_lock; struct list_head private_list; void *private_data; } ;
405 struct request_queue ;
406 struct hd_struct ;
406 struct gendisk ;
406 struct block_device { dev_t bd_dev; int bd_openers; struct inode *bd_inode; struct super_block *bd_super; struct mutex bd_mutex; struct list_head bd_inodes; 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 list_head bd_list; unsigned long bd_private; int bd_fsfreeze_count; struct mutex bd_fsfreeze_mutex; } ;
503 struct posix_acl ;
504 struct inode_operations ;
504 union __anonunion_ldv_21337_164 { const unsigned int i_nlink; unsigned int __i_nlink; } ;
504 union __anonunion_ldv_21357_165 { struct hlist_head i_dentry; struct callback_head i_rcu; } ;
504 struct file_lock ;
504 struct cdev ;
504 union __anonunion_ldv_21374_166 { struct pipe_inode_info *i_pipe; struct block_device *i_bdev; struct cdev *i_cdev; } ;
504 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_ldv_21337_164 ldv_21337; 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; blkcnt_t i_blocks; unsigned long i_state; struct mutex i_mutex; unsigned long dirtied_when; struct hlist_node i_hash; struct list_head i_wb_list; struct list_head i_lru; struct list_head i_sb_list; union __anonunion_ldv_21357_165 ldv_21357; 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 *i_flock; struct address_space i_data; struct dquot *i_dquot[2U]; struct list_head i_devices; union __anonunion_ldv_21374_166 ldv_21374; __u32 i_generation; __u32 i_fsnotify_mask; struct hlist_head i_fsnotify_marks; void *i_private; } ;
740 struct fown_struct { rwlock_t lock; struct pid *pid; enum pid_type pid_type; kuid_t uid; kuid_t euid; int signum; } ;
748 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; } ;
771 union __anonunion_f_u_167 { struct llist_node fu_llist; struct callback_head fu_rcuhead; } ;
771 struct file { union __anonunion_f_u_167 f_u; struct path f_path; struct inode *f_inode; const struct file_operations *f_op; spinlock_t f_lock; 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; } ;
861 typedef void *fl_owner_t;
862 struct file_lock_operations { void (*fl_copy_lock)(struct file_lock *, struct file_lock *); void (*fl_release_private)(struct file_lock *); } ;
867 struct lock_manager_operations { int (*lm_compare_owner)(struct file_lock *, struct file_lock *); unsigned long int (*lm_owner_key)(struct file_lock *); void (*lm_notify)(struct file_lock *); int (*lm_grant)(struct file_lock *, struct file_lock *, int); void (*lm_break)(struct file_lock *); int (*lm_change)(struct file_lock **, int); } ;
885 struct nlm_lockowner ;
886 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_169 { struct list_head link; int state; } ;
19 union __anonunion_fl_u_168 { struct nfs_lock_info nfs_fl; struct nfs4_lock_info nfs4_fl; struct __anonstruct_afs_169 afs; } ;
19 struct file_lock { struct file_lock *fl_next; 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_168 fl_u; } ;
988 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; } ;
1182 struct sb_writers { struct percpu_counter counter[3U]; wait_queue_head_t wait; int frozen; wait_queue_head_t wait_unfrozen; struct lockdep_map lock_map[3U]; } ;
1198 struct super_operations ;
1198 struct xattr_handler ;
1198 struct mtd_info ;
1198 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_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; struct list_head s_inodes; 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; struct quota_info s_dquot; struct sb_writers s_writers; char s_id[32U]; u8 s_uuid[16U]; 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; char *s_options; 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 list_lru s_dentry_lru; struct list_lru s_inode_lru; struct callback_head rcu; } ;
1429 struct fiemap_extent_info { unsigned int fi_flags; unsigned int fi_extents_mapped; unsigned int fi_extents_max; struct fiemap_extent *fi_extents_start; } ;
1467 struct dir_context { int (*actor)(void *, const char *, int, loff_t , u64 , unsigned int); loff_t pos; } ;
1472 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 (*aio_read)(struct kiocb *, const struct iovec *, unsigned long, loff_t ); ssize_t (*aio_write)(struct kiocb *, const struct iovec *, unsigned long, 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 *); 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 (*aio_fsync)(struct kiocb *, 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 **); long int (*fallocate)(struct file *, int, loff_t , loff_t ); int (*show_fdinfo)(struct seq_file *, struct file *); } ;
1514 struct inode_operations { struct dentry * (*lookup)(struct inode *, struct dentry *, unsigned int); void * (*follow_link)(struct dentry *, struct nameidata *); int (*permission)(struct inode *, int); struct posix_acl * (*get_acl)(struct inode *, int); int (*readlink)(struct dentry *, char *, int); void (*put_link)(struct dentry *, struct nameidata *, void *); 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 *); int (*rename2)(struct inode *, struct dentry *, struct inode *, struct dentry *, unsigned int); int (*setattr)(struct dentry *, struct iattr *); int (*getattr)(struct vfsmount *, struct dentry *, struct kstat *); int (*setxattr)(struct dentry *, const char *, const void *, size_t , int); ssize_t (*getxattr)(struct dentry *, const char *, void *, size_t ); ssize_t (*listxattr)(struct dentry *, char *, size_t ); int (*removexattr)(struct dentry *, const char *); 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); } ;
1561 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_fs)(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 ); int (*bdev_try_to_free_page)(struct super_block *, struct page *, gfp_t ); long int (*nr_cached_objects)(struct super_block *, int); long int (*free_cached_objects)(struct super_block *, long, int); } ;
1775 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; } ;
13 typedef unsigned long kernel_ulong_t;
186 struct acpi_device_id { __u8 id[9U]; kernel_ulong_t driver_data; } ;
219 struct of_device_id { char name[32U]; char type[32U]; char compatible[128U]; const void *data; } ;
479 struct platform_device_id { char name[20U]; kernel_ulong_t driver_data; } ;
84 struct plist_node { int prio; struct list_head prio_list; struct list_head node_list; } ;
4 typedef unsigned long cputime_t;
25 struct sem_undo_list ;
25 struct sysv_sem { struct sem_undo_list *undo_list; } ;
26 struct sysv_shm { struct list_head shm_clist; } ;
24 struct __anonstruct_sigset_t_173 { unsigned long sig[1U]; } ;
24 typedef struct __anonstruct_sigset_t_173 sigset_t;
25 struct siginfo ;
17 typedef void __signalfn_t(int);
18 typedef __signalfn_t *__sighandler_t;
20 typedef void __restorefn_t();
21 typedef __restorefn_t *__sigrestore_t;
34 union sigval { int sival_int; void *sival_ptr; } ;
10 typedef union sigval sigval_t;
11 struct __anonstruct__kill_175 { __kernel_pid_t _pid; __kernel_uid32_t _uid; } ;
11 struct __anonstruct__timer_176 { __kernel_timer_t _tid; int _overrun; char _pad[0U]; sigval_t _sigval; int _sys_private; } ;
11 struct __anonstruct__rt_177 { __kernel_pid_t _pid; __kernel_uid32_t _uid; sigval_t _sigval; } ;
11 struct __anonstruct__sigchld_178 { __kernel_pid_t _pid; __kernel_uid32_t _uid; int _status; __kernel_clock_t _utime; __kernel_clock_t _stime; } ;
11 struct __anonstruct__sigfault_179 { void *_addr; short _addr_lsb; } ;
11 struct __anonstruct__sigpoll_180 { long _band; int _fd; } ;
11 struct __anonstruct__sigsys_181 { void *_call_addr; int _syscall; unsigned int _arch; } ;
11 union __anonunion__sifields_174 { int _pad[28U]; struct __anonstruct__kill_175 _kill; struct __anonstruct__timer_176 _timer; struct __anonstruct__rt_177 _rt; struct __anonstruct__sigchld_178 _sigchld; struct __anonstruct__sigfault_179 _sigfault; struct __anonstruct__sigpoll_180 _sigpoll; struct __anonstruct__sigsys_181 _sigsys; } ;
11 struct siginfo { int si_signo; int si_errno; int si_code; union __anonunion__sifields_174 _sifields; } ;
109 typedef struct siginfo siginfo_t;
21 struct sigpending { struct list_head list; sigset_t signal; } ;
246 struct sigaction { __sighandler_t sa_handler; unsigned long sa_flags; __sigrestore_t sa_restorer; sigset_t sa_mask; } ;
260 struct k_sigaction { struct sigaction sa; } ;
53 struct seccomp_filter ;
54 struct seccomp { int mode; struct seccomp_filter *filter; } ;
20 struct rt_mutex { raw_spinlock_t wait_lock; struct rb_root waiters; struct rb_node *waiters_leftmost; struct task_struct *owner; int save_state; const char *name; const char *file; int line; void *magic; } ;
40 struct rt_mutex_waiter ;
41 struct rlimit { __kernel_ulong_t rlim_cur; __kernel_ulong_t rlim_max; } ;
11 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; unsigned long state; int start_pid; void *start_site; char start_comm[16U]; } ;
132 struct hrtimer_clock_base { struct hrtimer_cpu_base *cpu_base; int index; clockid_t clockid; struct timerqueue_head active; ktime_t resolution; ktime_t (*get_time)(); ktime_t softirq_time; ktime_t offset; } ;
163 struct hrtimer_cpu_base { raw_spinlock_t lock; unsigned int cpu; unsigned int active_bases; unsigned int clock_was_set; ktime_t expires_next; int hres_active; int hang_detected; unsigned long nr_events; unsigned long nr_retries; unsigned long nr_hangs; ktime_t max_hang_time; struct hrtimer_clock_base clock_base[4U]; } ;
451 struct task_io_accounting { u64 rchar; u64 wchar; u64 syscr; u64 syscw; u64 read_bytes; u64 write_bytes; u64 cancelled_write_bytes; } ;
45 struct latency_record { unsigned long backtrace[12U]; unsigned int count; unsigned long time; unsigned long max; } ;
836 struct nsproxy ;
191 struct assoc_array_ptr ;
191 struct assoc_array { struct assoc_array_ptr *root; unsigned long nr_leaves_on_tree; } ;
31 typedef int32_t key_serial_t;
34 typedef uint32_t key_perm_t;
35 struct key ;
36 struct signal_struct ;
37 struct key_type ;
41 struct keyring_index_key { struct key_type *type; const char *description; size_t desc_len; } ;
123 union __anonunion_ldv_25560_186 { struct list_head graveyard_link; struct rb_node serial_node; } ;
123 struct key_user ;
123 union __anonunion_ldv_25568_187 { time_t expiry; time_t revoked_at; } ;
123 struct __anonstruct_ldv_25581_189 { struct key_type *type; char *description; } ;
123 union __anonunion_ldv_25582_188 { struct keyring_index_key index_key; struct __anonstruct_ldv_25581_189 ldv_25581; } ;
123 union __anonunion_type_data_190 { struct list_head link; unsigned long x[2U]; void *p[2U]; int reject_error; } ;
123 union __anonunion_payload_192 { unsigned long value; void *rcudata; void *data; void *data2[2U]; } ;
123 union __anonunion_ldv_25597_191 { union __anonunion_payload_192 payload; struct assoc_array keys; } ;
123 struct key { atomic_t usage; key_serial_t serial; union __anonunion_ldv_25560_186 ldv_25560; struct rw_semaphore sem; struct key_user *user; void *security; union __anonunion_ldv_25568_187 ldv_25568; 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_ldv_25582_188 ldv_25582; union __anonunion_type_data_190 type_data; union __anonunion_ldv_25597_191 ldv_25597; } ;
358 struct audit_context ;
27 struct group_info { atomic_t usage; int ngroups; int nblocks; kgid_t small_block[32U]; kgid_t *blocks[0U]; } ;
78 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; 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; } ;
126 struct futex_pi_state ;
127 struct robust_list_head ;
128 struct bio_list ;
129 struct fs_struct ;
130 struct perf_event_context ;
131 struct blk_plug ;
180 struct cfs_rq ;
181 struct task_group ;
426 struct sighand_struct { atomic_t count; struct k_sigaction action[64U]; spinlock_t siglock; wait_queue_head_t signalfd_wqh; } ;
465 struct pacct_struct { int ac_flag; long ac_exitcode; unsigned long ac_mem; cputime_t ac_utime; cputime_t ac_stime; unsigned long ac_minflt; unsigned long ac_majflt; } ;
473 struct cpu_itimer { cputime_t expires; cputime_t incr; u32 error; u32 incr_error; } ;
480 struct cputime { cputime_t utime; cputime_t stime; } ;
492 struct task_cputime { cputime_t utime; cputime_t stime; unsigned long long sum_exec_runtime; } ;
512 struct thread_group_cputimer { struct task_cputime cputime; int running; raw_spinlock_t lock; } ;
554 struct autogroup ;
555 struct tty_struct ;
555 struct taskstats ;
555 struct tty_audit_buf ;
555 struct signal_struct { atomic_t sigcnt; atomic_t live; int nr_threads; struct list_head thread_head; wait_queue_head_t wait_chldexit; struct task_struct *curr_target; struct sigpending shared_pending; int group_exit_code; int notify_count; struct task_struct *group_exit_task; int group_stop_count; unsigned int flags; unsigned char is_child_subreaper; unsigned char has_child_subreaper; int posix_timer_id; struct list_head posix_timers; struct hrtimer real_timer; struct pid *leader_pid; ktime_t it_real_incr; struct cpu_itimer it[2U]; struct thread_group_cputimer cputimer; struct task_cputime cputime_expires; struct list_head cpu_timers[3U]; struct pid *tty_old_pgrp; int leader; struct tty_struct *tty; struct autogroup *autogroup; cputime_t utime; cputime_t stime; cputime_t cutime; cputime_t cstime; cputime_t gtime; cputime_t cgtime; struct cputime prev_cputime; unsigned long nvcsw; unsigned long nivcsw; unsigned long cnvcsw; unsigned long cnivcsw; unsigned long min_flt; unsigned long maj_flt; unsigned long cmin_flt; unsigned long cmaj_flt; unsigned long inblock; unsigned long oublock; unsigned long cinblock; unsigned long coublock; unsigned long maxrss; unsigned long cmaxrss; struct task_io_accounting ioac; unsigned long long sum_sched_runtime; struct rlimit rlim[16U]; struct pacct_struct pacct; struct taskstats *stats; unsigned int audit_tty; unsigned int audit_tty_log_passwd; struct tty_audit_buf *tty_audit_buf; struct rw_semaphore group_rwsem; oom_flags_t oom_flags; short oom_score_adj; short oom_score_adj_min; struct mutex cred_guard_mutex; } ;
735 struct user_struct { atomic_t __count; atomic_t processes; atomic_t sigpending; atomic_t inotify_watches; atomic_t inotify_devs; atomic_t fanotify_listeners; atomic_long_t epoll_watches; unsigned long mq_bytes; unsigned long locked_shm; struct key *uid_keyring; struct key *session_keyring; struct hlist_node uidhash_node; kuid_t uid; atomic_long_t locked_vm; } ;
778 struct reclaim_state ;
779 struct sched_info { unsigned long pcount; unsigned long long run_delay; unsigned long long last_arrival; unsigned long long last_queued; } ;
794 struct task_delay_info { spinlock_t lock; unsigned int flags; u64 blkio_start; u64 blkio_delay; u64 swapin_delay; u32 blkio_count; u32 swapin_count; u64 freepages_start; u64 freepages_delay; u32 freepages_count; } ;
1061 struct load_weight { unsigned long weight; u32 inv_weight; } ;
1069 struct sched_avg { u32 runnable_avg_sum; u32 runnable_avg_period; u64 last_runnable_update; s64 decay_count; unsigned long load_avg_contrib; } ;
1081 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; } ;
1116 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; } ;
1148 struct rt_rq ;
1148 struct sched_rt_entity { struct list_head run_list; unsigned long timeout; unsigned long watchdog_stamp; unsigned int time_slice; struct sched_rt_entity *back; struct sched_rt_entity *parent; struct rt_rq *rt_rq; struct rt_rq *my_q; } ;
1164 struct sched_dl_entity { struct rb_node rb_node; u64 dl_runtime; u64 dl_deadline; u64 dl_period; u64 dl_bw; s64 runtime; u64 deadline; unsigned int flags; int dl_throttled; int dl_new; int dl_boosted; int dl_yielded; struct hrtimer dl_timer; } ;
1222 struct memcg_oom_info { struct mem_cgroup *memcg; gfp_t gfp_mask; int order; unsigned char may_oom; } ;
1639 struct sched_class ;
1639 struct files_struct ;
1639 struct css_set ;
1639 struct compat_robust_list_head ;
1639 struct numa_group ;
1639 struct task_struct { volatile long state; void *stack; atomic_t usage; unsigned int flags; unsigned int ptrace; struct llist_node wake_entry; int on_cpu; struct task_struct *last_wakee; unsigned long wakee_flips; unsigned long wakee_flip_decay_ts; 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; 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; unsigned char brk_randomized; u32 vmacache_seqnum; struct vm_area_struct *vmacache[4U]; struct task_rss_stat rss_stat; int exit_state; int exit_code; int exit_signal; int pdeath_signal; unsigned int jobctl; unsigned int personality; unsigned char in_execve; unsigned char in_iowait; unsigned char sched_reset_on_fork; unsigned char sched_contributes_to_load; unsigned long atomic_flags; 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; cputime_t utime; cputime_t stime; cputime_t utimescaled; cputime_t stimescaled; cputime_t gtime; struct 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 *real_cred; const struct cred *cred; char comm[16U]; int link_count; int total_link_count; struct sysv_sem sysvsem; struct sysv_shm sysvshm; unsigned long last_switch_count; struct thread_struct thread; 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; int (*notifier)(void *); void *notifier_data; sigset_t *notifier_mask; 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 rb_root pi_waiters; struct rb_node *pi_waiters_leftmost; 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; 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; cputime_t 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; 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_next; 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_memory; unsigned long total_numa_faults; unsigned long *numa_faults_buffer_memory; unsigned long *numa_faults_cpu; unsigned long *numa_faults_buffer_cpu; unsigned long numa_faults_locality[2U]; unsigned long numa_pages_migrated; struct callback_head rcu; struct pipe_inode_info *splice_pipe; struct page_frag task_frag; struct task_delay_info *delays; int make_it_fail; int nr_dirtied; int nr_dirtied_pause; unsigned long dirty_paused_when; int latency_record_count; struct latency_record latency_record[32U]; unsigned long timer_slack_ns; unsigned long default_timer_slack_ns; unsigned long trace; unsigned long trace_recursion; unsigned int memcg_kmem_skip_account; struct memcg_oom_info memcg_oom; struct uprobe_task *utask; unsigned int sequential_io; unsigned int sequential_io_avg; } ;
30 typedef u32 phandle;
32 struct property { char *name; int length; void *value; struct property *next; unsigned long _flags; unsigned int unique_id; struct bin_attribute attr; } ;
42 struct device_node { const char *name; const char *type; phandle phandle; const char *full_name; struct property *properties; struct property *deadprops; struct device_node *parent; struct device_node *child; struct device_node *sibling; struct device_node *next; struct device_node *allnext; struct kobject kobj; unsigned long _flags; void *data; } ;
825 struct i2c_msg { __u16 addr; __u16 flags; __u16 len; __u8 *buf; } ;
82 union i2c_smbus_data { __u8 byte; __u16 word; __u8 block[34U]; } ;
39 struct i2c_algorithm ;
40 struct i2c_adapter ;
41 struct i2c_client ;
43 struct i2c_board_info ;
198 struct i2c_client { unsigned short flags; unsigned short addr; char name[20U]; struct i2c_adapter *adapter; struct device dev; int irq; struct list_head detected; } ;
248 struct i2c_board_info { char type[20U]; unsigned short flags; unsigned short addr; void *platform_data; struct dev_archdata *archdata; struct device_node *of_node; struct acpi_dev_node acpi_node; int irq; } ;
335 struct i2c_algorithm { int (*master_xfer)(struct i2c_adapter *, struct i2c_msg *, int); int (*smbus_xfer)(struct i2c_adapter *, u16 , unsigned short, char, u8 , int, union i2c_smbus_data *); u32 (*functionality)(struct i2c_adapter *); } ;
381 struct i2c_bus_recovery_info { int (*recover_bus)(struct i2c_adapter *); int (*get_scl)(struct i2c_adapter *); void (*set_scl)(struct i2c_adapter *, int); int (*get_sda)(struct i2c_adapter *); void (*prepare_recovery)(struct i2c_bus_recovery_info *); void (*unprepare_recovery)(struct i2c_bus_recovery_info *); int scl_gpio; int sda_gpio; } ;
420 struct i2c_adapter { struct module *owner; unsigned int class; const struct i2c_algorithm *algo; void *algo_data; struct rt_mutex bus_lock; int timeout; int retries; struct device dev; int nr; char name[48U]; struct completion dev_released; struct mutex userspace_clients_lock; struct list_head userspace_clients; struct i2c_bus_recovery_info *bus_recovery_info; } ;
584 enum irqreturn { IRQ_NONE = 0, IRQ_HANDLED = 1, IRQ_WAKE_THREAD = 2 } ;
16 typedef enum irqreturn irqreturn_t;
62 struct exception_table_entry { int insn; int fixup; } ;
663 struct mfd_cell ;
664 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; } ;
173 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; } ;
279 struct v4l2_edid { __u32 pad; __u32 start_block; __u32 blocks; __u32 reserved[5U]; __u8 *edid; } ;
556 enum v4l2_field { V4L2_FIELD_ANY = 0, V4L2_FIELD_NONE = 1, V4L2_FIELD_TOP = 2, V4L2_FIELD_BOTTOM = 3, V4L2_FIELD_INTERLACED = 4, V4L2_FIELD_SEQ_TB = 5, V4L2_FIELD_SEQ_BT = 6, V4L2_FIELD_ALTERNATE = 7, V4L2_FIELD_INTERLACED_TB = 8, V4L2_FIELD_INTERLACED_BT = 9 } ;
569 enum v4l2_buf_type { V4L2_BUF_TYPE_VIDEO_CAPTURE = 1, V4L2_BUF_TYPE_VIDEO_OUTPUT = 2, V4L2_BUF_TYPE_VIDEO_OVERLAY = 3, V4L2_BUF_TYPE_VBI_CAPTURE = 4, V4L2_BUF_TYPE_VBI_OUTPUT = 5, V4L2_BUF_TYPE_SLICED_VBI_CAPTURE = 6, V4L2_BUF_TYPE_SLICED_VBI_OUTPUT = 7, V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY = 8, V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE = 9, V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE = 10, V4L2_BUF_TYPE_SDR_CAPTURE = 11, V4L2_BUF_TYPE_PRIVATE = 128 } ;
592 enum v4l2_memory { V4L2_MEMORY_MMAP = 1, V4L2_MEMORY_USERPTR = 2, V4L2_MEMORY_OVERLAY = 3, V4L2_MEMORY_DMABUF = 4 } ;
610 enum v4l2_priority { V4L2_PRIORITY_UNSET = 0, V4L2_PRIORITY_BACKGROUND = 1, V4L2_PRIORITY_INTERACTIVE = 2, V4L2_PRIORITY_RECORD = 3, V4L2_PRIORITY_DEFAULT = 2 } ;
618 struct v4l2_rect { __s32 left; __s32 top; __u32 width; __u32 height; } ;
220 struct v4l2_fract { __u32 numerator; __u32 denominator; } ;
225 struct v4l2_capability { __u8 driver[16U]; __u8 card[32U]; __u8 bus_info[32U]; __u32 version; __u32 capabilities; __u32 device_caps; __u32 reserved[3U]; } ;
246 struct v4l2_pix_format { __u32 width; __u32 height; __u32 pixelformat; __u32 field; __u32 bytesperline; __u32 sizeimage; __u32 colorspace; __u32 priv; __u32 flags; } ;
297 struct v4l2_fmtdesc { __u32 index; __u32 type; __u32 flags; __u8 description[32U]; __u32 pixelformat; __u32 reserved[4U]; } ;
483 struct v4l2_frmsize_discrete { __u32 width; __u32 height; } ;
496 struct v4l2_frmsize_stepwise { __u32 min_width; __u32 max_width; __u32 step_width; __u32 min_height; __u32 max_height; __u32 step_height; } ;
505 union __anonunion_ldv_30292_196 { struct v4l2_frmsize_discrete discrete; struct v4l2_frmsize_stepwise stepwise; } ;
505 struct v4l2_frmsizeenum { __u32 index; __u32 pixel_format; __u32 type; union __anonunion_ldv_30292_196 ldv_30292; __u32 reserved[2U]; } ;
524 struct v4l2_frmival_stepwise { struct v4l2_fract min; struct v4l2_fract max; struct v4l2_fract step; } ;
533 union __anonunion_ldv_30311_197 { struct v4l2_fract discrete; struct v4l2_frmival_stepwise stepwise; } ;
533 struct v4l2_frmivalenum { __u32 index; __u32 pixel_format; __u32 width; __u32 height; __u32 type; union __anonunion_ldv_30311_197 ldv_30311; __u32 reserved[2U]; } ;
548 struct v4l2_timecode { __u32 type; __u32 flags; __u8 frames; __u8 seconds; __u8 minutes; __u8 hours; __u8 userbits[4U]; } ;
562 struct v4l2_jpegcompression { int quality; int APPn; int APP_len; char APP_data[60U]; int COM_len; char COM_data[60U]; __u32 jpeg_markers; } ;
591 struct v4l2_requestbuffers { __u32 count; __u32 type; __u32 memory; __u32 reserved[2U]; } ;
616 union __anonunion_m_198 { __u32 mem_offset; unsigned long userptr; __s32 fd; } ;
616 struct v4l2_plane { __u32 bytesused; __u32 length; union __anonunion_m_198 m; __u32 data_offset; __u32 reserved[11U]; } ;
648 union __anonunion_m_199 { __u32 offset; unsigned long userptr; struct v4l2_plane *planes; __s32 fd; } ;
648 struct v4l2_buffer { __u32 index; __u32 type; __u32 bytesused; __u32 flags; __u32 field; struct timeval timestamp; struct v4l2_timecode timecode; __u32 sequence; __u32 memory; union __anonunion_m_199 m; __u32 length; __u32 reserved2; __u32 reserved; } ;
701 struct v4l2_exportbuffer { __u32 type; __u32 index; __u32 plane; __u32 flags; __s32 fd; __u32 reserved[11U]; } ;
760 struct __anonstruct_fmt_200 { __u32 width; __u32 height; __u32 pixelformat; __u32 field; __u32 bytesperline; __u32 sizeimage; __u32 colorspace; __u32 priv; } ;
760 struct v4l2_framebuffer { __u32 capability; __u32 flags; void *base; struct __anonstruct_fmt_200 fmt; } ;
781 struct v4l2_clip { struct v4l2_rect c; struct v4l2_clip *next; } ;
803 struct v4l2_window { struct v4l2_rect w; __u32 field; __u32 chromakey; struct v4l2_clip *clips; __u32 clipcount; void *bitmap; __u8 global_alpha; } ;
813 struct v4l2_captureparm { __u32 capability; __u32 capturemode; struct v4l2_fract timeperframe; __u32 extendedmode; __u32 readbuffers; __u32 reserved[4U]; } ;
825 struct v4l2_outputparm { __u32 capability; __u32 outputmode; struct v4l2_fract timeperframe; __u32 extendedmode; __u32 writebuffers; __u32 reserved[4U]; } ;
838 struct v4l2_cropcap { __u32 type; struct v4l2_rect bounds; struct v4l2_rect defrect; struct v4l2_fract pixelaspect; } ;
848 struct v4l2_crop { __u32 type; struct v4l2_rect c; } ;
853 struct v4l2_selection { __u32 type; __u32 target; __u32 flags; struct v4l2_rect r; __u32 reserved[9U]; } ;
880 typedef __u64 v4l2_std_id;
1016 struct v4l2_bt_timings { __u32 width; __u32 height; __u32 interlaced; __u32 polarities; __u64 pixelclock; __u32 hfrontporch; __u32 hsync; __u32 hbackporch; __u32 vfrontporch; __u32 vsync; __u32 vbackporch; __u32 il_vfrontporch; __u32 il_vsync; __u32 il_vbackporch; __u32 standards; __u32 flags; __u32 reserved[14U]; } ;
1072 union __anonunion_ldv_30453_201 { struct v4l2_bt_timings bt; __u32 reserved[32U]; } ;
1072 struct v4l2_dv_timings { __u32 type; union __anonunion_ldv_30453_201 ldv_30453; } ;
1134 struct v4l2_enum_dv_timings { __u32 index; __u32 pad; __u32 reserved[2U]; struct v4l2_dv_timings timings; } ;
1152 struct v4l2_bt_timings_cap { __u32 min_width; __u32 max_width; __u32 min_height; __u32 max_height; __u64 min_pixelclock; __u64 max_pixelclock; __u32 standards; __u32 capabilities; __u32 reserved[16U]; } ;
1175 union __anonunion_ldv_30476_202 { struct v4l2_bt_timings_cap bt; __u32 raw_data[32U]; } ;
1175 struct v4l2_dv_timings_cap { __u32 type; __u32 pad; __u32 reserved[2U]; union __anonunion_ldv_30476_202 ldv_30476; } ;
1200 struct v4l2_input { __u32 index; __u8 name[32U]; __u32 type; __u32 audioset; __u32 tuner; v4l2_std_id std; __u32 status; __u32 capabilities; __u32 reserved[3U]; } ;
1216 struct v4l2_output { __u32 index; __u8 name[32U]; __u32 type; __u32 audioset; __u32 modulator; v4l2_std_id std; __u32 capabilities; __u32 reserved[3U]; } ;
1263 struct v4l2_control { __u32 id; __s32 value; } ;
1280 union __anonunion_ldv_30511_203 { __s32 value; __s64 value64; char *string; __u8 *p_u8; __u16 *p_u16; __u32 *p_u32; void *ptr; } ;
1280 struct v4l2_ext_control { __u32 id; __u32 size; __u32 reserved2[1U]; union __anonunion_ldv_30511_203 ldv_30511; } ;
1295 struct v4l2_ext_controls { __u32 ctrl_class; __u32 count; __u32 error_idx; __u32 reserved[2U]; struct v4l2_ext_control *controls; } ;
1319 struct v4l2_queryctrl { __u32 id; __u32 type; __u8 name[32U]; __s32 minimum; __s32 maximum; __s32 step; __s32 default_value; __u32 flags; __u32 reserved[2U]; } ;
1339 struct v4l2_query_ext_ctrl { __u32 id; __u32 type; char name[32U]; __s64 minimum; __s64 maximum; __u64 step; __s64 default_value; __u32 flags; __u32 elem_size; __u32 elems; __u32 nr_of_dims; __u32 dims[4U]; __u32 reserved[32U]; } ;
1356 union __anonunion_ldv_30562_204 { __u8 name[32U]; __s64 value; } ;
1356 struct v4l2_querymenu { __u32 id; __u32 index; union __anonunion_ldv_30562_204 ldv_30562; __u32 reserved; } ;
1367 struct v4l2_tuner { __u32 index; __u8 name[32U]; __u32 type; __u32 capability; __u32 rangelow; __u32 rangehigh; __u32 rxsubchans; __u32 audmode; __s32 signal; __s32 afc; __u32 reserved[4U]; } ;
1405 struct v4l2_modulator { __u32 index; __u8 name[32U]; __u32 capability; __u32 rangelow; __u32 rangehigh; __u32 txsubchans; __u32 reserved[4U]; } ;
1415 struct v4l2_frequency { __u32 tuner; __u32 type; __u32 frequency; __u32 reserved[8U]; } ;
1454 struct v4l2_frequency_band { __u32 tuner; __u32 type; __u32 index; __u32 capability; __u32 rangelow; __u32 rangehigh; __u32 modulation; __u32 reserved[9U]; } ;
1469 struct v4l2_hw_freq_seek { __u32 tuner; __u32 type; __u32 seek_upward; __u32 wrap_around; __u32 spacing; __u32 rangelow; __u32 rangehigh; __u32 reserved[5U]; } ;
1490 struct v4l2_audio { __u32 index; __u8 name[32U]; __u32 capability; __u32 mode; __u32 reserved[2U]; } ;
1512 struct v4l2_audioout { __u32 index; __u8 name[32U]; __u32 capability; __u32 mode; __u32 reserved[2U]; } ;
1527 struct v4l2_enc_idx_entry { __u64 offset; __u64 pts; __u32 length; __u32 flags; __u32 reserved[2U]; } ;
1546 struct v4l2_enc_idx { __u32 entries; __u32 entries_cap; __u32 reserved[4U]; struct v4l2_enc_idx_entry entry[64U]; } ;
1554 struct __anonstruct_raw_206 { __u32 data[8U]; } ;
1554 union __anonunion_ldv_30641_205 { struct __anonstruct_raw_206 raw; } ;
1554 struct v4l2_encoder_cmd { __u32 cmd; __u32 flags; union __anonunion_ldv_30641_205 ldv_30641; } ;
1573 struct __anonstruct_stop_208 { __u64 pts; } ;
1573 struct __anonstruct_start_209 { __s32 speed; __u32 format; } ;
1573 struct __anonstruct_raw_210 { __u32 data[16U]; } ;
1573 union __anonunion_ldv_30656_207 { struct __anonstruct_stop_208 stop; struct __anonstruct_start_209 start; struct __anonstruct_raw_210 raw; } ;
1573 struct v4l2_decoder_cmd { __u32 cmd; __u32 flags; union __anonunion_ldv_30656_207 ldv_30656; } ;
1622 struct v4l2_vbi_format { __u32 sampling_rate; __u32 offset; __u32 samples_per_line; __u32 sample_format; __s32 start[2U]; __u32 count[2U]; __u32 flags; __u32 reserved[2U]; } ;
1642 struct v4l2_sliced_vbi_format { __u16 service_set; __u16 service_lines[2U][24U]; __u32 io_size; __u32 reserved[2U]; } ;
1670 struct v4l2_sliced_vbi_cap { __u16 service_set; __u16 service_lines[2U][24U]; __u32 type; __u32 reserved[3U]; } ;
1694 struct v4l2_sliced_vbi_data { __u32 id; __u32 field; __u32 line; __u32 reserved; __u8 data[48U]; } ;
1749 struct v4l2_plane_pix_format { __u32 sizeimage; __u16 bytesperline; __u16 reserved[7U]; } ;
1766 struct v4l2_pix_format_mplane { __u32 width; __u32 height; __u32 pixelformat; __u32 field; __u32 colorspace; struct v4l2_plane_pix_format plane_fmt[8U]; __u8 num_planes; __u8 flags; __u8 reserved[10U]; } ;
1790 struct v4l2_sdr_format { __u32 pixelformat; __u32 buffersize; __u8 reserved[24U]; } ;
1801 union __anonunion_fmt_212 { struct v4l2_pix_format pix; struct v4l2_pix_format_mplane pix_mp; struct v4l2_window win; struct v4l2_vbi_format vbi; struct v4l2_sliced_vbi_format sliced; struct v4l2_sdr_format sdr; __u8 raw_data[200U]; } ;
1801 struct v4l2_format { __u32 type; union __anonunion_fmt_212 fmt; } ;
1824 union __anonunion_parm_213 { struct v4l2_captureparm capture; struct v4l2_outputparm output; __u8 raw_data[200U]; } ;
1824 struct v4l2_streamparm { __u32 type; union __anonunion_parm_213 parm; } ;
1915 struct v4l2_event_subscription { __u32 type; __u32 id; __u32 flags; __u32 reserved[5U]; } ;
1925 union __anonunion_ldv_30778_216 { __u32 addr; char name[32U]; } ;
1925 struct v4l2_dbg_match { __u32 type; union __anonunion_ldv_30778_216 ldv_30778; } ;
1951 struct v4l2_dbg_register { struct v4l2_dbg_match match; __u32 size; __u64 reg; __u64 val; } ;
1958 struct v4l2_dbg_chip_info { struct v4l2_dbg_match match; char name[32U]; __u32 flags; __u32 reserved[32U]; } ;
1969 struct v4l2_create_buffers { __u32 index; __u32 count; __u32 memory; struct v4l2_format format; __u32 reserved[8U]; } ;
15 typedef __u64 Elf64_Addr;
16 typedef __u16 Elf64_Half;
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;
48 struct kernel_param ;
53 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 *); } ;
58 struct kparam_string ;
58 struct kparam_array ;
58 union __anonunion_ldv_31168_221 { void *arg; const struct kparam_string *str; const struct kparam_array *arr; } ;
58 struct kernel_param { const char *name; const struct kernel_param_ops *ops; u16 perm; s16 level; union __anonunion_ldv_31168_221 ldv_31168; } ;
70 struct kparam_string { unsigned int maxlen; char *string; } ;
76 struct kparam_array { unsigned int max; unsigned int elemsize; unsigned int *num; const struct kernel_param_ops *ops; void *elem; } ;
466 struct mod_arch_specific { } ;
36 struct module_param_attrs ;
36 struct module_kobject { struct kobject kobj; struct module *mod; struct kobject *drivers_dir; struct module_param_attrs *mp; struct completion *kobj_completion; } ;
46 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 *); } ;
205 enum module_state { MODULE_STATE_LIVE = 0, MODULE_STATE_COMING = 1, MODULE_STATE_GOING = 2, MODULE_STATE_UNFORMED = 3 } ;
212 struct module_ref { unsigned long incs; unsigned long decs; } ;
226 struct module_sect_attrs ;
226 struct module_notes_attrs ;
226 struct tracepoint ;
226 struct ftrace_event_call ;
226 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 unsigned long *crcs; unsigned int num_syms; struct kernel_param *kp; unsigned int num_kp; unsigned int num_gpl_syms; const struct kernel_symbol *gpl_syms; const unsigned long *gpl_crcs; const struct kernel_symbol *unused_syms; const unsigned long *unused_crcs; unsigned int num_unused_syms; unsigned int num_unused_gpl_syms; const struct kernel_symbol *unused_gpl_syms; const unsigned long *unused_gpl_crcs; bool sig_ok; const struct kernel_symbol *gpl_future_syms; const unsigned long *gpl_future_crcs; unsigned int num_gpl_future_syms; unsigned int num_exentries; struct exception_table_entry *extable; int (*init)(); void *module_init; void *module_core; unsigned int init_size; unsigned int core_size; unsigned int init_text_size; unsigned int core_text_size; unsigned int init_ro_size; unsigned int core_ro_size; struct mod_arch_specific arch; unsigned int taints; unsigned int num_bugs; struct list_head bug_list; struct bug_entry *bug_table; Elf64_Sym *symtab; Elf64_Sym *core_symtab; unsigned int num_symtab; unsigned int core_num_syms; char *strtab; char *core_strtab; 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 ftrace_event_call **trace_events; unsigned int num_trace_events; struct list_head source_list; struct list_head target_list; void (*exit)(); struct module_ref *refptr; ctor_fn_t (**ctors)(); unsigned int num_ctors; } ;
655 enum sh_vou_bus_fmt { SH_VOU_BUS_8BIT = 0, SH_VOU_BUS_16BIT = 1, SH_VOU_BUS_BT656 = 2 } ;
661 struct sh_vou_pdata { enum sh_vou_bus_fmt bus_fmt; int i2c_adap; struct i2c_board_info *board_info; unsigned long flags; } ;
32 struct poll_table_struct { void (*_qproc)(struct file *, wait_queue_head_t *, struct poll_table_struct *); unsigned long _key; } ;
40 typedef struct poll_table_struct poll_table;
163 struct cdev { struct kobject kobj; struct module *owner; const struct file_operations *ops; struct list_head list; dev_t dev; unsigned int count; } ;
129 struct media_pipeline { } ;
132 struct media_pad ;
132 struct media_link { struct media_pad *source; struct media_pad *sink; struct media_link *reverse; unsigned long flags; } ;
40 struct media_entity ;
40 struct media_pad { struct media_entity *entity; u16 index; unsigned long flags; } ;
46 struct media_entity_operations { int (*link_setup)(struct media_entity *, const struct media_pad *, const struct media_pad *, u32 ); int (*link_validate)(struct media_link *); } ;
53 struct media_device ;
53 struct __anonstruct_v4l_228 { u32 major; u32 minor; } ;
53 struct __anonstruct_fb_229 { u32 major; u32 minor; } ;
53 struct __anonstruct_alsa_230 { u32 card; u32 device; u32 subdevice; } ;
53 union __anonunion_info_227 { struct __anonstruct_v4l_228 v4l; struct __anonstruct_fb_229 fb; struct __anonstruct_alsa_230 alsa; int dvb; } ;
53 struct media_entity { struct list_head list; struct media_device *parent; u32 id; const char *name; u32 type; u32 revision; unsigned long flags; u32 group_id; u16 num_pads; u16 num_links; u16 num_backlinks; u16 max_links; struct media_pad *pads; struct media_link *links; const struct media_entity_operations *ops; int stream_count; int use_count; struct media_pipeline *pipe; union __anonunion_info_227 info; } ;
156 struct video_device ;
157 struct v4l2_device ;
158 struct v4l2_ctrl_handler ;
159 struct v4l2_prio_state { atomic_t prios[4U]; } ;
61 struct v4l2_file_operations { struct module *owner; ssize_t (*read)(struct file *, char *, size_t , loff_t *); ssize_t (*write)(struct file *, const char *, size_t , loff_t *); unsigned int (*poll)(struct file *, struct poll_table_struct *); long int (*ioctl)(struct file *, unsigned int, unsigned long); long int (*unlocked_ioctl)(struct file *, unsigned int, unsigned long); long int (*compat_ioctl32)(struct file *, unsigned int, unsigned long); unsigned long int (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long); int (*mmap)(struct file *, struct vm_area_struct *); int (*open)(struct file *); int (*release)(struct file *); } ;
79 struct vb2_queue ;
79 struct v4l2_ioctl_ops ;
79 struct video_device { struct media_entity entity; const struct v4l2_file_operations *fops; struct device dev; struct cdev *cdev; struct v4l2_device *v4l2_dev; struct device *dev_parent; struct v4l2_ctrl_handler *ctrl_handler; struct vb2_queue *queue; struct v4l2_prio_state *prio; char name[32U]; int vfl_type; int vfl_dir; int minor; u16 num; unsigned long flags; int index; spinlock_t fh_lock; struct list_head fh_list; int debug; v4l2_std_id tvnorms; void (*release)(struct video_device *); const struct v4l2_ioctl_ops *ioctl_ops; unsigned long valid_ioctls[3U]; unsigned long disable_locking[3U]; struct mutex *lock; } ;
101 struct v4l2_subdev ;
102 struct v4l2_subdev_ops ;
162 struct v4l2_priv_tun_config { int tuner; void *priv; } ;
206 struct media_file_operations { struct module *owner; ssize_t (*read)(struct file *, char *, size_t , loff_t *); ssize_t (*write)(struct file *, const char *, size_t , loff_t *); unsigned int (*poll)(struct file *, struct poll_table_struct *); long int (*ioctl)(struct file *, unsigned int, unsigned long); long int (*compat_ioctl)(struct file *, unsigned int, unsigned long); int (*open)(struct file *); int (*release)(struct file *); } ;
53 struct media_devnode { const struct media_file_operations *fops; struct device dev; struct cdev cdev; struct device *parent; int minor; unsigned long flags; void (*release)(struct media_devnode *); } ;
98 struct media_device { struct device *dev; struct media_devnode devnode; char model[32U]; char serial[40U]; char bus_info[32U]; u32 hw_revision; u32 driver_version; u32 entity_id; struct list_head entities; spinlock_t lock; struct mutex graph_mutex; int (*link_notify)(struct media_link *, u32 , unsigned int); } ;
98 enum v4l2_mbus_pixelcode { V4L2_MBUS_FMT_FIXED = 1, V4L2_MBUS_FMT_RGB444_2X8_PADHI_BE = 4097, V4L2_MBUS_FMT_RGB444_2X8_PADHI_LE = 4098, V4L2_MBUS_FMT_RGB555_2X8_PADHI_BE = 4099, V4L2_MBUS_FMT_RGB555_2X8_PADHI_LE = 4100, V4L2_MBUS_FMT_BGR565_2X8_BE = 4101, V4L2_MBUS_FMT_BGR565_2X8_LE = 4102, V4L2_MBUS_FMT_RGB565_2X8_BE = 4103, V4L2_MBUS_FMT_RGB565_2X8_LE = 4104, V4L2_MBUS_FMT_RGB666_1X18 = 4105, V4L2_MBUS_FMT_RGB888_1X24 = 4106, V4L2_MBUS_FMT_RGB888_2X12_BE = 4107, V4L2_MBUS_FMT_RGB888_2X12_LE = 4108, V4L2_MBUS_FMT_ARGB8888_1X32 = 4109, V4L2_MBUS_FMT_Y8_1X8 = 8193, V4L2_MBUS_FMT_UV8_1X8 = 8213, V4L2_MBUS_FMT_UYVY8_1_5X8 = 8194, V4L2_MBUS_FMT_VYUY8_1_5X8 = 8195, V4L2_MBUS_FMT_YUYV8_1_5X8 = 8196, V4L2_MBUS_FMT_YVYU8_1_5X8 = 8197, V4L2_MBUS_FMT_UYVY8_2X8 = 8198, V4L2_MBUS_FMT_VYUY8_2X8 = 8199, V4L2_MBUS_FMT_YUYV8_2X8 = 8200, V4L2_MBUS_FMT_YVYU8_2X8 = 8201, V4L2_MBUS_FMT_Y10_1X10 = 8202, V4L2_MBUS_FMT_UYVY10_2X10 = 8216, V4L2_MBUS_FMT_VYUY10_2X10 = 8217, V4L2_MBUS_FMT_YUYV10_2X10 = 8203, V4L2_MBUS_FMT_YVYU10_2X10 = 8204, V4L2_MBUS_FMT_Y12_1X12 = 8211, V4L2_MBUS_FMT_UYVY8_1X16 = 8207, V4L2_MBUS_FMT_VYUY8_1X16 = 8208, V4L2_MBUS_FMT_YUYV8_1X16 = 8209, V4L2_MBUS_FMT_YVYU8_1X16 = 8210, V4L2_MBUS_FMT_YDYUYDYV8_1X16 = 8212, V4L2_MBUS_FMT_UYVY10_1X20 = 8218, V4L2_MBUS_FMT_VYUY10_1X20 = 8219, V4L2_MBUS_FMT_YUYV10_1X20 = 8205, V4L2_MBUS_FMT_YVYU10_1X20 = 8206, V4L2_MBUS_FMT_YUV10_1X30 = 8214, V4L2_MBUS_FMT_AYUV8_1X32 = 8215, V4L2_MBUS_FMT_UYVY12_2X12 = 8220, V4L2_MBUS_FMT_VYUY12_2X12 = 8221, V4L2_MBUS_FMT_YUYV12_2X12 = 8222, V4L2_MBUS_FMT_YVYU12_2X12 = 8223, V4L2_MBUS_FMT_UYVY12_1X24 = 8224, V4L2_MBUS_FMT_VYUY12_1X24 = 8225, V4L2_MBUS_FMT_YUYV12_1X24 = 8226, V4L2_MBUS_FMT_YVYU12_1X24 = 8227, V4L2_MBUS_FMT_SBGGR8_1X8 = 12289, V4L2_MBUS_FMT_SGBRG8_1X8 = 12307, V4L2_MBUS_FMT_SGRBG8_1X8 = 12290, V4L2_MBUS_FMT_SRGGB8_1X8 = 12308, V4L2_MBUS_FMT_SBGGR10_ALAW8_1X8 = 12309, V4L2_MBUS_FMT_SGBRG10_ALAW8_1X8 = 12310, V4L2_MBUS_FMT_SGRBG10_ALAW8_1X8 = 12311, V4L2_MBUS_FMT_SRGGB10_ALAW8_1X8 = 12312, V4L2_MBUS_FMT_SBGGR10_DPCM8_1X8 = 12299, V4L2_MBUS_FMT_SGBRG10_DPCM8_1X8 = 12300, V4L2_MBUS_FMT_SGRBG10_DPCM8_1X8 = 12297, V4L2_MBUS_FMT_SRGGB10_DPCM8_1X8 = 12301, V4L2_MBUS_FMT_SBGGR10_2X8_PADHI_BE = 12291, V4L2_MBUS_FMT_SBGGR10_2X8_PADHI_LE = 12292, V4L2_MBUS_FMT_SBGGR10_2X8_PADLO_BE = 12293, V4L2_MBUS_FMT_SBGGR10_2X8_PADLO_LE = 12294, V4L2_MBUS_FMT_SBGGR10_1X10 = 12295, V4L2_MBUS_FMT_SGBRG10_1X10 = 12302, V4L2_MBUS_FMT_SGRBG10_1X10 = 12298, V4L2_MBUS_FMT_SRGGB10_1X10 = 12303, V4L2_MBUS_FMT_SBGGR12_1X12 = 12296, V4L2_MBUS_FMT_SGBRG12_1X12 = 12304, V4L2_MBUS_FMT_SGRBG12_1X12 = 12305, V4L2_MBUS_FMT_SRGGB12_1X12 = 12306, V4L2_MBUS_FMT_JPEG_1X8 = 16385, V4L2_MBUS_FMT_S5C_UYVY_JPEG_1X8 = 20481, V4L2_MBUS_FMT_AHSV8888_1X32 = 24577 } ;
177 struct v4l2_mbus_framefmt { __u32 width; __u32 height; __u32 code; __u32 field; __u32 colorspace; __u32 reserved[7U]; } ;
151 struct v4l2_subdev_format { __u32 which; __u32 pad; struct v4l2_mbus_framefmt format; __u32 reserved[8U]; } ;
53 struct v4l2_subdev_crop { __u32 which; __u32 pad; struct v4l2_rect rect; __u32 reserved[8U]; } ;
66 struct v4l2_subdev_mbus_code_enum { __u32 pad; __u32 index; __u32 code; __u32 reserved[9U]; } ;
79 struct v4l2_subdev_frame_size_enum { __u32 index; __u32 pad; __u32 code; __u32 min_width; __u32 max_width; __u32 min_height; __u32 max_height; __u32 reserved[9U]; } ;
96 struct v4l2_subdev_frame_interval { __u32 pad; struct v4l2_fract interval; __u32 reserved[9U]; } ;
107 struct v4l2_subdev_frame_interval_enum { __u32 index; __u32 pad; __u32 code; __u32 width; __u32 height; struct v4l2_fract interval; __u32 reserved[9U]; } ;
126 struct v4l2_subdev_selection { __u32 which; __u32 pad; __u32 target; __u32 flags; struct v4l2_rect r; __u32 reserved[8U]; } ;
150 struct v4l2_async_notifier ;
151 enum v4l2_async_match_type { V4L2_ASYNC_MATCH_CUSTOM = 0, V4L2_ASYNC_MATCH_DEVNAME = 1, V4L2_ASYNC_MATCH_I2C = 2, V4L2_ASYNC_MATCH_OF = 3 } ;
158 struct __anonstruct_of_233 { const struct device_node *node; } ;
158 struct __anonstruct_device_name_234 { const char *name; } ;
158 struct __anonstruct_i2c_235 { int adapter_id; unsigned short address; } ;
158 struct __anonstruct_custom_236 { bool (*match)(struct device *, struct v4l2_async_subdev *); void *priv; } ;
158 union __anonunion_match_232 { struct __anonstruct_of_233 of; struct __anonstruct_device_name_234 device_name; struct __anonstruct_i2c_235 i2c; struct __anonstruct_custom_236 custom; } ;
158 struct v4l2_async_subdev { enum v4l2_async_match_type match_type; union __anonunion_match_232 match; struct list_head list; } ;
63 struct v4l2_async_notifier { unsigned int num_subdevs; struct v4l2_async_subdev **subdevs; struct v4l2_device *v4l2_dev; struct list_head waiting; struct list_head done; struct list_head list; int (*bound)(struct v4l2_async_notifier *, struct v4l2_subdev *, struct v4l2_async_subdev *); int (*complete)(struct v4l2_async_notifier *); void (*unbind)(struct v4l2_async_notifier *, struct v4l2_subdev *, struct v4l2_async_subdev *); } ;
97 struct v4l2_m2m_ctx ;
97 struct v4l2_fh { struct list_head list; struct video_device *vdev; struct v4l2_ctrl_handler *ctrl_handler; enum v4l2_priority prio; wait_queue_head_t wait; struct list_head subscribed; struct list_head available; unsigned int navailable; u32 sequence; struct v4l2_m2m_ctx *m2m_ctx; } ;
106 enum v4l2_mbus_type { V4L2_MBUS_PARALLEL = 0, V4L2_MBUS_BT656 = 1, V4L2_MBUS_CSI2 = 2 } ;
112 struct v4l2_mbus_config { enum v4l2_mbus_type type; unsigned int flags; } ;
109 struct v4l2_subdev_fh ;
110 struct tuner_setup ;
111 struct v4l2_mbus_frame_desc ;
112 struct v4l2_decode_vbi_line { u32 is_second_field; u8 *p; u32 line; u32 type; } ;
61 struct v4l2_subdev_io_pin_config { u32 flags; u8 pin; u8 function; u8 value; u8 strength; } ;
117 struct v4l2_subdev_core_ops { int (*log_status)(struct v4l2_subdev *); int (*s_io_pin_config)(struct v4l2_subdev *, size_t , struct v4l2_subdev_io_pin_config *); int (*init)(struct v4l2_subdev *, u32 ); int (*load_fw)(struct v4l2_subdev *); int (*reset)(struct v4l2_subdev *, u32 ); int (*s_gpio)(struct v4l2_subdev *, u32 ); int (*queryctrl)(struct v4l2_subdev *, struct v4l2_queryctrl *); int (*g_ctrl)(struct v4l2_subdev *, struct v4l2_control *); int (*s_ctrl)(struct v4l2_subdev *, struct v4l2_control *); int (*g_ext_ctrls)(struct v4l2_subdev *, struct v4l2_ext_controls *); int (*s_ext_ctrls)(struct v4l2_subdev *, struct v4l2_ext_controls *); int (*try_ext_ctrls)(struct v4l2_subdev *, struct v4l2_ext_controls *); int (*querymenu)(struct v4l2_subdev *, struct v4l2_querymenu *); long int (*ioctl)(struct v4l2_subdev *, unsigned int, void *); long int (*compat_ioctl32)(struct v4l2_subdev *, unsigned int, unsigned long); int (*g_register)(struct v4l2_subdev *, struct v4l2_dbg_register *); int (*s_register)(struct v4l2_subdev *, const struct v4l2_dbg_register *); int (*s_power)(struct v4l2_subdev *, int); int (*interrupt_service_routine)(struct v4l2_subdev *, u32 , bool *); int (*subscribe_event)(struct v4l2_subdev *, struct v4l2_fh *, struct v4l2_event_subscription *); int (*unsubscribe_event)(struct v4l2_subdev *, struct v4l2_fh *, struct v4l2_event_subscription *); } ;
178 struct v4l2_subdev_tuner_ops { int (*s_radio)(struct v4l2_subdev *); int (*s_frequency)(struct v4l2_subdev *, const struct v4l2_frequency *); int (*g_frequency)(struct v4l2_subdev *, struct v4l2_frequency *); int (*enum_freq_bands)(struct v4l2_subdev *, struct v4l2_frequency_band *); int (*g_tuner)(struct v4l2_subdev *, struct v4l2_tuner *); int (*s_tuner)(struct v4l2_subdev *, const struct v4l2_tuner *); int (*g_modulator)(struct v4l2_subdev *, struct v4l2_modulator *); int (*s_modulator)(struct v4l2_subdev *, const struct v4l2_modulator *); int (*s_type_addr)(struct v4l2_subdev *, struct tuner_setup *); int (*s_config)(struct v4l2_subdev *, const struct v4l2_priv_tun_config *); } ;
205 struct v4l2_subdev_audio_ops { int (*s_clock_freq)(struct v4l2_subdev *, u32 ); int (*s_i2s_clock_freq)(struct v4l2_subdev *, u32 ); int (*s_routing)(struct v4l2_subdev *, u32 , u32 , u32 ); int (*s_stream)(struct v4l2_subdev *, int); } ;
232 struct v4l2_mbus_frame_desc_entry { u16 flags; u32 pixelcode; u32 length; } ;
253 struct v4l2_mbus_frame_desc { struct v4l2_mbus_frame_desc_entry entry[4U]; unsigned short num_entries; } ;
265 struct v4l2_subdev_video_ops { int (*s_routing)(struct v4l2_subdev *, u32 , u32 , u32 ); int (*s_crystal_freq)(struct v4l2_subdev *, u32 , u32 ); int (*g_std)(struct v4l2_subdev *, v4l2_std_id *); int (*s_std)(struct v4l2_subdev *, v4l2_std_id ); int (*s_std_output)(struct v4l2_subdev *, v4l2_std_id ); int (*g_std_output)(struct v4l2_subdev *, v4l2_std_id *); int (*querystd)(struct v4l2_subdev *, v4l2_std_id *); int (*g_tvnorms)(struct v4l2_subdev *, v4l2_std_id *); int (*g_tvnorms_output)(struct v4l2_subdev *, v4l2_std_id *); int (*g_input_status)(struct v4l2_subdev *, u32 *); int (*s_stream)(struct v4l2_subdev *, int); int (*cropcap)(struct v4l2_subdev *, struct v4l2_cropcap *); int (*g_crop)(struct v4l2_subdev *, struct v4l2_crop *); int (*s_crop)(struct v4l2_subdev *, const struct v4l2_crop *); int (*g_parm)(struct v4l2_subdev *, struct v4l2_streamparm *); int (*s_parm)(struct v4l2_subdev *, struct v4l2_streamparm *); int (*g_frame_interval)(struct v4l2_subdev *, struct v4l2_subdev_frame_interval *); int (*s_frame_interval)(struct v4l2_subdev *, struct v4l2_subdev_frame_interval *); int (*enum_framesizes)(struct v4l2_subdev *, struct v4l2_frmsizeenum *); int (*enum_frameintervals)(struct v4l2_subdev *, struct v4l2_frmivalenum *); int (*s_dv_timings)(struct v4l2_subdev *, struct v4l2_dv_timings *); int (*g_dv_timings)(struct v4l2_subdev *, struct v4l2_dv_timings *); int (*query_dv_timings)(struct v4l2_subdev *, struct v4l2_dv_timings *); int (*enum_mbus_fmt)(struct v4l2_subdev *, unsigned int, enum v4l2_mbus_pixelcode *); int (*enum_mbus_fsizes)(struct v4l2_subdev *, struct v4l2_frmsizeenum *); int (*g_mbus_fmt)(struct v4l2_subdev *, struct v4l2_mbus_framefmt *); int (*try_mbus_fmt)(struct v4l2_subdev *, struct v4l2_mbus_framefmt *); int (*s_mbus_fmt)(struct v4l2_subdev *, struct v4l2_mbus_framefmt *); int (*g_mbus_config)(struct v4l2_subdev *, struct v4l2_mbus_config *); int (*s_mbus_config)(struct v4l2_subdev *, const struct v4l2_mbus_config *); int (*s_rx_buffer)(struct v4l2_subdev *, void *, unsigned int *); } ;
359 struct v4l2_subdev_vbi_ops { int (*decode_vbi_line)(struct v4l2_subdev *, struct v4l2_decode_vbi_line *); int (*s_vbi_data)(struct v4l2_subdev *, const struct v4l2_sliced_vbi_data *); int (*g_vbi_data)(struct v4l2_subdev *, struct v4l2_sliced_vbi_data *); int (*g_sliced_vbi_cap)(struct v4l2_subdev *, struct v4l2_sliced_vbi_cap *); int (*s_raw_fmt)(struct v4l2_subdev *, struct v4l2_vbi_format *); int (*g_sliced_fmt)(struct v4l2_subdev *, struct v4l2_sliced_vbi_format *); int (*s_sliced_fmt)(struct v4l2_subdev *, struct v4l2_sliced_vbi_format *); } ;
399 struct v4l2_subdev_sensor_ops { int (*g_skip_top_lines)(struct v4l2_subdev *, u32 *); int (*g_skip_frames)(struct v4l2_subdev *, u32 *); } ;
414 enum v4l2_subdev_ir_mode { V4L2_SUBDEV_IR_MODE_PULSE_WIDTH = 0 } ;
418 struct v4l2_subdev_ir_parameters { unsigned int bytes_per_data_element; enum v4l2_subdev_ir_mode mode; bool enable; bool interrupt_enable; bool shutdown; bool modulation; u32 max_pulse_width; unsigned int carrier_freq; unsigned int duty_cycle; bool invert_level; bool invert_carrier_sense; u32 noise_filter_min_width; unsigned int carrier_range_lower; unsigned int carrier_range_upper; u32 resolution; } ;
466 struct v4l2_subdev_ir_ops { int (*rx_read)(struct v4l2_subdev *, u8 *, size_t , ssize_t *); int (*rx_g_parameters)(struct v4l2_subdev *, struct v4l2_subdev_ir_parameters *); int (*rx_s_parameters)(struct v4l2_subdev *, struct v4l2_subdev_ir_parameters *); int (*tx_write)(struct v4l2_subdev *, u8 *, size_t , ssize_t *); int (*tx_g_parameters)(struct v4l2_subdev *, struct v4l2_subdev_ir_parameters *); int (*tx_s_parameters)(struct v4l2_subdev *, struct v4l2_subdev_ir_parameters *); } ;
485 struct v4l2_subdev_pad_ops { int (*enum_mbus_code)(struct v4l2_subdev *, struct v4l2_subdev_fh *, struct v4l2_subdev_mbus_code_enum *); int (*enum_frame_size)(struct v4l2_subdev *, struct v4l2_subdev_fh *, struct v4l2_subdev_frame_size_enum *); int (*enum_frame_interval)(struct v4l2_subdev *, struct v4l2_subdev_fh *, struct v4l2_subdev_frame_interval_enum *); int (*get_fmt)(struct v4l2_subdev *, struct v4l2_subdev_fh *, struct v4l2_subdev_format *); int (*set_fmt)(struct v4l2_subdev *, struct v4l2_subdev_fh *, struct v4l2_subdev_format *); int (*set_crop)(struct v4l2_subdev *, struct v4l2_subdev_fh *, struct v4l2_subdev_crop *); int (*get_crop)(struct v4l2_subdev *, struct v4l2_subdev_fh *, struct v4l2_subdev_crop *); int (*get_selection)(struct v4l2_subdev *, struct v4l2_subdev_fh *, struct v4l2_subdev_selection *); int (*set_selection)(struct v4l2_subdev *, struct v4l2_subdev_fh *, struct v4l2_subdev_selection *); int (*get_edid)(struct v4l2_subdev *, struct v4l2_edid *); int (*set_edid)(struct v4l2_subdev *, struct v4l2_edid *); int (*dv_timings_cap)(struct v4l2_subdev *, struct v4l2_dv_timings_cap *); int (*enum_dv_timings)(struct v4l2_subdev *, struct v4l2_enum_dv_timings *); int (*link_validate)(struct v4l2_subdev *, struct media_link *, struct v4l2_subdev_format *, struct v4l2_subdev_format *); int (*get_frame_desc)(struct v4l2_subdev *, unsigned int, struct v4l2_mbus_frame_desc *); int (*set_frame_desc)(struct v4l2_subdev *, unsigned int, struct v4l2_mbus_frame_desc *); } ;
529 struct v4l2_subdev_ops { const struct v4l2_subdev_core_ops *core; const struct v4l2_subdev_tuner_ops *tuner; const struct v4l2_subdev_audio_ops *audio; const struct v4l2_subdev_video_ops *video; const struct v4l2_subdev_vbi_ops *vbi; const struct v4l2_subdev_ir_ops *ir; const struct v4l2_subdev_sensor_ops *sensor; const struct v4l2_subdev_pad_ops *pad; } ;
541 struct v4l2_subdev_internal_ops { int (*registered)(struct v4l2_subdev *); void (*unregistered)(struct v4l2_subdev *); int (*open)(struct v4l2_subdev *, struct v4l2_subdev_fh *); int (*close)(struct v4l2_subdev *, struct v4l2_subdev_fh *); } ;
562 struct regulator_bulk_data ;
563 struct v4l2_subdev_platform_data { struct regulator_bulk_data *regulators; int num_regulators; void *host_priv; } ;
584 struct v4l2_subdev { struct media_entity entity; struct list_head list; struct module *owner; bool owner_v4l2_dev; u32 flags; struct v4l2_device *v4l2_dev; const struct v4l2_subdev_ops *ops; const struct v4l2_subdev_internal_ops *internal_ops; struct v4l2_ctrl_handler *ctrl_handler; char name[32U]; u32 grp_id; void *dev_priv; void *host_priv; struct video_device *devnode; struct device *dev; struct list_head async_list; struct v4l2_async_subdev *asd; struct v4l2_async_notifier *notifier; struct v4l2_subdev_platform_data *pdata; } ;
622 struct __anonstruct_pad_237 { struct v4l2_mbus_framefmt try_fmt; struct v4l2_rect try_crop; struct v4l2_rect try_compose; } ;
622 struct v4l2_subdev_fh { struct v4l2_fh vfh; struct __anonstruct_pad_237 *pad; } ;
691 struct v4l2_device { struct device *dev; struct media_device *mdev; struct list_head subdevs; spinlock_t lock; char name[36U]; void (*notify)(struct v4l2_subdev *, unsigned int, void *); struct v4l2_ctrl_handler *ctrl_handler; struct v4l2_prio_state prio; struct mutex ioctl_lock; struct kref ref; void (*release)(struct v4l2_device *); } ;
130 struct v4l2_ioctl_ops { int (*vidioc_querycap)(struct file *, void *, struct v4l2_capability *); int (*vidioc_g_priority)(struct file *, void *, enum v4l2_priority *); int (*vidioc_s_priority)(struct file *, void *, enum v4l2_priority ); int (*vidioc_enum_fmt_vid_cap)(struct file *, void *, struct v4l2_fmtdesc *); int (*vidioc_enum_fmt_vid_overlay)(struct file *, void *, struct v4l2_fmtdesc *); int (*vidioc_enum_fmt_vid_out)(struct file *, void *, struct v4l2_fmtdesc *); int (*vidioc_enum_fmt_vid_cap_mplane)(struct file *, void *, struct v4l2_fmtdesc *); int (*vidioc_enum_fmt_vid_out_mplane)(struct file *, void *, struct v4l2_fmtdesc *); int (*vidioc_enum_fmt_sdr_cap)(struct file *, void *, struct v4l2_fmtdesc *); int (*vidioc_g_fmt_vid_cap)(struct file *, void *, struct v4l2_format *); int (*vidioc_g_fmt_vid_overlay)(struct file *, void *, struct v4l2_format *); int (*vidioc_g_fmt_vid_out)(struct file *, void *, struct v4l2_format *); int (*vidioc_g_fmt_vid_out_overlay)(struct file *, void *, struct v4l2_format *); int (*vidioc_g_fmt_vbi_cap)(struct file *, void *, struct v4l2_format *); int (*vidioc_g_fmt_vbi_out)(struct file *, void *, struct v4l2_format *); int (*vidioc_g_fmt_sliced_vbi_cap)(struct file *, void *, struct v4l2_format *); int (*vidioc_g_fmt_sliced_vbi_out)(struct file *, void *, struct v4l2_format *); int (*vidioc_g_fmt_vid_cap_mplane)(struct file *, void *, struct v4l2_format *); int (*vidioc_g_fmt_vid_out_mplane)(struct file *, void *, struct v4l2_format *); int (*vidioc_g_fmt_sdr_cap)(struct file *, void *, struct v4l2_format *); int (*vidioc_s_fmt_vid_cap)(struct file *, void *, struct v4l2_format *); int (*vidioc_s_fmt_vid_overlay)(struct file *, void *, struct v4l2_format *); int (*vidioc_s_fmt_vid_out)(struct file *, void *, struct v4l2_format *); int (*vidioc_s_fmt_vid_out_overlay)(struct file *, void *, struct v4l2_format *); int (*vidioc_s_fmt_vbi_cap)(struct file *, void *, struct v4l2_format *); int (*vidioc_s_fmt_vbi_out)(struct file *, void *, struct v4l2_format *); int (*vidioc_s_fmt_sliced_vbi_cap)(struct file *, void *, struct v4l2_format *); int (*vidioc_s_fmt_sliced_vbi_out)(struct file *, void *, struct v4l2_format *); int (*vidioc_s_fmt_vid_cap_mplane)(struct file *, void *, struct v4l2_format *); int (*vidioc_s_fmt_vid_out_mplane)(struct file *, void *, struct v4l2_format *); int (*vidioc_s_fmt_sdr_cap)(struct file *, void *, struct v4l2_format *); int (*vidioc_try_fmt_vid_cap)(struct file *, void *, struct v4l2_format *); int (*vidioc_try_fmt_vid_overlay)(struct file *, void *, struct v4l2_format *); int (*vidioc_try_fmt_vid_out)(struct file *, void *, struct v4l2_format *); int (*vidioc_try_fmt_vid_out_overlay)(struct file *, void *, struct v4l2_format *); int (*vidioc_try_fmt_vbi_cap)(struct file *, void *, struct v4l2_format *); int (*vidioc_try_fmt_vbi_out)(struct file *, void *, struct v4l2_format *); int (*vidioc_try_fmt_sliced_vbi_cap)(struct file *, void *, struct v4l2_format *); int (*vidioc_try_fmt_sliced_vbi_out)(struct file *, void *, struct v4l2_format *); int (*vidioc_try_fmt_vid_cap_mplane)(struct file *, void *, struct v4l2_format *); int (*vidioc_try_fmt_vid_out_mplane)(struct file *, void *, struct v4l2_format *); int (*vidioc_try_fmt_sdr_cap)(struct file *, void *, struct v4l2_format *); int (*vidioc_reqbufs)(struct file *, void *, struct v4l2_requestbuffers *); int (*vidioc_querybuf)(struct file *, void *, struct v4l2_buffer *); int (*vidioc_qbuf)(struct file *, void *, struct v4l2_buffer *); int (*vidioc_expbuf)(struct file *, void *, struct v4l2_exportbuffer *); int (*vidioc_dqbuf)(struct file *, void *, struct v4l2_buffer *); int (*vidioc_create_bufs)(struct file *, void *, struct v4l2_create_buffers *); int (*vidioc_prepare_buf)(struct file *, void *, struct v4l2_buffer *); int (*vidioc_overlay)(struct file *, void *, unsigned int); int (*vidioc_g_fbuf)(struct file *, void *, struct v4l2_framebuffer *); int (*vidioc_s_fbuf)(struct file *, void *, const struct v4l2_framebuffer *); int (*vidioc_streamon)(struct file *, void *, enum v4l2_buf_type ); int (*vidioc_streamoff)(struct file *, void *, enum v4l2_buf_type ); int (*vidioc_g_std)(struct file *, void *, v4l2_std_id *); int (*vidioc_s_std)(struct file *, void *, v4l2_std_id ); int (*vidioc_querystd)(struct file *, void *, v4l2_std_id *); int (*vidioc_enum_input)(struct file *, void *, struct v4l2_input *); int (*vidioc_g_input)(struct file *, void *, unsigned int *); int (*vidioc_s_input)(struct file *, void *, unsigned int); int (*vidioc_enum_output)(struct file *, void *, struct v4l2_output *); int (*vidioc_g_output)(struct file *, void *, unsigned int *); int (*vidioc_s_output)(struct file *, void *, unsigned int); int (*vidioc_queryctrl)(struct file *, void *, struct v4l2_queryctrl *); int (*vidioc_query_ext_ctrl)(struct file *, void *, struct v4l2_query_ext_ctrl *); int (*vidioc_g_ctrl)(struct file *, void *, struct v4l2_control *); int (*vidioc_s_ctrl)(struct file *, void *, struct v4l2_control *); int (*vidioc_g_ext_ctrls)(struct file *, void *, struct v4l2_ext_controls *); int (*vidioc_s_ext_ctrls)(struct file *, void *, struct v4l2_ext_controls *); int (*vidioc_try_ext_ctrls)(struct file *, void *, struct v4l2_ext_controls *); int (*vidioc_querymenu)(struct file *, void *, struct v4l2_querymenu *); int (*vidioc_enumaudio)(struct file *, void *, struct v4l2_audio *); int (*vidioc_g_audio)(struct file *, void *, struct v4l2_audio *); int (*vidioc_s_audio)(struct file *, void *, const struct v4l2_audio *); int (*vidioc_enumaudout)(struct file *, void *, struct v4l2_audioout *); int (*vidioc_g_audout)(struct file *, void *, struct v4l2_audioout *); int (*vidioc_s_audout)(struct file *, void *, const struct v4l2_audioout *); int (*vidioc_g_modulator)(struct file *, void *, struct v4l2_modulator *); int (*vidioc_s_modulator)(struct file *, void *, const struct v4l2_modulator *); int (*vidioc_cropcap)(struct file *, void *, struct v4l2_cropcap *); int (*vidioc_g_crop)(struct file *, void *, struct v4l2_crop *); int (*vidioc_s_crop)(struct file *, void *, const struct v4l2_crop *); int (*vidioc_g_selection)(struct file *, void *, struct v4l2_selection *); int (*vidioc_s_selection)(struct file *, void *, struct v4l2_selection *); int (*vidioc_g_jpegcomp)(struct file *, void *, struct v4l2_jpegcompression *); int (*vidioc_s_jpegcomp)(struct file *, void *, const struct v4l2_jpegcompression *); int (*vidioc_g_enc_index)(struct file *, void *, struct v4l2_enc_idx *); int (*vidioc_encoder_cmd)(struct file *, void *, struct v4l2_encoder_cmd *); int (*vidioc_try_encoder_cmd)(struct file *, void *, struct v4l2_encoder_cmd *); int (*vidioc_decoder_cmd)(struct file *, void *, struct v4l2_decoder_cmd *); int (*vidioc_try_decoder_cmd)(struct file *, void *, struct v4l2_decoder_cmd *); int (*vidioc_g_parm)(struct file *, void *, struct v4l2_streamparm *); int (*vidioc_s_parm)(struct file *, void *, struct v4l2_streamparm *); int (*vidioc_g_tuner)(struct file *, void *, struct v4l2_tuner *); int (*vidioc_s_tuner)(struct file *, void *, const struct v4l2_tuner *); int (*vidioc_g_frequency)(struct file *, void *, struct v4l2_frequency *); int (*vidioc_s_frequency)(struct file *, void *, const struct v4l2_frequency *); int (*vidioc_enum_freq_bands)(struct file *, void *, struct v4l2_frequency_band *); int (*vidioc_g_sliced_vbi_cap)(struct file *, void *, struct v4l2_sliced_vbi_cap *); int (*vidioc_log_status)(struct file *, void *); int (*vidioc_s_hw_freq_seek)(struct file *, void *, const struct v4l2_hw_freq_seek *); int (*vidioc_g_register)(struct file *, void *, struct v4l2_dbg_register *); int (*vidioc_s_register)(struct file *, void *, const struct v4l2_dbg_register *); int (*vidioc_g_chip_info)(struct file *, void *, struct v4l2_dbg_chip_info *); int (*vidioc_enum_framesizes)(struct file *, void *, struct v4l2_frmsizeenum *); int (*vidioc_enum_frameintervals)(struct file *, void *, struct v4l2_frmivalenum *); int (*vidioc_s_dv_timings)(struct file *, void *, struct v4l2_dv_timings *); int (*vidioc_g_dv_timings)(struct file *, void *, struct v4l2_dv_timings *); int (*vidioc_query_dv_timings)(struct file *, void *, struct v4l2_dv_timings *); int (*vidioc_enum_dv_timings)(struct file *, void *, struct v4l2_enum_dv_timings *); int (*vidioc_dv_timings_cap)(struct file *, void *, struct v4l2_dv_timings_cap *); int (*vidioc_g_edid)(struct file *, void *, struct v4l2_edid *); int (*vidioc_s_edid)(struct file *, void *, struct v4l2_edid *); int (*vidioc_subscribe_event)(struct v4l2_fh *, const struct v4l2_event_subscription *); int (*vidioc_unsubscribe_event)(struct v4l2_fh *, const struct v4l2_event_subscription *); long int (*vidioc_default)(struct file *, void *, bool , unsigned int, void *); } ;
331 struct videobuf_mapping { unsigned int count; struct videobuf_queue *q; } ;
55 enum videobuf_state { VIDEOBUF_NEEDS_INIT = 0, VIDEOBUF_PREPARED = 1, VIDEOBUF_QUEUED = 2, VIDEOBUF_ACTIVE = 3, VIDEOBUF_DONE = 4, VIDEOBUF_ERROR = 5, VIDEOBUF_IDLE = 6 } ;
65 struct videobuf_buffer { unsigned int i; u32 magic; unsigned int width; unsigned int height; unsigned int bytesperline; unsigned long size; enum v4l2_field field; enum videobuf_state state; struct list_head stream; struct list_head queue; wait_queue_head_t done; unsigned int field_count; struct timeval ts; enum v4l2_memory memory; size_t bsize; size_t boff; unsigned long baddr; struct videobuf_mapping *map; int privsize; void *priv; } ;
104 struct videobuf_queue_ops { int (*buf_setup)(struct videobuf_queue *, unsigned int *, unsigned int *); int (*buf_prepare)(struct videobuf_queue *, struct videobuf_buffer *, enum v4l2_field ); void (*buf_queue)(struct videobuf_queue *, struct videobuf_buffer *); void (*buf_release)(struct videobuf_queue *, struct videobuf_buffer *); } ;
115 struct videobuf_qtype_ops { u32 magic; struct videobuf_buffer * (*alloc_vb)(size_t ); void * (*vaddr)(struct videobuf_buffer *); int (*iolock)(struct videobuf_queue *, struct videobuf_buffer *, struct v4l2_framebuffer *); int (*sync)(struct videobuf_queue *, struct videobuf_buffer *); int (*mmap_mapper)(struct videobuf_queue *, struct videobuf_buffer *, struct vm_area_struct *); } ;
132 struct videobuf_queue { struct mutex vb_lock; struct mutex *ext_lock; spinlock_t *irqlock; struct device *dev; wait_queue_head_t wait; enum v4l2_buf_type type; unsigned int msize; enum v4l2_field field; enum v4l2_field last; struct videobuf_buffer *bufs[32U]; const struct videobuf_queue_ops *ops; struct videobuf_qtype_ops *int_ops; unsigned char streaming; unsigned char reading; struct list_head stream; unsigned int read_off; struct videobuf_buffer *read_buf; void *priv_data; } ;
31 enum sh_vou_status { SH_VOU_IDLE = 0, SH_VOU_INITIALISING = 1, SH_VOU_RUNNING = 2 } ;
37 struct sh_vou_device { struct v4l2_device v4l2_dev; struct video_device *vdev; atomic_t use_count; struct sh_vou_pdata *pdata; spinlock_t lock; void *base; struct v4l2_pix_format pix; struct v4l2_rect rect; struct list_head queue; v4l2_std_id std; int pix_idx; struct videobuf_buffer *active; enum sh_vou_status status; struct mutex fop_lock; } ;
134 struct sh_vou_file { struct videobuf_queue vbq; } ;
185 struct sh_vou_fmt { u32 pfmt; char *desc; unsigned char bpp; unsigned char rgb; unsigned char yf; unsigned char pkf; } ;
571 struct sh_vou_geometry { struct v4l2_rect output; unsigned int in_width; unsigned int in_height; int scale_idx_h; int scale_idx_v; } ;
2129 typedef int ldv_func_ret_type;
29 struct attribute___0 { const char *name; umode_t mode; bool ignore_lockdep; struct lock_class_key *key; struct lock_class_key skey; } ;
60 struct attribute_group___0 { const char *name; umode_t (*is_visible)(struct kobject___0 *, struct attribute___0 *, int); struct attribute___0 **attrs; struct bin_attribute___0 **bin_attrs; } ;
121 struct bin_attribute___0 { struct attribute___0 attr; size_t size; void *private; ssize_t (*read)(struct file *, struct kobject___0 *, struct bin_attribute___0 *, char *, loff_t , size_t ); ssize_t (*write)(struct file *, struct kobject___0 *, struct bin_attribute___0 *, char *, loff_t , size_t ); int (*mmap)(struct file *, struct kobject___0 *, struct bin_attribute___0 *attr, struct vm_area_struct *vma); } ;
175 struct sysfs_ops___0 { ssize_t (*show)(struct kobject___0 *, struct attribute___0 *, char *); ssize_t (*store)(struct kobject___0 *, struct attribute___0 *, const char *, size_t ); } ;
63 struct kobject___0 { const char *name; struct list_head entry; struct kobject___0 *parent; struct kset *kset; struct kobj_type___0 *ktype; struct kernfs_node *sd; struct kref kref; struct delayed_work release; unsigned int state_initialized; unsigned int state_in_sysfs; unsigned int state_add_uevent_sent; unsigned int state_remove_uevent_sent; unsigned int uevent_suppress; } ;
115 struct kobj_type___0 { void (*release)(struct kobject___0 *kobj); const struct sysfs_ops___0 *sysfs_ops; struct attribute___0 **default_attrs; const struct kobj_ns_type_operations * (*child_ns_type)(struct kobject___0 *kobj); const void * (*namespace)(struct kobject___0 *kobj); } ;
295 struct dev_pm_ops___0 { int (*prepare)(struct device___0 *dev); void (*complete)(struct device___0 *dev); int (*suspend)(struct device___0 *dev); int (*resume)(struct device___0 *dev); int (*freeze)(struct device___0 *dev); int (*thaw)(struct device___0 *dev); int (*poweroff)(struct device___0 *dev); int (*restore)(struct device___0 *dev); int (*suspend_late)(struct device___0 *dev); int (*resume_early)(struct device___0 *dev); int (*freeze_late)(struct device___0 *dev); int (*thaw_early)(struct device___0 *dev); int (*poweroff_late)(struct device___0 *dev); int (*restore_early)(struct device___0 *dev); int (*suspend_noirq)(struct device___0 *dev); int (*resume_noirq)(struct device___0 *dev); int (*freeze_noirq)(struct device___0 *dev); int (*thaw_noirq)(struct device___0 *dev); int (*poweroff_noirq)(struct device___0 *dev); int (*restore_noirq)(struct device___0 *dev); int (*runtime_suspend)(struct device___0 *dev); int (*runtime_resume)(struct device___0 *dev); int (*runtime_idle)(struct device___0 *dev); } ;
558 struct dev_pm_info___0 { pm_message_t power_state; unsigned int can_wakeup; unsigned int async_suspend; bool is_prepared; bool is_suspended; bool is_noirq_suspended; bool is_late_suspended; bool ignore_children; bool early_init; bool direct_complete; spinlock_t lock; struct list_head entry; struct completion completion; struct wakeup_source___0 *wakeup; bool wakeup_path; bool syscore; struct timer_list suspend_timer; unsigned long timer_expires; struct work_struct work; wait_queue_head_t wait_queue; atomic_t usage_count; atomic_t child_count; unsigned int disable_depth; unsigned int idle_notification; unsigned int request_pending; unsigned int deferred_resume; unsigned int run_wake; unsigned int runtime_auto; unsigned int no_callbacks; unsigned int irq_safe; unsigned int use_autosuspend; unsigned int timer_autosuspends; unsigned int memalloc_noio; 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___0 *, s32 ); struct dev_pm_qos *qos; } ;
620 struct dev_pm_domain___0 { struct dev_pm_ops___0 ops; } ;
104 struct bus_type___0 { const char *name; const char *dev_name; struct device___0 *dev_root; struct device_attribute___0 *dev_attrs; const struct attribute_group___0 **bus_groups; const struct attribute_group___0 **dev_groups; const struct attribute_group___0 **drv_groups; int (*match)(struct device___0 *dev, struct device_driver___0 *drv); int (*uevent)(struct device___0 *dev, struct kobj_uevent_env *env); int (*probe)(struct device___0 *dev); int (*remove)(struct device___0 *dev); void (*shutdown)(struct device___0 *dev); int (*online)(struct device___0 *dev); int (*offline)(struct device___0 *dev); int (*suspend)(struct device___0 *dev, pm_message_t state); int (*resume)(struct device___0 *dev); const struct dev_pm_ops___0 *pm; const struct iommu_ops *iommu_ops; struct subsys_private *p; struct lock_class_key lock_key; } ;
228 struct device_driver___0 { const char *name; struct bus_type___0 *bus; struct module *owner; const char *mod_name; bool suppress_bind_attrs; const struct of_device_id *of_match_table; const struct acpi_device_id *acpi_match_table; int (*probe)(struct device___0 *dev); int (*remove)(struct device___0 *dev); void (*shutdown)(struct device___0 *dev); int (*suspend)(struct device___0 *dev, pm_message_t state); int (*resume)(struct device___0 *dev); const struct attribute_group___0 **groups; const struct dev_pm_ops___0 *pm; struct driver_private *p; } ;
351 struct class___0 { const char *name; struct module *owner; struct class_attribute___0 *class_attrs; const struct attribute_group___0 **dev_groups; struct kobject___0 *dev_kobj; int (*dev_uevent)(struct device___0 *dev, struct kobj_uevent_env *env); char * (*devnode)(struct device___0 *dev, umode_t *mode); void (*class_release)(struct class___0 *class); void (*dev_release)(struct device___0 *dev); int (*suspend)(struct device___0 *dev, pm_message_t state); int (*resume)(struct device___0 *dev); const struct kobj_ns_type_operations *ns_type; const void * (*namespace)(struct device___0 *dev); const struct dev_pm_ops___0 *pm; struct subsys_private *p; } ;
417 struct class_attribute___0 { struct attribute___0 attr; ssize_t (*show)(struct class___0 *class, struct class_attribute___0 *attr, char *buf); ssize_t (*store)(struct class___0 *class, struct class_attribute___0 *attr, const char *buf, size_t count); } ;
500 struct device_type___0 { const char *name; const struct attribute_group___0 **groups; int (*uevent)(struct device___0 *dev, struct kobj_uevent_env *env); char * (*devnode)(struct device___0 *dev, umode_t *mode, kuid_t *uid, kgid_t *gid); void (*release)(struct device___0 *dev); const struct dev_pm_ops___0 *pm; } ;
512 struct device_attribute___0 { struct attribute___0 attr; ssize_t (*show)(struct device___0 *dev, struct device_attribute___0 *attr, char *buf); ssize_t (*store)(struct device___0 *dev, struct device_attribute___0 *attr, const char *buf, size_t count); } ;
729 struct device___0 { struct device___0 *parent; struct device_private *p; struct kobject___0 kobj; const char *init_name; const struct device_type___0 *type; struct mutex mutex; struct bus_type___0 *bus; struct device_driver___0 *driver; void *platform_data; void *driver_data; struct dev_pm_info___0 power; struct dev_pm_domain___0 *pm_domain; struct dev_pin_info *pins; int numa_node; 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 acpi_dev_node acpi_node; dev_t devt; u32 id; spinlock_t devres_lock; struct list_head devres_head; struct klist_node knode_class; struct class___0 *class; const struct attribute_group___0 **groups; void (*release)(struct device___0 *dev); struct iommu_group *iommu_group; bool offline_disabled; bool offline; } ;
46 struct wakeup_source___0 { const char *name; struct list_head entry; spinlock_t lock; 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; } ;
1 long int __builtin_expect(long exp, long c);
33 extern struct module __this_module;
142 int printk(const char *, ...);
156 bool printk_timed_ratelimit(unsigned long *, unsigned int);
45 int __dynamic_pr_debug(struct _ddebug *, const char *, ...);
53 int __dynamic_dev_dbg(struct _ddebug *, const struct device *, const char *, ...);
14 void ldv_error();
24 void ldv_stop();
30 void * ldv_undef_ptr();
33 void * __VERIFIER_alloc(size_t size);
34 void * ldv_zalloc(size_t size);
35 void * ldv_successful_alloc(size_t size);
79 void __builtin_trap();
16 void * ldv_alloc(size_t size);
18 void ldv_free();
19 void ldv_condition_free();
28 void ldv_assume_and_increase(void *res);
24 void INIT_LIST_HEAD(struct list_head *list);
47 void __list_add(struct list_head *, struct list_head *, struct list_head *);
74 void list_add_tail(struct list_head *new, struct list_head *head);
112 void list_del(struct list_head *);
186 int list_empty(const struct list_head *head);
87 void __bad_percpu_size();
26 size_t strlcpy(char *, const char *, size_t );
17 void __xadd_wrong_size();
37 void atomic_set(atomic_t *v, int i);
102 void atomic_dec(atomic_t *v);
155 int atomic_add_return(int i, atomic_t *v);
167 int atomic_sub_return(int i, atomic_t *v);
8 extern int __preempt_count;
20 int preempt_count();
93 void __raw_spin_lock_init(raw_spinlock_t *, const char *, struct lock_class_key *);
22 void _raw_spin_lock(raw_spinlock_t *);
32 unsigned long int _raw_spin_lock_irqsave(raw_spinlock_t *);
39 void _raw_spin_unlock(raw_spinlock_t *);
43 void _raw_spin_unlock_irqrestore(raw_spinlock_t *, unsigned long);
290 raw_spinlock_t * spinlock_check(spinlock_t *lock);
301 void spin_lock(spinlock_t *lock);
341 void spin_unlock(spinlock_t *lock);
356 void spin_unlock_irqrestore(spinlock_t *lock, unsigned long flags);
146 void __wake_up(wait_queue_head_t *, unsigned int, int, void *);
120 void __mutex_init(struct mutex *, const char *, struct lock_class_key *);
139 void mutex_lock_nested(struct mutex *, unsigned int);
142 int mutex_lock_interruptible_nested(struct mutex *, unsigned int);
175 void mutex_unlock(struct mutex *);
164 resource_size_t resource_size(const struct resource *res);
60 unsigned int __readl(const volatile void *addr);
68 void __writel(unsigned int val, volatile void *addr);
175 void * ioremap_nocache(resource_size_t , unsigned long);
183 void * ioremap(resource_size_t offset, unsigned long size);
188 void iounmap(volatile void *);
144 void kfree(const void *);
147 void ldv_kfree_9(const void *ldv_func_arg1);
151 void ldv_kfree_10(const void *ldv_func_arg1);
155 void ldv_kfree_11(const void *ldv_func_arg1);
159 void ldv_kfree_12(const void *ldv_func_arg1);
637 void * kzalloc(size_t size, gfp_t flags);
33 struct v4l2_format *sh_vou_ioctl_ops_group1 = 0;
34 int LDV_IN_INTERRUPT = 1;
35 struct file *sh_vou_fops_group0 = 0;
36 int __VERIFIER_nondet_int();
37 struct videobuf_queue *sh_vou_video_qops_group1 = 0;
38 int probed_1 = 0;
39 int ldv_state_variable_0 = 0;
40 struct platform_device *sh_vou_group1 = 0;
41 int ldv_state_variable_3 = 0;
42 int ldv_state_variable_2 = 0;
43 struct file *sh_vou_ioctl_ops_group2 = 0;
44 int ref_cnt = 0;
45 int ldv_state_variable_1 = 0;
46 int ldv_state_variable_4 = 0;
47 struct v4l2_buffer *sh_vou_ioctl_ops_group0 = 0;
48 struct videobuf_buffer *sh_vou_video_qops_group2 = 0;
50 void ldv_initialyze_v4l2_file_operations_2();
51 void ldv_platform_driver_init_1();
52 void ldv_videobuf_queue_ops_4();
53 void ldv_platform_probe_1(int (*probe)(struct platform_device *));
54 void ldv_initialyze_v4l2_ioctl_ops_3();
839 void * dev_get_drvdata(const struct device *dev);
844 void dev_set_drvdata(struct device *dev, void *data);
1044 int dev_err(const struct device *, const char *, ...);
1046 int dev_warn(const struct device *, const char *, ...);
10 void __const_udelay(unsigned long);
524 struct i2c_adapter * i2c_get_adapter(int);
525 void i2c_put_adapter(struct i2c_adapter *);
123 int request_threaded_irq(unsigned int, irqreturn_t (*)(int, void *), irqreturn_t (*)(int, void *), unsigned long, const char *, void *);
128 int request_irq(unsigned int irq, irqreturn_t (*handler)(int, void *), unsigned long flags, const char *name, void *dev);
142 void free_irq(unsigned int, void *);
51 struct resource * platform_get_resource(struct platform_device *, unsigned int, unsigned int);
53 int platform_get_irq(struct platform_device *, unsigned int);
195 void platform_driver_unregister(struct platform_driver *);
198 void ldv_platform_driver_unregister_14(struct platform_driver *ldv_func_arg1);
204 int platform_driver_probe(struct platform_driver *, int (*)(struct platform_device *));
208 int ldv_platform_driver_probe_13(struct platform_driver *ldv_func_arg1, int (*probe)(struct platform_device *));
211 void * platform_get_drvdata(const struct platform_device *pdev);
49 int __pm_runtime_idle(struct device *, int);
51 int __pm_runtime_resume(struct device *, int);
55 void pm_runtime_enable(struct device *);
56 void __pm_runtime_disable(struct device *, bool );
199 int pm_runtime_resume(struct device *dev);
224 int pm_runtime_get_sync(struct device *dev);
229 int pm_runtime_put(struct device *dev);
265 void pm_runtime_disable(struct device *dev);
149 int __video_register_device(struct video_device *, int, int, int, struct module *);
156 int video_register_device(struct video_device *vdev, int type, int nr);
172 void video_unregister_device(struct video_device *);
176 struct video_device * video_device_alloc();
179 void video_device_release(struct video_device *);
207 void * video_get_drvdata(struct video_device *vdev);
212 void video_set_drvdata(struct video_device *vdev, void *data);
217 struct video_device * video_devdata(struct file *);
221 void * video_drvdata(struct file *file);
123 struct v4l2_subdev * v4l2_i2c_new_subdev_board(struct v4l2_device *, struct i2c_adapter *, struct i2c_board_info *, const unsigned short *);
190 void v4l_bound_align_image(unsigned int *, unsigned int, unsigned int, unsigned int, unsigned int *, unsigned int, unsigned int, unsigned int, unsigned int);
205 void v4l2_get_timestamp(struct timeval *);
668 void * v4l2_get_subdevdata(const struct v4l2_subdev *sd);
79 int v4l2_device_register(struct device *, struct v4l2_device *);
106 void v4l2_device_unregister(struct v4l2_device *);
330 long int video_ioctl2(struct file *, unsigned int, unsigned long);
177 int videobuf_waiton(struct videobuf_queue *, struct videobuf_buffer *, int, int);
179 int videobuf_iolock(struct videobuf_queue *, struct videobuf_buffer *, struct v4l2_framebuffer *);
202 int videobuf_reqbufs(struct videobuf_queue *, struct v4l2_requestbuffers *);
204 int videobuf_querybuf(struct videobuf_queue *, struct v4l2_buffer *);
205 int videobuf_qbuf(struct videobuf_queue *, struct v4l2_buffer *);
207 int videobuf_dqbuf(struct videobuf_queue *, struct v4l2_buffer *, int);
209 int videobuf_streamon(struct videobuf_queue *);
210 int videobuf_streamoff(struct videobuf_queue *);
222 unsigned int videobuf_poll_stream(struct file *, struct videobuf_queue *, poll_table *);
233 int videobuf_mmap_mapper(struct videobuf_queue *, struct vm_area_struct *);
19 void videobuf_queue_dma_contig_init(struct videobuf_queue *, const struct videobuf_queue_ops *, struct device *, spinlock_t *, enum v4l2_buf_type , enum v4l2_field , unsigned int, void *, struct mutex *);
29 dma_addr_t videobuf_to_dma_contig(struct videobuf_buffer *);
30 void videobuf_dma_contig_free(struct videobuf_queue *, struct videobuf_buffer *);
140 void sh_vou_reg_a_write(struct sh_vou_device *vou_dev, unsigned int reg, u32 value);
146 void sh_vou_reg_ab_write(struct sh_vou_device *vou_dev, unsigned int reg, u32 value);
153 void sh_vou_reg_m_write(struct sh_vou_device *vou_dev, unsigned int reg, u32 value);
159 u32 sh_vou_reg_a_read(struct sh_vou_device *vou_dev, unsigned int reg);
164 void sh_vou_reg_a_set(struct sh_vou_device *vou_dev, unsigned int reg, u32 value, u32 mask);
173 void sh_vou_reg_b_set(struct sh_vou_device *vou_dev, unsigned int reg, u32 value, u32 mask);
179 void sh_vou_reg_ab_set(struct sh_vou_device *vou_dev, unsigned int reg, u32 value, u32 mask);
196 struct sh_vou_fmt vou_fmt[5U] = { { 842094158U, (char *)"YVU420 planar", 12U, 0U, 0U, 0U }, { 909203022U, (char *)"YVYU planar", 16U, 0U, 1U, 0U }, { 859981650U, (char *)"RGB24", 24U, 1U, 0U, 2U }, { 1346520914U, (char *)"RGB565", 16U, 1U, 0U, 3U }, { 1380075346U, (char *)"RGB565 byteswapped", 16U, 1U, 0U, 3U } };
234 void sh_vou_schedule_next(struct sh_vou_device *vou_dev, struct videobuf_buffer *vb);
253 void sh_vou_stream_start(struct sh_vou_device *vou_dev, struct videobuf_buffer *vb);
284 void free_buffer(struct videobuf_queue *vq, struct videobuf_buffer *vb);
295 int sh_vou_buf_setup(struct videobuf_queue *vq, unsigned int *count, unsigned int *size);
318 int sh_vou_buf_prepare(struct videobuf_queue *vq, struct videobuf_buffer *vb, enum v4l2_field field);
368 void sh_vou_buf_queue(struct videobuf_queue *vq, struct videobuf_buffer *vb);
408 void sh_vou_buf_release(struct videobuf_queue *vq, struct videobuf_buffer *vb);
437 struct videobuf_queue_ops sh_vou_video_qops = { &sh_vou_buf_setup, &sh_vou_buf_prepare, &sh_vou_buf_queue, &sh_vou_buf_release };
445 int sh_vou_querycap(struct file *file, void *priv, struct v4l2_capability *cap);
458 int sh_vou_enum_fmt_vid_out(struct file *file, void *priv, struct v4l2_fmtdesc *fmt);
476 int sh_vou_g_fmt_vid_out(struct file *file, void *priv, struct v4l2_format *fmt);
489 const unsigned char vou_scale_h_num[5U] = { 1U, 9U, 2U, 9U, 4U };
490 const unsigned char vou_scale_h_den[5U] = { 1U, 8U, 1U, 4U, 1U };
491 const unsigned char vou_scale_h_fld[4U] = { 0U, 2U, 1U, 3U };
492 const unsigned char vou_scale_v_num[3U] = { 1U, 2U, 4U };
493 const unsigned char vou_scale_v_den[3U] = { 1U, 1U, 1U };
494 const unsigned char vou_scale_v_fld[2U] = { 0U, 1U };
496 void sh_vou_configure_geometry(struct sh_vou_device *vou_dev, int pix_idx, int w_idx, int h_idx);
584 void vou_adjust_input(struct sh_vou_geometry *geo, v4l2_std_id std);
652 void vou_adjust_output(struct sh_vou_geometry *geo, v4l2_std_id std);
727 int sh_vou_s_fmt_vid_out(struct file *file, void *priv, struct v4l2_format *fmt);
819 int sh_vou_try_fmt_vid_out(struct file *file, void *priv, struct v4l2_format *fmt);
843 int sh_vou_reqbufs(struct file *file, void *priv, struct v4l2_requestbuffers *req);
857 int sh_vou_querybuf(struct file *file, void *priv, struct v4l2_buffer *b);
868 int sh_vou_qbuf(struct file *file, void *priv, struct v4l2_buffer *b);
878 int sh_vou_dqbuf(struct file *file, void *priv, struct v4l2_buffer *b);
888 int sh_vou_streamon(struct file *file, void *priv, enum v4l2_buf_type buftype);
906 int sh_vou_streamoff(struct file *file, void *priv, enum v4l2_buf_type buftype);
924 u32 sh_vou_ntsc_mode(enum sh_vou_bus_fmt bus_fmt);
939 int sh_vou_s_std(struct file *file, void *priv, v4l2_std_id std_id);
966 int sh_vou_g_std(struct file *file, void *priv, v4l2_std_id *std);
977 int sh_vou_g_crop(struct file *file, void *fh, struct v4l2_crop *a);
990 int sh_vou_s_crop(struct file *file, void *fh, const struct v4l2_crop *a);
1081 int sh_vou_cropcap(struct file *file, void *priv, struct v4l2_cropcap *a);
1104 irqreturn_t sh_vou_isr(int irq, void *dev_id);
1177 int sh_vou_hw_init(struct sh_vou_device *vou_dev);
1213 int sh_vou_open(struct file *file);
1254 int sh_vou_release(struct file *file);
1276 int sh_vou_mmap(struct file *file, struct vm_area_struct *vma);
1291 unsigned int sh_vou_poll(struct file *file, poll_table *wait);
1306 const struct v4l2_ioctl_ops sh_vou_ioctl_ops = { &sh_vou_querycap, 0, 0, 0, 0, &sh_vou_enum_fmt_vid_out, 0, 0, 0, 0, 0, &sh_vou_g_fmt_vid_out, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, &sh_vou_s_fmt_vid_out, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, &sh_vou_try_fmt_vid_out, 0, 0, 0, 0, 0, 0, 0, 0, &sh_vou_reqbufs, &sh_vou_querybuf, &sh_vou_qbuf, 0, &sh_vou_dqbuf, 0, 0, 0, 0, 0, &sh_vou_streamon, &sh_vou_streamoff, &sh_vou_g_std, &sh_vou_s_std, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, &sh_vou_cropcap, &sh_vou_g_crop, &sh_vou_s_crop, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
1325 const struct v4l2_file_operations sh_vou_fops = { &__this_module, 0, 0, &sh_vou_poll, 0, &video_ioctl2, 0, 0, &sh_vou_mmap, &sh_vou_open, &sh_vou_release };
1334 const struct video_device sh_vou_video_template = { { { 0, 0 }, 0, 0U, 0, 0U, 0U, 0UL, 0U, 0U, 0U, 0U, 0U, 0, 0, 0, 0, 0, 0, { .alsa = { 0U, 0U, 0U } } }, &sh_vou_fops, { 0, 0, { 0, { 0, 0 }, 0, 0, 0, 0, { { 0 } }, { { { 0L }, { 0, 0 }, 0, { 0, { 0, 0 }, 0, 0, 0UL } }, { { 0, 0 }, 0UL, 0, 0, 0UL, 0, 0, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 0, { 0, 0 }, 0, 0, 0UL } }, 0, 0 }, 0U, 0U, 0U, 0U, 0U }, 0, 0, { { 0 }, { { { { { 0U } }, 0U, 0U, 0, { 0, { 0, 0 }, 0, 0, 0UL } } } }, { 0, 0 }, 0, 0, 0, { 0, { 0, 0 }, 0, 0, 0UL } }, 0, 0, 0, 0, { { 0 }, 0U, 0U, 0, 0, 0, 0, 0, 0, 0, { { { { { 0U } }, 0U, 0U, 0, { 0, { 0, 0 }, 0, 0, 0UL } } } }, { 0, 0 }, { 0U, { { { { { { 0U } }, 0U, 0U, 0, { 0, { 0, 0 }, 0, 0, 0UL } } } }, { 0, 0 } } }, 0, 0, 0, { { 0, 0 }, 0UL, 0, 0, 0UL, 0, 0, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 0, { 0, 0 }, 0, 0, 0UL } }, 0UL, { { 0L }, { 0, 0 }, 0, { 0, { 0, 0 }, 0, 0, 0UL } }, { { { { { { 0U } }, 0U, 0U, 0, { 0, { 0, 0 }, 0, 0, 0UL } } } }, { 0, 0 } }, { 0 }, { 0 }, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0, 0, 0, 0, 0UL, 0UL, 0UL, 0UL, 0, 0, 0 }, 0, 0, 0, 0, 0ULL, 0UL, 0, { 0, 0 }, 0, 0, { 0, 0 }, 0, { 0 }, 0U, 0U, { { { { { 0U } }, 0U, 0U, 0, { 0, { 0, 0 }, 0, 0, 0UL } } } }, { 0, 0 }, { 0, { 0, 0 }, { { 0 } } }, 0, 0, 0, 0, 0, 0 }, 0, 0, 0, 0, 0, 0, { 's', 'h', '_', 'v', 'o', 'u', '\x0' }, 0, 1, 0, 0U, 0UL, 0, { { { { { 0U } }, 0U, 0U, 0, { 0, { 0, 0 }, 0, 0, 0UL } } } }, { 0, 0 }, 0, 63744ULL, 0, &sh_vou_ioctl_ops, { 0UL, 0UL, 0UL }, { 0UL, 0UL, 0UL }, 0 };
1342 int sh_vou_probe(struct platform_device *pdev);
1477 int sh_vou_remove(struct platform_device *pdev);
1502 struct platform_driver sh_vou = { 0, &sh_vou_remove, 0, 0, 0, { "sh-vou", 0, &__this_module, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, 0, 0 };
1510 int sh_vou_init();
1510 void sh_vou_exit();
1518 int ldv_probe_1();
1519 int ldv_retval_2 = 0;
1520 int ldv_retval_0 = 0;
1521 int ldv_retval_4 = 0;
1522 void ldv_initialize();
1523 int ldv_retval_1 = 0;
1524 void ldv_check_final_state();
1525 int ldv_retval_3 = 0;
1569 void entry_point();
14 void ldv_error___0();
24 void ldv_stop___0();
7 bool ldv_is_err(const void *ptr);
14 void * ldv_err_ptr(long error);
21 long int ldv_ptr_err(const void *ptr);
28 bool ldv_is_err_or_null(const void *ptr);
8 int ldv_alloc_count = 0;
11 void (*gadget_release_pointer)(struct device___0 *_dev) = 0;
26 void * ldv_zero_alloc(size_t size);
43 void * ldv_nonzero_alloc(size_t size);
56 void * ldv_alloc_without_counter(size_t size);
64 void * ldv_zalloc_without_counter(size_t size);
88 void ldv_save_gadget_release(void (*func)(struct device___0 *_dev));
93 int ldv_dev_set_drvdata(struct device___0 *dev, void *data);
99 void * ldv_dev_get_drvdata(const struct device___0 *dev);
return ;
}
-entry_point
{
1571 unsigned int *ldvarg1;
1572 enum v4l2_field ldvarg0;
1573 unsigned int *ldvarg2;
1574 enum v4l2_buf_type ldvarg18;
1575 struct v4l2_capability *ldvarg11;
1576 struct v4l2_crop *ldvarg20;
1577 struct v4l2_fmtdesc *ldvarg7;
1578 void *ldvarg23;
1579 enum v4l2_buf_type ldvarg3;
1580 void *ldvarg12;
1581 void *ldvarg8;
1582 void *ldvarg13;
1583 void *ldvarg10;
1584 v4l2_std_id *ldvarg9;
1585 void *ldvarg24;
1586 void *ldvarg27;
1587 struct v4l2_requestbuffers *ldvarg26;
1588 const struct v4l2_crop *ldvarg5;
1589 void *ldvarg6;
1590 void *ldvarg15;
1591 void *ldvarg16;
1592 void *ldvarg21;
1593 void *ldvarg25;
1594 void *ldvarg4;
1595 struct v4l2_cropcap *ldvarg14;
1596 void *ldvarg17;
1597 v4l2_std_id ldvarg22;
1598 void *ldvarg19;
1599 void *ldvarg28;
1600 struct vm_area_struct *ldvarg32;
1601 struct poll_table_struct *ldvarg31;
1602 unsigned long ldvarg29;
1603 unsigned int ldvarg30;
1604 int tmp;
1605 int tmp___0;
1606 int tmp___1;
1607 int tmp___2;
1608 int tmp___3;
1609 int tmp___4;
1570 ldv_initialize() { /* Function call is skipped due to function is undefined */}
1606 ldv_state_variable_4 = 0;
1607 ldv_state_variable_1 = 0;
1608 ref_cnt = 0;
1609 ldv_state_variable_0 = 1;
1610 ldv_state_variable_3 = 0;
1611 ldv_state_variable_2 = 0;
1612 ldv_34664:;
1613 tmp = __VERIFIER_nondet_int() { /* Function call is skipped due to function is undefined */}
1613 switch (tmp)
1614 assume(!(tmp == 0));
1682 assume(!(tmp == 1));
1728 assume(tmp == 2);
1731 assume(ldv_state_variable_0 != 0);
1732 tmp___2 = __VERIFIER_nondet_int() { /* Function call is skipped due to function is undefined */}
1732 switch (tmp___2)
1733 assume(!(tmp___2 == 0));
1743 assume(tmp___2 == 1);
1745 assume(ldv_state_variable_0 == 1);
1747 -sh_vou_init()
{
1512 int tmp;
1510 -ldv_platform_driver_probe_13(&sh_vou, &sh_vou_probe)
{
2129 ldv_func_ret_type ldv_func_res;
2130 int tmp;
2131 tmp = platform_driver_probe(ldv_func_arg1, probe) { /* Function call is skipped due to function is undefined */}
2131 ldv_func_res = tmp;
2133 assume(ldv_func_res == 0);
2134 -ldv_platform_driver_init_1()
{
1535 void *tmp;
1534 -ldv_successful_alloc(1472UL)
{
37 void *ret;
38 void *tmp;
37 tmp = __VERIFIER_alloc(size) { /* Function call is skipped due to function is undefined */}
37 ret = tmp;
38 assume(!(((unsigned long)ret) == 0UL));
39 return ret;;
}
1534 sh_vou_group1 = (struct platform_device *)tmp;
1535 return ;;
}
2135 -ldv_platform_probe_1(probe)
{
1546 int err;
1546 assume(!(probe == (&sh_vou_release)));
1546 assume(!(probe == (&sh_vou_remove)));
1546 assume(!(probe == (&sh_vou_open)));
1546 assume(probe == (&sh_vou_probe));
1546 -sh_vou_probe(sh_vou_group1)
{
1344 struct sh_vou_pdata *vou_pdata;
1345 struct v4l2_rect *rect;
1346 struct v4l2_pix_format *pix;
1347 struct i2c_adapter *i2c_adap;
1348 struct video_device *vdev;
1349 struct sh_vou_device *vou_dev;
1350 struct resource *reg_res;
1351 struct resource *region;
1352 struct v4l2_subdev *subdev;
1353 int irq;
1354 int ret;
1355 void *tmp;
1356 struct lock_class_key __key;
1357 struct lock_class_key __key___0;
1358 resource_size_t tmp___0;
1359 void *tmp___1;
1360 resource_size_t tmp___2;
1344 vou_pdata = (struct sh_vou_pdata *)(pdev->dev.platform_data);
1354 reg_res = platform_get_resource(pdev, 512U, 0U) { /* Function call is skipped due to function is undefined */}
1355 irq = platform_get_irq(pdev, 0U) { /* Function call is skipped due to function is undefined */}
1357 assume(!(((unsigned long)vou_pdata) == 0UL));
1357 assume(!(((unsigned long)reg_res) == 0UL));
1357 assume(irq <= 0);
1358 dev_err((const struct device *)(&(pdev->dev)), "Insufficient VOU platform information.\n") { /* Function call is skipped due to function is undefined */}
1359 return -19;;
}
1546 skip
1547 assume(!(err == 0));
1551 return ;;
}
2138 return ldv_func_res;;
}
1510 return tmp;;
}
1749 assume(ldv_retval_3 == 0);
1750 ldv_state_variable_0 = 3;
1751 ldv_state_variable_2 = 1;
1752 -ldv_initialyze_v4l2_file_operations_2()
{
1531 void *tmp;
1530 tmp = ldv_undef_ptr() { /* Function call is skipped due to function is undefined */}
1530 sh_vou_fops_group0 = (struct file *)tmp;
1531 return ;;
}
1753 ldv_state_variable_3 = 1;
1754 -ldv_initialyze_v4l2_ioctl_ops_3()
{
1556 void *tmp;
1557 void *tmp___0;
1558 void *tmp___1;
1555 tmp = ldv_undef_ptr() { /* Function call is skipped due to function is undefined */}
1555 sh_vou_ioctl_ops_group0 = (struct v4l2_buffer *)tmp;
1556 tmp___0 = ldv_undef_ptr() { /* Function call is skipped due to function is undefined */}
1556 sh_vou_ioctl_ops_group1 = (struct v4l2_format *)tmp___0;
1557 tmp___1 = ldv_undef_ptr() { /* Function call is skipped due to function is undefined */}
1557 sh_vou_ioctl_ops_group2 = (struct file *)tmp___1;
1558 return ;;
}
1755 ldv_state_variable_4 = 1;
1756 -ldv_videobuf_queue_ops_4()
{
1540 void *tmp;
1541 void *tmp___0;
1539 tmp = ldv_undef_ptr() { /* Function call is skipped due to function is undefined */}
1539 sh_vou_video_qops_group1 = (struct videobuf_queue *)tmp;
1540 tmp___0 = ldv_undef_ptr() { /* Function call is skipped due to function is undefined */}
1540 sh_vou_video_qops_group2 = (struct videobuf_buffer *)tmp___0;
1541 return ;;
}
1758 assume(!(ldv_retval_3 != 0));
1764 goto ldv_34633;
1769 goto ldv_34624;
2027 goto ldv_34664;
1613 tmp = __VERIFIER_nondet_int() { /* Function call is skipped due to function is undefined */}
1613 switch (tmp)
1614 assume(!(tmp == 0));
1682 assume(!(tmp == 1));
1728 assume(!(tmp == 2));
1770 assume(!(tmp == 3));
1940 assume(tmp == 4);
1943 assume(ldv_state_variable_2 != 0);
1944 tmp___4 = __VERIFIER_nondet_int() { /* Function call is skipped due to function is undefined */}
1944 switch (tmp___4)
1945 assume(tmp___4 == 0);
1947 assume(ldv_state_variable_2 == 1);
1949 -sh_vou_open(sh_vou_fops_group0)
{
1215 struct sh_vou_device *vou_dev;
1216 void *tmp;
1217 struct sh_vou_file *vou_file;
1218 void *tmp___0;
1219 struct _ddebug descriptor;
1220 long tmp___1;
1221 int tmp___2;
1222 int ret;
1223 int tmp___3;
1215 -video_drvdata(file)
{
223 struct video_device *tmp;
224 void *tmp___0;
223 tmp = video_devdata(file) { /* Function call is skipped due to function is undefined */}
223 -video_get_drvdata(tmp)
{
209 void *tmp;
209 -dev_get_drvdata((const struct device *)(&(vdev->dev)))
{
841 void *__CPAchecker_TMP_0 = (void *)(dev->driver_data);
841 return __CPAchecker_TMP_0;;
}
209 return tmp;;
}
223 return tmp___0;;
}
1215 vou_dev = (struct sh_vou_device *)tmp;
1216 -kzalloc(616UL, 208U)
{
2077 void *res;
2078 void *tmp;
2078 tmp = ldv_zalloc(size) { /* Function call is skipped due to function is undefined */}
2078 res = tmp;
2079 -ldv_assume_and_increase(res)
{
36 assume(((unsigned long)res) <= 201200UL);
37 assume(((unsigned long)res) != 0UL);
39 ldv_alloc_count = ldv_alloc_count + 1;
41 return ;;
}
2080 return res;;
}
1216 vou_file = (struct sh_vou_file *)tmp___0;
1219 assume(!(((unsigned long)vou_file) == 0UL));
1222 descriptor.modname = "sh_vou";
1222 descriptor.function = "sh_vou_open";
1222 descriptor.filename = "/home/ldvuser/andrianov/work/current--X--drivers/--X--defaultlinux-3.17-rc1.tar.xz--X--104_1a--X--cpachecker/linux-3.17-rc1.tar.xz/csd_deg_dscv/9767/dscv_tempdir/dscv/ri/104_1a/drivers/media/platform/sh_vou.c.prepared";
1222 descriptor.format = "%s()\n";
1222 descriptor.lineno = 1222U;
1222 descriptor.flags = 0U;
1222 -__builtin_expect(((long)(descriptor.flags)) & 1L, 0L)
{
71 return exp;;
}
1222 assume(!(tmp___1 != 0L));
1224 file->private_data = (void *)vou_file;
1226 tmp___2 = mutex_lock_interruptible_nested(&(vou_dev->fop_lock), 0U) { /* Function call is skipped due to function is undefined */}
1226 assume(tmp___2 != 0);
1227 return -512;;
}
1951 assume(!(ldv_retval_4 == 0));
1957 goto ldv_34657;
2024 goto ldv_34624;
2027 goto ldv_34664;
1613 tmp = __VERIFIER_nondet_int() { /* Function call is skipped due to function is undefined */}
1613 switch (tmp)
1614 assume(!(tmp == 0));
1682 assume(!(tmp == 1));
1728 assume(tmp == 2);
1731 assume(ldv_state_variable_0 != 0);
1732 tmp___2 = __VERIFIER_nondet_int() { /* Function call is skipped due to function is undefined */}
1732 switch (tmp___2)
1733 assume(tmp___2 == 0);
1735 assume(ldv_state_variable_0 == 3);
1735 assume(ref_cnt == 0);
1737 -sh_vou_exit()
{
1510 -ldv_platform_driver_unregister_14(&sh_vou)
{
2144 platform_driver_unregister(ldv_func_arg1) { /* Function call is skipped due to function is undefined */}
2146 ldv_state_variable_1 = 0;
2147 return ;;
}
1511 return ;;
}
1738 ldv_state_variable_0 = 2;
1739 goto ldv_final;
2028 ldv_final:;
2029 -ldv_check_final_state()
{
110 assume(!(ldv_alloc_count == 0));
110 -ldv_error___0()
{
19 LDV_ERROR:;
16 goto LDV_ERROR;
}
}
}
Source code
1 2 #include <linux/kernel.h> 3 bool ldv_is_err(const void *ptr); 4 bool ldv_is_err_or_null(const void *ptr); 5 void* ldv_err_ptr(long error); 6 long ldv_ptr_err(const void *ptr); 7 8 /* TODO: this include should be avoided here while bindings below should 9 * call just model functions from LDV_COMMON_MODEL rather then, say, 10 * ldv_undef_int_negative(). */ 11 #include <verifier/rcv.h> 12 // Provide model function prototypes before their usage. 13 //for dev_get_drvdata, dev_set_drvdata 14 //#include <linux/device.h> 15 16 void* ldv_alloc(size_t size); 17 void* ldv_zero_alloc(size_t size); 18 void ldv_free(void); 19 void ldv_condition_free(void); 20 void ldv_save_gadget_release(void (*func)(struct device *_dev)); 21 void *ldv_dev_get_drvdata(const struct device *dev); 22 int ldv_dev_set_drvdata(struct device *dev, void *data); 23 void* ldv_alloc_without_counter(size_t size); 24 void* ldv_zalloc_without_counter(size_t size); 25 void* ldv_nonzero_alloc(size_t size); 26 void* __VERIFIER_alloc(size_t size); 27 void* ldv_zalloc(size_t size); 28 void ldv_assume_and_increase(void* res) ; 29 30 #include <linux/slab.h> 31 #include <verifier/rcv.h> 32 #include <linux/gfp.h> 33 struct v4l2_format *sh_vou_ioctl_ops_group1; 34 int LDV_IN_INTERRUPT = 1; 35 struct file *sh_vou_fops_group0; 36 int __VERIFIER_nondet_int(void); 37 struct videobuf_queue *sh_vou_video_qops_group1; 38 int probed_1=0; 39 int ldv_state_variable_0; 40 struct platform_device *sh_vou_group1; 41 int ldv_state_variable_3; 42 int ldv_state_variable_2; 43 struct file *sh_vou_ioctl_ops_group2; 44 int ref_cnt; 45 int ldv_state_variable_1; 46 int ldv_state_variable_4; 47 struct v4l2_buffer *sh_vou_ioctl_ops_group0; 48 struct videobuf_buffer *sh_vou_video_qops_group2; 49 int __VERIFIER_nondet_int(void); 50 void ldv_initialyze_v4l2_file_operations_2(void); 51 void ldv_platform_driver_init_1(void); 52 void ldv_videobuf_queue_ops_4(void); 53 void ldv_platform_probe_1(int (*probe)(struct platform_device *)); 54 void ldv_initialyze_v4l2_ioctl_ops_3(void); 55 /* 56 * SuperH Video Output Unit (VOU) driver 57 * 58 * Copyright (C) 2010, Guennadi Liakhovetski <g.liakhovetski@gmx.de> 59 * 60 * This program is free software; you can redistribute it and/or modify 61 * it under the terms of the GNU General Public License version 2 as 62 * published by the Free Software Foundation. 63 */ 64 65 #include <linux/dma-mapping.h> 66 #include <linux/delay.h> 67 #include <linux/errno.h> 68 #include <linux/fs.h> 69 #include <linux/i2c.h> 70 #include <linux/init.h> 71 #include <linux/interrupt.h> 72 #include <linux/kernel.h> 73 #include <linux/platform_device.h> 74 #include <linux/pm_runtime.h> 75 #include <linux/slab.h> 76 #include <linux/videodev2.h> 77 #include <linux/module.h> 78 79 #include <media/sh_vou.h> 80 #include <media/v4l2-common.h> 81 #include <media/v4l2-device.h> 82 #include <media/v4l2-ioctl.h> 83 #include <media/v4l2-mediabus.h> 84 #include <media/videobuf-dma-contig.h> 85 86 /* Mirror addresses are not available for all registers */ 87 #define VOUER 0 88 #define VOUCR 4 89 #define VOUSTR 8 90 #define VOUVCR 0xc 91 #define VOUISR 0x10 92 #define VOUBCR 0x14 93 #define VOUDPR 0x18 94 #define VOUDSR 0x1c 95 #define VOUVPR 0x20 96 #define VOUIR 0x24 97 #define VOUSRR 0x28 98 #define VOUMSR 0x2c 99 #define VOUHIR 0x30 100 #define VOUDFR 0x34 101 #define VOUAD1R 0x38 102 #define VOUAD2R 0x3c 103 #define VOUAIR 0x40 104 #define VOUSWR 0x44 105 #define VOURCR 0x48 106 #define VOURPR 0x50 107 108 enum sh_vou_status { 109 SH_VOU_IDLE, 110 SH_VOU_INITIALISING, 111 SH_VOU_RUNNING, 112 }; 113 114 #define VOU_MAX_IMAGE_WIDTH 720 115 #define VOU_MAX_IMAGE_HEIGHT 576 116 117 struct sh_vou_device { 118 struct v4l2_device v4l2_dev; 119 struct video_device *vdev; 120 atomic_t use_count; 121 struct sh_vou_pdata *pdata; 122 spinlock_t lock; 123 void __iomem *base; 124 /* State information */ 125 struct v4l2_pix_format pix; 126 struct v4l2_rect rect; 127 struct list_head queue; 128 v4l2_std_id std; 129 int pix_idx; 130 struct videobuf_buffer *active; 131 enum sh_vou_status status; 132 struct mutex fop_lock; 133 }; 134 135 struct sh_vou_file { 136 struct videobuf_queue vbq; 137 }; 138 139 /* Register access routines for sides A, B and mirror addresses */ 140 static void sh_vou_reg_a_write(struct sh_vou_device *vou_dev, unsigned int reg, 141 u32 value) 142 { 143 __raw_writel(value, vou_dev->base + reg); 144 } 145 146 static void sh_vou_reg_ab_write(struct sh_vou_device *vou_dev, unsigned int reg, 147 u32 value) 148 { 149 __raw_writel(value, vou_dev->base + reg); 150 __raw_writel(value, vou_dev->base + reg + 0x1000); 151 } 152 153 static void sh_vou_reg_m_write(struct sh_vou_device *vou_dev, unsigned int reg, 154 u32 value) 155 { 156 __raw_writel(value, vou_dev->base + reg + 0x2000); 157 } 158 159 static u32 sh_vou_reg_a_read(struct sh_vou_device *vou_dev, unsigned int reg) 160 { 161 return __raw_readl(vou_dev->base + reg); 162 } 163 164 static void sh_vou_reg_a_set(struct sh_vou_device *vou_dev, unsigned int reg, 165 u32 value, u32 mask) 166 { 167 u32 old = __raw_readl(vou_dev->base + reg); 168 169 value = (value & mask) | (old & ~mask); 170 __raw_writel(value, vou_dev->base + reg); 171 } 172 173 static void sh_vou_reg_b_set(struct sh_vou_device *vou_dev, unsigned int reg, 174 u32 value, u32 mask) 175 { 176 sh_vou_reg_a_set(vou_dev, reg + 0x1000, value, mask); 177 } 178 179 static void sh_vou_reg_ab_set(struct sh_vou_device *vou_dev, unsigned int reg, 180 u32 value, u32 mask) 181 { 182 sh_vou_reg_a_set(vou_dev, reg, value, mask); 183 sh_vou_reg_b_set(vou_dev, reg, value, mask); 184 } 185 186 struct sh_vou_fmt { 187 u32 pfmt; 188 char *desc; 189 unsigned char bpp; 190 unsigned char rgb; 191 unsigned char yf; 192 unsigned char pkf; 193 }; 194 195 /* Further pixel formats can be added */ 196 static struct sh_vou_fmt vou_fmt[] = { 197 { 198 .pfmt = V4L2_PIX_FMT_NV12, 199 .bpp = 12, 200 .desc = "YVU420 planar", 201 .yf = 0, 202 .rgb = 0, 203 }, 204 { 205 .pfmt = V4L2_PIX_FMT_NV16, 206 .bpp = 16, 207 .desc = "YVYU planar", 208 .yf = 1, 209 .rgb = 0, 210 }, 211 { 212 .pfmt = V4L2_PIX_FMT_RGB24, 213 .bpp = 24, 214 .desc = "RGB24", 215 .pkf = 2, 216 .rgb = 1, 217 }, 218 { 219 .pfmt = V4L2_PIX_FMT_RGB565, 220 .bpp = 16, 221 .desc = "RGB565", 222 .pkf = 3, 223 .rgb = 1, 224 }, 225 { 226 .pfmt = V4L2_PIX_FMT_RGB565X, 227 .bpp = 16, 228 .desc = "RGB565 byteswapped", 229 .pkf = 3, 230 .rgb = 1, 231 }, 232 }; 233 234 static void sh_vou_schedule_next(struct sh_vou_device *vou_dev, 235 struct videobuf_buffer *vb) 236 { 237 dma_addr_t addr1, addr2; 238 239 addr1 = videobuf_to_dma_contig(vb); 240 switch (vou_dev->pix.pixelformat) { 241 case V4L2_PIX_FMT_NV12: 242 case V4L2_PIX_FMT_NV16: 243 addr2 = addr1 + vou_dev->pix.width * vou_dev->pix.height; 244 break; 245 default: 246 addr2 = 0; 247 } 248 249 sh_vou_reg_m_write(vou_dev, VOUAD1R, addr1); 250 sh_vou_reg_m_write(vou_dev, VOUAD2R, addr2); 251 } 252 253 static void sh_vou_stream_start(struct sh_vou_device *vou_dev, 254 struct videobuf_buffer *vb) 255 { 256 unsigned int row_coeff; 257 #ifdef __LITTLE_ENDIAN 258 u32 dataswap = 7; 259 #else 260 u32 dataswap = 0; 261 #endif 262 263 switch (vou_dev->pix.pixelformat) { 264 default: 265 case V4L2_PIX_FMT_NV12: 266 case V4L2_PIX_FMT_NV16: 267 row_coeff = 1; 268 break; 269 case V4L2_PIX_FMT_RGB565: 270 dataswap ^= 1; 271 case V4L2_PIX_FMT_RGB565X: 272 row_coeff = 2; 273 break; 274 case V4L2_PIX_FMT_RGB24: 275 row_coeff = 3; 276 break; 277 } 278 279 sh_vou_reg_a_write(vou_dev, VOUSWR, dataswap); 280 sh_vou_reg_ab_write(vou_dev, VOUAIR, vou_dev->pix.width * row_coeff); 281 sh_vou_schedule_next(vou_dev, vb); 282 } 283 284 static void free_buffer(struct videobuf_queue *vq, struct videobuf_buffer *vb) 285 { 286 BUG_ON(in_interrupt()); 287 288 /* Wait until this buffer is no longer in STATE_QUEUED or STATE_ACTIVE */ 289 videobuf_waiton(vq, vb, 0, 0); 290 videobuf_dma_contig_free(vq, vb); 291 vb->state = VIDEOBUF_NEEDS_INIT; 292 } 293 294 /* Locking: caller holds fop_lock mutex */ 295 static int sh_vou_buf_setup(struct videobuf_queue *vq, unsigned int *count, 296 unsigned int *size) 297 { 298 struct video_device *vdev = vq->priv_data; 299 struct sh_vou_device *vou_dev = video_get_drvdata(vdev); 300 301 *size = vou_fmt[vou_dev->pix_idx].bpp * vou_dev->pix.width * 302 vou_dev->pix.height / 8; 303 304 if (*count < 2) 305 *count = 2; 306 307 /* Taking into account maximum frame size, *count will stay >= 2 */ 308 if (PAGE_ALIGN(*size) * *count > 4 * 1024 * 1024) 309 *count = 4 * 1024 * 1024 / PAGE_ALIGN(*size); 310 311 dev_dbg(vou_dev->v4l2_dev.dev, "%s(): count=%d, size=%d\n", __func__, 312 *count, *size); 313 314 return 0; 315 } 316 317 /* Locking: caller holds fop_lock mutex */ 318 static int sh_vou_buf_prepare(struct videobuf_queue *vq, 319 struct videobuf_buffer *vb, 320 enum v4l2_field field) 321 { 322 struct video_device *vdev = vq->priv_data; 323 struct sh_vou_device *vou_dev = video_get_drvdata(vdev); 324 struct v4l2_pix_format *pix = &vou_dev->pix; 325 int bytes_per_line = vou_fmt[vou_dev->pix_idx].bpp * pix->width / 8; 326 int ret; 327 328 dev_dbg(vou_dev->v4l2_dev.dev, "%s()\n", __func__); 329 330 if (vb->width != pix->width || 331 vb->height != pix->height || 332 vb->field != pix->field) { 333 vb->width = pix->width; 334 vb->height = pix->height; 335 vb->field = field; 336 if (vb->state != VIDEOBUF_NEEDS_INIT) 337 free_buffer(vq, vb); 338 } 339 340 vb->size = vb->height * bytes_per_line; 341 if (vb->baddr && vb->bsize < vb->size) { 342 /* User buffer too small */ 343 dev_warn(vq->dev, "User buffer too small: [%zu] @ %lx\n", 344 vb->bsize, vb->baddr); 345 return -EINVAL; 346 } 347 348 if (vb->state == VIDEOBUF_NEEDS_INIT) { 349 ret = videobuf_iolock(vq, vb, NULL); 350 if (ret < 0) { 351 dev_warn(vq->dev, "IOLOCK buf-type %d: %d\n", 352 vb->memory, ret); 353 return ret; 354 } 355 vb->state = VIDEOBUF_PREPARED; 356 } 357 358 dev_dbg(vou_dev->v4l2_dev.dev, 359 "%s(): fmt #%d, %u bytes per line, phys %pad, type %d, state %d\n", 360 __func__, vou_dev->pix_idx, bytes_per_line, 361 ({ dma_addr_t addr = videobuf_to_dma_contig(vb); &addr; }), 362 vb->memory, vb->state); 363 364 return 0; 365 } 366 367 /* Locking: caller holds fop_lock mutex and vq->irqlock spinlock */ 368 static void sh_vou_buf_queue(struct videobuf_queue *vq, 369 struct videobuf_buffer *vb) 370 { 371 struct video_device *vdev = vq->priv_data; 372 struct sh_vou_device *vou_dev = video_get_drvdata(vdev); 373 374 dev_dbg(vou_dev->v4l2_dev.dev, "%s()\n", __func__); 375 376 vb->state = VIDEOBUF_QUEUED; 377 list_add_tail(&vb->queue, &vou_dev->queue); 378 379 if (vou_dev->status == SH_VOU_RUNNING) { 380 return; 381 } else if (!vou_dev->active) { 382 vou_dev->active = vb; 383 /* Start from side A: we use mirror addresses, so, set B */ 384 sh_vou_reg_a_write(vou_dev, VOURPR, 1); 385 dev_dbg(vou_dev->v4l2_dev.dev, "%s: first buffer status 0x%x\n", 386 __func__, sh_vou_reg_a_read(vou_dev, VOUSTR)); 387 sh_vou_schedule_next(vou_dev, vb); 388 /* Only activate VOU after the second buffer */ 389 } else if (vou_dev->active->queue.next == &vb->queue) { 390 /* Second buffer - initialise register side B */ 391 sh_vou_reg_a_write(vou_dev, VOURPR, 0); 392 sh_vou_stream_start(vou_dev, vb); 393 394 /* Register side switching with frame VSYNC */ 395 sh_vou_reg_a_write(vou_dev, VOURCR, 5); 396 dev_dbg(vou_dev->v4l2_dev.dev, "%s: second buffer status 0x%x\n", 397 __func__, sh_vou_reg_a_read(vou_dev, VOUSTR)); 398 399 /* Enable End-of-Frame (VSYNC) interrupts */ 400 sh_vou_reg_a_write(vou_dev, VOUIR, 0x10004); 401 /* Two buffers on the queue - activate the hardware */ 402 403 vou_dev->status = SH_VOU_RUNNING; 404 sh_vou_reg_a_write(vou_dev, VOUER, 0x107); 405 } 406 } 407 408 static void sh_vou_buf_release(struct videobuf_queue *vq, 409 struct videobuf_buffer *vb) 410 { 411 struct video_device *vdev = vq->priv_data; 412 struct sh_vou_device *vou_dev = video_get_drvdata(vdev); 413 unsigned long flags; 414 415 dev_dbg(vou_dev->v4l2_dev.dev, "%s()\n", __func__); 416 417 spin_lock_irqsave(&vou_dev->lock, flags); 418 419 if (vou_dev->active == vb) { 420 /* disable output */ 421 sh_vou_reg_a_set(vou_dev, VOUER, 0, 1); 422 /* ...but the current frame will complete */ 423 sh_vou_reg_a_set(vou_dev, VOUIR, 0, 0x30000); 424 vou_dev->active = NULL; 425 } 426 427 if ((vb->state == VIDEOBUF_ACTIVE || vb->state == VIDEOBUF_QUEUED)) { 428 vb->state = VIDEOBUF_ERROR; 429 list_del(&vb->queue); 430 } 431 432 spin_unlock_irqrestore(&vou_dev->lock, flags); 433 434 free_buffer(vq, vb); 435 } 436 437 static struct videobuf_queue_ops sh_vou_video_qops = { 438 .buf_setup = sh_vou_buf_setup, 439 .buf_prepare = sh_vou_buf_prepare, 440 .buf_queue = sh_vou_buf_queue, 441 .buf_release = sh_vou_buf_release, 442 }; 443 444 /* Video IOCTLs */ 445 static int sh_vou_querycap(struct file *file, void *priv, 446 struct v4l2_capability *cap) 447 { 448 struct sh_vou_device *vou_dev = video_drvdata(file); 449 450 dev_dbg(vou_dev->v4l2_dev.dev, "%s()\n", __func__); 451 452 strlcpy(cap->card, "SuperH VOU", sizeof(cap->card)); 453 cap->capabilities = V4L2_CAP_VIDEO_OUTPUT | V4L2_CAP_STREAMING; 454 return 0; 455 } 456 457 /* Enumerate formats, that the device can accept from the user */ 458 static int sh_vou_enum_fmt_vid_out(struct file *file, void *priv, 459 struct v4l2_fmtdesc *fmt) 460 { 461 struct sh_vou_device *vou_dev = video_drvdata(file); 462 463 if (fmt->index >= ARRAY_SIZE(vou_fmt)) 464 return -EINVAL; 465 466 dev_dbg(vou_dev->v4l2_dev.dev, "%s()\n", __func__); 467 468 fmt->type = V4L2_BUF_TYPE_VIDEO_OUTPUT; 469 strlcpy(fmt->description, vou_fmt[fmt->index].desc, 470 sizeof(fmt->description)); 471 fmt->pixelformat = vou_fmt[fmt->index].pfmt; 472 473 return 0; 474 } 475 476 static int sh_vou_g_fmt_vid_out(struct file *file, void *priv, 477 struct v4l2_format *fmt) 478 { 479 struct sh_vou_device *vou_dev = video_drvdata(file); 480 481 dev_dbg(vou_dev->v4l2_dev.dev, "%s()\n", __func__); 482 483 fmt->type = V4L2_BUF_TYPE_VIDEO_OUTPUT; 484 fmt->fmt.pix = vou_dev->pix; 485 486 return 0; 487 } 488 489 static const unsigned char vou_scale_h_num[] = {1, 9, 2, 9, 4}; 490 static const unsigned char vou_scale_h_den[] = {1, 8, 1, 4, 1}; 491 static const unsigned char vou_scale_h_fld[] = {0, 2, 1, 3}; 492 static const unsigned char vou_scale_v_num[] = {1, 2, 4}; 493 static const unsigned char vou_scale_v_den[] = {1, 1, 1}; 494 static const unsigned char vou_scale_v_fld[] = {0, 1}; 495 496 static void sh_vou_configure_geometry(struct sh_vou_device *vou_dev, 497 int pix_idx, int w_idx, int h_idx) 498 { 499 struct sh_vou_fmt *fmt = vou_fmt + pix_idx; 500 unsigned int black_left, black_top, width_max, 501 frame_in_height, frame_out_height, frame_out_top; 502 struct v4l2_rect *rect = &vou_dev->rect; 503 struct v4l2_pix_format *pix = &vou_dev->pix; 504 u32 vouvcr = 0, dsr_h, dsr_v; 505 506 if (vou_dev->std & V4L2_STD_525_60) { 507 width_max = 858; 508 /* height_max = 262; */ 509 } else { 510 width_max = 864; 511 /* height_max = 312; */ 512 } 513 514 frame_in_height = pix->height / 2; 515 frame_out_height = rect->height / 2; 516 frame_out_top = rect->top / 2; 517 518 /* 519 * Cropping scheme: max useful image is 720x480, and the total video 520 * area is 858x525 (NTSC) or 864x625 (PAL). AK8813 / 8814 starts 521 * sampling data beginning with fixed 276th (NTSC) / 288th (PAL) clock, 522 * of which the first 33 / 25 clocks HSYNC must be held active. This 523 * has to be configured in CR[HW]. 1 pixel equals 2 clock periods. 524 * This gives CR[HW] = 16 / 12, VPR[HVP] = 138 / 144, which gives 525 * exactly 858 - 138 = 864 - 144 = 720! We call the out-of-display area, 526 * beyond DSR, specified on the left and top by the VPR register "black 527 * pixels" and out-of-image area (DPR) "background pixels." We fix VPR 528 * at 138 / 144 : 20, because that's the HSYNC timing, that our first 529 * client requires, and that's exactly what leaves us 720 pixels for the 530 * image; we leave VPR[VVP] at default 20 for now, because the client 531 * doesn't seem to have any special requirements for it. Otherwise we 532 * could also set it to max - 240 = 22 / 72. Thus VPR depends only on 533 * the selected standard, and DPR and DSR are selected according to 534 * cropping. Q: how does the client detect the first valid line? Does 535 * HSYNC stay inactive during invalid (black) lines? 536 */ 537 black_left = width_max - VOU_MAX_IMAGE_WIDTH; 538 black_top = 20; 539 540 dsr_h = rect->width + rect->left; 541 dsr_v = frame_out_height + frame_out_top; 542 543 dev_dbg(vou_dev->v4l2_dev.dev, 544 "image %ux%u, black %u:%u, offset %u:%u, display %ux%u\n", 545 pix->width, frame_in_height, black_left, black_top, 546 rect->left, frame_out_top, dsr_h, dsr_v); 547 548 /* VOUISR height - half of a frame height in frame mode */ 549 sh_vou_reg_ab_write(vou_dev, VOUISR, (pix->width << 16) | frame_in_height); 550 sh_vou_reg_ab_write(vou_dev, VOUVPR, (black_left << 16) | black_top); 551 sh_vou_reg_ab_write(vou_dev, VOUDPR, (rect->left << 16) | frame_out_top); 552 sh_vou_reg_ab_write(vou_dev, VOUDSR, (dsr_h << 16) | dsr_v); 553 554 /* 555 * if necessary, we could set VOUHIR to 556 * max(black_left + dsr_h, width_max) here 557 */ 558 559 if (w_idx) 560 vouvcr |= (1 << 15) | (vou_scale_h_fld[w_idx - 1] << 4); 561 if (h_idx) 562 vouvcr |= (1 << 14) | vou_scale_v_fld[h_idx - 1]; 563 564 dev_dbg(vou_dev->v4l2_dev.dev, "%s: scaling 0x%x\n", fmt->desc, vouvcr); 565 566 /* To produce a colour bar for testing set bit 23 of VOUVCR */ 567 sh_vou_reg_ab_write(vou_dev, VOUVCR, vouvcr); 568 sh_vou_reg_ab_write(vou_dev, VOUDFR, 569 fmt->pkf | (fmt->yf << 8) | (fmt->rgb << 16)); 570 } 571 572 struct sh_vou_geometry { 573 struct v4l2_rect output; 574 unsigned int in_width; 575 unsigned int in_height; 576 int scale_idx_h; 577 int scale_idx_v; 578 }; 579 580 /* 581 * Find input geometry, that we can use to produce output, closest to the 582 * requested rectangle, using VOU scaling 583 */ 584 static void vou_adjust_input(struct sh_vou_geometry *geo, v4l2_std_id std) 585 { 586 /* The compiler cannot know, that best and idx will indeed be set */ 587 unsigned int best_err = UINT_MAX, best = 0, img_height_max; 588 int i, idx = 0; 589 590 if (std & V4L2_STD_525_60) 591 img_height_max = 480; 592 else 593 img_height_max = 576; 594 595 /* Image width must be a multiple of 4 */ 596 v4l_bound_align_image(&geo->in_width, 0, VOU_MAX_IMAGE_WIDTH, 2, 597 &geo->in_height, 0, img_height_max, 1, 0); 598 599 /* Select scales to come as close as possible to the output image */ 600 for (i = ARRAY_SIZE(vou_scale_h_num) - 1; i >= 0; i--) { 601 unsigned int err; 602 unsigned int found = geo->output.width * vou_scale_h_den[i] / 603 vou_scale_h_num[i]; 604 605 if (found > VOU_MAX_IMAGE_WIDTH) 606 /* scales increase */ 607 break; 608 609 err = abs(found - geo->in_width); 610 if (err < best_err) { 611 best_err = err; 612 idx = i; 613 best = found; 614 } 615 if (!err) 616 break; 617 } 618 619 geo->in_width = best; 620 geo->scale_idx_h = idx; 621 622 best_err = UINT_MAX; 623 624 /* This loop can be replaced with one division */ 625 for (i = ARRAY_SIZE(vou_scale_v_num) - 1; i >= 0; i--) { 626 unsigned int err; 627 unsigned int found = geo->output.height * vou_scale_v_den[i] / 628 vou_scale_v_num[i]; 629 630 if (found > img_height_max) 631 /* scales increase */ 632 break; 633 634 err = abs(found - geo->in_height); 635 if (err < best_err) { 636 best_err = err; 637 idx = i; 638 best = found; 639 } 640 if (!err) 641 break; 642 } 643 644 geo->in_height = best; 645 geo->scale_idx_v = idx; 646 } 647 648 /* 649 * Find output geometry, that we can produce, using VOU scaling, closest to 650 * the requested rectangle 651 */ 652 static void vou_adjust_output(struct sh_vou_geometry *geo, v4l2_std_id std) 653 { 654 unsigned int best_err = UINT_MAX, best = geo->in_width, 655 width_max, height_max, img_height_max; 656 int i, idx = 0; 657 658 if (std & V4L2_STD_525_60) { 659 width_max = 858; 660 height_max = 262 * 2; 661 img_height_max = 480; 662 } else { 663 width_max = 864; 664 height_max = 312 * 2; 665 img_height_max = 576; 666 } 667 668 /* Select scales to come as close as possible to the output image */ 669 for (i = 0; i < ARRAY_SIZE(vou_scale_h_num); i++) { 670 unsigned int err; 671 unsigned int found = geo->in_width * vou_scale_h_num[i] / 672 vou_scale_h_den[i]; 673 674 if (found > VOU_MAX_IMAGE_WIDTH) 675 /* scales increase */ 676 break; 677 678 err = abs(found - geo->output.width); 679 if (err < best_err) { 680 best_err = err; 681 idx = i; 682 best = found; 683 } 684 if (!err) 685 break; 686 } 687 688 geo->output.width = best; 689 geo->scale_idx_h = idx; 690 if (geo->output.left + best > width_max) 691 geo->output.left = width_max - best; 692 693 pr_debug("%s(): W %u * %u/%u = %u\n", __func__, geo->in_width, 694 vou_scale_h_num[idx], vou_scale_h_den[idx], best); 695 696 best_err = UINT_MAX; 697 698 /* This loop can be replaced with one division */ 699 for (i = 0; i < ARRAY_SIZE(vou_scale_v_num); i++) { 700 unsigned int err; 701 unsigned int found = geo->in_height * vou_scale_v_num[i] / 702 vou_scale_v_den[i]; 703 704 if (found > img_height_max) 705 /* scales increase */ 706 break; 707 708 err = abs(found - geo->output.height); 709 if (err < best_err) { 710 best_err = err; 711 idx = i; 712 best = found; 713 } 714 if (!err) 715 break; 716 } 717 718 geo->output.height = best; 719 geo->scale_idx_v = idx; 720 if (geo->output.top + best > height_max) 721 geo->output.top = height_max - best; 722 723 pr_debug("%s(): H %u * %u/%u = %u\n", __func__, geo->in_height, 724 vou_scale_v_num[idx], vou_scale_v_den[idx], best); 725 } 726 727 static int sh_vou_s_fmt_vid_out(struct file *file, void *priv, 728 struct v4l2_format *fmt) 729 { 730 struct sh_vou_device *vou_dev = video_drvdata(file); 731 struct v4l2_pix_format *pix = &fmt->fmt.pix; 732 unsigned int img_height_max; 733 int pix_idx; 734 struct sh_vou_geometry geo; 735 struct v4l2_mbus_framefmt mbfmt = { 736 /* Revisit: is this the correct code? */ 737 .code = V4L2_MBUS_FMT_YUYV8_2X8, 738 .field = V4L2_FIELD_INTERLACED, 739 .colorspace = V4L2_COLORSPACE_SMPTE170M, 740 }; 741 int ret; 742 743 dev_dbg(vou_dev->v4l2_dev.dev, "%s(): %ux%u -> %ux%u\n", __func__, 744 vou_dev->rect.width, vou_dev->rect.height, 745 pix->width, pix->height); 746 747 if (pix->field == V4L2_FIELD_ANY) 748 pix->field = V4L2_FIELD_NONE; 749 750 if (fmt->type != V4L2_BUF_TYPE_VIDEO_OUTPUT || 751 pix->field != V4L2_FIELD_NONE) 752 return -EINVAL; 753 754 for (pix_idx = 0; pix_idx < ARRAY_SIZE(vou_fmt); pix_idx++) 755 if (vou_fmt[pix_idx].pfmt == pix->pixelformat) 756 break; 757 758 if (pix_idx == ARRAY_SIZE(vou_fmt)) 759 return -EINVAL; 760 761 if (vou_dev->std & V4L2_STD_525_60) 762 img_height_max = 480; 763 else 764 img_height_max = 576; 765 766 /* Image width must be a multiple of 4 */ 767 v4l_bound_align_image(&pix->width, 0, VOU_MAX_IMAGE_WIDTH, 2, 768 &pix->height, 0, img_height_max, 1, 0); 769 770 geo.in_width = pix->width; 771 geo.in_height = pix->height; 772 geo.output = vou_dev->rect; 773 774 vou_adjust_output(&geo, vou_dev->std); 775 776 mbfmt.width = geo.output.width; 777 mbfmt.height = geo.output.height; 778 ret = v4l2_device_call_until_err(&vou_dev->v4l2_dev, 0, video, 779 s_mbus_fmt, &mbfmt); 780 /* Must be implemented, so, don't check for -ENOIOCTLCMD */ 781 if (ret < 0) 782 return ret; 783 784 dev_dbg(vou_dev->v4l2_dev.dev, "%s(): %ux%u -> %ux%u\n", __func__, 785 geo.output.width, geo.output.height, mbfmt.width, mbfmt.height); 786 787 /* Sanity checks */ 788 if ((unsigned)mbfmt.width > VOU_MAX_IMAGE_WIDTH || 789 (unsigned)mbfmt.height > img_height_max || 790 mbfmt.code != V4L2_MBUS_FMT_YUYV8_2X8) 791 return -EIO; 792 793 if (mbfmt.width != geo.output.width || 794 mbfmt.height != geo.output.height) { 795 geo.output.width = mbfmt.width; 796 geo.output.height = mbfmt.height; 797 798 vou_adjust_input(&geo, vou_dev->std); 799 } 800 801 /* We tried to preserve output rectangle, but it could have changed */ 802 vou_dev->rect = geo.output; 803 pix->width = geo.in_width; 804 pix->height = geo.in_height; 805 806 dev_dbg(vou_dev->v4l2_dev.dev, "%s(): %ux%u\n", __func__, 807 pix->width, pix->height); 808 809 vou_dev->pix_idx = pix_idx; 810 811 vou_dev->pix = *pix; 812 813 sh_vou_configure_geometry(vou_dev, pix_idx, 814 geo.scale_idx_h, geo.scale_idx_v); 815 816 return 0; 817 } 818 819 static int sh_vou_try_fmt_vid_out(struct file *file, void *priv, 820 struct v4l2_format *fmt) 821 { 822 struct sh_vou_device *vou_dev = video_drvdata(file); 823 struct v4l2_pix_format *pix = &fmt->fmt.pix; 824 int i; 825 826 dev_dbg(vou_dev->v4l2_dev.dev, "%s()\n", __func__); 827 828 fmt->type = V4L2_BUF_TYPE_VIDEO_OUTPUT; 829 pix->field = V4L2_FIELD_NONE; 830 831 v4l_bound_align_image(&pix->width, 0, VOU_MAX_IMAGE_WIDTH, 1, 832 &pix->height, 0, VOU_MAX_IMAGE_HEIGHT, 1, 0); 833 834 for (i = 0; i < ARRAY_SIZE(vou_fmt); i++) 835 if (vou_fmt[i].pfmt == pix->pixelformat) 836 return 0; 837 838 pix->pixelformat = vou_fmt[0].pfmt; 839 840 return 0; 841 } 842 843 static int sh_vou_reqbufs(struct file *file, void *priv, 844 struct v4l2_requestbuffers *req) 845 { 846 struct sh_vou_device *vou_dev = video_drvdata(file); 847 struct sh_vou_file *vou_file = priv; 848 849 dev_dbg(vou_dev->v4l2_dev.dev, "%s()\n", __func__); 850 851 if (req->type != V4L2_BUF_TYPE_VIDEO_OUTPUT) 852 return -EINVAL; 853 854 return videobuf_reqbufs(&vou_file->vbq, req); 855 } 856 857 static int sh_vou_querybuf(struct file *file, void *priv, 858 struct v4l2_buffer *b) 859 { 860 struct sh_vou_device *vou_dev = video_drvdata(file); 861 struct sh_vou_file *vou_file = priv; 862 863 dev_dbg(vou_dev->v4l2_dev.dev, "%s()\n", __func__); 864 865 return videobuf_querybuf(&vou_file->vbq, b); 866 } 867 868 static int sh_vou_qbuf(struct file *file, void *priv, struct v4l2_buffer *b) 869 { 870 struct sh_vou_device *vou_dev = video_drvdata(file); 871 struct sh_vou_file *vou_file = priv; 872 873 dev_dbg(vou_dev->v4l2_dev.dev, "%s()\n", __func__); 874 875 return videobuf_qbuf(&vou_file->vbq, b); 876 } 877 878 static int sh_vou_dqbuf(struct file *file, void *priv, struct v4l2_buffer *b) 879 { 880 struct sh_vou_device *vou_dev = video_drvdata(file); 881 struct sh_vou_file *vou_file = priv; 882 883 dev_dbg(vou_dev->v4l2_dev.dev, "%s()\n", __func__); 884 885 return videobuf_dqbuf(&vou_file->vbq, b, file->f_flags & O_NONBLOCK); 886 } 887 888 static int sh_vou_streamon(struct file *file, void *priv, 889 enum v4l2_buf_type buftype) 890 { 891 struct sh_vou_device *vou_dev = video_drvdata(file); 892 struct sh_vou_file *vou_file = priv; 893 int ret; 894 895 dev_dbg(vou_dev->v4l2_dev.dev, "%s()\n", __func__); 896 897 ret = v4l2_device_call_until_err(&vou_dev->v4l2_dev, 0, 898 video, s_stream, 1); 899 if (ret < 0 && ret != -ENOIOCTLCMD) 900 return ret; 901 902 /* This calls our .buf_queue() (== sh_vou_buf_queue) */ 903 return videobuf_streamon(&vou_file->vbq); 904 } 905 906 static int sh_vou_streamoff(struct file *file, void *priv, 907 enum v4l2_buf_type buftype) 908 { 909 struct sh_vou_device *vou_dev = video_drvdata(file); 910 struct sh_vou_file *vou_file = priv; 911 912 dev_dbg(vou_dev->v4l2_dev.dev, "%s()\n", __func__); 913 914 /* 915 * This calls buf_release from host driver's videobuf_queue_ops for all 916 * remaining buffers. When the last buffer is freed, stop streaming 917 */ 918 videobuf_streamoff(&vou_file->vbq); 919 v4l2_device_call_until_err(&vou_dev->v4l2_dev, 0, video, s_stream, 0); 920 921 return 0; 922 } 923 924 static u32 sh_vou_ntsc_mode(enum sh_vou_bus_fmt bus_fmt) 925 { 926 switch (bus_fmt) { 927 default: 928 pr_warning("%s(): Invalid bus-format code %d, using default 8-bit\n", 929 __func__, bus_fmt); 930 case SH_VOU_BUS_8BIT: 931 return 1; 932 case SH_VOU_BUS_16BIT: 933 return 0; 934 case SH_VOU_BUS_BT656: 935 return 3; 936 } 937 } 938 939 static int sh_vou_s_std(struct file *file, void *priv, v4l2_std_id std_id) 940 { 941 struct sh_vou_device *vou_dev = video_drvdata(file); 942 int ret; 943 944 dev_dbg(vou_dev->v4l2_dev.dev, "%s(): 0x%llx\n", __func__, std_id); 945 946 if (std_id & ~vou_dev->vdev->tvnorms) 947 return -EINVAL; 948 949 ret = v4l2_device_call_until_err(&vou_dev->v4l2_dev, 0, video, 950 s_std_output, std_id); 951 /* Shall we continue, if the subdev doesn't support .s_std_output()? */ 952 if (ret < 0 && ret != -ENOIOCTLCMD) 953 return ret; 954 955 if (std_id & V4L2_STD_525_60) 956 sh_vou_reg_ab_set(vou_dev, VOUCR, 957 sh_vou_ntsc_mode(vou_dev->pdata->bus_fmt) << 29, 7 << 29); 958 else 959 sh_vou_reg_ab_set(vou_dev, VOUCR, 5 << 29, 7 << 29); 960 961 vou_dev->std = std_id; 962 963 return 0; 964 } 965 966 static int sh_vou_g_std(struct file *file, void *priv, v4l2_std_id *std) 967 { 968 struct sh_vou_device *vou_dev = video_drvdata(file); 969 970 dev_dbg(vou_dev->v4l2_dev.dev, "%s()\n", __func__); 971 972 *std = vou_dev->std; 973 974 return 0; 975 } 976 977 static int sh_vou_g_crop(struct file *file, void *fh, struct v4l2_crop *a) 978 { 979 struct sh_vou_device *vou_dev = video_drvdata(file); 980 981 dev_dbg(vou_dev->v4l2_dev.dev, "%s()\n", __func__); 982 983 a->type = V4L2_BUF_TYPE_VIDEO_OUTPUT; 984 a->c = vou_dev->rect; 985 986 return 0; 987 } 988 989 /* Assume a dull encoder, do all the work ourselves. */ 990 static int sh_vou_s_crop(struct file *file, void *fh, const struct v4l2_crop *a) 991 { 992 struct v4l2_crop a_writable = *a; 993 struct sh_vou_device *vou_dev = video_drvdata(file); 994 struct v4l2_rect *rect = &a_writable.c; 995 struct v4l2_crop sd_crop = {.type = V4L2_BUF_TYPE_VIDEO_OUTPUT}; 996 struct v4l2_pix_format *pix = &vou_dev->pix; 997 struct sh_vou_geometry geo; 998 struct v4l2_mbus_framefmt mbfmt = { 999 /* Revisit: is this the correct code? */ 1000 .code = V4L2_MBUS_FMT_YUYV8_2X8, 1001 .field = V4L2_FIELD_INTERLACED, 1002 .colorspace = V4L2_COLORSPACE_SMPTE170M, 1003 }; 1004 unsigned int img_height_max; 1005 int ret; 1006 1007 dev_dbg(vou_dev->v4l2_dev.dev, "%s(): %ux%u@%u:%u\n", __func__, 1008 rect->width, rect->height, rect->left, rect->top); 1009 1010 if (a->type != V4L2_BUF_TYPE_VIDEO_OUTPUT) 1011 return -EINVAL; 1012 1013 if (vou_dev->std & V4L2_STD_525_60) 1014 img_height_max = 480; 1015 else 1016 img_height_max = 576; 1017 1018 v4l_bound_align_image(&rect->width, 0, VOU_MAX_IMAGE_WIDTH, 1, 1019 &rect->height, 0, img_height_max, 1, 0); 1020 1021 if (rect->width + rect->left > VOU_MAX_IMAGE_WIDTH) 1022 rect->left = VOU_MAX_IMAGE_WIDTH - rect->width; 1023 1024 if (rect->height + rect->top > img_height_max) 1025 rect->top = img_height_max - rect->height; 1026 1027 geo.output = *rect; 1028 geo.in_width = pix->width; 1029 geo.in_height = pix->height; 1030 1031 /* Configure the encoder one-to-one, position at 0, ignore errors */ 1032 sd_crop.c.width = geo.output.width; 1033 sd_crop.c.height = geo.output.height; 1034 /* 1035 * We first issue a S_CROP, so that the subsequent S_FMT delivers the 1036 * final encoder configuration. 1037 */ 1038 v4l2_device_call_until_err(&vou_dev->v4l2_dev, 0, video, 1039 s_crop, &sd_crop); 1040 mbfmt.width = geo.output.width; 1041 mbfmt.height = geo.output.height; 1042 ret = v4l2_device_call_until_err(&vou_dev->v4l2_dev, 0, video, 1043 s_mbus_fmt, &mbfmt); 1044 /* Must be implemented, so, don't check for -ENOIOCTLCMD */ 1045 if (ret < 0) 1046 return ret; 1047 1048 /* Sanity checks */ 1049 if ((unsigned)mbfmt.width > VOU_MAX_IMAGE_WIDTH || 1050 (unsigned)mbfmt.height > img_height_max || 1051 mbfmt.code != V4L2_MBUS_FMT_YUYV8_2X8) 1052 return -EIO; 1053 1054 geo.output.width = mbfmt.width; 1055 geo.output.height = mbfmt.height; 1056 1057 /* 1058 * No down-scaling. According to the API, current call has precedence: 1059 * http://v4l2spec.bytesex.org/spec/x1904.htm#AEN1954 paragraph two. 1060 */ 1061 vou_adjust_input(&geo, vou_dev->std); 1062 1063 /* We tried to preserve output rectangle, but it could have changed */ 1064 vou_dev->rect = geo.output; 1065 pix->width = geo.in_width; 1066 pix->height = geo.in_height; 1067 1068 sh_vou_configure_geometry(vou_dev, vou_dev->pix_idx, 1069 geo.scale_idx_h, geo.scale_idx_v); 1070 1071 return 0; 1072 } 1073 1074 /* 1075 * Total field: NTSC 858 x 2 * 262/263, PAL 864 x 2 * 312/313, default rectangle 1076 * is the initial register values, height takes the interlaced format into 1077 * account. The actual image can only go up to 720 x 2 * 240, So, VOUVPR can 1078 * actually only meaningfully contain values <= 720 and <= 240 respectively, and 1079 * not <= 864 and <= 312. 1080 */ 1081 static int sh_vou_cropcap(struct file *file, void *priv, 1082 struct v4l2_cropcap *a) 1083 { 1084 struct sh_vou_device *vou_dev = video_drvdata(file); 1085 1086 dev_dbg(vou_dev->v4l2_dev.dev, "%s()\n", __func__); 1087 1088 a->type = V4L2_BUF_TYPE_VIDEO_OUTPUT; 1089 a->bounds.left = 0; 1090 a->bounds.top = 0; 1091 a->bounds.width = VOU_MAX_IMAGE_WIDTH; 1092 a->bounds.height = VOU_MAX_IMAGE_HEIGHT; 1093 /* Default = max, set VOUDPR = 0, which is not hardware default */ 1094 a->defrect.left = 0; 1095 a->defrect.top = 0; 1096 a->defrect.width = VOU_MAX_IMAGE_WIDTH; 1097 a->defrect.height = VOU_MAX_IMAGE_HEIGHT; 1098 a->pixelaspect.numerator = 1; 1099 a->pixelaspect.denominator = 1; 1100 1101 return 0; 1102 } 1103 1104 static irqreturn_t sh_vou_isr(int irq, void *dev_id) 1105 { 1106 struct sh_vou_device *vou_dev = dev_id; 1107 static unsigned long j; 1108 struct videobuf_buffer *vb; 1109 static int cnt; 1110 u32 irq_status = sh_vou_reg_a_read(vou_dev, VOUIR), masked; 1111 u32 vou_status = sh_vou_reg_a_read(vou_dev, VOUSTR); 1112 1113 if (!(irq_status & 0x300)) { 1114 if (printk_timed_ratelimit(&j, 500)) 1115 dev_warn(vou_dev->v4l2_dev.dev, "IRQ status 0x%x!\n", 1116 irq_status); 1117 return IRQ_NONE; 1118 } 1119 1120 spin_lock(&vou_dev->lock); 1121 if (!vou_dev->active || list_empty(&vou_dev->queue)) { 1122 if (printk_timed_ratelimit(&j, 500)) 1123 dev_warn(vou_dev->v4l2_dev.dev, 1124 "IRQ without active buffer: %x!\n", irq_status); 1125 /* Just ack: buf_release will disable further interrupts */ 1126 sh_vou_reg_a_set(vou_dev, VOUIR, 0, 0x300); 1127 spin_unlock(&vou_dev->lock); 1128 return IRQ_HANDLED; 1129 } 1130 1131 masked = ~(0x300 & irq_status) & irq_status & 0x30304; 1132 dev_dbg(vou_dev->v4l2_dev.dev, 1133 "IRQ status 0x%x -> 0x%x, VOU status 0x%x, cnt %d\n", 1134 irq_status, masked, vou_status, cnt); 1135 1136 cnt++; 1137 /* side = vou_status & 0x10000; */ 1138 1139 /* Clear only set interrupts */ 1140 sh_vou_reg_a_write(vou_dev, VOUIR, masked); 1141 1142 vb = vou_dev->active; 1143 list_del(&vb->queue); 1144 1145 vb->state = VIDEOBUF_DONE; 1146 v4l2_get_timestamp(&vb->ts); 1147 vb->field_count++; 1148 wake_up(&vb->done); 1149 1150 if (list_empty(&vou_dev->queue)) { 1151 /* Stop VOU */ 1152 dev_dbg(vou_dev->v4l2_dev.dev, "%s: queue empty after %d\n", 1153 __func__, cnt); 1154 sh_vou_reg_a_set(vou_dev, VOUER, 0, 1); 1155 vou_dev->active = NULL; 1156 vou_dev->status = SH_VOU_INITIALISING; 1157 /* Disable End-of-Frame (VSYNC) interrupts */ 1158 sh_vou_reg_a_set(vou_dev, VOUIR, 0, 0x30000); 1159 spin_unlock(&vou_dev->lock); 1160 return IRQ_HANDLED; 1161 } 1162 1163 vou_dev->active = list_entry(vou_dev->queue.next, 1164 struct videobuf_buffer, queue); 1165 1166 if (vou_dev->active->queue.next != &vou_dev->queue) { 1167 struct videobuf_buffer *new = list_entry(vou_dev->active->queue.next, 1168 struct videobuf_buffer, queue); 1169 sh_vou_schedule_next(vou_dev, new); 1170 } 1171 1172 spin_unlock(&vou_dev->lock); 1173 1174 return IRQ_HANDLED; 1175 } 1176 1177 static int sh_vou_hw_init(struct sh_vou_device *vou_dev) 1178 { 1179 struct sh_vou_pdata *pdata = vou_dev->pdata; 1180 u32 voucr = sh_vou_ntsc_mode(pdata->bus_fmt) << 29; 1181 int i = 100; 1182 1183 /* Disable all IRQs */ 1184 sh_vou_reg_a_write(vou_dev, VOUIR, 0); 1185 1186 /* Reset VOU interfaces - registers unaffected */ 1187 sh_vou_reg_a_write(vou_dev, VOUSRR, 0x101); 1188 while (--i && (sh_vou_reg_a_read(vou_dev, VOUSRR) & 0x101)) 1189 udelay(1); 1190 1191 if (!i) 1192 return -ETIMEDOUT; 1193 1194 dev_dbg(vou_dev->v4l2_dev.dev, "Reset took %dus\n", 100 - i); 1195 1196 if (pdata->flags & SH_VOU_PCLK_FALLING) 1197 voucr |= 1 << 28; 1198 if (pdata->flags & SH_VOU_HSYNC_LOW) 1199 voucr |= 1 << 27; 1200 if (pdata->flags & SH_VOU_VSYNC_LOW) 1201 voucr |= 1 << 26; 1202 sh_vou_reg_ab_set(vou_dev, VOUCR, voucr, 0xfc000000); 1203 1204 /* Manual register side switching at first */ 1205 sh_vou_reg_a_write(vou_dev, VOURCR, 4); 1206 /* Default - fixed HSYNC length, can be made configurable is required */ 1207 sh_vou_reg_ab_write(vou_dev, VOUMSR, 0x800000); 1208 1209 return 0; 1210 } 1211 1212 /* File operations */ 1213 static int sh_vou_open(struct file *file) 1214 { 1215 struct sh_vou_device *vou_dev = video_drvdata(file); 1216 struct sh_vou_file *vou_file = kzalloc(sizeof(struct sh_vou_file), 1217 GFP_KERNEL); 1218 1219 if (!vou_file) 1220 return -ENOMEM; 1221 1222 dev_dbg(vou_dev->v4l2_dev.dev, "%s()\n", __func__); 1223 1224 file->private_data = vou_file; 1225 1226 if (mutex_lock_interruptible(&vou_dev->fop_lock)) 1227 return -ERESTARTSYS; 1228 if (atomic_inc_return(&vou_dev->use_count) == 1) { 1229 int ret; 1230 /* First open */ 1231 vou_dev->status = SH_VOU_INITIALISING; 1232 pm_runtime_get_sync(vou_dev->v4l2_dev.dev); 1233 ret = sh_vou_hw_init(vou_dev); 1234 if (ret < 0) { 1235 atomic_dec(&vou_dev->use_count); 1236 pm_runtime_put(vou_dev->v4l2_dev.dev); 1237 vou_dev->status = SH_VOU_IDLE; 1238 mutex_unlock(&vou_dev->fop_lock); 1239 return ret; 1240 } 1241 } 1242 1243 videobuf_queue_dma_contig_init(&vou_file->vbq, &sh_vou_video_qops, 1244 vou_dev->v4l2_dev.dev, &vou_dev->lock, 1245 V4L2_BUF_TYPE_VIDEO_OUTPUT, 1246 V4L2_FIELD_NONE, 1247 sizeof(struct videobuf_buffer), 1248 vou_dev->vdev, &vou_dev->fop_lock); 1249 mutex_unlock(&vou_dev->fop_lock); 1250 1251 return 0; 1252 } 1253 1254 static int sh_vou_release(struct file *file) 1255 { 1256 struct sh_vou_device *vou_dev = video_drvdata(file); 1257 struct sh_vou_file *vou_file = file->private_data; 1258 1259 dev_dbg(vou_dev->v4l2_dev.dev, "%s()\n", __func__); 1260 1261 if (!atomic_dec_return(&vou_dev->use_count)) { 1262 mutex_lock(&vou_dev->fop_lock); 1263 /* Last close */ 1264 vou_dev->status = SH_VOU_IDLE; 1265 sh_vou_reg_a_set(vou_dev, VOUER, 0, 0x101); 1266 pm_runtime_put(vou_dev->v4l2_dev.dev); 1267 mutex_unlock(&vou_dev->fop_lock); 1268 } 1269 1270 file->private_data = NULL; 1271 kfree(vou_file); 1272 1273 return 0; 1274 } 1275 1276 static int sh_vou_mmap(struct file *file, struct vm_area_struct *vma) 1277 { 1278 struct sh_vou_device *vou_dev = video_drvdata(file); 1279 struct sh_vou_file *vou_file = file->private_data; 1280 int ret; 1281 1282 dev_dbg(vou_dev->v4l2_dev.dev, "%s()\n", __func__); 1283 1284 if (mutex_lock_interruptible(&vou_dev->fop_lock)) 1285 return -ERESTARTSYS; 1286 ret = videobuf_mmap_mapper(&vou_file->vbq, vma); 1287 mutex_unlock(&vou_dev->fop_lock); 1288 return ret; 1289 } 1290 1291 static unsigned int sh_vou_poll(struct file *file, poll_table *wait) 1292 { 1293 struct sh_vou_device *vou_dev = video_drvdata(file); 1294 struct sh_vou_file *vou_file = file->private_data; 1295 unsigned int res; 1296 1297 dev_dbg(vou_dev->v4l2_dev.dev, "%s()\n", __func__); 1298 1299 mutex_lock(&vou_dev->fop_lock); 1300 res = videobuf_poll_stream(file, &vou_file->vbq, wait); 1301 mutex_unlock(&vou_dev->fop_lock); 1302 return res; 1303 } 1304 1305 /* sh_vou display ioctl operations */ 1306 static const struct v4l2_ioctl_ops sh_vou_ioctl_ops = { 1307 .vidioc_querycap = sh_vou_querycap, 1308 .vidioc_enum_fmt_vid_out = sh_vou_enum_fmt_vid_out, 1309 .vidioc_g_fmt_vid_out = sh_vou_g_fmt_vid_out, 1310 .vidioc_s_fmt_vid_out = sh_vou_s_fmt_vid_out, 1311 .vidioc_try_fmt_vid_out = sh_vou_try_fmt_vid_out, 1312 .vidioc_reqbufs = sh_vou_reqbufs, 1313 .vidioc_querybuf = sh_vou_querybuf, 1314 .vidioc_qbuf = sh_vou_qbuf, 1315 .vidioc_dqbuf = sh_vou_dqbuf, 1316 .vidioc_streamon = sh_vou_streamon, 1317 .vidioc_streamoff = sh_vou_streamoff, 1318 .vidioc_s_std = sh_vou_s_std, 1319 .vidioc_g_std = sh_vou_g_std, 1320 .vidioc_cropcap = sh_vou_cropcap, 1321 .vidioc_g_crop = sh_vou_g_crop, 1322 .vidioc_s_crop = sh_vou_s_crop, 1323 }; 1324 1325 static const struct v4l2_file_operations sh_vou_fops = { 1326 .owner = THIS_MODULE, 1327 .open = sh_vou_open, 1328 .release = sh_vou_release, 1329 .unlocked_ioctl = video_ioctl2, 1330 .mmap = sh_vou_mmap, 1331 .poll = sh_vou_poll, 1332 }; 1333 1334 static const struct video_device sh_vou_video_template = { 1335 .name = "sh_vou", 1336 .fops = &sh_vou_fops, 1337 .ioctl_ops = &sh_vou_ioctl_ops, 1338 .tvnorms = V4L2_STD_525_60, /* PAL only supported in 8-bit non-bt656 mode */ 1339 .vfl_dir = VFL_DIR_TX, 1340 }; 1341 1342 static int sh_vou_probe(struct platform_device *pdev) 1343 { 1344 struct sh_vou_pdata *vou_pdata = pdev->dev.platform_data; 1345 struct v4l2_rect *rect; 1346 struct v4l2_pix_format *pix; 1347 struct i2c_adapter *i2c_adap; 1348 struct video_device *vdev; 1349 struct sh_vou_device *vou_dev; 1350 struct resource *reg_res, *region; 1351 struct v4l2_subdev *subdev; 1352 int irq, ret; 1353 1354 reg_res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 1355 irq = platform_get_irq(pdev, 0); 1356 1357 if (!vou_pdata || !reg_res || irq <= 0) { 1358 dev_err(&pdev->dev, "Insufficient VOU platform information.\n"); 1359 return -ENODEV; 1360 } 1361 1362 vou_dev = kzalloc(sizeof(*vou_dev), GFP_KERNEL); 1363 if (!vou_dev) 1364 return -ENOMEM; 1365 1366 INIT_LIST_HEAD(&vou_dev->queue); 1367 spin_lock_init(&vou_dev->lock); 1368 mutex_init(&vou_dev->fop_lock); 1369 atomic_set(&vou_dev->use_count, 0); 1370 vou_dev->pdata = vou_pdata; 1371 vou_dev->status = SH_VOU_IDLE; 1372 1373 rect = &vou_dev->rect; 1374 pix = &vou_dev->pix; 1375 1376 /* Fill in defaults */ 1377 vou_dev->std = V4L2_STD_NTSC_M; 1378 rect->left = 0; 1379 rect->top = 0; 1380 rect->width = VOU_MAX_IMAGE_WIDTH; 1381 rect->height = 480; 1382 pix->width = VOU_MAX_IMAGE_WIDTH; 1383 pix->height = 480; 1384 pix->pixelformat = V4L2_PIX_FMT_YVYU; 1385 pix->field = V4L2_FIELD_NONE; 1386 pix->bytesperline = VOU_MAX_IMAGE_WIDTH * 2; 1387 pix->sizeimage = VOU_MAX_IMAGE_WIDTH * 2 * 480; 1388 pix->colorspace = V4L2_COLORSPACE_SMPTE170M; 1389 1390 region = request_mem_region(reg_res->start, resource_size(reg_res), 1391 pdev->name); 1392 if (!region) { 1393 dev_err(&pdev->dev, "VOU region already claimed\n"); 1394 ret = -EBUSY; 1395 goto ereqmemreg; 1396 } 1397 1398 vou_dev->base = ioremap(reg_res->start, resource_size(reg_res)); 1399 if (!vou_dev->base) { 1400 ret = -ENOMEM; 1401 goto emap; 1402 } 1403 1404 ret = request_irq(irq, sh_vou_isr, 0, "vou", vou_dev); 1405 if (ret < 0) 1406 goto ereqirq; 1407 1408 ret = v4l2_device_register(&pdev->dev, &vou_dev->v4l2_dev); 1409 if (ret < 0) { 1410 dev_err(&pdev->dev, "Error registering v4l2 device\n"); 1411 goto ev4l2devreg; 1412 } 1413 1414 /* Allocate memory for video device */ 1415 vdev = video_device_alloc(); 1416 if (vdev == NULL) { 1417 ret = -ENOMEM; 1418 goto evdevalloc; 1419 } 1420 1421 *vdev = sh_vou_video_template; 1422 if (vou_pdata->bus_fmt == SH_VOU_BUS_8BIT) 1423 vdev->tvnorms |= V4L2_STD_PAL; 1424 vdev->v4l2_dev = &vou_dev->v4l2_dev; 1425 vdev->release = video_device_release; 1426 vdev->lock = &vou_dev->fop_lock; 1427 1428 vou_dev->vdev = vdev; 1429 video_set_drvdata(vdev, vou_dev); 1430 1431 pm_runtime_enable(&pdev->dev); 1432 pm_runtime_resume(&pdev->dev); 1433 1434 i2c_adap = i2c_get_adapter(vou_pdata->i2c_adap); 1435 if (!i2c_adap) { 1436 ret = -ENODEV; 1437 goto ei2cgadap; 1438 } 1439 1440 ret = sh_vou_hw_init(vou_dev); 1441 if (ret < 0) 1442 goto ereset; 1443 1444 subdev = v4l2_i2c_new_subdev_board(&vou_dev->v4l2_dev, i2c_adap, 1445 vou_pdata->board_info, NULL); 1446 if (!subdev) { 1447 ret = -ENOMEM; 1448 goto ei2cnd; 1449 } 1450 1451 ret = video_register_device(vdev, VFL_TYPE_GRABBER, -1); 1452 if (ret < 0) 1453 goto evregdev; 1454 1455 return 0; 1456 1457 evregdev: 1458 ei2cnd: 1459 ereset: 1460 i2c_put_adapter(i2c_adap); 1461 ei2cgadap: 1462 video_device_release(vdev); 1463 pm_runtime_disable(&pdev->dev); 1464 evdevalloc: 1465 v4l2_device_unregister(&vou_dev->v4l2_dev); 1466 ev4l2devreg: 1467 free_irq(irq, vou_dev); 1468 ereqirq: 1469 iounmap(vou_dev->base); 1470 emap: 1471 release_mem_region(reg_res->start, resource_size(reg_res)); 1472 ereqmemreg: 1473 kfree(vou_dev); 1474 return ret; 1475 } 1476 1477 static int sh_vou_remove(struct platform_device *pdev) 1478 { 1479 int irq = platform_get_irq(pdev, 0); 1480 struct v4l2_device *v4l2_dev = platform_get_drvdata(pdev); 1481 struct sh_vou_device *vou_dev = container_of(v4l2_dev, 1482 struct sh_vou_device, v4l2_dev); 1483 struct v4l2_subdev *sd = list_entry(v4l2_dev->subdevs.next, 1484 struct v4l2_subdev, list); 1485 struct i2c_client *client = v4l2_get_subdevdata(sd); 1486 struct resource *reg_res; 1487 1488 if (irq > 0) 1489 free_irq(irq, vou_dev); 1490 pm_runtime_disable(&pdev->dev); 1491 video_unregister_device(vou_dev->vdev); 1492 i2c_put_adapter(client->adapter); 1493 v4l2_device_unregister(&vou_dev->v4l2_dev); 1494 iounmap(vou_dev->base); 1495 reg_res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 1496 if (reg_res) 1497 release_mem_region(reg_res->start, resource_size(reg_res)); 1498 kfree(vou_dev); 1499 return 0; 1500 } 1501 1502 static struct platform_driver __refdata sh_vou = { 1503 .remove = sh_vou_remove, 1504 .driver = { 1505 .name = "sh-vou", 1506 .owner = THIS_MODULE, 1507 }, 1508 }; 1509 1510 module_platform_driver_probe(sh_vou, sh_vou_probe); 1511 1512 MODULE_DESCRIPTION("SuperH VOU driver"); 1513 MODULE_AUTHOR("Guennadi Liakhovetski <g.liakhovetski@gmx.de>"); 1514 MODULE_LICENSE("GPL v2"); 1515 MODULE_VERSION("0.1.0"); 1516 MODULE_ALIAS("platform:sh-vou"); 1517 1518 int ldv_probe_1(void); 1519 int ldv_retval_2; 1520 int ldv_retval_0; 1521 int ldv_retval_4; 1522 void ldv_initialize(void); 1523 int ldv_retval_1; 1524 void ldv_check_final_state(void); 1525 int ldv_retval_3; 1526 1527 int __VERIFIER_nondet_int(void); 1528 1529 void ldv_initialyze_v4l2_file_operations_2(void){ 1530 sh_vou_fops_group0 = ldv_undef_ptr(); 1531 } 1532 1533 void ldv_platform_driver_init_1(void){ 1534 sh_vou_group1 = ldv_successful_alloc(sizeof(struct platform_device)); 1535 } 1536 1537 1538 void ldv_videobuf_queue_ops_4(void){ 1539 sh_vou_video_qops_group1 = ldv_undef_ptr(); 1540 sh_vou_video_qops_group2 = ldv_undef_ptr(); 1541 } 1542 1543 1544 void ldv_platform_probe_1(int (*probe)(struct platform_device *)){ 1545 int err; 1546 err = probe(sh_vou_group1); 1547 if(err == 0){ 1548 probed_1 = 1; 1549 ref_cnt++; 1550 } 1551 } 1552 1553 1554 void ldv_initialyze_v4l2_ioctl_ops_3(void){ 1555 sh_vou_ioctl_ops_group0 = ldv_undef_ptr(); 1556 sh_vou_ioctl_ops_group1 = ldv_undef_ptr(); 1557 sh_vou_ioctl_ops_group2 = ldv_undef_ptr(); 1558 } 1559 1560 /* DEG-ENVIRONMENT-BEGIN */ 1561 extern void ldv_main_exported_4(void); 1562 extern void ldv_main_exported_1(void); 1563 extern void ldv_main_exported_0(void); 1564 extern void ldv_main_exported_3(void); 1565 extern void ldv_main_exported_2(void); 1566 1567 //********************* LDV MAIN ********************* 1568 //main 1569 void entry_point(void){ 1570 ldv_initialize(); 1571 //args for callbacks 1572 unsigned int *ldvarg1; 1573 enum v4l2_field ldvarg0; 1574 unsigned int *ldvarg2; 1575 enum v4l2_buf_type ldvarg18; 1576 struct v4l2_capability *ldvarg11; 1577 struct v4l2_crop *ldvarg20; 1578 struct v4l2_fmtdesc *ldvarg7; 1579 void *ldvarg23; 1580 enum v4l2_buf_type ldvarg3; 1581 void *ldvarg12; 1582 void *ldvarg8; 1583 void *ldvarg13; 1584 void *ldvarg10; 1585 v4l2_std_id *ldvarg9; 1586 void *ldvarg24; 1587 void *ldvarg27; 1588 struct v4l2_requestbuffers *ldvarg26; 1589 struct v4l2_crop const *ldvarg5; 1590 void *ldvarg6; 1591 void *ldvarg15; 1592 void *ldvarg16; 1593 void *ldvarg21; 1594 void *ldvarg25; 1595 void *ldvarg4; 1596 struct v4l2_cropcap *ldvarg14; 1597 void *ldvarg17; 1598 v4l2_std_id ldvarg22; 1599 void *ldvarg19; 1600 void *ldvarg28; 1601 struct vm_area_struct *ldvarg32; 1602 struct poll_table_struct *ldvarg31; 1603 long unsigned int ldvarg29; 1604 unsigned int ldvarg30; 1605 //initialization of machine states 1606 ldv_state_variable_4=0; 1607 ldv_state_variable_1=0; 1608 ref_cnt=0; 1609 ldv_state_variable_0=1; 1610 ldv_state_variable_3=0; 1611 ldv_state_variable_2=0; 1612 while(1){ 1613 switch(__VERIFIER_nondet_int()){ 1614 case 0:{ 1615 /*DEG-struct: handlers from structure sh_vou_video_qops*/ 1616 /*DEG-CHECK: checking registration of sh_vou_video_qops structure*/ 1617 if(ldv_state_variable_4 != 0){ 1618 switch(__VERIFIER_nondet_int()){ 1619 case 0:{ 1620 /*DEG-state: state 1 (look at corresponding state-chart diagram for details)*/ 1621 if(ldv_state_variable_4 == 1){ 1622 /*DEG-CALL: handler buf_setup from sh_vou_video_qops*/ 1623 (& sh_vou_buf_setup)(sh_vou_video_qops_group1,ldvarg2,ldvarg1); 1624 /*DEG-postcall: default*/ 1625 ldv_state_variable_4 = 1; 1626 } 1627 /*DEG-state: state 2 (look at corresponding state-chart diagram for details)*/ 1628 if(ldv_state_variable_4 == 2){ 1629 /*DEG-CALL: handler buf_setup from sh_vou_video_qops*/ 1630 (& sh_vou_buf_setup)(sh_vou_video_qops_group1,ldvarg2,ldvarg1); 1631 /*DEG-postcall: default*/ 1632 ldv_state_variable_4 = 2; 1633 } 1634 } 1635 break; 1636 case 1:{ 1637 /*DEG-state: state 2 (look at corresponding state-chart diagram for details)*/ 1638 if(ldv_state_variable_4 == 2){ 1639 /*DEG-CALL: handler buf_release from sh_vou_video_qops*/ 1640 (& sh_vou_buf_release)(sh_vou_video_qops_group1,sh_vou_video_qops_group2); 1641 /*DEG-postcall: free resources*/ 1642 ldv_state_variable_4 = 1; 1643 ref_cnt--; 1644 } 1645 } 1646 break; 1647 case 2:{ 1648 /*DEG-state: state 1 (look at corresponding state-chart diagram for details)*/ 1649 if(ldv_state_variable_4 == 1){ 1650 /*DEG-CALL: handler buf_queue from sh_vou_video_qops*/ 1651 (& sh_vou_buf_queue)(sh_vou_video_qops_group1,sh_vou_video_qops_group2); 1652 /*DEG-postcall: default*/ 1653 ldv_state_variable_4 = 1; 1654 } 1655 /*DEG-state: state 2 (look at corresponding state-chart diagram for details)*/ 1656 if(ldv_state_variable_4 == 2){ 1657 /*DEG-CALL: handler buf_queue from sh_vou_video_qops*/ 1658 (& sh_vou_buf_queue)(sh_vou_video_qops_group1,sh_vou_video_qops_group2); 1659 /*DEG-postcall: default*/ 1660 ldv_state_variable_4 = 2; 1661 } 1662 } 1663 break; 1664 case 3:{ 1665 /*DEG-state: state 1 (look at corresponding state-chart diagram for details)*/ 1666 if(ldv_state_variable_4 == 1){ 1667 /*DEG-CALL: handler buf_prepare from sh_vou_video_qops*/ 1668 ldv_retval_0=(& sh_vou_buf_prepare)(sh_vou_video_qops_group1,sh_vou_video_qops_group2,ldvarg0); 1669 /*DEG-postcall: check return value*/ 1670 if(ldv_retval_0==0){ 1671 ldv_state_variable_4 = 2; 1672 ref_cnt++; 1673 } 1674 } 1675 } 1676 break; 1677 default: ldv_assume(0); 1678 } 1679 } 1680 } 1681 break; 1682 case 1:{ 1683 /*DEG-struct: handlers from structure sh_vou*/ 1684 /*DEG-CHECK: checking registration of sh_vou structure*/ 1685 if(ldv_state_variable_1 != 0){ 1686 switch(__VERIFIER_nondet_int()){ 1687 case 0:{ 1688 /*DEG-state: state 1 (look at corresponding state-chart diagram for details)*/ 1689 if(ldv_state_variable_1 == 1 && probed_1 == 1){ 1690 /*DEG-CALL: handler remove from sh_vou*/ 1691 ldv_retval_2=(& sh_vou_remove)(sh_vou_group1); 1692 if(ldv_retval_2==0){ 1693 ldv_state_variable_1 = 1; 1694 ref_cnt--; 1695 probed_1 = 0; 1696 } 1697 } 1698 /*DEG-state: state 2 (look at corresponding state-chart diagram for details)*/ 1699 if(ldv_state_variable_1 == 2 && probed_1 == 1){ 1700 /*DEG-CALL: handler remove from sh_vou*/ 1701 ldv_retval_2=(& sh_vou_remove)(sh_vou_group1); 1702 if(ldv_retval_2==0){ 1703 ldv_state_variable_1 = 1; 1704 ref_cnt--; 1705 probed_1 = 0; 1706 } 1707 } 1708 } 1709 break; 1710 case 1:{ 1711 /*DEG-state: state 1 (look at corresponding state-chart diagram for details)*/ 1712 if(ldv_state_variable_1 == 1){ 1713 /*DEG-CALL: handler probe from sh_vou*/ 1714 ldv_retval_1=ldv_probe_1(); 1715 if(ldv_retval_1==0){ 1716 ldv_state_variable_1 = 2; 1717 ref_cnt++; 1718 probed_1 = 1; 1719 } 1720 } 1721 } 1722 break; 1723 default: ldv_assume(0); 1724 } 1725 } 1726 } 1727 break; 1728 case 2:{ 1729 /*DEG-struct: handlers from structure module*/ 1730 /*DEG-CHECK: checking registration of module structure*/ 1731 if(ldv_state_variable_0 != 0){ 1732 switch(__VERIFIER_nondet_int()){ 1733 case 0:{ 1734 /*DEG-state: state 3 (look at corresponding state-chart diagram for details)*/ 1735 if(ldv_state_variable_0 == 3 && ref_cnt==0){ 1736 /*DEG-CALL: handler module_exit from module*/ 1737 sh_vou_exit(); 1738 ldv_state_variable_0 = 2; 1739 goto ldv_final; 1740 } 1741 } 1742 break; 1743 case 1:{ 1744 /*DEG-state: state 1 (look at corresponding state-chart diagram for details)*/ 1745 if(ldv_state_variable_0 == 1){ 1746 /*DEG-CALL: handler module_init from module*/ 1747 ldv_retval_3=sh_vou_init(); 1748 /*DEG-postcall: if success*/ 1749 if(ldv_retval_3==0){ 1750 ldv_state_variable_0 = 3; 1751 ldv_state_variable_2 = 1; 1752 ldv_initialyze_v4l2_file_operations_2(); 1753 ldv_state_variable_3 = 1; 1754 ldv_initialyze_v4l2_ioctl_ops_3(); 1755 ldv_state_variable_4 = 1; 1756 ldv_videobuf_queue_ops_4(); 1757 } 1758 if(ldv_retval_3!=0){ 1759 ldv_state_variable_0 = 2; 1760 goto ldv_final; 1761 } 1762 } 1763 } 1764 break; 1765 default: ldv_assume(0); 1766 } 1767 } 1768 } 1769 break; 1770 case 3:{ 1771 /*DEG-struct: handlers from structure sh_vou_ioctl_ops*/ 1772 /*DEG-CHECK: checking registration of sh_vou_ioctl_ops structure*/ 1773 if(ldv_state_variable_3 != 0){ 1774 switch(__VERIFIER_nondet_int()){ 1775 case 0:{ 1776 /*DEG-state: state 1 (look at corresponding state-chart diagram for details)*/ 1777 if(ldv_state_variable_3 == 1){ 1778 /*DEG-CALL: handler vidioc_g_fmt_vid_out from sh_vou_ioctl_ops*/ 1779 (& sh_vou_g_fmt_vid_out)(sh_vou_ioctl_ops_group2,ldvarg28,sh_vou_ioctl_ops_group1); 1780 /*DEG-postcall: default*/ 1781 ldv_state_variable_3 = 1; 1782 } 1783 } 1784 break; 1785 case 1:{ 1786 /*DEG-state: state 1 (look at corresponding state-chart diagram for details)*/ 1787 if(ldv_state_variable_3 == 1){ 1788 /*DEG-CALL: handler vidioc_reqbufs from sh_vou_ioctl_ops*/ 1789 (& sh_vou_reqbufs)(sh_vou_ioctl_ops_group2,ldvarg27,ldvarg26); 1790 /*DEG-postcall: default*/ 1791 ldv_state_variable_3 = 1; 1792 } 1793 } 1794 break; 1795 case 2:{ 1796 /*DEG-state: state 1 (look at corresponding state-chart diagram for details)*/ 1797 if(ldv_state_variable_3 == 1){ 1798 /*DEG-CALL: handler vidioc_s_fmt_vid_out from sh_vou_ioctl_ops*/ 1799 (& sh_vou_s_fmt_vid_out)(sh_vou_ioctl_ops_group2,ldvarg25,sh_vou_ioctl_ops_group1); 1800 /*DEG-postcall: default*/ 1801 ldv_state_variable_3 = 1; 1802 } 1803 } 1804 break; 1805 case 3:{ 1806 /*DEG-state: state 1 (look at corresponding state-chart diagram for details)*/ 1807 if(ldv_state_variable_3 == 1){ 1808 /*DEG-CALL: handler vidioc_try_fmt_vid_out from sh_vou_ioctl_ops*/ 1809 (& sh_vou_try_fmt_vid_out)(sh_vou_ioctl_ops_group2,ldvarg24,sh_vou_ioctl_ops_group1); 1810 /*DEG-postcall: default*/ 1811 ldv_state_variable_3 = 1; 1812 } 1813 } 1814 break; 1815 case 4:{ 1816 /*DEG-state: state 1 (look at corresponding state-chart diagram for details)*/ 1817 if(ldv_state_variable_3 == 1){ 1818 /*DEG-CALL: handler vidioc_s_std from sh_vou_ioctl_ops*/ 1819 (& sh_vou_s_std)(sh_vou_ioctl_ops_group2,ldvarg23,ldvarg22); 1820 /*DEG-postcall: default*/ 1821 ldv_state_variable_3 = 1; 1822 } 1823 } 1824 break; 1825 case 5:{ 1826 /*DEG-state: state 1 (look at corresponding state-chart diagram for details)*/ 1827 if(ldv_state_variable_3 == 1){ 1828 /*DEG-CALL: handler vidioc_g_crop from sh_vou_ioctl_ops*/ 1829 (& sh_vou_g_crop)(sh_vou_ioctl_ops_group2,ldvarg21,ldvarg20); 1830 /*DEG-postcall: default*/ 1831 ldv_state_variable_3 = 1; 1832 } 1833 } 1834 break; 1835 case 6:{ 1836 /*DEG-state: state 1 (look at corresponding state-chart diagram for details)*/ 1837 if(ldv_state_variable_3 == 1){ 1838 /*DEG-CALL: handler vidioc_streamoff from sh_vou_ioctl_ops*/ 1839 (& sh_vou_streamoff)(sh_vou_ioctl_ops_group2,ldvarg19,ldvarg18); 1840 /*DEG-postcall: default*/ 1841 ldv_state_variable_3 = 1; 1842 } 1843 } 1844 break; 1845 case 7:{ 1846 /*DEG-state: state 1 (look at corresponding state-chart diagram for details)*/ 1847 if(ldv_state_variable_3 == 1){ 1848 /*DEG-CALL: handler vidioc_dqbuf from sh_vou_ioctl_ops*/ 1849 (& sh_vou_dqbuf)(sh_vou_ioctl_ops_group2,ldvarg17,sh_vou_ioctl_ops_group0); 1850 /*DEG-postcall: default*/ 1851 ldv_state_variable_3 = 1; 1852 } 1853 } 1854 break; 1855 case 8:{ 1856 /*DEG-state: state 1 (look at corresponding state-chart diagram for details)*/ 1857 if(ldv_state_variable_3 == 1){ 1858 /*DEG-CALL: handler vidioc_querybuf from sh_vou_ioctl_ops*/ 1859 (& sh_vou_querybuf)(sh_vou_ioctl_ops_group2,ldvarg16,sh_vou_ioctl_ops_group0); 1860 /*DEG-postcall: default*/ 1861 ldv_state_variable_3 = 1; 1862 } 1863 } 1864 break; 1865 case 9:{ 1866 /*DEG-state: state 1 (look at corresponding state-chart diagram for details)*/ 1867 if(ldv_state_variable_3 == 1){ 1868 /*DEG-CALL: handler vidioc_cropcap from sh_vou_ioctl_ops*/ 1869 (& sh_vou_cropcap)(sh_vou_ioctl_ops_group2,ldvarg15,ldvarg14); 1870 /*DEG-postcall: default*/ 1871 ldv_state_variable_3 = 1; 1872 } 1873 } 1874 break; 1875 case 10:{ 1876 /*DEG-state: state 1 (look at corresponding state-chart diagram for details)*/ 1877 if(ldv_state_variable_3 == 1){ 1878 /*DEG-CALL: handler vidioc_qbuf from sh_vou_ioctl_ops*/ 1879 (& sh_vou_qbuf)(sh_vou_ioctl_ops_group2,ldvarg13,sh_vou_ioctl_ops_group0); 1880 /*DEG-postcall: default*/ 1881 ldv_state_variable_3 = 1; 1882 } 1883 } 1884 break; 1885 case 11:{ 1886 /*DEG-state: state 1 (look at corresponding state-chart diagram for details)*/ 1887 if(ldv_state_variable_3 == 1){ 1888 /*DEG-CALL: handler vidioc_querycap from sh_vou_ioctl_ops*/ 1889 (& sh_vou_querycap)(sh_vou_ioctl_ops_group2,ldvarg12,ldvarg11); 1890 /*DEG-postcall: default*/ 1891 ldv_state_variable_3 = 1; 1892 } 1893 } 1894 break; 1895 case 12:{ 1896 /*DEG-state: state 1 (look at corresponding state-chart diagram for details)*/ 1897 if(ldv_state_variable_3 == 1){ 1898 /*DEG-CALL: handler vidioc_g_std from sh_vou_ioctl_ops*/ 1899 (& sh_vou_g_std)(sh_vou_ioctl_ops_group2,ldvarg10,ldvarg9); 1900 /*DEG-postcall: default*/ 1901 ldv_state_variable_3 = 1; 1902 } 1903 } 1904 break; 1905 case 13:{ 1906 /*DEG-state: state 1 (look at corresponding state-chart diagram for details)*/ 1907 if(ldv_state_variable_3 == 1){ 1908 /*DEG-CALL: handler vidioc_enum_fmt_vid_out from sh_vou_ioctl_ops*/ 1909 (& sh_vou_enum_fmt_vid_out)(sh_vou_ioctl_ops_group2,ldvarg8,ldvarg7); 1910 /*DEG-postcall: default*/ 1911 ldv_state_variable_3 = 1; 1912 } 1913 } 1914 break; 1915 case 14:{ 1916 /*DEG-state: state 1 (look at corresponding state-chart diagram for details)*/ 1917 if(ldv_state_variable_3 == 1){ 1918 /*DEG-CALL: handler vidioc_s_crop from sh_vou_ioctl_ops*/ 1919 (& sh_vou_s_crop)(sh_vou_ioctl_ops_group2,ldvarg6,ldvarg5); 1920 /*DEG-postcall: default*/ 1921 ldv_state_variable_3 = 1; 1922 } 1923 } 1924 break; 1925 case 15:{ 1926 /*DEG-state: state 1 (look at corresponding state-chart diagram for details)*/ 1927 if(ldv_state_variable_3 == 1){ 1928 /*DEG-CALL: handler vidioc_streamon from sh_vou_ioctl_ops*/ 1929 (& sh_vou_streamon)(sh_vou_ioctl_ops_group2,ldvarg4,ldvarg3); 1930 /*DEG-postcall: default*/ 1931 ldv_state_variable_3 = 1; 1932 } 1933 } 1934 break; 1935 default: ldv_assume(0); 1936 } 1937 } 1938 } 1939 break; 1940 case 4:{ 1941 /*DEG-struct: handlers from structure sh_vou_fops*/ 1942 /*DEG-CHECK: checking registration of sh_vou_fops structure*/ 1943 if(ldv_state_variable_2 != 0){ 1944 switch(__VERIFIER_nondet_int()){ 1945 case 0:{ 1946 /*DEG-state: state 1 (look at corresponding state-chart diagram for details)*/ 1947 if(ldv_state_variable_2 == 1){ 1948 /*DEG-CALL: handler open from sh_vou_fops*/ 1949 ldv_retval_4=(& sh_vou_open)(sh_vou_fops_group0); 1950 /*DEG-postcall: since other handlers should be called*/ 1951 if(ldv_retval_4==0){ 1952 ldv_state_variable_2 = 2; 1953 ref_cnt++; 1954 } 1955 } 1956 } 1957 break; 1958 case 1:{ 1959 /*DEG-state: state 1 (look at corresponding state-chart diagram for details)*/ 1960 if(ldv_state_variable_2 == 1){ 1961 /*DEG-CALL: handler mmap from sh_vou_fops*/ 1962 (& sh_vou_mmap)(sh_vou_fops_group0,ldvarg32); 1963 /*DEG-postcall: default*/ 1964 ldv_state_variable_2 = 1; 1965 } 1966 /*DEG-state: state 2 (look at corresponding state-chart diagram for details)*/ 1967 if(ldv_state_variable_2 == 2){ 1968 /*DEG-CALL: handler mmap from sh_vou_fops*/ 1969 (& sh_vou_mmap)(sh_vou_fops_group0,ldvarg32); 1970 /*DEG-postcall: default*/ 1971 ldv_state_variable_2 = 2; 1972 } 1973 } 1974 break; 1975 case 2:{ 1976 /*DEG-state: state 2 (look at corresponding state-chart diagram for details)*/ 1977 if(ldv_state_variable_2 == 2){ 1978 /*DEG-CALL: handler release from sh_vou_fops*/ 1979 (& sh_vou_release)(sh_vou_fops_group0); 1980 /*DEG-postcall: module put*/ 1981 ldv_state_variable_2 = 1; 1982 ref_cnt--; 1983 } 1984 } 1985 break; 1986 case 3:{ 1987 /*DEG-state: state 1 (look at corresponding state-chart diagram for details)*/ 1988 if(ldv_state_variable_2 == 1){ 1989 /*DEG-CALL: handler poll from sh_vou_fops*/ 1990 (& sh_vou_poll)(sh_vou_fops_group0,ldvarg31); 1991 /*DEG-postcall: default*/ 1992 ldv_state_variable_2 = 1; 1993 } 1994 /*DEG-state: state 2 (look at corresponding state-chart diagram for details)*/ 1995 if(ldv_state_variable_2 == 2){ 1996 /*DEG-CALL: handler poll from sh_vou_fops*/ 1997 (& sh_vou_poll)(sh_vou_fops_group0,ldvarg31); 1998 /*DEG-postcall: default*/ 1999 ldv_state_variable_2 = 2; 2000 } 2001 } 2002 break; 2003 case 4:{ 2004 /*DEG-state: state 1 (look at corresponding state-chart diagram for details)*/ 2005 if(ldv_state_variable_2 == 1){ 2006 /*DEG-CALL: handler unlocked_ioctl from sh_vou_fops*/ 2007 (& video_ioctl2)(sh_vou_fops_group0,ldvarg30,ldvarg29); 2008 /*DEG-postcall: default*/ 2009 ldv_state_variable_2 = 1; 2010 } 2011 /*DEG-state: state 2 (look at corresponding state-chart diagram for details)*/ 2012 if(ldv_state_variable_2 == 2){ 2013 /*DEG-CALL: handler unlocked_ioctl from sh_vou_fops*/ 2014 (& video_ioctl2)(sh_vou_fops_group0,ldvarg30,ldvarg29); 2015 /*DEG-postcall: default*/ 2016 ldv_state_variable_2 = 2; 2017 } 2018 } 2019 break; 2020 default: ldv_assume(0); 2021 } 2022 } 2023 } 2024 break; 2025 default: ldv_assume(0); 2026 } 2027 } 2028 ldv_final: 2029 ldv_check_final_state(); 2030 return; 2031 } 2032 /* DEG-ENVIRONMENT-END */
1 2 3 #include <verifier/rcv.h> 4 #include <linux/device.h> 5 #include <kernel-model/ERR.inc> 6 struct device_private; 7 /* LDV_COMMENT_CHANGE_STATE At the beginning nothing is allocated. */ 8 int ldv_alloc_count = 0; 9 10 /* LDV_COMMENT_CHANGE_STATE Saved release function pointer. */ 11 void (*gadget_release_pointer)(struct device *_dev); 12 13 void* __VERIFIER_alloc(size_t size); 14 15 /* LDV_COMMENT_CHANGE_STATE At the beginning nothing is allocated. */ 16 //void* ldv_saved_drv_data; 17 18 /* LDV_COMMENT_MODEL_FUNCTION_DEFINITION(name='ldv_alloc') Allocate a "memory". */ 19 void* ldv_alloc(size_t size) 20 { 21 void *res = __VERIFIER_alloc(size); 22 ldv_assume_and_increase(res); 23 return res; 24 } 25 26 void* ldv_zero_alloc(size_t size) 27 { 28 void *res = ldv_zalloc(size); 29 ldv_assume_and_increase(res); 30 return res; 31 } 32 33 /* LDV_COMMENT_MODEL_FUNCTION_DEFINITION(name='ldv_assume_and_increase') Allocate a "memory". */ 34 void ldv_assume_and_increase(void* res) 35 { 36 ldv_assume(res <= LDV_PTR_MAX); 37 if (res != 0) { 38 /* LDV_COMMENT_CHANGE_STATE One more "memory" is allocated. */ 39 ldv_alloc_count++; 40 } 41 } 42 43 void* ldv_nonzero_alloc(size_t size) 44 { 45 //functions, like memdup_user returns either valid pointer, or ptr_err 46 void *res = __VERIFIER_alloc(size); 47 ldv_assume(res != 0); 48 if (res <= LDV_PTR_MAX) { 49 /* LDV_COMMENT_CHANGE_STATE One more "memory" is allocated. */ 50 ldv_alloc_count++; 51 } 52 return res; 53 } 54 55 /* LDV_COMMENT_MODEL_FUNCTION_DEFINITION(name='ldv_alloc_without_counter') Allocate a "memory". */ 56 void* ldv_alloc_without_counter(size_t size) 57 { 58 void *res = __VERIFIER_alloc(size); 59 ldv_assume(res <= LDV_PTR_MAX); 60 return res; 61 } 62 63 /* LDV_COMMENT_MODEL_FUNCTION_DEFINITION(name='ldv_zalloc_without_counter') Allocate a "memory". */ 64 void* ldv_zalloc_without_counter(size_t size) 65 { 66 void *res = ldv_zalloc(size); 67 ldv_assume(res <= LDV_PTR_MAX); 68 return res; 69 } 70 71 /* LDV_COMMENT_MODEL_FUNCTION_DEFINITION(name='ldv_free') Free a "memory". */ 72 void ldv_free(void) 73 { 74 /* LDV_COMMENT_CHANGE_STATE Free a "memory". */ 75 ldv_alloc_count--; 76 //ldv_saved_drv_data = 0; 77 } 78 79 void ldv_condition_free() 80 { 81 if (ldv_alloc_count > 0) 82 { 83 ldv_free(); 84 } 85 } 86 87 /* LDV_COMMENT_MODEL_FUNCTION_DEFINITION(name='ldv_save_gadget_release') Free a "memory". */ 88 void ldv_save_gadget_release(void (*func)(struct device *_dev)) 89 { 90 gadget_release_pointer = func; 91 } 92 93 int ldv_dev_set_drvdata(struct device *dev, void *data) 94 { 95 dev->p = data; 96 return 0; 97 } 98 99 void *ldv_dev_get_drvdata(const struct device *dev) 100 { 101 return dev->p; 102 } 103 104 105 106 /* LDV_COMMENT_MODEL_FUNCTION_DEFINITION(name='ldv_check_final_state') All allocated memory should be freed at the end. */ 107 void ldv_check_final_state(void) 108 { 109 /* LDV_COMMENT_ASSERT Nothing should be allocated at the end. */ 110 ldv_assert(ldv_alloc_count == 0); 111 }
1 #ifndef _LDV_RCV_H_ 2 #define _LDV_RCV_H_ 3 4 //Only for defining size_t 5 #include <linux/types.h> 6 7 /* If expr evaluates to zero, ldv_assert() causes a program to reach the error 8 label like the standard assert(). */ 9 #define ldv_assert(expr) ((expr) ? 0 : ldv_error()) 10 11 12 /* The error label wrapper. It is used because of some static verifiers (like 13 BLAST) don't accept multiple error labels through a program. */ 14 static inline void ldv_error(void) 15 { 16 LDV_ERROR: goto LDV_ERROR; 17 } 18 19 /* If expr evaluates to zero, ldv_assume() causes an infinite loop that is 20 avoided by verifiers. */ 21 #define ldv_assume(expr) ((expr) ? 0 : ldv_stop()) 22 23 /* Infinite loop, that causes verifiers to skip such paths. */ 24 static inline void ldv_stop(void) { 25 LDV_STOP: goto LDV_STOP; 26 } 27 28 /* Special nondeterministic functions. */ 29 int ldv_undef_int(void); 30 void *ldv_undef_ptr(void); 31 unsigned long ldv_undef_ulong(void); 32 33 void* __VERIFIER_alloc(size_t size); 34 void* ldv_zalloc(size_t size); 35 static inline void* ldv_successful_alloc(size_t size) 36 { 37 void* ret = __VERIFIER_alloc(size); 38 ldv_assume(ret != 0); 39 return ret; 40 } 41 42 static inline void* ldv_successful_zalloc(size_t size) 43 { 44 void* ret = ldv_zalloc(size); 45 ldv_assume(ret != 0); 46 return ret; 47 } 48 /* Return nondeterministic negative integer number. */ 49 static inline int ldv_undef_int_negative(void) 50 { 51 int ret = ldv_undef_int(); 52 53 ldv_assume(ret < 0); 54 55 return ret; 56 } 57 /* Return nondeterministic nonpositive integer number. */ 58 static inline int ldv_undef_int_nonpositive(void) 59 { 60 int ret = ldv_undef_int(); 61 62 ldv_assume(ret <= 0); 63 64 return ret; 65 } 66 67 /* Add explicit model for __builin_expect GCC function. Without the model a 68 return value will be treated as nondetermined by verifiers. */ 69 long __builtin_expect(long exp, long c) 70 { 71 return exp; 72 } 73 74 /* This function causes the program to exit abnormally. GCC implements this 75 function by using a target-dependent mechanism (such as intentionally executing 76 an illegal instruction) or by calling abort. The mechanism used may vary from 77 release to release so you should not rely on any particular implementation. 78 http://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html */ 79 void __builtin_trap(void) 80 { 81 ldv_assert(0); 82 } 83 84 /* The constant is for simulating an error of ldv_undef_ptr() function. */ 85 #define LDV_PTR_MAX 201200 86 87 #endif /* _LDV_RCV_H_ */
1 /* 2 * device.h - generic, centralized driver model 3 * 4 * Copyright (c) 2001-2003 Patrick Mochel <mochel@osdl.org> 5 * Copyright (c) 2004-2009 Greg Kroah-Hartman <gregkh@suse.de> 6 * Copyright (c) 2008-2009 Novell Inc. 7 * 8 * This file is released under the GPLv2 9 * 10 * See Documentation/driver-model/ for more information. 11 */ 12 13 #ifndef _DEVICE_H_ 14 #define _DEVICE_H_ 15 16 #include <linux/ioport.h> 17 #include <linux/kobject.h> 18 #include <linux/klist.h> 19 #include <linux/list.h> 20 #include <linux/lockdep.h> 21 #include <linux/compiler.h> 22 #include <linux/types.h> 23 #include <linux/mutex.h> 24 #include <linux/pinctrl/devinfo.h> 25 #include <linux/pm.h> 26 #include <linux/atomic.h> 27 #include <linux/ratelimit.h> 28 #include <linux/uidgid.h> 29 #include <linux/gfp.h> 30 #include <asm/device.h> 31 32 struct device; 33 struct device_private; 34 struct device_driver; 35 struct driver_private; 36 struct module; 37 struct class; 38 struct subsys_private; 39 struct bus_type; 40 struct device_node; 41 struct iommu_ops; 42 struct iommu_group; 43 44 struct bus_attribute { 45 struct attribute attr; 46 ssize_t (*show)(struct bus_type *bus, char *buf); 47 ssize_t (*store)(struct bus_type *bus, const char *buf, size_t count); 48 }; 49 50 #define BUS_ATTR(_name, _mode, _show, _store) \ 51 struct bus_attribute bus_attr_##_name = __ATTR(_name, _mode, _show, _store) 52 #define BUS_ATTR_RW(_name) \ 53 struct bus_attribute bus_attr_##_name = __ATTR_RW(_name) 54 #define BUS_ATTR_RO(_name) \ 55 struct bus_attribute bus_attr_##_name = __ATTR_RO(_name) 56 57 extern int __must_check bus_create_file(struct bus_type *, 58 struct bus_attribute *); 59 extern void bus_remove_file(struct bus_type *, struct bus_attribute *); 60 61 /** 62 * struct bus_type - The bus type of the device 63 * 64 * @name: The name of the bus. 65 * @dev_name: Used for subsystems to enumerate devices like ("foo%u", dev->id). 66 * @dev_root: Default device to use as the parent. 67 * @dev_attrs: Default attributes of the devices on the bus. 68 * @bus_groups: Default attributes of the bus. 69 * @dev_groups: Default attributes of the devices on the bus. 70 * @drv_groups: Default attributes of the device drivers on the bus. 71 * @match: Called, perhaps multiple times, whenever a new device or driver 72 * is added for this bus. It should return a nonzero value if the 73 * given device can be handled by the given driver. 74 * @uevent: Called when a device is added, removed, or a few other things 75 * that generate uevents to add the environment variables. 76 * @probe: Called when a new device or driver add to this bus, and callback 77 * the specific driver's probe to initial the matched device. 78 * @remove: Called when a device removed from this bus. 79 * @shutdown: Called at shut-down time to quiesce the device. 80 * 81 * @online: Called to put the device back online (after offlining it). 82 * @offline: Called to put the device offline for hot-removal. May fail. 83 * 84 * @suspend: Called when a device on this bus wants to go to sleep mode. 85 * @resume: Called to bring a device on this bus out of sleep mode. 86 * @pm: Power management operations of this bus, callback the specific 87 * device driver's pm-ops. 88 * @iommu_ops: IOMMU specific operations for this bus, used to attach IOMMU 89 * driver implementations to a bus and allow the driver to do 90 * bus-specific setup 91 * @p: The private data of the driver core, only the driver core can 92 * touch this. 93 * @lock_key: Lock class key for use by the lock validator 94 * 95 * A bus is a channel between the processor and one or more devices. For the 96 * purposes of the device model, all devices are connected via a bus, even if 97 * it is an internal, virtual, "platform" bus. Buses can plug into each other. 98 * A USB controller is usually a PCI device, for example. The device model 99 * represents the actual connections between buses and the devices they control. 100 * A bus is represented by the bus_type structure. It contains the name, the 101 * default attributes, the bus' methods, PM operations, and the driver core's 102 * private data. 103 */ 104 struct bus_type { 105 const char *name; 106 const char *dev_name; 107 struct device *dev_root; 108 struct device_attribute *dev_attrs; /* use dev_groups instead */ 109 const struct attribute_group **bus_groups; 110 const struct attribute_group **dev_groups; 111 const struct attribute_group **drv_groups; 112 113 int (*match)(struct device *dev, struct device_driver *drv); 114 int (*uevent)(struct device *dev, struct kobj_uevent_env *env); 115 int (*probe)(struct device *dev); 116 int (*remove)(struct device *dev); 117 void (*shutdown)(struct device *dev); 118 119 int (*online)(struct device *dev); 120 int (*offline)(struct device *dev); 121 122 int (*suspend)(struct device *dev, pm_message_t state); 123 int (*resume)(struct device *dev); 124 125 const struct dev_pm_ops *pm; 126 127 const struct iommu_ops *iommu_ops; 128 129 struct subsys_private *p; 130 struct lock_class_key lock_key; 131 }; 132 133 extern int __must_check bus_register(struct bus_type *bus); 134 135 extern void bus_unregister(struct bus_type *bus); 136 137 extern int __must_check bus_rescan_devices(struct bus_type *bus); 138 139 /* iterator helpers for buses */ 140 struct subsys_dev_iter { 141 struct klist_iter ki; 142 const struct device_type *type; 143 }; 144 void subsys_dev_iter_init(struct subsys_dev_iter *iter, 145 struct bus_type *subsys, 146 struct device *start, 147 const struct device_type *type); 148 struct device *subsys_dev_iter_next(struct subsys_dev_iter *iter); 149 void subsys_dev_iter_exit(struct subsys_dev_iter *iter); 150 151 int bus_for_each_dev(struct bus_type *bus, struct device *start, void *data, 152 int (*fn)(struct device *dev, void *data)); 153 struct device *bus_find_device(struct bus_type *bus, struct device *start, 154 void *data, 155 int (*match)(struct device *dev, void *data)); 156 struct device *bus_find_device_by_name(struct bus_type *bus, 157 struct device *start, 158 const char *name); 159 struct device *subsys_find_device_by_id(struct bus_type *bus, unsigned int id, 160 struct device *hint); 161 int bus_for_each_drv(struct bus_type *bus, struct device_driver *start, 162 void *data, int (*fn)(struct device_driver *, void *)); 163 void bus_sort_breadthfirst(struct bus_type *bus, 164 int (*compare)(const struct device *a, 165 const struct device *b)); 166 /* 167 * Bus notifiers: Get notified of addition/removal of devices 168 * and binding/unbinding of drivers to devices. 169 * In the long run, it should be a replacement for the platform 170 * notify hooks. 171 */ 172 struct notifier_block; 173 174 extern int bus_register_notifier(struct bus_type *bus, 175 struct notifier_block *nb); 176 extern int bus_unregister_notifier(struct bus_type *bus, 177 struct notifier_block *nb); 178 179 /* All 4 notifers below get called with the target struct device * 180 * as an argument. Note that those functions are likely to be called 181 * with the device lock held in the core, so be careful. 182 */ 183 #define BUS_NOTIFY_ADD_DEVICE 0x00000001 /* device added */ 184 #define BUS_NOTIFY_DEL_DEVICE 0x00000002 /* device removed */ 185 #define BUS_NOTIFY_BIND_DRIVER 0x00000003 /* driver about to be 186 bound */ 187 #define BUS_NOTIFY_BOUND_DRIVER 0x00000004 /* driver bound to device */ 188 #define BUS_NOTIFY_UNBIND_DRIVER 0x00000005 /* driver about to be 189 unbound */ 190 #define BUS_NOTIFY_UNBOUND_DRIVER 0x00000006 /* driver is unbound 191 from the device */ 192 193 extern struct kset *bus_get_kset(struct bus_type *bus); 194 extern struct klist *bus_get_device_klist(struct bus_type *bus); 195 196 /** 197 * struct device_driver - The basic device driver structure 198 * @name: Name of the device driver. 199 * @bus: The bus which the device of this driver belongs to. 200 * @owner: The module owner. 201 * @mod_name: Used for built-in modules. 202 * @suppress_bind_attrs: Disables bind/unbind via sysfs. 203 * @of_match_table: The open firmware table. 204 * @acpi_match_table: The ACPI match table. 205 * @probe: Called to query the existence of a specific device, 206 * whether this driver can work with it, and bind the driver 207 * to a specific device. 208 * @remove: Called when the device is removed from the system to 209 * unbind a device from this driver. 210 * @shutdown: Called at shut-down time to quiesce the device. 211 * @suspend: Called to put the device to sleep mode. Usually to a 212 * low power state. 213 * @resume: Called to bring a device from sleep mode. 214 * @groups: Default attributes that get created by the driver core 215 * automatically. 216 * @pm: Power management operations of the device which matched 217 * this driver. 218 * @p: Driver core's private data, no one other than the driver 219 * core can touch this. 220 * 221 * The device driver-model tracks all of the drivers known to the system. 222 * The main reason for this tracking is to enable the driver core to match 223 * up drivers with new devices. Once drivers are known objects within the 224 * system, however, a number of other things become possible. Device drivers 225 * can export information and configuration variables that are independent 226 * of any specific device. 227 */ 228 struct device_driver { 229 const char *name; 230 struct bus_type *bus; 231 232 struct module *owner; 233 const char *mod_name; /* used for built-in modules */ 234 235 bool suppress_bind_attrs; /* disables bind/unbind via sysfs */ 236 237 const struct of_device_id *of_match_table; 238 const struct acpi_device_id *acpi_match_table; 239 240 int (*probe) (struct device *dev); 241 int (*remove) (struct device *dev); 242 void (*shutdown) (struct device *dev); 243 int (*suspend) (struct device *dev, pm_message_t state); 244 int (*resume) (struct device *dev); 245 const struct attribute_group **groups; 246 247 const struct dev_pm_ops *pm; 248 249 struct driver_private *p; 250 }; 251 252 253 extern int __must_check driver_register(struct device_driver *drv); 254 extern void driver_unregister(struct device_driver *drv); 255 256 extern struct device_driver *driver_find(const char *name, 257 struct bus_type *bus); 258 extern int driver_probe_done(void); 259 extern void wait_for_device_probe(void); 260 261 262 /* sysfs interface for exporting driver attributes */ 263 264 struct driver_attribute { 265 struct attribute attr; 266 ssize_t (*show)(struct device_driver *driver, char *buf); 267 ssize_t (*store)(struct device_driver *driver, const char *buf, 268 size_t count); 269 }; 270 271 #define DRIVER_ATTR(_name, _mode, _show, _store) \ 272 struct driver_attribute driver_attr_##_name = __ATTR(_name, _mode, _show, _store) 273 #define DRIVER_ATTR_RW(_name) \ 274 struct driver_attribute driver_attr_##_name = __ATTR_RW(_name) 275 #define DRIVER_ATTR_RO(_name) \ 276 struct driver_attribute driver_attr_##_name = __ATTR_RO(_name) 277 #define DRIVER_ATTR_WO(_name) \ 278 struct driver_attribute driver_attr_##_name = __ATTR_WO(_name) 279 280 extern int __must_check driver_create_file(struct device_driver *driver, 281 const struct driver_attribute *attr); 282 extern void driver_remove_file(struct device_driver *driver, 283 const struct driver_attribute *attr); 284 285 extern int __must_check driver_for_each_device(struct device_driver *drv, 286 struct device *start, 287 void *data, 288 int (*fn)(struct device *dev, 289 void *)); 290 struct device *driver_find_device(struct device_driver *drv, 291 struct device *start, void *data, 292 int (*match)(struct device *dev, void *data)); 293 294 /** 295 * struct subsys_interface - interfaces to device functions 296 * @name: name of the device function 297 * @subsys: subsytem of the devices to attach to 298 * @node: the list of functions registered at the subsystem 299 * @add_dev: device hookup to device function handler 300 * @remove_dev: device hookup to device function handler 301 * 302 * Simple interfaces attached to a subsystem. Multiple interfaces can 303 * attach to a subsystem and its devices. Unlike drivers, they do not 304 * exclusively claim or control devices. Interfaces usually represent 305 * a specific functionality of a subsystem/class of devices. 306 */ 307 struct subsys_interface { 308 const char *name; 309 struct bus_type *subsys; 310 struct list_head node; 311 int (*add_dev)(struct device *dev, struct subsys_interface *sif); 312 int (*remove_dev)(struct device *dev, struct subsys_interface *sif); 313 }; 314 315 int subsys_interface_register(struct subsys_interface *sif); 316 void subsys_interface_unregister(struct subsys_interface *sif); 317 318 int subsys_system_register(struct bus_type *subsys, 319 const struct attribute_group **groups); 320 int subsys_virtual_register(struct bus_type *subsys, 321 const struct attribute_group **groups); 322 323 /** 324 * struct class - device classes 325 * @name: Name of the class. 326 * @owner: The module owner. 327 * @class_attrs: Default attributes of this class. 328 * @dev_groups: Default attributes of the devices that belong to the class. 329 * @dev_kobj: The kobject that represents this class and links it into the hierarchy. 330 * @dev_uevent: Called when a device is added, removed from this class, or a 331 * few other things that generate uevents to add the environment 332 * variables. 333 * @devnode: Callback to provide the devtmpfs. 334 * @class_release: Called to release this class. 335 * @dev_release: Called to release the device. 336 * @suspend: Used to put the device to sleep mode, usually to a low power 337 * state. 338 * @resume: Used to bring the device from the sleep mode. 339 * @ns_type: Callbacks so sysfs can detemine namespaces. 340 * @namespace: Namespace of the device belongs to this class. 341 * @pm: The default device power management operations of this class. 342 * @p: The private data of the driver core, no one other than the 343 * driver core can touch this. 344 * 345 * A class is a higher-level view of a device that abstracts out low-level 346 * implementation details. Drivers may see a SCSI disk or an ATA disk, but, 347 * at the class level, they are all simply disks. Classes allow user space 348 * to work with devices based on what they do, rather than how they are 349 * connected or how they work. 350 */ 351 struct class { 352 const char *name; 353 struct module *owner; 354 355 struct class_attribute *class_attrs; 356 const struct attribute_group **dev_groups; 357 struct kobject *dev_kobj; 358 359 int (*dev_uevent)(struct device *dev, struct kobj_uevent_env *env); 360 char *(*devnode)(struct device *dev, umode_t *mode); 361 362 void (*class_release)(struct class *class); 363 void (*dev_release)(struct device *dev); 364 365 int (*suspend)(struct device *dev, pm_message_t state); 366 int (*resume)(struct device *dev); 367 368 const struct kobj_ns_type_operations *ns_type; 369 const void *(*namespace)(struct device *dev); 370 371 const struct dev_pm_ops *pm; 372 373 struct subsys_private *p; 374 }; 375 376 struct class_dev_iter { 377 struct klist_iter ki; 378 const struct device_type *type; 379 }; 380 381 extern struct kobject *sysfs_dev_block_kobj; 382 extern struct kobject *sysfs_dev_char_kobj; 383 extern int __must_check __class_register(struct class *class, 384 struct lock_class_key *key); 385 extern void class_unregister(struct class *class); 386 387 /* This is a #define to keep the compiler from merging different 388 * instances of the __key variable */ 389 #define class_register(class) \ 390 ({ \ 391 static struct lock_class_key __key; \ 392 __class_register(class, &__key); \ 393 }) 394 395 struct class_compat; 396 struct class_compat *class_compat_register(const char *name); 397 void class_compat_unregister(struct class_compat *cls); 398 int class_compat_create_link(struct class_compat *cls, struct device *dev, 399 struct device *device_link); 400 void class_compat_remove_link(struct class_compat *cls, struct device *dev, 401 struct device *device_link); 402 403 extern void class_dev_iter_init(struct class_dev_iter *iter, 404 struct class *class, 405 struct device *start, 406 const struct device_type *type); 407 extern struct device *class_dev_iter_next(struct class_dev_iter *iter); 408 extern void class_dev_iter_exit(struct class_dev_iter *iter); 409 410 extern int class_for_each_device(struct class *class, struct device *start, 411 void *data, 412 int (*fn)(struct device *dev, void *data)); 413 extern struct device *class_find_device(struct class *class, 414 struct device *start, const void *data, 415 int (*match)(struct device *, const void *)); 416 417 struct class_attribute { 418 struct attribute attr; 419 ssize_t (*show)(struct class *class, struct class_attribute *attr, 420 char *buf); 421 ssize_t (*store)(struct class *class, struct class_attribute *attr, 422 const char *buf, size_t count); 423 }; 424 425 #define CLASS_ATTR(_name, _mode, _show, _store) \ 426 struct class_attribute class_attr_##_name = __ATTR(_name, _mode, _show, _store) 427 #define CLASS_ATTR_RW(_name) \ 428 struct class_attribute class_attr_##_name = __ATTR_RW(_name) 429 #define CLASS_ATTR_RO(_name) \ 430 struct class_attribute class_attr_##_name = __ATTR_RO(_name) 431 432 extern int __must_check class_create_file_ns(struct class *class, 433 const struct class_attribute *attr, 434 const void *ns); 435 extern void class_remove_file_ns(struct class *class, 436 const struct class_attribute *attr, 437 const void *ns); 438 439 static inline int __must_check class_create_file(struct class *class, 440 const struct class_attribute *attr) 441 { 442 return class_create_file_ns(class, attr, NULL); 443 } 444 445 static inline void class_remove_file(struct class *class, 446 const struct class_attribute *attr) 447 { 448 return class_remove_file_ns(class, attr, NULL); 449 } 450 451 /* Simple class attribute that is just a static string */ 452 struct class_attribute_string { 453 struct class_attribute attr; 454 char *str; 455 }; 456 457 /* Currently read-only only */ 458 #define _CLASS_ATTR_STRING(_name, _mode, _str) \ 459 { __ATTR(_name, _mode, show_class_attr_string, NULL), _str } 460 #define CLASS_ATTR_STRING(_name, _mode, _str) \ 461 struct class_attribute_string class_attr_##_name = \ 462 _CLASS_ATTR_STRING(_name, _mode, _str) 463 464 extern ssize_t show_class_attr_string(struct class *class, struct class_attribute *attr, 465 char *buf); 466 467 struct class_interface { 468 struct list_head node; 469 struct class *class; 470 471 int (*add_dev) (struct device *, struct class_interface *); 472 void (*remove_dev) (struct device *, struct class_interface *); 473 }; 474 475 extern int __must_check class_interface_register(struct class_interface *); 476 extern void class_interface_unregister(struct class_interface *); 477 478 extern struct class * __must_check __class_create(struct module *owner, 479 const char *name, 480 struct lock_class_key *key); 481 extern void class_destroy(struct class *cls); 482 483 /* This is a #define to keep the compiler from merging different 484 * instances of the __key variable */ 485 #define class_create(owner, name) \ 486 ({ \ 487 static struct lock_class_key __key; \ 488 __class_create(owner, name, &__key); \ 489 }) 490 491 /* 492 * The type of device, "struct device" is embedded in. A class 493 * or bus can contain devices of different types 494 * like "partitions" and "disks", "mouse" and "event". 495 * This identifies the device type and carries type-specific 496 * information, equivalent to the kobj_type of a kobject. 497 * If "name" is specified, the uevent will contain it in 498 * the DEVTYPE variable. 499 */ 500 struct device_type { 501 const char *name; 502 const struct attribute_group **groups; 503 int (*uevent)(struct device *dev, struct kobj_uevent_env *env); 504 char *(*devnode)(struct device *dev, umode_t *mode, 505 kuid_t *uid, kgid_t *gid); 506 void (*release)(struct device *dev); 507 508 const struct dev_pm_ops *pm; 509 }; 510 511 /* interface for exporting device attributes */ 512 struct device_attribute { 513 struct attribute attr; 514 ssize_t (*show)(struct device *dev, struct device_attribute *attr, 515 char *buf); 516 ssize_t (*store)(struct device *dev, struct device_attribute *attr, 517 const char *buf, size_t count); 518 }; 519 520 struct dev_ext_attribute { 521 struct device_attribute attr; 522 void *var; 523 }; 524 525 ssize_t device_show_ulong(struct device *dev, struct device_attribute *attr, 526 char *buf); 527 ssize_t device_store_ulong(struct device *dev, struct device_attribute *attr, 528 const char *buf, size_t count); 529 ssize_t device_show_int(struct device *dev, struct device_attribute *attr, 530 char *buf); 531 ssize_t device_store_int(struct device *dev, struct device_attribute *attr, 532 const char *buf, size_t count); 533 ssize_t device_show_bool(struct device *dev, struct device_attribute *attr, 534 char *buf); 535 ssize_t device_store_bool(struct device *dev, struct device_attribute *attr, 536 const char *buf, size_t count); 537 538 #define DEVICE_ATTR(_name, _mode, _show, _store) \ 539 struct device_attribute dev_attr_##_name = __ATTR(_name, _mode, _show, _store) 540 #define DEVICE_ATTR_RW(_name) \ 541 struct device_attribute dev_attr_##_name = __ATTR_RW(_name) 542 #define DEVICE_ATTR_RO(_name) \ 543 struct device_attribute dev_attr_##_name = __ATTR_RO(_name) 544 #define DEVICE_ATTR_WO(_name) \ 545 struct device_attribute dev_attr_##_name = __ATTR_WO(_name) 546 #define DEVICE_ULONG_ATTR(_name, _mode, _var) \ 547 struct dev_ext_attribute dev_attr_##_name = \ 548 { __ATTR(_name, _mode, device_show_ulong, device_store_ulong), &(_var) } 549 #define DEVICE_INT_ATTR(_name, _mode, _var) \ 550 struct dev_ext_attribute dev_attr_##_name = \ 551 { __ATTR(_name, _mode, device_show_int, device_store_int), &(_var) } 552 #define DEVICE_BOOL_ATTR(_name, _mode, _var) \ 553 struct dev_ext_attribute dev_attr_##_name = \ 554 { __ATTR(_name, _mode, device_show_bool, device_store_bool), &(_var) } 555 #define DEVICE_ATTR_IGNORE_LOCKDEP(_name, _mode, _show, _store) \ 556 struct device_attribute dev_attr_##_name = \ 557 __ATTR_IGNORE_LOCKDEP(_name, _mode, _show, _store) 558 559 extern int device_create_file(struct device *device, 560 const struct device_attribute *entry); 561 extern void device_remove_file(struct device *dev, 562 const struct device_attribute *attr); 563 extern bool device_remove_file_self(struct device *dev, 564 const struct device_attribute *attr); 565 extern int __must_check device_create_bin_file(struct device *dev, 566 const struct bin_attribute *attr); 567 extern void device_remove_bin_file(struct device *dev, 568 const struct bin_attribute *attr); 569 570 /* device resource management */ 571 typedef void (*dr_release_t)(struct device *dev, void *res); 572 typedef int (*dr_match_t)(struct device *dev, void *res, void *match_data); 573 574 #ifdef CONFIG_DEBUG_DEVRES 575 extern void *__devres_alloc(dr_release_t release, size_t size, gfp_t gfp, 576 const char *name); 577 #define devres_alloc(release, size, gfp) \ 578 __devres_alloc(release, size, gfp, #release) 579 #else 580 extern void *devres_alloc(dr_release_t release, size_t size, gfp_t gfp); 581 #endif 582 extern void devres_for_each_res(struct device *dev, dr_release_t release, 583 dr_match_t match, void *match_data, 584 void (*fn)(struct device *, void *, void *), 585 void *data); 586 extern void devres_free(void *res); 587 extern void devres_add(struct device *dev, void *res); 588 extern void *devres_find(struct device *dev, dr_release_t release, 589 dr_match_t match, void *match_data); 590 extern void *devres_get(struct device *dev, void *new_res, 591 dr_match_t match, void *match_data); 592 extern void *devres_remove(struct device *dev, dr_release_t release, 593 dr_match_t match, void *match_data); 594 extern int devres_destroy(struct device *dev, dr_release_t release, 595 dr_match_t match, void *match_data); 596 extern int devres_release(struct device *dev, dr_release_t release, 597 dr_match_t match, void *match_data); 598 599 /* devres group */ 600 extern void * __must_check devres_open_group(struct device *dev, void *id, 601 gfp_t gfp); 602 extern void devres_close_group(struct device *dev, void *id); 603 extern void devres_remove_group(struct device *dev, void *id); 604 extern int devres_release_group(struct device *dev, void *id); 605 606 /* managed devm_k.alloc/kfree for device drivers */ 607 extern void *devm_kmalloc(struct device *dev, size_t size, gfp_t gfp); 608 extern char *devm_kvasprintf(struct device *dev, gfp_t gfp, const char *fmt, 609 va_list ap); 610 extern char *devm_kasprintf(struct device *dev, gfp_t gfp, 611 const char *fmt, ...); 612 static inline void *devm_kzalloc(struct device *dev, size_t size, gfp_t gfp) 613 { 614 return devm_kmalloc(dev, size, gfp | __GFP_ZERO); 615 } 616 static inline void *devm_kmalloc_array(struct device *dev, 617 size_t n, size_t size, gfp_t flags) 618 { 619 if (size != 0 && n > SIZE_MAX / size) 620 return NULL; 621 return devm_kmalloc(dev, n * size, flags); 622 } 623 static inline void *devm_kcalloc(struct device *dev, 624 size_t n, size_t size, gfp_t flags) 625 { 626 return devm_kmalloc_array(dev, n, size, flags | __GFP_ZERO); 627 } 628 extern void devm_kfree(struct device *dev, void *p); 629 extern char *devm_kstrdup(struct device *dev, const char *s, gfp_t gfp); 630 extern void *devm_kmemdup(struct device *dev, const void *src, size_t len, 631 gfp_t gfp); 632 633 extern unsigned long devm_get_free_pages(struct device *dev, 634 gfp_t gfp_mask, unsigned int order); 635 extern void devm_free_pages(struct device *dev, unsigned long addr); 636 637 void __iomem *devm_ioremap_resource(struct device *dev, struct resource *res); 638 639 /* allows to add/remove a custom action to devres stack */ 640 int devm_add_action(struct device *dev, void (*action)(void *), void *data); 641 void devm_remove_action(struct device *dev, void (*action)(void *), void *data); 642 643 struct device_dma_parameters { 644 /* 645 * a low level driver may set these to teach IOMMU code about 646 * sg limitations. 647 */ 648 unsigned int max_segment_size; 649 unsigned long segment_boundary_mask; 650 }; 651 652 struct acpi_device; 653 654 struct acpi_dev_node { 655 #ifdef CONFIG_ACPI 656 struct acpi_device *companion; 657 #endif 658 }; 659 660 /** 661 * struct device - The basic device structure 662 * @parent: The device's "parent" device, the device to which it is attached. 663 * In most cases, a parent device is some sort of bus or host 664 * controller. If parent is NULL, the device, is a top-level device, 665 * which is not usually what you want. 666 * @p: Holds the private data of the driver core portions of the device. 667 * See the comment of the struct device_private for detail. 668 * @kobj: A top-level, abstract class from which other classes are derived. 669 * @init_name: Initial name of the device. 670 * @type: The type of device. 671 * This identifies the device type and carries type-specific 672 * information. 673 * @mutex: Mutex to synchronize calls to its driver. 674 * @bus: Type of bus device is on. 675 * @driver: Which driver has allocated this 676 * @platform_data: Platform data specific to the device. 677 * Example: For devices on custom boards, as typical of embedded 678 * and SOC based hardware, Linux often uses platform_data to point 679 * to board-specific structures describing devices and how they 680 * are wired. That can include what ports are available, chip 681 * variants, which GPIO pins act in what additional roles, and so 682 * on. This shrinks the "Board Support Packages" (BSPs) and 683 * minimizes board-specific #ifdefs in drivers. 684 * @driver_data: Private pointer for driver specific info. 685 * @power: For device power management. 686 * See Documentation/power/devices.txt for details. 687 * @pm_domain: Provide callbacks that are executed during system suspend, 688 * hibernation, system resume and during runtime PM transitions 689 * along with subsystem-level and driver-level callbacks. 690 * @pins: For device pin management. 691 * See Documentation/pinctrl.txt for details. 692 * @numa_node: NUMA node this device is close to. 693 * @dma_mask: Dma mask (if dma'ble device). 694 * @coherent_dma_mask: Like dma_mask, but for alloc_coherent mapping as not all 695 * hardware supports 64-bit addresses for consistent allocations 696 * such descriptors. 697 * @dma_pfn_offset: offset of DMA memory range relatively of RAM 698 * @dma_parms: A low level driver may set these to teach IOMMU code about 699 * segment limitations. 700 * @dma_pools: Dma pools (if dma'ble device). 701 * @dma_mem: Internal for coherent mem override. 702 * @cma_area: Contiguous memory area for dma allocations 703 * @archdata: For arch-specific additions. 704 * @of_node: Associated device tree node. 705 * @acpi_node: Associated ACPI device node. 706 * @devt: For creating the sysfs "dev". 707 * @id: device instance 708 * @devres_lock: Spinlock to protect the resource of the device. 709 * @devres_head: The resources list of the device. 710 * @knode_class: The node used to add the device to the class list. 711 * @class: The class of the device. 712 * @groups: Optional attribute groups. 713 * @release: Callback to free the device after all references have 714 * gone away. This should be set by the allocator of the 715 * device (i.e. the bus driver that discovered the device). 716 * @iommu_group: IOMMU group the device belongs to. 717 * 718 * @offline_disabled: If set, the device is permanently online. 719 * @offline: Set after successful invocation of bus type's .offline(). 720 * 721 * At the lowest level, every device in a Linux system is represented by an 722 * instance of struct device. The device structure contains the information 723 * that the device model core needs to model the system. Most subsystems, 724 * however, track additional information about the devices they host. As a 725 * result, it is rare for devices to be represented by bare device structures; 726 * instead, that structure, like kobject structures, is usually embedded within 727 * a higher-level representation of the device. 728 */ 729 struct device { 730 struct device *parent; 731 732 struct device_private *p; 733 734 struct kobject kobj; 735 const char *init_name; /* initial name of the device */ 736 const struct device_type *type; 737 738 struct mutex mutex; /* mutex to synchronize calls to 739 * its driver. 740 */ 741 742 struct bus_type *bus; /* type of bus device is on */ 743 struct device_driver *driver; /* which driver has allocated this 744 device */ 745 void *platform_data; /* Platform specific data, device 746 core doesn't touch it */ 747 void *driver_data; /* Driver data, set and get with 748 dev_set/get_drvdata */ 749 struct dev_pm_info power; 750 struct dev_pm_domain *pm_domain; 751 752 #ifdef CONFIG_PINCTRL 753 struct dev_pin_info *pins; 754 #endif 755 756 #ifdef CONFIG_NUMA 757 int numa_node; /* NUMA node this device is close to */ 758 #endif 759 u64 *dma_mask; /* dma mask (if dma'able device) */ 760 u64 coherent_dma_mask;/* Like dma_mask, but for 761 alloc_coherent mappings as 762 not all hardware supports 763 64 bit addresses for consistent 764 allocations such descriptors. */ 765 unsigned long dma_pfn_offset; 766 767 struct device_dma_parameters *dma_parms; 768 769 struct list_head dma_pools; /* dma pools (if dma'ble) */ 770 771 struct dma_coherent_mem *dma_mem; /* internal for coherent mem 772 override */ 773 #ifdef CONFIG_DMA_CMA 774 struct cma *cma_area; /* contiguous memory area for dma 775 allocations */ 776 #endif 777 /* arch specific additions */ 778 struct dev_archdata archdata; 779 780 struct device_node *of_node; /* associated device tree node */ 781 struct acpi_dev_node acpi_node; /* associated ACPI device node */ 782 783 dev_t devt; /* dev_t, creates the sysfs "dev" */ 784 u32 id; /* device instance */ 785 786 spinlock_t devres_lock; 787 struct list_head devres_head; 788 789 struct klist_node knode_class; 790 struct class *class; 791 const struct attribute_group **groups; /* optional groups */ 792 793 void (*release)(struct device *dev); 794 struct iommu_group *iommu_group; 795 796 bool offline_disabled:1; 797 bool offline:1; 798 }; 799 800 static inline struct device *kobj_to_dev(struct kobject *kobj) 801 { 802 return container_of(kobj, struct device, kobj); 803 } 804 805 /* Get the wakeup routines, which depend on struct device */ 806 #include <linux/pm_wakeup.h> 807 808 static inline const char *dev_name(const struct device *dev) 809 { 810 /* Use the init name until the kobject becomes available */ 811 if (dev->init_name) 812 return dev->init_name; 813 814 return kobject_name(&dev->kobj); 815 } 816 817 extern __printf(2, 3) 818 int dev_set_name(struct device *dev, const char *name, ...); 819 820 #ifdef CONFIG_NUMA 821 static inline int dev_to_node(struct device *dev) 822 { 823 return dev->numa_node; 824 } 825 static inline void set_dev_node(struct device *dev, int node) 826 { 827 dev->numa_node = node; 828 } 829 #else 830 static inline int dev_to_node(struct device *dev) 831 { 832 return -1; 833 } 834 static inline void set_dev_node(struct device *dev, int node) 835 { 836 } 837 #endif 838 839 static inline void *dev_get_drvdata(const struct device *dev) 840 { 841 return dev->driver_data; 842 } 843 844 static inline void dev_set_drvdata(struct device *dev, void *data) 845 { 846 dev->driver_data = data; 847 } 848 849 static inline struct pm_subsys_data *dev_to_psd(struct device *dev) 850 { 851 return dev ? dev->power.subsys_data : NULL; 852 } 853 854 static inline unsigned int dev_get_uevent_suppress(const struct device *dev) 855 { 856 return dev->kobj.uevent_suppress; 857 } 858 859 static inline void dev_set_uevent_suppress(struct device *dev, int val) 860 { 861 dev->kobj.uevent_suppress = val; 862 } 863 864 static inline int device_is_registered(struct device *dev) 865 { 866 return dev->kobj.state_in_sysfs; 867 } 868 869 static inline void device_enable_async_suspend(struct device *dev) 870 { 871 if (!dev->power.is_prepared) 872 dev->power.async_suspend = true; 873 } 874 875 static inline void device_disable_async_suspend(struct device *dev) 876 { 877 if (!dev->power.is_prepared) 878 dev->power.async_suspend = false; 879 } 880 881 static inline bool device_async_suspend_enabled(struct device *dev) 882 { 883 return !!dev->power.async_suspend; 884 } 885 886 static inline void pm_suspend_ignore_children(struct device *dev, bool enable) 887 { 888 dev->power.ignore_children = enable; 889 } 890 891 static inline void dev_pm_syscore_device(struct device *dev, bool val) 892 { 893 #ifdef CONFIG_PM_SLEEP 894 dev->power.syscore = val; 895 #endif 896 } 897 898 static inline void device_lock(struct device *dev) 899 { 900 mutex_lock(&dev->mutex); 901 } 902 903 static inline int device_trylock(struct device *dev) 904 { 905 return mutex_trylock(&dev->mutex); 906 } 907 908 static inline void device_unlock(struct device *dev) 909 { 910 mutex_unlock(&dev->mutex); 911 } 912 913 void driver_init(void); 914 915 /* 916 * High level routines for use by the bus drivers 917 */ 918 extern int __must_check device_register(struct device *dev); 919 extern void device_unregister(struct device *dev); 920 extern void device_initialize(struct device *dev); 921 extern int __must_check device_add(struct device *dev); 922 extern void device_del(struct device *dev); 923 extern int device_for_each_child(struct device *dev, void *data, 924 int (*fn)(struct device *dev, void *data)); 925 extern struct device *device_find_child(struct device *dev, void *data, 926 int (*match)(struct device *dev, void *data)); 927 extern int device_rename(struct device *dev, const char *new_name); 928 extern int device_move(struct device *dev, struct device *new_parent, 929 enum dpm_order dpm_order); 930 extern const char *device_get_devnode(struct device *dev, 931 umode_t *mode, kuid_t *uid, kgid_t *gid, 932 const char **tmp); 933 934 static inline bool device_supports_offline(struct device *dev) 935 { 936 return dev->bus && dev->bus->offline && dev->bus->online; 937 } 938 939 extern void lock_device_hotplug(void); 940 extern void unlock_device_hotplug(void); 941 extern int lock_device_hotplug_sysfs(void); 942 extern int device_offline(struct device *dev); 943 extern int device_online(struct device *dev); 944 /* 945 * Root device objects for grouping under /sys/devices 946 */ 947 extern struct device *__root_device_register(const char *name, 948 struct module *owner); 949 950 /* This is a macro to avoid include problems with THIS_MODULE */ 951 #define root_device_register(name) \ 952 __root_device_register(name, THIS_MODULE) 953 954 extern void root_device_unregister(struct device *root); 955 956 static inline void *dev_get_platdata(const struct device *dev) 957 { 958 return dev->platform_data; 959 } 960 961 /* 962 * Manual binding of a device to driver. See drivers/base/bus.c 963 * for information on use. 964 */ 965 extern int __must_check device_bind_driver(struct device *dev); 966 extern void device_release_driver(struct device *dev); 967 extern int __must_check device_attach(struct device *dev); 968 extern int __must_check driver_attach(struct device_driver *drv); 969 extern int __must_check device_reprobe(struct device *dev); 970 971 /* 972 * Easy functions for dynamically creating devices on the fly 973 */ 974 extern struct device *device_create_vargs(struct class *cls, 975 struct device *parent, 976 dev_t devt, 977 void *drvdata, 978 const char *fmt, 979 va_list vargs); 980 extern __printf(5, 6) 981 struct device *device_create(struct class *cls, struct device *parent, 982 dev_t devt, void *drvdata, 983 const char *fmt, ...); 984 extern __printf(6, 7) 985 struct device *device_create_with_groups(struct class *cls, 986 struct device *parent, dev_t devt, void *drvdata, 987 const struct attribute_group **groups, 988 const char *fmt, ...); 989 extern void device_destroy(struct class *cls, dev_t devt); 990 991 /* 992 * Platform "fixup" functions - allow the platform to have their say 993 * about devices and actions that the general device layer doesn't 994 * know about. 995 */ 996 /* Notify platform of device discovery */ 997 extern int (*platform_notify)(struct device *dev); 998 999 extern int (*platform_notify_remove)(struct device *dev); 1000 1001 1002 /* 1003 * get_device - atomically increment the reference count for the device. 1004 * 1005 */ 1006 extern struct device *get_device(struct device *dev); 1007 extern void put_device(struct device *dev); 1008 1009 #ifdef CONFIG_DEVTMPFS 1010 extern int devtmpfs_create_node(struct device *dev); 1011 extern int devtmpfs_delete_node(struct device *dev); 1012 extern int devtmpfs_mount(const char *mntdir); 1013 #else 1014 static inline int devtmpfs_create_node(struct device *dev) { return 0; } 1015 static inline int devtmpfs_delete_node(struct device *dev) { return 0; } 1016 static inline int devtmpfs_mount(const char *mountpoint) { return 0; } 1017 #endif 1018 1019 /* drivers/base/power/shutdown.c */ 1020 extern void device_shutdown(void); 1021 1022 /* debugging and troubleshooting/diagnostic helpers. */ 1023 extern const char *dev_driver_string(const struct device *dev); 1024 1025 1026 #ifdef CONFIG_PRINTK 1027 1028 extern __printf(3, 0) 1029 int dev_vprintk_emit(int level, const struct device *dev, 1030 const char *fmt, va_list args); 1031 extern __printf(3, 4) 1032 int dev_printk_emit(int level, const struct device *dev, const char *fmt, ...); 1033 1034 extern __printf(3, 4) 1035 int dev_printk(const char *level, const struct device *dev, 1036 const char *fmt, ...); 1037 extern __printf(2, 3) 1038 int dev_emerg(const struct device *dev, const char *fmt, ...); 1039 extern __printf(2, 3) 1040 int dev_alert(const struct device *dev, const char *fmt, ...); 1041 extern __printf(2, 3) 1042 int dev_crit(const struct device *dev, const char *fmt, ...); 1043 extern __printf(2, 3) 1044 int dev_err(const struct device *dev, const char *fmt, ...); 1045 extern __printf(2, 3) 1046 int dev_warn(const struct device *dev, const char *fmt, ...); 1047 extern __printf(2, 3) 1048 int dev_notice(const struct device *dev, const char *fmt, ...); 1049 extern __printf(2, 3) 1050 int _dev_info(const struct device *dev, const char *fmt, ...); 1051 1052 #else 1053 1054 static inline __printf(3, 0) 1055 int dev_vprintk_emit(int level, const struct device *dev, 1056 const char *fmt, va_list args) 1057 { return 0; } 1058 static inline __printf(3, 4) 1059 int dev_printk_emit(int level, const struct device *dev, const char *fmt, ...) 1060 { return 0; } 1061 1062 static inline int __dev_printk(const char *level, const struct device *dev, 1063 struct va_format *vaf) 1064 { return 0; } 1065 static inline __printf(3, 4) 1066 int dev_printk(const char *level, const struct device *dev, 1067 const char *fmt, ...) 1068 { return 0; } 1069 1070 static inline __printf(2, 3) 1071 int dev_emerg(const struct device *dev, const char *fmt, ...) 1072 { return 0; } 1073 static inline __printf(2, 3) 1074 int dev_crit(const struct device *dev, const char *fmt, ...) 1075 { return 0; } 1076 static inline __printf(2, 3) 1077 int dev_alert(const struct device *dev, const char *fmt, ...) 1078 { return 0; } 1079 static inline __printf(2, 3) 1080 int dev_err(const struct device *dev, const char *fmt, ...) 1081 { return 0; } 1082 static inline __printf(2, 3) 1083 int dev_warn(const struct device *dev, const char *fmt, ...) 1084 { return 0; } 1085 static inline __printf(2, 3) 1086 int dev_notice(const struct device *dev, const char *fmt, ...) 1087 { return 0; } 1088 static inline __printf(2, 3) 1089 int _dev_info(const struct device *dev, const char *fmt, ...) 1090 { return 0; } 1091 1092 #endif 1093 1094 /* 1095 * Stupid hackaround for existing uses of non-printk uses dev_info 1096 * 1097 * Note that the definition of dev_info below is actually _dev_info 1098 * and a macro is used to avoid redefining dev_info 1099 */ 1100 1101 #define dev_info(dev, fmt, arg...) _dev_info(dev, fmt, ##arg) 1102 1103 #if defined(CONFIG_DYNAMIC_DEBUG) 1104 #define dev_dbg(dev, format, ...) \ 1105 do { \ 1106 dynamic_dev_dbg(dev, format, ##__VA_ARGS__); \ 1107 } while (0) 1108 #elif defined(DEBUG) 1109 #define dev_dbg(dev, format, arg...) \ 1110 dev_printk(KERN_DEBUG, dev, format, ##arg) 1111 #else 1112 #define dev_dbg(dev, format, arg...) \ 1113 ({ \ 1114 if (0) \ 1115 dev_printk(KERN_DEBUG, dev, format, ##arg); \ 1116 0; \ 1117 }) 1118 #endif 1119 1120 #define dev_level_ratelimited(dev_level, dev, fmt, ...) \ 1121 do { \ 1122 static DEFINE_RATELIMIT_STATE(_rs, \ 1123 DEFAULT_RATELIMIT_INTERVAL, \ 1124 DEFAULT_RATELIMIT_BURST); \ 1125 if (__ratelimit(&_rs)) \ 1126 dev_level(dev, fmt, ##__VA_ARGS__); \ 1127 } while (0) 1128 1129 #define dev_emerg_ratelimited(dev, fmt, ...) \ 1130 dev_level_ratelimited(dev_emerg, dev, fmt, ##__VA_ARGS__) 1131 #define dev_alert_ratelimited(dev, fmt, ...) \ 1132 dev_level_ratelimited(dev_alert, dev, fmt, ##__VA_ARGS__) 1133 #define dev_crit_ratelimited(dev, fmt, ...) \ 1134 dev_level_ratelimited(dev_crit, dev, fmt, ##__VA_ARGS__) 1135 #define dev_err_ratelimited(dev, fmt, ...) \ 1136 dev_level_ratelimited(dev_err, dev, fmt, ##__VA_ARGS__) 1137 #define dev_warn_ratelimited(dev, fmt, ...) \ 1138 dev_level_ratelimited(dev_warn, dev, fmt, ##__VA_ARGS__) 1139 #define dev_notice_ratelimited(dev, fmt, ...) \ 1140 dev_level_ratelimited(dev_notice, dev, fmt, ##__VA_ARGS__) 1141 #define dev_info_ratelimited(dev, fmt, ...) \ 1142 dev_level_ratelimited(dev_info, dev, fmt, ##__VA_ARGS__) 1143 #if defined(CONFIG_DYNAMIC_DEBUG) 1144 /* descriptor check is first to prevent flooding with "callbacks suppressed" */ 1145 #define dev_dbg_ratelimited(dev, fmt, ...) \ 1146 do { \ 1147 static DEFINE_RATELIMIT_STATE(_rs, \ 1148 DEFAULT_RATELIMIT_INTERVAL, \ 1149 DEFAULT_RATELIMIT_BURST); \ 1150 DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt); \ 1151 if (unlikely(descriptor.flags & _DPRINTK_FLAGS_PRINT) && \ 1152 __ratelimit(&_rs)) \ 1153 __dynamic_dev_dbg(&descriptor, dev, fmt, \ 1154 ##__VA_ARGS__); \ 1155 } while (0) 1156 #elif defined(DEBUG) 1157 #define dev_dbg_ratelimited(dev, fmt, ...) \ 1158 do { \ 1159 static DEFINE_RATELIMIT_STATE(_rs, \ 1160 DEFAULT_RATELIMIT_INTERVAL, \ 1161 DEFAULT_RATELIMIT_BURST); \ 1162 if (__ratelimit(&_rs)) \ 1163 dev_printk(KERN_DEBUG, dev, fmt, ##__VA_ARGS__); \ 1164 } while (0) 1165 #else 1166 #define dev_dbg_ratelimited(dev, fmt, ...) \ 1167 no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) 1168 #endif 1169 1170 #ifdef VERBOSE_DEBUG 1171 #define dev_vdbg dev_dbg 1172 #else 1173 #define dev_vdbg(dev, format, arg...) \ 1174 ({ \ 1175 if (0) \ 1176 dev_printk(KERN_DEBUG, dev, format, ##arg); \ 1177 0; \ 1178 }) 1179 #endif 1180 1181 /* 1182 * dev_WARN*() acts like dev_printk(), but with the key difference of 1183 * using WARN/WARN_ONCE to include file/line information and a backtrace. 1184 */ 1185 #define dev_WARN(dev, format, arg...) \ 1186 WARN(1, "%s %s: " format, dev_driver_string(dev), dev_name(dev), ## arg); 1187 1188 #define dev_WARN_ONCE(dev, condition, format, arg...) \ 1189 WARN_ONCE(condition, "%s %s: " format, \ 1190 dev_driver_string(dev), dev_name(dev), ## arg) 1191 1192 /* Create alias, so I can be autoloaded. */ 1193 #define MODULE_ALIAS_CHARDEV(major,minor) \ 1194 MODULE_ALIAS("char-major-" __stringify(major) "-" __stringify(minor)) 1195 #define MODULE_ALIAS_CHARDEV_MAJOR(major) \ 1196 MODULE_ALIAS("char-major-" __stringify(major) "-*") 1197 1198 #ifdef CONFIG_SYSFS_DEPRECATED 1199 extern long sysfs_deprecated; 1200 #else 1201 #define sysfs_deprecated 0 1202 #endif 1203 1204 /** 1205 * module_driver() - Helper macro for drivers that don't do anything 1206 * special in module init/exit. This eliminates a lot of boilerplate. 1207 * Each module may only use this macro once, and calling it replaces 1208 * module_init() and module_exit(). 1209 * 1210 * @__driver: driver name 1211 * @__register: register function for this driver type 1212 * @__unregister: unregister function for this driver type 1213 * @...: Additional arguments to be passed to __register and __unregister. 1214 * 1215 * Use this macro to construct bus specific macros for registering 1216 * drivers, and do not use it on its own. 1217 */ 1218 #define module_driver(__driver, __register, __unregister, ...) \ 1219 static int __init __driver##_init(void) \ 1220 { \ 1221 return __register(&(__driver) , ##__VA_ARGS__); \ 1222 } \ 1223 module_init(__driver##_init); \ 1224 static void __exit __driver##_exit(void) \ 1225 { \ 1226 __unregister(&(__driver) , ##__VA_ARGS__); \ 1227 } \ 1228 module_exit(__driver##_exit); 1229 1230 #endif /* _DEVICE_H_ */
1 /* 2 * 3 * V 4 L 2 D R I V E R H E L P E R A P I 4 * 5 * Moved from videodev2.h 6 * 7 * Some commonly needed functions for drivers (v4l2-common.o module) 8 */ 9 #ifndef _V4L2_DEV_H 10 #define _V4L2_DEV_H 11 12 #include <linux/poll.h> 13 #include <linux/fs.h> 14 #include <linux/device.h> 15 #include <linux/cdev.h> 16 #include <linux/mutex.h> 17 #include <linux/videodev2.h> 18 19 #include <media/media-entity.h> 20 21 #define VIDEO_MAJOR 81 22 23 #define VFL_TYPE_GRABBER 0 24 #define VFL_TYPE_VBI 1 25 #define VFL_TYPE_RADIO 2 26 #define VFL_TYPE_SUBDEV 3 27 #define VFL_TYPE_SDR 4 28 #define VFL_TYPE_MAX 5 29 30 /* Is this a receiver, transmitter or mem-to-mem? */ 31 /* Ignored for VFL_TYPE_SUBDEV. */ 32 #define VFL_DIR_RX 0 33 #define VFL_DIR_TX 1 34 #define VFL_DIR_M2M 2 35 36 struct v4l2_ioctl_callbacks; 37 struct video_device; 38 struct v4l2_device; 39 struct v4l2_ctrl_handler; 40 41 /* Flag to mark the video_device struct as registered. 42 Drivers can clear this flag if they want to block all future 43 device access. It is cleared by video_unregister_device. */ 44 #define V4L2_FL_REGISTERED (0) 45 /* file->private_data points to struct v4l2_fh */ 46 #define V4L2_FL_USES_V4L2_FH (1) 47 48 /* Priority helper functions */ 49 50 struct v4l2_prio_state { 51 atomic_t prios[4]; 52 }; 53 54 void v4l2_prio_init(struct v4l2_prio_state *global); 55 int v4l2_prio_change(struct v4l2_prio_state *global, enum v4l2_priority *local, 56 enum v4l2_priority new); 57 void v4l2_prio_open(struct v4l2_prio_state *global, enum v4l2_priority *local); 58 void v4l2_prio_close(struct v4l2_prio_state *global, enum v4l2_priority local); 59 enum v4l2_priority v4l2_prio_max(struct v4l2_prio_state *global); 60 int v4l2_prio_check(struct v4l2_prio_state *global, enum v4l2_priority local); 61 62 63 struct v4l2_file_operations { 64 struct module *owner; 65 ssize_t (*read) (struct file *, char __user *, size_t, loff_t *); 66 ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *); 67 unsigned int (*poll) (struct file *, struct poll_table_struct *); 68 long (*ioctl) (struct file *, unsigned int, unsigned long); 69 long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long); 70 #ifdef CONFIG_COMPAT 71 long (*compat_ioctl32) (struct file *, unsigned int, unsigned long); 72 #endif 73 unsigned long (*get_unmapped_area) (struct file *, unsigned long, 74 unsigned long, unsigned long, unsigned long); 75 int (*mmap) (struct file *, struct vm_area_struct *); 76 int (*open) (struct file *); 77 int (*release) (struct file *); 78 }; 79 80 /* 81 * Newer version of video_device, handled by videodev2.c 82 * This version moves redundant code from video device code to 83 * the common handler 84 */ 85 86 struct video_device 87 { 88 #if defined(CONFIG_MEDIA_CONTROLLER) 89 struct media_entity entity; 90 #endif 91 /* device ops */ 92 const struct v4l2_file_operations *fops; 93 94 /* sysfs */ 95 struct device dev; /* v4l device */ 96 struct cdev *cdev; /* character device */ 97 98 struct v4l2_device *v4l2_dev; /* v4l2_device parent */ 99 /* Only set parent if that can't be deduced from v4l2_dev */ 100 struct device *dev_parent; /* device parent */ 101 102 /* Control handler associated with this device node. May be NULL. */ 103 struct v4l2_ctrl_handler *ctrl_handler; 104 105 /* vb2_queue associated with this device node. May be NULL. */ 106 struct vb2_queue *queue; 107 108 /* Priority state. If NULL, then v4l2_dev->prio will be used. */ 109 struct v4l2_prio_state *prio; 110 111 /* device info */ 112 char name[32]; 113 int vfl_type; /* device type */ 114 int vfl_dir; /* receiver, transmitter or m2m */ 115 /* 'minor' is set to -1 if the registration failed */ 116 int minor; 117 u16 num; 118 /* use bitops to set/clear/test flags */ 119 unsigned long flags; 120 /* attribute to differentiate multiple indices on one physical device */ 121 int index; 122 123 /* V4L2 file handles */ 124 spinlock_t fh_lock; /* Lock for all v4l2_fhs */ 125 struct list_head fh_list; /* List of struct v4l2_fh */ 126 127 int debug; /* Activates debug level*/ 128 129 /* Video standard vars */ 130 v4l2_std_id tvnorms; /* Supported tv norms */ 131 132 /* callbacks */ 133 void (*release)(struct video_device *vdev); 134 135 /* ioctl callbacks */ 136 const struct v4l2_ioctl_ops *ioctl_ops; 137 DECLARE_BITMAP(valid_ioctls, BASE_VIDIOC_PRIVATE); 138 139 /* serialization lock */ 140 DECLARE_BITMAP(disable_locking, BASE_VIDIOC_PRIVATE); 141 struct mutex *lock; 142 }; 143 144 #define media_entity_to_video_device(__e) \ 145 container_of(__e, struct video_device, entity) 146 /* dev to video-device */ 147 #define to_video_device(cd) container_of(cd, struct video_device, dev) 148 149 int __must_check __video_register_device(struct video_device *vdev, int type, 150 int nr, int warn_if_nr_in_use, struct module *owner); 151 152 /* Register video devices. Note that if video_register_device fails, 153 the release() callback of the video_device structure is *not* called, so 154 the caller is responsible for freeing any data. Usually that means that 155 you call video_device_release() on failure. */ 156 static inline int __must_check video_register_device(struct video_device *vdev, 157 int type, int nr) 158 { 159 return __video_register_device(vdev, type, nr, 1, vdev->fops->owner); 160 } 161 162 /* Same as video_register_device, but no warning is issued if the desired 163 device node number was already in use. */ 164 static inline int __must_check video_register_device_no_warn( 165 struct video_device *vdev, int type, int nr) 166 { 167 return __video_register_device(vdev, type, nr, 0, vdev->fops->owner); 168 } 169 170 /* Unregister video devices. Will do nothing if vdev == NULL or 171 video_is_registered() returns false. */ 172 void video_unregister_device(struct video_device *vdev); 173 174 /* helper functions to alloc/release struct video_device, the 175 latter can also be used for video_device->release(). */ 176 struct video_device * __must_check video_device_alloc(void); 177 178 /* this release function frees the vdev pointer */ 179 void video_device_release(struct video_device *vdev); 180 181 /* this release function does nothing, use when the video_device is a 182 static global struct. Note that having a static video_device is 183 a dubious construction at best. */ 184 void video_device_release_empty(struct video_device *vdev); 185 186 /* returns true if cmd is a known V4L2 ioctl */ 187 bool v4l2_is_known_ioctl(unsigned int cmd); 188 189 /* mark that this command shouldn't use core locking */ 190 static inline void v4l2_disable_ioctl_locking(struct video_device *vdev, unsigned int cmd) 191 { 192 if (_IOC_NR(cmd) < BASE_VIDIOC_PRIVATE) 193 set_bit(_IOC_NR(cmd), vdev->disable_locking); 194 } 195 196 /* Mark that this command isn't implemented. This must be called before 197 video_device_register. See also the comments in determine_valid_ioctls(). 198 This function allows drivers to provide just one v4l2_ioctl_ops struct, but 199 disable ioctls based on the specific card that is actually found. */ 200 static inline void v4l2_disable_ioctl(struct video_device *vdev, unsigned int cmd) 201 { 202 if (_IOC_NR(cmd) < BASE_VIDIOC_PRIVATE) 203 set_bit(_IOC_NR(cmd), vdev->valid_ioctls); 204 } 205 206 /* helper functions to access driver private data. */ 207 static inline void *video_get_drvdata(struct video_device *vdev) 208 { 209 return dev_get_drvdata(&vdev->dev); 210 } 211 212 static inline void video_set_drvdata(struct video_device *vdev, void *data) 213 { 214 dev_set_drvdata(&vdev->dev, data); 215 } 216 217 struct video_device *video_devdata(struct file *file); 218 219 /* Combine video_get_drvdata and video_devdata as this is 220 used very often. */ 221 static inline void *video_drvdata(struct file *file) 222 { 223 return video_get_drvdata(video_devdata(file)); 224 } 225 226 static inline const char *video_device_node_name(struct video_device *vdev) 227 { 228 return dev_name(&vdev->dev); 229 } 230 231 static inline int video_is_registered(struct video_device *vdev) 232 { 233 return test_bit(V4L2_FL_REGISTERED, &vdev->flags); 234 } 235 236 #endif /* _V4L2_DEV_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.

Kernel Module Rule Verifier Verdict Status Timestamp Bug report
linux-3.17-rc1.tar.xz drivers/media/platform/sh_vou.ko 104_1a CPAchecker Bug Fixed 2015-02-14 01:41:20 L0198

Comment

Reported: 14 Feb 2015

[Home]