summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/.gitignore39
-rw-r--r--src/Makefile.am1151
-rw-r--r--src/access.c50
-rw-r--r--src/affinity.c105
-rw-r--r--src/aio.c313
-rw-r--r--src/alpha.c66
-rw-r--r--src/arch_defs.h15
-rw-r--r--src/basic_filters.c387
-rw-r--r--src/bind.c23
-rw-r--r--src/bjm.c49
-rw-r--r--src/block.c220
-rw-r--r--src/bpf.c1365
-rw-r--r--src/bpf_attr.h410
-rw-r--r--src/bpf_filter.c182
-rw-r--r--src/bpf_filter.h30
-rw-r--r--src/bpf_fprog.h16
-rw-r--r--src/bpf_seccomp_filter.c51
-rw-r--r--src/bpf_sock_filter.c56
-rw-r--r--src/btrfs.c1420
-rw-r--r--src/cacheflush.c83
-rw-r--r--src/capability.c148
-rw-r--r--src/caps0.h39
-rw-r--r--src/caps1.h16
-rw-r--r--src/chdir.c15
-rw-r--r--src/chmod.c41
-rw-r--r--src/clone.c332
-rw-r--r--src/close_range.c22
-rw-r--r--src/copy_file_range.c30
-rw-r--r--src/count.c524
-rw-r--r--src/defs.h1850
-rw-r--r--src/delay.c133
-rw-r--r--src/delay.h18
-rw-r--r--src/desc.c199
-rw-r--r--src/dirent.c120
-rw-r--r--src/dirent64.c67
-rw-r--r--src/dirent_types.c11
-rw-r--r--src/disable_ptrace_get_syscall_info.c13
-rw-r--r--src/disable_ptrace_getregset.c24
-rw-r--r--src/disable_ptrace_request.c159
-rw-r--r--src/dm.c651
-rw-r--r--src/dup.c42
-rw-r--r--src/dyxlat.c76
-rw-r--r--src/empty.h0
-rw-r--r--src/epoll.c111
-rw-r--r--src/error_prints.c108
-rw-r--r--src/error_prints.h59
-rw-r--r--src/evdev.c465
-rw-r--r--src/evdev_mpers.c199
-rw-r--r--src/eventfd.c37
-rw-r--r--src/execve.c131
-rw-r--r--src/f_owner_ex.h21
-rw-r--r--src/fadvise.c46
-rw-r--r--src/fallocate.c35
-rw-r--r--src/fanotify.c66
-rw-r--r--src/fchownat.c21
-rw-r--r--src/fcntl.c232
-rw-r--r--src/fetch_bpf_fprog.c44
-rw-r--r--src/fetch_indirect_syscall_args.c35
-rw-r--r--src/fetch_struct_flock.c73
-rw-r--r--src/fetch_struct_keyctl_kdf_params.c41
-rw-r--r--src/fetch_struct_mmsghdr.c68
-rw-r--r--src/fetch_struct_msghdr.c60
-rw-r--r--src/fetch_struct_stat.c86
-rw-r--r--src/fetch_struct_stat64.c84
-rw-r--r--src/fetch_struct_statfs.c103
-rw-r--r--src/fetch_struct_xfs_quotastat.c42
-rw-r--r--src/file_handle.c131
-rw-r--r--src/filter.h19
-rw-r--r--src/filter_qualify.c591
-rw-r--r--src/filter_seccomp.c762
-rw-r--r--src/filter_seccomp.h22
-rw-r--r--src/flock.c24
-rw-r--r--src/flock.h30
-rw-r--r--src/fs_0x94_ioctl.c158
-rw-r--r--src/fs_f_ioctl.c128
-rw-r--r--src/fs_x_ioctl.c89
-rw-r--r--src/fsconfig.c88
-rw-r--r--src/fsmount.c26
-rw-r--r--src/fsopen.c20
-rw-r--r--src/fspick.c25
-rw-r--r--src/fstatfs.c19
-rw-r--r--src/fstatfs64.c19
-rw-r--r--src/futex.c136
-rw-r--r--src/gcc_compat.h136
-rwxr-xr-xsrc/gen_bpf_attr_check.sh59
-rwxr-xr-xsrc/generate_mpers_am.sh22
-rwxr-xr-xsrc/generate_sen.sh15
-rw-r--r--src/get_personality.c19
-rw-r--r--src/get_personality.h17
-rw-r--r--src/get_robust_list.c22
-rw-r--r--src/getcpu.c20
-rw-r--r--src/getcwd.c20
-rw-r--r--src/getpagesize.c13
-rw-r--r--src/getpid.c46
-rw-r--r--src/getrandom.c23
-rw-r--r--src/gpio_ioctl.c509
-rw-r--r--src/hdio.c111
-rw-r--r--src/hostname.c45
-rw-r--r--src/inotify.c49
-rw-r--r--src/inotify_ioctl.c28
-rw-r--r--src/io.c315
-rw-r--r--src/io_uring.c322
-rw-r--r--src/ioctl.c422
-rw-r--r--src/ioctl_iocdef.c24
-rw-r--r--src/ioctlsort.c145
-rw-r--r--src/ioperm.c16
-rw-r--r--src/iopl.c15
-rw-r--r--src/ioprio.c106
-rw-r--r--src/ipc.c28
-rw-r--r--src/ipc_defs.h71
-rw-r--r--src/ipc_msg.c111
-rw-r--r--src/ipc_msgctl.c155
-rw-r--r--src/ipc_sem.c98
-rw-r--r--src/ipc_semctl.c186
-rw-r--r--src/ipc_shm.c92
-rw-r--r--src/ipc_shmctl.c178
-rw-r--r--src/kcmp.c80
-rw-r--r--src/kernel_dirent.h29
-rw-r--r--src/kernel_rusage.h32
-rw-r--r--src/kernel_timespec.h25
-rw-r--r--src/kernel_timeval.h27
-rw-r--r--src/kernel_timex.h105
-rw-r--r--src/kernel_types.h63
-rw-r--r--src/kernel_v4l2_types.h61
-rw-r--r--src/kexec.c111
-rw-r--r--src/keyctl.c630
-rw-r--r--src/keyctl_kdf_params.h34
-rw-r--r--src/kill_save_errno.h24
-rw-r--r--src/kvm.c428
-rw-r--r--src/largefile_wrappers.h52
-rw-r--r--src/ldt.c202
-rw-r--r--src/link.c64
-rw-r--r--src/linux/32/ioctls_inc.h15
-rw-r--r--src/linux/32/ioctls_inc_align16.h2914
-rw-r--r--src/linux/32/ioctls_inc_align32.h2914
-rw-r--r--src/linux/32/ioctls_inc_align64.h2914
-rw-r--r--src/linux/32/syscallent-time32.h33
-rw-r--r--src/linux/32/syscallent.h303
-rw-r--r--src/linux/64/ioctls_inc.h2927
-rw-r--r--src/linux/64/syscallent.h289
-rw-r--r--src/linux/aarch64/arch_defs_.h13
-rw-r--r--src/linux/aarch64/arch_get_personality.c13
-rw-r--r--src/linux/aarch64/arch_regs.c49
-rw-r--r--src/linux/aarch64/arch_sigreturn.c1
-rw-r--r--src/linux/aarch64/get_error.c28
-rw-r--r--src/linux/aarch64/get_scno.c28
-rw-r--r--src/linux/aarch64/get_syscall_args.c25
-rw-r--r--src/linux/aarch64/ioctls_arch0.h74
-rw-r--r--src/linux/aarch64/ioctls_arch1.h1
-rw-r--r--src/linux/aarch64/ioctls_inc0.h1
-rw-r--r--src/linux/aarch64/ioctls_inc1.h1
-rw-r--r--src/linux/aarch64/nr_prefix.c1
-rw-r--r--src/linux/aarch64/raw_syscall.h29
-rw-r--r--src/linux/aarch64/set_error.c32
-rw-r--r--src/linux/aarch64/set_scno.c29
-rw-r--r--src/linux/aarch64/shuffle_scno.c19
-rw-r--r--src/linux/aarch64/syscallent.h13
-rw-r--r--src/linux/aarch64/syscallent1.h1
-rw-r--r--src/linux/alpha/arch_defs_.h10
-rw-r--r--src/linux/alpha/arch_getrval2.c15
-rw-r--r--src/linux/alpha/arch_regs.c18
-rw-r--r--src/linux/alpha/arch_sigreturn.c18
-rw-r--r--src/linux/alpha/errnoent.h156
-rw-r--r--src/linux/alpha/get_error.c17
-rw-r--r--src/linux/alpha/get_scno.c32
-rw-r--r--src/linux/alpha/get_syscall_args.c18
-rw-r--r--src/linux/alpha/get_syscall_result.c13
-rw-r--r--src/linux/alpha/ioctls_arch0.h80
-rw-r--r--src/linux/alpha/ioctls_inc0.h1
-rw-r--r--src/linux/alpha/raw_syscall.h31
-rw-r--r--src/linux/alpha/set_error.c20
-rw-r--r--src/linux/alpha/set_scno.c12
-rw-r--r--src/linux/alpha/signalent.h40
-rw-r--r--src/linux/alpha/syscallent.h483
-rw-r--r--src/linux/alpha/userent.h74
-rw-r--r--src/linux/arc/arch_regs.c11
-rw-r--r--src/linux/arc/get_error.c19
-rw-r--r--src/linux/arc/get_scno.c14
-rw-r--r--src/linux/arc/get_syscall_args.c18
-rw-r--r--src/linux/arc/ioctls_arch0.h1
-rw-r--r--src/linux/arc/ioctls_inc0.h1
-rw-r--r--src/linux/arc/raw_syscall.h41
-rw-r--r--src/linux/arc/set_error.c20
-rw-r--r--src/linux/arc/set_scno.c15
-rw-r--r--src/linux/arc/syscallent.h15
-rw-r--r--src/linux/arch_defs_.h76
-rw-r--r--src/linux/arch_kvm.c26
-rw-r--r--src/linux/arch_regs.h1
-rw-r--r--src/linux/arch_rt_sigframe.c14
-rw-r--r--src/linux/arch_sigreturn.c11
-rw-r--r--src/linux/arm/arch_defs_.h11
-rw-r--r--src/linux/arm/arch_regs.c12
-rw-r--r--src/linux/arm/arch_sigreturn.c28
-rw-r--r--src/linux/arm/get_error.c19
-rw-r--r--src/linux/arm/get_scno.c62
-rw-r--r--src/linux/arm/get_syscall_args.c19
-rw-r--r--src/linux/arm/ioctls_arch0.h75
-rw-r--r--src/linux/arm/ioctls_inc0.h1
-rw-r--r--src/linux/arm/nr_prefix.c19
-rw-r--r--src/linux/arm/raw_syscall.h44
-rw-r--r--src/linux/arm/set_error.c20
-rw-r--r--src/linux/arm/set_scno.c25
-rw-r--r--src/linux/arm/shuffle_scno.c35
-rw-r--r--src/linux/arm/syscallent.h443
-rw-r--r--src/linux/arm/userent.h37
-rw-r--r--src/linux/asm_stat.h57
-rw-r--r--src/linux/avr32/arch_regs.c11
-rw-r--r--src/linux/avr32/get_error.c19
-rw-r--r--src/linux/avr32/get_scno.c14
-rw-r--r--src/linux/avr32/get_syscall_args.c19
-rw-r--r--src/linux/avr32/ioctls_arch0.h1
-rw-r--r--src/linux/avr32/ioctls_inc0.h1
-rw-r--r--src/linux/avr32/raw_syscall.h29
-rw-r--r--src/linux/avr32/set_error.c20
-rw-r--r--src/linux/avr32/set_scno.c15
-rw-r--r--src/linux/avr32/syscallent.h339
-rw-r--r--src/linux/avr32/userent.h37
-rw-r--r--src/linux/bfin/arch_defs_.h9
-rw-r--r--src/linux/bfin/arch_regs.c10
-rw-r--r--src/linux/bfin/get_error.c19
-rw-r--r--src/linux/bfin/get_scno.c13
-rw-r--r--src/linux/bfin/get_syscall_args.c21
-rw-r--r--src/linux/bfin/get_syscall_result.c12
-rw-r--r--src/linux/bfin/ioctls_arch0.h12
-rw-r--r--src/linux/bfin/ioctls_inc0.h1
-rw-r--r--src/linux/bfin/raw_syscall.h28
-rw-r--r--src/linux/bfin/rt_sigframe.h22
-rw-r--r--src/linux/bfin/set_error.c20
-rw-r--r--src/linux/bfin/set_scno.c12
-rw-r--r--src/linux/bfin/syscallent.h401
-rw-r--r--src/linux/bfin/userent.h16
-rw-r--r--src/linux/check_scno.c13
-rw-r--r--src/linux/csky/arch_regs.c12
-rw-r--r--src/linux/csky/get_error.c18
-rw-r--r--src/linux/csky/get_scno.c18
-rw-r--r--src/linux/csky/get_syscall_args.c19
-rw-r--r--src/linux/csky/ioctls_arch0.h1
-rw-r--r--src/linux/csky/ioctls_inc0.h1
-rw-r--r--src/linux/csky/raw_syscall.h32
-rw-r--r--src/linux/csky/set_error.c20
-rw-r--r--src/linux/csky/set_scno.c19
-rw-r--r--src/linux/csky/syscallent.h4
-rw-r--r--src/linux/dummy.h141
-rw-r--r--src/linux/errnoent.h155
-rw-r--r--src/linux/getregs_old.h8
-rw-r--r--src/linux/hppa/arch_defs_.h16
-rw-r--r--src/linux/hppa/arch_regs.c11
-rw-r--r--src/linux/hppa/arch_rt_sigframe.c21
-rw-r--r--src/linux/hppa/errnoent.h159
-rw-r--r--src/linux/hppa/get_error.c19
-rw-r--r--src/linux/hppa/get_scno.c14
-rw-r--r--src/linux/hppa/get_syscall_args.c15
-rw-r--r--src/linux/hppa/ioctls_arch0.h94
-rw-r--r--src/linux/hppa/ioctls_inc0.h1
-rw-r--r--src/linux/hppa/raw_syscall.h32
-rw-r--r--src/linux/hppa/rt_sigframe.h19
-rw-r--r--src/linux/hppa/set_error.c20
-rw-r--r--src/linux/hppa/set_scno.c15
-rw-r--r--src/linux/hppa/signalent.h40
-rw-r--r--src/linux/hppa/syscallent.h364
-rw-r--r--src/linux/hppa/userent.h69
-rw-r--r--src/linux/i386/arch_defs_.h11
-rw-r--r--src/linux/i386/arch_kvm.c1
-rw-r--r--src/linux/i386/arch_regs.c15
-rw-r--r--src/linux/i386/arch_rt_sigframe.c12
-rw-r--r--src/linux/i386/arch_sigreturn.c30
-rw-r--r--src/linux/i386/get_error.c19
-rw-r--r--src/linux/i386/get_scno.c14
-rw-r--r--src/linux/i386/get_syscall_args.c19
-rw-r--r--src/linux/i386/ioctls_arch0.h119
-rw-r--r--src/linux/i386/ioctls_inc0.h1
-rw-r--r--src/linux/i386/raw_syscall.h28
-rw-r--r--src/linux/i386/rt_sigframe.h23
-rw-r--r--src/linux/i386/set_error.c20
-rw-r--r--src/linux/i386/set_scno.c12
-rw-r--r--src/linux/i386/syscallent.h411
-rw-r--r--src/linux/i386/userent.h26
-rw-r--r--src/linux/i386/userent0.h22
-rw-r--r--src/linux/ia64/arch_defs_.h12
-rw-r--r--src/linux/ia64/arch_getrval2.c14
-rw-r--r--src/linux/ia64/arch_regs.c12
-rw-r--r--src/linux/ia64/arch_regs.h1
-rw-r--r--src/linux/ia64/arch_rt_sigframe.c12
-rw-r--r--src/linux/ia64/get_error.c19
-rw-r--r--src/linux/ia64/get_scno.c14
-rw-r--r--src/linux/ia64/get_syscall_args.c33
-rw-r--r--src/linux/ia64/ioctls_arch0.h1
-rw-r--r--src/linux/ia64/ioctls_inc0.h1
-rw-r--r--src/linux/ia64/raw_syscall.h41
-rw-r--r--src/linux/ia64/rt_sigframe.h25
-rw-r--r--src/linux/ia64/set_error.c24
-rw-r--r--src/linux/ia64/set_scno.c15
-rw-r--r--src/linux/ia64/shuffle_scno.c11
-rw-r--r--src/linux/ia64/syscallent.h359
-rw-r--r--src/linux/ia64/syscallent_base_nr.h1
-rw-r--r--src/linux/ia64/userent.h80
-rw-r--r--src/linux/inet_diag.h163
-rw-r--r--src/linux/m68k/arch_defs_.h11
-rw-r--r--src/linux/m68k/arch_regs.c11
-rw-r--r--src/linux/m68k/arch_rt_sigframe.c1
-rw-r--r--src/linux/m68k/arch_sigreturn.c29
-rw-r--r--src/linux/m68k/get_error.c19
-rw-r--r--src/linux/m68k/get_scno.c14
-rw-r--r--src/linux/m68k/get_syscall_args.c19
-rw-r--r--src/linux/m68k/ioctls_arch0.h24
-rw-r--r--src/linux/m68k/ioctls_inc0.h1
-rw-r--r--src/linux/m68k/raw_syscall.h28
-rw-r--r--src/linux/m68k/rt_sigframe.h23
-rw-r--r--src/linux/m68k/set_error.c20
-rw-r--r--src/linux/m68k/set_scno.c15
-rw-r--r--src/linux/m68k/syscallent.h409
-rw-r--r--src/linux/m68k/userent.h41
-rw-r--r--src/linux/metag/arch_regs.c11
-rw-r--r--src/linux/metag/arch_rt_sigframe.c15
-rw-r--r--src/linux/metag/get_error.c20
-rw-r--r--src/linux/metag/get_scno.c14
-rw-r--r--src/linux/metag/get_syscall_args.c19
-rw-r--r--src/linux/metag/ioctls_arch0.h1
-rw-r--r--src/linux/metag/ioctls_inc0.h1
-rw-r--r--src/linux/metag/raw_syscall.h29
-rw-r--r--src/linux/metag/set_error.c20
-rw-r--r--src/linux/metag/set_scno.c15
-rw-r--r--src/linux/metag/syscallent.h13
-rw-r--r--src/linux/microblaze/arch_defs_.h9
-rw-r--r--src/linux/microblaze/arch_regs.c10
-rw-r--r--src/linux/microblaze/arch_sigreturn.c21
-rw-r--r--src/linux/microblaze/get_error.c19
-rw-r--r--src/linux/microblaze/get_scno.c13
-rw-r--r--src/linux/microblaze/get_syscall_args.c18
-rw-r--r--src/linux/microblaze/get_syscall_result.c12
-rw-r--r--src/linux/microblaze/ioctls_arch0.h1
-rw-r--r--src/linux/microblaze/ioctls_inc0.h1
-rw-r--r--src/linux/microblaze/raw_syscall.h30
-rw-r--r--src/linux/microblaze/set_error.c20
-rw-r--r--src/linux/microblaze/set_scno.c12
-rw-r--r--src/linux/microblaze/syscallent.h412
-rw-r--r--src/linux/microblaze/userent.h47
-rw-r--r--src/linux/mips/.gitignore5
-rw-r--r--src/linux/mips/arch_defs_.h10
-rw-r--r--src/linux/mips/arch_getrval2.c14
-rw-r--r--src/linux/mips/arch_regs.c28
-rw-r--r--src/linux/mips/arch_sigreturn.c24
-rw-r--r--src/linux/mips/errnoent.h158
-rwxr-xr-xsrc/linux/mips/genstub.sh15
-rw-r--r--src/linux/mips/get_error.c17
-rw-r--r--src/linux/mips/get_scno.c22
-rw-r--r--src/linux/mips/get_syscall_args.c87
-rw-r--r--src/linux/mips/ioctls_arch0.h152
-rw-r--r--src/linux/mips/ioctls_inc0.h12
-rw-r--r--src/linux/mips/raw_syscall.h35
-rw-r--r--src/linux/mips/rt_sigframe.h19
-rw-r--r--src/linux/mips/set_error.c22
-rw-r--r--src/linux/mips/set_scno.c15
-rw-r--r--src/linux/mips/signalent.h40
-rw-r--r--src/linux/mips/syscallent-compat.h707
-rw-r--r--src/linux/mips/syscallent-n32.h359
-rw-r--r--src/linux/mips/syscallent-n64.h353
-rw-r--r--src/linux/mips/syscallent-o32.h407
-rw-r--r--src/linux/mips/syscallent.h5
-rw-r--r--src/linux/mips/userent.h90
-rw-r--r--src/linux/netlink_diag.h62
-rw-r--r--src/linux/nios2/arch_defs_.h8
-rw-r--r--src/linux/nios2/arch_regs.c11
-rw-r--r--src/linux/nios2/get_error.c24
-rw-r--r--src/linux/nios2/get_scno.c14
-rw-r--r--src/linux/nios2/get_syscall_args.c19
-rw-r--r--src/linux/nios2/ioctls_arch0.h1
-rw-r--r--src/linux/nios2/ioctls_inc0.h1
-rw-r--r--src/linux/nios2/raw_syscall.h29
-rw-r--r--src/linux/nios2/set_error.c22
-rw-r--r--src/linux/nios2/set_scno.c15
-rw-r--r--src/linux/nios2/syscallent.h11
-rw-r--r--src/linux/nr_prefix.c18
-rw-r--r--src/linux/or1k/arch_regs.c11
-rw-r--r--src/linux/or1k/get_error.c19
-rw-r--r--src/linux/or1k/get_scno.c14
-rw-r--r--src/linux/or1k/get_syscall_args.c19
-rw-r--r--src/linux/or1k/ioctls_arch0.h1
-rw-r--r--src/linux/or1k/ioctls_inc0.h1
-rw-r--r--src/linux/or1k/raw_syscall.h30
-rw-r--r--src/linux/or1k/set_error.c20
-rw-r--r--src/linux/or1k/set_scno.c15
-rw-r--r--src/linux/or1k/syscallent.h11
-rw-r--r--src/linux/or1k/userent.h41
-rw-r--r--src/linux/packet_diag.h80
-rw-r--r--src/linux/powerpc/arch_defs_.h10
-rw-r--r--src/linux/powerpc/arch_regs.c15
-rw-r--r--src/linux/powerpc/arch_rt_sigframe.c14
-rw-r--r--src/linux/powerpc/arch_sigreturn.c41
-rw-r--r--src/linux/powerpc/errnoent.h9
-rw-r--r--src/linux/powerpc/get_error.c17
-rw-r--r--src/linux/powerpc/get_scno.c14
-rw-r--r--src/linux/powerpc/get_syscall_args.c34
-rw-r--r--src/linux/powerpc/getregs_old.c42
-rw-r--r--src/linux/powerpc/getregs_old.h1
-rw-r--r--src/linux/powerpc/ioctls_arch0.h175
-rw-r--r--src/linux/powerpc/ioctls_inc0.h1
-rw-r--r--src/linux/powerpc/raw_syscall.h32
-rw-r--r--src/linux/powerpc/set_error.c35
-rw-r--r--src/linux/powerpc/set_scno.c12
-rw-r--r--src/linux/powerpc/syscallent.h403
-rw-r--r--src/linux/powerpc/userent.h54
-rw-r--r--src/linux/powerpc64/arch_defs_.h12
-rw-r--r--src/linux/powerpc64/arch_get_personality.c13
-rw-r--r--src/linux/powerpc64/arch_regs.c1
-rw-r--r--src/linux/powerpc64/arch_rt_sigframe.c23
-rw-r--r--src/linux/powerpc64/arch_sigreturn.c1
-rw-r--r--src/linux/powerpc64/errnoent.h1
-rw-r--r--src/linux/powerpc64/get_error.c1
-rw-r--r--src/linux/powerpc64/get_scno.c22
-rw-r--r--src/linux/powerpc64/get_syscall_args.c1
-rw-r--r--src/linux/powerpc64/getregs_old.c1
-rw-r--r--src/linux/powerpc64/getregs_old.h1
-rw-r--r--src/linux/powerpc64/ioctls_arch0.h1
-rw-r--r--src/linux/powerpc64/ioctls_arch1.h1
-rw-r--r--src/linux/powerpc64/ioctls_inc0.h1
-rw-r--r--src/linux/powerpc64/ioctls_inc1.h1
-rw-r--r--src/linux/powerpc64/raw_syscall.h1
-rw-r--r--src/linux/powerpc64/rt_sigframe.h22
-rw-r--r--src/linux/powerpc64/set_error.c1
-rw-r--r--src/linux/powerpc64/set_scno.c1
-rw-r--r--src/linux/powerpc64/syscallent.h399
-rw-r--r--src/linux/powerpc64/syscallent1.h1
-rw-r--r--src/linux/powerpc64/userent.h1
-rw-r--r--src/linux/powerpc64le/arch_defs_.h9
-rw-r--r--src/linux/powerpc64le/arch_regs.c1
-rw-r--r--src/linux/powerpc64le/arch_rt_sigframe.c13
-rw-r--r--src/linux/powerpc64le/errnoent.h1
-rw-r--r--src/linux/powerpc64le/get_error.c1
-rw-r--r--src/linux/powerpc64le/get_scno.c14
-rw-r--r--src/linux/powerpc64le/get_syscall_args.c1
-rw-r--r--src/linux/powerpc64le/ioctls_arch0.h1
-rw-r--r--src/linux/powerpc64le/ioctls_inc0.h1
-rw-r--r--src/linux/powerpc64le/raw_syscall.h1
-rw-r--r--src/linux/powerpc64le/rt_sigframe.h1
-rw-r--r--src/linux/powerpc64le/set_error.c1
-rw-r--r--src/linux/powerpc64le/set_scno.c1
-rw-r--r--src/linux/powerpc64le/syscallent.h1
-rw-r--r--src/linux/powerpc64le/userent.h1
-rw-r--r--src/linux/ptrace_pokeuser.c12
-rw-r--r--src/linux/raw_syscall.h1
-rw-r--r--src/linux/riscv64/arch_regs.c11
-rw-r--r--src/linux/riscv64/get_error.c19
-rw-r--r--src/linux/riscv64/get_scno.c14
-rw-r--r--src/linux/riscv64/get_syscall_args.c19
-rw-r--r--src/linux/riscv64/ioctls_arch0.h1
-rw-r--r--src/linux/riscv64/ioctls_inc0.h1
-rw-r--r--src/linux/riscv64/raw_syscall.h29
-rw-r--r--src/linux/riscv64/set_error.c20
-rw-r--r--src/linux/riscv64/set_scno.c15
-rw-r--r--src/linux/riscv64/syscallent.h11
-rw-r--r--src/linux/rt_sigframe.h21
-rw-r--r--src/linux/s390/arch_defs_.h11
-rw-r--r--src/linux/s390/arch_regs.c12
-rw-r--r--src/linux/s390/arch_sigreturn.c28
-rw-r--r--src/linux/s390/check_scno.c32
-rw-r--r--src/linux/s390/get_error.c23
-rw-r--r--src/linux/s390/get_scno.c19
-rw-r--r--src/linux/s390/get_syscall_args.c23
-rw-r--r--src/linux/s390/ioctls_arch0.h170
-rw-r--r--src/linux/s390/ioctls_inc0.h1
-rw-r--r--src/linux/s390/raw_syscall.h29
-rw-r--r--src/linux/s390/rt_sigframe.h27
-rw-r--r--src/linux/s390/set_error.c24
-rw-r--r--src/linux/s390/set_scno.c19
-rw-r--r--src/linux/s390/syscallent.h414
-rw-r--r--src/linux/s390/userent.h42
-rw-r--r--src/linux/s390/userent0.h48
-rw-r--r--src/linux/s390/userent1.h18
-rw-r--r--src/linux/s390x/arch_defs_.h13
-rw-r--r--src/linux/s390x/arch_get_personality.c13
-rw-r--r--src/linux/s390x/arch_regs.c45
-rw-r--r--src/linux/s390x/arch_sigreturn.c29
-rw-r--r--src/linux/s390x/check_scno.c1
-rw-r--r--src/linux/s390x/get_error.c29
-rw-r--r--src/linux/s390x/get_scno.c27
-rw-r--r--src/linux/s390x/get_syscall_args.c28
-rw-r--r--src/linux/s390x/ioctls_arch0.h170
-rw-r--r--src/linux/s390x/ioctls_arch1.h1
-rw-r--r--src/linux/s390x/ioctls_inc0.h1
-rw-r--r--src/linux/s390x/ioctls_inc1.h1
-rw-r--r--src/linux/s390x/raw_syscall.h1
-rw-r--r--src/linux/s390x/rt_sigframe.h1
-rw-r--r--src/linux/s390x/set_error.c40
-rw-r--r--src/linux/s390x/set_scno.c27
-rw-r--r--src/linux/s390x/syscallent.h399
-rw-r--r--src/linux/s390x/syscallent1.h1
-rw-r--r--src/linux/s390x/userent.h26
-rw-r--r--src/linux/sh/arch_defs_.h10
-rw-r--r--src/linux/sh/arch_getrval2.c12
-rw-r--r--src/linux/sh/arch_regs.c11
-rw-r--r--src/linux/sh/get_error.c19
-rw-r--r--src/linux/sh/get_scno.c14
-rw-r--r--src/linux/sh/get_syscall_args.c17
-rw-r--r--src/linux/sh/ioctls_arch0.h77
-rw-r--r--src/linux/sh/ioctls_inc0.h1
-rw-r--r--src/linux/sh/raw_syscall.h34
-rw-r--r--src/linux/sh/set_error.c20
-rw-r--r--src/linux/sh/set_scno.c15
-rw-r--r--src/linux/sh/syscallent.h412
-rw-r--r--src/linux/sh/userent.h60
-rw-r--r--src/linux/sh/userent0.h20
-rw-r--r--src/linux/sh64/arch_defs_.h8
-rw-r--r--src/linux/sh64/arch_regs.c11
-rw-r--r--src/linux/sh64/get_error.c19
-rw-r--r--src/linux/sh64/get_scno.c14
-rw-r--r--src/linux/sh64/get_syscall_args.c15
-rw-r--r--src/linux/sh64/ioctls_arch0.h77
-rw-r--r--src/linux/sh64/ioctls_inc0.h1
-rw-r--r--src/linux/sh64/raw_syscall.h1
-rw-r--r--src/linux/sh64/rt_sigframe.h21
-rw-r--r--src/linux/sh64/set_error.c20
-rw-r--r--src/linux/sh64/set_scno.c15
-rw-r--r--src/linux/sh64/syscallent.h405
-rw-r--r--src/linux/sh64/userent.h161
-rw-r--r--src/linux/shuffle_scno.c12
-rw-r--r--src/linux/signal.h.in5
-rw-r--r--src/linux/signalent.h40
-rw-r--r--src/linux/smc_diag.h102
-rw-r--r--src/linux/sock_diag.h21
-rw-r--r--src/linux/sparc/arch_defs_.h13
-rw-r--r--src/linux/sparc/arch_getrval2.c14
-rw-r--r--src/linux/sparc/arch_regs.c19
-rw-r--r--src/linux/sparc/arch_sigreturn.c43
-rw-r--r--src/linux/sparc/errnoent.h159
-rw-r--r--src/linux/sparc/get_error.c19
-rw-r--r--src/linux/sparc/get_scno.c14
-rw-r--r--src/linux/sparc/get_syscall_args.c19
-rw-r--r--src/linux/sparc/ioctls_arch0.h122
-rw-r--r--src/linux/sparc/ioctls_inc0.h1
-rw-r--r--src/linux/sparc/raw_syscall.h38
-rw-r--r--src/linux/sparc/rt_sigframe.h25
-rw-r--r--src/linux/sparc/set_error.c28
-rw-r--r--src/linux/sparc/set_scno.c20
-rw-r--r--src/linux/sparc/signalent.h40
-rw-r--r--src/linux/sparc/syscallent.h389
-rw-r--r--src/linux/sparc/userent.h1
-rw-r--r--src/linux/sparc64/arch_defs_.h15
-rw-r--r--src/linux/sparc64/arch_get_personality.c13
-rw-r--r--src/linux/sparc64/arch_getrval2.c1
-rw-r--r--src/linux/sparc64/arch_regs.c10
-rw-r--r--src/linux/sparc64/arch_rt_sigframe.c17
-rw-r--r--src/linux/sparc64/arch_sigreturn.c26
-rw-r--r--src/linux/sparc64/errnoent.h1
-rw-r--r--src/linux/sparc64/get_error.c17
-rw-r--r--src/linux/sparc64/get_scno.c32
-rw-r--r--src/linux/sparc64/get_syscall_args.c35
-rw-r--r--src/linux/sparc64/ioctls_arch0.h122
-rw-r--r--src/linux/sparc64/ioctls_arch1.h1
-rw-r--r--src/linux/sparc64/ioctls_inc0.h1
-rw-r--r--src/linux/sparc64/ioctls_inc1.h1
-rw-r--r--src/linux/sparc64/raw_syscall.h40
-rw-r--r--src/linux/sparc64/rt_sigframe.h31
-rw-r--r--src/linux/sparc64/set_error.c29
-rw-r--r--src/linux/sparc64/set_scno.c1
-rw-r--r--src/linux/sparc64/signalent.h1
-rw-r--r--src/linux/sparc64/syscallent.h388
-rw-r--r--src/linux/sparc64/syscallent1.h1
-rw-r--r--src/linux/sparc64/userent.h14
-rw-r--r--src/linux/subcall.h54
-rw-r--r--src/linux/subcall32.h5
-rw-r--r--src/linux/subcall64.h5
-rw-r--r--src/linux/syscall.h30
-rw-r--r--src/linux/syscallent-common-32.h30
-rw-r--r--src/linux/syscallent-common.h27
-rw-r--r--src/linux/syscallent_base_nr.h1
-rw-r--r--src/linux/tile/arch_defs_.h15
-rw-r--r--src/linux/tile/arch_get_personality.c14
-rw-r--r--src/linux/tile/arch_regs.c11
-rw-r--r--src/linux/tile/arch_sigreturn.c20
-rw-r--r--src/linux/tile/get_error.c25
-rw-r--r--src/linux/tile/get_scno.c29
-rw-r--r--src/linux/tile/get_syscall_args.c19
-rw-r--r--src/linux/tile/ioctls_arch0.h1
-rw-r--r--src/linux/tile/ioctls_arch1.h1
-rw-r--r--src/linux/tile/ioctls_inc0.h1
-rw-r--r--src/linux/tile/ioctls_inc1.h1
-rw-r--r--src/linux/tile/raw_syscall.h33
-rw-r--r--src/linux/tile/rt_sigframe.h19
-rw-r--r--src/linux/tile/set_error.c20
-rw-r--r--src/linux/tile/set_scno.c15
-rw-r--r--src/linux/tile/syscallent.h11
-rw-r--r--src/linux/tile/syscallent1.h13
-rw-r--r--src/linux/tile/userent.h68
-rw-r--r--src/linux/unix_diag.h60
-rw-r--r--src/linux/userent.h1
-rw-r--r--src/linux/userent0.h8
-rw-r--r--src/linux/x32/arch_defs_.h15
-rw-r--r--src/linux/x32/arch_get_personality.c1
-rw-r--r--src/linux/x32/arch_kvm.c1
-rw-r--r--src/linux/x32/arch_regs.c1
-rw-r--r--src/linux/x32/arch_regs.h1
-rw-r--r--src/linux/x32/arch_rt_sigframe.c1
-rw-r--r--src/linux/x32/arch_sigreturn.c1
-rw-r--r--src/linux/x32/asm_stat.h1
-rw-r--r--src/linux/x32/check_scno.c22
-rw-r--r--src/linux/x32/get_error.c1
-rw-r--r--src/linux/x32/get_scno.c1
-rw-r--r--src/linux/x32/get_syscall_args.c1
-rw-r--r--src/linux/x32/ioctls_arch0.h1
-rw-r--r--src/linux/x32/ioctls_arch1.h1
-rw-r--r--src/linux/x32/ioctls_inc0.h2915
-rw-r--r--src/linux/x32/ioctls_inc1.h1
-rw-r--r--src/linux/x32/ptrace_pokeuser.c17
-rw-r--r--src/linux/x32/raw_syscall.h1
-rw-r--r--src/linux/x32/rt_sigframe.h1
-rw-r--r--src/linux/x32/set_error.c1
-rw-r--r--src/linux/x32/set_scno.c1
-rw-r--r--src/linux/x32/shuffle_scno.c15
-rw-r--r--src/linux/x32/syscallent.h384
-rw-r--r--src/linux/x32/syscallent1.h3
-rw-r--r--src/linux/x32/userent.h1
-rw-r--r--src/linux/x86_64/arch_defs_.h18
-rw-r--r--src/linux/x86_64/arch_get_personality.c39
-rw-r--r--src/linux/x86_64/arch_kvm.c158
-rw-r--r--src/linux/x86_64/arch_regs.c52
-rw-r--r--src/linux/x86_64/arch_regs.h35
-rw-r--r--src/linux/x86_64/arch_rt_sigframe.c1
-rw-r--r--src/linux/x86_64/arch_sigreturn.c2
-rw-r--r--src/linux/x86_64/asm_stat.h46
-rw-r--r--src/linux/x86_64/get_error.c35
-rw-r--r--src/linux/x86_64/get_scno.c73
-rw-r--r--src/linux/x86_64/get_syscall_args.c50
-rw-r--r--src/linux/x86_64/getregs_old.c49
-rw-r--r--src/linux/x86_64/getregs_old.h9
-rw-r--r--src/linux/x86_64/ioctls_arch0.h119
-rw-r--r--src/linux/x86_64/ioctls_arch1.h1
-rw-r--r--src/linux/x86_64/ioctls_arch2.h1
-rw-r--r--src/linux/x86_64/ioctls_inc0.h1
-rw-r--r--src/linux/x86_64/ioctls_inc1.h1
-rw-r--r--src/linux/x86_64/ioctls_inc2.h1
-rw-r--r--src/linux/x86_64/raw_syscall.h28
-rw-r--r--src/linux/x86_64/rt_sigframe.h23
-rw-r--r--src/linux/x86_64/set_error.c32
-rw-r--r--src/linux/x86_64/set_scno.c12
-rw-r--r--src/linux/x86_64/shuffle_scno.c15
-rw-r--r--src/linux/x86_64/syscallent.h344
-rw-r--r--src/linux/x86_64/syscallent1.h3
-rw-r--r--src/linux/x86_64/syscallent2.h2
-rw-r--r--src/linux/x86_64/userent.h30
-rw-r--r--src/linux/xtensa/arch_regs.c11
-rw-r--r--src/linux/xtensa/get_error.c19
-rw-r--r--src/linux/xtensa/get_scno.c13
-rw-r--r--src/linux/xtensa/get_syscall_args.c17
-rw-r--r--src/linux/xtensa/ioctls_arch0.h67
-rw-r--r--src/linux/xtensa/ioctls_inc0.h1
-rw-r--r--src/linux/xtensa/raw_syscall.h28
-rw-r--r--src/linux/xtensa/set_error.c20
-rw-r--r--src/linux/xtensa/set_scno.c12
-rw-r--r--src/linux/xtensa/syscallent.h353
-rw-r--r--src/linux/xtensa/userent.h96
-rw-r--r--src/list.h300
-rw-r--r--src/listen.c21
-rw-r--r--src/lookup_dcookie.c30
-rw-r--r--src/loop.c236
-rw-r--r--src/lseek.c74
-rw-r--r--src/macros.h87
-rw-r--r--src/mem.c383
-rw-r--r--src/membarrier.c38
-rw-r--r--src/memfd_create.c58
-rw-r--r--src/mknod.c53
-rw-r--r--src/mmap_cache.c221
-rw-r--r--src/mmap_cache.h70
-rw-r--r--src/mmap_notify.c34
-rw-r--r--src/mmap_notify.h20
-rw-r--r--src/mmsghdr.c240
-rw-r--r--src/mount.c67
-rw-r--r--src/move_mount.c26
-rw-r--r--src/mpers.awk222
-rwxr-xr-xsrc/mpers.sh59
-rwxr-xr-xsrc/mpers_test.sh132
-rw-r--r--src/mpers_type.h35
-rw-r--r--src/mq.c110
-rw-r--r--src/msghdr.c530
-rw-r--r--src/msghdr.h27
-rw-r--r--src/mtd.c385
-rw-r--r--src/native_defs.h11
-rw-r--r--src/nbd_ioctl.c52
-rw-r--r--src/negated_errno.h31
-rw-r--r--src/net.c1051
-rw-r--r--src/netlink.c676
-rw-r--r--src/netlink.h55
-rw-r--r--src/netlink_crypto.c232
-rw-r--r--src/netlink_inet_diag.c459
-rw-r--r--src/netlink_kobject_uevent.c59
-rw-r--r--src/netlink_kobject_uevent.h24
-rw-r--r--src/netlink_netfilter.c83
-rw-r--r--src/netlink_netlink_diag.c187
-rw-r--r--src/netlink_packet_diag.c218
-rw-r--r--src/netlink_route.c130
-rw-r--r--src/netlink_route.h37
-rw-r--r--src/netlink_selinux.c50
-rw-r--r--src/netlink_smc_diag.c285
-rw-r--r--src/netlink_sock_diag.c75
-rw-r--r--src/netlink_sock_diag.h44
-rw-r--r--src/netlink_unix_diag.c170
-rw-r--r--src/nlattr.c487
-rw-r--r--src/nlattr.h120
-rw-r--r--src/nsfs.c40
-rw-r--r--src/nsfs.h28
-rw-r--r--src/nsig.h22
-rw-r--r--src/numa.c189
-rw-r--r--src/number_set.c153
-rw-r--r--src/number_set.h94
-rw-r--r--src/oldstat.c65
-rw-r--r--src/open.c178
-rw-r--r--src/open_tree.c23
-rw-r--r--src/or1k_atomic.c58
-rw-r--r--src/pathtrace.c417
-rw-r--r--src/perf.c452
-rw-r--r--src/perf_event_struct.h91
-rw-r--r--src/perf_ioctl.c140
-rw-r--r--src/personality.c45
-rw-r--r--src/pidfd_getfd.c31
-rw-r--r--src/pidfd_open.c24
-rw-r--r--src/pidns.c608
-rw-r--r--src/pkeys.c25
-rw-r--r--src/poll.c194
-rw-r--r--src/prctl.c450
-rw-r--r--src/print_dev_t.c29
-rw-r--r--src/print_fields.h472
-rw-r--r--src/print_group_req.c38
-rw-r--r--src/print_ifindex.c64
-rw-r--r--src/print_instruction_pointer.c24
-rw-r--r--src/print_kernel_sigset.c33
-rw-r--r--src/print_kernel_version.c31
-rw-r--r--src/print_mac.c152
-rw-r--r--src/print_mq_attr.c51
-rw-r--r--src/print_msgbuf.c37
-rw-r--r--src/print_sg_req_info.c56
-rw-r--r--src/print_sigevent.c74
-rw-r--r--src/print_statfs.c118
-rw-r--r--src/print_struct_stat.c143
-rw-r--r--src/print_syscall_number.c18
-rw-r--r--src/print_time.c34
-rw-r--r--src/print_timespec.h177
-rw-r--r--src/print_timespec32.c25
-rw-r--r--src/print_timespec64.c19
-rw-r--r--src/print_timeval.c198
-rw-r--r--src/print_timeval64.c15
-rw-r--r--src/print_timex.c50
-rw-r--r--src/print_timex.h72
-rw-r--r--src/print_utils.h39
-rw-r--r--src/printmode.c53
-rw-r--r--src/printrusage.c137
-rw-r--r--src/printsiginfo.c274
-rw-r--r--src/printsiginfo.h13
-rw-r--r--src/process.c313
-rw-r--r--src/process_vm.c59
-rw-r--r--src/ptp.c164
-rw-r--r--src/ptrace.h204
-rw-r--r--src/ptrace_syscall_info.c384
-rw-r--r--src/ptrace_syscall_info.h16
-rw-r--r--src/quota.c527
-rw-r--r--src/random_ioctl.c63
-rw-r--r--src/readahead.c19
-rw-r--r--src/readlink.c52
-rw-r--r--src/reboot.c35
-rw-r--r--src/regs.h14
-rw-r--r--src/renameat.c39
-rw-r--r--src/resource.c217
-rw-r--r--src/retval.c50
-rw-r--r--src/retval.h15
-rw-r--r--src/riscv.c33
-rw-r--r--src/rt_sigframe.c17
-rw-r--r--src/rt_sigreturn.c32
-rw-r--r--src/rtc.c183
-rw-r--r--src/rtnl_addr.c128
-rw-r--r--src/rtnl_addrlabel.c77
-rw-r--r--src/rtnl_dcb.c53
-rw-r--r--src/rtnl_link.c1023
-rw-r--r--src/rtnl_mdb.c217
-rw-r--r--src/rtnl_neigh.c126
-rw-r--r--src/rtnl_neightbl.c164
-rw-r--r--src/rtnl_netconf.c51
-rw-r--r--src/rtnl_nsid.c43
-rw-r--r--src/rtnl_route.c326
-rw-r--r--src/rtnl_rule.c143
-rw-r--r--src/rtnl_tc.c347
-rw-r--r--src/rtnl_tc_action.c79
-rw-r--r--src/s390.c1545
-rw-r--r--src/sched.c223
-rw-r--r--src/sched_attr.h33
-rw-r--r--src/scno.am25
-rw-r--r--src/scno.head15
-rw-r--r--src/scsi.c167
-rw-r--r--src/seccomp.c50
-rw-r--r--src/sendfile.c54
-rw-r--r--src/sg_io_v3.c194
-rw-r--r--src/sg_io_v4.c182
-rw-r--r--src/shutdown.c24
-rw-r--r--src/sigaltstack.c50
-rw-r--r--src/sigevent.h27
-rw-r--r--src/signal.c728
-rw-r--r--src/signalfd.c41
-rw-r--r--src/sigreturn.c36
-rw-r--r--src/sock.c414
-rw-r--r--src/sockaddr.c745
-rw-r--r--src/socketcall.c19
-rw-r--r--src/socketutils.c669
-rw-r--r--src/sparc.c26
-rw-r--r--src/sram_alloc.c26
-rw-r--r--src/stage_output.c75
-rw-r--r--src/stat.c56
-rw-r--r--src/stat.h32
-rw-r--r--src/stat64.c56
-rw-r--r--src/statfs.c19
-rw-r--r--src/statfs.h27
-rw-r--r--src/statfs64.c19
-rw-r--r--src/static_assert.h29
-rw-r--r--src/statx.c120
-rw-r--r--src/statx.h50
-rwxr-xr-xsrc/strace-graph341
-rwxr-xr-xsrc/strace-log-merge90
-rw-r--r--src/strace.c3727
-rw-r--r--src/string_to_uint.c43
-rw-r--r--src/string_to_uint.h49
-rw-r--r--src/swapon.c30
-rw-r--r--src/sync_file_range.c25
-rw-r--r--src/sync_file_range2.c26
-rw-r--r--src/syscall.c1549
-rw-r--r--src/sysctl.c173
-rw-r--r--src/sysent.h43
-rw-r--r--src/sysent_shorthand_defs.h62
-rw-r--r--src/sysent_shorthand_undefs.h31
-rw-r--r--src/sysinfo.c59
-rw-r--r--src/syslog.c71
-rw-r--r--src/sysmips.c60
-rw-r--r--src/tee.c594
-rw-r--r--src/term.c276
-rw-r--r--src/time.c480
-rw-r--r--src/times.c38
-rw-r--r--src/trace_event.h76
-rw-r--r--src/trie.c290
-rw-r--r--src/trie.h92
-rw-r--r--src/truncate.c40
-rw-r--r--src/types/btrfs.h25
-rw-r--r--src/types/cryptouser.h64
-rw-r--r--src/types/evdev.h40
-rw-r--r--src/types/fib_rules.h37
-rw-r--r--src/types/fiemap.h35
-rw-r--r--src/types/find_last_type_fields.awk24
-rw-r--r--src/types/fs_0x94.h41
-rw-r--r--src/types/fs_x.h30
-rwxr-xr-xsrc/types/gen.sh209
-rw-r--r--src/types/gpio.h120
-rw-r--r--src/types/io_uring.h73
-rw-r--r--src/types/loop.h21
-rw-r--r--src/types/openat2.h21
-rw-r--r--src/types/rtnl_link.h94
-rw-r--r--src/types/rtnl_mdb.h37
-rw-r--r--src/types/rtnl_neightbl.h51
-rw-r--r--src/types/rtnl_route.h31
-rw-r--r--src/types/tee.h107
-rw-r--r--src/types/v4l2.h273
-rw-r--r--src/ubi.c256
-rw-r--r--src/ucopy.c415
-rw-r--r--src/uid.c184
-rw-r--r--src/uid16.c9
-rw-r--r--src/umask.c15
-rw-r--r--src/umount.c18
-rw-r--r--src/uname.c48
-rw-r--r--src/unwind-libdw.c258
-rw-r--r--src/unwind-libunwind.c170
-rw-r--r--src/unwind.c301
-rw-r--r--src/unwind.h50
-rw-r--r--src/upeek.c33
-rw-r--r--src/upoke.c23
-rw-r--r--src/userfaultfd.c195
-rw-r--r--src/ustat.c40
-rw-r--r--src/util.c1587
-rw-r--r--src/utime.c35
-rw-r--r--src/utimes.c72
-rw-r--r--src/v4l2.c1568
-rw-r--r--src/wait.c164
-rw-r--r--src/wait.h42
-rw-r--r--src/watchdog_ioctl.c46
-rw-r--r--src/xattr.c131
-rw-r--r--src/xfs_quota_stat.h29
-rw-r--r--src/xgetdents.c141
-rw-r--r--src/xgetdents.h21
-rw-r--r--src/xlat.c516
-rw-r--r--src/xlat.h69
-rw-r--r--src/xlat/access_modes.in4
-rw-r--r--src/xlat/addrfams.in46
-rw-r--r--src/xlat/adjtimex_modes.in13
-rw-r--r--src/xlat/adjtimex_state.in7
-rw-r--r--src/xlat/adjtimex_status.in16
-rw-r--r--src/xlat/advise.in11
-rw-r--r--src/xlat/af_packet_types.in9
-rw-r--r--src/xlat/af_packet_versions.in4
-rw-r--r--src/xlat/aio_cmds.in10
-rw-r--r--src/xlat/aio_iocb_flags.in2
-rw-r--r--src/xlat/archvals.in9
-rw-r--r--src/xlat/arp_hardware_types.in67
-rw-r--r--src/xlat/at_flags.in6
-rw-r--r--src/xlat/at_statx_sync_types.in5
-rw-r--r--src/xlat/atomic_ops.in9
-rw-r--r--src/xlat/audit_arch.in62
-rw-r--r--src/xlat/ax25_protocols.in17
-rw-r--r--src/xlat/baud_options.in33
-rw-r--r--src/xlat/bdaddr_types.in4
-rw-r--r--src/xlat/blkpg_ops.in4
-rw-r--r--src/xlat/block_ioctl_cmds.in39
-rw-r--r--src/xlat/bluetooth_l2_cid.in11
-rw-r--r--src/xlat/bluetooth_l2_psm.in10
-rw-r--r--src/xlat/bootflags1.in1
-rw-r--r--src/xlat/bootflags2.in4
-rw-r--r--src/xlat/bootflags3.in8
-rw-r--r--src/xlat/bpf_attach_flags.in3
-rw-r--r--src/xlat/bpf_attach_type.in39
-rw-r--r--src/xlat/bpf_class.in9
-rw-r--r--src/xlat/bpf_commands.in37
-rw-r--r--src/xlat/bpf_file_mode_flags.in2
-rw-r--r--src/xlat/bpf_map_flags.in13
-rw-r--r--src/xlat/bpf_map_lookup_elem_flags.in2
-rw-r--r--src/xlat/bpf_map_types.in30
-rw-r--r--src/xlat/bpf_map_update_elem_flags.in5
-rw-r--r--src/xlat/bpf_miscop.in2
-rw-r--r--src/xlat/bpf_mode.in7
-rw-r--r--src/xlat/bpf_op_alu.in14
-rw-r--r--src/xlat/bpf_op_jmp.in14
-rw-r--r--src/xlat/bpf_prog_flags.in5
-rw-r--r--src/xlat/bpf_prog_types.in32
-rw-r--r--src/xlat/bpf_query_flags.in1
-rw-r--r--src/xlat/bpf_rval.in3
-rw-r--r--src/xlat/bpf_size.in4
-rw-r--r--src/xlat/bpf_src.in2
-rw-r--r--src/xlat/bpf_task_fd_type.in7
-rw-r--r--src/xlat/bsg_flags.in2
-rw-r--r--src/xlat/bsg_protocol.in1
-rw-r--r--src/xlat/bsg_subprotocol.in3
-rw-r--r--src/xlat/bt_protocols.in9
-rw-r--r--src/xlat/btrfs_balance_args.in12
-rw-r--r--src/xlat/btrfs_balance_ctl_cmds.in3
-rw-r--r--src/xlat/btrfs_balance_flags.in6
-rw-r--r--src/xlat/btrfs_balance_state.in3
-rw-r--r--src/xlat/btrfs_compress_types.in8
-rw-r--r--src/xlat/btrfs_cont_reading_from_srcdev_mode.in3
-rw-r--r--src/xlat/btrfs_defrag_flags.in3
-rw-r--r--src/xlat/btrfs_dev_replace_cmds.in4
-rw-r--r--src/xlat/btrfs_dev_replace_results.in5
-rw-r--r--src/xlat/btrfs_dev_replace_state.in6
-rw-r--r--src/xlat/btrfs_dev_stats_flags.in2
-rw-r--r--src/xlat/btrfs_dev_stats_values.in8
-rw-r--r--src/xlat/btrfs_features_compat.in0
-rw-r--r--src/xlat/btrfs_features_compat_ro.in3
-rw-r--r--src/xlat/btrfs_features_incompat.in12
-rw-r--r--src/xlat/btrfs_key_types.in42
-rw-r--r--src/xlat/btrfs_logical_ino_args_flags.in1
-rw-r--r--src/xlat/btrfs_qgroup_ctl_cmds.in4
-rw-r--r--src/xlat/btrfs_qgroup_inherit_flags.in2
-rw-r--r--src/xlat/btrfs_qgroup_limit_flags.in7
-rw-r--r--src/xlat/btrfs_qgroup_status_flags.in3
-rw-r--r--src/xlat/btrfs_scrub_flags.in2
-rw-r--r--src/xlat/btrfs_send_flags.in3
-rw-r--r--src/xlat/btrfs_snap_flags_v2.in4
-rw-r--r--src/xlat/btrfs_space_info_flags.in12
-rw-r--r--src/xlat/btrfs_tree_objectids.in14
-rw-r--r--src/xlat/cacheflush_flags.in21
-rw-r--r--src/xlat/cacheflush_scope.in3
-rw-r--r--src/xlat/caif_protocols.in7
-rw-r--r--src/xlat/can_protocols.in8
-rw-r--r--src/xlat/cap.in43
-rw-r--r--src/xlat/cap_mask0.in33
-rw-r--r--src/xlat/cap_mask1.in10
-rw-r--r--src/xlat/cap_version.in4
-rw-r--r--src/xlat/clockflags.in1
-rw-r--r--src/xlat/clocknames.in13
-rw-r--r--src/xlat/clone3_flags.in4
-rw-r--r--src/xlat/clone_flags.in24
-rw-r--r--src/xlat/close_range_flags.in3
-rw-r--r--src/xlat/cpuclocknames.in4
-rw-r--r--src/xlat/crypto_msgs.in7
-rw-r--r--src/xlat/crypto_nl_attrs.in13
-rw-r--r--src/xlat/dcb_commands.in29
-rw-r--r--src/xlat/delete_module_flags.in2
-rw-r--r--src/xlat/dirent_types.in9
-rw-r--r--src/xlat/dm_flags.in19
-rw-r--r--src/xlat/ebpf_class.in9
-rw-r--r--src/xlat/ebpf_mode.in5
-rw-r--r--src/xlat/ebpf_op_alu.in3
-rw-r--r--src/xlat/ebpf_op_jmp.in9
-rw-r--r--src/xlat/ebpf_regs.in12
-rw-r--r--src/xlat/ebpf_size.in1
-rw-r--r--src/xlat/efd_flags.in5
-rw-r--r--src/xlat/elf_em.in202
-rw-r--r--src/xlat/epollctls.in4
-rw-r--r--src/xlat/epollevents.in16
-rw-r--r--src/xlat/epollflags.in3
-rw-r--r--src/xlat/ethernet_protocols.in95
-rw-r--r--src/xlat/evdev_abs.in43
-rw-r--r--src/xlat/evdev_autorepeat.in3
-rw-r--r--src/xlat/evdev_ev.in12
-rw-r--r--src/xlat/evdev_ff_status.in3
-rw-r--r--src/xlat/evdev_ff_types.in17
-rw-r--r--src/xlat/evdev_ioctl_cmds.in17
-rw-r--r--src/xlat/evdev_keycode.in678
-rw-r--r--src/xlat/evdev_leds.in12
-rw-r--r--src/xlat/evdev_misc.in7
-rw-r--r--src/xlat/evdev_mtslots.in16
-rw-r--r--src/xlat/evdev_prop.in8
-rw-r--r--src/xlat/evdev_relative_axes.in14
-rw-r--r--src/xlat/evdev_snd.in4
-rw-r--r--src/xlat/evdev_switch.in17
-rw-r--r--src/xlat/f_owner_types.in4
-rw-r--r--src/xlat/f_seals.in5
-rw-r--r--src/xlat/faccessat_flags.in3
-rw-r--r--src/xlat/falloc_flags.in7
-rw-r--r--src/xlat/fan_classes.in3
-rw-r--r--src/xlat/fan_event_flags.in20
-rw-r--r--src/xlat/fan_init_flags.in9
-rw-r--r--src/xlat/fan_mark_flags.in9
-rw-r--r--src/xlat/fcntlcmds.in98
-rw-r--r--src/xlat/fdflags.in1
-rw-r--r--src/xlat/fib_rule_actions.in10
-rw-r--r--src/xlat/fib_rule_flags.in6
-rw-r--r--src/xlat/fiemap_extent_flags.in11
-rw-r--r--src/xlat/fiemap_flags.in3
-rw-r--r--src/xlat/flockcmds.in8
-rw-r--r--src/xlat/fs_0x94_ioctl_cmds.in8
-rw-r--r--src/xlat/fs_f_ioctl_cmds.in5
-rw-r--r--src/xlat/fs_ioc_flags.in29
-rw-r--r--src/xlat/fs_x_ioctl_cmds.in8
-rw-r--r--src/xlat/fs_xflags.in17
-rw-r--r--src/xlat/fsconfig_cmds.in9
-rw-r--r--src/xlat/fsmagic.in110
-rw-r--r--src/xlat/fsmount_flags.in1
-rw-r--r--src/xlat/fsopen_flags.in1
-rw-r--r--src/xlat/fspick_flags.in4
-rw-r--r--src/xlat/futexbitset.in1
-rw-r--r--src/xlat/futexops.in32
-rw-r--r--src/xlat/futexwakecmps.in7
-rw-r--r--src/xlat/futexwakeops.in6
-rwxr-xr-xsrc/xlat/gen.sh484
-rw-r--r--src/xlat/get_mempolicy_flags.in3
-rw-r--r--src/xlat/getrandom_flags.in3
-rw-r--r--src/xlat/getsock_ip_options.in29
-rw-r--r--src/xlat/getsock_ipv6_options.in10
-rw-r--r--src/xlat/getsock_options.in5
-rw-r--r--src/xlat/gpio_event_flags.in3
-rw-r--r--src/xlat/gpio_handle_flags.in8
-rw-r--r--src/xlat/gpio_ioctl_cmds.in15
-rw-r--r--src/xlat/gpio_line_flags.in8
-rw-r--r--src/xlat/gpio_v2_line_attr_ids.in5
-rw-r--r--src/xlat/gpio_v2_line_flags.in14
-rw-r--r--src/xlat/hci_channels.in6
-rw-r--r--src/xlat/hdio_drive_cmds.in94
-rw-r--r--src/xlat/hw_breakpoint_len.in4
-rw-r--r--src/xlat/hw_breakpoint_type.in6
-rw-r--r--src/xlat/icmpfilterflags.in13
-rw-r--r--src/xlat/if_dqblk_valid.in6
-rw-r--r--src/xlat/if_dqinfo_flags.in2
-rw-r--r--src/xlat/if_dqinfo_valid.in3
-rw-r--r--src/xlat/ifaddrflags.in12
-rw-r--r--src/xlat/iffflags.in20
-rw-r--r--src/xlat/in6_addr_gen_mode.in5
-rw-r--r--src/xlat/inet6_devconf_indices.in52
-rw-r--r--src/xlat/inet6_if_flags.in6
-rw-r--r--src/xlat/inet_devconf_indices.in34
-rw-r--r--src/xlat/inet_diag_attrs.in25
-rw-r--r--src/xlat/inet_diag_bytecodes.in16
-rw-r--r--src/xlat/inet_diag_extended_flags.in23
-rw-r--r--src/xlat/inet_diag_req_attrs.in6
-rw-r--r--src/xlat/inet_protocols.in35
-rw-r--r--src/xlat/inotify_flags.in22
-rw-r--r--src/xlat/inotify_init_flags.in4
-rw-r--r--src/xlat/ioctl_dirs.in3
-rw-r--r--src/xlat/ioprio_class.in5
-rw-r--r--src/xlat/ioprio_who.in4
-rw-r--r--src/xlat/ip_cmsg_types.in9
-rw-r--r--src/xlat/ip_type_of_services.in4
-rw-r--r--src/xlat/ipc_msg_flags.in4
-rw-r--r--src/xlat/ipc_private.in1
-rw-r--r--src/xlat/ipccalls.in12
-rw-r--r--src/xlat/irda_protocols.in3
-rw-r--r--src/xlat/isdn_protocols.in19
-rw-r--r--src/xlat/itimer_which.in4
-rw-r--r--src/xlat/kcm_protocols.in2
-rw-r--r--src/xlat/kcmp_types.in9
-rw-r--r--src/xlat/kexec_arch_values.in14
-rw-r--r--src/xlat/kexec_file_load_flags.in3
-rw-r--r--src/xlat/kexec_load_flags.in2
-rw-r--r--src/xlat/key_perms.in28
-rw-r--r--src/xlat/key_reqkeys.in10
-rw-r--r--src/xlat/key_spec.in9
-rw-r--r--src/xlat/keyctl_caps0.in8
-rw-r--r--src/xlat/keyctl_caps1.in3
-rw-r--r--src/xlat/keyctl_commands.in34
-rw-r--r--src/xlat/keyctl_move_flags.in1
-rw-r--r--src/xlat/keyctl_pkey_ops.in4
-rw-r--r--src/xlat/kvm_cap.in186
-rw-r--r--src/xlat/kvm_cpuid_flags.in10
-rw-r--r--src/xlat/kvm_exit_reason.in33
-rw-r--r--src/xlat/kvm_mem_flags.in2
-rw-r--r--src/xlat/lockfcmds.in5
-rw-r--r--src/xlat/loop_cmds.in14
-rw-r--r--src/xlat/loop_crypt_type_options.in10
-rw-r--r--src/xlat/loop_flags_options.in11
-rw-r--r--src/xlat/lwtunnel_encap_types.in10
-rw-r--r--src/xlat/madvise_cmds.in79
-rw-r--r--src/xlat/mbind_flags.in3
-rw-r--r--src/xlat/mctl_sync.in3
-rw-r--r--src/xlat/mdb_flags.in4
-rw-r--r--src/xlat/mdb_states.in2
-rw-r--r--src/xlat/membarrier_cmds.in10
-rw-r--r--src/xlat/membarrier_flags.in1
-rw-r--r--src/xlat/memfd_create_flags.in3
-rw-r--r--src/xlat/mlock_flags.in1
-rw-r--r--src/xlat/mlockall_flags.in9
-rw-r--r--src/xlat/mmap_flags.in192
-rw-r--r--src/xlat/mmap_prot.in9
-rw-r--r--src/xlat/modem_flags.in11
-rw-r--r--src/xlat/modetypes.in7
-rw-r--r--src/xlat/module_init_flags.in2
-rw-r--r--src/xlat/mount_attr_flags.in7
-rw-r--r--src/xlat/mount_flags.in31
-rw-r--r--src/xlat/move_mount_flags.in6
-rw-r--r--src/xlat/move_pages_flags.in2
-rw-r--r--src/xlat/mpol_mode_flags.in2
-rw-r--r--src/xlat/mpol_modes.in6
-rw-r--r--src/xlat/mq_attr_flags.in1
-rw-r--r--src/xlat/mremap_flags.in3
-rw-r--r--src/xlat/msg_flags.in34
-rw-r--r--src/xlat/msgctl_flags.in8
-rw-r--r--src/xlat/mtd_file_mode_options.in6
-rw-r--r--src/xlat/mtd_flags_options.in4
-rw-r--r--src/xlat/mtd_mode_options.in5
-rw-r--r--src/xlat/mtd_nandecc_options.in5
-rw-r--r--src/xlat/mtd_otp_options.in3
-rw-r--r--src/xlat/mtd_type_options.in8
-rw-r--r--src/xlat/multicast_router_types.in5
-rw-r--r--src/xlat/name_to_handle_at_flags.in2
-rw-r--r--src/xlat/nbd_ioctl_cmds.in11
-rw-r--r--src/xlat/nbd_ioctl_flags.in29
-rw-r--r--src/xlat/neighbor_cache_entry_flags.in8
-rw-r--r--src/xlat/neighbor_cache_entry_states.in9
-rw-r--r--src/xlat/netfilter_versions.in3
-rw-r--r--src/xlat/netlink_ack_flags.in2
-rw-r--r--src/xlat/netlink_delete_flags.in1
-rw-r--r--src/xlat/netlink_diag_attrs.in7
-rw-r--r--src/xlat/netlink_diag_show.in4
-rw-r--r--src/xlat/netlink_flags.in6
-rw-r--r--src/xlat/netlink_get_flags.in4
-rw-r--r--src/xlat/netlink_new_flags.in4
-rw-r--r--src/xlat/netlink_protocols.in23
-rw-r--r--src/xlat/netlink_sk_meminfo_indices.in10
-rw-r--r--src/xlat/netlink_socket_flags.in6
-rw-r--r--src/xlat/netlink_states.in4
-rw-r--r--src/xlat/netlink_types.in5
-rw-r--r--src/xlat/nf_acct_msg_types.in6
-rw-r--r--src/xlat/nf_cthelper_msg_types.in4
-rw-r--r--src/xlat/nf_ctnetlink_exp_msg_types.in5
-rw-r--r--src/xlat/nf_ctnetlink_msg_types.in9
-rw-r--r--src/xlat/nf_cttimeout_msg_types.in6
-rw-r--r--src/xlat/nf_ipset_msg_types.in22
-rw-r--r--src/xlat/nf_nft_compat_msg_types.in1
-rw-r--r--src/xlat/nf_nftables_msg_types.in23
-rw-r--r--src/xlat/nf_osf_msg_types.in3
-rw-r--r--src/xlat/nf_queue_msg_types.in5
-rw-r--r--src/xlat/nf_ulog_msg_types.in3
-rw-r--r--src/xlat/nfc_protocols.in3
-rw-r--r--src/xlat/nl_audit_types.in124
-rw-r--r--src/xlat/nl_crypto_types.in5
-rw-r--r--src/xlat/nl_netfilter_msg_types.in2
-rw-r--r--src/xlat/nl_netfilter_subsys_ids.in13
-rw-r--r--src/xlat/nl_route_types.in75
-rw-r--r--src/xlat/nl_selinux_types.in2
-rw-r--r--src/xlat/nl_sock_diag_types.in4
-rw-r--r--src/xlat/nl_xfrm_types.in34
-rw-r--r--src/xlat/nlmsgerr_attrs.in6
-rw-r--r--src/xlat/notifyflags.in7
-rw-r--r--src/xlat/nt_descriptor_types.in71
-rw-r--r--src/xlat/numa_node.in1
-rw-r--r--src/xlat/open_access_modes.in5
-rw-r--r--src/xlat/open_mode_flags.in199
-rw-r--r--src/xlat/open_resolve_flags.in5
-rw-r--r--src/xlat/open_tree_flags.in10
-rw-r--r--src/xlat/packet_diag_attrs.in10
-rw-r--r--src/xlat/packet_diag_info_flags.in5
-rw-r--r--src/xlat/packet_diag_show.in6
-rw-r--r--src/xlat/packet_mreq_type.in4
-rw-r--r--src/xlat/perf_attr_size.in7
-rw-r--r--src/xlat/perf_branch_sample_type.in18
-rw-r--r--src/xlat/perf_event_open_flags.in4
-rw-r--r--src/xlat/perf_event_read_format.in4
-rw-r--r--src/xlat/perf_event_sample_format.in21
-rw-r--r--src/xlat/perf_hw_cache_id.in8
-rw-r--r--src/xlat/perf_hw_cache_op_id.in4
-rw-r--r--src/xlat/perf_hw_cache_op_result_id.in3
-rw-r--r--src/xlat/perf_hw_id.in11
-rw-r--r--src/xlat/perf_ioctl_cmds.in12
-rw-r--r--src/xlat/perf_ioctl_flags.in1
-rw-r--r--src/xlat/perf_sw_ids.in12
-rw-r--r--src/xlat/perf_type_id.in7
-rw-r--r--src/xlat/personality_flags.in11
-rw-r--r--src/xlat/personality_types.in23
-rw-r--r--src/xlat/phonet_protocols.in4
-rw-r--r--src/xlat/pidfd_open_flags.in1
-rw-r--r--src/xlat/pkey_access.in3
-rw-r--r--src/xlat/pollflags.in42
-rw-r--r--src/xlat/pr_cap_ambient.in5
-rw-r--r--src/xlat/pr_dumpable.in5
-rw-r--r--src/xlat/pr_fp_mode.in2
-rw-r--r--src/xlat/pr_mce_kill.in3
-rw-r--r--src/xlat/pr_mce_kill_policy.in4
-rw-r--r--src/xlat/pr_set_mm.in16
-rw-r--r--src/xlat/pr_spec_cmds.in3
-rw-r--r--src/xlat/pr_spec_get_store_bypass_flags.in6
-rw-r--r--src/xlat/pr_spec_set_store_bypass_flags.in4
-rw-r--r--src/xlat/pr_sve_vl_flags.in2
-rw-r--r--src/xlat/pr_tsc.in3
-rw-r--r--src/xlat/pr_unalign_flags.in2
-rw-r--r--src/xlat/prctl_options.in57
-rw-r--r--src/xlat/priorities.in3
-rw-r--r--src/xlat/ptp_extts_flags.in4
-rw-r--r--src/xlat/ptp_perout_flags.in3
-rw-r--r--src/xlat/ptrace_cmds.in474
-rw-r--r--src/xlat/ptrace_events.in10
-rw-r--r--src/xlat/ptrace_peeksiginfo_flags.in1
-rw-r--r--src/xlat/ptrace_setoptions_flags.in12
-rw-r--r--src/xlat/ptrace_syscall_info_op.in5
-rw-r--r--src/xlat/quota_formats.in5
-rw-r--r--src/xlat/quotacmds.in38
-rw-r--r--src/xlat/quotatypes.in4
-rw-r--r--src/xlat/random_ioctl_cmds.in7
-rw-r--r--src/xlat/rename_flags.in3
-rw-r--r--src/xlat/resource_flags.in3
-rw-r--r--src/xlat/resources.in39
-rw-r--r--src/xlat/riscv_flush_icache_flags.in1
-rw-r--r--src/xlat/route_nexthop_flags.in6
-rw-r--r--src/xlat/routing_flags.in9
-rw-r--r--src/xlat/routing_protocols.in23
-rw-r--r--src/xlat/routing_scopes.in5
-rw-r--r--src/xlat/routing_table_ids.in5
-rw-r--r--src/xlat/routing_types.in13
-rw-r--r--src/xlat/rtc_ioctl_cmds.in22
-rw-r--r--src/xlat/rtc_vl_flags.in5
-rw-r--r--src/xlat/rtnl_addr_attrs.in12
-rw-r--r--src/xlat/rtnl_addrlabel_attrs.in3
-rw-r--r--src/xlat/rtnl_dcb_attrs.in18
-rw-r--r--src/xlat/rtnl_ifla_af_spec_inet6_attrs.in10
-rw-r--r--src/xlat/rtnl_ifla_af_spec_inet_attrs.in3
-rw-r--r--src/xlat/rtnl_ifla_brport_attrs.in36
-rw-r--r--src/xlat/rtnl_ifla_events.in8
-rw-r--r--src/xlat/rtnl_ifla_info_attrs.in7
-rw-r--r--src/xlat/rtnl_ifla_info_data_bridge_attrs.in48
-rw-r--r--src/xlat/rtnl_ifla_info_data_tun_attrs.in11
-rw-r--r--src/xlat/rtnl_ifla_port_attrs.in9
-rw-r--r--src/xlat/rtnl_ifla_vf_port_attrs.in3
-rw-r--r--src/xlat/rtnl_ifla_xdp_attached_mode.in9
-rw-r--r--src/xlat/rtnl_ifla_xdp_attrs.in13
-rw-r--r--src/xlat/rtnl_link_attrs.in60
-rw-r--r--src/xlat/rtnl_mdb_attrs.in4
-rw-r--r--src/xlat/rtnl_mdba_mdb_attrs.in3
-rw-r--r--src/xlat/rtnl_mdba_mdb_eattr_attrs.in7
-rw-r--r--src/xlat/rtnl_mdba_mdb_entry_attrs.in3
-rw-r--r--src/xlat/rtnl_mdba_router_attrs.in3
-rw-r--r--src/xlat/rtnl_mdba_router_pattr_attrs.in4
-rw-r--r--src/xlat/rtnl_neigh_attrs.in16
-rw-r--r--src/xlat/rtnl_neightbl_attrs.in11
-rw-r--r--src/xlat/rtnl_neightbl_parms_attrs.in20
-rw-r--r--src/xlat/rtnl_netconf_attrs.in10
-rw-r--r--src/xlat/rtnl_nsid_attrs.in7
-rw-r--r--src/xlat/rtnl_route_attrs.in31
-rw-r--r--src/xlat/rtnl_rta_metrics_attrs.in18
-rw-r--r--src/xlat/rtnl_rule_attrs.in26
-rw-r--r--src/xlat/rtnl_tc_action_attrs.in13
-rw-r--r--src/xlat/rtnl_tc_attrs.in17
-rw-r--r--src/xlat/rtnl_tca_act_flags.in1
-rw-r--r--src/xlat/rtnl_tca_act_hw_stats.in2
-rw-r--r--src/xlat/rtnl_tca_stab_attrs.in7
-rw-r--r--src/xlat/rtnl_tca_stats_attrs.in12
-rw-r--r--src/xlat/rwf_flags.in5
-rw-r--r--src/xlat/s390_guarded_storage_commands.in6
-rw-r--r--src/xlat/s390_runtime_instr_commands.in3
-rw-r--r--src/xlat/s390_sthyi_function_codes.in1
-rw-r--r--src/xlat/sa_handler_values.in4
-rw-r--r--src/xlat/sched_flags.in7
-rw-r--r--src/xlat/schedulers.in7
-rw-r--r--src/xlat/scmvals.in28
-rw-r--r--src/xlat/scsi_sg_commands.in25
-rw-r--r--src/xlat/secbits.in8
-rw-r--r--src/xlat/seccomp_filter_flags.in5
-rw-r--r--src/xlat/seccomp_mode.in4
-rw-r--r--src/xlat/seccomp_ops.in5
-rw-r--r--src/xlat/seccomp_ret_action.in8
-rw-r--r--src/xlat/semctl_flags.in15
-rw-r--r--src/xlat/semop_flags.in2
-rw-r--r--src/xlat/setns_types.in9
-rw-r--r--src/xlat/setsock_ip_options.in31
-rw-r--r--src/xlat/setsock_ipv6_options.in8
-rw-r--r--src/xlat/setsock_options.in6
-rw-r--r--src/xlat/sfd_flags.in4
-rw-r--r--src/xlat/sg_io_dxfer_direction.in4
-rw-r--r--src/xlat/sg_io_flags.in6
-rw-r--r--src/xlat/sg_io_info.in3
-rw-r--r--src/xlat/sg_scsi_reset.in6
-rw-r--r--src/xlat/shm_flags.in4
-rw-r--r--src/xlat/shm_resource_flags.in4
-rw-r--r--src/xlat/shmctl_flags.in10
-rw-r--r--src/xlat/shutdown_modes.in4
-rw-r--r--src/xlat/sigact_flags.in20
-rw-r--r--src/xlat/sigaltstack_flags.in3
-rw-r--r--src/xlat/sigbus_codes.in6
-rw-r--r--src/xlat/sigchld_codes.in7
-rw-r--r--src/xlat/sigemt_codes.in1
-rw-r--r--src/xlat/sigev_value.in5
-rw-r--r--src/xlat/sigfpe_codes.in16
-rw-r--r--src/xlat/sigill_codes.in18
-rw-r--r--src/xlat/siginfo_codes.in22
-rw-r--r--src/xlat/sigpoll_codes.in7
-rw-r--r--src/xlat/sigprocmaskcmds.in4
-rw-r--r--src/xlat/sigprof_codes.in1
-rw-r--r--src/xlat/sigsegv_codes.in11
-rw-r--r--src/xlat/sigsys_codes.in1
-rw-r--r--src/xlat/sigtrap_codes.in9
-rw-r--r--src/xlat/skf_ad.in16
-rw-r--r--src/xlat/skf_off.in3
-rw-r--r--src/xlat/smc_decl_codes.in17
-rw-r--r--src/xlat/smc_diag_attrs.in8
-rw-r--r--src/xlat/smc_diag_extended_flags.in3
-rw-r--r--src/xlat/smc_diag_mode.in4
-rw-r--r--src/xlat/smc_link_group_roles.in3
-rw-r--r--src/xlat/smc_protocols.in3
-rw-r--r--src/xlat/smc_states.in12
-rw-r--r--src/xlat/snmp_icmp6_stats.in7
-rw-r--r--src/xlat/snmp_ip_stats.in38
-rw-r--r--src/xlat/sock_alg_options.in7
-rw-r--r--src/xlat/sock_ax25_options.in15
-rw-r--r--src/xlat/sock_bluetooth_options.in9
-rw-r--r--src/xlat/sock_caif_options.in3
-rw-r--r--src/xlat/sock_dccp_options.in17
-rw-r--r--src/xlat/sock_ip_options.in51
-rw-r--r--src/xlat/sock_ipv6_options.in65
-rw-r--r--src/xlat/sock_ipx_options.in1
-rw-r--r--src/xlat/sock_irda_options.in12
-rw-r--r--src/xlat/sock_iucv_options.in3
-rw-r--r--src/xlat/sock_kcm_options.in1
-rw-r--r--src/xlat/sock_llc_options.in11
-rw-r--r--src/xlat/sock_netlink_options.in13
-rw-r--r--src/xlat/sock_nfcllcp_options.in6
-rw-r--r--src/xlat/sock_options.in513
-rw-r--r--src/xlat/sock_packet_options.in21
-rw-r--r--src/xlat/sock_pnp_options.in5
-rw-r--r--src/xlat/sock_pppol2tp_options.in6
-rw-r--r--src/xlat/sock_raw_options.in1
-rw-r--r--src/xlat/sock_rds_options.in29
-rw-r--r--src/xlat/sock_rxrpc_options.in7
-rw-r--r--src/xlat/sock_sctp_options.in71
-rw-r--r--src/xlat/sock_shutdown_flags.in2
-rw-r--r--src/xlat/sock_tcp_options.in38
-rw-r--r--src/xlat/sock_tipc_options.in13
-rw-r--r--src/xlat/sock_tls_options.in3
-rw-r--r--src/xlat/sock_type_flags.in2
-rw-r--r--src/xlat/sock_udp_options.in6
-rw-r--r--src/xlat/sock_xdp_options.in9
-rw-r--r--src/xlat/socketcalls.in21
-rw-r--r--src/xlat/socketlayers.in45
-rw-r--r--src/xlat/socktypes.in12
-rw-r--r--src/xlat/sparc_kern_features.in1
-rw-r--r--src/xlat/splice_flags.in4
-rw-r--r--src/xlat/sram_alloc_flags.in5
-rw-r--r--src/xlat/statfs_flags.in10
-rw-r--r--src/xlat/statx_attrs.in19
-rw-r--r--src/xlat/statx_masks.in16
-rw-r--r--src/xlat/swap_flags.in4
-rw-r--r--src/xlat/sync_file_range_flags.in3
-rw-r--r--src/xlat/sysctl_kern.in73
-rw-r--r--src/xlat/sysctl_net.in26
-rw-r--r--src/xlat/sysctl_net_core.in27
-rw-r--r--src/xlat/sysctl_net_ipv4.in97
-rw-r--r--src/xlat/sysctl_net_ipv4_conf.in27
-rw-r--r--src/xlat/sysctl_net_ipv4_route.in24
-rw-r--r--src/xlat/sysctl_net_ipv6.in15
-rw-r--r--src/xlat/sysctl_net_ipv6_route.in15
-rw-r--r--src/xlat/sysctl_net_unix.in7
-rw-r--r--src/xlat/sysctl_root.in20
-rw-r--r--src/xlat/sysctl_vm.in25
-rw-r--r--src/xlat/syslog_action_type.in12
-rw-r--r--src/xlat/syslog_console_levels.in11
-rw-r--r--src/xlat/sysmips_operations.in5
-rw-r--r--src/xlat/tcflsh_options.in3
-rw-r--r--src/xlat/tcp_state_flags.in13
-rw-r--r--src/xlat/tcp_states.in13
-rw-r--r--src/xlat/tcxonc_options.in4
-rw-r--r--src/xlat/tee_ioctl_cmds.in10
-rw-r--r--src/xlat/tee_ioctl_gen_caps.in4
-rw-r--r--src/xlat/tee_ioctl_impl_ids.in2
-rw-r--r--src/xlat/tee_ioctl_login_types.in7
-rw-r--r--src/xlat/tee_ioctl_max_arg_size.in1
-rw-r--r--src/xlat/tee_ioctl_optee_caps.in1
-rw-r--r--src/xlat/tee_ioctl_origins.in4
-rw-r--r--src/xlat/tee_ioctl_param_attr_types.in8
-rw-r--r--src/xlat/tee_ioctl_shm_flags.in8
-rw-r--r--src/xlat/timerfdflags.in8
-rw-r--r--src/xlat/tun_device_types.in3
-rw-r--r--src/xlat/ubi_data_types.in3
-rw-r--r--src/xlat/ubi_volume_flags.in1
-rw-r--r--src/xlat/ubi_volume_props.in2
-rw-r--r--src/xlat/ubi_volume_types.in3
-rw-r--r--src/xlat/uffd_api_features.in10
-rw-r--r--src/xlat/uffd_api_flags.in4
-rw-r--r--src/xlat/uffd_copy_flags.in3
-rw-r--r--src/xlat/uffd_flags.in2
-rw-r--r--src/xlat/uffd_register_ioctl_flags.in5
-rw-r--r--src/xlat/uffd_register_mode_flags.in3
-rw-r--r--src/xlat/uffd_zeropage_flags.in2
-rw-r--r--src/xlat/umount_flags.in4
-rw-r--r--src/xlat/unix_diag_attrs.in10
-rw-r--r--src/xlat/unix_diag_show.in7
-rw-r--r--src/xlat/unshare_flags.in15
-rw-r--r--src/xlat/uring_cqring_flags.in1
-rw-r--r--src/xlat/uring_enter_flags.in3
-rw-r--r--src/xlat/uring_op_flags.in1
-rw-r--r--src/xlat/uring_ops.in37
-rw-r--r--src/xlat/uring_register_opcodes.in16
-rw-r--r--src/xlat/uring_setup_features.in7
-rw-r--r--src/xlat/uring_setup_flags.in7
-rw-r--r--src/xlat/usagewho.in4
-rw-r--r--src/xlat/v4l2_buf_flags.in15
-rw-r--r--src/xlat/v4l2_buf_flags_masks.in2
-rw-r--r--src/xlat/v4l2_buf_flags_ts_src.in3
-rw-r--r--src/xlat/v4l2_buf_flags_ts_type.in4
-rw-r--r--src/xlat/v4l2_buf_types.in21
-rw-r--r--src/xlat/v4l2_capture_modes.in1
-rw-r--r--src/xlat/v4l2_colorspaces.in19
-rw-r--r--src/xlat/v4l2_control_classes.in13
-rw-r--r--src/xlat/v4l2_control_flags.in11
-rw-r--r--src/xlat/v4l2_control_id_bases.in40
-rw-r--r--src/xlat/v4l2_control_ids.in361
-rw-r--r--src/xlat/v4l2_control_query_flags.in2
-rw-r--r--src/xlat/v4l2_control_types.in19
-rw-r--r--src/xlat/v4l2_device_capabilities_flags.in29
-rw-r--r--src/xlat/v4l2_fields.in16
-rw-r--r--src/xlat/v4l2_format_description_flags.in9
-rw-r--r--src/xlat/v4l2_frameinterval_types.in4
-rw-r--r--src/xlat/v4l2_framesize_types.in9
-rw-r--r--src/xlat/v4l2_input_types.in4
-rw-r--r--src/xlat/v4l2_ioctl_cmds.in114
-rw-r--r--src/xlat/v4l2_memories.in10
-rw-r--r--src/xlat/v4l2_meta_fmts.in6
-rw-r--r--src/xlat/v4l2_pix_fmts.in199
-rw-r--r--src/xlat/v4l2_sdr_fmts.in9
-rw-r--r--src/xlat/v4l2_sliced_flags.in6
-rw-r--r--src/xlat/v4l2_streaming_capabilities.in1
-rw-r--r--src/xlat/v4l2_tuner_audmodes.in7
-rw-r--r--src/xlat/v4l2_tuner_capabilities.in14
-rw-r--r--src/xlat/v4l2_tuner_rxsubchanses.in6
-rw-r--r--src/xlat/v4l2_tuner_types.in11
-rw-r--r--src/xlat/v4l2_vbi_flags.in2
-rw-r--r--src/xlat/wait4_options.in12
-rw-r--r--src/xlat/waitid_types.in8
-rw-r--r--src/xlat/watchdog_ioctl_cmds.in10
-rw-r--r--src/xlat/whence_codes.in5
-rw-r--r--src/xlat/xattrflags.in2
-rw-r--r--src/xlat/xdp_flags.in6
-rw-r--r--src/xlat/xfs_dqblk_flags.in3
-rw-r--r--src/xlat/xfs_quota_flags.in6
-rw-r--r--src/xmalloc.c148
-rw-r--r--src/xmalloc.h80
-rw-r--r--src/xstring.h113
1462 files changed, 107837 insertions, 0 deletions
diff --git a/src/.gitignore b/src/.gitignore
new file mode 100644
index 000000000..c99b434ef
--- /dev/null
+++ b/src/.gitignore
@@ -0,0 +1,39 @@
+/*.mpers.i
+/bpf_attr_check.c
+/config.h
+/config.h.in
+/disable_ptrace_get_syscall_info
+/disable_ptrace_getregset
+/gnu
+/ioctl_iocdef.[ih]
+/ioctl_redefs[12].h
+/ioctlent[012].h
+/ioctls_all[012].h
+/ioctlsort[012]
+/libmpers-m32.a
+/libmpers-mx32.a
+/libstrace.a
+/linux/linux
+/m32_funcs.h
+/m32_printer_decls.h
+/m32_printer_defs.h
+/m32_type_defs.h
+/mpers-m32
+/mpers-m32.stamp
+/mpers-mx32
+/mpers-mx32.stamp
+/mpers.am
+/mpers_xlat.h
+/mx32_funcs.h
+/mx32_printer_decls.h
+/mx32_printer_defs.h
+/mx32_type_defs.h
+/native_printer_decls.h
+/native_printer_defs.h
+/printers.h
+/scno.h
+/sen.h
+/stamp-h1
+/strace
+/sys_func.h
+/syscallent.i
diff --git a/src/Makefile.am b/src/Makefile.am
new file mode 100644
index 000000000..71406a979
--- /dev/null
+++ b/src/Makefile.am
@@ -0,0 +1,1151 @@
+# Automake input for strace.
+#
+# Copyright (c) 2002-2009 Roland McGrath <roland@redhat.com>
+# Copyright (c) 2006-2016 Dmitry V. Levin <ldv@strace.io>
+# Copyright (c) 2008-2015 Mike Frysinger <vapier@gentoo.org>
+# Copyright (c) 2015 Elvira Khabirova <lineprinter0@gmail.com>
+# Copyright (c) 2002-2021 The strace developers.
+# All rights reserved.
+#
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+bin_PROGRAMS = strace
+bin_SCRIPTS = strace-log-merge
+
+OS = linux
+# ARCH is `i386', `m68k', `sparc', etc.
+ARCH = @arch@
+
+READELF = @READELF@
+
+AM_CFLAGS = $(WARN_CFLAGS)
+AM_CPPFLAGS = -I$(builddir)/$(OS)/$(ARCH) \
+ -I$(srcdir)/$(OS)/$(ARCH) \
+ -I$(builddir)/$(OS) \
+ -I$(srcdir)/$(OS) \
+ -I$(builddir) \
+ -I$(srcdir)
+
+AM_CFLAGS_FOR_BUILD = $(WARN_CFLAGS_FOR_BUILD)
+AM_CPPFLAGS_FOR_BUILD = $(AM_CPPFLAGS)
+
+include types/Makemodule.am
+include xlat/Makemodule.am
+
+strace_CPPFLAGS = $(AM_CPPFLAGS) -DIN_STRACE=1
+strace_CFLAGS = $(AM_CFLAGS)
+strace_LDFLAGS =
+strace_LDADD = libstrace.a $(clock_LIBS) $(timer_LIBS)
+strace_SOURCES = strace.c
+
+noinst_PROGRAMS = disable_ptrace_get_syscall_info disable_ptrace_getregset
+disable_ptrace_get_syscall_info_LDADD = $(strace_LDADD)
+disable_ptrace_getregset_LDADD = $(strace_LDADD)
+
+noinst_LIBRARIES = libstrace.a
+libstrace_a_CPPFLAGS = $(strace_CPPFLAGS)
+libstrace_a_CFLAGS = $(strace_CFLAGS)
+libstrace_a_SOURCES = \
+ access.c \
+ affinity.c \
+ aio.c \
+ alpha.c \
+ arch_defs.h \
+ basic_filters.c \
+ bind.c \
+ bjm.c \
+ block.c \
+ bpf.c \
+ bpf_attr.h \
+ bpf_filter.c \
+ bpf_filter.h \
+ bpf_fprog.h \
+ bpf_seccomp_filter.c \
+ bpf_sock_filter.c \
+ btrfs.c \
+ cacheflush.c \
+ capability.c \
+ caps0.h \
+ caps1.h \
+ chdir.c \
+ chmod.c \
+ clone.c \
+ close_range.c \
+ copy_file_range.c \
+ count.c \
+ defs.h \
+ delay.c \
+ delay.h \
+ desc.c \
+ dirent.c \
+ dirent64.c \
+ dirent_types.c \
+ dm.c \
+ dup.c \
+ dyxlat.c \
+ empty.h \
+ epoll.c \
+ error_prints.c \
+ error_prints.h \
+ evdev.c \
+ evdev_mpers.c \
+ eventfd.c \
+ execve.c \
+ f_owner_ex.h \
+ fadvise.c \
+ fallocate.c \
+ fanotify.c \
+ fchownat.c \
+ fcntl.c \
+ fetch_bpf_fprog.c \
+ fetch_indirect_syscall_args.c \
+ fetch_struct_flock.c \
+ fetch_struct_keyctl_kdf_params.c \
+ fetch_struct_mmsghdr.c \
+ fetch_struct_msghdr.c \
+ fetch_struct_stat.c \
+ fetch_struct_stat64.c \
+ fetch_struct_statfs.c \
+ fetch_struct_xfs_quotastat.c \
+ file_handle.c \
+ filter.h \
+ filter_qualify.c \
+ filter_seccomp.c \
+ filter_seccomp.h \
+ flock.c \
+ flock.h \
+ fs_0x94_ioctl.c \
+ fs_f_ioctl.c \
+ fs_x_ioctl.c \
+ fsconfig.c \
+ fsmount.c \
+ fsopen.c \
+ fspick.c \
+ fstatfs.c \
+ fstatfs64.c \
+ futex.c \
+ gcc_compat.h \
+ get_personality.c \
+ get_personality.h \
+ get_robust_list.c \
+ getcpu.c \
+ getcwd.c \
+ getpagesize.c \
+ getpid.c \
+ getrandom.c \
+ gpio_ioctl.c \
+ hdio.c \
+ hostname.c \
+ inotify.c \
+ inotify_ioctl.c \
+ io.c \
+ io_uring.c \
+ ioctl.c \
+ ioperm.c \
+ iopl.c \
+ ioprio.c \
+ ipc.c \
+ ipc_defs.h \
+ ipc_msg.c \
+ ipc_msgctl.c \
+ ipc_sem.c \
+ ipc_semctl.c \
+ ipc_shm.c \
+ ipc_shmctl.c \
+ kcmp.c \
+ kernel_dirent.h \
+ kernel_rusage.h \
+ kernel_timespec.h \
+ kernel_timeval.h \
+ kernel_timex.h \
+ kernel_types.h \
+ kernel_v4l2_types.h \
+ kexec.c \
+ keyctl.c \
+ keyctl_kdf_params.h \
+ kill_save_errno.h \
+ kvm.c \
+ largefile_wrappers.h \
+ ldt.c \
+ link.c \
+ linux/asm_stat.h \
+ linux/x32/asm_stat.h \
+ linux/x86_64/asm_stat.h \
+ list.h \
+ listen.c \
+ lookup_dcookie.c \
+ loop.c \
+ lseek.c \
+ macros.h \
+ mem.c \
+ membarrier.c \
+ memfd_create.c \
+ mknod.c \
+ mmap_cache.c \
+ mmap_cache.h \
+ mmap_notify.c \
+ mmap_notify.h \
+ mmsghdr.c \
+ mount.c \
+ move_mount.c \
+ mpers_type.h \
+ mq.c \
+ msghdr.c \
+ msghdr.h \
+ mtd.c \
+ native_defs.h \
+ nbd_ioctl.c \
+ negated_errno.h \
+ net.c \
+ netlink.c \
+ netlink.h \
+ netlink_crypto.c \
+ netlink_inet_diag.c \
+ netlink_kobject_uevent.c \
+ netlink_kobject_uevent.h \
+ netlink_netfilter.c \
+ netlink_netlink_diag.c \
+ netlink_packet_diag.c \
+ netlink_route.c \
+ netlink_route.h \
+ netlink_selinux.c \
+ netlink_smc_diag.c \
+ netlink_sock_diag.c \
+ netlink_sock_diag.h \
+ netlink_unix_diag.c \
+ nlattr.c \
+ nlattr.h \
+ nsfs.c \
+ nsfs.h \
+ nsig.h \
+ numa.c \
+ number_set.c \
+ number_set.h \
+ oldstat.c \
+ open.c \
+ open_tree.c \
+ or1k_atomic.c \
+ pathtrace.c \
+ perf.c \
+ perf_event_struct.h \
+ perf_ioctl.c \
+ personality.c \
+ pidfd_getfd.c \
+ pidfd_open.c \
+ pidns.c \
+ pkeys.c \
+ poll.c \
+ prctl.c \
+ print_kernel_sigset.c \
+ print_dev_t.c \
+ print_fields.h \
+ print_group_req.c \
+ print_ifindex.c \
+ print_instruction_pointer.c \
+ print_kernel_version.c \
+ print_mac.c \
+ print_mq_attr.c \
+ print_msgbuf.c \
+ print_sg_req_info.c \
+ print_sigevent.c \
+ print_statfs.c \
+ print_struct_stat.c \
+ print_syscall_number.c \
+ print_time.c \
+ print_timespec.h \
+ print_timespec32.c \
+ print_timespec64.c \
+ print_timeval.c \
+ print_timeval64.c \
+ print_timex.c \
+ print_timex.h \
+ print_utils.h \
+ printmode.c \
+ printrusage.c \
+ printsiginfo.c \
+ printsiginfo.h \
+ process.c \
+ process_vm.c \
+ ptp.c \
+ ptrace.h \
+ ptrace_syscall_info.c \
+ ptrace_syscall_info.h \
+ quota.c \
+ random_ioctl.c \
+ readahead.c \
+ readlink.c \
+ reboot.c \
+ regs.h \
+ renameat.c \
+ resource.c \
+ retval.c \
+ retval.h \
+ riscv.c \
+ rt_sigframe.c \
+ rt_sigreturn.c \
+ rtc.c \
+ rtnl_addr.c \
+ rtnl_addrlabel.c \
+ rtnl_dcb.c \
+ rtnl_link.c \
+ rtnl_mdb.c \
+ rtnl_neigh.c \
+ rtnl_neightbl.c \
+ rtnl_netconf.c \
+ rtnl_nsid.c \
+ rtnl_route.c \
+ rtnl_rule.c \
+ rtnl_tc.c \
+ rtnl_tc_action.c \
+ s390.c \
+ sched.c \
+ sched_attr.h \
+ scsi.c \
+ seccomp.c \
+ sendfile.c \
+ sg_io_v3.c \
+ sg_io_v4.c \
+ shutdown.c \
+ sigaltstack.c \
+ sigevent.h \
+ signal.c \
+ signalfd.c \
+ sigreturn.c \
+ sock.c \
+ sockaddr.c \
+ socketcall.c \
+ socketutils.c \
+ sparc.c \
+ sram_alloc.c \
+ stage_output.c \
+ stat.c \
+ stat.h \
+ stat64.c \
+ statfs.c \
+ statfs.c \
+ statfs.h \
+ statfs64.c \
+ static_assert.h \
+ statx.c \
+ statx.h \
+ string_to_uint.c \
+ string_to_uint.h \
+ swapon.c \
+ sync_file_range.c \
+ sync_file_range2.c \
+ syscall.c \
+ sysctl.c \
+ sysent.h \
+ sysent_shorthand_defs.h \
+ sysent_shorthand_undefs.h \
+ sysinfo.c \
+ syslog.c \
+ sysmips.c \
+ tee.c \
+ term.c \
+ time.c \
+ times.c \
+ trace_event.h \
+ trie.c \
+ trie.h \
+ truncate.c \
+ ubi.c \
+ ucopy.c \
+ uid.c \
+ uid16.c \
+ umask.c \
+ umount.c \
+ uname.c \
+ upeek.c \
+ upoke.c \
+ userfaultfd.c \
+ ustat.c \
+ util.c \
+ utime.c \
+ utimes.c \
+ v4l2.c \
+ wait.c \
+ wait.h \
+ watchdog_ioctl.c \
+ xattr.c \
+ xfs_quota_stat.h \
+ xgetdents.c \
+ xgetdents.h \
+ xlat.c \
+ xlat.h \
+ xmalloc.c \
+ xmalloc.h \
+ xstring.h \
+ $(TYPES_HEADER_FILES) \
+ $(strace_SOURCES_check) \
+ # end of libstrace_a_SOURCES
+
+strace_SOURCES_check = bpf_attr_check.c $(TYPES_CHECK_FILES)
+
+if ENABLE_STACKTRACE
+libstrace_a_SOURCES += unwind.c unwind.h
+if USE_LIBDW
+libstrace_a_SOURCES += unwind-libdw.c
+strace_CPPFLAGS += $(libdw_CPPFLAGS)
+strace_CFLAGS += $(libdw_CFLAGS)
+strace_LDFLAGS += $(libdw_LDFLAGS)
+strace_LDADD += $(libdw_LIBS)
+endif
+if USE_LIBUNWIND
+libstrace_a_SOURCES += unwind-libunwind.c
+strace_CPPFLAGS += $(libunwind_CPPFLAGS)
+strace_LDFLAGS += $(libunwind_LDFLAGS)
+strace_LDADD += $(libunwind_LIBS)
+endif
+if USE_DEMANGLE
+strace_CPPFLAGS += $(libiberty_CPPFLAGS)
+strace_LDFLAGS += $(libiberty_LDFLAGS)
+strace_LDADD += $(libiberty_LIBS)
+endif
+endif
+
+strace_CPPFLAGS += $(CODE_COVERAGE_CPPFLAGS)
+strace_CFLAGS += $(CODE_COVERAGE_CFLAGS)
+strace_LDADD += $(CODE_COVERAGE_LIBS)
+
+# Enable this to get link map generated
+#strace_LDFLAGS += -Wl,-Map=strace.mapfile
+
+EXTRA_DIST = \
+ disable_ptrace_request.c \
+ gen_bpf_attr_check.sh \
+ generate_sen.sh \
+ ioctl_iocdef.c \
+ ioctlsort.c \
+ linux/32/ioctls_inc.h \
+ linux/32/ioctls_inc_align16.h \
+ linux/32/ioctls_inc_align32.h \
+ linux/32/ioctls_inc_align64.h \
+ linux/32/syscallent-time32.h \
+ linux/32/syscallent.h \
+ linux/64/ioctls_inc.h \
+ linux/64/syscallent.h \
+ linux/aarch64/arch_defs_.h \
+ linux/aarch64/arch_get_personality.c \
+ linux/aarch64/arch_regs.c \
+ linux/aarch64/arch_sigreturn.c \
+ linux/aarch64/get_error.c \
+ linux/aarch64/get_scno.c \
+ linux/aarch64/get_syscall_args.c \
+ linux/aarch64/ioctls_arch0.h \
+ linux/aarch64/ioctls_arch1.h \
+ linux/aarch64/ioctls_inc0.h \
+ linux/aarch64/ioctls_inc1.h \
+ linux/aarch64/nr_prefix.c \
+ linux/aarch64/raw_syscall.h \
+ linux/aarch64/set_error.c \
+ linux/aarch64/set_scno.c \
+ linux/aarch64/shuffle_scno.c \
+ linux/aarch64/syscallent.h \
+ linux/aarch64/syscallent1.h \
+ linux/alpha/arch_defs_.h \
+ linux/alpha/arch_getrval2.c \
+ linux/alpha/arch_regs.c \
+ linux/alpha/arch_sigreturn.c \
+ linux/alpha/errnoent.h \
+ linux/alpha/get_error.c \
+ linux/alpha/get_scno.c \
+ linux/alpha/get_syscall_args.c \
+ linux/alpha/get_syscall_result.c \
+ linux/alpha/ioctls_arch0.h \
+ linux/alpha/ioctls_inc0.h \
+ linux/alpha/raw_syscall.h \
+ linux/alpha/set_error.c \
+ linux/alpha/set_scno.c \
+ linux/alpha/signalent.h \
+ linux/alpha/syscallent.h \
+ linux/alpha/userent.h \
+ linux/arc/arch_regs.c \
+ linux/arc/get_error.c \
+ linux/arc/get_scno.c \
+ linux/arc/get_syscall_args.c \
+ linux/arc/ioctls_arch0.h \
+ linux/arc/ioctls_inc0.h \
+ linux/arc/raw_syscall.h \
+ linux/arc/set_error.c \
+ linux/arc/set_scno.c \
+ linux/arc/syscallent.h \
+ linux/arch_defs_.h \
+ linux/arch_kvm.c \
+ linux/arch_regs.h \
+ linux/arch_rt_sigframe.c \
+ linux/arch_sigreturn.c \
+ linux/arm/arch_defs_.h \
+ linux/arm/arch_regs.c \
+ linux/arm/arch_sigreturn.c \
+ linux/arm/get_error.c \
+ linux/arm/get_scno.c \
+ linux/arm/get_syscall_args.c \
+ linux/arm/ioctls_arch0.h \
+ linux/arm/ioctls_inc0.h \
+ linux/arm/nr_prefix.c \
+ linux/arm/raw_syscall.h \
+ linux/arm/set_error.c \
+ linux/arm/set_scno.c \
+ linux/arm/shuffle_scno.c \
+ linux/arm/syscallent.h \
+ linux/arm/userent.h \
+ linux/avr32/arch_regs.c \
+ linux/avr32/get_error.c \
+ linux/avr32/get_scno.c \
+ linux/avr32/get_syscall_args.c \
+ linux/avr32/ioctls_arch0.h \
+ linux/avr32/ioctls_inc0.h \
+ linux/avr32/raw_syscall.h \
+ linux/avr32/set_error.c \
+ linux/avr32/set_scno.c \
+ linux/avr32/syscallent.h \
+ linux/avr32/userent.h \
+ linux/bfin/arch_defs_.h \
+ linux/bfin/arch_regs.c \
+ linux/bfin/get_error.c \
+ linux/bfin/get_scno.c \
+ linux/bfin/get_syscall_args.c \
+ linux/bfin/get_syscall_result.c \
+ linux/bfin/ioctls_arch0.h \
+ linux/bfin/ioctls_inc0.h \
+ linux/bfin/raw_syscall.h \
+ linux/bfin/rt_sigframe.h \
+ linux/bfin/set_error.c \
+ linux/bfin/set_scno.c \
+ linux/bfin/syscallent.h \
+ linux/csky/arch_regs.c \
+ linux/csky/get_error.c \
+ linux/csky/get_scno.c \
+ linux/csky/get_syscall_args.c \
+ linux/csky/ioctls_arch0.h \
+ linux/csky/ioctls_inc0.h \
+ linux/csky/raw_syscall.h \
+ linux/csky/set_error.c \
+ linux/csky/set_scno.c \
+ linux/csky/syscallent.h \
+ linux/bfin/userent.h \
+ linux/check_scno.c \
+ linux/dummy.h \
+ linux/errnoent.h \
+ linux/getregs_old.h \
+ linux/hppa/arch_defs_.h \
+ linux/hppa/arch_regs.c \
+ linux/hppa/arch_rt_sigframe.c \
+ linux/hppa/errnoent.h \
+ linux/hppa/get_error.c \
+ linux/hppa/get_scno.c \
+ linux/hppa/get_syscall_args.c \
+ linux/hppa/ioctls_arch0.h \
+ linux/hppa/ioctls_inc0.h \
+ linux/hppa/raw_syscall.h \
+ linux/hppa/rt_sigframe.h \
+ linux/hppa/set_error.c \
+ linux/hppa/set_scno.c \
+ linux/hppa/signalent.h \
+ linux/hppa/syscallent.h \
+ linux/hppa/userent.h \
+ linux/i386/arch_defs_.h \
+ linux/i386/arch_kvm.c \
+ linux/i386/arch_regs.c \
+ linux/i386/arch_rt_sigframe.c \
+ linux/i386/arch_sigreturn.c \
+ linux/i386/get_error.c \
+ linux/i386/get_scno.c \
+ linux/i386/get_syscall_args.c \
+ linux/i386/ioctls_arch0.h \
+ linux/i386/ioctls_inc0.h \
+ linux/i386/raw_syscall.h \
+ linux/i386/rt_sigframe.h \
+ linux/i386/set_error.c \
+ linux/i386/set_scno.c \
+ linux/i386/syscallent.h \
+ linux/i386/userent.h \
+ linux/i386/userent0.h \
+ linux/ia64/arch_defs_.h \
+ linux/ia64/arch_getrval2.c \
+ linux/ia64/arch_regs.c \
+ linux/ia64/arch_regs.h \
+ linux/ia64/arch_rt_sigframe.c \
+ linux/ia64/get_error.c \
+ linux/ia64/get_scno.c \
+ linux/ia64/get_syscall_args.c \
+ linux/ia64/ioctls_arch0.h \
+ linux/ia64/ioctls_inc0.h \
+ linux/ia64/raw_syscall.h \
+ linux/ia64/rt_sigframe.h \
+ linux/ia64/set_error.c \
+ linux/ia64/set_scno.c \
+ linux/ia64/shuffle_scno.c \
+ linux/ia64/syscallent.h \
+ linux/ia64/syscallent_base_nr.h \
+ linux/ia64/userent.h \
+ linux/inet_diag.h \
+ linux/m68k/arch_defs_.h \
+ linux/m68k/arch_regs.c \
+ linux/m68k/arch_rt_sigframe.c \
+ linux/m68k/arch_sigreturn.c \
+ linux/m68k/get_error.c \
+ linux/m68k/get_scno.c \
+ linux/m68k/get_syscall_args.c \
+ linux/m68k/ioctls_arch0.h \
+ linux/m68k/ioctls_inc0.h \
+ linux/m68k/raw_syscall.h \
+ linux/m68k/rt_sigframe.h \
+ linux/m68k/set_error.c \
+ linux/m68k/set_scno.c \
+ linux/m68k/syscallent.h \
+ linux/m68k/userent.h \
+ linux/metag/arch_regs.c \
+ linux/metag/arch_rt_sigframe.c \
+ linux/metag/get_error.c \
+ linux/metag/get_scno.c \
+ linux/metag/get_syscall_args.c \
+ linux/metag/ioctls_arch0.h \
+ linux/metag/ioctls_inc0.h \
+ linux/metag/raw_syscall.h \
+ linux/metag/set_error.c \
+ linux/metag/set_scno.c \
+ linux/metag/syscallent.h \
+ linux/microblaze/arch_defs_.h \
+ linux/microblaze/arch_regs.c \
+ linux/microblaze/arch_sigreturn.c \
+ linux/microblaze/get_error.c \
+ linux/microblaze/get_scno.c \
+ linux/microblaze/get_syscall_args.c \
+ linux/microblaze/get_syscall_result.c \
+ linux/microblaze/ioctls_arch0.h \
+ linux/microblaze/ioctls_inc0.h \
+ linux/microblaze/raw_syscall.h \
+ linux/microblaze/set_error.c \
+ linux/microblaze/set_scno.c \
+ linux/microblaze/syscallent.h \
+ linux/microblaze/userent.h \
+ linux/mips/arch_defs_.h \
+ linux/mips/arch_getrval2.c \
+ linux/mips/arch_regs.c \
+ linux/mips/arch_sigreturn.c \
+ linux/mips/errnoent.h \
+ linux/mips/genstub.sh \
+ linux/mips/get_error.c \
+ linux/mips/get_scno.c \
+ linux/mips/get_syscall_args.c \
+ linux/mips/ioctls_arch0.h \
+ linux/mips/ioctls_inc0.h \
+ linux/mips/raw_syscall.h \
+ linux/mips/rt_sigframe.h \
+ linux/mips/set_error.c \
+ linux/mips/set_scno.c \
+ linux/mips/signalent.h \
+ linux/mips/syscallent-compat.h \
+ linux/mips/syscallent-n32.h \
+ linux/mips/syscallent-n64.h \
+ linux/mips/syscallent-o32.h \
+ linux/mips/syscallent.h \
+ linux/mips/userent.h \
+ linux/netlink_diag.h \
+ linux/nios2/arch_defs_.h \
+ linux/nios2/arch_regs.c \
+ linux/nios2/get_error.c \
+ linux/nios2/get_scno.c \
+ linux/nios2/get_syscall_args.c \
+ linux/nios2/ioctls_arch0.h \
+ linux/nios2/ioctls_inc0.h \
+ linux/nios2/raw_syscall.h \
+ linux/nios2/set_error.c \
+ linux/nios2/set_scno.c \
+ linux/nios2/syscallent.h \
+ linux/nr_prefix.c \
+ linux/or1k/arch_regs.c \
+ linux/or1k/get_error.c \
+ linux/or1k/get_scno.c \
+ linux/or1k/get_syscall_args.c \
+ linux/or1k/ioctls_arch0.h \
+ linux/or1k/ioctls_inc0.h \
+ linux/or1k/raw_syscall.h \
+ linux/or1k/set_error.c \
+ linux/or1k/set_scno.c \
+ linux/or1k/syscallent.h \
+ linux/or1k/userent.h \
+ linux/packet_diag.h \
+ linux/powerpc/arch_defs_.h \
+ linux/powerpc/arch_regs.c \
+ linux/powerpc/arch_rt_sigframe.c \
+ linux/powerpc/arch_sigreturn.c \
+ linux/powerpc/errnoent.h \
+ linux/powerpc/get_error.c \
+ linux/powerpc/get_scno.c \
+ linux/powerpc/get_syscall_args.c \
+ linux/powerpc/getregs_old.c \
+ linux/powerpc/getregs_old.h \
+ linux/powerpc/ioctls_arch0.h \
+ linux/powerpc/ioctls_inc0.h \
+ linux/powerpc/raw_syscall.h \
+ linux/powerpc/set_error.c \
+ linux/powerpc/set_scno.c \
+ linux/powerpc/syscallent.h \
+ linux/powerpc/userent.h \
+ linux/powerpc64/arch_defs_.h \
+ linux/powerpc64/arch_get_personality.c \
+ linux/powerpc64/arch_regs.c \
+ linux/powerpc64/arch_rt_sigframe.c \
+ linux/powerpc64/arch_sigreturn.c \
+ linux/powerpc64/errnoent.h \
+ linux/powerpc64/get_error.c \
+ linux/powerpc64/get_scno.c \
+ linux/powerpc64/get_syscall_args.c \
+ linux/powerpc64/getregs_old.c \
+ linux/powerpc64/getregs_old.h \
+ linux/powerpc64/ioctls_arch0.h \
+ linux/powerpc64/ioctls_arch1.h \
+ linux/powerpc64/ioctls_inc0.h \
+ linux/powerpc64/ioctls_inc1.h \
+ linux/powerpc64/raw_syscall.h \
+ linux/powerpc64/rt_sigframe.h \
+ linux/powerpc64/set_error.c \
+ linux/powerpc64/set_scno.c \
+ linux/powerpc64/syscallent.h \
+ linux/powerpc64/syscallent1.h \
+ linux/powerpc64/userent.h \
+ linux/powerpc64le/arch_defs_.h \
+ linux/powerpc64le/arch_regs.c \
+ linux/powerpc64le/arch_rt_sigframe.c \
+ linux/powerpc64le/errnoent.h \
+ linux/powerpc64le/get_error.c \
+ linux/powerpc64le/get_scno.c \
+ linux/powerpc64le/get_syscall_args.c \
+ linux/powerpc64le/ioctls_arch0.h \
+ linux/powerpc64le/ioctls_inc0.h \
+ linux/powerpc64le/raw_syscall.h \
+ linux/powerpc64le/rt_sigframe.h \
+ linux/powerpc64le/set_error.c \
+ linux/powerpc64le/set_scno.c \
+ linux/powerpc64le/syscallent.h \
+ linux/powerpc64le/userent.h \
+ linux/ptrace_pokeuser.c \
+ linux/raw_syscall.h \
+ linux/riscv64/arch_regs.c \
+ linux/riscv64/get_error.c \
+ linux/riscv64/get_scno.c \
+ linux/riscv64/get_syscall_args.c \
+ linux/riscv64/ioctls_arch0.h \
+ linux/riscv64/ioctls_inc0.h \
+ linux/riscv64/raw_syscall.h \
+ linux/riscv64/set_error.c \
+ linux/riscv64/set_scno.c \
+ linux/riscv64/syscallent.h \
+ linux/rt_sigframe.h \
+ linux/s390/arch_defs_.h \
+ linux/s390/arch_regs.c \
+ linux/s390/arch_sigreturn.c \
+ linux/s390/check_scno.c \
+ linux/s390/get_error.c \
+ linux/s390/get_scno.c \
+ linux/s390/get_syscall_args.c \
+ linux/s390/ioctls_arch0.h \
+ linux/s390/ioctls_inc0.h \
+ linux/s390/raw_syscall.h \
+ linux/s390/rt_sigframe.h \
+ linux/s390/set_error.c \
+ linux/s390/set_scno.c \
+ linux/s390/syscallent.h \
+ linux/s390/userent.h \
+ linux/s390/userent0.h \
+ linux/s390/userent1.h \
+ linux/s390x/arch_defs_.h \
+ linux/s390x/arch_get_personality.c \
+ linux/s390x/arch_regs.c \
+ linux/s390x/arch_sigreturn.c \
+ linux/s390x/check_scno.c \
+ linux/s390x/get_error.c \
+ linux/s390x/get_scno.c \
+ linux/s390x/get_syscall_args.c \
+ linux/s390x/ioctls_arch0.h \
+ linux/s390x/ioctls_arch1.h \
+ linux/s390x/ioctls_inc0.h \
+ linux/s390x/ioctls_inc1.h \
+ linux/s390x/raw_syscall.h \
+ linux/s390x/rt_sigframe.h \
+ linux/s390x/set_error.c \
+ linux/s390x/set_scno.c \
+ linux/s390x/syscallent.h \
+ linux/s390x/syscallent1.h \
+ linux/s390x/userent.h \
+ linux/sh/arch_defs_.h \
+ linux/sh/arch_getrval2.c \
+ linux/sh/arch_regs.c \
+ linux/sh/get_error.c \
+ linux/sh/get_scno.c \
+ linux/sh/get_syscall_args.c \
+ linux/sh/ioctls_arch0.h \
+ linux/sh/ioctls_inc0.h \
+ linux/sh/raw_syscall.h \
+ linux/sh/set_error.c \
+ linux/sh/set_scno.c \
+ linux/sh/syscallent.h \
+ linux/sh/userent.h \
+ linux/sh/userent0.h \
+ linux/sh64/arch_defs_.h \
+ linux/sh64/arch_regs.c \
+ linux/sh64/get_error.c \
+ linux/sh64/get_scno.c \
+ linux/sh64/get_syscall_args.c \
+ linux/sh64/ioctls_arch0.h \
+ linux/sh64/ioctls_inc0.h \
+ linux/sh64/raw_syscall.h \
+ linux/sh64/rt_sigframe.h \
+ linux/sh64/set_error.c \
+ linux/sh64/set_scno.c \
+ linux/sh64/syscallent.h \
+ linux/sh64/userent.h \
+ linux/shuffle_scno.c \
+ linux/signal.h.in \
+ linux/signalent.h \
+ linux/smc_diag.h \
+ linux/sock_diag.h \
+ linux/sparc/arch_defs_.h \
+ linux/sparc/arch_getrval2.c \
+ linux/sparc/arch_regs.c \
+ linux/sparc/arch_sigreturn.c \
+ linux/sparc/errnoent.h \
+ linux/sparc/get_error.c \
+ linux/sparc/get_scno.c \
+ linux/sparc/get_syscall_args.c \
+ linux/sparc/ioctls_arch0.h \
+ linux/sparc/ioctls_inc0.h \
+ linux/sparc/raw_syscall.h \
+ linux/sparc/rt_sigframe.h \
+ linux/sparc/set_error.c \
+ linux/sparc/set_scno.c \
+ linux/sparc/signalent.h \
+ linux/sparc/syscallent.h \
+ linux/sparc/userent.h \
+ linux/sparc64/arch_defs_.h \
+ linux/sparc64/arch_get_personality.c \
+ linux/sparc64/arch_getrval2.c \
+ linux/sparc64/arch_regs.c \
+ linux/sparc64/arch_rt_sigframe.c \
+ linux/sparc64/arch_sigreturn.c \
+ linux/sparc64/errnoent.h \
+ linux/sparc64/get_error.c \
+ linux/sparc64/get_scno.c \
+ linux/sparc64/get_syscall_args.c \
+ linux/sparc64/ioctls_arch0.h \
+ linux/sparc64/ioctls_arch1.h \
+ linux/sparc64/ioctls_inc0.h \
+ linux/sparc64/ioctls_inc1.h \
+ linux/sparc64/raw_syscall.h \
+ linux/sparc64/rt_sigframe.h \
+ linux/sparc64/set_error.c \
+ linux/sparc64/set_scno.c \
+ linux/sparc64/signalent.h \
+ linux/sparc64/syscallent.h \
+ linux/sparc64/syscallent1.h \
+ linux/sparc64/userent.h \
+ linux/subcall.h \
+ linux/subcall32.h \
+ linux/subcall64.h \
+ linux/syscall.h \
+ linux/syscallent-common-32.h \
+ linux/syscallent-common.h \
+ linux/syscallent_base_nr.h \
+ linux/tile/arch_defs_.h \
+ linux/tile/arch_get_personality.c \
+ linux/tile/arch_regs.c \
+ linux/tile/arch_sigreturn.c \
+ linux/tile/get_error.c \
+ linux/tile/get_scno.c \
+ linux/tile/get_syscall_args.c \
+ linux/tile/ioctls_arch0.h \
+ linux/tile/ioctls_arch1.h \
+ linux/tile/ioctls_inc0.h \
+ linux/tile/ioctls_inc1.h \
+ linux/tile/raw_syscall.h \
+ linux/tile/rt_sigframe.h \
+ linux/tile/set_error.c \
+ linux/tile/set_scno.c \
+ linux/tile/syscallent.h \
+ linux/tile/syscallent1.h \
+ linux/tile/userent.h \
+ linux/unix_diag.h \
+ linux/userent.h \
+ linux/userent0.h \
+ linux/x32/arch_defs_.h \
+ linux/x32/arch_get_personality.c \
+ linux/x32/arch_kvm.c \
+ linux/x32/arch_regs.c \
+ linux/x32/arch_regs.h \
+ linux/x32/arch_rt_sigframe.c \
+ linux/x32/arch_sigreturn.c \
+ linux/x32/check_scno.c \
+ linux/x32/get_error.c \
+ linux/x32/get_scno.c \
+ linux/x32/get_syscall_args.c \
+ linux/x32/ioctls_arch0.h \
+ linux/x32/ioctls_arch1.h \
+ linux/x32/ioctls_inc0.h \
+ linux/x32/ioctls_inc1.h \
+ linux/x32/ptrace_pokeuser.c \
+ linux/x32/raw_syscall.h \
+ linux/x32/rt_sigframe.h \
+ linux/x32/set_error.c \
+ linux/x32/set_scno.c \
+ linux/x32/shuffle_scno.c \
+ linux/x32/syscallent.h \
+ linux/x32/syscallent1.h \
+ linux/x32/userent.h \
+ linux/x86_64/arch_defs_.h \
+ linux/x86_64/arch_get_personality.c \
+ linux/x86_64/arch_kvm.c \
+ linux/x86_64/arch_regs.c \
+ linux/x86_64/arch_regs.h \
+ linux/x86_64/arch_rt_sigframe.c \
+ linux/x86_64/arch_sigreturn.c \
+ linux/x86_64/get_error.c \
+ linux/x86_64/get_scno.c \
+ linux/x86_64/get_syscall_args.c \
+ linux/x86_64/getregs_old.c \
+ linux/x86_64/getregs_old.h \
+ linux/x86_64/ioctls_arch0.h \
+ linux/x86_64/ioctls_arch1.h \
+ linux/x86_64/ioctls_arch2.h \
+ linux/x86_64/ioctls_inc0.h \
+ linux/x86_64/ioctls_inc1.h \
+ linux/x86_64/ioctls_inc2.h \
+ linux/x86_64/raw_syscall.h \
+ linux/x86_64/rt_sigframe.h \
+ linux/x86_64/set_error.c \
+ linux/x86_64/set_scno.c \
+ linux/x86_64/shuffle_scno.c \
+ linux/x86_64/syscallent.h \
+ linux/x86_64/syscallent1.h \
+ linux/x86_64/syscallent2.h \
+ linux/x86_64/userent.h \
+ linux/xtensa/arch_regs.c \
+ linux/xtensa/get_error.c \
+ linux/xtensa/get_scno.c \
+ linux/xtensa/get_syscall_args.c \
+ linux/xtensa/ioctls_arch0.h \
+ linux/xtensa/ioctls_inc0.h \
+ linux/xtensa/raw_syscall.h \
+ linux/xtensa/set_error.c \
+ linux/xtensa/set_scno.c \
+ linux/xtensa/syscallent.h \
+ linux/xtensa/userent.h \
+ mpers.awk \
+ mpers.sh \
+ mpers_test.sh \
+ mpers_xlat.h \
+ scno.head \
+ strace-graph \
+ strace-log-merge \
+ types/find_last_type_fields.awk \
+ types/gen.sh \
+ $(XLAT_INPUT_FILES) \
+ $(XLAT_HEADER_FILES) \
+ xlat/gen.sh \
+ # end of EXTRA_DIST
+
+.PHONY: check-valgrind-local
+check-valgrind-local:
+
+bpf_attr_check.c: $(srcdir)/bpf_attr.h $(srcdir)/gen_bpf_attr_check.sh
+ D="$(D)" \
+ $(srcdir)/gen_bpf_attr_check.sh $< > $@-t && mv $@-t $@
+
+strace_SOURCES_c = \
+ $(filter %.c,$(strace_SOURCES)) $(filter %.c,$(libstrace_a_SOURCES))
+
+sys_func_h_sources = $(filter-out $(strace_SOURCES_check),$(strace_SOURCES_c))
+
+sys_func.h: $(patsubst %,$(srcdir)/%,$(sys_func_h_sources))
+ for f in $^; do \
+ sed -n 's/^SYS_FUNC(.*/extern &;/p' $$f; \
+ done | sort -u > $@
+
+syscallent_names = subcall.h syscallent.h syscallent1.h \
+ syscallent-common.h syscallent-common-32.h \
+ syscallent-n32.h syscallent-n64.h syscallent-o32.h
+syscallent_patterns = $(patsubst %,\%/%,$(syscallent_names))
+syscallent_files = $(filter $(syscallent_patterns),$(EXTRA_DIST))
+
+sen.h: $(patsubst %,$(srcdir)/%,$(syscallent_files))
+ for f in $^; do cat -- $$f; done | \
+ D="$(D)" \
+ $(srcdir)/generate_sen.sh > $@
+
+ioctlsort_CC = $(CC_FOR_BUILD)
+ioctlsort_DEFS = $(DEFS)
+ioctlsort_INCLUDES = $(DEFAULT_INCLUDES) $(INCLUDES)
+ioctlsort_CPPFLAGS = $(AM_CPPFLAGS_FOR_BUILD) $(CPPFLAGS_FOR_BUILD)
+ioctlsort_CFLAGS = $(AM_CFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD)
+ioctlsort_LDFLAGS = $(AM_LDFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD)
+
+ioctls_inc_h = $(wildcard $(srcdir)/$(OS)/$(ARCH)/ioctls_inc*.h)
+ioctlent_h = $(patsubst $(srcdir)/$(OS)/$(ARCH)/ioctls_inc%,ioctlent%,$(ioctls_inc_h))
+ioctl_redefs_h = $(filter-out ioctl_redefs0.h,$(subst ioctlent,ioctl_redefs,$(ioctlent_h)))
+
+ioctl_redefs%.h: ioctlent%.h ioctlent0.h
+ sort $< > $<-t
+ sort ioctlent0.h | comm -23 $<-t - | \
+ sed -r -n 's/^\{ "([^"]+)", (0x[[:xdigit:]]+) \},$$/#ifdef \1\n# undef \1\n# define \1 \2\n#endif/p' \
+ > $@-t
+ rm -f $<-t
+ mv $@-t $@
+
+ioctlent%.h: ioctlsort%
+ ./$< > $@
+
+# Need to pick up <linux/ioctl.h> definitions *for host* while compiling
+# ioctlsort *for build*, hence this magic.
+ioctl_iocdef.i: $(srcdir)/ioctl_iocdef.c
+ $(CPP) -P $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(strace_CPPFLAGS) $(CPPFLAGS) $< -o $@
+
+ioctl_iocdef.h: ioctl_iocdef.i
+ sed -n 's/^DEFINE HOST/#define /p' $< > $@
+
+ioctlsort%$(BUILD_EXEEXT): ioctlsort%.o
+ $(ioctlsort_CC) $(ioctlsort_CFLAGS) $(ioctlsort_LDFLAGS) $< -o $@
+
+ioctlsort%.o: ioctls_all%.h ioctl_iocdef.h $(srcdir)/ioctlsort.c
+ $(ioctlsort_CC) $(ioctlsort_DEFS) $(ioctlsort_INCLUDES) $(ioctlsort_CPPFLAGS) $(ioctlsort_CFLAGS) -DIOCTLSORT_INC=\"$<\" -c -o $@ $(srcdir)/ioctlsort.c
+
+ioctls_all%.h: $(srcdir)/$(OS)/$(ARCH)/ioctls_inc%.h $(srcdir)/$(OS)/$(ARCH)/ioctls_arch%.h
+ cat $^ > $@
+
+BUILT_SOURCES = $(ioctl_redefs_h) $(ioctlent_h) \
+ bpf_attr_check.c native_printer_decls.h native_printer_defs.h \
+ printers.h sen.h sys_func.h
+CLEANFILES = $(ioctl_redefs_h) $(ioctlent_h) $(mpers_preproc_files) \
+ ioctl_iocdef.h ioctl_iocdef.i \
+ bpf_attr_check.c native_printer_decls.h native_printer_defs.h \
+ printers.h sen.h sys_func.h
+DISTCLEANFILES = gnu/stubs-32.h gnu/stubs-x32.h linux/linux/signal.h
+
+include scno.am
+
+$(strace_OBJECTS): scno.h
+
+# defines mpers_source_files
+include mpers.am
+srcdir_mpers_source_files = $(patsubst %,$(srcdir)/%,$(mpers_source_files))
+mpers_preproc_files = $(mpers_source_files:.c=.c.mpers.i)
+
+mpers_NAME =
+mpers_PREFIX = $(mpers_NAME)_
+mpers_DEFS = $(DEFS)
+mpers_INCLUDES = $(DEFAULT_INCLUDES) $(INCLUDES)
+mpers_CPPFLAGS = $(CPPFLAGS)
+mpers_sh_opts = $(mpers_DEFS) $(mpers_INCLUDES) $(strace_CPPFLAGS) $(mpers_CPPFLAGS)
+libmpers_CPPFLAGS = $(strace_CPPFLAGS) -DIN_MPERS
+libmpers_CFLAGS = $(strace_CFLAGS)
+
+# mpers targets
+
+mpers-m%.stamp: $(srcdir_mpers_source_files) | printers.h
+ for f in $^; do \
+ D="$(D)" \
+ READELF="$(READELF)" \
+ CC="$(mpers_CC)" \
+ CFLAGS="$(mpers_sh_opts) -DMPERS_IS_$(mpers_NAME)" \
+ CPP="$(CPP)" \
+ CPPFLAGS="$(mpers_sh_opts) -DIN_MPERS -DMPERS_IS_$(mpers_NAME)" \
+ $(srcdir)/mpers.sh $(mpers_NAME) "$(mpers_CC_FLAGS)" $$f || exit; \
+ done
+ > $@
+
+m%_type_defs.h: $(srcdir_mpers_source_files)
+ for f in $^; do \
+ sed -r -n 's/^#[[:space:]]*include DEF_MPERS_TYPE\(([^)]+)\)/#ifdef MPERS_$(mpers_PREFIX)\1\n# define \1 MPERS_$(mpers_PREFIX)\1\n#endif/p' $$f || exit; \
+ done > $@-t
+ echo '#undef MPERS_PRINTER_NAME' >> $@-t
+ echo '#define MPERS_PRINTER_NAME(printer_name) printer_name' >> $@-t
+ echo '#include "$(mpers_PREFIX)printer_decls.h"' >> $@-t
+ echo '#include MPERS_$(mpers_PREFIX)IOCTL_MACROS' >> $@-t
+ mv $@-t $@
+
+m%_funcs.h: $(srcdir_mpers_source_files)
+ for f in $^; do \
+ sed -r -n 's/^SYS_FUNC\(([^)]+)\)/#undef sys_\1\n#define sys_\1 $(mpers_PREFIX)sys_\1/p' $$f || exit; \
+ done > $@-t && \
+ echo '#include "sys_func.h"' >> $@-t
+ mv $@-t $@
+
+# printers
+
+%.c.mpers.i: $(srcdir)/%.c
+ $(CPP) -P $(mpers_sh_opts) -DIN_MPERS_BOOTSTRAP $< -o $@
+
+mpers_printer_decl_pattern = ^MPERS_PRINTER_DECL\(([^,)]+),[[:space:]]*([^,)]+),[[:space:]]*([^)]+)\)$$
+
+printers.h: $(mpers_preproc_files)
+ echo '/* Generated by Makefile from $^; do not edit. */' > $@-t
+ echo 'typedef struct {' >> $@-t
+ for f in $^; do \
+ sed -r -n 's/$(mpers_printer_decl_pattern)/ \1 (*\2)(\3);\n#define \2 MPERS_PRINTER_NAME(\2)\n/p' $$f \
+ || exit; \
+ done >> $@-t
+ echo '} struct_printers;' >> $@-t
+ echo 'extern const struct_printers *printers;' >> $@-t
+ echo '#define MPERS_PRINTER_NAME(printer_name) printers->printer_name' >> $@-t
+ mv $@-t $@
+
+%_printer_decls.h: $(mpers_preproc_files)
+ echo '/* Generated by Makefile from $^; do not edit. */' > $@-t
+ for f in $^; do \
+ sed -r -n 's/$(mpers_printer_decl_pattern)/extern \1 $(mpers_PREFIX)\2(\3);/p' $$f \
+ || exit; \
+ done >> $@-t
+ mv $@-t $@
+
+%_printer_defs.h: $(mpers_preproc_files)
+ echo '/* Generated by Makefile from $^; do not edit. */' > $@-t
+ for f in $^; do \
+ sed -r -n 's/$(mpers_printer_decl_pattern)/.\2 = $(mpers_PREFIX)\2,/p' $$f \
+ || exit; \
+ done >> $@-t
+ mv $@-t $@
+
+native_printer_decls.h native_printer_defs.h: mpers_PREFIX =
+
+if HAVE_M32_MPERS
+
+strace_LDADD += libmpers-m32.a
+noinst_LIBRARIES += libmpers-m32.a
+libmpers_m32_a_SOURCES = $(mpers_source_files)
+libmpers_m32_a_CPPFLAGS = $(libmpers_CPPFLAGS) -DMPERS_IS_m32 -I$(builddir)/mpers-m32
+libmpers_m32_a_CFLAGS = $(libmpers_CFLAGS)
+mpers_m32_targets = mpers-m32.stamp m32_type_defs.h m32_funcs.h m32_printer_decls.h m32_printer_defs.h
+
+BUILT_SOURCES += $(mpers_m32_targets)
+CLEANFILES += $(mpers_m32_targets)
+
+$(mpers_m32_targets): mpers_NAME = m32
+$(mpers_m32_targets): mpers_CC_FLAGS = @CFLAGS_FOR_M32@ @cc_flags_m32@
+$(mpers_m32_targets): mpers_CPPFLAGS = @CPPFLAGS_FOR_M32@
+$(mpers_m32_targets): mpers_CC = @CC_FOR_M32@
+
+endif # HAVE_M32_MPERS
+
+if HAVE_MX32_MPERS
+
+strace_LDADD += libmpers-mx32.a
+noinst_LIBRARIES += libmpers-mx32.a
+libmpers_mx32_a_SOURCES = $(mpers_source_files)
+libmpers_mx32_a_CPPFLAGS = $(libmpers_CPPFLAGS) -DMPERS_IS_mx32 -I$(builddir)/mpers-mx32
+libmpers_mx32_a_CFLAGS = $(libmpers_CFLAGS)
+mpers_mx32_targets = mpers-mx32.stamp mx32_type_defs.h mx32_funcs.h mx32_printer_decls.h mx32_printer_defs.h
+
+BUILT_SOURCES += $(mpers_mx32_targets)
+CLEANFILES += $(mpers_mx32_targets)
+
+$(mpers_mx32_targets): mpers_NAME = mx32
+$(mpers_mx32_targets): mpers_CC_FLAGS = @CFLAGS_FOR_MX32@ @cc_flags_mx32@
+$(mpers_mx32_targets): mpers_CPPFLAGS = @CPPFLAGS_FOR_MX32@
+$(mpers_mx32_targets): mpers_CC = @CC_FOR_MX32@
+
+endif # HAVE_MX32_MPERS
+
+clean-local:
+ -rm -rf mpers-m32 mpers-mx32
diff --git a/src/access.c b/src/access.c
new file mode 100644
index 000000000..759e0a6a2
--- /dev/null
+++ b/src/access.c
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2014-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#include <fcntl.h>
+
+#include "xlat/access_modes.h"
+#include "xlat/faccessat_flags.h"
+
+static void
+decode_access(struct tcb *tcp, int offset)
+{
+ printpath(tcp, tcp->u_arg[offset]);
+ tprints(", ");
+ printflags(access_modes, tcp->u_arg[offset + 1], "?_OK");
+}
+
+SYS_FUNC(access)
+{
+ decode_access(tcp, 0);
+ return RVAL_DECODED;
+}
+
+static void
+decode_faccessat(struct tcb *tcp)
+{
+ print_dirfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ decode_access(tcp, 1);
+}
+
+
+SYS_FUNC(faccessat)
+{
+ decode_faccessat(tcp);
+ return RVAL_DECODED;
+}
+
+SYS_FUNC(faccessat2)
+{
+ decode_faccessat(tcp);
+ tprints(", ");
+ printflags(faccessat_flags, tcp->u_arg[3], "AT_???");
+ return RVAL_DECODED;
+}
diff --git a/src/affinity.c b/src/affinity.c
new file mode 100644
index 000000000..26fe3500a
--- /dev/null
+++ b/src/affinity.c
@@ -0,0 +1,105 @@
+/*
+ * Copyright (c) 2002-2004 Roland McGrath <roland@redhat.com>
+ * Copyright (c) 2009-2018 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2014-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include <sched.h>
+
+static unsigned int
+get_cpuset_size(void)
+{
+ static unsigned int cpuset_size;
+
+ if (!cpuset_size) {
+ /*
+ * If the cpuset size passed to sched_getaffinity is less
+ * than necessary to store the bitmask, the kernel does not
+ * look at the mask pointer and fails with EINVAL.
+ *
+ * If the cpuset size is large enough, the kernel fails with
+ * EFAULT on inaccessible mask pointers.
+ *
+ * This undocumented kernel feature can be used to probe
+ * the kernel and find out the minimal valid cpuset size
+ * without allocating any memory for the CPU affinity mask.
+ */
+ cpuset_size = 128;
+ while (cpuset_size &&
+ sched_getaffinity(0, cpuset_size, NULL) == -1 &&
+ EINVAL == errno) {
+ cpuset_size <<= 1;
+ }
+ if (!cpuset_size)
+ cpuset_size = 128;
+ }
+
+ return cpuset_size;
+}
+
+static void
+print_affinitylist(struct tcb *const tcp, const kernel_ulong_t addr,
+ const unsigned int len)
+{
+ const unsigned int max_size = get_cpuset_size();
+ const unsigned int umove_size = len < max_size ? len : max_size;
+ const unsigned int size =
+ (umove_size + current_wordsize - 1) & -current_wordsize;
+ const unsigned int ncpu = size * 8;
+ void *cpu;
+
+ if (!verbose(tcp) || (exiting(tcp) && syserror(tcp)) ||
+ !addr || !len || !(cpu = calloc(size, 1))) {
+ printaddr(addr);
+ return;
+ }
+
+ if (!umoven_or_printaddr(tcp, addr, umove_size, cpu)) {
+ int i = 0;
+ const char *sep = "";
+
+ tprints("[");
+ for (;; i++) {
+ i = next_set_bit(cpu, i, ncpu);
+ if (i < 0)
+ break;
+ tprintf("%s%d", sep, i);
+ sep = ", ";
+ }
+ if (size < len)
+ tprintf("%s...", sep);
+ tprints("]");
+ }
+
+ free(cpu);
+}
+
+SYS_FUNC(sched_setaffinity)
+{
+ const int pid = tcp->u_arg[0];
+ const unsigned int len = tcp->u_arg[1];
+
+ printpid(tcp, pid, PT_TGID);
+ tprintf(", %u, ", len);
+ print_affinitylist(tcp, tcp->u_arg[2], len);
+
+ return RVAL_DECODED;
+}
+
+SYS_FUNC(sched_getaffinity)
+{
+ const int pid = tcp->u_arg[0];
+ const unsigned int len = tcp->u_arg[1];
+
+ if (entering(tcp)) {
+ printpid(tcp, pid, PT_TGID);
+ tprintf(", %u, ", len);
+ } else {
+ print_affinitylist(tcp, tcp->u_arg[2], tcp->u_rval);
+ }
+ return 0;
+}
diff --git a/src/aio.c b/src/aio.c
new file mode 100644
index 000000000..6d504369f
--- /dev/null
+++ b/src/aio.c
@@ -0,0 +1,313 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
+ * Copyright (c) 1999-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include <linux/aio_abi.h>
+
+#include "xlat/aio_cmds.h"
+
+#ifdef HAVE_STRUCT_IOCB_AIO_FLAGS
+# include "xlat/aio_iocb_flags.h"
+#endif
+
+SYS_FUNC(io_setup)
+{
+ if (entering(tcp))
+ tprintf("%u, ", (unsigned int) tcp->u_arg[0]);
+ else
+ printnum_ptr(tcp, tcp->u_arg[1]);
+ return 0;
+}
+
+SYS_FUNC(io_destroy)
+{
+ printaddr(tcp->u_arg[0]);
+
+ return RVAL_DECODED;
+}
+
+enum iocb_sub {
+ SUB_NONE, SUB_COMMON, SUB_VECTOR, SUB_POLL
+};
+
+static enum iocb_sub
+tprint_lio_opcode(unsigned int cmd)
+{
+ static const enum iocb_sub subs[] = {
+ [IOCB_CMD_PREAD] = SUB_COMMON,
+ [IOCB_CMD_PWRITE] = SUB_COMMON,
+ [IOCB_CMD_FSYNC] = SUB_NONE,
+ [IOCB_CMD_FDSYNC] = SUB_NONE,
+ [IOCB_CMD_PREADX] = SUB_NONE,
+ [IOCB_CMD_POLL] = SUB_POLL,
+ [IOCB_CMD_NOOP] = SUB_NONE,
+ [IOCB_CMD_PREADV] = SUB_VECTOR,
+ [IOCB_CMD_PWRITEV] = SUB_VECTOR,
+ };
+
+ printxval_ex(aio_cmds, cmd, "IOCB_CMD_???", XLAT_STYLE_FMT_U);
+
+ return cmd < ARRAY_SIZE(subs) ? subs[cmd] : SUB_NONE;
+}
+
+static void
+print_common_flags(struct tcb *tcp, const struct iocb *cb)
+{
+/* aio_flags and aio_resfd fields are available since v2.6.22-rc1~47 */
+#ifdef HAVE_STRUCT_IOCB_AIO_FLAGS
+ if (cb->aio_flags) {
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(*cb, aio_flags, aio_iocb_flags,
+ "IOCB_FLAG_???");
+ }
+
+ if (cb->aio_flags & IOCB_FLAG_RESFD) {
+ tprint_struct_next();
+ PRINT_FIELD_FD(*cb, aio_resfd, tcp);
+ } else if (cb->aio_resfd) {
+ tprint_struct_next();
+ PRINT_FIELD_X(*cb, aio_resfd);
+ }
+#endif
+}
+
+static bool
+iocb_is_valid(const struct iocb *cb)
+{
+ return cb->aio_buf == (unsigned long) cb->aio_buf &&
+ cb->aio_nbytes == (size_t) cb->aio_nbytes &&
+ (ssize_t) cb->aio_nbytes >= 0;
+}
+
+static enum iocb_sub
+print_iocb_header(struct tcb *tcp, const struct iocb *cb)
+{
+ enum iocb_sub sub;
+
+ PRINT_FIELD_X(*cb, aio_data);
+
+ if (cb->aio_key) {
+ tprint_struct_next();
+ PRINT_FIELD_U(*cb, aio_key);
+ }
+
+#ifndef HAVE_STRUCT_IOCB_AIO_RW_FLAGS
+# define aio_rw_flags aio_reserved1
+#endif
+ if (cb->aio_rw_flags) {
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(*cb, aio_rw_flags, rwf_flags, "RWF_???");
+ }
+
+ tprint_struct_next();
+ tprints_field_name("aio_lio_opcode");
+ sub = tprint_lio_opcode(cb->aio_lio_opcode);
+
+ if (cb->aio_flags & IOCB_FLAG_IOPRIO) {
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_U(*cb, aio_reqprio, print_ioprio);
+ } else if (cb->aio_reqprio) {
+ tprint_struct_next();
+ PRINT_FIELD_D(*cb, aio_reqprio);
+ }
+
+ tprint_struct_next();
+ PRINT_FIELD_FD(*cb, aio_fildes, tcp);
+
+ return sub;
+}
+
+static void
+print_iocb(struct tcb *tcp, const struct iocb *cb)
+{
+ tprint_struct_begin();
+
+ enum iocb_sub sub = print_iocb_header(tcp, cb);
+
+ switch (sub) {
+ case SUB_COMMON:
+ if (cb->aio_lio_opcode == 1 && iocb_is_valid(cb)) {
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_TCB_VAL(*cb, aio_buf, tcp,
+ printstrn, cb->aio_nbytes);
+ } else {
+ tprint_struct_next();
+ PRINT_FIELD_X(*cb, aio_buf);
+ }
+ tprint_struct_next();
+ PRINT_FIELD_U(*cb, aio_nbytes);
+ tprint_struct_next();
+ PRINT_FIELD_D(*cb, aio_offset);
+ print_common_flags(tcp, cb);
+ break;
+ case SUB_VECTOR:
+ if (iocb_is_valid(cb)) {
+ tprint_struct_next();
+ tprints_field_name("aio_buf");
+ tprint_iov(tcp, cb->aio_nbytes, cb->aio_buf,
+ cb->aio_lio_opcode == 8
+ ? IOV_DECODE_STR
+ : IOV_DECODE_ADDR);
+ } else {
+ tprint_struct_next();
+ PRINT_FIELD_X(*cb, aio_buf);
+ tprint_struct_next();
+ PRINT_FIELD_U(*cb, aio_nbytes);
+ }
+ tprint_struct_next();
+ PRINT_FIELD_D(*cb, aio_offset);
+ print_common_flags(tcp, cb);
+ break;
+ case SUB_POLL:
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(*cb, aio_buf, pollflags, "POLL???");
+ print_common_flags(tcp, cb);
+ break;
+ case SUB_NONE:
+ break;
+ }
+
+ tprint_struct_end();
+}
+
+static bool
+print_iocbp(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data)
+{
+ kernel_ulong_t addr;
+ struct iocb cb;
+
+ if (elem_size < sizeof(kernel_ulong_t)) {
+ addr = *(unsigned int *) elem_buf;
+ } else {
+ addr = *(kernel_ulong_t *) elem_buf;
+ }
+
+ if (!umove_or_printaddr(tcp, addr, &cb))
+ print_iocb(tcp, &cb);
+
+ return true;
+}
+
+SYS_FUNC(io_submit)
+{
+ const kernel_long_t nr =
+ truncate_klong_to_current_wordsize(tcp->u_arg[1]);
+ const kernel_ulong_t addr = tcp->u_arg[2];
+ kernel_ulong_t iocbp;
+
+ printaddr(tcp->u_arg[0]);
+ tprintf(", %" PRI_kld ", ", nr);
+
+ if (nr < 0)
+ printaddr(addr);
+ else
+ print_array(tcp, addr, nr, &iocbp, current_wordsize,
+ tfetch_mem, print_iocbp, 0);
+
+ return RVAL_DECODED;
+}
+
+static bool
+print_io_event(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data)
+{
+ struct io_event *event = elem_buf;
+
+ tprint_struct_begin();
+ PRINT_FIELD_X(*event, data);
+ tprint_struct_next();
+ PRINT_FIELD_X(*event, obj);
+ tprint_struct_next();
+ PRINT_FIELD_D(*event, res);
+ tprint_struct_next();
+ PRINT_FIELD_D(*event, res2);
+ tprint_struct_end();
+
+ return true;
+}
+
+SYS_FUNC(io_cancel)
+{
+ if (entering(tcp)) {
+ printaddr(tcp->u_arg[0]);
+ tprints(", ");
+
+ struct iocb cb;
+
+ if (!umove_or_printaddr(tcp, tcp->u_arg[1], &cb)) {
+ tprint_struct_begin();
+ print_iocb_header(tcp, &cb);
+ tprint_struct_end();
+ }
+ tprints(", ");
+ } else {
+ struct io_event event;
+
+ if (!umove_or_printaddr(tcp, tcp->u_arg[2], &event))
+ print_io_event(tcp, &event, sizeof(event), 0);
+ }
+ return 0;
+}
+
+static int
+print_io_getevents(struct tcb *const tcp, const print_obj_by_addr_fn print_ts,
+ const bool has_usig)
+{
+ if (entering(tcp)) {
+ printaddr(tcp->u_arg[0]);
+ tprintf(", %" PRI_kld ", %" PRI_kld ", ",
+ truncate_klong_to_current_wordsize(tcp->u_arg[1]),
+ truncate_klong_to_current_wordsize(tcp->u_arg[2]));
+ } else {
+ struct io_event buf;
+ print_array(tcp, tcp->u_arg[3], tcp->u_rval, &buf, sizeof(buf),
+ tfetch_mem, print_io_event, 0);
+ tprints(", ");
+ /*
+ * Since the timeout and usig parameters are read by the kernel
+ * on entering syscall, it has to be decoded the same way
+ * whether the syscall has failed or not.
+ */
+ temporarily_clear_syserror(tcp);
+ print_ts(tcp, tcp->u_arg[4]);
+ if (has_usig) {
+ tprints(", ");
+ print_kernel_sigset(tcp, tcp->u_arg[5]);
+ }
+ restore_cleared_syserror(tcp);
+ }
+ return 0;
+}
+
+#if HAVE_ARCH_TIME32_SYSCALLS
+SYS_FUNC(io_getevents_time32)
+{
+ return print_io_getevents(tcp, print_timespec32, false);
+}
+#endif
+
+#if HAVE_ARCH_OLD_TIME64_SYSCALLS
+SYS_FUNC(io_getevents_time64)
+{
+ return print_io_getevents(tcp, print_timespec64, false);
+}
+#endif
+
+#if HAVE_ARCH_TIME32_SYSCALLS
+SYS_FUNC(io_pgetevents_time32)
+{
+ return print_io_getevents(tcp, print_timespec32, true);
+}
+#endif
+
+SYS_FUNC(io_pgetevents_time64)
+{
+ return print_io_getevents(tcp, print_timespec64, true);
+}
diff --git a/src/alpha.c b/src/alpha.c
new file mode 100644
index 000000000..e6a3f75ae
--- /dev/null
+++ b/src/alpha.c
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2016 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2016-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#ifdef ALPHA
+
+# include "xstring.h"
+
+static int
+decode_getxxid(struct tcb *tcp, const char *what)
+{
+ if (entering(tcp))
+ return 0;
+
+ long rval = getrval2(tcp);
+ if (rval == -1)
+ return 0;
+ static const char const fmt[] = "%s %ld";
+ static char outstr[sizeof(fmt) + 3 * sizeof(rval)];
+ xsprintf(outstr, fmt, what, rval);
+ tcp->auxstr = outstr;
+ return RVAL_STR;
+}
+
+SYS_FUNC(getxpid)
+{
+ return decode_getxxid(tcp, "ppid");
+}
+
+SYS_FUNC(getxuid)
+{
+ return decode_getxxid(tcp, "euid");
+}
+
+SYS_FUNC(getxgid)
+{
+ return decode_getxxid(tcp, "egid");
+}
+
+SYS_FUNC(osf_statfs)
+{
+ printpath(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ printaddr(tcp->u_arg[1]);
+ tprints(", ");
+ tprintf("%lu", tcp->u_arg[2]);
+ return RVAL_DECODED;
+}
+
+SYS_FUNC(osf_fstatfs)
+{
+ printfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ printaddr(tcp->u_arg[1]);
+ tprints(", ");
+ tprintf("%lu", tcp->u_arg[2]);
+ return RVAL_DECODED;
+}
+
+#endif /* ALPHA */
diff --git a/src/arch_defs.h b/src/arch_defs.h
new file mode 100644
index 000000000..02aa6cca1
--- /dev/null
+++ b/src/arch_defs.h
@@ -0,0 +1,15 @@
+/*
+ * Copyright (c) 2018 Dmitry V. Levin <ldv@strace.io>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+/* Architecture-specific definitions. */
+#ifndef STRACE_ARCH_DEFS_H
+# define STRACE_ARCH_DEFS_H
+
+# include "arch_defs_.h"
+# include "linux/arch_defs_.h"
+
+#endif /* !STRACE_ARCH_DEFS_H */
diff --git a/src/basic_filters.c b/src/basic_filters.c
new file mode 100644
index 000000000..371338278
--- /dev/null
+++ b/src/basic_filters.c
@@ -0,0 +1,387 @@
+/*
+ * Copyright (c) 2016 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2016-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#include <regex.h>
+
+#include "filter.h"
+#include "number_set.h"
+#include "xstring.h"
+
+
+/**
+ * Checks whether a @-separated personality specification suffix is present.
+ * Personality suffix is a one of strings stored in personality_designators
+ * array.
+ *
+ * @param[in] s Specification string to check.
+ * @param[out] p Where to store personality number if it is found.
+ * @return If personality is found, the provided string is copied without
+ * suffix and returned as a result (callee should de-alllocate it
+ * with free() after use), and personality number is written to p.
+ * Otherwise, NULL is returned and p is untouched.
+ */
+static char *
+qualify_syscall_separate_personality(const char *s, unsigned int *p)
+{
+ char *pos = strchr(s, '@');
+
+ if (!pos)
+ return NULL;
+
+ for (unsigned int i = 0; i < SUPPORTED_PERSONALITIES; i++) {
+ if (!strcmp(pos + 1, personality_designators[i])) {
+ *p = i;
+ return xstrndup(s, pos - s);
+ }
+ }
+
+ error_msg_and_help("incorrect personality designator '%s'"
+ " in qualification '%s'", pos + 1, s);
+}
+
+static bool
+qualify_syscall_number_personality(int n, unsigned int p,
+ struct number_set *set)
+{
+ if ((unsigned int) n >= nsyscall_vec[p])
+ return false;
+
+ add_number_to_set_array(n, set, p);
+
+ return true;
+}
+
+static bool
+qualify_syscall_number(const char *s, struct number_set *set)
+{
+ unsigned int p;
+ char *num_str = qualify_syscall_separate_personality(s, &p);
+ int n;
+
+ if (num_str) {
+ n = string_to_uint(num_str);
+ free(num_str);
+
+ if (n < 0)
+ return false;
+
+ return qualify_syscall_number_personality(n, p, set);
+ }
+
+ n = string_to_uint(s);
+ if (n < 0)
+ return false;
+
+ bool done = false;
+
+ for (p = 0; p < SUPPORTED_PERSONALITIES; ++p)
+ done |= qualify_syscall_number_personality(n, p, set);
+
+ return done;
+}
+
+static void
+regerror_msg_and_die(int errcode, const regex_t *preg,
+ const char *str, const char *pattern)
+{
+ char buf[512];
+
+ regerror(errcode, preg, buf, sizeof(buf));
+ error_msg_and_die("%s: %s: %s", str, pattern, buf);
+}
+
+static bool
+qualify_syscall_regex(const char *s, struct number_set *set)
+{
+ regex_t preg;
+ int rc;
+
+ if ((rc = regcomp(&preg, s, REG_EXTENDED | REG_NOSUB)) != 0)
+ regerror_msg_and_die(rc, &preg, "regcomp", s);
+
+ bool found = false;
+
+ for (unsigned int p = 0; p < SUPPORTED_PERSONALITIES; ++p) {
+ for (unsigned int i = 0; i < nsyscall_vec[p]; ++i) {
+ if (!sysent_vec[p][i].sys_name)
+ continue;
+
+ rc = regexec(&preg, sysent_vec[p][i].sys_name,
+ 0, NULL, 0);
+
+ if (rc == REG_NOMATCH) {
+ char name_buf[128];
+ char *pos = stpcpy(name_buf,
+ sysent_vec[p][i].sys_name);
+
+ (void) xappendstr(name_buf, pos, "@%s",
+ personality_designators[p]);
+
+ rc = regexec(&preg, name_buf, 0, NULL, 0);
+ }
+
+ if (rc == REG_NOMATCH)
+ continue;
+ else if (rc)
+ regerror_msg_and_die(rc, &preg, "regexec", s);
+
+ add_number_to_set_array(i, set, p);
+ found = true;
+ }
+ }
+
+ regfree(&preg);
+ return found;
+}
+
+static unsigned int
+lookup_class(const char *s)
+{
+ static const struct {
+ const char *name;
+ unsigned int value;
+ } syscall_class[] = {
+ { "%desc", TRACE_DESC },
+ { "%file", TRACE_FILE },
+ { "%memory", TRACE_MEMORY },
+ { "%process", TRACE_PROCESS },
+ { "%creds", TRACE_CREDS },
+ { "%signal", TRACE_SIGNAL },
+ { "%ipc", TRACE_IPC },
+ { "%net", TRACE_NETWORK },
+ { "%network", TRACE_NETWORK },
+ { "%stat", TRACE_STAT },
+ { "%lstat", TRACE_LSTAT },
+ { "%fstat", TRACE_FSTAT },
+ { "%%stat", TRACE_STAT_LIKE },
+ { "%statfs", TRACE_STATFS },
+ { "%fstatfs", TRACE_FSTATFS },
+ { "%%statfs", TRACE_STATFS_LIKE },
+ { "%pure", TRACE_PURE },
+ { "%clock", TRACE_CLOCK },
+ /* legacy class names */
+ { "desc", TRACE_DESC },
+ { "file", TRACE_FILE },
+ { "memory", TRACE_MEMORY },
+ { "process", TRACE_PROCESS },
+ { "signal", TRACE_SIGNAL },
+ { "ipc", TRACE_IPC },
+ { "network", TRACE_NETWORK },
+ };
+
+ for (unsigned int i = 0; i < ARRAY_SIZE(syscall_class); ++i) {
+ if (strcmp(s, syscall_class[i].name) == 0)
+ return syscall_class[i].value;
+ }
+
+ return 0;
+}
+
+static bool
+qualify_syscall_class(const char *s, struct number_set *set)
+{
+ const unsigned int n = lookup_class(s);
+ if (!n)
+ return false;
+
+ for (unsigned int p = 0; p < SUPPORTED_PERSONALITIES; ++p) {
+ for (unsigned int i = 0; i < nsyscall_vec[p]; ++i) {
+ if (sysent_vec[p][i].sys_name &&
+ (sysent_vec[p][i].sys_flags & n) == n)
+ add_number_to_set_array(i, set, p);
+ }
+ }
+
+ return true;
+}
+
+kernel_long_t
+scno_by_name(const char *s, unsigned int p, kernel_long_t start)
+{
+ if (p >= SUPPORTED_PERSONALITIES)
+ return -1;
+
+ for (kernel_ulong_t i = start; i < nsyscall_vec[p]; ++i) {
+ if (sysent_vec[p][i].sys_name &&
+ strcmp(s, sysent_vec[p][i].sys_name) == 0)
+ return i;
+ }
+
+ return -1;
+}
+
+static bool
+qualify_syscall_name_personality(const char *s, unsigned int p,
+ struct number_set *set)
+{
+ bool found = false;
+
+ for (kernel_long_t scno = 0; (scno = scno_by_name(s, p, scno)) >= 0;
+ ++scno) {
+ add_number_to_set_array(scno, set, p);
+ found = true;
+ }
+
+ return found;
+}
+
+static bool
+qualify_syscall_name(const char *s, struct number_set *set)
+{
+ unsigned int p;
+ char *name_str = qualify_syscall_separate_personality(s, &p);
+ bool found = false;
+
+ if (name_str) {
+ found = qualify_syscall_name_personality(name_str, p, set);
+ free(name_str);
+
+ return found;
+ }
+
+ for (p = 0; p < SUPPORTED_PERSONALITIES; ++p)
+ found |= qualify_syscall_name_personality(s, p, set);
+
+ return found;
+}
+
+static bool
+qualify_syscall(const char *token, struct number_set *set)
+{
+ bool ignore_fail = false;
+
+ while (*token == '?') {
+ token++;
+ ignore_fail = true;
+ }
+ if (*token >= '0' && *token <= '9')
+ return qualify_syscall_number(token, set) || ignore_fail;
+ if (*token == '/')
+ return qualify_syscall_regex(token + 1, set) || ignore_fail;
+ return qualify_syscall_class(token, set)
+ || qualify_syscall_name(token, set)
+ || ignore_fail;
+}
+
+/*
+ * Add syscall numbers to SETs for each supported personality
+ * according to STR specification.
+ */
+void
+qualify_syscall_tokens(const char *const str, struct number_set *const set)
+{
+ /* Clear all sets. */
+ clear_number_set_array(set, SUPPORTED_PERSONALITIES);
+
+ /*
+ * Each leading ! character means inversion
+ * of the remaining specification.
+ */
+ const char *s = str;
+ while (*s == '!') {
+ invert_number_set_array(set, SUPPORTED_PERSONALITIES);
+ ++s;
+ }
+
+ if (strcmp(s, "none") == 0) {
+ /*
+ * No syscall numbers are added to sets.
+ * Subsequent is_number_in_set* invocations
+ * will return set[p]->not.
+ */
+ return;
+ } else if (strcmp(s, "all") == 0) {
+ /* "all" == "!none" */
+ invert_number_set_array(set, SUPPORTED_PERSONALITIES);
+ return;
+ }
+
+ /*
+ * Split the string into comma separated tokens.
+ * For each token, call qualify_syscall that will take care
+ * if adding appropriate syscall numbers to sets.
+ * The absence of tokens or a negative return code
+ * from qualify_syscall is a fatal error.
+ */
+ char *copy = xstrdup(s);
+ char *saveptr = NULL;
+ bool done = false;
+
+ for (const char *token = strtok_r(copy, ",", &saveptr);
+ token; token = strtok_r(NULL, ",", &saveptr)) {
+ done = qualify_syscall(token, set);
+ if (!done)
+ error_msg_and_die("invalid system call '%s'", token);
+ }
+
+ free(copy);
+
+ if (!done)
+ error_msg_and_die("invalid system call '%s'", str);
+}
+
+/*
+ * Add numbers to SET according to STR specification.
+ */
+void
+qualify_tokens(const char *const str, struct number_set *const set,
+ string_to_uint_func func, const char *const name)
+{
+ /* Clear the set. */
+ clear_number_set_array(set, 1);
+
+ /*
+ * Each leading ! character means inversion
+ * of the remaining specification.
+ */
+ const char *s = str;
+ while (*s == '!') {
+ invert_number_set_array(set, 1);
+ ++s;
+ }
+
+ if (strcmp(s, "none") == 0) {
+ /*
+ * No numbers are added to the set.
+ * Subsequent is_number_in_set* invocations
+ * will return set->not.
+ */
+ return;
+ } else if (strcmp(s, "all") == 0) {
+ /* "all" == "!none" */
+ invert_number_set_array(set, 1);
+ return;
+ }
+
+ /*
+ * Split the string into comma separated tokens.
+ * For each token, find out the corresponding number
+ * by calling FUNC, and add that number to the set.
+ * The absence of tokens or a negative answer
+ * from FUNC is a fatal error.
+ */
+ char *copy = xstrdup(s);
+ char *saveptr = NULL;
+ int number = -1;
+
+ for (const char *token = strtok_r(copy, ",", &saveptr);
+ token; token = strtok_r(NULL, ",", &saveptr)) {
+ number = func(token);
+ if (number < 0)
+ error_msg_and_die("invalid %s '%s'", name, token);
+
+ add_number_to_set(number, set);
+ }
+
+ free(copy);
+
+ if (number < 0)
+ error_msg_and_die("invalid %s '%s'", name, str);
+}
diff --git a/src/bind.c b/src/bind.c
new file mode 100644
index 000000000..ff773fd91
--- /dev/null
+++ b/src/bind.c
@@ -0,0 +1,23 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1996-2000 Wichert Akkerman <wichert@cistron.nl>
+ * Copyright (c) 1999-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+SYS_FUNC(bind)
+{
+ printfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ const int addrlen = tcp->u_arg[2];
+ decode_sockaddr(tcp, tcp->u_arg[1], addrlen);
+ tprintf(", %d", addrlen);
+
+ return RVAL_DECODED;
+}
diff --git a/src/bjm.c b/src/bjm.c
new file mode 100644
index 000000000..fb5af8bda
--- /dev/null
+++ b/src/bjm.c
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
+ * Copyright (c) 1999-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include <fcntl.h>
+
+#include "xlat/delete_module_flags.h"
+
+SYS_FUNC(delete_module)
+{
+ printstr(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ printflags(delete_module_flags, tcp->u_arg[1], "O_???");
+
+ return RVAL_DECODED;
+}
+
+SYS_FUNC(init_module)
+{
+ printaddr(tcp->u_arg[0]);
+ tprintf(", %" PRI_klu ", ", tcp->u_arg[1]);
+ printstr(tcp, tcp->u_arg[2]);
+
+ return RVAL_DECODED;
+}
+
+#include "xlat/module_init_flags.h"
+
+SYS_FUNC(finit_module)
+{
+ /* file descriptor */
+ printfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ /* param_values */
+ printstr(tcp, tcp->u_arg[1]);
+ tprints(", ");
+ /* flags */
+ printflags(module_init_flags, tcp->u_arg[2], "MODULE_INIT_???");
+
+ return RVAL_DECODED;
+}
diff --git a/src/block.c b/src/block.c
new file mode 100644
index 000000000..2502bbbb0
--- /dev/null
+++ b/src/block.c
@@ -0,0 +1,220 @@
+/*
+ * Copyright (c) 2009, 2010 Jeff Mahoney <jeffm@suse.com>
+ * Copyright (c) 2011-2016 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2011-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#include DEF_MPERS_TYPE(struct_blk_user_trace_setup)
+#include DEF_MPERS_TYPE(struct_blkpg_ioctl_arg)
+#include DEF_MPERS_TYPE(struct_blkpg_partition)
+
+#include <linux/ioctl.h>
+#include <linux/fs.h>
+
+typedef struct {
+ int op;
+ int flags;
+ int datalen;
+ void *data;
+} struct_blkpg_ioctl_arg;
+
+#define BLKPG_DEVNAMELTH 64
+#define BLKPG_VOLNAMELTH 64
+typedef struct {
+ int64_t start; /* starting offset in bytes */
+ int64_t length; /* length in bytes */
+ int pno; /* partition number */
+ char devname[BLKPG_DEVNAMELTH]; /* partition name, like sda5 or c0d1p2,
+ to be used in kernel messages */
+ char volname[BLKPG_VOLNAMELTH]; /* volume label */
+} struct_blkpg_partition;
+
+#define BLKTRACE_BDEV_SIZE 32
+typedef struct blk_user_trace_setup {
+ char name[BLKTRACE_BDEV_SIZE]; /* output */
+ uint16_t act_mask; /* input */
+ uint32_t buf_size; /* input */
+ uint32_t buf_nr; /* input */
+ uint64_t start_lba;
+ uint64_t end_lba;
+ uint32_t pid;
+} struct_blk_user_trace_setup;
+
+/* Provide fall-back definitions for BLK* ioctls */
+#define XLAT_MACROS_ONLY
+#include "xlat/block_ioctl_cmds.h"
+#undef XLAT_MACROS_ONLY
+
+#include MPERS_DEFS
+
+#include "xlat/blkpg_ops.h"
+
+static void
+print_blkpg_req(struct tcb *tcp, const struct_blkpg_ioctl_arg *blkpg)
+{
+ struct_blkpg_partition p;
+
+ tprint_struct_begin();
+ PRINT_FIELD_XVAL(*blkpg, op, blkpg_ops, "BLKPG_???");
+ tprint_struct_next();
+ PRINT_FIELD_D(*blkpg, flags);
+ tprint_struct_next();
+ PRINT_FIELD_D(*blkpg, datalen);
+
+ tprint_struct_next();
+ tprints_field_name("data");
+ if (!umove_or_printaddr(tcp, ptr_to_kulong(blkpg->data), &p)) {
+ tprint_struct_begin();
+ PRINT_FIELD_D(p, start);
+ tprint_struct_next();
+ PRINT_FIELD_D(p, length);
+ tprint_struct_next();
+ PRINT_FIELD_D(p, pno);
+ tprint_struct_next();
+ PRINT_FIELD_CSTRING(p, devname);
+ tprint_struct_next();
+ PRINT_FIELD_CSTRING(p, volname);
+ tprint_struct_end();
+ }
+ tprint_struct_end();
+}
+
+MPERS_PRINTER_DECL(int, block_ioctl, struct tcb *const tcp,
+ const unsigned int code, const kernel_ulong_t arg)
+{
+ switch (code) {
+ /* take arg as a value, not as a pointer */
+ case BLKRASET:
+ case BLKFRASET:
+ tprintf(", %" PRI_klu, arg);
+ break;
+
+ /* return an unsigned short */
+ case BLKSECTGET:
+ case BLKROTATIONAL:
+ if (entering(tcp))
+ return 0;
+ tprints(", ");
+ printnum_short(tcp, arg, "%hu");
+ break;
+
+ /* return a signed int */
+ case BLKROGET:
+ case BLKBSZGET:
+ case BLKSSZGET:
+ case BLKALIGNOFF:
+ if (entering(tcp))
+ return 0;
+ ATTRIBUTE_FALLTHROUGH;
+ /* take a signed int */
+ case BLKROSET:
+ case BLKBSZSET:
+ tprints(", ");
+ printnum_int(tcp, arg, "%d");
+ break;
+
+ /* return an unsigned int */
+ case BLKPBSZGET:
+ case BLKIOMIN:
+ case BLKIOOPT:
+ case BLKDISCARDZEROES:
+ case BLKGETZONESZ:
+ case BLKGETNRZONES:
+ if (entering(tcp))
+ return 0;
+ tprints(", ");
+ printnum_int(tcp, arg, "%u");
+ break;
+
+ /* return a signed long */
+ case BLKRAGET:
+ case BLKFRAGET:
+ if (entering(tcp))
+ return 0;
+ tprints(", ");
+ printnum_slong(tcp, arg);
+ break;
+
+ /* returns an unsigned long */
+ case BLKGETSIZE:
+ if (entering(tcp))
+ return 0;
+ tprints(", ");
+ printnum_ulong(tcp, arg);
+ break;
+
+ /* returns an uint64_t */
+ case BLKGETSIZE64:
+ if (entering(tcp))
+ return 0;
+ tprints(", ");
+ printnum_int64(tcp, arg, "%" PRIu64);
+ break;
+
+ /* takes a pair of uint64_t */
+ case BLKDISCARD:
+ case BLKSECDISCARD:
+ case BLKZEROOUT:
+ tprints(", ");
+ printpair_int64(tcp, arg, "%" PRIu64);
+ break;
+
+ /* More complex types */
+ case BLKPG: {
+ struct_blkpg_ioctl_arg blkpg;
+
+ tprints(", ");
+ if (!umove_or_printaddr(tcp, arg, &blkpg))
+ print_blkpg_req(tcp, &blkpg);
+ break;
+ }
+
+ case BLKTRACESETUP:
+ if (entering(tcp)) {
+ struct_blk_user_trace_setup buts;
+
+ tprints(", ");
+ if (umove_or_printaddr(tcp, arg, &buts))
+ break;
+ tprint_struct_begin();
+ PRINT_FIELD_U(buts, act_mask);
+ tprint_struct_next();
+ PRINT_FIELD_U(buts, buf_size);
+ tprint_struct_next();
+ PRINT_FIELD_U(buts, buf_nr);
+ tprint_struct_next();
+ PRINT_FIELD_U(buts, start_lba);
+ tprint_struct_next();
+ PRINT_FIELD_U(buts, end_lba);
+ tprint_struct_next();
+ PRINT_FIELD_TGID(buts, pid, tcp);
+ return 0;
+ } else {
+ struct_blk_user_trace_setup buts;
+
+ if (!syserror(tcp) && !umove(tcp, arg, &buts)) {
+ tprint_struct_next();
+ PRINT_FIELD_CSTRING(buts, name);
+ }
+ tprint_struct_end();
+ break;
+ }
+
+ /* No arguments */
+ case BLKRRPART:
+ case BLKFLSBUF:
+ case BLKTRACESTART:
+ case BLKTRACESTOP:
+ case BLKTRACETEARDOWN:
+ break;
+ default:
+ return RVAL_DECODED;
+ }
+
+ return RVAL_IOCTL_DECODED;
+}
diff --git a/src/bpf.c b/src/bpf.c
new file mode 100644
index 000000000..0c503f054
--- /dev/null
+++ b/src/bpf.c
@@ -0,0 +1,1365 @@
+/*
+ * Copyright (c) 2015-2017 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2017 Quentin Monnet <quentin.monnet@6wind.com>
+ * Copyright (c) 2015-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#ifdef HAVE_LINUX_BPF_H
+# include <linux/bpf.h>
+#endif
+#include <linux/filter.h>
+
+#include "bpf_attr.h"
+
+#include "xlat/bpf_commands.h"
+#include "xlat/bpf_file_mode_flags.h"
+#include "xlat/bpf_map_types.h"
+#include "xlat/bpf_map_flags.h"
+#include "xlat/bpf_prog_types.h"
+#include "xlat/bpf_prog_flags.h"
+#include "xlat/bpf_map_lookup_elem_flags.h"
+#include "xlat/bpf_map_update_elem_flags.h"
+#include "xlat/bpf_attach_type.h"
+#include "xlat/bpf_attach_flags.h"
+#include "xlat/bpf_query_flags.h"
+#include "xlat/bpf_task_fd_type.h"
+#include "xlat/ebpf_regs.h"
+#include "xlat/numa_node.h"
+
+#define DECL_BPF_CMD_DECODER(bpf_cmd_decoder) \
+int \
+bpf_cmd_decoder(struct tcb *const tcp, \
+ const kernel_ulong_t addr, \
+ const unsigned int size, \
+ void *const data) \
+/* End of DECL_BPF_CMD_DECODER definition. */
+
+#define BEGIN_BPF_CMD_DECODER(bpf_cmd) \
+ static DECL_BPF_CMD_DECODER(decode_ ## bpf_cmd) \
+ { \
+ struct bpf_cmd ## _struct attr = {}; \
+ const size_t attr_size = bpf_cmd ## _struct_size; \
+ const unsigned int len = MIN(size, attr_size); \
+ memcpy(&attr, data, len); \
+ do { \
+/* End of BEGIN_BPF_CMD_DECODER definition. */
+
+#define END_BPF_CMD_DECODER(rval) \
+ decode_attr_extra_data(tcp, data, size, attr_size); \
+ } while (0); \
+ tprint_struct_end(); \
+ return (rval); \
+ } \
+/* End of END_BPF_CMD_DECODER definition. */
+
+#define BPF_CMD_ENTRY(bpf_cmd) \
+ [bpf_cmd] = decode_ ## bpf_cmd
+
+typedef DECL_BPF_CMD_DECODER((*bpf_cmd_decoder_t));
+
+/*
+ * A note about bpf syscall decoder: it doesn't perform any size sanity checks,
+ * so even if it leads to partial copying of one of the fields, the command
+ * handler will still use the (partially-copied-from-userspace, partially
+ * zeroed) field value. That's why we stop decoding and check for known sizes
+ * that correspond to released versions of the structure used by the specific
+ * command - it looks like the most sensible way to parse this insanity.
+ */
+
+static int
+decode_attr_extra_data(struct tcb *const tcp,
+ const char *data,
+ unsigned int size,
+ const size_t attr_size)
+{
+ if (size <= attr_size)
+ return 0;
+
+ data += attr_size;
+ size -= attr_size;
+
+ unsigned int i;
+ for (i = 0; i < size; ++i) {
+ if (data[i]) {
+ tprints(", ");
+ if (abbrev(tcp)) {
+ tprint_more_data_follows();
+ } else {
+ tprintf("/* bytes %zu..%zu */ ",
+ attr_size, attr_size + size - 1);
+ print_quoted_string(data, size,
+ QUOTE_FORCE_HEX);
+ }
+ return RVAL_DECODED;
+ }
+ }
+
+ return 0;
+}
+
+struct ebpf_insn {
+ uint8_t code;
+ uint8_t dst_reg:4;
+ uint8_t src_reg:4;
+ int16_t off;
+ int32_t imm;
+};
+
+struct ebpf_insns_data {
+ unsigned int count;
+};
+
+static bool
+print_ebpf_insn(struct tcb * const tcp, void * const elem_buf,
+ const size_t elem_size, void * const data)
+{
+ struct ebpf_insns_data *eid = data;
+ struct ebpf_insn *insn = elem_buf;
+
+ if (eid->count++ >= BPF_MAXINSNS) {
+ tprint_more_data_follows();
+ return false;
+ }
+
+ tprint_struct_begin();
+ PRINT_FIELD_OBJ_VAL(*insn, code, print_bpf_filter_code, true);
+
+ /* We can't use PRINT_FIELD_XVAL on bit fields */
+ tprint_struct_next();
+ tprints_field_name("dst_reg");
+ printxval(ebpf_regs, insn->dst_reg, "BPF_REG_???");
+ tprint_struct_next();
+ tprints_field_name("src_reg");
+ printxval(ebpf_regs, insn->src_reg, "BPF_REG_???");
+
+ tprint_struct_next();
+ PRINT_FIELD_D(*insn, off);
+ tprint_struct_next();
+ PRINT_FIELD_X(*insn, imm);
+ tprint_struct_end();
+
+ return true;
+}
+
+static void
+print_ebpf_prog(struct tcb *const tcp, const uint64_t addr, const uint32_t len)
+{
+ print_big_u64_addr(addr);
+ if (abbrev(tcp)) {
+ printaddr(addr);
+ } else {
+ struct ebpf_insns_data eid = {};
+ struct ebpf_insn insn;
+
+ print_array(tcp, addr, len, &insn, sizeof(insn),
+ tfetch_mem, print_ebpf_insn, &eid);
+ }
+}
+
+BEGIN_BPF_CMD_DECODER(BPF_MAP_CREATE)
+{
+ tprint_struct_begin();
+ PRINT_FIELD_XVAL(attr, map_type, bpf_map_types, "BPF_MAP_TYPE_???");
+ tprint_struct_next();
+ PRINT_FIELD_U(attr, key_size);
+ tprint_struct_next();
+ PRINT_FIELD_U(attr, value_size);
+ tprint_struct_next();
+ PRINT_FIELD_U(attr, max_entries);
+
+ /* map_flags field was added in Linux commit v4.6-rc1~91^2~108^2~6. */
+ if (len <= offsetof(struct BPF_MAP_CREATE_struct, map_flags))
+ break;
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(attr, map_flags, bpf_map_flags, "BPF_F_???");
+
+ /*
+ * inner_map_fd field was added in Linux commit
+ * v4.12-rc1~64^3~373^2~2.
+ */
+ if (len <= offsetof(struct BPF_MAP_CREATE_struct, inner_map_fd))
+ break;
+ tprint_struct_next();
+ PRINT_FIELD_FD(attr, inner_map_fd, tcp);
+
+ /* numa_node field was added in Linux commit v4.14-rc1~130^2~196^2~1. */
+ if (len <= offsetof(struct BPF_MAP_CREATE_struct, numa_node))
+ break;
+ if (attr.map_flags & BPF_F_NUMA_NODE) {
+ /*
+ * Kernel uses the value of -1 as a designation for "no NUMA
+ * node specified", and even uses NUMA_NO_NODE constant;
+ * however, the constant definition is not a part of UAPI
+ * headers, thus we can't simply print this named constant
+ * instead of the value. Let's force verbose xlat style instead
+ * in order to provide the information for the user while
+ * not hampering the availability to derive the actual value
+ * without the access to the kernel headers.
+ */
+ tprint_struct_next();
+ tprints_field_name("numa_node");
+ printxvals_ex(attr.numa_node, NULL,
+ XLAT_STYLE_FMT_U | XLAT_STYLE_VERBOSE,
+ numa_node, NULL);
+ }
+
+ /* map_name field was added in Linux commit v4.15-rc1~84^2~605^2~3. */
+ if (len <= offsetof(struct BPF_MAP_CREATE_struct, map_name))
+ break;
+ tprint_struct_next();
+ PRINT_FIELD_CSTRING_SZ(attr, map_name,
+ MIN(sizeof(attr.map_name),
+ len - offsetof(struct BPF_MAP_CREATE_struct,
+ map_name)));
+
+ /*
+ * map_ifindex field was added in Linux commit
+ * v4.16-rc1~123^2~145^2~5^2~8.
+ */
+ if (len <= offsetof(struct BPF_MAP_CREATE_struct, map_ifindex))
+ break;
+ tprint_struct_next();
+ PRINT_FIELD_IFINDEX(attr, map_ifindex);
+
+ /*
+ * The following three fields were introduced by Linux commits
+ * v4.18-rc1~114^2~417^2~1^2~3 and v4.18-rc1~114^2~148^2~7^2~2.
+ */
+ if (len <= offsetof(struct BPF_MAP_CREATE_struct, btf_fd))
+ break;
+ tprint_struct_next();
+ PRINT_FIELD_FD(attr, btf_fd, tcp);
+ tprint_struct_next();
+ PRINT_FIELD_U(attr, btf_key_type_id);
+ tprint_struct_next();
+ PRINT_FIELD_U(attr, btf_value_type_id);
+
+ /*
+ * The following field was introduced by Linux commit
+ * v5.6-rc1~151^2~46^2~37^2~5.
+ */
+ if (len <= offsetof(struct BPF_MAP_CREATE_struct, btf_vmlinux_value_type_id))
+ break;
+ tprint_struct_next();
+ PRINT_FIELD_U(attr, btf_vmlinux_value_type_id);
+}
+END_BPF_CMD_DECODER(RVAL_DECODED | RVAL_FD)
+
+BEGIN_BPF_CMD_DECODER(BPF_MAP_LOOKUP_ELEM)
+{
+ tprint_struct_begin();
+ PRINT_FIELD_FD(attr, map_fd, tcp);
+ tprint_struct_next();
+ PRINT_FIELD_ADDR64(attr, key);
+ tprint_struct_next();
+ PRINT_FIELD_ADDR64(attr, value);
+ /* flags field was added in Linux commit v5.1-rc1~178^2~375^2~4^2~3. */
+ if (len <= offsetof(struct BPF_MAP_LOOKUP_ELEM_struct, flags))
+ break;
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(attr, flags, bpf_map_lookup_elem_flags, "BPF_???");
+}
+END_BPF_CMD_DECODER(RVAL_DECODED)
+
+#define decode_BPF_MAP_LOOKUP_AND_DELETE_ELEM decode_BPF_MAP_LOOKUP_ELEM
+
+BEGIN_BPF_CMD_DECODER(BPF_MAP_UPDATE_ELEM)
+{
+ tprint_struct_begin();
+ PRINT_FIELD_FD(attr, map_fd, tcp);
+ tprint_struct_next();
+ PRINT_FIELD_ADDR64(attr, key);
+ tprint_struct_next();
+ PRINT_FIELD_ADDR64(attr, value);
+ tprint_struct_next();
+ PRINT_FIELD_XVAL(attr, flags, bpf_map_update_elem_flags, "BPF_???");
+}
+END_BPF_CMD_DECODER(RVAL_DECODED)
+
+BEGIN_BPF_CMD_DECODER(BPF_MAP_DELETE_ELEM)
+{
+ tprint_struct_begin();
+ PRINT_FIELD_FD(attr, map_fd, tcp);
+ tprint_struct_next();
+ PRINT_FIELD_ADDR64(attr, key);
+}
+END_BPF_CMD_DECODER(RVAL_DECODED)
+
+BEGIN_BPF_CMD_DECODER(BPF_MAP_GET_NEXT_KEY)
+{
+ tprint_struct_begin();
+ PRINT_FIELD_FD(attr, map_fd, tcp);
+ tprint_struct_next();
+ PRINT_FIELD_ADDR64(attr, key);
+ tprint_struct_next();
+ PRINT_FIELD_ADDR64(attr, next_key);
+}
+END_BPF_CMD_DECODER(RVAL_DECODED)
+
+BEGIN_BPF_CMD_DECODER(BPF_MAP_FREEZE)
+{
+ tprint_struct_begin();
+ PRINT_FIELD_FD(attr, map_fd, tcp);
+}
+END_BPF_CMD_DECODER(RVAL_DECODED)
+
+BEGIN_BPF_CMD_DECODER(BPF_PROG_LOAD)
+{
+ tprint_struct_begin();
+ PRINT_FIELD_XVAL(attr, prog_type, bpf_prog_types, "BPF_PROG_TYPE_???");
+ tprint_struct_next();
+ PRINT_FIELD_U(attr, insn_cnt);
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_TCB_VAL(attr, insns, tcp,
+ print_ebpf_prog, attr.insn_cnt);
+
+ tprint_struct_next();
+ tprints_field_name("license");
+ print_big_u64_addr(attr.license);
+ printstr(tcp, attr.license);
+
+ /* log_* fields were added in Linux commit v3.18-rc1~52^2~1^2~4. */
+ if (len <= offsetof(struct BPF_PROG_LOAD_struct, log_level))
+ break;
+ tprint_struct_next();
+ PRINT_FIELD_U(attr, log_level);
+ tprint_struct_next();
+ PRINT_FIELD_U(attr, log_size);
+ tprint_struct_next();
+ tprints_field_name("log_buf");
+ print_big_u64_addr(attr.log_buf);
+ printstr_ex(tcp, attr.log_buf, attr.log_size, QUOTE_0_TERMINATED);
+
+ /* kern_version field was added in Linux commit v4.1-rc1~84^2~50. */
+ if (len <= offsetof(struct BPF_PROG_LOAD_struct, kern_version))
+ break;
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_VAL(attr, kern_version, print_kernel_version);
+
+ /* prog_flags field was added in Linux commit v4.12-rc2~34^2~29^2~2. */
+ if (len <= offsetof(struct BPF_PROG_LOAD_struct, prog_flags))
+ break;
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(attr, prog_flags, bpf_prog_flags, "BPF_F_???");
+
+ /* prog_name field was added in Linux commit v4.15-rc1~84^2~605^2~4. */
+ if (len <= offsetof(struct BPF_PROG_LOAD_struct, prog_name))
+ break;
+ tprint_struct_next();
+ PRINT_FIELD_CSTRING_SZ(attr, prog_name,
+ MIN(sizeof(attr.prog_name),
+ len - offsetof(struct BPF_PROG_LOAD_struct,
+ prog_name)));
+
+ /*
+ * prog_ifindex field was added as prog_target_ifindex in Linux commit
+ * v4.15-rc1~84^2~127^2~13 and renamed to its current name in
+ * v4.15-rc1~15^2~5^2~3^2~7.
+ */
+ if (len <= offsetof(struct BPF_PROG_LOAD_struct, prog_ifindex))
+ break;
+ tprint_struct_next();
+ PRINT_FIELD_IFINDEX(attr, prog_ifindex);
+
+ /*
+ * expected_attach_type was added in Linux commit
+ * v4.17-rc1~148^2~19^2^2~8.
+ */
+ if (len <= offsetof(struct BPF_PROG_LOAD_struct, expected_attach_type))
+ break;
+ tprint_struct_next();
+ PRINT_FIELD_XVAL(attr, expected_attach_type, bpf_attach_type,
+ "BPF_???");
+
+ /*
+ * The following seven fields were introduced by Linux commits
+ * v5.0-rc1~129^2~209^2~16^2~8 and v5.0-rc1~129^2~114^2~5^2~6.
+ */
+ if (len <= offsetof(struct BPF_PROG_LOAD_struct, prog_btf_fd))
+ break;
+ tprint_struct_next();
+ PRINT_FIELD_FD(attr, prog_btf_fd, tcp);
+ tprint_struct_next();
+ PRINT_FIELD_U(attr, func_info_rec_size);
+ tprint_struct_next();
+ PRINT_FIELD_ADDR64(attr, func_info);
+ tprint_struct_next();
+ PRINT_FIELD_U(attr, func_info_cnt);
+ tprint_struct_next();
+ PRINT_FIELD_U(attr, line_info_rec_size);
+ tprint_struct_next();
+ PRINT_FIELD_ADDR64(attr, line_info);
+ tprint_struct_next();
+ PRINT_FIELD_U(attr, line_info_cnt);
+
+ /* attach_btf_id was added in Linux commit v5.5-rc1~174^2~310^2~19^2~7 */
+ if (len <= offsetof(struct BPF_PROG_LOAD_struct, attach_btf_id))
+ break;
+ tprint_struct_next();
+ PRINT_FIELD_U(attr, attach_btf_id);
+
+ /* attach_prog_fd was added in Linux commit v5.5-rc1~174^2~49^2~12^2~3 */
+ if (len <= offsetof(struct BPF_PROG_LOAD_struct, attach_prog_fd))
+ break;
+ tprint_struct_next();
+ PRINT_FIELD_FD(attr, attach_prog_fd, tcp);
+}
+END_BPF_CMD_DECODER(RVAL_DECODED | RVAL_FD)
+
+BEGIN_BPF_CMD_DECODER(BPF_OBJ_PIN)
+{
+ tprint_struct_begin();
+ tprints_field_name("pathname");
+ print_big_u64_addr(attr.pathname);
+ printpath(tcp, attr.pathname);
+
+ tprint_struct_next();
+ PRINT_FIELD_FD(attr, bpf_fd, tcp);
+
+ /* file_flags field was added in Linux v4.15-rc1~84^2~384^2~4 */
+ if (len <= offsetof(struct BPF_OBJ_PIN_struct, file_flags))
+ break;
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(attr, file_flags, bpf_file_mode_flags, "BPF_F_???");
+}
+END_BPF_CMD_DECODER(RVAL_DECODED | RVAL_FD)
+
+#define decode_BPF_OBJ_GET decode_BPF_OBJ_PIN
+
+BEGIN_BPF_CMD_DECODER(BPF_PROG_ATTACH)
+{
+ tprint_struct_begin();
+ PRINT_FIELD_FD(attr, target_fd, tcp);
+ tprint_struct_next();
+ PRINT_FIELD_FD(attr, attach_bpf_fd, tcp);
+ tprint_struct_next();
+ PRINT_FIELD_XVAL(attr, attach_type, bpf_attach_type, "BPF_???");
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(attr, attach_flags, bpf_attach_flags, "BPF_F_???");
+
+ /*
+ * The following field was introduced by Linux commit
+ * v5.6-rc1~151^2~199^2~7^2~3.
+ */
+ if (len <= offsetof(struct BPF_PROG_ATTACH_struct, replace_bpf_fd))
+ break;
+ tprint_struct_next();
+ PRINT_FIELD_FD(attr, replace_bpf_fd, tcp);
+}
+END_BPF_CMD_DECODER(RVAL_DECODED)
+
+BEGIN_BPF_CMD_DECODER(BPF_PROG_DETACH)
+{
+ tprint_struct_begin();
+ PRINT_FIELD_FD(attr, target_fd, tcp);
+ tprint_struct_next();
+ PRINT_FIELD_XVAL(attr, attach_type, bpf_attach_type, "BPF_???");
+}
+END_BPF_CMD_DECODER(RVAL_DECODED)
+
+BEGIN_BPF_CMD_DECODER(BPF_PROG_TEST_RUN)
+{
+ tprint_struct_begin();
+ tprints_field_name("test");
+ tprint_struct_begin();
+ PRINT_FIELD_FD(attr, prog_fd, tcp);
+ tprint_struct_next();
+ PRINT_FIELD_U(attr, retval);
+ tprint_struct_next();
+ PRINT_FIELD_U(attr, data_size_in);
+ tprint_struct_next();
+ PRINT_FIELD_U(attr, data_size_out);
+ tprint_struct_next();
+ PRINT_FIELD_ADDR64(attr, data_in);
+ tprint_struct_next();
+ PRINT_FIELD_ADDR64(attr, data_out);
+ tprint_struct_next();
+ PRINT_FIELD_U(attr, repeat);
+ tprint_struct_next();
+ PRINT_FIELD_U(attr, duration);
+ /*
+ * The following four fields were introduced by Linux commit
+ * v5.2-rc1~133^2~193^2~6.
+ */
+ if (len > offsetof(struct BPF_PROG_TEST_RUN_struct, ctx_size_in)) {
+ tprint_struct_next();
+ PRINT_FIELD_U(attr, ctx_size_in);
+ tprint_struct_next();
+ PRINT_FIELD_U(attr, ctx_size_out);
+ tprint_struct_next();
+ PRINT_FIELD_ADDR64(attr, ctx_in);
+ tprint_struct_next();
+ PRINT_FIELD_ADDR64(attr, ctx_out);
+ }
+ tprint_struct_end();
+}
+END_BPF_CMD_DECODER(RVAL_DECODED)
+
+BEGIN_BPF_CMD_DECODER(BPF_PROG_GET_NEXT_ID)
+{
+ tprint_struct_begin();
+ PRINT_FIELD_U(attr, start_id);
+ tprint_struct_next();
+ PRINT_FIELD_U(attr, next_id);
+
+ /* open_flags field has been added in Linux v4.15-rc1~84^2~384^2~4 */
+ if (len <= offsetof(struct BPF_PROG_GET_NEXT_ID_struct, open_flags))
+ break;
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(attr, open_flags, bpf_file_mode_flags, "BPF_F_???");
+}
+END_BPF_CMD_DECODER(RVAL_DECODED)
+
+#define decode_BPF_MAP_GET_NEXT_ID decode_BPF_PROG_GET_NEXT_ID
+#define decode_BPF_BTF_GET_NEXT_ID decode_BPF_PROG_GET_NEXT_ID
+
+BEGIN_BPF_CMD_DECODER(BPF_PROG_GET_FD_BY_ID)
+{
+ tprint_struct_begin();
+ PRINT_FIELD_U(attr, prog_id);
+ tprint_struct_next();
+ PRINT_FIELD_U(attr, next_id);
+
+ /* open_flags field has been added in Linux v4.15-rc1~84^2~384^2~4 */
+ if (len <= offsetof(struct BPF_PROG_GET_FD_BY_ID_struct, open_flags))
+ break;
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(attr, open_flags, bpf_file_mode_flags, "BPF_F_???");
+}
+END_BPF_CMD_DECODER(RVAL_DECODED | RVAL_FD)
+
+BEGIN_BPF_CMD_DECODER(BPF_MAP_GET_FD_BY_ID)
+{
+ tprint_struct_begin();
+ PRINT_FIELD_U(attr, map_id);
+ tprint_struct_next();
+ PRINT_FIELD_U(attr, next_id);
+
+ /* open_flags field has been added in Linux v4.15-rc1~84^2~384^2~4 */
+ if (len <= offsetof(struct BPF_MAP_GET_FD_BY_ID_struct, open_flags))
+ break;
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(attr, open_flags, bpf_file_mode_flags, "BPF_F_???");
+}
+END_BPF_CMD_DECODER(RVAL_DECODED | RVAL_FD)
+
+struct obj_get_info_saved;
+typedef void (*print_bpf_obj_info_fn)(struct tcb *,
+ uint32_t bpf_fd,
+ const char *info_buf,
+ uint32_t size,
+ struct obj_get_info_saved *saved);
+
+struct obj_get_info_saved {
+ print_bpf_obj_info_fn print_fn;
+
+ uint32_t info_len;
+
+ uint32_t jited_prog_len;
+ uint32_t xlated_prog_len;
+ uint32_t nr_map_ids;
+
+ uint32_t nr_jited_ksyms;
+ uint32_t nr_jited_func_lens;
+ uint64_t jited_ksyms;
+ uint64_t jited_func_lens;
+
+ uint32_t func_info_rec_size;
+ uint32_t nr_func_info;
+ uint32_t nr_line_info;
+ uint32_t nr_jited_line_info;
+ uint64_t jited_line_info;
+ uint32_t line_info_rec_size;
+ uint32_t jited_line_info_rec_size;
+ uint32_t nr_prog_tags;
+};
+
+static void
+print_bpf_map_info(struct tcb * const tcp, uint32_t bpf_fd,
+ const char *info_buf, uint32_t size,
+ struct obj_get_info_saved *saved)
+{
+ if (entering(tcp))
+ return;
+
+ struct bpf_map_info_struct info = { 0 };
+ const unsigned int len = MIN(size, bpf_map_info_struct_size);
+
+ memcpy(&info, info_buf, len);
+
+ tprint_struct_begin();
+ PRINT_FIELD_XVAL(info, type, bpf_map_types, "BPF_MAP_TYPE_???");
+ tprint_struct_next();
+ PRINT_FIELD_U(info, id);
+ tprint_struct_next();
+ PRINT_FIELD_U(info, key_size);
+ tprint_struct_next();
+ PRINT_FIELD_U(info, value_size);
+ tprint_struct_next();
+ PRINT_FIELD_U(info, max_entries);
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(info, map_flags, bpf_map_flags, "BPF_F_???");
+
+ /*
+ * "name" field was introduced by Linux commit v4.15-rc1~84^2~605^2~3.
+ */
+ if (len <= offsetof(struct bpf_map_info_struct, name))
+ goto print_bpf_map_info_end;
+ tprint_struct_next();
+ PRINT_FIELD_CSTRING(info, name);
+
+ /*
+ * ifindex, netns_dev, and netns_ino fields were introduced
+ * by Linux commit v4.16-rc1~123^2~109^2~5^2~4.
+ */
+ if (len <= offsetof(struct bpf_map_info_struct, ifindex))
+ goto print_bpf_map_info_end;
+ tprint_struct_next();
+ PRINT_FIELD_IFINDEX(info, ifindex);
+ /*
+ * btf_vmlinux_value_type_id field was crammed in
+ * by Linux commit v5.6-rc1~151^2~46^2~37^2~5.
+ */
+ tprint_struct_next();
+ PRINT_FIELD_U(info, btf_vmlinux_value_type_id);
+ tprint_struct_next();
+ PRINT_FIELD_DEV(info, netns_dev);
+ tprint_struct_next();
+ PRINT_FIELD_U(info, netns_ino);
+
+ /*
+ * The next three fields were introduced by Linux commits
+ * v4.18-rc1~114^2~223^2~21^2~4 and v4.18-rc1~114^2~148^2~7^2~2.
+ */
+ if (len <= offsetof(struct bpf_map_info_struct, btf_id))
+ goto print_bpf_map_info_end;
+ tprint_struct_next();
+ PRINT_FIELD_U(info, btf_id);
+ tprint_struct_next();
+ PRINT_FIELD_U(info, btf_key_type_id);
+ tprint_struct_next();
+ PRINT_FIELD_U(info, btf_value_type_id);
+
+ decode_attr_extra_data(tcp, info_buf, size, bpf_map_info_struct_size);
+
+print_bpf_map_info_end:
+ tprint_struct_end();
+}
+
+static void
+print_bpf_prog_info(struct tcb * const tcp, uint32_t bpf_fd,
+ const char *info_buf, uint32_t size,
+ struct obj_get_info_saved *saved)
+{
+ struct bpf_prog_info_struct info = { 0 };
+ const unsigned int len = MIN(size, bpf_prog_info_struct_size);
+ uint64_t map_id_buf;
+
+ memcpy(&info, info_buf, len);
+
+ if (entering(tcp)) {
+ saved->jited_prog_len = info.jited_prog_len;
+ saved->xlated_prog_len = info.xlated_prog_len;
+ saved->nr_map_ids = info.nr_map_ids;
+ saved->nr_jited_ksyms = info.nr_jited_ksyms;
+ saved->nr_jited_func_lens = info.nr_jited_func_lens;
+ saved->jited_ksyms = info.jited_ksyms;
+ saved->jited_func_lens = info.jited_func_lens;
+
+ saved->func_info_rec_size = info.func_info_rec_size;
+ saved->nr_func_info = info.nr_func_info;
+ saved->nr_line_info = info.nr_line_info;
+ saved->nr_jited_line_info = info.nr_jited_line_info;
+ saved->jited_line_info = info.jited_line_info;
+ saved->line_info_rec_size = info.line_info_rec_size;
+ saved->jited_line_info_rec_size = info.jited_line_info_rec_size;
+ saved->nr_prog_tags = info.nr_prog_tags;
+
+ return;
+ }
+
+ tprint_struct_begin();
+ PRINT_FIELD_XVAL(info, type, bpf_prog_types, "BPF_PROG_TYPE_???");
+ tprint_struct_next();
+ PRINT_FIELD_U(info, id);
+ tprint_struct_next();
+ PRINT_FIELD_HEX_ARRAY(info, tag);
+
+ tprint_struct_next();
+ tprints_field_name("jited_prog_len");
+ if (saved->jited_prog_len != info.jited_prog_len) {
+ tprintf("%" PRIu32, saved->jited_prog_len);
+ tprint_value_changed();
+ }
+ tprintf("%" PRIu32, info.jited_prog_len);
+
+ tprint_struct_next();
+ tprints_field_name("jited_prog_insns");
+ print_big_u64_addr(info.jited_prog_insns);
+ printstr_ex(tcp, info.jited_prog_insns, info.jited_prog_len,
+ QUOTE_FORCE_HEX);
+
+ tprint_struct_next();
+ tprints_field_name("xlated_prog_len");
+ if (saved->xlated_prog_len != info.xlated_prog_len) {
+ tprintf("%" PRIu32, saved->xlated_prog_len);
+ tprint_value_changed();
+ }
+ tprintf("%" PRIu32, info.xlated_prog_len);
+
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_TCB_VAL(info, xlated_prog_insns,
+ tcp, print_ebpf_prog,
+ MIN(saved->xlated_prog_len, info.xlated_prog_len) / 8);
+
+ /*
+ * load_time, created_by_uid, nr_map_ids, map_ids, and name fields
+ * were introduced by Linux commit v4.15-rc1~84^2~605^2~4.
+ */
+ if (len <= offsetof(struct bpf_prog_info_struct, load_time))
+ goto print_bpf_prog_info_end;
+ tprint_struct_next();
+ PRINT_FIELD_U(info, load_time);
+ tprint_struct_next();
+ PRINT_FIELD_ID(info, created_by_uid);
+
+ tprint_struct_next();
+ tprints_field_name("nr_map_ids");
+ if (saved->nr_map_ids != info.nr_map_ids) {
+ tprintf("%" PRIu32, saved->nr_map_ids);
+ tprint_value_changed();
+ }
+ tprintf("%" PRIu32, info.nr_map_ids);
+
+ tprint_struct_next();
+ tprints_field_name("map_ids");
+ print_big_u64_addr(info.map_ids);
+ print_array(tcp, info.map_ids, MIN(saved->nr_map_ids, info.nr_map_ids),
+ &map_id_buf, sizeof(map_id_buf),
+ tfetch_mem, print_uint32_array_member, 0);
+
+ tprint_struct_next();
+ PRINT_FIELD_CSTRING(info, name);
+
+ /*
+ * ifindex, netns_dev, and netns_ino fields were introduced
+ * by Linux commit v4.16-rc1~123^2~227^2~5^2~2, and
+ * gpl_compatible was added later by Linux commit
+ * v4.18-rc1~114^2~376^2~6.
+ */
+ if (len <= offsetof(struct bpf_prog_info_struct, ifindex))
+ goto print_bpf_prog_info_end;
+ tprint_struct_next();
+ PRINT_FIELD_IFINDEX(info, ifindex);
+ tprint_struct_next();
+ PRINT_FIELD_U_CAST(info, gpl_compatible, unsigned int);
+ tprint_struct_next();
+ PRINT_FIELD_DEV(info, netns_dev);
+ tprint_struct_next();
+ PRINT_FIELD_U(info, netns_ino);
+
+ /*
+ * The next four fields were introduced by Linux commits
+ * v4.18-rc1~114^2~148^2~3^2~6 and v4.18-rc1~114^2~148^2~3^2~2.
+ */
+ if (len <= offsetof(struct bpf_prog_info_struct, nr_jited_ksyms))
+ goto print_bpf_prog_info_end;
+
+ tprint_struct_next();
+ tprints_field_name("nr_jited_ksyms");
+ if (saved->nr_jited_ksyms != info.nr_jited_ksyms) {
+ tprintf("%" PRIu32, saved->nr_jited_ksyms);
+ tprint_value_changed();
+ }
+ tprintf("%" PRIu32, info.nr_jited_ksyms);
+
+ tprint_struct_next();
+ tprints_field_name("nr_jited_func_lens");
+ if (saved->nr_jited_func_lens != info.nr_jited_func_lens) {
+ tprintf("%" PRIu32, saved->nr_jited_func_lens);
+ tprint_value_changed();
+ }
+ tprintf("%" PRIu32, info.nr_jited_func_lens);
+
+ tprint_struct_next();
+ tprints_field_name("jited_ksyms");
+ if (saved->jited_ksyms != info.jited_ksyms) {
+ printaddr64(saved->jited_ksyms);
+ tprint_value_changed();
+ }
+ printaddr64(info.jited_ksyms);
+
+ tprint_struct_next();
+ tprints_field_name("jited_func_lens");
+ if (saved->jited_func_lens != info.jited_func_lens) {
+ printaddr64(saved->jited_func_lens);
+ tprint_value_changed();
+ }
+ printaddr64(info.jited_func_lens);
+
+ /*
+ * The next twelve fields were introduced by Linux commits
+ * v5.0-rc1~129^2~209^2~16^2~8
+ * v5.0-rc1~129^2~114^2~5^2~6
+ * v5.0-rc1~129^2~114^2^2~2
+ * v5.0-rc1~129^2~15^2~22
+ */
+ if (len <= offsetof(struct bpf_prog_info_struct, btf_id))
+ goto print_bpf_prog_info_end;
+
+ tprint_struct_next();
+ PRINT_FIELD_U(info, btf_id);
+
+ tprint_struct_next();
+ tprints_field_name("func_info_rec_size");
+ if (saved->func_info_rec_size != info.func_info_rec_size) {
+ tprintf("%" PRIu32, saved->func_info_rec_size);
+ tprint_value_changed();
+ }
+ tprintf("%" PRIu32, info.func_info_rec_size);
+
+ tprint_struct_next();
+ PRINT_FIELD_ADDR64(info, func_info);
+
+ tprint_struct_next();
+ tprints_field_name("nr_func_info");
+ if (saved->nr_func_info != info.nr_func_info) {
+ tprintf("%" PRIu32, saved->nr_func_info);
+ tprint_value_changed();
+ }
+ tprintf("%" PRIu32, info.nr_func_info);
+
+ tprint_struct_next();
+ tprints_field_name("nr_line_info");
+ if (saved->nr_line_info != info.nr_line_info) {
+ tprintf("%" PRIu32, saved->nr_line_info);
+ tprint_value_changed();
+ }
+ tprintf("%" PRIu32, info.nr_line_info);
+
+ tprint_struct_next();
+ PRINT_FIELD_ADDR64(info, line_info);
+
+ tprint_struct_next();
+ tprints_field_name("jited_line_info");
+ if (saved->jited_line_info != info.jited_line_info) {
+ printaddr64(saved->jited_line_info);
+ tprint_value_changed();
+ }
+ printaddr64(info.jited_line_info);
+
+ tprint_struct_next();
+ tprints_field_name("nr_jited_line_info");
+ if (saved->nr_jited_line_info != info.nr_jited_line_info) {
+ tprintf("%" PRIu32, saved->nr_jited_line_info);
+ tprint_value_changed();
+ }
+ tprintf("%" PRIu32, info.nr_jited_line_info);
+
+ tprint_struct_next();
+ tprints_field_name("line_info_rec_size");
+ if (saved->line_info_rec_size != info.line_info_rec_size) {
+ tprintf("%" PRIu32, saved->line_info_rec_size);
+ tprint_value_changed();
+ }
+ tprintf("%" PRIu32, info.line_info_rec_size);
+
+ tprint_struct_next();
+ tprints_field_name("jited_line_info_rec_size");
+ if (saved->jited_line_info_rec_size != info.jited_line_info_rec_size) {
+ tprintf("%" PRIu32, saved->jited_line_info_rec_size);
+ tprint_value_changed();
+ }
+ tprintf("%" PRIu32, info.jited_line_info_rec_size);
+
+ tprint_struct_next();
+ tprints_field_name("nr_prog_tags");
+ if (saved->nr_prog_tags != info.nr_prog_tags) {
+ tprintf("%" PRIu32, saved->nr_prog_tags);
+ tprint_value_changed();
+ }
+ tprintf("%" PRIu32, info.nr_prog_tags);
+
+ tprint_struct_next();
+ PRINT_FIELD_ADDR64(info, prog_tags);
+
+ /*
+ * run_time_ns and run_cnt fields were introduced
+ * by Linux commit v5.1-rc1~178^2~17^2~15^2~2.
+ */
+ if (len <= offsetof(struct bpf_prog_info_struct, run_time_ns))
+ goto print_bpf_prog_info_end;
+
+ tprint_struct_next();
+ PRINT_FIELD_U(info, run_time_ns);
+ tprint_struct_next();
+ PRINT_FIELD_U(info, run_cnt);
+
+ decode_attr_extra_data(tcp, info_buf, size, bpf_prog_info_struct_size);
+
+print_bpf_prog_info_end:
+ tprint_struct_end();
+}
+
+static const char *
+fetch_bpf_obj_info(struct tcb * const tcp, uint64_t info, uint32_t size)
+{
+ static char *info_buf;
+
+ if (!info_buf)
+ info_buf = xmalloc(get_pagesize());
+
+ memset(info_buf, 0, get_pagesize());
+
+ if (size > 0 && size <= get_pagesize()
+ && !umoven(tcp, info, size, info_buf))
+ return info_buf;
+
+ return NULL;
+}
+
+static void
+print_bpf_obj_info_addr(struct tcb * const tcp, uint64_t addr)
+{
+ if (exiting(tcp))
+ printaddr64(addr);
+}
+
+static void
+print_bpf_obj_info(struct tcb * const tcp, uint32_t bpf_fd, uint64_t info,
+ uint32_t size, struct obj_get_info_saved *saved)
+{
+ if (abbrev(tcp)) {
+ print_bpf_obj_info_addr(tcp, info);
+ return;
+ }
+
+ static struct {
+ const char *id;
+ print_bpf_obj_info_fn print_fn;
+ } obj_printers[] = {
+ { "anon_inode:bpf-map", print_bpf_map_info },
+ { "anon_inode:bpf-prog", print_bpf_prog_info }
+ };
+
+ if (entering(tcp)) {
+ char path[PATH_MAX + 1];
+
+ if (getfdpath(tcp, bpf_fd, path, sizeof(path)) > 0) {
+ for (size_t i = 0; i < ARRAY_SIZE(obj_printers); ++i) {
+ if (!strcmp(path, obj_printers[i].id)) {
+ saved->print_fn =
+ obj_printers[i].print_fn;
+ break;
+ }
+ }
+ }
+ }
+
+ if (!saved || !saved->print_fn) {
+ print_bpf_obj_info_addr(tcp, info);
+ return;
+ }
+
+ const char *info_buf = fetch_bpf_obj_info(tcp, info, size);
+
+ if (info_buf)
+ saved->print_fn(tcp, bpf_fd, info_buf, size, saved);
+ else
+ print_bpf_obj_info_addr(tcp, info);
+}
+
+BEGIN_BPF_CMD_DECODER(BPF_OBJ_GET_INFO_BY_FD)
+{
+ struct obj_get_info_saved *saved;
+
+ if (entering(tcp)) {
+ saved = xzalloc(sizeof(*saved));
+ saved->info_len = attr.info_len;
+ set_tcb_priv_data(tcp, saved, free);
+
+ tprint_struct_begin();
+ tprints_field_name("info");
+ tprint_struct_begin();
+ PRINT_FIELD_FD(attr, bpf_fd, tcp);
+ tprint_struct_next();
+ PRINT_FIELD_U(attr, info_len);
+ } else {
+ saved = get_tcb_priv_data(tcp);
+
+ if (saved && (saved->info_len != attr.info_len)) {
+ tprint_value_changed();
+ tprintf("%u", attr.info_len);
+ }
+
+ tprint_struct_next();
+ tprints_field_name("info");
+ }
+
+ print_bpf_obj_info(tcp, attr.bpf_fd, attr.info, attr.info_len, saved);
+
+ if (entering(tcp))
+ return 0;
+
+ tprint_struct_end();
+}
+END_BPF_CMD_DECODER(RVAL_DECODED)
+
+BEGIN_BPF_CMD_DECODER(BPF_PROG_QUERY)
+{
+ uint32_t prog_id_buf;
+
+ if (entering(tcp)) {
+ tprint_struct_begin();
+ tprints_field_name("query");
+ tprint_struct_begin();
+ PRINT_FIELD_FD(attr, target_fd, tcp);
+ tprint_struct_next();
+ PRINT_FIELD_XVAL(attr, attach_type, bpf_attach_type,
+ "BPF_???");
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(attr, query_flags, bpf_query_flags,
+ "BPF_F_QUERY_???");
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(attr, attach_flags, bpf_attach_flags,
+ "BPF_F_???");
+
+ tprint_struct_next();
+ tprints_field_name("prog_ids");
+
+ set_tcb_priv_ulong(tcp, attr.prog_cnt);
+
+ return 0;
+ }
+
+ print_big_u64_addr(attr.prog_ids);
+ print_array(tcp, attr.prog_ids, attr.prog_cnt, &prog_id_buf,
+ sizeof(prog_id_buf), tfetch_mem,
+ print_uint32_array_member, 0);
+
+ tprint_struct_next();
+ tprints_field_name("prog_cnt");
+ const uint32_t prog_cnt_entering = get_tcb_priv_ulong(tcp);
+ if (prog_cnt_entering != attr.prog_cnt) {
+ tprintf("%" PRIu32, prog_cnt_entering);
+ tprint_value_changed();
+ }
+ tprintf("%" PRIu32, attr.prog_cnt);
+ tprint_struct_end();
+}
+END_BPF_CMD_DECODER(RVAL_DECODED)
+
+BEGIN_BPF_CMD_DECODER(BPF_RAW_TRACEPOINT_OPEN)
+{
+ enum { TP_NAME_SIZE = 128 };
+
+ tprint_struct_begin();
+ tprints_field_name("raw_tracepoint");
+ tprint_struct_begin();
+ tprints_field_name("name");
+ print_big_u64_addr(attr.name);
+ printstr_ex(tcp, attr.name, TP_NAME_SIZE, QUOTE_0_TERMINATED);
+
+ tprint_struct_next();
+ PRINT_FIELD_FD(attr, prog_fd, tcp);
+
+ tprint_struct_end();
+}
+END_BPF_CMD_DECODER(RVAL_DECODED)
+
+BEGIN_BPF_CMD_DECODER(BPF_BTF_LOAD)
+{
+ tprint_struct_begin();
+ tprints_field_name("btf");
+ print_big_u64_addr(attr.btf);
+ printstrn(tcp, attr.btf, attr.btf_size);
+ tprint_struct_next();
+ PRINT_FIELD_ADDR64(attr, btf_log_buf);
+ tprint_struct_next();
+ PRINT_FIELD_U(attr, btf_size);
+ tprint_struct_next();
+ PRINT_FIELD_U(attr, btf_log_size);
+ tprint_struct_next();
+ PRINT_FIELD_U(attr, btf_log_level);
+}
+END_BPF_CMD_DECODER(RVAL_DECODED | RVAL_FD)
+
+BEGIN_BPF_CMD_DECODER(BPF_BTF_GET_FD_BY_ID)
+{
+ tprint_struct_begin();
+ PRINT_FIELD_U(attr, btf_id);
+}
+END_BPF_CMD_DECODER(RVAL_DECODED | RVAL_FD)
+
+BEGIN_BPF_CMD_DECODER(BPF_TASK_FD_QUERY)
+{
+ if (entering(tcp)) {
+ set_tcb_priv_ulong(tcp, attr.buf_len);
+
+ tprint_struct_begin();
+ tprints_field_name("task_fd_query");
+ tprint_struct_begin();
+ PRINT_FIELD_TGID(attr, pid, tcp);
+ tprint_struct_next();
+ PRINT_FIELD_FD(attr, fd, tcp);
+ tprint_struct_next();
+ PRINT_FIELD_U(attr, flags);
+ tprint_struct_next();
+ PRINT_FIELD_U(attr, buf_len);
+
+ return 0;
+ }
+
+ unsigned int saved_buf_len = get_tcb_priv_ulong(tcp);
+
+ if (saved_buf_len != attr.buf_len) {
+ tprint_value_changed();
+ tprintf("%u", attr.buf_len);
+ }
+
+ const unsigned int buf_len = MIN(saved_buf_len, attr.buf_len);
+ tprint_struct_next();
+ tprints_field_name("buf");
+ print_big_u64_addr(attr.buf);
+ printstr_ex(tcp, attr.buf, buf_len, QUOTE_0_TERMINATED);
+ tprint_struct_next();
+ PRINT_FIELD_U(attr, prog_id);
+ tprint_struct_next();
+ PRINT_FIELD_XVAL(attr, fd_type, bpf_task_fd_type, "BPF_FD_TYPE_???");
+ tprint_struct_next();
+ PRINT_FIELD_X(attr, probe_offset);
+ tprint_struct_next();
+ PRINT_FIELD_X(attr, probe_addr);
+
+ tprint_struct_end();
+}
+END_BPF_CMD_DECODER(RVAL_DECODED)
+
+BEGIN_BPF_CMD_DECODER(BPF_MAP_LOOKUP_BATCH)
+{
+ if (entering(tcp)) {
+ set_tcb_priv_ulong(tcp, attr.count);
+
+ tprint_struct_begin();
+ tprints_field_name("batch");
+ tprint_struct_begin();
+ PRINT_FIELD_ADDR64(attr, in_batch);
+ tprint_struct_next();
+ PRINT_FIELD_ADDR64(attr, out_batch);
+ tprint_struct_next();
+ PRINT_FIELD_ADDR64(attr, keys);
+ tprint_struct_next();
+ PRINT_FIELD_ADDR64(attr, values);
+ tprint_struct_next();
+ PRINT_FIELD_U(attr, count);
+ tprint_struct_next();
+ PRINT_FIELD_FD(attr, map_fd, tcp);
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(attr, elem_flags,
+ bpf_map_lookup_elem_flags, "BPF_???");
+ tprint_struct_next();
+ PRINT_FIELD_X(attr, flags);
+
+ tprint_struct_end();
+ } else {
+ unsigned long count = get_tcb_priv_ulong(tcp);
+
+ if (count != attr.count) {
+ tprint_value_changed();
+ tprint_struct_begin();
+ tprints_field_name("batch");
+ tprint_struct_begin();
+ PRINT_FIELD_U(attr, count);
+ tprint_struct_end();
+ tprint_struct_end();
+ }
+
+ return RVAL_DECODED;
+ }
+}
+END_BPF_CMD_DECODER(0)
+
+#define decode_BPF_MAP_LOOKUP_AND_DELETE_BATCH decode_BPF_MAP_LOOKUP_BATCH
+
+BEGIN_BPF_CMD_DECODER(BPF_MAP_UPDATE_BATCH)
+{
+ if (entering(tcp)) {
+ set_tcb_priv_ulong(tcp, attr.count);
+
+ tprint_struct_begin();
+ tprints_field_name("batch");
+ tprint_struct_begin();
+ PRINT_FIELD_ADDR64(attr, keys);
+ tprint_struct_next();
+ PRINT_FIELD_ADDR64(attr, values);
+ tprint_struct_next();
+ PRINT_FIELD_U(attr, count);
+ tprint_struct_next();
+ PRINT_FIELD_FD(attr, map_fd, tcp);
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(attr, elem_flags,
+ bpf_map_lookup_elem_flags, "BPF_???");
+ tprint_struct_next();
+ PRINT_FIELD_X(attr, flags);
+
+ tprint_struct_end();
+ } else {
+ unsigned long count = get_tcb_priv_ulong(tcp);
+
+ if (count != attr.count) {
+ tprint_value_changed();
+ tprint_struct_begin();
+ tprints_field_name("batch");
+ tprint_struct_begin();
+ PRINT_FIELD_U(attr, count);
+ tprint_struct_end();
+ tprint_struct_end();
+ }
+
+ return RVAL_DECODED;
+ }
+}
+END_BPF_CMD_DECODER(0)
+
+BEGIN_BPF_CMD_DECODER(BPF_MAP_DELETE_BATCH)
+{
+ if (entering(tcp)) {
+ set_tcb_priv_ulong(tcp, attr.count);
+
+ tprint_struct_begin();
+ tprints_field_name("batch");
+ tprint_struct_begin();
+ PRINT_FIELD_ADDR64(attr, keys);
+ tprint_struct_next();
+ PRINT_FIELD_U(attr, count);
+ tprint_struct_next();
+ PRINT_FIELD_FD(attr, map_fd, tcp);
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(attr, elem_flags,
+ bpf_map_lookup_elem_flags, "BPF_???");
+ tprint_struct_next();
+ PRINT_FIELD_X(attr, flags);
+
+ tprint_struct_end();
+ } else {
+ unsigned long count = get_tcb_priv_ulong(tcp);
+
+ if (count != attr.count) {
+ tprint_value_changed();
+ tprint_struct_begin();
+ tprints_field_name("batch");
+ tprint_struct_begin();
+ PRINT_FIELD_U(attr, count);
+ tprint_struct_end();
+ tprint_struct_end();
+ }
+
+ return RVAL_DECODED;
+ }
+}
+END_BPF_CMD_DECODER(0)
+
+BEGIN_BPF_CMD_DECODER(BPF_LINK_CREATE)
+{
+ tprint_struct_begin();
+ tprints_field_name("link_create");
+ tprint_struct_begin();
+ PRINT_FIELD_FD(attr, prog_fd, tcp);
+ tprint_struct_next();
+ PRINT_FIELD_FD(attr, target_fd, tcp);
+ tprint_struct_next();
+ PRINT_FIELD_XVAL(attr, attach_type, bpf_attach_type, "BPF_???");
+ tprint_struct_next();
+ PRINT_FIELD_X(attr, flags);
+ tprint_struct_end();
+}
+END_BPF_CMD_DECODER(RVAL_DECODED | RVAL_FD)
+
+BEGIN_BPF_CMD_DECODER(BPF_LINK_UPDATE)
+{
+ tprint_struct_begin();
+ tprints_field_name("link_update");
+ tprint_struct_begin();
+ PRINT_FIELD_FD(attr, link_fd, tcp);
+ tprint_struct_next();
+ PRINT_FIELD_FD(attr, new_prog_fd, tcp);
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(attr, flags, bpf_attach_flags, "BPF_F_???");
+ if (attr.flags & BPF_F_REPLACE) {
+ tprint_struct_next();
+ PRINT_FIELD_FD(attr, old_prog_fd, tcp);
+ }
+ tprint_struct_end();
+}
+END_BPF_CMD_DECODER(RVAL_DECODED)
+
+SYS_FUNC(bpf)
+{
+ static const bpf_cmd_decoder_t bpf_cmd_decoders[] = {
+ BPF_CMD_ENTRY(BPF_MAP_CREATE),
+ BPF_CMD_ENTRY(BPF_MAP_LOOKUP_ELEM),
+ BPF_CMD_ENTRY(BPF_MAP_UPDATE_ELEM),
+ BPF_CMD_ENTRY(BPF_MAP_DELETE_ELEM),
+ BPF_CMD_ENTRY(BPF_MAP_GET_NEXT_KEY),
+ BPF_CMD_ENTRY(BPF_PROG_LOAD),
+ BPF_CMD_ENTRY(BPF_OBJ_PIN),
+ BPF_CMD_ENTRY(BPF_OBJ_GET),
+ BPF_CMD_ENTRY(BPF_PROG_ATTACH),
+ BPF_CMD_ENTRY(BPF_PROG_DETACH),
+ BPF_CMD_ENTRY(BPF_PROG_TEST_RUN),
+ BPF_CMD_ENTRY(BPF_PROG_GET_NEXT_ID),
+ BPF_CMD_ENTRY(BPF_MAP_GET_NEXT_ID),
+ BPF_CMD_ENTRY(BPF_PROG_GET_FD_BY_ID),
+ BPF_CMD_ENTRY(BPF_MAP_GET_FD_BY_ID),
+ BPF_CMD_ENTRY(BPF_OBJ_GET_INFO_BY_FD),
+ BPF_CMD_ENTRY(BPF_PROG_QUERY),
+ BPF_CMD_ENTRY(BPF_RAW_TRACEPOINT_OPEN),
+ BPF_CMD_ENTRY(BPF_BTF_LOAD),
+ BPF_CMD_ENTRY(BPF_BTF_GET_FD_BY_ID),
+ BPF_CMD_ENTRY(BPF_TASK_FD_QUERY),
+ BPF_CMD_ENTRY(BPF_MAP_LOOKUP_AND_DELETE_ELEM),
+ BPF_CMD_ENTRY(BPF_MAP_FREEZE),
+ BPF_CMD_ENTRY(BPF_BTF_GET_NEXT_ID),
+ BPF_CMD_ENTRY(BPF_MAP_LOOKUP_BATCH),
+ BPF_CMD_ENTRY(BPF_MAP_LOOKUP_AND_DELETE_BATCH),
+ BPF_CMD_ENTRY(BPF_MAP_UPDATE_BATCH),
+ BPF_CMD_ENTRY(BPF_MAP_DELETE_BATCH),
+ BPF_CMD_ENTRY(BPF_LINK_CREATE),
+ BPF_CMD_ENTRY(BPF_LINK_UPDATE),
+ };
+
+ const unsigned int cmd = tcp->u_arg[0];
+ const kernel_ulong_t addr = tcp->u_arg[1];
+ const unsigned int size = tcp->u_arg[2];
+ int rc = RVAL_DECODED;
+
+ if (entering(tcp)) {
+ printxval(bpf_commands, cmd, "BPF_???");
+ tprints(", ");
+ }
+
+ if (size > 0
+ && size <= get_pagesize()
+ && cmd < ARRAY_SIZE(bpf_cmd_decoders)
+ && bpf_cmd_decoders[cmd]) {
+ static char *buf;
+
+ if (!buf)
+ buf = xmalloc(get_pagesize());
+
+ if (!umoven_or_printaddr_ignore_syserror(tcp, addr, size, buf))
+ rc = bpf_cmd_decoders[cmd](tcp, addr, size, buf);
+ } else {
+ printaddr(addr);
+ }
+
+ if (exiting(tcp) || (rc & RVAL_DECODED))
+ tprintf(", %u", size);
+
+ return rc;
+}
diff --git a/src/bpf_attr.h b/src/bpf_attr.h
new file mode 100644
index 000000000..59146e446
--- /dev/null
+++ b/src/bpf_attr.h
@@ -0,0 +1,410 @@
+/*
+ * Copyright (c) 2015-2018 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2018-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_BPF_ATTR_H
+# define STRACE_BPF_ATTR_H
+
+/*
+ * The policy is that all fields of type uint64_t in this header file
+ * must have ATTRIBUTE_ALIGNED(8).
+ *
+ * This should not cause any contradictions with <linux/bpf.h>
+ * unless the latter is buggy.
+ *
+ * By word "buggy" I mean containing such changes as Linux kernel commit
+ * v4.16-rc1~123^2~109^2~5^2~4.
+ */
+
+# ifndef BPF_OBJ_NAME_LEN
+# define BPF_OBJ_NAME_LEN 16U
+# else
+# if BPF_OBJ_NAME_LEN != 16U
+# error "Unexpected value of BPF_OBJ_NAME_LEN"
+# endif
+# endif
+
+# ifndef BPF_TAG_SIZE
+# define BPF_TAG_SIZE 8
+# else
+# if BPF_TAG_SIZE != 8
+# error "Unexpected value of BPF_TAG_SIZE"
+# endif
+# endif
+
+struct BPF_MAP_CREATE_struct {
+ uint32_t map_type;
+ uint32_t key_size;
+ uint32_t value_size;
+ uint32_t max_entries;
+ uint32_t map_flags;
+ uint32_t inner_map_fd;
+ uint32_t numa_node;
+ char map_name[BPF_OBJ_NAME_LEN];
+ uint32_t map_ifindex;
+ uint32_t btf_fd;
+ uint32_t btf_key_type_id;
+ uint32_t btf_value_type_id;
+ uint32_t btf_vmlinux_value_type_id;
+};
+
+# define BPF_MAP_CREATE_struct_size \
+ sizeof(struct BPF_MAP_CREATE_struct)
+# define expected_BPF_MAP_CREATE_struct_size 64
+
+struct BPF_MAP_LOOKUP_ELEM_struct {
+ uint32_t map_fd;
+ uint64_t ATTRIBUTE_ALIGNED(8) key;
+ uint64_t ATTRIBUTE_ALIGNED(8) value;
+ uint64_t ATTRIBUTE_ALIGNED(8) flags;
+};
+
+# define BPF_MAP_LOOKUP_ELEM_struct_size \
+ sizeof(struct BPF_MAP_LOOKUP_ELEM_struct)
+# define expected_BPF_MAP_LOOKUP_ELEM_struct_size 32
+
+struct BPF_MAP_UPDATE_ELEM_struct {
+ uint32_t map_fd;
+ uint64_t ATTRIBUTE_ALIGNED(8) key;
+ uint64_t ATTRIBUTE_ALIGNED(8) value;
+ uint64_t ATTRIBUTE_ALIGNED(8) flags;
+};
+
+# define BPF_MAP_UPDATE_ELEM_struct_size \
+ sizeof(struct BPF_MAP_UPDATE_ELEM_struct)
+# define expected_BPF_MAP_UPDATE_ELEM_struct_size 32
+
+struct BPF_MAP_DELETE_ELEM_struct {
+ uint32_t map_fd;
+ uint64_t ATTRIBUTE_ALIGNED(8) key;
+};
+
+# define BPF_MAP_DELETE_ELEM_struct_size \
+ sizeof(struct BPF_MAP_DELETE_ELEM_struct)
+# define expected_BPF_MAP_DELETE_ELEM_struct_size 16
+
+struct BPF_MAP_GET_NEXT_KEY_struct {
+ uint32_t map_fd;
+ uint64_t ATTRIBUTE_ALIGNED(8) key;
+ uint64_t ATTRIBUTE_ALIGNED(8) next_key;
+};
+
+# define BPF_MAP_GET_NEXT_KEY_struct_size \
+ sizeof(struct BPF_MAP_GET_NEXT_KEY_struct)
+# define expected_BPF_MAP_GET_NEXT_KEY_struct_size 24
+
+struct BPF_MAP_FREEZE_struct {
+ uint32_t map_fd;
+};
+
+# define BPF_MAP_FREEZE_struct_size \
+ sizeof(struct BPF_MAP_FREEZE_struct)
+# define expected_BPF_MAP_FREEZE_struct_size 4
+
+struct BPF_PROG_LOAD_struct {
+ uint32_t prog_type;
+ uint32_t insn_cnt;
+ uint64_t ATTRIBUTE_ALIGNED(8) insns;
+ uint64_t ATTRIBUTE_ALIGNED(8) license;
+ uint32_t log_level;
+ uint32_t log_size;
+ uint64_t ATTRIBUTE_ALIGNED(8) log_buf;
+ uint32_t kern_version;
+ uint32_t prog_flags;
+ char prog_name[BPF_OBJ_NAME_LEN];
+ uint32_t prog_ifindex;
+ uint32_t expected_attach_type;
+ uint32_t prog_btf_fd;
+ uint32_t func_info_rec_size;
+ uint64_t ATTRIBUTE_ALIGNED(8) func_info;
+ uint32_t func_info_cnt;
+ uint32_t line_info_rec_size;
+ uint64_t ATTRIBUTE_ALIGNED(8) line_info;
+ uint32_t line_info_cnt;
+ uint32_t attach_btf_id;
+ uint32_t attach_prog_fd;
+};
+
+# define BPF_PROG_LOAD_struct_size \
+ offsetofend(struct BPF_PROG_LOAD_struct, attach_prog_fd)
+# define expected_BPF_PROG_LOAD_struct_size 116
+
+struct BPF_OBJ_PIN_struct {
+ uint64_t ATTRIBUTE_ALIGNED(8) pathname;
+ uint32_t bpf_fd;
+ uint32_t file_flags;
+};
+
+# define BPF_OBJ_PIN_struct_size \
+ sizeof(struct BPF_OBJ_PIN_struct)
+# define expected_BPF_OBJ_PIN_struct_size 16
+
+# define BPF_OBJ_GET_struct BPF_OBJ_PIN_struct
+# define BPF_OBJ_GET_struct_size BPF_OBJ_PIN_struct_size
+
+struct BPF_PROG_ATTACH_struct {
+ uint32_t target_fd;
+ uint32_t attach_bpf_fd;
+ uint32_t attach_type;
+ uint32_t attach_flags;
+ uint32_t replace_bpf_fd;
+};
+
+# define BPF_PROG_ATTACH_struct_size \
+ sizeof(struct BPF_PROG_ATTACH_struct)
+# define expected_BPF_PROG_ATTACH_struct_size 20
+
+struct BPF_PROG_DETACH_struct {
+ uint32_t target_fd;
+ uint32_t dummy;
+ uint32_t attach_type;
+};
+
+# define BPF_PROG_DETACH_struct_size \
+ sizeof(struct BPF_PROG_DETACH_struct)
+# define expected_BPF_PROG_DETACH_struct_size 12
+
+struct BPF_PROG_TEST_RUN_struct /* test */ {
+ uint32_t prog_fd;
+ uint32_t retval;
+ uint32_t data_size_in;
+ uint32_t data_size_out;
+ uint64_t ATTRIBUTE_ALIGNED(8) data_in;
+ uint64_t ATTRIBUTE_ALIGNED(8) data_out;
+ uint32_t repeat;
+ uint32_t duration;
+ uint32_t ctx_size_in;
+ uint32_t ctx_size_out;
+ uint64_t ATTRIBUTE_ALIGNED(8) ctx_in;
+ uint64_t ATTRIBUTE_ALIGNED(8) ctx_out;
+};
+
+# define BPF_PROG_TEST_RUN_struct_size \
+ sizeof(struct BPF_PROG_TEST_RUN_struct)
+# define expected_BPF_PROG_TEST_RUN_struct_size 64
+
+struct BPF_PROG_GET_NEXT_ID_struct {
+ uint32_t start_id;
+ uint32_t next_id;
+ uint32_t open_flags;
+};
+
+# define BPF_PROG_GET_NEXT_ID_struct_size \
+ sizeof(struct BPF_PROG_GET_NEXT_ID_struct)
+# define expected_BPF_PROG_GET_NEXT_ID_struct_size 12
+
+# define BPF_MAP_GET_NEXT_ID_struct BPF_PROG_GET_NEXT_ID_struct
+# define BPF_MAP_GET_NEXT_ID_struct_size BPF_PROG_GET_NEXT_ID_struct_size
+
+# define BPF_BTF_GET_NEXT_ID_struct BPF_PROG_GET_NEXT_ID_struct
+# define BPF_BTF_GET_NEXT_ID_struct_size BPF_PROG_GET_NEXT_ID_struct_size
+
+struct BPF_PROG_GET_FD_BY_ID_struct {
+ uint32_t prog_id;
+ uint32_t next_id;
+ uint32_t open_flags;
+};
+
+# define BPF_PROG_GET_FD_BY_ID_struct_size \
+ sizeof(struct BPF_PROG_GET_FD_BY_ID_struct)
+# define expected_BPF_PROG_GET_FD_BY_ID_struct_size 12
+
+struct BPF_MAP_GET_FD_BY_ID_struct {
+ uint32_t map_id;
+ uint32_t next_id;
+ uint32_t open_flags;
+};
+
+# define BPF_MAP_GET_FD_BY_ID_struct_size \
+ sizeof(struct BPF_MAP_GET_FD_BY_ID_struct)
+# define expected_BPF_MAP_GET_FD_BY_ID_struct_size 12
+
+struct BPF_OBJ_GET_INFO_BY_FD_struct /* info */ {
+ uint32_t bpf_fd;
+ uint32_t info_len;
+ uint64_t ATTRIBUTE_ALIGNED(8) info;
+};
+
+# define BPF_OBJ_GET_INFO_BY_FD_struct_size \
+ sizeof(struct BPF_OBJ_GET_INFO_BY_FD_struct)
+# define expected_BPF_OBJ_GET_INFO_BY_FD_struct_size 16
+
+struct BPF_PROG_QUERY_struct /* query */ {
+ uint32_t target_fd;
+ uint32_t attach_type;
+ uint32_t query_flags;
+ uint32_t attach_flags;
+ uint64_t ATTRIBUTE_ALIGNED(8) prog_ids;
+ uint32_t prog_cnt;
+};
+
+# define BPF_PROG_QUERY_struct_size \
+ offsetofend(struct BPF_PROG_QUERY_struct, prog_cnt)
+# define expected_BPF_PROG_QUERY_struct_size 28
+
+struct BPF_RAW_TRACEPOINT_OPEN_struct /* raw_tracepoint */ {
+ uint64_t ATTRIBUTE_ALIGNED(8) name;
+ uint32_t prog_fd;
+};
+
+# define BPF_RAW_TRACEPOINT_OPEN_struct_size \
+ offsetofend(struct BPF_RAW_TRACEPOINT_OPEN_struct, prog_fd)
+# define expected_BPF_RAW_TRACEPOINT_OPEN_struct_size 12
+
+struct BPF_BTF_LOAD_struct {
+ uint64_t ATTRIBUTE_ALIGNED(8) btf;
+ uint64_t ATTRIBUTE_ALIGNED(8) btf_log_buf;
+ uint32_t btf_size;
+ uint32_t btf_log_size;
+ uint32_t btf_log_level;
+};
+
+# define BPF_BTF_LOAD_struct_size \
+ offsetofend(struct BPF_BTF_LOAD_struct, btf_log_level)
+# define expected_BPF_BTF_LOAD_struct_size 28
+
+struct BPF_BTF_GET_FD_BY_ID_struct {
+ uint32_t btf_id;
+};
+
+# define BPF_BTF_GET_FD_BY_ID_struct_size \
+ sizeof(struct BPF_BTF_GET_FD_BY_ID_struct)
+# define expected_BPF_BTF_GET_FD_BY_ID_struct_size 4
+
+struct BPF_TASK_FD_QUERY_struct /* task_fd_query */ {
+ uint32_t pid;
+ uint32_t fd;
+ uint32_t flags;
+ uint32_t buf_len;
+ uint64_t ATTRIBUTE_ALIGNED(8) buf;
+ uint32_t prog_id;
+ uint32_t fd_type;
+ uint64_t ATTRIBUTE_ALIGNED(8) probe_offset;
+ uint64_t ATTRIBUTE_ALIGNED(8) probe_addr;
+};
+
+# define BPF_TASK_FD_QUERY_struct_size \
+ sizeof(struct BPF_TASK_FD_QUERY_struct)
+# define expected_BPF_TASK_FD_QUERY_struct_size 48
+
+struct bpf_map_info_struct {
+ uint32_t type;
+ uint32_t id;
+ uint32_t key_size;
+ uint32_t value_size;
+ uint32_t max_entries;
+ uint32_t map_flags;
+ char name[BPF_OBJ_NAME_LEN];
+ uint32_t ifindex;
+ uint32_t btf_vmlinux_value_type_id;
+ /*
+ * The kernel UAPI is broken by Linux commit
+ * v4.16-rc1~123^2~109^2~5^2~4 .
+ */
+ uint64_t ATTRIBUTE_ALIGNED(8) netns_dev; /* skip check */
+ uint64_t ATTRIBUTE_ALIGNED(8) netns_ino; /* skip check */
+ uint32_t btf_id;
+ uint32_t btf_key_type_id;
+ uint32_t btf_value_type_id;
+};
+
+# define bpf_map_info_struct_size \
+ offsetofend(struct bpf_map_info_struct, btf_value_type_id)
+# define expected_bpf_map_info_struct_size 76
+
+struct bpf_prog_info_struct {
+ uint32_t type;
+ uint32_t id;
+ uint8_t tag[BPF_TAG_SIZE];
+ uint32_t jited_prog_len;
+ uint32_t xlated_prog_len;
+ uint64_t ATTRIBUTE_ALIGNED(8) jited_prog_insns;
+ uint64_t ATTRIBUTE_ALIGNED(8) xlated_prog_insns;
+ uint64_t ATTRIBUTE_ALIGNED(8) load_time;
+ uint32_t created_by_uid;
+ uint32_t nr_map_ids;
+ uint64_t ATTRIBUTE_ALIGNED(8) map_ids;
+ char name[BPF_OBJ_NAME_LEN];
+ uint32_t ifindex;
+ uint32_t gpl_compatible:1;
+ /*
+ * The kernel UAPI is broken by Linux commit
+ * v4.16-rc1~123^2~227^2~5^2~2 .
+ */
+ uint64_t ATTRIBUTE_ALIGNED(8) netns_dev; /* skip check */
+ uint64_t ATTRIBUTE_ALIGNED(8) netns_ino; /* skip check */
+ uint32_t nr_jited_ksyms;
+ uint32_t nr_jited_func_lens;
+ uint64_t ATTRIBUTE_ALIGNED(8) jited_ksyms;
+ uint64_t ATTRIBUTE_ALIGNED(8) jited_func_lens;
+ uint32_t btf_id;
+ uint32_t func_info_rec_size;
+ uint64_t ATTRIBUTE_ALIGNED(8) func_info;
+ uint32_t nr_func_info;
+ uint32_t nr_line_info;
+ uint64_t ATTRIBUTE_ALIGNED(8) line_info;
+ uint64_t ATTRIBUTE_ALIGNED(8) jited_line_info;
+ uint32_t nr_jited_line_info;
+ uint32_t line_info_rec_size;
+ uint32_t jited_line_info_rec_size;
+ uint32_t nr_prog_tags;
+ uint64_t ATTRIBUTE_ALIGNED(8) prog_tags;
+ uint64_t ATTRIBUTE_ALIGNED(8) run_time_ns;
+ uint64_t ATTRIBUTE_ALIGNED(8) run_cnt;
+};
+
+# define bpf_prog_info_struct_size \
+ sizeof(struct bpf_prog_info_struct)
+# define expected_bpf_prog_info_struct_size 208
+
+struct BPF_MAP_LOOKUP_BATCH_struct /* batch */ {
+ uint64_t ATTRIBUTE_ALIGNED(8) in_batch;
+ uint64_t ATTRIBUTE_ALIGNED(8) out_batch;
+ uint64_t ATTRIBUTE_ALIGNED(8) keys;
+ uint64_t ATTRIBUTE_ALIGNED(8) values;
+ uint32_t count;
+ uint32_t map_fd;
+ uint64_t ATTRIBUTE_ALIGNED(8) elem_flags;
+ uint64_t ATTRIBUTE_ALIGNED(8) flags;
+};
+
+# define BPF_MAP_LOOKUP_BATCH_struct_size \
+ sizeof(struct BPF_MAP_LOOKUP_BATCH_struct)
+# define expected_BPF_MAP_LOOKUP_BATCH_struct_size 56
+
+# define BPF_MAP_LOOKUP_AND_DELETE_BATCH_struct BPF_MAP_LOOKUP_BATCH_struct
+# define BPF_MAP_LOOKUP_AND_DELETE_BATCH_struct_size BPF_MAP_LOOKUP_BATCH_struct_size
+
+# define BPF_MAP_UPDATE_BATCH_struct BPF_MAP_LOOKUP_BATCH_struct
+# define BPF_MAP_UPDATE_BATCH_struct_size BPF_MAP_LOOKUP_BATCH_struct_size
+
+# define BPF_MAP_DELETE_BATCH_struct BPF_MAP_LOOKUP_BATCH_struct
+# define BPF_MAP_DELETE_BATCH_struct_size BPF_MAP_LOOKUP_BATCH_struct_size
+
+struct BPF_LINK_CREATE_struct /* link_create */ {
+ uint32_t prog_fd;
+ uint32_t target_fd;
+ uint32_t attach_type;
+ uint32_t flags;
+};
+
+# define BPF_LINK_CREATE_struct_size \
+ sizeof(struct BPF_LINK_CREATE_struct)
+# define expected_BPF_LINK_CREATE_struct_size 16
+
+struct BPF_LINK_UPDATE_struct /* link_update */ {
+ uint32_t link_fd;
+ uint32_t new_prog_fd;
+ uint32_t flags;
+ uint32_t old_prog_fd;
+};
+
+# define BPF_LINK_UPDATE_struct_size \
+ sizeof(struct BPF_LINK_UPDATE_struct)
+# define expected_BPF_LINK_UPDATE_struct_size 16
+
+#endif /* !STRACE_BPF_ATTR_H */
diff --git a/src/bpf_filter.c b/src/bpf_filter.c
new file mode 100644
index 000000000..dfe48d165
--- /dev/null
+++ b/src/bpf_filter.c
@@ -0,0 +1,182 @@
+/*
+ * Decoder of classic BPF programs.
+ *
+ * Copyright (c) 2015-2017 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2017-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#include "bpf_filter.h"
+#include "bpf_fprog.h"
+
+#include <linux/filter.h>
+
+#include "xlat/bpf_class.h"
+#include "xlat/bpf_miscop.h"
+#include "xlat/bpf_mode.h"
+#include "xlat/bpf_op_alu.h"
+#include "xlat/bpf_op_jmp.h"
+#include "xlat/bpf_rval.h"
+#include "xlat/bpf_size.h"
+#include "xlat/bpf_src.h"
+
+#include "xlat/ebpf_class.h"
+#include "xlat/ebpf_mode.h"
+#include "xlat/ebpf_op_alu.h"
+#include "xlat/ebpf_op_jmp.h"
+#include "xlat/ebpf_size.h"
+
+void
+print_bpf_filter_code(const uint16_t code, bool extended)
+{
+ const struct xlat *mode = extended ? ebpf_mode : bpf_mode;
+ uint16_t i = code & ~BPF_CLASS(code);
+
+ printxval(extended ? ebpf_class : bpf_class, BPF_CLASS(code),
+ "BPF_???");
+ switch (BPF_CLASS(code)) {
+ case BPF_ST:
+ case BPF_STX:
+ if (!extended) {
+ if (i) {
+ tprintf("|%#x", i);
+ tprints_comment("BPF_???");
+ }
+ break;
+ }
+ ATTRIBUTE_FALLTHROUGH; /* extended == true */
+
+ case BPF_LD:
+ case BPF_LDX:
+ tprints("|");
+ printxvals(BPF_SIZE(code), "BPF_???",
+ bpf_size, extended ? ebpf_size : NULL, NULL);
+ tprints("|");
+ printxval(mode, BPF_MODE(code), "BPF_???");
+ break;
+
+ case BPF_MISC: /* BPF_ALU64 in eBPF */
+ if (!extended) {
+ tprints("|");
+ printxval(bpf_miscop, BPF_MISCOP(code), "BPF_???");
+ i &= ~BPF_MISCOP(code);
+ if (i) {
+ tprintf("|%#x", i);
+ tprints_comment("BPF_???");
+ }
+ break;
+ }
+ ATTRIBUTE_FALLTHROUGH; /* extended == true */
+
+ case BPF_ALU:
+ tprints("|");
+ printxval(bpf_src, BPF_SRC(code), "BPF_???");
+ tprints("|");
+ printxvals(BPF_OP(code), "BPF_???",
+ bpf_op_alu,
+ extended ? ebpf_op_alu : NULL, NULL);
+ break;
+
+ case BPF_JMP:
+ tprints("|");
+ printxval(bpf_src, BPF_SRC(code), "BPF_???");
+ tprints("|");
+ printxvals(BPF_OP(code), "BPF_???",
+ bpf_op_jmp, extended ? ebpf_op_jmp : NULL, NULL);
+ break;
+
+ case BPF_RET: /* Reserved in eBPF */
+ if (!extended) {
+ tprints("|");
+ printxval(bpf_rval, BPF_RVAL(code), "BPF_???");
+ i &= ~BPF_RVAL(code);
+ }
+
+ if (i) {
+ tprintf("|%#x", i);
+ tprints_comment("BPF_???");
+ }
+
+ break;
+ }
+}
+
+static void
+print_bpf_filter_stmt(const struct bpf_filter_block *const filter,
+ const print_bpf_filter_fn print_k)
+{
+ tprints("BPF_STMT(");
+ print_bpf_filter_code(filter->code, false);
+ tprints(", ");
+ if (!print_k || !print_k(filter))
+ tprintf("%#x", filter->k);
+ tprints(")");
+}
+
+static void
+print_bpf_filter_jump(const struct bpf_filter_block *const filter)
+{
+ tprints("BPF_JUMP(");
+ print_bpf_filter_code(filter->code, false);
+ tprintf(", %#x, %#x, %#x)", filter->k, filter->jt, filter->jf);
+}
+
+struct bpf_filter_block_data {
+ const print_bpf_filter_fn fn;
+ unsigned int count;
+};
+
+static bool
+print_bpf_filter_block(struct tcb *const tcp, void *const elem_buf,
+ const size_t elem_size, void *const data)
+{
+ const struct bpf_filter_block *const filter = elem_buf;
+ struct bpf_filter_block_data *const fbd = data;
+
+ if (fbd->count++ >= BPF_MAXINSNS) {
+ tprint_more_data_follows();
+ return false;
+ }
+
+ if (filter->jt || filter->jf)
+ print_bpf_filter_jump(filter);
+ else
+ print_bpf_filter_stmt(filter, fbd->fn);
+
+ return true;
+}
+
+void
+print_bpf_fprog(struct tcb *const tcp, const kernel_ulong_t addr,
+ const unsigned short len, const print_bpf_filter_fn print_k)
+{
+ if (abbrev(tcp)) {
+ printaddr(addr);
+ } else {
+ struct bpf_filter_block_data fbd = { .fn = print_k };
+ struct bpf_filter_block filter;
+
+ print_array(tcp, addr, len, &filter, sizeof(filter),
+ tfetch_mem, print_bpf_filter_block, &fbd);
+ }
+}
+
+void
+decode_bpf_fprog(struct tcb *const tcp, const kernel_ulong_t addr,
+ const print_bpf_filter_fn print_k)
+{
+ struct bpf_fprog fprog;
+
+ if (fetch_bpf_fprog(tcp, addr, &fprog)) {
+ tprint_struct_begin();
+ PRINT_FIELD_U(fprog, len);
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_TCB_VAL(fprog, filter, tcp,
+ print_bpf_fprog, fprog.len, print_k);
+ tprint_struct_end();
+ }
+}
diff --git a/src/bpf_filter.h b/src/bpf_filter.h
new file mode 100644
index 000000000..790f13dcf
--- /dev/null
+++ b/src/bpf_filter.h
@@ -0,0 +1,30 @@
+/*
+ * Classic BPF filter block.
+ *
+ * Copyright (c) 2015-2018 Dmitry V. Levin <ldv@strace.io>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_BPF_FILTER_H
+# define STRACE_BPF_FILTER_H
+
+struct bpf_filter_block {
+ uint16_t code;
+ uint8_t jt;
+ uint8_t jf;
+ uint32_t k;
+};
+
+typedef bool (*print_bpf_filter_fn)(const struct bpf_filter_block *);
+
+extern void
+print_bpf_fprog(struct tcb *const tcp, const kernel_ulong_t addr,
+ const unsigned short len, const print_bpf_filter_fn print_k);
+
+extern void
+decode_bpf_fprog(struct tcb *const tcp, const kernel_ulong_t addr,
+ const print_bpf_filter_fn print_k);
+
+#endif /* !STRACE_BPF_FILTER_H */
diff --git a/src/bpf_fprog.h b/src/bpf_fprog.h
new file mode 100644
index 000000000..6f1f1aa22
--- /dev/null
+++ b/src/bpf_fprog.h
@@ -0,0 +1,16 @@
+/*
+ * Copyright (c) 2017-2018 Dmitry V. Levin <ldv@strace.io>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_BPF_FPROG_H
+# define STRACE_BPF_FPROG_H
+
+struct bpf_fprog {
+ unsigned short len;
+ kernel_ulong_t filter;
+};
+
+#endif /* !STRACE_BPF_FPROG_H */
diff --git a/src/bpf_seccomp_filter.c b/src/bpf_seccomp_filter.c
new file mode 100644
index 000000000..c75f72fd1
--- /dev/null
+++ b/src/bpf_seccomp_filter.c
@@ -0,0 +1,51 @@
+/*
+ * Decoder of seccomp filter programs.
+ *
+ * Copyright (c) 2015-2018 Dmitry V. Levin <ldv@strace.io>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#include "bpf_filter.h"
+
+#include <linux/filter.h>
+#ifdef HAVE_LINUX_SECCOMP_H
+# include <linux/seccomp.h>
+#endif
+#ifndef SECCOMP_RET_ACTION_FULL
+# define SECCOMP_RET_ACTION_FULL 0xffff0000U
+#endif
+#include "xlat/seccomp_ret_action.h"
+
+static bool
+print_seccomp_filter_k(const struct bpf_filter_block *const fp)
+{
+ if (BPF_CLASS(fp->code) == BPF_RET) {
+ unsigned int action = SECCOMP_RET_ACTION_FULL & fp->k;
+ unsigned int data = fp->k & ~action;
+
+ printxval(seccomp_ret_action, action, "SECCOMP_RET_???");
+ if (data)
+ tprintf("|%#x", data);
+
+ return true;
+ }
+
+ return false;
+}
+
+void
+print_seccomp_fprog(struct tcb *const tcp, const kernel_ulong_t addr,
+ const unsigned short len)
+{
+ print_bpf_fprog(tcp, addr, len, print_seccomp_filter_k);
+}
+
+void
+decode_seccomp_fprog(struct tcb *const tcp, const kernel_ulong_t addr)
+{
+ decode_bpf_fprog(tcp, addr, print_seccomp_filter_k);
+}
diff --git a/src/bpf_sock_filter.c b/src/bpf_sock_filter.c
new file mode 100644
index 000000000..0df4c41f8
--- /dev/null
+++ b/src/bpf_sock_filter.c
@@ -0,0 +1,56 @@
+/*
+ * Decoder of socket filter programs.
+ *
+ * Copyright (c) 2017 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2017-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#include "bpf_filter.h"
+
+#include <linux/filter.h>
+#include "xlat/skf_ad.h"
+#define XLAT_MACROS_ONLY
+# include "xlat/skf_off.h"
+#undef XLAT_MACROS_ONLY
+
+static bool
+print_sock_filter_k(const struct bpf_filter_block *const fp)
+{
+ if (BPF_CLASS(fp->code) == BPF_LD && BPF_MODE(fp->code) == BPF_ABS) {
+ if (fp->k >= (unsigned int) SKF_AD_OFF) {
+ print_xlat32(SKF_AD_OFF);
+ tprints("+");
+ printxval(skf_ad, fp->k - (unsigned int) SKF_AD_OFF,
+ "SKF_AD_???");
+ return true;
+ } else if (fp->k >= (unsigned int) SKF_NET_OFF) {
+ print_xlat32(SKF_NET_OFF);
+ tprintf("+%u", fp->k - (unsigned int) SKF_NET_OFF);
+ return true;
+ } else if (fp->k >= (unsigned int) SKF_LL_OFF) {
+ print_xlat32(SKF_LL_OFF);
+ tprintf("+%u", fp->k - (unsigned int) SKF_LL_OFF);
+ return true;
+ }
+ }
+
+ return false;
+}
+
+void
+print_sock_fprog(struct tcb *const tcp, const kernel_ulong_t addr,
+ const unsigned short len)
+{
+ print_bpf_fprog(tcp, addr, len, print_sock_filter_k);
+}
+
+void
+decode_sock_fprog(struct tcb *const tcp, const kernel_ulong_t addr)
+{
+ decode_bpf_fprog(tcp, addr, print_sock_filter_k);
+}
diff --git a/src/btrfs.c b/src/btrfs.c
new file mode 100644
index 000000000..1933cf33a
--- /dev/null
+++ b/src/btrfs.c
@@ -0,0 +1,1420 @@
+/*
+ * Copyright (c) 2016 Jeff Mahoney <jeffm@suse.com>
+ * Copyright (c) 2016-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#ifdef HAVE_LINUX_BTRFS_H
+
+# include DEF_MPERS_TYPE(struct_btrfs_ioctl_dev_replace_args)
+# include DEF_MPERS_TYPE(struct_btrfs_ioctl_send_args)
+# include DEF_MPERS_TYPE(struct_btrfs_ioctl_received_subvol_args)
+# include DEF_MPERS_TYPE(struct_btrfs_ioctl_timespec)
+# include DEF_MPERS_TYPE(struct_btrfs_ioctl_vol_args_v2)
+
+# include <linux/btrfs.h>
+
+typedef struct btrfs_ioctl_dev_replace_args
+ struct_btrfs_ioctl_dev_replace_args;
+typedef struct btrfs_ioctl_send_args
+ struct_btrfs_ioctl_send_args;
+typedef struct btrfs_ioctl_received_subvol_args
+ struct_btrfs_ioctl_received_subvol_args;
+typedef struct btrfs_ioctl_timespec
+ struct_btrfs_ioctl_timespec;
+typedef struct btrfs_ioctl_vol_args_v2
+ struct_btrfs_ioctl_vol_args_v2;
+
+#endif /* HAVE_LINUX_BTRFS_H */
+
+#include MPERS_DEFS
+
+#ifdef HAVE_LINUX_BTRFS_H
+
+# include "types/btrfs.h"
+# include <linux/fs.h>
+
+/*
+ * Prior to Linux 3.12, the BTRFS_IOC_DEFAULT_SUBVOL used u64 in
+ * its definition, which isn't exported by the kernel.
+ */
+typedef __u64 u64;
+
+# ifndef HAVE_STRUCT_BTRFS_IOCTL_FEATURE_FLAGS_COMPAT_FLAGS
+struct btrfs_ioctl_feature_flags {
+ uint64_t compat_flags;
+ uint64_t compat_ro_flags;
+ uint64_t incompat_flags;
+};
+# endif
+
+# ifndef HAVE_STRUCT_BTRFS_IOCTL_DEFRAG_RANGE_ARGS_START
+struct btrfs_ioctl_defrag_range_args {
+ uint64_t start;
+ uint64_t len;
+ uint64_t flags;
+ uint32_t extent_thresh;
+ uint32_t compress_type;
+ uint32_t unused[4];
+};
+# endif
+
+# ifndef BTRFS_LABEL_SIZE
+# define BTRFS_LABEL_SIZE 256
+# endif
+
+# ifndef BTRFS_IOC_QUOTA_RESCAN
+struct btrfs_ioctl_quota_rescan_args {
+ uint64_t flags, progress, reserved[6];
+};
+# define BTRFS_IOC_QUOTA_RESCAN _IOW(BTRFS_IOCTL_MAGIC, 44, \
+ struct btrfs_ioctl_quota_rescan_args)
+# define BTRFS_IOC_QUOTA_RESCAN_STATUS _IOR(BTRFS_IOCTL_MAGIC, 45, \
+ struct btrfs_ioctl_quota_rescan_args)
+# endif
+
+# ifndef BTRFS_IOC_QUOTA_RESCAN_WAIT
+# define BTRFS_IOC_QUOTA_RESCAN_WAIT _IO(BTRFS_IOCTL_MAGIC, 46)
+# endif
+
+# ifndef BTRFS_IOC_GET_FEATURES
+# define BTRFS_IOC_GET_FEATURES _IOR(BTRFS_IOCTL_MAGIC, 57, \
+ struct btrfs_ioctl_feature_flags)
+# define BTRFS_IOC_SET_FEATURES _IOW(BTRFS_IOCTL_MAGIC, 57, \
+ struct btrfs_ioctl_feature_flags[2])
+# define BTRFS_IOC_GET_SUPPORTED_FEATURES _IOR(BTRFS_IOCTL_MAGIC, 57, \
+ struct btrfs_ioctl_feature_flags[3])
+# endif
+
+# ifndef BTRFS_IOC_TREE_SEARCH_V2
+# define BTRFS_IOC_TREE_SEARCH_V2 _IOWR(BTRFS_IOCTL_MAGIC, 17, \
+ struct btrfs_ioctl_search_args_v2)
+struct btrfs_ioctl_search_args_v2 {
+ struct btrfs_ioctl_search_key key; /* in/out - search parameters */
+ uint64_t buf_size; /* in - size of buffer
+ * out - on EOVERFLOW: needed size
+ * to store item */
+ uint64_t buf[0]; /* out - found items */
+};
+# endif
+
+# include "xlat/btrfs_balance_args.h"
+# include "xlat/btrfs_balance_ctl_cmds.h"
+# include "xlat/btrfs_balance_flags.h"
+# include "xlat/btrfs_balance_state.h"
+# include "xlat/btrfs_compress_types.h"
+# include "xlat/btrfs_cont_reading_from_srcdev_mode.h"
+# include "xlat/btrfs_defrag_flags.h"
+# include "xlat/btrfs_dev_replace_cmds.h"
+# include "xlat/btrfs_dev_replace_results.h"
+# include "xlat/btrfs_dev_replace_state.h"
+# include "xlat/btrfs_dev_stats_flags.h"
+# include "xlat/btrfs_dev_stats_values.h"
+# include "xlat/btrfs_features_compat.h"
+# include "xlat/btrfs_features_compat_ro.h"
+# include "xlat/btrfs_features_incompat.h"
+# include "xlat/btrfs_key_types.h"
+# include "xlat/btrfs_logical_ino_args_flags.h"
+# include "xlat/btrfs_qgroup_ctl_cmds.h"
+# include "xlat/btrfs_qgroup_inherit_flags.h"
+# include "xlat/btrfs_qgroup_limit_flags.h"
+# include "xlat/btrfs_qgroup_status_flags.h"
+# include "xlat/btrfs_scrub_flags.h"
+# include "xlat/btrfs_send_flags.h"
+# include "xlat/btrfs_snap_flags_v2.h"
+# include "xlat/btrfs_space_info_flags.h"
+# include "xlat/btrfs_tree_objectids.h"
+
+static void
+btrfs_print_balance_args(const struct btrfs_balance_args *const bba)
+{
+ tprint_struct_begin();
+ PRINT_FIELD_FLAGS(*bba, profiles, btrfs_space_info_flags,
+ "BTRFS_BLOCK_GROUP_???");
+ tprint_struct_next();
+ PRINT_FIELD_U64(*bba, usage);
+ tprint_struct_next();
+ PRINT_FIELD_DEV(*bba, devid);
+ tprint_struct_next();
+ PRINT_FIELD_U64(*bba, pstart);
+ tprint_struct_next();
+ PRINT_FIELD_U64(*bba, pend);
+ tprint_struct_next();
+ PRINT_FIELD_U64(*bba, vstart);
+ tprint_struct_next();
+ PRINT_FIELD_U64(*bba, vend);
+ tprint_struct_next();
+ PRINT_FIELD_U64(*bba, target);
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(*bba, flags, btrfs_balance_args,
+ "BTRFS_BALANCE_ARGS_???");
+ tprint_struct_end();
+}
+
+static void
+btrfs_print_balance(struct tcb *const tcp, const kernel_ulong_t arg, bool out)
+{
+ struct btrfs_ioctl_balance_args balance_args;
+
+ if (umove_or_printaddr(tcp, arg, &balance_args))
+ return;
+
+ tprint_struct_begin();
+ PRINT_FIELD_FLAGS(balance_args, flags, btrfs_balance_flags,
+ "BTRFS_BALANCE_???");
+ if (out) {
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(balance_args, state,
+ btrfs_balance_state,
+ "BTRFS_BALANCE_STATE_???");
+ }
+
+ if (balance_args.flags & BTRFS_BALANCE_DATA) {
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_PTR(balance_args, data,
+ btrfs_print_balance_args);
+ }
+ if (balance_args.flags & BTRFS_BALANCE_METADATA) {
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_PTR(balance_args, meta,
+ btrfs_print_balance_args);
+ }
+ if (balance_args.flags & BTRFS_BALANCE_SYSTEM) {
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_PTR(balance_args, sys,
+ btrfs_print_balance_args);
+ }
+ tprint_struct_end();
+}
+
+static void
+btrfs_print_features(const struct btrfs_ioctl_feature_flags *flags)
+{
+ tprint_struct_begin();
+ PRINT_FIELD_FLAGS(*flags, compat_flags, btrfs_features_compat,
+ "BTRFS_FEATURE_COMPAT_???");
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(*flags, compat_ro_flags,
+ btrfs_features_compat_ro,
+ "BTRFS_FEATURE_COMPAT_RO_???");
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(*flags, incompat_flags, btrfs_features_incompat,
+ "BTRFS_FEATURE_INCOMPAT_???");
+ tprint_struct_end();
+}
+
+static void
+btrfs_print_qgroup_limit(const struct btrfs_qgroup_limit *lim)
+{
+ tprint_struct_begin();
+ PRINT_FIELD_FLAGS(*lim, flags, btrfs_qgroup_limit_flags,
+ "BTRFS_QGROUP_LIMIT_???");
+ tprint_struct_next();
+ PRINT_FIELD_U(*lim, max_rfer);
+ tprint_struct_next();
+ PRINT_FIELD_U(*lim, max_excl);
+ tprint_struct_next();
+ PRINT_FIELD_U(*lim, rsv_rfer);
+ tprint_struct_next();
+ PRINT_FIELD_U(*lim, rsv_excl);
+ tprint_struct_end();
+}
+
+# define btrfs_print_key_type(where_, field_) \
+ PRINT_FIELD_XVAL_U((where_), field_, btrfs_key_types, NULL)
+# define btrfs_print_objectid(where_, field_) \
+ PRINT_FIELD_XVAL_U((where_), field_, btrfs_tree_objectids, NULL)
+
+static void
+btrfs_print_data_container_header(const struct btrfs_data_container *container)
+{
+ tprint_struct_begin();
+ PRINT_FIELD_U(*container, bytes_left);
+ tprint_struct_next();
+ PRINT_FIELD_U(*container, bytes_missing);
+ tprint_struct_next();
+ PRINT_FIELD_U(*container, elem_cnt);
+ tprint_struct_next();
+ PRINT_FIELD_U(*container, elem_missed);
+}
+
+static void
+btrfs_print_data_container_footer(void)
+{
+ tprint_struct_end();
+}
+
+static bool
+print_btrfs_data_container_logical_ino(struct tcb *tcp, void *elem_buf,
+ size_t elem_size, void *data)
+{
+ const struct {
+ uint64_t inum;
+ uint64_t offset;
+ uint64_t root;
+ } *const record = elem_buf;
+
+ tprint_struct_begin();
+ PRINT_FIELD_U(*record, inum);
+ tprint_struct_next();
+ PRINT_FIELD_U(*record, offset);
+ tprint_struct_next();
+ PRINT_FIELD_U(*record, root);
+ tprint_struct_end();
+
+ return true;
+}
+
+static void
+btrfs_print_logical_ino_container(struct tcb *tcp,
+ const uint64_t inodes_addr)
+{
+ struct btrfs_data_container container;
+
+ if (umove_or_printaddr(tcp, inodes_addr, &container))
+ return;
+
+ btrfs_print_data_container_header(&container);
+
+ if (abbrev(tcp)) {
+ tprint_struct_next();
+ tprint_more_data_follows();
+ } else {
+ const uint64_t val_addr =
+ inodes_addr + offsetof(typeof(container), val);
+ uint64_t record[3];
+ tprint_struct_next();
+ tprints_field_name("val");
+ print_array(tcp, val_addr, container.elem_cnt / 3,
+ record, sizeof(record),
+ tfetch_mem,
+ print_btrfs_data_container_logical_ino, 0);
+ }
+
+ btrfs_print_data_container_footer();
+}
+
+static bool
+print_btrfs_data_container_ino_path(struct tcb *tcp, void *elem_buf,
+ size_t elem_size, void *data)
+{
+ const uint64_t *const offset = elem_buf;
+ const uint64_t *const val_addr = data;
+
+ printpath(tcp, *val_addr + *offset);
+
+ return true;
+}
+
+static void
+btrfs_print_ino_path_container(struct tcb *tcp,
+ const uint64_t fspath_addr)
+{
+ struct btrfs_data_container container;
+
+ if (umove_or_printaddr(tcp, fspath_addr, &container))
+ return;
+
+ btrfs_print_data_container_header(&container);
+
+ if (abbrev(tcp)) {
+ tprint_struct_next();
+ tprint_more_data_follows();
+ } else {
+ uint64_t val_addr =
+ fspath_addr + offsetof(typeof(container), val);
+ uint64_t offset;
+ tprint_struct_next();
+ tprints_field_name("val");
+ print_array(tcp, val_addr, container.elem_cnt,
+ &offset, sizeof(offset),
+ tfetch_mem,
+ print_btrfs_data_container_ino_path, &val_addr);
+ }
+
+ btrfs_print_data_container_footer();
+}
+
+static void
+btrfs_print_qgroup_inherit(struct tcb *const tcp, const kernel_ulong_t qgi_addr)
+{
+ struct btrfs_qgroup_inherit inherit;
+
+ if (umove_or_printaddr(tcp, qgi_addr, &inherit))
+ return;
+
+ tprint_struct_begin();
+ PRINT_FIELD_FLAGS(inherit, flags, btrfs_qgroup_inherit_flags,
+ "BTRFS_QGROUP_INHERIT_???");
+ tprint_struct_next();
+ PRINT_FIELD_U(inherit, num_qgroups);
+ tprint_struct_next();
+ PRINT_FIELD_U(inherit, num_ref_copies);
+ tprint_struct_next();
+ PRINT_FIELD_U(inherit, num_excl_copies);
+
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_PTR(inherit, lim, btrfs_print_qgroup_limit);
+
+ if (abbrev(tcp)) {
+ tprint_struct_next();
+ tprint_more_data_follows();
+ } else {
+ uint64_t record;
+ tprint_struct_next();
+ tprints_field_name("qgroups");
+ print_array(tcp, qgi_addr + offsetof(typeof(inherit), qgroups),
+ inherit.num_qgroups, &record, sizeof(record),
+ tfetch_mem, print_uint64_array_member, 0);
+ }
+ tprint_struct_end();
+}
+
+static void
+print_btrfs_ioctl_search_key(const struct btrfs_ioctl_search_key *const key,
+ const bool is_entering, const bool is_not_abbrev)
+{
+ tprint_struct_begin();
+ if (is_entering) {
+ btrfs_print_objectid(*key, tree_id);
+
+ if (key->min_objectid != BTRFS_FIRST_FREE_OBJECTID ||
+ is_not_abbrev) {
+ tprint_struct_next();
+ btrfs_print_objectid(*key, min_objectid);
+ }
+
+ if (key->max_objectid != BTRFS_LAST_FREE_OBJECTID ||
+ is_not_abbrev) {
+ tprint_struct_next();
+ btrfs_print_objectid(*key, max_objectid);
+ }
+
+ tprint_struct_next();
+ PRINT_FIELD_U64(*key, min_offset);
+ tprint_struct_next();
+ PRINT_FIELD_U64(*key, max_offset);
+ tprint_struct_next();
+ PRINT_FIELD_U64(*key, min_transid);
+ tprint_struct_next();
+ PRINT_FIELD_U64(*key, max_transid);
+
+ tprint_struct_next();
+ btrfs_print_key_type(*key, min_type);
+ tprint_struct_next();
+ btrfs_print_key_type(*key, max_type);
+ tprint_struct_next();
+ PRINT_FIELD_U(*key, nr_items);
+ } else {
+ PRINT_FIELD_U(*key, nr_items);
+ }
+ tprint_struct_end();
+}
+
+static void
+print_btrfs_ioctl_search_header(const struct btrfs_ioctl_search_header *p)
+{
+ tprint_struct_begin();
+ PRINT_FIELD_U(*p, transid);
+ tprint_struct_next();
+ btrfs_print_objectid(*p, objectid);
+ tprint_struct_next();
+ PRINT_FIELD_U(*p, offset);
+ tprint_struct_next();
+ btrfs_print_key_type(*p, type);
+ tprint_struct_next();
+ PRINT_FIELD_U(*p, len);
+ tprint_struct_end();
+}
+
+static void
+decode_search_arg_buf(struct tcb *tcp, kernel_ulong_t buf_addr, uint64_t buf_size,
+ unsigned int nr_items)
+{
+ if (entering(tcp))
+ return;
+ tprints(", ");
+ if (abbrev(tcp)) {
+ tprint_more_data_follows();
+ } else {
+ tprints_field_name("buf");
+ tprints("[");
+ uint64_t off = 0;
+ for (unsigned int i = 0; i < nr_items; ++i) {
+ if (i)
+ tprints(", ");
+ struct btrfs_ioctl_search_header sh;
+ uint64_t addr = buf_addr + off;
+ if (addr < buf_addr || off + sizeof(sh) > buf_size ||
+ i > max_strlen) {
+ tprint_more_data_follows();
+ break;
+ }
+ if (!tfetch_mem(tcp, addr, sizeof(sh), &sh)) {
+ tprint_more_data_follows();
+ printaddr_comment(addr);
+ break;
+ }
+ print_btrfs_ioctl_search_header(&sh);
+ off += sizeof(sh) + sh.len;
+
+ }
+ tprints("]");
+ }
+}
+
+static bool
+print_objectid_callback(struct tcb *tcp, void *elem_buf,
+ size_t elem_size, void *data)
+{
+ printxvals_ex(*(uint64_t *) elem_buf, NULL, XLAT_STYLE_FMT_U,
+ btrfs_tree_objectids, NULL);
+
+ return true;
+}
+
+static bool
+print_btrfs_ioctl_space_info(struct tcb *tcp, void *elem_buf,
+ size_t elem_size, void *data)
+{
+ const struct btrfs_ioctl_space_info *info = elem_buf;
+
+ tprint_struct_begin();
+ PRINT_FIELD_FLAGS(*info, flags, btrfs_space_info_flags,
+ "BTRFS_SPACE_INFO_???");
+ tprint_struct_next();
+ PRINT_FIELD_U(*info, total_bytes);
+ tprint_struct_next();
+ PRINT_FIELD_U(*info, used_bytes);
+ tprint_struct_end();
+
+ return true;
+}
+
+static void
+print_btrfs_timespec(const MPERS_PTR_ARG(struct_btrfs_ioctl_timespec *) const arg)
+{
+ const struct_btrfs_ioctl_timespec *const p = arg;
+ tprint_struct_begin();
+ PRINT_FIELD_U(*p, sec);
+ tprint_struct_next();
+ PRINT_FIELD_U(*p, nsec);
+ tprint_struct_end();
+ tprints_comment(sprinttime_nsec(p->sec, p->nsec));
+}
+
+static void
+print_btrfs_scrub_progress(const struct btrfs_scrub_progress *const p)
+{
+ tprint_struct_begin();
+ PRINT_FIELD_U(*p, data_extents_scrubbed);
+ tprint_struct_next();
+ PRINT_FIELD_U(*p, tree_extents_scrubbed);
+ tprint_struct_next();
+ PRINT_FIELD_U(*p, data_bytes_scrubbed);
+ tprint_struct_next();
+ PRINT_FIELD_U(*p, tree_bytes_scrubbed);
+ tprint_struct_next();
+ PRINT_FIELD_U(*p, read_errors);
+ tprint_struct_next();
+ PRINT_FIELD_U(*p, csum_errors);
+ tprint_struct_next();
+ PRINT_FIELD_U(*p, verify_errors);
+ tprint_struct_next();
+ PRINT_FIELD_U(*p, no_csum);
+ tprint_struct_next();
+ PRINT_FIELD_U(*p, csum_discards);
+ tprint_struct_next();
+ PRINT_FIELD_U(*p, super_errors);
+ tprint_struct_next();
+ PRINT_FIELD_U(*p, malloc_errors);
+ tprint_struct_next();
+ PRINT_FIELD_U(*p, uncorrectable_errors);
+ tprint_struct_next();
+ PRINT_FIELD_U(*p, corrected_errors);
+ tprint_struct_next();
+ PRINT_FIELD_U(*p, last_physical);
+ tprint_struct_next();
+ PRINT_FIELD_U(*p, unverified_errors);
+ tprint_struct_end();
+}
+
+static void
+print_btrfs_replace_start_params(const typeof_field(struct_btrfs_ioctl_dev_replace_args, start) *const p)
+{
+ tprint_struct_begin();
+ PRINT_FIELD_DEV(*p, srcdevid);
+ tprint_struct_next();
+ PRINT_FIELD_XVAL(*p, cont_reading_from_srcdev_mode,
+ btrfs_cont_reading_from_srcdev_mode,
+ "BTRFS_IOCTL_DEV_REPLACE_CONT_READING"
+ "_FROM_SRCDEV_MODE_???");
+ tprint_struct_next();
+ PRINT_FIELD_CSTRING(*p, srcdev_name);
+ tprint_struct_next();
+ PRINT_FIELD_CSTRING(*p, tgtdev_name);
+ tprint_struct_end();
+}
+
+static void
+print_btrfs_replace_status_params(const typeof_field(struct_btrfs_ioctl_dev_replace_args, status) *const p)
+{
+ tprint_struct_begin();
+ PRINT_FIELD_XVAL(*p, replace_state, btrfs_dev_replace_state,
+ "BTRFS_IOCTL_DEV_REPLACE_STATE_???");
+
+ tprint_struct_next();
+ PRINT_FIELD_U(*p, progress_1000);
+ if (p->progress_1000 <= 1000)
+ tprintf_comment("%u.%u%%",
+ (unsigned) p->progress_1000 / 10,
+ (unsigned) p->progress_1000 % 10);
+
+ tprint_struct_next();
+ PRINT_FIELD_U(*p, time_started);
+ tprints_comment(sprinttime(p->time_started));
+
+ tprint_struct_next();
+ PRINT_FIELD_U(*p, time_stopped);
+ tprints_comment(sprinttime(p->time_stopped));
+
+ tprint_struct_next();
+ PRINT_FIELD_U(*p, num_write_errors);
+ tprint_struct_next();
+ PRINT_FIELD_U(*p, num_uncorrectable_read_errors);
+ tprint_struct_end();
+}
+
+MPERS_PRINTER_DECL(int, btrfs_ioctl,
+ struct tcb *const tcp, const unsigned int code,
+ const kernel_ulong_t arg)
+{
+ switch (code) {
+ /* Take no arguments; command only. */
+ case BTRFS_IOC_TRANS_START:
+ case BTRFS_IOC_TRANS_END:
+ case BTRFS_IOC_SYNC:
+ case BTRFS_IOC_SCRUB_CANCEL:
+ case BTRFS_IOC_QUOTA_RESCAN_WAIT:
+ /*
+ * The codes for these ioctls are based on each accepting a
+ * vol_args but none of them actually consume an argument.
+ */
+ case BTRFS_IOC_DEFRAG:
+ case BTRFS_IOC_BALANCE:
+ break;
+
+ /* takes a signed int */
+ case BTRFS_IOC_BALANCE_CTL:
+ tprints(", ");
+ printxval(btrfs_balance_ctl_cmds, arg, "BTRFS_BALANCE_CTL_???");
+ break;
+
+ /* returns a 64 */
+ case BTRFS_IOC_START_SYNC: /* R */
+ if (entering(tcp))
+ return 0;
+ ATTRIBUTE_FALLTHROUGH;
+ /* takes a u64 */
+ case BTRFS_IOC_DEFAULT_SUBVOL: /* W */
+ case BTRFS_IOC_WAIT_SYNC: /* W */
+ tprints(", ");
+ printnum_int64(tcp, arg, "%" PRIu64);
+ break;
+
+ /* u64 but describe a flags bitfield; we can make that symbolic */
+ case BTRFS_IOC_SUBVOL_GETFLAGS: { /* R */
+ uint64_t flags;
+
+ if (entering(tcp))
+ return 0;
+
+ tprints(", ");
+
+ if (umove_or_printaddr(tcp, arg, &flags))
+ break;
+
+ printflags64(btrfs_snap_flags_v2, flags, "BTRFS_SUBVOL_???");
+ break;
+ }
+
+ case BTRFS_IOC_SUBVOL_SETFLAGS: { /* W */
+ uint64_t flags;
+
+ tprints(", ");
+
+ if (umove_or_printaddr(tcp, arg, &flags))
+ break;
+
+ printflags64(btrfs_snap_flags_v2, flags, "BTRFS_SUBVOL_???");
+ break;
+ }
+
+ /* More complex types */
+ case BTRFS_IOC_BALANCE_V2: /* RW */
+ if (entering(tcp)) {
+ tprints(", ");
+ btrfs_print_balance(tcp, arg, false);
+ return 0;
+ }
+
+ if (syserror(tcp))
+ break;
+
+ tprint_value_changed();
+ btrfs_print_balance(tcp, arg, true);
+ break;
+ case BTRFS_IOC_BALANCE_PROGRESS: /* R */
+ if (entering(tcp))
+ return 0;
+
+ tprints(", ");
+ btrfs_print_balance(tcp, arg, true);
+ break;
+
+ case BTRFS_IOC_DEFRAG_RANGE: { /* W */
+ struct btrfs_ioctl_defrag_range_args args;
+
+ tprints(", ");
+
+ if (umove_or_printaddr(tcp, arg, &args))
+ break;
+
+ tprint_struct_begin();
+ PRINT_FIELD_U(args, start);
+ tprint_struct_next();
+ PRINT_FIELD_U64(args, len);
+
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(args, flags, btrfs_defrag_flags,
+ "BTRFS_DEFRAG_RANGE_???");
+ tprint_struct_next();
+ PRINT_FIELD_U(args, extent_thresh);
+ tprint_struct_next();
+ PRINT_FIELD_XVAL(args, compress_type,
+ btrfs_compress_types, "BTRFS_COMPRESS_???");
+ tprint_struct_end();
+ break;
+ }
+
+ case BTRFS_IOC_DEV_INFO: { /* RW */
+ struct btrfs_ioctl_dev_info_args args;
+
+ if (entering(tcp))
+ tprints(", ");
+ else if (syserror(tcp))
+ break;
+ else
+ tprint_value_changed();
+ if (umove_or_printaddr(tcp, arg, &args))
+ break;
+
+ if (entering(tcp)) {
+ tprint_struct_begin();
+ PRINT_FIELD_DEV(args, devid);
+ if (!IS_ARRAY_ZERO(args.uuid)) {
+ tprint_struct_next();
+ PRINT_FIELD_UUID(args, uuid);
+ }
+ tprint_struct_end();
+ return 0;
+ }
+
+ tprint_struct_begin();
+
+ if (!IS_ARRAY_ZERO(args.uuid)) {
+ PRINT_FIELD_UUID(args, uuid);
+ tprints(", ");
+ }
+
+ PRINT_FIELD_U(args, bytes_used);
+ tprint_struct_next();
+ PRINT_FIELD_U(args, total_bytes);
+ tprint_struct_next();
+ PRINT_FIELD_CSTRING(args, path);
+ tprint_struct_end();
+
+ break;
+ }
+
+ case BTRFS_IOC_DEV_REPLACE: { /* RW */
+ struct_btrfs_ioctl_dev_replace_args args;
+
+ if (entering(tcp))
+ tprints(", ");
+ else if (syserror(tcp))
+ break;
+ else
+ tprint_value_changed();
+
+ if (umove_or_printaddr(tcp, arg, &args))
+ break;
+
+ if (entering(tcp)) {
+ tprint_struct_begin();
+ PRINT_FIELD_XVAL(args, cmd, btrfs_dev_replace_cmds,
+ "BTRFS_IOCTL_DEV_REPLACE_CMD_???");
+ if (args.cmd == BTRFS_IOCTL_DEV_REPLACE_CMD_START) {
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_PTR(args, start,
+ print_btrfs_replace_start_params);
+ }
+ tprint_struct_end();
+ return 0;
+ }
+
+ tprint_struct_begin();
+ PRINT_FIELD_XVAL(args, result, btrfs_dev_replace_results,
+ "BTRFS_IOCTL_DEV_REPLACE_RESULT_???");
+ if (args.cmd == BTRFS_IOCTL_DEV_REPLACE_CMD_STATUS) {
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_PTR(args, status,
+ print_btrfs_replace_status_params);
+ }
+ tprint_struct_end();
+ break;
+ }
+
+ case BTRFS_IOC_GET_FEATURES: { /* R */
+ struct btrfs_ioctl_feature_flags flags;
+
+ if (entering(tcp))
+ return 0;
+
+ tprints(", ");
+ if (umove_or_printaddr(tcp, arg, &flags))
+ break;
+
+ btrfs_print_features(&flags);
+ break;
+ }
+
+ case BTRFS_IOC_SET_FEATURES: { /* W */
+ struct btrfs_ioctl_feature_flags flarg[2];
+
+ tprints(", ");
+
+ if (umove_or_printaddr(tcp, arg, &flarg))
+ break;
+
+ tprints("[");
+ btrfs_print_features(&flarg[0]);
+ tprints(", ");
+ btrfs_print_features(&flarg[1]);
+ tprints("]");
+ break;
+ }
+
+ case BTRFS_IOC_GET_SUPPORTED_FEATURES: { /* R */
+ struct btrfs_ioctl_feature_flags flarg[3];
+
+ if (entering(tcp))
+ return 0;
+
+ tprints(", ");
+ if (umove_or_printaddr(tcp, arg, &flarg))
+ break;
+
+ tprints("[");
+ btrfs_print_features(&flarg[0]);
+ tprints_comment("supported");
+
+ tprints(", ");
+ btrfs_print_features(&flarg[1]);
+ tprints_comment("safe to set");
+
+ tprints(", ");
+ btrfs_print_features(&flarg[2]);
+ tprints_comment("safe to clear");
+ tprints("]");
+
+ break;
+ }
+
+ case BTRFS_IOC_FS_INFO: { /* R */
+ struct btrfs_ioctl_fs_info_args args;
+ uint32_t nodesize, sectorsize, clone_alignment;
+# ifndef HAVE_STRUCT_BTRFS_IOCTL_FS_INFO_ARGS_NODESIZE
+ uint32_t *reserved32;
+# endif
+
+ if (entering(tcp))
+ return 0;
+
+ tprints(", ");
+ if (umove_or_printaddr(tcp, arg, &args))
+ break;
+
+# ifdef HAVE_STRUCT_BTRFS_IOCTL_FS_INFO_ARGS_NODESIZE
+ nodesize = args.nodesize,
+ sectorsize = args.sectorsize,
+ clone_alignment = args.clone_alignment;
+# else
+ reserved32 = (void *) args.reserved;
+ nodesize = reserved32[0];
+ sectorsize = reserved32[1];
+ clone_alignment = reserved32[2];
+# endif
+ tprint_struct_begin();
+ PRINT_FIELD_U(args, max_id);
+ tprint_struct_next();
+ PRINT_FIELD_U(args, num_devices);
+ tprint_struct_next();
+ PRINT_FIELD_UUID(args, fsid);
+ tprint_struct_next();
+ tprints_field_name("nodesize");
+ tprintf("%u", nodesize);
+ tprint_struct_next();
+ tprints_field_name("sectorsize");
+ tprintf("%u", sectorsize);
+ tprint_struct_next();
+ tprints_field_name("clone_alignment");
+ tprintf("%u", clone_alignment);
+ tprint_struct_end();
+ break;
+ }
+
+ case BTRFS_IOC_GET_DEV_STATS: { /* RW */
+ struct btrfs_ioctl_get_dev_stats args;
+ uint64_t i;
+
+ if (entering(tcp))
+ tprints(", ");
+ else if (syserror(tcp))
+ break;
+ else
+ tprint_value_changed();
+ if (umove_or_printaddr(tcp, arg, &args))
+ break;
+
+ tprint_struct_begin();
+
+ if (entering(tcp)) {
+ PRINT_FIELD_DEV(args, devid);
+ tprints(", ");
+ }
+
+ PRINT_FIELD_U(args, nr_items);
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(args, flags, btrfs_dev_stats_flags,
+ "BTRFS_DEV_STATS_???");
+
+ if (entering(tcp)) {
+ tprint_struct_end();
+ return 0;
+ }
+
+ /*
+ * The structure has a 1k limit; Let's make sure we don't
+ * go off into the middle of nowhere with a bad nr_items
+ * value.
+ */
+ tprints(", [");
+ for (i = 0; i < args.nr_items; i++) {
+ if (i)
+ tprints(", ");
+ if (i >= ARRAY_SIZE(args.values)) {
+ tprint_more_data_follows();
+ break;
+ }
+
+ tprints("[");
+ printxval_u(btrfs_dev_stats_values, i, NULL);
+ tprintf("] = %" PRI__u64, args.values[i]);
+ }
+ tprints("]");
+ tprint_struct_end();
+ break;
+ }
+
+ case BTRFS_IOC_INO_LOOKUP: { /* RW */
+ struct btrfs_ioctl_ino_lookup_args args;
+
+ if (entering(tcp))
+ tprints(", ");
+ else if (syserror(tcp))
+ break;
+ else
+ tprint_value_changed();
+
+ if (umove_or_printaddr(tcp, arg, &args))
+ break;
+
+ if (entering(tcp)) {
+ /* Use subvolume id of the containing root */
+ if (args.treeid == 0)
+ set_tcb_priv_ulong(tcp, 1);
+
+ tprint_struct_begin();
+ btrfs_print_objectid(args, treeid);
+ tprint_struct_next();
+ btrfs_print_objectid(args, objectid);
+ tprint_struct_end();
+ return 0;
+ }
+
+ tprint_struct_begin();
+ if (get_tcb_priv_ulong(tcp)) {
+ btrfs_print_objectid(args, treeid);
+ tprints(", ");
+ }
+
+ PRINT_FIELD_CSTRING(args, name);
+ tprint_struct_end();
+ break;
+ }
+
+ case BTRFS_IOC_INO_PATHS: { /* RW */
+ struct btrfs_ioctl_ino_path_args args;
+
+ if (entering(tcp))
+ tprints(", ");
+ else if (syserror(tcp))
+ break;
+ else
+ tprint_value_changed();
+
+ if (umove_or_printaddr(tcp, arg, &args))
+ break;
+
+ if (entering(tcp)) {
+ tprint_struct_begin();
+ PRINT_FIELD_U(args, inum);
+ tprint_struct_next();
+ PRINT_FIELD_U(args, size);
+ tprint_struct_next();
+ PRINT_FIELD_ADDR64(args, fspath);
+ tprint_struct_end();
+ return 0;
+ }
+
+ tprint_struct_begin();
+ PRINT_FIELD_OBJ_TCB_VAL(args, fspath, tcp,
+ btrfs_print_ino_path_container);
+ tprint_struct_end();
+ break;
+ }
+
+ case BTRFS_IOC_LOGICAL_INO: { /* RW */
+ struct_btrfs_ioctl_logical_ino_args args;
+
+ if (entering(tcp))
+ tprints(", ");
+ else if (syserror(tcp))
+ break;
+ else
+ tprint_value_changed();
+
+ if (umove_or_printaddr(tcp, arg, &args))
+ break;
+
+ if (entering(tcp)) {
+ tprint_struct_begin();
+ PRINT_FIELD_U(args, logical);
+ tprint_struct_next();
+ PRINT_FIELD_U(args, size);
+
+ if (!IS_ARRAY_ZERO(args.reserved)) {
+ tprint_struct_next();
+ PRINT_FIELD_X_ARRAY(args, reserved);
+ }
+
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(args, flags,
+ btrfs_logical_ino_args_flags,
+ "BTRFS_LOGICAL_INO_ARGS_???");
+ tprint_struct_next();
+ PRINT_FIELD_ADDR64(args, inodes);
+ tprint_struct_end();
+ return 0;
+ }
+
+ tprint_struct_begin();
+ PRINT_FIELD_OBJ_TCB_VAL(args, inodes, tcp,
+ btrfs_print_logical_ino_container);
+
+ tprint_struct_end();
+ break;
+ }
+
+ case BTRFS_IOC_QGROUP_ASSIGN: { /* W */
+ struct btrfs_ioctl_qgroup_assign_args args;
+
+ tprints(", ");
+ if (umove_or_printaddr(tcp, arg, &args))
+ break;
+
+ tprint_struct_begin();
+ PRINT_FIELD_U(args, assign);
+ tprint_struct_next();
+ PRINT_FIELD_U(args, src);
+ tprint_struct_next();
+ PRINT_FIELD_U(args, dst);
+ tprint_struct_end();
+ break;
+ }
+
+ case BTRFS_IOC_QGROUP_CREATE: { /* W */
+ struct btrfs_ioctl_qgroup_create_args args;
+
+ tprints(", ");
+ if (umove_or_printaddr(tcp, arg, &args))
+ break;
+
+ tprint_struct_begin();
+ PRINT_FIELD_U(args, create);
+ tprint_struct_next();
+ PRINT_FIELD_U(args, qgroupid);
+ tprint_struct_end();
+ break;
+ }
+
+ case BTRFS_IOC_QGROUP_LIMIT: { /* R */
+ struct btrfs_ioctl_qgroup_limit_args args;
+
+ if (entering(tcp))
+ return 0;
+
+ tprints(", ");
+ if (umove_or_printaddr(tcp, arg, &args))
+ break;
+
+ tprint_struct_begin();
+ PRINT_FIELD_U(args, qgroupid);
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_PTR(args, lim, btrfs_print_qgroup_limit);
+ tprint_struct_end();
+ break;
+ }
+
+ case BTRFS_IOC_QUOTA_CTL: { /* W */
+ struct btrfs_ioctl_quota_ctl_args args;
+
+ tprints(", ");
+ if (umove_or_printaddr(tcp, arg, &args))
+ break;
+
+ tprint_struct_begin();
+ PRINT_FIELD_XVAL(args, cmd, btrfs_qgroup_ctl_cmds,
+ "BTRFS_QUOTA_CTL_???");
+ tprint_struct_end();
+
+ break;
+ }
+
+ case BTRFS_IOC_QUOTA_RESCAN: { /* W */
+ struct btrfs_ioctl_quota_rescan_args args;
+
+ tprints(", ");
+ if (umove_or_printaddr(tcp, arg, &args))
+ break;
+
+ tprint_struct_begin();
+ PRINT_FIELD_U(args, flags);
+ tprint_struct_end();
+ break;
+ }
+
+ case BTRFS_IOC_QUOTA_RESCAN_STATUS: { /* R */
+ struct btrfs_ioctl_quota_rescan_args args;
+
+ if (entering(tcp))
+ return 0;
+
+ tprints(", ");
+ if (umove_or_printaddr(tcp, arg, &args))
+ break;
+
+ tprint_struct_begin();
+ PRINT_FIELD_U(args, flags);
+ tprint_struct_next();
+ btrfs_print_objectid(args, progress);
+ tprint_struct_end();
+ break;
+ }
+
+ case BTRFS_IOC_SET_RECEIVED_SUBVOL: { /* RW */
+ struct_btrfs_ioctl_received_subvol_args args;
+
+ if (entering(tcp))
+ tprints(", ");
+ else if (syserror(tcp))
+ break;
+ else
+ tprint_value_changed();
+
+ if (umove_or_printaddr(tcp, arg, &args))
+ break;
+
+ if (entering(tcp)) {
+ tprint_struct_begin();
+ PRINT_FIELD_UUID(args, uuid);
+ tprint_struct_next();
+ PRINT_FIELD_U(args, stransid);
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_PTR(args, stime,
+ print_btrfs_timespec);
+ tprint_struct_next();
+ PRINT_FIELD_U(args, flags);
+ tprint_struct_end();
+ return 0;
+ }
+ tprint_struct_begin();
+ PRINT_FIELD_U(args, rtransid);
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_PTR(args, rtime, print_btrfs_timespec);
+ tprint_struct_end();
+ break;
+ }
+
+ case BTRFS_IOC_SCRUB: /* RW */
+ case BTRFS_IOC_SCRUB_PROGRESS: { /* RW */
+ struct btrfs_ioctl_scrub_args args;
+
+ if (entering(tcp))
+ tprints(", ");
+ else if (syserror(tcp))
+ break;
+ else
+ tprint_value_changed();
+
+ if (umove_or_printaddr(tcp, arg, &args))
+ break;
+
+ if (entering(tcp)) {
+ tprint_struct_begin();
+ PRINT_FIELD_DEV(args, devid);
+ if (code == BTRFS_IOC_SCRUB) {
+ tprint_struct_next();
+ PRINT_FIELD_U(args, start);
+ tprint_struct_next();
+ PRINT_FIELD_U64(args, end);
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(args, flags,
+ btrfs_scrub_flags,
+ "BTRFS_SCRUB_???");
+ }
+ tprint_struct_end();
+ return 0;
+ }
+ tprint_struct_begin();
+ PRINT_FIELD_OBJ_PTR(args, progress,
+ print_btrfs_scrub_progress);
+ tprint_struct_end();
+ break;
+ }
+
+ case BTRFS_IOC_TREE_SEARCH: { /* RW */
+ struct btrfs_ioctl_search_args args;
+
+ if (entering(tcp))
+ tprints(", ");
+ else if (syserror(tcp))
+ break;
+ else
+ tprint_value_changed();
+
+ if (umove_or_printaddr(tcp, arg, &args.key))
+ break;
+
+ tprint_struct_begin();
+ PRINT_FIELD_OBJ_PTR(args, key,
+ print_btrfs_ioctl_search_key,
+ entering(tcp), !abbrev(tcp));
+ decode_search_arg_buf(tcp, arg + offsetof(typeof(args), buf),
+ sizeof(args.buf), args.key.nr_items);
+ tprint_struct_end();
+ if (entering(tcp))
+ return 0;
+ break;
+ }
+
+ case BTRFS_IOC_TREE_SEARCH_V2: { /* RW */
+ struct btrfs_ioctl_search_args_v2 args;
+
+ if (entering(tcp))
+ tprints(", ");
+ else if (syserror(tcp)) {
+ if (tcp->u_error == EOVERFLOW) {
+ tprint_value_changed();
+ if (!umove_or_printaddr_ignore_syserror(tcp,
+ arg, &args)) {
+ tprint_struct_begin();
+ PRINT_FIELD_U(args, buf_size);
+ tprint_struct_end();
+ }
+ }
+ break;
+ } else
+ tprint_value_changed();
+
+ if (umove_or_printaddr(tcp, arg, &args))
+ break;
+
+ tprint_struct_begin();
+ PRINT_FIELD_OBJ_PTR(args, key,
+ print_btrfs_ioctl_search_key,
+ entering(tcp), !abbrev(tcp));
+ tprint_struct_next();
+ PRINT_FIELD_U(args, buf_size);
+ decode_search_arg_buf(tcp, arg + offsetof(typeof(args), buf),
+ args.buf_size, args.key.nr_items);
+ tprint_struct_end();
+ if (entering(tcp))
+ return 0;
+ break;
+ }
+
+ case BTRFS_IOC_SEND: { /* W */
+ struct_btrfs_ioctl_send_args args;
+
+ tprints(", ");
+ if (umove_or_printaddr(tcp, arg, &args))
+ break;
+
+ tprint_struct_begin();
+ PRINT_FIELD_FD(args, send_fd, tcp);
+ tprint_struct_next();
+ PRINT_FIELD_U(args, clone_sources_count);
+
+ if (abbrev(tcp)) {
+ tprint_struct_next();
+ PRINT_FIELD_PTR(args, clone_sources);
+ } else {
+ tprint_struct_next();
+ tprints_field_name("clone_sources");
+ uint64_t record;
+ print_array(tcp, ptr_to_kulong(args.clone_sources),
+ args.clone_sources_count,
+ &record, sizeof(record),
+ tfetch_mem,
+ print_objectid_callback, 0);
+ }
+ tprint_struct_next();
+ btrfs_print_objectid(args, parent_root);
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(args, flags, btrfs_send_flags,
+ "BTRFS_SEND_FLAGS_???");
+ tprint_struct_end();
+ break;
+ }
+
+ case BTRFS_IOC_SPACE_INFO: { /* RW */
+ struct btrfs_ioctl_space_args args;
+
+ if (entering(tcp))
+ tprints(", ");
+ else if (syserror(tcp))
+ break;
+ else
+ tprint_value_changed();
+
+ if (umove_or_printaddr(tcp, arg, &args))
+ break;
+
+ if (entering(tcp)) {
+ tprint_struct_begin();
+ PRINT_FIELD_U(args, space_slots);
+ tprint_struct_end();
+ return 0;
+ }
+
+ tprint_struct_begin();
+ PRINT_FIELD_U(args, total_spaces);
+
+ if (args.space_slots == 0 && args.total_spaces) {
+ tprint_struct_end();
+ break;
+ }
+
+ if (abbrev(tcp)) {
+ tprint_struct_next();
+ tprint_more_data_follows();
+ } else {
+ struct btrfs_ioctl_space_info info;
+ tprint_struct_next();
+ tprints_field_name("spaces");
+ print_array(tcp, arg + offsetof(typeof(args), spaces),
+ args.total_spaces,
+ &info, sizeof(info), tfetch_mem,
+ print_btrfs_ioctl_space_info, 0);
+ }
+ tprint_struct_end();
+ break;
+ }
+
+ case BTRFS_IOC_SNAP_CREATE:
+ case BTRFS_IOC_RESIZE:
+ case BTRFS_IOC_SCAN_DEV:
+# ifdef BTRFS_IOC_FORGET_DEV
+ case BTRFS_IOC_FORGET_DEV:
+# endif
+ case BTRFS_IOC_ADD_DEV:
+ case BTRFS_IOC_RM_DEV:
+ case BTRFS_IOC_SUBVOL_CREATE:
+ case BTRFS_IOC_SNAP_DESTROY:
+ case BTRFS_IOC_DEVICES_READY: { /* W */
+ struct btrfs_ioctl_vol_args args;
+
+ tprints(", ");
+ if (umove_or_printaddr(tcp, arg, &args))
+ break;
+
+ tprint_struct_begin();
+ PRINT_FIELD_FD(args, fd, tcp);
+ tprint_struct_next();
+ PRINT_FIELD_CSTRING(args, name);
+ tprint_struct_end();
+ break;
+ }
+
+ case BTRFS_IOC_SNAP_CREATE_V2:
+ case BTRFS_IOC_SUBVOL_CREATE_V2: { /* code is W, but is actually RW */
+ struct_btrfs_ioctl_vol_args_v2 args;
+
+ if (entering(tcp))
+ tprints(", ");
+ else if (syserror(tcp))
+ break;
+ else
+ tprint_value_changed();
+
+ if (umove_or_printaddr(tcp, arg, &args))
+ break;
+
+ if (entering(tcp)) {
+ tprint_struct_begin();
+ PRINT_FIELD_FD(args, fd, tcp);
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(args, flags,
+ btrfs_snap_flags_v2,
+ "BTRFS_SUBVOL_???");
+ if (args.flags & BTRFS_SUBVOL_QGROUP_INHERIT) {
+ tprint_struct_next();
+ PRINT_FIELD_U(args, size);
+ tprint_struct_next();
+ tprints_field_name("qgroup_inherit");
+ btrfs_print_qgroup_inherit(tcp,
+ ptr_to_kulong(args.qgroup_inherit));
+ }
+ tprint_struct_next();
+ PRINT_FIELD_CSTRING(args, name);
+ tprint_struct_end();
+ return 0;
+ }
+ tprint_struct_begin();
+ PRINT_FIELD_U(args, transid);
+ tprint_struct_end();
+ break;
+ }
+
+ default:
+ return RVAL_DECODED;
+ };
+ return RVAL_IOCTL_DECODED;
+}
+#endif /* HAVE_LINUX_BTRFS_H */
diff --git a/src/cacheflush.c b/src/cacheflush.c
new file mode 100644
index 000000000..677adede6
--- /dev/null
+++ b/src/cacheflush.c
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 1999 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
+ * Copyright (c) 2010 Mike Frysinger <vapier@gentoo.org>
+ * Copyright (c) 2010 Carmelo Amoroso <carmelo.amoroso@st.com>
+ * Copyright (c) 2015 Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
+ * Copyright (c) 2014-2015 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2014-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#ifdef HAVE_ASM_CACHECTL_H
+# include <asm/cachectl.h>
+#endif
+
+#ifdef M68K
+# include "xlat/cacheflush_scope.h"
+# include "xlat/cacheflush_flags.h"
+
+SYS_FUNC(cacheflush)
+{
+ /* addr */
+ printaddr(tcp->u_arg[0]);
+ tprints(", ");
+ /* scope */
+ printxval(cacheflush_scope, tcp->u_arg[1], "FLUSH_SCOPE_???");
+ tprints(", ");
+ /* flags */
+ printflags(cacheflush_flags, tcp->u_arg[2], "FLUSH_CACHE_???");
+ /* len */
+ tprintf(", %lu", tcp->u_arg[3]);
+
+ return RVAL_DECODED;
+}
+#endif /* M68K */
+
+#if defined(BFIN) || defined(CSKY)
+# include "xlat/cacheflush_flags.h"
+
+SYS_FUNC(cacheflush)
+{
+ /* start addr */
+ printaddr(tcp->u_arg[0]);
+ /* length */
+ tprintf(", %lu, ", tcp->u_arg[1]);
+ /* flags */
+ printxval(cacheflush_flags, tcp->u_arg[2], "?CACHE");
+
+ return RVAL_DECODED;
+}
+#endif /* BFIN || CSKY */
+
+#ifdef SH
+# include "xlat/cacheflush_flags.h"
+
+SYS_FUNC(cacheflush)
+{
+ /* addr */
+ printaddr(tcp->u_arg[0]);
+ /* len */
+ tprintf(", %lu, ", tcp->u_arg[1]);
+ /* flags */
+ printflags(cacheflush_flags, tcp->u_arg[2], "CACHEFLUSH_???");
+
+ return RVAL_DECODED;
+}
+#endif /* SH */
+
+#ifdef NIOS2
+SYS_FUNC(cacheflush)
+{
+ /* addr */
+ printaddr(tcp->u_arg[0]);
+ /* len */
+ tprintf(", %lu, ", tcp->u_arg[3]);
+ /* scope and flags (cache type) are currently ignored */
+
+ return RVAL_DECODED;
+}
+#endif /* NIOS2 */
diff --git a/src/capability.c b/src/capability.c
new file mode 100644
index 000000000..a4f493a4b
--- /dev/null
+++ b/src/capability.c
@@ -0,0 +1,148 @@
+/*
+ * Copyright (c) 2000 Wichert Akkerman <wakkerma@debian.org>
+ * Copyright (c) 2011 Denys Vlasenko <dvlasenk@redhat.com>
+ * Copyright (c) 2005-2015 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2014-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+/* these constants are the same as in <linux/capability.h> */
+enum {
+#include "caps0.h"
+};
+
+#include "xlat/cap_mask0.h"
+
+/* these constants are CAP_TO_INDEX'ed constants from <linux/capability.h> */
+enum {
+#include "caps1.h"
+};
+
+#include "xlat/cap_mask1.h"
+
+/* these constants are the same as in <linux/capability.h> */
+enum {
+ _LINUX_CAPABILITY_VERSION_1 = 0x19980330,
+ _LINUX_CAPABILITY_VERSION_2 = 0x20071026,
+ _LINUX_CAPABILITY_VERSION_3 = 0x20080522
+};
+
+#include "xlat/cap_version.h"
+
+struct user_cap_header_struct {
+ uint32_t version;
+ int pid;
+};
+
+struct user_cap_data_struct {
+ uint32_t effective;
+ uint32_t permitted;
+ uint32_t inheritable;
+};
+
+static const struct user_cap_header_struct *
+get_cap_header(struct tcb *const tcp, const kernel_ulong_t addr)
+{
+ static struct user_cap_header_struct header;
+
+ if (!addr || !verbose(tcp))
+ return NULL;
+
+ if (umove(tcp, addr, &header) < 0)
+ return NULL;
+
+ return &header;
+}
+
+static void
+print_cap_header(struct tcb *const tcp, const kernel_ulong_t addr,
+ const struct user_cap_header_struct *const h)
+{
+ if (!addr || !h) {
+ printaddr(addr);
+ return;
+ }
+
+ tprint_struct_begin();
+ PRINT_FIELD_XVAL(*h, version, cap_version,
+ "_LINUX_CAPABILITY_VERSION_???");
+ tprint_struct_next();
+ PRINT_FIELD_TGID(*h, pid, tcp);
+ tprint_struct_end();
+}
+
+static void
+print_cap_bits(const uint32_t lo, const uint32_t hi)
+{
+ if (lo || !hi)
+ printflags(cap_mask0, lo, "CAP_???");
+
+ if (hi) {
+ if (lo)
+ tprints("|");
+ printflags(cap_mask1, hi, "CAP_???");
+ }
+}
+
+static void
+print_cap_data(struct tcb *const tcp, const kernel_ulong_t addr,
+ const struct user_cap_header_struct *const h)
+{
+ struct user_cap_data_struct data[2];
+ unsigned int len;
+
+ if (!addr || !h) {
+ printaddr(addr);
+ return;
+ }
+
+ if (_LINUX_CAPABILITY_VERSION_2 == h->version ||
+ _LINUX_CAPABILITY_VERSION_3 == h->version)
+ len = 2;
+ else
+ len = 1;
+
+ if (umoven_or_printaddr(tcp, addr, len * sizeof(data[0]), data))
+ return;
+
+ tprint_struct_begin();
+ tprints_field_name("effective");
+ print_cap_bits(data[0].effective, len > 1 ? data[1].effective : 0);
+ tprint_struct_next();
+ tprints_field_name("permitted");
+ print_cap_bits(data[0].permitted, len > 1 ? data[1].permitted : 0);
+ tprint_struct_next();
+ tprints_field_name("inheritable");
+ print_cap_bits(data[0].inheritable, len > 1 ? data[1].inheritable : 0);
+ tprint_struct_end();
+}
+
+SYS_FUNC(capget)
+{
+ const struct user_cap_header_struct *h;
+
+ if (entering(tcp)) {
+ h = get_cap_header(tcp, tcp->u_arg[0]);
+ print_cap_header(tcp, tcp->u_arg[0], h);
+ tprints(", ");
+ } else {
+ h = syserror(tcp) ? NULL : get_cap_header(tcp, tcp->u_arg[0]);
+ print_cap_data(tcp, tcp->u_arg[1], h);
+ }
+ return 0;
+}
+
+SYS_FUNC(capset)
+{
+ const struct user_cap_header_struct *const h =
+ get_cap_header(tcp, tcp->u_arg[0]);
+ print_cap_header(tcp, tcp->u_arg[0], h);
+ tprints(", ");
+ print_cap_data(tcp, tcp->u_arg[1], h);
+
+ return RVAL_DECODED;
+}
diff --git a/src/caps0.h b/src/caps0.h
new file mode 100644
index 000000000..3789c25fb
--- /dev/null
+++ b/src/caps0.h
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2015-2018 Dmitry V. Levin <ldv@strace.io>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+CAP_CHOWN,
+CAP_DAC_OVERRIDE,
+CAP_DAC_READ_SEARCH,
+CAP_FOWNER,
+CAP_FSETID,
+CAP_KILL,
+CAP_SETGID,
+CAP_SETUID,
+CAP_SETPCAP,
+CAP_LINUX_IMMUTABLE,
+CAP_NET_BIND_SERVICE,
+CAP_NET_BROADCAST,
+CAP_NET_ADMIN,
+CAP_NET_RAW,
+CAP_IPC_LOCK,
+CAP_IPC_OWNER,
+CAP_SYS_MODULE,
+CAP_SYS_RAWIO,
+CAP_SYS_CHROOT,
+CAP_SYS_PTRACE,
+CAP_SYS_PACCT,
+CAP_SYS_ADMIN,
+CAP_SYS_BOOT,
+CAP_SYS_NICE,
+CAP_SYS_RESOURCE,
+CAP_SYS_TIME,
+CAP_SYS_TTY_CONFIG,
+CAP_MKNOD,
+CAP_LEASE,
+CAP_AUDIT_WRITE,
+CAP_AUDIT_CONTROL,
+CAP_SETFCAP,
diff --git a/src/caps1.h b/src/caps1.h
new file mode 100644
index 000000000..ca3147b60
--- /dev/null
+++ b/src/caps1.h
@@ -0,0 +1,16 @@
+/*
+ * Copyright (c) 2015-2020 Dmitry V. Levin <ldv@strace.io>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+CAP_MAC_OVERRIDE,
+CAP_MAC_ADMIN,
+CAP_SYSLOG,
+CAP_WAKE_ALARM,
+CAP_BLOCK_SUSPEND,
+CAP_AUDIT_READ,
+CAP_PERFMON,
+CAP_BPF,
+CAP_CHECKPOINT_RESTORE,
diff --git a/src/chdir.c b/src/chdir.c
new file mode 100644
index 000000000..b07d164e8
--- /dev/null
+++ b/src/chdir.c
@@ -0,0 +1,15 @@
+/*
+ * Copyright (c) 2014-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+SYS_FUNC(chdir)
+{
+ printpath(tcp, tcp->u_arg[0]);
+
+ return RVAL_DECODED;
+}
diff --git a/src/chmod.c b/src/chmod.c
new file mode 100644
index 000000000..85b3abec3
--- /dev/null
+++ b/src/chmod.c
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2014-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+static void
+decode_chmod(struct tcb *tcp, const int offset)
+{
+ printpath(tcp, tcp->u_arg[offset]);
+ tprints(", ");
+ print_numeric_umode_t(tcp->u_arg[offset + 1]);
+}
+
+SYS_FUNC(chmod)
+{
+ decode_chmod(tcp, 0);
+
+ return RVAL_DECODED;
+}
+
+SYS_FUNC(fchmodat)
+{
+ print_dirfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ decode_chmod(tcp, 1);
+
+ return RVAL_DECODED;
+}
+
+SYS_FUNC(fchmod)
+{
+ printfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ print_numeric_umode_t(tcp->u_arg[1]);
+
+ return RVAL_DECODED;
+}
diff --git a/src/clone.c b/src/clone.c
new file mode 100644
index 000000000..433c59d39
--- /dev/null
+++ b/src/clone.c
@@ -0,0 +1,332 @@
+/*
+ * Copyright (c) 1999-2000 Wichert Akkerman <wichert@cistron.nl>
+ * Copyright (c) 2002-2005 Roland McGrath <roland@redhat.com>
+ * Copyright (c) 2008 Jan Kratochvil <jan.kratochvil@redhat.com>
+ * Copyright (c) 2009-2013 Denys Vlasenko <dvlasenk@redhat.com>
+ * Copyright (c) 2006-2015 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2014-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include <sched.h>
+#include "scno.h"
+
+#ifndef CSIGNAL
+# define CSIGNAL 0x000000ff
+#endif
+
+#include "xlat/clone_flags.h"
+#include "xlat/clone3_flags.h"
+#include "xlat/setns_types.h"
+#include "xlat/unshare_flags.h"
+
+#if defined IA64
+# define ARG_FLAGS 0
+# define ARG_STACK 1
+# define ARG_STACKSIZE (shuffle_scno(tcp->scno) == __NR_clone2 ? 2 : -1)
+# define ARG_PTID (shuffle_scno(tcp->scno) == __NR_clone2 ? 3 : 2)
+# define ARG_CTID (shuffle_scno(tcp->scno) == __NR_clone2 ? 4 : 3)
+# define ARG_TLS (shuffle_scno(tcp->scno) == __NR_clone2 ? 5 : 4)
+#elif defined S390 || defined S390X
+# define ARG_STACK 0
+# define ARG_FLAGS 1
+# define ARG_PTID 2
+# define ARG_CTID 3
+# define ARG_TLS 4
+#elif defined X86_64 || defined X32
+/* x86 personality processes have the last two arguments flipped. */
+# define ARG_FLAGS 0
+# define ARG_STACK 1
+# define ARG_PTID 2
+# define ARG_CTID ((current_personality != 1) ? 3 : 4)
+# define ARG_TLS ((current_personality != 1) ? 4 : 3)
+#elif defined ALPHA || defined TILE || defined OR1K || defined CSKY
+# define ARG_FLAGS 0
+# define ARG_STACK 1
+# define ARG_PTID 2
+# define ARG_CTID 3
+# define ARG_TLS 4
+#else
+# define ARG_FLAGS 0
+# define ARG_STACK 1
+# define ARG_PTID 2
+# define ARG_TLS 3
+# define ARG_CTID 4
+#endif
+
+static void
+print_tls_arg(struct tcb *const tcp, const kernel_ulong_t addr)
+{
+#ifdef HAVE_STRUCT_USER_DESC
+ if ((SUPPORTED_PERSONALITIES == 1) || (current_personality == 1))
+ {
+ print_user_desc(tcp, addr, USER_DESC_BOTH);
+ }
+ else
+#endif /* HAVE_STRUCT_USER_DESC */
+ {
+ printaddr(addr);
+ }
+}
+
+SYS_FUNC(clone)
+{
+ const kernel_ulong_t flags = tcp->u_arg[ARG_FLAGS] & ~CSIGNAL;
+
+ if (entering(tcp)) {
+ const unsigned int sig = tcp->u_arg[ARG_FLAGS] & CSIGNAL;
+
+ tprints("child_stack=");
+ printaddr(tcp->u_arg[ARG_STACK]);
+ tprints(", ");
+#ifdef ARG_STACKSIZE
+ if (ARG_STACKSIZE != -1)
+ tprintf("stack_size=%#" PRI_klx ", ",
+ tcp->u_arg[ARG_STACKSIZE]);
+#endif
+ tprints("flags=");
+ if (flags) {
+ printflags64(clone_flags, flags, "CLONE_???");
+ if (sig) {
+ tprints("|");
+ printsignal(sig);
+ }
+ } else {
+ printsignal(sig);
+ }
+ /*
+ * TODO on syscall entry:
+ * We can clear CLONE_PTRACE here since it is an ancient hack
+ * to allow us to catch children, and we use another hack for that.
+ * But CLONE_PTRACE can conceivably be used by malicious programs
+ * to subvert us. By clearing this bit, we can defend against it:
+ * in untraced execution, CLONE_PTRACE should have no effect.
+ *
+ * We can also clear CLONE_UNTRACED, since it allows to start
+ * children outside of our control. At the moment
+ * I'm trying to figure out whether there is a *legitimate*
+ * use of this flag which we should respect.
+ */
+ if ((flags & (CLONE_PARENT_SETTID|CLONE_PIDFD|CLONE_CHILD_SETTID
+ |CLONE_CHILD_CLEARTID|CLONE_SETTLS)) == 0)
+ return RVAL_DECODED | RVAL_TID;
+ } else {
+ if (flags & (CLONE_PARENT_SETTID|CLONE_PIDFD)) {
+ kernel_ulong_t addr = tcp->u_arg[ARG_PTID];
+
+ tprint_struct_next();
+ tprints_field_name("parent_tid");
+ if (flags & CLONE_PARENT_SETTID)
+ printnum_pid(tcp, addr, PT_TID);
+ else
+ printnum_fd(tcp, addr);
+ }
+ if (flags & CLONE_SETTLS) {
+ tprint_struct_next();
+ tprints_field_name("tls");
+ print_tls_arg(tcp, tcp->u_arg[ARG_TLS]);
+ }
+ if (flags & (CLONE_CHILD_SETTID|CLONE_CHILD_CLEARTID)) {
+ tprint_struct_next();
+ tprints_field_name("child_tidptr");
+ printaddr(tcp->u_arg[ARG_CTID]);
+ }
+ }
+ return RVAL_TID;
+}
+
+
+struct strace_clone_args {
+ uint64_t flags;
+ uint64_t /* fd * */ pidfd;
+ uint64_t /* pid_t * */ child_tid;
+ uint64_t /* pid_t * */ parent_tid;
+ uint64_t /* int */ exit_signal;
+ uint64_t /* void * */ stack;
+ uint64_t stack_size;
+ uint64_t /* struct user_desc * / void * */ tls;
+ uint64_t /* pid_t * */ set_tid;
+ uint64_t set_tid_size;
+ uint64_t cgroup;
+};
+
+static void
+tprint_value_changed_struct_begin(void)
+{
+ tprint_value_changed();
+ tprint_struct_begin();
+}
+
+SYS_FUNC(clone3)
+{
+ static const size_t minsz = offsetofend(struct strace_clone_args, tls);
+
+ const kernel_ulong_t addr = tcp->u_arg[0];
+ const kernel_ulong_t size = tcp->u_arg[1];
+
+ struct strace_clone_args arg = { 0 };
+ kernel_ulong_t fetch_size;
+
+ fetch_size = MIN(size, sizeof(arg));
+
+ if (entering(tcp)) {
+ if (fetch_size < minsz) {
+ printaddr(addr);
+ goto out;
+ } else if (umoven_or_printaddr(tcp, addr, fetch_size, &arg)) {
+ goto out;
+ }
+
+ tprint_struct_begin();
+ tprints_field_name("flags");
+ printflags_ex(arg.flags, "CLONE_???", XLAT_STYLE_DEFAULT,
+ clone_flags, clone3_flags, NULL);
+
+ if (arg.flags & CLONE_PIDFD) {
+ tprint_struct_next();
+ PRINT_FIELD_ADDR64(arg, pidfd);
+ }
+
+ if (arg.flags & (CLONE_CHILD_SETTID | CLONE_CHILD_CLEARTID)) {
+ tprint_struct_next();
+ PRINT_FIELD_ADDR64(arg, child_tid);
+ }
+
+ if (arg.flags & CLONE_PARENT_SETTID) {
+ tprint_struct_next();
+ PRINT_FIELD_ADDR64(arg, parent_tid);
+ }
+
+ if (arg.exit_signal < INT_MAX) {
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_VAL(arg, exit_signal, printsignal);
+ } else {
+ tprint_struct_next();
+ PRINT_FIELD_U(arg, exit_signal);
+ }
+
+ tprint_struct_next();
+ PRINT_FIELD_ADDR64(arg, stack);
+ tprint_struct_next();
+ PRINT_FIELD_X(arg, stack_size);
+
+ if (arg.flags & CLONE_SETTLS) {
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_TCB_VAL(arg, tls, tcp,
+ print_tls_arg);
+ }
+
+ if (arg.set_tid || arg.set_tid_size) {
+ static const unsigned int max_set_tid_size = 32;
+
+ if (!arg.set_tid || !arg.set_tid_size ||
+ arg.set_tid_size > max_set_tid_size) {
+ tprint_struct_next();
+ PRINT_FIELD_ADDR64(arg, set_tid);
+ } else {
+ int buf;
+
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_TCB_VAL(arg, set_tid, tcp,
+ print_array, arg.set_tid_size,
+ &buf, sizeof(buf), tfetch_mem,
+ print_int32_array_member, 0);
+ }
+ tprint_struct_next();
+ PRINT_FIELD_U(arg, set_tid_size);
+ }
+
+ if (fetch_size > offsetof(struct strace_clone_args, cgroup)
+ && (arg.cgroup || arg.flags & CLONE_INTO_CGROUP)) {
+ tprint_struct_next();
+ PRINT_FIELD_U(arg, cgroup);
+ }
+
+ if (size > fetch_size)
+ print_nonzero_bytes(tcp, tprint_struct_next,
+ addr, fetch_size,
+ MIN(size, get_pagesize()),
+ QUOTE_FORCE_HEX);
+
+ tprint_struct_end();
+
+ if ((arg.flags & (CLONE_PIDFD | CLONE_PARENT_SETTID)) ||
+ (size > fetch_size))
+ return RVAL_TID;
+
+ goto out;
+ }
+
+ /* exiting */
+
+ if (syserror(tcp))
+ goto out;
+
+ if (umoven(tcp, addr, fetch_size, &arg)) {
+ tprint_value_changed();
+ printaddr(addr);
+ goto out;
+ }
+
+ void (*prefix_fun)(void) = tprint_value_changed_struct_begin;
+
+ if (arg.flags & CLONE_PIDFD) {
+ prefix_fun();
+ prefix_fun = tprint_struct_next;
+ tprints_field_name("pidfd");
+ printnum_fd(tcp, arg.pidfd);
+ }
+
+ if (arg.flags & CLONE_PARENT_SETTID) {
+ prefix_fun();
+ prefix_fun = tprint_struct_next;
+ tprints_field_name("parent_tid");
+ printnum_pid(tcp, arg.parent_tid, PT_TID);
+ }
+
+ if (size > fetch_size) {
+ /*
+ * TODO: it is possible to also store the tail on entering
+ * and then compare against it on exiting in order
+ * to avoid double-printing, but it would also require yet
+ * another complication of print_nonzero_bytes interface.
+ */
+ if (print_nonzero_bytes(tcp, prefix_fun, addr, fetch_size,
+ MIN(size, get_pagesize()),
+ QUOTE_FORCE_HEX)) {
+ prefix_fun = tprint_struct_next;
+ }
+ }
+
+ if (prefix_fun != tprint_value_changed_struct_begin)
+ tprint_struct_end();
+
+out:
+ tprintf(", %" PRI_klu, size);
+
+ return RVAL_DECODED | RVAL_TID;
+}
+
+
+SYS_FUNC(setns)
+{
+ printfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ printxval(setns_types, tcp->u_arg[1], "CLONE_NEW???");
+
+ return RVAL_DECODED;
+}
+
+SYS_FUNC(unshare)
+{
+ printflags64(unshare_flags, tcp->u_arg[0], "CLONE_???");
+ return RVAL_DECODED;
+}
+
+SYS_FUNC(fork)
+{
+ return RVAL_DECODED | RVAL_TGID;
+}
diff --git a/src/close_range.c b/src/close_range.c
new file mode 100644
index 000000000..191537a16
--- /dev/null
+++ b/src/close_range.c
@@ -0,0 +1,22 @@
+/*
+ * Copyright (c) 2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#ifdef HAVE_LINUX_CLOSE_RANGE_H
+# include <linux/close_range.h>
+#endif
+#include "xlat/close_range_flags.h"
+
+SYS_FUNC(close_range)
+{
+ printfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ printfd(tcp, tcp->u_arg[1]);
+ tprints(", ");
+ printflags(close_range_flags, tcp->u_arg[2], "CLOSE_RANGE_???");
+ return RVAL_DECODED;
+}
diff --git a/src/copy_file_range.c b/src/copy_file_range.c
new file mode 100644
index 000000000..7d6de0f51
--- /dev/null
+++ b/src/copy_file_range.c
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2016-2018 Dmitry V. Levin <ldv@strace.io>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+SYS_FUNC(copy_file_range)
+{
+ /* int fd_in */
+ printfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ /* loff_t *off_in */
+ printnum_int64(tcp, tcp->u_arg[1], "%" PRId64);
+ tprints(", ");
+ /* int fd_out */
+ printfd(tcp, tcp->u_arg[2]);
+ tprints(", ");
+ /* loff_t *off_out */
+ printnum_int64(tcp, tcp->u_arg[3], "%" PRId64);
+ tprints(", ");
+ /* size_t len */
+ tprintf("%" PRI_klu ", ", tcp->u_arg[4]);
+ /* unsigned int flags */
+ tprintf("%u", (unsigned int) tcp->u_arg[5]);
+
+ return RVAL_DECODED;
+}
diff --git a/src/count.c b/src/count.c
new file mode 100644
index 000000000..6e1401f1f
--- /dev/null
+++ b/src/count.c
@@ -0,0 +1,524 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
+ * Copyright (c) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation
+ * Linux for s390 port by D.J. Barrow
+ * <barrow_dj@mail.yahoo.com,djbarrow@de.ibm.com>
+ * Copyright (c) 2004 Roland McGrath <roland@redhat.com>
+ * Copyright (c) 2006 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2006-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#include <stdarg.h>
+
+/* Per-syscall stats structure */
+struct call_counts {
+ /* time may be total latency or system time */
+ struct timespec time;
+ struct timespec time_min;
+ struct timespec time_max;
+ struct timespec time_avg;
+ uint64_t calls, errors;
+};
+
+static struct call_counts *countv[SUPPORTED_PERSONALITIES];
+#define counts (countv[current_personality])
+
+static const struct timespec zero_ts;
+static const struct timespec max_ts = {
+ (time_t) (long long) (zero_extend_signed_to_ull((time_t) -1ULL) >> 1),
+ 999999999 };
+
+static struct timespec overhead;
+
+
+enum count_summary_columns {
+ CSC_NONE,
+ CSC_TIME_100S,
+ CSC_TIME_TOTAL,
+ CSC_TIME_MIN,
+ CSC_TIME_MAX,
+ CSC_TIME_AVG,
+ CSC_CALLS,
+ CSC_ERRORS,
+ CSC_SC_NAME,
+
+ CSC_MAX,
+};
+
+static uint8_t columns[CSC_MAX] = {
+ CSC_TIME_100S,
+ CSC_TIME_TOTAL,
+ CSC_TIME_AVG,
+ CSC_CALLS,
+ CSC_ERRORS,
+ CSC_SC_NAME,
+};
+
+static const struct {
+ const char *name;
+ uint8_t column;
+} column_aliases[] = {
+ { "time", CSC_TIME_100S },
+ { "time_percent", CSC_TIME_100S },
+ { "time-percent", CSC_TIME_100S },
+ { "time_total", CSC_TIME_TOTAL },
+ { "time-total", CSC_TIME_TOTAL },
+ { "total_time", CSC_TIME_TOTAL },
+ { "total-time", CSC_TIME_TOTAL },
+ { "min_time", CSC_TIME_MIN },
+ { "min-time", CSC_TIME_MIN },
+ { "shortest", CSC_TIME_MIN },
+ { "time_min", CSC_TIME_MIN },
+ { "time-min", CSC_TIME_MIN },
+ { "longest" , CSC_TIME_MAX },
+ { "max_time", CSC_TIME_MAX },
+ { "max-time", CSC_TIME_MAX },
+ { "time_max", CSC_TIME_MAX },
+ { "time-max", CSC_TIME_MAX },
+ { "avg_time", CSC_TIME_AVG },
+ { "avg-time", CSC_TIME_AVG },
+ { "time_avg", CSC_TIME_AVG },
+ { "time-avg", CSC_TIME_AVG },
+ { "calls", CSC_CALLS },
+ { "count", CSC_CALLS },
+ { "error", CSC_ERRORS },
+ { "errors", CSC_ERRORS },
+ { "name", CSC_SC_NAME },
+ { "syscall", CSC_SC_NAME },
+ { "syscall_name", CSC_SC_NAME },
+ { "syscall-name", CSC_SC_NAME },
+ { "none", CSC_NONE },
+ { "nothing", CSC_NONE },
+};
+
+void
+count_syscall(struct tcb *tcp, const struct timespec *syscall_exiting_ts)
+{
+ if (!scno_in_range(tcp->scno))
+ return;
+
+ if (!counts) {
+ counts = xcalloc(nsyscalls, sizeof(*counts));
+
+ for (size_t i = 0; i < nsyscalls; i++)
+ counts[i].time_min = max_ts;
+ }
+ struct call_counts *cc = &counts[tcp->scno];
+
+ cc->calls++;
+ if (syserror(tcp))
+ cc->errors++;
+
+ struct timespec wts;
+ if (count_wallclock) {
+ /* wall clock time spent while in syscall */
+ ts_sub(&wts, syscall_exiting_ts, &tcp->etime);
+ } else {
+ /* system CPU time spent while in syscall */
+ ts_sub(&wts, &tcp->stime, &tcp->ltime);
+ }
+
+ ts_sub(&wts, &wts, &overhead);
+
+ const struct timespec *wts_nonneg = ts_max(&wts, &zero_ts);
+
+ ts_add(&cc->time, &cc->time, wts_nonneg);
+ cc->time_min = *ts_min(&cc->time_min, wts_nonneg);
+ cc->time_max = *ts_max(&cc->time_max, wts_nonneg);
+}
+
+static int
+time_cmp(const void *a, const void *b)
+{
+ const unsigned int *a_int = a;
+ const unsigned int *b_int = b;
+ return -ts_cmp(&counts[*a_int].time, &counts[*b_int].time);
+}
+
+static int
+min_time_cmp(const void *a, const void *b)
+{
+ return -ts_cmp(&counts[*((unsigned int *) a)].time_min,
+ &counts[*((unsigned int *) b)].time_min);
+}
+
+static int
+max_time_cmp(const void *a, const void *b)
+{
+ return -ts_cmp(&counts[*((unsigned int *) a)].time_max,
+ &counts[*((unsigned int *) b)].time_max);
+}
+
+static int
+avg_time_cmp(const void *a, const void *b)
+{
+ return -ts_cmp(&counts[*((unsigned int *) a)].time_avg,
+ &counts[*((unsigned int *) b)].time_avg);
+}
+
+static int
+syscall_cmp(const void *a, const void *b)
+{
+ const unsigned int *a_int = a;
+ const unsigned int *b_int = b;
+ const char *a_name = sysent[*a_int].sys_name;
+ const char *b_name = sysent[*b_int].sys_name;
+ return strcmp(a_name ? a_name : "", b_name ? b_name : "");
+}
+
+static int
+count_cmp(const void *a, const void *b)
+{
+ const unsigned int *a_int = a;
+ const unsigned int *b_int = b;
+ unsigned int m = counts[*a_int].calls;
+ unsigned int n = counts[*b_int].calls;
+
+ return (m < n) ? 1 : (m > n) ? -1 : 0;
+}
+
+static int
+error_cmp(const void *a, const void *b)
+{
+ const unsigned int *a_int = a;
+ const unsigned int *b_int = b;
+ unsigned int m = counts[*a_int].errors;
+ unsigned int n = counts[*b_int].errors;
+
+ return (m < n) ? 1 : (m > n) ? -1 : 0;
+}
+
+typedef int (*sort_func)(const void *, const void *);
+static sort_func sortfun;
+
+void
+set_sortby(const char *sortby)
+{
+ static const sort_func sort_fns[CSC_MAX] = {
+ [CSC_TIME_100S] = time_cmp,
+ [CSC_TIME_TOTAL] = time_cmp,
+ [CSC_TIME_MIN] = min_time_cmp,
+ [CSC_TIME_MAX] = max_time_cmp,
+ [CSC_TIME_AVG] = avg_time_cmp,
+ [CSC_CALLS] = count_cmp,
+ [CSC_ERRORS] = error_cmp,
+ [CSC_SC_NAME] = syscall_cmp,
+ };
+
+ for (size_t i = 0; i < ARRAY_SIZE(column_aliases); ++i) {
+ if (!strcmp(column_aliases[i].name, sortby)) {
+ sortfun = sort_fns[column_aliases[i].column];
+ return;
+ }
+ }
+
+ error_msg_and_help("invalid sortby: '%s'", sortby);
+}
+
+void
+set_count_summary_columns(const char *s)
+{
+ uint8_t visible[CSC_MAX] = { 0 };
+ const char *prev = s;
+ size_t cur = 0;
+
+ memset(columns, 0, sizeof(columns));
+
+ for (;;) {
+ bool found = false;
+ const char *pos = strchr(prev, ',');
+ size_t len = pos ? (size_t) (pos - prev) : strlen(prev);
+
+ for (size_t i = 0; i < ARRAY_SIZE(column_aliases); i++) {
+ if (strncmp(column_aliases[i].name, prev, len) ||
+ column_aliases[i].name[len])
+ continue;
+ if (column_aliases[i].column == CSC_NONE ||
+ column_aliases[i].column >= CSC_MAX)
+ continue;
+
+ if (visible[column_aliases[i].column])
+ error_msg_and_help("call summary column "
+ "has been provided more "
+ "than once: '%s' (-U option "
+ "residual: '%s')",
+ column_aliases[i].name,
+ prev);
+
+ columns[cur++] = column_aliases[i].column;
+ visible[column_aliases[i].column] = 1;
+ found = true;
+
+ break;
+ }
+
+ if (!found)
+ error_msg_and_help("unknown column name: '%.*s'",
+ (int) MIN(len, INT_MAX), prev);
+
+ if (!pos)
+ break;
+
+ prev = pos + 1;
+ }
+
+ /*
+ * Always enable syscall name column, as without it table is meaningless
+ */
+ if (!visible[CSC_SC_NAME])
+ columns[cur++] = CSC_SC_NAME;
+}
+
+int
+set_overhead(const char *str)
+{
+ return parse_ts(str, &overhead);
+}
+
+static size_t ATTRIBUTE_FORMAT((printf, 1, 2))
+num_chars(const char *fmt, ...)
+{
+ va_list ap;
+
+ va_start(ap, fmt);
+ int ret = vsnprintf(NULL, 0, fmt, ap);
+ va_end(ap);
+
+ return (unsigned int) MAX(ret, 0);
+}
+
+static void
+call_summary_pers(FILE *outf)
+{
+ unsigned int *indices;
+ size_t last_column = 0;
+
+ struct timespec tv_cum = zero_ts;
+ const struct timespec *tv_min = &max_ts;
+ const struct timespec *tv_min_max = &zero_ts;
+ const struct timespec *tv_max = &zero_ts;
+ const struct timespec *tv_avg_max = &zero_ts;
+ uint64_t call_cum = 0;
+ uint64_t error_cum = 0;
+
+ double float_tv_cum;
+ double percent;
+
+ size_t sc_name_max = 0;
+
+
+ /* sort, calculate statistics */
+ indices = xcalloc(sizeof(indices[0]), nsyscalls);
+ for (size_t i = 0; i < nsyscalls; ++i) {
+ indices[i] = i;
+ if (counts[i].calls == 0)
+ continue;
+
+ ts_add(&tv_cum, &tv_cum, &counts[i].time);
+ tv_min = ts_min(tv_min, &counts[i].time_min);
+ tv_min_max = ts_max(tv_min_max, &counts[i].time_min);
+ tv_max = ts_max(tv_max, &counts[i].time_max);
+ call_cum += counts[i].calls;
+ error_cum += counts[i].errors;
+
+ ts_div(&counts[i].time_avg, &counts[i].time, counts[i].calls);
+ tv_avg_max = ts_max(tv_avg_max, &counts[i].time_avg);
+
+ sc_name_max = MAX(sc_name_max, strlen(sysent[i].sys_name));
+ }
+ float_tv_cum = ts_float(&tv_cum);
+
+ if (sortfun)
+ qsort((void *) indices, nsyscalls, sizeof(indices[0]), sortfun);
+
+ enum column_flags {
+ CF_L = 1 << 0, /* Left-aligned column */
+ };
+ static const struct {
+ const char *s;
+ size_t sz;
+ const char *fmt;
+ const char *last_fmt;
+ uint32_t flags;
+ } cdesc[] = {
+ [CSC_TIME_100S] = { ARRSZ_PAIR("% time") - 1, "%1$*2$.2f" },
+ [CSC_TIME_MIN] = { ARRSZ_PAIR("shortest") - 1, "%1$*2$.6f" },
+ [CSC_TIME_MAX] = { ARRSZ_PAIR("longest") - 1, "%1$*2$.6f" },
+ /* Historical field sizes are preserved */
+ [CSC_TIME_TOTAL] = { "seconds", 11, "%1$*2$.6f" },
+ [CSC_TIME_AVG] = { "usecs/call", 11, "%1$*2$" PRIu64 },
+ [CSC_CALLS] = { "calls", 9, "%1$*2$" PRIu64 },
+ [CSC_ERRORS] = { "errors", 9, "%1$*2$.0" PRIu64 },
+ [CSC_SC_NAME] = { "syscall", 16, "%1$-*2$s", "%1$s", CF_L },
+ };
+
+ /* calculate column widths */
+#define W_(c_, v_) [c_] = MAX(cdesc[c_].sz, (v_))
+ unsigned int cwidths[CSC_MAX] = {
+ W_(CSC_TIME_100S, sizeof("100.00") - 1),
+ W_(CSC_TIME_TOTAL, num_chars("%.6f", float_tv_cum)),
+ W_(CSC_TIME_MIN, num_chars("%" PRId64 ".000000",
+ (int64_t) tv_min_max->tv_sec)),
+ W_(CSC_TIME_MAX, num_chars("%" PRId64 ".000000",
+ (int64_t) tv_max->tv_sec)),
+ W_(CSC_TIME_AVG, num_chars("%" PRId64 ,
+ (uint64_t) (ts_float(tv_avg_max)
+ * 1e6))),
+ W_(CSC_CALLS, num_chars("%" PRIu64, call_cum)),
+ W_(CSC_ERRORS, num_chars("%" PRIu64, error_cum)),
+ W_(CSC_SC_NAME, sc_name_max + 1),
+ };
+#undef W_
+
+ /* find the last column */
+ for (size_t i = 0; i < ARRAY_SIZE(columns) && columns[i]; ++i)
+ last_column = i;
+
+ /* header */
+ for (size_t i = 0; i <= last_column; ++i) {
+ const char *fmt = cdesc[columns[i]].flags & CF_L
+ ? (i == last_column ? "%1$s" : "%1$-*2$s")
+ : "%1$*2$s";
+ if (i)
+ fputc(' ', outf);
+ fprintf(outf, fmt, cdesc[columns[i]].s, cwidths[columns[i]]);
+ }
+ fputc('\n', outf);
+
+ /* divider */
+ for (size_t i = 0; i <= last_column; ++i) {
+ if (i)
+ fputc(' ', outf);
+
+ for (size_t j = 0; j < cwidths[columns[i]]; ++j)
+ fputc('-', outf);
+ }
+ fputc('\n', outf);
+
+ /* cache column formats */
+#define FC_(c_) \
+ case (c_): \
+ column_fmts[i] = (i == last_column) && cdesc[c].last_fmt \
+ ? cdesc[c].last_fmt : cdesc[c].fmt; \
+ break
+#define PC_(c_, val_) \
+ case (c_): \
+ fprintf(outf, column_fmts[i], (val_), cwidths[c]); \
+ break
+
+ const char *column_fmts[last_column + 1];
+ for (size_t i = 0; i <= last_column; ++i) {
+ const size_t c = columns[i];
+
+ switch (c) {
+ FC_(CSC_TIME_100S);
+ FC_(CSC_TIME_TOTAL);
+ FC_(CSC_TIME_MIN);
+ FC_(CSC_TIME_MAX);
+ FC_(CSC_TIME_AVG);
+ FC_(CSC_CALLS);
+ FC_(CSC_ERRORS);
+ FC_(CSC_SC_NAME);
+ }
+ }
+
+ /* data output */
+ for (size_t j = 0; j < nsyscalls; ++j) {
+ unsigned int idx = indices[j];
+ struct call_counts *cc = &counts[idx];
+ double float_syscall_time;
+
+ if (cc->calls == 0)
+ continue;
+
+ float_syscall_time = ts_float(&cc->time);
+ percent = (100.0 * float_syscall_time);
+ /* else: float_tv_cum can be 0.0 too and we get 0/0 = NAN */
+ if (percent != 0.0)
+ percent /= float_tv_cum;
+
+ for (size_t i = 0; i <= last_column; ++i) {
+ const size_t c = columns[i];
+ if (i)
+ fputc(' ', outf);
+
+ switch (c) {
+ PC_(CSC_TIME_100S, percent);
+ PC_(CSC_TIME_TOTAL, float_syscall_time);
+ PC_(CSC_TIME_MIN, ts_float(&cc->time_min));
+ PC_(CSC_TIME_MAX, ts_float(&cc->time_max));
+ PC_(CSC_TIME_AVG,
+ (uint64_t) (ts_float(&cc->time_avg) * 1e6));
+ PC_(CSC_CALLS, cc->calls);
+ PC_(CSC_ERRORS, cc->errors);
+ PC_(CSC_SC_NAME, sysent[idx].sys_name);
+ }
+ }
+
+ fputc('\n', outf);
+ }
+
+ free(indices);
+
+ /* footer */
+ for (size_t i = 0; i <= last_column; ++i) {
+ if (i)
+ fputc(' ', outf);
+
+ for (size_t j = 0; j < cwidths[columns[i]]; ++j)
+ fputc('-', outf);
+ }
+ fputc('\n', outf);
+
+ /* totals */
+ for (size_t i = 0; i <= last_column; ++i) {
+ const size_t c = columns[i];
+ if (i)
+ fputc(' ', outf);
+
+ switch (c) {
+ PC_(CSC_TIME_100S, 100.0);
+ PC_(CSC_TIME_TOTAL, float_tv_cum);
+ PC_(CSC_TIME_MIN, ts_float(tv_min));
+ PC_(CSC_TIME_MAX, ts_float(tv_max));
+ PC_(CSC_TIME_AVG, (uint64_t) (float_tv_cum / call_cum * 1e6));
+ PC_(CSC_CALLS, call_cum);
+ PC_(CSC_ERRORS, error_cum);
+ PC_(CSC_SC_NAME, "total");
+ }
+ }
+ fputc('\n', outf);
+
+#undef PC_
+#undef FC_
+}
+
+void
+call_summary(FILE *outf)
+{
+ unsigned int i, old_pers = current_personality;
+
+ for (i = 0; i < SUPPORTED_PERSONALITIES; ++i) {
+ if (!countv[i])
+ continue;
+
+ if (current_personality != i)
+ set_personality(i);
+ if (i)
+ fprintf(outf,
+ "System call usage summary for %s mode:\n",
+ personality_names[i]);
+ call_summary_pers(outf);
+ }
+
+ if (old_pers != current_personality)
+ set_personality(old_pers);
+}
diff --git a/src/defs.h b/src/defs.h
new file mode 100644
index 000000000..0ccb19b24
--- /dev/null
+++ b/src/defs.h
@@ -0,0 +1,1850 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1999-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_DEFS_H
+# define STRACE_DEFS_H
+
+# ifdef HAVE_CONFIG_H
+# include "config.h"
+# endif
+
+# include <features.h>
+# include <stdbool.h>
+# include <stdint.h>
+# include <inttypes.h>
+# include <sys/types.h>
+# include <stddef.h>
+# include <unistd.h>
+# include <stdlib.h>
+# include <stdio.h>
+/* Open-coding isprint(ch) et al proved more efficient than calling
+ * generalized libc interface. We don't *want* to do non-ASCII anyway.
+ */
+/* #include <ctype.h> */
+# include <string.h>
+# include <errno.h>
+# include <time.h>
+# include <sys/time.h>
+
+# include "arch_defs.h"
+# include "error_prints.h"
+# include "gcc_compat.h"
+# include "kernel_types.h"
+# include "list.h"
+# include "macros.h"
+# include "mpers_type.h"
+# include "string_to_uint.h"
+# include "sysent.h"
+# include "xmalloc.h"
+
+# ifndef HAVE_STRERROR
+const char *strerror(int);
+# endif
+# ifndef HAVE_STPCPY
+/* Some libc have stpcpy, some don't. Sigh...
+ * Roll our private implementation...
+ */
+# undef stpcpy
+# define stpcpy strace_stpcpy
+extern char *stpcpy(char *dst, const char *src);
+# endif
+
+/* Glibc has an efficient macro for sigemptyset
+ * (it just does one or two assignments of 0 to internal vector of longs).
+ */
+# if defined(__GLIBC__) && defined(__sigemptyset) && !defined(sigemptyset)
+# define sigemptyset __sigemptyset
+# endif
+
+/* Configuration section */
+# ifndef DEFAULT_STRLEN
+/* default maximum # of bytes printed in `printstr', change with -s switch */
+# define DEFAULT_STRLEN 32
+# endif
+# ifndef DEFAULT_ACOLUMN
+# define DEFAULT_ACOLUMN 40 /* default alignment column for results */
+# endif
+/*
+ * Maximum number of args to a syscall.
+ *
+ * Make sure that all entries in all syscallent.h files have nargs <= MAX_ARGS!
+ * linux/<ARCH>/syscallent*.h:
+ * all have nargs <= 6 except mips o32 which has nargs <= 7.
+ */
+# ifndef MAX_ARGS
+# ifdef LINUX_MIPSO32
+# define MAX_ARGS 7
+# else
+# define MAX_ARGS 6
+# endif
+# endif
+/* default sorting method for call profiling */
+# ifndef DEFAULT_SORTBY
+# define DEFAULT_SORTBY "time"
+# endif
+
+/* To force NOMMU build, set to 1 */
+# define NOMMU_SYSTEM 0
+
+# ifndef ERESTARTSYS
+# define ERESTARTSYS 512
+# endif
+# ifndef ERESTARTNOINTR
+# define ERESTARTNOINTR 513
+# endif
+# ifndef ERESTARTNOHAND
+# define ERESTARTNOHAND 514
+# endif
+# ifndef ERESTART_RESTARTBLOCK
+# define ERESTART_RESTARTBLOCK 516
+# endif
+
+# define PERSONALITY0_WORDSIZE SIZEOF_LONG
+# define PERSONALITY0_KLONGSIZE SIZEOF_KERNEL_LONG_T
+# define PERSONALITY0_INCLUDE_PRINTERS_DECLS "native_printer_decls.h"
+# define PERSONALITY0_INCLUDE_PRINTERS_DEFS "native_printer_defs.h"
+
+# if SUPPORTED_PERSONALITIES > 1
+# define PERSONALITY1_WORDSIZE 4
+# define PERSONALITY1_KLONGSIZE PERSONALITY1_WORDSIZE
+# endif
+
+# if SUPPORTED_PERSONALITIES > 2
+# define PERSONALITY2_WORDSIZE 4
+# define PERSONALITY2_KLONGSIZE PERSONALITY0_KLONGSIZE
+# endif
+
+# if SUPPORTED_PERSONALITIES > 1 && defined HAVE_M32_MPERS
+# define PERSONALITY1_INCLUDE_PRINTERS_DECLS "m32_printer_decls.h"
+# define PERSONALITY1_INCLUDE_PRINTERS_DEFS "m32_printer_defs.h"
+# define PERSONALITY1_INCLUDE_FUNCS "m32_funcs.h"
+# define MPERS_m32_IOCTL_MACROS "ioctl_redefs1.h"
+# define HAVE_PERSONALITY_1_MPERS 1
+# else
+# define PERSONALITY1_INCLUDE_PRINTERS_DECLS "native_printer_decls.h"
+# define PERSONALITY1_INCLUDE_PRINTERS_DEFS "native_printer_defs.h"
+# define PERSONALITY1_INCLUDE_FUNCS "empty.h"
+# define HAVE_PERSONALITY_1_MPERS 0
+# endif
+
+# if SUPPORTED_PERSONALITIES > 2 && defined HAVE_MX32_MPERS
+# define PERSONALITY2_INCLUDE_FUNCS "mx32_funcs.h"
+# define PERSONALITY2_INCLUDE_PRINTERS_DECLS "mx32_printer_decls.h"
+# define PERSONALITY2_INCLUDE_PRINTERS_DEFS "mx32_printer_defs.h"
+# define MPERS_mx32_IOCTL_MACROS "ioctl_redefs2.h"
+# define HAVE_PERSONALITY_2_MPERS 1
+# else
+# define PERSONALITY2_INCLUDE_PRINTERS_DECLS "native_printer_decls.h"
+# define PERSONALITY2_INCLUDE_PRINTERS_DEFS "native_printer_defs.h"
+# define PERSONALITY2_INCLUDE_FUNCS "empty.h"
+# define HAVE_PERSONALITY_2_MPERS 0
+# endif
+
+# ifdef WORDS_BIGENDIAN
+# define is_bigendian true
+# else
+# define is_bigendian false
+# endif
+
+# if SUPPORTED_PERSONALITIES > 1
+extern void set_personality(unsigned int personality);
+extern unsigned current_personality;
+# else
+# define set_personality(personality) ((void)0)
+# define current_personality 0
+# endif
+
+# if SUPPORTED_PERSONALITIES == 1
+# define current_wordsize PERSONALITY0_WORDSIZE
+# define current_klongsize PERSONALITY0_KLONGSIZE
+# else
+# if SUPPORTED_PERSONALITIES == 2 && PERSONALITY0_WORDSIZE == PERSONALITY1_WORDSIZE
+# define current_wordsize PERSONALITY0_WORDSIZE
+# else
+extern unsigned current_wordsize;
+# endif
+# if SUPPORTED_PERSONALITIES == 2 && PERSONALITY0_KLONGSIZE == PERSONALITY1_KLONGSIZE
+# define current_klongsize PERSONALITY0_KLONGSIZE
+# else
+extern unsigned current_klongsize;
+# endif
+# endif
+
+# define max_addr() (~0ULL >> ((8 - current_wordsize) * 8))
+# define max_kaddr() (~0ULL >> ((8 - current_klongsize) * 8))
+
+/* Shorthands for defining word/klong-based dispatcher function bodies */
+# ifndef current_wordsize
+# define opt_wordsize(opt_64_, opt_32_) \
+ ((current_wordsize > sizeof(uint32_t)) ? (opt_64_) : (opt_32_))
+# define dispatch_wordsize(call_64_, call_32_, ...) \
+ ((current_wordsize > sizeof(uint32_t)) \
+ ? (call_64_)(__VA_ARGS__) : (call_32_)(__VA_ARGS__))
+# elif current_wordsize > 4
+# define opt_wordsize(opt_64_, opt_32_) (opt_64_)
+# define dispatch_wordsize(call_64_, call_32_, ...) ((call_64_)(__VA_ARGS__))
+# else /* current_wordsize == 4 */
+# define opt_wordsize(opt_64_, opt_32_) (opt_32_)
+# define dispatch_wordsize(call_64_, call_32_, ...) ((call_32_)(__VA_ARGS__))
+# endif
+
+# ifndef current_klongsize
+# define opt_klongsize(opt_64_, opt_32_) \
+ ((current_klongsize > sizeof(uint32_t)) ? (opt_64_) : (opt_32_))
+# define dispatch_klongsize(call_64_, call_32_, ...) \
+ ((current_klongsize > sizeof(uint32_t)) \
+ ? (call_64_)(__VA_ARGS__) : (call_32_)(__VA_ARGS__))
+# elif current_klongsize > 4
+# define opt_klongsize(opt_64_, opt_32_) (opt_64_)
+# define dispatch_klongsize(call_64_, call_32_, ...) ((call_64_)(__VA_ARGS__))
+# else /* current_klongsize == 4 */
+# define opt_klongsize(opt_64_, opt_32_) (opt_32_)
+# define dispatch_klongsize(call_64_, call_32_, ...) ((call_32_)(__VA_ARGS__))
+# endif
+
+
+typedef struct ioctlent {
+ const char *symbol;
+ unsigned int code;
+} struct_ioctlent;
+
+# define INJECT_F_SIGNAL 0x01
+# define INJECT_F_ERROR 0x02
+# define INJECT_F_RETVAL 0x04
+# define INJECT_F_DELAY_ENTER 0x08
+# define INJECT_F_DELAY_EXIT 0x10
+# define INJECT_F_SYSCALL 0x20
+
+# define INJECT_ACTION_FLAGS \
+ (INJECT_F_SIGNAL \
+ |INJECT_F_ERROR \
+ |INJECT_F_RETVAL \
+ |INJECT_F_DELAY_ENTER \
+ |INJECT_F_DELAY_EXIT \
+ )
+
+struct inject_data {
+ uint8_t flags; /* 6 of 8 flags are used so far */
+ uint8_t signo; /* NSIG <= 128 */
+ uint16_t rval_idx; /* index in retval_vec */
+ uint16_t delay_idx; /* index in delay_data_vec */
+ uint16_t scno; /* syscall to be injected instead of -1 */
+};
+
+struct inject_opts {
+ uint16_t first;
+ uint16_t last;
+ uint16_t step;
+ struct inject_data data;
+};
+
+# define INJECT_LAST_INF ((uint16_t) -1)
+
+# define MAX_ERRNO_VALUE 4095
+
+/* Trace Control Block */
+struct tcb {
+ int flags; /* See below for TCB_ values */
+ int pid; /* If 0, this tcb is free */
+ int qual_flg; /* qual_flags[scno] or DEFAULT_QUAL_FLAGS + RAW */
+# if SUPPORTED_PERSONALITIES > 1
+ unsigned int currpers; /* Personality at the time of scno update */
+# endif
+ unsigned long u_error; /* Error code */
+ kernel_ulong_t scno; /* System call number */
+ kernel_ulong_t true_scno; /* Same, but without subcall decoding and shuffling */
+ kernel_ulong_t u_arg[MAX_ARGS]; /* System call arguments */
+ kernel_long_t u_rval; /* Return value */
+ int sys_func_rval; /* Syscall entry parser's return value */
+ int curcol; /* Output column for this process */
+ FILE *outf; /* Output file for this process */
+ struct staged_output_data *staged_output_data;
+
+ const char *auxstr; /* Auxiliary info from syscall (see RVAL_STR) */
+ void *_priv_data; /* Private data for syscall decoding functions */
+ void (*_free_priv_data)(void *); /* Callback for freeing priv_data */
+ const struct_sysent *s_ent; /* sysent[scno] or a stub struct for bad
+ * scno. Use tcp_sysent() macro for access.
+ */
+ const struct_sysent *s_prev_ent; /* for "resuming interrupted SYSCALL" msg */
+ struct inject_opts *inject_vec[SUPPORTED_PERSONALITIES];
+ struct timespec stime; /* System time usage as of last process wait */
+ struct timespec ltime; /* System time usage as of last syscall entry */
+ struct timespec atime; /* System time right after attach */
+ struct timespec etime; /* Syscall entry time (CLOCK_MONOTONIC) */
+ struct timespec delay_expiration_time; /* When does the delay end */
+
+ /*
+ * The ID of the PID namespace of this process
+ * (inode number of /proc/<pid>/ns/pid)
+ * (0: not initialized)
+ */
+ unsigned int pid_ns;
+
+ struct mmap_cache_t *mmap_cache;
+
+ /*
+ * Data that is stored during process wait traversal.
+ * We use indices as the actual data is stored in an array
+ * that is realloc'ed at runtime.
+ */
+ size_t wait_data_idx;
+ /** Wait data storage for a delayed process. */
+ struct tcb_wait_data *delayed_wait_data;
+ struct list_item wait_list;
+
+
+# ifdef HAVE_LINUX_KVM_H
+ struct vcpu_info *vcpu_info_list;
+# endif
+
+# ifdef ENABLE_STACKTRACE
+ void *unwind_ctx;
+ struct unwind_queue_t *unwind_queue;
+# endif
+};
+
+/* TCB flags */
+/* We have attached to this process, but did not see it stopping yet */
+# define TCB_STARTUP 0x01
+# define TCB_IGNORE_ONE_SIGSTOP 0x02 /* Next SIGSTOP is to be ignored */
+/*
+ * Are we in system call entry or in syscall exit?
+ *
+ * This bit is set in syscall_entering_finish() and cleared in
+ * syscall_exiting_finish().
+ * Other stops which are possible directly after syscall entry (death, ptrace
+ * event stop) are handled without calling syscall_{entering,exiting}_*().
+ *
+ * Use entering(tcp) / exiting(tcp) to check this bit to make code more
+ * readable.
+ */
+# define TCB_INSYSCALL 0x04
+# define TCB_ATTACHED 0x08 /* We attached to it already */
+# define TCB_REPRINT 0x10 /* We should reprint this syscall on exit */
+# define TCB_FILTERED 0x20 /* This system call has been filtered out */
+# define TCB_TAMPERED 0x40 /* A syscall has been tampered with */
+# define TCB_HIDE_LOG 0x80 /* We should hide everything (until execve) */
+# define TCB_CHECK_EXEC_SYSCALL 0x100 /* Check whether this execve syscall succeeded */
+# define TCB_SKIP_DETACH_ON_FIRST_EXEC 0x200 /* -b execve should skip detach on first execve */
+# define TCB_GRABBED 0x400 /* We grab the process and can catch it
+ * in the middle of a syscall */
+# define TCB_RECOVERING 0x800 /* We try to recover after detecting incorrect
+ * syscall entering/exiting state */
+# define TCB_INJECT_DELAY_EXIT 0x1000 /* Current syscall needs to be delayed
+ on exit */
+# define TCB_DELAYED 0x2000 /* Current syscall has been delayed */
+# define TCB_TAMPERED_NO_FAIL 0x4000 /* We tamper tcb with syscall
+ that should not fail. */
+# define TCB_SECCOMP_FILTER 0x8000 /* This process has a seccomp filter
+ * attached.
+ */
+
+/* qualifier flags */
+# define QUAL_TRACE 0x001 /* this system call should be traced */
+# define QUAL_ABBREV 0x002 /* abbreviate the structures of this syscall */
+# define QUAL_VERBOSE 0x004 /* decode the structures of this syscall */
+# define QUAL_RAW 0x008 /* print all args in hex for this syscall */
+# define QUAL_INJECT 0x010 /* tamper with this system call on purpose */
+
+# define DEFAULT_QUAL_FLAGS (QUAL_TRACE | QUAL_ABBREV | QUAL_VERBOSE)
+
+# define entering(tcp) (!((tcp)->flags & TCB_INSYSCALL))
+# define exiting(tcp) ((tcp)->flags & TCB_INSYSCALL)
+# define syserror(tcp) ((tcp)->u_error != 0)
+# define traced(tcp) ((tcp)->qual_flg & QUAL_TRACE)
+# define verbose(tcp) ((tcp)->qual_flg & QUAL_VERBOSE)
+# define abbrev(tcp) ((tcp)->qual_flg & QUAL_ABBREV)
+# define raw(tcp) ((tcp)->qual_flg & QUAL_RAW)
+# define inject(tcp) ((tcp)->qual_flg & QUAL_INJECT)
+# define filtered(tcp) ((tcp)->flags & TCB_FILTERED)
+# define hide_log(tcp) ((tcp)->flags & TCB_HIDE_LOG)
+# define check_exec_syscall(tcp) ((tcp)->flags & TCB_CHECK_EXEC_SYSCALL)
+# define syscall_tampered(tcp) ((tcp)->flags & TCB_TAMPERED)
+# define recovering(tcp) ((tcp)->flags & TCB_RECOVERING)
+# define inject_delay_exit(tcp) ((tcp)->flags & TCB_INJECT_DELAY_EXIT)
+# define syscall_delayed(tcp) ((tcp)->flags & TCB_DELAYED)
+# define syscall_tampered_nofail(tcp) ((tcp)->flags & TCB_TAMPERED_NO_FAIL)
+# define has_seccomp_filter(tcp) ((tcp)->flags & TCB_SECCOMP_FILTER)
+
+extern const struct_sysent stub_sysent;
+# define tcp_sysent(tcp) (tcp->s_ent ?: &stub_sysent)
+# define n_args(tcp) (tcp_sysent(tcp)->nargs)
+
+# include "xlat.h"
+
+extern const struct xlat addrfams[];
+extern const struct xlat arp_hardware_types[];
+extern const struct xlat at_flags[];
+extern const struct xlat clocknames[];
+extern const struct xlat dirent_types[];
+extern const struct xlat ethernet_protocols[];
+extern const struct xlat inet_protocols[];
+extern const struct xlat evdev_abs[];
+extern const struct xlat audit_arch[];
+extern const struct xlat evdev_ev[];
+extern const struct xlat iffflags[];
+extern const struct xlat ip_type_of_services[];
+extern const struct xlat ipc_private[];
+extern const struct xlat msg_flags[];
+extern const struct xlat netlink_protocols[];
+extern const struct xlat nl_netfilter_msg_types[];
+extern const struct xlat nl_route_types[];
+extern const struct xlat open_access_modes[];
+extern const struct xlat open_mode_flags[];
+extern const struct xlat pollflags[];
+extern const struct xlat ptrace_cmds[];
+extern const struct xlat resource_flags[];
+extern const struct xlat routing_scopes[];
+extern const struct xlat routing_table_ids[];
+extern const struct xlat routing_types[];
+extern const struct xlat rwf_flags[];
+extern const struct xlat seccomp_filter_flags[];
+extern const struct xlat seccomp_ret_action[];
+extern const struct xlat setns_types[];
+extern const struct xlat sg_io_info[];
+extern const struct xlat socketlayers[];
+extern const struct xlat socktypes[];
+extern const struct xlat tcp_state_flags[];
+extern const struct xlat tcp_states[];
+extern const struct xlat whence_codes[];
+
+/* Format of syscall return values */
+# define RVAL_UDECIMAL 000 /* unsigned decimal format */
+# define RVAL_HEX 001 /* hex format */
+# define RVAL_OCTAL 002 /* octal format */
+# define RVAL_FD 010 /* file descriptor */
+# define RVAL_TID 011 /* task ID */
+# define RVAL_SID 012 /* session ID */
+# define RVAL_TGID 013 /* thread group ID */
+# define RVAL_PGID 014 /* process group ID */
+# define RVAL_MASK 017 /* mask for these values */
+
+# define RVAL_STR 020 /* Print `auxstr' field after return val */
+# define RVAL_NONE 040 /* Print nothing */
+
+# define RVAL_DECODED 0100 /* syscall decoding finished */
+# define RVAL_IOCTL_DECODED 0200 /* ioctl sub-parser successfully decoded
+ the argument */
+
+# define IOCTL_NUMBER_UNKNOWN 0
+# define IOCTL_NUMBER_HANDLED 1
+# define IOCTL_NUMBER_STOP_LOOKUP 010
+
+# define indirect_ipccall(tcp) (tcp_sysent(tcp)->sys_flags & TRACE_INDIRECT_SUBCALL)
+
+enum pid_type {
+ PT_TID,
+ PT_TGID,
+ PT_PGID,
+ PT_SID,
+
+ PT_COUNT,
+ PT_NONE = -1
+};
+
+enum sock_proto {
+ SOCK_PROTO_UNKNOWN,
+ SOCK_PROTO_UNIX,
+ SOCK_PROTO_TCP,
+ SOCK_PROTO_UDP,
+ SOCK_PROTO_UDPLITE,
+ SOCK_PROTO_DCCP,
+ SOCK_PROTO_SCTP,
+ SOCK_PROTO_L2TP_IP,
+ SOCK_PROTO_PING,
+ SOCK_PROTO_RAW,
+ SOCK_PROTO_TCPv6,
+ SOCK_PROTO_UDPv6,
+ SOCK_PROTO_UDPLITEv6,
+ SOCK_PROTO_DCCPv6,
+ SOCK_PROTO_L2TP_IPv6,
+ SOCK_PROTO_SCTPv6,
+ SOCK_PROTO_PINGv6,
+ SOCK_PROTO_RAWv6,
+ SOCK_PROTO_NETLINK,
+};
+extern enum sock_proto get_proto_by_name(const char *);
+extern int get_family_by_proto(enum sock_proto proto);
+
+enum iov_decode {
+ IOV_DECODE_ADDR,
+ IOV_DECODE_STR,
+ IOV_DECODE_NETLINK
+};
+
+typedef enum {
+ CFLAG_NONE = 0,
+ CFLAG_ONLY_STATS,
+ CFLAG_BOTH
+} cflag_t;
+extern cflag_t cflag;
+extern bool Tflag;
+extern int Tflag_scale;
+extern int Tflag_width;
+extern bool iflag;
+extern bool count_wallclock;
+extern unsigned int pidns_translation;
+/* are we filtering traces based on paths? */
+extern struct path_set {
+ const char **paths_selected;
+ size_t num_selected;
+ size_t size;
+} global_path_set;
+# define tracing_paths (global_path_set.num_selected != 0)
+enum xflag_opts {
+ HEXSTR_NONE,
+ HEXSTR_NON_ASCII,
+ HEXSTR_ALL,
+
+ NUM_HEXSTR_OPTS
+};
+extern unsigned xflag;
+extern bool followfork;
+extern bool output_separately;
+# ifdef ENABLE_STACKTRACE
+/* if this is true do the stack trace for every system call */
+extern bool stack_trace_enabled;
+# else
+# define stack_trace_enabled 0
+# endif
+extern unsigned ptrace_setoptions;
+extern unsigned max_strlen;
+extern unsigned os_release;
+# undef KERNEL_VERSION
+# define KERNEL_VERSION(a, b, c) (((a) << 16) + ((b) << 8) + (c))
+
+extern int read_int_from_file(const char *, int *);
+
+extern void set_sortby(const char *);
+extern int set_overhead(const char *);
+extern void set_count_summary_columns(const char *columns);
+
+extern bool get_instruction_pointer(struct tcb *, kernel_ulong_t *);
+extern bool get_stack_pointer(struct tcb *, kernel_ulong_t *);
+extern void print_instruction_pointer(struct tcb *);
+
+extern void print_syscall_number(struct tcb *);
+
+extern void print_syscall_resume(struct tcb *tcp);
+
+extern int syscall_entering_decode(struct tcb *);
+extern int syscall_entering_trace(struct tcb *, unsigned int *);
+extern void syscall_entering_finish(struct tcb *, int);
+
+extern int syscall_exiting_decode(struct tcb *, struct timespec *);
+extern int syscall_exiting_trace(struct tcb *, struct timespec *, int);
+extern void syscall_exiting_finish(struct tcb *);
+
+extern void count_syscall(struct tcb *, const struct timespec *);
+extern void call_summary(FILE *);
+
+extern void clear_regs(struct tcb *tcp);
+extern int get_scno(struct tcb *);
+extern kernel_ulong_t get_rt_sigframe_addr(struct tcb *);
+
+/**
+ * Convert a (shuffled) syscall number to the corresponding syscall name.
+ *
+ * @param scno Syscall number.
+ * @return String literal corresponding to the syscall number in case latter
+ * is valid; NULL otherwise.
+ */
+extern const char *syscall_name(kernel_ulong_t scno);
+/**
+ * Convert a syscall name to the corresponding (shuffled) syscall number.
+ *
+ * @param s Syscall name.
+ * @param p Personality.
+ * @param start From which position in syscall entry table resume the search.
+ * @return Shuffled syscall number (ready to use against sysent_vec)
+ * if syscall name is found; -1 otherwise.
+ */
+extern kernel_long_t scno_by_name(const char *s, unsigned p,
+ kernel_long_t start);
+/**
+ * Shuffle syscall numbers so that we don't have huge gaps in syscall table.
+ * The shuffling should be an involution: shuffle_scno(shuffle_scno(n)) == n.
+ *
+ * @param scno Raw or shuffled syscall number.
+ * @return Shuffled or raw syscall number, respectively.
+ */
+extern kernel_ulong_t shuffle_scno(kernel_ulong_t scno);
+/**
+ * Print error name in accordance with current xlat style setting.
+ *
+ * @param err Error value.
+ * @param negated If set to true, negative values of the err parameter indicate
+ * error condition, otherwise positive.
+ */
+extern void print_err(int64_t err, bool negated);
+
+extern bool is_erestart(struct tcb *);
+extern void temporarily_clear_syserror(struct tcb *);
+extern void restore_cleared_syserror(struct tcb *);
+
+extern void *get_tcb_priv_data(const struct tcb *);
+extern int set_tcb_priv_data(struct tcb *, void *priv_data,
+ void (*free_priv_data)(void *));
+extern void free_tcb_priv_data(struct tcb *);
+
+static inline unsigned long get_tcb_priv_ulong(const struct tcb *tcp)
+{
+ return (unsigned long) get_tcb_priv_data(tcp);
+}
+
+static inline int set_tcb_priv_ulong(struct tcb *tcp, unsigned long val)
+{
+ return set_tcb_priv_data(tcp, (void *) val, 0);
+}
+
+/**
+ * @return 0 on success, -1 on error.
+ */
+extern int
+umoven(struct tcb *, kernel_ulong_t addr, unsigned int len, void *laddr);
+# define umove(pid, addr, objp) \
+ umoven((pid), (addr), sizeof(*(objp)), (void *) (objp))
+
+/**
+ * @return true on success, false on error.
+ */
+extern bool
+tfetch_mem64(struct tcb *, uint64_t addr, unsigned int len, void *laddr);
+
+static inline bool
+tfetch_mem(struct tcb *tcp, const kernel_ulong_t addr,
+ unsigned int len, void *laddr)
+{
+ return tfetch_mem64(tcp, addr, len, laddr);
+}
+# define tfetch_obj(pid, addr, objp) \
+ tfetch_mem((pid), (addr), sizeof(*(objp)), (void *) (objp))
+
+/**
+ * @return true on success, false on error.
+ */
+extern bool
+tfetch_mem64_ignore_syserror(struct tcb *, uint64_t addr,
+ unsigned int len, void *laddr);
+
+static inline bool
+tfetch_mem_ignore_syserror(struct tcb *tcp, const kernel_ulong_t addr,
+ unsigned int len, void *laddr)
+{
+ return tfetch_mem64_ignore_syserror(tcp, addr, len, laddr);
+}
+
+/**
+ * @return 0 on success, -1 on error (and print addr).
+ */
+extern int
+umoven_or_printaddr64(struct tcb *, uint64_t addr,
+ unsigned int len, void *laddr);
+# define umove_or_printaddr64(pid, addr, objp) \
+ umoven_or_printaddr64((pid), (addr), sizeof(*(objp)), (void *) (objp))
+
+static inline int
+umoven_or_printaddr(struct tcb *tcp, const kernel_ulong_t addr,
+ unsigned int len, void *laddr)
+{
+ return umoven_or_printaddr64(tcp, addr, len, laddr);
+}
+# define umove_or_printaddr(pid, addr, objp) \
+ umoven_or_printaddr((pid), (addr), sizeof(*(objp)), (void *) (objp))
+
+/**
+ * @return 0 on success, -1 on error (and print addr).
+ */
+extern int
+umoven_or_printaddr64_ignore_syserror(struct tcb *, uint64_t addr,
+ unsigned int len, void *laddr);
+# define umove_or_printaddr64_ignore_syserror(pid, addr, objp) \
+ umoven_or_printaddr64_ignore_syserror((pid), (addr), sizeof(*(objp)), \
+ (void *) (objp))
+
+static inline int
+umoven_or_printaddr_ignore_syserror(struct tcb *tcp, const kernel_ulong_t addr,
+ unsigned int len, void *laddr)
+{
+ return umoven_or_printaddr64_ignore_syserror(tcp, addr, len, laddr);
+}
+# define umove_or_printaddr_ignore_syserror(pid, addr, objp) \
+ umoven_or_printaddr_ignore_syserror((pid), (addr), sizeof(*(objp)), \
+ (void *) (objp))
+
+/**
+ * @return strlen + 1 on success, 0 on success and no NUL seen, -1 on error.
+ */
+extern int
+umovestr(struct tcb *, kernel_ulong_t addr, unsigned int len, char *laddr);
+
+/* Invalidate the cache used by umove* functions. */
+extern void invalidate_umove_cache(void);
+
+extern int upeek(struct tcb *tcp, unsigned long, kernel_ulong_t *);
+extern int upoke(struct tcb *tcp, unsigned long, kernel_ulong_t);
+
+# if HAVE_ARCH_GETRVAL2
+extern long getrval2(struct tcb *);
+# endif
+
+extern const char *signame(const int);
+extern const char *sprintsigname(const int);
+extern void pathtrace_select_set(const char *, struct path_set *);
+extern bool pathtrace_match_set(struct tcb *, struct path_set *);
+
+static inline void
+pathtrace_select(const char *path)
+{
+ return pathtrace_select_set(path, &global_path_set);
+}
+
+static inline bool
+pathtrace_match(struct tcb *tcp)
+{
+ return pathtrace_match_set(tcp, &global_path_set);
+}
+
+extern int getfdpath_pid(pid_t pid, int fd, char *buf, unsigned bufsize);
+
+static inline int
+getfdpath(struct tcb *tcp, int fd, char *buf, unsigned bufsize)
+{
+ return getfdpath_pid(tcp->pid, fd, buf, bufsize);
+}
+
+extern unsigned long getfdinode(struct tcb *, int);
+extern enum sock_proto getfdproto(struct tcb *, int);
+
+extern const char *xlookup(const struct xlat *, const uint64_t);
+extern const char *xlookup_le(const struct xlat *, uint64_t *);
+
+struct dyxlat;
+struct dyxlat *dyxlat_alloc(size_t nmemb);
+void dyxlat_free(struct dyxlat *);
+const struct xlat *dyxlat_get(const struct dyxlat *);
+void dyxlat_add_pair(struct dyxlat *, uint64_t val, const char *str, size_t len);
+
+const struct xlat *genl_families_xlat(struct tcb *tcp);
+
+extern unsigned long get_pagesize(void);
+extern int next_set_bit(const void *bit_array, unsigned cur_bit, unsigned size_bits);
+
+/*
+ * Returns STR if it does not start with PREFIX,
+ * or a pointer to the first char in STR after PREFIX.
+ * The length of PREFIX is specified by PREFIX_LEN.
+ */
+static inline const char *
+str_strip_prefix_len(const char *str, const char *prefix, size_t prefix_len)
+{
+ return strncmp(str, prefix, prefix_len) ? str : str + prefix_len;
+}
+
+# define STR_STRIP_PREFIX(str, prefix) \
+ str_strip_prefix_len((str), (prefix), sizeof(prefix) - 1)
+
+/** String is '\0'-terminated. */
+# define QUOTE_0_TERMINATED 0x01
+/** Do not emit leading and ending '"' characters. */
+# define QUOTE_OMIT_LEADING_TRAILING_QUOTES 0x02
+/** Do not print '\0' if it is the last character. */
+# define QUOTE_OMIT_TRAILING_0 0x08
+/** Print ellipsis if the last character is not '\0' */
+# define QUOTE_EXPECT_TRAILING_0 0x10
+/** Print string in hex (using '\xHH' notation). */
+# define QUOTE_FORCE_HEX 0x20
+/** Enclose the string in C comment syntax. */
+# define QUOTE_EMIT_COMMENT 0x40
+
+extern int string_quote(const char *, char *, unsigned int, unsigned int,
+ const char *escape_chars);
+extern int print_quoted_string_ex(const char *, unsigned int, unsigned int,
+ const char *escape_chars);
+extern int print_quoted_string(const char *, unsigned int, unsigned int);
+extern int print_quoted_cstring(const char *, unsigned int);
+
+/* a refers to the lower numbered u_arg,
+ * b refers to the higher numbered u_arg
+ */
+# ifdef WORDS_BIGENDIAN
+# define ULONG_LONG(a, b) \
+ ((unsigned long long)(unsigned)(b) | ((unsigned long long)(a)<<32))
+# else
+# define ULONG_LONG(a, b) \
+ ((unsigned long long)(unsigned)(a) | ((unsigned long long)(b)<<32))
+# endif
+extern int getllval(struct tcb *, unsigned long long *, int);
+extern int printllval(struct tcb *, const char *, int)
+ ATTRIBUTE_FORMAT((printf, 2, 0));
+
+extern void printaddr64(uint64_t addr);
+
+static inline void
+printaddr(const kernel_ulong_t addr)
+{
+ printaddr64(addr);
+}
+
+# define xlat_verbose(style_) ((style_) & XLAT_STYLE_VERBOSITY_MASK)
+# define xlat_format(style_) ((style_) & XLAT_STYLE_FORMAT_MASK)
+
+extern enum xlat_style xlat_verbosity;
+
+extern int printxvals_ex(uint64_t val, const char *dflt,
+ enum xlat_style, const struct xlat *, ...)
+ ATTRIBUTE_SENTINEL;
+# define printxvals(val_, dflt_, ...) \
+ printxvals_ex((val_), (dflt_), XLAT_STYLE_DEFAULT, __VA_ARGS__)
+# define printxval_ex(xlat_, val_, dflt_, style_) \
+ printxvals_ex((val_), (dflt_), (style_), (xlat_), NULL)
+
+extern int sprintxval_ex(char *buf, size_t size, const struct xlat *,
+ unsigned int val, const char *dflt, enum xlat_style);
+
+static inline int
+sprintxval(char *buf, size_t size, const struct xlat *xlat, unsigned int val,
+ const char *dflt)
+{
+ return sprintxval_ex(buf, size, xlat, val, dflt, XLAT_STYLE_DEFAULT);
+}
+
+enum xlat_style_private_flag_bits {
+ /* print_array */
+ PAF_PRINT_INDICES_BIT = XLAT_STYLE_SPEC_BITS + 1,
+ PAF_ARRAY_TRUNCATED_BIT,
+
+ /* print_xlat */
+ PXF_DEFAULT_STR_BIT,
+};
+
+enum xlat_style_private_flags {
+ /* print_array */
+ FLAG(PAF_PRINT_INDICES),
+ FLAG(PAF_ARRAY_TRUNCATED),
+
+ /* print_xlat */
+ FLAG(PXF_DEFAULT_STR),
+};
+
+/**
+ * Print a value in accordance with xlat formatting settings.
+ *
+ * @param val Value itself.
+ * @param str String representation of the value. Semantics may be affected
+ * by style argument;
+ * @param style Combination of flags from enum xlat_style and PXF_* flags
+ * from enum xlat_style_private_flags:
+ * - PXF_DEFAULT_STR - interpret str argument as default
+ * (fallback) string and not as string representation of val.
+ */
+extern void print_xlat_ex(uint64_t val, const char *str, uint32_t style);
+# define print_xlat(val_) \
+ print_xlat_ex((val_), #val_, XLAT_STYLE_DEFAULT)
+# define print_xlat32(val_) \
+ print_xlat_ex((uint32_t) (val_), #val_, XLAT_STYLE_DEFAULT)
+# define print_xlat_u(val_) \
+ print_xlat_ex((val_), #val_, XLAT_STYLE_FMT_U)
+# define print_xlat_d(val_) \
+ print_xlat_ex((val_), #val_, XLAT_STYLE_FMT_D)
+
+extern int printargs(struct tcb *);
+extern int printargs_u(struct tcb *);
+extern int printargs_d(struct tcb *);
+
+extern int printflags_ex(uint64_t flags, const char *dflt,
+ enum xlat_style, const struct xlat *, ...)
+ ATTRIBUTE_SENTINEL;
+extern const char *sprintflags_ex(const char *prefix, const struct xlat *,
+ uint64_t flags, char sep, enum xlat_style);
+
+static inline const char *
+sprintflags(const char *prefix, const struct xlat *xlat, uint64_t flags)
+{
+ return sprintflags_ex(prefix, xlat, flags, '\0', XLAT_STYLE_DEFAULT);
+}
+
+extern const char *sprinttime(long long sec);
+extern const char *sprinttime_nsec(long long sec, unsigned long long nsec);
+extern const char *sprinttime_usec(long long sec, unsigned long long usec);
+
+# ifndef MAX_ADDR_LEN
+# define MAX_ADDR_LEN 32
+# endif
+
+extern const char *sprint_mac_addr(const uint8_t addr[], size_t size);
+extern void print_mac_addr(const char *prefix,
+ const uint8_t addr[], size_t size);
+
+extern const char *sprint_hwaddr(const uint8_t addr[], size_t size,
+ uint32_t devtype);
+extern void print_hwaddr(const char *prefix,
+ const uint8_t addr[], size_t size, uint32_t devtype);
+
+extern void print_uuid(const unsigned char *uuid);
+
+extern void print_symbolic_mode_t(unsigned int);
+extern void print_numeric_umode_t(unsigned short);
+extern void print_numeric_ll_umode_t(unsigned long long);
+extern void print_dev_t(unsigned long long dev);
+extern void print_kernel_version(unsigned long version);
+extern void print_abnormal_hi(kernel_ulong_t);
+extern void print_ioprio(unsigned int ioprio);
+
+extern bool print_int8_array_member(struct tcb *, void *elem_buf,
+ size_t elem_size, void *data);
+extern bool print_uint8_array_member(struct tcb *, void *elem_buf,
+ size_t elem_size, void *data);
+extern bool print_int32_array_member(struct tcb *, void *elem_buf,
+ size_t elem_size, void *data);
+extern bool print_uint32_array_member(struct tcb *, void *elem_buf,
+ size_t elem_size, void *data);
+extern bool print_uint64_array_member(struct tcb *, void *elem_buf,
+ size_t elem_size, void *data);
+extern bool print_xint32_array_member(struct tcb *, void *elem_buf,
+ size_t elem_size, void *data);
+extern bool print_xint64_array_member(struct tcb *, void *elem_buf,
+ size_t elem_size, void *data);
+
+static inline bool
+print_xlong_array_member(struct tcb *tcp, void *elem_buf, size_t elem_size,
+ void *data)
+{
+ return dispatch_wordsize(print_xint64_array_member,
+ print_xint32_array_member,
+ tcp, elem_buf, elem_size, data);
+}
+
+static inline bool
+print_kulong_array_member(struct tcb *tcp, void *elem_buf, size_t elem_size,
+ void *data)
+{
+ return dispatch_klongsize(print_uint64_array_member,
+ print_uint32_array_member,
+ tcp, elem_buf, elem_size, data);
+}
+
+
+typedef bool (*tfetch_mem_fn)(struct tcb *, kernel_ulong_t addr,
+ unsigned int size, void *dest);
+typedef bool (*print_fn)(struct tcb *, void *elem_buf,
+ size_t elem_size, void *opaque_data);
+typedef int (*print_obj_by_addr_fn)(struct tcb *, kernel_ulong_t);
+typedef const char * (*sprint_obj_by_addr_fn)(struct tcb *, kernel_ulong_t);
+
+
+/**
+ * Array printing function with over-engineered interface.
+ *
+ * @param start_addr If tfetch_mem_fn is non-NULL: address in tracee's
+ * memory where the start of the array is located.
+ * If tfetch_mem_fn is NULL: ignored.
+ * @param nmemb Number of elements in array.
+ * @param elem_buf If tfetch_mem_fn is non-NULL: a buffer where each
+ * element fetched by tfetch_mem_fn is stored.
+ * If tfetch_mem_fn is NULL: address of the start of
+ * the array in local memory.
+ * @param elem_size Size (in bytes) of each element in the array.
+ * @param tfetch_mem_fn Fetching function. If NULL, then elem_buf is treated
+ * as local array of nmemb members elem_size each;
+ * start_addr is ignored.
+ * @param print_func Element printing callback.
+ * @param opaque_data A value that is unconditionally passed to print_func
+ * in opaque_data argument.
+ * @param flags Combination of xlat style settings and additional
+ * flags from enum print_array_flags.
+ * @param index_xlat Xlat array that is used for printing indices.
+ * @param index_xlat_size The size of xlat array.
+ * @param index_dflt Default string for the values not found
+ * in index_xlat.
+ */
+extern bool
+print_array_ex(struct tcb *,
+ kernel_ulong_t start_addr,
+ size_t nmemb,
+ void *elem_buf,
+ size_t elem_size,
+ tfetch_mem_fn tfetch_mem_func,
+ print_fn print_func,
+ void *opaque_data,
+ unsigned int flags,
+ const struct xlat *index_xlat,
+ const char *index_dflt);
+
+/** Print an array from tracee's memory without any index printing features. */
+static inline bool
+print_array(struct tcb *const tcp,
+ const kernel_ulong_t start_addr,
+ const size_t nmemb,
+ void *const elem_buf,
+ const size_t elem_size,
+ tfetch_mem_fn tfetch_mem_func,
+ print_fn print_func,
+ void *const opaque_data)
+{
+ return print_array_ex(tcp, start_addr, nmemb, elem_buf, elem_size,
+ tfetch_mem_func, print_func, opaque_data,
+ 0, NULL, NULL);
+}
+
+/** Shorthand for printing local arrays. */
+static inline bool
+print_local_array_ex(struct tcb *tcp,
+ const void *start_addr,
+ const size_t nmemb,
+ const size_t elem_size,
+ print_fn print_func,
+ void *const opaque_data,
+ unsigned int flags,
+ const struct xlat *index_xlat,
+ const char *index_dflt)
+{
+ return print_array_ex(tcp, (uintptr_t) start_addr, nmemb,
+ NULL, elem_size, NULL, print_func,
+ opaque_data, flags, index_xlat, index_dflt);
+}
+
+/** Shorthand for a shorthand for printing local arrays. */
+# define print_local_array(tcp_, start_addr_, print_func_) \
+ print_local_array_ex((tcp_), (start_addr_), ARRAY_SIZE(start_addr_), \
+ sizeof((start_addr_)[0]), (print_func_), \
+ NULL, 0, NULL, NULL)
+
+#define print_local_array_upto(tcp_, start_addr_, upto_, print_func_) \
+ print_local_array_ex((tcp_), (start_addr_), \
+ CLAMP((upto_), 0, \
+ (typeof(upto_)) ARRAY_SIZE(start_addr_)), \
+ sizeof((start_addr_)[0]), (print_func_), \
+ NULL, 0, NULL, NULL)
+
+extern kernel_ulong_t *
+fetch_indirect_syscall_args(struct tcb *, kernel_ulong_t addr, unsigned int n_args);
+
+extern void pidns_init(void);
+
+/**
+ * Returns the pid of the tracee as present in /proc of the tracer (can be
+ * different from tcp->pid if /proc and the tracer process are in different PID
+ * namespaces).
+ */
+extern int get_proc_pid(struct tcb *);
+
+/**
+ * Translates a pid from tracee's namespace to our namespace.
+ *
+ * @param tcp The tcb of the tracee
+ * (NULL: from_id is in strace's namespace. Useful for
+ * getting the proc PID of from_id)
+ * @param from_id The id to be translated
+ * @param type The PID type of from_id
+ * @param proc_pid_ptr If not NULL, writes the proc PID to this location
+ * @return The translated id, or 0 if translation fails.
+ */
+extern int translate_pid(struct tcb *, int dest_id, enum pid_type type,
+ int *proc_pid_ptr);
+
+extern void
+dumpiov_in_msghdr(struct tcb *, kernel_ulong_t addr, kernel_ulong_t data_size);
+
+extern void
+dumpiov_in_mmsghdr(struct tcb *, kernel_ulong_t addr);
+
+extern void
+dumpiov_upto(struct tcb *, int len, kernel_ulong_t addr, kernel_ulong_t data_size);
+
+extern void
+dumpstr(struct tcb *, kernel_ulong_t addr, kernel_ulong_t len);
+
+extern int
+printstr_ex(struct tcb *, kernel_ulong_t addr, kernel_ulong_t len,
+ unsigned int user_style);
+
+/**
+ * Print a region of tracee memory only in case non-zero bytes are present
+ * there. It almost fits into printstr_ex, but it has some pretty specific
+ * behaviour peculiarities (like printing of ellipsis on error) to readily
+ * integrate it there.
+ *
+ * Since it is expected to be used for printing tail of a structure in tracee's
+ * memory, it accepts a combination of start_addr/start_offs/total_len and does
+ * the relevant calculations itself.
+ *
+ * @param prefix_fun A function called before something is going to be printed.
+ * @param start_addr Address of the beginning of a structure (whose tail
+ * is supposedly to be printed) in tracee's memory.
+ * @param start_offs Offset from the beginning of the structure where the tail
+ * data starts.
+ * @param total_len Total size of the tracee's memory region containing
+ * the structure and the tail data.
+ * Caller is responsible for imposing a sensible (usually
+ * mandated by the kernel interface, like get_pagesize())
+ * limit here.
+ * @param style Passed to string_quote as "style" parameter.
+ * @return Returns true is anything was printed, false otherwise.
+ */
+extern bool print_nonzero_bytes(struct tcb *const tcp,
+ void (*prefix_fun)(void),
+ const kernel_ulong_t start_addr,
+ const unsigned int start_offs,
+ const unsigned int total_len,
+ const unsigned int style);
+
+extern int
+printpathn(struct tcb *, kernel_ulong_t addr, unsigned int n);
+
+extern int
+printpath(struct tcb *, kernel_ulong_t addr);
+
+# define TIMESPEC_TEXT_BUFSIZE \
+ (sizeof(long long) * 3 * 2 + sizeof("{tv_sec=-, tv_nsec=}"))
+
+/**
+ * Returns the pid associated with pidfd of the process with ID pid_of_fd
+ */
+extern pid_t pidfd_get_pid(pid_t pid_of_fd, int fd);
+/**
+ * Print file descriptor fd owned by process with ID pid (from the PID NS
+ * of the tracer).
+ */
+extern void printfd_pid(struct tcb *tcp, pid_t pid, int fd);
+
+static inline void
+printfd(struct tcb *tcp, int fd)
+{
+ printfd_pid(tcp, tcp->pid, fd);
+}
+
+/**
+ * Print file descriptor fd owned by process with ID pid (from the PID NS
+ * of the tracee).
+ */
+extern void printfd_pid_tracee_ns(struct tcb *tcp, pid_t pid, int fd);
+
+/** Prints a PID specified in the tracee's PID namespace */
+extern void printpid(struct tcb *, int pid, enum pid_type type);
+
+/**
+ * Prints pid as a TGID if positive, and PGID if negative
+ * (like the first argument of kill).
+ */
+extern void printpid_tgid_pgid(struct tcb *, int pid);
+extern void print_sockaddr(struct tcb *, const void *sa, int len);
+extern bool
+print_inet_addr(int af, const void *addr, unsigned int len, const char *var_name);
+extern bool
+decode_inet_addr(struct tcb *, kernel_ulong_t addr,
+ unsigned int len, int family, const char *var_name);
+extern void print_ax25_addr(const void /* ax25_address */ *addr);
+extern void print_x25_addr(const void /* struct x25_address */ *addr);
+extern const char *get_sockaddr_by_inode(struct tcb *, int fd, unsigned long inode);
+extern bool print_sockaddr_by_inode(struct tcb *, int fd, unsigned long inode);
+extern void print_dirfd(struct tcb *, int);
+
+extern int
+decode_sockaddr(struct tcb *, kernel_ulong_t addr, int addrlen);
+
+extern void printuid(const char *, const unsigned int);
+
+extern void
+print_sigset_addr_len(struct tcb *, kernel_ulong_t addr, kernel_ulong_t len);
+extern void
+print_sigset_addr(struct tcb *, kernel_ulong_t addr);
+
+extern const char *sprintsigmask_n(const char *, const void *, unsigned int);
+extern void printsignal(int);
+
+extern void
+tprint_iov_upto(struct tcb *, kernel_ulong_t len, kernel_ulong_t addr,
+ enum iov_decode, kernel_ulong_t data_size);
+
+extern void
+decode_netlink(struct tcb *, int fd, kernel_ulong_t addr, kernel_ulong_t len);
+
+extern void tprint_open_modes(unsigned int);
+extern const char *sprint_open_modes(unsigned int);
+
+extern void
+decode_seccomp_fprog(struct tcb *, kernel_ulong_t addr);
+
+extern void
+print_seccomp_fprog(struct tcb *, kernel_ulong_t addr, unsigned short len);
+
+extern void
+decode_sock_fprog(struct tcb *, kernel_ulong_t addr);
+
+extern void
+print_sock_fprog(struct tcb *, kernel_ulong_t addr, unsigned short len);
+
+struct strace_stat;
+extern void print_struct_stat(struct tcb *, const struct strace_stat *const st);
+
+struct strace_statfs;
+struct strace_keyctl_kdf_params;
+
+extern void
+print_struct_statfs(struct tcb *, kernel_ulong_t addr);
+
+extern void
+print_struct_statfs64(struct tcb *, kernel_ulong_t addr, kernel_ulong_t size);
+
+extern int
+fetch_perf_event_attr(struct tcb *const tcp, const kernel_ulong_t addr);
+extern void
+print_perf_event_attr(struct tcb *const tcp, const kernel_ulong_t addr);
+
+extern const char *get_ifname(const unsigned int ifindex);
+extern void print_ifindex(unsigned int);
+
+extern void print_bpf_filter_code(const uint16_t code, bool extended);
+
+extern void qualify(const char *);
+extern void qualify_trace(const char *);
+extern void qualify_abbrev(const char *);
+extern void qualify_verbose(const char *);
+extern void qualify_raw(const char *);
+extern void qualify_signals(const char *);
+extern void qualify_status(const char *);
+extern void qualify_quiet(const char *);
+extern void qualify_decode_fd(const char *);
+extern void qualify_read(const char *);
+extern void qualify_write(const char *);
+extern void qualify_fault(const char *);
+extern void qualify_inject(const char *);
+extern void qualify_kvm(const char *);
+extern unsigned int qual_flags(const unsigned int);
+
+# define DECL_IOCTL(name) \
+extern int \
+name ## _ioctl(struct tcb *, unsigned int request, kernel_ulong_t arg) \
+/* End of DECL_IOCTL definition. */
+
+DECL_IOCTL(dm);
+DECL_IOCTL(evdev);
+DECL_IOCTL(fs_0x94);
+DECL_IOCTL(fs_f);
+DECL_IOCTL(fs_x);
+DECL_IOCTL(gpio);
+DECL_IOCTL(inotify);
+DECL_IOCTL(kvm);
+DECL_IOCTL(nbd);
+DECL_IOCTL(nsfs);
+DECL_IOCTL(ptp);
+DECL_IOCTL(random);
+DECL_IOCTL(scsi);
+DECL_IOCTL(tee);
+DECL_IOCTL(term);
+DECL_IOCTL(ubi);
+DECL_IOCTL(uffdio);
+DECL_IOCTL(watchdog);
+# undef DECL_IOCTL
+
+extern int decode_sg_io_v4(struct tcb *, const kernel_ulong_t arg);
+extern void print_evdev_ff_type(const kernel_ulong_t val);
+
+struct nlmsghdr;
+
+typedef bool (*netlink_decoder_t)(struct tcb *, const struct nlmsghdr *,
+ kernel_ulong_t addr, unsigned int len);
+
+# define DECL_NETLINK(name) \
+extern bool \
+decode_netlink_ ## name(struct tcb *, const struct nlmsghdr *, \
+ kernel_ulong_t addr, unsigned int len) \
+/* End of DECL_NETLINK definition. */
+
+DECL_NETLINK(crypto);
+DECL_NETLINK(netfilter);
+DECL_NETLINK(route);
+DECL_NETLINK(selinux);
+DECL_NETLINK(sock_diag);
+
+extern void
+decode_netlink_kobject_uevent(struct tcb *, kernel_ulong_t addr,
+ kernel_ulong_t len);
+
+enum find_xlat_flag_bits {
+ FXL_CASE_SENSITIVE_BIT,
+};
+
+enum find_xlat_flags {
+ /** Whether to use strcmp instead of strcasecmp for comparison */
+ FLAG(FXL_CASE_SENSITIVE),
+};
+
+/**
+ * Searches for a string-value pair in the provided array of pairs.
+ *
+ * @param items Array of string-value pairs to search in.
+ * @param s String to search for.
+ * @param num_items Item count in items array.
+ * @param flags Bitwise-or'ed flags from enum find_xlat_flags.
+ * @return Pointer to the first matching string-value pair inside items
+ * or NULL if nothing has been found.
+ */
+extern const struct xlat_data *find_xlat_val_ex(const struct xlat_data *items,
+ const char *s, size_t num_items,
+ unsigned int flags);
+# define find_xlat_val(items_, s_) \
+ find_xlat_val_ex((items_), (s_), ARRAY_SIZE(items_), 0)
+# define find_xlat_val_case(items_, s_) \
+ find_xlat_val_ex((items_), (s_), ARRAY_SIZE(items_), FXL_CASE_SENSITIVE)
+
+/**
+ * A find_xlat_val_ex wrapper for option arguments parsing. Provides a value
+ * from strs array that matched the supplied arg string. If arg is NULL,
+ * default_val is returned. If nothing has matched, not_found value
+ * is returned.
+ *
+ * find_arg_val provides a wrapper for the common case of statically-defined
+ * strs arrays.
+ *
+ * @param arg Argument string to parse
+ * @param strs Array of string-value pairs to match arg against.
+ * @param strs_size Element count in the strs array.
+ * @param default_val Value to return if arg is NULL.
+ * @param not_found Value to return if arg hasn't found among strs.
+ * @return default_val is arg is NULL, value part of the matched
+ * string-value pair, or not_found if nothing has matched.
+ */
+extern uint64_t find_arg_val_(const char *arg, const struct xlat_data *strs,
+ size_t strs_size, uint64_t default_val,
+ uint64_t not_found);
+/** A find_arg_val_ wrapper that supplies strs_size to it using ARRAY_SIZE. */
+# define find_arg_val(arg_, strs_, dflt_, not_found_) \
+ find_arg_val_((arg_), (strs_), ARRAY_SIZE(strs_), (dflt_), (not_found_))
+
+/**
+ * A find_arg_val wrapper for parsing time scale names.
+ *
+ * @param arg String to parse
+ * @param empty_dflt Default scale for the empty arg.
+ * @param null_dflt Default scale for the NULL arg.
+ * @param width Width of the field required to print the second part
+ * with the specified precision.
+ * @return Time scale (amount of nanoseconds) if found,
+ * empty_dflt if arg is empty, null_dflt if arg is NULL,
+ * -1 if arg doesn't match any known time scale.
+ */
+extern int str2timescale_ex(const char *arg, int empty_dflt, int null_dflt,
+ int *width);
+/** str2timescale_ex wrapper for handling a separate argument. */
+# define str2timescale_optarg(arg_, w_) str2timescale_ex((arg_), -1, 1000, (w_))
+/** str2timescale_ex wrapper for handling a suffix in existing argument. */
+# define str2timescale_sfx(arg_, w_) str2timescale_ex((arg_), 1000, -1, (w_))
+
+extern int ts_nz(const struct timespec *);
+extern int ts_cmp(const struct timespec *, const struct timespec *);
+extern double ts_float(const struct timespec *);
+extern void ts_add(struct timespec *, const struct timespec *, const struct timespec *);
+extern void ts_sub(struct timespec *, const struct timespec *, const struct timespec *);
+extern void ts_mul(struct timespec *, const struct timespec *, uint64_t);
+extern void ts_div(struct timespec *, const struct timespec *, uint64_t);
+extern const struct timespec *ts_min(const struct timespec *, const struct timespec *);
+extern const struct timespec *ts_max(const struct timespec *, const struct timespec *);
+extern int parse_ts(const char *s, struct timespec *t);
+
+# ifdef ENABLE_STACKTRACE
+extern void unwind_init(void);
+extern void unwind_tcb_init(struct tcb *);
+extern void unwind_tcb_fin(struct tcb *);
+extern void unwind_tcb_print(struct tcb *);
+extern void unwind_tcb_capture(struct tcb *);
+# endif
+
+# ifdef HAVE_LINUX_KVM_H
+extern void kvm_run_structure_decoder_init(void);
+extern void kvm_vcpu_info_free(struct tcb *);
+# endif
+
+static inline int
+printstrn(struct tcb *tcp, kernel_ulong_t addr, kernel_ulong_t len)
+{
+ return printstr_ex(tcp, addr, len, 0);
+}
+
+static inline int
+printstr(struct tcb *tcp, kernel_ulong_t addr)
+{
+ return printstr_ex(tcp, addr, -1, QUOTE_0_TERMINATED);
+}
+
+static inline int
+printflags64(const struct xlat *x, uint64_t flags, const char *dflt)
+{
+ return printflags_ex(flags, dflt, XLAT_STYLE_DEFAULT, x, NULL);
+}
+
+static inline int
+printflags(const struct xlat *x, unsigned int flags, const char *dflt)
+{
+ return printflags64(x, flags, dflt);
+}
+
+static inline int
+printxval64(const struct xlat *x, const uint64_t val, const char *dflt)
+{
+ return printxvals(val, dflt, x, NULL);
+}
+
+static inline int
+printxval(const struct xlat *x, const unsigned int val, const char *dflt)
+{
+ return printxvals(val, dflt, x, NULL);
+}
+
+static inline int
+printxval64_u(const struct xlat *x, const uint64_t val, const char *dflt)
+{
+ return printxvals_ex(val, dflt, XLAT_STYLE_FMT_U, x, NULL);
+}
+
+static inline int
+printxval_u(const struct xlat *x, const unsigned int val, const char *dflt)
+{
+ return printxvals_ex(val, dflt, XLAT_STYLE_FMT_U, x, NULL);
+}
+
+static inline int
+printxval64_d(const struct xlat *x, const int64_t val, const char *dflt)
+{
+ return printxvals_ex(val, dflt, XLAT_STYLE_FMT_D, x, NULL);
+}
+
+static inline int
+printxval_d(const struct xlat *x, const int val, const char *dflt)
+{
+ return printxvals_ex(val, dflt, XLAT_STYLE_FMT_D, x, NULL);
+}
+
+static inline void
+tprint_iov(struct tcb *tcp, kernel_ulong_t len, kernel_ulong_t addr,
+ enum iov_decode decode_iov)
+{
+ tprint_iov_upto(tcp, len, addr, decode_iov, -1);
+}
+
+# if HAVE_ARCH_TIME32_SYSCALLS || HAVE_ARCH_TIMESPEC32
+extern bool print_timespec32_data_size(const void *arg, size_t size);
+extern bool print_timespec32_array_data_size(const void *arg,
+ unsigned int nmemb,
+ size_t size);
+# endif /* HAVE_ARCH_TIME32_SYSCALLS || HAVE_ARCH_TIMESPEC32 */
+# if HAVE_ARCH_TIME32_SYSCALLS
+extern int print_timespec32(struct tcb *, kernel_ulong_t);
+extern const char *sprint_timespec32(struct tcb *, kernel_ulong_t);
+extern int print_timespec32_utime_pair(struct tcb *, kernel_ulong_t);
+extern int print_itimerspec32(struct tcb *, kernel_ulong_t);
+extern int print_timex32(struct tcb *, kernel_ulong_t);
+# endif /* HAVE_ARCH_TIME32_SYSCALLS */
+
+extern bool print_timespec64_data_size(const void *arg, size_t size);
+extern bool print_timespec64_array_data_size(const void *arg,
+ unsigned int nmemb,
+ size_t size);
+extern int print_timespec64(struct tcb *, kernel_ulong_t);
+extern const char *sprint_timespec64(struct tcb *, kernel_ulong_t);
+extern int print_timespec64_utime_pair(struct tcb *, kernel_ulong_t);
+extern int print_itimerspec64(struct tcb *, kernel_ulong_t);
+
+extern bool print_timeval64_data_size(const void *arg, size_t size);
+
+extern int print_timex64(struct tcb *, kernel_ulong_t);
+
+# ifdef SPARC64
+extern int print_sparc64_timex(struct tcb *, kernel_ulong_t);
+# endif
+
+# ifdef ALPHA
+typedef struct {
+ int tv_sec, tv_usec;
+} timeval32_t;
+
+extern void print_timeval32_t(const timeval32_t *);
+extern void printrusage32(struct tcb *, kernel_ulong_t);
+extern const char *sprint_timeval32(struct tcb *, kernel_ulong_t addr);
+extern int print_timeval32(struct tcb *, kernel_ulong_t addr);
+extern int print_timeval32_utimes(struct tcb *, kernel_ulong_t addr);
+extern int print_itimerval32(struct tcb *, kernel_ulong_t addr);
+# endif
+
+# ifdef HAVE_STRUCT_USER_DESC
+/**
+ * Filter what to print from the point of view of the get_thread_area syscall.
+ * Kernel copies only entry_number field at first and then tries to write the
+ * whole structure.
+ */
+enum user_desc_print_filter {
+ /* Print the "entering" part of struct user_desc - entry_number. */
+ USER_DESC_ENTERING = 1,
+ /* Print the "exiting" part of the structure. */
+ USER_DESC_EXITING = 2,
+ USER_DESC_BOTH = USER_DESC_ENTERING | USER_DESC_EXITING,
+};
+
+extern void print_user_desc(struct tcb *, kernel_ulong_t addr,
+ enum user_desc_print_filter filter);
+# endif
+
+/* Strace log generation machinery.
+ *
+ * printing_tcp: tcb which has incomplete line being printed right now.
+ * NULL if last line has been completed ('\n'-terminated).
+ * printleader(tcp) examines it, finishes incomplete line if needed,
+ * the sets it to tcp.
+ * line_ended() clears printing_tcp and resets ->curcol = 0.
+ * tcp->curcol == 0 check is also used to detect completeness
+ * of last line, since in -ff mode just checking printing_tcp for NULL
+ * is not enough.
+ *
+ * If you change this code, test log generation in both -f and -ff modes
+ * using:
+ * strace -oLOG -f[f] test/threaded_execve
+ * strace -oLOG -f[f] test/sigkill_rain
+ * strace -oLOG -f[f] -p "`pidof web_browser`"
+ */
+extern struct tcb *printing_tcp;
+extern void printleader(struct tcb *);
+extern void line_ended(void);
+extern void tabto(void);
+extern void tprintf(const char *fmt, ...) ATTRIBUTE_FORMAT((printf, 1, 2));
+extern void tprints(const char *str);
+extern void tprintf_comment(const char *fmt, ...) ATTRIBUTE_FORMAT((printf, 1, 2));
+extern void tprints_comment(const char *str);
+
+/*
+ * Staging output for status qualifier.
+ */
+extern FILE *strace_open_memstream(struct tcb *tcp);
+extern void strace_close_memstream(struct tcb *tcp, bool publish);
+
+static inline void
+printaddr_comment(const kernel_ulong_t addr)
+{
+ tprintf_comment("%#llx", (unsigned long long) addr);
+}
+
+/*
+ * When u64 is interpreted by the kernel as an address, there is a difference
+ * in behaviour between 32-bit and 64-bit kernel in the way u64_to_user_ptr
+ * works (32-bit kernel trims higher bits during conversion which may result
+ * to a valid address). Since 32-bit strace cannot figure out what kind of
+ * kernel the tracee is running on, it has to account for both possibilities.
+ */
+# if CAN_ARCH_BE_COMPAT_ON_64BIT_KERNEL
+
+/**
+ * Print raw 64-bit value as an address if it's too big to fit in strace's
+ * kernel_long_t.
+ */
+static inline void
+print_big_u64_addr(const uint64_t addr)
+{
+ if (sizeof(kernel_long_t) < 8 && addr > max_kaddr()) {
+ printaddr64(addr);
+ tprints(" or ");
+ }
+}
+# else /* !CAN_ARCH_BE_COMPAT_ON_64BIT_KERNEL */
+# define print_big_u64_addr(addr_) ((void) 0)
+# endif /* CAN_ARCH_BE_COMPAT_ON_64BIT_KERNEL */
+
+# if SIZEOF_KERNEL_LONG_T > 4 \
+ && (SIZEOF_LONG < SIZEOF_KERNEL_LONG_T || !defined(current_wordsize))
+# define ANY_WORDSIZE_LESS_THAN_KERNEL_LONG 1
+# else
+# define ANY_WORDSIZE_LESS_THAN_KERNEL_LONG 0
+# endif
+
+# define DECL_PRINTNUM(name) \
+extern bool \
+printnum_ ## name(struct tcb *, kernel_ulong_t addr, const char *fmt) \
+ ATTRIBUTE_FORMAT((printf, 3, 0)) \
+/* End of DECL_PRINTNUM definition. */
+
+DECL_PRINTNUM(short);
+DECL_PRINTNUM(int);
+DECL_PRINTNUM(int64);
+# undef DECL_PRINTNUM
+
+# define DECL_PRINTNUM_ADDR(name) \
+extern bool \
+printnum_addr_ ## name(struct tcb *, kernel_ulong_t addr) \
+/* End of DECL_PRINTNUM_ADDR definition. */
+
+DECL_PRINTNUM_ADDR(int);
+DECL_PRINTNUM_ADDR(int64);
+# undef DECL_PRINTNUM_ADDR
+
+extern bool
+printnum_fd(struct tcb *, kernel_ulong_t addr);
+
+extern bool
+printnum_pid(struct tcb *const tcp, const kernel_ulong_t addr, enum pid_type type);
+
+static inline bool
+printnum_slong(struct tcb *tcp, kernel_ulong_t addr)
+{
+ return dispatch_wordsize(printnum_int64, printnum_int,
+ tcp, addr, opt_wordsize("%" PRId64, "%d"));
+}
+
+static inline bool
+printnum_ulong(struct tcb *tcp, kernel_ulong_t addr)
+{
+ return dispatch_wordsize(printnum_int64, printnum_int,
+ tcp, addr, opt_wordsize("%" PRIu64, "%u"));
+}
+
+static inline bool
+printnum_ptr(struct tcb *tcp, kernel_ulong_t addr)
+{
+ return dispatch_wordsize(printnum_addr_int64, printnum_addr_int,
+ tcp, addr);
+}
+
+static inline bool
+printnum_kptr(struct tcb *tcp, kernel_ulong_t addr)
+{
+ return dispatch_klongsize(printnum_addr_int64, printnum_addr_int,
+ tcp, addr);
+}
+
+
+# define DECL_PRINTPAIR(name) \
+extern bool \
+printpair_ ## name(struct tcb *, kernel_ulong_t addr, const char *fmt) \
+ ATTRIBUTE_FORMAT((printf, 3, 0)) \
+/* End of DECL_PRINTPAIR definition. */
+
+DECL_PRINTPAIR(int);
+DECL_PRINTPAIR(int64);
+# undef DECL_PRINTPAIR
+
+static inline kernel_long_t
+truncate_klong_to_current_wordsize(const kernel_long_t v)
+{
+# if ANY_WORDSIZE_LESS_THAN_KERNEL_LONG
+ if (current_wordsize < sizeof(v)) {
+ return (int) v;
+ } else
+# endif
+ {
+ return v;
+ }
+}
+
+static inline kernel_ulong_t
+truncate_kulong_to_current_wordsize(const kernel_ulong_t v)
+{
+# if ANY_WORDSIZE_LESS_THAN_KERNEL_LONG
+ if (current_wordsize < sizeof(v)) {
+ return (unsigned int) v;
+ } else
+# endif
+ {
+ return v;
+ }
+}
+
+/*
+ * Cast a pointer or a pointer-sized integer to kernel_ulong_t.
+ */
+# define ptr_to_kulong(v) ((kernel_ulong_t) (unsigned long) (v))
+
+/*
+ * Zero-extend a signed integer type to unsigned long long.
+ */
+# define zero_extend_signed_to_ull(v) \
+ (sizeof(v) == sizeof(char) ? (unsigned long long) (unsigned char) (v) : \
+ sizeof(v) == sizeof(short) ? (unsigned long long) (unsigned short) (v) : \
+ sizeof(v) == sizeof(int) ? (unsigned long long) (unsigned int) (v) : \
+ sizeof(v) == sizeof(long) ? (unsigned long long) (unsigned long) (v) : \
+ (unsigned long long) (v))
+
+/*
+ * Sign-extend an unsigned integer type to long long.
+ */
+# define sign_extend_unsigned_to_ll(v) \
+ (sizeof(v) == sizeof(char) ? (long long) (char) (v) : \
+ sizeof(v) == sizeof(short) ? (long long) (short) (v) : \
+ sizeof(v) == sizeof(int) ? (long long) (int) (v) : \
+ sizeof(v) == sizeof(long) ? (long long) (long) (v) : \
+ (long long) (v))
+
+/*
+ * Computes the popcount of a vector of 32-bit values.
+ */
+static inline unsigned int
+popcount32(const uint32_t *a, unsigned int size)
+{
+ unsigned int count = 0;
+
+ for (; size; ++a, --size) {
+ uint32_t x = *a;
+
+# ifdef HAVE___BUILTIN_POPCOUNT
+ count += __builtin_popcount(x);
+# else
+ for (; x; ++count)
+ x &= x - 1;
+# endif
+ }
+
+ return count;
+}
+
+extern const char *const errnoent[];
+extern const char *const signalent[];
+extern const unsigned int nerrnos;
+extern const unsigned int nsignals;
+
+extern const struct_sysent sysent0[];
+extern const struct_ioctlent ioctlent0[];
+
+extern const char *const personality_names[];
+/* Personality designators to be used for specifying personality */
+extern const char *const personality_designators[];
+
+# if SUPPORTED_PERSONALITIES > 1
+extern const struct_sysent *sysent;
+extern const struct_ioctlent *ioctlent;
+# else
+# define sysent sysent0
+# define ioctlent ioctlent0
+# endif
+
+extern unsigned nsyscalls;
+extern unsigned nioctlents;
+
+extern const unsigned int nsyscall_vec[SUPPORTED_PERSONALITIES];
+extern const struct_sysent *const sysent_vec[SUPPORTED_PERSONALITIES];
+extern struct inject_opts *inject_vec[SUPPORTED_PERSONALITIES];
+
+# ifdef ENABLE_COVERAGE_GCOV
+# ifdef HAVE_GCOV_H
+# include <gcov.h>
+# else
+extern void __gcov_dump(void);
+# endif
+# define GCOV_DUMP __gcov_dump()
+# else
+# define GCOV_DUMP
+# endif
+
+# ifdef IN_MPERS_BOOTSTRAP
+/* Transform multi-line MPERS_PRINTER_DECL statements to one-liners. */
+# define MPERS_PRINTER_DECL(type, name, ...) MPERS_PRINTER_DECL(type, name, __VA_ARGS__)
+# else /* !IN_MPERS_BOOTSTRAP */
+# if SUPPORTED_PERSONALITIES > 1
+# include "printers.h"
+# else
+# include "native_printer_decls.h"
+# endif
+# define MPERS_PRINTER_DECL(type, name, ...) type MPERS_FUNC_NAME(name)(__VA_ARGS__)
+# endif /* !IN_MPERS_BOOTSTRAP */
+
+#ifdef IN_MPERS
+# define MPERS_PTR_ARG(arg_) void *
+#else
+# define MPERS_PTR_ARG(arg_) arg_
+#endif
+
+/* Checks that sysent[scno] is not out of range. */
+static inline bool
+scno_in_range(kernel_ulong_t scno)
+{
+ return scno < nsyscalls;
+}
+
+/*
+ * Checks whether scno is not out of range,
+ * its corresponding sysent[scno].sys_func is non-NULL,
+ * and its sysent[scno].sys_flags has no TRACE_INDIRECT_SUBCALL flag set.
+ */
+static inline bool
+scno_is_valid(kernel_ulong_t scno)
+{
+ return scno_in_range(scno)
+ && sysent[scno].sys_func
+ && !(sysent[scno].sys_flags & TRACE_INDIRECT_SUBCALL);
+}
+
+# define MPERS_FUNC_NAME__(prefix, name) prefix ## name
+# define MPERS_FUNC_NAME_(prefix, name) MPERS_FUNC_NAME__(prefix, name)
+# define MPERS_FUNC_NAME(name) MPERS_FUNC_NAME_(MPERS_PREFIX, name)
+
+# define SYS_FUNC_NAME(syscall_name) MPERS_FUNC_NAME(syscall_name)
+
+# define SYS_FUNC(syscall_name) int SYS_FUNC_NAME(sys_ ## syscall_name)(struct tcb *tcp)
+
+# define ILOG2_ITER_(val_, ret_, bit_) \
+ do { \
+ typeof(ret_) shift_ = \
+ ((val_) > ((((typeof(val_)) 1) \
+ << (1 << (bit_))) - 1)) << (bit_); \
+ (val_) >>= shift_; \
+ (ret_) |= shift_; \
+ } while (0)
+
+/**
+ * Calculate floor(log2(val)), with the exception of val == 0, for which 0
+ * is returned as well.
+ *
+ * @param val 64-bit value to calculate integer base-2 logarithm for.
+ * @return (unsigned int) floor(log2(val)) if val > 0, 0 if val == 0.
+ */
+static inline unsigned int
+ilog2_64(uint64_t val)
+{
+ unsigned int ret = 0;
+
+ ILOG2_ITER_(val, ret, 5);
+ ILOG2_ITER_(val, ret, 4);
+ ILOG2_ITER_(val, ret, 3);
+ ILOG2_ITER_(val, ret, 2);
+ ILOG2_ITER_(val, ret, 1);
+ ILOG2_ITER_(val, ret, 0);
+
+ return ret;
+}
+
+/**
+ * Calculate floor(log2(val)), with the exception of val == 0, for which 0
+ * is returned as well.
+ *
+ * @param val 32-bit value to calculate integer base-2 logarithm for.
+ * @return (unsigned int) floor(log2(val)) if val > 0, 0 if val == 0.
+ */
+static inline unsigned int
+ilog2_32(uint32_t val)
+{
+ unsigned int ret = 0;
+
+ ILOG2_ITER_(val, ret, 4);
+ ILOG2_ITER_(val, ret, 3);
+ ILOG2_ITER_(val, ret, 2);
+ ILOG2_ITER_(val, ret, 1);
+ ILOG2_ITER_(val, ret, 0);
+
+ return ret;
+}
+
+# if SIZEOF_KERNEL_LONG_T > 4
+# define ilog2_klong ilog2_64
+# else
+# define ilog2_klong ilog2_32
+# endif
+
+# undef ILOG2_ITER_
+
+# include "print_fields.h"
+
+#endif /* !STRACE_DEFS_H */
diff --git a/src/delay.c b/src/delay.c
new file mode 100644
index 000000000..538992ff9
--- /dev/null
+++ b/src/delay.c
@@ -0,0 +1,133 @@
+/*
+ * Copyright (c) 2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+struct inject_delay_data {
+ struct timespec ts_enter;
+ struct timespec ts_exit;
+};
+
+static struct inject_delay_data *delay_data_vec;
+static size_t delay_data_vec_capacity; /* size of the arena */
+static size_t delay_data_vec_size; /* size of the used arena */
+
+static timer_t delay_timer = (timer_t) -1;
+static bool delay_timer_is_armed;
+
+static void
+expand_delay_data_vec(void)
+{
+ const size_t old_capacity = delay_data_vec_capacity;
+ delay_data_vec = xgrowarray(delay_data_vec, &delay_data_vec_capacity,
+ sizeof(*delay_data_vec));
+ memset(delay_data_vec + old_capacity, 0,
+ (delay_data_vec_capacity - old_capacity)
+ * sizeof(*delay_data_vec));
+}
+
+uint16_t
+alloc_delay_data(void)
+{
+ const uint16_t rval = delay_data_vec_size;
+
+ if (rval < delay_data_vec_size)
+ error_func_msg_and_die("delay index overflow");
+
+ if (delay_data_vec_size == delay_data_vec_capacity)
+ expand_delay_data_vec();
+
+ ++delay_data_vec_size;
+ return rval;
+}
+
+void
+fill_delay_data(uint16_t delay_idx, struct timespec *val, bool isenter)
+{
+ if (delay_idx >= delay_data_vec_size)
+ error_func_msg_and_die("delay_idx >= delay_data_vec_size");
+
+ struct timespec *ts;
+ if (isenter)
+ ts = &(delay_data_vec[delay_idx].ts_enter);
+ else
+ ts = &(delay_data_vec[delay_idx].ts_exit);
+
+ *ts = *val;
+}
+
+static bool
+is_delay_timer_created(void)
+{
+ return delay_timer != (timer_t) -1;
+}
+
+bool
+is_delay_timer_armed(void)
+{
+ return delay_timer_is_armed;
+}
+
+void
+delay_timer_expired(void)
+{
+ delay_timer_is_armed = false;
+}
+
+void
+arm_delay_timer(const struct tcb *const tcp)
+{
+ const struct itimerspec its = {
+ .it_value = tcp->delay_expiration_time
+ };
+
+ if (timer_settime(delay_timer, TIMER_ABSTIME, &its, NULL))
+ perror_msg_and_die("timer_settime");
+
+ delay_timer_is_armed = true;
+
+ debug_func_msg("timer set to %lld.%09ld for pid %d",
+ (long long) tcp->delay_expiration_time.tv_sec,
+ (long) tcp->delay_expiration_time.tv_nsec,
+ tcp->pid);
+}
+
+void
+delay_tcb(struct tcb *tcp, uint16_t delay_idx, bool isenter)
+{
+ if (delay_idx >= delay_data_vec_size)
+ error_func_msg_and_die("delay_idx >= delay_data_vec_size");
+
+ debug_func_msg("delaying pid %d on %s",
+ tcp->pid, isenter ? "enter" : "exit");
+ tcp->flags |= TCB_DELAYED;
+
+ struct timespec *ts_diff;
+ if (isenter)
+ ts_diff = &(delay_data_vec[delay_idx].ts_enter);
+ else
+ ts_diff = &(delay_data_vec[delay_idx].ts_exit);
+
+ struct timespec ts_now;
+ clock_gettime(CLOCK_MONOTONIC, &ts_now);
+ ts_add(&tcp->delay_expiration_time, &ts_now, ts_diff);
+
+ if (is_delay_timer_created()) {
+ struct itimerspec its;
+ if (timer_gettime(delay_timer, &its))
+ perror_msg_and_die("timer_gettime");
+
+ const struct timespec *const ts_old = &its.it_value;
+ if (ts_nz(ts_old) && ts_cmp(ts_diff, ts_old) > 0)
+ return;
+ } else {
+ if (timer_create(CLOCK_MONOTONIC, NULL, &delay_timer))
+ perror_msg_and_die("timer_create");
+ }
+
+ arm_delay_timer(tcp);
+}
diff --git a/src/delay.h b/src/delay.h
new file mode 100644
index 000000000..1dc273042
--- /dev/null
+++ b/src/delay.h
@@ -0,0 +1,18 @@
+/*
+ * Copyright (c) 2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_DELAY_H
+# define STRACE_DELAY_H
+
+uint16_t alloc_delay_data(void);
+void fill_delay_data(uint16_t delay_idx, struct timespec *val, bool isenter);
+bool is_delay_timer_armed(void);
+void delay_timer_expired(void);
+void arm_delay_timer(const struct tcb *);
+void delay_tcb(struct tcb *, uint16_t delay_idx, bool isenter);
+
+#endif /* !STRACE_DELAY_H */
diff --git a/src/desc.c b/src/desc.c
new file mode 100644
index 000000000..ac4585f17
--- /dev/null
+++ b/src/desc.c
@@ -0,0 +1,199 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
+ * Copyright (c) 1999-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include "xstring.h"
+
+SYS_FUNC(close)
+{
+ printfd(tcp, tcp->u_arg[0]);
+
+ return RVAL_DECODED;
+}
+
+static int
+decode_select(struct tcb *const tcp, const kernel_ulong_t *const args,
+ const print_obj_by_addr_fn print_tv_ts,
+ const sprint_obj_by_addr_fn sprint_tv_ts)
+{
+ int i, j;
+ int nfds, fdsize;
+ fd_set *fds = NULL;
+ const char *sep;
+ kernel_ulong_t addr;
+
+ /* Kernel truncates args[0] to int, we do the same. */
+ nfds = (int) args[0];
+
+ /* Kernel rejects negative nfds, so we don't parse it either. */
+ if (nfds < 0)
+ nfds = 0;
+
+ /* Beware of select(2^31-1, NULL, NULL, NULL) and similar... */
+ if (nfds > 1024*1024)
+ nfds = 1024*1024;
+
+ /*
+ * We had bugs a-la "while (j < args[0])" and "umoven(args[0])" below.
+ * Instead of args[0], use nfds for fd count, fdsize for array lengths.
+ */
+ fdsize = (((nfds + 7) / 8) + current_wordsize-1) & -current_wordsize;
+
+ if (entering(tcp)) {
+ tprintf("%d", (int) args[0]);
+
+ if (verbose(tcp) && fdsize > 0)
+ fds = malloc(fdsize);
+ for (i = 0; i < 3; i++) {
+ addr = args[i+1];
+ tprints(", ");
+ if (!fds) {
+ printaddr(addr);
+ continue;
+ }
+ if (umoven_or_printaddr(tcp, addr, fdsize, fds))
+ continue;
+ tprints("[");
+ for (j = 0, sep = "";; j++) {
+ j = next_set_bit(fds, j, nfds);
+ if (j < 0)
+ break;
+ tprints(sep);
+ printfd(tcp, j);
+ sep = " ";
+ }
+ tprints("]");
+ }
+ free(fds);
+ tprints(", ");
+ print_tv_ts(tcp, args[4]);
+ } else {
+ static char outstr[1024];
+ char *outptr;
+#define end_outstr (outstr + sizeof(outstr))
+ int ready_fds;
+
+ if (syserror(tcp))
+ return 0;
+
+ ready_fds = tcp->u_rval;
+ if (ready_fds == 0) {
+ tcp->auxstr = "Timeout";
+ return RVAL_STR;
+ }
+
+ fds = malloc(fdsize);
+
+ outptr = outstr;
+ sep = "";
+ for (i = 0; i < 3 && ready_fds > 0; i++) {
+ int first = 1;
+
+ addr = args[i+1];
+ if (!addr || !fds || umoven(tcp, addr, fdsize, fds) < 0)
+ continue;
+ for (j = 0;; j++) {
+ j = next_set_bit(fds, j, nfds);
+ if (j < 0)
+ break;
+ /* +2 chars needed at the end: ']',NUL */
+ if (outptr < end_outstr - (sizeof(", except [") + sizeof(int)*3 + 2)) {
+ if (first) {
+ outptr = xappendstr(outstr,
+ outptr,
+ "%s%s [%u",
+ sep,
+ i == 0 ? "in" : i == 1 ? "out" : "except",
+ j
+ );
+ first = 0;
+ sep = ", ";
+ } else {
+ outptr = xappendstr(outstr,
+ outptr,
+ " %u", j);
+ }
+ }
+ if (--ready_fds == 0)
+ break;
+ }
+ if (outptr != outstr)
+ *outptr++ = ']';
+ }
+ free(fds);
+ /* This contains no useful information on SunOS. */
+ if (args[4]) {
+ const char *str = sprint_tv_ts(tcp, args[4]);
+ if (outptr + sizeof("left ") + strlen(sep) + strlen(str) < end_outstr) {
+ outptr = xappendstr(outstr, outptr,
+ "%sleft %s", sep, str);
+ }
+ }
+ *outptr = '\0';
+ tcp->auxstr = outstr;
+ return RVAL_STR;
+#undef end_outstr
+ }
+ return 0;
+}
+
+#if HAVE_ARCH_OLD_SELECT
+SYS_FUNC(oldselect)
+{
+ kernel_ulong_t *args =
+ fetch_indirect_syscall_args(tcp, tcp->u_arg[0], 5);
+
+ if (args) {
+ return decode_select(tcp, args, print_timeval, sprint_timeval);
+ } else {
+ if (entering(tcp))
+ printaddr(tcp->u_arg[0]);
+ return RVAL_DECODED;
+ }
+}
+#endif /* HAVE_ARCH_OLD_SELECT */
+
+#ifdef ALPHA
+SYS_FUNC(osf_select)
+{
+ return decode_select(tcp, tcp->u_arg, print_timeval32, sprint_timeval32);
+}
+#endif
+
+SYS_FUNC(select)
+{
+ return decode_select(tcp, tcp->u_arg, print_timeval, sprint_timeval);
+}
+
+static int
+do_pselect6(struct tcb *const tcp, const print_obj_by_addr_fn print_ts,
+ const sprint_obj_by_addr_fn sprint_ts)
+{
+ int rc = decode_select(tcp, tcp->u_arg, print_ts, sprint_ts);
+ if (entering(tcp)) {
+ tprints(", ");
+ print_kernel_sigset(tcp, tcp->u_arg[5]);
+ }
+
+ return rc;
+}
+
+#if HAVE_ARCH_TIME32_SYSCALLS
+SYS_FUNC(pselect6_time32)
+{
+ return do_pselect6(tcp, print_timespec32, sprint_timespec32);
+}
+#endif
+
+SYS_FUNC(pselect6_time64)
+{
+ return do_pselect6(tcp, print_timespec64, sprint_timespec64);
+}
diff --git a/src/dirent.c b/src/dirent.c
new file mode 100644
index 000000000..91167b9a0
--- /dev/null
+++ b/src/dirent.c
@@ -0,0 +1,120 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
+ * Copyright (c) 2005-2015 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2014-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include "kernel_dirent.h"
+
+#include DEF_MPERS_TYPE(kernel_dirent_t)
+
+#include MPERS_DEFS
+
+#include "xgetdents.h"
+
+#define D_NAME_LEN_MAX 256
+
+/* The minimum size of a valid directory entry. */
+static const unsigned int header_size =
+ offsetof(kernel_dirent_t, d_name);
+
+static void
+print_dentry_head(const kernel_dirent_t *const dent)
+{
+ tprint_struct_begin();
+ PRINT_FIELD_U(*dent, d_ino);
+ tprint_struct_next();
+ PRINT_FIELD_U(*dent, d_off);
+ tprint_struct_next();
+ PRINT_FIELD_U(*dent, d_reclen);
+}
+
+static unsigned int
+decode_dentry_head(struct tcb *const tcp, const void *const arg)
+{
+ const kernel_dirent_t *const dent = arg;
+
+ if (!abbrev(tcp))
+ print_dentry_head(dent);
+
+ return dent->d_reclen;
+}
+
+static int
+decode_dentry_tail(struct tcb *const tcp, kernel_ulong_t addr,
+ const void *const arg, const unsigned int d_name_type_len)
+{
+ int rc = 0;
+
+ /* !abbrev(tcp) */
+
+ if (d_name_type_len) {
+ unsigned int d_name_len = d_name_type_len - 1;
+ if (d_name_len) {
+ if (d_name_len > D_NAME_LEN_MAX)
+ d_name_len = D_NAME_LEN_MAX;
+ tprint_struct_next();
+ tprints_field_name("d_name");
+ rc = printpathn(tcp, addr, d_name_len - 1);
+ }
+ tprint_struct_next();
+ tprints_field_name("d_type");
+ const kernel_ulong_t d_type_addr =
+ addr + (d_name_type_len - 1);
+ unsigned char d_type;
+ if (umove_or_printaddr(tcp, d_type_addr, &d_type))
+ rc = -1;
+ else
+ printxval(dirent_types, d_type, "DT_???");
+ }
+ tprint_struct_end();
+
+ return rc;
+}
+
+SYS_FUNC(getdents)
+{
+ return xgetdents(tcp, header_size,
+ decode_dentry_head, decode_dentry_tail);
+}
+
+static void
+print_old_dirent(struct tcb *const tcp, const kernel_ulong_t addr)
+{
+ kernel_dirent_t dent;
+
+ if (umove_or_printaddr(tcp, addr, &dent))
+ return;
+
+ print_dentry_head(&dent);
+ tprint_struct_next();
+ tprints_field_name("d_name");
+ printpathn(tcp, addr + header_size,
+ MIN(dent.d_reclen, D_NAME_LEN_MAX));
+ tprint_struct_end();
+}
+
+SYS_FUNC(readdir)
+{
+ if (entering(tcp)) {
+ printfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ } else {
+ if (tcp->u_rval == 0)
+ printaddr(tcp->u_arg[1]);
+ else
+ print_old_dirent(tcp, tcp->u_arg[1]);
+ const unsigned int count = tcp->u_arg[2];
+ /* Not much point in printing this out, it is always 1. */
+ if (count != 1)
+ tprintf(", %u", count);
+ }
+ return 0;
+}
diff --git a/src/dirent64.c b/src/dirent64.c
new file mode 100644
index 000000000..b1f6141dc
--- /dev/null
+++ b/src/dirent64.c
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2020 Dmitry V. Levin <ldv@strace.io>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "xgetdents.h"
+#include "kernel_dirent.h"
+
+#define D_NAME_LEN_MAX 256
+
+static void
+print_dentry_head(const kernel_dirent64_t *const dent)
+{
+ tprint_struct_begin();
+ PRINT_FIELD_U(*dent, d_ino);
+ tprint_struct_next();
+ PRINT_FIELD_U(*dent, d_off);
+ tprint_struct_next();
+ PRINT_FIELD_U(*dent, d_reclen);
+}
+
+static unsigned int
+decode_dentry_head(struct tcb *const tcp, const void *const arg)
+{
+ const kernel_dirent64_t *const dent = arg;
+
+ if (!abbrev(tcp))
+ print_dentry_head(dent);
+
+ return dent->d_reclen;
+}
+
+static int
+decode_dentry_tail(struct tcb *const tcp, kernel_ulong_t addr,
+ const void *const arg, unsigned int d_name_len)
+{
+ const kernel_dirent64_t *const dent = arg;
+ int rc = 0;
+
+ /* !abbrev(tcp) */
+
+ tprint_struct_next();
+ PRINT_FIELD_XVAL(*dent, d_type, dirent_types, "DT_???");
+
+ if (d_name_len) {
+ if (d_name_len > D_NAME_LEN_MAX)
+ d_name_len = D_NAME_LEN_MAX;
+ tprint_struct_next();
+ tprints_field_name("d_name");
+ rc = printpathn(tcp, addr, d_name_len - 1);
+ }
+ tprint_struct_end();
+
+ return rc;
+}
+
+SYS_FUNC(getdents64)
+{
+ /* The minimum size of a valid directory entry. */
+ static const unsigned int header_size =
+ offsetof(kernel_dirent64_t, d_name);
+
+ return xgetdents(tcp, header_size,
+ decode_dentry_head, decode_dentry_tail);
+}
diff --git a/src/dirent_types.c b/src/dirent_types.c
new file mode 100644
index 000000000..593563e14
--- /dev/null
+++ b/src/dirent_types.c
@@ -0,0 +1,11 @@
+/*
+ * Copyright (c) 2005-2015 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2015-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include <dirent.h>
+#include "xlat/dirent_types.h"
diff --git a/src/disable_ptrace_get_syscall_info.c b/src/disable_ptrace_get_syscall_info.c
new file mode 100644
index 000000000..337c2a566
--- /dev/null
+++ b/src/disable_ptrace_get_syscall_info.c
@@ -0,0 +1,13 @@
+/*
+ * A helper that executes the specified program
+ * with the ptrace PTRACE_GET_SYSCALL_INFO disabled.
+ *
+ * Copyright (c) 2021 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#define DISABLE_PTRACE_REQUEST PTRACE_GET_SYSCALL_INFO
+#define DEFAULT_PROGRAM_INVOCATION_NAME "disable_ptrace_get_syscall_info"
+#include "disable_ptrace_request.c"
diff --git a/src/disable_ptrace_getregset.c b/src/disable_ptrace_getregset.c
new file mode 100644
index 000000000..e7834aa83
--- /dev/null
+++ b/src/disable_ptrace_getregset.c
@@ -0,0 +1,24 @@
+/*
+ * A helper that executes the specified program
+ * with the ptrace PTRACE_GETREGSET or PTRACE_GETREGS disabled.
+ *
+ * Copyright (c) 2021 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#include "defs.h"
+#define static
+#include "getregs_old.h"
+#undef static
+#undef DISABLE_PTRACE_REQUEST
+#ifdef HAVE_GETREGS_OLD
+# if defined __x86_64__
+# define DISABLE_PTRACE_REQUEST PTRACE_GETREGSET
+# elif defined __powerpc__
+# define DISABLE_PTRACE_REQUEST PTRACE_GETREGS
+# endif
+#endif
+#define DEFAULT_PROGRAM_INVOCATION_NAME "disable_ptrace_getregset"
+#include "disable_ptrace_request.c"
diff --git a/src/disable_ptrace_request.c b/src/disable_ptrace_request.c
new file mode 100644
index 000000000..872c644df
--- /dev/null
+++ b/src/disable_ptrace_request.c
@@ -0,0 +1,159 @@
+/*
+ * A helper that executes the specified program
+ * with the ptrace request disabled.
+ *
+ * Copyright (c) 2015-2021 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#include "defs.h"
+#include "ptrace.h"
+#include "scno.h"
+#include <signal.h>
+#include <sys/prctl.h>
+#include <sys/wait.h>
+#include <linux/filter.h>
+#ifdef HAVE_LINUX_SECCOMP_H
+# include <linux/seccomp.h>
+#endif
+
+#ifndef HAVE_PROGRAM_INVOCATION_NAME
+char *program_invocation_name;
+#endif
+
+void ATTRIBUTE_NORETURN
+die(void)
+{
+ exit(1);
+}
+
+static void
+init(int argc, char **argv)
+{
+ if (!program_invocation_name || !*program_invocation_name) {
+ static char name[] = DEFAULT_PROGRAM_INVOCATION_NAME;
+ program_invocation_name =
+ (argc > 0 && argv[0] && *argv[0]) ? argv[0] : name;
+ }
+}
+
+#if defined DISABLE_PTRACE_REQUEST \
+ && defined PR_SET_NO_NEW_PRIVS \
+ && defined PR_SET_SECCOMP \
+ && defined SECCOMP_MODE_FILTER \
+ && defined SECCOMP_RET_ERRNO \
+ && defined BPF_JUMP \
+ && defined BPF_STMT
+
+static unsigned int
+get_arch(void)
+{
+ pid_t pid = fork();
+ if (pid < 0)
+ perror_msg_and_die("fork");
+
+ if (pid == 0) {
+ /* get the pid before PTRACE_TRACEME */
+ pid = getpid();
+ if (ptrace(PTRACE_TRACEME, 0, 0, 0))
+ perror_msg_and_die("PTRACE_TRACEME");
+ kill(pid, SIGSTOP);
+ /* unreachable */
+ _exit(1);
+ }
+
+ int status = 0;
+ if (waitpid(pid, &status, 0) != pid ||
+ !WIFSTOPPED(status) ||
+ WSTOPSIG(status) != SIGSTOP) {
+ /* cannot happen */
+ perror_msg_and_die("waitpid: status = %d", status);
+ }
+
+ static const unsigned int size =
+ offsetof(struct_ptrace_syscall_info, entry);
+ struct_ptrace_syscall_info psi = { .arch = 0 };
+
+ long rc = ptrace(PTRACE_GET_SYSCALL_INFO, pid, size, &psi);
+
+ int saved_errno = errno;
+ (void) kill(pid, SIGKILL);
+ (void) waitpid(pid, NULL, 0);
+ errno = saved_errno;
+
+ /*
+ * Skip if PTRACE_GET_SYSCALL_INFO is not available
+ * or behaves in an unexpected way.
+ */
+ if (rc < (long) size ||
+ psi.op != PTRACE_SYSCALL_INFO_NONE ||
+ psi.arch == 0) {
+ perror_msg_and_die("PTRACE_GET_SYSCALL_INFO");
+ }
+
+ return psi.arch;
+}
+
+int
+main(int argc, char **argv)
+{
+ init(argc, argv);
+
+ if (argc < 2)
+ error_msg_and_die("Insufficient arguments");
+
+ if (prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0))
+ perror_msg_and_die("PR_SET_NO_NEW_PRIVS");
+
+# ifdef WORDS_BIGENDIAN
+# define ARG_OFFSET sizeof(uint32_t)
+# else
+# define ARG_OFFSET 0
+# endif
+
+ struct sock_filter filter[] = {
+ /* load the architecture */
+ BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
+ offsetof(struct seccomp_data, arch)),
+ /* jump to "allow" if the architecture does not match */
+ BPF_JUMP(BPF_JMP | BPF_K | BPF_JEQ, get_arch(), 0, 5),
+ /* load the syscall number */
+ BPF_STMT(BPF_LD | BPF_W | BPF_ABS, \
+ offsetof(struct seccomp_data, nr)),
+ /* jump to "allow" if it is not equal to __NR_ptrace */
+ BPF_JUMP(BPF_JMP | BPF_K | BPF_JEQ, __NR_ptrace, 0, 3),
+ /* load the 1st syscall argument */
+ BPF_STMT(BPF_LD | BPF_W | BPF_ABS, \
+ offsetof(struct seccomp_data, args[0]) + ARG_OFFSET),
+ /* jump to "allow" if it is not equal to DISABLE_PTRACE_REQUEST */
+ BPF_JUMP(BPF_JMP | BPF_K | BPF_JEQ, DISABLE_PTRACE_REQUEST, 0, 1),
+ /* reject */
+ BPF_STMT(BPF_RET | BPF_K, SECCOMP_RET_ERRNO | EIO),
+ /* allow */
+ BPF_STMT(BPF_RET | BPF_K, SECCOMP_RET_ALLOW)
+ };
+
+ const struct sock_fprog prog = {
+ .len = ARRAY_SIZE(filter),
+ .filter = filter,
+ };
+
+ if (prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, &prog))
+ perror_msg_and_die("PR_SET_SECCOMP");
+
+ (void) execvp(argv[1], argv + 1);
+ perror_msg_and_die("execvp: %s", argv[1]);
+}
+
+#else
+
+int
+main(int argc, char **argv)
+{
+ init(argc, argv);
+ error_msg_and_die("Operation not supported");
+}
+
+#endif
diff --git a/src/dm.c b/src/dm.c
new file mode 100644
index 000000000..f77d14eb2
--- /dev/null
+++ b/src/dm.c
@@ -0,0 +1,651 @@
+/*
+ * Support for decoding of DM_* ioctl commands.
+ *
+ * Copyright (c) 2016 Mikulas Patocka <mpatocka@redhat.com>
+ * Copyright (c) 2016 Masatake Yamato <yamato@redhat.com>
+ * Copyright (c) 2016 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2016 Eugene Syromyatnikov <evgsyr@gmail.com>
+ * Copyright (c) 2016-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#ifdef HAVE_LINUX_DM_IOCTL_H
+
+# include <linux/dm-ioctl.h>
+# include <linux/ioctl.h>
+
+# if DM_VERSION_MAJOR == 4
+
+/* Definitions for command which have been added later */
+
+# ifndef DM_LIST_VERSIONS
+# define DM_LIST_VERSIONS _IOWR(DM_IOCTL, 0x0d, struct dm_ioctl)
+# endif
+# ifndef DM_TARGET_MSG
+# define DM_TARGET_MSG _IOWR(DM_IOCTL, 0x0e, struct dm_ioctl)
+# endif
+# ifndef DM_DEV_SET_GEOMETRY
+# define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, 0x0f, struct dm_ioctl)
+# endif
+# ifndef DM_DEV_ARM_POLL
+# define DM_DEV_ARM_POLL _IOWR(DM_IOCTL, 0x10, struct dm_ioctl)
+# endif
+
+
+static void
+dm_decode_device(const unsigned int code, const struct dm_ioctl *ioc)
+{
+ switch (code) {
+ case DM_REMOVE_ALL:
+ case DM_LIST_DEVICES:
+ case DM_LIST_VERSIONS:
+ break;
+ default:
+ if (ioc->dev) {
+ tprint_struct_next();
+ PRINT_FIELD_DEV(*ioc, dev);
+ }
+
+ if (ioc->name[0]) {
+ tprint_struct_next();
+ PRINT_FIELD_CSTRING(*ioc, name);
+ }
+
+ if (ioc->uuid[0]) {
+ tprint_struct_next();
+ PRINT_FIELD_CSTRING(*ioc, uuid);
+ }
+
+ break;
+ }
+}
+
+static void
+dm_decode_values(struct tcb *tcp, const unsigned int code,
+ const struct dm_ioctl *ioc)
+{
+ if (entering(tcp)) {
+ switch (code) {
+ case DM_TABLE_LOAD:
+ tprint_struct_next();
+ PRINT_FIELD_U(*ioc, target_count);
+ break;
+ case DM_DEV_SUSPEND:
+ if (ioc->flags & DM_SUSPEND_FLAG)
+ break;
+ ATTRIBUTE_FALLTHROUGH;
+ case DM_DEV_RENAME:
+ case DM_DEV_REMOVE:
+ case DM_DEV_WAIT:
+ tprint_struct_next();
+ PRINT_FIELD_U(*ioc, event_nr);
+ break;
+ }
+ } else if (!syserror(tcp)) {
+ switch (code) {
+ case DM_DEV_CREATE:
+ case DM_DEV_RENAME:
+ case DM_DEV_SUSPEND:
+ case DM_DEV_STATUS:
+ case DM_DEV_WAIT:
+ case DM_TABLE_LOAD:
+ case DM_TABLE_CLEAR:
+ case DM_TABLE_DEPS:
+ case DM_TABLE_STATUS:
+ case DM_TARGET_MSG:
+ tprint_struct_next();
+ PRINT_FIELD_U(*ioc, target_count);
+ tprint_struct_next();
+ PRINT_FIELD_U(*ioc, open_count);
+ tprint_struct_next();
+ PRINT_FIELD_U(*ioc, event_nr);
+ break;
+ }
+ }
+}
+
+# include "xlat/dm_flags.h"
+
+static void
+dm_decode_flags(const struct dm_ioctl *ioc)
+{
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(*ioc, flags, dm_flags, "DM_???");
+}
+
+static void
+dm_decode_dm_target_spec(struct tcb *const tcp, const kernel_ulong_t addr,
+ const struct dm_ioctl *const ioc)
+{
+ static const uint32_t target_spec_size =
+ sizeof(struct dm_target_spec);
+ uint32_t i;
+ uint32_t offset = ioc->data_start;
+ uint32_t offset_end = 0;
+
+ if (abbrev(tcp)) {
+ if (ioc->target_count) {
+ tprints(", ");
+ tprint_more_data_follows();
+ }
+
+ return;
+ }
+
+ for (i = 0; i < ioc->target_count; i++) {
+ tprints(", ");
+
+ if (i && offset <= offset_end)
+ goto misplaced;
+
+ offset_end = offset + target_spec_size;
+
+ if (offset_end <= offset || offset_end > ioc->data_size)
+ goto misplaced;
+
+ if (i >= max_strlen) {
+ tprint_more_data_follows();
+ break;
+ }
+
+ struct dm_target_spec s;
+
+ if (umove_or_printaddr(tcp, addr + offset, &s))
+ break;
+
+ tprint_struct_begin();
+ PRINT_FIELD_U(s, sector_start);
+ tprint_struct_next();
+ PRINT_FIELD_U(s, length);
+
+ if (exiting(tcp)) {
+ tprint_struct_next();
+ PRINT_FIELD_D(s, status);
+ }
+
+ tprint_struct_next();
+ PRINT_FIELD_CSTRING(s, target_type);
+
+ tprint_struct_next();
+ tprints_field_name("string");
+ printstr_ex(tcp, addr + offset_end, ioc->data_size - offset_end,
+ QUOTE_0_TERMINATED);
+ tprint_struct_end();
+
+ if (entering(tcp))
+ offset += s.next;
+ else
+ offset = ioc->data_start + s.next;
+ }
+
+ return;
+
+misplaced:
+ tprints("???");
+ tprints_comment("misplaced struct dm_target_spec");
+}
+
+bool
+dm_print_dev(struct tcb *tcp, void *dev_ptr, size_t dev_size, void *dummy)
+{
+ uint64_t *dev = (uint64_t *) dev_ptr;
+
+ print_dev_t(*dev);
+
+ return 1;
+}
+
+static void
+dm_decode_dm_target_deps(struct tcb *const tcp, const kernel_ulong_t addr,
+ const struct dm_ioctl *const ioc)
+{
+ if (ioc->data_start == ioc->data_size)
+ return;
+
+ tprints(", ");
+
+ if (abbrev(tcp)) {
+ tprint_more_data_follows();
+ return;
+ }
+
+ static const uint32_t target_deps_dev_offs =
+ offsetof(struct dm_target_deps, dev);
+ uint64_t dev_buf;
+ struct dm_target_deps s;
+ uint32_t offset = ioc->data_start;
+ uint32_t offset_end = offset + target_deps_dev_offs;
+ uint32_t space;
+
+ if (offset_end <= offset || offset_end > ioc->data_size)
+ goto misplaced;
+
+ if (umove_or_printaddr(tcp, addr + offset, &s))
+ return;
+
+ space = (ioc->data_size - offset_end) / sizeof(dev_buf);
+
+ if (s.count > space)
+ goto misplaced;
+
+ tprint_struct_begin();
+ PRINT_FIELD_U(s, count);
+
+ tprint_struct_next();
+ tprints_field_name("deps");
+ print_array(tcp, addr + offset_end, s.count, &dev_buf, sizeof(dev_buf),
+ tfetch_mem, dm_print_dev, NULL);
+
+ tprint_struct_end();
+
+ return;
+
+misplaced:
+ tprints("???");
+ tprints_comment("misplaced struct dm_target_deps");
+}
+
+static void
+dm_decode_dm_name_list(struct tcb *const tcp, const kernel_ulong_t addr,
+ const struct dm_ioctl *const ioc)
+{
+ static const uint32_t name_list_name_offs =
+ offsetof(struct dm_name_list, name);
+ struct dm_name_list s;
+ uint32_t offset = ioc->data_start;
+ uint32_t offset_end = 0;
+ uint32_t count;
+ int rc;
+
+ if (ioc->data_start == ioc->data_size)
+ return;
+
+ if (abbrev(tcp)) {
+ tprint_struct_next();
+ tprint_more_data_follows();
+ return;
+ }
+
+ for (count = 0;; count++) {
+ tprints(", ");
+
+ if (count && offset <= offset_end)
+ goto misplaced;
+
+ offset_end = offset + name_list_name_offs;
+
+ if (offset_end <= offset || offset_end > ioc->data_size)
+ goto misplaced;
+
+ if (count >= max_strlen) {
+ tprint_more_data_follows();
+ break;
+ }
+
+ if (umove_or_printaddr(tcp, addr + offset, &s))
+ break;
+
+ tprint_struct_begin();
+ PRINT_FIELD_DEV(s, dev);
+ tprint_struct_next();
+ tprints_field_name("name");
+ rc = printstr_ex(tcp, addr + offset_end,
+ ioc->data_size - offset_end,
+ QUOTE_0_TERMINATED);
+
+ /*
+ * In Linux v4.13-rc1~137^2~13 it has been decided to cram in
+ * one more undocumented field after the device name, as if the
+ * format decoding was not twisted enough already. So, we have
+ * to check "next" now, and if it _looks like_ that there is
+ * a space for one additional integer, let's print it. As if the
+ * perversity with "name string going further than pointer to
+ * the next one" wasn't enough. Moreover, the calculation was
+ * broken for m32 on 64-bit kernels until v4.14-rc4~20^2~3, and
+ * we have no ability to detect kernel bit-ness (on x86, at
+ * least), so refrain from printing it for the DM versions below
+ * 4.37 (the original version was also aligned differently than
+ * now even on 64 bit).
+ */
+
+ if ((rc > 0) && ioc->version[1] >= 37) {
+ kernel_ulong_t event_addr =
+ (addr + offset_end + rc + 7) & ~7;
+ uint32_t event_nr;
+
+ if ((event_addr + sizeof(event_nr)) <=
+ (addr + offset + s.next) &&
+ !umove(tcp, event_addr, &event_nr)) {
+ tprint_struct_next();
+ tprints_field_name("event_nr");
+ tprintf("%" PRIu32, event_nr);
+ }
+ }
+
+ tprint_struct_end();
+
+ if (!s.next)
+ break;
+
+ offset += s.next;
+ }
+
+ return;
+
+misplaced:
+ tprints("???");
+ tprints_comment("misplaced struct dm_name_list");
+}
+
+static void
+dm_decode_dm_target_versions(struct tcb *const tcp, const kernel_ulong_t addr,
+ const struct dm_ioctl *const ioc)
+{
+ static const uint32_t target_vers_name_offs =
+ offsetof(struct dm_target_versions, name);
+ struct dm_target_versions s;
+ uint32_t offset = ioc->data_start;
+ uint32_t offset_end = 0;
+ uint32_t count;
+
+ if (ioc->data_start == ioc->data_size)
+ return;
+
+ if (abbrev(tcp)) {
+ tprint_struct_next();
+ tprint_more_data_follows();
+ return;
+ }
+
+ for (count = 0;; count++) {
+ tprints(", ");
+
+ if (count && offset <= offset_end)
+ goto misplaced;
+
+ offset_end = offset + target_vers_name_offs;
+
+ if (offset_end <= offset || offset_end > ioc->data_size)
+ goto misplaced;
+
+ if (count >= max_strlen) {
+ tprint_more_data_follows();
+ break;
+ }
+
+ if (umove_or_printaddr(tcp, addr + offset, &s))
+ break;
+
+ tprint_struct_begin();
+ tprints_field_name("name");
+ printstr_ex(tcp, addr + offset_end, ioc->data_size - offset_end,
+ QUOTE_0_TERMINATED);
+ tprint_struct_next();
+ tprints_field_name("version");
+ tprintf("%" PRIu32 ".%" PRIu32 ".%" PRIu32,
+ s.version[0], s.version[1], s.version[2]);
+ tprint_struct_end();
+
+ if (!s.next)
+ break;
+
+ offset += s.next;
+ }
+
+ return;
+
+misplaced:
+ tprints("???");
+ tprints_comment("misplaced struct dm_target_versions");
+}
+
+static void
+dm_decode_dm_target_msg(struct tcb *const tcp, const kernel_ulong_t addr,
+ const struct dm_ioctl *const ioc)
+{
+ if (ioc->data_start == ioc->data_size)
+ return;
+
+ tprints(", ");
+
+ if (abbrev(tcp)) {
+ tprint_more_data_follows();
+ return;
+ }
+
+ static const uint32_t target_msg_message_offs =
+ offsetof(struct dm_target_msg, message);
+ uint32_t offset = ioc->data_start;
+ uint32_t offset_end = offset + target_msg_message_offs;
+
+ if (offset_end > offset && offset_end <= ioc->data_size) {
+ struct dm_target_msg s;
+
+ if (umove_or_printaddr(tcp, addr + offset, &s))
+ return;
+
+ tprint_struct_begin();
+ PRINT_FIELD_U(s, sector);
+ tprint_struct_next();
+ tprints_field_name("message");
+ printstr_ex(tcp, addr + offset_end, ioc->data_size - offset_end,
+ QUOTE_0_TERMINATED);
+ tprint_struct_end();
+ } else {
+ tprints("???");
+ tprints_comment("misplaced struct dm_target_msg");
+ }
+}
+
+static void
+dm_decode_string(struct tcb *const tcp, const kernel_ulong_t addr,
+ const struct dm_ioctl *const ioc)
+{
+ tprints(", ");
+
+ if (abbrev(tcp)) {
+ tprint_more_data_follows();
+ return;
+ }
+
+ uint32_t offset = ioc->data_start;
+
+ if (offset <= ioc->data_size) {
+ tprints_field_name("string");
+ printstr_ex(tcp, addr + offset, ioc->data_size - offset,
+ QUOTE_0_TERMINATED);
+ } else {
+ tprints("???");
+ tprints_comment("misplaced string");
+ }
+}
+
+static inline bool
+dm_ioctl_has_params(const unsigned int code)
+{
+ switch (code) {
+ case DM_VERSION:
+ case DM_REMOVE_ALL:
+ case DM_DEV_CREATE:
+ case DM_DEV_REMOVE:
+ case DM_DEV_SUSPEND:
+ case DM_DEV_STATUS:
+ case DM_TABLE_CLEAR:
+ case DM_DEV_ARM_POLL:
+ return false;
+ }
+
+ return true;
+}
+
+static int
+dm_known_ioctl(struct tcb *const tcp, const unsigned int code,
+ const kernel_ulong_t arg)
+{
+ struct dm_ioctl *ioc = NULL;
+ struct dm_ioctl *entering_ioc = NULL;
+ bool ioc_changed = false;
+
+ if (entering(tcp)) {
+ ioc = malloc(sizeof(*ioc));
+ if (!ioc)
+ return 0;
+ } else {
+ ioc = alloca(sizeof(*ioc));
+ }
+
+ if ((umoven(tcp, arg, offsetof(struct dm_ioctl, data), ioc) < 0) ||
+ (ioc->data_size < offsetof(struct dm_ioctl, data_size))) {
+ if (entering(tcp))
+ free(ioc);
+ return 0;
+ }
+ if (entering(tcp))
+ set_tcb_priv_data(tcp, ioc, free);
+ else {
+ entering_ioc = get_tcb_priv_data(tcp);
+
+ /*
+ * retrieve_status, __dev_status called only in case of success,
+ * so it looks like there's no need to check open_count,
+ * event_nr, target_count, dev fields for change (they are
+ * printed only in case of absence of errors).
+ */
+ if (!entering_ioc ||
+ (ioc->version[0] != entering_ioc->version[0]) ||
+ (ioc->version[1] != entering_ioc->version[1]) ||
+ (ioc->version[2] != entering_ioc->version[2]) ||
+ (ioc->data_size != entering_ioc->data_size) ||
+ (ioc->data_start != entering_ioc->data_start) ||
+ (ioc->flags != entering_ioc->flags))
+ ioc_changed = true;
+ }
+
+ if (exiting(tcp) && syserror(tcp) && !ioc_changed)
+ return RVAL_IOCTL_DECODED;
+
+ if (entering(tcp))
+ tprints(", ");
+ else
+ tprint_value_changed();
+
+ tprint_struct_begin();
+ /*
+ * device mapper code uses %d in some places and %u in another, but
+ * fields themselves are declared as __u32.
+ */
+ tprints_field_name("version");
+ tprintf("%u.%u.%u", ioc->version[0], ioc->version[1], ioc->version[2]);
+ /*
+ * if we use a different version of ABI, do not attempt to decode
+ * ioctl fields
+ */
+ if (ioc->version[0] != DM_VERSION_MAJOR) {
+ tprints_comment("unsupported device mapper ABI version");
+ goto skip;
+ }
+
+ tprint_struct_next();
+ PRINT_FIELD_U(*ioc, data_size);
+
+ if (ioc->data_size < offsetof(struct dm_ioctl, data)) {
+ tprints_comment("data_size too small");
+ goto skip;
+ }
+
+ if (dm_ioctl_has_params(code)) {
+ tprint_struct_next();
+ PRINT_FIELD_U(*ioc, data_start);
+ }
+
+ dm_decode_device(code, ioc);
+ dm_decode_values(tcp, code, ioc);
+ dm_decode_flags(ioc);
+
+ switch (code) {
+ case DM_DEV_WAIT:
+ case DM_TABLE_STATUS:
+ if (entering(tcp) || syserror(tcp))
+ break;
+ dm_decode_dm_target_spec(tcp, arg, ioc);
+ break;
+ case DM_TABLE_LOAD:
+ if (exiting(tcp))
+ break;
+ dm_decode_dm_target_spec(tcp, arg, ioc);
+ break;
+ case DM_TABLE_DEPS:
+ if (entering(tcp) || syserror(tcp))
+ break;
+ dm_decode_dm_target_deps(tcp, arg, ioc);
+ break;
+ case DM_LIST_DEVICES:
+ if (entering(tcp) || syserror(tcp))
+ break;
+ dm_decode_dm_name_list(tcp, arg, ioc);
+ break;
+ case DM_LIST_VERSIONS:
+ if (entering(tcp) || syserror(tcp))
+ break;
+ dm_decode_dm_target_versions(tcp, arg, ioc);
+ break;
+ case DM_TARGET_MSG:
+ if (entering(tcp))
+ dm_decode_dm_target_msg(tcp, arg, ioc);
+ else if (!syserror(tcp) && ioc->flags & DM_DATA_OUT_FLAG)
+ dm_decode_string(tcp, arg, ioc);
+ break;
+ case DM_DEV_RENAME:
+ case DM_DEV_SET_GEOMETRY:
+ if (exiting(tcp))
+ break;
+ dm_decode_string(tcp, arg, ioc);
+ break;
+ }
+
+ skip:
+ tprint_struct_end();
+ return entering(tcp) ? 0 : RVAL_IOCTL_DECODED;
+}
+
+int
+dm_ioctl(struct tcb *const tcp, const unsigned int code, const kernel_ulong_t arg)
+{
+ switch (code) {
+ case DM_VERSION:
+ case DM_REMOVE_ALL:
+ case DM_LIST_DEVICES:
+ case DM_DEV_CREATE:
+ case DM_DEV_REMOVE:
+ case DM_DEV_RENAME:
+ case DM_DEV_SUSPEND:
+ case DM_DEV_STATUS:
+ case DM_DEV_WAIT:
+ case DM_TABLE_LOAD:
+ case DM_TABLE_CLEAR:
+ case DM_TABLE_DEPS:
+ case DM_TABLE_STATUS:
+ case DM_LIST_VERSIONS:
+ case DM_TARGET_MSG:
+ case DM_DEV_SET_GEOMETRY:
+ case DM_DEV_ARM_POLL:
+ return dm_known_ioctl(tcp, code, arg);
+ default:
+ return RVAL_DECODED;
+ }
+}
+
+# else /* !(DM_VERSION_MAJOR == 4) */
+
+int
+dm_ioctl(struct tcb *const tcp, const unsigned int code, const kernel_ulong_t arg)
+{
+ return RVAL_DECODED;
+}
+
+# endif /* DM_VERSION_MAJOR == 4 */
+#endif /* HAVE_LINUX_DM_IOCTL_H */
diff --git a/src/dup.c b/src/dup.c
new file mode 100644
index 000000000..aa86dd935
--- /dev/null
+++ b/src/dup.c
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 1999-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+static int
+dup_123(struct tcb *const tcp, const int newfd_arg, const int flags_arg)
+{
+ printfd(tcp, tcp->u_arg[0]);
+
+ if (newfd_arg > 0) {
+ tprints(", ");
+ printfd(tcp, tcp->u_arg[newfd_arg]);
+
+ if (flags_arg > 0) {
+ tprints(", ");
+ printflags(open_mode_flags, tcp->u_arg[flags_arg],
+ "O_???");
+ }
+ }
+
+ return RVAL_DECODED | RVAL_FD;
+}
+
+SYS_FUNC(dup)
+{
+ return dup_123(tcp, -1, -1);
+}
+
+SYS_FUNC(dup2)
+{
+ return dup_123(tcp, 1, -1);
+}
+
+SYS_FUNC(dup3)
+{
+ return dup_123(tcp, 1, 2);
+}
diff --git a/src/dyxlat.c b/src/dyxlat.c
new file mode 100644
index 000000000..52d20a497
--- /dev/null
+++ b/src/dyxlat.c
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2017-2018 The strace developers.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+struct dyxlat {
+ size_t allocated;
+ struct xlat xlat;
+ struct xlat_data *data;
+};
+
+struct dyxlat *
+dyxlat_alloc(const size_t nmemb)
+{
+ struct dyxlat *const dyxlat = xmalloc(sizeof(*dyxlat));
+
+ dyxlat->xlat.type = XT_NORMAL;
+ dyxlat->xlat.size = 0;
+ dyxlat->allocated = nmemb;
+ dyxlat->xlat.data = dyxlat->data = xgrowarray(NULL, &dyxlat->allocated,
+ sizeof(struct xlat_data));
+
+ return dyxlat;
+}
+
+void
+dyxlat_free(struct dyxlat *const dyxlat)
+{
+ size_t i;
+
+ for (i = 0; i < dyxlat->xlat.size; ++i) {
+ free((void *) dyxlat->data[i].str);
+ dyxlat->data[i].str = NULL;
+ }
+
+ free(dyxlat->data);
+ dyxlat->xlat.data = NULL;
+ free(dyxlat);
+}
+
+const struct xlat *
+dyxlat_get(const struct dyxlat *const dyxlat)
+{
+ return &dyxlat->xlat;
+}
+
+void
+dyxlat_add_pair(struct dyxlat *const dyxlat, const uint64_t val,
+ const char *const str, const size_t len)
+{
+ size_t i;
+
+ for (i = 0; i < dyxlat->xlat.size; ++i) {
+ if (dyxlat->data[i].val == val) {
+ if (strncmp(dyxlat->data[i].str, str, len) == 0
+ && dyxlat->data[i].str[len] == '\0')
+ return;
+
+ free((void *) dyxlat->data[i].str);
+ dyxlat->data[i].str = xstrndup(str, len);
+ return;
+ }
+ }
+
+ if (dyxlat->xlat.size >= dyxlat->allocated)
+ dyxlat->xlat.data = dyxlat->data =
+ xgrowarray(dyxlat->data, &dyxlat->allocated,
+ sizeof(struct xlat_data));
+
+ dyxlat->data[dyxlat->xlat.size].val = val;
+ dyxlat->data[dyxlat->xlat.size].str = xstrndup(str, len);
+ dyxlat->xlat.size++;
+}
diff --git a/src/empty.h b/src/empty.h
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/src/empty.h
diff --git a/src/epoll.c b/src/epoll.c
new file mode 100644
index 000000000..d87e0b8bc
--- /dev/null
+++ b/src/epoll.c
@@ -0,0 +1,111 @@
+/*
+ * Copyright (c) 2004-2007 Ulrich Drepper <drepper@redhat.com>
+ * Copyright (c) 2004 Roland McGrath <roland@redhat.com>
+ * Copyright (c) 2005-2015 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include <fcntl.h>
+#include <sys/epoll.h>
+
+SYS_FUNC(epoll_create)
+{
+ tprintf("%d", (int) tcp->u_arg[0]);
+
+ return RVAL_DECODED | RVAL_FD;
+}
+
+#include "xlat/epollflags.h"
+
+SYS_FUNC(epoll_create1)
+{
+ printflags(epollflags, tcp->u_arg[0], "EPOLL_???");
+
+ return RVAL_DECODED | RVAL_FD;
+}
+
+#include "xlat/epollevents.h"
+
+static void
+print_epoll_data(const epoll_data_t data)
+{
+ /*
+ * We cannot know what format the tracee uses, so
+ * print both u32 and u66 which will cover every value.
+ */
+ tprint_struct_begin();
+ PRINT_FIELD_U(data, u32);
+ tprint_struct_next();
+ PRINT_FIELD_U(data, u64);
+ tprint_struct_end();
+}
+
+static bool
+print_epoll_event(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data)
+{
+ const struct epoll_event *ev = elem_buf;
+
+ tprint_struct_begin();
+ PRINT_FIELD_FLAGS(*ev, events, epollevents, "EPOLL???");
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_VAL(*ev, data, print_epoll_data);
+ tprint_struct_end();
+
+ return true;
+}
+
+#include "xlat/epollctls.h"
+
+SYS_FUNC(epoll_ctl)
+{
+ printfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ const unsigned int op = tcp->u_arg[1];
+ printxval(epollctls, op, "EPOLL_CTL_???");
+ tprints(", ");
+ printfd(tcp, tcp->u_arg[2]);
+ tprints(", ");
+ struct epoll_event ev;
+ if (EPOLL_CTL_DEL == op)
+ printaddr(tcp->u_arg[3]);
+ else if (!umove_or_printaddr(tcp, tcp->u_arg[3], &ev))
+ print_epoll_event(tcp, &ev, sizeof(ev), 0);
+
+ return RVAL_DECODED;
+}
+
+static void
+epoll_wait_common(struct tcb *tcp)
+{
+ if (entering(tcp)) {
+ printfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ } else {
+ struct epoll_event ev;
+ print_array(tcp, tcp->u_arg[1], tcp->u_rval, &ev, sizeof(ev),
+ tfetch_mem, print_epoll_event, 0);
+ tprintf(", %d, %d", (int) tcp->u_arg[2], (int) tcp->u_arg[3]);
+ }
+}
+
+SYS_FUNC(epoll_wait)
+{
+ epoll_wait_common(tcp);
+ return 0;
+}
+
+SYS_FUNC(epoll_pwait)
+{
+ epoll_wait_common(tcp);
+ if (exiting(tcp)) {
+ tprints(", ");
+ /* NB: kernel requires arg[5] == NSIG_BYTES */
+ print_sigset_addr_len(tcp, tcp->u_arg[4], tcp->u_arg[5]);
+ tprintf(", %" PRI_klu, tcp->u_arg[5]);
+ }
+ return 0;
+}
diff --git a/src/error_prints.c b/src/error_prints.c
new file mode 100644
index 000000000..d14268df7
--- /dev/null
+++ b/src/error_prints.c
@@ -0,0 +1,108 @@
+/*
+ * Copyright (c) 1999-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <errno.h>
+#include <stdarg.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "error_prints.h"
+
+#ifndef HAVE_PROGRAM_INVOCATION_NAME
+extern char *program_invocation_name;
+#endif
+
+static void
+verror_msg(int err_no, const char *fmt, va_list p)
+{
+ char *msg;
+
+ fflush(NULL);
+
+ /* We want to print entire message with single fprintf to ensure
+ * message integrity if stderr is shared with other programs.
+ * Thus we use vasprintf + single fprintf.
+ */
+ msg = NULL;
+ if (vasprintf(&msg, fmt, p) >= 0) {
+ if (err_no)
+ fprintf(stderr, "%s: %s: %s\n",
+ program_invocation_name, msg, strerror(err_no));
+ else
+ fprintf(stderr, "%s: %s\n",
+ program_invocation_name, msg);
+ free(msg);
+ } else {
+ /* malloc in vasprintf failed, try it without malloc */
+ fprintf(stderr, "%s: ", program_invocation_name);
+ vfprintf(stderr, fmt, p);
+ if (err_no)
+ fprintf(stderr, ": %s\n", strerror(err_no));
+ else
+ putc('\n', stderr);
+ }
+ /* We don't switch stderr to buffered, thus fprintf(stderr)
+ * always flushes its output and this is not necessary: */
+ /* fflush(stderr); */
+}
+
+void
+error_msg(const char *fmt, ...)
+{
+ va_list p;
+ va_start(p, fmt);
+ verror_msg(0, fmt, p);
+ va_end(p);
+}
+
+void
+error_msg_and_die(const char *fmt, ...)
+{
+ va_list p;
+ va_start(p, fmt);
+ verror_msg(0, fmt, p);
+ va_end(p);
+ die();
+}
+
+void
+error_msg_and_help(const char *fmt, ...)
+{
+ if (fmt != NULL) {
+ va_list p;
+ va_start(p, fmt);
+ verror_msg(0, fmt, p);
+ va_end(p);
+ }
+ fprintf(stderr, "Try '%s -h' for more information.\n",
+ program_invocation_name);
+ die();
+}
+
+void
+perror_msg(const char *fmt, ...)
+{
+ va_list p;
+ va_start(p, fmt);
+ verror_msg(errno, fmt, p);
+ va_end(p);
+}
+
+void
+perror_msg_and_die(const char *fmt, ...)
+{
+ va_list p;
+ va_start(p, fmt);
+ verror_msg(errno, fmt, p);
+ va_end(p);
+ die();
+}
diff --git a/src/error_prints.h b/src/error_prints.h
new file mode 100644
index 000000000..678c1d15a
--- /dev/null
+++ b/src/error_prints.h
@@ -0,0 +1,59 @@
+/*
+ * This file contains error printing functions.
+ * These functions can be used by various binaries included in the strace
+ * package. Variable 'program_invocation_name' and function 'die()'
+ * have to be defined globally.
+ *
+ * Copyright (c) 2001-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_ERROR_PRINTS_H
+# define STRACE_ERROR_PRINTS_H
+
+# include <stdbool.h>
+
+# include "gcc_compat.h"
+
+extern bool debug_flag;
+
+void die(void) ATTRIBUTE_NORETURN;
+
+void error_msg(const char *fmt, ...) ATTRIBUTE_FORMAT((printf, 1, 2));
+void perror_msg(const char *fmt, ...) ATTRIBUTE_FORMAT((printf, 1, 2));
+void perror_msg_and_die(const char *fmt, ...)
+ ATTRIBUTE_FORMAT((printf, 1, 2)) ATTRIBUTE_NORETURN;
+void error_msg_and_help(const char *fmt, ...)
+ ATTRIBUTE_FORMAT((printf, 1, 2)) ATTRIBUTE_NORETURN;
+void error_msg_and_die(const char *fmt, ...)
+ ATTRIBUTE_FORMAT((printf, 1, 2)) ATTRIBUTE_NORETURN;
+
+/* Wrappers for if (debug_flag) error_msg(...) */
+# define debug_msg(...) \
+ do { \
+ if (debug_flag) \
+ error_msg(__VA_ARGS__); \
+ } while (0)
+# define debug_perror_msg(...) \
+ do { \
+ if (debug_flag) \
+ perror_msg(__VA_ARGS__); \
+ } while (0)
+
+/* Simple wrappers for providing function name in error messages */
+# define error_func_msg(fmt_, ...) \
+ error_msg("%s: " fmt_, __func__, ##__VA_ARGS__)
+# define perror_func_msg(fmt_, ...) \
+ perror_msg("%s: " fmt_, __func__, ##__VA_ARGS__)
+# define debug_func_msg(fmt_, ...) \
+ debug_msg("%s: " fmt_, __func__, ##__VA_ARGS__)
+# define debug_func_perror_msg(fmt_, ...) \
+ debug_perror_msg("%s: " fmt_, __func__, ##__VA_ARGS__)
+# define error_func_msg_and_die(fmt_, ...) \
+ error_msg_and_die("%s: " fmt_, __func__, ##__VA_ARGS__)
+# define perror_func_msg_and_die(fmt_, ...) \
+ perror_msg_and_die("%s: " fmt_, __func__, ##__VA_ARGS__)
+
+#endif /* !STRACE_ERROR_PRINTS_H */
diff --git a/src/evdev.c b/src/evdev.c
new file mode 100644
index 000000000..d8fd40489
--- /dev/null
+++ b/src/evdev.c
@@ -0,0 +1,465 @@
+/*
+ * Copyright (c) 2015 Etienne Gemsa <etienne.gemsa@lse.epita.fr>
+ * Copyright (c) 2015-2016 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2015-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#include "xlat/evdev_abs.h"
+#include "xlat/evdev_ev.h"
+
+#ifdef HAVE_LINUX_INPUT_H
+
+# include <linux/ioctl.h>
+# include "types/evdev.h"
+
+# include "xlat/evdev_autorepeat.h"
+# include "xlat/evdev_ff_status.h"
+# include "xlat/evdev_ff_types.h"
+# include "xlat/evdev_keycode.h"
+# include "xlat/evdev_leds.h"
+# include "xlat/evdev_misc.h"
+# include "xlat/evdev_mtslots.h"
+# include "xlat/evdev_prop.h"
+# include "xlat/evdev_relative_axes.h"
+# include "xlat/evdev_snd.h"
+# include "xlat/evdev_switch.h"
+
+/** Added by Linux commit v2.6.38-rc1~247^2~1^2~2^2~5 */
+# ifndef INPUT_PROP_MAX
+# define INPUT_PROP_MAX 0x1f
+# endif
+# ifndef SYN_MAX
+# define SYN_MAX 0xf
+# endif
+
+/*
+ * Has to be included after struct_* type definitions, since _IO* macros
+ * used in fallback definitions require them for sizeof().
+ */
+# define XLAT_MACROS_ONLY
+# include "xlat/evdev_ioctl_cmds.h"
+# undef XLAT_MACROS_ONLY
+
+# ifndef EVIOCGPROP
+# define EVIOCGPROP(len) _IOR('E', 0x09, len)
+# endif
+# ifndef EVIOCGMTSLOTS
+# define EVIOCGMTSLOTS(len) _IOR('E', 0x0a, len)
+# endif
+# ifndef EVIOCGSW
+# define EVIOCGSW(len) _IOR('E', 0x1b, len)
+# endif
+
+static int
+abs_ioctl(struct tcb *const tcp, const unsigned int code,
+ const kernel_ulong_t arg)
+{
+ static const size_t orig_sz = offsetofend(struct_input_absinfo, flat);
+ static const size_t res_sz = offsetofend(struct_input_absinfo,
+ resolution);
+
+ struct_input_absinfo absinfo;
+ size_t sz = _IOC_SIZE(code);
+ size_t read_sz = MIN(sz, sizeof(absinfo));
+
+ if (sz < orig_sz)
+ return RVAL_DECODED;
+
+ tprints(", ");
+
+ if (umoven_or_printaddr(tcp, arg, read_sz, &absinfo))
+ return RVAL_IOCTL_DECODED;
+
+ tprint_struct_begin();
+ PRINT_FIELD_U(absinfo, value);
+ tprint_struct_next();
+ PRINT_FIELD_U(absinfo, minimum);
+
+ if (!abbrev(tcp)) {
+ tprint_struct_next();
+ PRINT_FIELD_U(absinfo, maximum);
+ tprint_struct_next();
+ PRINT_FIELD_U(absinfo, fuzz);
+ tprint_struct_next();
+ PRINT_FIELD_U(absinfo, flat);
+ if (sz > orig_sz) {
+ if (sz >= res_sz) {
+ tprint_struct_next();
+ PRINT_FIELD_U(absinfo, resolution);
+ }
+ if (sz != res_sz) {
+ tprint_struct_next();
+ tprint_more_data_follows();
+ }
+ }
+ } else {
+ tprint_struct_next();
+ tprint_more_data_follows();
+ }
+
+ tprint_struct_end();
+
+ return RVAL_IOCTL_DECODED;
+}
+
+static int
+keycode_ioctl(struct tcb *const tcp, const kernel_ulong_t arg)
+{
+ tprints(", ");
+
+ unsigned int keycode[2];
+
+ if (!umove_or_printaddr(tcp, arg, &keycode)) {
+ tprintf("[%u, ", keycode[0]);
+ printxval(evdev_keycode, keycode[1], "KEY_???");
+ tprints("]");
+ }
+
+ return RVAL_IOCTL_DECODED;
+}
+
+static int
+keycode_V2_ioctl(struct tcb *const tcp, const kernel_ulong_t arg)
+{
+ tprints(", ");
+
+ struct_input_keymap_entry ike;
+
+ if (umove_or_printaddr(tcp, arg, &ike))
+ return RVAL_IOCTL_DECODED;
+
+ tprint_struct_begin();
+ PRINT_FIELD_U(ike, flags);
+ tprint_struct_next();
+ PRINT_FIELD_U(ike, len);
+
+ if (!abbrev(tcp)) {
+ tprint_struct_next();
+ PRINT_FIELD_U(ike, index);
+ tprint_struct_next();
+ PRINT_FIELD_XVAL(ike, keycode, evdev_keycode, "KEY_???");
+ tprint_struct_next();
+ PRINT_FIELD_X_ARRAY(ike, scancode);
+ } else {
+ tprint_struct_next();
+ tprint_more_data_follows();
+ }
+
+ tprint_struct_end();
+
+ return RVAL_IOCTL_DECODED;
+}
+
+static int
+getid_ioctl(struct tcb *const tcp, const kernel_ulong_t arg)
+{
+ tprints(", ");
+
+ struct input_id id;
+
+ if (!umove_or_printaddr(tcp, arg, &id)) {
+ tprint_struct_begin();
+ PRINT_FIELD_U(id, bustype);
+ tprint_struct_next();
+ PRINT_FIELD_U(id, vendor);
+ tprint_struct_next();
+ PRINT_FIELD_U(id, product);
+ tprint_struct_next();
+ PRINT_FIELD_U(id, version);
+ tprint_struct_end();
+ }
+
+ return RVAL_IOCTL_DECODED;
+}
+
+static int
+decode_bitset(struct tcb *const tcp, const kernel_ulong_t arg,
+ const struct xlat *decode_nr, const unsigned int max_nr,
+ const char *const dflt)
+{
+ tprints(", ");
+
+ unsigned int size;
+ unsigned int size_bits;
+
+ if ((kernel_ulong_t) tcp->u_rval > max_nr / 8)
+ size_bits = max_nr;
+ else
+ size_bits = tcp->u_rval * 8;
+
+ size = ROUNDUP(ROUNDUP_DIV(size_bits, 8), current_wordsize);
+
+ if (syserror(tcp) || !size) {
+ printaddr(arg);
+
+ return RVAL_IOCTL_DECODED;
+ }
+
+ char decoded_arg[size];
+
+ if (umove_or_printaddr(tcp, arg, &decoded_arg))
+ return RVAL_IOCTL_DECODED;
+
+ if (xlat_verbose(xlat_verbosity) != XLAT_STYLE_RAW) {
+ tprints("[");
+
+ int bit_displayed = 0;
+ int i = next_set_bit(decoded_arg, 0, size_bits);
+ if (i < 0) {
+ tprints(" 0 ");
+ } else {
+ printxval(decode_nr, i, dflt);
+
+ while ((i = next_set_bit(decoded_arg, i + 1,
+ size_bits)) > 0) {
+ if (abbrev(tcp) && bit_displayed >= 3) {
+ tprint_struct_next();
+ tprint_more_data_follows();
+ break;
+ }
+ tprints(", ");
+ printxval(decode_nr, i, dflt);
+ bit_displayed++;
+ }
+ }
+
+ tprints("]");
+ }
+
+ if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE)
+ tprints(" /* ");
+
+ if (xlat_verbose(xlat_verbosity) != XLAT_STYLE_ABBREV) {
+ print_local_array_ex(tcp, decoded_arg, size / current_wordsize,
+ current_wordsize, print_xlong_array_member,
+ NULL, 0, NULL, NULL);
+ }
+
+ if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE)
+ tprints(" */");
+
+ return RVAL_IOCTL_DECODED;
+}
+
+static int
+mtslots_ioctl(struct tcb *const tcp, const unsigned int code,
+ const kernel_ulong_t arg)
+{
+ tprints(", ");
+
+ const size_t size = _IOC_SIZE(code) / sizeof(int);
+ if (!size) {
+ printaddr(arg);
+ return RVAL_IOCTL_DECODED;
+ }
+
+ int buffer[size];
+
+ if (umove_or_printaddr(tcp, arg, &buffer))
+ return RVAL_IOCTL_DECODED;
+
+ tprint_struct_begin();
+ tprints_field_name("code");
+ printxval(evdev_mtslots, buffer[0], "ABS_MT_???");
+
+ tprint_struct_next();
+ tprints_field_name("values");
+ tprints("[");
+
+ unsigned int i;
+ for (i = 1; i < ARRAY_SIZE(buffer); i++)
+ tprintf("%s%d", i > 1 ? ", " : "", buffer[i]);
+
+ tprints("]");
+ tprint_struct_end();
+
+ return RVAL_IOCTL_DECODED;
+}
+
+static int
+repeat_ioctl(struct tcb *const tcp, const kernel_ulong_t arg)
+{
+ tprints(", ");
+ printpair_int(tcp, arg, "%u");
+ return RVAL_IOCTL_DECODED;
+}
+
+static int
+bit_ioctl(struct tcb *const tcp, const unsigned int ev_nr,
+ const kernel_ulong_t arg)
+{
+ switch (ev_nr) {
+ case 0:
+ return decode_bitset(tcp, arg, evdev_ev,
+ EV_MAX, "EV_???");
+ case EV_KEY:
+ return decode_bitset(tcp, arg, evdev_keycode,
+ KEY_MAX, "KEY_???");
+ case EV_REL:
+ return decode_bitset(tcp, arg, evdev_relative_axes,
+ REL_MAX, "REL_???");
+ case EV_ABS:
+ return decode_bitset(tcp, arg, evdev_abs,
+ ABS_MAX, "ABS_???");
+ case EV_MSC:
+ return decode_bitset(tcp, arg, evdev_misc,
+ MSC_MAX, "MSC_???");
+ case EV_SW:
+ return decode_bitset(tcp, arg, evdev_switch,
+ SW_MAX, "SW_???");
+ case EV_LED:
+ return decode_bitset(tcp, arg, evdev_leds,
+ LED_MAX, "LED_???");
+ case EV_SND:
+ return decode_bitset(tcp, arg, evdev_snd,
+ SND_MAX, "SND_???");
+ case EV_REP:
+ return decode_bitset(tcp, arg, evdev_autorepeat,
+ REP_MAX, "REP_???");
+ case EV_FF:
+ return decode_bitset(tcp, arg, evdev_ff_types,
+ FF_MAX, "FF_???");
+ case EV_PWR:
+ tprints(", ");
+ printnum_int(tcp, arg, "%d");
+ return RVAL_IOCTL_DECODED;
+ case EV_FF_STATUS:
+ return decode_bitset(tcp, arg, evdev_ff_status,
+ FF_STATUS_MAX, "FF_STATUS_???");
+ default:
+ tprints(", ");
+ printaddr(arg);
+ return RVAL_IOCTL_DECODED;
+ }
+}
+
+static int
+evdev_read_ioctl(struct tcb *const tcp, const unsigned int code,
+ const kernel_ulong_t arg)
+{
+ /* fixed-number fixed-length commands */
+ switch (code) {
+ case EVIOCGVERSION:
+ tprints(", ");
+ printnum_int(tcp, arg, "%#x");
+ return RVAL_IOCTL_DECODED;
+ case EVIOCGEFFECTS:
+ tprints(", ");
+ printnum_int(tcp, arg, "%u");
+ return RVAL_IOCTL_DECODED;
+ case EVIOCGID:
+ return getid_ioctl(tcp, arg);
+ case EVIOCGREP:
+ return repeat_ioctl(tcp, arg);
+ case EVIOCGKEYCODE:
+ return keycode_ioctl(tcp, arg);
+ case EVIOCGKEYCODE_V2:
+ return keycode_V2_ioctl(tcp, arg);
+ }
+
+ /* fixed-number variable-length commands */
+ switch (_IOC_NR(code)) {
+ case _IOC_NR(EVIOCGMTSLOTS(0)):
+ return mtslots_ioctl(tcp, code, arg);
+ case _IOC_NR(EVIOCGNAME(0)):
+ case _IOC_NR(EVIOCGPHYS(0)):
+ case _IOC_NR(EVIOCGUNIQ(0)):
+ tprints(", ");
+ if (syserror(tcp))
+ printaddr(arg);
+ else
+ printstrn(tcp, arg, tcp->u_rval);
+ return RVAL_IOCTL_DECODED;
+ case _IOC_NR(EVIOCGPROP(0)):
+ return decode_bitset(tcp, arg, evdev_prop,
+ INPUT_PROP_MAX, "PROP_???");
+ case _IOC_NR(EVIOCGSND(0)):
+ return decode_bitset(tcp, arg, evdev_snd,
+ SND_MAX, "SND_???");
+ case _IOC_NR(EVIOCGSW(0)):
+ return decode_bitset(tcp, arg, evdev_switch,
+ SW_MAX, "SW_???");
+ case _IOC_NR(EVIOCGKEY(0)):
+ return decode_bitset(tcp, arg, evdev_keycode,
+ KEY_MAX, "KEY_???");
+ case _IOC_NR(EVIOCGLED(0)):
+ return decode_bitset(tcp, arg, evdev_leds,
+ LED_MAX, "LED_???");
+ }
+
+ /* multi-number fixed-length commands */
+ if ((_IOC_NR(code) & ~ABS_MAX) == _IOC_NR(EVIOCGABS(0)))
+ return abs_ioctl(tcp, code, arg);
+
+ /* multi-number variable-length commands */
+ if ((_IOC_NR(code) & ~EV_MAX) == _IOC_NR(EVIOCGBIT(0, 0)))
+ return bit_ioctl(tcp, _IOC_NR(code) & EV_MAX, arg);
+
+ return 0;
+}
+
+static int
+evdev_write_ioctl(struct tcb *const tcp, const unsigned int code,
+ const kernel_ulong_t arg)
+{
+ /* fixed-number fixed-length commands */
+ switch (code) {
+ case EVIOCSREP:
+ return repeat_ioctl(tcp, arg);
+ case EVIOCSKEYCODE:
+ return keycode_ioctl(tcp, arg);
+ case EVIOCSKEYCODE_V2:
+ return keycode_V2_ioctl(tcp, arg);
+ case EVIOCRMFF:
+ tprintf(", %d", (int) arg);
+ return RVAL_IOCTL_DECODED;
+ case EVIOCGRAB:
+ case EVIOCREVOKE:
+ tprintf(", %" PRI_klu, arg);
+ return RVAL_IOCTL_DECODED;
+ case EVIOCSCLOCKID:
+ tprints(", ");
+ printnum_int(tcp, arg, "%u");
+ return RVAL_IOCTL_DECODED;
+ }
+
+ int rc = evdev_write_ioctl_mpers(tcp, code, arg);
+
+ if (rc != RVAL_DECODED)
+ return rc;
+
+ /* multi-number fixed-length commands */
+ if ((_IOC_NR(code) & ~ABS_MAX) == _IOC_NR(EVIOCSABS(0)))
+ return abs_ioctl(tcp, code, arg);
+
+ return 0;
+}
+
+void
+print_evdev_ff_type(const kernel_ulong_t val)
+{
+ printxval(evdev_ff_types, val, "FF_???");
+}
+
+int
+evdev_ioctl(struct tcb *const tcp,
+ const unsigned int code, const kernel_ulong_t arg)
+{
+ switch (_IOC_DIR(code)) {
+ case _IOC_READ:
+ if (entering(tcp))
+ return 0;
+ return evdev_read_ioctl(tcp, code, arg);
+ case _IOC_WRITE:
+ return evdev_write_ioctl(tcp, code, arg) | RVAL_DECODED;
+ default:
+ return RVAL_DECODED;
+ }
+}
+
+#endif /* HAVE_LINUX_INPUT_H */
diff --git a/src/evdev_mpers.c b/src/evdev_mpers.c
new file mode 100644
index 000000000..a91e38749
--- /dev/null
+++ b/src/evdev_mpers.c
@@ -0,0 +1,199 @@
+/*
+ * Copyright (c) 2015 Etienne Gemsa <etienne.gemsa@lse.epita.fr>
+ * Copyright (c) 2015-2016 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2015-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#ifdef HAVE_LINUX_INPUT_H
+
+# include DEF_MPERS_TYPE(struct_ff_effect)
+
+# include <linux/ioctl.h>
+# include <linux/input.h>
+
+typedef struct ff_effect struct_ff_effect;
+
+#endif /* HAVE_LINUX_INPUT_H */
+
+#include MPERS_DEFS
+
+#ifdef HAVE_LINUX_INPUT_H
+
+static void
+print_ff_envelope(const MPERS_PTR_ARG(struct ff_envelope *) const arg)
+{
+ const struct ff_envelope *const p = arg;
+ tprint_struct_begin();
+ PRINT_FIELD_U(*p, attack_length);
+ tprint_struct_next();
+ PRINT_FIELD_U(*p, attack_level);
+ tprint_struct_next();
+ PRINT_FIELD_U(*p, fade_length);
+ tprint_struct_next();
+ PRINT_FIELD_X(*p, fade_level);
+ tprint_struct_end();
+}
+
+#define DECL_print_ff(name_) \
+ print_ff_ ## name_(const typeof_field(struct_ff_effect, name_) *const p)
+
+static void
+DECL_print_ff(trigger)
+{
+ tprint_struct_begin();
+ PRINT_FIELD_U(*p, button);
+ tprint_struct_next();
+ PRINT_FIELD_U(*p, interval);
+ tprint_struct_end();
+}
+
+static void
+DECL_print_ff(replay)
+{
+ tprint_struct_begin();
+ PRINT_FIELD_U(*p, length);
+ tprint_struct_next();
+ PRINT_FIELD_U(*p, delay);
+ tprint_struct_end();
+}
+
+# define PRINT_FIELD_FF_EFFECT(where_, field_) \
+ do { \
+ tprints_field_name(#field_); \
+ print_ff_ ## field_(&((where_).field_)); \
+ } while (0)
+
+#define DECL_print_ff_effect(name_) \
+ print_ff_ ## name_ ## _effect(const typeof_field(struct_ff_effect, u.name_) *const p)
+
+static void
+DECL_print_ff_effect(constant)
+{
+ tprint_struct_begin();
+ PRINT_FIELD_D(*p, level);
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_PTR(*p, envelope, print_ff_envelope);
+ tprint_struct_end();
+}
+
+static void
+DECL_print_ff_effect(ramp)
+{
+ tprint_struct_begin();
+ PRINT_FIELD_D(*p, start_level);
+ tprint_struct_next();
+ PRINT_FIELD_D(*p, end_level);
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_PTR(*p, envelope, print_ff_envelope);
+ tprint_struct_end();
+}
+
+static void
+DECL_print_ff_effect(periodic)
+{
+ tprint_struct_begin();
+ PRINT_FIELD_U(*p, waveform);
+ tprint_struct_next();
+ PRINT_FIELD_U(*p, period);
+ tprint_struct_next();
+ PRINT_FIELD_D(*p, magnitude);
+ tprint_struct_next();
+ PRINT_FIELD_D(*p, offset);
+ tprint_struct_next();
+ PRINT_FIELD_U(*p, phase);
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_PTR(*p, envelope, print_ff_envelope);
+ tprint_struct_next();
+ PRINT_FIELD_U(*p, custom_len);
+ tprint_struct_next();
+ PRINT_FIELD_PTR(*p, custom_data);
+ tprint_struct_end();
+}
+
+static void
+DECL_print_ff_effect(rumble)
+{
+ tprint_struct_begin();
+ PRINT_FIELD_U(*p, strong_magnitude);
+ tprint_struct_next();
+ PRINT_FIELD_U(*p, weak_magnitude);
+ tprint_struct_end();
+}
+
+# define PRINT_FIELD_FF_TYPE_EFFECT(where_, field_) \
+ do { \
+ tprints_field_name(#field_); \
+ print_ff_ ## field_ ## _effect(&((where_).field_)); \
+ } while (0)
+
+static int
+ff_effect_ioctl(struct tcb *const tcp, const kernel_ulong_t arg)
+{
+ tprints(", ");
+
+ struct_ff_effect ffe;
+
+ if (umove_or_printaddr(tcp, arg, &ffe))
+ return RVAL_IOCTL_DECODED;
+
+ tprint_struct_begin();
+ PRINT_FIELD_OBJ_VAL(ffe, type, print_evdev_ff_type);
+ tprint_struct_next();
+ PRINT_FIELD_D(ffe, id);
+ tprint_struct_next();
+ PRINT_FIELD_U(ffe, direction);
+ tprint_struct_next();
+
+ if (abbrev(tcp)) {
+ tprint_more_data_follows();
+ tprint_struct_end();
+ return RVAL_IOCTL_DECODED;
+ }
+
+ PRINT_FIELD_FF_EFFECT(ffe, trigger);
+ tprint_struct_next();
+ PRINT_FIELD_FF_EFFECT(ffe, replay);
+
+ switch (ffe.type) {
+ case FF_CONSTANT:
+ tprint_struct_next();
+ PRINT_FIELD_FF_TYPE_EFFECT(ffe.u, constant);
+ break;
+ case FF_RAMP:
+ tprint_struct_next();
+ PRINT_FIELD_FF_TYPE_EFFECT(ffe.u, ramp);
+ break;
+ case FF_PERIODIC:
+ tprint_struct_next();
+ PRINT_FIELD_FF_TYPE_EFFECT(ffe.u, periodic);
+ break;
+ case FF_RUMBLE:
+ tprint_struct_next();
+ PRINT_FIELD_FF_TYPE_EFFECT(ffe.u, rumble);
+ break;
+ default:
+ break;
+ }
+
+ tprint_struct_end();
+
+ return RVAL_IOCTL_DECODED;
+}
+
+MPERS_PRINTER_DECL(int, evdev_write_ioctl_mpers, struct tcb *const tcp,
+ const unsigned int code, const kernel_ulong_t arg)
+{
+ switch (code) {
+ case EVIOCSFF:
+ return ff_effect_ioctl(tcp, arg);
+ default:
+ return RVAL_DECODED;
+ }
+}
+
+#endif /* HAVE_LINUX_INPUT_H */
diff --git a/src/eventfd.c b/src/eventfd.c
new file mode 100644
index 000000000..395ac6524
--- /dev/null
+++ b/src/eventfd.c
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2007 Ulrich Drepper <drepper@redhat.com>
+ * Copyright (c) 2008-2018 Dmitry V. Levin <ldv@strace.io>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include <fcntl.h>
+#ifdef HAVE_SYS_EVENTFD_H
+# include <sys/eventfd.h>
+#endif
+
+#include "xlat/efd_flags.h"
+
+static int
+do_eventfd(struct tcb *tcp, int flags_arg)
+{
+ tprintf("%u", (unsigned int) tcp->u_arg[0]);
+ if (flags_arg >= 0) {
+ tprints(", ");
+ printflags(efd_flags, tcp->u_arg[flags_arg], "EFD_???");
+ }
+
+ return RVAL_DECODED | RVAL_FD;
+}
+
+SYS_FUNC(eventfd)
+{
+ return do_eventfd(tcp, -1);
+}
+
+SYS_FUNC(eventfd2)
+{
+ return do_eventfd(tcp, 1);
+}
diff --git a/src/execve.c b/src/execve.c
new file mode 100644
index 000000000..6fcb4cafe
--- /dev/null
+++ b/src/execve.c
@@ -0,0 +1,131 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993-1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
+ * Copyright (c) 2007 Roland McGrath <roland@redhat.com>
+ * Copyright (c) 2011-2012 Denys Vlasenko <vda.linux@googlemail.com>
+ * Copyright (c) 2010-2015 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2014-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+static void
+printargv(struct tcb *const tcp, kernel_ulong_t addr)
+{
+ if (!addr || !verbose(tcp)) {
+ printaddr(addr);
+ return;
+ }
+
+ const char *const start_sep = "[";
+ const char *sep = start_sep;
+ const unsigned int wordsize = current_wordsize;
+ unsigned int n;
+
+ for (n = 0; addr; sep = ", ", addr += wordsize, ++n) {
+ union {
+ unsigned int p32;
+ kernel_ulong_t p64;
+ char data[sizeof(kernel_ulong_t)];
+ } cp;
+
+ if (umoven(tcp, addr, wordsize, cp.data)) {
+ if (sep == start_sep)
+ printaddr(addr);
+ else {
+ tprints(", ");
+ tprint_more_data_follows();
+ printaddr_comment(addr);
+ tprints("]");
+ }
+ return;
+ }
+ if (!(wordsize < sizeof(cp.p64) ? cp.p32 : cp.p64)) {
+ if (sep == start_sep)
+ tprints(start_sep);
+ break;
+ }
+ if (abbrev(tcp) && n >= max_strlen) {
+ tprints(sep);
+ tprint_more_data_follows();
+ break;
+ }
+ tprints(sep);
+ printstr(tcp, wordsize < sizeof(cp.p64) ? cp.p32 : cp.p64);
+ }
+ tprints("]");
+}
+
+static void
+printargc(struct tcb *const tcp, kernel_ulong_t addr)
+{
+ printaddr(addr);
+
+ if (!addr || !verbose(tcp))
+ return;
+
+ bool unterminated = false;
+ unsigned int count = 0;
+ char *cp = NULL;
+
+ for (; addr; addr += current_wordsize, ++count) {
+ if (umoven(tcp, addr, current_wordsize, &cp)) {
+ if (!count)
+ return;
+
+ unterminated = true;
+ break;
+ }
+ if (!cp)
+ break;
+ }
+ tprintf_comment("%u var%s%s",
+ count, count == 1 ? "" : "s",
+ unterminated ? ", unterminated" : "");
+}
+
+static void
+decode_execve(struct tcb *tcp, const unsigned int index)
+{
+ printpath(tcp, tcp->u_arg[index + 0]);
+ tprints(", ");
+
+ printargv(tcp, tcp->u_arg[index + 1]);
+ tprints(", ");
+
+ (abbrev(tcp) ? printargc : printargv) (tcp, tcp->u_arg[index + 2]);
+}
+
+SYS_FUNC(execve)
+{
+ decode_execve(tcp, 0);
+
+ return RVAL_DECODED;
+}
+
+SYS_FUNC(execveat)
+{
+ print_dirfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ decode_execve(tcp, 1);
+ tprints(", ");
+ printflags(at_flags, tcp->u_arg[4], "AT_???");
+
+ return RVAL_DECODED;
+}
+
+#if defined(SPARC) || defined(SPARC64)
+SYS_FUNC(execv)
+{
+ printpath(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ printargv(tcp, tcp->u_arg[1]);
+
+ return RVAL_DECODED;
+}
+#endif /* SPARC || SPARC64 */
diff --git a/src/f_owner_ex.h b/src/f_owner_ex.h
new file mode 100644
index 000000000..81e4a4d7b
--- /dev/null
+++ b/src/f_owner_ex.h
@@ -0,0 +1,21 @@
+/*
+ * Copyright (c) 2018 Dmitry V. Levin <ldv@strace.io>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_F_OWNER_EX_H
+# define STRACE_F_OWNER_EX_H
+
+# include <linux/fcntl.h>
+
+# if defined HAVE_STRUCT_F_OWNER_EX
+typedef struct f_owner_ex struct_kernel_f_owner_ex;
+# elif defined HAVE_STRUCT___KERNEL_F_OWNER_EX
+typedef struct __kernel_f_owner_ex struct_kernel_f_owner_ex;
+# else
+# error struct f_owner_ex definition not found in <linux/fcntl.h>
+# endif
+
+#endif /* !STRACE_F_OWNER_EX_H */
diff --git a/src/fadvise.c b/src/fadvise.c
new file mode 100644
index 000000000..02e4df63f
--- /dev/null
+++ b/src/fadvise.c
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2004 Ulrich Drepper <drepper@redhat.com>
+ * Copyright (c) 2004 Roland McGrath <roland@redhat.com>
+ * Copyright (c) 2007 Daniel Jacobowitz <dan@codesourcery.com>
+ * Copyright (c) 2009 Andreas Schwab <schwab@redhat.com>
+ * Copyright (c) 2009 Kirill A. Shutemov <kirill@shutemov.name>
+ * Copyright (c) 2011-2015 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2014-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#include <fcntl.h>
+
+#include "xlat/advise.h"
+
+SYS_FUNC(fadvise64)
+{
+ int argn;
+
+ printfd(tcp, tcp->u_arg[0]);
+ argn = printllval(tcp, ", %lld", 1);
+ tprintf(", %" PRI_klu ", ", tcp->u_arg[argn++]);
+ printxval(advise, tcp->u_arg[argn], "POSIX_FADV_???");
+
+ return RVAL_DECODED;
+}
+
+SYS_FUNC(fadvise64_64)
+{
+ int argn;
+
+ printfd(tcp, tcp->u_arg[0]);
+ argn = printllval(tcp, ", %lld, ", 1);
+ argn = printllval(tcp, "%lld, ", argn);
+#if defined __ARM_EABI__ || defined AARCH64 || defined POWERPC || defined XTENSA
+ printxval(advise, tcp->u_arg[1], "POSIX_FADV_???");
+#else
+ printxval(advise, tcp->u_arg[argn], "POSIX_FADV_???");
+#endif
+
+ return RVAL_DECODED;
+}
diff --git a/src/fallocate.c b/src/fallocate.c
new file mode 100644
index 000000000..82c0d642d
--- /dev/null
+++ b/src/fallocate.c
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2014-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#ifdef HAVE_LINUX_FALLOC_H
+# include <linux/falloc.h>
+#endif
+
+#include "xlat/falloc_flags.h"
+
+SYS_FUNC(fallocate)
+{
+ int argn;
+
+ /* fd */
+ printfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+
+ /* mode */
+ printflags(falloc_flags, tcp->u_arg[1], "FALLOC_FL_???");
+ tprints(", ");
+
+ /* offset */
+ argn = printllval(tcp, "%lld, ", 2);
+
+ /* len */
+ printllval(tcp, "%lld", argn);
+
+ return RVAL_DECODED;
+}
diff --git a/src/fanotify.c b/src/fanotify.c
new file mode 100644
index 000000000..389b373e9
--- /dev/null
+++ b/src/fanotify.c
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2014-2015 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2014-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#include "xlat/fan_classes.h"
+#include "xlat/fan_init_flags.h"
+
+#ifndef FAN_ALL_CLASS_BITS
+# define FAN_ALL_CLASS_BITS (FAN_CLASS_NOTIF | FAN_CLASS_CONTENT | FAN_CLASS_PRE_CONTENT)
+#endif
+#ifndef FAN_NOFD
+# define FAN_NOFD -1
+#endif
+
+SYS_FUNC(fanotify_init)
+{
+ unsigned int flags = tcp->u_arg[0];
+
+ printxval(fan_classes, flags & FAN_ALL_CLASS_BITS, "FAN_CLASS_???");
+ flags &= ~FAN_ALL_CLASS_BITS;
+ if (flags) {
+ tprints("|");
+ printflags(fan_init_flags, flags, "FAN_???");
+ }
+ tprints(", ");
+ tprint_open_modes((unsigned) tcp->u_arg[1]);
+
+ return RVAL_DECODED | RVAL_FD;
+}
+
+#include "xlat/fan_mark_flags.h"
+#include "xlat/fan_event_flags.h"
+
+SYS_FUNC(fanotify_mark)
+{
+ printfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ printflags(fan_mark_flags, tcp->u_arg[1], "FAN_MARK_???");
+ tprints(", ");
+ /*
+ * the mask argument is defined as 64-bit,
+ * but kernel uses the lower 32 bits only.
+ */
+ unsigned long long mask = 0;
+ int argn = getllval(tcp, &mask, 2);
+#ifdef HPPA
+ /* Parsic is weird. See arch/parisc/kernel/sys_parisc32.c. */
+ mask = (mask << 32) | (mask >> 32);
+#endif
+ printflags64(fan_event_flags, mask, "FAN_???");
+ tprints(", ");
+ if ((int) tcp->u_arg[argn] == FAN_NOFD)
+ print_xlat_d(FAN_NOFD);
+ else
+ print_dirfd(tcp, tcp->u_arg[argn]);
+ tprints(", ");
+ printpath(tcp, tcp->u_arg[argn + 1]);
+
+ return RVAL_DECODED;
+}
diff --git a/src/fchownat.c b/src/fchownat.c
new file mode 100644
index 000000000..b573b5bae
--- /dev/null
+++ b/src/fchownat.c
@@ -0,0 +1,21 @@
+/*
+ * Copyright (c) 2014-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+SYS_FUNC(fchownat)
+{
+ print_dirfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ printpath(tcp, tcp->u_arg[1]);
+ printuid(", ", tcp->u_arg[2]);
+ printuid(", ", tcp->u_arg[3]);
+ tprints(", ");
+ printflags(at_flags, tcp->u_arg[4], "AT_???");
+
+ return RVAL_DECODED;
+}
diff --git a/src/fcntl.c b/src/fcntl.c
new file mode 100644
index 000000000..5fd916ced
--- /dev/null
+++ b/src/fcntl.c
@@ -0,0 +1,232 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
+ * Copyright (c) 1999-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include "flock.h"
+
+#include "xlat/f_owner_types.h"
+#include "xlat/f_seals.h"
+#include "xlat/fcntlcmds.h"
+#include "xlat/fdflags.h"
+#include "xlat/lockfcmds.h"
+#include "xlat/notifyflags.h"
+
+static void
+print_struct_flock64(struct tcb *const tcp, const struct_kernel_flock64 *fl, const int getlk)
+{
+ tprint_struct_begin();
+ PRINT_FIELD_XVAL(*fl, l_type, lockfcmds, "F_???");
+ tprint_struct_next();
+ PRINT_FIELD_XVAL(*fl, l_whence, whence_codes, "SEEK_???");
+ tprint_struct_next();
+ PRINT_FIELD_D(*fl, l_start);
+ tprint_struct_next();
+ PRINT_FIELD_D(*fl, l_len);
+ if (getlk) {
+ tprint_struct_next();
+ PRINT_FIELD_TGID(*fl, l_pid, tcp);
+ }
+ tprint_struct_end();
+}
+
+static void
+printflock64(struct tcb *const tcp, const kernel_ulong_t addr, const int getlk)
+{
+ struct_kernel_flock64 fl;
+
+ if (fetch_struct_flock64(tcp, addr, &fl))
+ print_struct_flock64(tcp, &fl, getlk);
+}
+
+static void
+printflock(struct tcb *const tcp, const kernel_ulong_t addr, const int getlk)
+{
+ struct_kernel_flock64 fl;
+
+ if (fetch_struct_flock(tcp, addr, &fl))
+ print_struct_flock64(tcp, &fl, getlk);
+}
+
+static void
+print_f_owner_ex(struct tcb *const tcp, const kernel_ulong_t addr)
+{
+ struct { int type, pid; } owner;
+
+ if (umove_or_printaddr(tcp, addr, &owner))
+ return;
+
+ tprint_struct_begin();
+ PRINT_FIELD_XVAL(owner, type, f_owner_types, "F_OWNER_???");
+
+ enum pid_type pid_type = PT_NONE;
+ switch (owner.type)
+ {
+ case F_OWNER_TID:
+ pid_type = PT_TID;
+ break;
+ case F_OWNER_PID:
+ pid_type = PT_TGID;
+ break;
+ case F_OWNER_PGRP:
+ pid_type = PT_PGID;
+ break;
+ }
+ tprint_struct_next();
+ tprints_field_name("pid");
+ printpid(tcp, owner.pid, pid_type);
+ tprint_struct_end();
+}
+
+static int
+print_fcntl(struct tcb *tcp)
+{
+ const unsigned int cmd = tcp->u_arg[1];
+
+ switch (cmd) {
+ case F_SETFD:
+ tprints(", ");
+ printflags(fdflags, tcp->u_arg[2], "FD_???");
+ break;
+ case F_SETOWN:
+ tprints(", ");
+ printpid_tgid_pgid(tcp, tcp->u_arg[2]);
+ break;
+ case F_SETPIPE_SZ:
+ tprintf(", %" PRI_kld, tcp->u_arg[2]);
+ break;
+ case F_DUPFD:
+ case F_DUPFD_CLOEXEC:
+ tprintf(", %" PRI_kld, tcp->u_arg[2]);
+ return RVAL_DECODED | RVAL_FD;
+ case F_SETFL:
+ tprints(", ");
+ tprint_open_modes(tcp->u_arg[2]);
+ break;
+ case F_SETLK:
+ case F_SETLKW:
+ tprints(", ");
+ printflock(tcp, tcp->u_arg[2], 0);
+ break;
+ case F_OFD_SETLK:
+ case F_OFD_SETLKW:
+ tprints(", ");
+ printflock64(tcp, tcp->u_arg[2], 0);
+ break;
+ case F_SETOWN_EX:
+ tprints(", ");
+ print_f_owner_ex(tcp, tcp->u_arg[2]);
+ break;
+ case F_NOTIFY:
+ tprints(", ");
+ printflags64(notifyflags, tcp->u_arg[2], "DN_???");
+ break;
+ case F_SETLEASE:
+ tprints(", ");
+ printxval64(lockfcmds, tcp->u_arg[2], "F_???");
+ break;
+ case F_ADD_SEALS:
+ tprints(", ");
+ printflags64(f_seals, tcp->u_arg[2], "F_SEAL_???");
+ break;
+ case F_SETSIG:
+ tprints(", ");
+ printsignal(tcp->u_arg[2]);
+ break;
+ case F_GETOWN:
+ return RVAL_DECODED |
+ ((int) tcp->u_rval < 0 ? RVAL_PGID : RVAL_TGID);
+ case F_GETPIPE_SZ:
+ break;
+ case F_GETFD:
+ if (entering(tcp) || syserror(tcp) || tcp->u_rval == 0)
+ return 0;
+ tcp->auxstr = sprintflags("flags ", fdflags,
+ (kernel_ulong_t) tcp->u_rval);
+ return RVAL_HEX | RVAL_STR;
+ case F_GETFL:
+ if (entering(tcp) || syserror(tcp))
+ return 0;
+ tcp->auxstr = sprint_open_modes(tcp->u_rval);
+ return RVAL_HEX | RVAL_STR;
+ case F_GETLK:
+ if (entering(tcp))
+ return 0;
+ tprints(", ");
+ printflock(tcp, tcp->u_arg[2], 1);
+ break;
+ case F_OFD_GETLK:
+ if (entering(tcp))
+ return 0;
+ tprints(", ");
+ printflock64(tcp, tcp->u_arg[2], 1);
+ break;
+ case F_GETOWN_EX:
+ if (entering(tcp))
+ return 0;
+ tprints(", ");
+ print_f_owner_ex(tcp, tcp->u_arg[2]);
+ break;
+ case F_GETLEASE:
+ if (entering(tcp) || syserror(tcp))
+ return 0;
+ tcp->auxstr = xlookup(lockfcmds, (kernel_ulong_t) tcp->u_rval);
+ return RVAL_HEX | RVAL_STR;
+ case F_GET_SEALS:
+ if (entering(tcp) || syserror(tcp) || tcp->u_rval == 0)
+ return 0;
+ tcp->auxstr = sprintflags("seals ", f_seals,
+ (kernel_ulong_t) tcp->u_rval);
+ return RVAL_HEX | RVAL_STR;
+ case F_GETSIG:
+ if (entering(tcp) || syserror(tcp) || tcp->u_rval == 0)
+ return 0;
+ tcp->auxstr = signame(tcp->u_rval);
+ return RVAL_STR;
+ default:
+ tprintf(", %#" PRI_klx, tcp->u_arg[2]);
+ break;
+ }
+ return RVAL_DECODED;
+}
+
+SYS_FUNC(fcntl)
+{
+ if (entering(tcp)) {
+ printfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ printxval(fcntlcmds, tcp->u_arg[1], "F_???");
+ }
+ return print_fcntl(tcp);
+}
+
+SYS_FUNC(fcntl64)
+{
+ const unsigned int cmd = tcp->u_arg[1];
+ if (entering(tcp)) {
+ printfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ printxval(fcntlcmds, cmd, "F_???");
+ }
+ switch (cmd) {
+ case F_SETLK64:
+ case F_SETLKW64:
+ tprints(", ");
+ printflock64(tcp, tcp->u_arg[2], 0);
+ return RVAL_DECODED;
+ case F_GETLK64:
+ if (exiting(tcp)) {
+ tprints(", ");
+ printflock64(tcp, tcp->u_arg[2], 1);
+ }
+ return 0;
+ }
+ return print_fcntl(tcp);
+}
diff --git a/src/fetch_bpf_fprog.c b/src/fetch_bpf_fprog.c
new file mode 100644
index 000000000..4fb7812f7
--- /dev/null
+++ b/src/fetch_bpf_fprog.c
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2015-2018 Dmitry V. Levin <ldv@strace.io>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#include DEF_MPERS_TYPE(struct_sock_fprog)
+
+#include <linux/filter.h>
+typedef struct sock_fprog struct_sock_fprog;
+
+#include MPERS_DEFS
+#include "bpf_fprog.h"
+
+MPERS_PRINTER_DECL(unsigned int, get_sock_fprog_size, void)
+{
+ return sizeof(struct_sock_fprog);
+}
+
+MPERS_PRINTER_DECL(bool, fetch_bpf_fprog, struct tcb *const tcp,
+ const kernel_ulong_t addr, void *const p)
+{
+ struct bpf_fprog *pfp = p;
+ struct_sock_fprog mfp;
+
+ if ((sizeof(*pfp) == sizeof(mfp))
+ && (offsetof(struct bpf_fprog, filter) ==
+ offsetof(struct_sock_fprog, filter)))
+ return !umove_or_printaddr(tcp, addr, pfp);
+
+ if (umove_or_printaddr(tcp, addr, &mfp))
+ return false;
+
+ pfp->len = mfp.len;
+ pfp->filter =
+#ifndef IN_MPERS
+ (uintptr_t)
+#endif
+ mfp.filter;
+ return true;
+}
diff --git a/src/fetch_indirect_syscall_args.c b/src/fetch_indirect_syscall_args.c
new file mode 100644
index 000000000..10d0c8474
--- /dev/null
+++ b/src/fetch_indirect_syscall_args.c
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+/*
+ * Fetch indirect syscall arguments that are provided as an array.
+ * Return a pointer to a static array of kernel_ulong_t elements,
+ * or NULL in case of fetch failure.
+ */
+kernel_ulong_t *
+fetch_indirect_syscall_args(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int n_args)
+{
+ static kernel_ulong_t u_arg[MAX_ARGS];
+
+ if (current_wordsize == sizeof(*u_arg)) {
+ if (umoven(tcp, addr, sizeof(*u_arg) * n_args, u_arg))
+ return NULL;
+ } else {
+ uint32_t narrow_arg[ARRAY_SIZE(u_arg)];
+
+ if (umoven(tcp, addr, sizeof(*narrow_arg) * n_args, narrow_arg))
+ return NULL;
+ for (unsigned int i = 0; i < n_args; ++i)
+ u_arg[i] = narrow_arg[i];
+ }
+
+ return u_arg;
+}
diff --git a/src/fetch_struct_flock.c b/src/fetch_struct_flock.c
new file mode 100644
index 000000000..7262a9756
--- /dev/null
+++ b/src/fetch_struct_flock.c
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2015 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#include DEF_MPERS_TYPE(struct_flock)
+#include DEF_MPERS_TYPE(struct_flock64)
+
+#include "flock.h"
+typedef struct_kernel_flock struct_flock;
+typedef struct_kernel_flock64 struct_flock64;
+
+#include MPERS_DEFS
+
+#define SIZEOF_MEMBER(type, member) \
+ sizeof(((type *) NULL)->member)
+
+#define FLOCK_MEMBERS_EQ(type, member) \
+ (SIZEOF_MEMBER(struct_kernel_flock64, member) == SIZEOF_MEMBER(type, member) \
+ && offsetof(struct_kernel_flock64, member) == offsetof(type, member))
+
+#define FLOCK_STRUCTS_EQ(type) \
+ (sizeof(struct_kernel_flock64) == sizeof(type) \
+ && FLOCK_MEMBERS_EQ(type, l_type) \
+ && FLOCK_MEMBERS_EQ(type, l_whence) \
+ && FLOCK_MEMBERS_EQ(type, l_start) \
+ && FLOCK_MEMBERS_EQ(type, l_len) \
+ && FLOCK_MEMBERS_EQ(type, l_pid))
+
+MPERS_PRINTER_DECL(bool, fetch_struct_flock, struct tcb *const tcp,
+ const kernel_ulong_t addr, void *const p)
+{
+ struct_kernel_flock64 *pfl = p;
+ struct_flock mfl;
+
+ if (FLOCK_STRUCTS_EQ(struct_flock))
+ return !umove_or_printaddr(tcp, addr, pfl);
+
+ if (umove_or_printaddr(tcp, addr, &mfl))
+ return false;
+
+ pfl->l_type = mfl.l_type;
+ pfl->l_whence = mfl.l_whence;
+ pfl->l_start = mfl.l_start;
+ pfl->l_len = mfl.l_len;
+ pfl->l_pid = mfl.l_pid;
+ return true;
+}
+
+MPERS_PRINTER_DECL(bool, fetch_struct_flock64, struct tcb *const tcp,
+ const kernel_ulong_t addr, void *const p)
+{
+ struct_kernel_flock64 *pfl = p;
+ struct_flock64 mfl;
+
+ if (FLOCK_STRUCTS_EQ(struct_flock64))
+ return !umove_or_printaddr(tcp, addr, pfl);
+
+ if (umove_or_printaddr(tcp, addr, &mfl))
+ return false;
+
+ pfl->l_type = mfl.l_type;
+ pfl->l_whence = mfl.l_whence;
+ pfl->l_start = mfl.l_start;
+ pfl->l_len = mfl.l_len;
+ pfl->l_pid = mfl.l_pid;
+ return true;
+}
diff --git a/src/fetch_struct_keyctl_kdf_params.c b/src/fetch_struct_keyctl_kdf_params.c
new file mode 100644
index 000000000..63eadb2e7
--- /dev/null
+++ b/src/fetch_struct_keyctl_kdf_params.c
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2016-2018 Eugene Syromyatnikov <evgsyr@gmail.com>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#include DEF_MPERS_TYPE(struct_keyctl_kdf_params)
+
+#include "keyctl_kdf_params.h"
+typedef struct keyctl_kdf_params struct_keyctl_kdf_params;
+
+#include MPERS_DEFS
+
+MPERS_PRINTER_DECL(int, fetch_keyctl_kdf_params, struct tcb *const tcp,
+ kernel_ulong_t addr, struct strace_keyctl_kdf_params *p)
+{
+ struct_keyctl_kdf_params kdf;
+ int ret;
+
+ if ((ret = umove(tcp, addr, &kdf)))
+ return ret;
+
+ p->hashname = (kernel_ulong_t)
+#ifndef IN_MPERS
+ (uintptr_t)
+#endif
+ kdf.hashname;
+ p->otherinfo = (kernel_ulong_t)
+#ifndef IN_MPERS
+ (uintptr_t)
+#endif
+ kdf.otherinfo;
+ p->otherinfolen = kdf.otherinfolen;
+
+ memcpy(p->__spare, kdf.__spare, sizeof(kdf.__spare));
+
+ return 0;
+}
diff --git a/src/fetch_struct_mmsghdr.c b/src/fetch_struct_mmsghdr.c
new file mode 100644
index 000000000..9d2c8bf83
--- /dev/null
+++ b/src/fetch_struct_mmsghdr.c
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2016-2018 Dmitry V. Levin <ldv@strace.io>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#include DEF_MPERS_TYPE(struct_mmsghdr)
+
+#include "msghdr.h"
+typedef struct mmsghdr struct_mmsghdr;
+
+#include MPERS_DEFS
+
+/*
+ * On success, return the number of fetched bytes.
+ * On error, return 0;
+ *
+ * This function cannot use umove_or_printaddr because
+ * it is called by dumpio and therefore cannot print anything.
+ */
+
+MPERS_PRINTER_DECL(int, fetch_struct_mmsghdr,
+ struct tcb *const tcp, const kernel_ulong_t addr,
+ void *const p)
+{
+ struct mmsghdr *p_native = p;
+ struct_mmsghdr v_compat;
+
+ if (sizeof(*p_native) == sizeof(v_compat))
+ return umove(tcp, addr, p_native) ? 0 : sizeof(*p_native);
+
+ if (umove(tcp, addr, &v_compat))
+ return 0;
+
+ p_native->msg_hdr.msg_name = (void *) (unsigned long)
+ v_compat.msg_hdr.msg_name;
+
+ p_native->msg_hdr.msg_namelen =
+ v_compat.msg_hdr.msg_namelen;
+
+ p_native->msg_hdr.msg_iov = (void *) (unsigned long)
+ v_compat.msg_hdr.msg_iov;
+
+ p_native->msg_hdr.msg_iovlen =
+ v_compat.msg_hdr.msg_iovlen;
+
+ p_native->msg_hdr.msg_control = (void *) (unsigned long)
+ v_compat.msg_hdr.msg_control;
+
+ p_native->msg_hdr.msg_controllen =
+ v_compat.msg_hdr.msg_controllen;
+
+ p_native->msg_hdr.msg_flags =
+ v_compat.msg_hdr.msg_flags;
+
+ p_native->msg_len =
+ v_compat.msg_len;
+
+ return sizeof(v_compat);
+}
+
+MPERS_PRINTER_DECL(unsigned int, sizeof_struct_mmsghdr, void)
+{
+ return sizeof(struct_mmsghdr);
+}
diff --git a/src/fetch_struct_msghdr.c b/src/fetch_struct_msghdr.c
new file mode 100644
index 000000000..220dcce0a
--- /dev/null
+++ b/src/fetch_struct_msghdr.c
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2016-2018 Dmitry V. Levin <ldv@strace.io>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#include DEF_MPERS_TYPE(struct_msghdr)
+
+#include "msghdr.h"
+typedef struct msghdr struct_msghdr;
+
+#include MPERS_DEFS
+
+/*
+ * On success, return the number of fetched bytes.
+ * On error, return 0;
+ *
+ * This function cannot use umove_or_printaddr because
+ * it is called by dumpio and therefore cannot print anything.
+ */
+
+MPERS_PRINTER_DECL(int, fetch_struct_msghdr,
+ struct tcb *const tcp, const kernel_ulong_t addr,
+ void *const p)
+{
+ struct msghdr *const p_native = p;
+ struct_msghdr v_compat;
+
+ if (sizeof(*p_native) == sizeof(v_compat))
+ return umove(tcp, addr, p_native) ? 0 : sizeof(*p_native);
+
+ if (umove(tcp, addr, &v_compat))
+ return 0;
+
+ p_native->msg_name = (void *) (unsigned long)
+ v_compat.msg_name;
+
+ p_native->msg_namelen =
+ v_compat.msg_namelen;
+
+ p_native->msg_iov = (void *) (unsigned long)
+ v_compat.msg_iov;
+
+ p_native->msg_iovlen =
+ v_compat.msg_iovlen;
+
+ p_native->msg_control = (void *) (unsigned long)
+ v_compat.msg_control;
+
+ p_native->msg_controllen =
+ v_compat.msg_controllen;
+
+ p_native->msg_flags =
+ v_compat.msg_flags;
+
+ return sizeof(v_compat);
+}
diff --git a/src/fetch_struct_stat.c b/src/fetch_struct_stat.c
new file mode 100644
index 000000000..60eb3608c
--- /dev/null
+++ b/src/fetch_struct_stat.c
@@ -0,0 +1,86 @@
+/*
+ * Copyright (c) 2014-2016 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2016-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#include DEF_MPERS_TYPE(struct_stat)
+
+#include "asm_stat.h"
+
+#if defined MPERS_IS_m32
+# undef HAVE_STRUCT_STAT
+# undef HAVE_STRUCT_STAT_ST_MTIME_NSEC
+# ifdef HAVE_M32_STRUCT_STAT
+# define HAVE_STRUCT_STAT 1
+# ifdef HAVE_M32_STRUCT_STAT_ST_MTIME_NSEC
+# define HAVE_STRUCT_STAT_ST_MTIME_NSEC 1
+# endif /* HAVE_M32_STRUCT_STAT_ST_MTIME_NSEC */
+# endif /* HAVE_M32_STRUCT_STAT */
+#elif defined MPERS_IS_mx32
+# undef HAVE_STRUCT_STAT
+# undef HAVE_STRUCT_STAT_ST_MTIME_NSEC
+# ifdef HAVE_MX32_STRUCT_STAT
+# define HAVE_STRUCT_STAT 1
+# ifdef HAVE_MX32_STRUCT_STAT_ST_MTIME_NSEC
+# define HAVE_STRUCT_STAT_ST_MTIME_NSEC 1
+# endif /* HAVE_MX32_STRUCT_STAT_ST_MTIME_NSEC */
+# endif /* HAVE_MX32_STRUCT_STAT */
+#else /* !MPERS_IS_m32 && !MPERS_IS_mx32 */
+# define HAVE_STRUCT_STAT 1
+#endif
+
+#ifndef HAVE_STRUCT_STAT
+struct stat {};
+#endif
+
+typedef struct stat struct_stat;
+
+#include MPERS_DEFS
+
+#include "stat.h"
+
+#ifdef HAVE_STRUCT_STAT_ST_MTIME_NSEC
+# define TIME_NSEC(arg) zero_extend_signed_to_ull(arg)
+# define HAVE_NSEC true
+#else
+# define TIME_NSEC(arg) 0
+# define HAVE_NSEC false
+#endif
+
+MPERS_PRINTER_DECL(bool, fetch_struct_stat,
+ struct tcb *const tcp, const kernel_ulong_t addr,
+ struct strace_stat *const dst)
+{
+#ifdef HAVE_STRUCT_STAT
+ struct_stat buf;
+ if (umove_or_printaddr(tcp, addr, &buf))
+ return false;
+
+ dst->dev = zero_extend_signed_to_ull(buf.st_dev);
+ dst->ino = zero_extend_signed_to_ull(buf.st_ino);
+ dst->rdev = zero_extend_signed_to_ull(buf.st_rdev);
+ dst->size = zero_extend_signed_to_ull(buf.st_size);
+ dst->blocks = zero_extend_signed_to_ull(buf.st_blocks);
+ dst->blksize = zero_extend_signed_to_ull(buf.st_blksize);
+ dst->mode = zero_extend_signed_to_ull(buf.st_mode);
+ dst->nlink = zero_extend_signed_to_ull(buf.st_nlink);
+ dst->uid = zero_extend_signed_to_ull(buf.st_uid);
+ dst->gid = zero_extend_signed_to_ull(buf.st_gid);
+ dst->atime = sign_extend_unsigned_to_ll(buf.st_atime);
+ dst->ctime = sign_extend_unsigned_to_ll(buf.st_ctime);
+ dst->mtime = sign_extend_unsigned_to_ll(buf.st_mtime);
+ dst->atime_nsec = TIME_NSEC(buf.st_atime_nsec);
+ dst->ctime_nsec = TIME_NSEC(buf.st_ctime_nsec);
+ dst->mtime_nsec = TIME_NSEC(buf.st_mtime_nsec);
+ dst->has_nsec = HAVE_NSEC;
+ return true;
+#else /* !HAVE_STRUCT_STAT */
+ printaddr(addr);
+ return false;
+#endif
+}
diff --git a/src/fetch_struct_stat64.c b/src/fetch_struct_stat64.c
new file mode 100644
index 000000000..bec5306fe
--- /dev/null
+++ b/src/fetch_struct_stat64.c
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2014-2016 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2016-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#include DEF_MPERS_TYPE(struct_stat64)
+
+#include "asm_stat.h"
+
+#if defined MPERS_IS_m32
+# undef HAVE_STRUCT_STAT64
+# undef HAVE_STRUCT_STAT64_ST_MTIME_NSEC
+# ifdef HAVE_M32_STRUCT_STAT64
+# define HAVE_STRUCT_STAT64 1
+# ifdef HAVE_M32_STRUCT_STAT64_ST_MTIME_NSEC
+# define HAVE_STRUCT_STAT64_ST_MTIME_NSEC 1
+# endif /* HAVE_M32_STRUCT_STAT64_ST_MTIME_NSEC */
+# endif /* HAVE_M32_STRUCT_STAT64 */
+#elif defined MPERS_IS_mx32
+# undef HAVE_STRUCT_STAT64
+# undef HAVE_STRUCT_STAT64_ST_MTIME_NSEC
+# ifdef HAVE_MX32_STRUCT_STAT64
+# define HAVE_STRUCT_STAT64 1
+# ifdef HAVE_MX32_STRUCT_STAT64_ST_MTIME_NSEC
+# define HAVE_STRUCT_STAT64_ST_MTIME_NSEC 1
+# endif /* HAVE_MX32_STRUCT_STAT64_ST_MTIME_NSEC */
+# endif /* HAVE_MX32_STRUCT_STAT64 */
+#endif /* MPERS_IS_m32 || MPERS_IS_mx32 */
+
+#ifndef HAVE_STRUCT_STAT64
+struct stat64 {};
+#endif
+
+typedef struct stat64 struct_stat64;
+
+#include MPERS_DEFS
+
+#include "stat.h"
+
+#ifdef HAVE_STRUCT_STAT64_ST_MTIME_NSEC
+# define TIME_NSEC(arg) zero_extend_signed_to_ull(arg)
+# define HAVE_NSEC true
+#else
+# define TIME_NSEC(arg) 0
+# define HAVE_NSEC false
+#endif
+
+MPERS_PRINTER_DECL(bool, fetch_struct_stat64,
+ struct tcb *const tcp, const kernel_ulong_t addr,
+ struct strace_stat *const dst)
+{
+#ifdef HAVE_STRUCT_STAT64
+ struct_stat64 buf;
+ if (umove_or_printaddr(tcp, addr, &buf))
+ return false;
+
+ dst->dev = zero_extend_signed_to_ull(buf.st_dev);
+ dst->ino = zero_extend_signed_to_ull(buf.st_ino);
+ dst->rdev = zero_extend_signed_to_ull(buf.st_rdev);
+ dst->size = zero_extend_signed_to_ull(buf.st_size);
+ dst->blocks = zero_extend_signed_to_ull(buf.st_blocks);
+ dst->blksize = zero_extend_signed_to_ull(buf.st_blksize);
+ dst->mode = zero_extend_signed_to_ull(buf.st_mode);
+ dst->nlink = zero_extend_signed_to_ull(buf.st_nlink);
+ dst->uid = zero_extend_signed_to_ull(buf.st_uid);
+ dst->gid = zero_extend_signed_to_ull(buf.st_gid);
+ dst->atime = sign_extend_unsigned_to_ll(buf.st_atime);
+ dst->ctime = sign_extend_unsigned_to_ll(buf.st_ctime);
+ dst->mtime = sign_extend_unsigned_to_ll(buf.st_mtime);
+ dst->atime_nsec = TIME_NSEC(buf.st_atime_nsec);
+ dst->ctime_nsec = TIME_NSEC(buf.st_ctime_nsec);
+ dst->mtime_nsec = TIME_NSEC(buf.st_mtime_nsec);
+ dst->has_nsec = HAVE_NSEC;
+ return true;
+#else /* !HAVE_STRUCT_STAT64 */
+ printaddr(addr);
+ return false;
+#endif
+}
diff --git a/src/fetch_struct_statfs.c b/src/fetch_struct_statfs.c
new file mode 100644
index 000000000..cdb86798c
--- /dev/null
+++ b/src/fetch_struct_statfs.c
@@ -0,0 +1,103 @@
+/*
+ * Copyright (c) 2014-2016 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2016-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#include DEF_MPERS_TYPE(struct_statfs)
+#include DEF_MPERS_TYPE(struct_statfs64)
+
+#include <linux/types.h>
+#include <asm/statfs.h>
+typedef struct statfs struct_statfs;
+typedef struct statfs64 struct_statfs64;
+
+#include MPERS_DEFS
+
+#include "statfs.h"
+
+MPERS_PRINTER_DECL(bool, fetch_struct_statfs,
+ struct tcb *const tcp, const kernel_ulong_t addr,
+ struct strace_statfs *const p)
+{
+ struct_statfs b;
+
+ if (umove_or_printaddr(tcp, addr, &b))
+ return false;
+
+ p->f_type = zero_extend_signed_to_ull(b.f_type);
+ p->f_bsize = zero_extend_signed_to_ull(b.f_bsize);
+ p->f_blocks = zero_extend_signed_to_ull(b.f_blocks);
+ p->f_bfree = zero_extend_signed_to_ull(b.f_bfree);
+ p->f_bavail = zero_extend_signed_to_ull(b.f_bavail);
+ p->f_files = zero_extend_signed_to_ull(b.f_files);
+ p->f_ffree = zero_extend_signed_to_ull(b.f_ffree);
+#if defined HAVE_STRUCT_STATFS_F_FSID_VAL
+ p->f_fsid.val[0] = zero_extend_signed_to_ull(b.f_fsid.val[0]);
+ p->f_fsid.val[1] = zero_extend_signed_to_ull(b.f_fsid.val[1]);
+#elif defined HAVE_STRUCT_STATFS_F_FSID___VAL
+ p->f_fsid.val[0] = zero_extend_signed_to_ull(b.f_fsid.__val[0]);
+ p->f_fsid.val[1] = zero_extend_signed_to_ull(b.f_fsid.__val[1]);
+#endif
+ p->f_namelen = zero_extend_signed_to_ull(b.f_namelen);
+#ifdef HAVE_STRUCT_STATFS_F_FRSIZE
+ p->f_frsize = zero_extend_signed_to_ull(b.f_frsize);
+#endif
+#ifdef HAVE_STRUCT_STATFS_F_FLAGS
+ p->f_flags = zero_extend_signed_to_ull(b.f_flags);
+#endif
+
+ return true;
+}
+
+#if defined ARM || (defined AARCH64 && defined IN_MPERS)
+/* See arch/arm/kernel/sys_oabi-compat.c for details. */
+# define COMPAT_STATFS64_PADDED_SIZE (sizeof(struct_statfs64) + 4)
+#endif
+
+MPERS_PRINTER_DECL(bool, fetch_struct_statfs64,
+ struct tcb *const tcp, const kernel_ulong_t addr,
+ const kernel_ulong_t size, struct strace_statfs *const p)
+{
+ struct_statfs64 b;
+
+ if (sizeof(b) != size
+#ifdef COMPAT_STATFS64_PADDED_SIZE
+ && sizeof(b) != COMPAT_STATFS64_PADDED_SIZE
+#endif
+ ) {
+ printaddr(addr);
+ return false;
+ }
+
+ if (umove_or_printaddr(tcp, addr, &b))
+ return false;
+
+ p->f_type = zero_extend_signed_to_ull(b.f_type);
+ p->f_bsize = zero_extend_signed_to_ull(b.f_bsize);
+ p->f_blocks = zero_extend_signed_to_ull(b.f_blocks);
+ p->f_bfree = zero_extend_signed_to_ull(b.f_bfree);
+ p->f_bavail = zero_extend_signed_to_ull(b.f_bavail);
+ p->f_files = zero_extend_signed_to_ull(b.f_files);
+ p->f_ffree = zero_extend_signed_to_ull(b.f_ffree);
+#if defined HAVE_STRUCT_STATFS64_F_FSID_VAL
+ p->f_fsid.val[0] = zero_extend_signed_to_ull(b.f_fsid.val[0]);
+ p->f_fsid.val[1] = zero_extend_signed_to_ull(b.f_fsid.val[1]);
+#elif defined HAVE_STRUCT_STATFS64_F_FSID___VAL
+ p->f_fsid.val[0] = zero_extend_signed_to_ull(b.f_fsid.__val[0]);
+ p->f_fsid.val[1] = zero_extend_signed_to_ull(b.f_fsid.__val[1]);
+#endif
+ p->f_namelen = zero_extend_signed_to_ull(b.f_namelen);
+#ifdef HAVE_STRUCT_STATFS64_F_FRSIZE
+ p->f_frsize = zero_extend_signed_to_ull(b.f_frsize);
+#endif
+#ifdef HAVE_STRUCT_STATFS64_F_FLAGS
+ p->f_flags = zero_extend_signed_to_ull(b.f_flags);
+#endif
+
+ return true;
+}
diff --git a/src/fetch_struct_xfs_quotastat.c b/src/fetch_struct_xfs_quotastat.c
new file mode 100644
index 000000000..d78767588
--- /dev/null
+++ b/src/fetch_struct_xfs_quotastat.c
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#include DEF_MPERS_TYPE(struct_xfs_dqstats)
+
+#include "xfs_quota_stat.h"
+typedef struct xfs_dqstats struct_xfs_dqstats;
+
+#include MPERS_DEFS
+
+MPERS_PRINTER_DECL(bool, fetch_struct_quotastat, struct tcb *const tcp,
+ const kernel_ulong_t data, void *p)
+{
+ struct xfs_dqstats *dq = p;
+ struct_xfs_dqstats dqstat;
+
+ if (umove_or_printaddr(tcp, data, &dqstat))
+ return false;
+
+ dq->qs_version = dqstat.qs_version;
+ dq->qs_flags = dqstat.qs_flags;
+ dq->qs_pad = dqstat.qs_pad;
+ dq->qs_uquota.qfs_ino = dqstat.qs_uquota.qfs_ino;
+ dq->qs_uquota.qfs_nblks = dqstat.qs_uquota.qfs_nblks;
+ dq->qs_uquota.qfs_nextents = dqstat.qs_uquota.qfs_nextents;
+ dq->qs_gquota.qfs_ino = dqstat.qs_gquota.qfs_ino;
+ dq->qs_gquota.qfs_nblks = dqstat.qs_gquota.qfs_nblks;
+ dq->qs_gquota.qfs_nextents = dqstat.qs_gquota.qfs_nextents;
+ dq->qs_incoredqs = dqstat.qs_incoredqs;
+ dq->qs_btimelimit = dqstat.qs_btimelimit;
+ dq->qs_itimelimit = dqstat.qs_itimelimit;
+ dq->qs_rtbtimelimit = dqstat.qs_rtbtimelimit;
+ dq->qs_bwarnlimit = dqstat.qs_bwarnlimit;
+ dq->qs_iwarnlimit = dqstat.qs_iwarnlimit;
+ return true;
+}
diff --git a/src/file_handle.c b/src/file_handle.c
new file mode 100644
index 000000000..cd92f9993
--- /dev/null
+++ b/src/file_handle.c
@@ -0,0 +1,131 @@
+/*
+ * Copyright (c) 2015 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2015-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#include "xlat/name_to_handle_at_flags.h"
+
+#ifndef MAX_HANDLE_SZ
+# define MAX_HANDLE_SZ 128
+#endif
+
+typedef struct {
+ unsigned int handle_bytes;
+ int handle_type;
+} file_handle_header;
+
+SYS_FUNC(name_to_handle_at)
+{
+ file_handle_header h;
+ const kernel_ulong_t addr = tcp->u_arg[2];
+
+ if (entering(tcp)) {
+ /* dirfd */
+ print_dirfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+
+ /* pathname */
+ printpath(tcp, tcp->u_arg[1]);
+ tprints(", ");
+
+ /* handle */
+ if (umove_or_printaddr(tcp, addr, &h)) {
+ tprints(", ");
+
+ /* mount_id */
+ printaddr(tcp->u_arg[3]);
+ tprints(", ");
+
+ /* flags */
+ printflags(name_to_handle_at_flags, tcp->u_arg[4],
+ "AT_???");
+
+ return RVAL_DECODED;
+ }
+ tprint_struct_begin();
+ PRINT_FIELD_U(h, handle_bytes);
+
+ set_tcb_priv_ulong(tcp, h.handle_bytes);
+
+ return 0;
+ } else {
+ unsigned int i = get_tcb_priv_ulong(tcp);
+
+ if ((!syserror(tcp) || EOVERFLOW == tcp->u_error)
+ && !umove(tcp, addr, &h)) {
+ unsigned char f_handle[MAX_HANDLE_SZ];
+
+ if (i != h.handle_bytes) {
+ tprint_value_changed();
+ tprintf("%u", h.handle_bytes);
+ }
+ if (!syserror(tcp)) {
+ tprint_struct_next();
+ PRINT_FIELD_D(h, handle_type);
+ if (h.handle_bytes > MAX_HANDLE_SZ)
+ h.handle_bytes = MAX_HANDLE_SZ;
+ if (!umoven(tcp, addr + sizeof(h), h.handle_bytes,
+ f_handle)) {
+ tprint_struct_next();
+ tprints_field_name("f_handle");
+ tprints("0x");
+ for (i = 0; i < h.handle_bytes; ++i)
+ tprintf("%02x", f_handle[i]);
+ }
+ }
+ }
+ tprint_struct_end();
+ tprints(", ");
+
+ /* mount_id */
+ printnum_int(tcp, tcp->u_arg[3], "%d");
+ tprints(", ");
+
+ /* flags */
+ printflags(name_to_handle_at_flags, tcp->u_arg[4], "AT_???");
+ }
+ return 0;
+}
+
+SYS_FUNC(open_by_handle_at)
+{
+ file_handle_header h;
+ const kernel_ulong_t addr = tcp->u_arg[1];
+
+ /* mount_fd */
+ printfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+
+ /* handle */
+ if (!umove_or_printaddr(tcp, addr, &h)) {
+ unsigned char f_handle[MAX_HANDLE_SZ];
+
+ tprint_struct_begin();
+ PRINT_FIELD_U(h, handle_bytes);
+ tprint_struct_next();
+ PRINT_FIELD_D(h, handle_type);
+ if (h.handle_bytes > MAX_HANDLE_SZ)
+ h.handle_bytes = MAX_HANDLE_SZ;
+ if (!umoven(tcp, addr + sizeof(h), h.handle_bytes, &f_handle)) {
+ unsigned int i;
+
+ tprint_struct_next();
+ tprints_field_name("f_handle");
+ tprints("0x");
+ for (i = 0; i < h.handle_bytes; ++i)
+ tprintf("%02x", f_handle[i]);
+ }
+ tprint_struct_end();
+ }
+ tprints(", ");
+
+ /* flags */
+ tprint_open_modes(tcp->u_arg[2]);
+
+ return RVAL_DECODED;
+}
diff --git a/src/filter.h b/src/filter.h
new file mode 100644
index 000000000..54b0a72bf
--- /dev/null
+++ b/src/filter.h
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2017 Nikolay Marchuk <marchuk.nikolay.a@gmail.com>
+ * Copyright (c) 2017-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_FILTER_H
+# define STRACE_FILTER_H
+
+struct number_set;
+typedef int (*string_to_uint_func)(const char *);
+
+void qualify_tokens(const char *str, struct number_set *set,
+ string_to_uint_func func, const char *name);
+void qualify_syscall_tokens(const char *str, struct number_set *set);
+
+#endif /* !STRACE_FILTER_H */
diff --git a/src/filter_qualify.c b/src/filter_qualify.c
new file mode 100644
index 000000000..5f931f6ea
--- /dev/null
+++ b/src/filter_qualify.c
@@ -0,0 +1,591 @@
+/*
+ * Copyright (c) 2016 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2016-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include "nsig.h"
+#include "number_set.h"
+#include "filter.h"
+#include "delay.h"
+#include "retval.h"
+#include "static_assert.h"
+
+struct number_set *read_set;
+struct number_set *write_set;
+struct number_set *signal_set;
+struct number_set *status_set;
+struct number_set *quiet_set;
+struct number_set *decode_fd_set;
+struct number_set *trace_set;
+
+bool quiet_set_updated = false;
+bool decode_fd_set_updated = false;
+
+static struct number_set *abbrev_set;
+static struct number_set *inject_set;
+static struct number_set *raw_set;
+static struct number_set *verbose_set;
+
+/* Only syscall numbers are personality-specific so far. */
+struct inject_personality_data {
+ uint16_t scno;
+};
+
+static int
+sigstr_to_uint(const char *s)
+{
+ if (*s >= '0' && *s <= '9')
+ return string_to_uint_upto(s, 255);
+
+ if (strncasecmp(s, "SIG", 3) == 0)
+ s += 3;
+
+ for (int i = 1; i <= 255; ++i) {
+ const char *name = signame(i);
+
+ if (!name)
+ continue;
+
+ if (strncasecmp(name, "SIG", 3) != 0)
+ continue;
+
+ name += 3;
+
+ if (strcasecmp(name, s) != 0)
+ continue;
+
+ return i;
+ }
+
+ return -1;
+}
+
+static int
+statusstr_to_uint(const char *str)
+{
+ static const struct xlat_data statuses[] = {
+ { STATUS_SUCCESSFUL, "successful" },
+ { STATUS_FAILED, "failed" },
+ { STATUS_UNFINISHED, "unfinished" },
+ { STATUS_UNAVAILABLE, "unavailable" },
+ { STATUS_DETACHED, "detached" },
+ };
+
+ return (int) find_arg_val(str, statuses, -1ULL, -1ULL);
+}
+
+static int
+quietstr_to_uint(const char *str)
+{
+ static const struct xlat_data quiet_strs[] = {
+ { QUIET_ATTACH, "attach" },
+ { QUIET_EXIT, "exit" },
+ { QUIET_EXIT, "exits" },
+ { QUIET_PATH_RESOLVE, "path-resolution" },
+ { QUIET_PERSONALITY, "personality" },
+ { QUIET_THREAD_EXECVE, "superseded" },
+ { QUIET_THREAD_EXECVE, "thread-execve" },
+ };
+
+ return (int) find_arg_val(str, quiet_strs, -1ULL, -1ULL);
+}
+
+static int
+decode_fd_str_to_uint(const char *str)
+{
+ static const struct xlat_data decode_fd_strs[] = {
+ { DECODE_FD_PATH, "path" },
+ { DECODE_FD_SOCKET, "socket" },
+ { DECODE_FD_DEV, "dev" },
+ { DECODE_FD_PIDFD, "pidfd" },
+ };
+
+ return (int) find_arg_val(str, decode_fd_strs, -1ULL, -1ULL);
+}
+
+static int
+find_errno_by_name(const char *name)
+{
+ for (unsigned int i = 1; i < nerrnos; ++i) {
+ if (errnoent[i] && (strcasecmp(name, errnoent[i]) == 0))
+ return i;
+ }
+
+ return -1;
+}
+
+static bool
+parse_delay_token(const char *input, struct inject_opts *fopts, bool isenter)
+{
+ unsigned flag = isenter ? INJECT_F_DELAY_ENTER : INJECT_F_DELAY_EXIT;
+
+ if (fopts->data.flags & flag) /* duplicate */
+ return false;
+ struct timespec tsval;
+
+ if (parse_ts(input, &tsval) < 0) /* couldn't parse */
+ return false;
+
+ if (fopts->data.delay_idx == (uint16_t) -1)
+ fopts->data.delay_idx = alloc_delay_data();
+ /* populate .ts_enter or .ts_exit */
+ fill_delay_data(fopts->data.delay_idx, &tsval, isenter);
+ fopts->data.flags |= flag;
+
+ return true;
+}
+
+static bool
+parse_inject_token(const char *const token, struct inject_opts *const fopts,
+ struct inject_personality_data *const pdata,
+ const bool fault_tokens_only)
+{
+ const char *val;
+ int intval;
+
+ if ((val = STR_STRIP_PREFIX(token, "when=")) != token) {
+ /*
+ * == 1..INF+1
+ * F == F..INF+0
+ * F+ == F..INF+1
+ * F+S == F..INF+S
+ * F..L == F..L+1
+ * F..L+S
+ */
+ char *end;
+ intval = string_to_uint_ex(val, &end, 0xffff, "+.");
+ if (intval < 1)
+ return false;
+
+ fopts->first = intval;
+
+ if (end[0] == '.') {
+ if (end[1] != '.')
+ return false;
+ /*
+ * F..L
+ * F..L+S
+ */
+ val = end + 2;
+ intval = string_to_uint_ex(val, &end, 0xffff, "+");
+ if (intval < fopts->first || intval == INJECT_LAST_INF)
+ return false;
+ fopts->last = intval;
+ } else {
+ /*
+ * F == F..INF+0
+ * F+ == F..INF+1
+ * F+S == F..INF+S
+ */
+ fopts->last = INJECT_LAST_INF;
+ }
+
+ if (end[0] != '\0') {
+ val = end + 1;
+ if (val[0] != '\0') {
+ /*
+ * F+S == F..INF+S
+ * F..L+S
+ */
+ intval = string_to_uint_upto(val, 0xffff);
+ if (intval < 1)
+ return false;
+ fopts->step = intval;
+ } else {
+ /*
+ * F+ == F..INF+1
+ * F..L+ == F..L+1
+ */
+ fopts->step = 1;
+ }
+ } else {
+ if (fopts->last == INJECT_LAST_INF) {
+ /* F == F..INF+0 */
+ fopts->step = 0;
+ } else {
+ /* F..L == F..L+1 */
+ fopts->step = 1;
+ }
+ }
+ } else if ((val = STR_STRIP_PREFIX(token, "syscall=")) != token) {
+ if (fopts->data.flags & INJECT_F_SYSCALL)
+ return false;
+
+ for (unsigned int p = 0; p < SUPPORTED_PERSONALITIES; ++p) {
+ kernel_long_t scno = scno_by_name(val, p, 0);
+
+ if (scno < 0)
+ return false;
+
+ /*
+ * We want to inject only pure system calls with no side
+ * effects.
+ */
+ if (!(sysent_vec[p][scno].sys_flags & TRACE_PURE))
+ return false;
+
+ pdata[p].scno = scno;
+ }
+
+ fopts->data.flags |= INJECT_F_SYSCALL;
+ } else if ((val = STR_STRIP_PREFIX(token, "error=")) != token) {
+ if (fopts->data.flags & (INJECT_F_ERROR | INJECT_F_RETVAL))
+ return false;
+ intval = string_to_uint_upto(val, MAX_ERRNO_VALUE);
+ if (intval < 0)
+ intval = find_errno_by_name(val);
+ if (intval < 1)
+ return false;
+ fopts->data.rval_idx = retval_new(intval);
+ fopts->data.flags |= INJECT_F_ERROR;
+ } else if (!fault_tokens_only
+ && (val = STR_STRIP_PREFIX(token, "retval=")) != token) {
+
+ if (fopts->data.flags & (INJECT_F_ERROR | INJECT_F_RETVAL))
+ return false;
+
+ errno = 0;
+ char *endp;
+ unsigned long long ullval = strtoull(val, &endp, 0);
+ if (endp == val || *endp || (kernel_ulong_t) ullval != ullval
+ || ((ullval == 0 || ullval == ULLONG_MAX) && errno))
+ return false;
+
+#if ANY_WORDSIZE_LESS_THAN_KERNEL_LONG
+ bool inadvertent_fault_injection = false;
+#endif
+
+#if !HAVE_ARCH_DEDICATED_ERR_REG
+ if ((kernel_long_t) ullval < 0
+ && (kernel_long_t) ullval >= -MAX_ERRNO_VALUE) {
+# if ANY_WORDSIZE_LESS_THAN_KERNEL_LONG
+ inadvertent_fault_injection = true;
+# endif
+ error_msg("Inadvertent injection of error %" PRI_kld
+ " is possible for retval=%llu",
+ -(kernel_long_t) ullval, ullval);
+ }
+# if ANY_WORDSIZE_LESS_THAN_KERNEL_LONG
+ else if ((int) ullval < 0 && (int) ullval >= -MAX_ERRNO_VALUE) {
+ inadvertent_fault_injection = true;
+ error_msg("Inadvertent injection of error %d is"
+ " possible in compat personality for"
+ " retval=%llu",
+ -(int) ullval, ullval);
+ }
+# endif
+#endif
+
+#if ANY_WORDSIZE_LESS_THAN_KERNEL_LONG
+ if (!inadvertent_fault_injection
+ && (unsigned int) ullval != ullval) {
+ error_msg("Injected return value %llu will be"
+ " clipped to %u in compat personality",
+ ullval, (unsigned int) ullval);
+ }
+#endif
+
+ fopts->data.rval_idx = retval_new(ullval);
+ fopts->data.flags |= INJECT_F_RETVAL;
+ } else if (!fault_tokens_only
+ && (val = STR_STRIP_PREFIX(token, "signal=")) != token) {
+ if (fopts->data.flags & INJECT_F_SIGNAL)
+ return false;
+ intval = sigstr_to_uint(val);
+ if (intval < 1 || intval > NSIG_BYTES * 8)
+ return false;
+ fopts->data.signo = intval;
+ fopts->data.flags |= INJECT_F_SIGNAL;
+ } else if (!fault_tokens_only
+ && (val = STR_STRIP_PREFIX(token, "delay_enter=")) != token) {
+ if (!parse_delay_token(val, fopts, true))
+ return false;
+ } else if (!fault_tokens_only
+ && (val = STR_STRIP_PREFIX(token, "delay_exit=")) != token) {
+ if (!parse_delay_token(val, fopts, false))
+ return false;
+ } else {
+ return false;
+ }
+
+ return true;
+}
+
+static const char *
+parse_inject_expression(char *const str,
+ struct inject_opts *const fopts,
+ struct inject_personality_data *const pdata,
+ const bool fault_tokens_only)
+{
+ if (str[0] == '\0' || str[0] == ':')
+ return "";
+
+ char *saveptr = NULL;
+ const char *name = strtok_r(str, ":", &saveptr);
+
+ char *token;
+ while ((token = strtok_r(NULL, ":", &saveptr))) {
+ if (!parse_inject_token(token, fopts, pdata, fault_tokens_only))
+ return NULL;
+ }
+
+ return name;
+}
+
+void
+qualify_read(const char *const str)
+{
+ if (!read_set)
+ read_set = alloc_number_set_array(1);
+ qualify_tokens(str, read_set, string_to_uint, "descriptor");
+}
+
+void
+qualify_write(const char *const str)
+{
+ if (!write_set)
+ write_set = alloc_number_set_array(1);
+ qualify_tokens(str, write_set, string_to_uint, "descriptor");
+}
+
+void
+qualify_signals(const char *const str)
+{
+ if (!signal_set)
+ signal_set = alloc_number_set_array(1);
+ qualify_tokens(str, signal_set, sigstr_to_uint, "signal");
+}
+
+void
+qualify_status(const char *const str)
+{
+ if (!status_set)
+ status_set = alloc_number_set_array(1);
+ qualify_tokens(str, status_set, statusstr_to_uint, "status");
+}
+
+void
+qualify_quiet(const char *const str)
+{
+ if (!quiet_set)
+ quiet_set = alloc_number_set_array(1);
+ else
+ quiet_set_updated = true;
+ qualify_tokens(str, quiet_set, quietstr_to_uint, "quiet");
+}
+
+void
+qualify_decode_fd(const char *const str)
+{
+ if (!decode_fd_set)
+ decode_fd_set = alloc_number_set_array(1);
+ else
+ decode_fd_set_updated = true;
+ qualify_tokens(str, decode_fd_set, decode_fd_str_to_uint,
+ "decode-fds");
+}
+
+void
+qualify_trace(const char *const str)
+{
+ if (!trace_set)
+ trace_set = alloc_number_set_array(SUPPORTED_PERSONALITIES);
+ qualify_syscall_tokens(str, trace_set);
+}
+
+void
+qualify_abbrev(const char *const str)
+{
+ if (!abbrev_set)
+ abbrev_set = alloc_number_set_array(SUPPORTED_PERSONALITIES);
+ qualify_syscall_tokens(str, abbrev_set);
+}
+
+void
+qualify_verbose(const char *const str)
+{
+ if (!verbose_set)
+ verbose_set = alloc_number_set_array(SUPPORTED_PERSONALITIES);
+ qualify_syscall_tokens(str, verbose_set);
+}
+
+void
+qualify_raw(const char *const str)
+{
+ if (!raw_set)
+ raw_set = alloc_number_set_array(SUPPORTED_PERSONALITIES);
+ qualify_syscall_tokens(str, raw_set);
+}
+
+static void
+qualify_inject_common(const char *const str,
+ const bool fault_tokens_only,
+ const char *const description)
+{
+ struct inject_opts opts = {
+ .first = 1,
+ .last = INJECT_LAST_INF,
+ .step = 1,
+ .data = {
+ .delay_idx = -1
+ }
+ };
+ struct inject_personality_data pdata[SUPPORTED_PERSONALITIES] = { { 0 } };
+ char *copy = xstrdup(str);
+ const char *name =
+ parse_inject_expression(copy, &opts, pdata, fault_tokens_only);
+ if (!name)
+ error_msg_and_die("invalid %s '%s'", description, str);
+
+ struct number_set *tmp_set =
+ alloc_number_set_array(SUPPORTED_PERSONALITIES);
+ qualify_syscall_tokens(name, tmp_set);
+
+ free(copy);
+
+ /* If neither of retval, error, signal or delay is specified, then ... */
+ if (!(opts.data.flags & INJECT_ACTION_FLAGS)) {
+ if (fault_tokens_only) {
+ /* in fault= syntax the default error code is ENOSYS. */
+ opts.data.rval_idx = retval_new(ENOSYS);
+ opts.data.flags |= INJECT_F_ERROR;
+ } else {
+ /* in inject= syntax this is not allowed. */
+ error_msg_and_die("invalid %s '%s'", description, str);
+ }
+ }
+
+ /*
+ * Initialize inject_vec according to tmp_set.
+ * Merge tmp_set into inject_set.
+ */
+ for (unsigned int p = 0; p < SUPPORTED_PERSONALITIES; ++p) {
+ if (number_set_array_is_empty(tmp_set, p))
+ continue;
+
+ if (!inject_set) {
+ inject_set =
+ alloc_number_set_array(SUPPORTED_PERSONALITIES);
+ }
+ if (!inject_vec[p]) {
+ inject_vec[p] = xcalloc(nsyscall_vec[p],
+ sizeof(*inject_vec[p]));
+ }
+
+ for (unsigned int i = 0; i < nsyscall_vec[p]; ++i) {
+ if (is_number_in_set_array(i, tmp_set, p)) {
+ add_number_to_set_array(i, inject_set, p);
+ inject_vec[p][i] = opts;
+
+ /* Copy per-personality data. */
+ inject_vec[p][i].data.scno =
+ pdata[p].scno;
+ }
+ }
+ }
+
+ free_number_set_array(tmp_set, SUPPORTED_PERSONALITIES);
+}
+
+void
+qualify_fault(const char *const str)
+{
+ qualify_inject_common(str, true, "fault argument");
+}
+
+void
+qualify_inject(const char *const str)
+{
+ qualify_inject_common(str, false, "inject argument");
+}
+
+void
+qualify_kvm(const char *const str)
+{
+ if (strcmp(str, "vcpu") == 0) {
+#ifdef HAVE_LINUX_KVM_H
+ if (os_release >= KERNEL_VERSION(4, 16, 0))
+ kvm_run_structure_decoder_init();
+ else
+ error_msg("-e kvm=vcpu option needs"
+ " Linux 4.16.0 or higher");
+#else
+ error_msg("-e kvm=vcpu option is not implemented"
+ " for this architecture");
+#endif
+ } else {
+ error_msg_and_die("invalid -e kvm= argument: '%s'", str);
+ }
+}
+
+static const struct qual_options {
+ const char *name;
+ void (*qualify)(const char *);
+} qual_options[] = {
+ { "trace", qualify_trace },
+ { "t", qualify_trace },
+ { "abbrev", qualify_abbrev },
+ { "a", qualify_abbrev },
+ { "verbose", qualify_verbose },
+ { "v", qualify_verbose },
+ { "raw", qualify_raw },
+ { "x", qualify_raw },
+ { "signal", qualify_signals },
+ { "signals", qualify_signals },
+ { "status", qualify_status },
+ { "s", qualify_signals },
+ { "quiet", qualify_quiet },
+ { "silent", qualify_quiet },
+ { "silence", qualify_quiet },
+ { "q", qualify_quiet },
+ { "read", qualify_read },
+ { "reads", qualify_read },
+ { "r", qualify_read },
+ { "write", qualify_write },
+ { "writes", qualify_write },
+ { "w", qualify_write },
+ { "fault", qualify_fault },
+ { "inject", qualify_inject },
+ { "kvm", qualify_kvm },
+ { "decode-fd", qualify_decode_fd },
+ { "decode-fds", qualify_decode_fd },
+};
+
+void
+qualify(const char *str)
+{
+ const struct qual_options *opt = qual_options;
+
+ for (unsigned int i = 0; i < ARRAY_SIZE(qual_options); ++i) {
+ const char *name = qual_options[i].name;
+ const size_t len = strlen(name);
+ const char *val = str_strip_prefix_len(str, name, len);
+
+ if (val == str || *val != '=')
+ continue;
+ str = val + 1;
+ opt = &qual_options[i];
+ break;
+ }
+
+ opt->qualify(str);
+}
+
+unsigned int
+qual_flags(const unsigned int scno)
+{
+ return (is_number_in_set_array(scno, trace_set, current_personality)
+ ? QUAL_TRACE : 0)
+ | (is_number_in_set_array(scno, abbrev_set, current_personality)
+ ? QUAL_ABBREV : 0)
+ | (is_number_in_set_array(scno, verbose_set, current_personality)
+ ? QUAL_VERBOSE : 0)
+ | (is_number_in_set_array(scno, raw_set, current_personality)
+ ? QUAL_RAW : 0)
+ | (is_number_in_set_array(scno, inject_set, current_personality)
+ ? QUAL_INJECT : 0);
+}
diff --git a/src/filter_seccomp.c b/src/filter_seccomp.c
new file mode 100644
index 000000000..adb9f230b
--- /dev/null
+++ b/src/filter_seccomp.c
@@ -0,0 +1,762 @@
+/*
+ * Copyright (c) 2018 Chen Jingpiao <chenjingpiao@gmail.com>
+ * Copyright (c) 2019 Paul Chaignon <paul.chaignon@gmail.com>
+ * Copyright (c) 2018-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#include "ptrace.h"
+#include <signal.h>
+#include <sys/prctl.h>
+#include <sys/wait.h>
+#include <linux/filter.h>
+
+#include "filter_seccomp.h"
+#include "number_set.h"
+#include "syscall.h"
+#include "scno.h"
+
+bool seccomp_filtering;
+bool seccomp_before_sysentry;
+
+#ifdef HAVE_LINUX_SECCOMP_H
+
+# include <linux/seccomp.h>
+
+#else
+
+# define XLAT_MACROS_ONLY
+# include "xlat/prctl_options.h"
+# include "xlat/seccomp_mode.h"
+# include "xlat/seccomp_ret_action.h"
+# undef XLAT_MACROS_ONLY
+
+struct seccomp_data {
+ int nr;
+ uint32_t arch;
+ uint64_t instruction_pointer;
+ uint64_t args[6];
+};
+
+#endif /* !HAVE_LINUX_SECCOMP_H */
+
+/* PERSONALITY*_AUDIT_ARCH definitions depend on AUDIT_ARCH_* constants. */
+#ifdef PERSONALITY0_AUDIT_ARCH
+# include <linux/audit.h>
+# define XLAT_MACROS_ONLY
+# include "xlat/elf_em.h"
+# include "xlat/audit_arch.h"
+# undef XLAT_MACROS_ONLY
+#endif
+
+#ifndef BPF_MAXINSNS
+# define BPF_MAXINSNS 4096
+#endif
+
+#define JMP_PLACEHOLDER_NEXT ((unsigned char) -1)
+#define JMP_PLACEHOLDER_TRACE ((unsigned char) -2)
+#define JMP_PLACEHOLDER_ALLOW ((unsigned char) -3)
+
+#define SET_BPF(filter, code, jt, jf, k) \
+ (*(filter) = (struct sock_filter) { code, jt, jf, k })
+
+#define SET_BPF_STMT(filter, code, k) \
+ SET_BPF(filter, code, 0, 0, k)
+
+#define SET_BPF_JUMP(filter, code, k, jt, jf) \
+ SET_BPF(filter, BPF_JMP | code, jt, jf, k)
+
+struct audit_arch_t {
+ unsigned int arch;
+ unsigned int flag;
+};
+
+static const struct audit_arch_t audit_arch_vec[SUPPORTED_PERSONALITIES] = {
+#if SUPPORTED_PERSONALITIES > 1
+ PERSONALITY0_AUDIT_ARCH,
+ PERSONALITY1_AUDIT_ARCH,
+# if SUPPORTED_PERSONALITIES > 2
+ PERSONALITY2_AUDIT_ARCH,
+# endif
+#endif
+};
+
+typedef unsigned short (*filter_generator_t)(struct sock_filter *,
+ bool *overflow);
+static unsigned short linear_filter_generator(struct sock_filter *,
+ bool *overflow);
+static unsigned short binary_match_filter_generator(struct sock_filter *,
+ bool *overflow);
+static filter_generator_t filter_generators[] = {
+ linear_filter_generator,
+ binary_match_filter_generator,
+};
+
+/*
+ * Keep some margin in seccomp_filter as programs larger than allowed may
+ * be constructed before we discard them.
+ */
+static struct sock_filter
+filters[ARRAY_SIZE(filter_generators)][2 * BPF_MAXINSNS];
+static struct sock_fprog bpf_prog = {
+ .len = USHRT_MAX,
+ .filter = NULL,
+};
+
+#ifdef HAVE_FORK
+
+static void ATTRIBUTE_NORETURN
+check_seccomp_order_do_child(void)
+{
+ static const struct sock_filter filter[] = {
+ /* return (nr == __NR_gettid) ? RET_TRACE : RET_ALLOW; */
+ BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
+ offsetof(struct seccomp_data, nr)),
+ BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, __NR_gettid, 0, 1),
+ BPF_STMT(BPF_RET | BPF_K, SECCOMP_RET_TRACE),
+ BPF_STMT(BPF_RET | BPF_K, SECCOMP_RET_ALLOW)
+ };
+ static const struct sock_fprog prog = {
+ .len = ARRAY_SIZE(filter),
+ .filter = (struct sock_filter *) filter
+ };
+
+ /* Get everything ready before PTRACE_TRACEME. */
+ if (prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0) < 0)
+ perror_func_msg_and_die("prctl(PR_SET_NO_NEW_PRIVS, 1");
+ if (prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, &prog) < 0)
+ perror_func_msg_and_die("prctl(PR_SET_SECCOMP)");
+ int pid = getpid();
+
+ if (ptrace(PTRACE_TRACEME, 0L, 0L, 0L) < 0) {
+ /* Exit with a nonzero exit status. */
+ perror_func_msg_and_die("PTRACE_TRACEME");
+ }
+
+ GCOV_DUMP;
+
+ kill(pid, SIGSTOP);
+ syscall(__NR_gettid);
+ _exit(0);
+}
+
+static int
+check_seccomp_order_tracer(int pid)
+{
+ unsigned int step;
+
+ for (step = 0; ; ++step) {
+ int status;
+
+ for (;;) {
+ long rc = waitpid(pid, &status, 0);
+ if (rc < 0 && errno == EINTR)
+ continue;
+ if (rc == pid)
+ break;
+ /* Cannot happen. */
+ perror_func_msg("#%d: unexpected wait result %ld",
+ step, rc);
+ return pid;
+ }
+
+ if (WIFEXITED(status)) {
+ /* The tracee is no more. */
+ pid = 0;
+
+ int exitstatus = WEXITSTATUS(status);
+ if (step == 5 && exitstatus == 0) {
+ seccomp_filtering = true;
+ } else {
+ error_func_msg("#%d: unexpected exit status %u",
+ step, exitstatus);
+ }
+ break;
+ }
+
+ if (WIFSIGNALED(status)) {
+ /* The tracee is no more. */
+ pid = 0;
+
+ error_func_msg("#%d: unexpected signal %u",
+ step, WTERMSIG(status));
+ break;
+ }
+
+ if (!WIFSTOPPED(status)) {
+ /* Cannot happen. */
+ error_func_msg("#%d: unexpected wait status %#x",
+ step, status);
+ break;
+ }
+
+ unsigned int event = (unsigned int) status >> 16;
+
+ switch (WSTOPSIG(status)) {
+ case SIGSTOP:
+ if (step != 0) {
+ error_func_msg("#%d: unexpected signal stop",
+ step);
+ return pid;
+ }
+ if (ptrace(PTRACE_SETOPTIONS, pid, 0L,
+ PTRACE_O_TRACESYSGOOD|
+ PTRACE_O_TRACESECCOMP) < 0) {
+ perror_func_msg("PTRACE_SETOPTIONS");
+ return pid;
+ }
+ break;
+
+ case SIGTRAP:
+ if (event != PTRACE_EVENT_SECCOMP) {
+ error_func_msg("#%d: unexpected trap %#x",
+ step, event);
+ return pid;
+ }
+
+ switch (step) {
+ case 1: /* Seccomp stop before entering gettid. */
+ seccomp_before_sysentry = true;
+ break;
+ case 2: /* Seccomp stop after entering gettid. */
+ if (!seccomp_before_sysentry)
+ break;
+ ATTRIBUTE_FALLTHROUGH;
+ default:
+ error_func_msg("#%d: unexpected seccomp stop",
+ step);
+ return pid;
+ }
+ break;
+
+ case SIGTRAP | 0x80:
+ switch (step) {
+ case 3: /* Exiting gettid. */
+ case 4: /* Entering exit_group. */
+ break;
+ case 1: /* Entering gettid before seccomp stop. */
+ seccomp_before_sysentry = false;
+ break;
+ case 2: /* Entering gettid after seccomp stop. */
+ if (seccomp_before_sysentry)
+ break;
+ ATTRIBUTE_FALLTHROUGH;
+ default:
+ error_func_msg("#%d: unexpected syscall stop",
+ step);
+ return pid;
+ }
+ break;
+
+ default:
+ error_func_msg("#%d: unexpected stop signal %#x",
+ step, WSTOPSIG(status));
+ return pid;
+ }
+
+ if (ptrace(PTRACE_SYSCALL, pid, 0L, 0L) < 0) {
+ /* Cannot happen. */
+ perror_func_msg("#%d: PTRACE_SYSCALL", step);
+ break;
+ }
+ }
+
+ return pid;
+}
+#endif /* HAVE_FORK */
+
+static void
+check_seccomp_order(void)
+{
+ seccomp_filtering = false;
+
+ /* NOMMU provides no forks necessary for the test. */
+#ifdef HAVE_FORK
+ int pid = fork();
+ if (pid < 0) {
+ perror_func_msg("fork");
+ return;
+ }
+
+ if (pid == 0)
+ check_seccomp_order_do_child();
+
+ pid = check_seccomp_order_tracer(pid);
+ if (pid) {
+ kill(pid, SIGKILL);
+ for (;;) {
+ long rc = waitpid(pid, NULL, 0);
+ if (rc < 0 && errno == EINTR)
+ continue;
+ break;
+ }
+ }
+#endif /* HAVE_FORK */
+}
+
+static bool
+traced_by_seccomp(unsigned int scno, unsigned int p)
+{
+ unsigned int always_trace_flags =
+ TRACE_INDIRECT_SUBCALL | TRACE_SECCOMP_DEFAULT |
+ (stack_trace_enabled ? MEMORY_MAPPING_CHANGE : 0);
+ return sysent_vec[p][scno].sys_flags & always_trace_flags ||
+ is_number_in_set_array(scno, trace_set, p);
+}
+
+static void
+replace_jmp_placeholders(unsigned char *jmp_offset, unsigned char jmp_next,
+ unsigned char jmp_trace, unsigned char jmp_allow)
+{
+ switch (*jmp_offset) {
+ case JMP_PLACEHOLDER_NEXT:
+ *jmp_offset = jmp_next;
+ break;
+ case JMP_PLACEHOLDER_TRACE:
+ *jmp_offset = jmp_trace;
+ break;
+ case JMP_PLACEHOLDER_ALLOW:
+ *jmp_offset = jmp_allow;
+ break;
+ default:
+ break;
+ }
+}
+
+static unsigned short
+bpf_syscalls_cmp(struct sock_filter *filter,
+ unsigned int lower, unsigned int upper)
+{
+ if (lower + 1 == upper) {
+ /* if (nr == lower) return RET_TRACE; */
+ SET_BPF_JUMP(filter, BPF_JEQ | BPF_K, lower,
+ JMP_PLACEHOLDER_TRACE, 0);
+ return 1;
+ } else {
+ /* if (nr >= lower && nr < upper) return RET_TRACE; */
+ SET_BPF_JUMP(filter, BPF_JGE | BPF_K, lower, 0, 1);
+ SET_BPF_JUMP(filter + 1, BPF_JGE | BPF_K, upper, 0,
+ JMP_PLACEHOLDER_TRACE);
+ return 2;
+ }
+}
+
+static unsigned short
+linear_filter_generator(struct sock_filter *filter, bool *overflow)
+{
+ /*
+ * Generated program looks like:
+ * if (arch == AUDIT_ARCH_A && nr >= flag) {
+ * if (nr == 59)
+ * return SECCOMP_RET_TRACE;
+ * if (nr >= 321 && nr <= 323)
+ * return SECCOMP_RET_TRACE;
+ * ...
+ * return SECCOMP_RET_ALLOW;
+ * }
+ * if (arch == AUDIT_ARCH_A) {
+ * ...
+ * }
+ * if (arch == AUDIT_ARCH_B) {
+ * ...
+ * }
+ * return SECCOMP_RET_TRACE;
+ */
+ unsigned short pos = 0;
+
+#if SUPPORTED_PERSONALITIES > 1
+ SET_BPF_STMT(&filter[pos++], BPF_LD | BPF_W | BPF_ABS,
+ offsetof(struct seccomp_data, arch));
+#endif
+
+ /*
+ * Personalities are iterated in reverse-order in the BPF program so
+ * that the x86 case is naturally handled. On x86, the first and third
+ * personalities have the same arch identifier. The third can be
+ * distinguished based on its associated syscall flag, so we check it
+ * first. The only drawback here is that the first personality is more
+ * common, which may make the BPF program slower to match syscalls on
+ * average.
+ */
+ for (int p = SUPPORTED_PERSONALITIES - 1; p >= 0; --p) {
+ unsigned int lower = UINT_MAX;
+ unsigned short start = pos, end;
+
+#if SUPPORTED_PERSONALITIES > 1
+ /* if (arch != audit_arch_vec[p].arch) goto next; */
+ SET_BPF_JUMP(&filter[pos++], BPF_JEQ | BPF_K,
+ audit_arch_vec[p].arch, 0, JMP_PLACEHOLDER_NEXT);
+#endif
+ SET_BPF_STMT(&filter[pos++], BPF_LD | BPF_W | BPF_ABS,
+ offsetof(struct seccomp_data, nr));
+
+#if SUPPORTED_PERSONALITIES > 1
+ if (audit_arch_vec[p].flag) {
+ /* if (nr < audit_arch_vec[p].flag) goto next; */
+ SET_BPF_JUMP(&filter[pos++], BPF_JGE | BPF_K,
+ audit_arch_vec[p].flag, 2, 0);
+ SET_BPF_STMT(&filter[pos++], BPF_LD | BPF_W | BPF_ABS,
+ offsetof(struct seccomp_data, arch));
+ SET_BPF_JUMP(&filter[pos++], BPF_JA,
+ JMP_PLACEHOLDER_NEXT, 0, 0);
+ }
+#endif
+
+ for (unsigned int i = 0; i < nsyscall_vec[p]; ++i) {
+ if (traced_by_seccomp(i, p)) {
+ if (lower == UINT_MAX)
+ lower = i;
+ continue;
+ }
+ if (lower == UINT_MAX)
+ continue;
+ pos += bpf_syscalls_cmp(filter + pos,
+ lower | audit_arch_vec[p].flag,
+ i | audit_arch_vec[p].flag);
+ lower = UINT_MAX;
+ }
+ if (lower != UINT_MAX)
+ pos += bpf_syscalls_cmp(filter + pos,
+ lower | audit_arch_vec[p].flag,
+ nsyscall_vec[p]
+ | audit_arch_vec[p].flag);
+ end = pos;
+
+ /* if (nr >= max_nr) return RET_TRACE; */
+ SET_BPF_JUMP(&filter[pos++], BPF_JGE | BPF_K,
+ nsyscall_vec[p] | audit_arch_vec[p].flag, 1, 0);
+
+ SET_BPF_STMT(&filter[pos++], BPF_RET | BPF_K,
+ SECCOMP_RET_ALLOW);
+ SET_BPF_STMT(&filter[pos++], BPF_RET | BPF_K,
+ SECCOMP_RET_TRACE);
+
+ /*
+ * Within generated BPF programs, the origin and destination of
+ * jumps are always in the same personality section. The
+ * largest jump is therefore the jump from the first
+ * instruction of the section to the last, to skip the
+ * personality and try to compare .arch to the next
+ * personality.
+ * If we have a personality section with more than 255
+ * instructions, the jump offset will overflow. Such program
+ * is unlikely to happen, so we simply disable seccomp-filter
+ * in such a case.
+ */
+ if (pos - start > UCHAR_MAX) {
+ *overflow = true;
+ return pos;
+ }
+
+ for (unsigned int i = start; i < end; ++i) {
+ if (BPF_CLASS(filter[i].code) != BPF_JMP)
+ continue;
+ unsigned char jmp_next = pos - i - 1;
+ unsigned char jmp_trace = pos - i - 2;
+ unsigned char jmp_allow = pos - i - 3;
+ replace_jmp_placeholders(&filter[i].jt, jmp_next,
+ jmp_trace, jmp_allow);
+ replace_jmp_placeholders(&filter[i].jf, jmp_next,
+ jmp_trace, jmp_allow);
+ if (BPF_OP(filter[i].code) == BPF_JA)
+ filter[i].k = (unsigned int) jmp_next;
+ }
+ }
+
+#if SUPPORTED_PERSONALITIES > 1
+ /* Jumps conditioned on .arch default to this RET_TRACE. */
+ SET_BPF_STMT(&filter[pos++], BPF_RET | BPF_K, SECCOMP_RET_TRACE);
+#endif
+
+ return pos;
+}
+
+static unsigned short
+bpf_syscalls_match(struct sock_filter *filter, unsigned int bitarray,
+ unsigned int bitarray_idx)
+{
+ if (!bitarray) {
+ /* return RET_ALLOW; */
+ SET_BPF_JUMP(filter, BPF_JMP | BPF_JEQ | BPF_K, bitarray_idx,
+ JMP_PLACEHOLDER_ALLOW, 0);
+ return 1;
+ }
+ if (bitarray == UINT_MAX) {
+ /* return RET_TRACE; */
+ SET_BPF_JUMP(filter, BPF_JMP | BPF_JEQ | BPF_K, bitarray_idx,
+ JMP_PLACEHOLDER_TRACE, 0);
+ return 1;
+ }
+ /*
+ * if (A == nr / 32)
+ * return (X & bitarray) ? RET_TRACE : RET_ALLOW;
+ */
+ SET_BPF_JUMP(filter, BPF_JMP | BPF_JEQ | BPF_K, bitarray_idx,
+ 0, 2);
+ SET_BPF_STMT(filter + 1, BPF_MISC | BPF_TXA, 0);
+ SET_BPF_JUMP(filter + 2, BPF_JMP | BPF_JSET | BPF_K, bitarray,
+ JMP_PLACEHOLDER_TRACE, JMP_PLACEHOLDER_ALLOW);
+ return 3;
+}
+
+static unsigned short
+binary_match_filter_generator(struct sock_filter *filter, bool *overflow)
+{
+ unsigned short pos = 0;
+
+#if SUPPORTED_PERSONALITIES > 1
+ SET_BPF_STMT(&filter[pos++], BPF_LD | BPF_W | BPF_ABS,
+ offsetof(struct seccomp_data, arch));
+#endif
+
+ /* Personalities are iterated in reverse-order in the BPF program so that
+ * the x86 case is naturally handled. In x86, the first and third
+ * personalities have the same arch identifier. The third can be
+ * distinguished based on its associated bit mask, so we check it first.
+ * The only drawback here is that the first personality is more common,
+ * which may make the BPF program slower to match syscalls on average. */
+ for (int p = SUPPORTED_PERSONALITIES - 1;
+ p >= 0 && pos <= BPF_MAXINSNS;
+ --p) {
+ unsigned short start = pos, end;
+ unsigned int bitarray = 0;
+ unsigned int i;
+
+#if SUPPORTED_PERSONALITIES > 1
+ SET_BPF_JUMP(&filter[pos++], BPF_JMP | BPF_JEQ | BPF_K,
+ audit_arch_vec[p].arch, 0, JMP_PLACEHOLDER_NEXT);
+#endif
+ SET_BPF_STMT(&filter[pos++], BPF_LD | BPF_W | BPF_ABS,
+ offsetof(struct seccomp_data, nr));
+
+#if SUPPORTED_PERSONALITIES > 1
+ if (audit_arch_vec[p].flag) {
+ SET_BPF_JUMP(&filter[pos++], BPF_JMP | BPF_JGE | BPF_K,
+ audit_arch_vec[p].flag, 2, 0);
+ SET_BPF_STMT(&filter[pos++], BPF_LD | BPF_W | BPF_ABS,
+ offsetof(struct seccomp_data, arch));
+ SET_BPF_JUMP(&filter[pos++], BPF_JMP | BPF_JA,
+ JMP_PLACEHOLDER_NEXT, 0, 0);
+
+ /* nr = nr & ~mask */
+ SET_BPF_STMT(&filter[pos++], BPF_ALU | BPF_AND | BPF_K,
+ ~audit_arch_vec[p].flag);
+ }
+#endif
+
+ /* X = 1 << nr % 32 = 1 << nr & 0x1F; */
+ SET_BPF_STMT(&filter[pos++], BPF_ALU | BPF_AND | BPF_K, 0x1F);
+ SET_BPF_STMT(&filter[pos++], BPF_MISC | BPF_TAX, 0);
+ SET_BPF_STMT(&filter[pos++], BPF_LD | BPF_IMM, 1);
+ SET_BPF_STMT(&filter[pos++], BPF_ALU | BPF_LSH | BPF_X, 0);
+ SET_BPF_STMT(&filter[pos++], BPF_MISC | BPF_TAX, 0);
+
+ /* A = nr / 32 = n >> 5; */
+ SET_BPF_STMT(&filter[pos++], BPF_LD | BPF_W | BPF_ABS,
+ offsetof(struct seccomp_data, nr));
+ if (audit_arch_vec[p].flag) {
+ /* nr = nr & ~mask */
+ SET_BPF_STMT(&filter[pos++], BPF_ALU | BPF_AND | BPF_K,
+ ~audit_arch_vec[p].flag);
+ }
+ SET_BPF_STMT(&filter[pos++], BPF_ALU | BPF_RSH | BPF_K, 5);
+
+ for (i = 0; i < nsyscall_vec[p] && pos <= BPF_MAXINSNS; ++i) {
+ if (traced_by_seccomp(i, p))
+ bitarray |= (1 << i % 32);
+ if (i % 32 == 31) {
+ pos += bpf_syscalls_match(filter + pos,
+ bitarray, i / 32);
+ bitarray = 0;
+ }
+ }
+ if (i % 32 != 0)
+ pos += bpf_syscalls_match(filter + pos, bitarray,
+ i / 32);
+
+ end = pos;
+
+ SET_BPF_STMT(&filter[pos++], BPF_RET | BPF_K,
+ SECCOMP_RET_ALLOW);
+ SET_BPF_STMT(&filter[pos++], BPF_RET | BPF_K,
+ SECCOMP_RET_TRACE);
+
+ if (pos - start > UCHAR_MAX) {
+ *overflow = true;
+ return pos;
+ }
+
+ for (unsigned int i = start; i < end; ++i) {
+ if (BPF_CLASS(filter[i].code) != BPF_JMP)
+ continue;
+ unsigned char jmp_next = pos - i - 1;
+ unsigned char jmp_trace = pos - i - 2;
+ unsigned char jmp_allow = pos - i - 3;
+ replace_jmp_placeholders(&filter[i].jt, jmp_next,
+ jmp_trace, jmp_allow);
+ replace_jmp_placeholders(&filter[i].jf, jmp_next,
+ jmp_trace, jmp_allow);
+ if (BPF_OP(filter[i].code) == BPF_JA)
+ filter[i].k = (unsigned int)jmp_next;
+ }
+ }
+
+#if SUPPORTED_PERSONALITIES > 1
+ SET_BPF_STMT(&filter[pos++], BPF_RET | BPF_K, SECCOMP_RET_TRACE);
+#endif
+
+ return pos;
+}
+
+static void
+check_seccomp_filter_properties(void)
+{
+ int rc = prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, NULL, 0, 0);
+ seccomp_filtering = rc < 0 && errno != EINVAL;
+ if (!seccomp_filtering) {
+ debug_func_perror_msg("prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER)");
+ return;
+ }
+
+ for (unsigned int i = 0; i < ARRAY_SIZE(filter_generators); ++i) {
+ bool overflow = false;
+ unsigned short len = filter_generators[i](filters[i],
+ &overflow);
+ if (len < bpf_prog.len && !overflow) {
+ bpf_prog.len = len;
+ bpf_prog.filter = filters[i];
+ }
+ }
+ if (bpf_prog.len == USHRT_MAX) {
+ debug_msg("seccomp filter disabled due to jump offset "
+ "overflow");
+ seccomp_filtering = false;
+ } else if (bpf_prog.len > BPF_MAXINSNS) {
+ debug_msg("seccomp filter disabled due to BPF program "
+ "being oversized (%u > %d)", bpf_prog.len,
+ BPF_MAXINSNS);
+ seccomp_filtering = false;
+ }
+
+ if (seccomp_filtering)
+ check_seccomp_order();
+}
+
+static void
+dump_seccomp_bpf(void)
+{
+ const struct sock_filter *filter = bpf_prog.filter;
+ for (unsigned int i = 0; i < bpf_prog.len; ++i) {
+ switch (filter[i].code) {
+ case BPF_LD | BPF_W | BPF_ABS:
+ switch (filter[i].k) {
+ case offsetof(struct seccomp_data, arch):
+ error_msg("STMT(BPF_LDWABS, data->arch)");
+ break;
+ case offsetof(struct seccomp_data, nr):
+ error_msg("STMT(BPF_LDWABS, data->nr)");
+ break;
+ default:
+ error_msg("STMT(BPF_LDWABS, 0x%x)",
+ filter[i].k);
+ }
+ break;
+ case BPF_LD + BPF_W + BPF_IMM:
+ error_msg("STMT(BPF_LDWIMM, 0x%x)", filter[i].k);
+ break;
+ case BPF_RET | BPF_K:
+ switch (filter[i].k) {
+ case SECCOMP_RET_TRACE:
+ error_msg("STMT(BPF_RET, SECCOMP_RET_TRACE)");
+ break;
+ case SECCOMP_RET_ALLOW:
+ error_msg("STMT(BPF_RET, SECCOMP_RET_ALLOW)");
+ break;
+ default:
+ error_msg("STMT(BPF_RET, 0x%x)", filter[i].k);
+ }
+ break;
+ case BPF_JMP | BPF_JEQ | BPF_K:
+ error_msg("JUMP(BPF_JEQ, %u, %u, %u)",
+ filter[i].jt, filter[i].jf,
+ filter[i].k);
+ break;
+ case BPF_JMP | BPF_JGE | BPF_K:
+ error_msg("JUMP(BPF_JGE, %u, %u, %u)",
+ filter[i].jt, filter[i].jf,
+ filter[i].k);
+ break;
+ case BPF_JMP + BPF_JSET + BPF_K:
+ error_msg("JUMP(BPF_JSET, %u, %u, 0x%x)",
+ filter[i].jt, filter[i].jf,
+ filter[i].k);
+ break;
+ case BPF_JMP | BPF_JA:
+ error_msg("JUMP(BPF_JA, %u)", filter[i].k);
+ break;
+ case BPF_ALU + BPF_RSH + BPF_K:
+ error_msg("STMT(BPF_RSH, %u)", filter[i].k);
+ break;
+ case BPF_ALU + BPF_LSH + BPF_X:
+ error_msg("STMT(BPF_LSH, X)");
+ break;
+ case BPF_ALU + BPF_AND + BPF_K:
+ error_msg("STMT(BPF_AND, 0x%x)", filter[i].k);
+ break;
+ case BPF_MISC + BPF_TAX:
+ error_msg("STMT(BPF_TAX)");
+ break;
+ case BPF_MISC + BPF_TXA:
+ error_msg("STMT(BPF_TXA)");
+ break;
+ default:
+ error_msg("STMT(0x%x, %u, %u, 0x%x)", filter[i].code,
+ filter[i].jt, filter[i].jf, filter[i].k);
+ }
+ }
+}
+
+void
+init_seccomp_filter(void)
+{
+ if (prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0) < 0)
+ perror_func_msg_and_die("prctl(PR_SET_NO_NEW_PRIVS)");
+
+ if (debug_flag)
+ dump_seccomp_bpf();
+
+ if (prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, &bpf_prog) < 0)
+ perror_func_msg_and_die("prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER)");
+}
+
+int
+seccomp_filter_restart_operator(const struct tcb *tcp)
+{
+ if (exiting(tcp) && tcp->scno < nsyscall_vec[current_personality]
+ && traced_by_seccomp(tcp->scno, current_personality))
+ return PTRACE_SYSCALL;
+ return PTRACE_CONT;
+}
+
+void
+check_seccomp_filter(void)
+{
+ /* Let's avoid enabling seccomp if all syscalls are traced. */
+ seccomp_filtering = !is_complete_set_array(trace_set, nsyscall_vec,
+ SUPPORTED_PERSONALITIES);
+ if (!seccomp_filtering) {
+ error_msg("Seccomp filter is requested "
+ "but there are no syscalls to filter. "
+ "See -e trace to filter syscalls.");
+ return;
+ }
+
+ check_seccomp_filter_properties();
+
+ if (!seccomp_filtering)
+ error_msg("seccomp filter is requested but unavailable");
+}
diff --git a/src/filter_seccomp.h b/src/filter_seccomp.h
new file mode 100644
index 000000000..76539e079
--- /dev/null
+++ b/src/filter_seccomp.h
@@ -0,0 +1,22 @@
+/*
+ * Copyright (c) 2018 Chen Jingpiao <chenjingpiao@gmail.com>
+ * Copyright (c) 2019 Paul Chaignon <paul.chaignon@gmail.com>
+ * Copyright (c) 2018-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_SECCOMP_FILTER_H
+# define STRACE_SECCOMP_FILTER_H
+
+# include "defs.h"
+
+extern bool seccomp_filtering;
+extern bool seccomp_before_sysentry;
+
+extern void check_seccomp_filter(void);
+extern void init_seccomp_filter(void);
+extern int seccomp_filter_restart_operator(const struct tcb *);
+
+#endif /* !STRACE_SECCOMP_FILTER_H */
diff --git a/src/flock.c b/src/flock.c
new file mode 100644
index 000000000..b3f2b3b55
--- /dev/null
+++ b/src/flock.c
@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
+ * Copyright (c) 1999-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include <sys/file.h>
+
+#include "xlat/flockcmds.h"
+
+SYS_FUNC(flock)
+{
+ printfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ printflags(flockcmds, tcp->u_arg[1], "LOCK_???");
+
+ return RVAL_DECODED;
+}
diff --git a/src/flock.h b/src/flock.h
new file mode 100644
index 000000000..12ab1b5cb
--- /dev/null
+++ b/src/flock.h
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2015 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_FLOCK_H
+# define STRACE_FLOCK_H
+
+# include <linux/fcntl.h>
+
+# if defined HAVE_STRUCT_FLOCK
+typedef struct flock struct_kernel_flock;
+# elif defined HAVE_STRUCT___KERNEL_FLOCK
+typedef struct __kernel_flock struct_kernel_flock;
+# else
+# error struct flock definition not found in <linux/fcntl.h>
+# endif
+
+# if defined HAVE_STRUCT_FLOCK64
+typedef struct flock64 struct_kernel_flock64;
+# elif defined HAVE_STRUCT___KERNEL_FLOCK64
+typedef struct __kernel_flock64 struct_kernel_flock64;
+# else
+# error struct flock64 definition not found in <linux/fcntl.h>
+# endif
+
+#endif /* !STRACE_FLOCK_H */
diff --git a/src/fs_0x94_ioctl.c b/src/fs_0x94_ioctl.c
new file mode 100644
index 000000000..e980d1761
--- /dev/null
+++ b/src/fs_0x94_ioctl.c
@@ -0,0 +1,158 @@
+/*
+ * Copyright (c) 2016 Jeff Mahoney <jeffm@suse.com>
+ * Copyright (c) 2016-2021 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include "types/fs_0x94.h"
+#define XLAT_MACROS_ONLY
+# include "xlat/fs_0x94_ioctl_cmds.h"
+#undef XLAT_MACROS_ONLY
+
+static void
+decode_file_clone_range(struct tcb *const tcp, const kernel_ulong_t arg)
+{
+ struct_file_clone_range range;
+
+ tprints(", ");
+ if (!umove_or_printaddr(tcp, arg, &range)) {
+ tprint_struct_begin();
+ PRINT_FIELD_FD(range, src_fd, tcp);
+ tprint_struct_next();
+ PRINT_FIELD_U(range, src_offset);
+ tprint_struct_next();
+ PRINT_FIELD_U(range, src_length);
+ tprint_struct_next();
+ PRINT_FIELD_U(range, dest_offset);
+ tprint_struct_end();
+ }
+}
+
+static bool
+print_file_dedupe_range_info(struct tcb *tcp, void *elem_buf,
+ size_t elem_size, void *data)
+{
+ const struct_file_dedupe_range_info *info = elem_buf;
+ unsigned int *count = data;
+
+ if (count) {
+ if (*count == 0) {
+ tprint_more_data_follows();
+ return false;
+ }
+ --*count;
+ }
+
+ if (entering(tcp)) {
+ tprint_struct_begin();
+ PRINT_FIELD_FD(*info, dest_fd, tcp);
+ tprint_struct_next();
+ PRINT_FIELD_U(*info, dest_offset);
+ } else {
+ tprint_struct_begin();
+ PRINT_FIELD_U(*info, bytes_deduped);
+ tprint_struct_next();
+ PRINT_FIELD_D(*info, status);
+ }
+ tprint_struct_end();
+
+ return true;
+}
+
+static int
+decode_file_dedupe_range(struct tcb *const tcp, const kernel_ulong_t arg)
+{
+ struct_file_dedupe_range range;
+ struct_file_dedupe_range_info info;
+ unsigned int *limit = NULL;
+ unsigned int count = 2;
+ bool rc;
+
+ if (entering(tcp))
+ tprints(", ");
+ else if (syserror(tcp))
+ return RVAL_IOCTL_DECODED;
+ else
+ tprint_value_changed();
+
+ if (umove_or_printaddr(tcp, arg, &range))
+ return RVAL_IOCTL_DECODED;
+
+ tprint_struct_begin();
+
+ if (entering(tcp)) {
+ PRINT_FIELD_U(range, src_offset);
+ tprint_struct_next();
+ PRINT_FIELD_U(range, src_length);
+ tprint_struct_next();
+ PRINT_FIELD_U(range, dest_count);
+ tprints(", ");
+ }
+
+ tprints_field_name("info");
+
+ /* Limit how many elements we print in abbrev mode. */
+ if (abbrev(tcp) && range.dest_count > count)
+ limit = &count;
+
+ rc = print_array(tcp, arg + offsetof(typeof(range), info),
+ range.dest_count, &info, sizeof(info),
+ tfetch_mem,
+ print_file_dedupe_range_info, limit);
+
+ tprint_struct_end();
+
+ if (!rc || exiting(tcp))
+ return RVAL_IOCTL_DECODED;
+
+ return 0;
+}
+
+static void
+decode_fslabel(struct tcb *const tcp, const kernel_ulong_t arg)
+{
+ fs_0x94_label_t label;
+
+ tprints(", ");
+ if (!umove_or_printaddr(tcp, arg, &label))
+ print_quoted_cstring(label, sizeof(label));
+}
+
+int
+fs_0x94_ioctl(struct tcb *const tcp, const unsigned int code,
+ const kernel_ulong_t arg)
+{
+ switch (code) {
+ case FICLONE: /* W */
+ tprintf(", %d", (int) arg);
+ break;
+
+ case FICLONERANGE: /* W */
+ decode_file_clone_range(tcp, arg);
+ break;
+
+ case FIDEDUPERANGE: /* WR */
+ return decode_file_dedupe_range(tcp, arg);
+
+ case FS_IOC_GETFSLABEL: /* R */
+ if (entering(tcp))
+ return 0;
+ ATTRIBUTE_FALLTHROUGH;
+
+ case FS_IOC_SETFSLABEL: /* W */
+ decode_fslabel(tcp, arg);
+ break;
+
+ default:
+#ifdef HAVE_LINUX_BTRFS_H
+ return btrfs_ioctl(tcp, code, arg);
+#else
+ return RVAL_DECODED;
+#endif
+ };
+
+ return RVAL_IOCTL_DECODED;
+}
diff --git a/src/fs_f_ioctl.c b/src/fs_f_ioctl.c
new file mode 100644
index 000000000..d0de799f9
--- /dev/null
+++ b/src/fs_f_ioctl.c
@@ -0,0 +1,128 @@
+/*
+ * Copyright (c) 2016 Jeff Mahoney <jeffm@suse.com>
+ * Copyright (c) 2016-2021 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include <linux/fs.h>
+#include "types/fiemap.h"
+#include "xlat/fiemap_flags.h"
+#include "xlat/fiemap_extent_flags.h"
+#include "xlat/fs_ioc_flags.h"
+#define XLAT_MACROS_ONLY
+# include "xlat/fs_f_ioctl_cmds.h"
+#undef XLAT_MACROS_ONLY
+
+static bool
+print_fiemap_extent(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data)
+{
+ const struct_fiemap_extent *fe = elem_buf;
+
+ tprint_struct_begin();
+ PRINT_FIELD_U(*fe, fe_logical);
+ tprint_struct_next();
+ PRINT_FIELD_U(*fe, fe_physical);
+ tprint_struct_next();
+ PRINT_FIELD_U(*fe, fe_length);
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(*fe, fe_flags, fiemap_extent_flags,
+ "FIEMAP_EXTENT_???");
+ tprint_struct_end();
+
+ return true;
+}
+
+static int
+decode_fiemap(struct tcb *const tcp, const kernel_ulong_t arg)
+{
+ struct_fiemap args;
+
+ if (entering(tcp))
+ tprints(", ");
+ else if (syserror(tcp))
+ return RVAL_IOCTL_DECODED;
+ else
+ tprint_value_changed();
+
+ if (umove_or_printaddr(tcp, arg, &args))
+ return RVAL_IOCTL_DECODED;
+
+ if (entering(tcp)) {
+ tprint_struct_begin();
+ PRINT_FIELD_U(args, fm_start);
+ tprint_struct_next();
+ PRINT_FIELD_U(args, fm_length);
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(args, fm_flags, fiemap_flags,
+ "FIEMAP_FLAG_???");
+ tprint_struct_next();
+ PRINT_FIELD_U(args, fm_extent_count);
+ tprint_struct_end();
+ return 0;
+ }
+
+ tprint_struct_begin();
+ PRINT_FIELD_FLAGS(args, fm_flags, fiemap_flags, "FIEMAP_FLAG_???");
+ tprint_struct_next();
+ PRINT_FIELD_U(args, fm_mapped_extents);
+ if (abbrev(tcp)) {
+ tprint_struct_next();
+ tprint_more_data_follows();
+ } else {
+ struct_fiemap_extent fe;
+ tprint_struct_next();
+ tprints_field_name("fm_extents");
+ print_array(tcp, arg + offsetof(typeof(args), fm_extents),
+ args.fm_mapped_extents, &fe, sizeof(fe),
+ tfetch_mem, print_fiemap_extent, 0);
+ }
+ tprint_struct_end();
+
+ return RVAL_IOCTL_DECODED;
+}
+
+static void
+decode_fs_ioc_flags(struct tcb *const tcp, const kernel_ulong_t arg)
+{
+ unsigned int flags;
+
+ if (!umove_or_printaddr(tcp, arg, &flags)) {
+ tprints("[");
+ printflags(fs_ioc_flags, flags, "FS_???_FL");
+ tprints("]");
+ }
+}
+
+int
+fs_f_ioctl(struct tcb *const tcp, const unsigned int code,
+ const kernel_ulong_t arg)
+{
+ switch (code) {
+ case FS_IOC_FIEMAP:
+ return decode_fiemap(tcp, arg);
+
+ case FS_IOC_GETFLAGS:
+#if SIZEOF_LONG > 4
+ case FS_IOC32_GETFLAGS:
+#endif
+ if (entering(tcp))
+ return 0;
+ ATTRIBUTE_FALLTHROUGH;
+
+ case FS_IOC_SETFLAGS:
+#if SIZEOF_LONG > 4
+ case FS_IOC32_SETFLAGS:
+#endif
+ tprints(", ");
+ decode_fs_ioc_flags(tcp, arg);
+ break;
+
+ default:
+ return RVAL_DECODED;
+ };
+
+ return RVAL_IOCTL_DECODED;
+}
diff --git a/src/fs_x_ioctl.c b/src/fs_x_ioctl.c
new file mode 100644
index 000000000..b7abc409c
--- /dev/null
+++ b/src/fs_x_ioctl.c
@@ -0,0 +1,89 @@
+/*
+ * Copyright (c) 2014 Mike Frysinger <vapier@gentoo.org>
+ * Copyright (c) 2015-2016 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2016-2021 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include "types/fs_x.h"
+#define XLAT_MACROS_ONLY
+# include "xlat/fs_x_ioctl_cmds.h"
+#undef XLAT_MACROS_ONLY
+
+static void
+decode_fstrim_range(struct tcb *const tcp, const kernel_ulong_t arg)
+{
+ struct_fstrim_range range;
+
+ if (!umove_or_printaddr(tcp, arg, &range)) {
+ tprint_struct_begin();
+ PRINT_FIELD_X(range, start);
+ tprint_struct_next();
+ PRINT_FIELD_U(range, len);
+ tprint_struct_next();
+ PRINT_FIELD_U(range, minlen);
+ tprint_struct_end();
+ }
+}
+
+#include "xlat/fs_xflags.h"
+
+static void
+decode_fsxattr(struct tcb *const tcp, const kernel_ulong_t arg,
+ const bool is_get)
+{
+ struct_fsxattr fsxattr;
+
+ if (!umove_or_printaddr(tcp, arg, &fsxattr)) {
+ tprint_struct_begin();
+ PRINT_FIELD_FLAGS(fsxattr, fsx_xflags, fs_xflags, "FS_XFLAG_???");
+ tprint_struct_next();
+ PRINT_FIELD_U(fsxattr, fsx_extsize);
+ if (is_get) {
+ tprint_struct_next();
+ PRINT_FIELD_U(fsxattr, fsx_nextents);
+ }
+ tprint_struct_next();
+ PRINT_FIELD_X(fsxattr, fsx_projid);
+ tprint_struct_next();
+ PRINT_FIELD_U(fsxattr, fsx_cowextsize);
+ tprint_struct_end();
+ }
+}
+
+int
+fs_x_ioctl(struct tcb *const tcp, const unsigned int code,
+ const kernel_ulong_t arg)
+{
+ switch (code) {
+ case FITRIM:
+ tprints(", ");
+ decode_fstrim_range(tcp, arg);
+ break;
+
+ case FS_IOC_FSGETXATTR:
+ if (entering(tcp))
+ return 0;
+ tprints(", ");
+ decode_fsxattr(tcp, arg, true);
+ break;
+
+ case FS_IOC_FSSETXATTR:
+ tprints(", ");
+ decode_fsxattr(tcp, arg, false);
+ break;
+
+ /* No arguments */
+ case FIFREEZE:
+ case FITHAW:
+ break;
+
+ default:
+ return RVAL_DECODED;
+ }
+
+ return RVAL_IOCTL_DECODED;
+}
diff --git a/src/fsconfig.c b/src/fsconfig.c
new file mode 100644
index 000000000..6134155ca
--- /dev/null
+++ b/src/fsconfig.c
@@ -0,0 +1,88 @@
+/*
+ * Copyright (c) 2019 Dmitry V. Levin <ldv@strace.io>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#ifdef HAVE_LINUX_MOUNT_H
+# include <linux/mount.h>
+#endif
+#include "xlat/fsconfig_cmds.h"
+
+SYS_FUNC(fsconfig)
+{
+ const int fs_fd = tcp->u_arg[0];
+ const unsigned int cmd = tcp->u_arg[1];
+ const kernel_ulong_t key = tcp->u_arg[2];
+ const kernel_ulong_t value = tcp->u_arg[3];
+ const int aux = tcp->u_arg[4];
+
+ printfd(tcp, fs_fd);
+ tprints(", ");
+
+ printxval(fsconfig_cmds, cmd, "FSCONFIG_???");
+ tprints(", ");
+
+ switch (cmd) {
+ case FSCONFIG_SET_FLAG:
+ case FSCONFIG_SET_STRING:
+ case FSCONFIG_SET_BINARY:
+ case FSCONFIG_SET_PATH:
+ case FSCONFIG_SET_PATH_EMPTY:
+ case FSCONFIG_SET_FD:
+ printstr_ex(tcp, key, 256, QUOTE_0_TERMINATED);
+ break;
+ case FSCONFIG_CMD_CREATE:
+ case FSCONFIG_CMD_RECONFIGURE:
+ default:
+ printaddr(key);
+ break;
+ }
+ tprints(", ");
+
+ switch (cmd) {
+ case FSCONFIG_SET_STRING:
+ printstr_ex(tcp, value, 256, QUOTE_0_TERMINATED);
+ break;
+ case FSCONFIG_SET_PATH:
+ case FSCONFIG_SET_PATH_EMPTY:
+ printpath(tcp, value);
+ break;
+ case FSCONFIG_SET_BINARY:
+ if (aux >= 0 && aux <= 1024 * 1024) {
+ printstr_ex(tcp, value, aux, QUOTE_FORCE_HEX);
+ break;
+ }
+ ATTRIBUTE_FALLTHROUGH;
+ case FSCONFIG_SET_FLAG:
+ case FSCONFIG_SET_FD:
+ case FSCONFIG_CMD_CREATE:
+ case FSCONFIG_CMD_RECONFIGURE:
+ default:
+ printaddr(value);
+ break;
+ }
+ tprints(", ");
+
+ switch (cmd) {
+ case FSCONFIG_SET_PATH:
+ case FSCONFIG_SET_PATH_EMPTY:
+ print_dirfd(tcp, aux);
+ break;
+ case FSCONFIG_SET_FD:
+ printfd(tcp, aux);
+ break;
+ case FSCONFIG_SET_FLAG:
+ case FSCONFIG_SET_STRING:
+ case FSCONFIG_SET_BINARY:
+ case FSCONFIG_CMD_CREATE:
+ case FSCONFIG_CMD_RECONFIGURE:
+ default:
+ tprintf("%d", aux);
+ break;
+ }
+
+ return RVAL_DECODED;
+}
diff --git a/src/fsmount.c b/src/fsmount.c
new file mode 100644
index 000000000..5922421c2
--- /dev/null
+++ b/src/fsmount.c
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2019 Dmitry V. Levin <ldv@strace.io>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#ifdef HAVE_LINUX_MOUNT_H
+# include <linux/mount.h>
+#endif
+#include "xlat/fsmount_flags.h"
+#include "xlat/mount_attr_flags.h"
+
+SYS_FUNC(fsmount)
+{
+ printfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+
+ printflags(fsmount_flags, tcp->u_arg[1], "FSMOUNT_???");
+ tprints(", ");
+
+ printflags(mount_attr_flags, tcp->u_arg[2], "MOUNT_ATTR_???");
+
+ return RVAL_DECODED | RVAL_FD;
+}
diff --git a/src/fsopen.c b/src/fsopen.c
new file mode 100644
index 000000000..293bbfa52
--- /dev/null
+++ b/src/fsopen.c
@@ -0,0 +1,20 @@
+/*
+ * Copyright (c) 2019 Dmitry V. Levin <ldv@strace.io>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#ifdef HAVE_LINUX_MOUNT_H
+# include <linux/mount.h>
+#endif
+#include "xlat/fsopen_flags.h"
+
+SYS_FUNC(fsopen)
+{
+ printstr(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ printflags(fsopen_flags, tcp->u_arg[1], "FSOPEN_???");
+ return RVAL_DECODED | RVAL_FD;
+}
diff --git a/src/fspick.c b/src/fspick.c
new file mode 100644
index 000000000..1d9b43d70
--- /dev/null
+++ b/src/fspick.c
@@ -0,0 +1,25 @@
+/*
+ * Copyright (c) 2019 Dmitry V. Levin <ldv@strace.io>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#ifdef HAVE_LINUX_MOUNT_H
+# include <linux/mount.h>
+#endif
+#include "xlat/fspick_flags.h"
+
+SYS_FUNC(fspick)
+{
+ print_dirfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+
+ printpath(tcp, tcp->u_arg[1]);
+ tprints(", ");
+
+ printflags(fspick_flags, tcp->u_arg[2], "FSPICK_???");
+
+ return RVAL_DECODED | RVAL_FD;
+}
diff --git a/src/fstatfs.c b/src/fstatfs.c
new file mode 100644
index 000000000..e5029f32c
--- /dev/null
+++ b/src/fstatfs.c
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2016-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+SYS_FUNC(fstatfs)
+{
+ if (entering(tcp)) {
+ printfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ } else {
+ print_struct_statfs(tcp, tcp->u_arg[1]);
+ }
+ return 0;
+}
diff --git a/src/fstatfs64.c b/src/fstatfs64.c
new file mode 100644
index 000000000..0aac13d2c
--- /dev/null
+++ b/src/fstatfs64.c
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2016-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+SYS_FUNC(fstatfs64)
+{
+ if (entering(tcp)) {
+ printfd(tcp, tcp->u_arg[0]);
+ tprintf(", %" PRI_klu ", ", tcp->u_arg[1]);
+ } else {
+ print_struct_statfs64(tcp, tcp->u_arg[2], tcp->u_arg[1]);
+ }
+ return 0;
+}
diff --git a/src/futex.c b/src/futex.c
new file mode 100644
index 000000000..a31d7fc7d
--- /dev/null
+++ b/src/futex.c
@@ -0,0 +1,136 @@
+/*
+ * Copyright (c) 2002-2003 Roland McGrath <roland@redhat.com>
+ * Copyright (c) 2007-2008 Ulrich Drepper <drepper@redhat.com>
+ * Copyright (c) 2009 Andreas Schwab <schwab@redhat.com>
+ * Copyright (c) 2014-2015 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2014-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#ifndef FUTEX_PRIVATE_FLAG
+# define FUTEX_PRIVATE_FLAG 128
+#endif
+#ifndef FUTEX_CLOCK_REALTIME
+# define FUTEX_CLOCK_REALTIME 256
+#endif
+#ifndef FUTEX_OP_OPARG_SHIFT
+# define FUTEX_OP_OPARG_SHIFT 8
+#endif
+
+#include "xlat/futexbitset.h"
+#include "xlat/futexops.h"
+#include "xlat/futexwakeops.h"
+#include "xlat/futexwakecmps.h"
+
+static int
+do_futex(struct tcb *const tcp, const print_obj_by_addr_fn print_ts)
+{
+ const kernel_ulong_t uaddr = tcp->u_arg[0];
+ const int op = tcp->u_arg[1];
+ const int cmd = op & 127;
+ const kernel_ulong_t timeout = tcp->u_arg[3];
+ const kernel_ulong_t uaddr2 = tcp->u_arg[4];
+ const unsigned int val = tcp->u_arg[2];
+ const unsigned int val2 = tcp->u_arg[3];
+ const unsigned int val3 = tcp->u_arg[5];
+ const char *comment;
+
+ printaddr(uaddr);
+ tprints(", ");
+ printxval(futexops, op, "FUTEX_???");
+ switch (cmd) {
+ case FUTEX_WAIT:
+ tprintf(", %u", val);
+ tprints(", ");
+ print_ts(tcp, timeout);
+ break;
+ case FUTEX_LOCK_PI:
+ tprints(", ");
+ print_ts(tcp, timeout);
+ break;
+ case FUTEX_WAIT_BITSET:
+ tprintf(", %u", val);
+ tprints(", ");
+ print_ts(tcp, timeout);
+ tprints(", ");
+ printxval(futexbitset, val3, NULL);
+ break;
+ case FUTEX_WAKE_BITSET:
+ tprintf(", %u", val);
+ tprints(", ");
+ printxval(futexbitset, val3, NULL);
+ break;
+ case FUTEX_REQUEUE:
+ tprintf(", %u", val);
+ tprintf(", %u, ", val2);
+ printaddr(uaddr2);
+ break;
+ case FUTEX_CMP_REQUEUE:
+ case FUTEX_CMP_REQUEUE_PI:
+ tprintf(", %u", val);
+ tprintf(", %u, ", val2);
+ printaddr(uaddr2);
+ tprintf(", %u", val3);
+ break;
+ case FUTEX_WAKE_OP:
+ tprintf(", %u", val);
+ tprintf(", %u, ", val2);
+ printaddr(uaddr2);
+ tprints(", ");
+ if ((val3 >> 28) & FUTEX_OP_OPARG_SHIFT) {
+ print_xlat(FUTEX_OP_OPARG_SHIFT);
+ tprints("<<28|");
+ }
+ comment = printxval(futexwakeops, (val3 >> 28) & 0x7, NULL)
+ ? NULL : "FUTEX_OP_???";
+ tprints("<<28");
+ tprints_comment(comment);
+ tprintf("|%#x<<12|", (val3 >> 12) & 0xfff);
+ comment = printxval(futexwakecmps, (val3 >> 24) & 0xf, NULL)
+ ? NULL : "FUTEX_OP_CMP_???";
+ tprints("<<24");
+ tprints_comment(comment);
+ tprintf("|%#x", val3 & 0xfff);
+ break;
+ case FUTEX_WAIT_REQUEUE_PI:
+ tprintf(", %u", val);
+ tprints(", ");
+ print_ts(tcp, timeout);
+ tprints(", ");
+ printaddr(uaddr2);
+ break;
+ case FUTEX_FD:
+ case FUTEX_WAKE:
+ tprintf(", %u", val);
+ break;
+ case FUTEX_UNLOCK_PI:
+ case FUTEX_TRYLOCK_PI:
+ break;
+ default:
+ tprintf(", %u", val);
+ tprints(", ");
+ printaddr(timeout);
+ tprints(", ");
+ printaddr(uaddr2);
+ tprintf(", %#x", val3);
+ break;
+ }
+
+ return RVAL_DECODED;
+}
+
+#if HAVE_ARCH_TIME32_SYSCALLS
+SYS_FUNC(futex_time32)
+{
+ return do_futex(tcp, print_timespec32);
+}
+#endif
+
+SYS_FUNC(futex_time64)
+{
+ return do_futex(tcp, print_timespec64);
+}
diff --git a/src/gcc_compat.h b/src/gcc_compat.h
new file mode 100644
index 000000000..9ea8bbd56
--- /dev/null
+++ b/src/gcc_compat.h
@@ -0,0 +1,136 @@
+/*
+ * Copyright (c) 2015 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2015-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_GCC_COMPAT_H
+# define STRACE_GCC_COMPAT_H
+
+# if defined __GNUC__ && defined __GNUC_MINOR__
+# define GNUC_PREREQ(maj, min) \
+ ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
+# else
+# define GNUC_PREREQ(maj, min) 0
+# endif
+
+# if defined __clang__ && defined __clang_major__ && defined __clang_minor__
+# define CLANG_PREREQ(maj, min) \
+ ((__clang_major__ << 16) + __clang_minor__ >= ((maj) << 16) + (min))
+# else
+# define CLANG_PREREQ(maj, min) 0
+# endif
+
+# ifdef __GLIBC__
+# ifdef __GLIBC_MINOR__
+# define GLIBC_PREREQ_GE(maj, min) \
+ ((__GLIBC__ << 16) + __GLIBC_MINOR__ >= ((maj) << 16) + (min))
+# define GLIBC_PREREQ_LT(maj, min) \
+ ((__GLIBC__ << 16) + __GLIBC_MINOR__ < ((maj) << 16) + (min))
+# else /* !__GLIBC_MINOR__ */
+# define GLIBC_PREREQ_GE(maj, min) 0
+# define GLIBC_PREREQ_LT(maj, min) 1
+# endif
+# else /* !__GLIBC__ */
+# define GLIBC_PREREQ_GE(maj, min) 0
+# define GLIBC_PREREQ_LT(maj, min) 0
+# endif
+
+# if !(GNUC_PREREQ(2, 0) || CLANG_PREREQ(1, 0))
+# define __attribute__(x) /* empty */
+# endif
+
+# if GNUC_PREREQ(2, 5)
+# define ATTRIBUTE_NORETURN __attribute__((__noreturn__))
+# else
+# define ATTRIBUTE_NORETURN /* empty */
+# endif
+
+# if GNUC_PREREQ(2, 7)
+# define ATTRIBUTE_FORMAT(args) __attribute__((__format__ args))
+# define ATTRIBUTE_ALIGNED(arg) __attribute__((__aligned__(arg)))
+# define ATTRIBUTE_PACKED __attribute__((__packed__))
+# else
+# define ATTRIBUTE_FORMAT(args) /* empty */
+# define ATTRIBUTE_ALIGNED(arg) /* empty */
+# define ATTRIBUTE_PACKED /* empty */
+# endif
+
+# if GNUC_PREREQ(3, 0)
+# define SAME_TYPE(x, y) __builtin_types_compatible_p(typeof(x), typeof(y))
+# define FAIL_BUILD_ON_ZERO(expr) (sizeof(int[-1 + 2 * !!(expr)]) * 0)
+/* &(a)[0] is a pointer and not an array, shouldn't be treated as the same */
+# define MUST_BE_ARRAY(a) FAIL_BUILD_ON_ZERO(!SAME_TYPE((a), &(a)[0]))
+# else
+# define SAME_TYPE(x, y) 0
+# define FAIL_BUILD_ON_ZERO(e) 0
+# define MUST_BE_ARRAY(a) 0
+# endif
+
+# if GNUC_PREREQ(3, 0)
+# define ATTRIBUTE_MALLOC __attribute__((__malloc__))
+# else
+# define ATTRIBUTE_MALLOC /* empty */
+# endif
+
+# if GNUC_PREREQ(3, 1)
+# define ATTRIBUTE_NOINLINE __attribute__((__noinline__))
+# else
+# define ATTRIBUTE_NOINLINE /* empty */
+# endif
+
+# if GNUC_PREREQ(4, 0)
+# define ATTRIBUTE_SENTINEL __attribute__((__sentinel__))
+# else
+# define ATTRIBUTE_SENTINEL /* empty */
+# endif
+
+# if GNUC_PREREQ(4, 1)
+# define ALIGNOF(t_) __alignof__(t_)
+# else
+# define ALIGNOF(t_) (sizeof(struct { char x_; t_ y_; }) - sizeof(t_))
+# endif
+
+# if GNUC_PREREQ(4, 3)
+# define ATTRIBUTE_ALLOC_SIZE(args) __attribute__((__alloc_size__ args))
+# else
+# define ATTRIBUTE_ALLOC_SIZE(args) /* empty */
+# endif
+
+# if GNUC_PREREQ(7, 0)
+# define ATTRIBUTE_FALLTHROUGH __attribute__((__fallthrough__))
+# else
+# define ATTRIBUTE_FALLTHROUGH ((void) 0)
+# endif
+
+# if CLANG_PREREQ(2, 8)
+# define DIAG_PUSH_IGNORE_OVERRIDE_INIT \
+ _Pragma("clang diagnostic push"); \
+ _Pragma("clang diagnostic ignored \"-Winitializer-overrides\"");
+# define DIAG_POP_IGNORE_OVERRIDE_INIT \
+ _Pragma("clang diagnostic pop");
+# elif GNUC_PREREQ(4, 2)
+# define DIAG_PUSH_IGNORE_OVERRIDE_INIT \
+ _Pragma("GCC diagnostic push"); \
+ _Pragma("GCC diagnostic ignored \"-Woverride-init\"");
+# define DIAG_POP_IGNORE_OVERRIDE_INIT \
+ _Pragma("GCC diagnostic pop");
+# else
+# define DIAG_PUSH_IGNORE_OVERRIDE_INIT /* empty */
+# define DIAG_POP_IGNORE_OVERRIDE_INIT /* empty */
+# endif
+
+# if GNUC_PREREQ(6, 0)
+# define DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE \
+ _Pragma("GCC diagnostic push"); \
+ _Pragma("GCC diagnostic ignored \"-Wtautological-compare\"");
+# define DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE \
+ _Pragma("GCC diagnostic pop");
+# else
+# define DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE /* empty */
+# define DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE /* empty */
+# endif
+
+#endif /* !STRACE_GCC_COMPAT_H */
diff --git a/src/gen_bpf_attr_check.sh b/src/gen_bpf_attr_check.sh
new file mode 100755
index 000000000..513d662a4
--- /dev/null
+++ b/src/gen_bpf_attr_check.sh
@@ -0,0 +1,59 @@
+#!/bin/sh -efu
+# Copyright (c) 2018 Dmitry V. Levin <ldv@strace.io>
+# Copyright (c) 2018-2020 The strace developers.
+# All rights reserved.
+#
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[ "x${D:-0}" != x1 ] || set -x
+
+input="$1"
+shift
+
+cat <<EOF
+/* Generated by $0 from $input; do not edit. */
+#include "defs.h"
+#ifdef HAVE_LINUX_BPF_H
+# include <linux/bpf.h>
+# include "bpf_attr.h"
+# include "static_assert.h"
+
+EOF
+
+for struct in $(sed -n 's/^struct \([^[:space:]]\+_struct\) .*/\1/p' < "$input"); do
+ case "$struct" in
+ BPF_*) type_name='union bpf_attr' ;;
+ *) type_name="struct ${struct%_struct}" ;;
+ esac
+ TYPE_NAME="$(printf %s "$type_name" |tr '[:lower:] ' '[:upper:]_')"
+
+ enum="$(sed -n 's/^struct '"$struct"' \/\* \([^[:space:]]\+\) \*\/ {.*/\1/p' < "$input")"
+ ENUM="$(printf %s "$enum" |tr '[:lower:]' '[:upper:]')"
+ enum="$enum${enum:+.}"
+ ENUM="$ENUM${ENUM:+_}"
+ sed -n '/^struct '"$struct"' [^{]*{/,/^};$/p' < "$input" |
+ sed -n 's/^[[:space:]]\+[^][;:]*[[:space:]]\([^][[:space:];:]\+\)\(\[[^;:]*\]\)\?;$/\1/p' |
+ while read field; do
+ FIELD="$(printf %s "$field" |tr '[:lower:]' '[:upper:]')"
+ cat <<EOF
+
+# ifdef HAVE_${TYPE_NAME}_$ENUM$FIELD
+ static_assert(sizeof_field(struct $struct, $field) == sizeof_field($type_name, $enum$field),
+ "$struct.$field size mismatch");
+ static_assert(offsetof(struct $struct, $field) == offsetof($type_name, $enum$field),
+ "$struct.$field offset mismatch");
+# endif /* HAVE_${TYPE_NAME}_$ENUM$FIELD */
+EOF
+ done
+ cat <<EOF
+
+static_assert(${struct}_size == expected_${struct}_size,
+ "${struct}_size mismatch");
+EOF
+
+done
+
+cat <<'EOF'
+
+#endif /* HAVE_LINUX_BPF_H */
+EOF
diff --git a/src/generate_mpers_am.sh b/src/generate_mpers_am.sh
new file mode 100755
index 000000000..5676b65b6
--- /dev/null
+++ b/src/generate_mpers_am.sh
@@ -0,0 +1,22 @@
+#!/bin/sh -e
+#
+# Copyright (c) 2015-2019 The strace developers.
+# All rights reserved.
+#
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[ "x${D:-0}" != x1 ] || set -x
+
+cd "$(dirname "$0")"
+
+list="$(sed -r -n '/^strace_SOURCES[[:space:]]*=/,/^[[:space:]]*# end of strace_SOURCES/ s/^[[:space:]]*([[:alnum:]][^.]*\.c)[[:space:]]*\\$/\1/p' Makefile.am |
+ xargs -r grep -Elx '#[[:space:]]*include[[:space:]]+MPERS_DEFS' |
+ tr '\n' ' ')"
+
+cat > mpers.am <<EOF
+# Generated by $0; do not edit.
+mpers_source_files = $list
+EOF
+
+sed -r -n 's/^#[[:space:]]*include[[:space:]]*"xlat\/([a-z][a-z_0-9]*)\.h".*/extern const struct xlat \1[];/p' \
+ $list > mpers_xlat.h
diff --git a/src/generate_sen.sh b/src/generate_sen.sh
new file mode 100755
index 000000000..fd435c906
--- /dev/null
+++ b/src/generate_sen.sh
@@ -0,0 +1,15 @@
+#!/bin/sh -e
+#
+# Copyright (c) 2015-2019 The strace developers.
+# All rights reserved.
+#
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[ "x${D:-0}" != x1 ] || set -x
+
+echo 'enum {'
+echo 'SEN_printargs = 0,'
+ sed -r -n '/printargs/! s/.*SEN\(([^)]+)\).*/\1/p' |
+ LC_COLLATE=C sort -u |
+ sed 's/.*/SEN_&,/'
+echo '};'
diff --git a/src/get_personality.c b/src/get_personality.c
new file mode 100644
index 000000000..0af9095fc
--- /dev/null
+++ b/src/get_personality.c
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2018 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2018-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#if SUPPORTED_PERSONALITIES > 1
+# include "get_personality.h"
+# include <linux/audit.h>
+# define XLAT_MACROS_ONLY
+# include "xlat/elf_em.h"
+# include "xlat/audit_arch.h"
+# undef XLAT_MACROS_ONLY
+# include "arch_get_personality.c"
+#endif
diff --git a/src/get_personality.h b/src/get_personality.h
new file mode 100644
index 000000000..bb02bd4e2
--- /dev/null
+++ b/src/get_personality.h
@@ -0,0 +1,17 @@
+/*
+ * Copyright (c) 2018 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2018-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_GET_PERSONALITY_H
+# define STRACE_GET_PERSONALITY_H
+
+# include "ptrace.h"
+
+extern int
+get_personality_from_syscall_info(const struct_ptrace_syscall_info *);
+
+#endif /* !STRACE_GET_PERSONALITY_H */
diff --git a/src/get_robust_list.c b/src/get_robust_list.c
new file mode 100644
index 000000000..111aab424
--- /dev/null
+++ b/src/get_robust_list.c
@@ -0,0 +1,22 @@
+/*
+ * Copyright (c) 2012-2018 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2014-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+SYS_FUNC(get_robust_list)
+{
+ if (entering(tcp)) {
+ printpid(tcp, tcp->u_arg[0], PT_TID);
+ tprints(", ");
+ } else {
+ printnum_ptr(tcp, tcp->u_arg[1]);
+ tprints(", ");
+ printnum_ulong(tcp, tcp->u_arg[2]);
+ }
+ return 0;
+}
diff --git a/src/getcpu.c b/src/getcpu.c
new file mode 100644
index 000000000..e91c76ff2
--- /dev/null
+++ b/src/getcpu.c
@@ -0,0 +1,20 @@
+/*
+ * Copyright (c) 2014-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+SYS_FUNC(getcpu)
+{
+ if (exiting(tcp)) {
+ printnum_int(tcp, tcp->u_arg[0], "%u");
+ tprints(", ");
+ printnum_int(tcp, tcp->u_arg[1], "%u");
+ tprints(", ");
+ printaddr(tcp->u_arg[2]);
+ }
+ return 0;
+}
diff --git a/src/getcwd.c b/src/getcwd.c
new file mode 100644
index 000000000..7c6de9afb
--- /dev/null
+++ b/src/getcwd.c
@@ -0,0 +1,20 @@
+/*
+ * Copyright (c) 2014-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+SYS_FUNC(getcwd)
+{
+ if (exiting(tcp)) {
+ if (syserror(tcp))
+ printaddr(tcp->u_arg[0]);
+ else
+ printpathn(tcp, tcp->u_arg[0], tcp->u_rval - 1);
+ tprintf(", %" PRI_klu, tcp->u_arg[1]);
+ }
+ return 0;
+}
diff --git a/src/getpagesize.c b/src/getpagesize.c
new file mode 100644
index 000000000..6dae186de
--- /dev/null
+++ b/src/getpagesize.c
@@ -0,0 +1,13 @@
+/*
+ * Copyright (c) 2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+SYS_FUNC(getpagesize)
+{
+ return RVAL_DECODED | RVAL_HEX;
+}
diff --git a/src/getpid.c b/src/getpid.c
new file mode 100644
index 000000000..5e9a1a294
--- /dev/null
+++ b/src/getpid.c
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2020 Ákos Uzonyi <uzonyi.akos@gmail.com>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+SYS_FUNC(getpid)
+{
+ return RVAL_DECODED | RVAL_TGID;
+}
+
+SYS_FUNC(gettid)
+{
+ return RVAL_DECODED | RVAL_TID;
+}
+
+SYS_FUNC(getpgrp)
+{
+ return RVAL_DECODED | RVAL_PGID;
+}
+
+SYS_FUNC(getpgid)
+{
+ printpid(tcp, tcp->u_arg[0], PT_TGID);
+
+ return RVAL_DECODED | RVAL_PGID;
+}
+
+SYS_FUNC(getsid)
+{
+ printpid(tcp, tcp->u_arg[0], PT_TGID);
+
+ return RVAL_DECODED | RVAL_SID;
+}
+
+SYS_FUNC(setpgid)
+{
+ printpid(tcp, tcp->u_arg[0], PT_TGID);
+ tprints(", ");
+ printpid(tcp, tcp->u_arg[1], PT_PGID);
+
+ return RVAL_DECODED;
+}
diff --git a/src/getrandom.c b/src/getrandom.c
new file mode 100644
index 000000000..f2985f0c3
--- /dev/null
+++ b/src/getrandom.c
@@ -0,0 +1,23 @@
+/*
+ * Copyright (c) 2015-2018 Dmitry V. Levin <ldv@strace.io>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include "xlat/getrandom_flags.h"
+
+SYS_FUNC(getrandom)
+{
+ if (exiting(tcp)) {
+ if (syserror(tcp))
+ printaddr(tcp->u_arg[0]);
+ else
+ printstr_ex(tcp, tcp->u_arg[0], tcp->u_rval,
+ QUOTE_FORCE_HEX);
+ tprintf(", %" PRI_klu ", ", tcp->u_arg[1]);
+ printflags(getrandom_flags, tcp->u_arg[2], "GRND_???");
+ }
+ return 0;
+}
diff --git a/src/gpio_ioctl.c b/src/gpio_ioctl.c
new file mode 100644
index 000000000..ced418bd6
--- /dev/null
+++ b/src/gpio_ioctl.c
@@ -0,0 +1,509 @@
+/*
+ * Copyright (c) 2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#include "types/gpio.h"
+#define XLAT_MACROS_ONLY
+# include "xlat/gpio_ioctl_cmds.h"
+#undef XLAT_MACROS_ONLY
+
+static int
+print_gpiochip_info(struct tcb *const tcp, const kernel_ulong_t arg)
+{
+ struct_gpiochip_info info;
+
+ if (entering(tcp))
+ return 0;
+
+ tprints(", ");
+ if (umove_or_printaddr(tcp, arg, &info))
+ return RVAL_IOCTL_DECODED;
+
+ tprint_struct_begin();
+ PRINT_FIELD_CSTRING(info, name);
+ tprint_struct_next();
+ PRINT_FIELD_CSTRING(info, label);
+ tprint_struct_next();
+ PRINT_FIELD_U(info, lines);
+ tprint_struct_end();
+
+ return RVAL_IOCTL_DECODED;
+}
+
+#include "xlat/gpio_line_flags.h"
+
+static int
+print_gpioline_info(struct tcb *const tcp, const kernel_ulong_t arg)
+{
+ struct_gpioline_info info;
+
+ if (entering(tcp))
+ tprints(", ");
+ else if (syserror(tcp))
+ return RVAL_IOCTL_DECODED;
+ else
+ tprint_value_changed();
+
+ if (umove_or_printaddr(tcp, arg, &info))
+ return RVAL_IOCTL_DECODED;
+
+ if (entering(tcp)) {
+ tprint_struct_begin();
+ PRINT_FIELD_U(info, line_offset);
+ tprint_struct_end();
+ return 0;
+ }
+
+ /* exiting */
+ tprint_struct_begin();
+ PRINT_FIELD_FLAGS(info, flags, gpio_line_flags, "GPIOLINE_FLAG_???");
+ tprint_struct_next();
+ PRINT_FIELD_CSTRING(info, name);
+ tprint_struct_next();
+ PRINT_FIELD_CSTRING(info, consumer);
+ tprint_struct_end();
+
+ return RVAL_IOCTL_DECODED;
+}
+
+static int
+print_gpioline_info_unwatch(struct tcb *const tcp, const kernel_ulong_t arg)
+{
+ struct { uint32_t offset; } data;
+
+ tprints(", ");
+ if (!umove_or_printaddr(tcp, arg, &data)) {
+ tprint_struct_begin();
+ PRINT_FIELD_U(data, offset);
+ tprint_struct_end();
+ }
+
+ return RVAL_IOCTL_DECODED;
+}
+
+#include "xlat/gpio_handle_flags.h"
+
+static int
+print_gpiohandle_request(struct tcb *const tcp, const kernel_ulong_t arg)
+{
+ struct_gpiohandle_request hr;
+
+ if (entering(tcp))
+ tprints(", ");
+ else if (syserror(tcp))
+ return RVAL_IOCTL_DECODED;
+ else
+ tprint_value_changed();
+
+ if (umove_or_printaddr(tcp, arg, &hr))
+ return RVAL_IOCTL_DECODED;
+
+ if (exiting(tcp)) {
+ tprint_struct_begin();
+ PRINT_FIELD_FD(hr, fd, tcp);
+ tprint_struct_end();
+ return RVAL_IOCTL_DECODED;
+ }
+
+ /* entering */
+ tprint_struct_begin();
+ PRINT_FIELD_U(hr, lines);
+ tprint_struct_next();
+ PRINT_FIELD_ARRAY_UPTO(hr, lineoffsets, hr.lines, tcp,
+ print_uint32_array_member);
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(hr, flags, gpio_handle_flags,
+ "GPIOHANDLE_REQUEST_???");
+ tprint_struct_next();
+ PRINT_FIELD_ARRAY_UPTO(hr, default_values, hr.lines, tcp,
+ print_uint8_array_member);
+ tprint_struct_next();
+ PRINT_FIELD_CSTRING(hr, consumer_label);
+ tprint_struct_end();
+ return 0;
+}
+
+#include "xlat/gpio_event_flags.h"
+
+static int
+print_gpioevent_request(struct tcb *const tcp, const kernel_ulong_t arg)
+{
+ struct_gpioevent_request er;
+
+ if (entering(tcp))
+ tprints(", ");
+ else if (syserror(tcp))
+ return RVAL_IOCTL_DECODED;
+ else
+ tprint_value_changed();
+
+ if (umove_or_printaddr(tcp, arg, &er))
+ return RVAL_IOCTL_DECODED;
+
+ if (exiting(tcp)) {
+ tprint_struct_begin();
+ PRINT_FIELD_FD(er, fd, tcp);
+ tprint_struct_end();
+ return RVAL_IOCTL_DECODED;
+ }
+
+ /* entering */
+ tprint_struct_begin();
+ PRINT_FIELD_U(er, lineoffset);
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(er, handleflags, gpio_handle_flags,
+ "GPIOHANDLE_REQUEST_???");
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(er, eventflags, gpio_event_flags,
+ "GPIOEVENT_REQUEST_???");
+ tprint_struct_next();
+ PRINT_FIELD_CSTRING(er, consumer_label);
+ tprint_struct_end();
+ return 0;
+}
+
+static void
+print_gpiohandle_data(struct tcb *const tcp, const struct_gpiohandle_data *vals)
+{
+ tprint_struct_begin();
+ PRINT_FIELD_ARRAY(*vals, values, tcp, print_uint8_array_member);
+ tprint_struct_end();
+}
+
+static int
+print_gpiohandle_get_values(struct tcb *const tcp, const kernel_ulong_t arg)
+{
+ struct_gpiohandle_data vals;
+
+ if (entering(tcp))
+ return 0;
+
+ /* exiting */
+ tprints(", ");
+ if (!umove_or_printaddr(tcp, arg, &vals))
+ print_gpiohandle_data(tcp, &vals);
+
+ return RVAL_IOCTL_DECODED;
+}
+
+static int
+print_gpiohandle_set_values(struct tcb *const tcp, const kernel_ulong_t arg)
+{
+ struct_gpiohandle_data vals;
+
+ tprints(", ");
+ if (!umove_or_printaddr(tcp, arg, &vals))
+ print_gpiohandle_data(tcp, &vals);
+
+ return RVAL_IOCTL_DECODED;
+}
+
+static int
+print_gpiohandle_set_config(struct tcb *const tcp, const kernel_ulong_t arg)
+{
+ struct_gpiohandle_config hc;
+
+ tprints(", ");
+ if (umove_or_printaddr(tcp, arg, &hc))
+ return RVAL_IOCTL_DECODED;
+
+ tprint_struct_begin();
+ PRINT_FIELD_FLAGS(hc, flags, gpio_handle_flags, "GPIOHANDLE_REQUEST_???");
+ tprint_struct_next();
+ PRINT_FIELD_ARRAY(hc, default_values, tcp, print_uint8_array_member);
+ tprint_struct_end();
+
+ return RVAL_IOCTL_DECODED;
+}
+
+#include "xlat/gpio_v2_line_flags.h"
+#include "xlat/gpio_v2_line_attr_ids.h"
+
+static void
+print_gpio_v2_line_attribute_raw(const struct_gpio_v2_line_attribute *attr,
+ bool as_field)
+{
+ if (as_field) {
+ tprints_field_name("attr");
+ tprint_struct_begin();
+ }
+ PRINT_FIELD_U(*attr, id);
+ if (attr->padding) {
+ tprint_struct_next();
+ PRINT_FIELD_X(*attr, padding);
+ }
+ tprint_struct_next();
+ tprints_field_name("data");
+ tprintf("%#" PRIx64, attr->values);
+ if (as_field)
+ tprint_struct_end();
+}
+
+static void
+print_gpio_v2_line_attribute(const struct_gpio_v2_line_attribute *attr,
+ bool as_field)
+{
+ if (attr->padding) {
+ /* unexpected padding usage so decode fields raw */
+ print_gpio_v2_line_attribute_raw(attr, as_field);
+ return;
+ }
+ switch (attr->id) {
+ case GPIO_V2_LINE_ATTR_ID_FLAGS:
+ PRINT_FIELD_FLAGS(*attr, flags, gpio_v2_line_flags,
+ "GPIO_V2_LINE_FLAG_???");
+ break;
+ case GPIO_V2_LINE_ATTR_ID_OUTPUT_VALUES:
+ PRINT_FIELD_X(*attr, values);
+ break;
+ case GPIO_V2_LINE_ATTR_ID_DEBOUNCE:
+ PRINT_FIELD_U(*attr, debounce_period_us);
+ break;
+ default:
+ /* unknown id so decode fields raw */
+ print_gpio_v2_line_attribute_raw(attr, as_field);
+ break;
+ }
+}
+
+static void
+print_gpio_v2_line_config_attribute(const struct_gpio_v2_line_config_attribute *attr)
+{
+ tprint_struct_begin();
+ print_gpio_v2_line_attribute(&attr->attr, true);
+ tprint_struct_next();
+ PRINT_FIELD_X(*attr, mask);
+ tprint_struct_end();
+}
+
+static bool
+print_gpio_v2_line_attr_array_member(struct tcb *tcp, void *elem_buf,
+ size_t elem_size, void *data)
+{
+ tprint_struct_begin();
+ print_gpio_v2_line_attribute(elem_buf, false);
+ tprint_struct_end();
+
+ return true;
+}
+
+static bool
+print_gpio_v2_line_config_attr_array_member(struct tcb *tcp, void *elem_buf,
+ size_t elem_size, void *data)
+{
+ print_gpio_v2_line_config_attribute(elem_buf);
+
+ return true;
+}
+
+static void
+print_gpio_v2_line_config(struct tcb *const tcp,
+ const struct_gpio_v2_line_config *lc)
+{
+ tprint_struct_begin();
+ PRINT_FIELD_FLAGS(*lc, flags, gpio_v2_line_flags,
+ "GPIO_V2_LINE_FLAG_???");
+ tprint_struct_next();
+ PRINT_FIELD_U(*lc, num_attrs);
+ if (!IS_ARRAY_ZERO(lc->padding)) {
+ tprint_struct_next();
+ PRINT_FIELD_X_ARRAY(*lc, padding);
+ }
+ if (lc->num_attrs) {
+ tprint_struct_next();
+ PRINT_FIELD_ARRAY_UPTO(*lc, attrs, lc->num_attrs, tcp,
+ print_gpio_v2_line_config_attr_array_member);
+ }
+ tprint_struct_end();
+}
+
+static int
+print_gpio_v2_line_info(struct tcb *const tcp, const kernel_ulong_t arg)
+{
+ struct_gpio_v2_line_info li;
+
+ if (entering(tcp))
+ tprints(", ");
+ else if (syserror(tcp))
+ return RVAL_IOCTL_DECODED;
+ else
+ tprint_value_changed();
+
+ if (umove_or_printaddr(tcp, arg, &li))
+ return RVAL_IOCTL_DECODED;
+
+ if (entering(tcp)) {
+ tprint_struct_begin();
+ PRINT_FIELD_U(li, offset);
+ tprint_struct_end();
+ return 0;
+ }
+
+ /* exiting */
+ tprint_struct_begin();
+ PRINT_FIELD_CSTRING(li, name);
+ tprint_struct_next();
+ PRINT_FIELD_CSTRING(li, consumer);
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(li, flags, gpio_v2_line_flags, "GPIO_V2_LINE_FLAG_???");
+ tprint_struct_next();
+ PRINT_FIELD_U(li, num_attrs);
+ if (li.num_attrs) {
+ tprint_struct_next();
+ PRINT_FIELD_ARRAY_UPTO(li, attrs, li.num_attrs, tcp,
+ print_gpio_v2_line_attr_array_member);
+ }
+ if (!IS_ARRAY_ZERO(li.padding)) {
+ tprint_struct_next();
+ PRINT_FIELD_X_ARRAY(li, padding);
+ }
+ tprint_struct_end();
+
+ return RVAL_IOCTL_DECODED;
+}
+
+static int
+print_gpio_v2_line_request(struct tcb *const tcp, const kernel_ulong_t arg)
+{
+ struct_gpio_v2_line_request lr;
+
+ if (entering(tcp))
+ tprints(", ");
+ else if (syserror(tcp))
+ return RVAL_IOCTL_DECODED;
+ else
+ tprint_value_changed();
+
+ if (umove_or_printaddr(tcp, arg, &lr))
+ return RVAL_IOCTL_DECODED;
+
+ if (exiting(tcp)) {
+ tprint_struct_begin();
+ PRINT_FIELD_FD(lr, fd, tcp);
+ tprint_struct_end();
+ return RVAL_IOCTL_DECODED;
+ }
+
+ /* entering */
+ tprint_struct_begin();
+ PRINT_FIELD_U(lr, num_lines);
+ tprint_struct_next();
+ PRINT_FIELD_ARRAY_UPTO(lr, offsets, lr.num_lines, tcp,
+ print_uint32_array_member);
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_TCB_PTR(lr, config, tcp,
+ print_gpio_v2_line_config);
+ tprint_struct_next();
+ PRINT_FIELD_CSTRING(lr, consumer);
+ if (lr.event_buffer_size) {
+ tprint_struct_next();
+ PRINT_FIELD_U(lr, event_buffer_size);
+ }
+ if (!IS_ARRAY_ZERO(lr.padding)) {
+ tprint_struct_next();
+ PRINT_FIELD_X_ARRAY(lr, padding);
+ }
+ tprint_struct_end();
+ return 0;
+}
+
+static int
+print_gpio_v2_line_get_values(struct tcb *const tcp, const kernel_ulong_t arg)
+{
+ struct_gpio_v2_line_values vals;
+
+ if (entering(tcp))
+ tprints(", ");
+ else if (syserror(tcp))
+ return RVAL_IOCTL_DECODED;
+ else
+ tprint_value_changed();
+
+ if (umove_or_printaddr(tcp, arg, &vals))
+ return RVAL_IOCTL_DECODED;
+
+ if (entering(tcp)) {
+ tprint_struct_begin();
+ PRINT_FIELD_X(vals, mask);
+ tprint_struct_end();
+ return 0;
+ }
+
+ /* exiting */
+ tprint_struct_begin();
+ PRINT_FIELD_X(vals, bits);
+ tprint_struct_end();
+
+ return RVAL_IOCTL_DECODED;
+}
+
+static int
+print_gpio_v2_line_set_values(struct tcb *const tcp, const kernel_ulong_t arg)
+{
+ struct_gpio_v2_line_values vals;
+
+ tprints(", ");
+ if (!umove_or_printaddr(tcp, arg, &vals)) {
+ tprint_struct_begin();
+ PRINT_FIELD_X(vals, bits);
+ tprint_struct_next();
+ PRINT_FIELD_X(vals, mask);
+ tprint_struct_end();
+ }
+
+ return RVAL_IOCTL_DECODED;
+}
+
+static int
+print_gpio_v2_line_set_config(struct tcb *const tcp, const kernel_ulong_t arg)
+{
+ struct_gpio_v2_line_config lc;
+
+ tprints(", ");
+ if (!umove_or_printaddr(tcp, arg, &lc))
+ print_gpio_v2_line_config(tcp, &lc);
+
+ return RVAL_IOCTL_DECODED;
+}
+
+int
+gpio_ioctl(struct tcb *const tcp, const unsigned int code,
+ const kernel_ulong_t arg)
+{
+ switch (code) {
+ case GPIO_GET_CHIPINFO_IOCTL:
+ return print_gpiochip_info(tcp, arg);
+ case GPIO_GET_LINEINFO_UNWATCH_IOCTL:
+ return print_gpioline_info_unwatch(tcp, arg);
+ case GPIO_V2_GET_LINEINFO_IOCTL:
+ case GPIO_V2_GET_LINEINFO_WATCH_IOCTL:
+ return print_gpio_v2_line_info(tcp, arg);
+ case GPIO_V2_GET_LINE_IOCTL:
+ return print_gpio_v2_line_request(tcp, arg);
+ case GPIO_V2_LINE_SET_CONFIG_IOCTL:
+ return print_gpio_v2_line_set_config(tcp, arg);
+ case GPIO_V2_LINE_GET_VALUES_IOCTL:
+ return print_gpio_v2_line_get_values(tcp, arg);
+ case GPIO_V2_LINE_SET_VALUES_IOCTL:
+ return print_gpio_v2_line_set_values(tcp, arg);
+ case GPIO_GET_LINEINFO_IOCTL:
+ case GPIO_GET_LINEINFO_WATCH_IOCTL:
+ return print_gpioline_info(tcp, arg);
+ case GPIO_GET_LINEHANDLE_IOCTL:
+ return print_gpiohandle_request(tcp, arg);
+ case GPIO_GET_LINEEVENT_IOCTL:
+ return print_gpioevent_request(tcp, arg);
+ case GPIOHANDLE_GET_LINE_VALUES_IOCTL:
+ return print_gpiohandle_get_values(tcp, arg);
+ case GPIOHANDLE_SET_LINE_VALUES_IOCTL:
+ return print_gpiohandle_set_values(tcp, arg);
+ case GPIOHANDLE_SET_CONFIG_IOCTL:
+ return print_gpiohandle_set_config(tcp, arg);
+ }
+ return RVAL_DECODED;
+}
diff --git a/src/hdio.c b/src/hdio.c
new file mode 100644
index 000000000..085192183
--- /dev/null
+++ b/src/hdio.c
@@ -0,0 +1,111 @@
+/*
+ * Copyright (c) 2009, 2010 Jeff Mahoney <jeffm@suse.com>
+ * Copyright (c) 2011-2016 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2016-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#include DEF_MPERS_TYPE(struct_hd_geometry)
+
+#include <linux/hdreg.h>
+
+typedef struct hd_geometry struct_hd_geometry;
+
+#include MPERS_DEFS
+
+#include "xlat/hdio_drive_cmds.h"
+
+static int
+print_hdio_getgeo(struct tcb *const tcp, const kernel_ulong_t arg)
+{
+ if (entering(tcp)) {
+ tprints(", ");
+
+ return 0;
+ }
+
+ /* exiting */
+ struct_hd_geometry geo;
+
+ if (umove_or_printaddr(tcp, arg, &geo))
+ return RVAL_IOCTL_DECODED;
+
+ tprint_struct_begin();
+ PRINT_FIELD_U(geo, heads);
+ tprint_struct_next();
+ PRINT_FIELD_U(geo, sectors);
+ tprint_struct_next();
+ PRINT_FIELD_U(geo, cylinders);
+ tprint_struct_next();
+ PRINT_FIELD_U(geo, start);
+ tprint_struct_end();
+
+ return RVAL_IOCTL_DECODED;
+}
+
+static int
+print_hdio_drive_cmd(struct tcb *const tcp, const kernel_ulong_t arg)
+{
+ enum { SECTOR_SIZE = 512 };
+
+ struct hd_drive_cmd_hdr c;
+
+ if (entering(tcp)) {
+ tprints(", ");
+
+ if (umove_or_printaddr(tcp, arg, &c))
+ return RVAL_IOCTL_DECODED;
+
+ tprint_struct_begin();
+ PRINT_FIELD_XVAL(c, command, hdio_drive_cmds,
+ "ATA_CMD_???");
+ tprint_struct_next();
+ PRINT_FIELD_U(c, sector_number);
+ tprint_struct_next();
+ PRINT_FIELD_U(c, feature);
+ tprint_struct_next();
+ PRINT_FIELD_U(c, sector_count);
+ tprint_struct_end();
+
+ return 0;
+ }
+
+ /* exiting */
+ if ((syserror(tcp) && tcp->u_error != EIO) || umove(tcp, arg, &c))
+ return RVAL_IOCTL_DECODED;
+
+ tprint_value_changed();
+ tprint_struct_begin();
+
+ tprintf("/* status */ %#x, /* error */ %u, /* nsector */ %u",
+ c.command, c.sector_number, c.feature);
+
+ if (c.sector_count) {
+ tprints(", ");
+ printstr_ex(tcp, arg + 4, c.sector_count * SECTOR_SIZE,
+ QUOTE_FORCE_HEX);
+ }
+
+ tprint_struct_end();
+
+ return RVAL_IOCTL_DECODED;
+}
+
+MPERS_PRINTER_DECL(int, hdio_ioctl, struct tcb *const tcp,
+ const unsigned int code, const kernel_ulong_t arg)
+{
+ switch (code) {
+ case HDIO_GETGEO:
+ return print_hdio_getgeo(tcp, arg);
+ case HDIO_DRIVE_CMD:
+ return print_hdio_drive_cmd(tcp, arg);
+ default:
+ return RVAL_DECODED;
+ }
+
+ return RVAL_IOCTL_DECODED;
+}
diff --git a/src/hostname.c b/src/hostname.c
new file mode 100644
index 000000000..c13cf1d2d
--- /dev/null
+++ b/src/hostname.c
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2014-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#ifdef HAVE_LINUX_UTSNAME_H
+# include <linux/utsname.h>
+#endif
+
+#ifndef __NEW_UTS_LEN
+# define __NEW_UTS_LEN 64
+#endif
+
+SYS_FUNC(sethostname)
+{
+ unsigned int len = tcp->u_arg[1];
+
+ if (len > __NEW_UTS_LEN) {
+ printaddr(tcp->u_arg[0]);
+ } else {
+ printstrn(tcp, tcp->u_arg[0], len);
+ }
+
+ tprintf(", %u", len);
+
+ return RVAL_DECODED;
+}
+
+#if defined(ALPHA)
+SYS_FUNC(gethostname)
+{
+ if (exiting(tcp)) {
+ if (syserror(tcp))
+ printaddr(tcp->u_arg[0]);
+ else
+ printstr(tcp, tcp->u_arg[0]);
+ tprintf(", %" PRI_klu, tcp->u_arg[1]);
+ }
+ return 0;
+}
+#endif /* ALPHA */
diff --git a/src/inotify.c b/src/inotify.c
new file mode 100644
index 000000000..f5095914b
--- /dev/null
+++ b/src/inotify.c
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2006 Bernhard Kaindl <bk@suse.de>
+ * Copyright (c) 2006-2018 Dmitry V. Levin <ldv@strace.io>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include <fcntl.h>
+
+#include "xlat/inotify_flags.h"
+#include "xlat/inotify_init_flags.h"
+
+SYS_FUNC(inotify_add_watch)
+{
+ /* file descriptor */
+ printfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ /* pathname */
+ printpath(tcp, tcp->u_arg[1]);
+ tprints(", ");
+ /* mask */
+ printflags(inotify_flags, tcp->u_arg[2], "IN_???");
+
+ return RVAL_DECODED;
+}
+
+SYS_FUNC(inotify_rm_watch)
+{
+ /* file descriptor */
+ printfd(tcp, tcp->u_arg[0]);
+ /* watch descriptor */
+ tprintf(", %d", (int) tcp->u_arg[1]);
+
+ return RVAL_DECODED;
+}
+
+SYS_FUNC(inotify_init)
+{
+ return RVAL_DECODED | RVAL_FD;
+}
+
+SYS_FUNC(inotify_init1)
+{
+ printflags(inotify_init_flags, tcp->u_arg[0], "IN_???");
+
+ return RVAL_DECODED | RVAL_FD;
+}
diff --git a/src/inotify_ioctl.c b/src/inotify_ioctl.c
new file mode 100644
index 000000000..7e06dcb0c
--- /dev/null
+++ b/src/inotify_ioctl.c
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#include <linux/ioctl.h>
+
+#ifndef INOTIFY_IOC_SETNEXTWD
+# define INOTIFY_IOC_SETNEXTWD _IOW('I', 0, int32_t)
+#endif
+
+int
+inotify_ioctl(struct tcb *const tcp, const unsigned int code,
+ const kernel_ulong_t arg)
+{
+ switch (code) {
+ case INOTIFY_IOC_SETNEXTWD:
+ tprintf(", %d", (int) arg);
+
+ return RVAL_IOCTL_DECODED;
+ }
+
+ return RVAL_DECODED;
+}
diff --git a/src/io.c b/src/io.c
new file mode 100644
index 000000000..db4b667d9
--- /dev/null
+++ b/src/io.c
@@ -0,0 +1,315 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
+ * Copyright (c) 1999-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include <fcntl.h>
+#include <sys/uio.h>
+
+SYS_FUNC(read)
+{
+ if (entering(tcp)) {
+ printfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ } else {
+ if (syserror(tcp))
+ printaddr(tcp->u_arg[1]);
+ else
+ printstrn(tcp, tcp->u_arg[1], tcp->u_rval);
+ tprintf(", %" PRI_klu, tcp->u_arg[2]);
+ }
+ return 0;
+}
+
+SYS_FUNC(write)
+{
+ printfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ printstrn(tcp, tcp->u_arg[1], tcp->u_arg[2]);
+ tprintf(", %" PRI_klu, tcp->u_arg[2]);
+
+ return RVAL_DECODED;
+}
+
+struct print_iovec_config {
+ enum iov_decode decode_iov;
+ kernel_ulong_t data_size;
+};
+
+static bool
+print_iovec(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data)
+{
+ const kernel_ulong_t *iov;
+ kernel_ulong_t iov_buf[2], len;
+ struct print_iovec_config *c = data;
+
+ if (elem_size < sizeof(iov_buf)) {
+ iov_buf[0] = ((unsigned int *) elem_buf)[0];
+ iov_buf[1] = ((unsigned int *) elem_buf)[1];
+ iov = iov_buf;
+ } else {
+ iov = elem_buf;
+ }
+
+ tprint_struct_begin();
+ tprints_field_name("iov_base");
+
+ len = iov[1];
+
+ switch (c->decode_iov) {
+ case IOV_DECODE_STR:
+ if (len > c->data_size)
+ len = c->data_size;
+ if (c->data_size != (kernel_ulong_t) -1)
+ c->data_size -= len;
+ printstrn(tcp, iov[0], len);
+ break;
+ case IOV_DECODE_NETLINK:
+ if (len > c->data_size)
+ len = c->data_size;
+ if (c->data_size != (kernel_ulong_t) -1)
+ c->data_size -= len;
+ /* assume that the descriptor is 1st syscall argument */
+ decode_netlink(tcp, tcp->u_arg[0], iov[0], len);
+ break;
+ default:
+ printaddr(iov[0]);
+ break;
+ }
+
+ tprint_struct_next();
+ tprints_field_name("iov_len");
+ tprintf("%" PRI_klu, iov[1]);
+ tprint_struct_end();
+
+ return true;
+}
+
+/*
+ * data_size limits the cumulative size of printed data.
+ * Example: recvmsg returning a short read.
+ */
+void
+tprint_iov_upto(struct tcb *const tcp, const kernel_ulong_t len,
+ const kernel_ulong_t addr, const enum iov_decode decode_iov,
+ const kernel_ulong_t data_size)
+{
+ kernel_ulong_t iov[2];
+ struct print_iovec_config config = {
+ .decode_iov = decode_iov, .data_size = data_size
+ };
+
+ print_array(tcp, addr, len, iov, current_wordsize * 2,
+ tfetch_mem_ignore_syserror, print_iovec, &config);
+}
+
+SYS_FUNC(readv)
+{
+ if (entering(tcp)) {
+ printfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ } else {
+ tprint_iov_upto(tcp, tcp->u_arg[2], tcp->u_arg[1],
+ syserror(tcp) ? IOV_DECODE_ADDR :
+ IOV_DECODE_STR, tcp->u_rval);
+ tprintf(", %" PRI_klu, tcp->u_arg[2]);
+ }
+ return 0;
+}
+
+SYS_FUNC(writev)
+{
+ printfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ tprint_iov(tcp, tcp->u_arg[2], tcp->u_arg[1], IOV_DECODE_STR);
+ tprintf(", %" PRI_klu, tcp->u_arg[2]);
+
+ return RVAL_DECODED;
+}
+
+SYS_FUNC(pread)
+{
+ if (entering(tcp)) {
+ printfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ } else {
+ if (syserror(tcp))
+ printaddr(tcp->u_arg[1]);
+ else
+ printstrn(tcp, tcp->u_arg[1], tcp->u_rval);
+ tprintf(", %" PRI_klu ", ", tcp->u_arg[2]);
+ printllval(tcp, "%lld", 3);
+ }
+ return 0;
+}
+
+SYS_FUNC(pwrite)
+{
+ printfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ printstrn(tcp, tcp->u_arg[1], tcp->u_arg[2]);
+ tprintf(", %" PRI_klu ", ", tcp->u_arg[2]);
+ printllval(tcp, "%lld", 3);
+
+ return RVAL_DECODED;
+}
+
+static void
+print_lld_from_low_high_val(struct tcb *tcp, int arg)
+{
+#if SIZEOF_KERNEL_LONG_T > 4
+# ifndef current_klongsize
+ if (current_klongsize < SIZEOF_KERNEL_LONG_T) {
+ tprintf("%" PRI_kld, (tcp->u_arg[arg + 1] << 32)
+ | tcp->u_arg[arg]);
+ } else
+# endif /* !current_klongsize */
+ {
+ tprintf("%" PRI_kld, tcp->u_arg[arg]);
+ }
+#else /* SIZEOF_KERNEL_LONG_T == 4 */
+ tprintf("%lld",
+ ((long long) tcp->u_arg[arg + 1] << 32)
+ | ((long long) tcp->u_arg[arg]));
+#endif
+}
+
+#include "xlat/rwf_flags.h"
+
+static int
+do_preadv(struct tcb *tcp, const int flags_arg)
+{
+ if (entering(tcp)) {
+ printfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ } else {
+ kernel_ulong_t len =
+ truncate_kulong_to_current_wordsize(tcp->u_arg[2]);
+
+ tprint_iov_upto(tcp, len, tcp->u_arg[1],
+ syserror(tcp) ? IOV_DECODE_ADDR :
+ IOV_DECODE_STR, tcp->u_rval);
+ tprintf(", %" PRI_klu ", ", len);
+ print_lld_from_low_high_val(tcp, 3);
+ if (flags_arg >= 0) {
+ tprints(", ");
+ printflags(rwf_flags, tcp->u_arg[flags_arg], "RWF_???");
+ }
+ }
+ return 0;
+}
+
+SYS_FUNC(preadv)
+{
+ return do_preadv(tcp, -1);
+}
+
+static int
+do_pwritev(struct tcb *tcp, const int flags_arg)
+{
+ kernel_ulong_t len =
+ truncate_kulong_to_current_wordsize(tcp->u_arg[2]);
+
+ printfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ tprint_iov(tcp, len, tcp->u_arg[1], IOV_DECODE_STR);
+ tprintf(", %" PRI_klu ", ", len);
+ print_lld_from_low_high_val(tcp, 3);
+ if (flags_arg >= 0) {
+ tprints(", ");
+ printflags(rwf_flags, tcp->u_arg[flags_arg], "RWF_???");
+ }
+
+ return RVAL_DECODED;
+}
+
+SYS_FUNC(pwritev)
+{
+ return do_pwritev(tcp, -1);
+}
+
+/*
+ * x32 is the only architecture where preadv2 takes 5 arguments
+ * instead of 6, see preadv64v2 in kernel sources.
+ * Likewise, x32 is the only architecture where pwritev2 takes 5 arguments
+ * instead of 6, see pwritev64v2 in kernel sources.
+ */
+
+#if defined X86_64
+# define PREADV2_PWRITEV2_FLAGS_ARG_NO (current_personality == 2 ? 4 : 5)
+#elif defined X32
+# define PREADV2_PWRITEV2_FLAGS_ARG_NO (current_personality == 0 ? 4 : 5)
+#else
+# define PREADV2_PWRITEV2_FLAGS_ARG_NO 5
+#endif
+
+SYS_FUNC(preadv2)
+{
+ return do_preadv(tcp, PREADV2_PWRITEV2_FLAGS_ARG_NO);
+}
+
+SYS_FUNC(pwritev2)
+{
+ return do_pwritev(tcp, PREADV2_PWRITEV2_FLAGS_ARG_NO);
+}
+
+#include "xlat/splice_flags.h"
+
+SYS_FUNC(tee)
+{
+ /* int fd_in */
+ printfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ /* int fd_out */
+ printfd(tcp, tcp->u_arg[1]);
+ tprints(", ");
+ /* size_t len */
+ tprintf("%" PRI_klu ", ", tcp->u_arg[2]);
+ /* unsigned int flags */
+ printflags(splice_flags, tcp->u_arg[3], "SPLICE_F_???");
+
+ return RVAL_DECODED;
+}
+
+SYS_FUNC(splice)
+{
+ /* int fd_in */
+ printfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ /* loff_t *off_in */
+ printnum_int64(tcp, tcp->u_arg[1], "%" PRId64);
+ tprints(", ");
+ /* int fd_out */
+ printfd(tcp, tcp->u_arg[2]);
+ tprints(", ");
+ /* loff_t *off_out */
+ printnum_int64(tcp, tcp->u_arg[3], "%" PRId64);
+ tprints(", ");
+ /* size_t len */
+ tprintf("%" PRI_klu ", ", tcp->u_arg[4]);
+ /* unsigned int flags */
+ printflags(splice_flags, tcp->u_arg[5], "SPLICE_F_???");
+
+ return RVAL_DECODED;
+}
+
+SYS_FUNC(vmsplice)
+{
+ /* int fd */
+ printfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ /* const struct iovec *iov, unsigned long nr_segs */
+ tprint_iov(tcp, tcp->u_arg[2], tcp->u_arg[1], IOV_DECODE_STR);
+ tprintf(", %" PRI_klu ", ", tcp->u_arg[2]);
+ /* unsigned int flags */
+ printflags(splice_flags, tcp->u_arg[3], "SPLICE_F_???");
+
+ return RVAL_DECODED;
+}
diff --git a/src/io_uring.c b/src/io_uring.c
new file mode 100644
index 000000000..9f2e3b8af
--- /dev/null
+++ b/src/io_uring.c
@@ -0,0 +1,322 @@
+/*
+ * Copyright (c) 2019 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2019-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#include "types/io_uring.h"
+
+#include "xlat/uring_op_flags.h"
+#include "xlat/uring_ops.h"
+#include "xlat/uring_setup_features.h"
+#include "xlat/uring_setup_flags.h"
+#include "xlat/uring_enter_flags.h"
+#include "xlat/uring_register_opcodes.h"
+#include "xlat/uring_cqring_flags.h"
+
+#ifdef HAVE_STRUCT_IO_URING_PARAMS
+# ifdef HAVE_STRUCT_IO_URING_PARAMS_RESV
+static_assert(offsetof(struct_io_uring_params, resv)
+ >= offsetof(struct io_uring_params, resv),
+ "struct io_uring_params.resv offset mismatch"
+ ", please update the decoder");
+static_assert(sizeof_field(struct_io_uring_params, resv)
+ <= sizeof_field(struct io_uring_params, resv),
+ "struct io_uring_params.resv size mismatch"
+ ", please update the decoder");
+# else /* !HAVE_STRUCT_IO_URING_PARAMS_RESV */
+static_assert(0, "struct io_uring_params.resv is missing"
+ ", please update the decoder");
+# endif
+#endif /* HAVE_STRUCT_IO_URING_PARAMS */
+
+static void
+print_io_sqring_offsets(const struct_io_sqring_offsets *const p)
+{
+ tprint_struct_begin();
+ PRINT_FIELD_U(*p, head);
+ tprint_struct_next();
+ PRINT_FIELD_U(*p, tail);
+ tprint_struct_next();
+ PRINT_FIELD_U(*p, ring_mask);
+ tprint_struct_next();
+ PRINT_FIELD_U(*p, ring_entries);
+ tprint_struct_next();
+ PRINT_FIELD_U(*p, flags);
+ tprint_struct_next();
+ PRINT_FIELD_U(*p, dropped);
+ tprint_struct_next();
+ PRINT_FIELD_U(*p, array);
+ if (p->resv1) {
+ tprint_struct_next();
+ PRINT_FIELD_X(*p, resv1);
+ }
+ if (p->resv2) {
+ tprint_struct_next();
+ PRINT_FIELD_X(*p, resv2);
+ }
+ tprint_struct_end();
+}
+
+static void
+print_io_cqring_offsets(const struct_io_cqring_offsets *const p)
+{
+ tprint_struct_begin();
+ PRINT_FIELD_U(*p, head);
+ tprint_struct_next();
+ PRINT_FIELD_U(*p, tail);
+ tprint_struct_next();
+ PRINT_FIELD_U(*p, ring_mask);
+ tprint_struct_next();
+ PRINT_FIELD_U(*p, ring_entries);
+ tprint_struct_next();
+ PRINT_FIELD_U(*p, overflow);
+ tprint_struct_next();
+ PRINT_FIELD_U(*p, cqes);
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(*p, flags, uring_cqring_flags, "IORING_CQ_???");
+ if (p->resv1) {
+ tprint_struct_next();
+ PRINT_FIELD_X(*p, resv1);
+ }
+ if (p->resv2) {
+ tprint_struct_next();
+ PRINT_FIELD_X(*p, resv2);
+ }
+ tprint_struct_end();
+}
+
+SYS_FUNC(io_uring_setup)
+{
+ const uint32_t nentries = tcp->u_arg[0];
+ const kernel_ulong_t params_addr = tcp->u_arg[1];
+ struct_io_uring_params params;
+
+ if (entering(tcp)) {
+ tprintf("%u, ", nentries);
+
+ if (umove_or_printaddr(tcp, params_addr, &params))
+ return RVAL_DECODED | RVAL_FD;
+
+ tprint_struct_begin();
+ PRINT_FIELD_FLAGS(params, flags, uring_setup_flags,
+ "IORING_SETUP_???");
+ tprint_struct_next();
+ PRINT_FIELD_X(params, sq_thread_cpu);
+ tprint_struct_next();
+ PRINT_FIELD_U(params, sq_thread_idle);
+ if (params.flags & IORING_SETUP_ATTACH_WQ) {
+ tprint_struct_next();
+ PRINT_FIELD_FD(params, wq_fd, tcp);
+ }
+ if (!IS_ARRAY_ZERO(params.resv)) {
+ tprint_struct_next();
+ PRINT_FIELD_ARRAY(params, resv, tcp,
+ print_xint32_array_member);
+ }
+ return 0;
+ }
+
+ /* exiting */
+ if (syserror(tcp)) {
+ /* The remaining part of params is irrelevant. */
+ } else if (umove(tcp, params_addr, &params)) {
+ tprints(", ???");
+ } else {
+ tprint_struct_next();
+ PRINT_FIELD_U(params, sq_entries);
+ tprint_struct_next();
+ PRINT_FIELD_U(params, cq_entries);
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(params, features,
+ uring_setup_features,
+ "IORING_FEAT_???");
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_PTR(params, sq_off,
+ print_io_sqring_offsets);
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_PTR(params, cq_off,
+ print_io_cqring_offsets);
+ }
+ tprint_struct_end();
+
+ return RVAL_DECODED | RVAL_FD;
+}
+
+SYS_FUNC(io_uring_enter)
+{
+ const int fd = tcp->u_arg[0];
+ const uint32_t to_submit = tcp->u_arg[1];
+ const uint32_t min_complete = tcp->u_arg[2];
+ const uint32_t flags = tcp->u_arg[3];
+ const kernel_ulong_t sigset_addr = tcp->u_arg[4];
+ const kernel_ulong_t sigset_size = tcp->u_arg[5];
+
+ printfd(tcp, fd);
+ tprintf(", %u, %u, ", to_submit, min_complete);
+ printflags(uring_enter_flags, flags, "IORING_ENTER_???");
+ tprints(", ");
+ print_sigset_addr_len(tcp, sigset_addr, sigset_size);
+ tprintf(", %" PRI_klu, sigset_size);
+
+ return RVAL_DECODED;
+}
+
+static bool
+print_fd_array_member(struct tcb *tcp, void *elem_buf, size_t elem_size,
+ void *data)
+{
+ printfd(tcp, *(int *) elem_buf);
+ return true;
+}
+
+static void
+print_io_uring_files_update(struct tcb *tcp, const kernel_ulong_t addr,
+ const unsigned int nargs)
+{
+ struct_io_uring_files_update arg;
+ int buf;
+
+ if (umove_or_printaddr(tcp, addr, &arg))
+ return;
+
+ tprint_struct_begin();
+ PRINT_FIELD_U(arg, offset);
+ if (arg.resv) {
+ tprint_struct_next();
+ PRINT_FIELD_X(arg, resv);
+ }
+ tprint_struct_next();
+ tprints_field_name("fds");
+ print_big_u64_addr(arg.fds);
+ print_array(tcp, arg.fds, nargs, &buf, sizeof(buf),
+ tfetch_mem, print_fd_array_member, NULL);
+ tprint_struct_end();
+}
+
+static bool
+print_io_uring_probe_op(struct tcb *tcp, void *elem_buf, size_t elem_size,
+ void *data)
+{
+ struct_io_uring_probe_op *op = (struct_io_uring_probe_op *) elem_buf;
+
+ tprint_struct_begin();
+ PRINT_FIELD_XVAL_U(*op, op, uring_ops, "IORING_OP_???");
+ if (op->resv) {
+ tprint_struct_next();
+ PRINT_FIELD_X(*op, resv);
+ }
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(*op, flags, uring_op_flags, "IO_URING_OP_???");
+ if (op->resv2) {
+ tprint_struct_next();
+ PRINT_FIELD_X(*op, resv2);
+ }
+ tprint_struct_end();
+
+ return true;
+}
+
+static int
+print_io_uring_probe(struct tcb *tcp, const kernel_ulong_t addr,
+ const unsigned int nargs)
+{
+ struct_io_uring_probe *probe;
+ unsigned long printed = exiting(tcp) ? get_tcb_priv_ulong(tcp) : false;
+
+ if (exiting(tcp) && syserror(tcp)) {
+ if (!printed)
+ printaddr(addr);
+ return RVAL_DECODED;
+ }
+ if (nargs > 256) {
+ printaddr(addr);
+ return RVAL_DECODED;
+ }
+ if (printed)
+ tprint_value_changed();
+
+ /* Maximum size is 8 * 256 + 16, a bit over 4k */
+ size_t probe_sz = sizeof(probe->ops[0]) * nargs + sizeof(*probe);
+ probe = alloca(probe_sz);
+
+ /*
+ * So far, the operation doesn't use any data from the arg provided,
+ * but it checks that it is filled with zeroes.
+ */
+ if (umoven_or_printaddr(tcp, addr, probe_sz, probe))
+ return RVAL_DECODED;
+ if (entering(tcp) && is_filled((const char *) probe, 0, probe_sz))
+ return 0;
+ set_tcb_priv_ulong(tcp, true);
+
+ tprint_struct_begin();
+ PRINT_FIELD_XVAL_U(*probe, last_op, uring_ops, "IORING_OP_???");
+ tprint_struct_next();
+ PRINT_FIELD_U(*probe, ops_len);
+ if (probe->resv) {
+ tprint_struct_next();
+ PRINT_FIELD_X(*probe, resv);
+ }
+ if (!IS_ARRAY_ZERO(probe->resv2)) {
+ tprint_struct_next();
+ PRINT_FIELD_ARRAY(*probe, resv2, tcp,
+ print_xint32_array_member);
+ }
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_TCB_VAL(*probe, ops, tcp, print_local_array_ex,
+ entering(tcp) ? nargs : probe->ops_len,
+ sizeof(probe->ops[0]), print_io_uring_probe_op,
+ NULL, 0, NULL, NULL);
+ tprint_struct_end();
+
+ return 0;
+}
+
+SYS_FUNC(io_uring_register)
+{
+ const int fd = tcp->u_arg[0];
+ const unsigned int opcode = tcp->u_arg[1];
+ const kernel_ulong_t arg = tcp->u_arg[2];
+ const unsigned int nargs = tcp->u_arg[3];
+ int rc = RVAL_DECODED;
+ int buf;
+
+ if (entering(tcp)) {
+ printfd(tcp, fd);
+ tprints(", ");
+ printxval(uring_register_opcodes, opcode,
+ "IORING_REGISTER_???");
+ tprints(", ");
+ }
+
+ switch (opcode) {
+ case IORING_REGISTER_BUFFERS:
+ tprint_iov(tcp, nargs, arg, IOV_DECODE_ADDR);
+ break;
+ case IORING_REGISTER_FILES:
+ case IORING_REGISTER_EVENTFD:
+ case IORING_REGISTER_EVENTFD_ASYNC:
+ print_array(tcp, arg, nargs, &buf, sizeof(buf),
+ tfetch_mem, print_fd_array_member, NULL);
+ break;
+ case IORING_REGISTER_FILES_UPDATE:
+ print_io_uring_files_update(tcp, arg, nargs);
+ break;
+ case IORING_REGISTER_PROBE:
+ rc = print_io_uring_probe(tcp, arg, nargs);
+ break;
+ default:
+ printaddr(arg);
+ break;
+ }
+
+ if (rc || exiting(tcp))
+ tprintf(", %u", nargs);
+
+ return rc;
+}
diff --git a/src/ioctl.c b/src/ioctl.c
new file mode 100644
index 000000000..f3d31b8ad
--- /dev/null
+++ b/src/ioctl.c
@@ -0,0 +1,422 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1996-2001 Wichert Akkerman <wichert@cistron.nl>
+ * Copyright (c) 1999-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include <linux/ioctl.h>
+#include "xlat/ioctl_dirs.h"
+
+#if defined(SPARC) || defined(SPARC64)
+/*
+ * While Alpha, MIPS, PA-RISC, and POWER simply define _IOC_SIZEBITS to 13
+ * and utilise 3 bits for _IOC_DIRBITS, SPARC tries to provide 14 bits
+ * for the size field ("as on i386") by (ab)using the lowest direction bit.
+ * Unfortunately, while doing so, they decide to define _IOC_SIZE to 0
+ * when the direction doesn't have _IOC_READ/_IOC_WRITE bits set, which
+ * breaks the invariant
+ *
+ * _IOC_SIZE(_IOC(dir, type, nr, size)) == size
+ *
+ * for _IOC_DIR(val) that doesn't include _IOC_READ or _IOC_WRITE, which
+ * is unacceptable for strace's use case.
+ * So, let's redefine _IOC_SIZE in a way that is more suitable for us.
+ */
+# undef _IOC_SIZE
+# define _IOC_SIZE(nr) \
+ ((_IOC_DIR(nr) & (_IOC_WRITE | _IOC_READ)) \
+ ? (((nr) >> _IOC_SIZESHIFT) & _IOC_XSIZEMASK) \
+ : (((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK)) \
+ /* end of _IOC_SIZE definition */
+#endif
+
+static int
+compare(const void *a, const void *b)
+{
+ const unsigned int code1 = (const uintptr_t) a;
+ const unsigned int code2 = ((struct_ioctlent *) b)->code;
+ return (code1 > code2) ? 1 : (code1 < code2) ? -1 : 0;
+}
+
+static const struct_ioctlent *
+ioctl_lookup(const unsigned int code)
+{
+ struct_ioctlent *iop;
+
+ iop = bsearch((const void *) (const uintptr_t) code, ioctlent,
+ nioctlents, sizeof(ioctlent[0]), compare);
+ while (iop > ioctlent) {
+ iop--;
+ if (iop->code != code) {
+ iop++;
+ break;
+ }
+ }
+ return iop;
+}
+
+static const struct_ioctlent *
+ioctl_next_match(const struct_ioctlent *iop)
+{
+ const unsigned int code = iop->code;
+ iop++;
+ if (iop < ioctlent + nioctlents && iop->code == code)
+ return iop;
+ return NULL;
+}
+
+static void
+ioctl_print_code(const unsigned int code)
+{
+ const bool abbrev = xlat_verbose(xlat_verbosity) != XLAT_STYLE_VERBOSE;
+
+ tprints("_IOC(");
+ printflags_ex(_IOC_DIR(code), abbrev ? "_IOC_???" : NULL,
+ abbrev ? XLAT_STYLE_DEFAULT : XLAT_STYLE_ABBREV,
+ ioctl_dirs, NULL);
+ tprintf(", %#x, %#x, %#x)",
+ _IOC_TYPE(code), _IOC_NR(code), _IOC_SIZE(code));
+}
+
+static int
+evdev_decode_number(const unsigned int code)
+{
+ const unsigned int nr = _IOC_NR(code);
+ const bool abbrev = xlat_verbose(xlat_verbosity) != XLAT_STYLE_VERBOSE;
+
+ if (_IOC_DIR(code) == _IOC_WRITE) {
+ if (nr >= 0xc0 && nr <= 0xc0 + 0x3f) {
+ tprints("EVIOCSABS(");
+ printxval_ex(evdev_abs, nr - 0xc0,
+ abbrev ? "ABS_???" : NULL,
+ abbrev ? XLAT_STYLE_DEFAULT
+ : XLAT_STYLE_ABBREV);
+ tprints(")");
+ return 1;
+ }
+ }
+
+ if (_IOC_DIR(code) != _IOC_READ)
+ return 0;
+
+ if (nr >= 0x20 && nr <= 0x20 + 0x1f) {
+ tprints("EVIOCGBIT(");
+ if (nr == 0x20)
+ tprints("0");
+ else
+ printxval_ex(evdev_ev, nr - 0x20,
+ abbrev ? "EV_???" : NULL,
+ abbrev ? XLAT_STYLE_DEFAULT
+ : XLAT_STYLE_ABBREV);
+ tprintf(", %u)", _IOC_SIZE(code));
+ return 1;
+ } else if (nr >= 0x40 && nr <= 0x40 + 0x3f) {
+ tprints("EVIOCGABS(");
+ printxval_ex(evdev_abs, nr - 0x40, abbrev ? "ABS_???" : NULL,
+ abbrev ? XLAT_STYLE_DEFAULT : XLAT_STYLE_ABBREV);
+ tprints(")");
+ return 1;
+ }
+
+ switch (nr) {
+ case 0x06:
+ tprintf("EVIOCGNAME(%u)", _IOC_SIZE(code));
+ return 1;
+ case 0x07:
+ tprintf("EVIOCGPHYS(%u)", _IOC_SIZE(code));
+ return 1;
+ case 0x08:
+ tprintf("EVIOCGUNIQ(%u)", _IOC_SIZE(code));
+ return 1;
+ case 0x09:
+ tprintf("EVIOCGPROP(%u)", _IOC_SIZE(code));
+ return 1;
+ case 0x0a:
+ tprintf("EVIOCGMTSLOTS(%u)", _IOC_SIZE(code));
+ return 1;
+ case 0x18:
+ tprintf("EVIOCGKEY(%u)", _IOC_SIZE(code));
+ return 1;
+ case 0x19:
+ tprintf("EVIOCGLED(%u)", _IOC_SIZE(code));
+ return 1;
+ case 0x1a:
+ tprintf("EVIOCGSND(%u)", _IOC_SIZE(code));
+ return 1;
+ case 0x1b:
+ tprintf("EVIOCGSW(%u)", _IOC_SIZE(code));
+ return 1;
+ default:
+ return 0;
+ }
+}
+
+static int
+hiddev_decode_number(const unsigned int code)
+{
+ if (_IOC_DIR(code) == _IOC_READ) {
+ switch (_IOC_NR(code)) {
+ case 0x04:
+ tprintf("HIDIOCGRAWNAME(%u)", _IOC_SIZE(code));
+ return 1;
+ case 0x05:
+ tprintf("HIDIOCGRAWPHYS(%u)", _IOC_SIZE(code));
+ return 1;
+ case 0x06:
+ tprintf("HIDIOCSFEATURE(%u)", _IOC_SIZE(code));
+ return 1;
+ case 0x08:
+ tprintf("HIDIOCGRAWUNIQ(%u)", _IOC_SIZE(code));
+ return 1;
+ case 0x12:
+ tprintf("HIDIOCGPHYS(%u)", _IOC_SIZE(code));
+ return 1;
+ default:
+ return 0;
+ }
+ } else if (_IOC_DIR(code) == (_IOC_READ | _IOC_WRITE)) {
+ switch (_IOC_NR(code)) {
+ case 0x06:
+ tprintf("HIDIOCSFEATURE(%u)", _IOC_SIZE(code));
+ return 1;
+ case 0x07:
+ tprintf("HIDIOCGFEATURE(%u)", _IOC_SIZE(code));
+ return 1;
+ default:
+ return 0;
+ }
+ }
+
+ return 0;
+}
+
+static int
+ioctl_decode_command_number(struct tcb *tcp)
+{
+ const unsigned int code = tcp->u_arg[1];
+
+ switch (_IOC_TYPE(code)) {
+ case 'E':
+ return evdev_decode_number(code);
+ case 'H':
+ return hiddev_decode_number(code);
+ case 'M':
+ if (_IOC_DIR(code) == _IOC_WRITE) {
+ tprintf("MIXER_WRITE(%u)", _IOC_NR(code));
+ return 1;
+ } else if (_IOC_DIR(code) == _IOC_READ) {
+ tprintf("MIXER_READ(%u)", _IOC_NR(code));
+ return 1;
+ }
+ return 0;
+ case 'U':
+ if (_IOC_DIR(code) == _IOC_READ && _IOC_NR(code) == 0x2c) {
+ tprintf("UI_GET_SYSNAME(%u)", _IOC_SIZE(code));
+ return 1;
+ }
+ return 0;
+ case 'j':
+ if (_IOC_DIR(code) == _IOC_READ && _IOC_NR(code) == 0x13) {
+ tprintf("JSIOCGNAME(%u)", _IOC_SIZE(code));
+ return 1;
+ }
+ return 0;
+ case 'k':
+ if (_IOC_DIR(code) == _IOC_WRITE && _IOC_NR(code) == 0) {
+ tprintf("SPI_IOC_MESSAGE(%u)", _IOC_SIZE(code));
+ return 1;
+ }
+ return 0;
+ default:
+ return 0;
+ }
+}
+
+static int
+f_ioctl(struct tcb *tcp, const unsigned int code, const kernel_ulong_t arg)
+{
+ int rc = fs_f_ioctl(tcp, code, arg);
+#if defined ALPHA
+ if (rc == RVAL_DECODED)
+ rc = sock_ioctl(tcp, code, arg);
+ if (rc == RVAL_DECODED)
+ rc = term_ioctl(tcp, code, arg);
+#elif defined MIPS || defined SH || defined XTENSA
+ if (rc == RVAL_DECODED)
+ rc = sock_ioctl(tcp, code, arg);
+#elif defined POWERPC
+ if (rc == RVAL_DECODED)
+ rc = term_ioctl(tcp, code, arg);
+#endif
+ return rc;
+}
+
+/**
+ * Decode arg parameter of the ioctl call.
+ *
+ * @return There are two flags of the return value important for the purposes of
+ * processing by SYS_FUNC(ioctl):
+ * - RVAL_IOCTL_DECODED: indicates that ioctl decoder code
+ * has printed arg parameter;
+ * - RVAL_DECODED: indicates that decoding is done.
+ * As a result, the following behaviour is expected:
+ * - on entering:
+ * - 0: decoding should be continued on exiting;
+ * - RVAL_IOCTL_DECODED: decoding on exiting is not needed
+ * and decoder has printed arg value;
+ * - RVAL_DECODED: decoding on exiting is not needed
+ * and generic handler should print arg value.
+ * - on exiting:
+ * - 0: generic handler should print arg value;
+ * - RVAL_IOCTL_DECODED: decoder has printed arg value.
+ *
+ * Note that it makes no sense to return just RVAL_DECODED on exiting,
+ * but, of course, it is not prohibited (for example, it may be useful
+ * in cases where the return path is common on entering and on exiting
+ * the syscall).
+ *
+ * SYS_FUNC(ioctl) converts RVAL_IOCTL_DECODED flag to RVAL_DECODED,
+ * and passes all other bits of ioctl_decode return value unchanged.
+ */
+static int
+ioctl_decode(struct tcb *tcp)
+{
+ const unsigned int code = tcp->u_arg[1];
+ const kernel_ulong_t arg = tcp->u_arg[2];
+
+ switch (_IOC_TYPE(code)) {
+ case 0x03:
+ return hdio_ioctl(tcp, code, arg);
+ case 0x12:
+ return block_ioctl(tcp, code, arg);
+ case '"': /* 0x22 */
+ return scsi_ioctl(tcp, code, arg);
+ case '$': /* 0x24 */
+ return perf_ioctl(tcp, code, arg);
+#ifdef HAVE_STRUCT_PTP_SYS_OFFSET
+ case '=': /* 0x3d */
+ return ptp_ioctl(tcp, code, arg);
+#endif
+#ifdef HAVE_LINUX_INPUT_H
+ case 'E':
+ return evdev_ioctl(tcp, code, arg);
+#endif
+ case 'I':
+ return inotify_ioctl(tcp, code, arg);
+ case 'L':
+ return loop_ioctl(tcp, code, arg);
+#ifdef HAVE_STRUCT_MTD_WRITE_REQ
+ case 'M':
+ return mtd_ioctl(tcp, code, arg);
+#endif
+#ifdef HAVE_STRUCT_UBI_ATTACH_REQ_MAX_BEB_PER1024
+ case 'O':
+ return ubi_ioctl(tcp, code, arg);
+#endif
+ case 'R':
+ return random_ioctl(tcp, code, arg);
+ case 'T':
+ return term_ioctl(tcp, code, arg);
+ case 'V':
+ return v4l2_ioctl(tcp, code, arg);
+ case 'W':
+ return watchdog_ioctl(tcp, code, arg);
+ case 'X':
+ return fs_x_ioctl(tcp, code, arg);
+ case 'f':
+ return f_ioctl(tcp, code, arg);
+#ifdef HAVE_STRUCT_UBI_ATTACH_REQ_MAX_BEB_PER1024
+ case 'o':
+ return ubi_ioctl(tcp, code, arg);
+#endif
+ case 'p':
+ return rtc_ioctl(tcp, code, arg);
+#if defined ALPHA || defined MIPS || defined SH || defined XTENSA
+ case 's':
+ return sock_ioctl(tcp, code, arg);
+#endif
+#if defined(ALPHA) || defined(POWERPC)
+ case 't':
+ return term_ioctl(tcp, code, arg);
+#endif /* !ALPHA */
+ case 0x89:
+ return sock_ioctl(tcp, code, arg);
+ case 0x94:
+ return fs_0x94_ioctl(tcp, code, arg);
+ case 0xa4:
+ return tee_ioctl(tcp, code, arg);
+#ifdef HAVE_LINUX_USERFAULTFD_H
+ case 0xaa:
+ return uffdio_ioctl(tcp, code, arg);
+#endif
+ case 0xab:
+ return nbd_ioctl(tcp, code, arg);
+#ifdef HAVE_LINUX_KVM_H
+ case 0xae:
+ return kvm_ioctl(tcp, code, arg);
+#endif
+ case 0xb4:
+ return gpio_ioctl(tcp, code, arg);
+ case 0xb7:
+ return nsfs_ioctl(tcp, code, arg);
+#ifdef HAVE_LINUX_DM_IOCTL_H
+ case 0xfd:
+ return dm_ioctl(tcp, code, arg);
+#endif
+ default:
+ break;
+ }
+ return 0;
+}
+
+SYS_FUNC(ioctl)
+{
+ const struct_ioctlent *iop;
+ int ret;
+
+ if (entering(tcp)) {
+ printfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+
+ if (xlat_verbosity != XLAT_STYLE_ABBREV)
+ tprintf("%#x", (unsigned int) tcp->u_arg[1]);
+ if (xlat_verbosity == XLAT_STYLE_VERBOSE)
+ tprints(" /* ");
+ if (xlat_verbosity != XLAT_STYLE_RAW) {
+ ret = ioctl_decode_command_number(tcp);
+ if (!(ret & IOCTL_NUMBER_STOP_LOOKUP)) {
+ iop = ioctl_lookup(tcp->u_arg[1]);
+ if (iop) {
+ if (ret)
+ tprints(" or ");
+ tprints(iop->symbol);
+ while ((iop = ioctl_next_match(iop)))
+ tprintf(" or %s", iop->symbol);
+ } else if (!ret) {
+ ioctl_print_code(tcp->u_arg[1]);
+ }
+ }
+ }
+ if (xlat_verbosity == XLAT_STYLE_VERBOSE)
+ tprints(" */");
+
+ ret = ioctl_decode(tcp);
+ } else {
+ ret = ioctl_decode(tcp) | RVAL_DECODED;
+ }
+
+ if (ret & RVAL_IOCTL_DECODED) {
+ ret &= ~RVAL_IOCTL_DECODED;
+ ret |= RVAL_DECODED;
+ } else if (ret & RVAL_DECODED) {
+ tprintf(", %#" PRI_klx, tcp->u_arg[2]);
+ }
+
+ return ret;
+}
diff --git a/src/ioctl_iocdef.c b/src/ioctl_iocdef.c
new file mode 100644
index 000000000..1f43fc417
--- /dev/null
+++ b/src/ioctl_iocdef.c
@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2017 Alexey Neyman <stilor@att.net>
+ * Copyright (c) 2017-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+/*
+ * This file is *PREPROCESSED*, not *COMPILED* for host and the result
+ * is included into ioctlsort (which is compiled for build). Since some
+ * of these values are used in structure initializers, they cannot be
+ * defined as 'const unsigned int' - instead, they have to be macros.
+ * Hence, the result of preprocessing will be run through sed to change
+ * 'DEFINE' into '#define'
+ */
+#include <linux/ioctl.h>
+
+DEFINE HOST_IOC_NONE _IOC_NONE
+DEFINE HOST_IOC_READ _IOC_READ
+DEFINE HOST_IOC_WRITE _IOC_WRITE
+
+DEFINE HOST_IOC_SIZESHIFT _IOC_SIZESHIFT
+DEFINE HOST_IOC_DIRSHIFT _IOC_DIRSHIFT
diff --git a/src/ioctlsort.c b/src/ioctlsort.c
new file mode 100644
index 000000000..b92cbecce
--- /dev/null
+++ b/src/ioctlsort.c
@@ -0,0 +1,145 @@
+/*
+ * Copyright (c) 2001 Wichert Akkerman <wichert@cistron.nl>
+ * Copyright (c) 2004-2015 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 1999-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "ioctl_iocdef.h"
+
+struct ioctlent {
+ const char *info;
+ const char *name;
+ unsigned int dir;
+ unsigned int type_nr;
+ unsigned int size;
+};
+
+static int
+is_prefix(const char *s1, const char *s2)
+{
+ size_t len = strlen(s1);
+
+ if (len > strlen(s2))
+ return 0;
+ return !memcmp(s1, s2, len);
+}
+
+static int
+compare_name_info(const void *a, const void *b)
+{
+ int rc;
+
+ const char *name1 = ((struct ioctlent *) a)->name;
+ const char *name2 = ((struct ioctlent *) b)->name;
+ const char *info1 = ((struct ioctlent *) a)->info;
+ const char *info2 = ((struct ioctlent *) b)->info;
+
+ rc = strcmp(name1, name2);
+ if (rc)
+ return rc;
+
+ /*
+ * exception from lexicographical order:
+ * "asm/" < "asm-generic/"
+ */
+ if (is_prefix("asm/", info1) &&
+ is_prefix("asm-generic/", info2))
+ return -1;
+
+ if (is_prefix("asm/", info2) &&
+ is_prefix("asm-generic/", info1))
+ return 1;
+
+ return strcmp(info1, info2);
+}
+
+static unsigned int
+code(const struct ioctlent *e)
+{
+ return e->type_nr |
+ (e->size << _IOC_SIZESHIFT) |
+ (e->dir << _IOC_DIRSHIFT);
+}
+
+static int
+compare_code_name(const void *a, const void *b)
+{
+ unsigned int code1 = code((struct ioctlent *) a);
+ unsigned int code2 = code((struct ioctlent *) b);
+ const char *name1 = ((struct ioctlent *) a)->name;
+ const char *name2 = ((struct ioctlent *) b)->name;
+ return (code1 > code2) ?
+ 1 : (code1 < code2) ? -1 : strcmp(name1, name2);
+}
+
+static void
+ioctlsort(struct ioctlent *ioctls, size_t nioctls)
+{
+ size_t i;
+
+ qsort(ioctls, nioctls, sizeof(ioctls[0]), compare_name_info);
+
+ for (i = 1; i < nioctls; ++i)
+ if (!strcmp(ioctls[i-1].name, ioctls[i].name)) {
+ /*
+ * If there are multiple definitions for the same
+ * name, keep the first one and mark all the rest
+ * for deletion.
+ */
+ ioctls[i].info = NULL;
+ }
+
+ for (i = 1; i < nioctls; ++i)
+ if (!ioctls[i].info) {
+ /*
+ * Change ioctl code of marked elements
+ * to make them sorted to the end of array.
+ */
+ ioctls[i].dir =
+ ioctls[i].type_nr =
+ ioctls[i].size = 0xffffffffu;
+ }
+
+ qsort(ioctls, nioctls, sizeof(ioctls[0]), compare_code_name);
+
+ puts("/* Generated by ioctlsort. */");
+ for (i = 0; i < nioctls; ++i) {
+ if (!ioctls[i].info) {
+ /*
+ * We've reached the first element marked for deletion.
+ */
+ break;
+ }
+ if (i == 0 || code(&ioctls[i-1]) != code(&ioctls[i]) ||
+ !is_prefix(ioctls[i-1].name, ioctls[i].name))
+ printf("{ \"%s\", %#010x },\n",
+ ioctls[i].name, code(ioctls+i));
+ }
+}
+
+static struct ioctlent ioctls[] = {
+#ifdef IOCTLSORT_INC
+# include IOCTLSORT_INC
+#else
+# include "ioctls_arch.h"
+# include "ioctls_inc.h"
+#endif
+};
+
+int
+main(void)
+{
+ ioctlsort(ioctls, sizeof(ioctls) / sizeof(ioctls[0]));
+ return 0;
+}
diff --git a/src/ioperm.c b/src/ioperm.c
new file mode 100644
index 000000000..4dd3a2203
--- /dev/null
+++ b/src/ioperm.c
@@ -0,0 +1,16 @@
+/*
+ * Copyright (c) 2015-2018 Dmitry V. Levin <ldv@strace.io>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+SYS_FUNC(ioperm)
+{
+ tprintf("%#" PRI_klx ", %#" PRI_klx ", %d",
+ tcp->u_arg[0], tcp->u_arg[1], (int) tcp->u_arg[2]);
+
+ return RVAL_DECODED;
+}
diff --git a/src/iopl.c b/src/iopl.c
new file mode 100644
index 000000000..0e2c5da75
--- /dev/null
+++ b/src/iopl.c
@@ -0,0 +1,15 @@
+/*
+ * Copyright (c) 2015-2018 Dmitry V. Levin <ldv@strace.io>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+SYS_FUNC(iopl)
+{
+ tprintf("%d", (int) tcp->u_arg[0]);
+
+ return RVAL_DECODED;
+}
diff --git a/src/ioprio.c b/src/ioprio.c
new file mode 100644
index 000000000..f98300e9b
--- /dev/null
+++ b/src/ioprio.c
@@ -0,0 +1,106 @@
+/*
+ * Copyright (c) 2015 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2014-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include "xstring.h"
+
+#include "xlat/ioprio_who.h"
+#include "xlat/ioprio_class.h"
+
+#define IOPRIO_CLASS_SHIFT (13)
+#define IOPRIO_PRIO_MASK ((1ul << IOPRIO_CLASS_SHIFT) - 1)
+
+#define IOPRIO_PRIO_CLASS(mask) ((mask) >> IOPRIO_CLASS_SHIFT)
+#define IOPRIO_PRIO_DATA(mask) ((mask) & IOPRIO_PRIO_MASK)
+
+static const char *
+sprint_ioprio(unsigned int ioprio)
+{
+ static char outstr[256];
+ char class_buf[64];
+ unsigned int class, data;
+
+ class = IOPRIO_PRIO_CLASS(ioprio);
+ data = IOPRIO_PRIO_DATA(ioprio);
+ sprintxval(class_buf, sizeof(class_buf), ioprio_class, class,
+ "IOPRIO_CLASS_???");
+ xsprintf(outstr, "IOPRIO_PRIO_VALUE(%s, %d)", class_buf, data);
+
+ return outstr;
+}
+
+void
+print_ioprio(unsigned int ioprio)
+{
+ if (xlat_verbose(xlat_verbosity) != XLAT_STYLE_ABBREV)
+ tprintf("%#x", ioprio);
+
+ if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_RAW)
+ return;
+
+ const char *str = sprint_ioprio(ioprio);
+
+ (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE
+ ? tprints_comment : tprints)(str);
+}
+
+static void
+ioprio_print_who(struct tcb *tcp, int which, int who)
+{
+ switch (which)
+ {
+ case IOPRIO_WHO_PROCESS:
+ printpid(tcp, who, PT_TGID);
+ break;
+ case IOPRIO_WHO_PGRP:
+ printpid(tcp, who, PT_PGID);
+ break;
+ default:
+ tprintf("%d", who);
+ break;
+ }
+}
+
+SYS_FUNC(ioprio_get)
+{
+ if (entering(tcp)) {
+ /* int which */
+ printxval(ioprio_who, tcp->u_arg[0], "IOPRIO_WHO_???");
+ tprints(", ");
+ ioprio_print_who(tcp, tcp->u_arg[0], tcp->u_arg[1]);
+ return 0;
+ } else {
+ if (syserror(tcp))
+ return 0;
+ if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_RAW)
+ tcp->auxstr = NULL;
+ else
+ tcp->auxstr = sprint_ioprio(tcp->u_rval);
+ return RVAL_STR;
+ }
+}
+
+SYS_FUNC(ioprio_set)
+{
+ /* int which */
+ printxval(ioprio_who, tcp->u_arg[0], "IOPRIO_WHO_???");
+ tprints(", ");
+ ioprio_print_who(tcp, tcp->u_arg[0], tcp->u_arg[1]);
+ tprints(", ");
+ /* int ioprio */
+ if (xlat_verbose(xlat_verbosity) != XLAT_STYLE_ABBREV)
+ tprintf("%d", (int) tcp->u_arg[2]);
+
+ if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_RAW)
+ return RVAL_DECODED;
+
+ (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE
+ ? tprints_comment : tprints)(sprint_ioprio(tcp->u_arg[2]));
+
+ return RVAL_DECODED;
+}
diff --git a/src/ipc.c b/src/ipc.c
new file mode 100644
index 000000000..52cadea2f
--- /dev/null
+++ b/src/ipc.c
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2016 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 1999-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include "xlat/ipccalls.h"
+
+SYS_FUNC(ipc)
+{
+ unsigned int call = tcp->u_arg[0];
+ unsigned int version = call >> 16;
+ call &= 0xffff;
+
+ if (version)
+ tprintf("%u<<16|", version);
+
+ printxval_u(ipccalls, call, NULL);
+
+ unsigned int i;
+ for (i = 1; i < n_args(tcp); ++i)
+ tprintf(", %#" PRI_klx, tcp->u_arg[i]);
+
+ return RVAL_DECODED;
+}
diff --git a/src/ipc_defs.h b/src/ipc_defs.h
new file mode 100644
index 000000000..1fb5a7920
--- /dev/null
+++ b/src/ipc_defs.h
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2003 Roland McGrath <roland@redhat.com>
+ * Copyright (c) 2003-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_IPC_DEFS_H
+# define STRACE_IPC_DEFS_H
+
+# ifdef HAVE_LINUX_IPC_H
+# if defined MPERS_IS_m32
+# if defined ARCH_M32_SIZEOF_STRUCT_MSQID64_DS && \
+ defined M32_SIZEOF_STRUCT_MSQID64_DS && \
+ ARCH_M32_SIZEOF_STRUCT_MSQID64_DS != M32_SIZEOF_STRUCT_MSQID64_DS
+# undef HAVE_LINUX_IPC_H
+# endif
+# elif defined MPERS_IS_mx32
+# if defined ARCH_MX32_SIZEOF_STRUCT_MSQID64_DS && \
+ defined MX32_SIZEOF_STRUCT_MSQID64_DS && \
+ ARCH_MX32_SIZEOF_STRUCT_MSQID64_DS != MX32_SIZEOF_STRUCT_MSQID64_DS
+# undef HAVE_LINUX_IPC_H
+# endif
+# else /* !IN_MPERS */
+# if defined ARCH_SIZEOF_STRUCT_MSQID64_DS && \
+ defined SIZEOF_STRUCT_MSQID64_DS && \
+ ARCH_SIZEOF_STRUCT_MSQID64_DS != SIZEOF_STRUCT_MSQID64_DS
+# undef HAVE_LINUX_IPC_H
+# endif
+# endif
+# endif /* HAVE_LINUX_IPC_H */
+
+# if defined HAVE_LINUX_IPC_H
+# include <linux/ipc.h>
+# define MSG_H_PROVIDER "linux/msg.h"
+# define SEM_H_PROVIDER "linux/sem.h"
+# define SHM_H_PROVIDER "linux/shm.h"
+# define NAME_OF_STRUCT_MSQID_DS msqid64_ds
+# define NAME_OF_STRUCT_SEMID_DS semid64_ds
+# define NAME_OF_STRUCT_SHMID_DS shmid64_ds
+# define NAME_OF_STRUCT_SHMINFO shminfo64
+# define NAME_OF_STRUCT_IPC_PERM_KEY key
+# elif defined HAVE_SYS_IPC_H
+# include <sys/ipc.h>
+# define MSG_H_PROVIDER "sys/msg.h"
+# define SEM_H_PROVIDER "sys/sem.h"
+# define SHM_H_PROVIDER "sys/shm.h"
+# define NAME_OF_STRUCT_MSQID_DS msqid_ds
+# define NAME_OF_STRUCT_SEMID_DS semid_ds
+# define NAME_OF_STRUCT_SHMID_DS shmid_ds
+# define NAME_OF_STRUCT_SHMINFO shminfo
+# define NAME_OF_STRUCT_IPC_PERM_KEY __key
+# else
+# error Neither <sys/ipc.h> nor <linux/ipc.h> is available
+# endif
+
+# if !defined IPC_64
+# define IPC_64 0x100
+# endif
+
+# define PRINTCTL(flagset, arg, dflt) \
+ do { \
+ if ((arg) & IPC_64) { \
+ print_xlat(IPC_64); \
+ tprints("|"); \
+ } \
+ printxval((flagset), (arg) & ~IPC_64, dflt); \
+ } while (0)
+
+#endif /* !STRACE_IPC_DEFS_H */
diff --git a/src/ipc_msg.c b/src/ipc_msg.c
new file mode 100644
index 000000000..9b98054b0
--- /dev/null
+++ b/src/ipc_msg.c
@@ -0,0 +1,111 @@
+/*
+ * Copyright (c) 1993 Ulrich Pegelow <pegelow@moorea.uni-muenster.de>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
+ * Copyright (c) 2003-2006 Roland McGrath <roland@redhat.com>
+ * Copyright (c) 2006-2015 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2015-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include "ipc_defs.h"
+
+#include MSG_H_PROVIDER
+
+#include "xlat/ipc_msg_flags.h"
+#include "xlat/ipc_private.h"
+#include "xlat/resource_flags.h"
+
+SYS_FUNC(msgget)
+{
+ printxval(ipc_private, (unsigned int) tcp->u_arg[0], NULL);
+ tprints(", ");
+ if (printflags(resource_flags, tcp->u_arg[1] & ~0777, NULL) != 0)
+ tprints("|");
+ print_numeric_umode_t(tcp->u_arg[1] & 0777);
+ return RVAL_DECODED;
+}
+
+static void
+tprint_msgsnd(struct tcb *const tcp, const kernel_ulong_t addr,
+ const kernel_ulong_t count, const unsigned int flags)
+{
+ tprint_msgbuf(tcp, addr, count);
+ printflags(ipc_msg_flags, flags, "MSG_???");
+}
+
+SYS_FUNC(msgsnd)
+{
+ tprintf("%d, ", (int) tcp->u_arg[0]);
+ if (indirect_ipccall(tcp)) {
+ tprint_msgsnd(tcp, tcp->u_arg[3], tcp->u_arg[1],
+ tcp->u_arg[2]);
+ } else {
+ tprint_msgsnd(tcp, tcp->u_arg[1], tcp->u_arg[2],
+ tcp->u_arg[3]);
+ }
+ return RVAL_DECODED;
+}
+
+static void
+tprint_msgrcv(struct tcb *const tcp, const kernel_ulong_t addr,
+ const kernel_ulong_t count, const kernel_ulong_t msgtyp)
+{
+ tprint_msgbuf(tcp, addr, count);
+ tprintf("%" PRI_kld ", ", msgtyp);
+}
+
+static int
+fetch_msgrcv_args(struct tcb *const tcp, const kernel_ulong_t addr,
+ kernel_ulong_t *const pair)
+{
+ if (current_wordsize == sizeof(*pair)) {
+ if (umoven_or_printaddr(tcp, addr, 2 * sizeof(*pair), pair))
+ return -1;
+ } else {
+ unsigned int tmp[2];
+
+ if (umove_or_printaddr(tcp, addr, &tmp))
+ return -1;
+ pair[0] = tmp[0];
+ pair[1] = (int) tmp[1];
+ }
+ return 0;
+}
+
+SYS_FUNC(msgrcv)
+{
+ if (entering(tcp)) {
+ tprintf("%d, ", (int) tcp->u_arg[0]);
+ } else {
+ if (indirect_ipccall(tcp)) {
+ const bool direct =
+#ifdef SPARC64
+ current_wordsize == 8 ||
+#endif
+ get_tcb_priv_ulong(tcp) != 0;
+ if (direct) {
+ tprint_msgrcv(tcp, tcp->u_arg[3],
+ tcp->u_arg[1], tcp->u_arg[4]);
+ } else {
+ kernel_ulong_t pair[2];
+
+ if (fetch_msgrcv_args(tcp, tcp->u_arg[3], pair))
+ tprintf(", %" PRI_klu ", ", tcp->u_arg[1]);
+ else
+ tprint_msgrcv(tcp, pair[0],
+ tcp->u_arg[1], pair[1]);
+ }
+ printflags(ipc_msg_flags, tcp->u_arg[2], "MSG_???");
+ } else {
+ tprint_msgrcv(tcp, tcp->u_arg[1],
+ tcp->u_arg[2], tcp->u_arg[3]);
+ printflags(ipc_msg_flags, tcp->u_arg[4], "MSG_???");
+ }
+ }
+ return 0;
+}
diff --git a/src/ipc_msgctl.c b/src/ipc_msgctl.c
new file mode 100644
index 000000000..4c95e5cd3
--- /dev/null
+++ b/src/ipc_msgctl.c
@@ -0,0 +1,155 @@
+/*
+ * Copyright (c) 1993 Ulrich Pegelow <pegelow@moorea.uni-muenster.de>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
+ * Copyright (c) 2003-2006 Roland McGrath <roland@redhat.com>
+ * Copyright (c) 2006-2015 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2015-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#include DEF_MPERS_TYPE(msqid_ds_t)
+
+#include "ipc_defs.h"
+
+#include MSG_H_PROVIDER
+typedef struct NAME_OF_STRUCT_MSQID_DS msqid_ds_t;
+
+#include MPERS_DEFS
+
+#include "xlat/msgctl_flags.h"
+
+#define key NAME_OF_STRUCT_IPC_PERM_KEY
+
+static void
+print_ipc_perm(const typeof_field(msqid_ds_t, msg_perm) *const p,
+ const unsigned int cmd)
+{
+ tprint_struct_begin();
+ PRINT_FIELD_ID(*p, uid);
+ tprint_struct_next();
+ PRINT_FIELD_ID(*p, gid);
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_U(*p, mode, print_numeric_ll_umode_t);
+ if (cmd != IPC_SET) {
+ tprint_struct_next();
+ PRINT_FIELD_U(*p, key);
+ tprint_struct_next();
+ PRINT_FIELD_ID(*p, cuid);
+ tprint_struct_next();
+ PRINT_FIELD_ID(*p, cgid);
+ }
+ tprint_struct_end();
+}
+
+static void
+print_msqid_ds(struct tcb *const tcp, const kernel_ulong_t addr,
+ const unsigned int cmd)
+{
+ msqid_ds_t msqid_ds;
+
+ if (umove_or_printaddr(tcp, addr, &msqid_ds))
+ return;
+
+ tprint_struct_begin();
+ PRINT_FIELD_OBJ_PTR(msqid_ds, msg_perm, print_ipc_perm, cmd);
+ if (cmd != IPC_SET) {
+ tprint_struct_next();
+ PRINT_FIELD_U(msqid_ds, msg_stime);
+ tprint_struct_next();
+ PRINT_FIELD_U(msqid_ds, msg_rtime);
+ tprint_struct_next();
+ PRINT_FIELD_U(msqid_ds, msg_ctime);
+ tprint_struct_next();
+ PRINT_FIELD_U(msqid_ds, msg_qnum);
+ }
+ tprint_struct_next();
+ PRINT_FIELD_U(msqid_ds, msg_qbytes);
+ if (cmd != IPC_SET) {
+ tprint_struct_next();
+ PRINT_FIELD_D(msqid_ds, msg_lspid);
+ tprint_struct_next();
+ PRINT_FIELD_D(msqid_ds, msg_lrpid);
+ }
+ tprint_struct_end();
+}
+
+static void
+print_msginfo(struct tcb *const tcp, const kernel_ulong_t addr,
+ const unsigned int cmd)
+{
+ struct msginfo info;
+
+ if (umove_or_printaddr(tcp, addr, &info))
+ return;
+
+ tprint_struct_begin();
+ PRINT_FIELD_D(info, msgpool);
+ tprint_struct_next();
+ PRINT_FIELD_D(info, msgmap);
+ tprint_struct_next();
+ PRINT_FIELD_D(info, msgmax);
+ tprint_struct_next();
+ PRINT_FIELD_D(info, msgmnb);
+ tprint_struct_next();
+ PRINT_FIELD_D(info, msgmni);
+ tprint_struct_next();
+ PRINT_FIELD_D(info, msgssz);
+ tprint_struct_next();
+ PRINT_FIELD_D(info, msgtql);
+ tprint_struct_next();
+ PRINT_FIELD_U(info, msgseg);
+ tprint_struct_end();
+}
+
+SYS_FUNC(msgctl)
+{
+ const kernel_ulong_t addr = tcp->u_arg[indirect_ipccall(tcp) ? 3 : 2];
+ unsigned int cmd = tcp->u_arg[1];
+
+ /* TODO: We don't properly decode old compat ipc calls. */
+ if (cmd & IPC_64)
+ cmd &= ~IPC_64;
+
+ if (entering(tcp)) {
+ tprintf("%d, ", (int) tcp->u_arg[0]);
+ PRINTCTL(msgctl_flags, tcp->u_arg[1], "MSG_???");
+ tprints(", ");
+ switch (cmd) {
+ case IPC_SET:
+ print_msqid_ds(tcp, addr, cmd);
+ return RVAL_DECODED;
+
+ case IPC_STAT:
+ case MSG_STAT:
+ case MSG_STAT_ANY:
+ case IPC_INFO:
+ case MSG_INFO:
+ /* decode on exiting */
+ break;
+
+ default:
+ printaddr(addr);
+ return RVAL_DECODED;
+ }
+ } else {
+ switch (cmd) {
+ case IPC_STAT:
+ case MSG_STAT:
+ case MSG_STAT_ANY:
+ print_msqid_ds(tcp, addr, cmd);
+ break;
+
+ case IPC_INFO:
+ case MSG_INFO:
+ print_msginfo(tcp, addr, cmd);
+ break;
+ }
+ }
+ return 0;
+}
diff --git a/src/ipc_sem.c b/src/ipc_sem.c
new file mode 100644
index 000000000..1be0bb6d7
--- /dev/null
+++ b/src/ipc_sem.c
@@ -0,0 +1,98 @@
+/*
+ * Copyright (c) 1993 Ulrich Pegelow <pegelow@moorea.uni-muenster.de>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
+ * Copyright (c) 2003-2006 Roland McGrath <roland@redhat.com>
+ * Copyright (c) 2006-2015 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2015-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include "ipc_defs.h"
+
+#include SEM_H_PROVIDER
+
+#include "xlat/semop_flags.h"
+
+static bool
+print_sembuf(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data)
+{
+ const struct sembuf *const sb = elem_buf;
+
+ tprint_struct_begin();
+ PRINT_FIELD_U(*sb, sem_num);
+ tprint_struct_next();
+ PRINT_FIELD_D(*sb, sem_op);
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(*sb, sem_flg, semop_flags, "SEM_???");
+ tprint_struct_end();
+
+ return true;
+}
+
+static void
+tprint_sembuf_array(struct tcb *const tcp, const kernel_ulong_t addr,
+ const unsigned int count)
+{
+ struct sembuf sb;
+ print_array(tcp, addr, count, &sb, sizeof(sb),
+ tfetch_mem, print_sembuf, 0);
+ tprintf(", %u", count);
+}
+
+SYS_FUNC(semop)
+{
+ tprintf("%d, ", (int) tcp->u_arg[0]);
+ if (indirect_ipccall(tcp)) {
+ tprint_sembuf_array(tcp, tcp->u_arg[3], tcp->u_arg[1]);
+ } else {
+ tprint_sembuf_array(tcp, tcp->u_arg[1], tcp->u_arg[2]);
+ }
+ return RVAL_DECODED;
+}
+
+static int
+do_semtimedop(struct tcb *const tcp, const print_obj_by_addr_fn print_ts)
+{
+ tprintf("%d, ", (int) tcp->u_arg[0]);
+ if (indirect_ipccall(tcp)) {
+ tprint_sembuf_array(tcp, tcp->u_arg[3], tcp->u_arg[1]);
+ tprints(", ");
+#if defined(S390) || defined(S390X)
+ print_ts(tcp, tcp->u_arg[2]);
+#else
+ print_ts(tcp, tcp->u_arg[4]);
+#endif
+ } else {
+ tprint_sembuf_array(tcp, tcp->u_arg[1], tcp->u_arg[2]);
+ tprints(", ");
+ print_ts(tcp, tcp->u_arg[3]);
+ }
+ return RVAL_DECODED;
+}
+
+#if HAVE_ARCH_TIME32_SYSCALLS
+SYS_FUNC(semtimedop_time32)
+{
+ return do_semtimedop(tcp, print_timespec32);
+}
+#endif
+
+SYS_FUNC(semtimedop_time64)
+{
+ return do_semtimedop(tcp, print_timespec64);
+}
+
+SYS_FUNC(semget)
+{
+ printxval(ipc_private, (unsigned int) tcp->u_arg[0], NULL);
+ tprintf(", %d, ", (int) tcp->u_arg[1]);
+ if (printflags(resource_flags, tcp->u_arg[2] & ~0777, NULL) != 0)
+ tprints("|");
+ print_numeric_umode_t(tcp->u_arg[2] & 0777);
+ return RVAL_DECODED;
+}
diff --git a/src/ipc_semctl.c b/src/ipc_semctl.c
new file mode 100644
index 000000000..c4bbceca1
--- /dev/null
+++ b/src/ipc_semctl.c
@@ -0,0 +1,186 @@
+/*
+ * Copyright (c) 1993 Ulrich Pegelow <pegelow@moorea.uni-muenster.de>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
+ * Copyright (c) 2003-2006 Roland McGrath <roland@redhat.com>
+ * Copyright (c) 2006-2015 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2015-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#include DEF_MPERS_TYPE(semid_ds_t)
+#include DEF_MPERS_TYPE(semun_ptr_t)
+
+#include "ipc_defs.h"
+
+#include SEM_H_PROVIDER
+
+typedef struct NAME_OF_STRUCT_SEMID_DS semid_ds_t;
+typedef kernel_ulong_t semun_ptr_t;
+
+#include MPERS_DEFS
+
+#include "xlat/semctl_flags.h"
+
+#define key NAME_OF_STRUCT_IPC_PERM_KEY
+
+static void
+print_ipc_perm(const typeof_field(semid_ds_t, sem_perm) *const p,
+ const unsigned int cmd)
+{
+ tprint_struct_begin();
+ PRINT_FIELD_ID(*p, uid);
+ tprint_struct_next();
+ PRINT_FIELD_ID(*p, gid);
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_U(*p, mode, print_numeric_ll_umode_t);
+ if (cmd != IPC_SET) {
+ tprint_struct_next();
+ PRINT_FIELD_U(*p, key);
+ tprint_struct_next();
+ PRINT_FIELD_ID(*p, cuid);
+ tprint_struct_next();
+ PRINT_FIELD_ID(*p, cgid);
+ }
+ tprint_struct_end();
+}
+
+static void
+print_semid_ds(struct tcb *const tcp, const kernel_ulong_t addr,
+ const unsigned int cmd, const bool indirect_addr)
+{
+ semid_ds_t ds;
+
+ if (!tfetch_mem(tcp, addr, sizeof(ds), &ds)) {
+ if (indirect_addr)
+ tprints("[");
+ printaddr(addr);
+ if (indirect_addr)
+ tprints("]");
+ return;
+ }
+
+ tprint_struct_begin();
+ PRINT_FIELD_OBJ_PTR(ds, sem_perm, print_ipc_perm, cmd);
+ if (cmd != IPC_SET) {
+ tprint_struct_next();
+ PRINT_FIELD_U(ds, sem_otime);
+ tprint_struct_next();
+ PRINT_FIELD_U(ds, sem_ctime);
+ tprint_struct_next();
+ PRINT_FIELD_U(ds, sem_nsems);
+ }
+ tprint_struct_end();
+}
+
+static void
+print_seminfo(struct tcb *const tcp, const kernel_ulong_t addr,
+ const unsigned int cmd, const bool indirect_addr)
+{
+ struct seminfo info;
+
+ if (umove_or_printaddr(tcp, addr, &info))
+ return;
+ if (!tfetch_mem(tcp, addr, sizeof(info), &info)) {
+ if (indirect_addr)
+ tprints("[");
+ printaddr(addr);
+ if (indirect_addr)
+ tprints("]");
+ return;
+ }
+
+ tprint_struct_begin();
+ PRINT_FIELD_D(info, semmap);
+ tprint_struct_next();
+ PRINT_FIELD_D(info, semmni);
+ tprint_struct_next();
+ PRINT_FIELD_D(info, semmns);
+ tprint_struct_next();
+ PRINT_FIELD_D(info, semmnu);
+ tprint_struct_next();
+ PRINT_FIELD_D(info, semmsl);
+ tprint_struct_next();
+ PRINT_FIELD_D(info, semopm);
+ tprint_struct_next();
+ PRINT_FIELD_D(info, semume);
+ tprint_struct_next();
+ PRINT_FIELD_D(info, semusz);
+ tprint_struct_next();
+ PRINT_FIELD_D(info, semvmx);
+ tprint_struct_next();
+ PRINT_FIELD_D(info, semaem);
+ tprint_struct_end();
+}
+
+SYS_FUNC(semctl)
+{
+ kernel_ulong_t addr;
+ unsigned int cmd = tcp->u_arg[2];
+ const bool indirect_addr = indirect_ipccall(tcp)
+#ifdef SPARC64
+ && current_personality != 0
+#endif
+ ;
+
+ /* TODO: We don't properly decode old compat ipc calls. */
+ if (cmd & IPC_64)
+ cmd &= ~IPC_64;
+
+ if (entering(tcp)) {
+ tprintf("%d, %d, ", (int) tcp->u_arg[0], (int) tcp->u_arg[1]);
+ PRINTCTL(semctl_flags, tcp->u_arg[2], "SEM_???");
+ tprints(", ");
+
+ if (indirect_addr) {
+ semun_ptr_t ptr;
+ if (umove_or_printaddr(tcp, tcp->u_arg[3], &ptr))
+ return RVAL_DECODED;
+ addr = ptr;
+ } else {
+ addr = tcp->u_arg[3];
+ }
+ switch (cmd) {
+ case IPC_SET:
+ print_semid_ds(tcp, addr, cmd, indirect_addr);
+ return RVAL_DECODED;
+
+ case IPC_STAT:
+ case SEM_STAT:
+ case SEM_STAT_ANY:
+ case IPC_INFO:
+ case SEM_INFO:
+ /* decode on exiting */
+ set_tcb_priv_ulong(tcp, addr);
+ break;
+
+ default:
+ if (indirect_addr)
+ tprints("[");
+ printaddr(addr);
+ if (indirect_addr)
+ tprints("]");
+ return RVAL_DECODED;
+ }
+ } else {
+ addr = get_tcb_priv_ulong(tcp);
+ switch (cmd) {
+ case IPC_STAT:
+ case SEM_STAT:
+ case SEM_STAT_ANY:
+ print_semid_ds(tcp, addr, cmd, indirect_addr);
+ break;
+
+ case IPC_INFO:
+ case SEM_INFO:
+ print_seminfo(tcp, addr, cmd, indirect_addr);
+ break;
+ }
+ }
+ return 0;
+}
diff --git a/src/ipc_shm.c b/src/ipc_shm.c
new file mode 100644
index 000000000..f62a7ebbf
--- /dev/null
+++ b/src/ipc_shm.c
@@ -0,0 +1,92 @@
+/*
+ * Copyright (c) 1993 Ulrich Pegelow <pegelow@moorea.uni-muenster.de>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
+ * Copyright (c) 2003-2006 Roland McGrath <roland@redhat.com>
+ * Copyright (c) 2006-2015 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2015-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include "ipc_defs.h"
+
+#include SHM_H_PROVIDER
+
+#ifndef SHM_HUGE_SHIFT
+# define SHM_HUGE_SHIFT 26
+#endif
+
+#ifndef SHM_HUGE_MASK
+# define SHM_HUGE_MASK 0x3f
+#endif
+
+#include "xlat/shm_resource_flags.h"
+#include "xlat/shm_flags.h"
+
+SYS_FUNC(shmget)
+{
+ printxval(ipc_private, (unsigned int) tcp->u_arg[0], NULL);
+ tprintf(", %" PRI_klu ", ", tcp->u_arg[1]);
+
+ unsigned int flags = tcp->u_arg[2] & ~0777;
+ const unsigned int mask = SHM_HUGE_MASK << SHM_HUGE_SHIFT;
+ const unsigned int hugetlb_value = flags & mask;
+
+ flags &= ~mask;
+ if (flags || !hugetlb_value)
+ printflags(shm_resource_flags, flags, NULL);
+
+ if (hugetlb_value) {
+ tprintf("%s%u<<",
+ flags ? "|" : "",
+ hugetlb_value >> SHM_HUGE_SHIFT);
+ print_xlat_u(SHM_HUGE_SHIFT);
+ }
+
+ if (flags || hugetlb_value)
+ tprints("|");
+ print_numeric_umode_t(tcp->u_arg[2] & 0777);
+
+ return RVAL_DECODED;
+}
+
+SYS_FUNC(shmat)
+{
+ if (entering(tcp)) {
+ tprintf("%d, ", (int) tcp->u_arg[0]);
+ if (indirect_ipccall(tcp)) {
+ printaddr(tcp->u_arg[3]);
+ tprints(", ");
+ printflags(shm_flags, tcp->u_arg[1], "SHM_???");
+ } else {
+ printaddr(tcp->u_arg[1]);
+ tprints(", ");
+ printflags(shm_flags, tcp->u_arg[2], "SHM_???");
+ }
+ return 0;
+ } else {
+ if (syserror(tcp))
+ return 0;
+ if (indirect_ipccall(tcp)) {
+ union {
+ uint64_t r64;
+ uint32_t r32;
+ } u;
+ if (umoven(tcp, tcp->u_arg[2], current_wordsize, &u) < 0)
+ return RVAL_NONE;
+ tcp->u_rval = (sizeof(u.r32) == current_wordsize)
+ ? u.r32 : u.r64;
+ }
+ return RVAL_HEX;
+ }
+}
+
+SYS_FUNC(shmdt)
+{
+ printaddr(tcp->u_arg[indirect_ipccall(tcp) ? 3 : 0]);
+ return RVAL_DECODED;
+}
diff --git a/src/ipc_shmctl.c b/src/ipc_shmctl.c
new file mode 100644
index 000000000..6b23449ea
--- /dev/null
+++ b/src/ipc_shmctl.c
@@ -0,0 +1,178 @@
+/*
+ * Copyright (c) 1993 Ulrich Pegelow <pegelow@moorea.uni-muenster.de>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
+ * Copyright (c) 2003-2006 Roland McGrath <roland@redhat.com>
+ * Copyright (c) 2006-2015 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2015-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#include DEF_MPERS_TYPE(shmid_ds_t)
+#include DEF_MPERS_TYPE(struct_shm_info_t)
+#include DEF_MPERS_TYPE(struct_shm_ipc_info_t)
+
+#include "ipc_defs.h"
+
+#include SHM_H_PROVIDER
+typedef struct NAME_OF_STRUCT_SHMID_DS shmid_ds_t;
+typedef struct shm_info struct_shm_info_t;
+typedef struct NAME_OF_STRUCT_SHMINFO struct_shm_ipc_info_t;
+
+#include MPERS_DEFS
+
+#include "xlat/shmctl_flags.h"
+
+#define key NAME_OF_STRUCT_IPC_PERM_KEY
+
+static void
+print_ipc_perm(const typeof_field(shmid_ds_t, shm_perm) *const p,
+ const unsigned int cmd)
+{
+ tprint_struct_begin();
+ PRINT_FIELD_ID(*p, uid);
+ tprint_struct_next();
+ PRINT_FIELD_ID(*p, gid);
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_U(*p, mode, print_numeric_ll_umode_t);
+ if (cmd != IPC_SET) {
+ tprint_struct_next();
+ PRINT_FIELD_U(*p, key);
+ tprint_struct_next();
+ PRINT_FIELD_ID(*p, cuid);
+ tprint_struct_next();
+ PRINT_FIELD_ID(*p, cgid);
+ }
+ tprint_struct_end();
+}
+
+static void
+print_shmid_ds(struct tcb *const tcp, const kernel_ulong_t addr,
+ const unsigned int cmd)
+{
+ shmid_ds_t shmid_ds;
+
+ if (umove_or_printaddr(tcp, addr, &shmid_ds))
+ return;
+
+ tprint_struct_begin();
+ PRINT_FIELD_OBJ_PTR(shmid_ds, shm_perm, print_ipc_perm, cmd);
+ if (cmd != IPC_SET) {
+ tprint_struct_next();
+ PRINT_FIELD_U(shmid_ds, shm_segsz);
+ tprint_struct_next();
+ PRINT_FIELD_TGID(shmid_ds, shm_cpid, tcp);
+ tprint_struct_next();
+ PRINT_FIELD_TGID(shmid_ds, shm_lpid, tcp);
+ tprint_struct_next();
+ PRINT_FIELD_U(shmid_ds, shm_nattch);
+ tprint_struct_next();
+ PRINT_FIELD_U(shmid_ds, shm_atime);
+ tprint_struct_next();
+ PRINT_FIELD_U(shmid_ds, shm_dtime);
+ tprint_struct_next();
+ PRINT_FIELD_U(shmid_ds, shm_ctime);
+ }
+ tprint_struct_end();
+}
+
+static void
+print_ipc_info(struct tcb *const tcp, const kernel_ulong_t addr,
+ const unsigned int cmd)
+{
+ struct_shm_ipc_info_t info;
+
+ if (umove_or_printaddr(tcp, addr, &info))
+ return;
+
+ tprint_struct_begin();
+ PRINT_FIELD_U(info, shmmax);
+ tprint_struct_next();
+ PRINT_FIELD_U(info, shmmin);
+ tprint_struct_next();
+ PRINT_FIELD_U(info, shmmni);
+ tprint_struct_next();
+ PRINT_FIELD_U(info, shmseg);
+ tprint_struct_next();
+ PRINT_FIELD_U(info, shmall);
+ tprint_struct_end();
+}
+
+static void
+print_shm_info(struct tcb *const tcp, const kernel_ulong_t addr,
+ const unsigned int cmd)
+{
+ struct_shm_info_t info;
+
+ if (umove_or_printaddr(tcp, addr, &info))
+ return;
+
+ tprint_struct_begin();
+ PRINT_FIELD_D(info, used_ids);
+ tprint_struct_next();
+ PRINT_FIELD_U(info, shm_tot);
+ tprint_struct_next();
+ PRINT_FIELD_U(info, shm_rss);
+ tprint_struct_next();
+ PRINT_FIELD_U(info, shm_swp);
+ tprint_struct_next();
+ PRINT_FIELD_U(info, swap_attempts);
+ tprint_struct_next();
+ PRINT_FIELD_U(info, swap_successes);
+ tprint_struct_end();
+}
+
+SYS_FUNC(shmctl)
+{
+ const kernel_ulong_t addr = tcp->u_arg[indirect_ipccall(tcp) ? 3 : 2];
+ unsigned int cmd = tcp->u_arg[1];
+
+ /* TODO: We don't properly decode old compat ipc calls. */
+ if (cmd & IPC_64)
+ cmd &= ~IPC_64;
+
+ if (entering(tcp)) {
+ tprintf("%d, ", (int) tcp->u_arg[0]);
+ PRINTCTL(shmctl_flags, tcp->u_arg[1], "SHM_???");
+ tprints(", ");
+ switch (cmd) {
+ case IPC_SET:
+ print_shmid_ds(tcp, addr, cmd);
+ return RVAL_DECODED;
+
+ case IPC_STAT:
+ case SHM_STAT:
+ case SHM_STAT_ANY:
+ case IPC_INFO:
+ case SHM_INFO:
+ /* decode on exiting */
+ break;
+
+ default:
+ printaddr(addr);
+ return RVAL_DECODED;
+ }
+ } else {
+ switch (cmd) {
+ case IPC_STAT:
+ case SHM_STAT:
+ case SHM_STAT_ANY:
+ print_shmid_ds(tcp, addr, cmd);
+ break;
+
+ case IPC_INFO:
+ print_ipc_info(tcp, addr, cmd);
+ break;
+
+ case SHM_INFO:
+ print_shm_info(tcp, addr, cmd);
+ break;
+ }
+ }
+ return 0;
+}
diff --git a/src/kcmp.c b/src/kcmp.c
new file mode 100644
index 000000000..2fca20053
--- /dev/null
+++ b/src/kcmp.c
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2015 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2015-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include "xlat/kcmp_types.h"
+
+struct strace_kcmp_epoll_slot {
+ uint32_t efd;
+ uint32_t tfd;
+ uint32_t toff;
+};
+
+#define PRINT_FIELD_PIDFD(where_, field_, tcp_, pid_) \
+ do { \
+ tprints_field_name(#field_); \
+ printfd_pid_tracee_ns((tcp_), (pid_), (where_).field_); \
+ } while (0)
+
+SYS_FUNC(kcmp)
+{
+ pid_t pid1 = tcp->u_arg[0];
+ pid_t pid2 = tcp->u_arg[1];
+ int type = tcp->u_arg[2];
+ kernel_ulong_t idx1 = tcp->u_arg[3];
+ kernel_ulong_t idx2 = tcp->u_arg[4];
+
+ printpid(tcp, pid1, PT_TGID);
+ tprints(", ");
+ printpid(tcp, pid2, PT_TGID);
+ tprints(", ");
+ printxval(kcmp_types, type, "KCMP_???");
+
+ switch (type) {
+ case KCMP_FILE:
+ tprints(", ");
+ printfd_pid_tracee_ns(tcp, pid1, idx1);
+ tprints(", ");
+ printfd_pid_tracee_ns(tcp, pid2, idx2);
+
+ break;
+
+ case KCMP_EPOLL_TFD: {
+ struct strace_kcmp_epoll_slot slot;
+
+ tprints(", ");
+ printfd_pid_tracee_ns(tcp, pid1, idx1);
+ tprints(", ");
+
+ if (umove_or_printaddr(tcp, idx2, &slot))
+ break;
+
+ tprint_struct_begin();
+ PRINT_FIELD_PIDFD(slot, efd, tcp, pid2);
+ tprint_struct_next();
+ PRINT_FIELD_PIDFD(slot, tfd, tcp, pid2);
+ tprint_struct_next();
+ PRINT_FIELD_U(slot, toff);
+ tprint_struct_end();
+
+ break;
+ }
+
+ case KCMP_FILES:
+ case KCMP_FS:
+ case KCMP_IO:
+ case KCMP_SIGHAND:
+ case KCMP_SYSVSEM:
+ case KCMP_VM:
+ break;
+ default:
+ tprintf(", %#" PRI_klx ", %#" PRI_klx, idx1, idx2);
+ }
+
+ return RVAL_DECODED;
+}
diff --git a/src/kernel_dirent.h b/src/kernel_dirent.h
new file mode 100644
index 000000000..f4d55d28f
--- /dev/null
+++ b/src/kernel_dirent.h
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2015 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2015-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_KERNEL_DIRENT_H
+# define STRACE_KERNEL_DIRENT_H
+
+# include "kernel_types.h"
+
+typedef struct {
+ kernel_ulong_t d_ino;
+ kernel_ulong_t d_off;
+ unsigned short d_reclen;
+ char d_name[1];
+} kernel_dirent_t;
+
+typedef struct {
+ uint64_t d_ino;
+ uint64_t d_off;
+ unsigned short d_reclen;
+ unsigned char d_type;
+ char d_name[1];
+} kernel_dirent64_t;
+
+#endif /* !STRACE_KERNEL_DIRENT_H */
diff --git a/src/kernel_rusage.h b/src/kernel_rusage.h
new file mode 100644
index 000000000..c9028cb4d
--- /dev/null
+++ b/src/kernel_rusage.h
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 1999-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_KERNEL_RUSAGE_H
+# define STRACE_KERNEL_RUSAGE_H
+
+# include "kernel_timeval.h"
+
+typedef struct {
+ kernel_old_timeval_t ru_utime;
+ kernel_old_timeval_t ru_stime;
+ kernel_long_t ru_maxrss;
+ kernel_long_t ru_ixrss;
+ kernel_long_t ru_idrss;
+ kernel_long_t ru_isrss;
+ kernel_long_t ru_minflt;
+ kernel_long_t ru_majflt;
+ kernel_long_t ru_nswap;
+ kernel_long_t ru_inblock;
+ kernel_long_t ru_oublock;
+ kernel_long_t ru_msgsnd;
+ kernel_long_t ru_msgrcv;
+ kernel_long_t ru_nsignals;
+ kernel_long_t ru_nvcsw;
+ kernel_long_t ru_nivcsw;
+} kernel_rusage_t;
+
+#endif /* !STRACE_KERNEL_RUSAGE_H */
diff --git a/src/kernel_timespec.h b/src/kernel_timespec.h
new file mode 100644
index 000000000..2fa38a432
--- /dev/null
+++ b/src/kernel_timespec.h
@@ -0,0 +1,25 @@
+/*
+ * Copyright (c) 2019-2020 Dmitry V. Levin <ldv@strace.io>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_KERNEL_TIMESPEC_H
+# define STRACE_KERNEL_TIMESPEC_H
+
+typedef struct {
+ long long tv_sec;
+ long long tv_nsec;
+} kernel_timespec64_t;
+
+# if HAVE_ARCH_TIME32_SYSCALLS || HAVE_ARCH_TIMESPEC32
+
+typedef struct {
+ int tv_sec;
+ int tv_nsec;
+} kernel_timespec32_t;
+
+# endif /* HAVE_ARCH_TIME32_SYSCALLS || HAVE_ARCH_TIMESPEC32 */
+
+#endif /* !STRACE_KERNEL_TIMESPEC_H */
diff --git a/src/kernel_timeval.h b/src/kernel_timeval.h
new file mode 100644
index 000000000..4364efcaf
--- /dev/null
+++ b/src/kernel_timeval.h
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2019-2020 Dmitry V. Levin <ldv@strace.io>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_KERNEL_TIMEVAL_H
+# define STRACE_KERNEL_TIMEVAL_H
+
+# include "kernel_types.h"
+
+typedef struct {
+ long long tv_sec;
+ long long tv_usec;
+} kernel_timeval64_t;
+
+typedef struct {
+ kernel_long_t tv_sec;
+# if defined __sparc__ && defined __arch64__
+ int tv_usec;
+# else
+ kernel_long_t tv_usec;
+# endif
+} kernel_old_timeval_t;
+
+#endif /* !STRACE_KERNEL_TIMEVAL_H */
diff --git a/src/kernel_timex.h b/src/kernel_timex.h
new file mode 100644
index 000000000..c69468876
--- /dev/null
+++ b/src/kernel_timex.h
@@ -0,0 +1,105 @@
+/*
+ * Copyright (c) 2019 Dmitry V. Levin <ldv@strace.io>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_KERNEL_TIMEX_H
+# define STRACE_KERNEL_TIMEX_H
+
+# include "kernel_timeval.h"
+
+typedef struct {
+ unsigned int modes;
+ int pad0;
+ long long offset;
+ long long freq;
+ long long maxerror;
+ long long esterror;
+ int status;
+ int pad1;
+ long long constant;
+ long long precision;
+ long long tolerance;
+ kernel_timeval64_t time;
+ long long tick;
+ long long ppsfreq;
+ long long jitter;
+ int shift;
+ int pad2;
+ long long stabil;
+ long long jitcnt;
+ long long calcnt;
+ long long errcnt;
+ long long stbcnt;
+ int tai;
+ int pad3[11];
+} kernel_timex64_t;
+
+# ifdef SPARC64
+
+typedef struct {
+ unsigned int modes;
+ int pad0;
+ long long offset;
+ long long freq;
+ long long maxerror;
+ long long esterror;
+ int status;
+ int pad1;
+ long long constant;
+ long long precision;
+ long long tolerance;
+ struct {
+ long long tv_sec;
+ int tv_usec;
+ } time;
+ long long tick;
+ long long ppsfreq;
+ long long jitter;
+ int shift;
+ int pad2;
+ long long stabil;
+ long long jitcnt;
+ long long calcnt;
+ long long errcnt;
+ long long stbcnt;
+ int tai;
+ int pad3[11];
+} kernel_sparc64_timex_t;
+
+# endif /* SPARC64 */
+
+# if HAVE_ARCH_TIME32_SYSCALLS
+
+typedef struct {
+ unsigned int modes;
+ int offset;
+ int freq;
+ int maxerror;
+ int esterror;
+ int status;
+ int constant;
+ int precision;
+ int tolerance;
+ struct {
+ int tv_sec;
+ int tv_usec;
+ } time;
+ int tick;
+ int ppsfreq;
+ int jitter;
+ int shift;
+ int stabil;
+ int jitcnt;
+ int calcnt;
+ int errcnt;
+ int stbcnt;
+ int tai;
+ int pad0[11];
+} kernel_timex32_t;
+
+# endif /* HAVE_ARCH_TIME32_SYSCALLS */
+
+#endif /* !STRACE_KERNEL_TIMEX_H */
diff --git a/src/kernel_types.h b/src/kernel_types.h
new file mode 100644
index 000000000..5bdde1bbb
--- /dev/null
+++ b/src/kernel_types.h
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2015 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2015-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_KERNEL_TYPES_H
+# define STRACE_KERNEL_TYPES_H
+
+# if defined HAVE___KERNEL_LONG_T && defined HAVE___KERNEL_ULONG_T
+
+# include <asm/posix_types.h>
+
+typedef __kernel_long_t kernel_long_t;
+typedef __kernel_ulong_t kernel_ulong_t;
+
+# elif (defined __x86_64__ && defined __ILP32__) || defined LINUX_MIPSN32
+
+typedef long long kernel_long_t;
+typedef unsigned long long kernel_ulong_t;
+
+# else
+
+typedef long kernel_long_t;
+typedef unsigned long kernel_ulong_t;
+
+# endif
+
+# if SIZEOF_KERNEL_LONG_T > SIZEOF_LONG
+# define PRI_kl "ll"
+# else
+# define PRI_kl "l"
+# endif
+
+# define PRI_kld PRI_kl"d"
+# define PRI_klu PRI_kl"u"
+# define PRI_klx PRI_kl"x"
+
+/*
+ * The kernel used to define 64-bit types on 64-bit systems on a per-arch
+ * basis. Some architectures would use unsigned long and others would use
+ * unsigned long long. These types were exported as part of the
+ * kernel-userspace ABI and now must be maintained forever. This matches
+ * what the kernel exports for each architecture so we don't need to cast
+ * every printing of __u64 or __s64 to stdint types.
+ * The exception is Android, where for MIPS64 unsigned long long is used.
+ */
+# if SIZEOF_LONG == 4
+# define PRI__64 "ll"
+# elif defined ALPHA || defined IA64 || defined __powerpc64__ \
+ || (defined MIPS && !defined __ANDROID__)
+# define PRI__64 "l"
+# else
+# define PRI__64 "ll"
+# endif
+
+# define PRI__d64 PRI__64"d"
+# define PRI__u64 PRI__64"u"
+# define PRI__x64 PRI__64"x"
+
+#endif /* !STRACE_KERNEL_TYPES_H */
diff --git a/src/kernel_v4l2_types.h b/src/kernel_v4l2_types.h
new file mode 100644
index 000000000..b0c49e37b
--- /dev/null
+++ b/src/kernel_v4l2_types.h
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2020 Dmitry V. Levin <ldv@strace.io>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_KERNEL_V4L2_BUFFER_H
+# define STRACE_KERNEL_V4L2_BUFFER_H
+
+# include "types/v4l2.h"
+# include "kernel_timeval.h"
+# include "kernel_timespec.h"
+
+# if defined __sparc__ && defined __arch64__
+typedef struct {
+ long long tv_sec;
+ int tv_usec;
+ int pad;
+} kernel_v4l2_timeval_t;
+# else
+typedef kernel_timeval64_t kernel_v4l2_timeval_t;
+# endif
+
+typedef struct {
+ uint32_t index;
+ uint32_t type;
+ uint32_t bytesused;
+ uint32_t flags;
+ uint32_t field;
+ kernel_v4l2_timeval_t timestamp;
+ struct v4l2_timecode timecode;
+ uint32_t sequence;
+ uint32_t memory;
+ union {
+ uint32_t offset;
+ unsigned long userptr;
+ struct v4l2_plane *planes;
+ int32_t fd;
+ } m;
+ uint32_t length;
+ uint32_t reserved2;
+ union {
+ int32_t request_fd;
+ uint32_t reserved;
+ };
+} kernel_v4l2_buffer_t;
+
+typedef struct {
+ uint32_t type;
+ union {
+ uint64_t data[8];
+ } u;
+ uint32_t pending;
+ uint32_t sequence;
+ kernel_timespec64_t timestamp;
+ uint32_t id;
+ uint32_t reserved[8];
+} kernel_v4l2_event_t;
+
+#endif /* !STRACE_KERNEL_V4L2_BUFFER_H */
diff --git a/src/kexec.c b/src/kexec.c
new file mode 100644
index 000000000..73a2c17f6
--- /dev/null
+++ b/src/kexec.c
@@ -0,0 +1,111 @@
+/*
+ * Copyright (c) 2014-2015 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2014-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#include "xlat/kexec_load_flags.h"
+#include "xlat/kexec_arch_values.h"
+
+#ifndef KEXEC_ARCH_MASK
+# define KEXEC_ARCH_MASK 0xffff0000
+#endif
+#ifndef KEXEC_SEGMENT_MAX
+# define KEXEC_SEGMENT_MAX 16
+#endif
+
+static bool
+print_seg(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data)
+{
+ const kernel_ulong_t *seg;
+ kernel_ulong_t seg_buf[4];
+
+ if (elem_size < sizeof(seg_buf)) {
+ unsigned int i;
+
+ for (i = 0; i < ARRAY_SIZE(seg_buf); ++i)
+ seg_buf[i] = ((unsigned int *) elem_buf)[i];
+ seg = seg_buf;
+ } else {
+ seg = elem_buf;
+ }
+
+ tprint_struct_begin();
+ tprints_field_name("buf");
+ printaddr(seg[0]);
+ tprint_struct_next();
+ tprints_field_name("bufsz");
+ tprintf("%" PRI_klu, seg[1]);
+ tprint_struct_next();
+ tprints_field_name("mem");
+ printaddr(seg[2]);
+ tprint_struct_next();
+ tprints_field_name("memsz");
+ tprintf("%" PRI_klu, seg[3]);
+ tprint_struct_end();
+
+ return true;
+}
+
+static void
+print_kexec_segments(struct tcb *const tcp, const kernel_ulong_t addr,
+ const kernel_ulong_t len)
+{
+ if (len > KEXEC_SEGMENT_MAX) {
+ printaddr(addr);
+ return;
+ }
+
+ kernel_ulong_t seg[4];
+ const size_t sizeof_seg = ARRAY_SIZE(seg) * current_wordsize;
+
+ print_array(tcp, addr, len, seg, sizeof_seg,
+ tfetch_mem, print_seg, 0);
+}
+
+SYS_FUNC(kexec_load)
+{
+ /* entry, nr_segments */
+ printaddr(tcp->u_arg[0]);
+ tprintf(", %" PRI_klu ", ", tcp->u_arg[1]);
+
+ /* segments */
+ print_kexec_segments(tcp, tcp->u_arg[2], tcp->u_arg[1]);
+ tprints(", ");
+
+ /* flags */
+ kernel_ulong_t n = tcp->u_arg[3];
+ printxval64(kexec_arch_values, n & KEXEC_ARCH_MASK, "KEXEC_ARCH_???");
+ n &= ~(kernel_ulong_t) KEXEC_ARCH_MASK;
+ if (n) {
+ tprints("|");
+ printflags64(kexec_load_flags, n, "KEXEC_???");
+ }
+
+ return RVAL_DECODED;
+}
+
+#include "xlat/kexec_file_load_flags.h"
+
+SYS_FUNC(kexec_file_load)
+{
+ /* kernel_fd */
+ printfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ /* initrd_fd */
+ printfd(tcp, tcp->u_arg[1]);
+ tprints(", ");
+ /* cmdline_len */
+ tprintf("%" PRI_klu ", ", tcp->u_arg[2]);
+ /* cmdline */
+ printstrn(tcp, tcp->u_arg[3], tcp->u_arg[2]);
+ tprints(", ");
+ /* flags */
+ printflags64(kexec_file_load_flags, tcp->u_arg[4], "KEXEC_FILE_???");
+
+ return RVAL_DECODED;
+}
diff --git a/src/keyctl.c b/src/keyctl.c
new file mode 100644
index 000000000..800018bb2
--- /dev/null
+++ b/src/keyctl.c
@@ -0,0 +1,630 @@
+/*
+ * Copyright (c) 2014-2015 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2014-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#include "keyctl_kdf_params.h"
+
+#include "xlat/key_perms.h"
+#include "xlat/key_reqkeys.h"
+#include "xlat/key_spec.h"
+#include "xlat/keyctl_caps0.h"
+#include "xlat/keyctl_caps1.h"
+#include "xlat/keyctl_commands.h"
+#include "xlat/keyctl_move_flags.h"
+#include "xlat/keyctl_pkey_ops.h"
+
+
+typedef int32_t key_serial_t;
+
+struct keyctl_dh_params {
+ int32_t private;
+ int32_t prime;
+ int32_t base;
+};
+
+struct keyctl_pkey_query {
+ uint32_t supported_ops;
+ uint32_t key_size;
+ uint16_t max_data_size;
+ uint16_t max_sig_size;
+ uint16_t max_enc_size;
+ uint16_t max_dec_size;
+ uint32_t __spare[10];
+};
+
+struct keyctl_pkey_params {
+ int32_t key_id;
+ uint32_t in_len;
+ union {
+ uint32_t out_len;
+ uint32_t in2_len;
+ };
+ uint32_t __spare[7];
+};
+
+
+static void
+print_keyring_serial_number(key_serial_t id)
+{
+ printxval_d(key_spec, id, NULL);
+}
+
+SYS_FUNC(add_key)
+{
+ /* type */
+ printstr(tcp, tcp->u_arg[0]);
+ /* description */
+ tprints(", ");
+ printstr(tcp, tcp->u_arg[1]);
+ /* payload */
+ tprints(", ");
+ printstrn(tcp, tcp->u_arg[2], tcp->u_arg[3]);
+ /* payload length */
+ tprintf(", %" PRI_klu ", ", tcp->u_arg[3]);
+ /* keyring serial number */
+ print_keyring_serial_number(tcp->u_arg[4]);
+
+ return RVAL_DECODED;
+}
+
+SYS_FUNC(request_key)
+{
+ /* type */
+ printstr(tcp, tcp->u_arg[0]);
+ /* description */
+ tprints(", ");
+ printstr(tcp, tcp->u_arg[1]);
+ /* callout_info */
+ tprints(", ");
+ printstr(tcp, tcp->u_arg[2]);
+ /* keyring serial number */
+ tprints(", ");
+ print_keyring_serial_number(tcp->u_arg[3]);
+
+ return RVAL_DECODED;
+}
+
+static void
+keyctl_get_keyring_id(struct tcb *tcp, key_serial_t id, int create)
+{
+ print_keyring_serial_number(id);
+ tprintf(", %d", create);
+}
+
+static void
+keyctl_update_key(struct tcb *tcp, key_serial_t id, kernel_ulong_t addr,
+ kernel_ulong_t len)
+{
+ print_keyring_serial_number(id);
+ tprints(", ");
+ printstrn(tcp, addr, len);
+ tprintf(", %llu", zero_extend_signed_to_ull(len));
+}
+
+static void
+keyctl_handle_key_key(struct tcb *tcp, key_serial_t id1, key_serial_t id2)
+{
+ print_keyring_serial_number(id1);
+ tprints(", ");
+ print_keyring_serial_number(id2);
+}
+
+static void
+keyctl_read_key(struct tcb *tcp, key_serial_t id, kernel_ulong_t addr,
+ kernel_ulong_t len, bool has_nul)
+{
+ if (entering(tcp)) {
+ print_keyring_serial_number(id);
+ tprints(", ");
+ } else {
+ if (syserror(tcp))
+ printaddr(addr);
+ else {
+ kernel_ulong_t rval = (tcp->u_rval >= 0) &&
+ ((kernel_ulong_t) tcp->u_rval > len) ? len :
+ (kernel_ulong_t) tcp->u_rval;
+ printstr_ex(tcp, addr, rval, has_nul ?
+ QUOTE_OMIT_TRAILING_0 : 0);
+ }
+ tprintf(", %llu", zero_extend_signed_to_ull(len));
+ }
+}
+
+static void
+keyctl_keyring_search(struct tcb *tcp, key_serial_t id1, kernel_ulong_t addr1,
+ kernel_ulong_t addr2, key_serial_t id2)
+{
+ print_keyring_serial_number(id1);
+ tprints(", ");
+ printstr(tcp, addr1);
+ tprints(", ");
+ printstr(tcp, addr2);
+ tprints(", ");
+ print_keyring_serial_number(id2);
+}
+
+static void
+keyctl_chown_key(struct tcb *tcp, key_serial_t id, unsigned user,
+ unsigned group)
+{
+ print_keyring_serial_number(id);
+ printuid(", ", user);
+ printuid(", ", group);
+}
+
+static void
+keyctl_instantiate_key(struct tcb *tcp, key_serial_t id1, kernel_ulong_t addr,
+ kernel_ulong_t len, key_serial_t id2)
+{
+ print_keyring_serial_number(id1);
+ tprints(", ");
+ printstrn(tcp, addr, len);
+ tprintf(", %llu, ", zero_extend_signed_to_ull(len));
+ print_keyring_serial_number(id2);
+}
+
+static void
+keyctl_instantiate_key_iov(struct tcb *tcp, key_serial_t id1,
+ kernel_ulong_t addr, kernel_ulong_t len,
+ key_serial_t id2)
+{
+ print_keyring_serial_number(id1);
+ tprints(", ");
+ tprint_iov(tcp, len, addr, IOV_DECODE_STR);
+ tprintf(", %llu, ", zero_extend_signed_to_ull(len));
+ print_keyring_serial_number(id2);
+}
+
+static void
+keyctl_negate_key(struct tcb *tcp, key_serial_t id1, unsigned timeout,
+ key_serial_t id2)
+{
+ print_keyring_serial_number(id1);
+ tprintf(", %u, ", timeout);
+ print_keyring_serial_number(id2);
+}
+
+static void
+keyctl_reject_key(struct tcb *tcp, key_serial_t id1, unsigned timeout,
+ unsigned error, key_serial_t id2)
+{
+ print_keyring_serial_number(id1);
+ tprintf(", %u, ", timeout);
+ print_err(error, false);
+ tprints(", ");
+ print_keyring_serial_number(id2);
+}
+
+static void
+keyctl_set_timeout(struct tcb *tcp, key_serial_t id, unsigned timeout)
+{
+ print_keyring_serial_number(id);
+ tprintf(", %u", timeout);
+}
+
+static void
+keyctl_get_persistent(struct tcb *tcp, unsigned uid, key_serial_t id)
+{
+ printuid("", uid);
+ tprints(", ");
+ print_keyring_serial_number(id);
+}
+
+static void
+keyctl_setperm_key(struct tcb *tcp, key_serial_t id, uint32_t perm)
+{
+ print_keyring_serial_number(id);
+ tprints(", ");
+ printflags(key_perms, perm, "KEY_???");
+}
+
+static void
+print_dh_params(struct tcb *tcp, kernel_ulong_t addr)
+{
+ struct keyctl_dh_params params;
+
+ if (umove_or_printaddr(tcp, addr, &params))
+ return;
+
+ tprint_struct_begin();
+ PRINT_FIELD_OBJ_VAL(params, private, print_keyring_serial_number);
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_VAL(params, prime, print_keyring_serial_number);
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_VAL(params, base, print_keyring_serial_number);
+ tprint_struct_end();
+}
+
+static void
+keyctl_dh_compute(struct tcb *tcp, kernel_ulong_t params, kernel_ulong_t buf,
+ kernel_ulong_t len, kernel_ulong_t kdf_addr)
+{
+ if (entering(tcp)) {
+ print_dh_params(tcp, params);
+ tprints(", ");
+ } else {
+ struct strace_keyctl_kdf_params kdf;
+
+ if (syserror(tcp)) {
+ printaddr(buf);
+ } else {
+ kernel_ulong_t rval = (tcp->u_rval >= 0) &&
+ ((kernel_ulong_t) tcp->u_rval > len) ? len :
+ (kernel_ulong_t) tcp->u_rval;
+ printstrn(tcp, buf, rval);
+ }
+ tprintf(", %llu, ", zero_extend_signed_to_ull(len));
+
+ if (fetch_keyctl_kdf_params(tcp, kdf_addr, &kdf)) {
+ printaddr(kdf_addr);
+ } else {
+ tprint_struct_begin();
+ PRINT_FIELD_OBJ_TCB_VAL(kdf, hashname, tcp,
+ printstr);
+
+ /*
+ * Kernel doesn't touch otherinfo
+ * if otherinfolen is zero.
+ */
+ if (kdf.otherinfolen) {
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_TCB_VAL(kdf, otherinfo,
+ tcp, printstrn, kdf.otherinfolen);
+ } else {
+ tprint_struct_next();
+ PRINT_FIELD_PTR(kdf, otherinfo);
+ }
+
+ tprint_struct_next();
+ PRINT_FIELD_U(kdf, otherinfolen);
+
+ if (!IS_ARRAY_ZERO(kdf.__spare)) {
+ tprint_struct_next();
+ PRINT_FIELD_ARRAY(kdf, __spare, tcp,
+ print_xint32_array_member);
+ }
+
+ tprint_struct_end();
+ }
+ }
+}
+
+static void
+print_pkey_query(struct tcb *tcp, kernel_ulong_t addr)
+{
+ struct keyctl_pkey_query query;
+
+ if (umove_or_printaddr(tcp, addr, &query))
+ return;
+
+ tprint_struct_begin();
+ PRINT_FIELD_FLAGS(query, supported_ops, keyctl_pkey_ops,
+ "KEYCTL_SUPPORTS_???");
+ tprint_struct_next();
+ PRINT_FIELD_U(query, key_size);
+ tprint_struct_next();
+ PRINT_FIELD_U(query, max_data_size);
+ tprint_struct_next();
+ PRINT_FIELD_U(query, max_sig_size);
+ tprint_struct_next();
+ PRINT_FIELD_U(query, max_enc_size);
+ tprint_struct_next();
+ PRINT_FIELD_U(query, max_dec_size);
+
+ if (!IS_ARRAY_ZERO(query.__spare)) {
+ tprint_struct_next();
+ PRINT_FIELD_ARRAY(query, __spare, tcp,
+ print_xint32_array_member);
+ }
+
+ tprint_struct_end();
+}
+
+static void
+keyctl_pkey_query(struct tcb *const tcp,
+ const key_serial_t id,
+ const kernel_ulong_t reserved,
+ const kernel_ulong_t /* char * */ info,
+ const kernel_ulong_t /* keyctl_pkey_query * */ res)
+{
+ if (entering(tcp)) {
+ print_keyring_serial_number(id);
+ tprints(", ");
+ tprintf("%#" PRI_klx, reserved);
+ tprints(", ");
+ printstr(tcp, info);
+ tprints(", ");
+ } else {
+ print_pkey_query(tcp, res);
+ }
+}
+
+static bool
+fetch_print_pkey_params(struct tcb *tcp, kernel_ulong_t addr,
+ struct keyctl_pkey_params *params, bool out)
+{
+ if (umove_or_printaddr(tcp, addr, params))
+ return false;
+
+ tprint_struct_begin();
+ PRINT_FIELD_OBJ_VAL(*params, key_id, print_keyring_serial_number);
+ tprint_struct_next();
+ PRINT_FIELD_U(*params, in_len);
+
+ if (out) {
+ tprint_struct_next();
+ PRINT_FIELD_U(*params, out_len);
+ } else {
+ tprint_struct_next();
+ PRINT_FIELD_U(*params, in2_len);
+ }
+
+ if (!IS_ARRAY_ZERO(params->__spare)) {
+ tprint_struct_next();
+ PRINT_FIELD_ARRAY(*params, __spare, tcp,
+ print_xint32_array_member);
+ }
+
+ tprint_struct_end();
+
+ return true;
+}
+
+static int
+keyctl_pkey_op(struct tcb *const tcp,
+ const kernel_ulong_t /* keyctl_pkey_params * */ params_addr,
+ const kernel_ulong_t /* char * */ info,
+ const kernel_ulong_t /* void * */ op1,
+ const kernel_ulong_t /* void * */ op2,
+ bool out)
+{
+ if (entering(tcp)) {
+ struct keyctl_pkey_params params;
+ bool ret;
+
+ ret = fetch_print_pkey_params(tcp, params_addr, &params, out);
+ if (ret && out)
+ set_tcb_priv_ulong(tcp, params.out_len);
+
+ tprints(", ");
+ printstr(tcp, info);
+ tprints(", ");
+ if (ret)
+ printstrn(tcp, op1, params.in_len);
+ else
+ printaddr(op1);
+ tprints(", ");
+
+ if (!out || !ret) {
+ if (ret)
+ printstrn(tcp, op2, params.in2_len);
+ else
+ printaddr(op2);
+ }
+
+ return ret && out ? 0 : RVAL_DECODED;
+ } else {
+ unsigned long out_len = get_tcb_priv_ulong(tcp);
+
+ if (syserror(tcp))
+ printaddr(op2);
+ else
+ printstrn(tcp, op2, out_len);
+ }
+
+ return 0;
+}
+
+static void
+keyctl_restrict_keyring(struct tcb *const tcp,
+ const key_serial_t id,
+ const kernel_ulong_t addr1,
+ const kernel_ulong_t addr2)
+{
+ print_keyring_serial_number(id);
+ tprints(", ");
+ printstr(tcp, addr1);
+ tprints(", ");
+ printstr(tcp, addr2);
+}
+
+static void
+keyctl_move(struct tcb *const tcp,
+ const key_serial_t id,
+ const key_serial_t from,
+ const key_serial_t to,
+ const unsigned int flags)
+{
+ print_keyring_serial_number(id);
+ tprints(", ");
+ print_keyring_serial_number(from);
+ tprints(", ");
+ print_keyring_serial_number(to);
+ tprints(", ");
+ printflags(keyctl_move_flags, flags, "KEYCTL_MOVE_???");
+}
+
+bool
+print_keyctl_caps(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data)
+{
+ static const struct {
+ const struct xlat *xlat;
+ const char *dflt;
+ } caps[] = {
+ { keyctl_caps0, "KEYCTL_CAPS0_???" },
+ { keyctl_caps1, "KEYCTL_CAPS1_???" },
+ };
+
+ kernel_ulong_t *pos = data;
+ unsigned char *elem = elem_buf;
+
+ if (*pos < ARRAY_SIZE(caps))
+ printflags(caps[*pos].xlat, *elem, caps[*pos].dflt);
+ else
+ tprintf("%#hhx", *elem);
+
+ (*pos)++;
+
+ return true;
+}
+
+static void
+keyctl_capabilities(struct tcb *const tcp,
+ const kernel_ulong_t /* char * */ buf,
+ const kernel_ulong_t buflen)
+{
+ kernel_ulong_t pos = 0;
+ unsigned char elem;
+
+ if (entering(tcp))
+ return;
+
+ if (syserror(tcp)) {
+ printaddr(buf);
+ } else {
+ print_array(tcp, buf, MIN(buflen, (kernel_ulong_t) tcp->u_rval),
+ &elem, sizeof(elem),
+ tfetch_mem, print_keyctl_caps, &pos);
+ }
+
+ tprintf(", %" PRI_klu, buflen);
+}
+
+SYS_FUNC(keyctl)
+{
+ int cmd = tcp->u_arg[0];
+ kernel_ulong_t arg2 = tcp->u_arg[1];
+ kernel_ulong_t arg3 = tcp->u_arg[2];
+ kernel_ulong_t arg4 = tcp->u_arg[3];
+ kernel_ulong_t arg5 = tcp->u_arg[4];
+
+ if (entering(tcp)) {
+ printxval(keyctl_commands, cmd, "KEYCTL_???");
+
+ /*
+ * For now, KEYCTL_SESSION_TO_PARENT is the only cmd without
+ * arguments.
+ */
+ if (cmd != KEYCTL_SESSION_TO_PARENT)
+ tprints(", ");
+ }
+
+ switch (cmd) {
+ case KEYCTL_GET_KEYRING_ID:
+ keyctl_get_keyring_id(tcp, arg2, arg3);
+ break;
+
+ case KEYCTL_JOIN_SESSION_KEYRING:
+ printstr(tcp, arg2);
+ break;
+
+ case KEYCTL_UPDATE:
+ keyctl_update_key(tcp, arg2, arg3, arg4);
+ break;
+
+ case KEYCTL_REVOKE:
+ case KEYCTL_CLEAR:
+ case KEYCTL_INVALIDATE:
+ case KEYCTL_ASSUME_AUTHORITY:
+ print_keyring_serial_number(arg2);
+ break;
+
+ case KEYCTL_LINK:
+ case KEYCTL_UNLINK:
+ keyctl_handle_key_key(tcp, arg2, arg3);
+ break;
+
+ case KEYCTL_DESCRIBE:
+ case KEYCTL_READ:
+ case KEYCTL_GET_SECURITY:
+ keyctl_read_key(tcp, arg2, arg3, arg4, cmd != KEYCTL_READ);
+ return 0;
+
+ case KEYCTL_SEARCH:
+ keyctl_keyring_search(tcp, arg2, arg3, arg4, arg5);
+ break;
+
+ case KEYCTL_CHOWN:
+ keyctl_chown_key(tcp, arg2, arg3, arg4);
+ break;
+
+ case KEYCTL_SETPERM:
+ keyctl_setperm_key(tcp, arg2, arg3);
+ break;
+
+ case KEYCTL_INSTANTIATE:
+ keyctl_instantiate_key(tcp, arg2, arg3, arg4, arg5);
+ break;
+
+ case KEYCTL_NEGATE:
+ keyctl_negate_key(tcp, arg2, arg3, arg4);
+ break;
+
+ case KEYCTL_SET_REQKEY_KEYRING:
+ printxvals_ex((int) arg2, "KEY_REQKEY_DEFL_???",
+ XLAT_STYLE_FMT_D, key_reqkeys, NULL);
+ break;
+
+ case KEYCTL_SET_TIMEOUT:
+ keyctl_set_timeout(tcp, arg2, arg3);
+ break;
+
+ case KEYCTL_SESSION_TO_PARENT:
+ break;
+
+ case KEYCTL_REJECT:
+ keyctl_reject_key(tcp, arg2, arg3, arg4, arg5);
+ break;
+
+ case KEYCTL_INSTANTIATE_IOV:
+ keyctl_instantiate_key_iov(tcp, arg2, arg3, arg4, arg5);
+ break;
+
+ case KEYCTL_GET_PERSISTENT:
+ keyctl_get_persistent(tcp, arg2, arg3);
+ break;
+
+ case KEYCTL_DH_COMPUTE:
+ keyctl_dh_compute(tcp, arg2, arg3, arg4, arg5);
+ return 0;
+
+ case KEYCTL_PKEY_QUERY:
+ keyctl_pkey_query(tcp, arg2, arg3, arg4, arg5);
+ return 0;
+
+ case KEYCTL_PKEY_ENCRYPT:
+ case KEYCTL_PKEY_DECRYPT:
+ case KEYCTL_PKEY_SIGN:
+ return keyctl_pkey_op(tcp, arg2, arg3, arg4, arg5, true);
+
+ case KEYCTL_PKEY_VERIFY:
+ keyctl_pkey_op(tcp, arg2, arg3, arg4, arg5, false);
+ break;
+
+ case KEYCTL_RESTRICT_KEYRING:
+ keyctl_restrict_keyring(tcp, arg2, arg3, arg4);
+ break;
+
+ case KEYCTL_MOVE:
+ keyctl_move(tcp, arg2, arg3, arg4, arg5);
+ break;
+
+ case KEYCTL_CAPABILITIES:
+ keyctl_capabilities(tcp, arg2, arg3);
+ return 0;
+
+ default:
+ tprintf("%#" PRI_klx ", %#" PRI_klx
+ ", %#" PRI_klx ", %#" PRI_klx,
+ arg2, arg3, arg4, arg5);
+ break;
+ }
+
+ return RVAL_DECODED;
+}
diff --git a/src/keyctl_kdf_params.h b/src/keyctl_kdf_params.h
new file mode 100644
index 000000000..80fff1a6f
--- /dev/null
+++ b/src/keyctl_kdf_params.h
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2017-2018 Eugene Syromyatnikov <evgsyr@gmail.com>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_KEYCTL_KDF_PARAMS_H
+# define STRACE_KEYCTL_KDF_PARAMS_H
+
+# include <stdint.h>
+# include "kernel_types.h"
+
+/* from include/linux/crypto.h */
+# define CRYPTO_MAX_ALG_NAME 128
+
+/* from security/keys/internal.h */
+# define KEYCTL_KDF_MAX_OI_LEN 64 /* max length of otherinfo */
+
+struct keyctl_kdf_params {
+ char *hashname;
+ char *otherinfo;
+ uint32_t otherinfolen;
+ uint32_t __spare[8];
+};
+
+struct strace_keyctl_kdf_params {
+ kernel_ulong_t hashname;
+ kernel_ulong_t otherinfo;
+ uint32_t otherinfolen;
+ uint32_t __spare[8];
+};
+
+#endif /* STRACE_KEYCTL_KDF_PARAMS_H */
diff --git a/src/kill_save_errno.h b/src/kill_save_errno.h
new file mode 100644
index 000000000..a777b9a44
--- /dev/null
+++ b/src/kill_save_errno.h
@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2012-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_KILL_SAVE_ERRNO_H
+# define STRACE_KILL_SAVE_ERRNO_H
+
+# include <sys/types.h>
+# include <signal.h>
+# include <errno.h>
+
+static inline int
+kill_save_errno(pid_t pid, int sig)
+{
+ int saved_errno = errno;
+ int rc = kill(pid, sig);
+ errno = saved_errno;
+ return rc;
+}
+
+#endif /* !STRACE_KILL_SAVE_ERRNO_H */
diff --git a/src/kvm.c b/src/kvm.c
new file mode 100644
index 000000000..8a89b254e
--- /dev/null
+++ b/src/kvm.c
@@ -0,0 +1,428 @@
+/*
+ * Support for decoding of KVM_* ioctl commands.
+ *
+ * Copyright (c) 2017 Masatake YAMATO <yamato@redhat.com>
+ * Copyright (c) 2017 Red Hat, Inc.
+ * Copyright (c) 2017-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#ifdef HAVE_LINUX_KVM_H
+# include <linux/kvm.h>
+# include "arch_kvm.c"
+# include "xmalloc.h"
+# include "mmap_cache.h"
+
+struct vcpu_info {
+ struct vcpu_info *next;
+ int fd;
+ int cpuid;
+ long mmap_addr;
+ unsigned long mmap_len;
+ bool resolved;
+};
+
+static bool dump_kvm_run_structure;
+
+static struct vcpu_info *
+vcpu_find(struct tcb *const tcp, int fd)
+{
+ for (struct vcpu_info *vcpu_info = tcp->vcpu_info_list;
+ vcpu_info;
+ vcpu_info = vcpu_info->next)
+ if (vcpu_info->fd == fd)
+ return vcpu_info;
+
+ return NULL;
+}
+
+static struct vcpu_info *
+vcpu_alloc(struct tcb *const tcp, int fd, int cpuid)
+{
+ struct vcpu_info *vcpu_info = xzalloc(sizeof(*vcpu_info));
+
+ vcpu_info->fd = fd;
+ vcpu_info->cpuid = cpuid;
+
+ vcpu_info->next = tcp->vcpu_info_list;
+ tcp->vcpu_info_list = vcpu_info;
+
+ return vcpu_info;
+}
+
+void
+kvm_vcpu_info_free(struct tcb *tcp)
+{
+ struct vcpu_info *head, *next;
+
+ for (head = tcp->vcpu_info_list; head; head = next) {
+ next = head->next;
+ free(head);
+ }
+
+ tcp->vcpu_info_list = NULL;
+}
+
+static void
+vcpu_register(struct tcb *const tcp, int fd, int cpuid)
+{
+ if (fd < 0)
+ return;
+
+ struct vcpu_info *vcpu_info = vcpu_find(tcp, fd);
+
+ if (!vcpu_info) {
+ vcpu_alloc(tcp, fd, cpuid);
+ } else if (vcpu_info->cpuid != cpuid) {
+ vcpu_info->cpuid = cpuid;
+ vcpu_info->resolved = false;
+ }
+}
+
+static bool
+is_map_for_file(struct mmap_cache_entry_t *map_info, void *data)
+{
+ /* major version for anon inode may be given in get_anon_bdev()
+ * in linux kernel.
+ *
+ * *p = MKDEV(0, dev & MINORMASK);
+ *-----------------^
+ */
+ return map_info->binary_filename &&
+ map_info->major == 0 &&
+ strcmp(map_info->binary_filename, data) == 0;
+}
+
+static unsigned long
+map_len(struct mmap_cache_entry_t *map_info)
+{
+ return map_info->start_addr < map_info->end_addr
+ ? map_info->end_addr - map_info->start_addr
+ : 0;
+}
+
+# define VCPU_DENTRY_PREFIX "anon_inode:kvm-vcpu:"
+
+static struct vcpu_info*
+vcpu_get_info(struct tcb *const tcp, int fd)
+{
+ struct vcpu_info *vcpu_info = vcpu_find(tcp, fd);
+ struct mmap_cache_entry_t *map_info;
+ const char *cpuid_str;
+
+ enum mmap_cache_rebuild_result mc_stat =
+ mmap_cache_rebuild_if_invalid(tcp, __func__);
+ if (mc_stat == MMAP_CACHE_REBUILD_NOCACHE)
+ return NULL;
+
+ if (vcpu_info && vcpu_info->resolved) {
+ if (mc_stat == MMAP_CACHE_REBUILD_READY)
+ return vcpu_info;
+ else {
+ map_info = mmap_cache_search(tcp, vcpu_info->mmap_addr);
+ if (map_info) {
+ cpuid_str =
+ STR_STRIP_PREFIX(map_info->binary_filename,
+ VCPU_DENTRY_PREFIX);
+ if (cpuid_str != map_info->binary_filename) {
+ int cpuid = string_to_uint(cpuid_str);
+ if (cpuid < 0)
+ return NULL;
+ if (vcpu_info->cpuid == cpuid)
+ return vcpu_info;
+ }
+ }
+
+ /* The vcpu vma may be mremap'ed. */
+ vcpu_info->resolved = false;
+ }
+ }
+
+ /* Slow path: !vcpu_info || !vcpu_info->resolved */
+ char path[PATH_MAX + 1];
+ cpuid_str = path;
+ if (getfdpath(tcp, fd, path, sizeof(path)) >= 0)
+ cpuid_str = STR_STRIP_PREFIX(path, VCPU_DENTRY_PREFIX);
+ if (cpuid_str == path)
+ map_info = NULL;
+ else
+ map_info = mmap_cache_search_custom(tcp, is_map_for_file, path);
+
+ if (map_info) {
+ int cpuid = string_to_uint(cpuid_str);
+ if (cpuid < 0)
+ return NULL;
+ if (!vcpu_info)
+ vcpu_info = vcpu_alloc(tcp, fd, cpuid);
+ else if (vcpu_info->cpuid != cpuid)
+ vcpu_info->cpuid = cpuid;
+ vcpu_info->mmap_addr = map_info->start_addr;
+ vcpu_info->mmap_len = map_len(map_info);
+ vcpu_info->resolved = true;
+ return vcpu_info;
+ }
+
+ return NULL;
+}
+
+static int
+kvm_ioctl_create_vcpu(struct tcb *const tcp, const kernel_ulong_t arg)
+{
+ uint32_t cpuid = arg;
+
+ if (entering(tcp)) {
+ tprintf(", %u", cpuid);
+ if (dump_kvm_run_structure)
+ return 0;
+ } else if (!syserror(tcp)) {
+ vcpu_register(tcp, tcp->u_rval, cpuid);
+ }
+
+ return RVAL_IOCTL_DECODED | RVAL_FD;
+}
+
+# ifdef HAVE_STRUCT_KVM_USERSPACE_MEMORY_REGION
+# include "xlat/kvm_mem_flags.h"
+static int
+kvm_ioctl_set_user_memory_region(struct tcb *const tcp, const kernel_ulong_t arg)
+{
+ struct kvm_userspace_memory_region u_memory_region;
+
+ tprints(", ");
+ if (umove_or_printaddr(tcp, arg, &u_memory_region))
+ return RVAL_IOCTL_DECODED;
+
+ tprint_struct_begin();
+ PRINT_FIELD_U(u_memory_region, slot);
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(u_memory_region, flags, kvm_mem_flags, "KVM_MEM_???");
+ tprint_struct_next();
+ PRINT_FIELD_X(u_memory_region, guest_phys_addr);
+ tprint_struct_next();
+ PRINT_FIELD_U(u_memory_region, memory_size);
+ tprint_struct_next();
+ PRINT_FIELD_X(u_memory_region, userspace_addr);
+ tprint_struct_end();
+
+ return RVAL_IOCTL_DECODED;
+}
+# endif /* HAVE_STRUCT_KVM_USERSPACE_MEMORY_REGION */
+
+# ifdef HAVE_STRUCT_KVM_REGS
+static int
+kvm_ioctl_decode_regs(struct tcb *const tcp, const unsigned int code,
+ const kernel_ulong_t arg)
+{
+ struct kvm_regs regs;
+
+ if (code == KVM_GET_REGS && entering(tcp))
+ return 0;
+
+ tprints(", ");
+ if (!umove_or_printaddr(tcp, arg, &regs))
+ arch_print_kvm_regs(tcp, arg, &regs);
+
+ return RVAL_IOCTL_DECODED;
+}
+# endif /* HAVE_STRUCT_KVM_REGS */
+
+# ifdef HAVE_STRUCT_KVM_CPUID2
+# include "xlat/kvm_cpuid_flags.h"
+static bool
+print_kvm_cpuid_entry(struct tcb *const tcp,
+ void* elem_buf, size_t elem_size, void* data)
+{
+ const struct kvm_cpuid_entry2 *entry = elem_buf;
+ tprint_struct_begin();
+ PRINT_FIELD_X(*entry, function);
+ tprint_struct_next();
+ PRINT_FIELD_X(*entry, index);
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(*entry, flags, kvm_cpuid_flags, "KVM_CPUID_FLAG_???");
+ tprint_struct_next();
+ PRINT_FIELD_X(*entry, eax);
+ tprint_struct_next();
+ PRINT_FIELD_X(*entry, ebx);
+ tprint_struct_next();
+ PRINT_FIELD_X(*entry, ecx);
+ tprint_struct_next();
+ PRINT_FIELD_X(*entry, edx);
+ tprint_struct_end();
+
+ return true;
+}
+
+static int
+kvm_ioctl_decode_cpuid2(struct tcb *const tcp, const unsigned int code,
+ const kernel_ulong_t arg)
+{
+ struct kvm_cpuid2 cpuid;
+
+ if (entering(tcp) && (code == KVM_GET_SUPPORTED_CPUID
+# ifdef KVM_GET_EMULATED_CPUID
+ || code == KVM_GET_EMULATED_CPUID
+# endif
+ ))
+ return 0;
+
+ tprints(", ");
+ if (!umove_or_printaddr(tcp, arg, &cpuid)) {
+ tprint_struct_begin();
+ PRINT_FIELD_U(cpuid, nent);
+
+ tprint_struct_next();
+ tprints_field_name("entries");
+ if (abbrev(tcp)) {
+ tprints("[");
+ if (cpuid.nent)
+ tprint_more_data_follows();
+ tprints("]");
+
+ } else {
+ struct kvm_cpuid_entry2 entry;
+ print_array(tcp, arg + sizeof(cpuid), cpuid.nent,
+ &entry, sizeof(entry), tfetch_mem,
+ print_kvm_cpuid_entry, NULL);
+ }
+ tprint_struct_end();
+ }
+
+ return RVAL_IOCTL_DECODED;
+}
+# endif /* HAVE_STRUCT_KVM_CPUID2 */
+
+# ifdef HAVE_STRUCT_KVM_SREGS
+static int
+kvm_ioctl_decode_sregs(struct tcb *const tcp, const unsigned int code,
+ const kernel_ulong_t arg)
+{
+ struct kvm_sregs sregs;
+
+ if (code == KVM_GET_SREGS && entering(tcp))
+ return 0;
+
+ tprints(", ");
+ if (!umove_or_printaddr(tcp, arg, &sregs))
+ arch_print_kvm_sregs(tcp, arg, &sregs);
+
+ return RVAL_IOCTL_DECODED;
+}
+# endif /* HAVE_STRUCT_KVM_SREGS */
+
+# include "xlat/kvm_cap.h"
+static int
+kvm_ioctl_decode_check_extension(struct tcb *const tcp, const unsigned int code,
+ const kernel_ulong_t arg)
+{
+ tprints(", ");
+ printxval64(kvm_cap, arg, "KVM_CAP_???");
+ return RVAL_IOCTL_DECODED;
+}
+
+# include "xlat/kvm_exit_reason.h"
+static void
+kvm_ioctl_run_attach_auxstr(struct tcb *const tcp,
+ struct vcpu_info *info)
+
+{
+ static struct kvm_run vcpu_run_struct;
+
+ if (info->mmap_len < sizeof(vcpu_run_struct))
+ return;
+
+ if (umove(tcp, info->mmap_addr, &vcpu_run_struct) < 0)
+ return;
+
+ tcp->auxstr = xlookup(kvm_exit_reason, vcpu_run_struct.exit_reason);
+ if (!tcp->auxstr)
+ tcp->auxstr = "KVM_EXIT_???";
+}
+
+static int
+kvm_ioctl_decode_run(struct tcb *const tcp)
+{
+
+ if (entering(tcp))
+ return 0;
+
+ int r = RVAL_DECODED;
+
+ if (syserror(tcp))
+ return r;
+
+ if (dump_kvm_run_structure) {
+ tcp->auxstr = NULL;
+ int fd = tcp->u_arg[0];
+ struct vcpu_info *info = vcpu_get_info(tcp, fd);
+
+ if (info) {
+ kvm_ioctl_run_attach_auxstr(tcp, info);
+ if (tcp->auxstr)
+ r |= RVAL_STR;
+ }
+ }
+
+ return r;
+}
+
+int
+kvm_ioctl(struct tcb *const tcp, const unsigned int code, const kernel_ulong_t arg)
+{
+ switch (code) {
+ case KVM_CREATE_VCPU:
+ return kvm_ioctl_create_vcpu(tcp, arg);
+
+# ifdef HAVE_STRUCT_KVM_USERSPACE_MEMORY_REGION
+ case KVM_SET_USER_MEMORY_REGION:
+ return kvm_ioctl_set_user_memory_region(tcp, arg);
+# endif
+
+# ifdef HAVE_STRUCT_KVM_REGS
+ case KVM_SET_REGS:
+ case KVM_GET_REGS:
+ return kvm_ioctl_decode_regs(tcp, code, arg);
+# endif
+
+# ifdef HAVE_STRUCT_KVM_SREGS
+ case KVM_SET_SREGS:
+ case KVM_GET_SREGS:
+ return kvm_ioctl_decode_sregs(tcp, code, arg);
+# endif
+
+# ifdef HAVE_STRUCT_KVM_CPUID2
+ case KVM_SET_CPUID2:
+ case KVM_GET_SUPPORTED_CPUID:
+# ifdef KVM_GET_EMULATED_CPUID
+ case KVM_GET_EMULATED_CPUID:
+# endif
+ return kvm_ioctl_decode_cpuid2(tcp, code, arg);
+# endif
+
+ case KVM_CHECK_EXTENSION:
+ return kvm_ioctl_decode_check_extension(tcp, code, arg);
+
+ case KVM_CREATE_VM:
+ return RVAL_DECODED | RVAL_FD;
+
+ case KVM_RUN:
+ return kvm_ioctl_decode_run(tcp);
+
+ case KVM_GET_VCPU_MMAP_SIZE:
+ case KVM_GET_API_VERSION:
+ default:
+ return RVAL_DECODED;
+ }
+}
+
+void
+kvm_run_structure_decoder_init(void)
+{
+ dump_kvm_run_structure = true;
+ mmap_cache_enable();
+}
+
+#endif /* HAVE_LINUX_KVM_H */
diff --git a/src/largefile_wrappers.h b/src/largefile_wrappers.h
new file mode 100644
index 000000000..bde4eb1ba
--- /dev/null
+++ b/src/largefile_wrappers.h
@@ -0,0 +1,52 @@
+/*
+ * Wrappers for handling discrepancies in LF64-themed syscalls availability and
+ * necessity between various architectures and kernel versions.
+ *
+ * Copyright (c) 2012-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_LARGEFILE_WRAPPERS_H
+# define STRACE_LARGEFILE_WRAPPERS_H
+
+# include "defs.h"
+
+# ifdef _LARGEFILE64_SOURCE
+# ifdef HAVE_OPEN64
+# define open_file open64
+# else
+# define open_file open
+# endif
+# ifdef HAVE_FOPEN64
+# define fopen_stream fopen64
+# else
+# define fopen_stream fopen
+# endif
+# ifdef HAVE_FCNTL64
+# define fcntl_fd fcntl64
+# else
+# define fcntl_fd fcntl
+# endif
+# define fstat_fd fstat64
+# define strace_stat_t struct stat64
+# define stat_file stat64
+# define struct_dirent struct dirent64
+# define read_dir readdir64
+# define struct_rlimit struct rlimit64
+# define set_rlimit setrlimit64
+# else
+# define open_file open
+# define fopen_stream fopen
+# define fcntl_fd fcntl
+# define fstat_fd fstat
+# define strace_stat_t struct stat
+# define stat_file stat
+# define struct_dirent struct dirent
+# define read_dir readdir
+# define struct_rlimit struct rlimit
+# define set_rlimit setrlimit
+# endif
+
+#endif /* STRACE_LARGEFILE_WRAPPERS_H */
diff --git a/src/ldt.c b/src/ldt.c
new file mode 100644
index 000000000..de93cf896
--- /dev/null
+++ b/src/ldt.c
@@ -0,0 +1,202 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993-1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
+ * Copyright (c) 2002-2004 Roland McGrath <roland@redhat.com>
+ * Copyright (c) 2010 Andreas Schwab <schwab@linux-m68k.org>
+ * Copyright (c) 2014-2015 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2014-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#ifdef HAVE_STRUCT_USER_DESC
+
+# include <asm/ldt.h>
+
+# include "xstring.h"
+
+void
+print_user_desc(struct tcb *const tcp, const kernel_ulong_t addr,
+ enum user_desc_print_filter filter)
+{
+ struct user_desc desc;
+ unsigned *entry_number = get_tcb_priv_data(tcp);
+
+ switch (filter) {
+ case USER_DESC_ENTERING:
+ if (umove_or_printaddr(tcp, addr, &desc.entry_number))
+ return;
+
+ break;
+
+ case USER_DESC_EXITING:
+ if (!addr || !verbose(tcp))
+ return;
+ if (syserror(tcp) || umove(tcp, addr, &desc)) {
+ if (entry_number) {
+ tprint_struct_next();
+ tprint_more_data_follows();
+ tprint_struct_end();
+ }
+
+ return;
+ }
+
+ break;
+
+ case USER_DESC_BOTH:
+ if (umove_or_printaddr(tcp, addr, &desc))
+ return;
+
+ break;
+ }
+
+ if (filter & USER_DESC_ENTERING) {
+ tprint_struct_begin();
+ PRINT_FIELD_ID(desc, entry_number);
+
+ /*
+ * If we don't print the whole structure now, let's save it for
+ * later.
+ */
+ if (filter == USER_DESC_ENTERING) {
+ entry_number = xmalloc(sizeof(*entry_number));
+
+ *entry_number = desc.entry_number;
+ set_tcb_priv_data(tcp, entry_number, free);
+ }
+ }
+
+ if (filter & USER_DESC_EXITING) {
+ /*
+ * It should be the same in case of get_thread_area, but we can
+ * never be sure...
+ */
+ if (filter == USER_DESC_EXITING) {
+ if (entry_number) {
+ if (*entry_number != desc.entry_number) {
+ tprint_value_changed();
+ if ((int) desc.entry_number == -1)
+ tprints("-1");
+ else
+ tprintf("%u",
+ desc.entry_number);
+ }
+ } else {
+ /*
+ * This is really strange. If we are here, it
+ * means that we failed on entering but somehow
+ * succeeded on exiting.
+ */
+ tprint_value_changed();
+ tprint_struct_begin();
+ PRINT_FIELD_ID(desc, entry_number);
+ }
+ }
+
+ tprint_struct_next();
+ PRINT_FIELD_0X(desc, base_addr);
+ tprint_struct_next();
+ PRINT_FIELD_0X(desc, limit);
+ tprint_struct_next();
+ PRINT_FIELD_U_CAST(desc, seg_32bit, unsigned int);
+ tprint_struct_next();
+ PRINT_FIELD_U_CAST(desc, contents, unsigned int);
+ tprint_struct_next();
+ PRINT_FIELD_U_CAST(desc, read_exec_only, unsigned int);
+ tprint_struct_next();
+ PRINT_FIELD_U_CAST(desc, limit_in_pages, unsigned int);
+ tprint_struct_next();
+ PRINT_FIELD_U_CAST(desc, seg_not_present, unsigned int);
+ tprint_struct_next();
+ PRINT_FIELD_U_CAST(desc, useable, unsigned int);
+
+# ifdef HAVE_STRUCT_USER_DESC_LM
+ /* lm is totally ignored for 32-bit processes */
+ if (current_klongsize == 8) {
+ tprint_struct_next();
+ PRINT_FIELD_U_CAST(desc, lm, unsigned int);
+ }
+# endif /* HAVE_STRUCT_USER_DESC_LM */
+
+ tprint_struct_end();
+ }
+}
+
+SYS_FUNC(modify_ldt)
+{
+ if (entering(tcp)) {
+ tprintf("%d, ", (int) tcp->u_arg[0]);
+ if (tcp->u_arg[2] != sizeof(struct user_desc))
+ printaddr(tcp->u_arg[1]);
+ else
+ print_user_desc(tcp, tcp->u_arg[1], USER_DESC_BOTH);
+ tprintf(", %" PRI_klu, tcp->u_arg[2]);
+
+ return 0;
+ }
+
+ /*
+ * For some reason ("tht ABI for sys_modify_ldt() expects
+ * 'int'"), modify_ldt clips higher bits on x86_64.
+ */
+
+ if (syserror(tcp) || (kernel_ulong_t) tcp->u_rval < 0xfffff000)
+ return 0;
+
+ tcp->u_error = -(unsigned int) tcp->u_rval;
+
+ return 0;
+}
+
+SYS_FUNC(set_thread_area)
+{
+ if (entering(tcp)) {
+ print_user_desc(tcp, tcp->u_arg[0], USER_DESC_BOTH);
+ } else {
+ struct user_desc desc;
+
+ if (!verbose(tcp) || syserror(tcp) ||
+ umove(tcp, tcp->u_arg[0], &desc) < 0) {
+ /* returned entry_number is not available */
+ } else {
+ static char outstr[32];
+
+ xsprintf(outstr, "entry_number=%u", desc.entry_number);
+ tcp->auxstr = outstr;
+ return RVAL_STR;
+ }
+ }
+ return 0;
+}
+
+SYS_FUNC(get_thread_area)
+{
+ print_user_desc(tcp, tcp->u_arg[0],
+ entering(tcp) ? USER_DESC_ENTERING : USER_DESC_EXITING);
+ return 0;
+}
+
+#endif /* HAVE_STRUCT_USER_DESC */
+
+#if defined(M68K) || defined(MIPS)
+SYS_FUNC(set_thread_area)
+{
+ printaddr(tcp->u_arg[0]);
+
+ return RVAL_DECODED;
+
+}
+#endif
+
+#if defined(M68K)
+SYS_FUNC(get_thread_area)
+{
+ return RVAL_DECODED | RVAL_HEX;
+}
+#endif
diff --git a/src/link.c b/src/link.c
new file mode 100644
index 000000000..0d170485c
--- /dev/null
+++ b/src/link.c
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993-1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
+ * Copyright (c) 2006 Ulrich Drepper <drepper@redhat.com>
+ * Copyright (c) 2006 Bernhard Kaindl <bk@suse.de>
+ * Copyright (c) 2006-2019 Dmitry V. Levin <ldv@strace.io>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#include <fcntl.h>
+
+#include "xlat/at_flags.h"
+
+SYS_FUNC(link)
+{
+ printpath(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ printpath(tcp, tcp->u_arg[1]);
+
+ return RVAL_DECODED;
+}
+
+SYS_FUNC(linkat)
+{
+ print_dirfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ printpath(tcp, tcp->u_arg[1]);
+ tprints(", ");
+ print_dirfd(tcp, tcp->u_arg[2]);
+ tprints(", ");
+ printpath(tcp, tcp->u_arg[3]);
+ tprints(", ");
+ printflags(at_flags, tcp->u_arg[4], "AT_???");
+
+ return RVAL_DECODED;
+}
+
+SYS_FUNC(unlinkat)
+{
+ print_dirfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ printpath(tcp, tcp->u_arg[1]);
+ tprints(", ");
+ printflags(at_flags, tcp->u_arg[2], "AT_???");
+
+ return RVAL_DECODED;
+}
+
+SYS_FUNC(symlinkat)
+{
+ printpath(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ print_dirfd(tcp, tcp->u_arg[1]);
+ tprints(", ");
+ printpath(tcp, tcp->u_arg[2]);
+
+ return RVAL_DECODED;
+}
diff --git a/src/linux/32/ioctls_inc.h b/src/linux/32/ioctls_inc.h
new file mode 100644
index 000000000..84294ba01
--- /dev/null
+++ b/src/linux/32/ioctls_inc.h
@@ -0,0 +1,15 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#if defined M68K
+# include "32/ioctls_inc_align16.h"
+#elif defined X86_64 || defined X32 \
+ || SIZEOF_STRUCT_I64_I32 < SIZEOF_LONG_LONG * 2
+# include "32/ioctls_inc_align32.h"
+#else
+# include "32/ioctls_inc_align64.h"
+#endif
diff --git a/src/linux/32/ioctls_inc_align16.h b/src/linux/32/ioctls_inc_align16.h
new file mode 100644
index 000000000..867fde590
--- /dev/null
+++ b/src/linux/32/ioctls_inc_align16.h
@@ -0,0 +1,2914 @@
+/* Generated by ioctls_gen.sh from definitions found in $linux/include/ tree. */
+{ "acpi/apei.h", "APEI_ERST_CLEAR_RECORD", _IOC_WRITE, 0x4501, 0x08 },
+{ "acpi/apei.h", "APEI_ERST_GET_RECORD_COUNT", _IOC_READ, 0x4502, 0x04 },
+{ "asm-generic/ioctls.h", "FIOASYNC", 0, 0x5452, 0 },
+{ "asm-generic/ioctls.h", "FIOCLEX", 0, 0x5451, 0 },
+{ "asm-generic/ioctls.h", "FIONBIO", 0, 0x5421, 0 },
+{ "asm-generic/ioctls.h", "FIONCLEX", 0, 0x5450, 0 },
+{ "asm-generic/ioctls.h", "FIONREAD", 0, 0x541B, 0 },
+{ "asm-generic/ioctls.h", "FIOQSIZE", 0, 0x5460, 0 },
+{ "asm-generic/ioctls.h", "TCFLSH", 0, 0x540B, 0 },
+{ "asm-generic/ioctls.h", "TCGETA", 0, 0x5405, 0 },
+{ "asm-generic/ioctls.h", "TCGETS", 0, 0x5401, 0 },
+{ "asm-generic/ioctls.h", "TCGETS2", _IOC_READ, 0x542a, 0x2c },
+{ "asm-generic/ioctls.h", "TCGETX", 0, 0x5432, 0 },
+{ "asm-generic/ioctls.h", "TCSBRK", 0, 0x5409, 0 },
+{ "asm-generic/ioctls.h", "TCSBRKP", 0, 0x5425, 0 },
+{ "asm-generic/ioctls.h", "TCSETA", 0, 0x5406, 0 },
+{ "asm-generic/ioctls.h", "TCSETAF", 0, 0x5408, 0 },
+{ "asm-generic/ioctls.h", "TCSETAW", 0, 0x5407, 0 },
+{ "asm-generic/ioctls.h", "TCSETS", 0, 0x5402, 0 },
+{ "asm-generic/ioctls.h", "TCSETS2", _IOC_WRITE, 0x542b, 0x2c },
+{ "asm-generic/ioctls.h", "TCSETSF", 0, 0x5404, 0 },
+{ "asm-generic/ioctls.h", "TCSETSF2", _IOC_WRITE, 0x542d, 0x2c },
+{ "asm-generic/ioctls.h", "TCSETSW", 0, 0x5403, 0 },
+{ "asm-generic/ioctls.h", "TCSETSW2", _IOC_WRITE, 0x542c, 0x2c },
+{ "asm-generic/ioctls.h", "TCSETX", 0, 0x5433, 0 },
+{ "asm-generic/ioctls.h", "TCSETXF", 0, 0x5434, 0 },
+{ "asm-generic/ioctls.h", "TCSETXW", 0, 0x5435, 0 },
+{ "asm-generic/ioctls.h", "TCXONC", 0, 0x540A, 0 },
+{ "asm-generic/ioctls.h", "TIOCCBRK", 0, 0x5428, 0 },
+{ "asm-generic/ioctls.h", "TIOCCONS", 0, 0x541D, 0 },
+{ "asm-generic/ioctls.h", "TIOCEXCL", 0, 0x540C, 0 },
+{ "asm-generic/ioctls.h", "TIOCGDEV", _IOC_READ, 0x5432, 0x04 },
+{ "asm-generic/ioctls.h", "TIOCGETD", 0, 0x5424, 0 },
+{ "asm-generic/ioctls.h", "TIOCGEXCL", _IOC_READ, 0x5440, 0x04 },
+{ "asm-generic/ioctls.h", "TIOCGICOUNT", 0, 0x545D, 0 },
+{ "asm-generic/ioctls.h", "TIOCGISO7816", _IOC_READ, 0x5442, 0x28 },
+{ "asm-generic/ioctls.h", "TIOCGLCKTRMIOS", 0, 0x5456, 0 },
+{ "asm-generic/ioctls.h", "TIOCGPGRP", 0, 0x540F, 0 },
+{ "asm-generic/ioctls.h", "TIOCGPKT", _IOC_READ, 0x5438, 0x04 },
+{ "asm-generic/ioctls.h", "TIOCGPTLCK", _IOC_READ, 0x5439, 0x04 },
+{ "asm-generic/ioctls.h", "TIOCGPTN", _IOC_READ, 0x5430, 0x04 },
+{ "asm-generic/ioctls.h", "TIOCGPTPEER", _IOC_NONE, 0x5441, 0x00 },
+{ "asm-generic/ioctls.h", "TIOCGRS485", 0, 0x542E, 0 },
+{ "asm-generic/ioctls.h", "TIOCGSERIAL", 0, 0x541E, 0 },
+{ "asm-generic/ioctls.h", "TIOCGSID", 0, 0x5429, 0 },
+{ "asm-generic/ioctls.h", "TIOCGSOFTCAR", 0, 0x5419, 0 },
+{ "asm-generic/ioctls.h", "TIOCGWINSZ", 0, 0x5413, 0 },
+{ "asm-generic/ioctls.h", "TIOCLINUX", 0, 0x541C, 0 },
+{ "asm-generic/ioctls.h", "TIOCMBIC", 0, 0x5417, 0 },
+{ "asm-generic/ioctls.h", "TIOCMBIS", 0, 0x5416, 0 },
+{ "asm-generic/ioctls.h", "TIOCMGET", 0, 0x5415, 0 },
+{ "asm-generic/ioctls.h", "TIOCMIWAIT", 0, 0x545C, 0 },
+{ "asm-generic/ioctls.h", "TIOCMSET", 0, 0x5418, 0 },
+{ "asm-generic/ioctls.h", "TIOCNOTTY", 0, 0x5422, 0 },
+{ "asm-generic/ioctls.h", "TIOCNXCL", 0, 0x540D, 0 },
+{ "asm-generic/ioctls.h", "TIOCOUTQ", 0, 0x5411, 0 },
+{ "asm-generic/ioctls.h", "TIOCPKT", 0, 0x5420, 0 },
+{ "asm-generic/ioctls.h", "TIOCSBRK", 0, 0x5427, 0 },
+{ "asm-generic/ioctls.h", "TIOCSCTTY", 0, 0x540E, 0 },
+{ "asm-generic/ioctls.h", "TIOCSERCONFIG", 0, 0x5453, 0 },
+{ "asm-generic/ioctls.h", "TIOCSERGETLSR", 0, 0x5459, 0 },
+{ "asm-generic/ioctls.h", "TIOCSERGETMULTI", 0, 0x545A, 0 },
+{ "asm-generic/ioctls.h", "TIOCSERGSTRUCT", 0, 0x5458, 0 },
+{ "asm-generic/ioctls.h", "TIOCSERGWILD", 0, 0x5454, 0 },
+{ "asm-generic/ioctls.h", "TIOCSERSETMULTI", 0, 0x545B, 0 },
+{ "asm-generic/ioctls.h", "TIOCSERSWILD", 0, 0x5455, 0 },
+{ "asm-generic/ioctls.h", "TIOCSETD", 0, 0x5423, 0 },
+{ "asm-generic/ioctls.h", "TIOCSIG", _IOC_WRITE, 0x5436, 0x04 },
+{ "asm-generic/ioctls.h", "TIOCSISO7816", _IOC_READ|_IOC_WRITE, 0x5443, 0x28 },
+{ "asm-generic/ioctls.h", "TIOCSLCKTRMIOS", 0, 0x5457, 0 },
+{ "asm-generic/ioctls.h", "TIOCSPGRP", 0, 0x5410, 0 },
+{ "asm-generic/ioctls.h", "TIOCSPTLCK", _IOC_WRITE, 0x5431, 0x04 },
+{ "asm-generic/ioctls.h", "TIOCSRS485", 0, 0x542F, 0 },
+{ "asm-generic/ioctls.h", "TIOCSSERIAL", 0, 0x541F, 0 },
+{ "asm-generic/ioctls.h", "TIOCSSOFTCAR", 0, 0x541A, 0 },
+{ "asm-generic/ioctls.h", "TIOCSTI", 0, 0x5412, 0 },
+{ "asm-generic/ioctls.h", "TIOCSWINSZ", 0, 0x5414, 0 },
+{ "asm-generic/ioctls.h", "TIOCVHANGUP", 0, 0x5437, 0 },
+{ "asm-generic/sockios.h", "FIOGETOWN", 0, 0x8903, 0 },
+{ "asm-generic/sockios.h", "FIOSETOWN", 0, 0x8901, 0 },
+{ "asm-generic/sockios.h", "SIOCATMARK", 0, 0x8905, 0 },
+{ "asm-generic/sockios.h", "SIOCGPGRP", 0, 0x8904, 0 },
+{ "asm-generic/sockios.h", "SIOCGSTAMPNS_OLD", 0, 0x8907, 0 },
+{ "asm-generic/sockios.h", "SIOCGSTAMP_OLD", 0, 0x8906, 0 },
+{ "asm-generic/sockios.h", "SIOCSPGRP", 0, 0x8902, 0 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_BO_LIST", _IOC_READ|_IOC_WRITE, 0x6443, 0x18 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_CS", _IOC_READ|_IOC_WRITE, 0x6444, 0x18 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_CTX", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_FENCE_TO_HANDLE", _IOC_READ|_IOC_WRITE, 0x6454, 0x20 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_CREATE", _IOC_READ|_IOC_WRITE, 0x6440, 0x20 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_METADATA", _IOC_READ|_IOC_WRITE, 0x6446, 0x11c },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_MMAP", _IOC_READ|_IOC_WRITE, 0x6441, 0x08 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_OP", _IOC_READ|_IOC_WRITE, 0x6450, 0x10 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_USERPTR", _IOC_READ|_IOC_WRITE, 0x6451, 0x18 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_VA", _IOC_WRITE, 0x6448, 0x28 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_WAIT_IDLE", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_INFO", _IOC_WRITE, 0x6445, 0x20 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_SCHED", _IOC_WRITE, 0x6455, 0x10 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_VM", _IOC_READ|_IOC_WRITE, 0x6453, 0x08 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_WAIT_CS", _IOC_READ|_IOC_WRITE, 0x6449, 0x20 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_WAIT_FENCES", _IOC_READ|_IOC_WRITE, 0x6452, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_ADD_BUFS", _IOC_READ|_IOC_WRITE, 0x6416, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_ADD_CTX", _IOC_READ|_IOC_WRITE, 0x6420, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_ADD_DRAW", _IOC_READ|_IOC_WRITE, 0x6427, 0x04 },
+{ "drm/drm.h", "DRM_IOCTL_ADD_MAP", _IOC_READ|_IOC_WRITE, 0x6415, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_AGP_ACQUIRE", _IOC_NONE, 0x6430, 0x00 },
+{ "drm/drm.h", "DRM_IOCTL_AGP_ALLOC", _IOC_READ|_IOC_WRITE, 0x6434, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_AGP_BIND", _IOC_WRITE, 0x6436, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_AGP_ENABLE", _IOC_WRITE, 0x6432, 0x04 },
+{ "drm/drm.h", "DRM_IOCTL_AGP_FREE", _IOC_WRITE, 0x6435, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_AGP_INFO", _IOC_READ, 0x6433, 0x20 },
+{ "drm/drm.h", "DRM_IOCTL_AGP_RELEASE", _IOC_NONE, 0x6431, 0x00 },
+{ "drm/drm.h", "DRM_IOCTL_AGP_UNBIND", _IOC_WRITE, 0x6437, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_AUTH_MAGIC", _IOC_WRITE, 0x6411, 0x04 },
+{ "drm/drm.h", "DRM_IOCTL_BLOCK", _IOC_READ|_IOC_WRITE, 0x6412, 0x04 },
+{ "drm/drm.h", "DRM_IOCTL_CONTROL", _IOC_WRITE, 0x6414, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_CRTC_GET_SEQUENCE", _IOC_READ|_IOC_WRITE, 0x643b, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_CRTC_QUEUE_SEQUENCE", _IOC_READ|_IOC_WRITE, 0x643c, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_DMA", _IOC_READ|_IOC_WRITE, 0x6429, 0x28 },
+{ "drm/drm.h", "DRM_IOCTL_DROP_MASTER", _IOC_NONE, 0x641f, 0x00 },
+{ "drm/drm.h", "DRM_IOCTL_FINISH", _IOC_WRITE, 0x642c, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_FREE_BUFS", _IOC_WRITE, 0x641a, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_GEM_CLOSE", _IOC_WRITE, 0x6409, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_GEM_FLINK", _IOC_READ|_IOC_WRITE, 0x640a, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_GEM_OPEN", _IOC_READ|_IOC_WRITE, 0x640b, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_GET_CAP", _IOC_READ|_IOC_WRITE, 0x640c, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_GET_CLIENT", _IOC_READ|_IOC_WRITE, 0x6405, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_GET_CTX", _IOC_READ|_IOC_WRITE, 0x6423, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_GET_MAGIC", _IOC_READ, 0x6402, 0x04 },
+{ "drm/drm.h", "DRM_IOCTL_GET_MAP", _IOC_READ|_IOC_WRITE, 0x6404, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_GET_SAREA_CTX", _IOC_READ|_IOC_WRITE, 0x641d, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_GET_STATS", _IOC_READ, 0x6406, 0x7c },
+{ "drm/drm.h", "DRM_IOCTL_GET_UNIQUE", _IOC_READ|_IOC_WRITE, 0x6401, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_INFO_BUFS", _IOC_READ|_IOC_WRITE, 0x6418, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_IRQ_BUSID", _IOC_READ|_IOC_WRITE, 0x6403, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_LOCK", _IOC_WRITE, 0x642a, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_MAP_BUFS", _IOC_READ|_IOC_WRITE, 0x6419, 0x0c },
+{ "drm/drm.h", "DRM_IOCTL_MARK_BUFS", _IOC_WRITE, 0x6417, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_MODESET_CTL", _IOC_WRITE, 0x6408, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_ADDFB", _IOC_READ|_IOC_WRITE, 0x64ae, 0x1c },
+{ "drm/drm.h", "DRM_IOCTL_MODE_ADDFB2", _IOC_READ|_IOC_WRITE, 0x64b8, 0x64 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_ATOMIC", _IOC_READ|_IOC_WRITE, 0x64bc, 0x38 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_ATTACHMODE", _IOC_READ|_IOC_WRITE, 0x64a8, 0x48 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_CREATEPROPBLOB", _IOC_READ|_IOC_WRITE, 0x64bd, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_CREATE_DUMB", _IOC_READ|_IOC_WRITE, 0x64b2, 0x20 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_CREATE_LEASE", _IOC_READ|_IOC_WRITE, 0x64c6, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_CURSOR", _IOC_READ|_IOC_WRITE, 0x64a3, 0x1c },
+{ "drm/drm.h", "DRM_IOCTL_MODE_CURSOR2", _IOC_READ|_IOC_WRITE, 0x64bb, 0x24 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_DESTROYPROPBLOB", _IOC_READ|_IOC_WRITE, 0x64be, 0x04 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_DESTROY_DUMB", _IOC_READ|_IOC_WRITE, 0x64b4, 0x04 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_DETACHMODE", _IOC_READ|_IOC_WRITE, 0x64a9, 0x48 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_DIRTYFB", _IOC_READ|_IOC_WRITE, 0x64b1, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_GETCONNECTOR", _IOC_READ|_IOC_WRITE, 0x64a7, 0x50 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_GETCRTC", _IOC_READ|_IOC_WRITE, 0x64a1, 0x68 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_GETENCODER", _IOC_READ|_IOC_WRITE, 0x64a6, 0x14 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_GETFB", _IOC_READ|_IOC_WRITE, 0x64ad, 0x1c },
+{ "drm/drm.h", "DRM_IOCTL_MODE_GETFB2", _IOC_READ|_IOC_WRITE, 0x64ce, 0x64 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_GETGAMMA", _IOC_READ|_IOC_WRITE, 0x64a4, 0x20 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_GETPLANE", _IOC_READ|_IOC_WRITE, 0x64b6, 0x20 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_GETPLANERESOURCES", _IOC_READ|_IOC_WRITE, 0x64b5, 0x0c },
+{ "drm/drm.h", "DRM_IOCTL_MODE_GETPROPBLOB", _IOC_READ|_IOC_WRITE, 0x64ac, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_GETPROPERTY", _IOC_READ|_IOC_WRITE, 0x64aa, 0x40 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_GETRESOURCES", _IOC_READ|_IOC_WRITE, 0x64a0, 0x40 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_GET_LEASE", _IOC_READ|_IOC_WRITE, 0x64c8, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_LIST_LESSEES", _IOC_READ|_IOC_WRITE, 0x64c7, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_MAP_DUMB", _IOC_READ|_IOC_WRITE, 0x64b3, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_OBJ_GETPROPERTIES", _IOC_READ|_IOC_WRITE, 0x64b9, 0x1c },
+{ "drm/drm.h", "DRM_IOCTL_MODE_OBJ_SETPROPERTY", _IOC_READ|_IOC_WRITE, 0x64ba, 0x14 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_PAGE_FLIP", _IOC_READ|_IOC_WRITE, 0x64b0, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_REVOKE_LEASE", _IOC_READ|_IOC_WRITE, 0x64c9, 0x04 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_RMFB", _IOC_READ|_IOC_WRITE, 0x64af, 0x04 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_SETCRTC", _IOC_READ|_IOC_WRITE, 0x64a2, 0x68 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_SETGAMMA", _IOC_READ|_IOC_WRITE, 0x64a5, 0x20 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_SETPLANE", _IOC_READ|_IOC_WRITE, 0x64b7, 0x30 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_SETPROPERTY", _IOC_READ|_IOC_WRITE, 0x64ab, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_MOD_CTX", _IOC_WRITE, 0x6422, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_NEW_CTX", _IOC_WRITE, 0x6425, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_PRIME_FD_TO_HANDLE", _IOC_READ|_IOC_WRITE, 0x642e, 0x0c },
+{ "drm/drm.h", "DRM_IOCTL_PRIME_HANDLE_TO_FD", _IOC_READ|_IOC_WRITE, 0x642d, 0x0c },
+{ "drm/drm.h", "DRM_IOCTL_RES_CTX", _IOC_READ|_IOC_WRITE, 0x6426, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_RM_CTX", _IOC_READ|_IOC_WRITE, 0x6421, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_RM_DRAW", _IOC_READ|_IOC_WRITE, 0x6428, 0x04 },
+{ "drm/drm.h", "DRM_IOCTL_RM_MAP", _IOC_WRITE, 0x641b, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_SET_CLIENT_CAP", _IOC_WRITE, 0x640d, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_SET_MASTER", _IOC_NONE, 0x641e, 0x00 },
+{ "drm/drm.h", "DRM_IOCTL_SET_SAREA_CTX", _IOC_WRITE, 0x641c, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_SET_UNIQUE", _IOC_WRITE, 0x6410, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_SET_VERSION", _IOC_READ|_IOC_WRITE, 0x6407, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_SG_ALLOC", _IOC_READ|_IOC_WRITE, 0x6438, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_SG_FREE", _IOC_WRITE, 0x6439, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_SWITCH_CTX", _IOC_WRITE, 0x6424, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_CREATE", _IOC_READ|_IOC_WRITE, 0x64bf, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_DESTROY", _IOC_READ|_IOC_WRITE, 0x64c0, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_FD_TO_HANDLE", _IOC_READ|_IOC_WRITE, 0x64c2, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_HANDLE_TO_FD", _IOC_READ|_IOC_WRITE, 0x64c1, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_QUERY", _IOC_READ|_IOC_WRITE, 0x64cb, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_RESET", _IOC_READ|_IOC_WRITE, 0x64c4, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_SIGNAL", _IOC_READ|_IOC_WRITE, 0x64c5, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_TIMELINE_SIGNAL", _IOC_READ|_IOC_WRITE, 0x64cd, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_TIMELINE_WAIT", _IOC_READ|_IOC_WRITE, 0x64ca, 0x28 },
+{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_TRANSFER", _IOC_READ|_IOC_WRITE, 0x64cc, 0x20 },
+{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_WAIT", _IOC_READ|_IOC_WRITE, 0x64c3, 0x20 },
+{ "drm/drm.h", "DRM_IOCTL_UNBLOCK", _IOC_READ|_IOC_WRITE, 0x6413, 0x04 },
+{ "drm/drm.h", "DRM_IOCTL_UNLOCK", _IOC_WRITE, 0x642b, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_UPDATE_DRAW", _IOC_WRITE, 0x643f, 0x14 },
+{ "drm/drm.h", "DRM_IOCTL_VERSION", _IOC_READ|_IOC_WRITE, 0x6400, 0x24 },
+{ "drm/drm.h", "DRM_IOCTL_WAIT_VBLANK", _IOC_READ|_IOC_WRITE, 0x643a, 0x10 },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_CPU_FINI", _IOC_WRITE, 0x6445, 0x08 },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_CPU_PREP", _IOC_WRITE, 0x6444, 0x18 },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_NEW", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_SUBMIT", _IOC_READ|_IOC_WRITE, 0x6446, 0x48 },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_USERPTR", _IOC_READ|_IOC_WRITE, 0x6448, 0x18 },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_WAIT", _IOC_WRITE, 0x6449, 0x20 },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_PM_QUERY_DOM", _IOC_READ|_IOC_WRITE, 0x644a, 0x48 },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_PM_QUERY_SIG", _IOC_READ|_IOC_WRITE, 0x644b, 0x4a },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_WAIT_FENCE", _IOC_WRITE, 0x6447, 0x20 },
+{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_G2D_EXEC", _IOC_READ|_IOC_WRITE, 0x6462, 0x08 },
+{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_G2D_GET_VER", _IOC_READ|_IOC_WRITE, 0x6460, 0x08 },
+{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_G2D_SET_CMDLIST", _IOC_READ|_IOC_WRITE, 0x6461, 0x28 },
+{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_GEM_CREATE", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 },
+{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_GEM_GET", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 },
+{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_GEM_MAP", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 },
+{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_IPP_COMMIT", _IOC_READ|_IOC_WRITE, 0x6483, 0x20 },
+{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_IPP_GET_CAPS", _IOC_READ|_IOC_WRITE, 0x6481, 0x18 },
+{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_IPP_GET_LIMITS", _IOC_READ|_IOC_WRITE, 0x6482, 0x20 },
+{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_IPP_GET_RESOURCES", _IOC_READ|_IOC_WRITE, 0x6480, 0x10 },
+{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_VIDI_CONNECTION", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 },
+{ "drm/i810_drm.h", "DRM_IOCTL_I810_CLEAR", _IOC_WRITE, 0x6442, 0x0c },
+{ "drm/i810_drm.h", "DRM_IOCTL_I810_COPY", _IOC_WRITE, 0x6447, 0x0c },
+{ "drm/i810_drm.h", "DRM_IOCTL_I810_DOCOPY", _IOC_NONE, 0x6448, 0x00 },
+{ "drm/i810_drm.h", "DRM_IOCTL_I810_FLIP", _IOC_NONE, 0x644e, 0x00 },
+{ "drm/i810_drm.h", "DRM_IOCTL_I810_FLUSH", _IOC_NONE, 0x6443, 0x00 },
+{ "drm/i810_drm.h", "DRM_IOCTL_I810_FSTATUS", _IOC_NONE, 0x644a, 0x00 },
+{ "drm/i810_drm.h", "DRM_IOCTL_I810_GETAGE", _IOC_NONE, 0x6444, 0x00 },
+{ "drm/i810_drm.h", "DRM_IOCTL_I810_GETBUF", _IOC_READ|_IOC_WRITE, 0x6445, 0x10 },
+{ "drm/i810_drm.h", "DRM_IOCTL_I810_INIT", _IOC_WRITE, 0x6440, 0x40 },
+{ "drm/i810_drm.h", "DRM_IOCTL_I810_MC", _IOC_WRITE, 0x644c, 0x14 },
+{ "drm/i810_drm.h", "DRM_IOCTL_I810_OV0FLIP", _IOC_NONE, 0x644b, 0x00 },
+{ "drm/i810_drm.h", "DRM_IOCTL_I810_OV0INFO", _IOC_READ, 0x6449, 0x08 },
+{ "drm/i810_drm.h", "DRM_IOCTL_I810_RSTATUS", _IOC_NONE, 0x644d, 0x00 },
+{ "drm/i810_drm.h", "DRM_IOCTL_I810_SWAP", _IOC_NONE, 0x6446, 0x00 },
+{ "drm/i810_drm.h", "DRM_IOCTL_I810_VERTEX", _IOC_WRITE, 0x6441, 0x0c },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_ALLOC", _IOC_READ|_IOC_WRITE, 0x6448, 0x10 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_BATCHBUFFER", _IOC_WRITE, 0x6443, 0x18 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_CMDBUFFER", _IOC_WRITE, 0x644b, 0x18 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_DESTROY_HEAP", _IOC_WRITE, 0x644c, 0x04 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_FLIP", _IOC_NONE, 0x6442, 0x00 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_FLUSH", _IOC_NONE, 0x6441, 0x00 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_FREE", _IOC_WRITE, 0x6449, 0x08 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_BUSY", _IOC_READ|_IOC_WRITE, 0x6457, 0x08 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_CONTEXT_CREATE", _IOC_READ|_IOC_WRITE, 0x646d, 0x08 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_CONTEXT_CREATE_EXT", _IOC_READ|_IOC_WRITE, 0x646d, 0x10 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_CONTEXT_DESTROY", _IOC_WRITE, 0x646e, 0x08 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_CONTEXT_GETPARAM", _IOC_READ|_IOC_WRITE, 0x6474, 0x18 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_CONTEXT_SETPARAM", _IOC_READ|_IOC_WRITE, 0x6475, 0x18 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_CREATE", _IOC_READ|_IOC_WRITE, 0x645b, 0x10 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_ENTERVT", _IOC_NONE, 0x6459, 0x00 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_EXECBUFFER", _IOC_WRITE, 0x6454, 0x28 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_EXECBUFFER2", _IOC_WRITE, 0x6469, 0x40 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_EXECBUFFER2_WR", _IOC_READ|_IOC_WRITE, 0x6469, 0x40 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_GET_APERTURE", _IOC_READ, 0x6463, 0x10 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_GET_CACHING", _IOC_READ|_IOC_WRITE, 0x6470, 0x08 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_GET_TILING", _IOC_READ|_IOC_WRITE, 0x6462, 0x10 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_INIT", _IOC_WRITE, 0x6453, 0x10 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_LEAVEVT", _IOC_NONE, 0x645a, 0x00 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_MADVISE", _IOC_READ|_IOC_WRITE, 0x6466, 0x0c },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_MMAP", _IOC_READ|_IOC_WRITE, 0x645e, 0x28 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_MMAP_GTT", _IOC_READ|_IOC_WRITE, 0x6464, 0x10 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_MMAP_OFFSET", _IOC_READ|_IOC_WRITE, 0x6464, 0x20 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_PIN", _IOC_READ|_IOC_WRITE, 0x6455, 0x18 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_PREAD", _IOC_WRITE, 0x645c, 0x20 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_PWRITE", _IOC_WRITE, 0x645d, 0x20 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_SET_CACHING", _IOC_WRITE, 0x646f, 0x08 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_SET_DOMAIN", _IOC_WRITE, 0x645f, 0x0c },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_SET_TILING", _IOC_READ|_IOC_WRITE, 0x6461, 0x10 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_SW_FINISH", _IOC_WRITE, 0x6460, 0x04 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_THROTTLE", _IOC_NONE, 0x6458, 0x00 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_UNPIN", _IOC_WRITE, 0x6456, 0x08 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_USERPTR", _IOC_READ|_IOC_WRITE, 0x6473, 0x18 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_VM_CREATE", _IOC_READ|_IOC_WRITE, 0x647a, 0x10 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_VM_DESTROY", _IOC_WRITE, 0x647b, 0x10 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_WAIT", _IOC_READ|_IOC_WRITE, 0x646c, 0x10 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GETPARAM", _IOC_READ|_IOC_WRITE, 0x6446, 0x08 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GET_PIPE_FROM_CRTC_ID", _IOC_READ|_IOC_WRITE, 0x6465, 0x08 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GET_RESET_STATS", _IOC_READ|_IOC_WRITE, 0x6472, 0x18 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GET_SPRITE_COLORKEY", _IOC_READ|_IOC_WRITE, 0x646a, 0x14 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GET_VBLANK_PIPE", _IOC_READ, 0x644e, 0x04 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_HWS_ADDR", _IOC_WRITE, 0x6451, 0x10 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_INIT", _IOC_WRITE, 0x6440, 0x44 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_INIT_HEAP", _IOC_WRITE, 0x644a, 0x0c },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_IRQ_EMIT", _IOC_READ|_IOC_WRITE, 0x6444, 0x04 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_IRQ_WAIT", _IOC_WRITE, 0x6445, 0x04 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_OVERLAY_ATTRS", _IOC_READ|_IOC_WRITE, 0x6468, 0x2c },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_OVERLAY_PUT_IMAGE", _IOC_WRITE, 0x6467, 0x2c },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_PERF_ADD_CONFIG", _IOC_WRITE, 0x6477, 0x48 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_PERF_OPEN", _IOC_WRITE, 0x6476, 0x10 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_PERF_REMOVE_CONFIG", _IOC_WRITE, 0x6478, 0x08 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_QUERY", _IOC_READ|_IOC_WRITE, 0x6479, 0x10 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_REG_READ", _IOC_READ|_IOC_WRITE, 0x6471, 0x10 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_SETPARAM", _IOC_WRITE, 0x6447, 0x08 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_SET_SPRITE_COLORKEY", _IOC_READ|_IOC_WRITE, 0x646b, 0x14 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_SET_VBLANK_PIPE", _IOC_WRITE, 0x644d, 0x04 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_VBLANK_SWAP", _IOC_READ|_IOC_WRITE, 0x644f, 0x0c },
+{ "drm/i915_drm.h", "I915_PERF_IOCTL_CONFIG", _IOC_NONE, 0x6902, 0x00 },
+{ "drm/i915_drm.h", "I915_PERF_IOCTL_DISABLE", _IOC_NONE, 0x6901, 0x00 },
+{ "drm/i915_drm.h", "I915_PERF_IOCTL_ENABLE", _IOC_NONE, 0x6900, 0x00 },
+{ "drm/lima_drm.h", "DRM_IOCTL_LIMA_CTX_CREATE", _IOC_READ, 0x6445, 0x08 },
+{ "drm/lima_drm.h", "DRM_IOCTL_LIMA_CTX_FREE", _IOC_WRITE, 0x6446, 0x08 },
+{ "drm/lima_drm.h", "DRM_IOCTL_LIMA_GEM_CREATE", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 },
+{ "drm/lima_drm.h", "DRM_IOCTL_LIMA_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 },
+{ "drm/lima_drm.h", "DRM_IOCTL_LIMA_GEM_SUBMIT", _IOC_WRITE, 0x6443, 0x30 },
+{ "drm/lima_drm.h", "DRM_IOCTL_LIMA_GEM_WAIT", _IOC_WRITE, 0x6444, 0x10 },
+{ "drm/lima_drm.h", "DRM_IOCTL_LIMA_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 },
+{ "drm/mga_drm.h", "DRM_IOCTL_MGA_BLIT", _IOC_WRITE, 0x6448, 0x34 },
+{ "drm/mga_drm.h", "DRM_IOCTL_MGA_CLEAR", _IOC_WRITE, 0x6444, 0x14 },
+{ "drm/mga_drm.h", "DRM_IOCTL_MGA_DMA_BOOTSTRAP", _IOC_READ|_IOC_WRITE, 0x644c, 0x1a },
+{ "drm/mga_drm.h", "DRM_IOCTL_MGA_FLUSH", _IOC_WRITE, 0x6441, 0x08 },
+{ "drm/mga_drm.h", "DRM_IOCTL_MGA_GETPARAM", _IOC_READ|_IOC_WRITE, 0x6449, 0x08 },
+{ "drm/mga_drm.h", "DRM_IOCTL_MGA_ILOAD", _IOC_WRITE, 0x6447, 0x0c },
+{ "drm/mga_drm.h", "DRM_IOCTL_MGA_INDICES", _IOC_WRITE, 0x6446, 0x10 },
+{ "drm/mga_drm.h", "DRM_IOCTL_MGA_INIT", _IOC_WRITE, 0x6440, 0x5c },
+{ "drm/mga_drm.h", "DRM_IOCTL_MGA_RESET", _IOC_NONE, 0x6442, 0x00 },
+{ "drm/mga_drm.h", "DRM_IOCTL_MGA_SET_FENCE", _IOC_WRITE, 0x644a, 0x04 },
+{ "drm/mga_drm.h", "DRM_IOCTL_MGA_SWAP", _IOC_NONE, 0x6443, 0x00 },
+{ "drm/mga_drm.h", "DRM_IOCTL_MGA_VERTEX", _IOC_WRITE, 0x6445, 0x0c },
+{ "drm/mga_drm.h", "DRM_IOCTL_MGA_WAIT_FENCE", _IOC_READ|_IOC_WRITE, 0x644b, 0x04 },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_CPU_FINI", _IOC_WRITE, 0x6445, 0x04 },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_CPU_PREP", _IOC_WRITE, 0x6444, 0x18 },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6443, 0x18 },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_MADVISE", _IOC_READ|_IOC_WRITE, 0x6448, 0x0c },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_NEW", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_SUBMIT", _IOC_READ|_IOC_WRITE, 0x6446, 0x48 },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_SUBMITQUEUE_CLOSE", _IOC_WRITE, 0x644b, 0x04 },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_SUBMITQUEUE_NEW", _IOC_READ|_IOC_WRITE, 0x644a, 0x0c },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_SUBMITQUEUE_QUERY", _IOC_WRITE, 0x644c, 0x18 },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_WAIT_FENCE", _IOC_WRITE, 0x6447, 0x1c },
+{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_CPU_FINI", _IOC_WRITE, 0x6483, 0x04 },
+{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_CPU_PREP", _IOC_WRITE, 0x6482, 0x08 },
+{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6484, 0x28 },
+{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_NEW", _IOC_READ|_IOC_WRITE, 0x6480, 0x30 },
+{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_PUSHBUF", _IOC_READ|_IOC_WRITE, 0x6481, 0x40 },
+{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_SVM_BIND", _IOC_READ|_IOC_WRITE, 0x6449, 0x40 },
+{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_SVM_INIT", _IOC_READ|_IOC_WRITE, 0x6448, 0x10 },
+{ "drm/omap_drm.h", "DRM_IOCTL_OMAP_GEM_CPU_FINI", _IOC_WRITE, 0x6445, 0x10 },
+{ "drm/omap_drm.h", "DRM_IOCTL_OMAP_GEM_CPU_PREP", _IOC_WRITE, 0x6444, 0x08 },
+{ "drm/omap_drm.h", "DRM_IOCTL_OMAP_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6446, 0x18 },
+{ "drm/omap_drm.h", "DRM_IOCTL_OMAP_GEM_NEW", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 },
+{ "drm/omap_drm.h", "DRM_IOCTL_OMAP_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 },
+{ "drm/omap_drm.h", "DRM_IOCTL_OMAP_SET_PARAM", _IOC_WRITE, 0x6441, 0x10 },
+{ "drm/panfrost_drm.h", "DRM_IOCTL_PANFROST_CREATE_BO", _IOC_READ|_IOC_WRITE, 0x6442, 0x18 },
+{ "drm/panfrost_drm.h", "DRM_IOCTL_PANFROST_GET_BO_OFFSET", _IOC_READ|_IOC_WRITE, 0x6445, 0x10 },
+{ "drm/panfrost_drm.h", "DRM_IOCTL_PANFROST_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 },
+{ "drm/panfrost_drm.h", "DRM_IOCTL_PANFROST_MADVISE", _IOC_READ|_IOC_WRITE, 0x6448, 0x0c },
+{ "drm/panfrost_drm.h", "DRM_IOCTL_PANFROST_MMAP_BO", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 },
+{ "drm/panfrost_drm.h", "DRM_IOCTL_PANFROST_PERFCNT_DUMP", _IOC_WRITE, 0x6447, 0x08 },
+{ "drm/panfrost_drm.h", "DRM_IOCTL_PANFROST_PERFCNT_ENABLE", _IOC_WRITE, 0x6446, 0x08 },
+{ "drm/panfrost_drm.h", "DRM_IOCTL_PANFROST_SUBMIT", _IOC_WRITE, 0x6440, 0x28 },
+{ "drm/panfrost_drm.h", "DRM_IOCTL_PANFROST_WAIT_BO", _IOC_WRITE, 0x6441, 0x10 },
+{ "drm/qxl_drm.h", "DRM_IOCTL_QXL_ALLOC", _IOC_READ|_IOC_WRITE, 0x6440, 0x08 },
+{ "drm/qxl_drm.h", "DRM_IOCTL_QXL_ALLOC_SURF", _IOC_READ|_IOC_WRITE, 0x6446, 0x18 },
+{ "drm/qxl_drm.h", "DRM_IOCTL_QXL_CLIENTCAP", _IOC_WRITE, 0x6445, 0x08 },
+{ "drm/qxl_drm.h", "DRM_IOCTL_QXL_EXECBUFFER", _IOC_WRITE, 0x6442, 0x10 },
+{ "drm/qxl_drm.h", "DRM_IOCTL_QXL_GETPARAM", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 },
+{ "drm/qxl_drm.h", "DRM_IOCTL_QXL_MAP", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 },
+{ "drm/qxl_drm.h", "DRM_IOCTL_QXL_UPDATE_AREA", _IOC_WRITE, 0x6443, 0x18 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_BLIT", _IOC_WRITE, 0x644b, 0x18 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_CCE_IDLE", _IOC_NONE, 0x6444, 0x00 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_CCE_RESET", _IOC_NONE, 0x6443, 0x00 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_CCE_START", _IOC_NONE, 0x6441, 0x00 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_CCE_STOP", _IOC_WRITE, 0x6442, 0x08 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_CLEAR", _IOC_WRITE, 0x6448, 0x14 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_DEPTH", _IOC_WRITE, 0x644c, 0x18 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_FLIP", _IOC_NONE, 0x6453, 0x00 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_FULLSCREEN", _IOC_WRITE, 0x6450, 0x04 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_GETPARAM", _IOC_READ|_IOC_WRITE, 0x6452, 0x08 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_INDICES", _IOC_WRITE, 0x644a, 0x14 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_INDIRECT", _IOC_READ|_IOC_WRITE, 0x644f, 0x10 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_INIT", _IOC_WRITE, 0x6440, 0x58 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_RESET", _IOC_NONE, 0x6446, 0x00 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_STIPPLE", _IOC_WRITE, 0x644d, 0x04 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_SWAP", _IOC_NONE, 0x6447, 0x00 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_VERTEX", _IOC_WRITE, 0x6449, 0x10 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_ALLOC", _IOC_READ|_IOC_WRITE, 0x6453, 0x10 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CLEAR", _IOC_WRITE, 0x6448, 0x18 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CMDBUF", _IOC_WRITE, 0x6450, 0x10 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CP_IDLE", _IOC_NONE, 0x6444, 0x00 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CP_INIT", _IOC_WRITE, 0x6440, 0x54 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CP_RESET", _IOC_NONE, 0x6443, 0x00 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CP_RESUME", _IOC_NONE, 0x6458, 0x00 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CP_START", _IOC_NONE, 0x6441, 0x00 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CP_STOP", _IOC_WRITE, 0x6442, 0x08 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CS", _IOC_READ|_IOC_WRITE, 0x6466, 0x20 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_FLIP", _IOC_NONE, 0x6452, 0x00 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_FREE", _IOC_WRITE, 0x6454, 0x08 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_FULLSCREEN", _IOC_WRITE, 0x6446, 0x04 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_BUSY", _IOC_READ|_IOC_WRITE, 0x646a, 0x08 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_CREATE", _IOC_READ|_IOC_WRITE, 0x645d, 0x1c },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_GET_TILING", _IOC_READ|_IOC_WRITE, 0x6469, 0x0c },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x645c, 0x18 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_MMAP", _IOC_READ|_IOC_WRITE, 0x645e, 0x20 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_OP", _IOC_READ|_IOC_WRITE, 0x646c, 0x10 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_PREAD", _IOC_READ|_IOC_WRITE, 0x6461, 0x20 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_PWRITE", _IOC_READ|_IOC_WRITE, 0x6462, 0x20 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_SET_DOMAIN", _IOC_READ|_IOC_WRITE, 0x6463, 0x0c },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_SET_TILING", _IOC_READ|_IOC_WRITE, 0x6468, 0x0c },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_USERPTR", _IOC_READ|_IOC_WRITE, 0x646d, 0x18 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_VA", _IOC_READ|_IOC_WRITE, 0x646b, 0x18 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_WAIT_IDLE", _IOC_WRITE, 0x6464, 0x08 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GETPARAM", _IOC_READ|_IOC_WRITE, 0x6451, 0x08 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_INDICES", _IOC_WRITE, 0x644a, 0x14 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_INDIRECT", _IOC_READ|_IOC_WRITE, 0x644d, 0x10 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_INFO", _IOC_READ|_IOC_WRITE, 0x6467, 0x10 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_INIT_HEAP", _IOC_WRITE, 0x6455, 0x0c },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_IRQ_EMIT", _IOC_READ|_IOC_WRITE, 0x6456, 0x04 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_IRQ_WAIT", _IOC_WRITE, 0x6457, 0x04 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_RESET", _IOC_NONE, 0x6445, 0x00 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_SETPARAM", _IOC_WRITE, 0x6459, 0x0c },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_STIPPLE", _IOC_WRITE, 0x644c, 0x04 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_SURF_ALLOC", _IOC_WRITE, 0x645a, 0x0c },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_SURF_FREE", _IOC_WRITE, 0x645b, 0x04 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_SWAP", _IOC_NONE, 0x6447, 0x00 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_TEXTURE", _IOC_READ|_IOC_WRITE, 0x644e, 0x18 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_VERTEX", _IOC_WRITE, 0x6449, 0x10 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_VERTEX2", _IOC_WRITE, 0x644f, 0x18 },
+{ "drm/savage_drm.h", "DRM_IOCTL_SAVAGE_BCI_CMDBUF", _IOC_WRITE, 0x6441, 0x24 },
+{ "drm/savage_drm.h", "DRM_IOCTL_SAVAGE_BCI_EVENT_EMIT", _IOC_READ|_IOC_WRITE, 0x6442, 0x08 },
+{ "drm/savage_drm.h", "DRM_IOCTL_SAVAGE_BCI_EVENT_WAIT", _IOC_WRITE, 0x6443, 0x08 },
+{ "drm/savage_drm.h", "DRM_IOCTL_SAVAGE_BCI_INIT", _IOC_WRITE, 0x6440, 0x50 },
+{ "drm/sis_drm.h", "DRM_IOCTL_SIS_AGP_ALLOC", _IOC_READ|_IOC_WRITE, 0x6454, 0x10 },
+{ "drm/sis_drm.h", "DRM_IOCTL_SIS_AGP_FREE", _IOC_WRITE, 0x6455, 0x10 },
+{ "drm/sis_drm.h", "DRM_IOCTL_SIS_AGP_INIT", _IOC_READ|_IOC_WRITE, 0x6453, 0x08 },
+{ "drm/sis_drm.h", "DRM_IOCTL_SIS_FB_ALLOC", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 },
+{ "drm/sis_drm.h", "DRM_IOCTL_SIS_FB_FREE", _IOC_WRITE, 0x6445, 0x10 },
+{ "drm/sis_drm.h", "DRM_IOCTL_SIS_FB_INIT", _IOC_WRITE, 0x6456, 0x08 },
+{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_CLOSE_CHANNEL", _IOC_READ|_IOC_WRITE, 0x6446, 0x08 },
+{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GEM_CREATE", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 },
+{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GEM_GET_FLAGS", _IOC_READ|_IOC_WRITE, 0x644d, 0x08 },
+{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GEM_GET_TILING", _IOC_READ|_IOC_WRITE, 0x644b, 0x10 },
+{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GEM_MMAP", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 },
+{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GEM_SET_FLAGS", _IOC_READ|_IOC_WRITE, 0x644c, 0x08 },
+{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GEM_SET_TILING", _IOC_READ|_IOC_WRITE, 0x644a, 0x10 },
+{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GET_SYNCPT", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 },
+{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GET_SYNCPT_BASE", _IOC_READ|_IOC_WRITE, 0x6449, 0x10 },
+{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_OPEN_CHANNEL", _IOC_READ|_IOC_WRITE, 0x6445, 0x10 },
+{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_SUBMIT", _IOC_READ|_IOC_WRITE, 0x6448, 0x58 },
+{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_SYNCPT_INCR", _IOC_READ|_IOC_WRITE, 0x6443, 0x08 },
+{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_SYNCPT_READ", _IOC_READ|_IOC_WRITE, 0x6442, 0x08 },
+{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_SYNCPT_WAIT", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 },
+{ "drm/v3d_drm.h", "DRM_IOCTL_V3D_CREATE_BO", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 },
+{ "drm/v3d_drm.h", "DRM_IOCTL_V3D_GET_BO_OFFSET", _IOC_READ|_IOC_WRITE, 0x6445, 0x08 },
+{ "drm/v3d_drm.h", "DRM_IOCTL_V3D_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 },
+{ "drm/v3d_drm.h", "DRM_IOCTL_V3D_MMAP_BO", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 },
+{ "drm/v3d_drm.h", "DRM_IOCTL_V3D_SUBMIT_CL", _IOC_READ|_IOC_WRITE, 0x6440, 0x38 },
+{ "drm/v3d_drm.h", "DRM_IOCTL_V3D_SUBMIT_CSD", _IOC_WRITE, 0x6447, 0x40 },
+{ "drm/v3d_drm.h", "DRM_IOCTL_V3D_SUBMIT_TFU", _IOC_WRITE, 0x6446, 0x44 },
+{ "drm/v3d_drm.h", "DRM_IOCTL_V3D_WAIT_BO", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_CREATE_BO", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_CREATE_SHADER_BO", _IOC_READ|_IOC_WRITE, 0x6445, 0x18 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_GEM_MADVISE", _IOC_READ|_IOC_WRITE, 0x644b, 0x10 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_GET_HANG_STATE", _IOC_READ|_IOC_WRITE, 0x6446, 0xa0 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_GET_TILING", _IOC_READ|_IOC_WRITE, 0x6449, 0x10 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_LABEL_BO", _IOC_READ|_IOC_WRITE, 0x644a, 0x10 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_MMAP_BO", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_PERFMON_CREATE", _IOC_READ|_IOC_WRITE, 0x644c, 0x18 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_PERFMON_DESTROY", _IOC_READ|_IOC_WRITE, 0x644d, 0x04 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_PERFMON_GET_VALUES", _IOC_READ|_IOC_WRITE, 0x644e, 0x0c },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_SET_TILING", _IOC_READ|_IOC_WRITE, 0x6448, 0x10 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_SUBMIT_CL", _IOC_READ|_IOC_WRITE, 0x6440, 0xb0 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_WAIT_BO", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_WAIT_SEQNO", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 },
+{ "drm/vgem_drm.h", "DRM_IOCTL_VGEM_FENCE_ATTACH", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 },
+{ "drm/vgem_drm.h", "DRM_IOCTL_VGEM_FENCE_SIGNAL", _IOC_WRITE, 0x6442, 0x08 },
+{ "drm/via_drm.h", "DRM_IOCTL_VIA_AGP_INIT", _IOC_READ|_IOC_WRITE, 0x6442, 0x08 },
+{ "drm/via_drm.h", "DRM_IOCTL_VIA_ALLOCMEM", _IOC_READ|_IOC_WRITE, 0x6440, 0x14 },
+{ "drm/via_drm.h", "DRM_IOCTL_VIA_BLIT_SYNC", _IOC_WRITE, 0x644f, 0x08 },
+{ "drm/via_drm.h", "DRM_IOCTL_VIA_CMDBUFFER", _IOC_WRITE, 0x6448, 0x08 },
+{ "drm/via_drm.h", "DRM_IOCTL_VIA_CMDBUF_SIZE", _IOC_READ|_IOC_WRITE, 0x644b, 0x0c },
+{ "drm/via_drm.h", "DRM_IOCTL_VIA_DEC_FUTEX", _IOC_WRITE, 0x6445, 0x10 },
+{ "drm/via_drm.h", "DRM_IOCTL_VIA_DMA_BLIT", _IOC_WRITE, 0x644e, 0x28 },
+{ "drm/via_drm.h", "DRM_IOCTL_VIA_DMA_INIT", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 },
+{ "drm/via_drm.h", "DRM_IOCTL_VIA_FB_INIT", _IOC_READ|_IOC_WRITE, 0x6443, 0x08 },
+{ "drm/via_drm.h", "DRM_IOCTL_VIA_FLUSH", _IOC_NONE, 0x6449, 0x00 },
+{ "drm/via_drm.h", "DRM_IOCTL_VIA_FREEMEM", _IOC_WRITE, 0x6441, 0x14 },
+{ "drm/via_drm.h", "DRM_IOCTL_VIA_MAP_INIT", _IOC_READ|_IOC_WRITE, 0x6444, 0x14 },
+{ "drm/via_drm.h", "DRM_IOCTL_VIA_PCICMD", _IOC_WRITE, 0x644a, 0x08 },
+{ "drm/via_drm.h", "DRM_IOCTL_VIA_WAIT_IRQ", _IOC_READ|_IOC_WRITE, 0x644d, 0x10 },
+{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_EXECBUFFER", _IOC_READ|_IOC_WRITE, 0x6442, 0x20 },
+{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_GETPARAM", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 },
+{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_GET_CAPS", _IOC_READ|_IOC_WRITE, 0x6449, 0x18 },
+{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_MAP", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 },
+{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_RESOURCE_CREATE", _IOC_READ|_IOC_WRITE, 0x6444, 0x38 },
+{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_RESOURCE_INFO", _IOC_READ|_IOC_WRITE, 0x6445, 0x10 },
+{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_TRANSFER_FROM_HOST", _IOC_READ|_IOC_WRITE, 0x6446, 0x24 },
+{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_TRANSFER_TO_HOST", _IOC_READ|_IOC_WRITE, 0x6447, 0x24 },
+{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_WAIT", _IOC_READ|_IOC_WRITE, 0x6448, 0x08 },
+{ "linux/agpgart.h", "AGPIOC_ACQUIRE", _IOC_NONE, 0x4101, 0x00 },
+{ "linux/agpgart.h", "AGPIOC_ALLOCATE", _IOC_READ|_IOC_WRITE, 0x4106, 0x04 },
+{ "linux/agpgart.h", "AGPIOC_BIND", _IOC_WRITE, 0x4108, 0x04 },
+{ "linux/agpgart.h", "AGPIOC_CHIPSET_FLUSH", _IOC_NONE, 0x410a, 0x00 },
+{ "linux/agpgart.h", "AGPIOC_DEALLOCATE", _IOC_WRITE, 0x4107, 0x04 },
+{ "linux/agpgart.h", "AGPIOC_INFO", _IOC_READ, 0x4100, 0x04 },
+{ "linux/agpgart.h", "AGPIOC_PROTECT", _IOC_WRITE, 0x4105, 0x04 },
+{ "linux/agpgart.h", "AGPIOC_RELEASE", _IOC_NONE, 0x4102, 0x00 },
+{ "linux/agpgart.h", "AGPIOC_RESERVE", _IOC_WRITE, 0x4104, 0x04 },
+{ "linux/agpgart.h", "AGPIOC_SETUP", _IOC_WRITE, 0x4103, 0x04 },
+{ "linux/agpgart.h", "AGPIOC_UNBIND", _IOC_WRITE, 0x4109, 0x04 },
+{ "linux/am437x-vpfe.h", "VIDIOC_AM437X_CCDC_CFG", _IOC_WRITE, 0x56c1, 0x04 },
+{ "linux/android/binder.h", "BC_ACQUIRE", _IOC_WRITE, 0x6305, 0x04 },
+{ "linux/android/binder.h", "BC_ACQUIRE_DONE", _IOC_WRITE, 0x6309, 0x10 },
+{ "linux/android/binder.h", "BC_ACQUIRE_RESULT", _IOC_WRITE, 0x6302, 0x04 },
+{ "linux/android/binder.h", "BC_ATTEMPT_ACQUIRE", _IOC_WRITE, 0x630a, 0x08 },
+{ "linux/android/binder.h", "BC_CLEAR_DEATH_NOTIFICATION", _IOC_WRITE, 0x630f, 0x0c },
+{ "linux/android/binder.h", "BC_DEAD_BINDER_DONE", _IOC_WRITE, 0x6310, 0x08 },
+{ "linux/android/binder.h", "BC_DECREFS", _IOC_WRITE, 0x6307, 0x04 },
+{ "linux/android/binder.h", "BC_ENTER_LOOPER", _IOC_NONE, 0x630c, 0x00 },
+{ "linux/android/binder.h", "BC_EXIT_LOOPER", _IOC_NONE, 0x630d, 0x00 },
+{ "linux/android/binder.h", "BC_FREE_BUFFER", _IOC_WRITE, 0x6303, 0x08 },
+{ "linux/android/binder.h", "BC_INCREFS", _IOC_WRITE, 0x6304, 0x04 },
+{ "linux/android/binder.h", "BC_INCREFS_DONE", _IOC_WRITE, 0x6308, 0x10 },
+{ "linux/android/binder.h", "BC_REGISTER_LOOPER", _IOC_NONE, 0x630b, 0x00 },
+{ "linux/android/binder.h", "BC_RELEASE", _IOC_WRITE, 0x6306, 0x04 },
+{ "linux/android/binder.h", "BC_REPLY", _IOC_WRITE, 0x6301, 0x40 },
+{ "linux/android/binder.h", "BC_REPLY_SG", _IOC_WRITE, 0x6312, 0x48 },
+{ "linux/android/binder.h", "BC_REQUEST_DEATH_NOTIFICATION", _IOC_WRITE, 0x630e, 0x0c },
+{ "linux/android/binder.h", "BC_TRANSACTION", _IOC_WRITE, 0x6300, 0x40 },
+{ "linux/android/binder.h", "BC_TRANSACTION_SG", _IOC_WRITE, 0x6311, 0x48 },
+{ "linux/android/binder.h", "BINDER_GET_NODE_DEBUG_INFO", _IOC_READ|_IOC_WRITE, 0x620b, 0x18 },
+{ "linux/android/binder.h", "BINDER_GET_NODE_INFO_FOR_REF", _IOC_READ|_IOC_WRITE, 0x620c, 0x18 },
+{ "linux/android/binder.h", "BINDER_SET_CONTEXT_MGR", _IOC_WRITE, 0x6207, 0x04 },
+{ "linux/android/binder.h", "BINDER_SET_CONTEXT_MGR_EXT", _IOC_WRITE, 0x620d, 0x18 },
+{ "linux/android/binder.h", "BINDER_SET_IDLE_PRIORITY", _IOC_WRITE, 0x6206, 0x04 },
+{ "linux/android/binder.h", "BINDER_SET_IDLE_TIMEOUT", _IOC_WRITE, 0x6203, 0x08 },
+{ "linux/android/binder.h", "BINDER_SET_MAX_THREADS", _IOC_WRITE, 0x6205, 0x04 },
+{ "linux/android/binder.h", "BINDER_THREAD_EXIT", _IOC_WRITE, 0x6208, 0x04 },
+{ "linux/android/binder.h", "BINDER_VERSION", _IOC_READ|_IOC_WRITE, 0x6209, 0x04 },
+{ "linux/android/binder.h", "BINDER_WRITE_READ", _IOC_READ|_IOC_WRITE, 0x6201, 0x30 },
+{ "linux/android/binder.h", "BR_ACQUIRE", _IOC_READ, 0x7208, 0x10 },
+{ "linux/android/binder.h", "BR_ACQUIRE_RESULT", _IOC_READ, 0x7204, 0x04 },
+{ "linux/android/binder.h", "BR_ATTEMPT_ACQUIRE", _IOC_READ, 0x720b, 0x14 },
+{ "linux/android/binder.h", "BR_CLEAR_DEATH_NOTIFICATION_DONE", _IOC_READ, 0x7210, 0x08 },
+{ "linux/android/binder.h", "BR_DEAD_BINDER", _IOC_READ, 0x720f, 0x08 },
+{ "linux/android/binder.h", "BR_DEAD_REPLY", _IOC_NONE, 0x7205, 0x00 },
+{ "linux/android/binder.h", "BR_DECREFS", _IOC_READ, 0x720a, 0x10 },
+{ "linux/android/binder.h", "BR_ERROR", _IOC_READ, 0x7200, 0x04 },
+{ "linux/android/binder.h", "BR_FAILED_REPLY", _IOC_NONE, 0x7211, 0x00 },
+{ "linux/android/binder.h", "BR_FINISHED", _IOC_NONE, 0x720e, 0x00 },
+{ "linux/android/binder.h", "BR_INCREFS", _IOC_READ, 0x7207, 0x10 },
+{ "linux/android/binder.h", "BR_NOOP", _IOC_NONE, 0x720c, 0x00 },
+{ "linux/android/binder.h", "BR_OK", _IOC_NONE, 0x7201, 0x00 },
+{ "linux/android/binder.h", "BR_RELEASE", _IOC_READ, 0x7209, 0x10 },
+{ "linux/android/binder.h", "BR_REPLY", _IOC_READ, 0x7203, 0x40 },
+{ "linux/android/binder.h", "BR_SPAWN_LOOPER", _IOC_NONE, 0x720d, 0x00 },
+{ "linux/android/binder.h", "BR_TRANSACTION", _IOC_READ, 0x7202, 0x40 },
+{ "linux/android/binder.h", "BR_TRANSACTION_COMPLETE", _IOC_NONE, 0x7206, 0x00 },
+{ "linux/android/binder.h", "BR_TRANSACTION_SEC_CTX", _IOC_READ, 0x7202, 0x48 },
+{ "linux/android/binderfs.h", "BINDER_CTL_ADD", _IOC_READ|_IOC_WRITE, 0x6201, 0x108 },
+{ "linux/apm_bios.h", "APM_IOC_STANDBY", _IOC_NONE, 0x4101, 0x00 },
+{ "linux/apm_bios.h", "APM_IOC_SUSPEND", _IOC_NONE, 0x4102, 0x00 },
+{ "linux/arcfb.h", "FBIO_GETCONTROL2", _IOC_READ, 0x4689, 0x04 },
+{ "linux/arcfb.h", "FBIO_WAITEVENT", _IOC_NONE, 0x4688, 0x00 },
+{ "linux/aspeed-lpc-ctrl.h", "ASPEED_LPC_CTRL_IOCTL_GET_SIZE", _IOC_READ|_IOC_WRITE, 0xb200, 0x10 },
+{ "linux/aspeed-lpc-ctrl.h", "ASPEED_LPC_CTRL_IOCTL_MAP", _IOC_WRITE, 0xb201, 0x10 },
+{ "linux/aspeed-p2a-ctrl.h", "ASPEED_P2A_CTRL_IOCTL_GET_MEMORY_CONFIG", _IOC_READ|_IOC_WRITE, 0xb301, 0x10 },
+{ "linux/aspeed-p2a-ctrl.h", "ASPEED_P2A_CTRL_IOCTL_SET_WINDOW", _IOC_WRITE, 0xb300, 0x10 },
+{ "linux/atm_eni.h", "ENI_MEMDUMP", _IOC_WRITE, 0x6160, 0x0c },
+{ "linux/atm_eni.h", "ENI_SETMULT", _IOC_WRITE, 0x6167, 0x0c },
+{ "linux/atm_he.h", "HE_GET_REG", _IOC_WRITE, 0x6160, 0x0c },
+{ "linux/atm_idt77105.h", "IDT77105_GETSTAT", _IOC_WRITE, 0x6132, 0x0c },
+{ "linux/atm_idt77105.h", "IDT77105_GETSTATZ", _IOC_WRITE, 0x6133, 0x0c },
+{ "linux/atm_nicstar.h", "NS_ADJBUFLEV", _IOC_NONE, 0x6163, 0x00 },
+{ "linux/atm_nicstar.h", "NS_GETPSTAT", _IOC_READ|_IOC_WRITE, 0x6161, 0x0c },
+{ "linux/atm_nicstar.h", "NS_SETBUFLEV", _IOC_WRITE, 0x6162, 0x0c },
+{ "linux/atm_tcp.h", "ATMTCP_CREATE", _IOC_NONE, 0x618e, 0x00 },
+{ "linux/atm_tcp.h", "ATMTCP_REMOVE", _IOC_NONE, 0x618f, 0x00 },
+{ "linux/atm_tcp.h", "SIOCSIFATMTCP", _IOC_NONE, 0x6180, 0x00 },
+{ "linux/atm_zatm.h", "ZATM_GETPOOL", _IOC_WRITE, 0x6161, 0x0c },
+{ "linux/atm_zatm.h", "ZATM_GETPOOLZ", _IOC_WRITE, 0x6162, 0x0c },
+{ "linux/atm_zatm.h", "ZATM_SETPOOL", _IOC_WRITE, 0x6163, 0x0c },
+{ "linux/atmarp.h", "ATMARPD_CTRL", _IOC_NONE, 0x61e1, 0x00 },
+{ "linux/atmarp.h", "ATMARP_ENCAP", _IOC_NONE, 0x61e5, 0x00 },
+{ "linux/atmarp.h", "ATMARP_MKIP", _IOC_NONE, 0x61e2, 0x00 },
+{ "linux/atmarp.h", "ATMARP_SETENTRY", _IOC_NONE, 0x61e3, 0x00 },
+{ "linux/atmbr2684.h", "BR2684_SETFILT", _IOC_WRITE, 0x6190, 0x1c },
+{ "linux/atmclip.h", "SIOCMKCLIP", _IOC_NONE, 0x61e0, 0x00 },
+{ "linux/atmdev.h", "ATM_ADDADDR", _IOC_WRITE, 0x6188, 0x0c },
+{ "linux/atmdev.h", "ATM_ADDLECSADDR", _IOC_WRITE, 0x618e, 0x0c },
+{ "linux/atmdev.h", "ATM_ADDPARTY", _IOC_WRITE, 0x61f4, 0x08 },
+{ "linux/atmdev.h", "ATM_DELADDR", _IOC_WRITE, 0x6189, 0x0c },
+{ "linux/atmdev.h", "ATM_DELLECSADDR", _IOC_WRITE, 0x618f, 0x0c },
+{ "linux/atmdev.h", "ATM_DROPPARTY", _IOC_WRITE, 0x61f5, 0x04 },
+{ "linux/atmdev.h", "ATM_GETADDR", _IOC_WRITE, 0x6186, 0x0c },
+{ "linux/atmdev.h", "ATM_GETCIRANGE", _IOC_WRITE, 0x618a, 0x0c },
+{ "linux/atmdev.h", "ATM_GETESI", _IOC_WRITE, 0x6185, 0x0c },
+{ "linux/atmdev.h", "ATM_GETLECSADDR", _IOC_WRITE, 0x6190, 0x0c },
+{ "linux/atmdev.h", "ATM_GETLINKRATE", _IOC_WRITE, 0x6181, 0x0c },
+{ "linux/atmdev.h", "ATM_GETLOOP", _IOC_WRITE, 0x6152, 0x0c },
+{ "linux/atmdev.h", "ATM_GETNAMES", _IOC_WRITE, 0x6183, 0x08 },
+{ "linux/atmdev.h", "ATM_GETSTAT", _IOC_WRITE, 0x6150, 0x0c },
+{ "linux/atmdev.h", "ATM_GETSTATZ", _IOC_WRITE, 0x6151, 0x0c },
+{ "linux/atmdev.h", "ATM_GETTYPE", _IOC_WRITE, 0x6184, 0x0c },
+{ "linux/atmdev.h", "ATM_NEWBACKENDIF", _IOC_WRITE, 0x61f3, 0x02 },
+{ "linux/atmdev.h", "ATM_QUERYLOOP", _IOC_WRITE, 0x6154, 0x0c },
+{ "linux/atmdev.h", "ATM_RSTADDR", _IOC_WRITE, 0x6187, 0x0c },
+{ "linux/atmdev.h", "ATM_SETBACKEND", _IOC_WRITE, 0x61f2, 0x02 },
+{ "linux/atmdev.h", "ATM_SETCIRANGE", _IOC_WRITE, 0x618b, 0x0c },
+{ "linux/atmdev.h", "ATM_SETESI", _IOC_WRITE, 0x618c, 0x0c },
+{ "linux/atmdev.h", "ATM_SETESIF", _IOC_WRITE, 0x618d, 0x0c },
+{ "linux/atmdev.h", "ATM_SETLOOP", _IOC_WRITE, 0x6153, 0x0c },
+{ "linux/atmdev.h", "ATM_SETSC", _IOC_WRITE, 0x61f1, 0x04 },
+{ "linux/atmlec.h", "ATMLEC_CTRL", _IOC_NONE, 0x61d0, 0x00 },
+{ "linux/atmlec.h", "ATMLEC_DATA", _IOC_NONE, 0x61d1, 0x00 },
+{ "linux/atmlec.h", "ATMLEC_MCAST", _IOC_NONE, 0x61d2, 0x00 },
+{ "linux/atmmpc.h", "ATMMPC_CTRL", _IOC_NONE, 0x61d8, 0x00 },
+{ "linux/atmmpc.h", "ATMMPC_DATA", _IOC_NONE, 0x61d9, 0x00 },
+{ "linux/atmsvc.h", "ATMSIGD_CTRL", _IOC_NONE, 0x61f0, 0x00 },
+{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_ASKUMOUNT", _IOC_READ|_IOC_WRITE, 0x937d, 0x18 },
+{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_CATATONIC", _IOC_READ|_IOC_WRITE, 0x9379, 0x18 },
+{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_CLOSEMOUNT", _IOC_READ|_IOC_WRITE, 0x9375, 0x18 },
+{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_EXPIRE", _IOC_READ|_IOC_WRITE, 0x937c, 0x18 },
+{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_FAIL", _IOC_READ|_IOC_WRITE, 0x9377, 0x18 },
+{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_ISMOUNTPOINT", _IOC_READ|_IOC_WRITE, 0x937e, 0x18 },
+{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_OPENMOUNT", _IOC_READ|_IOC_WRITE, 0x9374, 0x18 },
+{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_PROTOSUBVER", _IOC_READ|_IOC_WRITE, 0x9373, 0x18 },
+{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_PROTOVER", _IOC_READ|_IOC_WRITE, 0x9372, 0x18 },
+{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_READY", _IOC_READ|_IOC_WRITE, 0x9376, 0x18 },
+{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_REQUESTER", _IOC_READ|_IOC_WRITE, 0x937b, 0x18 },
+{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_SETPIPEFD", _IOC_READ|_IOC_WRITE, 0x9378, 0x18 },
+{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_TIMEOUT", _IOC_READ|_IOC_WRITE, 0x937a, 0x18 },
+{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_VERSION", _IOC_READ|_IOC_WRITE, 0x9371, 0x18 },
+{ "linux/auto_fs.h", "AUTOFS_IOC_ASKUMOUNT", _IOC_READ, 0x9370, 0x04 },
+{ "linux/auto_fs.h", "AUTOFS_IOC_CATATONIC", _IOC_NONE, 0x9362, 0x00 },
+{ "linux/auto_fs.h", "AUTOFS_IOC_EXPIRE", _IOC_READ, 0x9365, 0x10c },
+{ "linux/auto_fs.h", "AUTOFS_IOC_EXPIRE_MULTI", _IOC_WRITE, 0x9366, 0x04 },
+{ "linux/auto_fs.h", "AUTOFS_IOC_FAIL", _IOC_NONE, 0x9361, 0x00 },
+{ "linux/auto_fs.h", "AUTOFS_IOC_PROTOSUBVER", _IOC_READ, 0x9367, 0x04 },
+{ "linux/auto_fs.h", "AUTOFS_IOC_PROTOVER", _IOC_READ, 0x9363, 0x04 },
+{ "linux/auto_fs.h", "AUTOFS_IOC_READY", _IOC_NONE, 0x9360, 0x00 },
+{ "linux/auto_fs.h", "AUTOFS_IOC_SETTIMEOUT32", _IOC_READ|_IOC_WRITE, 0x9364, 0x04 },
+{ "linux/blkpg.h", "BLKPG", _IOC_NONE, 0x1269, 0x00 },
+{ "linux/blkzoned.h", "BLKCLOSEZONE", _IOC_WRITE, 0x1287, 0x10 },
+{ "linux/blkzoned.h", "BLKFINISHZONE", _IOC_WRITE, 0x1288, 0x10 },
+{ "linux/blkzoned.h", "BLKGETNRZONES", _IOC_READ, 0x1285, 0x04 },
+{ "linux/blkzoned.h", "BLKGETZONESZ", _IOC_READ, 0x1284, 0x04 },
+{ "linux/blkzoned.h", "BLKOPENZONE", _IOC_WRITE, 0x1286, 0x10 },
+{ "linux/blkzoned.h", "BLKREPORTZONE", _IOC_READ|_IOC_WRITE, 0x1282, 0x10 },
+{ "linux/blkzoned.h", "BLKRESETZONE", _IOC_WRITE, 0x1283, 0x10 },
+{ "linux/bt-bmc.h", "BT_BMC_IOCTL_SMS_ATN", _IOC_NONE, 0xb100, 0x00 },
+{ "linux/btrfs.h", "BTRFS_IOC_ADD_DEV", _IOC_WRITE, 0x940a, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_BALANCE", _IOC_WRITE, 0x940c, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_BALANCE_CTL", _IOC_WRITE, 0x9421, 0x04 },
+{ "linux/btrfs.h", "BTRFS_IOC_BALANCE_PROGRESS", _IOC_READ, 0x9422, 0x400 },
+{ "linux/btrfs.h", "BTRFS_IOC_BALANCE_V2", _IOC_READ|_IOC_WRITE, 0x9420, 0x400 },
+{ "linux/btrfs.h", "BTRFS_IOC_CLONE", _IOC_WRITE, 0x9409, 0x04 },
+{ "linux/btrfs.h", "BTRFS_IOC_CLONE_RANGE", _IOC_WRITE, 0x940d, 0x20 },
+{ "linux/btrfs.h", "BTRFS_IOC_DEFAULT_SUBVOL", _IOC_WRITE, 0x9413, 0x08 },
+{ "linux/btrfs.h", "BTRFS_IOC_DEFRAG", _IOC_WRITE, 0x9402, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_DEFRAG_RANGE", _IOC_WRITE, 0x9410, 0x30 },
+{ "linux/btrfs.h", "BTRFS_IOC_DEVICES_READY", _IOC_READ, 0x9427, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_DEV_INFO", _IOC_READ|_IOC_WRITE, 0x941e, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_DEV_REPLACE", _IOC_READ|_IOC_WRITE, 0x9435, 0xa22 },
+{ "linux/btrfs.h", "BTRFS_IOC_FILE_EXTENT_SAME", _IOC_READ|_IOC_WRITE, 0x9436, 0x18 },
+{ "linux/btrfs.h", "BTRFS_IOC_FORGET_DEV", _IOC_WRITE, 0x9405, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_FS_INFO", _IOC_READ, 0x941f, 0x400 },
+{ "linux/btrfs.h", "BTRFS_IOC_GET_DEV_STATS", _IOC_READ|_IOC_WRITE, 0x9434, 0x408 },
+{ "linux/btrfs.h", "BTRFS_IOC_GET_FEATURES", _IOC_READ, 0x9439, 0x18 },
+{ "linux/btrfs.h", "BTRFS_IOC_GET_SUBVOL_INFO", _IOC_READ, 0x943c, 0x1e8 },
+{ "linux/btrfs.h", "BTRFS_IOC_GET_SUBVOL_ROOTREF", _IOC_READ|_IOC_WRITE, 0x943d, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_GET_SUPPORTED_FEATURES", _IOC_READ, 0x9439, 0x48 },
+{ "linux/btrfs.h", "BTRFS_IOC_INO_LOOKUP", _IOC_READ|_IOC_WRITE, 0x9412, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_INO_LOOKUP_USER", _IOC_READ|_IOC_WRITE, 0x943e, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_INO_PATHS", _IOC_READ|_IOC_WRITE, 0x9423, 0x38 },
+{ "linux/btrfs.h", "BTRFS_IOC_LOGICAL_INO", _IOC_READ|_IOC_WRITE, 0x9424, 0x38 },
+{ "linux/btrfs.h", "BTRFS_IOC_LOGICAL_INO_V2", _IOC_READ|_IOC_WRITE, 0x943b, 0x38 },
+{ "linux/btrfs.h", "BTRFS_IOC_QGROUP_ASSIGN", _IOC_WRITE, 0x9429, 0x18 },
+{ "linux/btrfs.h", "BTRFS_IOC_QGROUP_CREATE", _IOC_WRITE, 0x942a, 0x10 },
+{ "linux/btrfs.h", "BTRFS_IOC_QGROUP_LIMIT", _IOC_READ, 0x942b, 0x30 },
+{ "linux/btrfs.h", "BTRFS_IOC_QUOTA_CTL", _IOC_READ|_IOC_WRITE, 0x9428, 0x10 },
+{ "linux/btrfs.h", "BTRFS_IOC_QUOTA_RESCAN", _IOC_WRITE, 0x942c, 0x40 },
+{ "linux/btrfs.h", "BTRFS_IOC_QUOTA_RESCAN_STATUS", _IOC_READ, 0x942d, 0x40 },
+{ "linux/btrfs.h", "BTRFS_IOC_QUOTA_RESCAN_WAIT", _IOC_NONE, 0x942e, 0x00 },
+{ "linux/btrfs.h", "BTRFS_IOC_RESIZE", _IOC_WRITE, 0x9403, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_RM_DEV", _IOC_WRITE, 0x940b, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_RM_DEV_V2", _IOC_WRITE, 0x943a, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_SCAN_DEV", _IOC_WRITE, 0x9404, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_SCRUB", _IOC_READ|_IOC_WRITE, 0x941b, 0x400 },
+{ "linux/btrfs.h", "BTRFS_IOC_SCRUB_CANCEL", _IOC_NONE, 0x941c, 0x00 },
+{ "linux/btrfs.h", "BTRFS_IOC_SCRUB_PROGRESS", _IOC_READ|_IOC_WRITE, 0x941d, 0x400 },
+{ "linux/btrfs.h", "BTRFS_IOC_SEND", _IOC_WRITE, 0x9426, 0x44 },
+{ "linux/btrfs.h", "BTRFS_IOC_SET_FEATURES", _IOC_WRITE, 0x9439, 0x30 },
+{ "linux/btrfs.h", "BTRFS_IOC_SET_RECEIVED_SUBVOL", _IOC_READ|_IOC_WRITE, 0x9425, 0xc0 },
+{ "linux/btrfs.h", "BTRFS_IOC_SNAP_CREATE", _IOC_WRITE, 0x9401, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_SNAP_CREATE_V2", _IOC_WRITE, 0x9417, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_SNAP_DESTROY", _IOC_WRITE, 0x940f, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_SNAP_DESTROY_V2", _IOC_WRITE, 0x943f, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_SPACE_INFO", _IOC_READ|_IOC_WRITE, 0x9414, 0x10 },
+{ "linux/btrfs.h", "BTRFS_IOC_START_SYNC", _IOC_READ, 0x9418, 0x08 },
+{ "linux/btrfs.h", "BTRFS_IOC_SUBVOL_CREATE", _IOC_WRITE, 0x940e, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_SUBVOL_CREATE_V2", _IOC_WRITE, 0x9418, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_SUBVOL_GETFLAGS", _IOC_READ, 0x9419, 0x08 },
+{ "linux/btrfs.h", "BTRFS_IOC_SUBVOL_SETFLAGS", _IOC_WRITE, 0x941a, 0x08 },
+{ "linux/btrfs.h", "BTRFS_IOC_SYNC", _IOC_NONE, 0x9408, 0x00 },
+{ "linux/btrfs.h", "BTRFS_IOC_TRANS_END", _IOC_NONE, 0x9407, 0x00 },
+{ "linux/btrfs.h", "BTRFS_IOC_TRANS_START", _IOC_NONE, 0x9406, 0x00 },
+{ "linux/btrfs.h", "BTRFS_IOC_TREE_SEARCH", _IOC_READ|_IOC_WRITE, 0x9411, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_TREE_SEARCH_V2", _IOC_READ|_IOC_WRITE, 0x9411, 0x70 },
+{ "linux/btrfs.h", "BTRFS_IOC_WAIT_SYNC", _IOC_WRITE, 0x9416, 0x08 },
+{ "linux/capi.h", "CAPI_CLR_FLAGS", _IOC_READ, 0x4325, 0x04 },
+{ "linux/capi.h", "CAPI_GET_ERRCODE", _IOC_READ, 0x4321, 0x02 },
+{ "linux/capi.h", "CAPI_GET_FLAGS", _IOC_READ, 0x4323, 0x04 },
+{ "linux/capi.h", "CAPI_GET_MANUFACTURER", _IOC_READ|_IOC_WRITE, 0x4306, 0x04 },
+{ "linux/capi.h", "CAPI_GET_PROFILE", _IOC_READ|_IOC_WRITE, 0x4309, 0x40 },
+{ "linux/capi.h", "CAPI_GET_SERIAL", _IOC_READ|_IOC_WRITE, 0x4308, 0x04 },
+{ "linux/capi.h", "CAPI_GET_VERSION", _IOC_READ|_IOC_WRITE, 0x4307, 0x10 },
+{ "linux/capi.h", "CAPI_INSTALLED", _IOC_READ, 0x4322, 0x02 },
+{ "linux/capi.h", "CAPI_MANUFACTURER_CMD", _IOC_READ|_IOC_WRITE, 0x4320, 0x08 },
+{ "linux/capi.h", "CAPI_NCCI_GETUNIT", _IOC_READ, 0x4327, 0x04 },
+{ "linux/capi.h", "CAPI_NCCI_OPENCOUNT", _IOC_READ, 0x4326, 0x04 },
+{ "linux/capi.h", "CAPI_REGISTER", _IOC_WRITE, 0x4301, 0x0c },
+{ "linux/capi.h", "CAPI_SET_FLAGS", _IOC_READ, 0x4324, 0x04 },
+{ "linux/cciss_ioctl.h", "CCISS_BIG_PASSTHRU", _IOC_READ|_IOC_WRITE, 0x4212, 0x58 },
+{ "linux/cciss_ioctl.h", "CCISS_DEREGDISK", _IOC_NONE, 0x420c, 0x00 },
+{ "linux/cciss_ioctl.h", "CCISS_GETBUSTYPES", _IOC_READ, 0x4207, 0x04 },
+{ "linux/cciss_ioctl.h", "CCISS_GETDRIVVER", _IOC_READ, 0x4209, 0x04 },
+{ "linux/cciss_ioctl.h", "CCISS_GETFIRMVER", _IOC_READ, 0x4208, 0x04 },
+{ "linux/cciss_ioctl.h", "CCISS_GETHEARTBEAT", _IOC_READ, 0x4206, 0x04 },
+{ "linux/cciss_ioctl.h", "CCISS_GETINTINFO", _IOC_READ, 0x4202, 0x08 },
+{ "linux/cciss_ioctl.h", "CCISS_GETLUNINFO", _IOC_READ, 0x4211, 0x0c },
+{ "linux/cciss_ioctl.h", "CCISS_GETNODENAME", _IOC_READ, 0x4204, 0x10 },
+{ "linux/cciss_ioctl.h", "CCISS_GETPCIINFO", _IOC_READ, 0x4201, 0x08 },
+{ "linux/cciss_ioctl.h", "CCISS_PASSTHRU", _IOC_READ|_IOC_WRITE, 0x420b, 0x52 },
+{ "linux/cciss_ioctl.h", "CCISS_REGNEWD", _IOC_NONE, 0x420e, 0x00 },
+{ "linux/cciss_ioctl.h", "CCISS_REGNEWDISK", _IOC_WRITE, 0x420d, 0x04 },
+{ "linux/cciss_ioctl.h", "CCISS_RESCANDISK", _IOC_NONE, 0x4210, 0x00 },
+{ "linux/cciss_ioctl.h", "CCISS_REVALIDVOLS", _IOC_NONE, 0x420a, 0x00 },
+{ "linux/cciss_ioctl.h", "CCISS_SETINTINFO", _IOC_WRITE, 0x4203, 0x08 },
+{ "linux/cciss_ioctl.h", "CCISS_SETNODENAME", _IOC_WRITE, 0x4205, 0x10 },
+{ "linux/cdrom.h", "CDROMAUDIOBUFSIZ", 0, 0x5382, 0 },
+{ "linux/cdrom.h", "CDROMCLOSETRAY", 0, 0x5319, 0 },
+{ "linux/cdrom.h", "CDROMEJECT", 0, 0x5309, 0 },
+{ "linux/cdrom.h", "CDROMEJECT_SW", 0, 0x530f, 0 },
+{ "linux/cdrom.h", "CDROMGETSPINDOWN", 0, 0x531d, 0 },
+{ "linux/cdrom.h", "CDROMMULTISESSION", 0, 0x5310, 0 },
+{ "linux/cdrom.h", "CDROMPAUSE", 0, 0x5301, 0 },
+{ "linux/cdrom.h", "CDROMPLAYBLK", 0, 0x5317, 0 },
+{ "linux/cdrom.h", "CDROMPLAYMSF", 0, 0x5303, 0 },
+{ "linux/cdrom.h", "CDROMPLAYTRKIND", 0, 0x5304, 0 },
+{ "linux/cdrom.h", "CDROMREADALL", 0, 0x5318, 0 },
+{ "linux/cdrom.h", "CDROMREADAUDIO", 0, 0x530e, 0 },
+{ "linux/cdrom.h", "CDROMREADCOOKED", 0, 0x5315, 0 },
+{ "linux/cdrom.h", "CDROMREADMODE1", 0, 0x530d, 0 },
+{ "linux/cdrom.h", "CDROMREADMODE2", 0, 0x530c, 0 },
+{ "linux/cdrom.h", "CDROMREADRAW", 0, 0x5314, 0 },
+{ "linux/cdrom.h", "CDROMREADTOCENTRY", 0, 0x5306, 0 },
+{ "linux/cdrom.h", "CDROMREADTOCHDR", 0, 0x5305, 0 },
+{ "linux/cdrom.h", "CDROMRESET", 0, 0x5312, 0 },
+{ "linux/cdrom.h", "CDROMRESUME", 0, 0x5302, 0 },
+{ "linux/cdrom.h", "CDROMSEEK", 0, 0x5316, 0 },
+{ "linux/cdrom.h", "CDROMSETSPINDOWN", 0, 0x531e, 0 },
+{ "linux/cdrom.h", "CDROMSTART", 0, 0x5308, 0 },
+{ "linux/cdrom.h", "CDROMSTOP", 0, 0x5307, 0 },
+{ "linux/cdrom.h", "CDROMSUBCHNL", 0, 0x530b, 0 },
+{ "linux/cdrom.h", "CDROMVOLCTRL", 0, 0x530a, 0 },
+{ "linux/cdrom.h", "CDROMVOLREAD", 0, 0x5313, 0 },
+{ "linux/cdrom.h", "CDROM_CHANGER_NSLOTS", 0, 0x5328, 0 },
+{ "linux/cdrom.h", "CDROM_CLEAR_OPTIONS", 0, 0x5321, 0 },
+{ "linux/cdrom.h", "CDROM_DEBUG", 0, 0x5330, 0 },
+{ "linux/cdrom.h", "CDROM_DISC_STATUS", 0, 0x5327, 0 },
+{ "linux/cdrom.h", "CDROM_DRIVE_STATUS", 0, 0x5326, 0 },
+{ "linux/cdrom.h", "CDROM_GET_CAPABILITY", 0, 0x5331, 0 },
+{ "linux/cdrom.h", "CDROM_GET_MCN", 0, 0x5311, 0 },
+{ "linux/cdrom.h", "CDROM_LAST_WRITTEN", 0, 0x5395, 0 },
+{ "linux/cdrom.h", "CDROM_LOCKDOOR", 0, 0x5329, 0 },
+{ "linux/cdrom.h", "CDROM_MEDIA_CHANGED", 0, 0x5325, 0 },
+{ "linux/cdrom.h", "CDROM_NEXT_WRITABLE", 0, 0x5394, 0 },
+{ "linux/cdrom.h", "CDROM_SELECT_DISC", 0, 0x5323, 0 },
+{ "linux/cdrom.h", "CDROM_SELECT_SPEED", 0, 0x5322, 0 },
+{ "linux/cdrom.h", "CDROM_SEND_PACKET", 0, 0x5393, 0 },
+{ "linux/cdrom.h", "CDROM_SET_OPTIONS", 0, 0x5320, 0 },
+{ "linux/cdrom.h", "DVD_AUTH", 0, 0x5392, 0 },
+{ "linux/cdrom.h", "DVD_READ_STRUCT", 0, 0x5390, 0 },
+{ "linux/cdrom.h", "DVD_WRITE_STRUCT", 0, 0x5391, 0 },
+{ "linux/cec.h", "CEC_ADAP_G_CAPS", _IOC_READ|_IOC_WRITE, 0x6100, 0x4c },
+{ "linux/cec.h", "CEC_ADAP_G_CONNECTOR_INFO", _IOC_READ, 0x610a, 0x44 },
+{ "linux/cec.h", "CEC_ADAP_G_LOG_ADDRS", _IOC_READ, 0x6103, 0x5c },
+{ "linux/cec.h", "CEC_ADAP_G_PHYS_ADDR", _IOC_READ, 0x6101, 0x02 },
+{ "linux/cec.h", "CEC_ADAP_S_LOG_ADDRS", _IOC_READ|_IOC_WRITE, 0x6104, 0x5c },
+{ "linux/cec.h", "CEC_ADAP_S_PHYS_ADDR", _IOC_WRITE, 0x6102, 0x02 },
+{ "linux/cec.h", "CEC_DQEVENT", _IOC_READ|_IOC_WRITE, 0x6107, 0x50 },
+{ "linux/cec.h", "CEC_G_MODE", _IOC_READ, 0x6108, 0x04 },
+{ "linux/cec.h", "CEC_RECEIVE", _IOC_READ|_IOC_WRITE, 0x6106, 0x38 },
+{ "linux/cec.h", "CEC_S_MODE", _IOC_WRITE, 0x6109, 0x04 },
+{ "linux/cec.h", "CEC_TRANSMIT", _IOC_READ|_IOC_WRITE, 0x6105, 0x38 },
+{ "linux/chio.h", "CHIOEXCHANGE", _IOC_WRITE, 0x6302, 0x1c },
+{ "linux/chio.h", "CHIOGELEM", _IOC_WRITE, 0x6310, 0x6c },
+{ "linux/chio.h", "CHIOGPARAMS", _IOC_READ, 0x6306, 0x14 },
+{ "linux/chio.h", "CHIOGPICKER", _IOC_READ, 0x6304, 0x04 },
+{ "linux/chio.h", "CHIOGSTATUS", _IOC_WRITE, 0x6308, 0x08 },
+{ "linux/chio.h", "CHIOGVPARAMS", _IOC_READ, 0x6313, 0x70 },
+{ "linux/chio.h", "CHIOINITELEM", _IOC_NONE, 0x6311, 0x00 },
+{ "linux/chio.h", "CHIOMOVE", _IOC_WRITE, 0x6301, 0x14 },
+{ "linux/chio.h", "CHIOPOSITION", _IOC_WRITE, 0x6303, 0x0c },
+{ "linux/chio.h", "CHIOSPICKER", _IOC_WRITE, 0x6305, 0x04 },
+{ "linux/chio.h", "CHIOSVOLTAG", _IOC_WRITE, 0x6312, 0x30 },
+{ "linux/cm4000_cs.h", "CM_IOCARDOFF", _IOC_NONE, 0x6304, 0x00 },
+{ "linux/cm4000_cs.h", "CM_IOCGATR", _IOC_READ|_IOC_WRITE, 0x6301, 0x04 },
+{ "linux/cm4000_cs.h", "CM_IOCGSTATUS", _IOC_READ, 0x6300, 0x04 },
+{ "linux/cm4000_cs.h", "CM_IOCSPTS", _IOC_WRITE, 0x6302, 0x04 },
+{ "linux/cm4000_cs.h", "CM_IOCSRDR", _IOC_NONE, 0x6303, 0x00 },
+{ "linux/cm4000_cs.h", "CM_IOSDBGLVL", _IOC_WRITE, 0x63fa, 0x04 },
+{ "linux/coda.h", "CIOC_KERNEL_VERSION", _IOC_READ|_IOC_WRITE, 0x630a, 0x04 },
+{ "linux/dm-ioctl.h", "DM_DEV_ARM_POLL", _IOC_READ|_IOC_WRITE, 0xfd10, 0x138 },
+{ "linux/dm-ioctl.h", "DM_DEV_CREATE", _IOC_READ|_IOC_WRITE, 0xfd03, 0x138 },
+{ "linux/dm-ioctl.h", "DM_DEV_REMOVE", _IOC_READ|_IOC_WRITE, 0xfd04, 0x138 },
+{ "linux/dm-ioctl.h", "DM_DEV_RENAME", _IOC_READ|_IOC_WRITE, 0xfd05, 0x138 },
+{ "linux/dm-ioctl.h", "DM_DEV_SET_GEOMETRY", _IOC_READ|_IOC_WRITE, 0xfd0f, 0x138 },
+{ "linux/dm-ioctl.h", "DM_DEV_STATUS", _IOC_READ|_IOC_WRITE, 0xfd07, 0x138 },
+{ "linux/dm-ioctl.h", "DM_DEV_SUSPEND", _IOC_READ|_IOC_WRITE, 0xfd06, 0x138 },
+{ "linux/dm-ioctl.h", "DM_DEV_WAIT", _IOC_READ|_IOC_WRITE, 0xfd08, 0x138 },
+{ "linux/dm-ioctl.h", "DM_GET_TARGET_VERSION", _IOC_READ|_IOC_WRITE, 0xfd11, 0x138 },
+{ "linux/dm-ioctl.h", "DM_LIST_DEVICES", _IOC_READ|_IOC_WRITE, 0xfd02, 0x138 },
+{ "linux/dm-ioctl.h", "DM_LIST_VERSIONS", _IOC_READ|_IOC_WRITE, 0xfd0d, 0x138 },
+{ "linux/dm-ioctl.h", "DM_REMOVE_ALL", _IOC_READ|_IOC_WRITE, 0xfd01, 0x138 },
+{ "linux/dm-ioctl.h", "DM_TABLE_CLEAR", _IOC_READ|_IOC_WRITE, 0xfd0a, 0x138 },
+{ "linux/dm-ioctl.h", "DM_TABLE_DEPS", _IOC_READ|_IOC_WRITE, 0xfd0b, 0x138 },
+{ "linux/dm-ioctl.h", "DM_TABLE_LOAD", _IOC_READ|_IOC_WRITE, 0xfd09, 0x138 },
+{ "linux/dm-ioctl.h", "DM_TABLE_STATUS", _IOC_READ|_IOC_WRITE, 0xfd0c, 0x138 },
+{ "linux/dm-ioctl.h", "DM_TARGET_MSG", _IOC_READ|_IOC_WRITE, 0xfd0e, 0x138 },
+{ "linux/dm-ioctl.h", "DM_VERSION", _IOC_READ|_IOC_WRITE, 0xfd00, 0x138 },
+{ "linux/dma-buf.h", "DMA_BUF_IOCTL_SYNC", _IOC_WRITE, 0x6200, 0x08 },
+{ "linux/dma-buf.h", "DMA_BUF_SET_NAME_A", _IOC_WRITE, 0x6201, 0x04 },
+{ "linux/dma-buf.h", "DMA_BUF_SET_NAME_B", _IOC_WRITE, 0x6201, 0x08 },
+{ "linux/dma-heap.h", "DMA_HEAP_IOCTL_ALLOC", _IOC_READ|_IOC_WRITE, 0x4800, 0x18 },
+{ "linux/dn.h", "OSIOCGNETADDR", _IOC_READ, 0x89e1, 0x04 },
+{ "linux/dn.h", "OSIOCSNETADDR", _IOC_WRITE, 0x89e0, 0x04 },
+{ "linux/dvb/audio.h", "AUDIO_BILINGUAL_CHANNEL_SELECT", _IOC_NONE, 0x6f14, 0x00 },
+{ "linux/dvb/audio.h", "AUDIO_CHANNEL_SELECT", _IOC_NONE, 0x6f09, 0x00 },
+{ "linux/dvb/audio.h", "AUDIO_CLEAR_BUFFER", _IOC_NONE, 0x6f0c, 0x00 },
+{ "linux/dvb/audio.h", "AUDIO_CONTINUE", _IOC_NONE, 0x6f04, 0x00 },
+{ "linux/dvb/audio.h", "AUDIO_GET_CAPABILITIES", _IOC_READ, 0x6f0b, 0x04 },
+{ "linux/dvb/audio.h", "AUDIO_GET_STATUS", _IOC_READ, 0x6f0a, 0x20 },
+{ "linux/dvb/audio.h", "AUDIO_PAUSE", _IOC_NONE, 0x6f03, 0x00 },
+{ "linux/dvb/audio.h", "AUDIO_PLAY", _IOC_NONE, 0x6f02, 0x00 },
+{ "linux/dvb/audio.h", "AUDIO_SELECT_SOURCE", _IOC_NONE, 0x6f05, 0x00 },
+{ "linux/dvb/audio.h", "AUDIO_SET_AV_SYNC", _IOC_NONE, 0x6f07, 0x00 },
+{ "linux/dvb/audio.h", "AUDIO_SET_BYPASS_MODE", _IOC_NONE, 0x6f08, 0x00 },
+{ "linux/dvb/audio.h", "AUDIO_SET_ID", _IOC_NONE, 0x6f0d, 0x00 },
+{ "linux/dvb/audio.h", "AUDIO_SET_MIXER", _IOC_WRITE, 0x6f0e, 0x08 },
+{ "linux/dvb/audio.h", "AUDIO_SET_MUTE", _IOC_NONE, 0x6f06, 0x00 },
+{ "linux/dvb/audio.h", "AUDIO_SET_STREAMTYPE", _IOC_NONE, 0x6f0f, 0x00 },
+{ "linux/dvb/audio.h", "AUDIO_STOP", _IOC_NONE, 0x6f01, 0x00 },
+{ "linux/dvb/ca.h", "CA_GET_CAP", _IOC_READ, 0x6f81, 0x10 },
+{ "linux/dvb/ca.h", "CA_GET_DESCR_INFO", _IOC_READ, 0x6f83, 0x08 },
+{ "linux/dvb/ca.h", "CA_GET_MSG", _IOC_READ, 0x6f84, 0x10c },
+{ "linux/dvb/ca.h", "CA_GET_SLOT_INFO", _IOC_READ, 0x6f82, 0x0c },
+{ "linux/dvb/ca.h", "CA_RESET", _IOC_NONE, 0x6f80, 0x00 },
+{ "linux/dvb/ca.h", "CA_SEND_MSG", _IOC_WRITE, 0x6f85, 0x10c },
+{ "linux/dvb/ca.h", "CA_SET_DESCR", _IOC_WRITE, 0x6f86, 0x10 },
+{ "linux/dvb/dmx.h", "DMX_ADD_PID", _IOC_WRITE, 0x6f33, 0x02 },
+{ "linux/dvb/dmx.h", "DMX_DQBUF", _IOC_READ|_IOC_WRITE, 0x6f40, 0x18 },
+{ "linux/dvb/dmx.h", "DMX_EXPBUF", _IOC_READ|_IOC_WRITE, 0x6f3e, 0x0c },
+{ "linux/dvb/dmx.h", "DMX_GET_PES_PIDS", _IOC_READ, 0x6f2f, 0x0a },
+{ "linux/dvb/dmx.h", "DMX_GET_STC", _IOC_READ|_IOC_WRITE, 0x6f32, 0x10 },
+{ "linux/dvb/dmx.h", "DMX_QBUF", _IOC_READ|_IOC_WRITE, 0x6f3f, 0x18 },
+{ "linux/dvb/dmx.h", "DMX_QUERYBUF", _IOC_READ|_IOC_WRITE, 0x6f3d, 0x18 },
+{ "linux/dvb/dmx.h", "DMX_REMOVE_PID", _IOC_WRITE, 0x6f34, 0x02 },
+{ "linux/dvb/dmx.h", "DMX_REQBUFS", _IOC_READ|_IOC_WRITE, 0x6f3c, 0x08 },
+{ "linux/dvb/dmx.h", "DMX_SET_BUFFER_SIZE", _IOC_NONE, 0x6f2d, 0x00 },
+{ "linux/dvb/dmx.h", "DMX_SET_FILTER", _IOC_WRITE, 0x6f2b, 0x3a },
+{ "linux/dvb/dmx.h", "DMX_SET_PES_FILTER", _IOC_WRITE, 0x6f2c, 0x12 },
+{ "linux/dvb/dmx.h", "DMX_START", _IOC_NONE, 0x6f29, 0x00 },
+{ "linux/dvb/dmx.h", "DMX_STOP", _IOC_NONE, 0x6f2a, 0x00 },
+{ "linux/dvb/frontend.h", "FE_DISEQC_RECV_SLAVE_REPLY", _IOC_READ, 0x6f40, 0x0a },
+{ "linux/dvb/frontend.h", "FE_DISEQC_RESET_OVERLOAD", _IOC_NONE, 0x6f3e, 0x00 },
+{ "linux/dvb/frontend.h", "FE_DISEQC_SEND_BURST", _IOC_NONE, 0x6f41, 0x00 },
+{ "linux/dvb/frontend.h", "FE_DISEQC_SEND_MASTER_CMD", _IOC_WRITE, 0x6f3f, 0x07 },
+{ "linux/dvb/frontend.h", "FE_DISHNETWORK_SEND_LEGACY_CMD", _IOC_NONE, 0x6f50, 0x00 },
+{ "linux/dvb/frontend.h", "FE_ENABLE_HIGH_LNB_VOLTAGE", _IOC_NONE, 0x6f44, 0x00 },
+{ "linux/dvb/frontend.h", "FE_GET_EVENT", _IOC_READ, 0x6f4e, 0x28 },
+{ "linux/dvb/frontend.h", "FE_GET_FRONTEND", _IOC_READ, 0x6f4d, 0x24 },
+{ "linux/dvb/frontend.h", "FE_GET_INFO", _IOC_READ, 0x6f3d, 0xa8 },
+{ "linux/dvb/frontend.h", "FE_GET_PROPERTY", _IOC_READ, 0x6f53, 0x08 },
+{ "linux/dvb/frontend.h", "FE_READ_BER", _IOC_READ, 0x6f46, 0x04 },
+{ "linux/dvb/frontend.h", "FE_READ_SIGNAL_STRENGTH", _IOC_READ, 0x6f47, 0x02 },
+{ "linux/dvb/frontend.h", "FE_READ_SNR", _IOC_READ, 0x6f48, 0x02 },
+{ "linux/dvb/frontend.h", "FE_READ_STATUS", _IOC_READ, 0x6f45, 0x04 },
+{ "linux/dvb/frontend.h", "FE_READ_UNCORRECTED_BLOCKS", _IOC_READ, 0x6f49, 0x04 },
+{ "linux/dvb/frontend.h", "FE_SET_FRONTEND", _IOC_WRITE, 0x6f4c, 0x24 },
+{ "linux/dvb/frontend.h", "FE_SET_FRONTEND_TUNE_MODE", _IOC_NONE, 0x6f51, 0x00 },
+{ "linux/dvb/frontend.h", "FE_SET_PROPERTY", _IOC_WRITE, 0x6f52, 0x08 },
+{ "linux/dvb/frontend.h", "FE_SET_TONE", _IOC_NONE, 0x6f42, 0x00 },
+{ "linux/dvb/frontend.h", "FE_SET_VOLTAGE", _IOC_NONE, 0x6f43, 0x00 },
+{ "linux/dvb/net.h", "NET_ADD_IF", _IOC_READ|_IOC_WRITE, 0x6f34, 0x06 },
+{ "linux/dvb/net.h", "NET_GET_IF", _IOC_READ|_IOC_WRITE, 0x6f36, 0x06 },
+{ "linux/dvb/net.h", "NET_REMOVE_IF", _IOC_NONE, 0x6f35, 0x00 },
+{ "linux/dvb/osd.h", "OSD_GET_CAPABILITY", _IOC_READ, 0x6fa1, 0x08 },
+{ "linux/dvb/osd.h", "OSD_SEND_CMD", _IOC_WRITE, 0x6fa0, 0x1c },
+{ "linux/dvb/video.h", "VIDEO_CLEAR_BUFFER", _IOC_NONE, 0x6f22, 0x00 },
+{ "linux/dvb/video.h", "VIDEO_COMMAND", _IOC_READ|_IOC_WRITE, 0x6f3b, 0x48 },
+{ "linux/dvb/video.h", "VIDEO_CONTINUE", _IOC_NONE, 0x6f18, 0x00 },
+{ "linux/dvb/video.h", "VIDEO_FAST_FORWARD", _IOC_NONE, 0x6f1f, 0x00 },
+{ "linux/dvb/video.h", "VIDEO_FREEZE", _IOC_NONE, 0x6f17, 0x00 },
+{ "linux/dvb/video.h", "VIDEO_GET_CAPABILITIES", _IOC_READ, 0x6f21, 0x04 },
+{ "linux/dvb/video.h", "VIDEO_GET_EVENT", _IOC_READ, 0x6f1c, 0x14 },
+{ "linux/dvb/video.h", "VIDEO_GET_FRAME_COUNT", _IOC_READ, 0x6f3a, 0x08 },
+{ "linux/dvb/video.h", "VIDEO_GET_PTS", _IOC_READ, 0x6f39, 0x08 },
+{ "linux/dvb/video.h", "VIDEO_GET_SIZE", _IOC_READ, 0x6f37, 0x0c },
+{ "linux/dvb/video.h", "VIDEO_GET_STATUS", _IOC_READ, 0x6f1b, 0x14 },
+{ "linux/dvb/video.h", "VIDEO_PLAY", _IOC_NONE, 0x6f16, 0x00 },
+{ "linux/dvb/video.h", "VIDEO_SELECT_SOURCE", _IOC_NONE, 0x6f19, 0x00 },
+{ "linux/dvb/video.h", "VIDEO_SET_BLANK", _IOC_NONE, 0x6f1a, 0x00 },
+{ "linux/dvb/video.h", "VIDEO_SET_DISPLAY_FORMAT", _IOC_NONE, 0x6f1d, 0x00 },
+{ "linux/dvb/video.h", "VIDEO_SET_FORMAT", _IOC_NONE, 0x6f25, 0x00 },
+{ "linux/dvb/video.h", "VIDEO_SET_STREAMTYPE", _IOC_NONE, 0x6f24, 0x00 },
+{ "linux/dvb/video.h", "VIDEO_SLOWMOTION", _IOC_NONE, 0x6f20, 0x00 },
+{ "linux/dvb/video.h", "VIDEO_STILLPICTURE", _IOC_WRITE, 0x6f1e, 0x08 },
+{ "linux/dvb/video.h", "VIDEO_STOP", _IOC_NONE, 0x6f15, 0x00 },
+{ "linux/dvb/video.h", "VIDEO_TRY_COMMAND", _IOC_READ|_IOC_WRITE, 0x6f3c, 0x48 },
+{ "linux/fb.h", "FBIOBLANK", 0, 0x4611, 0 },
+{ "linux/fb.h", "FBIOGETCMAP", 0, 0x4604, 0 },
+{ "linux/fb.h", "FBIOGET_CON2FBMAP", 0, 0x460F, 0 },
+{ "linux/fb.h", "FBIOGET_DISPINFO", 0, 0x4618, 0 },
+{ "linux/fb.h", "FBIOGET_FSCREENINFO", 0, 0x4602, 0 },
+{ "linux/fb.h", "FBIOGET_GLYPH", 0, 0x4615, 0 },
+{ "linux/fb.h", "FBIOGET_HWCINFO", 0, 0x4616, 0 },
+{ "linux/fb.h", "FBIOGET_VBLANK", _IOC_READ, 0x4612, 0x20 },
+{ "linux/fb.h", "FBIOGET_VSCREENINFO", 0, 0x4600, 0 },
+{ "linux/fb.h", "FBIOPAN_DISPLAY", 0, 0x4606, 0 },
+{ "linux/fb.h", "FBIOPUTCMAP", 0, 0x4605, 0 },
+{ "linux/fb.h", "FBIOPUT_CON2FBMAP", 0, 0x4610, 0 },
+{ "linux/fb.h", "FBIOPUT_MODEINFO", 0, 0x4617, 0 },
+{ "linux/fb.h", "FBIOPUT_VSCREENINFO", 0, 0x4601, 0 },
+{ "linux/fb.h", "FBIO_ALLOC", 0, 0x4613, 0 },
+{ "linux/fb.h", "FBIO_CURSOR", _IOC_READ|_IOC_WRITE, 0x4608, 0x44 },
+{ "linux/fb.h", "FBIO_FREE", 0, 0x4614, 0 },
+{ "linux/fb.h", "FBIO_WAITFORVSYNC", _IOC_WRITE, 0x4620, 0x04 },
+{ "linux/fd.h", "FDCLRPRM", _IOC_NONE, 0x0241, 0x00 },
+{ "linux/fd.h", "FDDEFPRM", _IOC_WRITE, 0x0243, 0x1c },
+{ "linux/fd.h", "FDEJECT", _IOC_NONE, 0x025a, 0x00 },
+{ "linux/fd.h", "FDFLUSH", _IOC_NONE, 0x024b, 0x00 },
+{ "linux/fd.h", "FDFMTBEG", _IOC_NONE, 0x0247, 0x00 },
+{ "linux/fd.h", "FDFMTEND", _IOC_NONE, 0x0249, 0x00 },
+{ "linux/fd.h", "FDFMTTRK", _IOC_WRITE, 0x0248, 0x0c },
+{ "linux/fd.h", "FDGETDRVPRM", _IOC_READ, 0x0211, 0x52 },
+{ "linux/fd.h", "FDGETDRVSTAT", _IOC_READ, 0x0212, 0x34 },
+{ "linux/fd.h", "FDGETDRVTYP", _IOC_READ, 0x020f, 0x10 },
+{ "linux/fd.h", "FDGETFDCSTAT", _IOC_READ, 0x0215, 0x1c },
+{ "linux/fd.h", "FDGETMAXERRS", _IOC_READ, 0x020e, 0x14 },
+{ "linux/fd.h", "FDGETPRM", _IOC_READ, 0x0204, 0x1c },
+{ "linux/fd.h", "FDMSGOFF", _IOC_NONE, 0x0246, 0x00 },
+{ "linux/fd.h", "FDMSGON", _IOC_NONE, 0x0245, 0x00 },
+{ "linux/fd.h", "FDPOLLDRVSTAT", _IOC_READ, 0x0213, 0x34 },
+{ "linux/fd.h", "FDRAWCMD", _IOC_NONE, 0x0258, 0x00 },
+{ "linux/fd.h", "FDRESET", _IOC_NONE, 0x0254, 0x00 },
+{ "linux/fd.h", "FDSETDRVPRM", _IOC_WRITE, 0x0290, 0x52 },
+{ "linux/fd.h", "FDSETEMSGTRESH", _IOC_NONE, 0x024a, 0x00 },
+{ "linux/fd.h", "FDSETMAXERRS", _IOC_WRITE, 0x024c, 0x14 },
+{ "linux/fd.h", "FDSETPRM", _IOC_WRITE, 0x0242, 0x1c },
+{ "linux/fd.h", "FDTWADDLE", _IOC_NONE, 0x0259, 0x00 },
+{ "linux/fd.h", "FDWERRORCLR", _IOC_NONE, 0x0256, 0x00 },
+{ "linux/fd.h", "FDWERRORGET", _IOC_READ, 0x0217, 0x18 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_ADD_DESCRIPTOR", _IOC_READ|_IOC_WRITE, 0x2306, 0x18 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_ALLOCATE", _IOC_READ|_IOC_WRITE, 0x2302, 0x20 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_ALLOCATE_ISO_RESOURCE", _IOC_READ|_IOC_WRITE, 0x230d, 0x18 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_ALLOCATE_ISO_RESOURCE_ONCE", _IOC_WRITE, 0x230f, 0x18 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_CREATE_ISO_CONTEXT", _IOC_READ|_IOC_WRITE, 0x2308, 0x1c },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_DEALLOCATE", _IOC_WRITE, 0x2303, 0x04 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_DEALLOCATE_ISO_RESOURCE", _IOC_WRITE, 0x230e, 0x04 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_DEALLOCATE_ISO_RESOURCE_ONCE", _IOC_WRITE, 0x2310, 0x18 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_FLUSH_ISO", _IOC_WRITE, 0x2318, 0x04 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_GET_CYCLE_TIMER", _IOC_READ, 0x230c, 0x0c },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_GET_CYCLE_TIMER2", _IOC_READ|_IOC_WRITE, 0x2314, 0x14 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_GET_INFO", _IOC_READ|_IOC_WRITE, 0x2300, 0x24 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_GET_SPEED", _IOC_NONE, 0x2311, 0x00 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_INITIATE_BUS_RESET", _IOC_WRITE, 0x2305, 0x04 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_QUEUE_ISO", _IOC_READ|_IOC_WRITE, 0x2309, 0x18 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_RECEIVE_PHY_PACKETS", _IOC_WRITE, 0x2316, 0x08 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_REMOVE_DESCRIPTOR", _IOC_WRITE, 0x2307, 0x04 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_SEND_BROADCAST_REQUEST", _IOC_WRITE, 0x2312, 0x24 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_SEND_PHY_PACKET", _IOC_READ|_IOC_WRITE, 0x2315, 0x14 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_SEND_REQUEST", _IOC_WRITE, 0x2301, 0x24 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_SEND_RESPONSE", _IOC_WRITE, 0x2304, 0x14 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_SEND_STREAM_PACKET", _IOC_WRITE, 0x2313, 0x28 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_SET_ISO_CHANNELS", _IOC_WRITE, 0x2317, 0x0c },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_START_ISO", _IOC_WRITE, 0x230a, 0x10 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_STOP_ISO", _IOC_WRITE, 0x230b, 0x04 },
+{ "linux/fpga-dfl.h", "DFL_FPGA_CHECK_EXTENSION", _IOC_NONE, 0xb601, 0x00 },
+{ "linux/fpga-dfl.h", "DFL_FPGA_FME_ERR_GET_IRQ_NUM", _IOC_READ, 0xb683, 0x04 },
+{ "linux/fpga-dfl.h", "DFL_FPGA_FME_ERR_SET_IRQ", _IOC_WRITE, 0xb684, 0x08 },
+{ "linux/fpga-dfl.h", "DFL_FPGA_FME_PORT_ASSIGN", _IOC_WRITE, 0xb682, 0x04 },
+{ "linux/fpga-dfl.h", "DFL_FPGA_FME_PORT_PR", _IOC_NONE, 0xb680, 0x00 },
+{ "linux/fpga-dfl.h", "DFL_FPGA_FME_PORT_RELEASE", _IOC_WRITE, 0xb681, 0x04 },
+{ "linux/fpga-dfl.h", "DFL_FPGA_GET_API_VERSION", _IOC_NONE, 0xb600, 0x00 },
+{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_DMA_MAP", _IOC_NONE, 0xb643, 0x00 },
+{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_DMA_UNMAP", _IOC_NONE, 0xb644, 0x00 },
+{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_ERR_GET_IRQ_NUM", _IOC_READ, 0xb645, 0x04 },
+{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_ERR_SET_IRQ", _IOC_WRITE, 0xb646, 0x08 },
+{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_GET_INFO", _IOC_NONE, 0xb641, 0x00 },
+{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_GET_REGION_INFO", _IOC_NONE, 0xb642, 0x00 },
+{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_RESET", _IOC_NONE, 0xb640, 0x00 },
+{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_UINT_GET_IRQ_NUM", _IOC_READ, 0xb647, 0x04 },
+{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_UINT_SET_IRQ", _IOC_WRITE, 0xb648, 0x08 },
+{ "linux/fs.h", "BLKALIGNOFF", _IOC_NONE, 0x127a, 0x00 },
+{ "linux/fs.h", "BLKBSZGET", _IOC_READ, 0x1270, 0x04 },
+{ "linux/fs.h", "BLKBSZSET", _IOC_WRITE, 0x1271, 0x04 },
+{ "linux/fs.h", "BLKDISCARD", _IOC_NONE, 0x1277, 0x00 },
+{ "linux/fs.h", "BLKDISCARDZEROES", _IOC_NONE, 0x127c, 0x00 },
+{ "linux/fs.h", "BLKFLSBUF", _IOC_NONE, 0x1261, 0x00 },
+{ "linux/fs.h", "BLKFRAGET", _IOC_NONE, 0x1265, 0x00 },
+{ "linux/fs.h", "BLKFRASET", _IOC_NONE, 0x1264, 0x00 },
+{ "linux/fs.h", "BLKGETSIZE", _IOC_NONE, 0x1260, 0x00 },
+{ "linux/fs.h", "BLKGETSIZE64", _IOC_READ, 0x1272, 0x04 },
+{ "linux/fs.h", "BLKIOMIN", _IOC_NONE, 0x1278, 0x00 },
+{ "linux/fs.h", "BLKIOOPT", _IOC_NONE, 0x1279, 0x00 },
+{ "linux/fs.h", "BLKPBSZGET", _IOC_NONE, 0x127b, 0x00 },
+{ "linux/fs.h", "BLKRAGET", _IOC_NONE, 0x1263, 0x00 },
+{ "linux/fs.h", "BLKRASET", _IOC_NONE, 0x1262, 0x00 },
+{ "linux/fs.h", "BLKROGET", _IOC_NONE, 0x125e, 0x00 },
+{ "linux/fs.h", "BLKROSET", _IOC_NONE, 0x125d, 0x00 },
+{ "linux/fs.h", "BLKROTATIONAL", _IOC_NONE, 0x127e, 0x00 },
+{ "linux/fs.h", "BLKRRPART", _IOC_NONE, 0x125f, 0x00 },
+{ "linux/fs.h", "BLKSECDISCARD", _IOC_NONE, 0x127d, 0x00 },
+{ "linux/fs.h", "BLKSECTGET", _IOC_NONE, 0x1267, 0x00 },
+{ "linux/fs.h", "BLKSECTSET", _IOC_NONE, 0x1266, 0x00 },
+{ "linux/fs.h", "BLKSSZGET", _IOC_NONE, 0x1268, 0x00 },
+{ "linux/fs.h", "BLKTRACESETUP", _IOC_READ|_IOC_WRITE, 0x1273, 0x3e },
+{ "linux/fs.h", "BLKTRACESTART", _IOC_NONE, 0x1274, 0x00 },
+{ "linux/fs.h", "BLKTRACESTOP", _IOC_NONE, 0x1275, 0x00 },
+{ "linux/fs.h", "BLKTRACETEARDOWN", _IOC_NONE, 0x1276, 0x00 },
+{ "linux/fs.h", "BLKZEROOUT", _IOC_NONE, 0x127f, 0x00 },
+{ "linux/fs.h", "FIBMAP", _IOC_NONE, 0x0001, 0x00 },
+{ "linux/fs.h", "FICLONE", _IOC_WRITE, 0x9409, 0x04 },
+{ "linux/fs.h", "FICLONERANGE", _IOC_WRITE, 0x940d, 0x20 },
+{ "linux/fs.h", "FIDEDUPERANGE", _IOC_READ|_IOC_WRITE, 0x9436, 0x18 },
+{ "linux/fs.h", "FIFREEZE", _IOC_READ|_IOC_WRITE, 0x5877, 0x04 },
+{ "linux/fs.h", "FIGETBSZ", _IOC_NONE, 0x0002, 0x00 },
+{ "linux/fs.h", "FITHAW", _IOC_READ|_IOC_WRITE, 0x5878, 0x04 },
+{ "linux/fs.h", "FITRIM", _IOC_READ|_IOC_WRITE, 0x5879, 0x18 },
+{ "linux/fs.h", "FS_IOC32_GETFLAGS", _IOC_READ, 0x6601, 0x04 },
+{ "linux/fs.h", "FS_IOC32_GETVERSION", _IOC_READ, 0x7601, 0x04 },
+{ "linux/fs.h", "FS_IOC32_SETFLAGS", _IOC_WRITE, 0x6602, 0x04 },
+{ "linux/fs.h", "FS_IOC32_SETVERSION", _IOC_WRITE, 0x7602, 0x04 },
+{ "linux/fs.h", "FS_IOC_FIEMAP", _IOC_READ|_IOC_WRITE, 0x660b, 0x20 },
+{ "linux/fs.h", "FS_IOC_FSGETXATTR", _IOC_READ, 0x581f, 0x1c },
+{ "linux/fs.h", "FS_IOC_FSSETXATTR", _IOC_WRITE, 0x5820, 0x1c },
+{ "linux/fs.h", "FS_IOC_GETFSLABEL", _IOC_READ, 0x9431, 0x100 },
+{ "linux/fs.h", "FS_IOC_SETFSLABEL", _IOC_WRITE, 0x9432, 0x100 },
+{ "linux/fscrypt.h", "FS_IOC_ADD_ENCRYPTION_KEY", _IOC_READ|_IOC_WRITE, 0x6617, 0x50 },
+{ "linux/fscrypt.h", "FS_IOC_GET_ENCRYPTION_KEY_STATUS", _IOC_READ|_IOC_WRITE, 0x661a, 0x80 },
+{ "linux/fscrypt.h", "FS_IOC_GET_ENCRYPTION_NONCE", _IOC_READ, 0x661b, 0x10 },
+{ "linux/fscrypt.h", "FS_IOC_GET_ENCRYPTION_POLICY", _IOC_WRITE, 0x6615, 0x0c },
+{ "linux/fscrypt.h", "FS_IOC_GET_ENCRYPTION_POLICY_EX", _IOC_READ|_IOC_WRITE, 0x6616, 0x09 },
+{ "linux/fscrypt.h", "FS_IOC_GET_ENCRYPTION_PWSALT", _IOC_WRITE, 0x6614, 0x10 },
+{ "linux/fscrypt.h", "FS_IOC_REMOVE_ENCRYPTION_KEY", _IOC_READ|_IOC_WRITE, 0x6618, 0x40 },
+{ "linux/fscrypt.h", "FS_IOC_REMOVE_ENCRYPTION_KEY_ALL_USERS", _IOC_READ|_IOC_WRITE, 0x6619, 0x40 },
+{ "linux/fscrypt.h", "FS_IOC_SET_ENCRYPTION_POLICY", _IOC_READ, 0x6613, 0x0c },
+{ "linux/fsi.h", "FSI_SCOM_CHECK", _IOC_READ, 0x7300, 0x04 },
+{ "linux/fsi.h", "FSI_SCOM_READ", _IOC_READ|_IOC_WRITE, 0x7301, 0x1e },
+{ "linux/fsi.h", "FSI_SCOM_RESET", _IOC_WRITE, 0x7303, 0x04 },
+{ "linux/fsi.h", "FSI_SCOM_WRITE", _IOC_READ|_IOC_WRITE, 0x7302, 0x1e },
+{ "linux/fsl-diu-fb.h", "MFB_GET_ALPHA", _IOC_READ, 0x4d00, 0x01 },
+{ "linux/fsl-diu-fb.h", "MFB_GET_AOID", _IOC_READ, 0x4d04, 0x08 },
+{ "linux/fsl-diu-fb.h", "MFB_GET_GAMMA", _IOC_READ, 0x4d01, 0x01 },
+{ "linux/fsl-diu-fb.h", "MFB_GET_PIXFMT", _IOC_READ, 0x4d08, 0x04 },
+{ "linux/fsl-diu-fb.h", "MFB_SET_ALPHA", _IOC_WRITE, 0x4d00, 0x01 },
+{ "linux/fsl-diu-fb.h", "MFB_SET_AOID", _IOC_WRITE, 0x4d04, 0x08 },
+{ "linux/fsl-diu-fb.h", "MFB_SET_BRIGHTNESS", _IOC_WRITE, 0x4d03, 0x01 },
+{ "linux/fsl-diu-fb.h", "MFB_SET_CHROMA_KEY", _IOC_WRITE, 0x4d01, 0x0a },
+{ "linux/fsl-diu-fb.h", "MFB_SET_GAMMA", _IOC_WRITE, 0x4d01, 0x01 },
+{ "linux/fsl-diu-fb.h", "MFB_SET_PIXFMT", _IOC_WRITE, 0x4d08, 0x04 },
+{ "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_DOORBELL", _IOC_READ|_IOC_WRITE, 0xaf06, 0x08 },
+{ "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_GETPROP", _IOC_READ|_IOC_WRITE, 0xaf07, 0x28 },
+{ "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_MEMCPY", _IOC_READ|_IOC_WRITE, 0xaf05, 0x28 },
+{ "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_PARTITION_GET_STATUS", _IOC_READ|_IOC_WRITE, 0xaf02, 0x0c },
+{ "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_PARTITION_RESTART", _IOC_READ|_IOC_WRITE, 0xaf01, 0x08 },
+{ "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_PARTITION_START", _IOC_READ|_IOC_WRITE, 0xaf03, 0x10 },
+{ "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_PARTITION_STOP", _IOC_READ|_IOC_WRITE, 0xaf04, 0x08 },
+{ "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_SETPROP", _IOC_READ|_IOC_WRITE, 0xaf08, 0x28 },
+{ "linux/fsmap.h", "FS_IOC_GETFSMAP", _IOC_READ|_IOC_WRITE, 0x583b, 0xc0 },
+{ "linux/fsverity.h", "FS_IOC_ENABLE_VERITY", _IOC_WRITE, 0x6685, 0x80 },
+{ "linux/fsverity.h", "FS_IOC_MEASURE_VERITY", _IOC_READ|_IOC_WRITE, 0x6686, 0x04 },
+{ "linux/fuse.h", "FUSE_DEV_IOC_CLONE", _IOC_READ, 0xe500, 0x04 },
+{ "linux/genwqe/genwqe_card.h", "GENWQE_EXECUTE_DDCB", _IOC_READ|_IOC_WRITE, 0xa532, 0xe8 },
+{ "linux/genwqe/genwqe_card.h", "GENWQE_EXECUTE_RAW_DDCB", _IOC_READ|_IOC_WRITE, 0xa533, 0xe8 },
+{ "linux/genwqe/genwqe_card.h", "GENWQE_GET_CARD_STATE", _IOC_READ, 0xa524, 0x04 },
+{ "linux/genwqe/genwqe_card.h", "GENWQE_PIN_MEM", _IOC_READ|_IOC_WRITE, 0xa528, 0x20 },
+{ "linux/genwqe/genwqe_card.h", "GENWQE_READ_REG16", _IOC_READ, 0xa522, 0x10 },
+{ "linux/genwqe/genwqe_card.h", "GENWQE_READ_REG32", _IOC_READ, 0xa520, 0x10 },
+{ "linux/genwqe/genwqe_card.h", "GENWQE_READ_REG64", _IOC_READ, 0xa51e, 0x10 },
+{ "linux/genwqe/genwqe_card.h", "GENWQE_SLU_READ", _IOC_READ|_IOC_WRITE, 0xa551, 0x38 },
+{ "linux/genwqe/genwqe_card.h", "GENWQE_SLU_UPDATE", _IOC_READ|_IOC_WRITE, 0xa550, 0x38 },
+{ "linux/genwqe/genwqe_card.h", "GENWQE_UNPIN_MEM", _IOC_READ|_IOC_WRITE, 0xa529, 0x20 },
+{ "linux/genwqe/genwqe_card.h", "GENWQE_WRITE_REG16", _IOC_WRITE, 0xa523, 0x10 },
+{ "linux/genwqe/genwqe_card.h", "GENWQE_WRITE_REG32", _IOC_WRITE, 0xa521, 0x10 },
+{ "linux/genwqe/genwqe_card.h", "GENWQE_WRITE_REG64", _IOC_WRITE, 0xa51f, 0x10 },
+{ "linux/gpio.h", "GPIOHANDLE_GET_LINE_VALUES_IOCTL", _IOC_READ|_IOC_WRITE, 0xb408, 0x40 },
+{ "linux/gpio.h", "GPIOHANDLE_SET_CONFIG_IOCTL", _IOC_READ|_IOC_WRITE, 0xb40a, 0x54 },
+{ "linux/gpio.h", "GPIOHANDLE_SET_LINE_VALUES_IOCTL", _IOC_READ|_IOC_WRITE, 0xb409, 0x40 },
+{ "linux/gpio.h", "GPIO_GET_CHIPINFO_IOCTL", _IOC_READ, 0xb401, 0x44 },
+{ "linux/gpio.h", "GPIO_GET_LINEEVENT_IOCTL", _IOC_READ|_IOC_WRITE, 0xb404, 0x30 },
+{ "linux/gpio.h", "GPIO_GET_LINEHANDLE_IOCTL", _IOC_READ|_IOC_WRITE, 0xb403, 0x16c },
+{ "linux/gpio.h", "GPIO_GET_LINEINFO_IOCTL", _IOC_READ|_IOC_WRITE, 0xb402, 0x48 },
+{ "linux/gpio.h", "GPIO_GET_LINEINFO_UNWATCH_IOCTL", _IOC_READ|_IOC_WRITE, 0xb40c, 0x04 },
+{ "linux/gpio.h", "GPIO_GET_LINEINFO_WATCH_IOCTL", _IOC_READ|_IOC_WRITE, 0xb40b, 0x48 },
+{ "linux/gpio.h", "GPIO_V2_GET_LINEINFO_IOCTL", _IOC_READ|_IOC_WRITE, 0xb405, 0x100 },
+{ "linux/gpio.h", "GPIO_V2_GET_LINEINFO_WATCH_IOCTL", _IOC_READ|_IOC_WRITE, 0xb406, 0x100 },
+{ "linux/gpio.h", "GPIO_V2_GET_LINE_IOCTL", _IOC_READ|_IOC_WRITE, 0xb407, 0x250 },
+{ "linux/gpio.h", "GPIO_V2_LINE_GET_VALUES_IOCTL", _IOC_READ|_IOC_WRITE, 0xb40e, 0x10 },
+{ "linux/gpio.h", "GPIO_V2_LINE_SET_CONFIG_IOCTL", _IOC_READ|_IOC_WRITE, 0xb40d, 0x110 },
+{ "linux/gpio.h", "GPIO_V2_LINE_SET_VALUES_IOCTL", _IOC_READ|_IOC_WRITE, 0xb40f, 0x10 },
+{ "linux/gsmmux.h", "GSMIOC_DISABLE_NET", _IOC_NONE, 0x4703, 0x00 },
+{ "linux/gsmmux.h", "GSMIOC_ENABLE_NET", _IOC_WRITE, 0x4702, 0x34 },
+{ "linux/gsmmux.h", "GSMIOC_GETCONF", _IOC_READ, 0x4700, 0x4c },
+{ "linux/gsmmux.h", "GSMIOC_GETFIRST", _IOC_READ, 0x4704, 0x04 },
+{ "linux/gsmmux.h", "GSMIOC_SETCONF", _IOC_WRITE, 0x4701, 0x4c },
+{ "linux/hdreg.h", "HDIO_DRIVE_CMD", 0, 0x031f, 0 },
+{ "linux/hdreg.h", "HDIO_DRIVE_RESET", 0, 0x031c, 0 },
+{ "linux/hdreg.h", "HDIO_DRIVE_TASK", 0, 0x031e, 0 },
+{ "linux/hdreg.h", "HDIO_DRIVE_TASKFILE", 0, 0x031d, 0 },
+{ "linux/hdreg.h", "HDIO_GETGEO", 0, 0x0301, 0 },
+{ "linux/hdreg.h", "HDIO_GET_32BIT", 0, 0x0309, 0 },
+{ "linux/hdreg.h", "HDIO_GET_ACOUSTIC", 0, 0x030f, 0 },
+{ "linux/hdreg.h", "HDIO_GET_ADDRESS", 0, 0x0310, 0 },
+{ "linux/hdreg.h", "HDIO_GET_BUSSTATE", 0, 0x031a, 0 },
+{ "linux/hdreg.h", "HDIO_GET_DMA", 0, 0x030b, 0 },
+{ "linux/hdreg.h", "HDIO_GET_IDENTITY", 0, 0x030d, 0 },
+{ "linux/hdreg.h", "HDIO_GET_KEEPSETTINGS", 0, 0x0308, 0 },
+{ "linux/hdreg.h", "HDIO_GET_MULTCOUNT", 0, 0x0304, 0 },
+{ "linux/hdreg.h", "HDIO_GET_NICE", 0, 0x030c, 0 },
+{ "linux/hdreg.h", "HDIO_GET_NOWERR", 0, 0x030a, 0 },
+{ "linux/hdreg.h", "HDIO_GET_QDMA", 0, 0x0305, 0 },
+{ "linux/hdreg.h", "HDIO_GET_UNMASKINTR", 0, 0x0302, 0 },
+{ "linux/hdreg.h", "HDIO_GET_WCACHE", 0, 0x030e, 0 },
+{ "linux/hdreg.h", "HDIO_OBSOLETE_IDENTITY", 0, 0x0307, 0 },
+{ "linux/hdreg.h", "HDIO_SCAN_HWIF", 0, 0x0328, 0 },
+{ "linux/hdreg.h", "HDIO_SET_32BIT", 0, 0x0324, 0 },
+{ "linux/hdreg.h", "HDIO_SET_ACOUSTIC", 0, 0x032c, 0 },
+{ "linux/hdreg.h", "HDIO_SET_ADDRESS", 0, 0x032f, 0 },
+{ "linux/hdreg.h", "HDIO_SET_BUSSTATE", 0, 0x032d, 0 },
+{ "linux/hdreg.h", "HDIO_SET_DMA", 0, 0x0326, 0 },
+{ "linux/hdreg.h", "HDIO_SET_KEEPSETTINGS", 0, 0x0323, 0 },
+{ "linux/hdreg.h", "HDIO_SET_MULTCOUNT", 0, 0x0321, 0 },
+{ "linux/hdreg.h", "HDIO_SET_NICE", 0, 0x0329, 0 },
+{ "linux/hdreg.h", "HDIO_SET_NOWERR", 0, 0x0325, 0 },
+{ "linux/hdreg.h", "HDIO_SET_PIO_MODE", 0, 0x0327, 0 },
+{ "linux/hdreg.h", "HDIO_SET_QDMA", 0, 0x032e, 0 },
+{ "linux/hdreg.h", "HDIO_SET_UNMASKINTR", 0, 0x0322, 0 },
+{ "linux/hdreg.h", "HDIO_SET_WCACHE", 0, 0x032b, 0 },
+{ "linux/hdreg.h", "HDIO_SET_XFER", 0, 0x0306, 0 },
+{ "linux/hdreg.h", "HDIO_TRISTATE_HWIF", 0, 0x031b, 0 },
+{ "linux/hdreg.h", "HDIO_UNREGISTER_HWIF", 0, 0x032a, 0 },
+{ "linux/hid-roccat.h", "ROCCATIOCGREPSIZE", _IOC_READ, 0x48f1, 0x04 },
+{ "linux/hiddev.h", "HIDIOCAPPLICATION", _IOC_NONE, 0x4802, 0x00 },
+{ "linux/hiddev.h", "HIDIOCGCOLLECTIONINDEX", _IOC_WRITE, 0x4810, 0x18 },
+{ "linux/hiddev.h", "HIDIOCGCOLLECTIONINFO", _IOC_READ|_IOC_WRITE, 0x4811, 0x10 },
+{ "linux/hiddev.h", "HIDIOCGDEVINFO", _IOC_READ, 0x4803, 0x1a },
+{ "linux/hiddev.h", "HIDIOCGFIELDINFO", _IOC_READ|_IOC_WRITE, 0x480a, 0x38 },
+{ "linux/hiddev.h", "HIDIOCGFLAG", _IOC_READ, 0x480e, 0x04 },
+{ "linux/hiddev.h", "HIDIOCGREPORT", _IOC_WRITE, 0x4807, 0x0c },
+{ "linux/hiddev.h", "HIDIOCGREPORTINFO", _IOC_READ|_IOC_WRITE, 0x4809, 0x0c },
+{ "linux/hiddev.h", "HIDIOCGSTRING", _IOC_READ, 0x4804, 0x104 },
+{ "linux/hiddev.h", "HIDIOCGUCODE", _IOC_READ|_IOC_WRITE, 0x480d, 0x18 },
+{ "linux/hiddev.h", "HIDIOCGUSAGE", _IOC_READ|_IOC_WRITE, 0x480b, 0x18 },
+{ "linux/hiddev.h", "HIDIOCGUSAGES", _IOC_READ|_IOC_WRITE, 0x4813, 0x101c },
+{ "linux/hiddev.h", "HIDIOCGVERSION", _IOC_READ, 0x4801, 0x04 },
+{ "linux/hiddev.h", "HIDIOCINITREPORT", _IOC_NONE, 0x4805, 0x00 },
+{ "linux/hiddev.h", "HIDIOCSFLAG", _IOC_WRITE, 0x480f, 0x04 },
+{ "linux/hiddev.h", "HIDIOCSREPORT", _IOC_WRITE, 0x4808, 0x0c },
+{ "linux/hiddev.h", "HIDIOCSUSAGE", _IOC_WRITE, 0x480c, 0x18 },
+{ "linux/hiddev.h", "HIDIOCSUSAGES", _IOC_WRITE, 0x4814, 0x101c },
+{ "linux/hidraw.h", "HIDIOCGRAWINFO", _IOC_READ, 0x4803, 0x08 },
+{ "linux/hidraw.h", "HIDIOCGRDESC", _IOC_READ, 0x4802, 0x1004 },
+{ "linux/hidraw.h", "HIDIOCGRDESCSIZE", _IOC_READ, 0x4801, 0x04 },
+{ "linux/hpet.h", "HPET_DPI", _IOC_NONE, 0x6805, 0x00 },
+{ "linux/hpet.h", "HPET_EPI", _IOC_NONE, 0x6804, 0x00 },
+{ "linux/hpet.h", "HPET_IE_OFF", _IOC_NONE, 0x6802, 0x00 },
+{ "linux/hpet.h", "HPET_IE_ON", _IOC_NONE, 0x6801, 0x00 },
+{ "linux/hpet.h", "HPET_INFO", _IOC_READ, 0x6803, 0x0c },
+{ "linux/hpet.h", "HPET_IRQFREQ", _IOC_WRITE, 0x6806, 0x04 },
+{ "linux/hsi/cs-protocol.h", "CS_CONFIG_BUFS", _IOC_WRITE, 0x431f, 0x20 },
+{ "linux/hsi/cs-protocol.h", "CS_GET_IF_VERSION", _IOC_READ, 0x431e, 0x04 },
+{ "linux/hsi/cs-protocol.h", "CS_GET_STATE", _IOC_READ, 0x4315, 0x04 },
+{ "linux/hsi/cs-protocol.h", "CS_SET_WAKELINE", _IOC_WRITE, 0x4317, 0x04 },
+{ "linux/hsi/hsi_char.h", "HSC_GET_RX", _IOC_WRITE, 0x6b14, 0x0c },
+{ "linux/hsi/hsi_char.h", "HSC_GET_TX", _IOC_WRITE, 0x6b16, 0x10 },
+{ "linux/hsi/hsi_char.h", "HSC_RESET", _IOC_NONE, 0x6b10, 0x00 },
+{ "linux/hsi/hsi_char.h", "HSC_SEND_BREAK", _IOC_NONE, 0x6b12, 0x00 },
+{ "linux/hsi/hsi_char.h", "HSC_SET_PM", _IOC_NONE, 0x6b11, 0x00 },
+{ "linux/hsi/hsi_char.h", "HSC_SET_RX", _IOC_WRITE, 0x6b13, 0x0c },
+{ "linux/hsi/hsi_char.h", "HSC_SET_TX", _IOC_WRITE, 0x6b15, 0x10 },
+{ "linux/i2o-dev.h", "I2OEVTGET", _IOC_READ, 0x690b, 0x68 },
+{ "linux/i2o-dev.h", "I2OEVTREG", _IOC_WRITE, 0x690a, 0x0c },
+{ "linux/i2o-dev.h", "I2OGETIOPS", _IOC_READ, 0x6900, 0x20 },
+{ "linux/i2o-dev.h", "I2OHRTGET", _IOC_READ|_IOC_WRITE, 0x6901, 0x0c },
+{ "linux/i2o-dev.h", "I2OHTML", _IOC_READ|_IOC_WRITE, 0x6909, 0x1c },
+{ "linux/i2o-dev.h", "I2OLCTGET", _IOC_READ|_IOC_WRITE, 0x6902, 0x0c },
+{ "linux/i2o-dev.h", "I2OPARMGET", _IOC_READ|_IOC_WRITE, 0x6904, 0x18 },
+{ "linux/i2o-dev.h", "I2OPARMSET", _IOC_READ|_IOC_WRITE, 0x6903, 0x18 },
+{ "linux/i2o-dev.h", "I2OPASSTHRU32", _IOC_READ, 0x690c, 0x08 },
+{ "linux/i2o-dev.h", "I2OSWDEL", _IOC_READ|_IOC_WRITE, 0x6907, 0x1a },
+{ "linux/i2o-dev.h", "I2OSWDL", _IOC_READ|_IOC_WRITE, 0x6905, 0x1a },
+{ "linux/i2o-dev.h", "I2OSWUL", _IOC_READ|_IOC_WRITE, 0x6906, 0x1a },
+{ "linux/i2o-dev.h", "I2OVALIDATE", _IOC_READ, 0x6908, 0x04 },
+{ "linux/i8k.h", "I8K_BIOS_VERSION", _IOC_READ, 0x6980, 0x04 },
+{ "linux/i8k.h", "I8K_FN_STATUS", _IOC_READ, 0x6983, 0x04 },
+{ "linux/i8k.h", "I8K_GET_FAN", _IOC_READ|_IOC_WRITE, 0x6986, 0x04 },
+{ "linux/i8k.h", "I8K_GET_SPEED", _IOC_READ|_IOC_WRITE, 0x6985, 0x04 },
+{ "linux/i8k.h", "I8K_GET_TEMP", _IOC_READ, 0x6984, 0x04 },
+{ "linux/i8k.h", "I8K_MACHINE_ID", _IOC_READ, 0x6981, 0x04 },
+{ "linux/i8k.h", "I8K_POWER_STATUS", _IOC_READ, 0x6982, 0x04 },
+{ "linux/i8k.h", "I8K_SET_FAN", _IOC_READ|_IOC_WRITE, 0x6987, 0x04 },
+{ "linux/if_pppox.h", "PPPOEIOCDFWD", _IOC_NONE, 0xb101, 0x00 },
+{ "linux/if_pppox.h", "PPPOEIOCSFWD", _IOC_WRITE, 0xb100, 0x04 },
+{ "linux/if_tun.h", "TUNATTACHFILTER", _IOC_WRITE, 0x54d5, 0x06 },
+{ "linux/if_tun.h", "TUNDETACHFILTER", _IOC_WRITE, 0x54d6, 0x06 },
+{ "linux/if_tun.h", "TUNGETDEVNETNS", _IOC_NONE, 0x54e3, 0x00 },
+{ "linux/if_tun.h", "TUNGETFEATURES", _IOC_READ, 0x54cf, 0x04 },
+{ "linux/if_tun.h", "TUNGETFILTER", _IOC_READ, 0x54db, 0x06 },
+{ "linux/if_tun.h", "TUNGETIFF", _IOC_READ, 0x54d2, 0x04 },
+{ "linux/if_tun.h", "TUNGETSNDBUF", _IOC_READ, 0x54d3, 0x04 },
+{ "linux/if_tun.h", "TUNGETVNETBE", _IOC_READ, 0x54df, 0x04 },
+{ "linux/if_tun.h", "TUNGETVNETHDRSZ", _IOC_READ, 0x54d7, 0x04 },
+{ "linux/if_tun.h", "TUNGETVNETLE", _IOC_READ, 0x54dd, 0x04 },
+{ "linux/if_tun.h", "TUNSETCARRIER", _IOC_WRITE, 0x54e2, 0x04 },
+{ "linux/if_tun.h", "TUNSETDEBUG", _IOC_WRITE, 0x54c9, 0x04 },
+{ "linux/if_tun.h", "TUNSETFILTEREBPF", _IOC_READ, 0x54e1, 0x04 },
+{ "linux/if_tun.h", "TUNSETGROUP", _IOC_WRITE, 0x54ce, 0x04 },
+{ "linux/if_tun.h", "TUNSETIFF", _IOC_WRITE, 0x54ca, 0x04 },
+{ "linux/if_tun.h", "TUNSETIFINDEX", _IOC_WRITE, 0x54da, 0x04 },
+{ "linux/if_tun.h", "TUNSETLINK", _IOC_WRITE, 0x54cd, 0x04 },
+{ "linux/if_tun.h", "TUNSETNOCSUM", _IOC_WRITE, 0x54c8, 0x04 },
+{ "linux/if_tun.h", "TUNSETOFFLOAD", _IOC_WRITE, 0x54d0, 0x04 },
+{ "linux/if_tun.h", "TUNSETOWNER", _IOC_WRITE, 0x54cc, 0x04 },
+{ "linux/if_tun.h", "TUNSETPERSIST", _IOC_WRITE, 0x54cb, 0x04 },
+{ "linux/if_tun.h", "TUNSETQUEUE", _IOC_WRITE, 0x54d9, 0x04 },
+{ "linux/if_tun.h", "TUNSETSNDBUF", _IOC_WRITE, 0x54d4, 0x04 },
+{ "linux/if_tun.h", "TUNSETSTEERINGEBPF", _IOC_READ, 0x54e0, 0x04 },
+{ "linux/if_tun.h", "TUNSETTXFILTER", _IOC_WRITE, 0x54d1, 0x04 },
+{ "linux/if_tun.h", "TUNSETVNETBE", _IOC_WRITE, 0x54de, 0x04 },
+{ "linux/if_tun.h", "TUNSETVNETHDRSZ", _IOC_WRITE, 0x54d8, 0x04 },
+{ "linux/if_tun.h", "TUNSETVNETLE", _IOC_WRITE, 0x54dc, 0x04 },
+{ "linux/iio/events.h", "IIO_GET_EVENT_FD_IOCTL", _IOC_READ, 0x6990, 0x04 },
+{ "linux/inotify.h", "INOTIFY_IOC_SETNEXTWD", _IOC_WRITE, 0x4900, 0x04 },
+{ "linux/input.h", "EVIOCGEFFECTS", _IOC_READ, 0x4584, 0x04 },
+{ "linux/input.h", "EVIOCGID", _IOC_READ, 0x4502, 0x08 },
+{ "linux/input.h", "EVIOCGKEYCODE", _IOC_READ, 0x4504, 0x08 },
+{ "linux/input.h", "EVIOCGKEYCODE_V2", _IOC_READ, 0x4504, 0x28 },
+{ "linux/input.h", "EVIOCGMASK", _IOC_READ, 0x4592, 0x10 },
+{ "linux/input.h", "EVIOCGRAB", _IOC_WRITE, 0x4590, 0x04 },
+{ "linux/input.h", "EVIOCGREP", _IOC_READ, 0x4503, 0x08 },
+{ "linux/input.h", "EVIOCGVERSION", _IOC_READ, 0x4501, 0x04 },
+{ "linux/input.h", "EVIOCREVOKE", _IOC_WRITE, 0x4591, 0x04 },
+{ "linux/input.h", "EVIOCRMFF", _IOC_WRITE, 0x4581, 0x04 },
+{ "linux/input.h", "EVIOCSCLOCKID", _IOC_WRITE, 0x45a0, 0x04 },
+{ "linux/input.h", "EVIOCSFF", _IOC_WRITE, 0x4580, 0x28 },
+{ "linux/input.h", "EVIOCSKEYCODE", _IOC_WRITE, 0x4504, 0x08 },
+{ "linux/input.h", "EVIOCSKEYCODE_V2", _IOC_WRITE, 0x4504, 0x28 },
+{ "linux/input.h", "EVIOCSMASK", _IOC_WRITE, 0x4593, 0x10 },
+{ "linux/input.h", "EVIOCSREP", _IOC_WRITE, 0x4503, 0x08 },
+{ "linux/ipmi.h", "IPMICTL_GET_MAINTENANCE_MODE_CMD", _IOC_READ, 0x691e, 0x04 },
+{ "linux/ipmi.h", "IPMICTL_GET_MY_ADDRESS_CMD", _IOC_READ, 0x6912, 0x04 },
+{ "linux/ipmi.h", "IPMICTL_GET_MY_CHANNEL_ADDRESS_CMD", _IOC_READ, 0x6919, 0x04 },
+{ "linux/ipmi.h", "IPMICTL_GET_MY_CHANNEL_LUN_CMD", _IOC_READ, 0x691b, 0x04 },
+{ "linux/ipmi.h", "IPMICTL_GET_MY_LUN_CMD", _IOC_READ, 0x6914, 0x04 },
+{ "linux/ipmi.h", "IPMICTL_GET_TIMING_PARMS_CMD", _IOC_READ, 0x6917, 0x08 },
+{ "linux/ipmi.h", "IPMICTL_RECEIVE_MSG", _IOC_READ|_IOC_WRITE, 0x690c, 0x18 },
+{ "linux/ipmi.h", "IPMICTL_RECEIVE_MSG_TRUNC", _IOC_READ|_IOC_WRITE, 0x690b, 0x18 },
+{ "linux/ipmi.h", "IPMICTL_REGISTER_FOR_CMD", _IOC_READ, 0x690e, 0x02 },
+{ "linux/ipmi.h", "IPMICTL_REGISTER_FOR_CMD_CHANS", _IOC_READ, 0x691c, 0x0c },
+{ "linux/ipmi.h", "IPMICTL_SEND_COMMAND", _IOC_READ, 0x690d, 0x14 },
+{ "linux/ipmi.h", "IPMICTL_SEND_COMMAND_SETTIME", _IOC_READ, 0x6915, 0x1c },
+{ "linux/ipmi.h", "IPMICTL_SET_GETS_EVENTS_CMD", _IOC_READ, 0x6910, 0x04 },
+{ "linux/ipmi.h", "IPMICTL_SET_MAINTENANCE_MODE_CMD", _IOC_WRITE, 0x691f, 0x04 },
+{ "linux/ipmi.h", "IPMICTL_SET_MY_ADDRESS_CMD", _IOC_READ, 0x6911, 0x04 },
+{ "linux/ipmi.h", "IPMICTL_SET_MY_CHANNEL_ADDRESS_CMD", _IOC_READ, 0x6918, 0x04 },
+{ "linux/ipmi.h", "IPMICTL_SET_MY_CHANNEL_LUN_CMD", _IOC_READ, 0x691a, 0x04 },
+{ "linux/ipmi.h", "IPMICTL_SET_MY_LUN_CMD", _IOC_READ, 0x6913, 0x04 },
+{ "linux/ipmi.h", "IPMICTL_SET_TIMING_PARMS_CMD", _IOC_READ, 0x6916, 0x08 },
+{ "linux/ipmi.h", "IPMICTL_UNREGISTER_FOR_CMD", _IOC_READ, 0x690f, 0x02 },
+{ "linux/ipmi.h", "IPMICTL_UNREGISTER_FOR_CMD_CHANS", _IOC_READ, 0x691d, 0x0c },
+{ "linux/ipmi_bmc.h", "IPMI_BMC_IOCTL_CLEAR_SMS_ATN", _IOC_NONE, 0xb101, 0x00 },
+{ "linux/ipmi_bmc.h", "IPMI_BMC_IOCTL_FORCE_ABORT", _IOC_NONE, 0xb102, 0x00 },
+{ "linux/ipmi_bmc.h", "IPMI_BMC_IOCTL_SET_SMS_ATN", _IOC_NONE, 0xb100, 0x00 },
+{ "linux/isst_if.h", "ISST_IF_GET_PHY_ID", _IOC_READ|_IOC_WRITE, 0xfe01, 0x04 },
+{ "linux/isst_if.h", "ISST_IF_GET_PLATFORM_INFO", _IOC_READ, 0xfe00, 0x04 },
+{ "linux/isst_if.h", "ISST_IF_IO_CMD", _IOC_WRITE, 0xfe02, 0x04 },
+{ "linux/isst_if.h", "ISST_IF_MBOX_COMMAND", _IOC_READ|_IOC_WRITE, 0xfe03, 0x04 },
+{ "linux/isst_if.h", "ISST_IF_MSR_COMMAND", _IOC_READ|_IOC_WRITE, 0xfe04, 0x04 },
+{ "linux/ivtv.h", "IVTV_IOC_DMA_FRAME", _IOC_WRITE, 0x56c0, 0x38 },
+{ "linux/ivtv.h", "IVTV_IOC_PASSTHROUGH_MODE", _IOC_WRITE, 0x56c1, 0x04 },
+{ "linux/ivtvfb.h", "IVTVFB_IOC_DMA_FRAME", _IOC_WRITE, 0x56c0, 0x0c },
+{ "linux/joystick.h", "JSIOCGAXES", _IOC_READ, 0x6a11, 0x01 },
+{ "linux/joystick.h", "JSIOCGAXMAP", _IOC_READ, 0x6a32, 0x40 },
+{ "linux/joystick.h", "JSIOCGBTNMAP", _IOC_READ, 0x6a34, 0x400 },
+{ "linux/joystick.h", "JSIOCGBUTTONS", _IOC_READ, 0x6a12, 0x01 },
+{ "linux/joystick.h", "JSIOCGCORR", _IOC_READ, 0x6a22, 0x24 },
+{ "linux/joystick.h", "JSIOCGVERSION", _IOC_READ, 0x6a01, 0x04 },
+{ "linux/joystick.h", "JSIOCSAXMAP", _IOC_WRITE, 0x6a31, 0x40 },
+{ "linux/joystick.h", "JSIOCSBTNMAP", _IOC_WRITE, 0x6a33, 0x400 },
+{ "linux/joystick.h", "JSIOCSCORR", _IOC_WRITE, 0x6a21, 0x24 },
+{ "linux/kcov.h", "KCOV_DISABLE", _IOC_NONE, 0x6365, 0x00 },
+{ "linux/kcov.h", "KCOV_ENABLE", _IOC_NONE, 0x6364, 0x00 },
+{ "linux/kcov.h", "KCOV_INIT_TRACE", _IOC_READ, 0x6301, 0x04 },
+{ "linux/kcov.h", "KCOV_REMOTE_ENABLE", _IOC_WRITE, 0x6366, 0x18 },
+{ "linux/kd.h", "GIO_CMAP", 0, 0x4B70, 0 },
+{ "linux/kd.h", "GIO_FONT", 0, 0x4B60, 0 },
+{ "linux/kd.h", "GIO_FONTX", 0, 0x4B6B, 0 },
+{ "linux/kd.h", "GIO_SCRNMAP", 0, 0x4B40, 0 },
+{ "linux/kd.h", "GIO_UNIMAP", 0, 0x4B66, 0 },
+{ "linux/kd.h", "GIO_UNISCRNMAP", 0, 0x4B69, 0 },
+{ "linux/kd.h", "KDADDIO", 0, 0x4B34, 0 },
+{ "linux/kd.h", "KDDELIO", 0, 0x4B35, 0 },
+{ "linux/kd.h", "KDDISABIO", 0, 0x4B37, 0 },
+{ "linux/kd.h", "KDENABIO", 0, 0x4B36, 0 },
+{ "linux/kd.h", "KDFONTOP", 0, 0x4B72, 0 },
+{ "linux/kd.h", "KDGETKEYCODE", 0, 0x4B4C, 0 },
+{ "linux/kd.h", "KDGETLED", 0, 0x4B31, 0 },
+{ "linux/kd.h", "KDGETMODE", 0, 0x4B3B, 0 },
+{ "linux/kd.h", "KDGKBDIACR", 0, 0x4B4A, 0 },
+{ "linux/kd.h", "KDGKBDIACRUC", 0, 0x4BFA, 0 },
+{ "linux/kd.h", "KDGKBENT", 0, 0x4B46, 0 },
+{ "linux/kd.h", "KDGKBLED", 0, 0x4B64, 0 },
+{ "linux/kd.h", "KDGKBMETA", 0, 0x4B62, 0 },
+{ "linux/kd.h", "KDGKBMODE", 0, 0x4B44, 0 },
+{ "linux/kd.h", "KDGKBSENT", 0, 0x4B48, 0 },
+{ "linux/kd.h", "KDGKBTYPE", 0, 0x4B33, 0 },
+{ "linux/kd.h", "KDKBDREP", 0, 0x4B52, 0 },
+{ "linux/kd.h", "KDMAPDISP", 0, 0x4B3C, 0 },
+{ "linux/kd.h", "KDMKTONE", 0, 0x4B30, 0 },
+{ "linux/kd.h", "KDSETKEYCODE", 0, 0x4B4D, 0 },
+{ "linux/kd.h", "KDSETLED", 0, 0x4B32, 0 },
+{ "linux/kd.h", "KDSETMODE", 0, 0x4B3A, 0 },
+{ "linux/kd.h", "KDSIGACCEPT", 0, 0x4B4E, 0 },
+{ "linux/kd.h", "KDSKBDIACR", 0, 0x4B4B, 0 },
+{ "linux/kd.h", "KDSKBDIACRUC", 0, 0x4BFB, 0 },
+{ "linux/kd.h", "KDSKBENT", 0, 0x4B47, 0 },
+{ "linux/kd.h", "KDSKBLED", 0, 0x4B65, 0 },
+{ "linux/kd.h", "KDSKBMETA", 0, 0x4B63, 0 },
+{ "linux/kd.h", "KDSKBMODE", 0, 0x4B45, 0 },
+{ "linux/kd.h", "KDSKBSENT", 0, 0x4B49, 0 },
+{ "linux/kd.h", "KDUNMAPDISP", 0, 0x4B3D, 0 },
+{ "linux/kd.h", "KIOCSOUND", 0, 0x4B2F, 0 },
+{ "linux/kd.h", "PIO_CMAP", 0, 0x4B71, 0 },
+{ "linux/kd.h", "PIO_FONT", 0, 0x4B61, 0 },
+{ "linux/kd.h", "PIO_FONTRESET", 0, 0x4B6D, 0 },
+{ "linux/kd.h", "PIO_FONTX", 0, 0x4B6C, 0 },
+{ "linux/kd.h", "PIO_SCRNMAP", 0, 0x4B41, 0 },
+{ "linux/kd.h", "PIO_UNIMAP", 0, 0x4B67, 0 },
+{ "linux/kd.h", "PIO_UNIMAPCLR", 0, 0x4B68, 0 },
+{ "linux/kd.h", "PIO_UNISCRNMAP", 0, 0x4B6A, 0 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_ACQUIRE_VM", _IOC_WRITE, 0x4b15, 0x08 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_ALLOC_MEMORY_OF_GPU", _IOC_READ|_IOC_WRITE, 0x4b16, 0x28 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_ALLOC_QUEUE_GWS", _IOC_READ|_IOC_WRITE, 0x4b1e, 0x10 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_CREATE_EVENT", _IOC_READ|_IOC_WRITE, 0x4b08, 0x20 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_CREATE_QUEUE", _IOC_READ|_IOC_WRITE, 0x4b02, 0x58 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_DBG_ADDRESS_WATCH", _IOC_WRITE, 0x4b0f, 0x10 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_DBG_REGISTER", _IOC_WRITE, 0x4b0d, 0x08 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_DBG_UNREGISTER", _IOC_WRITE, 0x4b0e, 0x08 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_DBG_WAVE_CONTROL", _IOC_WRITE, 0x4b10, 0x10 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_DESTROY_EVENT", _IOC_WRITE, 0x4b09, 0x08 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_DESTROY_QUEUE", _IOC_READ|_IOC_WRITE, 0x4b03, 0x08 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_FREE_MEMORY_OF_GPU", _IOC_WRITE, 0x4b17, 0x08 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_CLOCK_COUNTERS", _IOC_READ|_IOC_WRITE, 0x4b05, 0x28 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_DMABUF_INFO", _IOC_READ|_IOC_WRITE, 0x4b1c, 0x20 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_PROCESS_APERTURES", _IOC_READ, 0x4b06, 0x190 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_PROCESS_APERTURES_NEW", _IOC_READ|_IOC_WRITE, 0x4b14, 0x10 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_QUEUE_WAVE_STATE", _IOC_READ|_IOC_WRITE, 0x4b1b, 0x18 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_TILE_CONFIG", _IOC_READ|_IOC_WRITE, 0x4b12, 0x28 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_VERSION", _IOC_READ, 0x4b01, 0x08 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_IMPORT_DMABUF", _IOC_READ|_IOC_WRITE, 0x4b1d, 0x18 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_MAP_MEMORY_TO_GPU", _IOC_READ|_IOC_WRITE, 0x4b18, 0x18 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_RESET_EVENT", _IOC_WRITE, 0x4b0b, 0x08 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_SET_CU_MASK", _IOC_WRITE, 0x4b1a, 0x10 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_SET_EVENT", _IOC_WRITE, 0x4b0a, 0x08 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_SET_MEMORY_POLICY", _IOC_WRITE, 0x4b04, 0x20 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_SET_SCRATCH_BACKING_VA", _IOC_READ|_IOC_WRITE, 0x4b11, 0x10 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_SET_TRAP_HANDLER", _IOC_WRITE, 0x4b13, 0x18 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_SMI_EVENTS", _IOC_READ|_IOC_WRITE, 0x4b1f, 0x08 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_UNMAP_MEMORY_FROM_GPU", _IOC_READ|_IOC_WRITE, 0x4b19, 0x18 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_UPDATE_QUEUE", _IOC_WRITE, 0x4b07, 0x18 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_WAIT_EVENTS", _IOC_READ|_IOC_WRITE, 0x4b0c, 0x18 },
+{ "linux/lightnvm.h", "NVME_NVM_IOCTL_ADMIN_VIO", _IOC_READ|_IOC_WRITE, 0x4c41, 0x50 },
+{ "linux/lightnvm.h", "NVME_NVM_IOCTL_IO_VIO", _IOC_READ|_IOC_WRITE, 0x4c43, 0x50 },
+{ "linux/lightnvm.h", "NVME_NVM_IOCTL_SUBMIT_VIO", _IOC_READ|_IOC_WRITE, 0x4c42, 0x40 },
+{ "linux/lightnvm.h", "NVM_DEV_CREATE", _IOC_WRITE, 0x4c22, 0x80 },
+{ "linux/lightnvm.h", "NVM_DEV_FACTORY", _IOC_WRITE, 0x4c25, 0x24 },
+{ "linux/lightnvm.h", "NVM_DEV_INIT", _IOC_WRITE, 0x4c24, 0x2c },
+{ "linux/lightnvm.h", "NVM_DEV_REMOVE", _IOC_WRITE, 0x4c23, 0x24 },
+{ "linux/lightnvm.h", "NVM_GET_DEVICES", _IOC_READ, 0x4c21, 0x1000 },
+{ "linux/lightnvm.h", "NVM_INFO", _IOC_READ|_IOC_WRITE, 0x4c20, 0x1000 },
+{ "linux/lirc.h", "LIRC_GET_FEATURES", _IOC_READ, 0x6900, 0x04 },
+{ "linux/lirc.h", "LIRC_GET_LENGTH", _IOC_READ, 0x690f, 0x04 },
+{ "linux/lirc.h", "LIRC_GET_MAX_TIMEOUT", _IOC_READ, 0x6909, 0x04 },
+{ "linux/lirc.h", "LIRC_GET_MIN_TIMEOUT", _IOC_READ, 0x6908, 0x04 },
+{ "linux/lirc.h", "LIRC_GET_REC_MODE", _IOC_READ, 0x6902, 0x04 },
+{ "linux/lirc.h", "LIRC_GET_REC_RESOLUTION", _IOC_READ, 0x6907, 0x04 },
+{ "linux/lirc.h", "LIRC_GET_REC_TIMEOUT", _IOC_READ, 0x6924, 0x04 },
+{ "linux/lirc.h", "LIRC_GET_SEND_MODE", _IOC_READ, 0x6901, 0x04 },
+{ "linux/lirc.h", "LIRC_SET_MEASURE_CARRIER_MODE", _IOC_WRITE, 0x691d, 0x04 },
+{ "linux/lirc.h", "LIRC_SET_REC_CARRIER", _IOC_WRITE, 0x6914, 0x04 },
+{ "linux/lirc.h", "LIRC_SET_REC_CARRIER_RANGE", _IOC_WRITE, 0x691f, 0x04 },
+{ "linux/lirc.h", "LIRC_SET_REC_MODE", _IOC_WRITE, 0x6912, 0x04 },
+{ "linux/lirc.h", "LIRC_SET_REC_TIMEOUT", _IOC_WRITE, 0x6918, 0x04 },
+{ "linux/lirc.h", "LIRC_SET_REC_TIMEOUT_REPORTS", _IOC_WRITE, 0x6919, 0x04 },
+{ "linux/lirc.h", "LIRC_SET_SEND_CARRIER", _IOC_WRITE, 0x6913, 0x04 },
+{ "linux/lirc.h", "LIRC_SET_SEND_DUTY_CYCLE", _IOC_WRITE, 0x6915, 0x04 },
+{ "linux/lirc.h", "LIRC_SET_SEND_MODE", _IOC_WRITE, 0x6911, 0x04 },
+{ "linux/lirc.h", "LIRC_SET_TRANSMITTER_MASK", _IOC_WRITE, 0x6917, 0x04 },
+{ "linux/lirc.h", "LIRC_SET_WIDEBAND_RECEIVER", _IOC_WRITE, 0x6923, 0x04 },
+{ "linux/loop.h", "LOOP_CHANGE_FD", 0, 0x4C06, 0 },
+{ "linux/loop.h", "LOOP_CLR_FD", 0, 0x4C01, 0 },
+{ "linux/loop.h", "LOOP_CONFIGURE", 0, 0x4C0A, 0 },
+{ "linux/loop.h", "LOOP_CTL_ADD", 0, 0x4C80, 0 },
+{ "linux/loop.h", "LOOP_CTL_GET_FREE", 0, 0x4C82, 0 },
+{ "linux/loop.h", "LOOP_CTL_REMOVE", 0, 0x4C81, 0 },
+{ "linux/loop.h", "LOOP_GET_STATUS", 0, 0x4C03, 0 },
+{ "linux/loop.h", "LOOP_GET_STATUS64", 0, 0x4C05, 0 },
+{ "linux/loop.h", "LOOP_SET_BLOCK_SIZE", 0, 0x4C09, 0 },
+{ "linux/loop.h", "LOOP_SET_CAPACITY", 0, 0x4C07, 0 },
+{ "linux/loop.h", "LOOP_SET_DIRECT_IO", 0, 0x4C08, 0 },
+{ "linux/loop.h", "LOOP_SET_FD", 0, 0x4C00, 0 },
+{ "linux/loop.h", "LOOP_SET_STATUS", 0, 0x4C02, 0 },
+{ "linux/loop.h", "LOOP_SET_STATUS64", 0, 0x4C04, 0 },
+{ "linux/lp.h", "LPSETTIMEOUT_NEW", _IOC_WRITE, 0x060f, 0x10 },
+{ "linux/mISDNif.h", "IMADDTIMER", _IOC_READ, 0x4940, 0x04 },
+{ "linux/mISDNif.h", "IMCLEAR_L2", _IOC_READ, 0x4946, 0x04 },
+{ "linux/mISDNif.h", "IMCTRLREQ", _IOC_READ, 0x4945, 0x04 },
+{ "linux/mISDNif.h", "IMDELTIMER", _IOC_READ, 0x4941, 0x04 },
+{ "linux/mISDNif.h", "IMGETCOUNT", _IOC_READ, 0x4943, 0x04 },
+{ "linux/mISDNif.h", "IMGETDEVINFO", _IOC_READ, 0x4944, 0x04 },
+{ "linux/mISDNif.h", "IMGETVERSION", _IOC_READ, 0x4942, 0x04 },
+{ "linux/mISDNif.h", "IMHOLD_L1", _IOC_READ, 0x4948, 0x04 },
+{ "linux/mISDNif.h", "IMSETDEVNAME", _IOC_READ, 0x4947, 0x18 },
+{ "linux/matroxfb.h", "MATROXFB_GET_ALL_OUTPUTS", _IOC_READ, 0x6efb, 0x04 },
+{ "linux/matroxfb.h", "MATROXFB_GET_AVAILABLE_OUTPUTS", _IOC_READ, 0x6ef9, 0x04 },
+{ "linux/matroxfb.h", "MATROXFB_GET_OUTPUT_CONNECTION", _IOC_READ, 0x6ef8, 0x04 },
+{ "linux/matroxfb.h", "MATROXFB_GET_OUTPUT_MODE", _IOC_READ|_IOC_WRITE, 0x6efa, 0x04 },
+{ "linux/matroxfb.h", "MATROXFB_SET_OUTPUT_CONNECTION", _IOC_WRITE, 0x6ef8, 0x04 },
+{ "linux/matroxfb.h", "MATROXFB_SET_OUTPUT_MODE", _IOC_WRITE, 0x6efa, 0x04 },
+{ "linux/media.h", "MEDIA_IOC_DEVICE_INFO", _IOC_READ|_IOC_WRITE, 0x7c00, 0x100 },
+{ "linux/media.h", "MEDIA_IOC_ENUM_ENTITIES", _IOC_READ|_IOC_WRITE, 0x7c01, 0x100 },
+{ "linux/media.h", "MEDIA_IOC_ENUM_LINKS", _IOC_READ|_IOC_WRITE, 0x7c02, 0x1c },
+{ "linux/media.h", "MEDIA_IOC_G_TOPOLOGY", _IOC_READ|_IOC_WRITE, 0x7c04, 0x48 },
+{ "linux/media.h", "MEDIA_IOC_REQUEST_ALLOC", _IOC_READ, 0x7c05, 0x04 },
+{ "linux/media.h", "MEDIA_IOC_SETUP_LINK", _IOC_READ|_IOC_WRITE, 0x7c03, 0x30 },
+{ "linux/media.h", "MEDIA_REQUEST_IOC_QUEUE", _IOC_NONE, 0x7c80, 0x00 },
+{ "linux/media.h", "MEDIA_REQUEST_IOC_REINIT", _IOC_NONE, 0x7c81, 0x00 },
+{ "linux/mei.h", "IOCTL_MEI_CONNECT_CLIENT", _IOC_READ|_IOC_WRITE, 0x4801, 0x10 },
+{ "linux/mei.h", "IOCTL_MEI_CONNECT_CLIENT_VTAG", _IOC_READ|_IOC_WRITE, 0x4804, 0x14 },
+{ "linux/mei.h", "IOCTL_MEI_NOTIFY_GET", _IOC_READ, 0x4803, 0x04 },
+{ "linux/mei.h", "IOCTL_MEI_NOTIFY_SET", _IOC_WRITE, 0x4802, 0x04 },
+{ "linux/meye.h", "MEYEIOC_G_PARAMS", _IOC_READ, 0x76c0, 0x06 },
+{ "linux/meye.h", "MEYEIOC_QBUF_CAPT", _IOC_WRITE, 0x76c2, 0x04 },
+{ "linux/meye.h", "MEYEIOC_STILLCAPT", _IOC_NONE, 0x76c4, 0x00 },
+{ "linux/meye.h", "MEYEIOC_STILLJCAPT", _IOC_READ, 0x76c5, 0x04 },
+{ "linux/meye.h", "MEYEIOC_SYNC", _IOC_READ|_IOC_WRITE, 0x76c3, 0x04 },
+{ "linux/meye.h", "MEYEIOC_S_PARAMS", _IOC_WRITE, 0x76c1, 0x06 },
+{ "linux/mmc/ioctl.h", "MMC_IOC_CMD", _IOC_READ|_IOC_WRITE, 0xb300, 0x48 },
+{ "linux/mmc/ioctl.h", "MMC_IOC_MULTI_CMD", _IOC_READ|_IOC_WRITE, 0xb301, 0x08 },
+{ "linux/mmtimer.h", "MMTIMER_GETBITS", _IOC_NONE, 0x6d04, 0x00 },
+{ "linux/mmtimer.h", "MMTIMER_GETCOUNTER", _IOC_READ, 0x6d09, 0x04 },
+{ "linux/mmtimer.h", "MMTIMER_GETFREQ", _IOC_READ, 0x6d02, 0x04 },
+{ "linux/mmtimer.h", "MMTIMER_GETOFFSET", _IOC_NONE, 0x6d00, 0x00 },
+{ "linux/mmtimer.h", "MMTIMER_GETRES", _IOC_READ, 0x6d01, 0x04 },
+{ "linux/mmtimer.h", "MMTIMER_MMAPAVAIL", _IOC_NONE, 0x6d06, 0x00 },
+{ "linux/msdos_fs.h", "FAT_IOCTL_GET_ATTRIBUTES", _IOC_READ, 0x7210, 0x04 },
+{ "linux/msdos_fs.h", "FAT_IOCTL_GET_VOLUME_ID", _IOC_READ, 0x7213, 0x04 },
+{ "linux/msdos_fs.h", "FAT_IOCTL_SET_ATTRIBUTES", _IOC_WRITE, 0x7211, 0x04 },
+{ "linux/msdos_fs.h", "VFAT_IOCTL_READDIR_BOTH", _IOC_READ, 0x7201, 0x214 },
+{ "linux/msdos_fs.h", "VFAT_IOCTL_READDIR_SHORT", _IOC_READ, 0x7202, 0x214 },
+{ "linux/mtio.h", "MTIOCGET", _IOC_READ, 0x6d02, 0x1c },
+{ "linux/mtio.h", "MTIOCPOS", _IOC_READ, 0x6d03, 0x04 },
+{ "linux/mtio.h", "MTIOCTOP", _IOC_WRITE, 0x6d01, 0x06 },
+{ "linux/nbd.h", "NBD_CLEAR_QUE", _IOC_NONE, 0xab05, 0x00 },
+{ "linux/nbd.h", "NBD_CLEAR_SOCK", _IOC_NONE, 0xab04, 0x00 },
+{ "linux/nbd.h", "NBD_DISCONNECT", _IOC_NONE, 0xab08, 0x00 },
+{ "linux/nbd.h", "NBD_DO_IT", _IOC_NONE, 0xab03, 0x00 },
+{ "linux/nbd.h", "NBD_PRINT_DEBUG", _IOC_NONE, 0xab06, 0x00 },
+{ "linux/nbd.h", "NBD_SET_BLKSIZE", _IOC_NONE, 0xab01, 0x00 },
+{ "linux/nbd.h", "NBD_SET_FLAGS", _IOC_NONE, 0xab0a, 0x00 },
+{ "linux/nbd.h", "NBD_SET_SIZE", _IOC_NONE, 0xab02, 0x00 },
+{ "linux/nbd.h", "NBD_SET_SIZE_BLOCKS", _IOC_NONE, 0xab07, 0x00 },
+{ "linux/nbd.h", "NBD_SET_SOCK", _IOC_NONE, 0xab00, 0x00 },
+{ "linux/nbd.h", "NBD_SET_TIMEOUT", _IOC_NONE, 0xab09, 0x00 },
+{ "linux/ndctl.h", "ND_IOCTL_ARS_CAP", _IOC_READ|_IOC_WRITE, 0x4e01, 0x20 },
+{ "linux/ndctl.h", "ND_IOCTL_ARS_START", _IOC_READ|_IOC_WRITE, 0x4e02, 0x20 },
+{ "linux/ndctl.h", "ND_IOCTL_ARS_STATUS", _IOC_READ|_IOC_WRITE, 0x4e03, 0x30 },
+{ "linux/ndctl.h", "ND_IOCTL_CALL", _IOC_READ|_IOC_WRITE, 0x4e0a, 0x40 },
+{ "linux/ndctl.h", "ND_IOCTL_CLEAR_ERROR", _IOC_READ|_IOC_WRITE, 0x4e04, 0x20 },
+{ "linux/ndctl.h", "ND_IOCTL_DIMM_FLAGS", _IOC_READ|_IOC_WRITE, 0x4e03, 0x08 },
+{ "linux/ndctl.h", "ND_IOCTL_GET_CONFIG_DATA", _IOC_READ|_IOC_WRITE, 0x4e05, 0x0c },
+{ "linux/ndctl.h", "ND_IOCTL_GET_CONFIG_SIZE", _IOC_READ|_IOC_WRITE, 0x4e04, 0x0c },
+{ "linux/ndctl.h", "ND_IOCTL_SET_CONFIG_DATA", _IOC_READ|_IOC_WRITE, 0x4e06, 0x08 },
+{ "linux/ndctl.h", "ND_IOCTL_VENDOR", _IOC_READ|_IOC_WRITE, 0x4e09, 0x08 },
+{ "linux/nilfs2_api.h", "NILFS_IOCTL_CHANGE_CPMODE", _IOC_WRITE, 0x6e80, 0x10 },
+{ "linux/nilfs2_api.h", "NILFS_IOCTL_CLEAN_SEGMENTS", _IOC_WRITE, 0x6e88, 0x78 },
+{ "linux/nilfs2_api.h", "NILFS_IOCTL_DELETE_CHECKPOINT", _IOC_WRITE, 0x6e81, 0x08 },
+{ "linux/nilfs2_api.h", "NILFS_IOCTL_GET_BDESCS", _IOC_READ|_IOC_WRITE, 0x6e87, 0x18 },
+{ "linux/nilfs2_api.h", "NILFS_IOCTL_GET_CPINFO", _IOC_READ, 0x6e82, 0x18 },
+{ "linux/nilfs2_api.h", "NILFS_IOCTL_GET_CPSTAT", _IOC_READ, 0x6e83, 0x18 },
+{ "linux/nilfs2_api.h", "NILFS_IOCTL_GET_SUINFO", _IOC_READ, 0x6e84, 0x18 },
+{ "linux/nilfs2_api.h", "NILFS_IOCTL_GET_SUSTAT", _IOC_READ, 0x6e85, 0x30 },
+{ "linux/nilfs2_api.h", "NILFS_IOCTL_GET_VINFO", _IOC_READ|_IOC_WRITE, 0x6e86, 0x18 },
+{ "linux/nilfs2_api.h", "NILFS_IOCTL_RESIZE", _IOC_WRITE, 0x6e8b, 0x08 },
+{ "linux/nilfs2_api.h", "NILFS_IOCTL_SET_ALLOC_RANGE", _IOC_WRITE, 0x6e8c, 0x10 },
+{ "linux/nilfs2_api.h", "NILFS_IOCTL_SET_SUINFO", _IOC_WRITE, 0x6e8d, 0x18 },
+{ "linux/nilfs2_api.h", "NILFS_IOCTL_SYNC", _IOC_READ, 0x6e8a, 0x08 },
+{ "linux/nitro_enclaves.h", "NE_ADD_VCPU", _IOC_READ|_IOC_WRITE, 0xae21, 0x04 },
+{ "linux/nitro_enclaves.h", "NE_CREATE_VM", _IOC_READ, 0xae20, 0x08 },
+{ "linux/nitro_enclaves.h", "NE_GET_IMAGE_LOAD_INFO", _IOC_READ|_IOC_WRITE, 0xae22, 0x10 },
+{ "linux/nitro_enclaves.h", "NE_SET_USER_MEMORY_REGION", _IOC_WRITE, 0xae23, 0x18 },
+{ "linux/nitro_enclaves.h", "NE_START_ENCLAVE", _IOC_READ|_IOC_WRITE, 0xae24, 0x10 },
+{ "linux/nsfs.h", "NS_GET_NSTYPE", _IOC_NONE, 0xb703, 0x00 },
+{ "linux/nsfs.h", "NS_GET_OWNER_UID", _IOC_NONE, 0xb704, 0x00 },
+{ "linux/nsfs.h", "NS_GET_PARENT", _IOC_NONE, 0xb702, 0x00 },
+{ "linux/nsfs.h", "NS_GET_USERNS", _IOC_NONE, 0xb701, 0x00 },
+{ "linux/nvme_ioctl.h", "NVME_IOCTL_ADMIN64_CMD", _IOC_READ|_IOC_WRITE, 0x4e47, 0x50 },
+{ "linux/nvme_ioctl.h", "NVME_IOCTL_ADMIN_CMD", _IOC_READ|_IOC_WRITE, 0x4e41, 0x48 },
+{ "linux/nvme_ioctl.h", "NVME_IOCTL_ID", _IOC_NONE, 0x4e40, 0x00 },
+{ "linux/nvme_ioctl.h", "NVME_IOCTL_IO64_CMD", _IOC_READ|_IOC_WRITE, 0x4e48, 0x50 },
+{ "linux/nvme_ioctl.h", "NVME_IOCTL_IO_CMD", _IOC_READ|_IOC_WRITE, 0x4e43, 0x48 },
+{ "linux/nvme_ioctl.h", "NVME_IOCTL_RESCAN", _IOC_NONE, 0x4e46, 0x00 },
+{ "linux/nvme_ioctl.h", "NVME_IOCTL_RESET", _IOC_NONE, 0x4e44, 0x00 },
+{ "linux/nvme_ioctl.h", "NVME_IOCTL_SUBMIT_IO", _IOC_WRITE, 0x4e42, 0x2c },
+{ "linux/nvme_ioctl.h", "NVME_IOCTL_SUBSYS_RESET", _IOC_NONE, 0x4e45, 0x00 },
+{ "linux/nvram.h", "NVRAM_INIT", _IOC_NONE, 0x7040, 0x00 },
+{ "linux/nvram.h", "NVRAM_SETCKS", _IOC_NONE, 0x7041, 0x00 },
+{ "linux/omap3isp.h", "VIDIOC_OMAP3ISP_AEWB_CFG", _IOC_READ|_IOC_WRITE, 0x56c3, 0x1e },
+{ "linux/omap3isp.h", "VIDIOC_OMAP3ISP_AF_CFG", _IOC_READ|_IOC_WRITE, 0x56c5, 0x4a },
+{ "linux/omap3isp.h", "VIDIOC_OMAP3ISP_CCDC_CFG", _IOC_READ|_IOC_WRITE, 0x56c1, 0x20 },
+{ "linux/omap3isp.h", "VIDIOC_OMAP3ISP_HIST_CFG", _IOC_READ|_IOC_WRITE, 0x56c4, 0x30 },
+{ "linux/omap3isp.h", "VIDIOC_OMAP3ISP_PRV_CFG", _IOC_READ|_IOC_WRITE, 0x56c2, 0x3c },
+{ "linux/omap3isp.h", "VIDIOC_OMAP3ISP_STAT_EN", _IOC_READ|_IOC_WRITE, 0x56c7, 0x04 },
+{ "linux/omap3isp.h", "VIDIOC_OMAP3ISP_STAT_REQ_TIME32", _IOC_READ|_IOC_WRITE, 0x56c6, 0x16 },
+{ "linux/omapfb.h", "OMAPFB_CTRL_TEST", _IOC_WRITE, 0x4f2e, 0x04 },
+{ "linux/omapfb.h", "OMAPFB_GET_CAPS", _IOC_READ, 0x4f2a, 0x0c },
+{ "linux/omapfb.h", "OMAPFB_GET_COLOR_KEY", _IOC_WRITE, 0x4f33, 0x0c },
+{ "linux/omapfb.h", "OMAPFB_GET_DISPLAY_INFO", _IOC_READ, 0x4f3f, 0x20 },
+{ "linux/omapfb.h", "OMAPFB_GET_OVERLAY_COLORMODE", _IOC_READ, 0x4f3b, 0x3a },
+{ "linux/omapfb.h", "OMAPFB_GET_UPDATE_MODE", _IOC_WRITE, 0x4f2b, 0x04 },
+{ "linux/omapfb.h", "OMAPFB_GET_VRAM_INFO", _IOC_READ, 0x4f3d, 0x20 },
+{ "linux/omapfb.h", "OMAPFB_LCD_TEST", _IOC_WRITE, 0x4f2d, 0x04 },
+{ "linux/omapfb.h", "OMAPFB_MEMORY_READ", _IOC_READ, 0x4f3a, 0x10 },
+{ "linux/omapfb.h", "OMAPFB_MIRROR", _IOC_WRITE, 0x4f1f, 0x04 },
+{ "linux/omapfb.h", "OMAPFB_QUERY_MEM", _IOC_WRITE, 0x4f38, 0x08 },
+{ "linux/omapfb.h", "OMAPFB_QUERY_PLANE", _IOC_WRITE, 0x4f35, 0x44 },
+{ "linux/omapfb.h", "OMAPFB_SETUP_MEM", _IOC_WRITE, 0x4f37, 0x08 },
+{ "linux/omapfb.h", "OMAPFB_SETUP_PLANE", _IOC_WRITE, 0x4f34, 0x44 },
+{ "linux/omapfb.h", "OMAPFB_SET_COLOR_KEY", _IOC_WRITE, 0x4f32, 0x0c },
+{ "linux/omapfb.h", "OMAPFB_SET_TEARSYNC", _IOC_WRITE, 0x4f3e, 0x08 },
+{ "linux/omapfb.h", "OMAPFB_SET_UPDATE_MODE", _IOC_WRITE, 0x4f28, 0x04 },
+{ "linux/omapfb.h", "OMAPFB_SYNC_GFX", _IOC_NONE, 0x4f25, 0x00 },
+{ "linux/omapfb.h", "OMAPFB_UPDATE_WINDOW", _IOC_WRITE, 0x4f36, 0x44 },
+{ "linux/omapfb.h", "OMAPFB_UPDATE_WINDOW_OLD", _IOC_WRITE, 0x4f2f, 0x14 },
+{ "linux/omapfb.h", "OMAPFB_VSYNC", _IOC_NONE, 0x4f26, 0x00 },
+{ "linux/omapfb.h", "OMAPFB_WAITFORGO", _IOC_NONE, 0x4f3c, 0x00 },
+{ "linux/omapfb.h", "OMAPFB_WAITFORVSYNC", _IOC_NONE, 0x4f39, 0x00 },
+{ "linux/pcitest.h", "PCITEST_BAR", _IOC_NONE, 0x5001, 0x00 },
+{ "linux/pcitest.h", "PCITEST_CLEAR_IRQ", _IOC_NONE, 0x5010, 0x00 },
+{ "linux/pcitest.h", "PCITEST_COPY", _IOC_WRITE, 0x5006, 0x04 },
+{ "linux/pcitest.h", "PCITEST_GET_IRQTYPE", _IOC_NONE, 0x5009, 0x00 },
+{ "linux/pcitest.h", "PCITEST_LEGACY_IRQ", _IOC_NONE, 0x5002, 0x00 },
+{ "linux/pcitest.h", "PCITEST_MSI", _IOC_WRITE, 0x5003, 0x04 },
+{ "linux/pcitest.h", "PCITEST_MSIX", _IOC_WRITE, 0x5007, 0x04 },
+{ "linux/pcitest.h", "PCITEST_READ", _IOC_WRITE, 0x5005, 0x04 },
+{ "linux/pcitest.h", "PCITEST_SET_IRQTYPE", _IOC_WRITE, 0x5008, 0x04 },
+{ "linux/pcitest.h", "PCITEST_WRITE", _IOC_WRITE, 0x5004, 0x04 },
+{ "linux/perf_event.h", "PERF_EVENT_IOC_DISABLE", _IOC_NONE, 0x2401, 0x00 },
+{ "linux/perf_event.h", "PERF_EVENT_IOC_ENABLE", _IOC_NONE, 0x2400, 0x00 },
+{ "linux/perf_event.h", "PERF_EVENT_IOC_ID", _IOC_READ, 0x2407, 0x04 },
+{ "linux/perf_event.h", "PERF_EVENT_IOC_MODIFY_ATTRIBUTES", _IOC_WRITE, 0x240b, 0x04 },
+{ "linux/perf_event.h", "PERF_EVENT_IOC_PAUSE_OUTPUT", _IOC_WRITE, 0x2409, 0x04 },
+{ "linux/perf_event.h", "PERF_EVENT_IOC_PERIOD", _IOC_WRITE, 0x2404, 0x08 },
+{ "linux/perf_event.h", "PERF_EVENT_IOC_QUERY_BPF", _IOC_READ|_IOC_WRITE, 0x240a, 0x04 },
+{ "linux/perf_event.h", "PERF_EVENT_IOC_REFRESH", _IOC_NONE, 0x2402, 0x00 },
+{ "linux/perf_event.h", "PERF_EVENT_IOC_RESET", _IOC_NONE, 0x2403, 0x00 },
+{ "linux/perf_event.h", "PERF_EVENT_IOC_SET_BPF", _IOC_WRITE, 0x2408, 0x04 },
+{ "linux/perf_event.h", "PERF_EVENT_IOC_SET_FILTER", _IOC_WRITE, 0x2406, 0x04 },
+{ "linux/perf_event.h", "PERF_EVENT_IOC_SET_OUTPUT", _IOC_NONE, 0x2405, 0x00 },
+{ "linux/phantom.h", "PHN_GETREG", _IOC_READ|_IOC_WRITE, 0x7005, 0x08 },
+{ "linux/phantom.h", "PHN_GETREGS", _IOC_READ|_IOC_WRITE, 0x7007, 0x28 },
+{ "linux/phantom.h", "PHN_GET_REG", _IOC_READ|_IOC_WRITE, 0x7000, 0x04 },
+{ "linux/phantom.h", "PHN_GET_REGS", _IOC_READ|_IOC_WRITE, 0x7002, 0x04 },
+{ "linux/phantom.h", "PHN_NOT_OH", _IOC_NONE, 0x7004, 0x00 },
+{ "linux/phantom.h", "PHN_SETREG", _IOC_WRITE, 0x7006, 0x08 },
+{ "linux/phantom.h", "PHN_SETREGS", _IOC_WRITE, 0x7008, 0x28 },
+{ "linux/phantom.h", "PHN_SET_REG", _IOC_WRITE, 0x7001, 0x04 },
+{ "linux/phantom.h", "PHN_SET_REGS", _IOC_WRITE, 0x7003, 0x04 },
+{ "linux/pktcdvd.h", "PACKET_CTRL_CMD", _IOC_READ|_IOC_WRITE, 0x5801, 0x18 },
+{ "linux/platform_data/cros_ec_chardev.h", "CROS_EC_DEV_IOCEVENTMASK", _IOC_NONE, 0xec02, 0x00 },
+{ "linux/platform_data/cros_ec_chardev.h", "CROS_EC_DEV_IOCRDMEM", _IOC_READ|_IOC_WRITE, 0xec01, 0x108 },
+{ "linux/platform_data/cros_ec_chardev.h", "CROS_EC_DEV_IOCXCMD", _IOC_READ|_IOC_WRITE, 0xec00, 0x14 },
+{ "linux/platform_data/media/si4713.h", "SI4713_IOC_MEASURE_RNL", _IOC_READ|_IOC_WRITE, 0x56c0, 0x1c },
+{ "linux/pmu.h", "PMU_IOC_CAN_SLEEP", _IOC_READ, 0x4205, 0x04 },
+{ "linux/pmu.h", "PMU_IOC_GET_BACKLIGHT", _IOC_READ, 0x4201, 0x04 },
+{ "linux/pmu.h", "PMU_IOC_GET_MODEL", _IOC_READ, 0x4203, 0x04 },
+{ "linux/pmu.h", "PMU_IOC_GRAB_BACKLIGHT", _IOC_READ, 0x4206, 0x04 },
+{ "linux/pmu.h", "PMU_IOC_HAS_ADB", _IOC_READ, 0x4204, 0x04 },
+{ "linux/pmu.h", "PMU_IOC_SET_BACKLIGHT", _IOC_WRITE, 0x4202, 0x04 },
+{ "linux/pmu.h", "PMU_IOC_SLEEP", _IOC_NONE, 0x4200, 0x00 },
+{ "linux/ppdev.h", "PPCLAIM", _IOC_NONE, 0x708b, 0x00 },
+{ "linux/ppdev.h", "PPCLRIRQ", _IOC_READ, 0x7093, 0x04 },
+{ "linux/ppdev.h", "PPDATADIR", _IOC_WRITE, 0x7090, 0x04 },
+{ "linux/ppdev.h", "PPEXCL", _IOC_NONE, 0x708f, 0x00 },
+{ "linux/ppdev.h", "PPFCONTROL", _IOC_WRITE, 0x708e, 0x02 },
+{ "linux/ppdev.h", "PPGETFLAGS", _IOC_READ, 0x709a, 0x04 },
+{ "linux/ppdev.h", "PPGETMODE", _IOC_READ, 0x7098, 0x04 },
+{ "linux/ppdev.h", "PPGETMODES", _IOC_READ, 0x7097, 0x04 },
+{ "linux/ppdev.h", "PPGETPHASE", _IOC_READ, 0x7099, 0x04 },
+{ "linux/ppdev.h", "PPGETTIME", _IOC_READ, 0x7095, 0x08 },
+{ "linux/ppdev.h", "PPNEGOT", _IOC_WRITE, 0x7091, 0x04 },
+{ "linux/ppdev.h", "PPRCONTROL", _IOC_READ, 0x7083, 0x01 },
+{ "linux/ppdev.h", "PPRDATA", _IOC_READ, 0x7085, 0x01 },
+{ "linux/ppdev.h", "PPRELEASE", _IOC_NONE, 0x708c, 0x00 },
+{ "linux/ppdev.h", "PPRSTATUS", _IOC_READ, 0x7081, 0x01 },
+{ "linux/ppdev.h", "PPSETFLAGS", _IOC_WRITE, 0x709b, 0x04 },
+{ "linux/ppdev.h", "PPSETMODE", _IOC_WRITE, 0x7080, 0x04 },
+{ "linux/ppdev.h", "PPSETPHASE", _IOC_WRITE, 0x7094, 0x04 },
+{ "linux/ppdev.h", "PPSETTIME", _IOC_WRITE, 0x7096, 0x08 },
+{ "linux/ppdev.h", "PPWCONTROL", _IOC_WRITE, 0x7084, 0x01 },
+{ "linux/ppdev.h", "PPWCTLONIRQ", _IOC_WRITE, 0x7092, 0x01 },
+{ "linux/ppdev.h", "PPWDATA", _IOC_WRITE, 0x7086, 0x01 },
+{ "linux/ppdev.h", "PPYIELD", _IOC_NONE, 0x708d, 0x00 },
+{ "linux/ppp-ioctl.h", "PPPIOCATTACH", _IOC_WRITE, 0x743d, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCATTCHAN", _IOC_WRITE, 0x7438, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCCONNECT", _IOC_WRITE, 0x743a, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCDETACH", _IOC_WRITE, 0x743c, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCDISCONN", _IOC_NONE, 0x7439, 0x00 },
+{ "linux/ppp-ioctl.h", "PPPIOCGASYNCMAP", _IOC_READ, 0x7458, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCGCHAN", _IOC_READ, 0x7437, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCGDEBUG", _IOC_READ, 0x7441, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCGFLAGS", _IOC_READ, 0x745a, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCGIDLE32", _IOC_READ, 0x743f, 0x08 },
+{ "linux/ppp-ioctl.h", "PPPIOCGIDLE64", _IOC_READ, 0x743f, 0x10 },
+{ "linux/ppp-ioctl.h", "PPPIOCGL2TPSTATS", _IOC_READ, 0x7436, 0x48 },
+{ "linux/ppp-ioctl.h", "PPPIOCGMRU", _IOC_READ, 0x7453, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCGNPMODE", _IOC_READ|_IOC_WRITE, 0x744c, 0x08 },
+{ "linux/ppp-ioctl.h", "PPPIOCGRASYNCMAP", _IOC_READ, 0x7455, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCGUNIT", _IOC_READ, 0x7456, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCGXASYNCMAP", _IOC_READ, 0x7450, 0x20 },
+{ "linux/ppp-ioctl.h", "PPPIOCNEWUNIT", _IOC_READ|_IOC_WRITE, 0x743e, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCSACTIVE", _IOC_WRITE, 0x7446, 0x06 },
+{ "linux/ppp-ioctl.h", "PPPIOCSASYNCMAP", _IOC_WRITE, 0x7457, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCSCOMPRESS", _IOC_WRITE, 0x744d, 0x0c },
+{ "linux/ppp-ioctl.h", "PPPIOCSDEBUG", _IOC_WRITE, 0x7440, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCSFLAGS", _IOC_WRITE, 0x7459, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCSMAXCID", _IOC_WRITE, 0x7451, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCSMRRU", _IOC_WRITE, 0x743b, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCSMRU", _IOC_WRITE, 0x7452, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCSNPMODE", _IOC_WRITE, 0x744b, 0x08 },
+{ "linux/ppp-ioctl.h", "PPPIOCSPASS", _IOC_WRITE, 0x7447, 0x06 },
+{ "linux/ppp-ioctl.h", "PPPIOCSRASYNCMAP", _IOC_WRITE, 0x7454, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCSXASYNCMAP", _IOC_WRITE, 0x744f, 0x20 },
+{ "linux/ppp-ioctl.h", "PPPIOCXFERUNIT", _IOC_NONE, 0x744e, 0x00 },
+{ "linux/pps.h", "PPS_FETCH", _IOC_READ|_IOC_WRITE, 0x70a4, 0x04 },
+{ "linux/pps.h", "PPS_GETCAP", _IOC_READ, 0x70a3, 0x04 },
+{ "linux/pps.h", "PPS_GETPARAMS", _IOC_READ, 0x70a1, 0x04 },
+{ "linux/pps.h", "PPS_KC_BIND", _IOC_WRITE, 0x70a5, 0x04 },
+{ "linux/pps.h", "PPS_SETPARAMS", _IOC_WRITE, 0x70a2, 0x04 },
+{ "linux/pr.h", "IOC_PR_CLEAR", _IOC_WRITE, 0x70cd, 0x10 },
+{ "linux/pr.h", "IOC_PR_PREEMPT", _IOC_WRITE, 0x70cb, 0x18 },
+{ "linux/pr.h", "IOC_PR_PREEMPT_ABORT", _IOC_WRITE, 0x70cc, 0x18 },
+{ "linux/pr.h", "IOC_PR_REGISTER", _IOC_WRITE, 0x70c8, 0x18 },
+{ "linux/pr.h", "IOC_PR_RELEASE", _IOC_WRITE, 0x70ca, 0x10 },
+{ "linux/pr.h", "IOC_PR_RESERVE", _IOC_WRITE, 0x70c9, 0x10 },
+{ "linux/psp-sev.h", "SEV_ISSUE_CMD", _IOC_READ|_IOC_WRITE, 0x5300, 0x10 },
+{ "linux/ptp_clock.h", "PTP_CLOCK_GETCAPS", _IOC_READ, 0x3d01, 0x50 },
+{ "linux/ptp_clock.h", "PTP_CLOCK_GETCAPS2", _IOC_READ, 0x3d0a, 0x50 },
+{ "linux/ptp_clock.h", "PTP_ENABLE_PPS", _IOC_WRITE, 0x3d04, 0x04 },
+{ "linux/ptp_clock.h", "PTP_ENABLE_PPS2", _IOC_WRITE, 0x3d0d, 0x04 },
+{ "linux/ptp_clock.h", "PTP_EXTTS_REQUEST", _IOC_WRITE, 0x3d02, 0x10 },
+{ "linux/ptp_clock.h", "PTP_EXTTS_REQUEST2", _IOC_WRITE, 0x3d0b, 0x10 },
+{ "linux/ptp_clock.h", "PTP_PEROUT_REQUEST", _IOC_WRITE, 0x3d03, 0x38 },
+{ "linux/ptp_clock.h", "PTP_PEROUT_REQUEST2", _IOC_WRITE, 0x3d0c, 0x38 },
+{ "linux/ptp_clock.h", "PTP_PIN_GETFUNC", _IOC_READ|_IOC_WRITE, 0x3d06, 0x60 },
+{ "linux/ptp_clock.h", "PTP_PIN_GETFUNC2", _IOC_READ|_IOC_WRITE, 0x3d0f, 0x60 },
+{ "linux/ptp_clock.h", "PTP_PIN_SETFUNC", _IOC_WRITE, 0x3d07, 0x60 },
+{ "linux/ptp_clock.h", "PTP_PIN_SETFUNC2", _IOC_WRITE, 0x3d10, 0x60 },
+{ "linux/ptp_clock.h", "PTP_SYS_OFFSET", _IOC_WRITE, 0x3d05, 0x340 },
+{ "linux/ptp_clock.h", "PTP_SYS_OFFSET2", _IOC_WRITE, 0x3d0e, 0x340 },
+{ "linux/ptp_clock.h", "PTP_SYS_OFFSET_EXTENDED", _IOC_READ|_IOC_WRITE, 0x3d09, 0x4c0 },
+{ "linux/ptp_clock.h", "PTP_SYS_OFFSET_EXTENDED2", _IOC_READ|_IOC_WRITE, 0x3d12, 0x4c0 },
+{ "linux/ptp_clock.h", "PTP_SYS_OFFSET_PRECISE", _IOC_READ|_IOC_WRITE, 0x3d08, 0x40 },
+{ "linux/ptp_clock.h", "PTP_SYS_OFFSET_PRECISE2", _IOC_READ|_IOC_WRITE, 0x3d11, 0x40 },
+{ "linux/radeonfb.h", "FBIO_RADEON_GET_MIRROR", _IOC_READ, 0x4003, 0x04 },
+{ "linux/radeonfb.h", "FBIO_RADEON_SET_MIRROR", _IOC_WRITE, 0x4004, 0x04 },
+{ "linux/raid/md_u.h", "ADD_NEW_DISK", _IOC_WRITE, 0x0921, 0x14 },
+{ "linux/raid/md_u.h", "CLEAR_ARRAY", _IOC_NONE, 0x0920, 0x00 },
+{ "linux/raid/md_u.h", "CLUSTERED_DISK_NACK", _IOC_NONE, 0x0935, 0x00 },
+{ "linux/raid/md_u.h", "GET_ARRAY_INFO", _IOC_READ, 0x0911, 0x48 },
+{ "linux/raid/md_u.h", "GET_BITMAP_FILE", _IOC_READ, 0x0915, 0x1000 },
+{ "linux/raid/md_u.h", "GET_DISK_INFO", _IOC_READ, 0x0912, 0x14 },
+{ "linux/raid/md_u.h", "HOT_ADD_DISK", _IOC_NONE, 0x0928, 0x00 },
+{ "linux/raid/md_u.h", "HOT_GENERATE_ERROR", _IOC_NONE, 0x092a, 0x00 },
+{ "linux/raid/md_u.h", "HOT_REMOVE_DISK", _IOC_NONE, 0x0922, 0x00 },
+{ "linux/raid/md_u.h", "PROTECT_ARRAY", _IOC_NONE, 0x0927, 0x00 },
+{ "linux/raid/md_u.h", "RAID_AUTORUN", _IOC_NONE, 0x0914, 0x00 },
+{ "linux/raid/md_u.h", "RAID_VERSION", _IOC_READ, 0x0910, 0x0c },
+{ "linux/raid/md_u.h", "RESTART_ARRAY_RW", _IOC_NONE, 0x0934, 0x00 },
+{ "linux/raid/md_u.h", "RUN_ARRAY", _IOC_WRITE, 0x0930, 0x0c },
+{ "linux/raid/md_u.h", "SET_ARRAY_INFO", _IOC_WRITE, 0x0923, 0x48 },
+{ "linux/raid/md_u.h", "SET_BITMAP_FILE", _IOC_WRITE, 0x092b, 0x04 },
+{ "linux/raid/md_u.h", "SET_DISK_FAULTY", _IOC_NONE, 0x0929, 0x00 },
+{ "linux/raid/md_u.h", "SET_DISK_INFO", _IOC_NONE, 0x0924, 0x00 },
+{ "linux/raid/md_u.h", "STOP_ARRAY", _IOC_NONE, 0x0932, 0x00 },
+{ "linux/raid/md_u.h", "STOP_ARRAY_RO", _IOC_NONE, 0x0933, 0x00 },
+{ "linux/raid/md_u.h", "UNPROTECT_ARRAY", _IOC_NONE, 0x0926, 0x00 },
+{ "linux/raid/md_u.h", "WRITE_RAID_INFO", _IOC_NONE, 0x0925, 0x00 },
+{ "linux/random.h", "RNDADDENTROPY", _IOC_WRITE, 0x5203, 0x08 },
+{ "linux/random.h", "RNDADDTOENTCNT", _IOC_WRITE, 0x5201, 0x04 },
+{ "linux/random.h", "RNDCLEARPOOL", _IOC_NONE, 0x5206, 0x00 },
+{ "linux/random.h", "RNDGETENTCNT", _IOC_READ, 0x5200, 0x04 },
+{ "linux/random.h", "RNDGETPOOL", _IOC_READ, 0x5202, 0x08 },
+{ "linux/random.h", "RNDRESEEDCRNG", _IOC_NONE, 0x5207, 0x00 },
+{ "linux/random.h", "RNDZAPENTCNT", _IOC_NONE, 0x5204, 0x00 },
+{ "linux/raw.h", "RAW_GETBIND", _IOC_NONE, 0xac01, 0x00 },
+{ "linux/raw.h", "RAW_SETBIND", _IOC_NONE, 0xac00, 0x00 },
+{ "linux/reiserfs_fs.h", "REISERFS_IOC_UNPACK", _IOC_WRITE, 0xcd01, 0x04 },
+{ "linux/remoteproc_cdev.h", "RPROC_GET_SHUTDOWN_ON_RELEASE", _IOC_READ, 0xb702, 0x04 },
+{ "linux/remoteproc_cdev.h", "RPROC_SET_SHUTDOWN_ON_RELEASE", _IOC_WRITE, 0xb701, 0x04 },
+{ "linux/rfkill.h", "RFKILL_IOCTL_NOINPUT", _IOC_NONE, 0x5201, 0x00 },
+{ "linux/rio_cm_cdev.h", "RIO_CM_CHAN_ACCEPT", _IOC_READ|_IOC_WRITE, 0x6307, 0x08 },
+{ "linux/rio_cm_cdev.h", "RIO_CM_CHAN_BIND", _IOC_WRITE, 0x6305, 0x08 },
+{ "linux/rio_cm_cdev.h", "RIO_CM_CHAN_CLOSE", _IOC_WRITE, 0x6304, 0x02 },
+{ "linux/rio_cm_cdev.h", "RIO_CM_CHAN_CONNECT", _IOC_WRITE, 0x6308, 0x08 },
+{ "linux/rio_cm_cdev.h", "RIO_CM_CHAN_CREATE", _IOC_READ|_IOC_WRITE, 0x6303, 0x02 },
+{ "linux/rio_cm_cdev.h", "RIO_CM_CHAN_LISTEN", _IOC_WRITE, 0x6306, 0x02 },
+{ "linux/rio_cm_cdev.h", "RIO_CM_CHAN_RECEIVE", _IOC_READ|_IOC_WRITE, 0x630a, 0x10 },
+{ "linux/rio_cm_cdev.h", "RIO_CM_CHAN_SEND", _IOC_WRITE, 0x6309, 0x10 },
+{ "linux/rio_cm_cdev.h", "RIO_CM_EP_GET_LIST", _IOC_READ|_IOC_WRITE, 0x6302, 0x04 },
+{ "linux/rio_cm_cdev.h", "RIO_CM_EP_GET_LIST_SIZE", _IOC_READ|_IOC_WRITE, 0x6301, 0x04 },
+{ "linux/rio_cm_cdev.h", "RIO_CM_MPORT_GET_LIST", _IOC_READ|_IOC_WRITE, 0x630b, 0x04 },
+{ "linux/rio_mport_cdev.h", "RIO_ALLOC_DMA", _IOC_READ|_IOC_WRITE, 0x6d13, 0x18 },
+{ "linux/rio_mport_cdev.h", "RIO_DEV_ADD", _IOC_WRITE, 0x6d17, 0x1e },
+{ "linux/rio_mport_cdev.h", "RIO_DEV_DEL", _IOC_WRITE, 0x6d18, 0x1e },
+{ "linux/rio_mport_cdev.h", "RIO_DISABLE_DOORBELL_RANGE", _IOC_WRITE, 0x6d0a, 0x08 },
+{ "linux/rio_mport_cdev.h", "RIO_DISABLE_PORTWRITE_RANGE", _IOC_WRITE, 0x6d0c, 0x10 },
+{ "linux/rio_mport_cdev.h", "RIO_ENABLE_DOORBELL_RANGE", _IOC_WRITE, 0x6d09, 0x08 },
+{ "linux/rio_mport_cdev.h", "RIO_ENABLE_PORTWRITE_RANGE", _IOC_WRITE, 0x6d0b, 0x10 },
+{ "linux/rio_mport_cdev.h", "RIO_FREE_DMA", _IOC_WRITE, 0x6d14, 0x08 },
+{ "linux/rio_mport_cdev.h", "RIO_GET_EVENT_MASK", _IOC_READ, 0x6d0e, 0x04 },
+{ "linux/rio_mport_cdev.h", "RIO_MAP_INBOUND", _IOC_READ|_IOC_WRITE, 0x6d11, 0x28 },
+{ "linux/rio_mport_cdev.h", "RIO_MAP_OUTBOUND", _IOC_READ|_IOC_WRITE, 0x6d0f, 0x28 },
+{ "linux/rio_mport_cdev.h", "RIO_MPORT_GET_PROPERTIES", _IOC_READ, 0x6d04, 0x30 },
+{ "linux/rio_mport_cdev.h", "RIO_MPORT_MAINT_COMPTAG_SET", _IOC_WRITE, 0x6d02, 0x04 },
+{ "linux/rio_mport_cdev.h", "RIO_MPORT_MAINT_HDID_SET", _IOC_WRITE, 0x6d01, 0x02 },
+{ "linux/rio_mport_cdev.h", "RIO_MPORT_MAINT_PORT_IDX_GET", _IOC_READ, 0x6d03, 0x04 },
+{ "linux/rio_mport_cdev.h", "RIO_MPORT_MAINT_READ_LOCAL", _IOC_READ, 0x6d05, 0x18 },
+{ "linux/rio_mport_cdev.h", "RIO_MPORT_MAINT_READ_REMOTE", _IOC_READ, 0x6d07, 0x18 },
+{ "linux/rio_mport_cdev.h", "RIO_MPORT_MAINT_WRITE_LOCAL", _IOC_WRITE, 0x6d06, 0x18 },
+{ "linux/rio_mport_cdev.h", "RIO_MPORT_MAINT_WRITE_REMOTE", _IOC_WRITE, 0x6d08, 0x18 },
+{ "linux/rio_mport_cdev.h", "RIO_SET_EVENT_MASK", _IOC_WRITE, 0x6d0d, 0x04 },
+{ "linux/rio_mport_cdev.h", "RIO_TRANSFER", _IOC_READ|_IOC_WRITE, 0x6d15, 0x18 },
+{ "linux/rio_mport_cdev.h", "RIO_UNMAP_INBOUND", _IOC_WRITE, 0x6d12, 0x08 },
+{ "linux/rio_mport_cdev.h", "RIO_UNMAP_OUTBOUND", _IOC_WRITE, 0x6d10, 0x28 },
+{ "linux/rio_mport_cdev.h", "RIO_WAIT_FOR_ASYNC", _IOC_WRITE, 0x6d16, 0x08 },
+{ "linux/rpmsg.h", "RPMSG_CREATE_EPT_IOCTL", _IOC_WRITE, 0xb501, 0x28 },
+{ "linux/rpmsg.h", "RPMSG_DESTROY_EPT_IOCTL", _IOC_NONE, 0xb502, 0x00 },
+{ "linux/rtc.h", "RTC_AIE_OFF", _IOC_NONE, 0x7002, 0x00 },
+{ "linux/rtc.h", "RTC_AIE_ON", _IOC_NONE, 0x7001, 0x00 },
+{ "linux/rtc.h", "RTC_ALM_READ", _IOC_READ, 0x7008, 0x24 },
+{ "linux/rtc.h", "RTC_ALM_SET", _IOC_WRITE, 0x7007, 0x24 },
+{ "linux/rtc.h", "RTC_EPOCH_READ", _IOC_READ, 0x700d, 0x04 },
+{ "linux/rtc.h", "RTC_EPOCH_SET", _IOC_WRITE, 0x700e, 0x04 },
+{ "linux/rtc.h", "RTC_IRQP_READ", _IOC_READ, 0x700b, 0x04 },
+{ "linux/rtc.h", "RTC_IRQP_SET", _IOC_WRITE, 0x700c, 0x04 },
+{ "linux/rtc.h", "RTC_PIE_OFF", _IOC_NONE, 0x7006, 0x00 },
+{ "linux/rtc.h", "RTC_PIE_ON", _IOC_NONE, 0x7005, 0x00 },
+{ "linux/rtc.h", "RTC_PLL_GET", _IOC_READ, 0x7011, 0x1c },
+{ "linux/rtc.h", "RTC_PLL_SET", _IOC_WRITE, 0x7012, 0x1c },
+{ "linux/rtc.h", "RTC_RD_TIME", _IOC_READ, 0x7009, 0x24 },
+{ "linux/rtc.h", "RTC_SET_TIME", _IOC_WRITE, 0x700a, 0x24 },
+{ "linux/rtc.h", "RTC_UIE_OFF", _IOC_NONE, 0x7004, 0x00 },
+{ "linux/rtc.h", "RTC_UIE_ON", _IOC_NONE, 0x7003, 0x00 },
+{ "linux/rtc.h", "RTC_VL_CLR", _IOC_NONE, 0x7014, 0x00 },
+{ "linux/rtc.h", "RTC_VL_READ", _IOC_READ, 0x7013, 0x04 },
+{ "linux/rtc.h", "RTC_WIE_OFF", _IOC_NONE, 0x7010, 0x00 },
+{ "linux/rtc.h", "RTC_WIE_ON", _IOC_NONE, 0x700f, 0x00 },
+{ "linux/rtc.h", "RTC_WKALM_RD", _IOC_READ, 0x7010, 0x26 },
+{ "linux/rtc.h", "RTC_WKALM_SET", _IOC_WRITE, 0x700f, 0x26 },
+{ "linux/scif_ioctl.h", "SCIF_ACCEPTREG", _IOC_READ|_IOC_WRITE, 0x7305, 0x08 },
+{ "linux/scif_ioctl.h", "SCIF_ACCEPTREQ", _IOC_READ|_IOC_WRITE, 0x7304, 0x10 },
+{ "linux/scif_ioctl.h", "SCIF_BIND", _IOC_READ|_IOC_WRITE, 0x7301, 0x08 },
+{ "linux/scif_ioctl.h", "SCIF_CONNECT", _IOC_READ|_IOC_WRITE, 0x7303, 0x08 },
+{ "linux/scif_ioctl.h", "SCIF_FENCE_MARK", _IOC_READ|_IOC_WRITE, 0x730f, 0x0c },
+{ "linux/scif_ioctl.h", "SCIF_FENCE_SIGNAL", _IOC_READ|_IOC_WRITE, 0x7311, 0x24 },
+{ "linux/scif_ioctl.h", "SCIF_FENCE_WAIT", _IOC_READ|_IOC_WRITE, 0x7310, 0x04 },
+{ "linux/scif_ioctl.h", "SCIF_GET_NODEIDS", _IOC_READ|_IOC_WRITE, 0x730e, 0x14 },
+{ "linux/scif_ioctl.h", "SCIF_LISTEN", _IOC_WRITE, 0x7302, 0x04 },
+{ "linux/scif_ioctl.h", "SCIF_READFROM", _IOC_READ|_IOC_WRITE, 0x730a, 0x24 },
+{ "linux/scif_ioctl.h", "SCIF_RECV", _IOC_READ|_IOC_WRITE, 0x7307, 0x14 },
+{ "linux/scif_ioctl.h", "SCIF_REG", _IOC_READ|_IOC_WRITE, 0x7308, 0x28 },
+{ "linux/scif_ioctl.h", "SCIF_SEND", _IOC_READ|_IOC_WRITE, 0x7306, 0x14 },
+{ "linux/scif_ioctl.h", "SCIF_UNREG", _IOC_READ|_IOC_WRITE, 0x7309, 0x10 },
+{ "linux/scif_ioctl.h", "SCIF_VREADFROM", _IOC_READ|_IOC_WRITE, 0x730c, 0x24 },
+{ "linux/scif_ioctl.h", "SCIF_VWRITETO", _IOC_READ|_IOC_WRITE, 0x730d, 0x24 },
+{ "linux/scif_ioctl.h", "SCIF_WRITETO", _IOC_READ|_IOC_WRITE, 0x730b, 0x24 },
+{ "linux/seccomp.h", "SECCOMP_IOCTL_NOTIF_ADDFD", _IOC_WRITE, 0x2103, 0x18 },
+{ "linux/seccomp.h", "SECCOMP_IOCTL_NOTIF_ID_VALID", _IOC_WRITE, 0x2102, 0x08 },
+{ "linux/seccomp.h", "SECCOMP_IOCTL_NOTIF_RECV", _IOC_READ|_IOC_WRITE, 0x2100, 0x50 },
+{ "linux/seccomp.h", "SECCOMP_IOCTL_NOTIF_SEND", _IOC_READ|_IOC_WRITE, 0x2101, 0x18 },
+{ "linux/sed-opal.h", "IOC_OPAL_ACTIVATE_LSP", _IOC_WRITE, 0x70df, 0x118 },
+{ "linux/sed-opal.h", "IOC_OPAL_ACTIVATE_USR", _IOC_WRITE, 0x70e1, 0x110 },
+{ "linux/sed-opal.h", "IOC_OPAL_ADD_USR_TO_LR", _IOC_WRITE, 0x70e4, 0x118 },
+{ "linux/sed-opal.h", "IOC_OPAL_ENABLE_DISABLE_MBR", _IOC_WRITE, 0x70e5, 0x110 },
+{ "linux/sed-opal.h", "IOC_OPAL_ERASE_LR", _IOC_WRITE, 0x70e6, 0x110 },
+{ "linux/sed-opal.h", "IOC_OPAL_GENERIC_TABLE_RW", _IOC_WRITE, 0x70eb, 0x138 },
+{ "linux/sed-opal.h", "IOC_OPAL_LOCK_UNLOCK", _IOC_WRITE, 0x70dd, 0x118 },
+{ "linux/sed-opal.h", "IOC_OPAL_LR_SETUP", _IOC_WRITE, 0x70e3, 0x128 },
+{ "linux/sed-opal.h", "IOC_OPAL_MBR_DONE", _IOC_WRITE, 0x70e9, 0x110 },
+{ "linux/sed-opal.h", "IOC_OPAL_PSID_REVERT_TPR", _IOC_WRITE, 0x70e8, 0x108 },
+{ "linux/sed-opal.h", "IOC_OPAL_REVERT_TPR", _IOC_WRITE, 0x70e2, 0x108 },
+{ "linux/sed-opal.h", "IOC_OPAL_SAVE", _IOC_WRITE, 0x70dc, 0x118 },
+{ "linux/sed-opal.h", "IOC_OPAL_SECURE_ERASE_LR", _IOC_WRITE, 0x70e7, 0x110 },
+{ "linux/sed-opal.h", "IOC_OPAL_SET_PW", _IOC_WRITE, 0x70e0, 0x220 },
+{ "linux/sed-opal.h", "IOC_OPAL_TAKE_OWNERSHIP", _IOC_WRITE, 0x70de, 0x108 },
+{ "linux/sed-opal.h", "IOC_OPAL_WRITE_SHADOW_MBR", _IOC_WRITE, 0x70ea, 0x120 },
+{ "linux/serio.h", "SPIOCSTYPE", _IOC_WRITE, 0x7101, 0x04 },
+{ "linux/sockios.h", "SIOCADDDLCI", 0, 0x8980, 0 },
+{ "linux/sockios.h", "SIOCADDMULTI", 0, 0x8931, 0 },
+{ "linux/sockios.h", "SIOCADDRT", 0, 0x890B, 0 },
+{ "linux/sockios.h", "SIOCBONDCHANGEACTIVE", 0, 0x8995, 0 },
+{ "linux/sockios.h", "SIOCBONDENSLAVE", 0, 0x8990, 0 },
+{ "linux/sockios.h", "SIOCBONDINFOQUERY", 0, 0x8994, 0 },
+{ "linux/sockios.h", "SIOCBONDRELEASE", 0, 0x8991, 0 },
+{ "linux/sockios.h", "SIOCBONDSETHWADDR", 0, 0x8992, 0 },
+{ "linux/sockios.h", "SIOCBONDSLAVEINFOQUERY", 0, 0x8993, 0 },
+{ "linux/sockios.h", "SIOCBRADDBR", 0, 0x89a0, 0 },
+{ "linux/sockios.h", "SIOCBRADDIF", 0, 0x89a2, 0 },
+{ "linux/sockios.h", "SIOCBRDELBR", 0, 0x89a1, 0 },
+{ "linux/sockios.h", "SIOCBRDELIF", 0, 0x89a3, 0 },
+{ "linux/sockios.h", "SIOCDARP", 0, 0x8953, 0 },
+{ "linux/sockios.h", "SIOCDELDLCI", 0, 0x8981, 0 },
+{ "linux/sockios.h", "SIOCDELMULTI", 0, 0x8932, 0 },
+{ "linux/sockios.h", "SIOCDELRT", 0, 0x890C, 0 },
+{ "linux/sockios.h", "SIOCDEVPRIVATE", 0, 0x89F0, 0 },
+{ "linux/sockios.h", "SIOCDIFADDR", 0, 0x8936, 0 },
+{ "linux/sockios.h", "SIOCDRARP", 0, 0x8960, 0 },
+{ "linux/sockios.h", "SIOCETHTOOL", 0, 0x8946, 0 },
+{ "linux/sockios.h", "SIOCGARP", 0, 0x8954, 0 },
+{ "linux/sockios.h", "SIOCGHWTSTAMP", 0, 0x89b1, 0 },
+{ "linux/sockios.h", "SIOCGIFADDR", 0, 0x8915, 0 },
+{ "linux/sockios.h", "SIOCGIFBR", 0, 0x8940, 0 },
+{ "linux/sockios.h", "SIOCGIFBRDADDR", 0, 0x8919, 0 },
+{ "linux/sockios.h", "SIOCGIFCONF", 0, 0x8912, 0 },
+{ "linux/sockios.h", "SIOCGIFCOUNT", 0, 0x8938, 0 },
+{ "linux/sockios.h", "SIOCGIFDSTADDR", 0, 0x8917, 0 },
+{ "linux/sockios.h", "SIOCGIFENCAP", 0, 0x8925, 0 },
+{ "linux/sockios.h", "SIOCGIFFLAGS", 0, 0x8913, 0 },
+{ "linux/sockios.h", "SIOCGIFHWADDR", 0, 0x8927, 0 },
+{ "linux/sockios.h", "SIOCGIFINDEX", 0, 0x8933, 0 },
+{ "linux/sockios.h", "SIOCGIFMAP", 0, 0x8970, 0 },
+{ "linux/sockios.h", "SIOCGIFMEM", 0, 0x891f, 0 },
+{ "linux/sockios.h", "SIOCGIFMETRIC", 0, 0x891d, 0 },
+{ "linux/sockios.h", "SIOCGIFMTU", 0, 0x8921, 0 },
+{ "linux/sockios.h", "SIOCGIFNAME", 0, 0x8910, 0 },
+{ "linux/sockios.h", "SIOCGIFNETMASK", 0, 0x891b, 0 },
+{ "linux/sockios.h", "SIOCGIFPFLAGS", 0, 0x8935, 0 },
+{ "linux/sockios.h", "SIOCGIFSLAVE", 0, 0x8929, 0 },
+{ "linux/sockios.h", "SIOCGIFTXQLEN", 0, 0x8942, 0 },
+{ "linux/sockios.h", "SIOCGIFVLAN", 0, 0x8982, 0 },
+{ "linux/sockios.h", "SIOCGMIIPHY", 0, 0x8947, 0 },
+{ "linux/sockios.h", "SIOCGMIIREG", 0, 0x8948, 0 },
+{ "linux/sockios.h", "SIOCGRARP", 0, 0x8961, 0 },
+{ "linux/sockios.h", "SIOCGSKNS", 0, 0x894C, 0 },
+{ "linux/sockios.h", "SIOCGSTAMPNS_NEW", _IOC_READ, 0x8907, 0x10 },
+{ "linux/sockios.h", "SIOCGSTAMP_NEW", _IOC_READ, 0x8906, 0x10 },
+{ "linux/sockios.h", "SIOCOUTQNSD", 0, 0x894B, 0 },
+{ "linux/sockios.h", "SIOCPROTOPRIVATE", 0, 0x89E0, 0 },
+{ "linux/sockios.h", "SIOCRTMSG", 0, 0x890D, 0 },
+{ "linux/sockios.h", "SIOCSARP", 0, 0x8955, 0 },
+{ "linux/sockios.h", "SIOCSHWTSTAMP", 0, 0x89b0, 0 },
+{ "linux/sockios.h", "SIOCSIFADDR", 0, 0x8916, 0 },
+{ "linux/sockios.h", "SIOCSIFBR", 0, 0x8941, 0 },
+{ "linux/sockios.h", "SIOCSIFBRDADDR", 0, 0x891a, 0 },
+{ "linux/sockios.h", "SIOCSIFDSTADDR", 0, 0x8918, 0 },
+{ "linux/sockios.h", "SIOCSIFENCAP", 0, 0x8926, 0 },
+{ "linux/sockios.h", "SIOCSIFFLAGS", 0, 0x8914, 0 },
+{ "linux/sockios.h", "SIOCSIFHWADDR", 0, 0x8924, 0 },
+{ "linux/sockios.h", "SIOCSIFHWBROADCAST", 0, 0x8937, 0 },
+{ "linux/sockios.h", "SIOCSIFLINK", 0, 0x8911, 0 },
+{ "linux/sockios.h", "SIOCSIFMAP", 0, 0x8971, 0 },
+{ "linux/sockios.h", "SIOCSIFMEM", 0, 0x8920, 0 },
+{ "linux/sockios.h", "SIOCSIFMETRIC", 0, 0x891e, 0 },
+{ "linux/sockios.h", "SIOCSIFMTU", 0, 0x8922, 0 },
+{ "linux/sockios.h", "SIOCSIFNAME", 0, 0x8923, 0 },
+{ "linux/sockios.h", "SIOCSIFNETMASK", 0, 0x891c, 0 },
+{ "linux/sockios.h", "SIOCSIFPFLAGS", 0, 0x8934, 0 },
+{ "linux/sockios.h", "SIOCSIFSLAVE", 0, 0x8930, 0 },
+{ "linux/sockios.h", "SIOCSIFTXQLEN", 0, 0x8943, 0 },
+{ "linux/sockios.h", "SIOCSIFVLAN", 0, 0x8983, 0 },
+{ "linux/sockios.h", "SIOCSMIIREG", 0, 0x8949, 0 },
+{ "linux/sockios.h", "SIOCSRARP", 0, 0x8962, 0 },
+{ "linux/sockios.h", "SIOCWANDEV", 0, 0x894A, 0 },
+{ "linux/sonet.h", "SONET_CLRDIAG", _IOC_READ|_IOC_WRITE, 0x6113, 0x04 },
+{ "linux/sonet.h", "SONET_GETDIAG", _IOC_READ, 0x6114, 0x04 },
+{ "linux/sonet.h", "SONET_GETFRAMING", _IOC_READ, 0x6116, 0x04 },
+{ "linux/sonet.h", "SONET_GETFRSENSE", _IOC_READ, 0x6117, 0x06 },
+{ "linux/sonet.h", "SONET_GETSTAT", _IOC_READ, 0x6110, 0x24 },
+{ "linux/sonet.h", "SONET_GETSTATZ", _IOC_READ, 0x6111, 0x24 },
+{ "linux/sonet.h", "SONET_SETDIAG", _IOC_READ|_IOC_WRITE, 0x6112, 0x04 },
+{ "linux/sonet.h", "SONET_SETFRAMING", _IOC_WRITE, 0x6115, 0x04 },
+{ "linux/sonypi.h", "SONYPI_IOCGBAT1CAP", _IOC_READ, 0x7602, 0x02 },
+{ "linux/sonypi.h", "SONYPI_IOCGBAT1REM", _IOC_READ, 0x7603, 0x02 },
+{ "linux/sonypi.h", "SONYPI_IOCGBAT2CAP", _IOC_READ, 0x7604, 0x02 },
+{ "linux/sonypi.h", "SONYPI_IOCGBAT2REM", _IOC_READ, 0x7605, 0x02 },
+{ "linux/sonypi.h", "SONYPI_IOCGBATFLAGS", _IOC_READ, 0x7607, 0x01 },
+{ "linux/sonypi.h", "SONYPI_IOCGBLUE", _IOC_READ, 0x7608, 0x01 },
+{ "linux/sonypi.h", "SONYPI_IOCGBRT", _IOC_READ, 0x7600, 0x01 },
+{ "linux/sonypi.h", "SONYPI_IOCGFAN", _IOC_READ, 0x760a, 0x01 },
+{ "linux/sonypi.h", "SONYPI_IOCGTEMP", _IOC_READ, 0x760c, 0x01 },
+{ "linux/sonypi.h", "SONYPI_IOCSBLUE", _IOC_WRITE, 0x7609, 0x01 },
+{ "linux/sonypi.h", "SONYPI_IOCSBRT", _IOC_WRITE, 0x7600, 0x01 },
+{ "linux/sonypi.h", "SONYPI_IOCSFAN", _IOC_WRITE, 0x760b, 0x01 },
+{ "linux/soundcard.h", "OSS_GETVERSION", _IOC_READ, 0x4d76, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_COPR_HALT", _IOC_READ|_IOC_WRITE, 0x4307, 0x14 },
+{ "linux/soundcard.h", "SNDCTL_COPR_LOAD", _IOC_READ|_IOC_WRITE, 0x4301, 0xfb0 },
+{ "linux/soundcard.h", "SNDCTL_COPR_RCODE", _IOC_READ|_IOC_WRITE, 0x4303, 0x14 },
+{ "linux/soundcard.h", "SNDCTL_COPR_RCVMSG", _IOC_READ, 0x4309, 0xfa4 },
+{ "linux/soundcard.h", "SNDCTL_COPR_RDATA", _IOC_READ|_IOC_WRITE, 0x4302, 0x14 },
+{ "linux/soundcard.h", "SNDCTL_COPR_RESET", _IOC_NONE, 0x4300, 0x00 },
+{ "linux/soundcard.h", "SNDCTL_COPR_RUN", _IOC_READ|_IOC_WRITE, 0x4306, 0x14 },
+{ "linux/soundcard.h", "SNDCTL_COPR_SENDMSG", _IOC_READ|_IOC_WRITE, 0x4308, 0xfa4 },
+{ "linux/soundcard.h", "SNDCTL_COPR_WCODE", _IOC_WRITE, 0x4305, 0x14 },
+{ "linux/soundcard.h", "SNDCTL_COPR_WDATA", _IOC_WRITE, 0x4304, 0x14 },
+{ "linux/soundcard.h", "SNDCTL_DSP_BIND_CHANNEL", _IOC_READ|_IOC_WRITE, 0x5041, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_CHANNELS", _IOC_READ|_IOC_WRITE, 0x5006, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_GETBLKSIZE", _IOC_READ|_IOC_WRITE, 0x5004, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_GETCAPS", _IOC_READ, 0x500f, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_GETCHANNELMASK", _IOC_READ|_IOC_WRITE, 0x5040, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_GETFMTS", _IOC_READ, 0x500b, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_GETIPTR", _IOC_READ, 0x5011, 0x0c },
+{ "linux/soundcard.h", "SNDCTL_DSP_GETISPACE", _IOC_READ, 0x500d, 0x10 },
+{ "linux/soundcard.h", "SNDCTL_DSP_GETODELAY", _IOC_READ, 0x5017, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_GETOPTR", _IOC_READ, 0x5012, 0x0c },
+{ "linux/soundcard.h", "SNDCTL_DSP_GETOSPACE", _IOC_READ, 0x500c, 0x10 },
+{ "linux/soundcard.h", "SNDCTL_DSP_GETSPDIF", _IOC_READ, 0x5043, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_GETTRIGGER", _IOC_READ, 0x5010, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_MAPINBUF", _IOC_READ, 0x5013, 0x08 },
+{ "linux/soundcard.h", "SNDCTL_DSP_MAPOUTBUF", _IOC_READ, 0x5014, 0x08 },
+{ "linux/soundcard.h", "SNDCTL_DSP_NONBLOCK", _IOC_NONE, 0x500e, 0x00 },
+{ "linux/soundcard.h", "SNDCTL_DSP_POST", _IOC_NONE, 0x5008, 0x00 },
+{ "linux/soundcard.h", "SNDCTL_DSP_PROFILE", _IOC_WRITE, 0x5017, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_RESET", _IOC_NONE, 0x5000, 0x00 },
+{ "linux/soundcard.h", "SNDCTL_DSP_SETDUPLEX", _IOC_NONE, 0x5016, 0x00 },
+{ "linux/soundcard.h", "SNDCTL_DSP_SETFMT", _IOC_READ|_IOC_WRITE, 0x5005, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_SETFRAGMENT", _IOC_READ|_IOC_WRITE, 0x500a, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_SETSPDIF", _IOC_WRITE, 0x5042, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_SETSYNCRO", _IOC_NONE, 0x5015, 0x00 },
+{ "linux/soundcard.h", "SNDCTL_DSP_SETTRIGGER", _IOC_WRITE, 0x5010, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_SPEED", _IOC_READ|_IOC_WRITE, 0x5002, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_STEREO", _IOC_READ|_IOC_WRITE, 0x5003, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_SUBDIVIDE", _IOC_READ|_IOC_WRITE, 0x5009, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_SYNC", _IOC_NONE, 0x5001, 0x00 },
+{ "linux/soundcard.h", "SNDCTL_FM_4OP_ENABLE", _IOC_WRITE, 0x510f, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_FM_LOAD_INSTR", _IOC_WRITE, 0x5107, 0x28 },
+{ "linux/soundcard.h", "SNDCTL_MIDI_INFO", _IOC_READ|_IOC_WRITE, 0x510c, 0x72 },
+{ "linux/soundcard.h", "SNDCTL_MIDI_MPUCMD", _IOC_READ|_IOC_WRITE, 0x6d02, 0x21 },
+{ "linux/soundcard.h", "SNDCTL_MIDI_MPUMODE", _IOC_READ|_IOC_WRITE, 0x6d01, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_MIDI_PRETIME", _IOC_READ|_IOC_WRITE, 0x6d00, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_SEQ_CTRLRATE", _IOC_READ|_IOC_WRITE, 0x5103, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_SEQ_GETINCOUNT", _IOC_READ, 0x5105, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_SEQ_GETOUTCOUNT", _IOC_READ, 0x5104, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_SEQ_GETTIME", _IOC_READ, 0x5113, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_SEQ_NRMIDIS", _IOC_READ, 0x510b, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_SEQ_NRSYNTHS", _IOC_READ, 0x510a, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_SEQ_OUTOFBAND", _IOC_WRITE, 0x5112, 0x08 },
+{ "linux/soundcard.h", "SNDCTL_SEQ_PANIC", _IOC_NONE, 0x5111, 0x00 },
+{ "linux/soundcard.h", "SNDCTL_SEQ_PERCMODE", _IOC_WRITE, 0x5106, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_SEQ_RESET", _IOC_NONE, 0x5100, 0x00 },
+{ "linux/soundcard.h", "SNDCTL_SEQ_RESETSAMPLES", _IOC_WRITE, 0x5109, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_SEQ_SYNC", _IOC_NONE, 0x5101, 0x00 },
+{ "linux/soundcard.h", "SNDCTL_SEQ_TESTMIDI", _IOC_WRITE, 0x5108, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_SEQ_THRESHOLD", _IOC_WRITE, 0x510d, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_SYNTH_CONTROL", _IOC_READ|_IOC_WRITE, 0x5115, 0xfa4 },
+{ "linux/soundcard.h", "SNDCTL_SYNTH_ID", _IOC_READ|_IOC_WRITE, 0x5114, 0x8a },
+{ "linux/soundcard.h", "SNDCTL_SYNTH_INFO", _IOC_READ|_IOC_WRITE, 0x5102, 0x8a },
+{ "linux/soundcard.h", "SNDCTL_SYNTH_MEMAVL", _IOC_READ|_IOC_WRITE, 0x510e, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_SYNTH_REMOVESAMPLE", _IOC_READ|_IOC_WRITE, 0x5116, 0x0c },
+{ "linux/soundcard.h", "SNDCTL_TMR_CONTINUE", _IOC_NONE, 0x5404, 0x00 },
+{ "linux/soundcard.h", "SNDCTL_TMR_METRONOME", _IOC_WRITE, 0x5407, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_TMR_SELECT", _IOC_WRITE, 0x5408, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_TMR_SOURCE", _IOC_READ|_IOC_WRITE, 0x5406, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_TMR_START", _IOC_NONE, 0x5402, 0x00 },
+{ "linux/soundcard.h", "SNDCTL_TMR_STOP", _IOC_NONE, 0x5403, 0x00 },
+{ "linux/soundcard.h", "SNDCTL_TMR_TEMPO", _IOC_READ|_IOC_WRITE, 0x5405, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_TMR_TIMEBASE", _IOC_READ|_IOC_WRITE, 0x5401, 0x04 },
+{ "linux/soundcard.h", "SOUND_MIXER_3DSE", _IOC_READ|_IOC_WRITE, 0x4d68, 0x04 },
+{ "linux/soundcard.h", "SOUND_MIXER_ACCESS", _IOC_READ|_IOC_WRITE, 0x4d66, 0x80 },
+{ "linux/soundcard.h", "SOUND_MIXER_AGC", _IOC_READ|_IOC_WRITE, 0x4d67, 0x04 },
+{ "linux/soundcard.h", "SOUND_MIXER_GETLEVELS", _IOC_READ|_IOC_WRITE, 0x4d74, 0xa4 },
+{ "linux/soundcard.h", "SOUND_MIXER_INFO", _IOC_READ, 0x4d65, 0x5c },
+{ "linux/soundcard.h", "SOUND_MIXER_PRIVATE1", _IOC_READ|_IOC_WRITE, 0x4d6f, 0x04 },
+{ "linux/soundcard.h", "SOUND_MIXER_PRIVATE2", _IOC_READ|_IOC_WRITE, 0x4d70, 0x04 },
+{ "linux/soundcard.h", "SOUND_MIXER_PRIVATE3", _IOC_READ|_IOC_WRITE, 0x4d71, 0x04 },
+{ "linux/soundcard.h", "SOUND_MIXER_PRIVATE4", _IOC_READ|_IOC_WRITE, 0x4d72, 0x04 },
+{ "linux/soundcard.h", "SOUND_MIXER_PRIVATE5", _IOC_READ|_IOC_WRITE, 0x4d73, 0x04 },
+{ "linux/soundcard.h", "SOUND_MIXER_SETLEVELS", _IOC_READ|_IOC_WRITE, 0x4d75, 0xa4 },
+{ "linux/soundcard.h", "SOUND_OLD_MIXER_INFO", _IOC_READ, 0x4d65, 0x30 },
+{ "linux/soundcard.h", "SOUND_PCM_READ_BITS", _IOC_READ, 0x5005, 0x04 },
+{ "linux/soundcard.h", "SOUND_PCM_READ_CHANNELS", _IOC_READ, 0x5006, 0x04 },
+{ "linux/soundcard.h", "SOUND_PCM_READ_FILTER", _IOC_READ, 0x5007, 0x04 },
+{ "linux/soundcard.h", "SOUND_PCM_READ_RATE", _IOC_READ, 0x5002, 0x04 },
+{ "linux/soundcard.h", "SOUND_PCM_WRITE_FILTER", _IOC_READ|_IOC_WRITE, 0x5007, 0x04 },
+{ "linux/spi/spidev.h", "SPI_IOC_RD_BITS_PER_WORD", _IOC_READ, 0x6b03, 0x01 },
+{ "linux/spi/spidev.h", "SPI_IOC_RD_LSB_FIRST", _IOC_READ, 0x6b02, 0x01 },
+{ "linux/spi/spidev.h", "SPI_IOC_RD_MAX_SPEED_HZ", _IOC_READ, 0x6b04, 0x04 },
+{ "linux/spi/spidev.h", "SPI_IOC_RD_MODE", _IOC_READ, 0x6b01, 0x01 },
+{ "linux/spi/spidev.h", "SPI_IOC_RD_MODE32", _IOC_READ, 0x6b05, 0x04 },
+{ "linux/spi/spidev.h", "SPI_IOC_WR_BITS_PER_WORD", _IOC_WRITE, 0x6b03, 0x01 },
+{ "linux/spi/spidev.h", "SPI_IOC_WR_LSB_FIRST", _IOC_WRITE, 0x6b02, 0x01 },
+{ "linux/spi/spidev.h", "SPI_IOC_WR_MAX_SPEED_HZ", _IOC_WRITE, 0x6b04, 0x04 },
+{ "linux/spi/spidev.h", "SPI_IOC_WR_MODE", _IOC_WRITE, 0x6b01, 0x01 },
+{ "linux/spi/spidev.h", "SPI_IOC_WR_MODE32", _IOC_WRITE, 0x6b05, 0x04 },
+{ "linux/stm.h", "STP_POLICY_ID_GET", _IOC_READ, 0x2501, 0x10 },
+{ "linux/stm.h", "STP_POLICY_ID_SET", _IOC_READ|_IOC_WRITE, 0x2500, 0x10 },
+{ "linux/stm.h", "STP_SET_OPTIONS", _IOC_WRITE, 0x2502, 0x08 },
+{ "linux/suspend_ioctls.h", "SNAPSHOT_ALLOC_SWAP_PAGE", _IOC_READ, 0x3314, 0x08 },
+{ "linux/suspend_ioctls.h", "SNAPSHOT_ATOMIC_RESTORE", _IOC_NONE, 0x3304, 0x00 },
+{ "linux/suspend_ioctls.h", "SNAPSHOT_AVAIL_SWAP_SIZE", _IOC_READ, 0x3313, 0x08 },
+{ "linux/suspend_ioctls.h", "SNAPSHOT_CREATE_IMAGE", _IOC_WRITE, 0x3311, 0x04 },
+{ "linux/suspend_ioctls.h", "SNAPSHOT_FREE", _IOC_NONE, 0x3305, 0x00 },
+{ "linux/suspend_ioctls.h", "SNAPSHOT_FREEZE", _IOC_NONE, 0x3301, 0x00 },
+{ "linux/suspend_ioctls.h", "SNAPSHOT_FREE_SWAP_PAGES", _IOC_NONE, 0x3309, 0x00 },
+{ "linux/suspend_ioctls.h", "SNAPSHOT_GET_IMAGE_SIZE", _IOC_READ, 0x330e, 0x08 },
+{ "linux/suspend_ioctls.h", "SNAPSHOT_PLATFORM_SUPPORT", _IOC_NONE, 0x330f, 0x00 },
+{ "linux/suspend_ioctls.h", "SNAPSHOT_POWER_OFF", _IOC_NONE, 0x3310, 0x00 },
+{ "linux/suspend_ioctls.h", "SNAPSHOT_PREF_IMAGE_SIZE", _IOC_NONE, 0x3312, 0x00 },
+{ "linux/suspend_ioctls.h", "SNAPSHOT_S2RAM", _IOC_NONE, 0x330b, 0x00 },
+{ "linux/suspend_ioctls.h", "SNAPSHOT_SET_SWAP_AREA", _IOC_WRITE, 0x330d, 0x0c },
+{ "linux/suspend_ioctls.h", "SNAPSHOT_UNFREEZE", _IOC_NONE, 0x3302, 0x00 },
+{ "linux/switchtec_ioctl.h", "SWITCHTEC_IOCTL_EVENT_CTL", _IOC_READ|_IOC_WRITE, 0x5743, 0x28 },
+{ "linux/switchtec_ioctl.h", "SWITCHTEC_IOCTL_EVENT_SUMMARY", _IOC_READ, 0x5742, 0x4d4 },
+{ "linux/switchtec_ioctl.h", "SWITCHTEC_IOCTL_EVENT_SUMMARY_LEGACY", _IOC_READ, 0x5742, 0x198 },
+{ "linux/switchtec_ioctl.h", "SWITCHTEC_IOCTL_FLASH_INFO", _IOC_READ, 0x5740, 0x10 },
+{ "linux/switchtec_ioctl.h", "SWITCHTEC_IOCTL_FLASH_PART_INFO", _IOC_READ|_IOC_WRITE, 0x5741, 0x10 },
+{ "linux/switchtec_ioctl.h", "SWITCHTEC_IOCTL_PFF_TO_PORT", _IOC_READ|_IOC_WRITE, 0x5744, 0x0c },
+{ "linux/switchtec_ioctl.h", "SWITCHTEC_IOCTL_PORT_TO_PFF", _IOC_READ|_IOC_WRITE, 0x5745, 0x0c },
+{ "linux/sync_file.h", "SYNC_IOC_FILE_INFO", _IOC_READ|_IOC_WRITE, 0x3e04, 0x38 },
+{ "linux/sync_file.h", "SYNC_IOC_MERGE", _IOC_READ|_IOC_WRITE, 0x3e03, 0x30 },
+{ "linux/synclink.h", "MGSL_IOCCLRMODCOUNT", _IOC_NONE, 0x6d0f, 0x00 },
+{ "linux/synclink.h", "MGSL_IOCGGPIO", _IOC_READ, 0x6d11, 0x10 },
+{ "linux/synclink.h", "MGSL_IOCGIF", _IOC_NONE, 0x6d0b, 0x00 },
+{ "linux/synclink.h", "MGSL_IOCGPARAMS", _IOC_READ, 0x6d01, 0x1c },
+{ "linux/synclink.h", "MGSL_IOCGSTATS", _IOC_NONE, 0x6d07, 0x00 },
+{ "linux/synclink.h", "MGSL_IOCGTXIDLE", _IOC_NONE, 0x6d03, 0x00 },
+{ "linux/synclink.h", "MGSL_IOCGXCTRL", _IOC_NONE, 0x6d16, 0x00 },
+{ "linux/synclink.h", "MGSL_IOCGXSYNC", _IOC_NONE, 0x6d14, 0x00 },
+{ "linux/synclink.h", "MGSL_IOCLOOPTXDONE", _IOC_NONE, 0x6d09, 0x00 },
+{ "linux/synclink.h", "MGSL_IOCRXENABLE", _IOC_NONE, 0x6d05, 0x00 },
+{ "linux/synclink.h", "MGSL_IOCSGPIO", _IOC_WRITE, 0x6d10, 0x10 },
+{ "linux/synclink.h", "MGSL_IOCSIF", _IOC_NONE, 0x6d0a, 0x00 },
+{ "linux/synclink.h", "MGSL_IOCSPARAMS", _IOC_WRITE, 0x6d00, 0x1c },
+{ "linux/synclink.h", "MGSL_IOCSTXIDLE", _IOC_NONE, 0x6d02, 0x00 },
+{ "linux/synclink.h", "MGSL_IOCSXCTRL", _IOC_NONE, 0x6d15, 0x00 },
+{ "linux/synclink.h", "MGSL_IOCSXSYNC", _IOC_NONE, 0x6d13, 0x00 },
+{ "linux/synclink.h", "MGSL_IOCTXABORT", _IOC_NONE, 0x6d06, 0x00 },
+{ "linux/synclink.h", "MGSL_IOCTXENABLE", _IOC_NONE, 0x6d04, 0x00 },
+{ "linux/synclink.h", "MGSL_IOCWAITEVENT", _IOC_READ|_IOC_WRITE, 0x6d08, 0x04 },
+{ "linux/synclink.h", "MGSL_IOCWAITGPIO", _IOC_READ|_IOC_WRITE, 0x6d12, 0x10 },
+{ "linux/tee.h", "TEE_IOC_CANCEL", _IOC_READ, 0xa404, 0x08 },
+{ "linux/tee.h", "TEE_IOC_CLOSE_SESSION", _IOC_READ, 0xa405, 0x04 },
+{ "linux/tee.h", "TEE_IOC_INVOKE", _IOC_READ, 0xa403, 0x10 },
+{ "linux/tee.h", "TEE_IOC_OPEN_SESSION", _IOC_READ, 0xa402, 0x10 },
+{ "linux/tee.h", "TEE_IOC_SHM_ALLOC", _IOC_READ|_IOC_WRITE, 0xa401, 0x10 },
+{ "linux/tee.h", "TEE_IOC_SHM_REGISTER", _IOC_READ|_IOC_WRITE, 0xa409, 0x18 },
+{ "linux/tee.h", "TEE_IOC_SUPPL_RECV", _IOC_READ, 0xa406, 0x10 },
+{ "linux/tee.h", "TEE_IOC_SUPPL_SEND", _IOC_READ, 0xa407, 0x10 },
+{ "linux/tee.h", "TEE_IOC_VERSION", _IOC_READ, 0xa400, 0x0c },
+{ "linux/timerfd.h", "TFD_IOC_SET_TICKS", _IOC_WRITE, 0x5400, 0x08 },
+{ "linux/toshiba.h", "TOSHIBA_ACPI_SCI", _IOC_READ|_IOC_WRITE, 0x7491, 0x18 },
+{ "linux/toshiba.h", "TOSH_SMM", _IOC_READ|_IOC_WRITE, 0x7490, 0x18 },
+{ "linux/udf_fs_i.h", "UDF_GETEABLOCK", _IOC_READ, 0x6c41, 0x04 },
+{ "linux/udf_fs_i.h", "UDF_GETEASIZE", _IOC_READ, 0x6c40, 0x04 },
+{ "linux/udf_fs_i.h", "UDF_GETVOLIDENT", _IOC_READ, 0x6c42, 0x04 },
+{ "linux/udf_fs_i.h", "UDF_RELOCATE_BLOCKS", _IOC_READ|_IOC_WRITE, 0x6c43, 0x04 },
+{ "linux/udmabuf.h", "UDMABUF_CREATE", _IOC_WRITE, 0x7542, 0x18 },
+{ "linux/udmabuf.h", "UDMABUF_CREATE_LIST", _IOC_WRITE, 0x7543, 0x08 },
+{ "linux/uinput.h", "UI_ABS_SETUP", _IOC_WRITE, 0x5504, 0x1a },
+{ "linux/uinput.h", "UI_BEGIN_FF_ERASE", _IOC_READ|_IOC_WRITE, 0x55ca, 0x0c },
+{ "linux/uinput.h", "UI_BEGIN_FF_UPLOAD", _IOC_READ|_IOC_WRITE, 0x55c8, 0x58 },
+{ "linux/uinput.h", "UI_DEV_CREATE", _IOC_NONE, 0x5501, 0x00 },
+{ "linux/uinput.h", "UI_DEV_DESTROY", _IOC_NONE, 0x5502, 0x00 },
+{ "linux/uinput.h", "UI_DEV_SETUP", _IOC_WRITE, 0x5503, 0x5c },
+{ "linux/uinput.h", "UI_END_FF_ERASE", _IOC_WRITE, 0x55cb, 0x0c },
+{ "linux/uinput.h", "UI_END_FF_UPLOAD", _IOC_WRITE, 0x55c9, 0x58 },
+{ "linux/uinput.h", "UI_GET_VERSION", _IOC_READ, 0x552d, 0x04 },
+{ "linux/uinput.h", "UI_SET_ABSBIT", _IOC_WRITE, 0x5567, 0x04 },
+{ "linux/uinput.h", "UI_SET_EVBIT", _IOC_WRITE, 0x5564, 0x04 },
+{ "linux/uinput.h", "UI_SET_FFBIT", _IOC_WRITE, 0x556b, 0x04 },
+{ "linux/uinput.h", "UI_SET_KEYBIT", _IOC_WRITE, 0x5565, 0x04 },
+{ "linux/uinput.h", "UI_SET_LEDBIT", _IOC_WRITE, 0x5569, 0x04 },
+{ "linux/uinput.h", "UI_SET_MSCBIT", _IOC_WRITE, 0x5568, 0x04 },
+{ "linux/uinput.h", "UI_SET_PHYS", _IOC_WRITE, 0x556c, 0x04 },
+{ "linux/uinput.h", "UI_SET_PROPBIT", _IOC_WRITE, 0x556e, 0x04 },
+{ "linux/uinput.h", "UI_SET_RELBIT", _IOC_WRITE, 0x5566, 0x04 },
+{ "linux/uinput.h", "UI_SET_SNDBIT", _IOC_WRITE, 0x556a, 0x04 },
+{ "linux/uinput.h", "UI_SET_SWBIT", _IOC_WRITE, 0x556d, 0x04 },
+{ "linux/usb/cdc-wdm.h", "IOCTL_WDM_MAX_COMMAND", _IOC_READ, 0x48a0, 0x02 },
+{ "linux/usb/functionfs.h", "FUNCTIONFS_CLEAR_HALT", _IOC_NONE, 0x6703, 0x00 },
+{ "linux/usb/functionfs.h", "FUNCTIONFS_ENDPOINT_DESC", _IOC_READ, 0x6782, 0x09 },
+{ "linux/usb/functionfs.h", "FUNCTIONFS_ENDPOINT_REVMAP", _IOC_NONE, 0x6781, 0x00 },
+{ "linux/usb/functionfs.h", "FUNCTIONFS_FIFO_FLUSH", _IOC_NONE, 0x6702, 0x00 },
+{ "linux/usb/functionfs.h", "FUNCTIONFS_FIFO_STATUS", _IOC_NONE, 0x6701, 0x00 },
+{ "linux/usb/functionfs.h", "FUNCTIONFS_INTERFACE_REVMAP", _IOC_NONE, 0x6780, 0x00 },
+{ "linux/usb/g_printer.h", "GADGET_GET_PRINTER_STATUS", _IOC_READ, 0x6721, 0x01 },
+{ "linux/usb/g_printer.h", "GADGET_SET_PRINTER_STATUS", _IOC_READ|_IOC_WRITE, 0x6722, 0x01 },
+{ "linux/usb/g_uvc.h", "UVCIOC_SEND_RESPONSE", _IOC_WRITE, 0x5501, 0x40 },
+{ "linux/usb/gadgetfs.h", "GADGETFS_CLEAR_HALT", _IOC_NONE, 0x6703, 0x00 },
+{ "linux/usb/gadgetfs.h", "GADGETFS_FIFO_FLUSH", _IOC_NONE, 0x6702, 0x00 },
+{ "linux/usb/gadgetfs.h", "GADGETFS_FIFO_STATUS", _IOC_NONE, 0x6701, 0x00 },
+{ "linux/usb/iowarrior.h", "IOW_GETINFO", _IOC_READ, 0xc003, 0x26 },
+{ "linux/usb/iowarrior.h", "IOW_READ", _IOC_WRITE, 0xc002, 0x04 },
+{ "linux/usb/iowarrior.h", "IOW_WRITE", _IOC_WRITE, 0xc001, 0x04 },
+{ "linux/usb/raw_gadget.h", "USB_RAW_IOCTL_CONFIGURE", _IOC_NONE, 0x5509, 0x00 },
+{ "linux/usb/raw_gadget.h", "USB_RAW_IOCTL_EP0_READ", _IOC_READ|_IOC_WRITE, 0x5504, 0x08 },
+{ "linux/usb/raw_gadget.h", "USB_RAW_IOCTL_EP0_STALL", _IOC_NONE, 0x550c, 0x00 },
+{ "linux/usb/raw_gadget.h", "USB_RAW_IOCTL_EP0_WRITE", _IOC_WRITE, 0x5503, 0x08 },
+{ "linux/usb/raw_gadget.h", "USB_RAW_IOCTL_EPS_INFO", _IOC_READ, 0x550b, 0x384 },
+{ "linux/usb/raw_gadget.h", "USB_RAW_IOCTL_EP_CLEAR_HALT", _IOC_WRITE, 0x550e, 0x04 },
+{ "linux/usb/raw_gadget.h", "USB_RAW_IOCTL_EP_DISABLE", _IOC_WRITE, 0x5506, 0x04 },
+{ "linux/usb/raw_gadget.h", "USB_RAW_IOCTL_EP_ENABLE", _IOC_WRITE, 0x5505, 0x09 },
+{ "linux/usb/raw_gadget.h", "USB_RAW_IOCTL_EP_READ", _IOC_READ|_IOC_WRITE, 0x5508, 0x08 },
+{ "linux/usb/raw_gadget.h", "USB_RAW_IOCTL_EP_SET_HALT", _IOC_WRITE, 0x550d, 0x04 },
+{ "linux/usb/raw_gadget.h", "USB_RAW_IOCTL_EP_SET_WEDGE", _IOC_WRITE, 0x550f, 0x04 },
+{ "linux/usb/raw_gadget.h", "USB_RAW_IOCTL_EP_WRITE", _IOC_WRITE, 0x5507, 0x08 },
+{ "linux/usb/raw_gadget.h", "USB_RAW_IOCTL_EVENT_FETCH", _IOC_READ, 0x5502, 0x08 },
+{ "linux/usb/raw_gadget.h", "USB_RAW_IOCTL_INIT", _IOC_WRITE, 0x5500, 0x101 },
+{ "linux/usb/raw_gadget.h", "USB_RAW_IOCTL_RUN", _IOC_NONE, 0x5501, 0x00 },
+{ "linux/usb/raw_gadget.h", "USB_RAW_IOCTL_VBUS_DRAW", _IOC_WRITE, 0x550a, 0x04 },
+{ "linux/usb/tmc.h", "USBTMC488_IOCTL_GET_CAPS", _IOC_READ, 0x5b11, 0x01 },
+{ "linux/usb/tmc.h", "USBTMC488_IOCTL_GOTO_LOCAL", _IOC_NONE, 0x5b14, 0x00 },
+{ "linux/usb/tmc.h", "USBTMC488_IOCTL_LOCAL_LOCKOUT", _IOC_NONE, 0x5b15, 0x00 },
+{ "linux/usb/tmc.h", "USBTMC488_IOCTL_READ_STB", _IOC_READ, 0x5b12, 0x01 },
+{ "linux/usb/tmc.h", "USBTMC488_IOCTL_REN_CONTROL", _IOC_WRITE, 0x5b13, 0x01 },
+{ "linux/usb/tmc.h", "USBTMC488_IOCTL_TRIGGER", _IOC_NONE, 0x5b16, 0x00 },
+{ "linux/usb/tmc.h", "USBTMC488_IOCTL_WAIT_SRQ", _IOC_WRITE, 0x5b17, 0x04 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_ABORT_BULK_IN", _IOC_NONE, 0x5b04, 0x00 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_ABORT_BULK_OUT", _IOC_NONE, 0x5b03, 0x00 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_API_VERSION", _IOC_READ, 0x5b10, 0x04 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_AUTO_ABORT", _IOC_WRITE, 0x5b19, 0x01 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_CANCEL_IO", _IOC_NONE, 0x5b23, 0x00 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_CLEANUP_IO", _IOC_NONE, 0x5b24, 0x00 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_CLEAR", _IOC_NONE, 0x5b02, 0x00 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_CLEAR_IN_HALT", _IOC_NONE, 0x5b07, 0x00 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_CLEAR_OUT_HALT", _IOC_NONE, 0x5b06, 0x00 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_CONFIG_TERMCHAR", _IOC_WRITE, 0x5b0c, 0x02 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_CTRL_REQUEST", _IOC_READ|_IOC_WRITE, 0x5b08, 0x0c },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_EOM_ENABLE", _IOC_WRITE, 0x5b0b, 0x01 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_GET_TIMEOUT", _IOC_READ, 0x5b09, 0x04 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_INDICATOR_PULSE", _IOC_NONE, 0x5b01, 0x00 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_MSG_IN_ATTR", _IOC_READ, 0x5b18, 0x01 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_READ", _IOC_READ|_IOC_WRITE, 0x5b0e, 0x10 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_SET_TIMEOUT", _IOC_WRITE, 0x5b0a, 0x04 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_WRITE", _IOC_READ|_IOC_WRITE, 0x5b0d, 0x10 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_WRITE_RESULT", _IOC_READ|_IOC_WRITE, 0x5b0f, 0x04 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_ALLOC_STREAMS", _IOC_READ, 0x551c, 0x08 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_ALLOW_SUSPEND", _IOC_NONE, 0x5522, 0x00 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_BULK32", _IOC_READ|_IOC_WRITE, 0x5502, 0x10 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_CLAIMINTERFACE", _IOC_READ, 0x550f, 0x04 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_CLAIM_PORT", _IOC_READ, 0x5518, 0x04 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_CLEAR_HALT", _IOC_READ, 0x5515, 0x04 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_CONNECT", _IOC_NONE, 0x5517, 0x00 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_CONNECTINFO", _IOC_WRITE, 0x5511, 0x06 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_CONTROL32", _IOC_READ|_IOC_WRITE, 0x5500, 0x10 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_DISCARDURB", _IOC_NONE, 0x550b, 0x00 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_DISCONNECT", _IOC_NONE, 0x5516, 0x00 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_DISCONNECT_CLAIM", _IOC_READ, 0x551b, 0x108 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_DISCSIGNAL32", _IOC_READ, 0x550e, 0x08 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_DROP_PRIVILEGES", _IOC_WRITE, 0x551e, 0x04 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_FORBID_SUSPEND", _IOC_NONE, 0x5521, 0x00 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_FREE_STREAMS", _IOC_READ, 0x551d, 0x08 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_GETDRIVER", _IOC_WRITE, 0x5508, 0x104 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_GET_CAPABILITIES", _IOC_READ, 0x551a, 0x04 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_GET_SPEED", _IOC_NONE, 0x551f, 0x00 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_HUB_PORTINFO", _IOC_READ, 0x5513, 0x80 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_IOCTL32", _IOC_READ|_IOC_WRITE, 0x5512, 0x0c },
+{ "linux/usbdevice_fs.h", "USBDEVFS_REAPURB32", _IOC_WRITE, 0x550c, 0x04 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_REAPURBNDELAY32", _IOC_WRITE, 0x550d, 0x04 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_RELEASEINTERFACE", _IOC_READ, 0x5510, 0x04 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_RELEASE_PORT", _IOC_READ, 0x5519, 0x04 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_RESET", _IOC_NONE, 0x5514, 0x00 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_RESETEP", _IOC_READ, 0x5503, 0x04 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_SETCONFIGURATION", _IOC_READ, 0x5505, 0x04 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_SETINTERFACE", _IOC_READ, 0x5504, 0x08 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_SUBMITURB", _IOC_READ, 0x550a, 0x2a },
+{ "linux/usbdevice_fs.h", "USBDEVFS_SUBMITURB32", _IOC_READ, 0x550a, 0x2a },
+{ "linux/usbdevice_fs.h", "USBDEVFS_WAIT_FOR_RESUME", _IOC_NONE, 0x5523, 0x00 },
+{ "linux/userfaultfd.h", "UFFDIO_API", _IOC_READ|_IOC_WRITE, 0xaa3f, 0x18 },
+{ "linux/userfaultfd.h", "UFFDIO_COPY", _IOC_READ|_IOC_WRITE, 0xaa03, 0x28 },
+{ "linux/userfaultfd.h", "UFFDIO_REGISTER", _IOC_READ|_IOC_WRITE, 0xaa00, 0x20 },
+{ "linux/userfaultfd.h", "UFFDIO_UNREGISTER", _IOC_READ, 0xaa01, 0x10 },
+{ "linux/userfaultfd.h", "UFFDIO_WAKE", _IOC_READ, 0xaa02, 0x10 },
+{ "linux/userfaultfd.h", "UFFDIO_WRITEPROTECT", _IOC_READ|_IOC_WRITE, 0xaa06, 0x18 },
+{ "linux/userfaultfd.h", "UFFDIO_ZEROPAGE", _IOC_READ|_IOC_WRITE, 0xaa04, 0x20 },
+{ "linux/uvcvideo.h", "UVCIOC_CTRL_MAP", _IOC_READ|_IOC_WRITE, 0x7520, 0x58 },
+{ "linux/uvcvideo.h", "UVCIOC_CTRL_QUERY", _IOC_READ|_IOC_WRITE, 0x7521, 0x0a },
+{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL", _IOC_READ|_IOC_WRITE, 0x564b, 0x40 },
+{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_ENUM_FRAME_SIZE", _IOC_READ|_IOC_WRITE, 0x564a, 0x40 },
+{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_ENUM_MBUS_CODE", _IOC_READ|_IOC_WRITE, 0x5602, 0x30 },
+{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_CROP", _IOC_READ|_IOC_WRITE, 0x563b, 0x38 },
+{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_FMT", _IOC_READ|_IOC_WRITE, 0x5604, 0x58 },
+{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_FRAME_INTERVAL", _IOC_READ|_IOC_WRITE, 0x5615, 0x30 },
+{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_SELECTION", _IOC_READ|_IOC_WRITE, 0x563d, 0x40 },
+{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_QUERYCAP", _IOC_READ, 0x5600, 0x40 },
+{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_CROP", _IOC_READ|_IOC_WRITE, 0x563c, 0x38 },
+{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_FMT", _IOC_READ|_IOC_WRITE, 0x5605, 0x58 },
+{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_FRAME_INTERVAL", _IOC_READ|_IOC_WRITE, 0x5616, 0x30 },
+{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_SELECTION", _IOC_READ|_IOC_WRITE, 0x563e, 0x40 },
+{ "linux/vboxguest.h", "VBG_IOCTL_ACQUIRE_GUEST_CAPABILITIES", _IOC_READ|_IOC_WRITE, 0x560d, 0x24 },
+{ "linux/vboxguest.h", "VBG_IOCTL_CHANGE_FILTER_MASK", _IOC_READ|_IOC_WRITE, 0x560c, 0x20 },
+{ "linux/vboxguest.h", "VBG_IOCTL_CHANGE_GUEST_CAPABILITIES", _IOC_READ|_IOC_WRITE, 0x560e, 0x20 },
+{ "linux/vboxguest.h", "VBG_IOCTL_CHECK_BALLOON", _IOC_READ|_IOC_WRITE, 0x5611, 0x20 },
+{ "linux/vboxguest.h", "VBG_IOCTL_DRIVER_VERSION_INFO", _IOC_READ|_IOC_WRITE, 0x5600, 0x2c },
+{ "linux/vboxguest.h", "VBG_IOCTL_HGCM_CONNECT", _IOC_READ|_IOC_WRITE, 0x5604, 0x9c },
+{ "linux/vboxguest.h", "VBG_IOCTL_HGCM_DISCONNECT", _IOC_READ|_IOC_WRITE, 0x5605, 0x1c },
+{ "linux/vboxguest.h", "VBG_IOCTL_INTERRUPT_ALL_WAIT_FOR_EVENTS", _IOC_READ|_IOC_WRITE, 0x560b, 0x18 },
+{ "linux/vboxguest.h", "VBG_IOCTL_VMMDEV_REQUEST_BIG", _IOC_NONE, 0x5603, 0x00 },
+{ "linux/vboxguest.h", "VBG_IOCTL_WAIT_FOR_EVENTS", _IOC_READ|_IOC_WRITE, 0x560a, 0x20 },
+{ "linux/vboxguest.h", "VBG_IOCTL_WRITE_CORE_DUMP", _IOC_READ|_IOC_WRITE, 0x5613, 0x1c },
+{ "linux/vfio.h", "VFIO_CHECK_EXTENSION", _IOC_NONE, 0x3b65, 0x00 },
+{ "linux/vfio.h", "VFIO_DEVICE_FEATURE", _IOC_NONE, 0x3b75, 0x00 },
+{ "linux/vfio.h", "VFIO_DEVICE_GET_GFX_DMABUF", _IOC_NONE, 0x3b73, 0x00 },
+{ "linux/vfio.h", "VFIO_DEVICE_GET_INFO", _IOC_NONE, 0x3b6b, 0x00 },
+{ "linux/vfio.h", "VFIO_DEVICE_GET_IRQ_INFO", _IOC_NONE, 0x3b6d, 0x00 },
+{ "linux/vfio.h", "VFIO_DEVICE_GET_PCI_HOT_RESET_INFO", _IOC_NONE, 0x3b70, 0x00 },
+{ "linux/vfio.h", "VFIO_DEVICE_GET_REGION_INFO", _IOC_NONE, 0x3b6c, 0x00 },
+{ "linux/vfio.h", "VFIO_DEVICE_IOEVENTFD", _IOC_NONE, 0x3b74, 0x00 },
+{ "linux/vfio.h", "VFIO_DEVICE_PCI_HOT_RESET", _IOC_NONE, 0x3b71, 0x00 },
+{ "linux/vfio.h", "VFIO_DEVICE_QUERY_GFX_PLANE", _IOC_NONE, 0x3b72, 0x00 },
+{ "linux/vfio.h", "VFIO_DEVICE_RESET", _IOC_NONE, 0x3b6f, 0x00 },
+{ "linux/vfio.h", "VFIO_DEVICE_SET_IRQS", _IOC_NONE, 0x3b6e, 0x00 },
+{ "linux/vfio.h", "VFIO_EEH_PE_OP", _IOC_NONE, 0x3b79, 0x00 },
+{ "linux/vfio.h", "VFIO_GET_API_VERSION", _IOC_NONE, 0x3b64, 0x00 },
+{ "linux/vfio.h", "VFIO_GROUP_GET_DEVICE_FD", _IOC_NONE, 0x3b6a, 0x00 },
+{ "linux/vfio.h", "VFIO_GROUP_GET_STATUS", _IOC_NONE, 0x3b67, 0x00 },
+{ "linux/vfio.h", "VFIO_GROUP_SET_CONTAINER", _IOC_NONE, 0x3b68, 0x00 },
+{ "linux/vfio.h", "VFIO_GROUP_UNSET_CONTAINER", _IOC_NONE, 0x3b69, 0x00 },
+{ "linux/vfio.h", "VFIO_IOMMU_DIRTY_PAGES", _IOC_NONE, 0x3b75, 0x00 },
+{ "linux/vfio.h", "VFIO_IOMMU_DISABLE", _IOC_NONE, 0x3b74, 0x00 },
+{ "linux/vfio.h", "VFIO_IOMMU_ENABLE", _IOC_NONE, 0x3b73, 0x00 },
+{ "linux/vfio.h", "VFIO_IOMMU_GET_INFO", _IOC_NONE, 0x3b70, 0x00 },
+{ "linux/vfio.h", "VFIO_IOMMU_MAP_DMA", _IOC_NONE, 0x3b71, 0x00 },
+{ "linux/vfio.h", "VFIO_IOMMU_SPAPR_REGISTER_MEMORY", _IOC_NONE, 0x3b75, 0x00 },
+{ "linux/vfio.h", "VFIO_IOMMU_SPAPR_TCE_CREATE", _IOC_NONE, 0x3b77, 0x00 },
+{ "linux/vfio.h", "VFIO_IOMMU_SPAPR_TCE_GET_INFO", _IOC_NONE, 0x3b70, 0x00 },
+{ "linux/vfio.h", "VFIO_IOMMU_SPAPR_TCE_REMOVE", _IOC_NONE, 0x3b78, 0x00 },
+{ "linux/vfio.h", "VFIO_IOMMU_SPAPR_UNREGISTER_MEMORY", _IOC_NONE, 0x3b76, 0x00 },
+{ "linux/vfio.h", "VFIO_IOMMU_UNMAP_DMA", _IOC_NONE, 0x3b72, 0x00 },
+{ "linux/vfio.h", "VFIO_SET_IOMMU", _IOC_NONE, 0x3b66, 0x00 },
+{ "linux/vhost.h", "VHOST_GET_BACKEND_FEATURES", _IOC_READ, 0xaf26, 0x08 },
+{ "linux/vhost.h", "VHOST_GET_FEATURES", _IOC_READ, 0xaf00, 0x08 },
+{ "linux/vhost.h", "VHOST_GET_VRING_BASE", _IOC_READ|_IOC_WRITE, 0xaf12, 0x08 },
+{ "linux/vhost.h", "VHOST_GET_VRING_BUSYLOOP_TIMEOUT", _IOC_WRITE, 0xaf24, 0x08 },
+{ "linux/vhost.h", "VHOST_GET_VRING_ENDIAN", _IOC_WRITE, 0xaf14, 0x08 },
+{ "linux/vhost.h", "VHOST_NET_SET_BACKEND", _IOC_WRITE, 0xaf30, 0x08 },
+{ "linux/vhost.h", "VHOST_RESET_OWNER", _IOC_NONE, 0xaf02, 0x00 },
+{ "linux/vhost.h", "VHOST_SCSI_CLEAR_ENDPOINT", _IOC_WRITE, 0xaf41, 0xe8 },
+{ "linux/vhost.h", "VHOST_SCSI_GET_ABI_VERSION", _IOC_WRITE, 0xaf42, 0x04 },
+{ "linux/vhost.h", "VHOST_SCSI_GET_EVENTS_MISSED", _IOC_WRITE, 0xaf44, 0x04 },
+{ "linux/vhost.h", "VHOST_SCSI_SET_ENDPOINT", _IOC_WRITE, 0xaf40, 0xe8 },
+{ "linux/vhost.h", "VHOST_SCSI_SET_EVENTS_MISSED", _IOC_WRITE, 0xaf43, 0x04 },
+{ "linux/vhost.h", "VHOST_SET_BACKEND_FEATURES", _IOC_WRITE, 0xaf25, 0x08 },
+{ "linux/vhost.h", "VHOST_SET_FEATURES", _IOC_WRITE, 0xaf00, 0x08 },
+{ "linux/vhost.h", "VHOST_SET_LOG_BASE", _IOC_WRITE, 0xaf04, 0x08 },
+{ "linux/vhost.h", "VHOST_SET_LOG_FD", _IOC_WRITE, 0xaf07, 0x04 },
+{ "linux/vhost.h", "VHOST_SET_MEM_TABLE", _IOC_WRITE, 0xaf03, 0x08 },
+{ "linux/vhost.h", "VHOST_SET_OWNER", _IOC_NONE, 0xaf01, 0x00 },
+{ "linux/vhost.h", "VHOST_SET_VRING_ADDR", _IOC_WRITE, 0xaf11, 0x28 },
+{ "linux/vhost.h", "VHOST_SET_VRING_BASE", _IOC_WRITE, 0xaf12, 0x08 },
+{ "linux/vhost.h", "VHOST_SET_VRING_BUSYLOOP_TIMEOUT", _IOC_WRITE, 0xaf23, 0x08 },
+{ "linux/vhost.h", "VHOST_SET_VRING_CALL", _IOC_WRITE, 0xaf21, 0x08 },
+{ "linux/vhost.h", "VHOST_SET_VRING_ENDIAN", _IOC_WRITE, 0xaf13, 0x08 },
+{ "linux/vhost.h", "VHOST_SET_VRING_ERR", _IOC_WRITE, 0xaf22, 0x08 },
+{ "linux/vhost.h", "VHOST_SET_VRING_KICK", _IOC_WRITE, 0xaf20, 0x08 },
+{ "linux/vhost.h", "VHOST_SET_VRING_NUM", _IOC_WRITE, 0xaf10, 0x08 },
+{ "linux/vhost.h", "VHOST_VDPA_GET_CONFIG", _IOC_READ, 0xaf73, 0x08 },
+{ "linux/vhost.h", "VHOST_VDPA_GET_DEVICE_ID", _IOC_READ, 0xaf70, 0x04 },
+{ "linux/vhost.h", "VHOST_VDPA_GET_IOVA_RANGE", _IOC_READ, 0xaf78, 0x10 },
+{ "linux/vhost.h", "VHOST_VDPA_GET_STATUS", _IOC_READ, 0xaf71, 0x01 },
+{ "linux/vhost.h", "VHOST_VDPA_GET_VRING_NUM", _IOC_READ, 0xaf76, 0x02 },
+{ "linux/vhost.h", "VHOST_VDPA_SET_CONFIG", _IOC_WRITE, 0xaf74, 0x08 },
+{ "linux/vhost.h", "VHOST_VDPA_SET_CONFIG_CALL", _IOC_WRITE, 0xaf77, 0x04 },
+{ "linux/vhost.h", "VHOST_VDPA_SET_STATUS", _IOC_WRITE, 0xaf72, 0x01 },
+{ "linux/vhost.h", "VHOST_VDPA_SET_VRING_ENABLE", _IOC_WRITE, 0xaf75, 0x08 },
+{ "linux/vhost.h", "VHOST_VSOCK_SET_GUEST_CID", _IOC_WRITE, 0xaf60, 0x08 },
+{ "linux/vhost.h", "VHOST_VSOCK_SET_RUNNING", _IOC_WRITE, 0xaf61, 0x04 },
+{ "linux/videodev2.h", "VIDIOC_CREATE_BUFS", _IOC_READ|_IOC_WRITE, 0x565c, 0xf8 },
+{ "linux/videodev2.h", "VIDIOC_CROPCAP", _IOC_READ|_IOC_WRITE, 0x563a, 0x2c },
+{ "linux/videodev2.h", "VIDIOC_DBG_G_CHIP_INFO", _IOC_READ|_IOC_WRITE, 0x5666, 0xc8 },
+{ "linux/videodev2.h", "VIDIOC_DBG_G_REGISTER", _IOC_READ|_IOC_WRITE, 0x5650, 0x38 },
+{ "linux/videodev2.h", "VIDIOC_DBG_S_REGISTER", _IOC_WRITE, 0x564f, 0x38 },
+{ "linux/videodev2.h", "VIDIOC_DECODER_CMD", _IOC_READ|_IOC_WRITE, 0x5660, 0x48 },
+{ "linux/videodev2.h", "VIDIOC_DQBUF", _IOC_READ|_IOC_WRITE, 0x5611, 0x4c },
+{ "linux/videodev2.h", "VIDIOC_DQEVENT", _IOC_READ, 0x5659, 0x80 },
+{ "linux/videodev2.h", "VIDIOC_DV_TIMINGS_CAP", _IOC_READ|_IOC_WRITE, 0x5664, 0x90 },
+{ "linux/videodev2.h", "VIDIOC_ENCODER_CMD", _IOC_READ|_IOC_WRITE, 0x564d, 0x28 },
+{ "linux/videodev2.h", "VIDIOC_ENUMAUDIO", _IOC_READ|_IOC_WRITE, 0x5641, 0x34 },
+{ "linux/videodev2.h", "VIDIOC_ENUMAUDOUT", _IOC_READ|_IOC_WRITE, 0x5642, 0x34 },
+{ "linux/videodev2.h", "VIDIOC_ENUMINPUT", _IOC_READ|_IOC_WRITE, 0x561a, 0x4c },
+{ "linux/videodev2.h", "VIDIOC_ENUMOUTPUT", _IOC_READ|_IOC_WRITE, 0x5630, 0x48 },
+{ "linux/videodev2.h", "VIDIOC_ENUMSTD", _IOC_READ|_IOC_WRITE, 0x5619, 0x40 },
+{ "linux/videodev2.h", "VIDIOC_ENUM_DV_TIMINGS", _IOC_READ|_IOC_WRITE, 0x5662, 0x94 },
+{ "linux/videodev2.h", "VIDIOC_ENUM_FMT", _IOC_READ|_IOC_WRITE, 0x5602, 0x40 },
+{ "linux/videodev2.h", "VIDIOC_ENUM_FRAMEINTERVALS", _IOC_READ|_IOC_WRITE, 0x564b, 0x34 },
+{ "linux/videodev2.h", "VIDIOC_ENUM_FRAMESIZES", _IOC_READ|_IOC_WRITE, 0x564a, 0x2c },
+{ "linux/videodev2.h", "VIDIOC_ENUM_FREQ_BANDS", _IOC_READ|_IOC_WRITE, 0x5665, 0x40 },
+{ "linux/videodev2.h", "VIDIOC_EXPBUF", _IOC_READ|_IOC_WRITE, 0x5610, 0x40 },
+{ "linux/videodev2.h", "VIDIOC_G_AUDIO", _IOC_READ, 0x5621, 0x34 },
+{ "linux/videodev2.h", "VIDIOC_G_AUDOUT", _IOC_READ, 0x5631, 0x34 },
+{ "linux/videodev2.h", "VIDIOC_G_CROP", _IOC_READ|_IOC_WRITE, 0x563b, 0x14 },
+{ "linux/videodev2.h", "VIDIOC_G_CTRL", _IOC_READ|_IOC_WRITE, 0x561b, 0x08 },
+{ "linux/videodev2.h", "VIDIOC_G_DV_TIMINGS", _IOC_READ|_IOC_WRITE, 0x5658, 0x84 },
+{ "linux/videodev2.h", "VIDIOC_G_EDID", _IOC_READ|_IOC_WRITE, 0x5628, 0x24 },
+{ "linux/videodev2.h", "VIDIOC_G_ENC_INDEX", _IOC_READ, 0x564c, 0x818 },
+{ "linux/videodev2.h", "VIDIOC_G_EXT_CTRLS", _IOC_READ|_IOC_WRITE, 0x5647, 0x18 },
+{ "linux/videodev2.h", "VIDIOC_G_FBUF", _IOC_READ, 0x560a, 0x2c },
+{ "linux/videodev2.h", "VIDIOC_G_FMT", _IOC_READ|_IOC_WRITE, 0x5604, 0xcc },
+{ "linux/videodev2.h", "VIDIOC_G_FREQUENCY", _IOC_READ|_IOC_WRITE, 0x5638, 0x2c },
+{ "linux/videodev2.h", "VIDIOC_G_INPUT", _IOC_READ, 0x5626, 0x04 },
+{ "linux/videodev2.h", "VIDIOC_G_JPEGCOMP", _IOC_READ, 0x563d, 0x8c },
+{ "linux/videodev2.h", "VIDIOC_G_MODULATOR", _IOC_READ|_IOC_WRITE, 0x5636, 0x44 },
+{ "linux/videodev2.h", "VIDIOC_G_OUTPUT", _IOC_READ, 0x562e, 0x04 },
+{ "linux/videodev2.h", "VIDIOC_G_PARM", _IOC_READ|_IOC_WRITE, 0x5615, 0xcc },
+{ "linux/videodev2.h", "VIDIOC_G_PRIORITY", _IOC_READ, 0x5643, 0x04 },
+{ "linux/videodev2.h", "VIDIOC_G_SELECTION", _IOC_READ|_IOC_WRITE, 0x565e, 0x40 },
+{ "linux/videodev2.h", "VIDIOC_G_SLICED_VBI_CAP", _IOC_READ|_IOC_WRITE, 0x5645, 0x72 },
+{ "linux/videodev2.h", "VIDIOC_G_STD", _IOC_READ, 0x5617, 0x08 },
+{ "linux/videodev2.h", "VIDIOC_G_TUNER", _IOC_READ|_IOC_WRITE, 0x561d, 0x54 },
+{ "linux/videodev2.h", "VIDIOC_LOG_STATUS", _IOC_NONE, 0x5646, 0x00 },
+{ "linux/videodev2.h", "VIDIOC_OVERLAY", _IOC_WRITE, 0x560e, 0x04 },
+{ "linux/videodev2.h", "VIDIOC_PREPARE_BUF", _IOC_READ|_IOC_WRITE, 0x565d, 0x4c },
+{ "linux/videodev2.h", "VIDIOC_QBUF", _IOC_READ|_IOC_WRITE, 0x560f, 0x4c },
+{ "linux/videodev2.h", "VIDIOC_QUERYBUF", _IOC_READ|_IOC_WRITE, 0x5609, 0x4c },
+{ "linux/videodev2.h", "VIDIOC_QUERYCAP", _IOC_READ, 0x5600, 0x68 },
+{ "linux/videodev2.h", "VIDIOC_QUERYCTRL", _IOC_READ|_IOC_WRITE, 0x5624, 0x44 },
+{ "linux/videodev2.h", "VIDIOC_QUERYMENU", _IOC_READ|_IOC_WRITE, 0x5625, 0x2c },
+{ "linux/videodev2.h", "VIDIOC_QUERYSTD", _IOC_READ, 0x563f, 0x08 },
+{ "linux/videodev2.h", "VIDIOC_QUERY_DV_TIMINGS", _IOC_READ, 0x5663, 0x84 },
+{ "linux/videodev2.h", "VIDIOC_QUERY_EXT_CTRL", _IOC_READ|_IOC_WRITE, 0x5667, 0xe8 },
+{ "linux/videodev2.h", "VIDIOC_REQBUFS", _IOC_READ|_IOC_WRITE, 0x5608, 0x14 },
+{ "linux/videodev2.h", "VIDIOC_STREAMOFF", _IOC_WRITE, 0x5613, 0x04 },
+{ "linux/videodev2.h", "VIDIOC_STREAMON", _IOC_WRITE, 0x5612, 0x04 },
+{ "linux/videodev2.h", "VIDIOC_SUBSCRIBE_EVENT", _IOC_WRITE, 0x565a, 0x20 },
+{ "linux/videodev2.h", "VIDIOC_S_AUDIO", _IOC_WRITE, 0x5622, 0x34 },
+{ "linux/videodev2.h", "VIDIOC_S_AUDOUT", _IOC_WRITE, 0x5632, 0x34 },
+{ "linux/videodev2.h", "VIDIOC_S_CROP", _IOC_WRITE, 0x563c, 0x14 },
+{ "linux/videodev2.h", "VIDIOC_S_CTRL", _IOC_READ|_IOC_WRITE, 0x561c, 0x08 },
+{ "linux/videodev2.h", "VIDIOC_S_DV_TIMINGS", _IOC_READ|_IOC_WRITE, 0x5657, 0x84 },
+{ "linux/videodev2.h", "VIDIOC_S_EDID", _IOC_READ|_IOC_WRITE, 0x5629, 0x24 },
+{ "linux/videodev2.h", "VIDIOC_S_EXT_CTRLS", _IOC_READ|_IOC_WRITE, 0x5648, 0x18 },
+{ "linux/videodev2.h", "VIDIOC_S_FBUF", _IOC_WRITE, 0x560b, 0x2c },
+{ "linux/videodev2.h", "VIDIOC_S_FMT", _IOC_READ|_IOC_WRITE, 0x5605, 0xcc },
+{ "linux/videodev2.h", "VIDIOC_S_FREQUENCY", _IOC_WRITE, 0x5639, 0x2c },
+{ "linux/videodev2.h", "VIDIOC_S_HW_FREQ_SEEK", _IOC_WRITE, 0x5652, 0x30 },
+{ "linux/videodev2.h", "VIDIOC_S_INPUT", _IOC_READ|_IOC_WRITE, 0x5627, 0x04 },
+{ "linux/videodev2.h", "VIDIOC_S_JPEGCOMP", _IOC_WRITE, 0x563e, 0x8c },
+{ "linux/videodev2.h", "VIDIOC_S_MODULATOR", _IOC_WRITE, 0x5637, 0x44 },
+{ "linux/videodev2.h", "VIDIOC_S_OUTPUT", _IOC_READ|_IOC_WRITE, 0x562f, 0x04 },
+{ "linux/videodev2.h", "VIDIOC_S_PARM", _IOC_READ|_IOC_WRITE, 0x5616, 0xcc },
+{ "linux/videodev2.h", "VIDIOC_S_PRIORITY", _IOC_WRITE, 0x5644, 0x04 },
+{ "linux/videodev2.h", "VIDIOC_S_SELECTION", _IOC_READ|_IOC_WRITE, 0x565f, 0x40 },
+{ "linux/videodev2.h", "VIDIOC_S_STD", _IOC_WRITE, 0x5618, 0x08 },
+{ "linux/videodev2.h", "VIDIOC_S_TUNER", _IOC_WRITE, 0x561e, 0x54 },
+{ "linux/videodev2.h", "VIDIOC_TRY_DECODER_CMD", _IOC_READ|_IOC_WRITE, 0x5661, 0x48 },
+{ "linux/videodev2.h", "VIDIOC_TRY_ENCODER_CMD", _IOC_READ|_IOC_WRITE, 0x564e, 0x28 },
+{ "linux/videodev2.h", "VIDIOC_TRY_EXT_CTRLS", _IOC_READ|_IOC_WRITE, 0x5649, 0x18 },
+{ "linux/videodev2.h", "VIDIOC_TRY_FMT", _IOC_READ|_IOC_WRITE, 0x5640, 0xcc },
+{ "linux/videodev2.h", "VIDIOC_UNSUBSCRIBE_EVENT", _IOC_WRITE, 0x565b, 0x20 },
+{ "linux/vm_sockets.h", "IOCTL_VM_SOCKETS_GET_LOCAL_CID", _IOC_NONE, 0x07b9, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_CTX_ADD_NOTIFICATION", _IOC_NONE, 0x07af, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_CTX_GET_CPT_STATE", _IOC_NONE, 0x07b1, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_CTX_REMOVE_NOTIFICATION", _IOC_NONE, 0x07b0, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_CTX_SET_CPT_STATE", _IOC_NONE, 0x07b2, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_DATAGRAM_RECEIVE", _IOC_NONE, 0x07ac, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_DATAGRAM_SEND", _IOC_NONE, 0x07ab, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_GET_CONTEXT_ID", _IOC_NONE, 0x07b3, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_INIT_CONTEXT", _IOC_NONE, 0x07a0, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_NOTIFICATIONS_RECEIVE", _IOC_NONE, 0x07a6, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_NOTIFY_RESOURCE", _IOC_NONE, 0x07a5, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_QUEUEPAIR_ALLOC", _IOC_NONE, 0x07a8, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_QUEUEPAIR_DETACH", _IOC_NONE, 0x07aa, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_QUEUEPAIR_SETPAGEFILE", _IOC_NONE, 0x07a9, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_QUEUEPAIR_SETVA", _IOC_NONE, 0x07a4, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_SET_NOTIFY", _IOC_NONE, 0x07cb, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_SOCKETS_GET_AF_VALUE", _IOC_NONE, 0x07b8, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_SOCKETS_GET_LOCAL_CID", _IOC_NONE, 0x07b9, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_SOCKETS_VERSION", _IOC_NONE, 0x07b4, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_VERSION", _IOC_NONE, 0x079f, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_VERSION2", _IOC_NONE, 0x07a7, 0x00 },
+{ "linux/vt.h", "VT_ACTIVATE", 0, 0x5606, 0 },
+{ "linux/vt.h", "VT_DISALLOCATE", 0, 0x5608, 0 },
+{ "linux/vt.h", "VT_GETHIFONTMASK", 0, 0x560D, 0 },
+{ "linux/vt.h", "VT_GETMODE", 0, 0x5601, 0 },
+{ "linux/vt.h", "VT_GETSTATE", 0, 0x5603, 0 },
+{ "linux/vt.h", "VT_LOCKSWITCH", 0, 0x560B, 0 },
+{ "linux/vt.h", "VT_OPENQRY", 0, 0x5600, 0 },
+{ "linux/vt.h", "VT_RELDISP", 0, 0x5605, 0 },
+{ "linux/vt.h", "VT_RESIZE", 0, 0x5609, 0 },
+{ "linux/vt.h", "VT_RESIZEX", 0, 0x560A, 0 },
+{ "linux/vt.h", "VT_SENDSIG", 0, 0x5604, 0 },
+{ "linux/vt.h", "VT_SETACTIVATE", 0, 0x560F, 0 },
+{ "linux/vt.h", "VT_SETMODE", 0, 0x5602, 0 },
+{ "linux/vt.h", "VT_UNLOCKSWITCH", 0, 0x560C, 0 },
+{ "linux/vt.h", "VT_WAITACTIVE", 0, 0x5607, 0 },
+{ "linux/vt.h", "VT_WAITEVENT", 0, 0x560E, 0 },
+{ "linux/vtpm_proxy.h", "VTPM_PROXY_IOC_NEW_DEV", _IOC_READ|_IOC_WRITE, 0xa100, 0x14 },
+{ "linux/watch_queue.h", "IOC_WATCH_QUEUE_SET_FILTER", _IOC_NONE, 0x5761, 0x00 },
+{ "linux/watch_queue.h", "IOC_WATCH_QUEUE_SET_SIZE", _IOC_NONE, 0x5760, 0x00 },
+{ "linux/watchdog.h", "WDIOC_GETBOOTSTATUS", _IOC_READ, 0x5702, 0x04 },
+{ "linux/watchdog.h", "WDIOC_GETPRETIMEOUT", _IOC_READ, 0x5709, 0x04 },
+{ "linux/watchdog.h", "WDIOC_GETSTATUS", _IOC_READ, 0x5701, 0x04 },
+{ "linux/watchdog.h", "WDIOC_GETSUPPORT", _IOC_READ, 0x5700, 0x28 },
+{ "linux/watchdog.h", "WDIOC_GETTEMP", _IOC_READ, 0x5703, 0x04 },
+{ "linux/watchdog.h", "WDIOC_GETTIMELEFT", _IOC_READ, 0x570a, 0x04 },
+{ "linux/watchdog.h", "WDIOC_GETTIMEOUT", _IOC_READ, 0x5707, 0x04 },
+{ "linux/watchdog.h", "WDIOC_KEEPALIVE", _IOC_READ, 0x5705, 0x04 },
+{ "linux/watchdog.h", "WDIOC_SETOPTIONS", _IOC_READ, 0x5704, 0x04 },
+{ "linux/watchdog.h", "WDIOC_SETPRETIMEOUT", _IOC_READ|_IOC_WRITE, 0x5708, 0x04 },
+{ "linux/watchdog.h", "WDIOC_SETTIMEOUT", _IOC_READ|_IOC_WRITE, 0x5706, 0x04 },
+{ "linux/wireless.h", "SIOCGIWAP", 0, 0x8B15, 0 },
+{ "linux/wireless.h", "SIOCGIWAPLIST", 0, 0x8B17, 0 },
+{ "linux/wireless.h", "SIOCGIWAUTH", 0, 0x8B33, 0 },
+{ "linux/wireless.h", "SIOCGIWENCODE", 0, 0x8B2B, 0 },
+{ "linux/wireless.h", "SIOCGIWENCODEEXT", 0, 0x8B35, 0 },
+{ "linux/wireless.h", "SIOCGIWESSID", 0, 0x8B1B, 0 },
+{ "linux/wireless.h", "SIOCGIWFRAG", 0, 0x8B25, 0 },
+{ "linux/wireless.h", "SIOCGIWFREQ", 0, 0x8B05, 0 },
+{ "linux/wireless.h", "SIOCGIWGENIE", 0, 0x8B31, 0 },
+{ "linux/wireless.h", "SIOCGIWMODE", 0, 0x8B07, 0 },
+{ "linux/wireless.h", "SIOCGIWNAME", 0, 0x8B01, 0 },
+{ "linux/wireless.h", "SIOCGIWNICKN", 0, 0x8B1D, 0 },
+{ "linux/wireless.h", "SIOCGIWNWID", 0, 0x8B03, 0 },
+{ "linux/wireless.h", "SIOCGIWPOWER", 0, 0x8B2D, 0 },
+{ "linux/wireless.h", "SIOCGIWPRIV", 0, 0x8B0D, 0 },
+{ "linux/wireless.h", "SIOCGIWRANGE", 0, 0x8B0B, 0 },
+{ "linux/wireless.h", "SIOCGIWRATE", 0, 0x8B21, 0 },
+{ "linux/wireless.h", "SIOCGIWRETRY", 0, 0x8B29, 0 },
+{ "linux/wireless.h", "SIOCGIWRTS", 0, 0x8B23, 0 },
+{ "linux/wireless.h", "SIOCGIWSCAN", 0, 0x8B19, 0 },
+{ "linux/wireless.h", "SIOCGIWSENS", 0, 0x8B09, 0 },
+{ "linux/wireless.h", "SIOCGIWSPY", 0, 0x8B11, 0 },
+{ "linux/wireless.h", "SIOCGIWSTATS", 0, 0x8B0F, 0 },
+{ "linux/wireless.h", "SIOCGIWTHRSPY", 0, 0x8B13, 0 },
+{ "linux/wireless.h", "SIOCGIWTXPOW", 0, 0x8B27, 0 },
+{ "linux/wireless.h", "SIOCIWFIRST", 0, 0x8B00, 0 },
+{ "linux/wireless.h", "SIOCIWFIRSTPRIV", 0, 0x8BE0, 0 },
+{ "linux/wireless.h", "SIOCIWLASTPRIV", 0, 0x8BFF, 0 },
+{ "linux/wireless.h", "SIOCSIWAP", 0, 0x8B14, 0 },
+{ "linux/wireless.h", "SIOCSIWAUTH", 0, 0x8B32, 0 },
+{ "linux/wireless.h", "SIOCSIWCOMMIT", 0, 0x8B00, 0 },
+{ "linux/wireless.h", "SIOCSIWENCODE", 0, 0x8B2A, 0 },
+{ "linux/wireless.h", "SIOCSIWENCODEEXT", 0, 0x8B34, 0 },
+{ "linux/wireless.h", "SIOCSIWESSID", 0, 0x8B1A, 0 },
+{ "linux/wireless.h", "SIOCSIWFRAG", 0, 0x8B24, 0 },
+{ "linux/wireless.h", "SIOCSIWFREQ", 0, 0x8B04, 0 },
+{ "linux/wireless.h", "SIOCSIWGENIE", 0, 0x8B30, 0 },
+{ "linux/wireless.h", "SIOCSIWMLME", 0, 0x8B16, 0 },
+{ "linux/wireless.h", "SIOCSIWMODE", 0, 0x8B06, 0 },
+{ "linux/wireless.h", "SIOCSIWNICKN", 0, 0x8B1C, 0 },
+{ "linux/wireless.h", "SIOCSIWNWID", 0, 0x8B02, 0 },
+{ "linux/wireless.h", "SIOCSIWPMKSA", 0, 0x8B36, 0 },
+{ "linux/wireless.h", "SIOCSIWPOWER", 0, 0x8B2C, 0 },
+{ "linux/wireless.h", "SIOCSIWPRIV", 0, 0x8B0C, 0 },
+{ "linux/wireless.h", "SIOCSIWRANGE", 0, 0x8B0A, 0 },
+{ "linux/wireless.h", "SIOCSIWRATE", 0, 0x8B20, 0 },
+{ "linux/wireless.h", "SIOCSIWRETRY", 0, 0x8B28, 0 },
+{ "linux/wireless.h", "SIOCSIWRTS", 0, 0x8B22, 0 },
+{ "linux/wireless.h", "SIOCSIWSCAN", 0, 0x8B18, 0 },
+{ "linux/wireless.h", "SIOCSIWSENS", 0, 0x8B08, 0 },
+{ "linux/wireless.h", "SIOCSIWSPY", 0, 0x8B10, 0 },
+{ "linux/wireless.h", "SIOCSIWSTATS", 0, 0x8B0E, 0 },
+{ "linux/wireless.h", "SIOCSIWTHRSPY", 0, 0x8B12, 0 },
+{ "linux/wireless.h", "SIOCSIWTXPOW", 0, 0x8B26, 0 },
+{ "linux/wmi.h", "DELL_WMI_SMBIOS_CMD", _IOC_READ|_IOC_WRITE, 0x5700, 0x34 },
+{ "media/drv-intf/exynos-fimc.h", "S5P_FIMC_TX_END_NOTIFY", _IOC_NONE, 0x6500, 0x00 },
+{ "media/i2c/adv7842.h", "ADV7842_CMD_RAM_TEST", _IOC_NONE, 0x56c0, 0x00 },
+{ "media/i2c/bt819.h", "BT819_FIFO_RESET_HIGH", _IOC_NONE, 0x6201, 0x00 },
+{ "media/i2c/bt819.h", "BT819_FIFO_RESET_LOW", _IOC_NONE, 0x6200, 0x00 },
+{ "media/i2c/saa6588.h", "SAA6588_CMD_CLOSE", _IOC_WRITE, 0x5202, 0x04 },
+{ "media/i2c/saa6588.h", "SAA6588_CMD_POLL", _IOC_READ, 0x5204, 0x04 },
+{ "media/i2c/saa6588.h", "SAA6588_CMD_READ", _IOC_READ, 0x5203, 0x04 },
+{ "media/v4l2-common.h", "TUNER_SET_CONFIG", _IOC_WRITE, 0x645c, 0x08 },
+{ "media/v4l2-common.h", "VIDIOC_INT_RESET", _IOC_WRITE, 0x6466, 0x04 },
+{ "media/v4l2-ioctl.h", "VIDIOC_DQBUF_TIME32", _IOC_READ|_IOC_WRITE, 0x5611, 0x44 },
+{ "media/v4l2-ioctl.h", "VIDIOC_DQEVENT_TIME32", _IOC_READ, 0x5659, 0x78 },
+{ "media/v4l2-ioctl.h", "VIDIOC_PREPARE_BUF_TIME32", _IOC_READ|_IOC_WRITE, 0x565d, 0x44 },
+{ "media/v4l2-ioctl.h", "VIDIOC_QBUF_TIME32", _IOC_READ|_IOC_WRITE, 0x560f, 0x44 },
+{ "media/v4l2-ioctl.h", "VIDIOC_QUERYBUF_TIME32", _IOC_READ|_IOC_WRITE, 0x5609, 0x44 },
+{ "media/v4l2-subdev.h", "V4L2_DEVICE_NOTIFY_EVENT", _IOC_WRITE, 0x7602, 0x80 },
+{ "media/v4l2-subdev.h", "V4L2_SUBDEV_IR_RX_NOTIFY", _IOC_WRITE, 0x7600, 0x04 },
+{ "media/v4l2-subdev.h", "V4L2_SUBDEV_IR_TX_NOTIFY", _IOC_WRITE, 0x7601, 0x04 },
+{ "misc/cxl.h", "CXL_IOCTL_DOWNLOAD_IMAGE", _IOC_WRITE, 0xca0a, 0x40 },
+{ "misc/cxl.h", "CXL_IOCTL_GET_AFU_ID", _IOC_READ, 0xca02, 0x40 },
+{ "misc/cxl.h", "CXL_IOCTL_GET_PROCESS_ELEMENT", _IOC_READ, 0xca01, 0x04 },
+{ "misc/cxl.h", "CXL_IOCTL_START_WORK", _IOC_WRITE, 0xca00, 0x40 },
+{ "misc/cxl.h", "CXL_IOCTL_VALIDATE_IMAGE", _IOC_WRITE, 0xca0b, 0x40 },
+{ "misc/fastrpc.h", "FASTRPC_IOCTL_ALLOC_DMA_BUFF", _IOC_READ|_IOC_WRITE, 0x5201, 0x10 },
+{ "misc/fastrpc.h", "FASTRPC_IOCTL_FREE_DMA_BUFF", _IOC_READ|_IOC_WRITE, 0x5202, 0x04 },
+{ "misc/fastrpc.h", "FASTRPC_IOCTL_INIT_ATTACH", _IOC_NONE, 0x5204, 0x00 },
+{ "misc/fastrpc.h", "FASTRPC_IOCTL_INIT_ATTACH_SNS", _IOC_NONE, 0x5208, 0x00 },
+{ "misc/fastrpc.h", "FASTRPC_IOCTL_INIT_CREATE", _IOC_READ|_IOC_WRITE, 0x5205, 0x18 },
+{ "misc/fastrpc.h", "FASTRPC_IOCTL_INVOKE", _IOC_READ|_IOC_WRITE, 0x5203, 0x10 },
+{ "misc/fastrpc.h", "FASTRPC_IOCTL_MMAP", _IOC_READ|_IOC_WRITE, 0x5206, 0x20 },
+{ "misc/fastrpc.h", "FASTRPC_IOCTL_MUNMAP", _IOC_READ|_IOC_WRITE, 0x5207, 0x10 },
+{ "misc/habanalabs.h", "HL_IOCTL_CB", _IOC_READ|_IOC_WRITE, 0x4802, 0x18 },
+{ "misc/habanalabs.h", "HL_IOCTL_CS", _IOC_READ|_IOC_WRITE, 0x4803, 0x2c },
+{ "misc/habanalabs.h", "HL_IOCTL_DEBUG", _IOC_READ|_IOC_WRITE, 0x4806, 0x28 },
+{ "misc/habanalabs.h", "HL_IOCTL_INFO", _IOC_READ|_IOC_WRITE, 0x4801, 0x18 },
+{ "misc/habanalabs.h", "HL_IOCTL_MEMORY", _IOC_READ|_IOC_WRITE, 0x4805, 0x28 },
+{ "misc/habanalabs.h", "HL_IOCTL_WAIT_CS", _IOC_READ|_IOC_WRITE, 0x4804, 0x18 },
+{ "misc/ocxl.h", "OCXL_IOCTL_ATTACH", _IOC_WRITE, 0xca10, 0x20 },
+{ "misc/ocxl.h", "OCXL_IOCTL_ENABLE_P9_WAIT", _IOC_READ, 0xca15, 0x20 },
+{ "misc/ocxl.h", "OCXL_IOCTL_GET_FEATURES", _IOC_READ, 0xca16, 0x20 },
+{ "misc/ocxl.h", "OCXL_IOCTL_GET_METADATA", _IOC_READ, 0xca14, 0x80 },
+{ "misc/ocxl.h", "OCXL_IOCTL_IRQ_ALLOC", _IOC_READ, 0xca11, 0x08 },
+{ "misc/ocxl.h", "OCXL_IOCTL_IRQ_FREE", _IOC_WRITE, 0xca12, 0x08 },
+{ "misc/ocxl.h", "OCXL_IOCTL_IRQ_SET_FD", _IOC_WRITE, 0xca13, 0x10 },
+{ "misc/uacce/hisi_qm.h", "UACCE_CMD_QM_SET_QP_CTX", _IOC_READ|_IOC_WRITE, 0x480a, 0x04 },
+{ "misc/uacce/uacce.h", "UACCE_CMD_PUT_Q", _IOC_NONE, 0x5701, 0x00 },
+{ "misc/uacce/uacce.h", "UACCE_CMD_START_Q", _IOC_NONE, 0x5700, 0x00 },
+{ "misc/xilinx_sdfec.h", "XSDFEC_ADD_LDPC_CODE_PARAMS", _IOC_WRITE, 0x6605, 0x4a },
+{ "misc/xilinx_sdfec.h", "XSDFEC_CLEAR_STATS", _IOC_NONE, 0x660b, 0x00 },
+{ "misc/xilinx_sdfec.h", "XSDFEC_GET_CONFIG", _IOC_READ, 0x6606, 0x1c },
+{ "misc/xilinx_sdfec.h", "XSDFEC_GET_STATS", _IOC_READ, 0x660c, 0x0c },
+{ "misc/xilinx_sdfec.h", "XSDFEC_GET_STATUS", _IOC_READ, 0x6602, 0x06 },
+{ "misc/xilinx_sdfec.h", "XSDFEC_GET_TURBO", _IOC_READ, 0x6607, 0x06 },
+{ "misc/xilinx_sdfec.h", "XSDFEC_IS_ACTIVE", _IOC_READ, 0x660a, 0x01 },
+{ "misc/xilinx_sdfec.h", "XSDFEC_SET_BYPASS", _IOC_WRITE, 0x6609, 0x01 },
+{ "misc/xilinx_sdfec.h", "XSDFEC_SET_DEFAULT_CONFIG", _IOC_NONE, 0x660d, 0x00 },
+{ "misc/xilinx_sdfec.h", "XSDFEC_SET_IRQ", _IOC_WRITE, 0x6603, 0x02 },
+{ "misc/xilinx_sdfec.h", "XSDFEC_SET_ORDER", _IOC_WRITE, 0x6608, 0x04 },
+{ "misc/xilinx_sdfec.h", "XSDFEC_SET_TURBO", _IOC_WRITE, 0x6604, 0x06 },
+{ "misc/xilinx_sdfec.h", "XSDFEC_START_DEV", _IOC_NONE, 0x6600, 0x00 },
+{ "misc/xilinx_sdfec.h", "XSDFEC_STOP_DEV", _IOC_NONE, 0x6601, 0x00 },
+{ "mtd/mtd-abi.h", "ECCGETLAYOUT", _IOC_READ, 0x4d11, 0x148 },
+{ "mtd/mtd-abi.h", "ECCGETSTATS", _IOC_READ, 0x4d12, 0x10 },
+{ "mtd/mtd-abi.h", "MEMERASE", _IOC_WRITE, 0x4d02, 0x08 },
+{ "mtd/mtd-abi.h", "MEMERASE64", _IOC_WRITE, 0x4d14, 0x10 },
+{ "mtd/mtd-abi.h", "MEMGETBADBLOCK", _IOC_WRITE, 0x4d0b, 0x08 },
+{ "mtd/mtd-abi.h", "MEMGETINFO", _IOC_READ, 0x4d01, 0x1e },
+{ "mtd/mtd-abi.h", "MEMGETOOBSEL", _IOC_READ, 0x4d0a, 0xc8 },
+{ "mtd/mtd-abi.h", "MEMGETREGIONCOUNT", _IOC_READ, 0x4d07, 0x04 },
+{ "mtd/mtd-abi.h", "MEMGETREGIONINFO", _IOC_READ|_IOC_WRITE, 0x4d08, 0x10 },
+{ "mtd/mtd-abi.h", "MEMISLOCKED", _IOC_READ, 0x4d17, 0x08 },
+{ "mtd/mtd-abi.h", "MEMLOCK", _IOC_WRITE, 0x4d05, 0x08 },
+{ "mtd/mtd-abi.h", "MEMREADOOB", _IOC_READ|_IOC_WRITE, 0x4d04, 0x0c },
+{ "mtd/mtd-abi.h", "MEMREADOOB64", _IOC_READ|_IOC_WRITE, 0x4d16, 0x18 },
+{ "mtd/mtd-abi.h", "MEMSETBADBLOCK", _IOC_WRITE, 0x4d0c, 0x08 },
+{ "mtd/mtd-abi.h", "MEMUNLOCK", _IOC_WRITE, 0x4d06, 0x08 },
+{ "mtd/mtd-abi.h", "MEMWRITE", _IOC_READ|_IOC_WRITE, 0x4d18, 0x30 },
+{ "mtd/mtd-abi.h", "MEMWRITEOOB", _IOC_READ|_IOC_WRITE, 0x4d03, 0x0c },
+{ "mtd/mtd-abi.h", "MEMWRITEOOB64", _IOC_READ|_IOC_WRITE, 0x4d15, 0x18 },
+{ "mtd/mtd-abi.h", "MTDFILEMODE", _IOC_NONE, 0x4d13, 0x00 },
+{ "mtd/mtd-abi.h", "OTPGETREGIONCOUNT", _IOC_WRITE, 0x4d0e, 0x04 },
+{ "mtd/mtd-abi.h", "OTPGETREGIONINFO", _IOC_WRITE, 0x4d0f, 0x0c },
+{ "mtd/mtd-abi.h", "OTPLOCK", _IOC_READ, 0x4d10, 0x0c },
+{ "mtd/mtd-abi.h", "OTPSELECT", _IOC_READ, 0x4d0d, 0x04 },
+{ "mtd/ubi-user.h", "UBI_IOCATT", _IOC_WRITE, 0x6f40, 0x18 },
+{ "mtd/ubi-user.h", "UBI_IOCDET", _IOC_WRITE, 0x6f41, 0x04 },
+{ "mtd/ubi-user.h", "UBI_IOCEBCH", _IOC_WRITE, 0x4f02, 0x04 },
+{ "mtd/ubi-user.h", "UBI_IOCEBER", _IOC_WRITE, 0x4f01, 0x04 },
+{ "mtd/ubi-user.h", "UBI_IOCEBISMAP", _IOC_READ, 0x4f05, 0x04 },
+{ "mtd/ubi-user.h", "UBI_IOCEBMAP", _IOC_WRITE, 0x4f03, 0x08 },
+{ "mtd/ubi-user.h", "UBI_IOCEBUNMAP", _IOC_WRITE, 0x4f04, 0x04 },
+{ "mtd/ubi-user.h", "UBI_IOCMKVOL", _IOC_WRITE, 0x6f00, 0x98 },
+{ "mtd/ubi-user.h", "UBI_IOCRMVOL", _IOC_WRITE, 0x6f01, 0x04 },
+{ "mtd/ubi-user.h", "UBI_IOCRNVOL", _IOC_WRITE, 0x6f03, 0x1110 },
+{ "mtd/ubi-user.h", "UBI_IOCRPEB", _IOC_WRITE, 0x6f04, 0x04 },
+{ "mtd/ubi-user.h", "UBI_IOCRSVOL", _IOC_WRITE, 0x6f02, 0x0c },
+{ "mtd/ubi-user.h", "UBI_IOCSETVOLPROP", _IOC_WRITE, 0x4f06, 0x10 },
+{ "mtd/ubi-user.h", "UBI_IOCSPEB", _IOC_WRITE, 0x6f05, 0x04 },
+{ "mtd/ubi-user.h", "UBI_IOCVOLCRBLK", _IOC_WRITE, 0x4f07, 0x80 },
+{ "mtd/ubi-user.h", "UBI_IOCVOLRMBLK", _IOC_NONE, 0x4f08, 0x00 },
+{ "mtd/ubi-user.h", "UBI_IOCVOLUP", _IOC_WRITE, 0x4f00, 0x08 },
+{ "net/bluetooth/hci_sock.h", "HCIBLOCKADDR", _IOC_WRITE, 0x48e6, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCIDEVDOWN", _IOC_WRITE, 0x48ca, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCIDEVRESET", _IOC_WRITE, 0x48cb, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCIDEVRESTAT", _IOC_WRITE, 0x48cc, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCIDEVUP", _IOC_WRITE, 0x48c9, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCIGETAUTHINFO", _IOC_READ, 0x48d7, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCIGETCONNINFO", _IOC_READ, 0x48d5, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCIGETCONNLIST", _IOC_READ, 0x48d4, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCIGETDEVINFO", _IOC_READ, 0x48d3, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCIGETDEVLIST", _IOC_READ, 0x48d2, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCIINQUIRY", _IOC_READ, 0x48f0, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCISETACLMTU", _IOC_WRITE, 0x48e3, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCISETAUTH", _IOC_WRITE, 0x48de, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCISETENCRYPT", _IOC_WRITE, 0x48df, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCISETLINKMODE", _IOC_WRITE, 0x48e2, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCISETLINKPOL", _IOC_WRITE, 0x48e1, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCISETPTYPE", _IOC_WRITE, 0x48e0, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCISETRAW", _IOC_WRITE, 0x48dc, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCISETSCAN", _IOC_WRITE, 0x48dd, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCISETSCOMTU", _IOC_WRITE, 0x48e4, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCIUNBLOCKADDR", _IOC_WRITE, 0x48e7, 0x04 },
+{ "net/bluetooth/rfcomm.h", "RFCOMMCREATEDEV", _IOC_WRITE, 0x52c8, 0x04 },
+{ "net/bluetooth/rfcomm.h", "RFCOMMGETDEVINFO", _IOC_READ, 0x52d3, 0x04 },
+{ "net/bluetooth/rfcomm.h", "RFCOMMGETDEVLIST", _IOC_READ, 0x52d2, 0x04 },
+{ "net/bluetooth/rfcomm.h", "RFCOMMRELEASEDEV", _IOC_WRITE, 0x52c9, 0x04 },
+{ "net/bluetooth/rfcomm.h", "RFCOMMSTEALDLC", _IOC_WRITE, 0x52dc, 0x04 },
+{ "net/nfc/nci_core.h", "NCIUARTSETDRIVER", _IOC_WRITE, 0x5500, 0x04 },
+{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_ACK_EVENT", _IOC_WRITE, 0x1bea, 0x04 },
+{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_ASSIGN_CTXT", _IOC_READ|_IOC_WRITE, 0x1be1, 0x1c },
+{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_CREDIT_UPD", _IOC_NONE, 0x1be6, 0x00 },
+{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_CTXT_INFO", _IOC_WRITE, 0x1be2, 0x28 },
+{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_CTXT_RESET", _IOC_NONE, 0x1bec, 0x00 },
+{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_GET_VERS", _IOC_READ, 0x1bee, 0x04 },
+{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_POLL_TYPE", _IOC_WRITE, 0x1be9, 0x04 },
+{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_RECV_CTRL", _IOC_WRITE, 0x1be8, 0x04 },
+{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_SET_PKEY", _IOC_WRITE, 0x1beb, 0x02 },
+{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_TID_FREE", _IOC_READ|_IOC_WRITE, 0x1be5, 0x18 },
+{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_TID_INVAL_READ", _IOC_READ|_IOC_WRITE, 0x1bed, 0x18 },
+{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_TID_UPDATE", _IOC_READ|_IOC_WRITE, 0x1be4, 0x18 },
+{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_USER_INFO", _IOC_WRITE, 0x1be3, 0x78 },
+{ "rdma/rdma_user_ioctl.h", "IB_USER_MAD_ENABLE_PKEY", _IOC_NONE, 0x1b03, 0x00 },
+{ "rdma/rdma_user_ioctl.h", "IB_USER_MAD_REGISTER_AGENT", _IOC_READ|_IOC_WRITE, 0x1b01, 0x1c },
+{ "rdma/rdma_user_ioctl.h", "IB_USER_MAD_REGISTER_AGENT2", _IOC_READ|_IOC_WRITE, 0x1b04, 0x28 },
+{ "rdma/rdma_user_ioctl.h", "IB_USER_MAD_UNREGISTER_AGENT", _IOC_WRITE, 0x1b02, 0x04 },
+{ "rdma/rdma_user_ioctl_cmds.h", "RDMA_VERBS_IOCTL", _IOC_READ|_IOC_WRITE, 0x1b01, 0x18 },
+{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_ATTACH", _IOC_READ|_IOC_WRITE, 0xca80, 0x90 },
+{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_DETACH", _IOC_READ|_IOC_WRITE, 0xca83, 0x60 },
+{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_MANAGE_LUN", _IOC_READ|_IOC_WRITE, 0xca86, 0x68 },
+{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_RECOVER_AFU", _IOC_READ|_IOC_WRITE, 0xca85, 0x78 },
+{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_RELEASE", _IOC_READ|_IOC_WRITE, 0xca82, 0x68 },
+{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_USER_DIRECT", _IOC_READ|_IOC_WRITE, 0xca81, 0x70 },
+{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_USER_VIRTUAL", _IOC_READ|_IOC_WRITE, 0xca87, 0x78 },
+{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_VERIFY", _IOC_READ|_IOC_WRITE, 0xca84, 0x90 },
+{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_VLUN_CLONE", _IOC_READ|_IOC_WRITE, 0xca89, 0x70 },
+{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_VLUN_RESIZE", _IOC_READ|_IOC_WRITE, 0xca88, 0x78 },
+{ "scsi/cxlflash_ioctl.h", "HT_CXLFLASH_AFU_DEBUG", _IOC_READ|_IOC_WRITE, 0xcabe, 0x78 },
+{ "scsi/cxlflash_ioctl.h", "HT_CXLFLASH_LUN_PROVISION", _IOC_READ|_IOC_WRITE, 0xcabf, 0xa0 },
+{ "scsi/scsi.h", "SCSI_IOCTL_GET_BUS_NUMBER", 0, 0x5386, 0 },
+{ "scsi/scsi.h", "SCSI_IOCTL_GET_IDLUN", 0, 0x5382, 0 },
+{ "scsi/scsi.h", "SCSI_IOCTL_GET_PCI", 0, 0x5387, 0 },
+{ "scsi/scsi.h", "SCSI_IOCTL_PROBE_HOST", 0, 0x5385, 0 },
+{ "scsi/scsi_ioctl.h", "SCSI_IOCTL_DOORLOCK", 0, 0x5380, 0 },
+{ "scsi/scsi_ioctl.h", "SCSI_IOCTL_DOORUNLOCK", 0, 0x5381, 0 },
+{ "scsi/sg.h", "SG_EMULATED_HOST", 0, 0x2203, 0 },
+{ "scsi/sg.h", "SG_GET_ACCESS_COUNT", 0, 0x2289, 0 },
+{ "scsi/sg.h", "SG_GET_COMMAND_Q", 0, 0x2270, 0 },
+{ "scsi/sg.h", "SG_GET_KEEP_ORPHAN", 0, 0x2288, 0 },
+{ "scsi/sg.h", "SG_GET_LOW_DMA", 0, 0x227a, 0 },
+{ "scsi/sg.h", "SG_GET_NUM_WAITING", 0, 0x227d, 0 },
+{ "scsi/sg.h", "SG_GET_PACK_ID", 0, 0x227c, 0 },
+{ "scsi/sg.h", "SG_GET_REQUEST_TABLE", 0, 0x2286, 0 },
+{ "scsi/sg.h", "SG_GET_RESERVED_SIZE", 0, 0x2272, 0 },
+{ "scsi/sg.h", "SG_GET_SCSI_ID", 0, 0x2276, 0 },
+{ "scsi/sg.h", "SG_GET_SG_TABLESIZE", 0, 0x227F, 0 },
+{ "scsi/sg.h", "SG_GET_TIMEOUT", 0, 0x2202, 0 },
+{ "scsi/sg.h", "SG_GET_TRANSFORM", 0, 0x2205, 0 },
+{ "scsi/sg.h", "SG_GET_VERSION_NUM", 0, 0x2282, 0 },
+{ "scsi/sg.h", "SG_IO", 0, 0x2285, 0 },
+{ "scsi/sg.h", "SG_NEXT_CMD_LEN", 0, 0x2283, 0 },
+{ "scsi/sg.h", "SG_SCSI_RESET", 0, 0x2284, 0 },
+{ "scsi/sg.h", "SG_SET_COMMAND_Q", 0, 0x2271, 0 },
+{ "scsi/sg.h", "SG_SET_DEBUG", 0, 0x227e, 0 },
+{ "scsi/sg.h", "SG_SET_FORCE_LOW_DMA", 0, 0x2279, 0 },
+{ "scsi/sg.h", "SG_SET_FORCE_PACK_ID", 0, 0x227b, 0 },
+{ "scsi/sg.h", "SG_SET_KEEP_ORPHAN", 0, 0x2287, 0 },
+{ "scsi/sg.h", "SG_SET_RESERVED_SIZE", 0, 0x2275, 0 },
+{ "scsi/sg.h", "SG_SET_TIMEOUT", 0, 0x2201, 0 },
+{ "scsi/sg.h", "SG_SET_TRANSFORM", 0, 0x2204, 0 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_CLIENT_ID", _IOC_READ, 0x5301, 0x04 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_CREATE_PORT", _IOC_READ|_IOC_WRITE, 0x5320, 0xa2 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_CREATE_QUEUE", _IOC_READ|_IOC_WRITE, 0x5332, 0x8a },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_DELETE_PORT", _IOC_WRITE, 0x5321, 0xa2 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_DELETE_QUEUE", _IOC_WRITE, 0x5333, 0x8a },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_CLIENT_INFO", _IOC_READ|_IOC_WRITE, 0x5310, 0xbc },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_CLIENT_POOL", _IOC_READ|_IOC_WRITE, 0x534b, 0x58 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_NAMED_QUEUE", _IOC_READ|_IOC_WRITE, 0x5336, 0x8a },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_PORT_INFO", _IOC_READ|_IOC_WRITE, 0x5322, 0xa2 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_QUEUE_CLIENT", _IOC_READ|_IOC_WRITE, 0x5349, 0x4c },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_QUEUE_INFO", _IOC_READ|_IOC_WRITE, 0x5334, 0x8a },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_QUEUE_STATUS", _IOC_READ|_IOC_WRITE, 0x5340, 0x5c },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_QUEUE_TEMPO", _IOC_READ|_IOC_WRITE, 0x5341, 0x2c },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_QUEUE_TIMER", _IOC_READ|_IOC_WRITE, 0x5345, 0x60 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_SUBSCRIPTION", _IOC_READ|_IOC_WRITE, 0x5350, 0x50 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_PVERSION", _IOC_READ, 0x5300, 0x04 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_QUERY_NEXT_CLIENT", _IOC_READ|_IOC_WRITE, 0x5351, 0xbc },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_QUERY_NEXT_PORT", _IOC_READ|_IOC_WRITE, 0x5352, 0xa2 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_QUERY_SUBS", _IOC_READ|_IOC_WRITE, 0x534f, 0x56 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_REMOVE_EVENTS", _IOC_WRITE, 0x534e, 0x3e },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_RUNNING_MODE", _IOC_READ|_IOC_WRITE, 0x5303, 0x10 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SET_CLIENT_INFO", _IOC_WRITE, 0x5311, 0xbc },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SET_CLIENT_POOL", _IOC_WRITE, 0x534c, 0x58 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SET_PORT_INFO", _IOC_WRITE, 0x5323, 0xa2 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SET_QUEUE_CLIENT", _IOC_WRITE, 0x534a, 0x4c },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SET_QUEUE_INFO", _IOC_READ|_IOC_WRITE, 0x5335, 0x8a },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SET_QUEUE_TEMPO", _IOC_WRITE, 0x5342, 0x2c },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SET_QUEUE_TIMER", _IOC_WRITE, 0x5346, 0x60 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SUBSCRIBE_PORT", _IOC_WRITE, 0x5330, 0x50 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SYSTEM_INFO", _IOC_READ|_IOC_WRITE, 0x5302, 0x30 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_UNSUBSCRIBE_PORT", _IOC_WRITE, 0x5331, 0x50 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_CARD_INFO", _IOC_READ, 0x5501, 0x178 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_ADD", _IOC_READ|_IOC_WRITE, 0x5517, 0x110 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_INFO", _IOC_READ|_IOC_WRITE, 0x5511, 0x110 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_LIST", _IOC_READ|_IOC_WRITE, 0x5510, 0x46 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_LOCK", _IOC_WRITE, 0x5514, 0x40 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_READ", _IOC_READ|_IOC_WRITE, 0x5512, 0x2c2 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_REMOVE", _IOC_READ|_IOC_WRITE, 0x5519, 0x40 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_REPLACE", _IOC_READ|_IOC_WRITE, 0x5518, 0x110 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_UNLOCK", _IOC_WRITE, 0x5515, 0x40 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_WRITE", _IOC_READ|_IOC_WRITE, 0x5513, 0x2c2 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_HWDEP_INFO", _IOC_READ, 0x5521, 0xdc },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_HWDEP_NEXT_DEVICE", _IOC_READ|_IOC_WRITE, 0x5520, 0x04 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_PCM_INFO", _IOC_READ|_IOC_WRITE, 0x5531, 0x120 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_PCM_NEXT_DEVICE", _IOC_READ, 0x5530, 0x04 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_PCM_PREFER_SUBDEVICE", _IOC_WRITE, 0x5532, 0x04 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_POWER", _IOC_READ|_IOC_WRITE, 0x55d0, 0x04 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_POWER_STATE", _IOC_READ, 0x55d1, 0x04 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_PVERSION", _IOC_READ, 0x5500, 0x04 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_RAWMIDI_INFO", _IOC_READ|_IOC_WRITE, 0x5541, 0x10c },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_RAWMIDI_NEXT_DEVICE", _IOC_READ|_IOC_WRITE, 0x5540, 0x04 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_RAWMIDI_PREFER_SUBDEVICE", _IOC_WRITE, 0x5542, 0x04 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_SUBSCRIBE_EVENTS", _IOC_READ|_IOC_WRITE, 0x5516, 0x04 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_TLV_COMMAND", _IOC_READ|_IOC_WRITE, 0x551c, 0x08 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_TLV_READ", _IOC_READ|_IOC_WRITE, 0x551a, 0x08 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_TLV_WRITE", _IOC_READ|_IOC_WRITE, 0x551b, 0x08 },
+{ "sound/asound.h", "SNDRV_HWDEP_IOCTL_DSP_LOAD", _IOC_WRITE, 0x4803, 0x50 },
+{ "sound/asound.h", "SNDRV_HWDEP_IOCTL_DSP_STATUS", _IOC_READ, 0x4802, 0x40 },
+{ "sound/asound.h", "SNDRV_HWDEP_IOCTL_INFO", _IOC_READ, 0x4801, 0xdc },
+{ "sound/asound.h", "SNDRV_HWDEP_IOCTL_PVERSION", _IOC_READ, 0x4800, 0x04 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_CHANNEL_INFO", _IOC_READ, 0x4132, 0x10 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_DELAY", _IOC_READ, 0x4121, 0x04 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_DRAIN", _IOC_NONE, 0x4144, 0x00 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_DROP", _IOC_NONE, 0x4143, 0x00 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_FORWARD", _IOC_WRITE, 0x4149, 0x04 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_HWSYNC", _IOC_NONE, 0x4122, 0x00 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_HW_FREE", _IOC_NONE, 0x4112, 0x00 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_HW_PARAMS", _IOC_READ|_IOC_WRITE, 0x4111, 0x232 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_HW_REFINE", _IOC_READ|_IOC_WRITE, 0x4110, 0x232 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_INFO", _IOC_READ, 0x4101, 0x120 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_LINK", _IOC_WRITE, 0x4160, 0x04 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_PAUSE", _IOC_WRITE, 0x4145, 0x04 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_PREPARE", _IOC_NONE, 0x4140, 0x00 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_PVERSION", _IOC_READ, 0x4100, 0x04 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_READI_FRAMES", _IOC_READ, 0x4151, 0x0c },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_READN_FRAMES", _IOC_READ, 0x4153, 0x0c },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_RESET", _IOC_NONE, 0x4141, 0x00 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_RESUME", _IOC_NONE, 0x4147, 0x00 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_REWIND", _IOC_WRITE, 0x4146, 0x04 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_START", _IOC_NONE, 0x4142, 0x00 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_STATUS", _IOC_READ, 0x4120, 0x6c },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_STATUS_EXT", _IOC_READ|_IOC_WRITE, 0x4124, 0x6c },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_SW_PARAMS", _IOC_READ|_IOC_WRITE, 0x4113, 0x68 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_SYNC_PTR", _IOC_READ|_IOC_WRITE, 0x4123, 0x84 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_TSTAMP", _IOC_WRITE, 0x4102, 0x04 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_TTSTAMP", _IOC_WRITE, 0x4103, 0x04 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_UNLINK", _IOC_NONE, 0x4161, 0x00 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_USER_PVERSION", _IOC_WRITE, 0x4104, 0x04 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_WRITEI_FRAMES", _IOC_WRITE, 0x4150, 0x0c },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_WRITEN_FRAMES", _IOC_WRITE, 0x4152, 0x0c },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_XRUN", _IOC_NONE, 0x4148, 0x00 },
+{ "sound/asound.h", "SNDRV_RAWMIDI_IOCTL_DRAIN", _IOC_WRITE, 0x5731, 0x04 },
+{ "sound/asound.h", "SNDRV_RAWMIDI_IOCTL_DROP", _IOC_WRITE, 0x5730, 0x04 },
+{ "sound/asound.h", "SNDRV_RAWMIDI_IOCTL_INFO", _IOC_READ, 0x5701, 0x10c },
+{ "sound/asound.h", "SNDRV_RAWMIDI_IOCTL_PARAMS", _IOC_READ|_IOC_WRITE, 0x5710, 0x1e },
+{ "sound/asound.h", "SNDRV_RAWMIDI_IOCTL_PVERSION", _IOC_READ, 0x5700, 0x04 },
+{ "sound/asound.h", "SNDRV_RAWMIDI_IOCTL_STATUS", _IOC_READ|_IOC_WRITE, 0x5720, 0x24 },
+{ "sound/asound.h", "SNDRV_TIMER_IOCTL_CONTINUE", _IOC_NONE, 0x54a2, 0x00 },
+{ "sound/asound.h", "SNDRV_TIMER_IOCTL_GINFO", _IOC_READ|_IOC_WRITE, 0x5403, 0xe0 },
+{ "sound/asound.h", "SNDRV_TIMER_IOCTL_GPARAMS", _IOC_WRITE, 0x5404, 0x3c },
+{ "sound/asound.h", "SNDRV_TIMER_IOCTL_GSTATUS", _IOC_READ|_IOC_WRITE, 0x5405, 0x40 },
+{ "sound/asound.h", "SNDRV_TIMER_IOCTL_INFO", _IOC_READ, 0x5411, 0xe0 },
+{ "sound/asound.h", "SNDRV_TIMER_IOCTL_NEXT_DEVICE", _IOC_READ|_IOC_WRITE, 0x5401, 0x14 },
+{ "sound/asound.h", "SNDRV_TIMER_IOCTL_PARAMS", _IOC_WRITE, 0x5412, 0x50 },
+{ "sound/asound.h", "SNDRV_TIMER_IOCTL_PAUSE", _IOC_NONE, 0x54a3, 0x00 },
+{ "sound/asound.h", "SNDRV_TIMER_IOCTL_PVERSION", _IOC_READ, 0x5400, 0x04 },
+{ "sound/asound.h", "SNDRV_TIMER_IOCTL_SELECT", _IOC_WRITE, 0x5410, 0x34 },
+{ "sound/asound.h", "SNDRV_TIMER_IOCTL_START", _IOC_NONE, 0x54a0, 0x00 },
+{ "sound/asound.h", "SNDRV_TIMER_IOCTL_STATUS", _IOC_READ, 0x5414, 0x58 },
+{ "sound/asound.h", "SNDRV_TIMER_IOCTL_STOP", _IOC_NONE, 0x54a1, 0x00 },
+{ "sound/asound.h", "SNDRV_TIMER_IOCTL_TREAD64", _IOC_WRITE, 0x54a4, 0x04 },
+{ "sound/asound.h", "SNDRV_TIMER_IOCTL_TREAD_OLD", _IOC_WRITE, 0x5402, 0x04 },
+{ "sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_CLEAR_PATCHES", _IOC_NONE, 0x4840, 0x00 },
+{ "sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_INFO", _IOC_READ, 0x4820, 0x02 },
+{ "sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_PLAY_NOTE", _IOC_WRITE, 0x4822, 0x08 },
+{ "sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_RESET", _IOC_NONE, 0x4821, 0x00 },
+{ "sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_SET_CONNECTION", _IOC_WRITE, 0x4826, 0x04 },
+{ "sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_SET_MODE", _IOC_WRITE, 0x4825, 0x04 },
+{ "sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_SET_PARAMS", _IOC_WRITE, 0x4824, 0x09 },
+{ "sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_SET_VOICE", _IOC_WRITE, 0x4823, 0x12 },
+{ "sound/compress_offload.h", "SNDRV_COMPRESS_AVAIL", _IOC_READ, 0x4321, 0x1c },
+{ "sound/compress_offload.h", "SNDRV_COMPRESS_DRAIN", _IOC_NONE, 0x4334, 0x00 },
+{ "sound/compress_offload.h", "SNDRV_COMPRESS_GET_CAPS", _IOC_READ|_IOC_WRITE, 0x4310, 0xc4 },
+{ "sound/compress_offload.h", "SNDRV_COMPRESS_GET_CODEC_CAPS", _IOC_READ|_IOC_WRITE, 0x4311, 0x2b88 },
+{ "sound/compress_offload.h", "SNDRV_COMPRESS_GET_METADATA", _IOC_READ|_IOC_WRITE, 0x4315, 0x24 },
+{ "sound/compress_offload.h", "SNDRV_COMPRESS_GET_PARAMS", _IOC_READ, 0x4313, 0x78 },
+{ "sound/compress_offload.h", "SNDRV_COMPRESS_IOCTL_VERSION", _IOC_READ, 0x4300, 0x04 },
+{ "sound/compress_offload.h", "SNDRV_COMPRESS_NEXT_TRACK", _IOC_NONE, 0x4335, 0x00 },
+{ "sound/compress_offload.h", "SNDRV_COMPRESS_PARTIAL_DRAIN", _IOC_NONE, 0x4336, 0x00 },
+{ "sound/compress_offload.h", "SNDRV_COMPRESS_PAUSE", _IOC_NONE, 0x4330, 0x00 },
+{ "sound/compress_offload.h", "SNDRV_COMPRESS_RESUME", _IOC_NONE, 0x4331, 0x00 },
+{ "sound/compress_offload.h", "SNDRV_COMPRESS_SET_METADATA", _IOC_WRITE, 0x4314, 0x24 },
+{ "sound/compress_offload.h", "SNDRV_COMPRESS_SET_PARAMS", _IOC_WRITE, 0x4312, 0x84 },
+{ "sound/compress_offload.h", "SNDRV_COMPRESS_START", _IOC_NONE, 0x4332, 0x00 },
+{ "sound/compress_offload.h", "SNDRV_COMPRESS_STOP", _IOC_NONE, 0x4333, 0x00 },
+{ "sound/compress_offload.h", "SNDRV_COMPRESS_TSTAMP", _IOC_READ, 0x4320, 0x14 },
+{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_CODE_PEEK", _IOC_READ|_IOC_WRITE, 0x4812, 0x18c },
+{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_CODE_POKE", _IOC_WRITE, 0x4811, 0x18c },
+{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_CONTINUE", _IOC_NONE, 0x4881, 0x00 },
+{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_DBG_READ", _IOC_READ, 0x4884, 0x04 },
+{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_INFO", _IOC_READ, 0x4810, 0x80c },
+{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_PCM_PEEK", _IOC_READ|_IOC_WRITE, 0x4831, 0x46 },
+{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_PCM_POKE", _IOC_WRITE, 0x4830, 0x46 },
+{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_PVERSION", _IOC_READ, 0x4840, 0x04 },
+{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_SINGLE_STEP", _IOC_WRITE, 0x4883, 0x04 },
+{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_STOP", _IOC_NONE, 0x4880, 0x00 },
+{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_TRAM_PEEK", _IOC_READ|_IOC_WRITE, 0x4822, 0x0c },
+{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_TRAM_POKE", _IOC_WRITE, 0x4821, 0x0c },
+{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_TRAM_SETUP", _IOC_WRITE, 0x4820, 0x04 },
+{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_ZERO_TRAM_COUNTER", _IOC_NONE, 0x4882, 0x00 },
+{ "sound/firewire.h", "SNDRV_FIREWIRE_IOCTL_GET_INFO", _IOC_READ, 0x48f8, 0x20 },
+{ "sound/firewire.h", "SNDRV_FIREWIRE_IOCTL_LOCK", _IOC_NONE, 0x48f9, 0x00 },
+{ "sound/firewire.h", "SNDRV_FIREWIRE_IOCTL_TASCAM_STATE", _IOC_READ, 0x48fb, 0x100 },
+{ "sound/firewire.h", "SNDRV_FIREWIRE_IOCTL_UNLOCK", _IOC_NONE, 0x48fa, 0x00 },
+{ "sound/hda_hwdep.h", "HDA_IOCTL_GET_WCAP", _IOC_READ|_IOC_WRITE, 0x4812, 0x08 },
+{ "sound/hda_hwdep.h", "HDA_IOCTL_PVERSION", _IOC_READ, 0x4810, 0x04 },
+{ "sound/hda_hwdep.h", "HDA_IOCTL_VERB_WRITE", _IOC_READ|_IOC_WRITE, 0x4811, 0x08 },
+{ "sound/hdsp.h", "SNDRV_HDSP_IOCTL_GET_9632_AEB", _IOC_READ, 0x4845, 0x08 },
+{ "sound/hdsp.h", "SNDRV_HDSP_IOCTL_GET_CONFIG_INFO", _IOC_READ, 0x4841, 0x22 },
+{ "sound/hdsp.h", "SNDRV_HDSP_IOCTL_GET_MIXER", _IOC_READ, 0x4844, 0x1000 },
+{ "sound/hdsp.h", "SNDRV_HDSP_IOCTL_GET_PEAK_RMS", _IOC_READ, 0x4840, 0x3b0 },
+{ "sound/hdsp.h", "SNDRV_HDSP_IOCTL_GET_VERSION", _IOC_READ, 0x4843, 0x06 },
+{ "sound/hdsp.h", "SNDRV_HDSP_IOCTL_UPLOAD_FIRMWARE", _IOC_WRITE, 0x4842, 0x04 },
+{ "sound/hdspm.h", "SNDRV_HDSPM_IOCTL_GET_CONFIG", _IOC_READ, 0x4841, 0x18 },
+{ "sound/hdspm.h", "SNDRV_HDSPM_IOCTL_GET_LTC", _IOC_READ, 0x4846, 0x10 },
+{ "sound/hdspm.h", "SNDRV_HDSPM_IOCTL_GET_MIXER", _IOC_READ, 0x4844, 0x04 },
+{ "sound/hdspm.h", "SNDRV_HDSPM_IOCTL_GET_PEAK_RMS", _IOC_READ, 0x4842, 0x906 },
+{ "sound/hdspm.h", "SNDRV_HDSPM_IOCTL_GET_STATUS", _IOC_READ, 0x4847, 0x1a },
+{ "sound/hdspm.h", "SNDRV_HDSPM_IOCTL_GET_VERSION", _IOC_READ, 0x4848, 0x20 },
+{ "sound/pcm.h", "SNDRV_PCM_IOCTL_STATUS32", _IOC_READ, 0x4120, 0x6c },
+{ "sound/pcm.h", "SNDRV_PCM_IOCTL_STATUS64", _IOC_READ, 0x4120, 0x80 },
+{ "sound/pcm.h", "SNDRV_PCM_IOCTL_STATUS_EXT32", _IOC_READ|_IOC_WRITE, 0x4124, 0x6c },
+{ "sound/pcm.h", "SNDRV_PCM_IOCTL_STATUS_EXT64", _IOC_READ|_IOC_WRITE, 0x4124, 0x80 },
+{ "sound/sb16_csp.h", "SNDRV_SB_CSP_IOCTL_INFO", _IOC_READ, 0x4810, 0x26 },
+{ "sound/sb16_csp.h", "SNDRV_SB_CSP_IOCTL_LOAD_CODE", _IOC_WRITE, 0x4811, 0x3012 },
+{ "sound/sb16_csp.h", "SNDRV_SB_CSP_IOCTL_PAUSE", _IOC_NONE, 0x4815, 0x00 },
+{ "sound/sb16_csp.h", "SNDRV_SB_CSP_IOCTL_RESTART", _IOC_NONE, 0x4816, 0x00 },
+{ "sound/sb16_csp.h", "SNDRV_SB_CSP_IOCTL_START", _IOC_WRITE, 0x4813, 0x08 },
+{ "sound/sb16_csp.h", "SNDRV_SB_CSP_IOCTL_STOP", _IOC_NONE, 0x4814, 0x00 },
+{ "sound/sb16_csp.h", "SNDRV_SB_CSP_IOCTL_UNLOAD_CODE", _IOC_NONE, 0x4812, 0x00 },
+{ "sound/sfnt_info.h", "SNDRV_EMUX_IOCTL_LOAD_PATCH", _IOC_READ|_IOC_WRITE, 0x4881, 0x10 },
+{ "sound/sfnt_info.h", "SNDRV_EMUX_IOCTL_MEM_AVAIL", _IOC_WRITE, 0x4884, 0x04 },
+{ "sound/sfnt_info.h", "SNDRV_EMUX_IOCTL_MISC_MODE", _IOC_READ|_IOC_WRITE, 0x4884, 0x10 },
+{ "sound/sfnt_info.h", "SNDRV_EMUX_IOCTL_REMOVE_LAST_SAMPLES", _IOC_NONE, 0x4883, 0x00 },
+{ "sound/sfnt_info.h", "SNDRV_EMUX_IOCTL_RESET_SAMPLES", _IOC_NONE, 0x4882, 0x00 },
+{ "sound/sfnt_info.h", "SNDRV_EMUX_IOCTL_VERSION", _IOC_READ, 0x4880, 0x04 },
+{ "sound/usb_stream.h", "SNDRV_USB_STREAM_IOCTL_SET_PARAMS", _IOC_WRITE, 0x4890, 0x10 },
+{ "staging/android/ashmem.h", "ASHMEM_GET_NAME", _IOC_READ, 0x7702, 0x100 },
+{ "staging/android/ashmem.h", "ASHMEM_GET_PIN_STATUS", _IOC_NONE, 0x7709, 0x00 },
+{ "staging/android/ashmem.h", "ASHMEM_GET_PROT_MASK", _IOC_NONE, 0x7706, 0x00 },
+{ "staging/android/ashmem.h", "ASHMEM_GET_SIZE", _IOC_NONE, 0x7704, 0x00 },
+{ "staging/android/ashmem.h", "ASHMEM_PIN", _IOC_WRITE, 0x7707, 0x08 },
+{ "staging/android/ashmem.h", "ASHMEM_PURGE_ALL_CACHES", _IOC_NONE, 0x770a, 0x00 },
+{ "staging/android/ashmem.h", "ASHMEM_SET_NAME", _IOC_WRITE, 0x7701, 0x100 },
+{ "staging/android/ashmem.h", "ASHMEM_SET_PROT_MASK", _IOC_WRITE, 0x7705, 0x04 },
+{ "staging/android/ashmem.h", "ASHMEM_SET_SIZE", _IOC_WRITE, 0x7703, 0x04 },
+{ "staging/android/ashmem.h", "ASHMEM_UNPIN", _IOC_WRITE, 0x7708, 0x08 },
+{ "staging/android/ion.h", "ION_IOC_ALLOC", _IOC_READ|_IOC_WRITE, 0x4900, 0x18 },
+{ "staging/android/ion.h", "ION_IOC_HEAP_QUERY", _IOC_READ|_IOC_WRITE, 0x4908, 0x18 },
+{ "video/da8xx-fb.h", "FBIGET_BRIGHTNESS", _IOC_READ, 0x4603, 0x04 },
+{ "video/da8xx-fb.h", "FBIGET_COLOR", _IOC_READ, 0x4605, 0x04 },
+{ "video/da8xx-fb.h", "FBIOGET_CONTRAST", _IOC_READ, 0x4601, 0x04 },
+{ "video/da8xx-fb.h", "FBIOPUT_CONTRAST", _IOC_WRITE, 0x4602, 0x04 },
+{ "video/da8xx-fb.h", "FBIPUT_BRIGHTNESS", _IOC_WRITE, 0x4603, 0x04 },
+{ "video/da8xx-fb.h", "FBIPUT_COLOR", _IOC_WRITE, 0x4606, 0x04 },
+{ "video/da8xx-fb.h", "FBIPUT_HSYNC", _IOC_WRITE, 0x4609, 0x04 },
+{ "video/da8xx-fb.h", "FBIPUT_VSYNC", _IOC_WRITE, 0x460a, 0x04 },
+{ "video/kyro.h", "KYRO_IOCTL_OVERLAY_CREATE", _IOC_NONE, 0x6b00, 0x00 },
+{ "video/kyro.h", "KYRO_IOCTL_OVERLAY_OFFSET", _IOC_NONE, 0x6b04, 0x00 },
+{ "video/kyro.h", "KYRO_IOCTL_OVERLAY_VIEWPORT_SET", _IOC_NONE, 0x6b01, 0x00 },
+{ "video/kyro.h", "KYRO_IOCTL_SET_VIDEO_MODE", _IOC_NONE, 0x6b02, 0x00 },
+{ "video/kyro.h", "KYRO_IOCTL_STRIDE", _IOC_NONE, 0x6b05, 0x00 },
+{ "video/kyro.h", "KYRO_IOCTL_UVSTRIDE", _IOC_NONE, 0x6b03, 0x00 },
+{ "video/sisfb.h", "SISFB_COMMAND", _IOC_READ|_IOC_WRITE, 0xf305, 0x54 },
+{ "video/sisfb.h", "SISFB_GET_AUTOMAXIMIZE", _IOC_READ, 0xf303, 0x04 },
+{ "video/sisfb.h", "SISFB_GET_AUTOMAXIMIZE_OLD", _IOC_READ, 0x6efa, 0x04 },
+{ "video/sisfb.h", "SISFB_GET_INFO", _IOC_READ, 0xf301, 0x114 },
+{ "video/sisfb.h", "SISFB_GET_INFO_OLD", _IOC_READ, 0x6ef8, 0x04 },
+{ "video/sisfb.h", "SISFB_GET_INFO_SIZE", _IOC_READ, 0xf300, 0x04 },
+{ "video/sisfb.h", "SISFB_GET_TVPOSOFFSET", _IOC_READ, 0xf304, 0x04 },
+{ "video/sisfb.h", "SISFB_GET_VBRSTATUS", _IOC_READ, 0xf302, 0x04 },
+{ "video/sisfb.h", "SISFB_GET_VBRSTATUS_OLD", _IOC_READ, 0x6ef9, 0x04 },
+{ "video/sisfb.h", "SISFB_SET_AUTOMAXIMIZE", _IOC_WRITE, 0xf303, 0x04 },
+{ "video/sisfb.h", "SISFB_SET_AUTOMAXIMIZE_OLD", _IOC_WRITE, 0x6efa, 0x04 },
+{ "video/sisfb.h", "SISFB_SET_LOCK", _IOC_WRITE, 0xf306, 0x04 },
+{ "video/sisfb.h", "SISFB_SET_TVPOSOFFSET", _IOC_WRITE, 0xf304, 0x04 },
+{ "video/sstfb.h", "SSTFB_GET_VGAPASS", _IOC_READ, 0x46dd, 0x04 },
+{ "video/sstfb.h", "SSTFB_SET_VGAPASS", _IOC_WRITE, 0x46dd, 0x04 },
+{ "xen/evtchn.h", "IOCTL_EVTCHN_BIND_INTERDOMAIN", _IOC_NONE, 0x4501, 0x08 },
+{ "xen/evtchn.h", "IOCTL_EVTCHN_BIND_UNBOUND_PORT", _IOC_NONE, 0x4502, 0x04 },
+{ "xen/evtchn.h", "IOCTL_EVTCHN_BIND_VIRQ", _IOC_NONE, 0x4500, 0x04 },
+{ "xen/evtchn.h", "IOCTL_EVTCHN_NOTIFY", _IOC_NONE, 0x4504, 0x04 },
+{ "xen/evtchn.h", "IOCTL_EVTCHN_RESET", _IOC_NONE, 0x4505, 0x00 },
+{ "xen/evtchn.h", "IOCTL_EVTCHN_RESTRICT_DOMID", _IOC_NONE, 0x4506, 0x02 },
+{ "xen/evtchn.h", "IOCTL_EVTCHN_UNBIND", _IOC_NONE, 0x4503, 0x04 },
+{ "xen/gntdev.h", "IOCTL_GNTDEV_DMABUF_EXP_FROM_REFS", _IOC_NONE, 0x4709, 0x14 },
+{ "xen/gntdev.h", "IOCTL_GNTDEV_DMABUF_EXP_WAIT_RELEASED", _IOC_NONE, 0x470a, 0x08 },
+{ "xen/gntdev.h", "IOCTL_GNTDEV_DMABUF_IMP_RELEASE", _IOC_NONE, 0x470c, 0x08 },
+{ "xen/gntdev.h", "IOCTL_GNTDEV_DMABUF_IMP_TO_REFS", _IOC_NONE, 0x470b, 0x14 },
+{ "xen/gntdev.h", "IOCTL_GNTDEV_GET_OFFSET_FOR_VADDR", _IOC_NONE, 0x4702, 0x18 },
+{ "xen/gntdev.h", "IOCTL_GNTDEV_GRANT_COPY", _IOC_NONE, 0x4708, 0x08 },
+{ "xen/gntdev.h", "IOCTL_GNTDEV_MAP_GRANT_REF", _IOC_NONE, 0x4700, 0x18 },
+{ "xen/gntdev.h", "IOCTL_GNTDEV_SET_MAX_GRANTS", _IOC_NONE, 0x4703, 0x04 },
+{ "xen/gntdev.h", "IOCTL_GNTDEV_SET_UNMAP_NOTIFY", _IOC_NONE, 0x4707, 0x10 },
+{ "xen/gntdev.h", "IOCTL_GNTDEV_UNMAP_GRANT_REF", _IOC_NONE, 0x4701, 0x10 },
+{ "xen/xenbus_dev.h", "IOCTL_XENBUS_BACKEND_EVTCHN", _IOC_NONE, 0x4200, 0x00 },
+{ "xen/xenbus_dev.h", "IOCTL_XENBUS_BACKEND_SETUP", _IOC_NONE, 0x4201, 0x00 },
diff --git a/src/linux/32/ioctls_inc_align32.h b/src/linux/32/ioctls_inc_align32.h
new file mode 100644
index 000000000..edbdf6996
--- /dev/null
+++ b/src/linux/32/ioctls_inc_align32.h
@@ -0,0 +1,2914 @@
+/* Generated by ioctls_gen.sh from definitions found in $linux/include/ tree. */
+{ "acpi/apei.h", "APEI_ERST_CLEAR_RECORD", _IOC_WRITE, 0x4501, 0x08 },
+{ "acpi/apei.h", "APEI_ERST_GET_RECORD_COUNT", _IOC_READ, 0x4502, 0x04 },
+{ "asm-generic/ioctls.h", "FIOASYNC", 0, 0x5452, 0 },
+{ "asm-generic/ioctls.h", "FIOCLEX", 0, 0x5451, 0 },
+{ "asm-generic/ioctls.h", "FIONBIO", 0, 0x5421, 0 },
+{ "asm-generic/ioctls.h", "FIONCLEX", 0, 0x5450, 0 },
+{ "asm-generic/ioctls.h", "FIONREAD", 0, 0x541B, 0 },
+{ "asm-generic/ioctls.h", "FIOQSIZE", 0, 0x5460, 0 },
+{ "asm-generic/ioctls.h", "TCFLSH", 0, 0x540B, 0 },
+{ "asm-generic/ioctls.h", "TCGETA", 0, 0x5405, 0 },
+{ "asm-generic/ioctls.h", "TCGETS", 0, 0x5401, 0 },
+{ "asm-generic/ioctls.h", "TCGETS2", _IOC_READ, 0x542a, 0x2c },
+{ "asm-generic/ioctls.h", "TCGETX", 0, 0x5432, 0 },
+{ "asm-generic/ioctls.h", "TCSBRK", 0, 0x5409, 0 },
+{ "asm-generic/ioctls.h", "TCSBRKP", 0, 0x5425, 0 },
+{ "asm-generic/ioctls.h", "TCSETA", 0, 0x5406, 0 },
+{ "asm-generic/ioctls.h", "TCSETAF", 0, 0x5408, 0 },
+{ "asm-generic/ioctls.h", "TCSETAW", 0, 0x5407, 0 },
+{ "asm-generic/ioctls.h", "TCSETS", 0, 0x5402, 0 },
+{ "asm-generic/ioctls.h", "TCSETS2", _IOC_WRITE, 0x542b, 0x2c },
+{ "asm-generic/ioctls.h", "TCSETSF", 0, 0x5404, 0 },
+{ "asm-generic/ioctls.h", "TCSETSF2", _IOC_WRITE, 0x542d, 0x2c },
+{ "asm-generic/ioctls.h", "TCSETSW", 0, 0x5403, 0 },
+{ "asm-generic/ioctls.h", "TCSETSW2", _IOC_WRITE, 0x542c, 0x2c },
+{ "asm-generic/ioctls.h", "TCSETX", 0, 0x5433, 0 },
+{ "asm-generic/ioctls.h", "TCSETXF", 0, 0x5434, 0 },
+{ "asm-generic/ioctls.h", "TCSETXW", 0, 0x5435, 0 },
+{ "asm-generic/ioctls.h", "TCXONC", 0, 0x540A, 0 },
+{ "asm-generic/ioctls.h", "TIOCCBRK", 0, 0x5428, 0 },
+{ "asm-generic/ioctls.h", "TIOCCONS", 0, 0x541D, 0 },
+{ "asm-generic/ioctls.h", "TIOCEXCL", 0, 0x540C, 0 },
+{ "asm-generic/ioctls.h", "TIOCGDEV", _IOC_READ, 0x5432, 0x04 },
+{ "asm-generic/ioctls.h", "TIOCGETD", 0, 0x5424, 0 },
+{ "asm-generic/ioctls.h", "TIOCGEXCL", _IOC_READ, 0x5440, 0x04 },
+{ "asm-generic/ioctls.h", "TIOCGICOUNT", 0, 0x545D, 0 },
+{ "asm-generic/ioctls.h", "TIOCGISO7816", _IOC_READ, 0x5442, 0x28 },
+{ "asm-generic/ioctls.h", "TIOCGLCKTRMIOS", 0, 0x5456, 0 },
+{ "asm-generic/ioctls.h", "TIOCGPGRP", 0, 0x540F, 0 },
+{ "asm-generic/ioctls.h", "TIOCGPKT", _IOC_READ, 0x5438, 0x04 },
+{ "asm-generic/ioctls.h", "TIOCGPTLCK", _IOC_READ, 0x5439, 0x04 },
+{ "asm-generic/ioctls.h", "TIOCGPTN", _IOC_READ, 0x5430, 0x04 },
+{ "asm-generic/ioctls.h", "TIOCGPTPEER", _IOC_NONE, 0x5441, 0x00 },
+{ "asm-generic/ioctls.h", "TIOCGRS485", 0, 0x542E, 0 },
+{ "asm-generic/ioctls.h", "TIOCGSERIAL", 0, 0x541E, 0 },
+{ "asm-generic/ioctls.h", "TIOCGSID", 0, 0x5429, 0 },
+{ "asm-generic/ioctls.h", "TIOCGSOFTCAR", 0, 0x5419, 0 },
+{ "asm-generic/ioctls.h", "TIOCGWINSZ", 0, 0x5413, 0 },
+{ "asm-generic/ioctls.h", "TIOCLINUX", 0, 0x541C, 0 },
+{ "asm-generic/ioctls.h", "TIOCMBIC", 0, 0x5417, 0 },
+{ "asm-generic/ioctls.h", "TIOCMBIS", 0, 0x5416, 0 },
+{ "asm-generic/ioctls.h", "TIOCMGET", 0, 0x5415, 0 },
+{ "asm-generic/ioctls.h", "TIOCMIWAIT", 0, 0x545C, 0 },
+{ "asm-generic/ioctls.h", "TIOCMSET", 0, 0x5418, 0 },
+{ "asm-generic/ioctls.h", "TIOCNOTTY", 0, 0x5422, 0 },
+{ "asm-generic/ioctls.h", "TIOCNXCL", 0, 0x540D, 0 },
+{ "asm-generic/ioctls.h", "TIOCOUTQ", 0, 0x5411, 0 },
+{ "asm-generic/ioctls.h", "TIOCPKT", 0, 0x5420, 0 },
+{ "asm-generic/ioctls.h", "TIOCSBRK", 0, 0x5427, 0 },
+{ "asm-generic/ioctls.h", "TIOCSCTTY", 0, 0x540E, 0 },
+{ "asm-generic/ioctls.h", "TIOCSERCONFIG", 0, 0x5453, 0 },
+{ "asm-generic/ioctls.h", "TIOCSERGETLSR", 0, 0x5459, 0 },
+{ "asm-generic/ioctls.h", "TIOCSERGETMULTI", 0, 0x545A, 0 },
+{ "asm-generic/ioctls.h", "TIOCSERGSTRUCT", 0, 0x5458, 0 },
+{ "asm-generic/ioctls.h", "TIOCSERGWILD", 0, 0x5454, 0 },
+{ "asm-generic/ioctls.h", "TIOCSERSETMULTI", 0, 0x545B, 0 },
+{ "asm-generic/ioctls.h", "TIOCSERSWILD", 0, 0x5455, 0 },
+{ "asm-generic/ioctls.h", "TIOCSETD", 0, 0x5423, 0 },
+{ "asm-generic/ioctls.h", "TIOCSIG", _IOC_WRITE, 0x5436, 0x04 },
+{ "asm-generic/ioctls.h", "TIOCSISO7816", _IOC_READ|_IOC_WRITE, 0x5443, 0x28 },
+{ "asm-generic/ioctls.h", "TIOCSLCKTRMIOS", 0, 0x5457, 0 },
+{ "asm-generic/ioctls.h", "TIOCSPGRP", 0, 0x5410, 0 },
+{ "asm-generic/ioctls.h", "TIOCSPTLCK", _IOC_WRITE, 0x5431, 0x04 },
+{ "asm-generic/ioctls.h", "TIOCSRS485", 0, 0x542F, 0 },
+{ "asm-generic/ioctls.h", "TIOCSSERIAL", 0, 0x541F, 0 },
+{ "asm-generic/ioctls.h", "TIOCSSOFTCAR", 0, 0x541A, 0 },
+{ "asm-generic/ioctls.h", "TIOCSTI", 0, 0x5412, 0 },
+{ "asm-generic/ioctls.h", "TIOCSWINSZ", 0, 0x5414, 0 },
+{ "asm-generic/ioctls.h", "TIOCVHANGUP", 0, 0x5437, 0 },
+{ "asm-generic/sockios.h", "FIOGETOWN", 0, 0x8903, 0 },
+{ "asm-generic/sockios.h", "FIOSETOWN", 0, 0x8901, 0 },
+{ "asm-generic/sockios.h", "SIOCATMARK", 0, 0x8905, 0 },
+{ "asm-generic/sockios.h", "SIOCGPGRP", 0, 0x8904, 0 },
+{ "asm-generic/sockios.h", "SIOCGSTAMPNS_OLD", 0, 0x8907, 0 },
+{ "asm-generic/sockios.h", "SIOCGSTAMP_OLD", 0, 0x8906, 0 },
+{ "asm-generic/sockios.h", "SIOCSPGRP", 0, 0x8902, 0 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_BO_LIST", _IOC_READ|_IOC_WRITE, 0x6443, 0x18 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_CS", _IOC_READ|_IOC_WRITE, 0x6444, 0x18 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_CTX", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_FENCE_TO_HANDLE", _IOC_READ|_IOC_WRITE, 0x6454, 0x20 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_CREATE", _IOC_READ|_IOC_WRITE, 0x6440, 0x20 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_METADATA", _IOC_READ|_IOC_WRITE, 0x6446, 0x11c },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_MMAP", _IOC_READ|_IOC_WRITE, 0x6441, 0x08 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_OP", _IOC_READ|_IOC_WRITE, 0x6450, 0x10 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_USERPTR", _IOC_READ|_IOC_WRITE, 0x6451, 0x18 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_VA", _IOC_WRITE, 0x6448, 0x28 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_WAIT_IDLE", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_INFO", _IOC_WRITE, 0x6445, 0x20 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_SCHED", _IOC_WRITE, 0x6455, 0x10 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_VM", _IOC_READ|_IOC_WRITE, 0x6453, 0x08 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_WAIT_CS", _IOC_READ|_IOC_WRITE, 0x6449, 0x20 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_WAIT_FENCES", _IOC_READ|_IOC_WRITE, 0x6452, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_ADD_BUFS", _IOC_READ|_IOC_WRITE, 0x6416, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_ADD_CTX", _IOC_READ|_IOC_WRITE, 0x6420, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_ADD_DRAW", _IOC_READ|_IOC_WRITE, 0x6427, 0x04 },
+{ "drm/drm.h", "DRM_IOCTL_ADD_MAP", _IOC_READ|_IOC_WRITE, 0x6415, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_AGP_ACQUIRE", _IOC_NONE, 0x6430, 0x00 },
+{ "drm/drm.h", "DRM_IOCTL_AGP_ALLOC", _IOC_READ|_IOC_WRITE, 0x6434, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_AGP_BIND", _IOC_WRITE, 0x6436, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_AGP_ENABLE", _IOC_WRITE, 0x6432, 0x04 },
+{ "drm/drm.h", "DRM_IOCTL_AGP_FREE", _IOC_WRITE, 0x6435, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_AGP_INFO", _IOC_READ, 0x6433, 0x20 },
+{ "drm/drm.h", "DRM_IOCTL_AGP_RELEASE", _IOC_NONE, 0x6431, 0x00 },
+{ "drm/drm.h", "DRM_IOCTL_AGP_UNBIND", _IOC_WRITE, 0x6437, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_AUTH_MAGIC", _IOC_WRITE, 0x6411, 0x04 },
+{ "drm/drm.h", "DRM_IOCTL_BLOCK", _IOC_READ|_IOC_WRITE, 0x6412, 0x04 },
+{ "drm/drm.h", "DRM_IOCTL_CONTROL", _IOC_WRITE, 0x6414, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_CRTC_GET_SEQUENCE", _IOC_READ|_IOC_WRITE, 0x643b, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_CRTC_QUEUE_SEQUENCE", _IOC_READ|_IOC_WRITE, 0x643c, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_DMA", _IOC_READ|_IOC_WRITE, 0x6429, 0x28 },
+{ "drm/drm.h", "DRM_IOCTL_DROP_MASTER", _IOC_NONE, 0x641f, 0x00 },
+{ "drm/drm.h", "DRM_IOCTL_FINISH", _IOC_WRITE, 0x642c, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_FREE_BUFS", _IOC_WRITE, 0x641a, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_GEM_CLOSE", _IOC_WRITE, 0x6409, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_GEM_FLINK", _IOC_READ|_IOC_WRITE, 0x640a, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_GEM_OPEN", _IOC_READ|_IOC_WRITE, 0x640b, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_GET_CAP", _IOC_READ|_IOC_WRITE, 0x640c, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_GET_CLIENT", _IOC_READ|_IOC_WRITE, 0x6405, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_GET_CTX", _IOC_READ|_IOC_WRITE, 0x6423, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_GET_MAGIC", _IOC_READ, 0x6402, 0x04 },
+{ "drm/drm.h", "DRM_IOCTL_GET_MAP", _IOC_READ|_IOC_WRITE, 0x6404, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_GET_SAREA_CTX", _IOC_READ|_IOC_WRITE, 0x641d, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_GET_STATS", _IOC_READ, 0x6406, 0x7c },
+{ "drm/drm.h", "DRM_IOCTL_GET_UNIQUE", _IOC_READ|_IOC_WRITE, 0x6401, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_INFO_BUFS", _IOC_READ|_IOC_WRITE, 0x6418, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_IRQ_BUSID", _IOC_READ|_IOC_WRITE, 0x6403, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_LOCK", _IOC_WRITE, 0x642a, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_MAP_BUFS", _IOC_READ|_IOC_WRITE, 0x6419, 0x0c },
+{ "drm/drm.h", "DRM_IOCTL_MARK_BUFS", _IOC_WRITE, 0x6417, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_MODESET_CTL", _IOC_WRITE, 0x6408, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_ADDFB", _IOC_READ|_IOC_WRITE, 0x64ae, 0x1c },
+{ "drm/drm.h", "DRM_IOCTL_MODE_ADDFB2", _IOC_READ|_IOC_WRITE, 0x64b8, 0x64 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_ATOMIC", _IOC_READ|_IOC_WRITE, 0x64bc, 0x38 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_ATTACHMODE", _IOC_READ|_IOC_WRITE, 0x64a8, 0x48 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_CREATEPROPBLOB", _IOC_READ|_IOC_WRITE, 0x64bd, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_CREATE_DUMB", _IOC_READ|_IOC_WRITE, 0x64b2, 0x20 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_CREATE_LEASE", _IOC_READ|_IOC_WRITE, 0x64c6, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_CURSOR", _IOC_READ|_IOC_WRITE, 0x64a3, 0x1c },
+{ "drm/drm.h", "DRM_IOCTL_MODE_CURSOR2", _IOC_READ|_IOC_WRITE, 0x64bb, 0x24 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_DESTROYPROPBLOB", _IOC_READ|_IOC_WRITE, 0x64be, 0x04 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_DESTROY_DUMB", _IOC_READ|_IOC_WRITE, 0x64b4, 0x04 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_DETACHMODE", _IOC_READ|_IOC_WRITE, 0x64a9, 0x48 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_DIRTYFB", _IOC_READ|_IOC_WRITE, 0x64b1, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_GETCONNECTOR", _IOC_READ|_IOC_WRITE, 0x64a7, 0x50 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_GETCRTC", _IOC_READ|_IOC_WRITE, 0x64a1, 0x68 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_GETENCODER", _IOC_READ|_IOC_WRITE, 0x64a6, 0x14 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_GETFB", _IOC_READ|_IOC_WRITE, 0x64ad, 0x1c },
+{ "drm/drm.h", "DRM_IOCTL_MODE_GETFB2", _IOC_READ|_IOC_WRITE, 0x64ce, 0x64 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_GETGAMMA", _IOC_READ|_IOC_WRITE, 0x64a4, 0x20 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_GETPLANE", _IOC_READ|_IOC_WRITE, 0x64b6, 0x20 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_GETPLANERESOURCES", _IOC_READ|_IOC_WRITE, 0x64b5, 0x0c },
+{ "drm/drm.h", "DRM_IOCTL_MODE_GETPROPBLOB", _IOC_READ|_IOC_WRITE, 0x64ac, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_GETPROPERTY", _IOC_READ|_IOC_WRITE, 0x64aa, 0x40 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_GETRESOURCES", _IOC_READ|_IOC_WRITE, 0x64a0, 0x40 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_GET_LEASE", _IOC_READ|_IOC_WRITE, 0x64c8, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_LIST_LESSEES", _IOC_READ|_IOC_WRITE, 0x64c7, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_MAP_DUMB", _IOC_READ|_IOC_WRITE, 0x64b3, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_OBJ_GETPROPERTIES", _IOC_READ|_IOC_WRITE, 0x64b9, 0x1c },
+{ "drm/drm.h", "DRM_IOCTL_MODE_OBJ_SETPROPERTY", _IOC_READ|_IOC_WRITE, 0x64ba, 0x14 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_PAGE_FLIP", _IOC_READ|_IOC_WRITE, 0x64b0, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_REVOKE_LEASE", _IOC_READ|_IOC_WRITE, 0x64c9, 0x04 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_RMFB", _IOC_READ|_IOC_WRITE, 0x64af, 0x04 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_SETCRTC", _IOC_READ|_IOC_WRITE, 0x64a2, 0x68 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_SETGAMMA", _IOC_READ|_IOC_WRITE, 0x64a5, 0x20 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_SETPLANE", _IOC_READ|_IOC_WRITE, 0x64b7, 0x30 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_SETPROPERTY", _IOC_READ|_IOC_WRITE, 0x64ab, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_MOD_CTX", _IOC_WRITE, 0x6422, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_NEW_CTX", _IOC_WRITE, 0x6425, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_PRIME_FD_TO_HANDLE", _IOC_READ|_IOC_WRITE, 0x642e, 0x0c },
+{ "drm/drm.h", "DRM_IOCTL_PRIME_HANDLE_TO_FD", _IOC_READ|_IOC_WRITE, 0x642d, 0x0c },
+{ "drm/drm.h", "DRM_IOCTL_RES_CTX", _IOC_READ|_IOC_WRITE, 0x6426, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_RM_CTX", _IOC_READ|_IOC_WRITE, 0x6421, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_RM_DRAW", _IOC_READ|_IOC_WRITE, 0x6428, 0x04 },
+{ "drm/drm.h", "DRM_IOCTL_RM_MAP", _IOC_WRITE, 0x641b, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_SET_CLIENT_CAP", _IOC_WRITE, 0x640d, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_SET_MASTER", _IOC_NONE, 0x641e, 0x00 },
+{ "drm/drm.h", "DRM_IOCTL_SET_SAREA_CTX", _IOC_WRITE, 0x641c, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_SET_UNIQUE", _IOC_WRITE, 0x6410, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_SET_VERSION", _IOC_READ|_IOC_WRITE, 0x6407, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_SG_ALLOC", _IOC_READ|_IOC_WRITE, 0x6438, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_SG_FREE", _IOC_WRITE, 0x6439, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_SWITCH_CTX", _IOC_WRITE, 0x6424, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_CREATE", _IOC_READ|_IOC_WRITE, 0x64bf, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_DESTROY", _IOC_READ|_IOC_WRITE, 0x64c0, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_FD_TO_HANDLE", _IOC_READ|_IOC_WRITE, 0x64c2, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_HANDLE_TO_FD", _IOC_READ|_IOC_WRITE, 0x64c1, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_QUERY", _IOC_READ|_IOC_WRITE, 0x64cb, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_RESET", _IOC_READ|_IOC_WRITE, 0x64c4, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_SIGNAL", _IOC_READ|_IOC_WRITE, 0x64c5, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_TIMELINE_SIGNAL", _IOC_READ|_IOC_WRITE, 0x64cd, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_TIMELINE_WAIT", _IOC_READ|_IOC_WRITE, 0x64ca, 0x28 },
+{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_TRANSFER", _IOC_READ|_IOC_WRITE, 0x64cc, 0x20 },
+{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_WAIT", _IOC_READ|_IOC_WRITE, 0x64c3, 0x20 },
+{ "drm/drm.h", "DRM_IOCTL_UNBLOCK", _IOC_READ|_IOC_WRITE, 0x6413, 0x04 },
+{ "drm/drm.h", "DRM_IOCTL_UNLOCK", _IOC_WRITE, 0x642b, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_UPDATE_DRAW", _IOC_WRITE, 0x643f, 0x14 },
+{ "drm/drm.h", "DRM_IOCTL_VERSION", _IOC_READ|_IOC_WRITE, 0x6400, 0x24 },
+{ "drm/drm.h", "DRM_IOCTL_WAIT_VBLANK", _IOC_READ|_IOC_WRITE, 0x643a, 0x10 },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_CPU_FINI", _IOC_WRITE, 0x6445, 0x08 },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_CPU_PREP", _IOC_WRITE, 0x6444, 0x18 },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_NEW", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_SUBMIT", _IOC_READ|_IOC_WRITE, 0x6446, 0x48 },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_USERPTR", _IOC_READ|_IOC_WRITE, 0x6448, 0x18 },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_WAIT", _IOC_WRITE, 0x6449, 0x20 },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_PM_QUERY_DOM", _IOC_READ|_IOC_WRITE, 0x644a, 0x48 },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_PM_QUERY_SIG", _IOC_READ|_IOC_WRITE, 0x644b, 0x4c },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_WAIT_FENCE", _IOC_WRITE, 0x6447, 0x20 },
+{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_G2D_EXEC", _IOC_READ|_IOC_WRITE, 0x6462, 0x08 },
+{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_G2D_GET_VER", _IOC_READ|_IOC_WRITE, 0x6460, 0x08 },
+{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_G2D_SET_CMDLIST", _IOC_READ|_IOC_WRITE, 0x6461, 0x28 },
+{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_GEM_CREATE", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 },
+{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_GEM_GET", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 },
+{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_GEM_MAP", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 },
+{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_IPP_COMMIT", _IOC_READ|_IOC_WRITE, 0x6483, 0x20 },
+{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_IPP_GET_CAPS", _IOC_READ|_IOC_WRITE, 0x6481, 0x18 },
+{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_IPP_GET_LIMITS", _IOC_READ|_IOC_WRITE, 0x6482, 0x20 },
+{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_IPP_GET_RESOURCES", _IOC_READ|_IOC_WRITE, 0x6480, 0x10 },
+{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_VIDI_CONNECTION", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 },
+{ "drm/i810_drm.h", "DRM_IOCTL_I810_CLEAR", _IOC_WRITE, 0x6442, 0x0c },
+{ "drm/i810_drm.h", "DRM_IOCTL_I810_COPY", _IOC_WRITE, 0x6447, 0x0c },
+{ "drm/i810_drm.h", "DRM_IOCTL_I810_DOCOPY", _IOC_NONE, 0x6448, 0x00 },
+{ "drm/i810_drm.h", "DRM_IOCTL_I810_FLIP", _IOC_NONE, 0x644e, 0x00 },
+{ "drm/i810_drm.h", "DRM_IOCTL_I810_FLUSH", _IOC_NONE, 0x6443, 0x00 },
+{ "drm/i810_drm.h", "DRM_IOCTL_I810_FSTATUS", _IOC_NONE, 0x644a, 0x00 },
+{ "drm/i810_drm.h", "DRM_IOCTL_I810_GETAGE", _IOC_NONE, 0x6444, 0x00 },
+{ "drm/i810_drm.h", "DRM_IOCTL_I810_GETBUF", _IOC_READ|_IOC_WRITE, 0x6445, 0x10 },
+{ "drm/i810_drm.h", "DRM_IOCTL_I810_INIT", _IOC_WRITE, 0x6440, 0x40 },
+{ "drm/i810_drm.h", "DRM_IOCTL_I810_MC", _IOC_WRITE, 0x644c, 0x14 },
+{ "drm/i810_drm.h", "DRM_IOCTL_I810_OV0FLIP", _IOC_NONE, 0x644b, 0x00 },
+{ "drm/i810_drm.h", "DRM_IOCTL_I810_OV0INFO", _IOC_READ, 0x6449, 0x08 },
+{ "drm/i810_drm.h", "DRM_IOCTL_I810_RSTATUS", _IOC_NONE, 0x644d, 0x00 },
+{ "drm/i810_drm.h", "DRM_IOCTL_I810_SWAP", _IOC_NONE, 0x6446, 0x00 },
+{ "drm/i810_drm.h", "DRM_IOCTL_I810_VERTEX", _IOC_WRITE, 0x6441, 0x0c },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_ALLOC", _IOC_READ|_IOC_WRITE, 0x6448, 0x10 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_BATCHBUFFER", _IOC_WRITE, 0x6443, 0x18 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_CMDBUFFER", _IOC_WRITE, 0x644b, 0x18 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_DESTROY_HEAP", _IOC_WRITE, 0x644c, 0x04 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_FLIP", _IOC_NONE, 0x6442, 0x00 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_FLUSH", _IOC_NONE, 0x6441, 0x00 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_FREE", _IOC_WRITE, 0x6449, 0x08 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_BUSY", _IOC_READ|_IOC_WRITE, 0x6457, 0x08 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_CONTEXT_CREATE", _IOC_READ|_IOC_WRITE, 0x646d, 0x08 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_CONTEXT_CREATE_EXT", _IOC_READ|_IOC_WRITE, 0x646d, 0x10 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_CONTEXT_DESTROY", _IOC_WRITE, 0x646e, 0x08 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_CONTEXT_GETPARAM", _IOC_READ|_IOC_WRITE, 0x6474, 0x18 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_CONTEXT_SETPARAM", _IOC_READ|_IOC_WRITE, 0x6475, 0x18 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_CREATE", _IOC_READ|_IOC_WRITE, 0x645b, 0x10 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_ENTERVT", _IOC_NONE, 0x6459, 0x00 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_EXECBUFFER", _IOC_WRITE, 0x6454, 0x28 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_EXECBUFFER2", _IOC_WRITE, 0x6469, 0x40 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_EXECBUFFER2_WR", _IOC_READ|_IOC_WRITE, 0x6469, 0x40 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_GET_APERTURE", _IOC_READ, 0x6463, 0x10 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_GET_CACHING", _IOC_READ|_IOC_WRITE, 0x6470, 0x08 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_GET_TILING", _IOC_READ|_IOC_WRITE, 0x6462, 0x10 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_INIT", _IOC_WRITE, 0x6453, 0x10 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_LEAVEVT", _IOC_NONE, 0x645a, 0x00 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_MADVISE", _IOC_READ|_IOC_WRITE, 0x6466, 0x0c },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_MMAP", _IOC_READ|_IOC_WRITE, 0x645e, 0x28 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_MMAP_GTT", _IOC_READ|_IOC_WRITE, 0x6464, 0x10 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_MMAP_OFFSET", _IOC_READ|_IOC_WRITE, 0x6464, 0x20 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_PIN", _IOC_READ|_IOC_WRITE, 0x6455, 0x18 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_PREAD", _IOC_WRITE, 0x645c, 0x20 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_PWRITE", _IOC_WRITE, 0x645d, 0x20 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_SET_CACHING", _IOC_WRITE, 0x646f, 0x08 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_SET_DOMAIN", _IOC_WRITE, 0x645f, 0x0c },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_SET_TILING", _IOC_READ|_IOC_WRITE, 0x6461, 0x10 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_SW_FINISH", _IOC_WRITE, 0x6460, 0x04 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_THROTTLE", _IOC_NONE, 0x6458, 0x00 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_UNPIN", _IOC_WRITE, 0x6456, 0x08 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_USERPTR", _IOC_READ|_IOC_WRITE, 0x6473, 0x18 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_VM_CREATE", _IOC_READ|_IOC_WRITE, 0x647a, 0x10 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_VM_DESTROY", _IOC_WRITE, 0x647b, 0x10 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_WAIT", _IOC_READ|_IOC_WRITE, 0x646c, 0x10 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GETPARAM", _IOC_READ|_IOC_WRITE, 0x6446, 0x08 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GET_PIPE_FROM_CRTC_ID", _IOC_READ|_IOC_WRITE, 0x6465, 0x08 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GET_RESET_STATS", _IOC_READ|_IOC_WRITE, 0x6472, 0x18 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GET_SPRITE_COLORKEY", _IOC_READ|_IOC_WRITE, 0x646a, 0x14 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GET_VBLANK_PIPE", _IOC_READ, 0x644e, 0x04 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_HWS_ADDR", _IOC_WRITE, 0x6451, 0x10 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_INIT", _IOC_WRITE, 0x6440, 0x44 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_INIT_HEAP", _IOC_WRITE, 0x644a, 0x0c },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_IRQ_EMIT", _IOC_READ|_IOC_WRITE, 0x6444, 0x04 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_IRQ_WAIT", _IOC_WRITE, 0x6445, 0x04 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_OVERLAY_ATTRS", _IOC_READ|_IOC_WRITE, 0x6468, 0x2c },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_OVERLAY_PUT_IMAGE", _IOC_WRITE, 0x6467, 0x2c },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_PERF_ADD_CONFIG", _IOC_WRITE, 0x6477, 0x48 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_PERF_OPEN", _IOC_WRITE, 0x6476, 0x10 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_PERF_REMOVE_CONFIG", _IOC_WRITE, 0x6478, 0x08 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_QUERY", _IOC_READ|_IOC_WRITE, 0x6479, 0x10 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_REG_READ", _IOC_READ|_IOC_WRITE, 0x6471, 0x10 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_SETPARAM", _IOC_WRITE, 0x6447, 0x08 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_SET_SPRITE_COLORKEY", _IOC_READ|_IOC_WRITE, 0x646b, 0x14 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_SET_VBLANK_PIPE", _IOC_WRITE, 0x644d, 0x04 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_VBLANK_SWAP", _IOC_READ|_IOC_WRITE, 0x644f, 0x0c },
+{ "drm/i915_drm.h", "I915_PERF_IOCTL_CONFIG", _IOC_NONE, 0x6902, 0x00 },
+{ "drm/i915_drm.h", "I915_PERF_IOCTL_DISABLE", _IOC_NONE, 0x6901, 0x00 },
+{ "drm/i915_drm.h", "I915_PERF_IOCTL_ENABLE", _IOC_NONE, 0x6900, 0x00 },
+{ "drm/lima_drm.h", "DRM_IOCTL_LIMA_CTX_CREATE", _IOC_READ, 0x6445, 0x08 },
+{ "drm/lima_drm.h", "DRM_IOCTL_LIMA_CTX_FREE", _IOC_WRITE, 0x6446, 0x08 },
+{ "drm/lima_drm.h", "DRM_IOCTL_LIMA_GEM_CREATE", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 },
+{ "drm/lima_drm.h", "DRM_IOCTL_LIMA_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 },
+{ "drm/lima_drm.h", "DRM_IOCTL_LIMA_GEM_SUBMIT", _IOC_WRITE, 0x6443, 0x30 },
+{ "drm/lima_drm.h", "DRM_IOCTL_LIMA_GEM_WAIT", _IOC_WRITE, 0x6444, 0x10 },
+{ "drm/lima_drm.h", "DRM_IOCTL_LIMA_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 },
+{ "drm/mga_drm.h", "DRM_IOCTL_MGA_BLIT", _IOC_WRITE, 0x6448, 0x34 },
+{ "drm/mga_drm.h", "DRM_IOCTL_MGA_CLEAR", _IOC_WRITE, 0x6444, 0x14 },
+{ "drm/mga_drm.h", "DRM_IOCTL_MGA_DMA_BOOTSTRAP", _IOC_READ|_IOC_WRITE, 0x644c, 0x1c },
+{ "drm/mga_drm.h", "DRM_IOCTL_MGA_FLUSH", _IOC_WRITE, 0x6441, 0x08 },
+{ "drm/mga_drm.h", "DRM_IOCTL_MGA_GETPARAM", _IOC_READ|_IOC_WRITE, 0x6449, 0x08 },
+{ "drm/mga_drm.h", "DRM_IOCTL_MGA_ILOAD", _IOC_WRITE, 0x6447, 0x0c },
+{ "drm/mga_drm.h", "DRM_IOCTL_MGA_INDICES", _IOC_WRITE, 0x6446, 0x10 },
+{ "drm/mga_drm.h", "DRM_IOCTL_MGA_INIT", _IOC_WRITE, 0x6440, 0x5c },
+{ "drm/mga_drm.h", "DRM_IOCTL_MGA_RESET", _IOC_NONE, 0x6442, 0x00 },
+{ "drm/mga_drm.h", "DRM_IOCTL_MGA_SET_FENCE", _IOC_WRITE, 0x644a, 0x04 },
+{ "drm/mga_drm.h", "DRM_IOCTL_MGA_SWAP", _IOC_NONE, 0x6443, 0x00 },
+{ "drm/mga_drm.h", "DRM_IOCTL_MGA_VERTEX", _IOC_WRITE, 0x6445, 0x0c },
+{ "drm/mga_drm.h", "DRM_IOCTL_MGA_WAIT_FENCE", _IOC_READ|_IOC_WRITE, 0x644b, 0x04 },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_CPU_FINI", _IOC_WRITE, 0x6445, 0x04 },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_CPU_PREP", _IOC_WRITE, 0x6444, 0x18 },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6443, 0x18 },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_MADVISE", _IOC_READ|_IOC_WRITE, 0x6448, 0x0c },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_NEW", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_SUBMIT", _IOC_READ|_IOC_WRITE, 0x6446, 0x48 },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_SUBMITQUEUE_CLOSE", _IOC_WRITE, 0x644b, 0x04 },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_SUBMITQUEUE_NEW", _IOC_READ|_IOC_WRITE, 0x644a, 0x0c },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_SUBMITQUEUE_QUERY", _IOC_WRITE, 0x644c, 0x18 },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_WAIT_FENCE", _IOC_WRITE, 0x6447, 0x1c },
+{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_CPU_FINI", _IOC_WRITE, 0x6483, 0x04 },
+{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_CPU_PREP", _IOC_WRITE, 0x6482, 0x08 },
+{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6484, 0x28 },
+{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_NEW", _IOC_READ|_IOC_WRITE, 0x6480, 0x30 },
+{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_PUSHBUF", _IOC_READ|_IOC_WRITE, 0x6481, 0x40 },
+{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_SVM_BIND", _IOC_READ|_IOC_WRITE, 0x6449, 0x40 },
+{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_SVM_INIT", _IOC_READ|_IOC_WRITE, 0x6448, 0x10 },
+{ "drm/omap_drm.h", "DRM_IOCTL_OMAP_GEM_CPU_FINI", _IOC_WRITE, 0x6445, 0x10 },
+{ "drm/omap_drm.h", "DRM_IOCTL_OMAP_GEM_CPU_PREP", _IOC_WRITE, 0x6444, 0x08 },
+{ "drm/omap_drm.h", "DRM_IOCTL_OMAP_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6446, 0x18 },
+{ "drm/omap_drm.h", "DRM_IOCTL_OMAP_GEM_NEW", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 },
+{ "drm/omap_drm.h", "DRM_IOCTL_OMAP_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 },
+{ "drm/omap_drm.h", "DRM_IOCTL_OMAP_SET_PARAM", _IOC_WRITE, 0x6441, 0x10 },
+{ "drm/panfrost_drm.h", "DRM_IOCTL_PANFROST_CREATE_BO", _IOC_READ|_IOC_WRITE, 0x6442, 0x18 },
+{ "drm/panfrost_drm.h", "DRM_IOCTL_PANFROST_GET_BO_OFFSET", _IOC_READ|_IOC_WRITE, 0x6445, 0x10 },
+{ "drm/panfrost_drm.h", "DRM_IOCTL_PANFROST_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 },
+{ "drm/panfrost_drm.h", "DRM_IOCTL_PANFROST_MADVISE", _IOC_READ|_IOC_WRITE, 0x6448, 0x0c },
+{ "drm/panfrost_drm.h", "DRM_IOCTL_PANFROST_MMAP_BO", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 },
+{ "drm/panfrost_drm.h", "DRM_IOCTL_PANFROST_PERFCNT_DUMP", _IOC_WRITE, 0x6447, 0x08 },
+{ "drm/panfrost_drm.h", "DRM_IOCTL_PANFROST_PERFCNT_ENABLE", _IOC_WRITE, 0x6446, 0x08 },
+{ "drm/panfrost_drm.h", "DRM_IOCTL_PANFROST_SUBMIT", _IOC_WRITE, 0x6440, 0x28 },
+{ "drm/panfrost_drm.h", "DRM_IOCTL_PANFROST_WAIT_BO", _IOC_WRITE, 0x6441, 0x10 },
+{ "drm/qxl_drm.h", "DRM_IOCTL_QXL_ALLOC", _IOC_READ|_IOC_WRITE, 0x6440, 0x08 },
+{ "drm/qxl_drm.h", "DRM_IOCTL_QXL_ALLOC_SURF", _IOC_READ|_IOC_WRITE, 0x6446, 0x18 },
+{ "drm/qxl_drm.h", "DRM_IOCTL_QXL_CLIENTCAP", _IOC_WRITE, 0x6445, 0x08 },
+{ "drm/qxl_drm.h", "DRM_IOCTL_QXL_EXECBUFFER", _IOC_WRITE, 0x6442, 0x10 },
+{ "drm/qxl_drm.h", "DRM_IOCTL_QXL_GETPARAM", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 },
+{ "drm/qxl_drm.h", "DRM_IOCTL_QXL_MAP", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 },
+{ "drm/qxl_drm.h", "DRM_IOCTL_QXL_UPDATE_AREA", _IOC_WRITE, 0x6443, 0x18 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_BLIT", _IOC_WRITE, 0x644b, 0x18 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_CCE_IDLE", _IOC_NONE, 0x6444, 0x00 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_CCE_RESET", _IOC_NONE, 0x6443, 0x00 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_CCE_START", _IOC_NONE, 0x6441, 0x00 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_CCE_STOP", _IOC_WRITE, 0x6442, 0x08 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_CLEAR", _IOC_WRITE, 0x6448, 0x14 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_DEPTH", _IOC_WRITE, 0x644c, 0x18 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_FLIP", _IOC_NONE, 0x6453, 0x00 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_FULLSCREEN", _IOC_WRITE, 0x6450, 0x04 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_GETPARAM", _IOC_READ|_IOC_WRITE, 0x6452, 0x08 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_INDICES", _IOC_WRITE, 0x644a, 0x14 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_INDIRECT", _IOC_READ|_IOC_WRITE, 0x644f, 0x10 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_INIT", _IOC_WRITE, 0x6440, 0x58 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_RESET", _IOC_NONE, 0x6446, 0x00 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_STIPPLE", _IOC_WRITE, 0x644d, 0x04 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_SWAP", _IOC_NONE, 0x6447, 0x00 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_VERTEX", _IOC_WRITE, 0x6449, 0x10 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_ALLOC", _IOC_READ|_IOC_WRITE, 0x6453, 0x10 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CLEAR", _IOC_WRITE, 0x6448, 0x18 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CMDBUF", _IOC_WRITE, 0x6450, 0x10 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CP_IDLE", _IOC_NONE, 0x6444, 0x00 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CP_INIT", _IOC_WRITE, 0x6440, 0x54 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CP_RESET", _IOC_NONE, 0x6443, 0x00 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CP_RESUME", _IOC_NONE, 0x6458, 0x00 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CP_START", _IOC_NONE, 0x6441, 0x00 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CP_STOP", _IOC_WRITE, 0x6442, 0x08 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CS", _IOC_READ|_IOC_WRITE, 0x6466, 0x20 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_FLIP", _IOC_NONE, 0x6452, 0x00 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_FREE", _IOC_WRITE, 0x6454, 0x08 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_FULLSCREEN", _IOC_WRITE, 0x6446, 0x04 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_BUSY", _IOC_READ|_IOC_WRITE, 0x646a, 0x08 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_CREATE", _IOC_READ|_IOC_WRITE, 0x645d, 0x1c },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_GET_TILING", _IOC_READ|_IOC_WRITE, 0x6469, 0x0c },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x645c, 0x18 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_MMAP", _IOC_READ|_IOC_WRITE, 0x645e, 0x20 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_OP", _IOC_READ|_IOC_WRITE, 0x646c, 0x10 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_PREAD", _IOC_READ|_IOC_WRITE, 0x6461, 0x20 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_PWRITE", _IOC_READ|_IOC_WRITE, 0x6462, 0x20 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_SET_DOMAIN", _IOC_READ|_IOC_WRITE, 0x6463, 0x0c },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_SET_TILING", _IOC_READ|_IOC_WRITE, 0x6468, 0x0c },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_USERPTR", _IOC_READ|_IOC_WRITE, 0x646d, 0x18 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_VA", _IOC_READ|_IOC_WRITE, 0x646b, 0x18 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_WAIT_IDLE", _IOC_WRITE, 0x6464, 0x08 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GETPARAM", _IOC_READ|_IOC_WRITE, 0x6451, 0x08 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_INDICES", _IOC_WRITE, 0x644a, 0x14 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_INDIRECT", _IOC_READ|_IOC_WRITE, 0x644d, 0x10 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_INFO", _IOC_READ|_IOC_WRITE, 0x6467, 0x10 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_INIT_HEAP", _IOC_WRITE, 0x6455, 0x0c },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_IRQ_EMIT", _IOC_READ|_IOC_WRITE, 0x6456, 0x04 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_IRQ_WAIT", _IOC_WRITE, 0x6457, 0x04 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_RESET", _IOC_NONE, 0x6445, 0x00 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_SETPARAM", _IOC_WRITE, 0x6459, 0x0c },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_STIPPLE", _IOC_WRITE, 0x644c, 0x04 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_SURF_ALLOC", _IOC_WRITE, 0x645a, 0x0c },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_SURF_FREE", _IOC_WRITE, 0x645b, 0x04 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_SWAP", _IOC_NONE, 0x6447, 0x00 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_TEXTURE", _IOC_READ|_IOC_WRITE, 0x644e, 0x18 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_VERTEX", _IOC_WRITE, 0x6449, 0x10 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_VERTEX2", _IOC_WRITE, 0x644f, 0x18 },
+{ "drm/savage_drm.h", "DRM_IOCTL_SAVAGE_BCI_CMDBUF", _IOC_WRITE, 0x6441, 0x24 },
+{ "drm/savage_drm.h", "DRM_IOCTL_SAVAGE_BCI_EVENT_EMIT", _IOC_READ|_IOC_WRITE, 0x6442, 0x08 },
+{ "drm/savage_drm.h", "DRM_IOCTL_SAVAGE_BCI_EVENT_WAIT", _IOC_WRITE, 0x6443, 0x08 },
+{ "drm/savage_drm.h", "DRM_IOCTL_SAVAGE_BCI_INIT", _IOC_WRITE, 0x6440, 0x50 },
+{ "drm/sis_drm.h", "DRM_IOCTL_SIS_AGP_ALLOC", _IOC_READ|_IOC_WRITE, 0x6454, 0x10 },
+{ "drm/sis_drm.h", "DRM_IOCTL_SIS_AGP_FREE", _IOC_WRITE, 0x6455, 0x10 },
+{ "drm/sis_drm.h", "DRM_IOCTL_SIS_AGP_INIT", _IOC_READ|_IOC_WRITE, 0x6453, 0x08 },
+{ "drm/sis_drm.h", "DRM_IOCTL_SIS_FB_ALLOC", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 },
+{ "drm/sis_drm.h", "DRM_IOCTL_SIS_FB_FREE", _IOC_WRITE, 0x6445, 0x10 },
+{ "drm/sis_drm.h", "DRM_IOCTL_SIS_FB_INIT", _IOC_WRITE, 0x6456, 0x08 },
+{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_CLOSE_CHANNEL", _IOC_READ|_IOC_WRITE, 0x6446, 0x08 },
+{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GEM_CREATE", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 },
+{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GEM_GET_FLAGS", _IOC_READ|_IOC_WRITE, 0x644d, 0x08 },
+{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GEM_GET_TILING", _IOC_READ|_IOC_WRITE, 0x644b, 0x10 },
+{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GEM_MMAP", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 },
+{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GEM_SET_FLAGS", _IOC_READ|_IOC_WRITE, 0x644c, 0x08 },
+{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GEM_SET_TILING", _IOC_READ|_IOC_WRITE, 0x644a, 0x10 },
+{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GET_SYNCPT", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 },
+{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GET_SYNCPT_BASE", _IOC_READ|_IOC_WRITE, 0x6449, 0x10 },
+{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_OPEN_CHANNEL", _IOC_READ|_IOC_WRITE, 0x6445, 0x10 },
+{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_SUBMIT", _IOC_READ|_IOC_WRITE, 0x6448, 0x58 },
+{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_SYNCPT_INCR", _IOC_READ|_IOC_WRITE, 0x6443, 0x08 },
+{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_SYNCPT_READ", _IOC_READ|_IOC_WRITE, 0x6442, 0x08 },
+{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_SYNCPT_WAIT", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 },
+{ "drm/v3d_drm.h", "DRM_IOCTL_V3D_CREATE_BO", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 },
+{ "drm/v3d_drm.h", "DRM_IOCTL_V3D_GET_BO_OFFSET", _IOC_READ|_IOC_WRITE, 0x6445, 0x08 },
+{ "drm/v3d_drm.h", "DRM_IOCTL_V3D_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 },
+{ "drm/v3d_drm.h", "DRM_IOCTL_V3D_MMAP_BO", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 },
+{ "drm/v3d_drm.h", "DRM_IOCTL_V3D_SUBMIT_CL", _IOC_READ|_IOC_WRITE, 0x6440, 0x38 },
+{ "drm/v3d_drm.h", "DRM_IOCTL_V3D_SUBMIT_CSD", _IOC_WRITE, 0x6447, 0x40 },
+{ "drm/v3d_drm.h", "DRM_IOCTL_V3D_SUBMIT_TFU", _IOC_WRITE, 0x6446, 0x44 },
+{ "drm/v3d_drm.h", "DRM_IOCTL_V3D_WAIT_BO", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_CREATE_BO", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_CREATE_SHADER_BO", _IOC_READ|_IOC_WRITE, 0x6445, 0x18 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_GEM_MADVISE", _IOC_READ|_IOC_WRITE, 0x644b, 0x10 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_GET_HANG_STATE", _IOC_READ|_IOC_WRITE, 0x6446, 0xa0 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_GET_TILING", _IOC_READ|_IOC_WRITE, 0x6449, 0x10 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_LABEL_BO", _IOC_READ|_IOC_WRITE, 0x644a, 0x10 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_MMAP_BO", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_PERFMON_CREATE", _IOC_READ|_IOC_WRITE, 0x644c, 0x18 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_PERFMON_DESTROY", _IOC_READ|_IOC_WRITE, 0x644d, 0x04 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_PERFMON_GET_VALUES", _IOC_READ|_IOC_WRITE, 0x644e, 0x0c },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_SET_TILING", _IOC_READ|_IOC_WRITE, 0x6448, 0x10 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_SUBMIT_CL", _IOC_READ|_IOC_WRITE, 0x6440, 0xb0 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_WAIT_BO", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_WAIT_SEQNO", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 },
+{ "drm/vgem_drm.h", "DRM_IOCTL_VGEM_FENCE_ATTACH", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 },
+{ "drm/vgem_drm.h", "DRM_IOCTL_VGEM_FENCE_SIGNAL", _IOC_WRITE, 0x6442, 0x08 },
+{ "drm/via_drm.h", "DRM_IOCTL_VIA_AGP_INIT", _IOC_READ|_IOC_WRITE, 0x6442, 0x08 },
+{ "drm/via_drm.h", "DRM_IOCTL_VIA_ALLOCMEM", _IOC_READ|_IOC_WRITE, 0x6440, 0x14 },
+{ "drm/via_drm.h", "DRM_IOCTL_VIA_BLIT_SYNC", _IOC_WRITE, 0x644f, 0x08 },
+{ "drm/via_drm.h", "DRM_IOCTL_VIA_CMDBUFFER", _IOC_WRITE, 0x6448, 0x08 },
+{ "drm/via_drm.h", "DRM_IOCTL_VIA_CMDBUF_SIZE", _IOC_READ|_IOC_WRITE, 0x644b, 0x0c },
+{ "drm/via_drm.h", "DRM_IOCTL_VIA_DEC_FUTEX", _IOC_WRITE, 0x6445, 0x10 },
+{ "drm/via_drm.h", "DRM_IOCTL_VIA_DMA_BLIT", _IOC_WRITE, 0x644e, 0x28 },
+{ "drm/via_drm.h", "DRM_IOCTL_VIA_DMA_INIT", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 },
+{ "drm/via_drm.h", "DRM_IOCTL_VIA_FB_INIT", _IOC_READ|_IOC_WRITE, 0x6443, 0x08 },
+{ "drm/via_drm.h", "DRM_IOCTL_VIA_FLUSH", _IOC_NONE, 0x6449, 0x00 },
+{ "drm/via_drm.h", "DRM_IOCTL_VIA_FREEMEM", _IOC_WRITE, 0x6441, 0x14 },
+{ "drm/via_drm.h", "DRM_IOCTL_VIA_MAP_INIT", _IOC_READ|_IOC_WRITE, 0x6444, 0x14 },
+{ "drm/via_drm.h", "DRM_IOCTL_VIA_PCICMD", _IOC_WRITE, 0x644a, 0x08 },
+{ "drm/via_drm.h", "DRM_IOCTL_VIA_WAIT_IRQ", _IOC_READ|_IOC_WRITE, 0x644d, 0x10 },
+{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_EXECBUFFER", _IOC_READ|_IOC_WRITE, 0x6442, 0x20 },
+{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_GETPARAM", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 },
+{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_GET_CAPS", _IOC_READ|_IOC_WRITE, 0x6449, 0x18 },
+{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_MAP", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 },
+{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_RESOURCE_CREATE", _IOC_READ|_IOC_WRITE, 0x6444, 0x38 },
+{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_RESOURCE_INFO", _IOC_READ|_IOC_WRITE, 0x6445, 0x10 },
+{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_TRANSFER_FROM_HOST", _IOC_READ|_IOC_WRITE, 0x6446, 0x24 },
+{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_TRANSFER_TO_HOST", _IOC_READ|_IOC_WRITE, 0x6447, 0x24 },
+{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_WAIT", _IOC_READ|_IOC_WRITE, 0x6448, 0x08 },
+{ "linux/agpgart.h", "AGPIOC_ACQUIRE", _IOC_NONE, 0x4101, 0x00 },
+{ "linux/agpgart.h", "AGPIOC_ALLOCATE", _IOC_READ|_IOC_WRITE, 0x4106, 0x04 },
+{ "linux/agpgart.h", "AGPIOC_BIND", _IOC_WRITE, 0x4108, 0x04 },
+{ "linux/agpgart.h", "AGPIOC_CHIPSET_FLUSH", _IOC_NONE, 0x410a, 0x00 },
+{ "linux/agpgart.h", "AGPIOC_DEALLOCATE", _IOC_WRITE, 0x4107, 0x04 },
+{ "linux/agpgart.h", "AGPIOC_INFO", _IOC_READ, 0x4100, 0x04 },
+{ "linux/agpgart.h", "AGPIOC_PROTECT", _IOC_WRITE, 0x4105, 0x04 },
+{ "linux/agpgart.h", "AGPIOC_RELEASE", _IOC_NONE, 0x4102, 0x00 },
+{ "linux/agpgart.h", "AGPIOC_RESERVE", _IOC_WRITE, 0x4104, 0x04 },
+{ "linux/agpgart.h", "AGPIOC_SETUP", _IOC_WRITE, 0x4103, 0x04 },
+{ "linux/agpgart.h", "AGPIOC_UNBIND", _IOC_WRITE, 0x4109, 0x04 },
+{ "linux/am437x-vpfe.h", "VIDIOC_AM437X_CCDC_CFG", _IOC_WRITE, 0x56c1, 0x04 },
+{ "linux/android/binder.h", "BC_ACQUIRE", _IOC_WRITE, 0x6305, 0x04 },
+{ "linux/android/binder.h", "BC_ACQUIRE_DONE", _IOC_WRITE, 0x6309, 0x10 },
+{ "linux/android/binder.h", "BC_ACQUIRE_RESULT", _IOC_WRITE, 0x6302, 0x04 },
+{ "linux/android/binder.h", "BC_ATTEMPT_ACQUIRE", _IOC_WRITE, 0x630a, 0x08 },
+{ "linux/android/binder.h", "BC_CLEAR_DEATH_NOTIFICATION", _IOC_WRITE, 0x630f, 0x0c },
+{ "linux/android/binder.h", "BC_DEAD_BINDER_DONE", _IOC_WRITE, 0x6310, 0x08 },
+{ "linux/android/binder.h", "BC_DECREFS", _IOC_WRITE, 0x6307, 0x04 },
+{ "linux/android/binder.h", "BC_ENTER_LOOPER", _IOC_NONE, 0x630c, 0x00 },
+{ "linux/android/binder.h", "BC_EXIT_LOOPER", _IOC_NONE, 0x630d, 0x00 },
+{ "linux/android/binder.h", "BC_FREE_BUFFER", _IOC_WRITE, 0x6303, 0x08 },
+{ "linux/android/binder.h", "BC_INCREFS", _IOC_WRITE, 0x6304, 0x04 },
+{ "linux/android/binder.h", "BC_INCREFS_DONE", _IOC_WRITE, 0x6308, 0x10 },
+{ "linux/android/binder.h", "BC_REGISTER_LOOPER", _IOC_NONE, 0x630b, 0x00 },
+{ "linux/android/binder.h", "BC_RELEASE", _IOC_WRITE, 0x6306, 0x04 },
+{ "linux/android/binder.h", "BC_REPLY", _IOC_WRITE, 0x6301, 0x40 },
+{ "linux/android/binder.h", "BC_REPLY_SG", _IOC_WRITE, 0x6312, 0x48 },
+{ "linux/android/binder.h", "BC_REQUEST_DEATH_NOTIFICATION", _IOC_WRITE, 0x630e, 0x0c },
+{ "linux/android/binder.h", "BC_TRANSACTION", _IOC_WRITE, 0x6300, 0x40 },
+{ "linux/android/binder.h", "BC_TRANSACTION_SG", _IOC_WRITE, 0x6311, 0x48 },
+{ "linux/android/binder.h", "BINDER_GET_NODE_DEBUG_INFO", _IOC_READ|_IOC_WRITE, 0x620b, 0x18 },
+{ "linux/android/binder.h", "BINDER_GET_NODE_INFO_FOR_REF", _IOC_READ|_IOC_WRITE, 0x620c, 0x18 },
+{ "linux/android/binder.h", "BINDER_SET_CONTEXT_MGR", _IOC_WRITE, 0x6207, 0x04 },
+{ "linux/android/binder.h", "BINDER_SET_CONTEXT_MGR_EXT", _IOC_WRITE, 0x620d, 0x18 },
+{ "linux/android/binder.h", "BINDER_SET_IDLE_PRIORITY", _IOC_WRITE, 0x6206, 0x04 },
+{ "linux/android/binder.h", "BINDER_SET_IDLE_TIMEOUT", _IOC_WRITE, 0x6203, 0x08 },
+{ "linux/android/binder.h", "BINDER_SET_MAX_THREADS", _IOC_WRITE, 0x6205, 0x04 },
+{ "linux/android/binder.h", "BINDER_THREAD_EXIT", _IOC_WRITE, 0x6208, 0x04 },
+{ "linux/android/binder.h", "BINDER_VERSION", _IOC_READ|_IOC_WRITE, 0x6209, 0x04 },
+{ "linux/android/binder.h", "BINDER_WRITE_READ", _IOC_READ|_IOC_WRITE, 0x6201, 0x30 },
+{ "linux/android/binder.h", "BR_ACQUIRE", _IOC_READ, 0x7208, 0x10 },
+{ "linux/android/binder.h", "BR_ACQUIRE_RESULT", _IOC_READ, 0x7204, 0x04 },
+{ "linux/android/binder.h", "BR_ATTEMPT_ACQUIRE", _IOC_READ, 0x720b, 0x14 },
+{ "linux/android/binder.h", "BR_CLEAR_DEATH_NOTIFICATION_DONE", _IOC_READ, 0x7210, 0x08 },
+{ "linux/android/binder.h", "BR_DEAD_BINDER", _IOC_READ, 0x720f, 0x08 },
+{ "linux/android/binder.h", "BR_DEAD_REPLY", _IOC_NONE, 0x7205, 0x00 },
+{ "linux/android/binder.h", "BR_DECREFS", _IOC_READ, 0x720a, 0x10 },
+{ "linux/android/binder.h", "BR_ERROR", _IOC_READ, 0x7200, 0x04 },
+{ "linux/android/binder.h", "BR_FAILED_REPLY", _IOC_NONE, 0x7211, 0x00 },
+{ "linux/android/binder.h", "BR_FINISHED", _IOC_NONE, 0x720e, 0x00 },
+{ "linux/android/binder.h", "BR_INCREFS", _IOC_READ, 0x7207, 0x10 },
+{ "linux/android/binder.h", "BR_NOOP", _IOC_NONE, 0x720c, 0x00 },
+{ "linux/android/binder.h", "BR_OK", _IOC_NONE, 0x7201, 0x00 },
+{ "linux/android/binder.h", "BR_RELEASE", _IOC_READ, 0x7209, 0x10 },
+{ "linux/android/binder.h", "BR_REPLY", _IOC_READ, 0x7203, 0x40 },
+{ "linux/android/binder.h", "BR_SPAWN_LOOPER", _IOC_NONE, 0x720d, 0x00 },
+{ "linux/android/binder.h", "BR_TRANSACTION", _IOC_READ, 0x7202, 0x40 },
+{ "linux/android/binder.h", "BR_TRANSACTION_COMPLETE", _IOC_NONE, 0x7206, 0x00 },
+{ "linux/android/binder.h", "BR_TRANSACTION_SEC_CTX", _IOC_READ, 0x7202, 0x48 },
+{ "linux/android/binderfs.h", "BINDER_CTL_ADD", _IOC_READ|_IOC_WRITE, 0x6201, 0x108 },
+{ "linux/apm_bios.h", "APM_IOC_STANDBY", _IOC_NONE, 0x4101, 0x00 },
+{ "linux/apm_bios.h", "APM_IOC_SUSPEND", _IOC_NONE, 0x4102, 0x00 },
+{ "linux/arcfb.h", "FBIO_GETCONTROL2", _IOC_READ, 0x4689, 0x04 },
+{ "linux/arcfb.h", "FBIO_WAITEVENT", _IOC_NONE, 0x4688, 0x00 },
+{ "linux/aspeed-lpc-ctrl.h", "ASPEED_LPC_CTRL_IOCTL_GET_SIZE", _IOC_READ|_IOC_WRITE, 0xb200, 0x10 },
+{ "linux/aspeed-lpc-ctrl.h", "ASPEED_LPC_CTRL_IOCTL_MAP", _IOC_WRITE, 0xb201, 0x10 },
+{ "linux/aspeed-p2a-ctrl.h", "ASPEED_P2A_CTRL_IOCTL_GET_MEMORY_CONFIG", _IOC_READ|_IOC_WRITE, 0xb301, 0x10 },
+{ "linux/aspeed-p2a-ctrl.h", "ASPEED_P2A_CTRL_IOCTL_SET_WINDOW", _IOC_WRITE, 0xb300, 0x10 },
+{ "linux/atm_eni.h", "ENI_MEMDUMP", _IOC_WRITE, 0x6160, 0x0c },
+{ "linux/atm_eni.h", "ENI_SETMULT", _IOC_WRITE, 0x6167, 0x0c },
+{ "linux/atm_he.h", "HE_GET_REG", _IOC_WRITE, 0x6160, 0x0c },
+{ "linux/atm_idt77105.h", "IDT77105_GETSTAT", _IOC_WRITE, 0x6132, 0x0c },
+{ "linux/atm_idt77105.h", "IDT77105_GETSTATZ", _IOC_WRITE, 0x6133, 0x0c },
+{ "linux/atm_nicstar.h", "NS_ADJBUFLEV", _IOC_NONE, 0x6163, 0x00 },
+{ "linux/atm_nicstar.h", "NS_GETPSTAT", _IOC_READ|_IOC_WRITE, 0x6161, 0x0c },
+{ "linux/atm_nicstar.h", "NS_SETBUFLEV", _IOC_WRITE, 0x6162, 0x0c },
+{ "linux/atm_tcp.h", "ATMTCP_CREATE", _IOC_NONE, 0x618e, 0x00 },
+{ "linux/atm_tcp.h", "ATMTCP_REMOVE", _IOC_NONE, 0x618f, 0x00 },
+{ "linux/atm_tcp.h", "SIOCSIFATMTCP", _IOC_NONE, 0x6180, 0x00 },
+{ "linux/atm_zatm.h", "ZATM_GETPOOL", _IOC_WRITE, 0x6161, 0x0c },
+{ "linux/atm_zatm.h", "ZATM_GETPOOLZ", _IOC_WRITE, 0x6162, 0x0c },
+{ "linux/atm_zatm.h", "ZATM_SETPOOL", _IOC_WRITE, 0x6163, 0x0c },
+{ "linux/atmarp.h", "ATMARPD_CTRL", _IOC_NONE, 0x61e1, 0x00 },
+{ "linux/atmarp.h", "ATMARP_ENCAP", _IOC_NONE, 0x61e5, 0x00 },
+{ "linux/atmarp.h", "ATMARP_MKIP", _IOC_NONE, 0x61e2, 0x00 },
+{ "linux/atmarp.h", "ATMARP_SETENTRY", _IOC_NONE, 0x61e3, 0x00 },
+{ "linux/atmbr2684.h", "BR2684_SETFILT", _IOC_WRITE, 0x6190, 0x1c },
+{ "linux/atmclip.h", "SIOCMKCLIP", _IOC_NONE, 0x61e0, 0x00 },
+{ "linux/atmdev.h", "ATM_ADDADDR", _IOC_WRITE, 0x6188, 0x0c },
+{ "linux/atmdev.h", "ATM_ADDLECSADDR", _IOC_WRITE, 0x618e, 0x0c },
+{ "linux/atmdev.h", "ATM_ADDPARTY", _IOC_WRITE, 0x61f4, 0x08 },
+{ "linux/atmdev.h", "ATM_DELADDR", _IOC_WRITE, 0x6189, 0x0c },
+{ "linux/atmdev.h", "ATM_DELLECSADDR", _IOC_WRITE, 0x618f, 0x0c },
+{ "linux/atmdev.h", "ATM_DROPPARTY", _IOC_WRITE, 0x61f5, 0x04 },
+{ "linux/atmdev.h", "ATM_GETADDR", _IOC_WRITE, 0x6186, 0x0c },
+{ "linux/atmdev.h", "ATM_GETCIRANGE", _IOC_WRITE, 0x618a, 0x0c },
+{ "linux/atmdev.h", "ATM_GETESI", _IOC_WRITE, 0x6185, 0x0c },
+{ "linux/atmdev.h", "ATM_GETLECSADDR", _IOC_WRITE, 0x6190, 0x0c },
+{ "linux/atmdev.h", "ATM_GETLINKRATE", _IOC_WRITE, 0x6181, 0x0c },
+{ "linux/atmdev.h", "ATM_GETLOOP", _IOC_WRITE, 0x6152, 0x0c },
+{ "linux/atmdev.h", "ATM_GETNAMES", _IOC_WRITE, 0x6183, 0x08 },
+{ "linux/atmdev.h", "ATM_GETSTAT", _IOC_WRITE, 0x6150, 0x0c },
+{ "linux/atmdev.h", "ATM_GETSTATZ", _IOC_WRITE, 0x6151, 0x0c },
+{ "linux/atmdev.h", "ATM_GETTYPE", _IOC_WRITE, 0x6184, 0x0c },
+{ "linux/atmdev.h", "ATM_NEWBACKENDIF", _IOC_WRITE, 0x61f3, 0x02 },
+{ "linux/atmdev.h", "ATM_QUERYLOOP", _IOC_WRITE, 0x6154, 0x0c },
+{ "linux/atmdev.h", "ATM_RSTADDR", _IOC_WRITE, 0x6187, 0x0c },
+{ "linux/atmdev.h", "ATM_SETBACKEND", _IOC_WRITE, 0x61f2, 0x02 },
+{ "linux/atmdev.h", "ATM_SETCIRANGE", _IOC_WRITE, 0x618b, 0x0c },
+{ "linux/atmdev.h", "ATM_SETESI", _IOC_WRITE, 0x618c, 0x0c },
+{ "linux/atmdev.h", "ATM_SETESIF", _IOC_WRITE, 0x618d, 0x0c },
+{ "linux/atmdev.h", "ATM_SETLOOP", _IOC_WRITE, 0x6153, 0x0c },
+{ "linux/atmdev.h", "ATM_SETSC", _IOC_WRITE, 0x61f1, 0x04 },
+{ "linux/atmlec.h", "ATMLEC_CTRL", _IOC_NONE, 0x61d0, 0x00 },
+{ "linux/atmlec.h", "ATMLEC_DATA", _IOC_NONE, 0x61d1, 0x00 },
+{ "linux/atmlec.h", "ATMLEC_MCAST", _IOC_NONE, 0x61d2, 0x00 },
+{ "linux/atmmpc.h", "ATMMPC_CTRL", _IOC_NONE, 0x61d8, 0x00 },
+{ "linux/atmmpc.h", "ATMMPC_DATA", _IOC_NONE, 0x61d9, 0x00 },
+{ "linux/atmsvc.h", "ATMSIGD_CTRL", _IOC_NONE, 0x61f0, 0x00 },
+{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_ASKUMOUNT", _IOC_READ|_IOC_WRITE, 0x937d, 0x18 },
+{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_CATATONIC", _IOC_READ|_IOC_WRITE, 0x9379, 0x18 },
+{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_CLOSEMOUNT", _IOC_READ|_IOC_WRITE, 0x9375, 0x18 },
+{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_EXPIRE", _IOC_READ|_IOC_WRITE, 0x937c, 0x18 },
+{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_FAIL", _IOC_READ|_IOC_WRITE, 0x9377, 0x18 },
+{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_ISMOUNTPOINT", _IOC_READ|_IOC_WRITE, 0x937e, 0x18 },
+{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_OPENMOUNT", _IOC_READ|_IOC_WRITE, 0x9374, 0x18 },
+{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_PROTOSUBVER", _IOC_READ|_IOC_WRITE, 0x9373, 0x18 },
+{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_PROTOVER", _IOC_READ|_IOC_WRITE, 0x9372, 0x18 },
+{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_READY", _IOC_READ|_IOC_WRITE, 0x9376, 0x18 },
+{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_REQUESTER", _IOC_READ|_IOC_WRITE, 0x937b, 0x18 },
+{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_SETPIPEFD", _IOC_READ|_IOC_WRITE, 0x9378, 0x18 },
+{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_TIMEOUT", _IOC_READ|_IOC_WRITE, 0x937a, 0x18 },
+{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_VERSION", _IOC_READ|_IOC_WRITE, 0x9371, 0x18 },
+{ "linux/auto_fs.h", "AUTOFS_IOC_ASKUMOUNT", _IOC_READ, 0x9370, 0x04 },
+{ "linux/auto_fs.h", "AUTOFS_IOC_CATATONIC", _IOC_NONE, 0x9362, 0x00 },
+{ "linux/auto_fs.h", "AUTOFS_IOC_EXPIRE", _IOC_READ, 0x9365, 0x10c },
+{ "linux/auto_fs.h", "AUTOFS_IOC_EXPIRE_MULTI", _IOC_WRITE, 0x9366, 0x04 },
+{ "linux/auto_fs.h", "AUTOFS_IOC_FAIL", _IOC_NONE, 0x9361, 0x00 },
+{ "linux/auto_fs.h", "AUTOFS_IOC_PROTOSUBVER", _IOC_READ, 0x9367, 0x04 },
+{ "linux/auto_fs.h", "AUTOFS_IOC_PROTOVER", _IOC_READ, 0x9363, 0x04 },
+{ "linux/auto_fs.h", "AUTOFS_IOC_READY", _IOC_NONE, 0x9360, 0x00 },
+{ "linux/auto_fs.h", "AUTOFS_IOC_SETTIMEOUT32", _IOC_READ|_IOC_WRITE, 0x9364, 0x04 },
+{ "linux/blkpg.h", "BLKPG", _IOC_NONE, 0x1269, 0x00 },
+{ "linux/blkzoned.h", "BLKCLOSEZONE", _IOC_WRITE, 0x1287, 0x10 },
+{ "linux/blkzoned.h", "BLKFINISHZONE", _IOC_WRITE, 0x1288, 0x10 },
+{ "linux/blkzoned.h", "BLKGETNRZONES", _IOC_READ, 0x1285, 0x04 },
+{ "linux/blkzoned.h", "BLKGETZONESZ", _IOC_READ, 0x1284, 0x04 },
+{ "linux/blkzoned.h", "BLKOPENZONE", _IOC_WRITE, 0x1286, 0x10 },
+{ "linux/blkzoned.h", "BLKREPORTZONE", _IOC_READ|_IOC_WRITE, 0x1282, 0x10 },
+{ "linux/blkzoned.h", "BLKRESETZONE", _IOC_WRITE, 0x1283, 0x10 },
+{ "linux/bt-bmc.h", "BT_BMC_IOCTL_SMS_ATN", _IOC_NONE, 0xb100, 0x00 },
+{ "linux/btrfs.h", "BTRFS_IOC_ADD_DEV", _IOC_WRITE, 0x940a, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_BALANCE", _IOC_WRITE, 0x940c, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_BALANCE_CTL", _IOC_WRITE, 0x9421, 0x04 },
+{ "linux/btrfs.h", "BTRFS_IOC_BALANCE_PROGRESS", _IOC_READ, 0x9422, 0x400 },
+{ "linux/btrfs.h", "BTRFS_IOC_BALANCE_V2", _IOC_READ|_IOC_WRITE, 0x9420, 0x400 },
+{ "linux/btrfs.h", "BTRFS_IOC_CLONE", _IOC_WRITE, 0x9409, 0x04 },
+{ "linux/btrfs.h", "BTRFS_IOC_CLONE_RANGE", _IOC_WRITE, 0x940d, 0x20 },
+{ "linux/btrfs.h", "BTRFS_IOC_DEFAULT_SUBVOL", _IOC_WRITE, 0x9413, 0x08 },
+{ "linux/btrfs.h", "BTRFS_IOC_DEFRAG", _IOC_WRITE, 0x9402, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_DEFRAG_RANGE", _IOC_WRITE, 0x9410, 0x30 },
+{ "linux/btrfs.h", "BTRFS_IOC_DEVICES_READY", _IOC_READ, 0x9427, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_DEV_INFO", _IOC_READ|_IOC_WRITE, 0x941e, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_DEV_REPLACE", _IOC_READ|_IOC_WRITE, 0x9435, 0xa24 },
+{ "linux/btrfs.h", "BTRFS_IOC_FILE_EXTENT_SAME", _IOC_READ|_IOC_WRITE, 0x9436, 0x18 },
+{ "linux/btrfs.h", "BTRFS_IOC_FORGET_DEV", _IOC_WRITE, 0x9405, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_FS_INFO", _IOC_READ, 0x941f, 0x400 },
+{ "linux/btrfs.h", "BTRFS_IOC_GET_DEV_STATS", _IOC_READ|_IOC_WRITE, 0x9434, 0x408 },
+{ "linux/btrfs.h", "BTRFS_IOC_GET_FEATURES", _IOC_READ, 0x9439, 0x18 },
+{ "linux/btrfs.h", "BTRFS_IOC_GET_SUBVOL_INFO", _IOC_READ, 0x943c, 0x1e8 },
+{ "linux/btrfs.h", "BTRFS_IOC_GET_SUBVOL_ROOTREF", _IOC_READ|_IOC_WRITE, 0x943d, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_GET_SUPPORTED_FEATURES", _IOC_READ, 0x9439, 0x48 },
+{ "linux/btrfs.h", "BTRFS_IOC_INO_LOOKUP", _IOC_READ|_IOC_WRITE, 0x9412, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_INO_LOOKUP_USER", _IOC_READ|_IOC_WRITE, 0x943e, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_INO_PATHS", _IOC_READ|_IOC_WRITE, 0x9423, 0x38 },
+{ "linux/btrfs.h", "BTRFS_IOC_LOGICAL_INO", _IOC_READ|_IOC_WRITE, 0x9424, 0x38 },
+{ "linux/btrfs.h", "BTRFS_IOC_LOGICAL_INO_V2", _IOC_READ|_IOC_WRITE, 0x943b, 0x38 },
+{ "linux/btrfs.h", "BTRFS_IOC_QGROUP_ASSIGN", _IOC_WRITE, 0x9429, 0x18 },
+{ "linux/btrfs.h", "BTRFS_IOC_QGROUP_CREATE", _IOC_WRITE, 0x942a, 0x10 },
+{ "linux/btrfs.h", "BTRFS_IOC_QGROUP_LIMIT", _IOC_READ, 0x942b, 0x30 },
+{ "linux/btrfs.h", "BTRFS_IOC_QUOTA_CTL", _IOC_READ|_IOC_WRITE, 0x9428, 0x10 },
+{ "linux/btrfs.h", "BTRFS_IOC_QUOTA_RESCAN", _IOC_WRITE, 0x942c, 0x40 },
+{ "linux/btrfs.h", "BTRFS_IOC_QUOTA_RESCAN_STATUS", _IOC_READ, 0x942d, 0x40 },
+{ "linux/btrfs.h", "BTRFS_IOC_QUOTA_RESCAN_WAIT", _IOC_NONE, 0x942e, 0x00 },
+{ "linux/btrfs.h", "BTRFS_IOC_RESIZE", _IOC_WRITE, 0x9403, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_RM_DEV", _IOC_WRITE, 0x940b, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_RM_DEV_V2", _IOC_WRITE, 0x943a, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_SCAN_DEV", _IOC_WRITE, 0x9404, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_SCRUB", _IOC_READ|_IOC_WRITE, 0x941b, 0x400 },
+{ "linux/btrfs.h", "BTRFS_IOC_SCRUB_CANCEL", _IOC_NONE, 0x941c, 0x00 },
+{ "linux/btrfs.h", "BTRFS_IOC_SCRUB_PROGRESS", _IOC_READ|_IOC_WRITE, 0x941d, 0x400 },
+{ "linux/btrfs.h", "BTRFS_IOC_SEND", _IOC_WRITE, 0x9426, 0x44 },
+{ "linux/btrfs.h", "BTRFS_IOC_SET_FEATURES", _IOC_WRITE, 0x9439, 0x30 },
+{ "linux/btrfs.h", "BTRFS_IOC_SET_RECEIVED_SUBVOL", _IOC_READ|_IOC_WRITE, 0x9425, 0xc0 },
+{ "linux/btrfs.h", "BTRFS_IOC_SNAP_CREATE", _IOC_WRITE, 0x9401, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_SNAP_CREATE_V2", _IOC_WRITE, 0x9417, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_SNAP_DESTROY", _IOC_WRITE, 0x940f, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_SNAP_DESTROY_V2", _IOC_WRITE, 0x943f, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_SPACE_INFO", _IOC_READ|_IOC_WRITE, 0x9414, 0x10 },
+{ "linux/btrfs.h", "BTRFS_IOC_START_SYNC", _IOC_READ, 0x9418, 0x08 },
+{ "linux/btrfs.h", "BTRFS_IOC_SUBVOL_CREATE", _IOC_WRITE, 0x940e, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_SUBVOL_CREATE_V2", _IOC_WRITE, 0x9418, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_SUBVOL_GETFLAGS", _IOC_READ, 0x9419, 0x08 },
+{ "linux/btrfs.h", "BTRFS_IOC_SUBVOL_SETFLAGS", _IOC_WRITE, 0x941a, 0x08 },
+{ "linux/btrfs.h", "BTRFS_IOC_SYNC", _IOC_NONE, 0x9408, 0x00 },
+{ "linux/btrfs.h", "BTRFS_IOC_TRANS_END", _IOC_NONE, 0x9407, 0x00 },
+{ "linux/btrfs.h", "BTRFS_IOC_TRANS_START", _IOC_NONE, 0x9406, 0x00 },
+{ "linux/btrfs.h", "BTRFS_IOC_TREE_SEARCH", _IOC_READ|_IOC_WRITE, 0x9411, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_TREE_SEARCH_V2", _IOC_READ|_IOC_WRITE, 0x9411, 0x70 },
+{ "linux/btrfs.h", "BTRFS_IOC_WAIT_SYNC", _IOC_WRITE, 0x9416, 0x08 },
+{ "linux/capi.h", "CAPI_CLR_FLAGS", _IOC_READ, 0x4325, 0x04 },
+{ "linux/capi.h", "CAPI_GET_ERRCODE", _IOC_READ, 0x4321, 0x02 },
+{ "linux/capi.h", "CAPI_GET_FLAGS", _IOC_READ, 0x4323, 0x04 },
+{ "linux/capi.h", "CAPI_GET_MANUFACTURER", _IOC_READ|_IOC_WRITE, 0x4306, 0x04 },
+{ "linux/capi.h", "CAPI_GET_PROFILE", _IOC_READ|_IOC_WRITE, 0x4309, 0x40 },
+{ "linux/capi.h", "CAPI_GET_SERIAL", _IOC_READ|_IOC_WRITE, 0x4308, 0x04 },
+{ "linux/capi.h", "CAPI_GET_VERSION", _IOC_READ|_IOC_WRITE, 0x4307, 0x10 },
+{ "linux/capi.h", "CAPI_INSTALLED", _IOC_READ, 0x4322, 0x02 },
+{ "linux/capi.h", "CAPI_MANUFACTURER_CMD", _IOC_READ|_IOC_WRITE, 0x4320, 0x08 },
+{ "linux/capi.h", "CAPI_NCCI_GETUNIT", _IOC_READ, 0x4327, 0x04 },
+{ "linux/capi.h", "CAPI_NCCI_OPENCOUNT", _IOC_READ, 0x4326, 0x04 },
+{ "linux/capi.h", "CAPI_REGISTER", _IOC_WRITE, 0x4301, 0x0c },
+{ "linux/capi.h", "CAPI_SET_FLAGS", _IOC_READ, 0x4324, 0x04 },
+{ "linux/cciss_ioctl.h", "CCISS_BIG_PASSTHRU", _IOC_READ|_IOC_WRITE, 0x4212, 0x58 },
+{ "linux/cciss_ioctl.h", "CCISS_DEREGDISK", _IOC_NONE, 0x420c, 0x00 },
+{ "linux/cciss_ioctl.h", "CCISS_GETBUSTYPES", _IOC_READ, 0x4207, 0x04 },
+{ "linux/cciss_ioctl.h", "CCISS_GETDRIVVER", _IOC_READ, 0x4209, 0x04 },
+{ "linux/cciss_ioctl.h", "CCISS_GETFIRMVER", _IOC_READ, 0x4208, 0x04 },
+{ "linux/cciss_ioctl.h", "CCISS_GETHEARTBEAT", _IOC_READ, 0x4206, 0x04 },
+{ "linux/cciss_ioctl.h", "CCISS_GETINTINFO", _IOC_READ, 0x4202, 0x08 },
+{ "linux/cciss_ioctl.h", "CCISS_GETLUNINFO", _IOC_READ, 0x4211, 0x0c },
+{ "linux/cciss_ioctl.h", "CCISS_GETNODENAME", _IOC_READ, 0x4204, 0x10 },
+{ "linux/cciss_ioctl.h", "CCISS_GETPCIINFO", _IOC_READ, 0x4201, 0x08 },
+{ "linux/cciss_ioctl.h", "CCISS_PASSTHRU", _IOC_READ|_IOC_WRITE, 0x420b, 0x54 },
+{ "linux/cciss_ioctl.h", "CCISS_REGNEWD", _IOC_NONE, 0x420e, 0x00 },
+{ "linux/cciss_ioctl.h", "CCISS_REGNEWDISK", _IOC_WRITE, 0x420d, 0x04 },
+{ "linux/cciss_ioctl.h", "CCISS_RESCANDISK", _IOC_NONE, 0x4210, 0x00 },
+{ "linux/cciss_ioctl.h", "CCISS_REVALIDVOLS", _IOC_NONE, 0x420a, 0x00 },
+{ "linux/cciss_ioctl.h", "CCISS_SETINTINFO", _IOC_WRITE, 0x4203, 0x08 },
+{ "linux/cciss_ioctl.h", "CCISS_SETNODENAME", _IOC_WRITE, 0x4205, 0x10 },
+{ "linux/cdrom.h", "CDROMAUDIOBUFSIZ", 0, 0x5382, 0 },
+{ "linux/cdrom.h", "CDROMCLOSETRAY", 0, 0x5319, 0 },
+{ "linux/cdrom.h", "CDROMEJECT", 0, 0x5309, 0 },
+{ "linux/cdrom.h", "CDROMEJECT_SW", 0, 0x530f, 0 },
+{ "linux/cdrom.h", "CDROMGETSPINDOWN", 0, 0x531d, 0 },
+{ "linux/cdrom.h", "CDROMMULTISESSION", 0, 0x5310, 0 },
+{ "linux/cdrom.h", "CDROMPAUSE", 0, 0x5301, 0 },
+{ "linux/cdrom.h", "CDROMPLAYBLK", 0, 0x5317, 0 },
+{ "linux/cdrom.h", "CDROMPLAYMSF", 0, 0x5303, 0 },
+{ "linux/cdrom.h", "CDROMPLAYTRKIND", 0, 0x5304, 0 },
+{ "linux/cdrom.h", "CDROMREADALL", 0, 0x5318, 0 },
+{ "linux/cdrom.h", "CDROMREADAUDIO", 0, 0x530e, 0 },
+{ "linux/cdrom.h", "CDROMREADCOOKED", 0, 0x5315, 0 },
+{ "linux/cdrom.h", "CDROMREADMODE1", 0, 0x530d, 0 },
+{ "linux/cdrom.h", "CDROMREADMODE2", 0, 0x530c, 0 },
+{ "linux/cdrom.h", "CDROMREADRAW", 0, 0x5314, 0 },
+{ "linux/cdrom.h", "CDROMREADTOCENTRY", 0, 0x5306, 0 },
+{ "linux/cdrom.h", "CDROMREADTOCHDR", 0, 0x5305, 0 },
+{ "linux/cdrom.h", "CDROMRESET", 0, 0x5312, 0 },
+{ "linux/cdrom.h", "CDROMRESUME", 0, 0x5302, 0 },
+{ "linux/cdrom.h", "CDROMSEEK", 0, 0x5316, 0 },
+{ "linux/cdrom.h", "CDROMSETSPINDOWN", 0, 0x531e, 0 },
+{ "linux/cdrom.h", "CDROMSTART", 0, 0x5308, 0 },
+{ "linux/cdrom.h", "CDROMSTOP", 0, 0x5307, 0 },
+{ "linux/cdrom.h", "CDROMSUBCHNL", 0, 0x530b, 0 },
+{ "linux/cdrom.h", "CDROMVOLCTRL", 0, 0x530a, 0 },
+{ "linux/cdrom.h", "CDROMVOLREAD", 0, 0x5313, 0 },
+{ "linux/cdrom.h", "CDROM_CHANGER_NSLOTS", 0, 0x5328, 0 },
+{ "linux/cdrom.h", "CDROM_CLEAR_OPTIONS", 0, 0x5321, 0 },
+{ "linux/cdrom.h", "CDROM_DEBUG", 0, 0x5330, 0 },
+{ "linux/cdrom.h", "CDROM_DISC_STATUS", 0, 0x5327, 0 },
+{ "linux/cdrom.h", "CDROM_DRIVE_STATUS", 0, 0x5326, 0 },
+{ "linux/cdrom.h", "CDROM_GET_CAPABILITY", 0, 0x5331, 0 },
+{ "linux/cdrom.h", "CDROM_GET_MCN", 0, 0x5311, 0 },
+{ "linux/cdrom.h", "CDROM_LAST_WRITTEN", 0, 0x5395, 0 },
+{ "linux/cdrom.h", "CDROM_LOCKDOOR", 0, 0x5329, 0 },
+{ "linux/cdrom.h", "CDROM_MEDIA_CHANGED", 0, 0x5325, 0 },
+{ "linux/cdrom.h", "CDROM_NEXT_WRITABLE", 0, 0x5394, 0 },
+{ "linux/cdrom.h", "CDROM_SELECT_DISC", 0, 0x5323, 0 },
+{ "linux/cdrom.h", "CDROM_SELECT_SPEED", 0, 0x5322, 0 },
+{ "linux/cdrom.h", "CDROM_SEND_PACKET", 0, 0x5393, 0 },
+{ "linux/cdrom.h", "CDROM_SET_OPTIONS", 0, 0x5320, 0 },
+{ "linux/cdrom.h", "DVD_AUTH", 0, 0x5392, 0 },
+{ "linux/cdrom.h", "DVD_READ_STRUCT", 0, 0x5390, 0 },
+{ "linux/cdrom.h", "DVD_WRITE_STRUCT", 0, 0x5391, 0 },
+{ "linux/cec.h", "CEC_ADAP_G_CAPS", _IOC_READ|_IOC_WRITE, 0x6100, 0x4c },
+{ "linux/cec.h", "CEC_ADAP_G_CONNECTOR_INFO", _IOC_READ, 0x610a, 0x44 },
+{ "linux/cec.h", "CEC_ADAP_G_LOG_ADDRS", _IOC_READ, 0x6103, 0x5c },
+{ "linux/cec.h", "CEC_ADAP_G_PHYS_ADDR", _IOC_READ, 0x6101, 0x02 },
+{ "linux/cec.h", "CEC_ADAP_S_LOG_ADDRS", _IOC_READ|_IOC_WRITE, 0x6104, 0x5c },
+{ "linux/cec.h", "CEC_ADAP_S_PHYS_ADDR", _IOC_WRITE, 0x6102, 0x02 },
+{ "linux/cec.h", "CEC_DQEVENT", _IOC_READ|_IOC_WRITE, 0x6107, 0x50 },
+{ "linux/cec.h", "CEC_G_MODE", _IOC_READ, 0x6108, 0x04 },
+{ "linux/cec.h", "CEC_RECEIVE", _IOC_READ|_IOC_WRITE, 0x6106, 0x38 },
+{ "linux/cec.h", "CEC_S_MODE", _IOC_WRITE, 0x6109, 0x04 },
+{ "linux/cec.h", "CEC_TRANSMIT", _IOC_READ|_IOC_WRITE, 0x6105, 0x38 },
+{ "linux/chio.h", "CHIOEXCHANGE", _IOC_WRITE, 0x6302, 0x1c },
+{ "linux/chio.h", "CHIOGELEM", _IOC_WRITE, 0x6310, 0x6c },
+{ "linux/chio.h", "CHIOGPARAMS", _IOC_READ, 0x6306, 0x14 },
+{ "linux/chio.h", "CHIOGPICKER", _IOC_READ, 0x6304, 0x04 },
+{ "linux/chio.h", "CHIOGSTATUS", _IOC_WRITE, 0x6308, 0x08 },
+{ "linux/chio.h", "CHIOGVPARAMS", _IOC_READ, 0x6313, 0x70 },
+{ "linux/chio.h", "CHIOINITELEM", _IOC_NONE, 0x6311, 0x00 },
+{ "linux/chio.h", "CHIOMOVE", _IOC_WRITE, 0x6301, 0x14 },
+{ "linux/chio.h", "CHIOPOSITION", _IOC_WRITE, 0x6303, 0x0c },
+{ "linux/chio.h", "CHIOSPICKER", _IOC_WRITE, 0x6305, 0x04 },
+{ "linux/chio.h", "CHIOSVOLTAG", _IOC_WRITE, 0x6312, 0x30 },
+{ "linux/cm4000_cs.h", "CM_IOCARDOFF", _IOC_NONE, 0x6304, 0x00 },
+{ "linux/cm4000_cs.h", "CM_IOCGATR", _IOC_READ|_IOC_WRITE, 0x6301, 0x04 },
+{ "linux/cm4000_cs.h", "CM_IOCGSTATUS", _IOC_READ, 0x6300, 0x04 },
+{ "linux/cm4000_cs.h", "CM_IOCSPTS", _IOC_WRITE, 0x6302, 0x04 },
+{ "linux/cm4000_cs.h", "CM_IOCSRDR", _IOC_NONE, 0x6303, 0x00 },
+{ "linux/cm4000_cs.h", "CM_IOSDBGLVL", _IOC_WRITE, 0x63fa, 0x04 },
+{ "linux/coda.h", "CIOC_KERNEL_VERSION", _IOC_READ|_IOC_WRITE, 0x630a, 0x04 },
+{ "linux/dm-ioctl.h", "DM_DEV_ARM_POLL", _IOC_READ|_IOC_WRITE, 0xfd10, 0x138 },
+{ "linux/dm-ioctl.h", "DM_DEV_CREATE", _IOC_READ|_IOC_WRITE, 0xfd03, 0x138 },
+{ "linux/dm-ioctl.h", "DM_DEV_REMOVE", _IOC_READ|_IOC_WRITE, 0xfd04, 0x138 },
+{ "linux/dm-ioctl.h", "DM_DEV_RENAME", _IOC_READ|_IOC_WRITE, 0xfd05, 0x138 },
+{ "linux/dm-ioctl.h", "DM_DEV_SET_GEOMETRY", _IOC_READ|_IOC_WRITE, 0xfd0f, 0x138 },
+{ "linux/dm-ioctl.h", "DM_DEV_STATUS", _IOC_READ|_IOC_WRITE, 0xfd07, 0x138 },
+{ "linux/dm-ioctl.h", "DM_DEV_SUSPEND", _IOC_READ|_IOC_WRITE, 0xfd06, 0x138 },
+{ "linux/dm-ioctl.h", "DM_DEV_WAIT", _IOC_READ|_IOC_WRITE, 0xfd08, 0x138 },
+{ "linux/dm-ioctl.h", "DM_GET_TARGET_VERSION", _IOC_READ|_IOC_WRITE, 0xfd11, 0x138 },
+{ "linux/dm-ioctl.h", "DM_LIST_DEVICES", _IOC_READ|_IOC_WRITE, 0xfd02, 0x138 },
+{ "linux/dm-ioctl.h", "DM_LIST_VERSIONS", _IOC_READ|_IOC_WRITE, 0xfd0d, 0x138 },
+{ "linux/dm-ioctl.h", "DM_REMOVE_ALL", _IOC_READ|_IOC_WRITE, 0xfd01, 0x138 },
+{ "linux/dm-ioctl.h", "DM_TABLE_CLEAR", _IOC_READ|_IOC_WRITE, 0xfd0a, 0x138 },
+{ "linux/dm-ioctl.h", "DM_TABLE_DEPS", _IOC_READ|_IOC_WRITE, 0xfd0b, 0x138 },
+{ "linux/dm-ioctl.h", "DM_TABLE_LOAD", _IOC_READ|_IOC_WRITE, 0xfd09, 0x138 },
+{ "linux/dm-ioctl.h", "DM_TABLE_STATUS", _IOC_READ|_IOC_WRITE, 0xfd0c, 0x138 },
+{ "linux/dm-ioctl.h", "DM_TARGET_MSG", _IOC_READ|_IOC_WRITE, 0xfd0e, 0x138 },
+{ "linux/dm-ioctl.h", "DM_VERSION", _IOC_READ|_IOC_WRITE, 0xfd00, 0x138 },
+{ "linux/dma-buf.h", "DMA_BUF_IOCTL_SYNC", _IOC_WRITE, 0x6200, 0x08 },
+{ "linux/dma-buf.h", "DMA_BUF_SET_NAME_A", _IOC_WRITE, 0x6201, 0x04 },
+{ "linux/dma-buf.h", "DMA_BUF_SET_NAME_B", _IOC_WRITE, 0x6201, 0x08 },
+{ "linux/dma-heap.h", "DMA_HEAP_IOCTL_ALLOC", _IOC_READ|_IOC_WRITE, 0x4800, 0x18 },
+{ "linux/dn.h", "OSIOCGNETADDR", _IOC_READ, 0x89e1, 0x04 },
+{ "linux/dn.h", "OSIOCSNETADDR", _IOC_WRITE, 0x89e0, 0x04 },
+{ "linux/dvb/audio.h", "AUDIO_BILINGUAL_CHANNEL_SELECT", _IOC_NONE, 0x6f14, 0x00 },
+{ "linux/dvb/audio.h", "AUDIO_CHANNEL_SELECT", _IOC_NONE, 0x6f09, 0x00 },
+{ "linux/dvb/audio.h", "AUDIO_CLEAR_BUFFER", _IOC_NONE, 0x6f0c, 0x00 },
+{ "linux/dvb/audio.h", "AUDIO_CONTINUE", _IOC_NONE, 0x6f04, 0x00 },
+{ "linux/dvb/audio.h", "AUDIO_GET_CAPABILITIES", _IOC_READ, 0x6f0b, 0x04 },
+{ "linux/dvb/audio.h", "AUDIO_GET_STATUS", _IOC_READ, 0x6f0a, 0x20 },
+{ "linux/dvb/audio.h", "AUDIO_PAUSE", _IOC_NONE, 0x6f03, 0x00 },
+{ "linux/dvb/audio.h", "AUDIO_PLAY", _IOC_NONE, 0x6f02, 0x00 },
+{ "linux/dvb/audio.h", "AUDIO_SELECT_SOURCE", _IOC_NONE, 0x6f05, 0x00 },
+{ "linux/dvb/audio.h", "AUDIO_SET_AV_SYNC", _IOC_NONE, 0x6f07, 0x00 },
+{ "linux/dvb/audio.h", "AUDIO_SET_BYPASS_MODE", _IOC_NONE, 0x6f08, 0x00 },
+{ "linux/dvb/audio.h", "AUDIO_SET_ID", _IOC_NONE, 0x6f0d, 0x00 },
+{ "linux/dvb/audio.h", "AUDIO_SET_MIXER", _IOC_WRITE, 0x6f0e, 0x08 },
+{ "linux/dvb/audio.h", "AUDIO_SET_MUTE", _IOC_NONE, 0x6f06, 0x00 },
+{ "linux/dvb/audio.h", "AUDIO_SET_STREAMTYPE", _IOC_NONE, 0x6f0f, 0x00 },
+{ "linux/dvb/audio.h", "AUDIO_STOP", _IOC_NONE, 0x6f01, 0x00 },
+{ "linux/dvb/ca.h", "CA_GET_CAP", _IOC_READ, 0x6f81, 0x10 },
+{ "linux/dvb/ca.h", "CA_GET_DESCR_INFO", _IOC_READ, 0x6f83, 0x08 },
+{ "linux/dvb/ca.h", "CA_GET_MSG", _IOC_READ, 0x6f84, 0x10c },
+{ "linux/dvb/ca.h", "CA_GET_SLOT_INFO", _IOC_READ, 0x6f82, 0x0c },
+{ "linux/dvb/ca.h", "CA_RESET", _IOC_NONE, 0x6f80, 0x00 },
+{ "linux/dvb/ca.h", "CA_SEND_MSG", _IOC_WRITE, 0x6f85, 0x10c },
+{ "linux/dvb/ca.h", "CA_SET_DESCR", _IOC_WRITE, 0x6f86, 0x10 },
+{ "linux/dvb/dmx.h", "DMX_ADD_PID", _IOC_WRITE, 0x6f33, 0x02 },
+{ "linux/dvb/dmx.h", "DMX_DQBUF", _IOC_READ|_IOC_WRITE, 0x6f40, 0x18 },
+{ "linux/dvb/dmx.h", "DMX_EXPBUF", _IOC_READ|_IOC_WRITE, 0x6f3e, 0x0c },
+{ "linux/dvb/dmx.h", "DMX_GET_PES_PIDS", _IOC_READ, 0x6f2f, 0x0a },
+{ "linux/dvb/dmx.h", "DMX_GET_STC", _IOC_READ|_IOC_WRITE, 0x6f32, 0x10 },
+{ "linux/dvb/dmx.h", "DMX_QBUF", _IOC_READ|_IOC_WRITE, 0x6f3f, 0x18 },
+{ "linux/dvb/dmx.h", "DMX_QUERYBUF", _IOC_READ|_IOC_WRITE, 0x6f3d, 0x18 },
+{ "linux/dvb/dmx.h", "DMX_REMOVE_PID", _IOC_WRITE, 0x6f34, 0x02 },
+{ "linux/dvb/dmx.h", "DMX_REQBUFS", _IOC_READ|_IOC_WRITE, 0x6f3c, 0x08 },
+{ "linux/dvb/dmx.h", "DMX_SET_BUFFER_SIZE", _IOC_NONE, 0x6f2d, 0x00 },
+{ "linux/dvb/dmx.h", "DMX_SET_FILTER", _IOC_WRITE, 0x6f2b, 0x3c },
+{ "linux/dvb/dmx.h", "DMX_SET_PES_FILTER", _IOC_WRITE, 0x6f2c, 0x14 },
+{ "linux/dvb/dmx.h", "DMX_START", _IOC_NONE, 0x6f29, 0x00 },
+{ "linux/dvb/dmx.h", "DMX_STOP", _IOC_NONE, 0x6f2a, 0x00 },
+{ "linux/dvb/frontend.h", "FE_DISEQC_RECV_SLAVE_REPLY", _IOC_READ, 0x6f40, 0x0c },
+{ "linux/dvb/frontend.h", "FE_DISEQC_RESET_OVERLOAD", _IOC_NONE, 0x6f3e, 0x00 },
+{ "linux/dvb/frontend.h", "FE_DISEQC_SEND_BURST", _IOC_NONE, 0x6f41, 0x00 },
+{ "linux/dvb/frontend.h", "FE_DISEQC_SEND_MASTER_CMD", _IOC_WRITE, 0x6f3f, 0x07 },
+{ "linux/dvb/frontend.h", "FE_DISHNETWORK_SEND_LEGACY_CMD", _IOC_NONE, 0x6f50, 0x00 },
+{ "linux/dvb/frontend.h", "FE_ENABLE_HIGH_LNB_VOLTAGE", _IOC_NONE, 0x6f44, 0x00 },
+{ "linux/dvb/frontend.h", "FE_GET_EVENT", _IOC_READ, 0x6f4e, 0x28 },
+{ "linux/dvb/frontend.h", "FE_GET_FRONTEND", _IOC_READ, 0x6f4d, 0x24 },
+{ "linux/dvb/frontend.h", "FE_GET_INFO", _IOC_READ, 0x6f3d, 0xa8 },
+{ "linux/dvb/frontend.h", "FE_GET_PROPERTY", _IOC_READ, 0x6f53, 0x08 },
+{ "linux/dvb/frontend.h", "FE_READ_BER", _IOC_READ, 0x6f46, 0x04 },
+{ "linux/dvb/frontend.h", "FE_READ_SIGNAL_STRENGTH", _IOC_READ, 0x6f47, 0x02 },
+{ "linux/dvb/frontend.h", "FE_READ_SNR", _IOC_READ, 0x6f48, 0x02 },
+{ "linux/dvb/frontend.h", "FE_READ_STATUS", _IOC_READ, 0x6f45, 0x04 },
+{ "linux/dvb/frontend.h", "FE_READ_UNCORRECTED_BLOCKS", _IOC_READ, 0x6f49, 0x04 },
+{ "linux/dvb/frontend.h", "FE_SET_FRONTEND", _IOC_WRITE, 0x6f4c, 0x24 },
+{ "linux/dvb/frontend.h", "FE_SET_FRONTEND_TUNE_MODE", _IOC_NONE, 0x6f51, 0x00 },
+{ "linux/dvb/frontend.h", "FE_SET_PROPERTY", _IOC_WRITE, 0x6f52, 0x08 },
+{ "linux/dvb/frontend.h", "FE_SET_TONE", _IOC_NONE, 0x6f42, 0x00 },
+{ "linux/dvb/frontend.h", "FE_SET_VOLTAGE", _IOC_NONE, 0x6f43, 0x00 },
+{ "linux/dvb/net.h", "NET_ADD_IF", _IOC_READ|_IOC_WRITE, 0x6f34, 0x06 },
+{ "linux/dvb/net.h", "NET_GET_IF", _IOC_READ|_IOC_WRITE, 0x6f36, 0x06 },
+{ "linux/dvb/net.h", "NET_REMOVE_IF", _IOC_NONE, 0x6f35, 0x00 },
+{ "linux/dvb/osd.h", "OSD_GET_CAPABILITY", _IOC_READ, 0x6fa1, 0x08 },
+{ "linux/dvb/osd.h", "OSD_SEND_CMD", _IOC_WRITE, 0x6fa0, 0x1c },
+{ "linux/dvb/video.h", "VIDEO_CLEAR_BUFFER", _IOC_NONE, 0x6f22, 0x00 },
+{ "linux/dvb/video.h", "VIDEO_COMMAND", _IOC_READ|_IOC_WRITE, 0x6f3b, 0x48 },
+{ "linux/dvb/video.h", "VIDEO_CONTINUE", _IOC_NONE, 0x6f18, 0x00 },
+{ "linux/dvb/video.h", "VIDEO_FAST_FORWARD", _IOC_NONE, 0x6f1f, 0x00 },
+{ "linux/dvb/video.h", "VIDEO_FREEZE", _IOC_NONE, 0x6f17, 0x00 },
+{ "linux/dvb/video.h", "VIDEO_GET_CAPABILITIES", _IOC_READ, 0x6f21, 0x04 },
+{ "linux/dvb/video.h", "VIDEO_GET_EVENT", _IOC_READ, 0x6f1c, 0x14 },
+{ "linux/dvb/video.h", "VIDEO_GET_FRAME_COUNT", _IOC_READ, 0x6f3a, 0x08 },
+{ "linux/dvb/video.h", "VIDEO_GET_PTS", _IOC_READ, 0x6f39, 0x08 },
+{ "linux/dvb/video.h", "VIDEO_GET_SIZE", _IOC_READ, 0x6f37, 0x0c },
+{ "linux/dvb/video.h", "VIDEO_GET_STATUS", _IOC_READ, 0x6f1b, 0x14 },
+{ "linux/dvb/video.h", "VIDEO_PLAY", _IOC_NONE, 0x6f16, 0x00 },
+{ "linux/dvb/video.h", "VIDEO_SELECT_SOURCE", _IOC_NONE, 0x6f19, 0x00 },
+{ "linux/dvb/video.h", "VIDEO_SET_BLANK", _IOC_NONE, 0x6f1a, 0x00 },
+{ "linux/dvb/video.h", "VIDEO_SET_DISPLAY_FORMAT", _IOC_NONE, 0x6f1d, 0x00 },
+{ "linux/dvb/video.h", "VIDEO_SET_FORMAT", _IOC_NONE, 0x6f25, 0x00 },
+{ "linux/dvb/video.h", "VIDEO_SET_STREAMTYPE", _IOC_NONE, 0x6f24, 0x00 },
+{ "linux/dvb/video.h", "VIDEO_SLOWMOTION", _IOC_NONE, 0x6f20, 0x00 },
+{ "linux/dvb/video.h", "VIDEO_STILLPICTURE", _IOC_WRITE, 0x6f1e, 0x08 },
+{ "linux/dvb/video.h", "VIDEO_STOP", _IOC_NONE, 0x6f15, 0x00 },
+{ "linux/dvb/video.h", "VIDEO_TRY_COMMAND", _IOC_READ|_IOC_WRITE, 0x6f3c, 0x48 },
+{ "linux/fb.h", "FBIOBLANK", 0, 0x4611, 0 },
+{ "linux/fb.h", "FBIOGETCMAP", 0, 0x4604, 0 },
+{ "linux/fb.h", "FBIOGET_CON2FBMAP", 0, 0x460F, 0 },
+{ "linux/fb.h", "FBIOGET_DISPINFO", 0, 0x4618, 0 },
+{ "linux/fb.h", "FBIOGET_FSCREENINFO", 0, 0x4602, 0 },
+{ "linux/fb.h", "FBIOGET_GLYPH", 0, 0x4615, 0 },
+{ "linux/fb.h", "FBIOGET_HWCINFO", 0, 0x4616, 0 },
+{ "linux/fb.h", "FBIOGET_VBLANK", _IOC_READ, 0x4612, 0x20 },
+{ "linux/fb.h", "FBIOGET_VSCREENINFO", 0, 0x4600, 0 },
+{ "linux/fb.h", "FBIOPAN_DISPLAY", 0, 0x4606, 0 },
+{ "linux/fb.h", "FBIOPUTCMAP", 0, 0x4605, 0 },
+{ "linux/fb.h", "FBIOPUT_CON2FBMAP", 0, 0x4610, 0 },
+{ "linux/fb.h", "FBIOPUT_MODEINFO", 0, 0x4617, 0 },
+{ "linux/fb.h", "FBIOPUT_VSCREENINFO", 0, 0x4601, 0 },
+{ "linux/fb.h", "FBIO_ALLOC", 0, 0x4613, 0 },
+{ "linux/fb.h", "FBIO_CURSOR", _IOC_READ|_IOC_WRITE, 0x4608, 0x48 },
+{ "linux/fb.h", "FBIO_FREE", 0, 0x4614, 0 },
+{ "linux/fb.h", "FBIO_WAITFORVSYNC", _IOC_WRITE, 0x4620, 0x04 },
+{ "linux/fd.h", "FDCLRPRM", _IOC_NONE, 0x0241, 0x00 },
+{ "linux/fd.h", "FDDEFPRM", _IOC_WRITE, 0x0243, 0x1c },
+{ "linux/fd.h", "FDEJECT", _IOC_NONE, 0x025a, 0x00 },
+{ "linux/fd.h", "FDFLUSH", _IOC_NONE, 0x024b, 0x00 },
+{ "linux/fd.h", "FDFMTBEG", _IOC_NONE, 0x0247, 0x00 },
+{ "linux/fd.h", "FDFMTEND", _IOC_NONE, 0x0249, 0x00 },
+{ "linux/fd.h", "FDFMTTRK", _IOC_WRITE, 0x0248, 0x0c },
+{ "linux/fd.h", "FDGETDRVPRM", _IOC_READ, 0x0211, 0x58 },
+{ "linux/fd.h", "FDGETDRVSTAT", _IOC_READ, 0x0212, 0x34 },
+{ "linux/fd.h", "FDGETDRVTYP", _IOC_READ, 0x020f, 0x10 },
+{ "linux/fd.h", "FDGETFDCSTAT", _IOC_READ, 0x0215, 0x20 },
+{ "linux/fd.h", "FDGETMAXERRS", _IOC_READ, 0x020e, 0x14 },
+{ "linux/fd.h", "FDGETPRM", _IOC_READ, 0x0204, 0x1c },
+{ "linux/fd.h", "FDMSGOFF", _IOC_NONE, 0x0246, 0x00 },
+{ "linux/fd.h", "FDMSGON", _IOC_NONE, 0x0245, 0x00 },
+{ "linux/fd.h", "FDPOLLDRVSTAT", _IOC_READ, 0x0213, 0x34 },
+{ "linux/fd.h", "FDRAWCMD", _IOC_NONE, 0x0258, 0x00 },
+{ "linux/fd.h", "FDRESET", _IOC_NONE, 0x0254, 0x00 },
+{ "linux/fd.h", "FDSETDRVPRM", _IOC_WRITE, 0x0290, 0x58 },
+{ "linux/fd.h", "FDSETEMSGTRESH", _IOC_NONE, 0x024a, 0x00 },
+{ "linux/fd.h", "FDSETMAXERRS", _IOC_WRITE, 0x024c, 0x14 },
+{ "linux/fd.h", "FDSETPRM", _IOC_WRITE, 0x0242, 0x1c },
+{ "linux/fd.h", "FDTWADDLE", _IOC_NONE, 0x0259, 0x00 },
+{ "linux/fd.h", "FDWERRORCLR", _IOC_NONE, 0x0256, 0x00 },
+{ "linux/fd.h", "FDWERRORGET", _IOC_READ, 0x0217, 0x18 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_ADD_DESCRIPTOR", _IOC_READ|_IOC_WRITE, 0x2306, 0x18 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_ALLOCATE", _IOC_READ|_IOC_WRITE, 0x2302, 0x20 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_ALLOCATE_ISO_RESOURCE", _IOC_READ|_IOC_WRITE, 0x230d, 0x18 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_ALLOCATE_ISO_RESOURCE_ONCE", _IOC_WRITE, 0x230f, 0x18 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_CREATE_ISO_CONTEXT", _IOC_READ|_IOC_WRITE, 0x2308, 0x1c },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_DEALLOCATE", _IOC_WRITE, 0x2303, 0x04 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_DEALLOCATE_ISO_RESOURCE", _IOC_WRITE, 0x230e, 0x04 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_DEALLOCATE_ISO_RESOURCE_ONCE", _IOC_WRITE, 0x2310, 0x18 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_FLUSH_ISO", _IOC_WRITE, 0x2318, 0x04 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_GET_CYCLE_TIMER", _IOC_READ, 0x230c, 0x0c },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_GET_CYCLE_TIMER2", _IOC_READ|_IOC_WRITE, 0x2314, 0x14 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_GET_INFO", _IOC_READ|_IOC_WRITE, 0x2300, 0x24 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_GET_SPEED", _IOC_NONE, 0x2311, 0x00 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_INITIATE_BUS_RESET", _IOC_WRITE, 0x2305, 0x04 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_QUEUE_ISO", _IOC_READ|_IOC_WRITE, 0x2309, 0x18 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_RECEIVE_PHY_PACKETS", _IOC_WRITE, 0x2316, 0x08 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_REMOVE_DESCRIPTOR", _IOC_WRITE, 0x2307, 0x04 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_SEND_BROADCAST_REQUEST", _IOC_WRITE, 0x2312, 0x24 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_SEND_PHY_PACKET", _IOC_READ|_IOC_WRITE, 0x2315, 0x14 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_SEND_REQUEST", _IOC_WRITE, 0x2301, 0x24 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_SEND_RESPONSE", _IOC_WRITE, 0x2304, 0x14 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_SEND_STREAM_PACKET", _IOC_WRITE, 0x2313, 0x28 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_SET_ISO_CHANNELS", _IOC_WRITE, 0x2317, 0x0c },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_START_ISO", _IOC_WRITE, 0x230a, 0x10 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_STOP_ISO", _IOC_WRITE, 0x230b, 0x04 },
+{ "linux/fpga-dfl.h", "DFL_FPGA_CHECK_EXTENSION", _IOC_NONE, 0xb601, 0x00 },
+{ "linux/fpga-dfl.h", "DFL_FPGA_FME_ERR_GET_IRQ_NUM", _IOC_READ, 0xb683, 0x04 },
+{ "linux/fpga-dfl.h", "DFL_FPGA_FME_ERR_SET_IRQ", _IOC_WRITE, 0xb684, 0x08 },
+{ "linux/fpga-dfl.h", "DFL_FPGA_FME_PORT_ASSIGN", _IOC_WRITE, 0xb682, 0x04 },
+{ "linux/fpga-dfl.h", "DFL_FPGA_FME_PORT_PR", _IOC_NONE, 0xb680, 0x00 },
+{ "linux/fpga-dfl.h", "DFL_FPGA_FME_PORT_RELEASE", _IOC_WRITE, 0xb681, 0x04 },
+{ "linux/fpga-dfl.h", "DFL_FPGA_GET_API_VERSION", _IOC_NONE, 0xb600, 0x00 },
+{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_DMA_MAP", _IOC_NONE, 0xb643, 0x00 },
+{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_DMA_UNMAP", _IOC_NONE, 0xb644, 0x00 },
+{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_ERR_GET_IRQ_NUM", _IOC_READ, 0xb645, 0x04 },
+{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_ERR_SET_IRQ", _IOC_WRITE, 0xb646, 0x08 },
+{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_GET_INFO", _IOC_NONE, 0xb641, 0x00 },
+{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_GET_REGION_INFO", _IOC_NONE, 0xb642, 0x00 },
+{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_RESET", _IOC_NONE, 0xb640, 0x00 },
+{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_UINT_GET_IRQ_NUM", _IOC_READ, 0xb647, 0x04 },
+{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_UINT_SET_IRQ", _IOC_WRITE, 0xb648, 0x08 },
+{ "linux/fs.h", "BLKALIGNOFF", _IOC_NONE, 0x127a, 0x00 },
+{ "linux/fs.h", "BLKBSZGET", _IOC_READ, 0x1270, 0x04 },
+{ "linux/fs.h", "BLKBSZSET", _IOC_WRITE, 0x1271, 0x04 },
+{ "linux/fs.h", "BLKDISCARD", _IOC_NONE, 0x1277, 0x00 },
+{ "linux/fs.h", "BLKDISCARDZEROES", _IOC_NONE, 0x127c, 0x00 },
+{ "linux/fs.h", "BLKFLSBUF", _IOC_NONE, 0x1261, 0x00 },
+{ "linux/fs.h", "BLKFRAGET", _IOC_NONE, 0x1265, 0x00 },
+{ "linux/fs.h", "BLKFRASET", _IOC_NONE, 0x1264, 0x00 },
+{ "linux/fs.h", "BLKGETSIZE", _IOC_NONE, 0x1260, 0x00 },
+{ "linux/fs.h", "BLKGETSIZE64", _IOC_READ, 0x1272, 0x04 },
+{ "linux/fs.h", "BLKIOMIN", _IOC_NONE, 0x1278, 0x00 },
+{ "linux/fs.h", "BLKIOOPT", _IOC_NONE, 0x1279, 0x00 },
+{ "linux/fs.h", "BLKPBSZGET", _IOC_NONE, 0x127b, 0x00 },
+{ "linux/fs.h", "BLKRAGET", _IOC_NONE, 0x1263, 0x00 },
+{ "linux/fs.h", "BLKRASET", _IOC_NONE, 0x1262, 0x00 },
+{ "linux/fs.h", "BLKROGET", _IOC_NONE, 0x125e, 0x00 },
+{ "linux/fs.h", "BLKROSET", _IOC_NONE, 0x125d, 0x00 },
+{ "linux/fs.h", "BLKROTATIONAL", _IOC_NONE, 0x127e, 0x00 },
+{ "linux/fs.h", "BLKRRPART", _IOC_NONE, 0x125f, 0x00 },
+{ "linux/fs.h", "BLKSECDISCARD", _IOC_NONE, 0x127d, 0x00 },
+{ "linux/fs.h", "BLKSECTGET", _IOC_NONE, 0x1267, 0x00 },
+{ "linux/fs.h", "BLKSECTSET", _IOC_NONE, 0x1266, 0x00 },
+{ "linux/fs.h", "BLKSSZGET", _IOC_NONE, 0x1268, 0x00 },
+{ "linux/fs.h", "BLKTRACESETUP", _IOC_READ|_IOC_WRITE, 0x1273, 0x40 },
+{ "linux/fs.h", "BLKTRACESTART", _IOC_NONE, 0x1274, 0x00 },
+{ "linux/fs.h", "BLKTRACESTOP", _IOC_NONE, 0x1275, 0x00 },
+{ "linux/fs.h", "BLKTRACETEARDOWN", _IOC_NONE, 0x1276, 0x00 },
+{ "linux/fs.h", "BLKZEROOUT", _IOC_NONE, 0x127f, 0x00 },
+{ "linux/fs.h", "FIBMAP", _IOC_NONE, 0x0001, 0x00 },
+{ "linux/fs.h", "FICLONE", _IOC_WRITE, 0x9409, 0x04 },
+{ "linux/fs.h", "FICLONERANGE", _IOC_WRITE, 0x940d, 0x20 },
+{ "linux/fs.h", "FIDEDUPERANGE", _IOC_READ|_IOC_WRITE, 0x9436, 0x18 },
+{ "linux/fs.h", "FIFREEZE", _IOC_READ|_IOC_WRITE, 0x5877, 0x04 },
+{ "linux/fs.h", "FIGETBSZ", _IOC_NONE, 0x0002, 0x00 },
+{ "linux/fs.h", "FITHAW", _IOC_READ|_IOC_WRITE, 0x5878, 0x04 },
+{ "linux/fs.h", "FITRIM", _IOC_READ|_IOC_WRITE, 0x5879, 0x18 },
+{ "linux/fs.h", "FS_IOC32_GETFLAGS", _IOC_READ, 0x6601, 0x04 },
+{ "linux/fs.h", "FS_IOC32_GETVERSION", _IOC_READ, 0x7601, 0x04 },
+{ "linux/fs.h", "FS_IOC32_SETFLAGS", _IOC_WRITE, 0x6602, 0x04 },
+{ "linux/fs.h", "FS_IOC32_SETVERSION", _IOC_WRITE, 0x7602, 0x04 },
+{ "linux/fs.h", "FS_IOC_FIEMAP", _IOC_READ|_IOC_WRITE, 0x660b, 0x20 },
+{ "linux/fs.h", "FS_IOC_FSGETXATTR", _IOC_READ, 0x581f, 0x1c },
+{ "linux/fs.h", "FS_IOC_FSSETXATTR", _IOC_WRITE, 0x5820, 0x1c },
+{ "linux/fs.h", "FS_IOC_GETFSLABEL", _IOC_READ, 0x9431, 0x100 },
+{ "linux/fs.h", "FS_IOC_SETFSLABEL", _IOC_WRITE, 0x9432, 0x100 },
+{ "linux/fscrypt.h", "FS_IOC_ADD_ENCRYPTION_KEY", _IOC_READ|_IOC_WRITE, 0x6617, 0x50 },
+{ "linux/fscrypt.h", "FS_IOC_GET_ENCRYPTION_KEY_STATUS", _IOC_READ|_IOC_WRITE, 0x661a, 0x80 },
+{ "linux/fscrypt.h", "FS_IOC_GET_ENCRYPTION_NONCE", _IOC_READ, 0x661b, 0x10 },
+{ "linux/fscrypt.h", "FS_IOC_GET_ENCRYPTION_POLICY", _IOC_WRITE, 0x6615, 0x0c },
+{ "linux/fscrypt.h", "FS_IOC_GET_ENCRYPTION_POLICY_EX", _IOC_READ|_IOC_WRITE, 0x6616, 0x09 },
+{ "linux/fscrypt.h", "FS_IOC_GET_ENCRYPTION_PWSALT", _IOC_WRITE, 0x6614, 0x10 },
+{ "linux/fscrypt.h", "FS_IOC_REMOVE_ENCRYPTION_KEY", _IOC_READ|_IOC_WRITE, 0x6618, 0x40 },
+{ "linux/fscrypt.h", "FS_IOC_REMOVE_ENCRYPTION_KEY_ALL_USERS", _IOC_READ|_IOC_WRITE, 0x6619, 0x40 },
+{ "linux/fscrypt.h", "FS_IOC_SET_ENCRYPTION_POLICY", _IOC_READ, 0x6613, 0x0c },
+{ "linux/fsi.h", "FSI_SCOM_CHECK", _IOC_READ, 0x7300, 0x04 },
+{ "linux/fsi.h", "FSI_SCOM_READ", _IOC_READ|_IOC_WRITE, 0x7301, 0x20 },
+{ "linux/fsi.h", "FSI_SCOM_RESET", _IOC_WRITE, 0x7303, 0x04 },
+{ "linux/fsi.h", "FSI_SCOM_WRITE", _IOC_READ|_IOC_WRITE, 0x7302, 0x20 },
+{ "linux/fsl-diu-fb.h", "MFB_GET_ALPHA", _IOC_READ, 0x4d00, 0x01 },
+{ "linux/fsl-diu-fb.h", "MFB_GET_AOID", _IOC_READ, 0x4d04, 0x08 },
+{ "linux/fsl-diu-fb.h", "MFB_GET_GAMMA", _IOC_READ, 0x4d01, 0x01 },
+{ "linux/fsl-diu-fb.h", "MFB_GET_PIXFMT", _IOC_READ, 0x4d08, 0x04 },
+{ "linux/fsl-diu-fb.h", "MFB_SET_ALPHA", _IOC_WRITE, 0x4d00, 0x01 },
+{ "linux/fsl-diu-fb.h", "MFB_SET_AOID", _IOC_WRITE, 0x4d04, 0x08 },
+{ "linux/fsl-diu-fb.h", "MFB_SET_BRIGHTNESS", _IOC_WRITE, 0x4d03, 0x01 },
+{ "linux/fsl-diu-fb.h", "MFB_SET_CHROMA_KEY", _IOC_WRITE, 0x4d01, 0x0c },
+{ "linux/fsl-diu-fb.h", "MFB_SET_GAMMA", _IOC_WRITE, 0x4d01, 0x01 },
+{ "linux/fsl-diu-fb.h", "MFB_SET_PIXFMT", _IOC_WRITE, 0x4d08, 0x04 },
+{ "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_DOORBELL", _IOC_READ|_IOC_WRITE, 0xaf06, 0x08 },
+{ "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_GETPROP", _IOC_READ|_IOC_WRITE, 0xaf07, 0x28 },
+{ "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_MEMCPY", _IOC_READ|_IOC_WRITE, 0xaf05, 0x28 },
+{ "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_PARTITION_GET_STATUS", _IOC_READ|_IOC_WRITE, 0xaf02, 0x0c },
+{ "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_PARTITION_RESTART", _IOC_READ|_IOC_WRITE, 0xaf01, 0x08 },
+{ "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_PARTITION_START", _IOC_READ|_IOC_WRITE, 0xaf03, 0x10 },
+{ "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_PARTITION_STOP", _IOC_READ|_IOC_WRITE, 0xaf04, 0x08 },
+{ "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_SETPROP", _IOC_READ|_IOC_WRITE, 0xaf08, 0x28 },
+{ "linux/fsmap.h", "FS_IOC_GETFSMAP", _IOC_READ|_IOC_WRITE, 0x583b, 0xc0 },
+{ "linux/fsverity.h", "FS_IOC_ENABLE_VERITY", _IOC_WRITE, 0x6685, 0x80 },
+{ "linux/fsverity.h", "FS_IOC_MEASURE_VERITY", _IOC_READ|_IOC_WRITE, 0x6686, 0x04 },
+{ "linux/fuse.h", "FUSE_DEV_IOC_CLONE", _IOC_READ, 0xe500, 0x04 },
+{ "linux/genwqe/genwqe_card.h", "GENWQE_EXECUTE_DDCB", _IOC_READ|_IOC_WRITE, 0xa532, 0xe8 },
+{ "linux/genwqe/genwqe_card.h", "GENWQE_EXECUTE_RAW_DDCB", _IOC_READ|_IOC_WRITE, 0xa533, 0xe8 },
+{ "linux/genwqe/genwqe_card.h", "GENWQE_GET_CARD_STATE", _IOC_READ, 0xa524, 0x04 },
+{ "linux/genwqe/genwqe_card.h", "GENWQE_PIN_MEM", _IOC_READ|_IOC_WRITE, 0xa528, 0x20 },
+{ "linux/genwqe/genwqe_card.h", "GENWQE_READ_REG16", _IOC_READ, 0xa522, 0x10 },
+{ "linux/genwqe/genwqe_card.h", "GENWQE_READ_REG32", _IOC_READ, 0xa520, 0x10 },
+{ "linux/genwqe/genwqe_card.h", "GENWQE_READ_REG64", _IOC_READ, 0xa51e, 0x10 },
+{ "linux/genwqe/genwqe_card.h", "GENWQE_SLU_READ", _IOC_READ|_IOC_WRITE, 0xa551, 0x38 },
+{ "linux/genwqe/genwqe_card.h", "GENWQE_SLU_UPDATE", _IOC_READ|_IOC_WRITE, 0xa550, 0x38 },
+{ "linux/genwqe/genwqe_card.h", "GENWQE_UNPIN_MEM", _IOC_READ|_IOC_WRITE, 0xa529, 0x20 },
+{ "linux/genwqe/genwqe_card.h", "GENWQE_WRITE_REG16", _IOC_WRITE, 0xa523, 0x10 },
+{ "linux/genwqe/genwqe_card.h", "GENWQE_WRITE_REG32", _IOC_WRITE, 0xa521, 0x10 },
+{ "linux/genwqe/genwqe_card.h", "GENWQE_WRITE_REG64", _IOC_WRITE, 0xa51f, 0x10 },
+{ "linux/gpio.h", "GPIOHANDLE_GET_LINE_VALUES_IOCTL", _IOC_READ|_IOC_WRITE, 0xb408, 0x40 },
+{ "linux/gpio.h", "GPIOHANDLE_SET_CONFIG_IOCTL", _IOC_READ|_IOC_WRITE, 0xb40a, 0x54 },
+{ "linux/gpio.h", "GPIOHANDLE_SET_LINE_VALUES_IOCTL", _IOC_READ|_IOC_WRITE, 0xb409, 0x40 },
+{ "linux/gpio.h", "GPIO_GET_CHIPINFO_IOCTL", _IOC_READ, 0xb401, 0x44 },
+{ "linux/gpio.h", "GPIO_GET_LINEEVENT_IOCTL", _IOC_READ|_IOC_WRITE, 0xb404, 0x30 },
+{ "linux/gpio.h", "GPIO_GET_LINEHANDLE_IOCTL", _IOC_READ|_IOC_WRITE, 0xb403, 0x16c },
+{ "linux/gpio.h", "GPIO_GET_LINEINFO_IOCTL", _IOC_READ|_IOC_WRITE, 0xb402, 0x48 },
+{ "linux/gpio.h", "GPIO_GET_LINEINFO_UNWATCH_IOCTL", _IOC_READ|_IOC_WRITE, 0xb40c, 0x04 },
+{ "linux/gpio.h", "GPIO_GET_LINEINFO_WATCH_IOCTL", _IOC_READ|_IOC_WRITE, 0xb40b, 0x48 },
+{ "linux/gpio.h", "GPIO_V2_GET_LINEINFO_IOCTL", _IOC_READ|_IOC_WRITE, 0xb405, 0x100 },
+{ "linux/gpio.h", "GPIO_V2_GET_LINEINFO_WATCH_IOCTL", _IOC_READ|_IOC_WRITE, 0xb406, 0x100 },
+{ "linux/gpio.h", "GPIO_V2_GET_LINE_IOCTL", _IOC_READ|_IOC_WRITE, 0xb407, 0x250 },
+{ "linux/gpio.h", "GPIO_V2_LINE_GET_VALUES_IOCTL", _IOC_READ|_IOC_WRITE, 0xb40e, 0x10 },
+{ "linux/gpio.h", "GPIO_V2_LINE_SET_CONFIG_IOCTL", _IOC_READ|_IOC_WRITE, 0xb40d, 0x110 },
+{ "linux/gpio.h", "GPIO_V2_LINE_SET_VALUES_IOCTL", _IOC_READ|_IOC_WRITE, 0xb40f, 0x10 },
+{ "linux/gsmmux.h", "GSMIOC_DISABLE_NET", _IOC_NONE, 0x4703, 0x00 },
+{ "linux/gsmmux.h", "GSMIOC_ENABLE_NET", _IOC_WRITE, 0x4702, 0x34 },
+{ "linux/gsmmux.h", "GSMIOC_GETCONF", _IOC_READ, 0x4700, 0x4c },
+{ "linux/gsmmux.h", "GSMIOC_GETFIRST", _IOC_READ, 0x4704, 0x04 },
+{ "linux/gsmmux.h", "GSMIOC_SETCONF", _IOC_WRITE, 0x4701, 0x4c },
+{ "linux/hdreg.h", "HDIO_DRIVE_CMD", 0, 0x031f, 0 },
+{ "linux/hdreg.h", "HDIO_DRIVE_RESET", 0, 0x031c, 0 },
+{ "linux/hdreg.h", "HDIO_DRIVE_TASK", 0, 0x031e, 0 },
+{ "linux/hdreg.h", "HDIO_DRIVE_TASKFILE", 0, 0x031d, 0 },
+{ "linux/hdreg.h", "HDIO_GETGEO", 0, 0x0301, 0 },
+{ "linux/hdreg.h", "HDIO_GET_32BIT", 0, 0x0309, 0 },
+{ "linux/hdreg.h", "HDIO_GET_ACOUSTIC", 0, 0x030f, 0 },
+{ "linux/hdreg.h", "HDIO_GET_ADDRESS", 0, 0x0310, 0 },
+{ "linux/hdreg.h", "HDIO_GET_BUSSTATE", 0, 0x031a, 0 },
+{ "linux/hdreg.h", "HDIO_GET_DMA", 0, 0x030b, 0 },
+{ "linux/hdreg.h", "HDIO_GET_IDENTITY", 0, 0x030d, 0 },
+{ "linux/hdreg.h", "HDIO_GET_KEEPSETTINGS", 0, 0x0308, 0 },
+{ "linux/hdreg.h", "HDIO_GET_MULTCOUNT", 0, 0x0304, 0 },
+{ "linux/hdreg.h", "HDIO_GET_NICE", 0, 0x030c, 0 },
+{ "linux/hdreg.h", "HDIO_GET_NOWERR", 0, 0x030a, 0 },
+{ "linux/hdreg.h", "HDIO_GET_QDMA", 0, 0x0305, 0 },
+{ "linux/hdreg.h", "HDIO_GET_UNMASKINTR", 0, 0x0302, 0 },
+{ "linux/hdreg.h", "HDIO_GET_WCACHE", 0, 0x030e, 0 },
+{ "linux/hdreg.h", "HDIO_OBSOLETE_IDENTITY", 0, 0x0307, 0 },
+{ "linux/hdreg.h", "HDIO_SCAN_HWIF", 0, 0x0328, 0 },
+{ "linux/hdreg.h", "HDIO_SET_32BIT", 0, 0x0324, 0 },
+{ "linux/hdreg.h", "HDIO_SET_ACOUSTIC", 0, 0x032c, 0 },
+{ "linux/hdreg.h", "HDIO_SET_ADDRESS", 0, 0x032f, 0 },
+{ "linux/hdreg.h", "HDIO_SET_BUSSTATE", 0, 0x032d, 0 },
+{ "linux/hdreg.h", "HDIO_SET_DMA", 0, 0x0326, 0 },
+{ "linux/hdreg.h", "HDIO_SET_KEEPSETTINGS", 0, 0x0323, 0 },
+{ "linux/hdreg.h", "HDIO_SET_MULTCOUNT", 0, 0x0321, 0 },
+{ "linux/hdreg.h", "HDIO_SET_NICE", 0, 0x0329, 0 },
+{ "linux/hdreg.h", "HDIO_SET_NOWERR", 0, 0x0325, 0 },
+{ "linux/hdreg.h", "HDIO_SET_PIO_MODE", 0, 0x0327, 0 },
+{ "linux/hdreg.h", "HDIO_SET_QDMA", 0, 0x032e, 0 },
+{ "linux/hdreg.h", "HDIO_SET_UNMASKINTR", 0, 0x0322, 0 },
+{ "linux/hdreg.h", "HDIO_SET_WCACHE", 0, 0x032b, 0 },
+{ "linux/hdreg.h", "HDIO_SET_XFER", 0, 0x0306, 0 },
+{ "linux/hdreg.h", "HDIO_TRISTATE_HWIF", 0, 0x031b, 0 },
+{ "linux/hdreg.h", "HDIO_UNREGISTER_HWIF", 0, 0x032a, 0 },
+{ "linux/hid-roccat.h", "ROCCATIOCGREPSIZE", _IOC_READ, 0x48f1, 0x04 },
+{ "linux/hiddev.h", "HIDIOCAPPLICATION", _IOC_NONE, 0x4802, 0x00 },
+{ "linux/hiddev.h", "HIDIOCGCOLLECTIONINDEX", _IOC_WRITE, 0x4810, 0x18 },
+{ "linux/hiddev.h", "HIDIOCGCOLLECTIONINFO", _IOC_READ|_IOC_WRITE, 0x4811, 0x10 },
+{ "linux/hiddev.h", "HIDIOCGDEVINFO", _IOC_READ, 0x4803, 0x1c },
+{ "linux/hiddev.h", "HIDIOCGFIELDINFO", _IOC_READ|_IOC_WRITE, 0x480a, 0x38 },
+{ "linux/hiddev.h", "HIDIOCGFLAG", _IOC_READ, 0x480e, 0x04 },
+{ "linux/hiddev.h", "HIDIOCGREPORT", _IOC_WRITE, 0x4807, 0x0c },
+{ "linux/hiddev.h", "HIDIOCGREPORTINFO", _IOC_READ|_IOC_WRITE, 0x4809, 0x0c },
+{ "linux/hiddev.h", "HIDIOCGSTRING", _IOC_READ, 0x4804, 0x104 },
+{ "linux/hiddev.h", "HIDIOCGUCODE", _IOC_READ|_IOC_WRITE, 0x480d, 0x18 },
+{ "linux/hiddev.h", "HIDIOCGUSAGE", _IOC_READ|_IOC_WRITE, 0x480b, 0x18 },
+{ "linux/hiddev.h", "HIDIOCGUSAGES", _IOC_READ|_IOC_WRITE, 0x4813, 0x101c },
+{ "linux/hiddev.h", "HIDIOCGVERSION", _IOC_READ, 0x4801, 0x04 },
+{ "linux/hiddev.h", "HIDIOCINITREPORT", _IOC_NONE, 0x4805, 0x00 },
+{ "linux/hiddev.h", "HIDIOCSFLAG", _IOC_WRITE, 0x480f, 0x04 },
+{ "linux/hiddev.h", "HIDIOCSREPORT", _IOC_WRITE, 0x4808, 0x0c },
+{ "linux/hiddev.h", "HIDIOCSUSAGE", _IOC_WRITE, 0x480c, 0x18 },
+{ "linux/hiddev.h", "HIDIOCSUSAGES", _IOC_WRITE, 0x4814, 0x101c },
+{ "linux/hidraw.h", "HIDIOCGRAWINFO", _IOC_READ, 0x4803, 0x08 },
+{ "linux/hidraw.h", "HIDIOCGRDESC", _IOC_READ, 0x4802, 0x1004 },
+{ "linux/hidraw.h", "HIDIOCGRDESCSIZE", _IOC_READ, 0x4801, 0x04 },
+{ "linux/hpet.h", "HPET_DPI", _IOC_NONE, 0x6805, 0x00 },
+{ "linux/hpet.h", "HPET_EPI", _IOC_NONE, 0x6804, 0x00 },
+{ "linux/hpet.h", "HPET_IE_OFF", _IOC_NONE, 0x6802, 0x00 },
+{ "linux/hpet.h", "HPET_IE_ON", _IOC_NONE, 0x6801, 0x00 },
+{ "linux/hpet.h", "HPET_INFO", _IOC_READ, 0x6803, 0x0c },
+{ "linux/hpet.h", "HPET_IRQFREQ", _IOC_WRITE, 0x6806, 0x04 },
+{ "linux/hsi/cs-protocol.h", "CS_CONFIG_BUFS", _IOC_WRITE, 0x431f, 0x20 },
+{ "linux/hsi/cs-protocol.h", "CS_GET_IF_VERSION", _IOC_READ, 0x431e, 0x04 },
+{ "linux/hsi/cs-protocol.h", "CS_GET_STATE", _IOC_READ, 0x4315, 0x04 },
+{ "linux/hsi/cs-protocol.h", "CS_SET_WAKELINE", _IOC_WRITE, 0x4317, 0x04 },
+{ "linux/hsi/hsi_char.h", "HSC_GET_RX", _IOC_WRITE, 0x6b14, 0x0c },
+{ "linux/hsi/hsi_char.h", "HSC_GET_TX", _IOC_WRITE, 0x6b16, 0x10 },
+{ "linux/hsi/hsi_char.h", "HSC_RESET", _IOC_NONE, 0x6b10, 0x00 },
+{ "linux/hsi/hsi_char.h", "HSC_SEND_BREAK", _IOC_NONE, 0x6b12, 0x00 },
+{ "linux/hsi/hsi_char.h", "HSC_SET_PM", _IOC_NONE, 0x6b11, 0x00 },
+{ "linux/hsi/hsi_char.h", "HSC_SET_RX", _IOC_WRITE, 0x6b13, 0x0c },
+{ "linux/hsi/hsi_char.h", "HSC_SET_TX", _IOC_WRITE, 0x6b15, 0x10 },
+{ "linux/i2o-dev.h", "I2OEVTGET", _IOC_READ, 0x690b, 0x68 },
+{ "linux/i2o-dev.h", "I2OEVTREG", _IOC_WRITE, 0x690a, 0x0c },
+{ "linux/i2o-dev.h", "I2OGETIOPS", _IOC_READ, 0x6900, 0x20 },
+{ "linux/i2o-dev.h", "I2OHRTGET", _IOC_READ|_IOC_WRITE, 0x6901, 0x0c },
+{ "linux/i2o-dev.h", "I2OHTML", _IOC_READ|_IOC_WRITE, 0x6909, 0x1c },
+{ "linux/i2o-dev.h", "I2OLCTGET", _IOC_READ|_IOC_WRITE, 0x6902, 0x0c },
+{ "linux/i2o-dev.h", "I2OPARMGET", _IOC_READ|_IOC_WRITE, 0x6904, 0x18 },
+{ "linux/i2o-dev.h", "I2OPARMSET", _IOC_READ|_IOC_WRITE, 0x6903, 0x18 },
+{ "linux/i2o-dev.h", "I2OPASSTHRU32", _IOC_READ, 0x690c, 0x08 },
+{ "linux/i2o-dev.h", "I2OSWDEL", _IOC_READ|_IOC_WRITE, 0x6907, 0x1c },
+{ "linux/i2o-dev.h", "I2OSWDL", _IOC_READ|_IOC_WRITE, 0x6905, 0x1c },
+{ "linux/i2o-dev.h", "I2OSWUL", _IOC_READ|_IOC_WRITE, 0x6906, 0x1c },
+{ "linux/i2o-dev.h", "I2OVALIDATE", _IOC_READ, 0x6908, 0x04 },
+{ "linux/i8k.h", "I8K_BIOS_VERSION", _IOC_READ, 0x6980, 0x04 },
+{ "linux/i8k.h", "I8K_FN_STATUS", _IOC_READ, 0x6983, 0x04 },
+{ "linux/i8k.h", "I8K_GET_FAN", _IOC_READ|_IOC_WRITE, 0x6986, 0x04 },
+{ "linux/i8k.h", "I8K_GET_SPEED", _IOC_READ|_IOC_WRITE, 0x6985, 0x04 },
+{ "linux/i8k.h", "I8K_GET_TEMP", _IOC_READ, 0x6984, 0x04 },
+{ "linux/i8k.h", "I8K_MACHINE_ID", _IOC_READ, 0x6981, 0x04 },
+{ "linux/i8k.h", "I8K_POWER_STATUS", _IOC_READ, 0x6982, 0x04 },
+{ "linux/i8k.h", "I8K_SET_FAN", _IOC_READ|_IOC_WRITE, 0x6987, 0x04 },
+{ "linux/if_pppox.h", "PPPOEIOCDFWD", _IOC_NONE, 0xb101, 0x00 },
+{ "linux/if_pppox.h", "PPPOEIOCSFWD", _IOC_WRITE, 0xb100, 0x04 },
+{ "linux/if_tun.h", "TUNATTACHFILTER", _IOC_WRITE, 0x54d5, 0x08 },
+{ "linux/if_tun.h", "TUNDETACHFILTER", _IOC_WRITE, 0x54d6, 0x08 },
+{ "linux/if_tun.h", "TUNGETDEVNETNS", _IOC_NONE, 0x54e3, 0x00 },
+{ "linux/if_tun.h", "TUNGETFEATURES", _IOC_READ, 0x54cf, 0x04 },
+{ "linux/if_tun.h", "TUNGETFILTER", _IOC_READ, 0x54db, 0x08 },
+{ "linux/if_tun.h", "TUNGETIFF", _IOC_READ, 0x54d2, 0x04 },
+{ "linux/if_tun.h", "TUNGETSNDBUF", _IOC_READ, 0x54d3, 0x04 },
+{ "linux/if_tun.h", "TUNGETVNETBE", _IOC_READ, 0x54df, 0x04 },
+{ "linux/if_tun.h", "TUNGETVNETHDRSZ", _IOC_READ, 0x54d7, 0x04 },
+{ "linux/if_tun.h", "TUNGETVNETLE", _IOC_READ, 0x54dd, 0x04 },
+{ "linux/if_tun.h", "TUNSETCARRIER", _IOC_WRITE, 0x54e2, 0x04 },
+{ "linux/if_tun.h", "TUNSETDEBUG", _IOC_WRITE, 0x54c9, 0x04 },
+{ "linux/if_tun.h", "TUNSETFILTEREBPF", _IOC_READ, 0x54e1, 0x04 },
+{ "linux/if_tun.h", "TUNSETGROUP", _IOC_WRITE, 0x54ce, 0x04 },
+{ "linux/if_tun.h", "TUNSETIFF", _IOC_WRITE, 0x54ca, 0x04 },
+{ "linux/if_tun.h", "TUNSETIFINDEX", _IOC_WRITE, 0x54da, 0x04 },
+{ "linux/if_tun.h", "TUNSETLINK", _IOC_WRITE, 0x54cd, 0x04 },
+{ "linux/if_tun.h", "TUNSETNOCSUM", _IOC_WRITE, 0x54c8, 0x04 },
+{ "linux/if_tun.h", "TUNSETOFFLOAD", _IOC_WRITE, 0x54d0, 0x04 },
+{ "linux/if_tun.h", "TUNSETOWNER", _IOC_WRITE, 0x54cc, 0x04 },
+{ "linux/if_tun.h", "TUNSETPERSIST", _IOC_WRITE, 0x54cb, 0x04 },
+{ "linux/if_tun.h", "TUNSETQUEUE", _IOC_WRITE, 0x54d9, 0x04 },
+{ "linux/if_tun.h", "TUNSETSNDBUF", _IOC_WRITE, 0x54d4, 0x04 },
+{ "linux/if_tun.h", "TUNSETSTEERINGEBPF", _IOC_READ, 0x54e0, 0x04 },
+{ "linux/if_tun.h", "TUNSETTXFILTER", _IOC_WRITE, 0x54d1, 0x04 },
+{ "linux/if_tun.h", "TUNSETVNETBE", _IOC_WRITE, 0x54de, 0x04 },
+{ "linux/if_tun.h", "TUNSETVNETHDRSZ", _IOC_WRITE, 0x54d8, 0x04 },
+{ "linux/if_tun.h", "TUNSETVNETLE", _IOC_WRITE, 0x54dc, 0x04 },
+{ "linux/iio/events.h", "IIO_GET_EVENT_FD_IOCTL", _IOC_READ, 0x6990, 0x04 },
+{ "linux/inotify.h", "INOTIFY_IOC_SETNEXTWD", _IOC_WRITE, 0x4900, 0x04 },
+{ "linux/input.h", "EVIOCGEFFECTS", _IOC_READ, 0x4584, 0x04 },
+{ "linux/input.h", "EVIOCGID", _IOC_READ, 0x4502, 0x08 },
+{ "linux/input.h", "EVIOCGKEYCODE", _IOC_READ, 0x4504, 0x08 },
+{ "linux/input.h", "EVIOCGKEYCODE_V2", _IOC_READ, 0x4504, 0x28 },
+{ "linux/input.h", "EVIOCGMASK", _IOC_READ, 0x4592, 0x10 },
+{ "linux/input.h", "EVIOCGRAB", _IOC_WRITE, 0x4590, 0x04 },
+{ "linux/input.h", "EVIOCGREP", _IOC_READ, 0x4503, 0x08 },
+{ "linux/input.h", "EVIOCGVERSION", _IOC_READ, 0x4501, 0x04 },
+{ "linux/input.h", "EVIOCREVOKE", _IOC_WRITE, 0x4591, 0x04 },
+{ "linux/input.h", "EVIOCRMFF", _IOC_WRITE, 0x4581, 0x04 },
+{ "linux/input.h", "EVIOCSCLOCKID", _IOC_WRITE, 0x45a0, 0x04 },
+{ "linux/input.h", "EVIOCSFF", _IOC_WRITE, 0x4580, 0x2c },
+{ "linux/input.h", "EVIOCSKEYCODE", _IOC_WRITE, 0x4504, 0x08 },
+{ "linux/input.h", "EVIOCSKEYCODE_V2", _IOC_WRITE, 0x4504, 0x28 },
+{ "linux/input.h", "EVIOCSMASK", _IOC_WRITE, 0x4593, 0x10 },
+{ "linux/input.h", "EVIOCSREP", _IOC_WRITE, 0x4503, 0x08 },
+{ "linux/ipmi.h", "IPMICTL_GET_MAINTENANCE_MODE_CMD", _IOC_READ, 0x691e, 0x04 },
+{ "linux/ipmi.h", "IPMICTL_GET_MY_ADDRESS_CMD", _IOC_READ, 0x6912, 0x04 },
+{ "linux/ipmi.h", "IPMICTL_GET_MY_CHANNEL_ADDRESS_CMD", _IOC_READ, 0x6919, 0x04 },
+{ "linux/ipmi.h", "IPMICTL_GET_MY_CHANNEL_LUN_CMD", _IOC_READ, 0x691b, 0x04 },
+{ "linux/ipmi.h", "IPMICTL_GET_MY_LUN_CMD", _IOC_READ, 0x6914, 0x04 },
+{ "linux/ipmi.h", "IPMICTL_GET_TIMING_PARMS_CMD", _IOC_READ, 0x6917, 0x08 },
+{ "linux/ipmi.h", "IPMICTL_RECEIVE_MSG", _IOC_READ|_IOC_WRITE, 0x690c, 0x18 },
+{ "linux/ipmi.h", "IPMICTL_RECEIVE_MSG_TRUNC", _IOC_READ|_IOC_WRITE, 0x690b, 0x18 },
+{ "linux/ipmi.h", "IPMICTL_REGISTER_FOR_CMD", _IOC_READ, 0x690e, 0x02 },
+{ "linux/ipmi.h", "IPMICTL_REGISTER_FOR_CMD_CHANS", _IOC_READ, 0x691c, 0x0c },
+{ "linux/ipmi.h", "IPMICTL_SEND_COMMAND", _IOC_READ, 0x690d, 0x14 },
+{ "linux/ipmi.h", "IPMICTL_SEND_COMMAND_SETTIME", _IOC_READ, 0x6915, 0x1c },
+{ "linux/ipmi.h", "IPMICTL_SET_GETS_EVENTS_CMD", _IOC_READ, 0x6910, 0x04 },
+{ "linux/ipmi.h", "IPMICTL_SET_MAINTENANCE_MODE_CMD", _IOC_WRITE, 0x691f, 0x04 },
+{ "linux/ipmi.h", "IPMICTL_SET_MY_ADDRESS_CMD", _IOC_READ, 0x6911, 0x04 },
+{ "linux/ipmi.h", "IPMICTL_SET_MY_CHANNEL_ADDRESS_CMD", _IOC_READ, 0x6918, 0x04 },
+{ "linux/ipmi.h", "IPMICTL_SET_MY_CHANNEL_LUN_CMD", _IOC_READ, 0x691a, 0x04 },
+{ "linux/ipmi.h", "IPMICTL_SET_MY_LUN_CMD", _IOC_READ, 0x6913, 0x04 },
+{ "linux/ipmi.h", "IPMICTL_SET_TIMING_PARMS_CMD", _IOC_READ, 0x6916, 0x08 },
+{ "linux/ipmi.h", "IPMICTL_UNREGISTER_FOR_CMD", _IOC_READ, 0x690f, 0x02 },
+{ "linux/ipmi.h", "IPMICTL_UNREGISTER_FOR_CMD_CHANS", _IOC_READ, 0x691d, 0x0c },
+{ "linux/ipmi_bmc.h", "IPMI_BMC_IOCTL_CLEAR_SMS_ATN", _IOC_NONE, 0xb101, 0x00 },
+{ "linux/ipmi_bmc.h", "IPMI_BMC_IOCTL_FORCE_ABORT", _IOC_NONE, 0xb102, 0x00 },
+{ "linux/ipmi_bmc.h", "IPMI_BMC_IOCTL_SET_SMS_ATN", _IOC_NONE, 0xb100, 0x00 },
+{ "linux/isst_if.h", "ISST_IF_GET_PHY_ID", _IOC_READ|_IOC_WRITE, 0xfe01, 0x04 },
+{ "linux/isst_if.h", "ISST_IF_GET_PLATFORM_INFO", _IOC_READ, 0xfe00, 0x04 },
+{ "linux/isst_if.h", "ISST_IF_IO_CMD", _IOC_WRITE, 0xfe02, 0x04 },
+{ "linux/isst_if.h", "ISST_IF_MBOX_COMMAND", _IOC_READ|_IOC_WRITE, 0xfe03, 0x04 },
+{ "linux/isst_if.h", "ISST_IF_MSR_COMMAND", _IOC_READ|_IOC_WRITE, 0xfe04, 0x04 },
+{ "linux/ivtv.h", "IVTV_IOC_DMA_FRAME", _IOC_WRITE, 0x56c0, 0x38 },
+{ "linux/ivtv.h", "IVTV_IOC_PASSTHROUGH_MODE", _IOC_WRITE, 0x56c1, 0x04 },
+{ "linux/ivtvfb.h", "IVTVFB_IOC_DMA_FRAME", _IOC_WRITE, 0x56c0, 0x0c },
+{ "linux/joystick.h", "JSIOCGAXES", _IOC_READ, 0x6a11, 0x01 },
+{ "linux/joystick.h", "JSIOCGAXMAP", _IOC_READ, 0x6a32, 0x40 },
+{ "linux/joystick.h", "JSIOCGBTNMAP", _IOC_READ, 0x6a34, 0x400 },
+{ "linux/joystick.h", "JSIOCGBUTTONS", _IOC_READ, 0x6a12, 0x01 },
+{ "linux/joystick.h", "JSIOCGCORR", _IOC_READ, 0x6a22, 0x24 },
+{ "linux/joystick.h", "JSIOCGVERSION", _IOC_READ, 0x6a01, 0x04 },
+{ "linux/joystick.h", "JSIOCSAXMAP", _IOC_WRITE, 0x6a31, 0x40 },
+{ "linux/joystick.h", "JSIOCSBTNMAP", _IOC_WRITE, 0x6a33, 0x400 },
+{ "linux/joystick.h", "JSIOCSCORR", _IOC_WRITE, 0x6a21, 0x24 },
+{ "linux/kcov.h", "KCOV_DISABLE", _IOC_NONE, 0x6365, 0x00 },
+{ "linux/kcov.h", "KCOV_ENABLE", _IOC_NONE, 0x6364, 0x00 },
+{ "linux/kcov.h", "KCOV_INIT_TRACE", _IOC_READ, 0x6301, 0x04 },
+{ "linux/kcov.h", "KCOV_REMOTE_ENABLE", _IOC_WRITE, 0x6366, 0x18 },
+{ "linux/kd.h", "GIO_CMAP", 0, 0x4B70, 0 },
+{ "linux/kd.h", "GIO_FONT", 0, 0x4B60, 0 },
+{ "linux/kd.h", "GIO_FONTX", 0, 0x4B6B, 0 },
+{ "linux/kd.h", "GIO_SCRNMAP", 0, 0x4B40, 0 },
+{ "linux/kd.h", "GIO_UNIMAP", 0, 0x4B66, 0 },
+{ "linux/kd.h", "GIO_UNISCRNMAP", 0, 0x4B69, 0 },
+{ "linux/kd.h", "KDADDIO", 0, 0x4B34, 0 },
+{ "linux/kd.h", "KDDELIO", 0, 0x4B35, 0 },
+{ "linux/kd.h", "KDDISABIO", 0, 0x4B37, 0 },
+{ "linux/kd.h", "KDENABIO", 0, 0x4B36, 0 },
+{ "linux/kd.h", "KDFONTOP", 0, 0x4B72, 0 },
+{ "linux/kd.h", "KDGETKEYCODE", 0, 0x4B4C, 0 },
+{ "linux/kd.h", "KDGETLED", 0, 0x4B31, 0 },
+{ "linux/kd.h", "KDGETMODE", 0, 0x4B3B, 0 },
+{ "linux/kd.h", "KDGKBDIACR", 0, 0x4B4A, 0 },
+{ "linux/kd.h", "KDGKBDIACRUC", 0, 0x4BFA, 0 },
+{ "linux/kd.h", "KDGKBENT", 0, 0x4B46, 0 },
+{ "linux/kd.h", "KDGKBLED", 0, 0x4B64, 0 },
+{ "linux/kd.h", "KDGKBMETA", 0, 0x4B62, 0 },
+{ "linux/kd.h", "KDGKBMODE", 0, 0x4B44, 0 },
+{ "linux/kd.h", "KDGKBSENT", 0, 0x4B48, 0 },
+{ "linux/kd.h", "KDGKBTYPE", 0, 0x4B33, 0 },
+{ "linux/kd.h", "KDKBDREP", 0, 0x4B52, 0 },
+{ "linux/kd.h", "KDMAPDISP", 0, 0x4B3C, 0 },
+{ "linux/kd.h", "KDMKTONE", 0, 0x4B30, 0 },
+{ "linux/kd.h", "KDSETKEYCODE", 0, 0x4B4D, 0 },
+{ "linux/kd.h", "KDSETLED", 0, 0x4B32, 0 },
+{ "linux/kd.h", "KDSETMODE", 0, 0x4B3A, 0 },
+{ "linux/kd.h", "KDSIGACCEPT", 0, 0x4B4E, 0 },
+{ "linux/kd.h", "KDSKBDIACR", 0, 0x4B4B, 0 },
+{ "linux/kd.h", "KDSKBDIACRUC", 0, 0x4BFB, 0 },
+{ "linux/kd.h", "KDSKBENT", 0, 0x4B47, 0 },
+{ "linux/kd.h", "KDSKBLED", 0, 0x4B65, 0 },
+{ "linux/kd.h", "KDSKBMETA", 0, 0x4B63, 0 },
+{ "linux/kd.h", "KDSKBMODE", 0, 0x4B45, 0 },
+{ "linux/kd.h", "KDSKBSENT", 0, 0x4B49, 0 },
+{ "linux/kd.h", "KDUNMAPDISP", 0, 0x4B3D, 0 },
+{ "linux/kd.h", "KIOCSOUND", 0, 0x4B2F, 0 },
+{ "linux/kd.h", "PIO_CMAP", 0, 0x4B71, 0 },
+{ "linux/kd.h", "PIO_FONT", 0, 0x4B61, 0 },
+{ "linux/kd.h", "PIO_FONTRESET", 0, 0x4B6D, 0 },
+{ "linux/kd.h", "PIO_FONTX", 0, 0x4B6C, 0 },
+{ "linux/kd.h", "PIO_SCRNMAP", 0, 0x4B41, 0 },
+{ "linux/kd.h", "PIO_UNIMAP", 0, 0x4B67, 0 },
+{ "linux/kd.h", "PIO_UNIMAPCLR", 0, 0x4B68, 0 },
+{ "linux/kd.h", "PIO_UNISCRNMAP", 0, 0x4B6A, 0 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_ACQUIRE_VM", _IOC_WRITE, 0x4b15, 0x08 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_ALLOC_MEMORY_OF_GPU", _IOC_READ|_IOC_WRITE, 0x4b16, 0x28 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_ALLOC_QUEUE_GWS", _IOC_READ|_IOC_WRITE, 0x4b1e, 0x10 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_CREATE_EVENT", _IOC_READ|_IOC_WRITE, 0x4b08, 0x20 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_CREATE_QUEUE", _IOC_READ|_IOC_WRITE, 0x4b02, 0x58 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_DBG_ADDRESS_WATCH", _IOC_WRITE, 0x4b0f, 0x10 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_DBG_REGISTER", _IOC_WRITE, 0x4b0d, 0x08 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_DBG_UNREGISTER", _IOC_WRITE, 0x4b0e, 0x08 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_DBG_WAVE_CONTROL", _IOC_WRITE, 0x4b10, 0x10 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_DESTROY_EVENT", _IOC_WRITE, 0x4b09, 0x08 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_DESTROY_QUEUE", _IOC_READ|_IOC_WRITE, 0x4b03, 0x08 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_FREE_MEMORY_OF_GPU", _IOC_WRITE, 0x4b17, 0x08 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_CLOCK_COUNTERS", _IOC_READ|_IOC_WRITE, 0x4b05, 0x28 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_DMABUF_INFO", _IOC_READ|_IOC_WRITE, 0x4b1c, 0x20 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_PROCESS_APERTURES", _IOC_READ, 0x4b06, 0x190 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_PROCESS_APERTURES_NEW", _IOC_READ|_IOC_WRITE, 0x4b14, 0x10 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_QUEUE_WAVE_STATE", _IOC_READ|_IOC_WRITE, 0x4b1b, 0x18 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_TILE_CONFIG", _IOC_READ|_IOC_WRITE, 0x4b12, 0x28 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_VERSION", _IOC_READ, 0x4b01, 0x08 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_IMPORT_DMABUF", _IOC_READ|_IOC_WRITE, 0x4b1d, 0x18 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_MAP_MEMORY_TO_GPU", _IOC_READ|_IOC_WRITE, 0x4b18, 0x18 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_RESET_EVENT", _IOC_WRITE, 0x4b0b, 0x08 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_SET_CU_MASK", _IOC_WRITE, 0x4b1a, 0x10 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_SET_EVENT", _IOC_WRITE, 0x4b0a, 0x08 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_SET_MEMORY_POLICY", _IOC_WRITE, 0x4b04, 0x20 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_SET_SCRATCH_BACKING_VA", _IOC_READ|_IOC_WRITE, 0x4b11, 0x10 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_SET_TRAP_HANDLER", _IOC_WRITE, 0x4b13, 0x18 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_SMI_EVENTS", _IOC_READ|_IOC_WRITE, 0x4b1f, 0x08 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_UNMAP_MEMORY_FROM_GPU", _IOC_READ|_IOC_WRITE, 0x4b19, 0x18 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_UPDATE_QUEUE", _IOC_WRITE, 0x4b07, 0x18 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_WAIT_EVENTS", _IOC_READ|_IOC_WRITE, 0x4b0c, 0x18 },
+{ "linux/lightnvm.h", "NVME_NVM_IOCTL_ADMIN_VIO", _IOC_READ|_IOC_WRITE, 0x4c41, 0x50 },
+{ "linux/lightnvm.h", "NVME_NVM_IOCTL_IO_VIO", _IOC_READ|_IOC_WRITE, 0x4c43, 0x50 },
+{ "linux/lightnvm.h", "NVME_NVM_IOCTL_SUBMIT_VIO", _IOC_READ|_IOC_WRITE, 0x4c42, 0x40 },
+{ "linux/lightnvm.h", "NVM_DEV_CREATE", _IOC_WRITE, 0x4c22, 0x80 },
+{ "linux/lightnvm.h", "NVM_DEV_FACTORY", _IOC_WRITE, 0x4c25, 0x24 },
+{ "linux/lightnvm.h", "NVM_DEV_INIT", _IOC_WRITE, 0x4c24, 0x2c },
+{ "linux/lightnvm.h", "NVM_DEV_REMOVE", _IOC_WRITE, 0x4c23, 0x24 },
+{ "linux/lightnvm.h", "NVM_GET_DEVICES", _IOC_READ, 0x4c21, 0x1000 },
+{ "linux/lightnvm.h", "NVM_INFO", _IOC_READ|_IOC_WRITE, 0x4c20, 0x1000 },
+{ "linux/lirc.h", "LIRC_GET_FEATURES", _IOC_READ, 0x6900, 0x04 },
+{ "linux/lirc.h", "LIRC_GET_LENGTH", _IOC_READ, 0x690f, 0x04 },
+{ "linux/lirc.h", "LIRC_GET_MAX_TIMEOUT", _IOC_READ, 0x6909, 0x04 },
+{ "linux/lirc.h", "LIRC_GET_MIN_TIMEOUT", _IOC_READ, 0x6908, 0x04 },
+{ "linux/lirc.h", "LIRC_GET_REC_MODE", _IOC_READ, 0x6902, 0x04 },
+{ "linux/lirc.h", "LIRC_GET_REC_RESOLUTION", _IOC_READ, 0x6907, 0x04 },
+{ "linux/lirc.h", "LIRC_GET_REC_TIMEOUT", _IOC_READ, 0x6924, 0x04 },
+{ "linux/lirc.h", "LIRC_GET_SEND_MODE", _IOC_READ, 0x6901, 0x04 },
+{ "linux/lirc.h", "LIRC_SET_MEASURE_CARRIER_MODE", _IOC_WRITE, 0x691d, 0x04 },
+{ "linux/lirc.h", "LIRC_SET_REC_CARRIER", _IOC_WRITE, 0x6914, 0x04 },
+{ "linux/lirc.h", "LIRC_SET_REC_CARRIER_RANGE", _IOC_WRITE, 0x691f, 0x04 },
+{ "linux/lirc.h", "LIRC_SET_REC_MODE", _IOC_WRITE, 0x6912, 0x04 },
+{ "linux/lirc.h", "LIRC_SET_REC_TIMEOUT", _IOC_WRITE, 0x6918, 0x04 },
+{ "linux/lirc.h", "LIRC_SET_REC_TIMEOUT_REPORTS", _IOC_WRITE, 0x6919, 0x04 },
+{ "linux/lirc.h", "LIRC_SET_SEND_CARRIER", _IOC_WRITE, 0x6913, 0x04 },
+{ "linux/lirc.h", "LIRC_SET_SEND_DUTY_CYCLE", _IOC_WRITE, 0x6915, 0x04 },
+{ "linux/lirc.h", "LIRC_SET_SEND_MODE", _IOC_WRITE, 0x6911, 0x04 },
+{ "linux/lirc.h", "LIRC_SET_TRANSMITTER_MASK", _IOC_WRITE, 0x6917, 0x04 },
+{ "linux/lirc.h", "LIRC_SET_WIDEBAND_RECEIVER", _IOC_WRITE, 0x6923, 0x04 },
+{ "linux/loop.h", "LOOP_CHANGE_FD", 0, 0x4C06, 0 },
+{ "linux/loop.h", "LOOP_CLR_FD", 0, 0x4C01, 0 },
+{ "linux/loop.h", "LOOP_CONFIGURE", 0, 0x4C0A, 0 },
+{ "linux/loop.h", "LOOP_CTL_ADD", 0, 0x4C80, 0 },
+{ "linux/loop.h", "LOOP_CTL_GET_FREE", 0, 0x4C82, 0 },
+{ "linux/loop.h", "LOOP_CTL_REMOVE", 0, 0x4C81, 0 },
+{ "linux/loop.h", "LOOP_GET_STATUS", 0, 0x4C03, 0 },
+{ "linux/loop.h", "LOOP_GET_STATUS64", 0, 0x4C05, 0 },
+{ "linux/loop.h", "LOOP_SET_BLOCK_SIZE", 0, 0x4C09, 0 },
+{ "linux/loop.h", "LOOP_SET_CAPACITY", 0, 0x4C07, 0 },
+{ "linux/loop.h", "LOOP_SET_DIRECT_IO", 0, 0x4C08, 0 },
+{ "linux/loop.h", "LOOP_SET_FD", 0, 0x4C00, 0 },
+{ "linux/loop.h", "LOOP_SET_STATUS", 0, 0x4C02, 0 },
+{ "linux/loop.h", "LOOP_SET_STATUS64", 0, 0x4C04, 0 },
+{ "linux/lp.h", "LPSETTIMEOUT_NEW", _IOC_WRITE, 0x060f, 0x10 },
+{ "linux/mISDNif.h", "IMADDTIMER", _IOC_READ, 0x4940, 0x04 },
+{ "linux/mISDNif.h", "IMCLEAR_L2", _IOC_READ, 0x4946, 0x04 },
+{ "linux/mISDNif.h", "IMCTRLREQ", _IOC_READ, 0x4945, 0x04 },
+{ "linux/mISDNif.h", "IMDELTIMER", _IOC_READ, 0x4941, 0x04 },
+{ "linux/mISDNif.h", "IMGETCOUNT", _IOC_READ, 0x4943, 0x04 },
+{ "linux/mISDNif.h", "IMGETDEVINFO", _IOC_READ, 0x4944, 0x04 },
+{ "linux/mISDNif.h", "IMGETVERSION", _IOC_READ, 0x4942, 0x04 },
+{ "linux/mISDNif.h", "IMHOLD_L1", _IOC_READ, 0x4948, 0x04 },
+{ "linux/mISDNif.h", "IMSETDEVNAME", _IOC_READ, 0x4947, 0x18 },
+{ "linux/matroxfb.h", "MATROXFB_GET_ALL_OUTPUTS", _IOC_READ, 0x6efb, 0x04 },
+{ "linux/matroxfb.h", "MATROXFB_GET_AVAILABLE_OUTPUTS", _IOC_READ, 0x6ef9, 0x04 },
+{ "linux/matroxfb.h", "MATROXFB_GET_OUTPUT_CONNECTION", _IOC_READ, 0x6ef8, 0x04 },
+{ "linux/matroxfb.h", "MATROXFB_GET_OUTPUT_MODE", _IOC_READ|_IOC_WRITE, 0x6efa, 0x04 },
+{ "linux/matroxfb.h", "MATROXFB_SET_OUTPUT_CONNECTION", _IOC_WRITE, 0x6ef8, 0x04 },
+{ "linux/matroxfb.h", "MATROXFB_SET_OUTPUT_MODE", _IOC_WRITE, 0x6efa, 0x04 },
+{ "linux/media.h", "MEDIA_IOC_DEVICE_INFO", _IOC_READ|_IOC_WRITE, 0x7c00, 0x100 },
+{ "linux/media.h", "MEDIA_IOC_ENUM_ENTITIES", _IOC_READ|_IOC_WRITE, 0x7c01, 0x100 },
+{ "linux/media.h", "MEDIA_IOC_ENUM_LINKS", _IOC_READ|_IOC_WRITE, 0x7c02, 0x1c },
+{ "linux/media.h", "MEDIA_IOC_G_TOPOLOGY", _IOC_READ|_IOC_WRITE, 0x7c04, 0x48 },
+{ "linux/media.h", "MEDIA_IOC_REQUEST_ALLOC", _IOC_READ, 0x7c05, 0x04 },
+{ "linux/media.h", "MEDIA_IOC_SETUP_LINK", _IOC_READ|_IOC_WRITE, 0x7c03, 0x34 },
+{ "linux/media.h", "MEDIA_REQUEST_IOC_QUEUE", _IOC_NONE, 0x7c80, 0x00 },
+{ "linux/media.h", "MEDIA_REQUEST_IOC_REINIT", _IOC_NONE, 0x7c81, 0x00 },
+{ "linux/mei.h", "IOCTL_MEI_CONNECT_CLIENT", _IOC_READ|_IOC_WRITE, 0x4801, 0x10 },
+{ "linux/mei.h", "IOCTL_MEI_CONNECT_CLIENT_VTAG", _IOC_READ|_IOC_WRITE, 0x4804, 0x14 },
+{ "linux/mei.h", "IOCTL_MEI_NOTIFY_GET", _IOC_READ, 0x4803, 0x04 },
+{ "linux/mei.h", "IOCTL_MEI_NOTIFY_SET", _IOC_WRITE, 0x4802, 0x04 },
+{ "linux/meye.h", "MEYEIOC_G_PARAMS", _IOC_READ, 0x76c0, 0x06 },
+{ "linux/meye.h", "MEYEIOC_QBUF_CAPT", _IOC_WRITE, 0x76c2, 0x04 },
+{ "linux/meye.h", "MEYEIOC_STILLCAPT", _IOC_NONE, 0x76c4, 0x00 },
+{ "linux/meye.h", "MEYEIOC_STILLJCAPT", _IOC_READ, 0x76c5, 0x04 },
+{ "linux/meye.h", "MEYEIOC_SYNC", _IOC_READ|_IOC_WRITE, 0x76c3, 0x04 },
+{ "linux/meye.h", "MEYEIOC_S_PARAMS", _IOC_WRITE, 0x76c1, 0x06 },
+{ "linux/mmc/ioctl.h", "MMC_IOC_CMD", _IOC_READ|_IOC_WRITE, 0xb300, 0x48 },
+{ "linux/mmc/ioctl.h", "MMC_IOC_MULTI_CMD", _IOC_READ|_IOC_WRITE, 0xb301, 0x08 },
+{ "linux/mmtimer.h", "MMTIMER_GETBITS", _IOC_NONE, 0x6d04, 0x00 },
+{ "linux/mmtimer.h", "MMTIMER_GETCOUNTER", _IOC_READ, 0x6d09, 0x04 },
+{ "linux/mmtimer.h", "MMTIMER_GETFREQ", _IOC_READ, 0x6d02, 0x04 },
+{ "linux/mmtimer.h", "MMTIMER_GETOFFSET", _IOC_NONE, 0x6d00, 0x00 },
+{ "linux/mmtimer.h", "MMTIMER_GETRES", _IOC_READ, 0x6d01, 0x04 },
+{ "linux/mmtimer.h", "MMTIMER_MMAPAVAIL", _IOC_NONE, 0x6d06, 0x00 },
+{ "linux/msdos_fs.h", "FAT_IOCTL_GET_ATTRIBUTES", _IOC_READ, 0x7210, 0x04 },
+{ "linux/msdos_fs.h", "FAT_IOCTL_GET_VOLUME_ID", _IOC_READ, 0x7213, 0x04 },
+{ "linux/msdos_fs.h", "FAT_IOCTL_SET_ATTRIBUTES", _IOC_WRITE, 0x7211, 0x04 },
+{ "linux/msdos_fs.h", "VFAT_IOCTL_READDIR_BOTH", _IOC_READ, 0x7201, 0x218 },
+{ "linux/msdos_fs.h", "VFAT_IOCTL_READDIR_SHORT", _IOC_READ, 0x7202, 0x218 },
+{ "linux/mtio.h", "MTIOCGET", _IOC_READ, 0x6d02, 0x1c },
+{ "linux/mtio.h", "MTIOCPOS", _IOC_READ, 0x6d03, 0x04 },
+{ "linux/mtio.h", "MTIOCTOP", _IOC_WRITE, 0x6d01, 0x08 },
+{ "linux/nbd.h", "NBD_CLEAR_QUE", _IOC_NONE, 0xab05, 0x00 },
+{ "linux/nbd.h", "NBD_CLEAR_SOCK", _IOC_NONE, 0xab04, 0x00 },
+{ "linux/nbd.h", "NBD_DISCONNECT", _IOC_NONE, 0xab08, 0x00 },
+{ "linux/nbd.h", "NBD_DO_IT", _IOC_NONE, 0xab03, 0x00 },
+{ "linux/nbd.h", "NBD_PRINT_DEBUG", _IOC_NONE, 0xab06, 0x00 },
+{ "linux/nbd.h", "NBD_SET_BLKSIZE", _IOC_NONE, 0xab01, 0x00 },
+{ "linux/nbd.h", "NBD_SET_FLAGS", _IOC_NONE, 0xab0a, 0x00 },
+{ "linux/nbd.h", "NBD_SET_SIZE", _IOC_NONE, 0xab02, 0x00 },
+{ "linux/nbd.h", "NBD_SET_SIZE_BLOCKS", _IOC_NONE, 0xab07, 0x00 },
+{ "linux/nbd.h", "NBD_SET_SOCK", _IOC_NONE, 0xab00, 0x00 },
+{ "linux/nbd.h", "NBD_SET_TIMEOUT", _IOC_NONE, 0xab09, 0x00 },
+{ "linux/ndctl.h", "ND_IOCTL_ARS_CAP", _IOC_READ|_IOC_WRITE, 0x4e01, 0x20 },
+{ "linux/ndctl.h", "ND_IOCTL_ARS_START", _IOC_READ|_IOC_WRITE, 0x4e02, 0x20 },
+{ "linux/ndctl.h", "ND_IOCTL_ARS_STATUS", _IOC_READ|_IOC_WRITE, 0x4e03, 0x30 },
+{ "linux/ndctl.h", "ND_IOCTL_CALL", _IOC_READ|_IOC_WRITE, 0x4e0a, 0x40 },
+{ "linux/ndctl.h", "ND_IOCTL_CLEAR_ERROR", _IOC_READ|_IOC_WRITE, 0x4e04, 0x20 },
+{ "linux/ndctl.h", "ND_IOCTL_DIMM_FLAGS", _IOC_READ|_IOC_WRITE, 0x4e03, 0x08 },
+{ "linux/ndctl.h", "ND_IOCTL_GET_CONFIG_DATA", _IOC_READ|_IOC_WRITE, 0x4e05, 0x0c },
+{ "linux/ndctl.h", "ND_IOCTL_GET_CONFIG_SIZE", _IOC_READ|_IOC_WRITE, 0x4e04, 0x0c },
+{ "linux/ndctl.h", "ND_IOCTL_SET_CONFIG_DATA", _IOC_READ|_IOC_WRITE, 0x4e06, 0x08 },
+{ "linux/ndctl.h", "ND_IOCTL_VENDOR", _IOC_READ|_IOC_WRITE, 0x4e09, 0x08 },
+{ "linux/nilfs2_api.h", "NILFS_IOCTL_CHANGE_CPMODE", _IOC_WRITE, 0x6e80, 0x10 },
+{ "linux/nilfs2_api.h", "NILFS_IOCTL_CLEAN_SEGMENTS", _IOC_WRITE, 0x6e88, 0x78 },
+{ "linux/nilfs2_api.h", "NILFS_IOCTL_DELETE_CHECKPOINT", _IOC_WRITE, 0x6e81, 0x08 },
+{ "linux/nilfs2_api.h", "NILFS_IOCTL_GET_BDESCS", _IOC_READ|_IOC_WRITE, 0x6e87, 0x18 },
+{ "linux/nilfs2_api.h", "NILFS_IOCTL_GET_CPINFO", _IOC_READ, 0x6e82, 0x18 },
+{ "linux/nilfs2_api.h", "NILFS_IOCTL_GET_CPSTAT", _IOC_READ, 0x6e83, 0x18 },
+{ "linux/nilfs2_api.h", "NILFS_IOCTL_GET_SUINFO", _IOC_READ, 0x6e84, 0x18 },
+{ "linux/nilfs2_api.h", "NILFS_IOCTL_GET_SUSTAT", _IOC_READ, 0x6e85, 0x30 },
+{ "linux/nilfs2_api.h", "NILFS_IOCTL_GET_VINFO", _IOC_READ|_IOC_WRITE, 0x6e86, 0x18 },
+{ "linux/nilfs2_api.h", "NILFS_IOCTL_RESIZE", _IOC_WRITE, 0x6e8b, 0x08 },
+{ "linux/nilfs2_api.h", "NILFS_IOCTL_SET_ALLOC_RANGE", _IOC_WRITE, 0x6e8c, 0x10 },
+{ "linux/nilfs2_api.h", "NILFS_IOCTL_SET_SUINFO", _IOC_WRITE, 0x6e8d, 0x18 },
+{ "linux/nilfs2_api.h", "NILFS_IOCTL_SYNC", _IOC_READ, 0x6e8a, 0x08 },
+{ "linux/nitro_enclaves.h", "NE_ADD_VCPU", _IOC_READ|_IOC_WRITE, 0xae21, 0x04 },
+{ "linux/nitro_enclaves.h", "NE_CREATE_VM", _IOC_READ, 0xae20, 0x08 },
+{ "linux/nitro_enclaves.h", "NE_GET_IMAGE_LOAD_INFO", _IOC_READ|_IOC_WRITE, 0xae22, 0x10 },
+{ "linux/nitro_enclaves.h", "NE_SET_USER_MEMORY_REGION", _IOC_WRITE, 0xae23, 0x18 },
+{ "linux/nitro_enclaves.h", "NE_START_ENCLAVE", _IOC_READ|_IOC_WRITE, 0xae24, 0x10 },
+{ "linux/nsfs.h", "NS_GET_NSTYPE", _IOC_NONE, 0xb703, 0x00 },
+{ "linux/nsfs.h", "NS_GET_OWNER_UID", _IOC_NONE, 0xb704, 0x00 },
+{ "linux/nsfs.h", "NS_GET_PARENT", _IOC_NONE, 0xb702, 0x00 },
+{ "linux/nsfs.h", "NS_GET_USERNS", _IOC_NONE, 0xb701, 0x00 },
+{ "linux/nvme_ioctl.h", "NVME_IOCTL_ADMIN64_CMD", _IOC_READ|_IOC_WRITE, 0x4e47, 0x50 },
+{ "linux/nvme_ioctl.h", "NVME_IOCTL_ADMIN_CMD", _IOC_READ|_IOC_WRITE, 0x4e41, 0x48 },
+{ "linux/nvme_ioctl.h", "NVME_IOCTL_ID", _IOC_NONE, 0x4e40, 0x00 },
+{ "linux/nvme_ioctl.h", "NVME_IOCTL_IO64_CMD", _IOC_READ|_IOC_WRITE, 0x4e48, 0x50 },
+{ "linux/nvme_ioctl.h", "NVME_IOCTL_IO_CMD", _IOC_READ|_IOC_WRITE, 0x4e43, 0x48 },
+{ "linux/nvme_ioctl.h", "NVME_IOCTL_RESCAN", _IOC_NONE, 0x4e46, 0x00 },
+{ "linux/nvme_ioctl.h", "NVME_IOCTL_RESET", _IOC_NONE, 0x4e44, 0x00 },
+{ "linux/nvme_ioctl.h", "NVME_IOCTL_SUBMIT_IO", _IOC_WRITE, 0x4e42, 0x2c },
+{ "linux/nvme_ioctl.h", "NVME_IOCTL_SUBSYS_RESET", _IOC_NONE, 0x4e45, 0x00 },
+{ "linux/nvram.h", "NVRAM_INIT", _IOC_NONE, 0x7040, 0x00 },
+{ "linux/nvram.h", "NVRAM_SETCKS", _IOC_NONE, 0x7041, 0x00 },
+{ "linux/omap3isp.h", "VIDIOC_OMAP3ISP_AEWB_CFG", _IOC_READ|_IOC_WRITE, 0x56c3, 0x20 },
+{ "linux/omap3isp.h", "VIDIOC_OMAP3ISP_AF_CFG", _IOC_READ|_IOC_WRITE, 0x56c5, 0x4c },
+{ "linux/omap3isp.h", "VIDIOC_OMAP3ISP_CCDC_CFG", _IOC_READ|_IOC_WRITE, 0x56c1, 0x20 },
+{ "linux/omap3isp.h", "VIDIOC_OMAP3ISP_HIST_CFG", _IOC_READ|_IOC_WRITE, 0x56c4, 0x30 },
+{ "linux/omap3isp.h", "VIDIOC_OMAP3ISP_PRV_CFG", _IOC_READ|_IOC_WRITE, 0x56c2, 0x3c },
+{ "linux/omap3isp.h", "VIDIOC_OMAP3ISP_STAT_EN", _IOC_READ|_IOC_WRITE, 0x56c7, 0x04 },
+{ "linux/omap3isp.h", "VIDIOC_OMAP3ISP_STAT_REQ_TIME32", _IOC_READ|_IOC_WRITE, 0x56c6, 0x18 },
+{ "linux/omapfb.h", "OMAPFB_CTRL_TEST", _IOC_WRITE, 0x4f2e, 0x04 },
+{ "linux/omapfb.h", "OMAPFB_GET_CAPS", _IOC_READ, 0x4f2a, 0x0c },
+{ "linux/omapfb.h", "OMAPFB_GET_COLOR_KEY", _IOC_WRITE, 0x4f33, 0x10 },
+{ "linux/omapfb.h", "OMAPFB_GET_DISPLAY_INFO", _IOC_READ, 0x4f3f, 0x20 },
+{ "linux/omapfb.h", "OMAPFB_GET_OVERLAY_COLORMODE", _IOC_READ, 0x4f3b, 0x3c },
+{ "linux/omapfb.h", "OMAPFB_GET_UPDATE_MODE", _IOC_WRITE, 0x4f2b, 0x04 },
+{ "linux/omapfb.h", "OMAPFB_GET_VRAM_INFO", _IOC_READ, 0x4f3d, 0x20 },
+{ "linux/omapfb.h", "OMAPFB_LCD_TEST", _IOC_WRITE, 0x4f2d, 0x04 },
+{ "linux/omapfb.h", "OMAPFB_MEMORY_READ", _IOC_READ, 0x4f3a, 0x10 },
+{ "linux/omapfb.h", "OMAPFB_MIRROR", _IOC_WRITE, 0x4f1f, 0x04 },
+{ "linux/omapfb.h", "OMAPFB_QUERY_MEM", _IOC_WRITE, 0x4f38, 0x08 },
+{ "linux/omapfb.h", "OMAPFB_QUERY_PLANE", _IOC_WRITE, 0x4f35, 0x44 },
+{ "linux/omapfb.h", "OMAPFB_SETUP_MEM", _IOC_WRITE, 0x4f37, 0x08 },
+{ "linux/omapfb.h", "OMAPFB_SETUP_PLANE", _IOC_WRITE, 0x4f34, 0x44 },
+{ "linux/omapfb.h", "OMAPFB_SET_COLOR_KEY", _IOC_WRITE, 0x4f32, 0x10 },
+{ "linux/omapfb.h", "OMAPFB_SET_TEARSYNC", _IOC_WRITE, 0x4f3e, 0x08 },
+{ "linux/omapfb.h", "OMAPFB_SET_UPDATE_MODE", _IOC_WRITE, 0x4f28, 0x04 },
+{ "linux/omapfb.h", "OMAPFB_SYNC_GFX", _IOC_NONE, 0x4f25, 0x00 },
+{ "linux/omapfb.h", "OMAPFB_UPDATE_WINDOW", _IOC_WRITE, 0x4f36, 0x44 },
+{ "linux/omapfb.h", "OMAPFB_UPDATE_WINDOW_OLD", _IOC_WRITE, 0x4f2f, 0x14 },
+{ "linux/omapfb.h", "OMAPFB_VSYNC", _IOC_NONE, 0x4f26, 0x00 },
+{ "linux/omapfb.h", "OMAPFB_WAITFORGO", _IOC_NONE, 0x4f3c, 0x00 },
+{ "linux/omapfb.h", "OMAPFB_WAITFORVSYNC", _IOC_NONE, 0x4f39, 0x00 },
+{ "linux/pcitest.h", "PCITEST_BAR", _IOC_NONE, 0x5001, 0x00 },
+{ "linux/pcitest.h", "PCITEST_CLEAR_IRQ", _IOC_NONE, 0x5010, 0x00 },
+{ "linux/pcitest.h", "PCITEST_COPY", _IOC_WRITE, 0x5006, 0x04 },
+{ "linux/pcitest.h", "PCITEST_GET_IRQTYPE", _IOC_NONE, 0x5009, 0x00 },
+{ "linux/pcitest.h", "PCITEST_LEGACY_IRQ", _IOC_NONE, 0x5002, 0x00 },
+{ "linux/pcitest.h", "PCITEST_MSI", _IOC_WRITE, 0x5003, 0x04 },
+{ "linux/pcitest.h", "PCITEST_MSIX", _IOC_WRITE, 0x5007, 0x04 },
+{ "linux/pcitest.h", "PCITEST_READ", _IOC_WRITE, 0x5005, 0x04 },
+{ "linux/pcitest.h", "PCITEST_SET_IRQTYPE", _IOC_WRITE, 0x5008, 0x04 },
+{ "linux/pcitest.h", "PCITEST_WRITE", _IOC_WRITE, 0x5004, 0x04 },
+{ "linux/perf_event.h", "PERF_EVENT_IOC_DISABLE", _IOC_NONE, 0x2401, 0x00 },
+{ "linux/perf_event.h", "PERF_EVENT_IOC_ENABLE", _IOC_NONE, 0x2400, 0x00 },
+{ "linux/perf_event.h", "PERF_EVENT_IOC_ID", _IOC_READ, 0x2407, 0x04 },
+{ "linux/perf_event.h", "PERF_EVENT_IOC_MODIFY_ATTRIBUTES", _IOC_WRITE, 0x240b, 0x04 },
+{ "linux/perf_event.h", "PERF_EVENT_IOC_PAUSE_OUTPUT", _IOC_WRITE, 0x2409, 0x04 },
+{ "linux/perf_event.h", "PERF_EVENT_IOC_PERIOD", _IOC_WRITE, 0x2404, 0x08 },
+{ "linux/perf_event.h", "PERF_EVENT_IOC_QUERY_BPF", _IOC_READ|_IOC_WRITE, 0x240a, 0x04 },
+{ "linux/perf_event.h", "PERF_EVENT_IOC_REFRESH", _IOC_NONE, 0x2402, 0x00 },
+{ "linux/perf_event.h", "PERF_EVENT_IOC_RESET", _IOC_NONE, 0x2403, 0x00 },
+{ "linux/perf_event.h", "PERF_EVENT_IOC_SET_BPF", _IOC_WRITE, 0x2408, 0x04 },
+{ "linux/perf_event.h", "PERF_EVENT_IOC_SET_FILTER", _IOC_WRITE, 0x2406, 0x04 },
+{ "linux/perf_event.h", "PERF_EVENT_IOC_SET_OUTPUT", _IOC_NONE, 0x2405, 0x00 },
+{ "linux/phantom.h", "PHN_GETREG", _IOC_READ|_IOC_WRITE, 0x7005, 0x08 },
+{ "linux/phantom.h", "PHN_GETREGS", _IOC_READ|_IOC_WRITE, 0x7007, 0x28 },
+{ "linux/phantom.h", "PHN_GET_REG", _IOC_READ|_IOC_WRITE, 0x7000, 0x04 },
+{ "linux/phantom.h", "PHN_GET_REGS", _IOC_READ|_IOC_WRITE, 0x7002, 0x04 },
+{ "linux/phantom.h", "PHN_NOT_OH", _IOC_NONE, 0x7004, 0x00 },
+{ "linux/phantom.h", "PHN_SETREG", _IOC_WRITE, 0x7006, 0x08 },
+{ "linux/phantom.h", "PHN_SETREGS", _IOC_WRITE, 0x7008, 0x28 },
+{ "linux/phantom.h", "PHN_SET_REG", _IOC_WRITE, 0x7001, 0x04 },
+{ "linux/phantom.h", "PHN_SET_REGS", _IOC_WRITE, 0x7003, 0x04 },
+{ "linux/pktcdvd.h", "PACKET_CTRL_CMD", _IOC_READ|_IOC_WRITE, 0x5801, 0x18 },
+{ "linux/platform_data/cros_ec_chardev.h", "CROS_EC_DEV_IOCEVENTMASK", _IOC_NONE, 0xec02, 0x00 },
+{ "linux/platform_data/cros_ec_chardev.h", "CROS_EC_DEV_IOCRDMEM", _IOC_READ|_IOC_WRITE, 0xec01, 0x108 },
+{ "linux/platform_data/cros_ec_chardev.h", "CROS_EC_DEV_IOCXCMD", _IOC_READ|_IOC_WRITE, 0xec00, 0x14 },
+{ "linux/platform_data/media/si4713.h", "SI4713_IOC_MEASURE_RNL", _IOC_READ|_IOC_WRITE, 0x56c0, 0x1c },
+{ "linux/pmu.h", "PMU_IOC_CAN_SLEEP", _IOC_READ, 0x4205, 0x04 },
+{ "linux/pmu.h", "PMU_IOC_GET_BACKLIGHT", _IOC_READ, 0x4201, 0x04 },
+{ "linux/pmu.h", "PMU_IOC_GET_MODEL", _IOC_READ, 0x4203, 0x04 },
+{ "linux/pmu.h", "PMU_IOC_GRAB_BACKLIGHT", _IOC_READ, 0x4206, 0x04 },
+{ "linux/pmu.h", "PMU_IOC_HAS_ADB", _IOC_READ, 0x4204, 0x04 },
+{ "linux/pmu.h", "PMU_IOC_SET_BACKLIGHT", _IOC_WRITE, 0x4202, 0x04 },
+{ "linux/pmu.h", "PMU_IOC_SLEEP", _IOC_NONE, 0x4200, 0x00 },
+{ "linux/ppdev.h", "PPCLAIM", _IOC_NONE, 0x708b, 0x00 },
+{ "linux/ppdev.h", "PPCLRIRQ", _IOC_READ, 0x7093, 0x04 },
+{ "linux/ppdev.h", "PPDATADIR", _IOC_WRITE, 0x7090, 0x04 },
+{ "linux/ppdev.h", "PPEXCL", _IOC_NONE, 0x708f, 0x00 },
+{ "linux/ppdev.h", "PPFCONTROL", _IOC_WRITE, 0x708e, 0x02 },
+{ "linux/ppdev.h", "PPGETFLAGS", _IOC_READ, 0x709a, 0x04 },
+{ "linux/ppdev.h", "PPGETMODE", _IOC_READ, 0x7098, 0x04 },
+{ "linux/ppdev.h", "PPGETMODES", _IOC_READ, 0x7097, 0x04 },
+{ "linux/ppdev.h", "PPGETPHASE", _IOC_READ, 0x7099, 0x04 },
+{ "linux/ppdev.h", "PPGETTIME", _IOC_READ, 0x7095, 0x08 },
+{ "linux/ppdev.h", "PPNEGOT", _IOC_WRITE, 0x7091, 0x04 },
+{ "linux/ppdev.h", "PPRCONTROL", _IOC_READ, 0x7083, 0x01 },
+{ "linux/ppdev.h", "PPRDATA", _IOC_READ, 0x7085, 0x01 },
+{ "linux/ppdev.h", "PPRELEASE", _IOC_NONE, 0x708c, 0x00 },
+{ "linux/ppdev.h", "PPRSTATUS", _IOC_READ, 0x7081, 0x01 },
+{ "linux/ppdev.h", "PPSETFLAGS", _IOC_WRITE, 0x709b, 0x04 },
+{ "linux/ppdev.h", "PPSETMODE", _IOC_WRITE, 0x7080, 0x04 },
+{ "linux/ppdev.h", "PPSETPHASE", _IOC_WRITE, 0x7094, 0x04 },
+{ "linux/ppdev.h", "PPSETTIME", _IOC_WRITE, 0x7096, 0x08 },
+{ "linux/ppdev.h", "PPWCONTROL", _IOC_WRITE, 0x7084, 0x01 },
+{ "linux/ppdev.h", "PPWCTLONIRQ", _IOC_WRITE, 0x7092, 0x01 },
+{ "linux/ppdev.h", "PPWDATA", _IOC_WRITE, 0x7086, 0x01 },
+{ "linux/ppdev.h", "PPYIELD", _IOC_NONE, 0x708d, 0x00 },
+{ "linux/ppp-ioctl.h", "PPPIOCATTACH", _IOC_WRITE, 0x743d, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCATTCHAN", _IOC_WRITE, 0x7438, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCCONNECT", _IOC_WRITE, 0x743a, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCDETACH", _IOC_WRITE, 0x743c, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCDISCONN", _IOC_NONE, 0x7439, 0x00 },
+{ "linux/ppp-ioctl.h", "PPPIOCGASYNCMAP", _IOC_READ, 0x7458, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCGCHAN", _IOC_READ, 0x7437, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCGDEBUG", _IOC_READ, 0x7441, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCGFLAGS", _IOC_READ, 0x745a, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCGIDLE32", _IOC_READ, 0x743f, 0x08 },
+{ "linux/ppp-ioctl.h", "PPPIOCGIDLE64", _IOC_READ, 0x743f, 0x10 },
+{ "linux/ppp-ioctl.h", "PPPIOCGL2TPSTATS", _IOC_READ, 0x7436, 0x48 },
+{ "linux/ppp-ioctl.h", "PPPIOCGMRU", _IOC_READ, 0x7453, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCGNPMODE", _IOC_READ|_IOC_WRITE, 0x744c, 0x08 },
+{ "linux/ppp-ioctl.h", "PPPIOCGRASYNCMAP", _IOC_READ, 0x7455, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCGUNIT", _IOC_READ, 0x7456, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCGXASYNCMAP", _IOC_READ, 0x7450, 0x20 },
+{ "linux/ppp-ioctl.h", "PPPIOCNEWUNIT", _IOC_READ|_IOC_WRITE, 0x743e, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCSACTIVE", _IOC_WRITE, 0x7446, 0x08 },
+{ "linux/ppp-ioctl.h", "PPPIOCSASYNCMAP", _IOC_WRITE, 0x7457, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCSCOMPRESS", _IOC_WRITE, 0x744d, 0x0c },
+{ "linux/ppp-ioctl.h", "PPPIOCSDEBUG", _IOC_WRITE, 0x7440, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCSFLAGS", _IOC_WRITE, 0x7459, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCSMAXCID", _IOC_WRITE, 0x7451, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCSMRRU", _IOC_WRITE, 0x743b, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCSMRU", _IOC_WRITE, 0x7452, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCSNPMODE", _IOC_WRITE, 0x744b, 0x08 },
+{ "linux/ppp-ioctl.h", "PPPIOCSPASS", _IOC_WRITE, 0x7447, 0x08 },
+{ "linux/ppp-ioctl.h", "PPPIOCSRASYNCMAP", _IOC_WRITE, 0x7454, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCSXASYNCMAP", _IOC_WRITE, 0x744f, 0x20 },
+{ "linux/ppp-ioctl.h", "PPPIOCXFERUNIT", _IOC_NONE, 0x744e, 0x00 },
+{ "linux/pps.h", "PPS_FETCH", _IOC_READ|_IOC_WRITE, 0x70a4, 0x04 },
+{ "linux/pps.h", "PPS_GETCAP", _IOC_READ, 0x70a3, 0x04 },
+{ "linux/pps.h", "PPS_GETPARAMS", _IOC_READ, 0x70a1, 0x04 },
+{ "linux/pps.h", "PPS_KC_BIND", _IOC_WRITE, 0x70a5, 0x04 },
+{ "linux/pps.h", "PPS_SETPARAMS", _IOC_WRITE, 0x70a2, 0x04 },
+{ "linux/pr.h", "IOC_PR_CLEAR", _IOC_WRITE, 0x70cd, 0x10 },
+{ "linux/pr.h", "IOC_PR_PREEMPT", _IOC_WRITE, 0x70cb, 0x18 },
+{ "linux/pr.h", "IOC_PR_PREEMPT_ABORT", _IOC_WRITE, 0x70cc, 0x18 },
+{ "linux/pr.h", "IOC_PR_REGISTER", _IOC_WRITE, 0x70c8, 0x18 },
+{ "linux/pr.h", "IOC_PR_RELEASE", _IOC_WRITE, 0x70ca, 0x10 },
+{ "linux/pr.h", "IOC_PR_RESERVE", _IOC_WRITE, 0x70c9, 0x10 },
+{ "linux/psp-sev.h", "SEV_ISSUE_CMD", _IOC_READ|_IOC_WRITE, 0x5300, 0x10 },
+{ "linux/ptp_clock.h", "PTP_CLOCK_GETCAPS", _IOC_READ, 0x3d01, 0x50 },
+{ "linux/ptp_clock.h", "PTP_CLOCK_GETCAPS2", _IOC_READ, 0x3d0a, 0x50 },
+{ "linux/ptp_clock.h", "PTP_ENABLE_PPS", _IOC_WRITE, 0x3d04, 0x04 },
+{ "linux/ptp_clock.h", "PTP_ENABLE_PPS2", _IOC_WRITE, 0x3d0d, 0x04 },
+{ "linux/ptp_clock.h", "PTP_EXTTS_REQUEST", _IOC_WRITE, 0x3d02, 0x10 },
+{ "linux/ptp_clock.h", "PTP_EXTTS_REQUEST2", _IOC_WRITE, 0x3d0b, 0x10 },
+{ "linux/ptp_clock.h", "PTP_PEROUT_REQUEST", _IOC_WRITE, 0x3d03, 0x38 },
+{ "linux/ptp_clock.h", "PTP_PEROUT_REQUEST2", _IOC_WRITE, 0x3d0c, 0x38 },
+{ "linux/ptp_clock.h", "PTP_PIN_GETFUNC", _IOC_READ|_IOC_WRITE, 0x3d06, 0x60 },
+{ "linux/ptp_clock.h", "PTP_PIN_GETFUNC2", _IOC_READ|_IOC_WRITE, 0x3d0f, 0x60 },
+{ "linux/ptp_clock.h", "PTP_PIN_SETFUNC", _IOC_WRITE, 0x3d07, 0x60 },
+{ "linux/ptp_clock.h", "PTP_PIN_SETFUNC2", _IOC_WRITE, 0x3d10, 0x60 },
+{ "linux/ptp_clock.h", "PTP_SYS_OFFSET", _IOC_WRITE, 0x3d05, 0x340 },
+{ "linux/ptp_clock.h", "PTP_SYS_OFFSET2", _IOC_WRITE, 0x3d0e, 0x340 },
+{ "linux/ptp_clock.h", "PTP_SYS_OFFSET_EXTENDED", _IOC_READ|_IOC_WRITE, 0x3d09, 0x4c0 },
+{ "linux/ptp_clock.h", "PTP_SYS_OFFSET_EXTENDED2", _IOC_READ|_IOC_WRITE, 0x3d12, 0x4c0 },
+{ "linux/ptp_clock.h", "PTP_SYS_OFFSET_PRECISE", _IOC_READ|_IOC_WRITE, 0x3d08, 0x40 },
+{ "linux/ptp_clock.h", "PTP_SYS_OFFSET_PRECISE2", _IOC_READ|_IOC_WRITE, 0x3d11, 0x40 },
+{ "linux/radeonfb.h", "FBIO_RADEON_GET_MIRROR", _IOC_READ, 0x4003, 0x04 },
+{ "linux/radeonfb.h", "FBIO_RADEON_SET_MIRROR", _IOC_WRITE, 0x4004, 0x04 },
+{ "linux/raid/md_u.h", "ADD_NEW_DISK", _IOC_WRITE, 0x0921, 0x14 },
+{ "linux/raid/md_u.h", "CLEAR_ARRAY", _IOC_NONE, 0x0920, 0x00 },
+{ "linux/raid/md_u.h", "CLUSTERED_DISK_NACK", _IOC_NONE, 0x0935, 0x00 },
+{ "linux/raid/md_u.h", "GET_ARRAY_INFO", _IOC_READ, 0x0911, 0x48 },
+{ "linux/raid/md_u.h", "GET_BITMAP_FILE", _IOC_READ, 0x0915, 0x1000 },
+{ "linux/raid/md_u.h", "GET_DISK_INFO", _IOC_READ, 0x0912, 0x14 },
+{ "linux/raid/md_u.h", "HOT_ADD_DISK", _IOC_NONE, 0x0928, 0x00 },
+{ "linux/raid/md_u.h", "HOT_GENERATE_ERROR", _IOC_NONE, 0x092a, 0x00 },
+{ "linux/raid/md_u.h", "HOT_REMOVE_DISK", _IOC_NONE, 0x0922, 0x00 },
+{ "linux/raid/md_u.h", "PROTECT_ARRAY", _IOC_NONE, 0x0927, 0x00 },
+{ "linux/raid/md_u.h", "RAID_AUTORUN", _IOC_NONE, 0x0914, 0x00 },
+{ "linux/raid/md_u.h", "RAID_VERSION", _IOC_READ, 0x0910, 0x0c },
+{ "linux/raid/md_u.h", "RESTART_ARRAY_RW", _IOC_NONE, 0x0934, 0x00 },
+{ "linux/raid/md_u.h", "RUN_ARRAY", _IOC_WRITE, 0x0930, 0x0c },
+{ "linux/raid/md_u.h", "SET_ARRAY_INFO", _IOC_WRITE, 0x0923, 0x48 },
+{ "linux/raid/md_u.h", "SET_BITMAP_FILE", _IOC_WRITE, 0x092b, 0x04 },
+{ "linux/raid/md_u.h", "SET_DISK_FAULTY", _IOC_NONE, 0x0929, 0x00 },
+{ "linux/raid/md_u.h", "SET_DISK_INFO", _IOC_NONE, 0x0924, 0x00 },
+{ "linux/raid/md_u.h", "STOP_ARRAY", _IOC_NONE, 0x0932, 0x00 },
+{ "linux/raid/md_u.h", "STOP_ARRAY_RO", _IOC_NONE, 0x0933, 0x00 },
+{ "linux/raid/md_u.h", "UNPROTECT_ARRAY", _IOC_NONE, 0x0926, 0x00 },
+{ "linux/raid/md_u.h", "WRITE_RAID_INFO", _IOC_NONE, 0x0925, 0x00 },
+{ "linux/random.h", "RNDADDENTROPY", _IOC_WRITE, 0x5203, 0x08 },
+{ "linux/random.h", "RNDADDTOENTCNT", _IOC_WRITE, 0x5201, 0x04 },
+{ "linux/random.h", "RNDCLEARPOOL", _IOC_NONE, 0x5206, 0x00 },
+{ "linux/random.h", "RNDGETENTCNT", _IOC_READ, 0x5200, 0x04 },
+{ "linux/random.h", "RNDGETPOOL", _IOC_READ, 0x5202, 0x08 },
+{ "linux/random.h", "RNDRESEEDCRNG", _IOC_NONE, 0x5207, 0x00 },
+{ "linux/random.h", "RNDZAPENTCNT", _IOC_NONE, 0x5204, 0x00 },
+{ "linux/raw.h", "RAW_GETBIND", _IOC_NONE, 0xac01, 0x00 },
+{ "linux/raw.h", "RAW_SETBIND", _IOC_NONE, 0xac00, 0x00 },
+{ "linux/reiserfs_fs.h", "REISERFS_IOC_UNPACK", _IOC_WRITE, 0xcd01, 0x04 },
+{ "linux/remoteproc_cdev.h", "RPROC_GET_SHUTDOWN_ON_RELEASE", _IOC_READ, 0xb702, 0x04 },
+{ "linux/remoteproc_cdev.h", "RPROC_SET_SHUTDOWN_ON_RELEASE", _IOC_WRITE, 0xb701, 0x04 },
+{ "linux/rfkill.h", "RFKILL_IOCTL_NOINPUT", _IOC_NONE, 0x5201, 0x00 },
+{ "linux/rio_cm_cdev.h", "RIO_CM_CHAN_ACCEPT", _IOC_READ|_IOC_WRITE, 0x6307, 0x08 },
+{ "linux/rio_cm_cdev.h", "RIO_CM_CHAN_BIND", _IOC_WRITE, 0x6305, 0x08 },
+{ "linux/rio_cm_cdev.h", "RIO_CM_CHAN_CLOSE", _IOC_WRITE, 0x6304, 0x02 },
+{ "linux/rio_cm_cdev.h", "RIO_CM_CHAN_CONNECT", _IOC_WRITE, 0x6308, 0x08 },
+{ "linux/rio_cm_cdev.h", "RIO_CM_CHAN_CREATE", _IOC_READ|_IOC_WRITE, 0x6303, 0x02 },
+{ "linux/rio_cm_cdev.h", "RIO_CM_CHAN_LISTEN", _IOC_WRITE, 0x6306, 0x02 },
+{ "linux/rio_cm_cdev.h", "RIO_CM_CHAN_RECEIVE", _IOC_READ|_IOC_WRITE, 0x630a, 0x10 },
+{ "linux/rio_cm_cdev.h", "RIO_CM_CHAN_SEND", _IOC_WRITE, 0x6309, 0x10 },
+{ "linux/rio_cm_cdev.h", "RIO_CM_EP_GET_LIST", _IOC_READ|_IOC_WRITE, 0x6302, 0x04 },
+{ "linux/rio_cm_cdev.h", "RIO_CM_EP_GET_LIST_SIZE", _IOC_READ|_IOC_WRITE, 0x6301, 0x04 },
+{ "linux/rio_cm_cdev.h", "RIO_CM_MPORT_GET_LIST", _IOC_READ|_IOC_WRITE, 0x630b, 0x04 },
+{ "linux/rio_mport_cdev.h", "RIO_ALLOC_DMA", _IOC_READ|_IOC_WRITE, 0x6d13, 0x18 },
+{ "linux/rio_mport_cdev.h", "RIO_DEV_ADD", _IOC_WRITE, 0x6d17, 0x20 },
+{ "linux/rio_mport_cdev.h", "RIO_DEV_DEL", _IOC_WRITE, 0x6d18, 0x20 },
+{ "linux/rio_mport_cdev.h", "RIO_DISABLE_DOORBELL_RANGE", _IOC_WRITE, 0x6d0a, 0x08 },
+{ "linux/rio_mport_cdev.h", "RIO_DISABLE_PORTWRITE_RANGE", _IOC_WRITE, 0x6d0c, 0x10 },
+{ "linux/rio_mport_cdev.h", "RIO_ENABLE_DOORBELL_RANGE", _IOC_WRITE, 0x6d09, 0x08 },
+{ "linux/rio_mport_cdev.h", "RIO_ENABLE_PORTWRITE_RANGE", _IOC_WRITE, 0x6d0b, 0x10 },
+{ "linux/rio_mport_cdev.h", "RIO_FREE_DMA", _IOC_WRITE, 0x6d14, 0x08 },
+{ "linux/rio_mport_cdev.h", "RIO_GET_EVENT_MASK", _IOC_READ, 0x6d0e, 0x04 },
+{ "linux/rio_mport_cdev.h", "RIO_MAP_INBOUND", _IOC_READ|_IOC_WRITE, 0x6d11, 0x28 },
+{ "linux/rio_mport_cdev.h", "RIO_MAP_OUTBOUND", _IOC_READ|_IOC_WRITE, 0x6d0f, 0x28 },
+{ "linux/rio_mport_cdev.h", "RIO_MPORT_GET_PROPERTIES", _IOC_READ, 0x6d04, 0x30 },
+{ "linux/rio_mport_cdev.h", "RIO_MPORT_MAINT_COMPTAG_SET", _IOC_WRITE, 0x6d02, 0x04 },
+{ "linux/rio_mport_cdev.h", "RIO_MPORT_MAINT_HDID_SET", _IOC_WRITE, 0x6d01, 0x02 },
+{ "linux/rio_mport_cdev.h", "RIO_MPORT_MAINT_PORT_IDX_GET", _IOC_READ, 0x6d03, 0x04 },
+{ "linux/rio_mport_cdev.h", "RIO_MPORT_MAINT_READ_LOCAL", _IOC_READ, 0x6d05, 0x18 },
+{ "linux/rio_mport_cdev.h", "RIO_MPORT_MAINT_READ_REMOTE", _IOC_READ, 0x6d07, 0x18 },
+{ "linux/rio_mport_cdev.h", "RIO_MPORT_MAINT_WRITE_LOCAL", _IOC_WRITE, 0x6d06, 0x18 },
+{ "linux/rio_mport_cdev.h", "RIO_MPORT_MAINT_WRITE_REMOTE", _IOC_WRITE, 0x6d08, 0x18 },
+{ "linux/rio_mport_cdev.h", "RIO_SET_EVENT_MASK", _IOC_WRITE, 0x6d0d, 0x04 },
+{ "linux/rio_mport_cdev.h", "RIO_TRANSFER", _IOC_READ|_IOC_WRITE, 0x6d15, 0x18 },
+{ "linux/rio_mport_cdev.h", "RIO_UNMAP_INBOUND", _IOC_WRITE, 0x6d12, 0x08 },
+{ "linux/rio_mport_cdev.h", "RIO_UNMAP_OUTBOUND", _IOC_WRITE, 0x6d10, 0x28 },
+{ "linux/rio_mport_cdev.h", "RIO_WAIT_FOR_ASYNC", _IOC_WRITE, 0x6d16, 0x08 },
+{ "linux/rpmsg.h", "RPMSG_CREATE_EPT_IOCTL", _IOC_WRITE, 0xb501, 0x28 },
+{ "linux/rpmsg.h", "RPMSG_DESTROY_EPT_IOCTL", _IOC_NONE, 0xb502, 0x00 },
+{ "linux/rtc.h", "RTC_AIE_OFF", _IOC_NONE, 0x7002, 0x00 },
+{ "linux/rtc.h", "RTC_AIE_ON", _IOC_NONE, 0x7001, 0x00 },
+{ "linux/rtc.h", "RTC_ALM_READ", _IOC_READ, 0x7008, 0x24 },
+{ "linux/rtc.h", "RTC_ALM_SET", _IOC_WRITE, 0x7007, 0x24 },
+{ "linux/rtc.h", "RTC_EPOCH_READ", _IOC_READ, 0x700d, 0x04 },
+{ "linux/rtc.h", "RTC_EPOCH_SET", _IOC_WRITE, 0x700e, 0x04 },
+{ "linux/rtc.h", "RTC_IRQP_READ", _IOC_READ, 0x700b, 0x04 },
+{ "linux/rtc.h", "RTC_IRQP_SET", _IOC_WRITE, 0x700c, 0x04 },
+{ "linux/rtc.h", "RTC_PIE_OFF", _IOC_NONE, 0x7006, 0x00 },
+{ "linux/rtc.h", "RTC_PIE_ON", _IOC_NONE, 0x7005, 0x00 },
+{ "linux/rtc.h", "RTC_PLL_GET", _IOC_READ, 0x7011, 0x1c },
+{ "linux/rtc.h", "RTC_PLL_SET", _IOC_WRITE, 0x7012, 0x1c },
+{ "linux/rtc.h", "RTC_RD_TIME", _IOC_READ, 0x7009, 0x24 },
+{ "linux/rtc.h", "RTC_SET_TIME", _IOC_WRITE, 0x700a, 0x24 },
+{ "linux/rtc.h", "RTC_UIE_OFF", _IOC_NONE, 0x7004, 0x00 },
+{ "linux/rtc.h", "RTC_UIE_ON", _IOC_NONE, 0x7003, 0x00 },
+{ "linux/rtc.h", "RTC_VL_CLR", _IOC_NONE, 0x7014, 0x00 },
+{ "linux/rtc.h", "RTC_VL_READ", _IOC_READ, 0x7013, 0x04 },
+{ "linux/rtc.h", "RTC_WIE_OFF", _IOC_NONE, 0x7010, 0x00 },
+{ "linux/rtc.h", "RTC_WIE_ON", _IOC_NONE, 0x700f, 0x00 },
+{ "linux/rtc.h", "RTC_WKALM_RD", _IOC_READ, 0x7010, 0x28 },
+{ "linux/rtc.h", "RTC_WKALM_SET", _IOC_WRITE, 0x700f, 0x28 },
+{ "linux/scif_ioctl.h", "SCIF_ACCEPTREG", _IOC_READ|_IOC_WRITE, 0x7305, 0x08 },
+{ "linux/scif_ioctl.h", "SCIF_ACCEPTREQ", _IOC_READ|_IOC_WRITE, 0x7304, 0x10 },
+{ "linux/scif_ioctl.h", "SCIF_BIND", _IOC_READ|_IOC_WRITE, 0x7301, 0x08 },
+{ "linux/scif_ioctl.h", "SCIF_CONNECT", _IOC_READ|_IOC_WRITE, 0x7303, 0x08 },
+{ "linux/scif_ioctl.h", "SCIF_FENCE_MARK", _IOC_READ|_IOC_WRITE, 0x730f, 0x0c },
+{ "linux/scif_ioctl.h", "SCIF_FENCE_SIGNAL", _IOC_READ|_IOC_WRITE, 0x7311, 0x24 },
+{ "linux/scif_ioctl.h", "SCIF_FENCE_WAIT", _IOC_READ|_IOC_WRITE, 0x7310, 0x04 },
+{ "linux/scif_ioctl.h", "SCIF_GET_NODEIDS", _IOC_READ|_IOC_WRITE, 0x730e, 0x14 },
+{ "linux/scif_ioctl.h", "SCIF_LISTEN", _IOC_WRITE, 0x7302, 0x04 },
+{ "linux/scif_ioctl.h", "SCIF_READFROM", _IOC_READ|_IOC_WRITE, 0x730a, 0x24 },
+{ "linux/scif_ioctl.h", "SCIF_RECV", _IOC_READ|_IOC_WRITE, 0x7307, 0x14 },
+{ "linux/scif_ioctl.h", "SCIF_REG", _IOC_READ|_IOC_WRITE, 0x7308, 0x28 },
+{ "linux/scif_ioctl.h", "SCIF_SEND", _IOC_READ|_IOC_WRITE, 0x7306, 0x14 },
+{ "linux/scif_ioctl.h", "SCIF_UNREG", _IOC_READ|_IOC_WRITE, 0x7309, 0x10 },
+{ "linux/scif_ioctl.h", "SCIF_VREADFROM", _IOC_READ|_IOC_WRITE, 0x730c, 0x24 },
+{ "linux/scif_ioctl.h", "SCIF_VWRITETO", _IOC_READ|_IOC_WRITE, 0x730d, 0x24 },
+{ "linux/scif_ioctl.h", "SCIF_WRITETO", _IOC_READ|_IOC_WRITE, 0x730b, 0x24 },
+{ "linux/seccomp.h", "SECCOMP_IOCTL_NOTIF_ADDFD", _IOC_WRITE, 0x2103, 0x18 },
+{ "linux/seccomp.h", "SECCOMP_IOCTL_NOTIF_ID_VALID", _IOC_WRITE, 0x2102, 0x08 },
+{ "linux/seccomp.h", "SECCOMP_IOCTL_NOTIF_RECV", _IOC_READ|_IOC_WRITE, 0x2100, 0x50 },
+{ "linux/seccomp.h", "SECCOMP_IOCTL_NOTIF_SEND", _IOC_READ|_IOC_WRITE, 0x2101, 0x18 },
+{ "linux/sed-opal.h", "IOC_OPAL_ACTIVATE_LSP", _IOC_WRITE, 0x70df, 0x118 },
+{ "linux/sed-opal.h", "IOC_OPAL_ACTIVATE_USR", _IOC_WRITE, 0x70e1, 0x110 },
+{ "linux/sed-opal.h", "IOC_OPAL_ADD_USR_TO_LR", _IOC_WRITE, 0x70e4, 0x118 },
+{ "linux/sed-opal.h", "IOC_OPAL_ENABLE_DISABLE_MBR", _IOC_WRITE, 0x70e5, 0x110 },
+{ "linux/sed-opal.h", "IOC_OPAL_ERASE_LR", _IOC_WRITE, 0x70e6, 0x110 },
+{ "linux/sed-opal.h", "IOC_OPAL_GENERIC_TABLE_RW", _IOC_WRITE, 0x70eb, 0x138 },
+{ "linux/sed-opal.h", "IOC_OPAL_LOCK_UNLOCK", _IOC_WRITE, 0x70dd, 0x118 },
+{ "linux/sed-opal.h", "IOC_OPAL_LR_SETUP", _IOC_WRITE, 0x70e3, 0x128 },
+{ "linux/sed-opal.h", "IOC_OPAL_MBR_DONE", _IOC_WRITE, 0x70e9, 0x110 },
+{ "linux/sed-opal.h", "IOC_OPAL_PSID_REVERT_TPR", _IOC_WRITE, 0x70e8, 0x108 },
+{ "linux/sed-opal.h", "IOC_OPAL_REVERT_TPR", _IOC_WRITE, 0x70e2, 0x108 },
+{ "linux/sed-opal.h", "IOC_OPAL_SAVE", _IOC_WRITE, 0x70dc, 0x118 },
+{ "linux/sed-opal.h", "IOC_OPAL_SECURE_ERASE_LR", _IOC_WRITE, 0x70e7, 0x110 },
+{ "linux/sed-opal.h", "IOC_OPAL_SET_PW", _IOC_WRITE, 0x70e0, 0x220 },
+{ "linux/sed-opal.h", "IOC_OPAL_TAKE_OWNERSHIP", _IOC_WRITE, 0x70de, 0x108 },
+{ "linux/sed-opal.h", "IOC_OPAL_WRITE_SHADOW_MBR", _IOC_WRITE, 0x70ea, 0x120 },
+{ "linux/serio.h", "SPIOCSTYPE", _IOC_WRITE, 0x7101, 0x04 },
+{ "linux/sockios.h", "SIOCADDDLCI", 0, 0x8980, 0 },
+{ "linux/sockios.h", "SIOCADDMULTI", 0, 0x8931, 0 },
+{ "linux/sockios.h", "SIOCADDRT", 0, 0x890B, 0 },
+{ "linux/sockios.h", "SIOCBONDCHANGEACTIVE", 0, 0x8995, 0 },
+{ "linux/sockios.h", "SIOCBONDENSLAVE", 0, 0x8990, 0 },
+{ "linux/sockios.h", "SIOCBONDINFOQUERY", 0, 0x8994, 0 },
+{ "linux/sockios.h", "SIOCBONDRELEASE", 0, 0x8991, 0 },
+{ "linux/sockios.h", "SIOCBONDSETHWADDR", 0, 0x8992, 0 },
+{ "linux/sockios.h", "SIOCBONDSLAVEINFOQUERY", 0, 0x8993, 0 },
+{ "linux/sockios.h", "SIOCBRADDBR", 0, 0x89a0, 0 },
+{ "linux/sockios.h", "SIOCBRADDIF", 0, 0x89a2, 0 },
+{ "linux/sockios.h", "SIOCBRDELBR", 0, 0x89a1, 0 },
+{ "linux/sockios.h", "SIOCBRDELIF", 0, 0x89a3, 0 },
+{ "linux/sockios.h", "SIOCDARP", 0, 0x8953, 0 },
+{ "linux/sockios.h", "SIOCDELDLCI", 0, 0x8981, 0 },
+{ "linux/sockios.h", "SIOCDELMULTI", 0, 0x8932, 0 },
+{ "linux/sockios.h", "SIOCDELRT", 0, 0x890C, 0 },
+{ "linux/sockios.h", "SIOCDEVPRIVATE", 0, 0x89F0, 0 },
+{ "linux/sockios.h", "SIOCDIFADDR", 0, 0x8936, 0 },
+{ "linux/sockios.h", "SIOCDRARP", 0, 0x8960, 0 },
+{ "linux/sockios.h", "SIOCETHTOOL", 0, 0x8946, 0 },
+{ "linux/sockios.h", "SIOCGARP", 0, 0x8954, 0 },
+{ "linux/sockios.h", "SIOCGHWTSTAMP", 0, 0x89b1, 0 },
+{ "linux/sockios.h", "SIOCGIFADDR", 0, 0x8915, 0 },
+{ "linux/sockios.h", "SIOCGIFBR", 0, 0x8940, 0 },
+{ "linux/sockios.h", "SIOCGIFBRDADDR", 0, 0x8919, 0 },
+{ "linux/sockios.h", "SIOCGIFCONF", 0, 0x8912, 0 },
+{ "linux/sockios.h", "SIOCGIFCOUNT", 0, 0x8938, 0 },
+{ "linux/sockios.h", "SIOCGIFDSTADDR", 0, 0x8917, 0 },
+{ "linux/sockios.h", "SIOCGIFENCAP", 0, 0x8925, 0 },
+{ "linux/sockios.h", "SIOCGIFFLAGS", 0, 0x8913, 0 },
+{ "linux/sockios.h", "SIOCGIFHWADDR", 0, 0x8927, 0 },
+{ "linux/sockios.h", "SIOCGIFINDEX", 0, 0x8933, 0 },
+{ "linux/sockios.h", "SIOCGIFMAP", 0, 0x8970, 0 },
+{ "linux/sockios.h", "SIOCGIFMEM", 0, 0x891f, 0 },
+{ "linux/sockios.h", "SIOCGIFMETRIC", 0, 0x891d, 0 },
+{ "linux/sockios.h", "SIOCGIFMTU", 0, 0x8921, 0 },
+{ "linux/sockios.h", "SIOCGIFNAME", 0, 0x8910, 0 },
+{ "linux/sockios.h", "SIOCGIFNETMASK", 0, 0x891b, 0 },
+{ "linux/sockios.h", "SIOCGIFPFLAGS", 0, 0x8935, 0 },
+{ "linux/sockios.h", "SIOCGIFSLAVE", 0, 0x8929, 0 },
+{ "linux/sockios.h", "SIOCGIFTXQLEN", 0, 0x8942, 0 },
+{ "linux/sockios.h", "SIOCGIFVLAN", 0, 0x8982, 0 },
+{ "linux/sockios.h", "SIOCGMIIPHY", 0, 0x8947, 0 },
+{ "linux/sockios.h", "SIOCGMIIREG", 0, 0x8948, 0 },
+{ "linux/sockios.h", "SIOCGRARP", 0, 0x8961, 0 },
+{ "linux/sockios.h", "SIOCGSKNS", 0, 0x894C, 0 },
+{ "linux/sockios.h", "SIOCGSTAMPNS_NEW", _IOC_READ, 0x8907, 0x10 },
+{ "linux/sockios.h", "SIOCGSTAMP_NEW", _IOC_READ, 0x8906, 0x10 },
+{ "linux/sockios.h", "SIOCOUTQNSD", 0, 0x894B, 0 },
+{ "linux/sockios.h", "SIOCPROTOPRIVATE", 0, 0x89E0, 0 },
+{ "linux/sockios.h", "SIOCRTMSG", 0, 0x890D, 0 },
+{ "linux/sockios.h", "SIOCSARP", 0, 0x8955, 0 },
+{ "linux/sockios.h", "SIOCSHWTSTAMP", 0, 0x89b0, 0 },
+{ "linux/sockios.h", "SIOCSIFADDR", 0, 0x8916, 0 },
+{ "linux/sockios.h", "SIOCSIFBR", 0, 0x8941, 0 },
+{ "linux/sockios.h", "SIOCSIFBRDADDR", 0, 0x891a, 0 },
+{ "linux/sockios.h", "SIOCSIFDSTADDR", 0, 0x8918, 0 },
+{ "linux/sockios.h", "SIOCSIFENCAP", 0, 0x8926, 0 },
+{ "linux/sockios.h", "SIOCSIFFLAGS", 0, 0x8914, 0 },
+{ "linux/sockios.h", "SIOCSIFHWADDR", 0, 0x8924, 0 },
+{ "linux/sockios.h", "SIOCSIFHWBROADCAST", 0, 0x8937, 0 },
+{ "linux/sockios.h", "SIOCSIFLINK", 0, 0x8911, 0 },
+{ "linux/sockios.h", "SIOCSIFMAP", 0, 0x8971, 0 },
+{ "linux/sockios.h", "SIOCSIFMEM", 0, 0x8920, 0 },
+{ "linux/sockios.h", "SIOCSIFMETRIC", 0, 0x891e, 0 },
+{ "linux/sockios.h", "SIOCSIFMTU", 0, 0x8922, 0 },
+{ "linux/sockios.h", "SIOCSIFNAME", 0, 0x8923, 0 },
+{ "linux/sockios.h", "SIOCSIFNETMASK", 0, 0x891c, 0 },
+{ "linux/sockios.h", "SIOCSIFPFLAGS", 0, 0x8934, 0 },
+{ "linux/sockios.h", "SIOCSIFSLAVE", 0, 0x8930, 0 },
+{ "linux/sockios.h", "SIOCSIFTXQLEN", 0, 0x8943, 0 },
+{ "linux/sockios.h", "SIOCSIFVLAN", 0, 0x8983, 0 },
+{ "linux/sockios.h", "SIOCSMIIREG", 0, 0x8949, 0 },
+{ "linux/sockios.h", "SIOCSRARP", 0, 0x8962, 0 },
+{ "linux/sockios.h", "SIOCWANDEV", 0, 0x894A, 0 },
+{ "linux/sonet.h", "SONET_CLRDIAG", _IOC_READ|_IOC_WRITE, 0x6113, 0x04 },
+{ "linux/sonet.h", "SONET_GETDIAG", _IOC_READ, 0x6114, 0x04 },
+{ "linux/sonet.h", "SONET_GETFRAMING", _IOC_READ, 0x6116, 0x04 },
+{ "linux/sonet.h", "SONET_GETFRSENSE", _IOC_READ, 0x6117, 0x06 },
+{ "linux/sonet.h", "SONET_GETSTAT", _IOC_READ, 0x6110, 0x24 },
+{ "linux/sonet.h", "SONET_GETSTATZ", _IOC_READ, 0x6111, 0x24 },
+{ "linux/sonet.h", "SONET_SETDIAG", _IOC_READ|_IOC_WRITE, 0x6112, 0x04 },
+{ "linux/sonet.h", "SONET_SETFRAMING", _IOC_WRITE, 0x6115, 0x04 },
+{ "linux/sonypi.h", "SONYPI_IOCGBAT1CAP", _IOC_READ, 0x7602, 0x02 },
+{ "linux/sonypi.h", "SONYPI_IOCGBAT1REM", _IOC_READ, 0x7603, 0x02 },
+{ "linux/sonypi.h", "SONYPI_IOCGBAT2CAP", _IOC_READ, 0x7604, 0x02 },
+{ "linux/sonypi.h", "SONYPI_IOCGBAT2REM", _IOC_READ, 0x7605, 0x02 },
+{ "linux/sonypi.h", "SONYPI_IOCGBATFLAGS", _IOC_READ, 0x7607, 0x01 },
+{ "linux/sonypi.h", "SONYPI_IOCGBLUE", _IOC_READ, 0x7608, 0x01 },
+{ "linux/sonypi.h", "SONYPI_IOCGBRT", _IOC_READ, 0x7600, 0x01 },
+{ "linux/sonypi.h", "SONYPI_IOCGFAN", _IOC_READ, 0x760a, 0x01 },
+{ "linux/sonypi.h", "SONYPI_IOCGTEMP", _IOC_READ, 0x760c, 0x01 },
+{ "linux/sonypi.h", "SONYPI_IOCSBLUE", _IOC_WRITE, 0x7609, 0x01 },
+{ "linux/sonypi.h", "SONYPI_IOCSBRT", _IOC_WRITE, 0x7600, 0x01 },
+{ "linux/sonypi.h", "SONYPI_IOCSFAN", _IOC_WRITE, 0x760b, 0x01 },
+{ "linux/soundcard.h", "OSS_GETVERSION", _IOC_READ, 0x4d76, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_COPR_HALT", _IOC_READ|_IOC_WRITE, 0x4307, 0x14 },
+{ "linux/soundcard.h", "SNDCTL_COPR_LOAD", _IOC_READ|_IOC_WRITE, 0x4301, 0xfb0 },
+{ "linux/soundcard.h", "SNDCTL_COPR_RCODE", _IOC_READ|_IOC_WRITE, 0x4303, 0x14 },
+{ "linux/soundcard.h", "SNDCTL_COPR_RCVMSG", _IOC_READ, 0x4309, 0xfa4 },
+{ "linux/soundcard.h", "SNDCTL_COPR_RDATA", _IOC_READ|_IOC_WRITE, 0x4302, 0x14 },
+{ "linux/soundcard.h", "SNDCTL_COPR_RESET", _IOC_NONE, 0x4300, 0x00 },
+{ "linux/soundcard.h", "SNDCTL_COPR_RUN", _IOC_READ|_IOC_WRITE, 0x4306, 0x14 },
+{ "linux/soundcard.h", "SNDCTL_COPR_SENDMSG", _IOC_READ|_IOC_WRITE, 0x4308, 0xfa4 },
+{ "linux/soundcard.h", "SNDCTL_COPR_WCODE", _IOC_WRITE, 0x4305, 0x14 },
+{ "linux/soundcard.h", "SNDCTL_COPR_WDATA", _IOC_WRITE, 0x4304, 0x14 },
+{ "linux/soundcard.h", "SNDCTL_DSP_BIND_CHANNEL", _IOC_READ|_IOC_WRITE, 0x5041, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_CHANNELS", _IOC_READ|_IOC_WRITE, 0x5006, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_GETBLKSIZE", _IOC_READ|_IOC_WRITE, 0x5004, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_GETCAPS", _IOC_READ, 0x500f, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_GETCHANNELMASK", _IOC_READ|_IOC_WRITE, 0x5040, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_GETFMTS", _IOC_READ, 0x500b, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_GETIPTR", _IOC_READ, 0x5011, 0x0c },
+{ "linux/soundcard.h", "SNDCTL_DSP_GETISPACE", _IOC_READ, 0x500d, 0x10 },
+{ "linux/soundcard.h", "SNDCTL_DSP_GETODELAY", _IOC_READ, 0x5017, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_GETOPTR", _IOC_READ, 0x5012, 0x0c },
+{ "linux/soundcard.h", "SNDCTL_DSP_GETOSPACE", _IOC_READ, 0x500c, 0x10 },
+{ "linux/soundcard.h", "SNDCTL_DSP_GETSPDIF", _IOC_READ, 0x5043, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_GETTRIGGER", _IOC_READ, 0x5010, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_MAPINBUF", _IOC_READ, 0x5013, 0x08 },
+{ "linux/soundcard.h", "SNDCTL_DSP_MAPOUTBUF", _IOC_READ, 0x5014, 0x08 },
+{ "linux/soundcard.h", "SNDCTL_DSP_NONBLOCK", _IOC_NONE, 0x500e, 0x00 },
+{ "linux/soundcard.h", "SNDCTL_DSP_POST", _IOC_NONE, 0x5008, 0x00 },
+{ "linux/soundcard.h", "SNDCTL_DSP_PROFILE", _IOC_WRITE, 0x5017, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_RESET", _IOC_NONE, 0x5000, 0x00 },
+{ "linux/soundcard.h", "SNDCTL_DSP_SETDUPLEX", _IOC_NONE, 0x5016, 0x00 },
+{ "linux/soundcard.h", "SNDCTL_DSP_SETFMT", _IOC_READ|_IOC_WRITE, 0x5005, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_SETFRAGMENT", _IOC_READ|_IOC_WRITE, 0x500a, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_SETSPDIF", _IOC_WRITE, 0x5042, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_SETSYNCRO", _IOC_NONE, 0x5015, 0x00 },
+{ "linux/soundcard.h", "SNDCTL_DSP_SETTRIGGER", _IOC_WRITE, 0x5010, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_SPEED", _IOC_READ|_IOC_WRITE, 0x5002, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_STEREO", _IOC_READ|_IOC_WRITE, 0x5003, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_SUBDIVIDE", _IOC_READ|_IOC_WRITE, 0x5009, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_SYNC", _IOC_NONE, 0x5001, 0x00 },
+{ "linux/soundcard.h", "SNDCTL_FM_4OP_ENABLE", _IOC_WRITE, 0x510f, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_FM_LOAD_INSTR", _IOC_WRITE, 0x5107, 0x28 },
+{ "linux/soundcard.h", "SNDCTL_MIDI_INFO", _IOC_READ|_IOC_WRITE, 0x510c, 0x74 },
+{ "linux/soundcard.h", "SNDCTL_MIDI_MPUCMD", _IOC_READ|_IOC_WRITE, 0x6d02, 0x21 },
+{ "linux/soundcard.h", "SNDCTL_MIDI_MPUMODE", _IOC_READ|_IOC_WRITE, 0x6d01, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_MIDI_PRETIME", _IOC_READ|_IOC_WRITE, 0x6d00, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_SEQ_CTRLRATE", _IOC_READ|_IOC_WRITE, 0x5103, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_SEQ_GETINCOUNT", _IOC_READ, 0x5105, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_SEQ_GETOUTCOUNT", _IOC_READ, 0x5104, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_SEQ_GETTIME", _IOC_READ, 0x5113, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_SEQ_NRMIDIS", _IOC_READ, 0x510b, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_SEQ_NRSYNTHS", _IOC_READ, 0x510a, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_SEQ_OUTOFBAND", _IOC_WRITE, 0x5112, 0x08 },
+{ "linux/soundcard.h", "SNDCTL_SEQ_PANIC", _IOC_NONE, 0x5111, 0x00 },
+{ "linux/soundcard.h", "SNDCTL_SEQ_PERCMODE", _IOC_WRITE, 0x5106, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_SEQ_RESET", _IOC_NONE, 0x5100, 0x00 },
+{ "linux/soundcard.h", "SNDCTL_SEQ_RESETSAMPLES", _IOC_WRITE, 0x5109, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_SEQ_SYNC", _IOC_NONE, 0x5101, 0x00 },
+{ "linux/soundcard.h", "SNDCTL_SEQ_TESTMIDI", _IOC_WRITE, 0x5108, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_SEQ_THRESHOLD", _IOC_WRITE, 0x510d, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_SYNTH_CONTROL", _IOC_READ|_IOC_WRITE, 0x5115, 0xfa4 },
+{ "linux/soundcard.h", "SNDCTL_SYNTH_ID", _IOC_READ|_IOC_WRITE, 0x5114, 0x8c },
+{ "linux/soundcard.h", "SNDCTL_SYNTH_INFO", _IOC_READ|_IOC_WRITE, 0x5102, 0x8c },
+{ "linux/soundcard.h", "SNDCTL_SYNTH_MEMAVL", _IOC_READ|_IOC_WRITE, 0x510e, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_SYNTH_REMOVESAMPLE", _IOC_READ|_IOC_WRITE, 0x5116, 0x0c },
+{ "linux/soundcard.h", "SNDCTL_TMR_CONTINUE", _IOC_NONE, 0x5404, 0x00 },
+{ "linux/soundcard.h", "SNDCTL_TMR_METRONOME", _IOC_WRITE, 0x5407, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_TMR_SELECT", _IOC_WRITE, 0x5408, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_TMR_SOURCE", _IOC_READ|_IOC_WRITE, 0x5406, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_TMR_START", _IOC_NONE, 0x5402, 0x00 },
+{ "linux/soundcard.h", "SNDCTL_TMR_STOP", _IOC_NONE, 0x5403, 0x00 },
+{ "linux/soundcard.h", "SNDCTL_TMR_TEMPO", _IOC_READ|_IOC_WRITE, 0x5405, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_TMR_TIMEBASE", _IOC_READ|_IOC_WRITE, 0x5401, 0x04 },
+{ "linux/soundcard.h", "SOUND_MIXER_3DSE", _IOC_READ|_IOC_WRITE, 0x4d68, 0x04 },
+{ "linux/soundcard.h", "SOUND_MIXER_ACCESS", _IOC_READ|_IOC_WRITE, 0x4d66, 0x80 },
+{ "linux/soundcard.h", "SOUND_MIXER_AGC", _IOC_READ|_IOC_WRITE, 0x4d67, 0x04 },
+{ "linux/soundcard.h", "SOUND_MIXER_GETLEVELS", _IOC_READ|_IOC_WRITE, 0x4d74, 0xa4 },
+{ "linux/soundcard.h", "SOUND_MIXER_INFO", _IOC_READ, 0x4d65, 0x5c },
+{ "linux/soundcard.h", "SOUND_MIXER_PRIVATE1", _IOC_READ|_IOC_WRITE, 0x4d6f, 0x04 },
+{ "linux/soundcard.h", "SOUND_MIXER_PRIVATE2", _IOC_READ|_IOC_WRITE, 0x4d70, 0x04 },
+{ "linux/soundcard.h", "SOUND_MIXER_PRIVATE3", _IOC_READ|_IOC_WRITE, 0x4d71, 0x04 },
+{ "linux/soundcard.h", "SOUND_MIXER_PRIVATE4", _IOC_READ|_IOC_WRITE, 0x4d72, 0x04 },
+{ "linux/soundcard.h", "SOUND_MIXER_PRIVATE5", _IOC_READ|_IOC_WRITE, 0x4d73, 0x04 },
+{ "linux/soundcard.h", "SOUND_MIXER_SETLEVELS", _IOC_READ|_IOC_WRITE, 0x4d75, 0xa4 },
+{ "linux/soundcard.h", "SOUND_OLD_MIXER_INFO", _IOC_READ, 0x4d65, 0x30 },
+{ "linux/soundcard.h", "SOUND_PCM_READ_BITS", _IOC_READ, 0x5005, 0x04 },
+{ "linux/soundcard.h", "SOUND_PCM_READ_CHANNELS", _IOC_READ, 0x5006, 0x04 },
+{ "linux/soundcard.h", "SOUND_PCM_READ_FILTER", _IOC_READ, 0x5007, 0x04 },
+{ "linux/soundcard.h", "SOUND_PCM_READ_RATE", _IOC_READ, 0x5002, 0x04 },
+{ "linux/soundcard.h", "SOUND_PCM_WRITE_FILTER", _IOC_READ|_IOC_WRITE, 0x5007, 0x04 },
+{ "linux/spi/spidev.h", "SPI_IOC_RD_BITS_PER_WORD", _IOC_READ, 0x6b03, 0x01 },
+{ "linux/spi/spidev.h", "SPI_IOC_RD_LSB_FIRST", _IOC_READ, 0x6b02, 0x01 },
+{ "linux/spi/spidev.h", "SPI_IOC_RD_MAX_SPEED_HZ", _IOC_READ, 0x6b04, 0x04 },
+{ "linux/spi/spidev.h", "SPI_IOC_RD_MODE", _IOC_READ, 0x6b01, 0x01 },
+{ "linux/spi/spidev.h", "SPI_IOC_RD_MODE32", _IOC_READ, 0x6b05, 0x04 },
+{ "linux/spi/spidev.h", "SPI_IOC_WR_BITS_PER_WORD", _IOC_WRITE, 0x6b03, 0x01 },
+{ "linux/spi/spidev.h", "SPI_IOC_WR_LSB_FIRST", _IOC_WRITE, 0x6b02, 0x01 },
+{ "linux/spi/spidev.h", "SPI_IOC_WR_MAX_SPEED_HZ", _IOC_WRITE, 0x6b04, 0x04 },
+{ "linux/spi/spidev.h", "SPI_IOC_WR_MODE", _IOC_WRITE, 0x6b01, 0x01 },
+{ "linux/spi/spidev.h", "SPI_IOC_WR_MODE32", _IOC_WRITE, 0x6b05, 0x04 },
+{ "linux/stm.h", "STP_POLICY_ID_GET", _IOC_READ, 0x2501, 0x10 },
+{ "linux/stm.h", "STP_POLICY_ID_SET", _IOC_READ|_IOC_WRITE, 0x2500, 0x10 },
+{ "linux/stm.h", "STP_SET_OPTIONS", _IOC_WRITE, 0x2502, 0x08 },
+{ "linux/suspend_ioctls.h", "SNAPSHOT_ALLOC_SWAP_PAGE", _IOC_READ, 0x3314, 0x08 },
+{ "linux/suspend_ioctls.h", "SNAPSHOT_ATOMIC_RESTORE", _IOC_NONE, 0x3304, 0x00 },
+{ "linux/suspend_ioctls.h", "SNAPSHOT_AVAIL_SWAP_SIZE", _IOC_READ, 0x3313, 0x08 },
+{ "linux/suspend_ioctls.h", "SNAPSHOT_CREATE_IMAGE", _IOC_WRITE, 0x3311, 0x04 },
+{ "linux/suspend_ioctls.h", "SNAPSHOT_FREE", _IOC_NONE, 0x3305, 0x00 },
+{ "linux/suspend_ioctls.h", "SNAPSHOT_FREEZE", _IOC_NONE, 0x3301, 0x00 },
+{ "linux/suspend_ioctls.h", "SNAPSHOT_FREE_SWAP_PAGES", _IOC_NONE, 0x3309, 0x00 },
+{ "linux/suspend_ioctls.h", "SNAPSHOT_GET_IMAGE_SIZE", _IOC_READ, 0x330e, 0x08 },
+{ "linux/suspend_ioctls.h", "SNAPSHOT_PLATFORM_SUPPORT", _IOC_NONE, 0x330f, 0x00 },
+{ "linux/suspend_ioctls.h", "SNAPSHOT_POWER_OFF", _IOC_NONE, 0x3310, 0x00 },
+{ "linux/suspend_ioctls.h", "SNAPSHOT_PREF_IMAGE_SIZE", _IOC_NONE, 0x3312, 0x00 },
+{ "linux/suspend_ioctls.h", "SNAPSHOT_S2RAM", _IOC_NONE, 0x330b, 0x00 },
+{ "linux/suspend_ioctls.h", "SNAPSHOT_SET_SWAP_AREA", _IOC_WRITE, 0x330d, 0x0c },
+{ "linux/suspend_ioctls.h", "SNAPSHOT_UNFREEZE", _IOC_NONE, 0x3302, 0x00 },
+{ "linux/switchtec_ioctl.h", "SWITCHTEC_IOCTL_EVENT_CTL", _IOC_READ|_IOC_WRITE, 0x5743, 0x28 },
+{ "linux/switchtec_ioctl.h", "SWITCHTEC_IOCTL_EVENT_SUMMARY", _IOC_READ, 0x5742, 0x4d4 },
+{ "linux/switchtec_ioctl.h", "SWITCHTEC_IOCTL_EVENT_SUMMARY_LEGACY", _IOC_READ, 0x5742, 0x198 },
+{ "linux/switchtec_ioctl.h", "SWITCHTEC_IOCTL_FLASH_INFO", _IOC_READ, 0x5740, 0x10 },
+{ "linux/switchtec_ioctl.h", "SWITCHTEC_IOCTL_FLASH_PART_INFO", _IOC_READ|_IOC_WRITE, 0x5741, 0x10 },
+{ "linux/switchtec_ioctl.h", "SWITCHTEC_IOCTL_PFF_TO_PORT", _IOC_READ|_IOC_WRITE, 0x5744, 0x0c },
+{ "linux/switchtec_ioctl.h", "SWITCHTEC_IOCTL_PORT_TO_PFF", _IOC_READ|_IOC_WRITE, 0x5745, 0x0c },
+{ "linux/sync_file.h", "SYNC_IOC_FILE_INFO", _IOC_READ|_IOC_WRITE, 0x3e04, 0x38 },
+{ "linux/sync_file.h", "SYNC_IOC_MERGE", _IOC_READ|_IOC_WRITE, 0x3e03, 0x30 },
+{ "linux/synclink.h", "MGSL_IOCCLRMODCOUNT", _IOC_NONE, 0x6d0f, 0x00 },
+{ "linux/synclink.h", "MGSL_IOCGGPIO", _IOC_READ, 0x6d11, 0x10 },
+{ "linux/synclink.h", "MGSL_IOCGIF", _IOC_NONE, 0x6d0b, 0x00 },
+{ "linux/synclink.h", "MGSL_IOCGPARAMS", _IOC_READ, 0x6d01, 0x20 },
+{ "linux/synclink.h", "MGSL_IOCGSTATS", _IOC_NONE, 0x6d07, 0x00 },
+{ "linux/synclink.h", "MGSL_IOCGTXIDLE", _IOC_NONE, 0x6d03, 0x00 },
+{ "linux/synclink.h", "MGSL_IOCGXCTRL", _IOC_NONE, 0x6d16, 0x00 },
+{ "linux/synclink.h", "MGSL_IOCGXSYNC", _IOC_NONE, 0x6d14, 0x00 },
+{ "linux/synclink.h", "MGSL_IOCLOOPTXDONE", _IOC_NONE, 0x6d09, 0x00 },
+{ "linux/synclink.h", "MGSL_IOCRXENABLE", _IOC_NONE, 0x6d05, 0x00 },
+{ "linux/synclink.h", "MGSL_IOCSGPIO", _IOC_WRITE, 0x6d10, 0x10 },
+{ "linux/synclink.h", "MGSL_IOCSIF", _IOC_NONE, 0x6d0a, 0x00 },
+{ "linux/synclink.h", "MGSL_IOCSPARAMS", _IOC_WRITE, 0x6d00, 0x20 },
+{ "linux/synclink.h", "MGSL_IOCSTXIDLE", _IOC_NONE, 0x6d02, 0x00 },
+{ "linux/synclink.h", "MGSL_IOCSXCTRL", _IOC_NONE, 0x6d15, 0x00 },
+{ "linux/synclink.h", "MGSL_IOCSXSYNC", _IOC_NONE, 0x6d13, 0x00 },
+{ "linux/synclink.h", "MGSL_IOCTXABORT", _IOC_NONE, 0x6d06, 0x00 },
+{ "linux/synclink.h", "MGSL_IOCTXENABLE", _IOC_NONE, 0x6d04, 0x00 },
+{ "linux/synclink.h", "MGSL_IOCWAITEVENT", _IOC_READ|_IOC_WRITE, 0x6d08, 0x04 },
+{ "linux/synclink.h", "MGSL_IOCWAITGPIO", _IOC_READ|_IOC_WRITE, 0x6d12, 0x10 },
+{ "linux/tee.h", "TEE_IOC_CANCEL", _IOC_READ, 0xa404, 0x08 },
+{ "linux/tee.h", "TEE_IOC_CLOSE_SESSION", _IOC_READ, 0xa405, 0x04 },
+{ "linux/tee.h", "TEE_IOC_INVOKE", _IOC_READ, 0xa403, 0x10 },
+{ "linux/tee.h", "TEE_IOC_OPEN_SESSION", _IOC_READ, 0xa402, 0x10 },
+{ "linux/tee.h", "TEE_IOC_SHM_ALLOC", _IOC_READ|_IOC_WRITE, 0xa401, 0x10 },
+{ "linux/tee.h", "TEE_IOC_SHM_REGISTER", _IOC_READ|_IOC_WRITE, 0xa409, 0x18 },
+{ "linux/tee.h", "TEE_IOC_SUPPL_RECV", _IOC_READ, 0xa406, 0x10 },
+{ "linux/tee.h", "TEE_IOC_SUPPL_SEND", _IOC_READ, 0xa407, 0x10 },
+{ "linux/tee.h", "TEE_IOC_VERSION", _IOC_READ, 0xa400, 0x0c },
+{ "linux/timerfd.h", "TFD_IOC_SET_TICKS", _IOC_WRITE, 0x5400, 0x08 },
+{ "linux/toshiba.h", "TOSHIBA_ACPI_SCI", _IOC_READ|_IOC_WRITE, 0x7491, 0x18 },
+{ "linux/toshiba.h", "TOSH_SMM", _IOC_READ|_IOC_WRITE, 0x7490, 0x18 },
+{ "linux/udf_fs_i.h", "UDF_GETEABLOCK", _IOC_READ, 0x6c41, 0x04 },
+{ "linux/udf_fs_i.h", "UDF_GETEASIZE", _IOC_READ, 0x6c40, 0x04 },
+{ "linux/udf_fs_i.h", "UDF_GETVOLIDENT", _IOC_READ, 0x6c42, 0x04 },
+{ "linux/udf_fs_i.h", "UDF_RELOCATE_BLOCKS", _IOC_READ|_IOC_WRITE, 0x6c43, 0x04 },
+{ "linux/udmabuf.h", "UDMABUF_CREATE", _IOC_WRITE, 0x7542, 0x18 },
+{ "linux/udmabuf.h", "UDMABUF_CREATE_LIST", _IOC_WRITE, 0x7543, 0x08 },
+{ "linux/uinput.h", "UI_ABS_SETUP", _IOC_WRITE, 0x5504, 0x1c },
+{ "linux/uinput.h", "UI_BEGIN_FF_ERASE", _IOC_READ|_IOC_WRITE, 0x55ca, 0x0c },
+{ "linux/uinput.h", "UI_BEGIN_FF_UPLOAD", _IOC_READ|_IOC_WRITE, 0x55c8, 0x60 },
+{ "linux/uinput.h", "UI_DEV_CREATE", _IOC_NONE, 0x5501, 0x00 },
+{ "linux/uinput.h", "UI_DEV_DESTROY", _IOC_NONE, 0x5502, 0x00 },
+{ "linux/uinput.h", "UI_DEV_SETUP", _IOC_WRITE, 0x5503, 0x5c },
+{ "linux/uinput.h", "UI_END_FF_ERASE", _IOC_WRITE, 0x55cb, 0x0c },
+{ "linux/uinput.h", "UI_END_FF_UPLOAD", _IOC_WRITE, 0x55c9, 0x60 },
+{ "linux/uinput.h", "UI_GET_VERSION", _IOC_READ, 0x552d, 0x04 },
+{ "linux/uinput.h", "UI_SET_ABSBIT", _IOC_WRITE, 0x5567, 0x04 },
+{ "linux/uinput.h", "UI_SET_EVBIT", _IOC_WRITE, 0x5564, 0x04 },
+{ "linux/uinput.h", "UI_SET_FFBIT", _IOC_WRITE, 0x556b, 0x04 },
+{ "linux/uinput.h", "UI_SET_KEYBIT", _IOC_WRITE, 0x5565, 0x04 },
+{ "linux/uinput.h", "UI_SET_LEDBIT", _IOC_WRITE, 0x5569, 0x04 },
+{ "linux/uinput.h", "UI_SET_MSCBIT", _IOC_WRITE, 0x5568, 0x04 },
+{ "linux/uinput.h", "UI_SET_PHYS", _IOC_WRITE, 0x556c, 0x04 },
+{ "linux/uinput.h", "UI_SET_PROPBIT", _IOC_WRITE, 0x556e, 0x04 },
+{ "linux/uinput.h", "UI_SET_RELBIT", _IOC_WRITE, 0x5566, 0x04 },
+{ "linux/uinput.h", "UI_SET_SNDBIT", _IOC_WRITE, 0x556a, 0x04 },
+{ "linux/uinput.h", "UI_SET_SWBIT", _IOC_WRITE, 0x556d, 0x04 },
+{ "linux/usb/cdc-wdm.h", "IOCTL_WDM_MAX_COMMAND", _IOC_READ, 0x48a0, 0x02 },
+{ "linux/usb/functionfs.h", "FUNCTIONFS_CLEAR_HALT", _IOC_NONE, 0x6703, 0x00 },
+{ "linux/usb/functionfs.h", "FUNCTIONFS_ENDPOINT_DESC", _IOC_READ, 0x6782, 0x09 },
+{ "linux/usb/functionfs.h", "FUNCTIONFS_ENDPOINT_REVMAP", _IOC_NONE, 0x6781, 0x00 },
+{ "linux/usb/functionfs.h", "FUNCTIONFS_FIFO_FLUSH", _IOC_NONE, 0x6702, 0x00 },
+{ "linux/usb/functionfs.h", "FUNCTIONFS_FIFO_STATUS", _IOC_NONE, 0x6701, 0x00 },
+{ "linux/usb/functionfs.h", "FUNCTIONFS_INTERFACE_REVMAP", _IOC_NONE, 0x6780, 0x00 },
+{ "linux/usb/g_printer.h", "GADGET_GET_PRINTER_STATUS", _IOC_READ, 0x6721, 0x01 },
+{ "linux/usb/g_printer.h", "GADGET_SET_PRINTER_STATUS", _IOC_READ|_IOC_WRITE, 0x6722, 0x01 },
+{ "linux/usb/g_uvc.h", "UVCIOC_SEND_RESPONSE", _IOC_WRITE, 0x5501, 0x40 },
+{ "linux/usb/gadgetfs.h", "GADGETFS_CLEAR_HALT", _IOC_NONE, 0x6703, 0x00 },
+{ "linux/usb/gadgetfs.h", "GADGETFS_FIFO_FLUSH", _IOC_NONE, 0x6702, 0x00 },
+{ "linux/usb/gadgetfs.h", "GADGETFS_FIFO_STATUS", _IOC_NONE, 0x6701, 0x00 },
+{ "linux/usb/iowarrior.h", "IOW_GETINFO", _IOC_READ, 0xc003, 0x28 },
+{ "linux/usb/iowarrior.h", "IOW_READ", _IOC_WRITE, 0xc002, 0x04 },
+{ "linux/usb/iowarrior.h", "IOW_WRITE", _IOC_WRITE, 0xc001, 0x04 },
+{ "linux/usb/raw_gadget.h", "USB_RAW_IOCTL_CONFIGURE", _IOC_NONE, 0x5509, 0x00 },
+{ "linux/usb/raw_gadget.h", "USB_RAW_IOCTL_EP0_READ", _IOC_READ|_IOC_WRITE, 0x5504, 0x08 },
+{ "linux/usb/raw_gadget.h", "USB_RAW_IOCTL_EP0_STALL", _IOC_NONE, 0x550c, 0x00 },
+{ "linux/usb/raw_gadget.h", "USB_RAW_IOCTL_EP0_WRITE", _IOC_WRITE, 0x5503, 0x08 },
+{ "linux/usb/raw_gadget.h", "USB_RAW_IOCTL_EPS_INFO", _IOC_READ, 0x550b, 0x3c0 },
+{ "linux/usb/raw_gadget.h", "USB_RAW_IOCTL_EP_CLEAR_HALT", _IOC_WRITE, 0x550e, 0x04 },
+{ "linux/usb/raw_gadget.h", "USB_RAW_IOCTL_EP_DISABLE", _IOC_WRITE, 0x5506, 0x04 },
+{ "linux/usb/raw_gadget.h", "USB_RAW_IOCTL_EP_ENABLE", _IOC_WRITE, 0x5505, 0x09 },
+{ "linux/usb/raw_gadget.h", "USB_RAW_IOCTL_EP_READ", _IOC_READ|_IOC_WRITE, 0x5508, 0x08 },
+{ "linux/usb/raw_gadget.h", "USB_RAW_IOCTL_EP_SET_HALT", _IOC_WRITE, 0x550d, 0x04 },
+{ "linux/usb/raw_gadget.h", "USB_RAW_IOCTL_EP_SET_WEDGE", _IOC_WRITE, 0x550f, 0x04 },
+{ "linux/usb/raw_gadget.h", "USB_RAW_IOCTL_EP_WRITE", _IOC_WRITE, 0x5507, 0x08 },
+{ "linux/usb/raw_gadget.h", "USB_RAW_IOCTL_EVENT_FETCH", _IOC_READ, 0x5502, 0x08 },
+{ "linux/usb/raw_gadget.h", "USB_RAW_IOCTL_INIT", _IOC_WRITE, 0x5500, 0x101 },
+{ "linux/usb/raw_gadget.h", "USB_RAW_IOCTL_RUN", _IOC_NONE, 0x5501, 0x00 },
+{ "linux/usb/raw_gadget.h", "USB_RAW_IOCTL_VBUS_DRAW", _IOC_WRITE, 0x550a, 0x04 },
+{ "linux/usb/tmc.h", "USBTMC488_IOCTL_GET_CAPS", _IOC_READ, 0x5b11, 0x01 },
+{ "linux/usb/tmc.h", "USBTMC488_IOCTL_GOTO_LOCAL", _IOC_NONE, 0x5b14, 0x00 },
+{ "linux/usb/tmc.h", "USBTMC488_IOCTL_LOCAL_LOCKOUT", _IOC_NONE, 0x5b15, 0x00 },
+{ "linux/usb/tmc.h", "USBTMC488_IOCTL_READ_STB", _IOC_READ, 0x5b12, 0x01 },
+{ "linux/usb/tmc.h", "USBTMC488_IOCTL_REN_CONTROL", _IOC_WRITE, 0x5b13, 0x01 },
+{ "linux/usb/tmc.h", "USBTMC488_IOCTL_TRIGGER", _IOC_NONE, 0x5b16, 0x00 },
+{ "linux/usb/tmc.h", "USBTMC488_IOCTL_WAIT_SRQ", _IOC_WRITE, 0x5b17, 0x04 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_ABORT_BULK_IN", _IOC_NONE, 0x5b04, 0x00 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_ABORT_BULK_OUT", _IOC_NONE, 0x5b03, 0x00 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_API_VERSION", _IOC_READ, 0x5b10, 0x04 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_AUTO_ABORT", _IOC_WRITE, 0x5b19, 0x01 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_CANCEL_IO", _IOC_NONE, 0x5b23, 0x00 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_CLEANUP_IO", _IOC_NONE, 0x5b24, 0x00 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_CLEAR", _IOC_NONE, 0x5b02, 0x00 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_CLEAR_IN_HALT", _IOC_NONE, 0x5b07, 0x00 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_CLEAR_OUT_HALT", _IOC_NONE, 0x5b06, 0x00 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_CONFIG_TERMCHAR", _IOC_WRITE, 0x5b0c, 0x02 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_CTRL_REQUEST", _IOC_READ|_IOC_WRITE, 0x5b08, 0x0c },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_EOM_ENABLE", _IOC_WRITE, 0x5b0b, 0x01 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_GET_TIMEOUT", _IOC_READ, 0x5b09, 0x04 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_INDICATOR_PULSE", _IOC_NONE, 0x5b01, 0x00 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_MSG_IN_ATTR", _IOC_READ, 0x5b18, 0x01 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_READ", _IOC_READ|_IOC_WRITE, 0x5b0e, 0x10 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_SET_TIMEOUT", _IOC_WRITE, 0x5b0a, 0x04 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_WRITE", _IOC_READ|_IOC_WRITE, 0x5b0d, 0x10 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_WRITE_RESULT", _IOC_READ|_IOC_WRITE, 0x5b0f, 0x04 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_ALLOC_STREAMS", _IOC_READ, 0x551c, 0x08 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_ALLOW_SUSPEND", _IOC_NONE, 0x5522, 0x00 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_BULK32", _IOC_READ|_IOC_WRITE, 0x5502, 0x10 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_CLAIMINTERFACE", _IOC_READ, 0x550f, 0x04 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_CLAIM_PORT", _IOC_READ, 0x5518, 0x04 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_CLEAR_HALT", _IOC_READ, 0x5515, 0x04 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_CONNECT", _IOC_NONE, 0x5517, 0x00 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_CONNECTINFO", _IOC_WRITE, 0x5511, 0x08 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_CONTROL32", _IOC_READ|_IOC_WRITE, 0x5500, 0x10 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_DISCARDURB", _IOC_NONE, 0x550b, 0x00 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_DISCONNECT", _IOC_NONE, 0x5516, 0x00 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_DISCONNECT_CLAIM", _IOC_READ, 0x551b, 0x108 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_DISCSIGNAL32", _IOC_READ, 0x550e, 0x08 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_DROP_PRIVILEGES", _IOC_WRITE, 0x551e, 0x04 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_FORBID_SUSPEND", _IOC_NONE, 0x5521, 0x00 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_FREE_STREAMS", _IOC_READ, 0x551d, 0x08 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_GETDRIVER", _IOC_WRITE, 0x5508, 0x104 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_GET_CAPABILITIES", _IOC_READ, 0x551a, 0x04 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_GET_SPEED", _IOC_NONE, 0x551f, 0x00 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_HUB_PORTINFO", _IOC_READ, 0x5513, 0x80 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_IOCTL32", _IOC_READ|_IOC_WRITE, 0x5512, 0x0c },
+{ "linux/usbdevice_fs.h", "USBDEVFS_REAPURB32", _IOC_WRITE, 0x550c, 0x04 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_REAPURBNDELAY32", _IOC_WRITE, 0x550d, 0x04 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_RELEASEINTERFACE", _IOC_READ, 0x5510, 0x04 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_RELEASE_PORT", _IOC_READ, 0x5519, 0x04 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_RESET", _IOC_NONE, 0x5514, 0x00 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_RESETEP", _IOC_READ, 0x5503, 0x04 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_SETCONFIGURATION", _IOC_READ, 0x5505, 0x04 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_SETINTERFACE", _IOC_READ, 0x5504, 0x08 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_SUBMITURB", _IOC_READ, 0x550a, 0x2c },
+{ "linux/usbdevice_fs.h", "USBDEVFS_SUBMITURB32", _IOC_READ, 0x550a, 0x2a },
+{ "linux/usbdevice_fs.h", "USBDEVFS_WAIT_FOR_RESUME", _IOC_NONE, 0x5523, 0x00 },
+{ "linux/userfaultfd.h", "UFFDIO_API", _IOC_READ|_IOC_WRITE, 0xaa3f, 0x18 },
+{ "linux/userfaultfd.h", "UFFDIO_COPY", _IOC_READ|_IOC_WRITE, 0xaa03, 0x28 },
+{ "linux/userfaultfd.h", "UFFDIO_REGISTER", _IOC_READ|_IOC_WRITE, 0xaa00, 0x20 },
+{ "linux/userfaultfd.h", "UFFDIO_UNREGISTER", _IOC_READ, 0xaa01, 0x10 },
+{ "linux/userfaultfd.h", "UFFDIO_WAKE", _IOC_READ, 0xaa02, 0x10 },
+{ "linux/userfaultfd.h", "UFFDIO_WRITEPROTECT", _IOC_READ|_IOC_WRITE, 0xaa06, 0x18 },
+{ "linux/userfaultfd.h", "UFFDIO_ZEROPAGE", _IOC_READ|_IOC_WRITE, 0xaa04, 0x20 },
+{ "linux/uvcvideo.h", "UVCIOC_CTRL_MAP", _IOC_READ|_IOC_WRITE, 0x7520, 0x58 },
+{ "linux/uvcvideo.h", "UVCIOC_CTRL_QUERY", _IOC_READ|_IOC_WRITE, 0x7521, 0x0c },
+{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL", _IOC_READ|_IOC_WRITE, 0x564b, 0x40 },
+{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_ENUM_FRAME_SIZE", _IOC_READ|_IOC_WRITE, 0x564a, 0x40 },
+{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_ENUM_MBUS_CODE", _IOC_READ|_IOC_WRITE, 0x5602, 0x30 },
+{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_CROP", _IOC_READ|_IOC_WRITE, 0x563b, 0x38 },
+{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_FMT", _IOC_READ|_IOC_WRITE, 0x5604, 0x58 },
+{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_FRAME_INTERVAL", _IOC_READ|_IOC_WRITE, 0x5615, 0x30 },
+{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_SELECTION", _IOC_READ|_IOC_WRITE, 0x563d, 0x40 },
+{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_QUERYCAP", _IOC_READ, 0x5600, 0x40 },
+{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_CROP", _IOC_READ|_IOC_WRITE, 0x563c, 0x38 },
+{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_FMT", _IOC_READ|_IOC_WRITE, 0x5605, 0x58 },
+{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_FRAME_INTERVAL", _IOC_READ|_IOC_WRITE, 0x5616, 0x30 },
+{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_SELECTION", _IOC_READ|_IOC_WRITE, 0x563e, 0x40 },
+{ "linux/vboxguest.h", "VBG_IOCTL_ACQUIRE_GUEST_CAPABILITIES", _IOC_READ|_IOC_WRITE, 0x560d, 0x24 },
+{ "linux/vboxguest.h", "VBG_IOCTL_CHANGE_FILTER_MASK", _IOC_READ|_IOC_WRITE, 0x560c, 0x20 },
+{ "linux/vboxguest.h", "VBG_IOCTL_CHANGE_GUEST_CAPABILITIES", _IOC_READ|_IOC_WRITE, 0x560e, 0x20 },
+{ "linux/vboxguest.h", "VBG_IOCTL_CHECK_BALLOON", _IOC_READ|_IOC_WRITE, 0x5611, 0x20 },
+{ "linux/vboxguest.h", "VBG_IOCTL_DRIVER_VERSION_INFO", _IOC_READ|_IOC_WRITE, 0x5600, 0x2c },
+{ "linux/vboxguest.h", "VBG_IOCTL_HGCM_CONNECT", _IOC_READ|_IOC_WRITE, 0x5604, 0x9c },
+{ "linux/vboxguest.h", "VBG_IOCTL_HGCM_DISCONNECT", _IOC_READ|_IOC_WRITE, 0x5605, 0x1c },
+{ "linux/vboxguest.h", "VBG_IOCTL_INTERRUPT_ALL_WAIT_FOR_EVENTS", _IOC_READ|_IOC_WRITE, 0x560b, 0x18 },
+{ "linux/vboxguest.h", "VBG_IOCTL_VMMDEV_REQUEST_BIG", _IOC_NONE, 0x5603, 0x00 },
+{ "linux/vboxguest.h", "VBG_IOCTL_WAIT_FOR_EVENTS", _IOC_READ|_IOC_WRITE, 0x560a, 0x20 },
+{ "linux/vboxguest.h", "VBG_IOCTL_WRITE_CORE_DUMP", _IOC_READ|_IOC_WRITE, 0x5613, 0x1c },
+{ "linux/vfio.h", "VFIO_CHECK_EXTENSION", _IOC_NONE, 0x3b65, 0x00 },
+{ "linux/vfio.h", "VFIO_DEVICE_FEATURE", _IOC_NONE, 0x3b75, 0x00 },
+{ "linux/vfio.h", "VFIO_DEVICE_GET_GFX_DMABUF", _IOC_NONE, 0x3b73, 0x00 },
+{ "linux/vfio.h", "VFIO_DEVICE_GET_INFO", _IOC_NONE, 0x3b6b, 0x00 },
+{ "linux/vfio.h", "VFIO_DEVICE_GET_IRQ_INFO", _IOC_NONE, 0x3b6d, 0x00 },
+{ "linux/vfio.h", "VFIO_DEVICE_GET_PCI_HOT_RESET_INFO", _IOC_NONE, 0x3b70, 0x00 },
+{ "linux/vfio.h", "VFIO_DEVICE_GET_REGION_INFO", _IOC_NONE, 0x3b6c, 0x00 },
+{ "linux/vfio.h", "VFIO_DEVICE_IOEVENTFD", _IOC_NONE, 0x3b74, 0x00 },
+{ "linux/vfio.h", "VFIO_DEVICE_PCI_HOT_RESET", _IOC_NONE, 0x3b71, 0x00 },
+{ "linux/vfio.h", "VFIO_DEVICE_QUERY_GFX_PLANE", _IOC_NONE, 0x3b72, 0x00 },
+{ "linux/vfio.h", "VFIO_DEVICE_RESET", _IOC_NONE, 0x3b6f, 0x00 },
+{ "linux/vfio.h", "VFIO_DEVICE_SET_IRQS", _IOC_NONE, 0x3b6e, 0x00 },
+{ "linux/vfio.h", "VFIO_EEH_PE_OP", _IOC_NONE, 0x3b79, 0x00 },
+{ "linux/vfio.h", "VFIO_GET_API_VERSION", _IOC_NONE, 0x3b64, 0x00 },
+{ "linux/vfio.h", "VFIO_GROUP_GET_DEVICE_FD", _IOC_NONE, 0x3b6a, 0x00 },
+{ "linux/vfio.h", "VFIO_GROUP_GET_STATUS", _IOC_NONE, 0x3b67, 0x00 },
+{ "linux/vfio.h", "VFIO_GROUP_SET_CONTAINER", _IOC_NONE, 0x3b68, 0x00 },
+{ "linux/vfio.h", "VFIO_GROUP_UNSET_CONTAINER", _IOC_NONE, 0x3b69, 0x00 },
+{ "linux/vfio.h", "VFIO_IOMMU_DIRTY_PAGES", _IOC_NONE, 0x3b75, 0x00 },
+{ "linux/vfio.h", "VFIO_IOMMU_DISABLE", _IOC_NONE, 0x3b74, 0x00 },
+{ "linux/vfio.h", "VFIO_IOMMU_ENABLE", _IOC_NONE, 0x3b73, 0x00 },
+{ "linux/vfio.h", "VFIO_IOMMU_GET_INFO", _IOC_NONE, 0x3b70, 0x00 },
+{ "linux/vfio.h", "VFIO_IOMMU_MAP_DMA", _IOC_NONE, 0x3b71, 0x00 },
+{ "linux/vfio.h", "VFIO_IOMMU_SPAPR_REGISTER_MEMORY", _IOC_NONE, 0x3b75, 0x00 },
+{ "linux/vfio.h", "VFIO_IOMMU_SPAPR_TCE_CREATE", _IOC_NONE, 0x3b77, 0x00 },
+{ "linux/vfio.h", "VFIO_IOMMU_SPAPR_TCE_GET_INFO", _IOC_NONE, 0x3b70, 0x00 },
+{ "linux/vfio.h", "VFIO_IOMMU_SPAPR_TCE_REMOVE", _IOC_NONE, 0x3b78, 0x00 },
+{ "linux/vfio.h", "VFIO_IOMMU_SPAPR_UNREGISTER_MEMORY", _IOC_NONE, 0x3b76, 0x00 },
+{ "linux/vfio.h", "VFIO_IOMMU_UNMAP_DMA", _IOC_NONE, 0x3b72, 0x00 },
+{ "linux/vfio.h", "VFIO_SET_IOMMU", _IOC_NONE, 0x3b66, 0x00 },
+{ "linux/vhost.h", "VHOST_GET_BACKEND_FEATURES", _IOC_READ, 0xaf26, 0x08 },
+{ "linux/vhost.h", "VHOST_GET_FEATURES", _IOC_READ, 0xaf00, 0x08 },
+{ "linux/vhost.h", "VHOST_GET_VRING_BASE", _IOC_READ|_IOC_WRITE, 0xaf12, 0x08 },
+{ "linux/vhost.h", "VHOST_GET_VRING_BUSYLOOP_TIMEOUT", _IOC_WRITE, 0xaf24, 0x08 },
+{ "linux/vhost.h", "VHOST_GET_VRING_ENDIAN", _IOC_WRITE, 0xaf14, 0x08 },
+{ "linux/vhost.h", "VHOST_NET_SET_BACKEND", _IOC_WRITE, 0xaf30, 0x08 },
+{ "linux/vhost.h", "VHOST_RESET_OWNER", _IOC_NONE, 0xaf02, 0x00 },
+{ "linux/vhost.h", "VHOST_SCSI_CLEAR_ENDPOINT", _IOC_WRITE, 0xaf41, 0xe8 },
+{ "linux/vhost.h", "VHOST_SCSI_GET_ABI_VERSION", _IOC_WRITE, 0xaf42, 0x04 },
+{ "linux/vhost.h", "VHOST_SCSI_GET_EVENTS_MISSED", _IOC_WRITE, 0xaf44, 0x04 },
+{ "linux/vhost.h", "VHOST_SCSI_SET_ENDPOINT", _IOC_WRITE, 0xaf40, 0xe8 },
+{ "linux/vhost.h", "VHOST_SCSI_SET_EVENTS_MISSED", _IOC_WRITE, 0xaf43, 0x04 },
+{ "linux/vhost.h", "VHOST_SET_BACKEND_FEATURES", _IOC_WRITE, 0xaf25, 0x08 },
+{ "linux/vhost.h", "VHOST_SET_FEATURES", _IOC_WRITE, 0xaf00, 0x08 },
+{ "linux/vhost.h", "VHOST_SET_LOG_BASE", _IOC_WRITE, 0xaf04, 0x08 },
+{ "linux/vhost.h", "VHOST_SET_LOG_FD", _IOC_WRITE, 0xaf07, 0x04 },
+{ "linux/vhost.h", "VHOST_SET_MEM_TABLE", _IOC_WRITE, 0xaf03, 0x08 },
+{ "linux/vhost.h", "VHOST_SET_OWNER", _IOC_NONE, 0xaf01, 0x00 },
+{ "linux/vhost.h", "VHOST_SET_VRING_ADDR", _IOC_WRITE, 0xaf11, 0x28 },
+{ "linux/vhost.h", "VHOST_SET_VRING_BASE", _IOC_WRITE, 0xaf12, 0x08 },
+{ "linux/vhost.h", "VHOST_SET_VRING_BUSYLOOP_TIMEOUT", _IOC_WRITE, 0xaf23, 0x08 },
+{ "linux/vhost.h", "VHOST_SET_VRING_CALL", _IOC_WRITE, 0xaf21, 0x08 },
+{ "linux/vhost.h", "VHOST_SET_VRING_ENDIAN", _IOC_WRITE, 0xaf13, 0x08 },
+{ "linux/vhost.h", "VHOST_SET_VRING_ERR", _IOC_WRITE, 0xaf22, 0x08 },
+{ "linux/vhost.h", "VHOST_SET_VRING_KICK", _IOC_WRITE, 0xaf20, 0x08 },
+{ "linux/vhost.h", "VHOST_SET_VRING_NUM", _IOC_WRITE, 0xaf10, 0x08 },
+{ "linux/vhost.h", "VHOST_VDPA_GET_CONFIG", _IOC_READ, 0xaf73, 0x08 },
+{ "linux/vhost.h", "VHOST_VDPA_GET_DEVICE_ID", _IOC_READ, 0xaf70, 0x04 },
+{ "linux/vhost.h", "VHOST_VDPA_GET_IOVA_RANGE", _IOC_READ, 0xaf78, 0x10 },
+{ "linux/vhost.h", "VHOST_VDPA_GET_STATUS", _IOC_READ, 0xaf71, 0x01 },
+{ "linux/vhost.h", "VHOST_VDPA_GET_VRING_NUM", _IOC_READ, 0xaf76, 0x02 },
+{ "linux/vhost.h", "VHOST_VDPA_SET_CONFIG", _IOC_WRITE, 0xaf74, 0x08 },
+{ "linux/vhost.h", "VHOST_VDPA_SET_CONFIG_CALL", _IOC_WRITE, 0xaf77, 0x04 },
+{ "linux/vhost.h", "VHOST_VDPA_SET_STATUS", _IOC_WRITE, 0xaf72, 0x01 },
+{ "linux/vhost.h", "VHOST_VDPA_SET_VRING_ENABLE", _IOC_WRITE, 0xaf75, 0x08 },
+{ "linux/vhost.h", "VHOST_VSOCK_SET_GUEST_CID", _IOC_WRITE, 0xaf60, 0x08 },
+{ "linux/vhost.h", "VHOST_VSOCK_SET_RUNNING", _IOC_WRITE, 0xaf61, 0x04 },
+{ "linux/videodev2.h", "VIDIOC_CREATE_BUFS", _IOC_READ|_IOC_WRITE, 0x565c, 0xf8 },
+{ "linux/videodev2.h", "VIDIOC_CROPCAP", _IOC_READ|_IOC_WRITE, 0x563a, 0x2c },
+{ "linux/videodev2.h", "VIDIOC_DBG_G_CHIP_INFO", _IOC_READ|_IOC_WRITE, 0x5666, 0xc8 },
+{ "linux/videodev2.h", "VIDIOC_DBG_G_REGISTER", _IOC_READ|_IOC_WRITE, 0x5650, 0x38 },
+{ "linux/videodev2.h", "VIDIOC_DBG_S_REGISTER", _IOC_WRITE, 0x564f, 0x38 },
+{ "linux/videodev2.h", "VIDIOC_DECODER_CMD", _IOC_READ|_IOC_WRITE, 0x5660, 0x48 },
+{ "linux/videodev2.h", "VIDIOC_DQBUF", _IOC_READ|_IOC_WRITE, 0x5611, 0x4c },
+{ "linux/videodev2.h", "VIDIOC_DQEVENT", _IOC_READ, 0x5659, 0x80 },
+{ "linux/videodev2.h", "VIDIOC_DV_TIMINGS_CAP", _IOC_READ|_IOC_WRITE, 0x5664, 0x90 },
+{ "linux/videodev2.h", "VIDIOC_ENCODER_CMD", _IOC_READ|_IOC_WRITE, 0x564d, 0x28 },
+{ "linux/videodev2.h", "VIDIOC_ENUMAUDIO", _IOC_READ|_IOC_WRITE, 0x5641, 0x34 },
+{ "linux/videodev2.h", "VIDIOC_ENUMAUDOUT", _IOC_READ|_IOC_WRITE, 0x5642, 0x34 },
+{ "linux/videodev2.h", "VIDIOC_ENUMINPUT", _IOC_READ|_IOC_WRITE, 0x561a, 0x4c },
+{ "linux/videodev2.h", "VIDIOC_ENUMOUTPUT", _IOC_READ|_IOC_WRITE, 0x5630, 0x48 },
+{ "linux/videodev2.h", "VIDIOC_ENUMSTD", _IOC_READ|_IOC_WRITE, 0x5619, 0x40 },
+{ "linux/videodev2.h", "VIDIOC_ENUM_DV_TIMINGS", _IOC_READ|_IOC_WRITE, 0x5662, 0x94 },
+{ "linux/videodev2.h", "VIDIOC_ENUM_FMT", _IOC_READ|_IOC_WRITE, 0x5602, 0x40 },
+{ "linux/videodev2.h", "VIDIOC_ENUM_FRAMEINTERVALS", _IOC_READ|_IOC_WRITE, 0x564b, 0x34 },
+{ "linux/videodev2.h", "VIDIOC_ENUM_FRAMESIZES", _IOC_READ|_IOC_WRITE, 0x564a, 0x2c },
+{ "linux/videodev2.h", "VIDIOC_ENUM_FREQ_BANDS", _IOC_READ|_IOC_WRITE, 0x5665, 0x40 },
+{ "linux/videodev2.h", "VIDIOC_EXPBUF", _IOC_READ|_IOC_WRITE, 0x5610, 0x40 },
+{ "linux/videodev2.h", "VIDIOC_G_AUDIO", _IOC_READ, 0x5621, 0x34 },
+{ "linux/videodev2.h", "VIDIOC_G_AUDOUT", _IOC_READ, 0x5631, 0x34 },
+{ "linux/videodev2.h", "VIDIOC_G_CROP", _IOC_READ|_IOC_WRITE, 0x563b, 0x14 },
+{ "linux/videodev2.h", "VIDIOC_G_CTRL", _IOC_READ|_IOC_WRITE, 0x561b, 0x08 },
+{ "linux/videodev2.h", "VIDIOC_G_DV_TIMINGS", _IOC_READ|_IOC_WRITE, 0x5658, 0x84 },
+{ "linux/videodev2.h", "VIDIOC_G_EDID", _IOC_READ|_IOC_WRITE, 0x5628, 0x24 },
+{ "linux/videodev2.h", "VIDIOC_G_ENC_INDEX", _IOC_READ, 0x564c, 0x818 },
+{ "linux/videodev2.h", "VIDIOC_G_EXT_CTRLS", _IOC_READ|_IOC_WRITE, 0x5647, 0x18 },
+{ "linux/videodev2.h", "VIDIOC_G_FBUF", _IOC_READ, 0x560a, 0x2c },
+{ "linux/videodev2.h", "VIDIOC_G_FMT", _IOC_READ|_IOC_WRITE, 0x5604, 0xcc },
+{ "linux/videodev2.h", "VIDIOC_G_FREQUENCY", _IOC_READ|_IOC_WRITE, 0x5638, 0x2c },
+{ "linux/videodev2.h", "VIDIOC_G_INPUT", _IOC_READ, 0x5626, 0x04 },
+{ "linux/videodev2.h", "VIDIOC_G_JPEGCOMP", _IOC_READ, 0x563d, 0x8c },
+{ "linux/videodev2.h", "VIDIOC_G_MODULATOR", _IOC_READ|_IOC_WRITE, 0x5636, 0x44 },
+{ "linux/videodev2.h", "VIDIOC_G_OUTPUT", _IOC_READ, 0x562e, 0x04 },
+{ "linux/videodev2.h", "VIDIOC_G_PARM", _IOC_READ|_IOC_WRITE, 0x5615, 0xcc },
+{ "linux/videodev2.h", "VIDIOC_G_PRIORITY", _IOC_READ, 0x5643, 0x04 },
+{ "linux/videodev2.h", "VIDIOC_G_SELECTION", _IOC_READ|_IOC_WRITE, 0x565e, 0x40 },
+{ "linux/videodev2.h", "VIDIOC_G_SLICED_VBI_CAP", _IOC_READ|_IOC_WRITE, 0x5645, 0x74 },
+{ "linux/videodev2.h", "VIDIOC_G_STD", _IOC_READ, 0x5617, 0x08 },
+{ "linux/videodev2.h", "VIDIOC_G_TUNER", _IOC_READ|_IOC_WRITE, 0x561d, 0x54 },
+{ "linux/videodev2.h", "VIDIOC_LOG_STATUS", _IOC_NONE, 0x5646, 0x00 },
+{ "linux/videodev2.h", "VIDIOC_OVERLAY", _IOC_WRITE, 0x560e, 0x04 },
+{ "linux/videodev2.h", "VIDIOC_PREPARE_BUF", _IOC_READ|_IOC_WRITE, 0x565d, 0x4c },
+{ "linux/videodev2.h", "VIDIOC_QBUF", _IOC_READ|_IOC_WRITE, 0x560f, 0x4c },
+{ "linux/videodev2.h", "VIDIOC_QUERYBUF", _IOC_READ|_IOC_WRITE, 0x5609, 0x4c },
+{ "linux/videodev2.h", "VIDIOC_QUERYCAP", _IOC_READ, 0x5600, 0x68 },
+{ "linux/videodev2.h", "VIDIOC_QUERYCTRL", _IOC_READ|_IOC_WRITE, 0x5624, 0x44 },
+{ "linux/videodev2.h", "VIDIOC_QUERYMENU", _IOC_READ|_IOC_WRITE, 0x5625, 0x2c },
+{ "linux/videodev2.h", "VIDIOC_QUERYSTD", _IOC_READ, 0x563f, 0x08 },
+{ "linux/videodev2.h", "VIDIOC_QUERY_DV_TIMINGS", _IOC_READ, 0x5663, 0x84 },
+{ "linux/videodev2.h", "VIDIOC_QUERY_EXT_CTRL", _IOC_READ|_IOC_WRITE, 0x5667, 0xe8 },
+{ "linux/videodev2.h", "VIDIOC_REQBUFS", _IOC_READ|_IOC_WRITE, 0x5608, 0x14 },
+{ "linux/videodev2.h", "VIDIOC_STREAMOFF", _IOC_WRITE, 0x5613, 0x04 },
+{ "linux/videodev2.h", "VIDIOC_STREAMON", _IOC_WRITE, 0x5612, 0x04 },
+{ "linux/videodev2.h", "VIDIOC_SUBSCRIBE_EVENT", _IOC_WRITE, 0x565a, 0x20 },
+{ "linux/videodev2.h", "VIDIOC_S_AUDIO", _IOC_WRITE, 0x5622, 0x34 },
+{ "linux/videodev2.h", "VIDIOC_S_AUDOUT", _IOC_WRITE, 0x5632, 0x34 },
+{ "linux/videodev2.h", "VIDIOC_S_CROP", _IOC_WRITE, 0x563c, 0x14 },
+{ "linux/videodev2.h", "VIDIOC_S_CTRL", _IOC_READ|_IOC_WRITE, 0x561c, 0x08 },
+{ "linux/videodev2.h", "VIDIOC_S_DV_TIMINGS", _IOC_READ|_IOC_WRITE, 0x5657, 0x84 },
+{ "linux/videodev2.h", "VIDIOC_S_EDID", _IOC_READ|_IOC_WRITE, 0x5629, 0x24 },
+{ "linux/videodev2.h", "VIDIOC_S_EXT_CTRLS", _IOC_READ|_IOC_WRITE, 0x5648, 0x18 },
+{ "linux/videodev2.h", "VIDIOC_S_FBUF", _IOC_WRITE, 0x560b, 0x2c },
+{ "linux/videodev2.h", "VIDIOC_S_FMT", _IOC_READ|_IOC_WRITE, 0x5605, 0xcc },
+{ "linux/videodev2.h", "VIDIOC_S_FREQUENCY", _IOC_WRITE, 0x5639, 0x2c },
+{ "linux/videodev2.h", "VIDIOC_S_HW_FREQ_SEEK", _IOC_WRITE, 0x5652, 0x30 },
+{ "linux/videodev2.h", "VIDIOC_S_INPUT", _IOC_READ|_IOC_WRITE, 0x5627, 0x04 },
+{ "linux/videodev2.h", "VIDIOC_S_JPEGCOMP", _IOC_WRITE, 0x563e, 0x8c },
+{ "linux/videodev2.h", "VIDIOC_S_MODULATOR", _IOC_WRITE, 0x5637, 0x44 },
+{ "linux/videodev2.h", "VIDIOC_S_OUTPUT", _IOC_READ|_IOC_WRITE, 0x562f, 0x04 },
+{ "linux/videodev2.h", "VIDIOC_S_PARM", _IOC_READ|_IOC_WRITE, 0x5616, 0xcc },
+{ "linux/videodev2.h", "VIDIOC_S_PRIORITY", _IOC_WRITE, 0x5644, 0x04 },
+{ "linux/videodev2.h", "VIDIOC_S_SELECTION", _IOC_READ|_IOC_WRITE, 0x565f, 0x40 },
+{ "linux/videodev2.h", "VIDIOC_S_STD", _IOC_WRITE, 0x5618, 0x08 },
+{ "linux/videodev2.h", "VIDIOC_S_TUNER", _IOC_WRITE, 0x561e, 0x54 },
+{ "linux/videodev2.h", "VIDIOC_TRY_DECODER_CMD", _IOC_READ|_IOC_WRITE, 0x5661, 0x48 },
+{ "linux/videodev2.h", "VIDIOC_TRY_ENCODER_CMD", _IOC_READ|_IOC_WRITE, 0x564e, 0x28 },
+{ "linux/videodev2.h", "VIDIOC_TRY_EXT_CTRLS", _IOC_READ|_IOC_WRITE, 0x5649, 0x18 },
+{ "linux/videodev2.h", "VIDIOC_TRY_FMT", _IOC_READ|_IOC_WRITE, 0x5640, 0xcc },
+{ "linux/videodev2.h", "VIDIOC_UNSUBSCRIBE_EVENT", _IOC_WRITE, 0x565b, 0x20 },
+{ "linux/vm_sockets.h", "IOCTL_VM_SOCKETS_GET_LOCAL_CID", _IOC_NONE, 0x07b9, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_CTX_ADD_NOTIFICATION", _IOC_NONE, 0x07af, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_CTX_GET_CPT_STATE", _IOC_NONE, 0x07b1, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_CTX_REMOVE_NOTIFICATION", _IOC_NONE, 0x07b0, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_CTX_SET_CPT_STATE", _IOC_NONE, 0x07b2, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_DATAGRAM_RECEIVE", _IOC_NONE, 0x07ac, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_DATAGRAM_SEND", _IOC_NONE, 0x07ab, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_GET_CONTEXT_ID", _IOC_NONE, 0x07b3, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_INIT_CONTEXT", _IOC_NONE, 0x07a0, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_NOTIFICATIONS_RECEIVE", _IOC_NONE, 0x07a6, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_NOTIFY_RESOURCE", _IOC_NONE, 0x07a5, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_QUEUEPAIR_ALLOC", _IOC_NONE, 0x07a8, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_QUEUEPAIR_DETACH", _IOC_NONE, 0x07aa, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_QUEUEPAIR_SETPAGEFILE", _IOC_NONE, 0x07a9, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_QUEUEPAIR_SETVA", _IOC_NONE, 0x07a4, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_SET_NOTIFY", _IOC_NONE, 0x07cb, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_SOCKETS_GET_AF_VALUE", _IOC_NONE, 0x07b8, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_SOCKETS_GET_LOCAL_CID", _IOC_NONE, 0x07b9, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_SOCKETS_VERSION", _IOC_NONE, 0x07b4, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_VERSION", _IOC_NONE, 0x079f, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_VERSION2", _IOC_NONE, 0x07a7, 0x00 },
+{ "linux/vt.h", "VT_ACTIVATE", 0, 0x5606, 0 },
+{ "linux/vt.h", "VT_DISALLOCATE", 0, 0x5608, 0 },
+{ "linux/vt.h", "VT_GETHIFONTMASK", 0, 0x560D, 0 },
+{ "linux/vt.h", "VT_GETMODE", 0, 0x5601, 0 },
+{ "linux/vt.h", "VT_GETSTATE", 0, 0x5603, 0 },
+{ "linux/vt.h", "VT_LOCKSWITCH", 0, 0x560B, 0 },
+{ "linux/vt.h", "VT_OPENQRY", 0, 0x5600, 0 },
+{ "linux/vt.h", "VT_RELDISP", 0, 0x5605, 0 },
+{ "linux/vt.h", "VT_RESIZE", 0, 0x5609, 0 },
+{ "linux/vt.h", "VT_RESIZEX", 0, 0x560A, 0 },
+{ "linux/vt.h", "VT_SENDSIG", 0, 0x5604, 0 },
+{ "linux/vt.h", "VT_SETACTIVATE", 0, 0x560F, 0 },
+{ "linux/vt.h", "VT_SETMODE", 0, 0x5602, 0 },
+{ "linux/vt.h", "VT_UNLOCKSWITCH", 0, 0x560C, 0 },
+{ "linux/vt.h", "VT_WAITACTIVE", 0, 0x5607, 0 },
+{ "linux/vt.h", "VT_WAITEVENT", 0, 0x560E, 0 },
+{ "linux/vtpm_proxy.h", "VTPM_PROXY_IOC_NEW_DEV", _IOC_READ|_IOC_WRITE, 0xa100, 0x14 },
+{ "linux/watch_queue.h", "IOC_WATCH_QUEUE_SET_FILTER", _IOC_NONE, 0x5761, 0x00 },
+{ "linux/watch_queue.h", "IOC_WATCH_QUEUE_SET_SIZE", _IOC_NONE, 0x5760, 0x00 },
+{ "linux/watchdog.h", "WDIOC_GETBOOTSTATUS", _IOC_READ, 0x5702, 0x04 },
+{ "linux/watchdog.h", "WDIOC_GETPRETIMEOUT", _IOC_READ, 0x5709, 0x04 },
+{ "linux/watchdog.h", "WDIOC_GETSTATUS", _IOC_READ, 0x5701, 0x04 },
+{ "linux/watchdog.h", "WDIOC_GETSUPPORT", _IOC_READ, 0x5700, 0x28 },
+{ "linux/watchdog.h", "WDIOC_GETTEMP", _IOC_READ, 0x5703, 0x04 },
+{ "linux/watchdog.h", "WDIOC_GETTIMELEFT", _IOC_READ, 0x570a, 0x04 },
+{ "linux/watchdog.h", "WDIOC_GETTIMEOUT", _IOC_READ, 0x5707, 0x04 },
+{ "linux/watchdog.h", "WDIOC_KEEPALIVE", _IOC_READ, 0x5705, 0x04 },
+{ "linux/watchdog.h", "WDIOC_SETOPTIONS", _IOC_READ, 0x5704, 0x04 },
+{ "linux/watchdog.h", "WDIOC_SETPRETIMEOUT", _IOC_READ|_IOC_WRITE, 0x5708, 0x04 },
+{ "linux/watchdog.h", "WDIOC_SETTIMEOUT", _IOC_READ|_IOC_WRITE, 0x5706, 0x04 },
+{ "linux/wireless.h", "SIOCGIWAP", 0, 0x8B15, 0 },
+{ "linux/wireless.h", "SIOCGIWAPLIST", 0, 0x8B17, 0 },
+{ "linux/wireless.h", "SIOCGIWAUTH", 0, 0x8B33, 0 },
+{ "linux/wireless.h", "SIOCGIWENCODE", 0, 0x8B2B, 0 },
+{ "linux/wireless.h", "SIOCGIWENCODEEXT", 0, 0x8B35, 0 },
+{ "linux/wireless.h", "SIOCGIWESSID", 0, 0x8B1B, 0 },
+{ "linux/wireless.h", "SIOCGIWFRAG", 0, 0x8B25, 0 },
+{ "linux/wireless.h", "SIOCGIWFREQ", 0, 0x8B05, 0 },
+{ "linux/wireless.h", "SIOCGIWGENIE", 0, 0x8B31, 0 },
+{ "linux/wireless.h", "SIOCGIWMODE", 0, 0x8B07, 0 },
+{ "linux/wireless.h", "SIOCGIWNAME", 0, 0x8B01, 0 },
+{ "linux/wireless.h", "SIOCGIWNICKN", 0, 0x8B1D, 0 },
+{ "linux/wireless.h", "SIOCGIWNWID", 0, 0x8B03, 0 },
+{ "linux/wireless.h", "SIOCGIWPOWER", 0, 0x8B2D, 0 },
+{ "linux/wireless.h", "SIOCGIWPRIV", 0, 0x8B0D, 0 },
+{ "linux/wireless.h", "SIOCGIWRANGE", 0, 0x8B0B, 0 },
+{ "linux/wireless.h", "SIOCGIWRATE", 0, 0x8B21, 0 },
+{ "linux/wireless.h", "SIOCGIWRETRY", 0, 0x8B29, 0 },
+{ "linux/wireless.h", "SIOCGIWRTS", 0, 0x8B23, 0 },
+{ "linux/wireless.h", "SIOCGIWSCAN", 0, 0x8B19, 0 },
+{ "linux/wireless.h", "SIOCGIWSENS", 0, 0x8B09, 0 },
+{ "linux/wireless.h", "SIOCGIWSPY", 0, 0x8B11, 0 },
+{ "linux/wireless.h", "SIOCGIWSTATS", 0, 0x8B0F, 0 },
+{ "linux/wireless.h", "SIOCGIWTHRSPY", 0, 0x8B13, 0 },
+{ "linux/wireless.h", "SIOCGIWTXPOW", 0, 0x8B27, 0 },
+{ "linux/wireless.h", "SIOCIWFIRST", 0, 0x8B00, 0 },
+{ "linux/wireless.h", "SIOCIWFIRSTPRIV", 0, 0x8BE0, 0 },
+{ "linux/wireless.h", "SIOCIWLASTPRIV", 0, 0x8BFF, 0 },
+{ "linux/wireless.h", "SIOCSIWAP", 0, 0x8B14, 0 },
+{ "linux/wireless.h", "SIOCSIWAUTH", 0, 0x8B32, 0 },
+{ "linux/wireless.h", "SIOCSIWCOMMIT", 0, 0x8B00, 0 },
+{ "linux/wireless.h", "SIOCSIWENCODE", 0, 0x8B2A, 0 },
+{ "linux/wireless.h", "SIOCSIWENCODEEXT", 0, 0x8B34, 0 },
+{ "linux/wireless.h", "SIOCSIWESSID", 0, 0x8B1A, 0 },
+{ "linux/wireless.h", "SIOCSIWFRAG", 0, 0x8B24, 0 },
+{ "linux/wireless.h", "SIOCSIWFREQ", 0, 0x8B04, 0 },
+{ "linux/wireless.h", "SIOCSIWGENIE", 0, 0x8B30, 0 },
+{ "linux/wireless.h", "SIOCSIWMLME", 0, 0x8B16, 0 },
+{ "linux/wireless.h", "SIOCSIWMODE", 0, 0x8B06, 0 },
+{ "linux/wireless.h", "SIOCSIWNICKN", 0, 0x8B1C, 0 },
+{ "linux/wireless.h", "SIOCSIWNWID", 0, 0x8B02, 0 },
+{ "linux/wireless.h", "SIOCSIWPMKSA", 0, 0x8B36, 0 },
+{ "linux/wireless.h", "SIOCSIWPOWER", 0, 0x8B2C, 0 },
+{ "linux/wireless.h", "SIOCSIWPRIV", 0, 0x8B0C, 0 },
+{ "linux/wireless.h", "SIOCSIWRANGE", 0, 0x8B0A, 0 },
+{ "linux/wireless.h", "SIOCSIWRATE", 0, 0x8B20, 0 },
+{ "linux/wireless.h", "SIOCSIWRETRY", 0, 0x8B28, 0 },
+{ "linux/wireless.h", "SIOCSIWRTS", 0, 0x8B22, 0 },
+{ "linux/wireless.h", "SIOCSIWSCAN", 0, 0x8B18, 0 },
+{ "linux/wireless.h", "SIOCSIWSENS", 0, 0x8B08, 0 },
+{ "linux/wireless.h", "SIOCSIWSPY", 0, 0x8B10, 0 },
+{ "linux/wireless.h", "SIOCSIWSTATS", 0, 0x8B0E, 0 },
+{ "linux/wireless.h", "SIOCSIWTHRSPY", 0, 0x8B12, 0 },
+{ "linux/wireless.h", "SIOCSIWTXPOW", 0, 0x8B26, 0 },
+{ "linux/wmi.h", "DELL_WMI_SMBIOS_CMD", _IOC_READ|_IOC_WRITE, 0x5700, 0x34 },
+{ "media/drv-intf/exynos-fimc.h", "S5P_FIMC_TX_END_NOTIFY", _IOC_NONE, 0x6500, 0x00 },
+{ "media/i2c/adv7842.h", "ADV7842_CMD_RAM_TEST", _IOC_NONE, 0x56c0, 0x00 },
+{ "media/i2c/bt819.h", "BT819_FIFO_RESET_HIGH", _IOC_NONE, 0x6201, 0x00 },
+{ "media/i2c/bt819.h", "BT819_FIFO_RESET_LOW", _IOC_NONE, 0x6200, 0x00 },
+{ "media/i2c/saa6588.h", "SAA6588_CMD_CLOSE", _IOC_WRITE, 0x5202, 0x04 },
+{ "media/i2c/saa6588.h", "SAA6588_CMD_POLL", _IOC_READ, 0x5204, 0x04 },
+{ "media/i2c/saa6588.h", "SAA6588_CMD_READ", _IOC_READ, 0x5203, 0x04 },
+{ "media/v4l2-common.h", "TUNER_SET_CONFIG", _IOC_WRITE, 0x645c, 0x08 },
+{ "media/v4l2-common.h", "VIDIOC_INT_RESET", _IOC_WRITE, 0x6466, 0x04 },
+{ "media/v4l2-ioctl.h", "VIDIOC_DQBUF_TIME32", _IOC_READ|_IOC_WRITE, 0x5611, 0x44 },
+{ "media/v4l2-ioctl.h", "VIDIOC_DQEVENT_TIME32", _IOC_READ, 0x5659, 0x78 },
+{ "media/v4l2-ioctl.h", "VIDIOC_PREPARE_BUF_TIME32", _IOC_READ|_IOC_WRITE, 0x565d, 0x44 },
+{ "media/v4l2-ioctl.h", "VIDIOC_QBUF_TIME32", _IOC_READ|_IOC_WRITE, 0x560f, 0x44 },
+{ "media/v4l2-ioctl.h", "VIDIOC_QUERYBUF_TIME32", _IOC_READ|_IOC_WRITE, 0x5609, 0x44 },
+{ "media/v4l2-subdev.h", "V4L2_DEVICE_NOTIFY_EVENT", _IOC_WRITE, 0x7602, 0x80 },
+{ "media/v4l2-subdev.h", "V4L2_SUBDEV_IR_RX_NOTIFY", _IOC_WRITE, 0x7600, 0x04 },
+{ "media/v4l2-subdev.h", "V4L2_SUBDEV_IR_TX_NOTIFY", _IOC_WRITE, 0x7601, 0x04 },
+{ "misc/cxl.h", "CXL_IOCTL_DOWNLOAD_IMAGE", _IOC_WRITE, 0xca0a, 0x40 },
+{ "misc/cxl.h", "CXL_IOCTL_GET_AFU_ID", _IOC_READ, 0xca02, 0x40 },
+{ "misc/cxl.h", "CXL_IOCTL_GET_PROCESS_ELEMENT", _IOC_READ, 0xca01, 0x04 },
+{ "misc/cxl.h", "CXL_IOCTL_START_WORK", _IOC_WRITE, 0xca00, 0x40 },
+{ "misc/cxl.h", "CXL_IOCTL_VALIDATE_IMAGE", _IOC_WRITE, 0xca0b, 0x40 },
+{ "misc/fastrpc.h", "FASTRPC_IOCTL_ALLOC_DMA_BUFF", _IOC_READ|_IOC_WRITE, 0x5201, 0x10 },
+{ "misc/fastrpc.h", "FASTRPC_IOCTL_FREE_DMA_BUFF", _IOC_READ|_IOC_WRITE, 0x5202, 0x04 },
+{ "misc/fastrpc.h", "FASTRPC_IOCTL_INIT_ATTACH", _IOC_NONE, 0x5204, 0x00 },
+{ "misc/fastrpc.h", "FASTRPC_IOCTL_INIT_ATTACH_SNS", _IOC_NONE, 0x5208, 0x00 },
+{ "misc/fastrpc.h", "FASTRPC_IOCTL_INIT_CREATE", _IOC_READ|_IOC_WRITE, 0x5205, 0x18 },
+{ "misc/fastrpc.h", "FASTRPC_IOCTL_INVOKE", _IOC_READ|_IOC_WRITE, 0x5203, 0x10 },
+{ "misc/fastrpc.h", "FASTRPC_IOCTL_MMAP", _IOC_READ|_IOC_WRITE, 0x5206, 0x20 },
+{ "misc/fastrpc.h", "FASTRPC_IOCTL_MUNMAP", _IOC_READ|_IOC_WRITE, 0x5207, 0x10 },
+{ "misc/habanalabs.h", "HL_IOCTL_CB", _IOC_READ|_IOC_WRITE, 0x4802, 0x18 },
+{ "misc/habanalabs.h", "HL_IOCTL_CS", _IOC_READ|_IOC_WRITE, 0x4803, 0x2c },
+{ "misc/habanalabs.h", "HL_IOCTL_DEBUG", _IOC_READ|_IOC_WRITE, 0x4806, 0x28 },
+{ "misc/habanalabs.h", "HL_IOCTL_INFO", _IOC_READ|_IOC_WRITE, 0x4801, 0x18 },
+{ "misc/habanalabs.h", "HL_IOCTL_MEMORY", _IOC_READ|_IOC_WRITE, 0x4805, 0x28 },
+{ "misc/habanalabs.h", "HL_IOCTL_WAIT_CS", _IOC_READ|_IOC_WRITE, 0x4804, 0x18 },
+{ "misc/ocxl.h", "OCXL_IOCTL_ATTACH", _IOC_WRITE, 0xca10, 0x20 },
+{ "misc/ocxl.h", "OCXL_IOCTL_ENABLE_P9_WAIT", _IOC_READ, 0xca15, 0x20 },
+{ "misc/ocxl.h", "OCXL_IOCTL_GET_FEATURES", _IOC_READ, 0xca16, 0x20 },
+{ "misc/ocxl.h", "OCXL_IOCTL_GET_METADATA", _IOC_READ, 0xca14, 0x80 },
+{ "misc/ocxl.h", "OCXL_IOCTL_IRQ_ALLOC", _IOC_READ, 0xca11, 0x08 },
+{ "misc/ocxl.h", "OCXL_IOCTL_IRQ_FREE", _IOC_WRITE, 0xca12, 0x08 },
+{ "misc/ocxl.h", "OCXL_IOCTL_IRQ_SET_FD", _IOC_WRITE, 0xca13, 0x10 },
+{ "misc/uacce/hisi_qm.h", "UACCE_CMD_QM_SET_QP_CTX", _IOC_READ|_IOC_WRITE, 0x480a, 0x04 },
+{ "misc/uacce/uacce.h", "UACCE_CMD_PUT_Q", _IOC_NONE, 0x5701, 0x00 },
+{ "misc/uacce/uacce.h", "UACCE_CMD_START_Q", _IOC_NONE, 0x5700, 0x00 },
+{ "misc/xilinx_sdfec.h", "XSDFEC_ADD_LDPC_CODE_PARAMS", _IOC_WRITE, 0x6605, 0x4c },
+{ "misc/xilinx_sdfec.h", "XSDFEC_CLEAR_STATS", _IOC_NONE, 0x660b, 0x00 },
+{ "misc/xilinx_sdfec.h", "XSDFEC_GET_CONFIG", _IOC_READ, 0x6606, 0x1c },
+{ "misc/xilinx_sdfec.h", "XSDFEC_GET_STATS", _IOC_READ, 0x660c, 0x0c },
+{ "misc/xilinx_sdfec.h", "XSDFEC_GET_STATUS", _IOC_READ, 0x6602, 0x08 },
+{ "misc/xilinx_sdfec.h", "XSDFEC_GET_TURBO", _IOC_READ, 0x6607, 0x08 },
+{ "misc/xilinx_sdfec.h", "XSDFEC_IS_ACTIVE", _IOC_READ, 0x660a, 0x01 },
+{ "misc/xilinx_sdfec.h", "XSDFEC_SET_BYPASS", _IOC_WRITE, 0x6609, 0x01 },
+{ "misc/xilinx_sdfec.h", "XSDFEC_SET_DEFAULT_CONFIG", _IOC_NONE, 0x660d, 0x00 },
+{ "misc/xilinx_sdfec.h", "XSDFEC_SET_IRQ", _IOC_WRITE, 0x6603, 0x02 },
+{ "misc/xilinx_sdfec.h", "XSDFEC_SET_ORDER", _IOC_WRITE, 0x6608, 0x04 },
+{ "misc/xilinx_sdfec.h", "XSDFEC_SET_TURBO", _IOC_WRITE, 0x6604, 0x08 },
+{ "misc/xilinx_sdfec.h", "XSDFEC_START_DEV", _IOC_NONE, 0x6600, 0x00 },
+{ "misc/xilinx_sdfec.h", "XSDFEC_STOP_DEV", _IOC_NONE, 0x6601, 0x00 },
+{ "mtd/mtd-abi.h", "ECCGETLAYOUT", _IOC_READ, 0x4d11, 0x148 },
+{ "mtd/mtd-abi.h", "ECCGETSTATS", _IOC_READ, 0x4d12, 0x10 },
+{ "mtd/mtd-abi.h", "MEMERASE", _IOC_WRITE, 0x4d02, 0x08 },
+{ "mtd/mtd-abi.h", "MEMERASE64", _IOC_WRITE, 0x4d14, 0x10 },
+{ "mtd/mtd-abi.h", "MEMGETBADBLOCK", _IOC_WRITE, 0x4d0b, 0x08 },
+{ "mtd/mtd-abi.h", "MEMGETINFO", _IOC_READ, 0x4d01, 0x20 },
+{ "mtd/mtd-abi.h", "MEMGETOOBSEL", _IOC_READ, 0x4d0a, 0xc8 },
+{ "mtd/mtd-abi.h", "MEMGETREGIONCOUNT", _IOC_READ, 0x4d07, 0x04 },
+{ "mtd/mtd-abi.h", "MEMGETREGIONINFO", _IOC_READ|_IOC_WRITE, 0x4d08, 0x10 },
+{ "mtd/mtd-abi.h", "MEMISLOCKED", _IOC_READ, 0x4d17, 0x08 },
+{ "mtd/mtd-abi.h", "MEMLOCK", _IOC_WRITE, 0x4d05, 0x08 },
+{ "mtd/mtd-abi.h", "MEMREADOOB", _IOC_READ|_IOC_WRITE, 0x4d04, 0x0c },
+{ "mtd/mtd-abi.h", "MEMREADOOB64", _IOC_READ|_IOC_WRITE, 0x4d16, 0x18 },
+{ "mtd/mtd-abi.h", "MEMSETBADBLOCK", _IOC_WRITE, 0x4d0c, 0x08 },
+{ "mtd/mtd-abi.h", "MEMUNLOCK", _IOC_WRITE, 0x4d06, 0x08 },
+{ "mtd/mtd-abi.h", "MEMWRITE", _IOC_READ|_IOC_WRITE, 0x4d18, 0x30 },
+{ "mtd/mtd-abi.h", "MEMWRITEOOB", _IOC_READ|_IOC_WRITE, 0x4d03, 0x0c },
+{ "mtd/mtd-abi.h", "MEMWRITEOOB64", _IOC_READ|_IOC_WRITE, 0x4d15, 0x18 },
+{ "mtd/mtd-abi.h", "MTDFILEMODE", _IOC_NONE, 0x4d13, 0x00 },
+{ "mtd/mtd-abi.h", "OTPGETREGIONCOUNT", _IOC_WRITE, 0x4d0e, 0x04 },
+{ "mtd/mtd-abi.h", "OTPGETREGIONINFO", _IOC_WRITE, 0x4d0f, 0x0c },
+{ "mtd/mtd-abi.h", "OTPLOCK", _IOC_READ, 0x4d10, 0x0c },
+{ "mtd/mtd-abi.h", "OTPSELECT", _IOC_READ, 0x4d0d, 0x04 },
+{ "mtd/ubi-user.h", "UBI_IOCATT", _IOC_WRITE, 0x6f40, 0x18 },
+{ "mtd/ubi-user.h", "UBI_IOCDET", _IOC_WRITE, 0x6f41, 0x04 },
+{ "mtd/ubi-user.h", "UBI_IOCEBCH", _IOC_WRITE, 0x4f02, 0x04 },
+{ "mtd/ubi-user.h", "UBI_IOCEBER", _IOC_WRITE, 0x4f01, 0x04 },
+{ "mtd/ubi-user.h", "UBI_IOCEBISMAP", _IOC_READ, 0x4f05, 0x04 },
+{ "mtd/ubi-user.h", "UBI_IOCEBMAP", _IOC_WRITE, 0x4f03, 0x08 },
+{ "mtd/ubi-user.h", "UBI_IOCEBUNMAP", _IOC_WRITE, 0x4f04, 0x04 },
+{ "mtd/ubi-user.h", "UBI_IOCMKVOL", _IOC_WRITE, 0x6f00, 0x98 },
+{ "mtd/ubi-user.h", "UBI_IOCRMVOL", _IOC_WRITE, 0x6f01, 0x04 },
+{ "mtd/ubi-user.h", "UBI_IOCRNVOL", _IOC_WRITE, 0x6f03, 0x1110 },
+{ "mtd/ubi-user.h", "UBI_IOCRPEB", _IOC_WRITE, 0x6f04, 0x04 },
+{ "mtd/ubi-user.h", "UBI_IOCRSVOL", _IOC_WRITE, 0x6f02, 0x0c },
+{ "mtd/ubi-user.h", "UBI_IOCSETVOLPROP", _IOC_WRITE, 0x4f06, 0x10 },
+{ "mtd/ubi-user.h", "UBI_IOCSPEB", _IOC_WRITE, 0x6f05, 0x04 },
+{ "mtd/ubi-user.h", "UBI_IOCVOLCRBLK", _IOC_WRITE, 0x4f07, 0x80 },
+{ "mtd/ubi-user.h", "UBI_IOCVOLRMBLK", _IOC_NONE, 0x4f08, 0x00 },
+{ "mtd/ubi-user.h", "UBI_IOCVOLUP", _IOC_WRITE, 0x4f00, 0x08 },
+{ "net/bluetooth/hci_sock.h", "HCIBLOCKADDR", _IOC_WRITE, 0x48e6, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCIDEVDOWN", _IOC_WRITE, 0x48ca, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCIDEVRESET", _IOC_WRITE, 0x48cb, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCIDEVRESTAT", _IOC_WRITE, 0x48cc, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCIDEVUP", _IOC_WRITE, 0x48c9, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCIGETAUTHINFO", _IOC_READ, 0x48d7, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCIGETCONNINFO", _IOC_READ, 0x48d5, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCIGETCONNLIST", _IOC_READ, 0x48d4, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCIGETDEVINFO", _IOC_READ, 0x48d3, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCIGETDEVLIST", _IOC_READ, 0x48d2, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCIINQUIRY", _IOC_READ, 0x48f0, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCISETACLMTU", _IOC_WRITE, 0x48e3, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCISETAUTH", _IOC_WRITE, 0x48de, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCISETENCRYPT", _IOC_WRITE, 0x48df, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCISETLINKMODE", _IOC_WRITE, 0x48e2, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCISETLINKPOL", _IOC_WRITE, 0x48e1, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCISETPTYPE", _IOC_WRITE, 0x48e0, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCISETRAW", _IOC_WRITE, 0x48dc, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCISETSCAN", _IOC_WRITE, 0x48dd, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCISETSCOMTU", _IOC_WRITE, 0x48e4, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCIUNBLOCKADDR", _IOC_WRITE, 0x48e7, 0x04 },
+{ "net/bluetooth/rfcomm.h", "RFCOMMCREATEDEV", _IOC_WRITE, 0x52c8, 0x04 },
+{ "net/bluetooth/rfcomm.h", "RFCOMMGETDEVINFO", _IOC_READ, 0x52d3, 0x04 },
+{ "net/bluetooth/rfcomm.h", "RFCOMMGETDEVLIST", _IOC_READ, 0x52d2, 0x04 },
+{ "net/bluetooth/rfcomm.h", "RFCOMMRELEASEDEV", _IOC_WRITE, 0x52c9, 0x04 },
+{ "net/bluetooth/rfcomm.h", "RFCOMMSTEALDLC", _IOC_WRITE, 0x52dc, 0x04 },
+{ "net/nfc/nci_core.h", "NCIUARTSETDRIVER", _IOC_WRITE, 0x5500, 0x04 },
+{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_ACK_EVENT", _IOC_WRITE, 0x1bea, 0x04 },
+{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_ASSIGN_CTXT", _IOC_READ|_IOC_WRITE, 0x1be1, 0x1c },
+{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_CREDIT_UPD", _IOC_NONE, 0x1be6, 0x00 },
+{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_CTXT_INFO", _IOC_WRITE, 0x1be2, 0x28 },
+{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_CTXT_RESET", _IOC_NONE, 0x1bec, 0x00 },
+{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_GET_VERS", _IOC_READ, 0x1bee, 0x04 },
+{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_POLL_TYPE", _IOC_WRITE, 0x1be9, 0x04 },
+{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_RECV_CTRL", _IOC_WRITE, 0x1be8, 0x04 },
+{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_SET_PKEY", _IOC_WRITE, 0x1beb, 0x02 },
+{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_TID_FREE", _IOC_READ|_IOC_WRITE, 0x1be5, 0x18 },
+{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_TID_INVAL_READ", _IOC_READ|_IOC_WRITE, 0x1bed, 0x18 },
+{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_TID_UPDATE", _IOC_READ|_IOC_WRITE, 0x1be4, 0x18 },
+{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_USER_INFO", _IOC_WRITE, 0x1be3, 0x78 },
+{ "rdma/rdma_user_ioctl.h", "IB_USER_MAD_ENABLE_PKEY", _IOC_NONE, 0x1b03, 0x00 },
+{ "rdma/rdma_user_ioctl.h", "IB_USER_MAD_REGISTER_AGENT", _IOC_READ|_IOC_WRITE, 0x1b01, 0x1c },
+{ "rdma/rdma_user_ioctl.h", "IB_USER_MAD_REGISTER_AGENT2", _IOC_READ|_IOC_WRITE, 0x1b04, 0x28 },
+{ "rdma/rdma_user_ioctl.h", "IB_USER_MAD_UNREGISTER_AGENT", _IOC_WRITE, 0x1b02, 0x04 },
+{ "rdma/rdma_user_ioctl_cmds.h", "RDMA_VERBS_IOCTL", _IOC_READ|_IOC_WRITE, 0x1b01, 0x18 },
+{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_ATTACH", _IOC_READ|_IOC_WRITE, 0xca80, 0x90 },
+{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_DETACH", _IOC_READ|_IOC_WRITE, 0xca83, 0x60 },
+{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_MANAGE_LUN", _IOC_READ|_IOC_WRITE, 0xca86, 0x68 },
+{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_RECOVER_AFU", _IOC_READ|_IOC_WRITE, 0xca85, 0x78 },
+{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_RELEASE", _IOC_READ|_IOC_WRITE, 0xca82, 0x68 },
+{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_USER_DIRECT", _IOC_READ|_IOC_WRITE, 0xca81, 0x70 },
+{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_USER_VIRTUAL", _IOC_READ|_IOC_WRITE, 0xca87, 0x78 },
+{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_VERIFY", _IOC_READ|_IOC_WRITE, 0xca84, 0x90 },
+{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_VLUN_CLONE", _IOC_READ|_IOC_WRITE, 0xca89, 0x70 },
+{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_VLUN_RESIZE", _IOC_READ|_IOC_WRITE, 0xca88, 0x78 },
+{ "scsi/cxlflash_ioctl.h", "HT_CXLFLASH_AFU_DEBUG", _IOC_READ|_IOC_WRITE, 0xcabe, 0x78 },
+{ "scsi/cxlflash_ioctl.h", "HT_CXLFLASH_LUN_PROVISION", _IOC_READ|_IOC_WRITE, 0xcabf, 0xa0 },
+{ "scsi/scsi.h", "SCSI_IOCTL_GET_BUS_NUMBER", 0, 0x5386, 0 },
+{ "scsi/scsi.h", "SCSI_IOCTL_GET_IDLUN", 0, 0x5382, 0 },
+{ "scsi/scsi.h", "SCSI_IOCTL_GET_PCI", 0, 0x5387, 0 },
+{ "scsi/scsi.h", "SCSI_IOCTL_PROBE_HOST", 0, 0x5385, 0 },
+{ "scsi/scsi_ioctl.h", "SCSI_IOCTL_DOORLOCK", 0, 0x5380, 0 },
+{ "scsi/scsi_ioctl.h", "SCSI_IOCTL_DOORUNLOCK", 0, 0x5381, 0 },
+{ "scsi/sg.h", "SG_EMULATED_HOST", 0, 0x2203, 0 },
+{ "scsi/sg.h", "SG_GET_ACCESS_COUNT", 0, 0x2289, 0 },
+{ "scsi/sg.h", "SG_GET_COMMAND_Q", 0, 0x2270, 0 },
+{ "scsi/sg.h", "SG_GET_KEEP_ORPHAN", 0, 0x2288, 0 },
+{ "scsi/sg.h", "SG_GET_LOW_DMA", 0, 0x227a, 0 },
+{ "scsi/sg.h", "SG_GET_NUM_WAITING", 0, 0x227d, 0 },
+{ "scsi/sg.h", "SG_GET_PACK_ID", 0, 0x227c, 0 },
+{ "scsi/sg.h", "SG_GET_REQUEST_TABLE", 0, 0x2286, 0 },
+{ "scsi/sg.h", "SG_GET_RESERVED_SIZE", 0, 0x2272, 0 },
+{ "scsi/sg.h", "SG_GET_SCSI_ID", 0, 0x2276, 0 },
+{ "scsi/sg.h", "SG_GET_SG_TABLESIZE", 0, 0x227F, 0 },
+{ "scsi/sg.h", "SG_GET_TIMEOUT", 0, 0x2202, 0 },
+{ "scsi/sg.h", "SG_GET_TRANSFORM", 0, 0x2205, 0 },
+{ "scsi/sg.h", "SG_GET_VERSION_NUM", 0, 0x2282, 0 },
+{ "scsi/sg.h", "SG_IO", 0, 0x2285, 0 },
+{ "scsi/sg.h", "SG_NEXT_CMD_LEN", 0, 0x2283, 0 },
+{ "scsi/sg.h", "SG_SCSI_RESET", 0, 0x2284, 0 },
+{ "scsi/sg.h", "SG_SET_COMMAND_Q", 0, 0x2271, 0 },
+{ "scsi/sg.h", "SG_SET_DEBUG", 0, 0x227e, 0 },
+{ "scsi/sg.h", "SG_SET_FORCE_LOW_DMA", 0, 0x2279, 0 },
+{ "scsi/sg.h", "SG_SET_FORCE_PACK_ID", 0, 0x227b, 0 },
+{ "scsi/sg.h", "SG_SET_KEEP_ORPHAN", 0, 0x2287, 0 },
+{ "scsi/sg.h", "SG_SET_RESERVED_SIZE", 0, 0x2275, 0 },
+{ "scsi/sg.h", "SG_SET_TIMEOUT", 0, 0x2201, 0 },
+{ "scsi/sg.h", "SG_SET_TRANSFORM", 0, 0x2204, 0 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_CLIENT_ID", _IOC_READ, 0x5301, 0x04 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_CREATE_PORT", _IOC_READ|_IOC_WRITE, 0x5320, 0xa4 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_CREATE_QUEUE", _IOC_READ|_IOC_WRITE, 0x5332, 0x8c },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_DELETE_PORT", _IOC_WRITE, 0x5321, 0xa4 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_DELETE_QUEUE", _IOC_WRITE, 0x5333, 0x8c },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_CLIENT_INFO", _IOC_READ|_IOC_WRITE, 0x5310, 0xbc },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_CLIENT_POOL", _IOC_READ|_IOC_WRITE, 0x534b, 0x58 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_NAMED_QUEUE", _IOC_READ|_IOC_WRITE, 0x5336, 0x8c },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_PORT_INFO", _IOC_READ|_IOC_WRITE, 0x5322, 0xa4 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_QUEUE_CLIENT", _IOC_READ|_IOC_WRITE, 0x5349, 0x4c },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_QUEUE_INFO", _IOC_READ|_IOC_WRITE, 0x5334, 0x8c },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_QUEUE_STATUS", _IOC_READ|_IOC_WRITE, 0x5340, 0x5c },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_QUEUE_TEMPO", _IOC_READ|_IOC_WRITE, 0x5341, 0x2c },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_QUEUE_TIMER", _IOC_READ|_IOC_WRITE, 0x5345, 0x60 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_SUBSCRIPTION", _IOC_READ|_IOC_WRITE, 0x5350, 0x50 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_PVERSION", _IOC_READ, 0x5300, 0x04 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_QUERY_NEXT_CLIENT", _IOC_READ|_IOC_WRITE, 0x5351, 0xbc },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_QUERY_NEXT_PORT", _IOC_READ|_IOC_WRITE, 0x5352, 0xa4 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_QUERY_SUBS", _IOC_READ|_IOC_WRITE, 0x534f, 0x58 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_REMOVE_EVENTS", _IOC_WRITE, 0x534e, 0x40 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_RUNNING_MODE", _IOC_READ|_IOC_WRITE, 0x5303, 0x10 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SET_CLIENT_INFO", _IOC_WRITE, 0x5311, 0xbc },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SET_CLIENT_POOL", _IOC_WRITE, 0x534c, 0x58 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SET_PORT_INFO", _IOC_WRITE, 0x5323, 0xa4 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SET_QUEUE_CLIENT", _IOC_WRITE, 0x534a, 0x4c },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SET_QUEUE_INFO", _IOC_READ|_IOC_WRITE, 0x5335, 0x8c },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SET_QUEUE_TEMPO", _IOC_WRITE, 0x5342, 0x2c },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SET_QUEUE_TIMER", _IOC_WRITE, 0x5346, 0x60 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SUBSCRIBE_PORT", _IOC_WRITE, 0x5330, 0x50 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SYSTEM_INFO", _IOC_READ|_IOC_WRITE, 0x5302, 0x30 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_UNSUBSCRIBE_PORT", _IOC_WRITE, 0x5331, 0x50 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_CARD_INFO", _IOC_READ, 0x5501, 0x178 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_ADD", _IOC_READ|_IOC_WRITE, 0x5517, 0x110 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_INFO", _IOC_READ|_IOC_WRITE, 0x5511, 0x110 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_LIST", _IOC_READ|_IOC_WRITE, 0x5510, 0x48 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_LOCK", _IOC_WRITE, 0x5514, 0x40 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_READ", _IOC_READ|_IOC_WRITE, 0x5512, 0x2c4 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_REMOVE", _IOC_READ|_IOC_WRITE, 0x5519, 0x40 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_REPLACE", _IOC_READ|_IOC_WRITE, 0x5518, 0x110 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_UNLOCK", _IOC_WRITE, 0x5515, 0x40 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_WRITE", _IOC_READ|_IOC_WRITE, 0x5513, 0x2c4 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_HWDEP_INFO", _IOC_READ, 0x5521, 0xdc },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_HWDEP_NEXT_DEVICE", _IOC_READ|_IOC_WRITE, 0x5520, 0x04 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_PCM_INFO", _IOC_READ|_IOC_WRITE, 0x5531, 0x120 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_PCM_NEXT_DEVICE", _IOC_READ, 0x5530, 0x04 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_PCM_PREFER_SUBDEVICE", _IOC_WRITE, 0x5532, 0x04 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_POWER", _IOC_READ|_IOC_WRITE, 0x55d0, 0x04 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_POWER_STATE", _IOC_READ, 0x55d1, 0x04 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_PVERSION", _IOC_READ, 0x5500, 0x04 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_RAWMIDI_INFO", _IOC_READ|_IOC_WRITE, 0x5541, 0x10c },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_RAWMIDI_NEXT_DEVICE", _IOC_READ|_IOC_WRITE, 0x5540, 0x04 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_RAWMIDI_PREFER_SUBDEVICE", _IOC_WRITE, 0x5542, 0x04 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_SUBSCRIBE_EVENTS", _IOC_READ|_IOC_WRITE, 0x5516, 0x04 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_TLV_COMMAND", _IOC_READ|_IOC_WRITE, 0x551c, 0x08 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_TLV_READ", _IOC_READ|_IOC_WRITE, 0x551a, 0x08 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_TLV_WRITE", _IOC_READ|_IOC_WRITE, 0x551b, 0x08 },
+{ "sound/asound.h", "SNDRV_HWDEP_IOCTL_DSP_LOAD", _IOC_WRITE, 0x4803, 0x50 },
+{ "sound/asound.h", "SNDRV_HWDEP_IOCTL_DSP_STATUS", _IOC_READ, 0x4802, 0x40 },
+{ "sound/asound.h", "SNDRV_HWDEP_IOCTL_INFO", _IOC_READ, 0x4801, 0xdc },
+{ "sound/asound.h", "SNDRV_HWDEP_IOCTL_PVERSION", _IOC_READ, 0x4800, 0x04 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_CHANNEL_INFO", _IOC_READ, 0x4132, 0x10 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_DELAY", _IOC_READ, 0x4121, 0x04 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_DRAIN", _IOC_NONE, 0x4144, 0x00 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_DROP", _IOC_NONE, 0x4143, 0x00 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_FORWARD", _IOC_WRITE, 0x4149, 0x04 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_HWSYNC", _IOC_NONE, 0x4122, 0x00 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_HW_FREE", _IOC_NONE, 0x4112, 0x00 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_HW_PARAMS", _IOC_READ|_IOC_WRITE, 0x4111, 0x25c },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_HW_REFINE", _IOC_READ|_IOC_WRITE, 0x4110, 0x25c },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_INFO", _IOC_READ, 0x4101, 0x120 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_LINK", _IOC_WRITE, 0x4160, 0x04 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_PAUSE", _IOC_WRITE, 0x4145, 0x04 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_PREPARE", _IOC_NONE, 0x4140, 0x00 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_PVERSION", _IOC_READ, 0x4100, 0x04 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_READI_FRAMES", _IOC_READ, 0x4151, 0x0c },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_READN_FRAMES", _IOC_READ, 0x4153, 0x0c },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_RESET", _IOC_NONE, 0x4141, 0x00 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_RESUME", _IOC_NONE, 0x4147, 0x00 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_REWIND", _IOC_WRITE, 0x4146, 0x04 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_START", _IOC_NONE, 0x4142, 0x00 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_STATUS", _IOC_READ, 0x4120, 0x6c },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_STATUS_EXT", _IOC_READ|_IOC_WRITE, 0x4124, 0x6c },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_SW_PARAMS", _IOC_READ|_IOC_WRITE, 0x4113, 0x68 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_SYNC_PTR", _IOC_READ|_IOC_WRITE, 0x4123, 0x84 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_TSTAMP", _IOC_WRITE, 0x4102, 0x04 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_TTSTAMP", _IOC_WRITE, 0x4103, 0x04 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_UNLINK", _IOC_NONE, 0x4161, 0x00 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_USER_PVERSION", _IOC_WRITE, 0x4104, 0x04 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_WRITEI_FRAMES", _IOC_WRITE, 0x4150, 0x0c },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_WRITEN_FRAMES", _IOC_WRITE, 0x4152, 0x0c },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_XRUN", _IOC_NONE, 0x4148, 0x00 },
+{ "sound/asound.h", "SNDRV_RAWMIDI_IOCTL_DRAIN", _IOC_WRITE, 0x5731, 0x04 },
+{ "sound/asound.h", "SNDRV_RAWMIDI_IOCTL_DROP", _IOC_WRITE, 0x5730, 0x04 },
+{ "sound/asound.h", "SNDRV_RAWMIDI_IOCTL_INFO", _IOC_READ, 0x5701, 0x10c },
+{ "sound/asound.h", "SNDRV_RAWMIDI_IOCTL_PARAMS", _IOC_READ|_IOC_WRITE, 0x5710, 0x20 },
+{ "sound/asound.h", "SNDRV_RAWMIDI_IOCTL_PVERSION", _IOC_READ, 0x5700, 0x04 },
+{ "sound/asound.h", "SNDRV_RAWMIDI_IOCTL_STATUS", _IOC_READ|_IOC_WRITE, 0x5720, 0x24 },
+{ "sound/asound.h", "SNDRV_TIMER_IOCTL_CONTINUE", _IOC_NONE, 0x54a2, 0x00 },
+{ "sound/asound.h", "SNDRV_TIMER_IOCTL_GINFO", _IOC_READ|_IOC_WRITE, 0x5403, 0xe0 },
+{ "sound/asound.h", "SNDRV_TIMER_IOCTL_GPARAMS", _IOC_WRITE, 0x5404, 0x3c },
+{ "sound/asound.h", "SNDRV_TIMER_IOCTL_GSTATUS", _IOC_READ|_IOC_WRITE, 0x5405, 0x40 },
+{ "sound/asound.h", "SNDRV_TIMER_IOCTL_INFO", _IOC_READ, 0x5411, 0xe0 },
+{ "sound/asound.h", "SNDRV_TIMER_IOCTL_NEXT_DEVICE", _IOC_READ|_IOC_WRITE, 0x5401, 0x14 },
+{ "sound/asound.h", "SNDRV_TIMER_IOCTL_PARAMS", _IOC_WRITE, 0x5412, 0x50 },
+{ "sound/asound.h", "SNDRV_TIMER_IOCTL_PAUSE", _IOC_NONE, 0x54a3, 0x00 },
+{ "sound/asound.h", "SNDRV_TIMER_IOCTL_PVERSION", _IOC_READ, 0x5400, 0x04 },
+{ "sound/asound.h", "SNDRV_TIMER_IOCTL_SELECT", _IOC_WRITE, 0x5410, 0x34 },
+{ "sound/asound.h", "SNDRV_TIMER_IOCTL_START", _IOC_NONE, 0x54a0, 0x00 },
+{ "sound/asound.h", "SNDRV_TIMER_IOCTL_STATUS", _IOC_READ, 0x5414, 0x58 },
+{ "sound/asound.h", "SNDRV_TIMER_IOCTL_STOP", _IOC_NONE, 0x54a1, 0x00 },
+{ "sound/asound.h", "SNDRV_TIMER_IOCTL_TREAD64", _IOC_WRITE, 0x54a4, 0x04 },
+{ "sound/asound.h", "SNDRV_TIMER_IOCTL_TREAD_OLD", _IOC_WRITE, 0x5402, 0x04 },
+{ "sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_CLEAR_PATCHES", _IOC_NONE, 0x4840, 0x00 },
+{ "sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_INFO", _IOC_READ, 0x4820, 0x02 },
+{ "sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_PLAY_NOTE", _IOC_WRITE, 0x4822, 0x0c },
+{ "sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_RESET", _IOC_NONE, 0x4821, 0x00 },
+{ "sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_SET_CONNECTION", _IOC_WRITE, 0x4826, 0x04 },
+{ "sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_SET_MODE", _IOC_WRITE, 0x4825, 0x04 },
+{ "sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_SET_PARAMS", _IOC_WRITE, 0x4824, 0x09 },
+{ "sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_SET_VOICE", _IOC_WRITE, 0x4823, 0x12 },
+{ "sound/compress_offload.h", "SNDRV_COMPRESS_AVAIL", _IOC_READ, 0x4321, 0x1c },
+{ "sound/compress_offload.h", "SNDRV_COMPRESS_DRAIN", _IOC_NONE, 0x4334, 0x00 },
+{ "sound/compress_offload.h", "SNDRV_COMPRESS_GET_CAPS", _IOC_READ|_IOC_WRITE, 0x4310, 0xc4 },
+{ "sound/compress_offload.h", "SNDRV_COMPRESS_GET_CODEC_CAPS", _IOC_READ|_IOC_WRITE, 0x4311, 0x2b88 },
+{ "sound/compress_offload.h", "SNDRV_COMPRESS_GET_METADATA", _IOC_READ|_IOC_WRITE, 0x4315, 0x24 },
+{ "sound/compress_offload.h", "SNDRV_COMPRESS_GET_PARAMS", _IOC_READ, 0x4313, 0x78 },
+{ "sound/compress_offload.h", "SNDRV_COMPRESS_IOCTL_VERSION", _IOC_READ, 0x4300, 0x04 },
+{ "sound/compress_offload.h", "SNDRV_COMPRESS_NEXT_TRACK", _IOC_NONE, 0x4335, 0x00 },
+{ "sound/compress_offload.h", "SNDRV_COMPRESS_PARTIAL_DRAIN", _IOC_NONE, 0x4336, 0x00 },
+{ "sound/compress_offload.h", "SNDRV_COMPRESS_PAUSE", _IOC_NONE, 0x4330, 0x00 },
+{ "sound/compress_offload.h", "SNDRV_COMPRESS_RESUME", _IOC_NONE, 0x4331, 0x00 },
+{ "sound/compress_offload.h", "SNDRV_COMPRESS_SET_METADATA", _IOC_WRITE, 0x4314, 0x24 },
+{ "sound/compress_offload.h", "SNDRV_COMPRESS_SET_PARAMS", _IOC_WRITE, 0x4312, 0x84 },
+{ "sound/compress_offload.h", "SNDRV_COMPRESS_START", _IOC_NONE, 0x4332, 0x00 },
+{ "sound/compress_offload.h", "SNDRV_COMPRESS_STOP", _IOC_NONE, 0x4333, 0x00 },
+{ "sound/compress_offload.h", "SNDRV_COMPRESS_TSTAMP", _IOC_READ, 0x4320, 0x14 },
+{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_CODE_PEEK", _IOC_READ|_IOC_WRITE, 0x4812, 0x18c },
+{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_CODE_POKE", _IOC_WRITE, 0x4811, 0x18c },
+{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_CONTINUE", _IOC_NONE, 0x4881, 0x00 },
+{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_DBG_READ", _IOC_READ, 0x4884, 0x04 },
+{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_INFO", _IOC_READ, 0x4810, 0x80c },
+{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_PCM_PEEK", _IOC_READ|_IOC_WRITE, 0x4831, 0x48 },
+{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_PCM_POKE", _IOC_WRITE, 0x4830, 0x48 },
+{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_PVERSION", _IOC_READ, 0x4840, 0x04 },
+{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_SINGLE_STEP", _IOC_WRITE, 0x4883, 0x04 },
+{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_STOP", _IOC_NONE, 0x4880, 0x00 },
+{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_TRAM_PEEK", _IOC_READ|_IOC_WRITE, 0x4822, 0x0c },
+{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_TRAM_POKE", _IOC_WRITE, 0x4821, 0x0c },
+{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_TRAM_SETUP", _IOC_WRITE, 0x4820, 0x04 },
+{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_ZERO_TRAM_COUNTER", _IOC_NONE, 0x4882, 0x00 },
+{ "sound/firewire.h", "SNDRV_FIREWIRE_IOCTL_GET_INFO", _IOC_READ, 0x48f8, 0x20 },
+{ "sound/firewire.h", "SNDRV_FIREWIRE_IOCTL_LOCK", _IOC_NONE, 0x48f9, 0x00 },
+{ "sound/firewire.h", "SNDRV_FIREWIRE_IOCTL_TASCAM_STATE", _IOC_READ, 0x48fb, 0x100 },
+{ "sound/firewire.h", "SNDRV_FIREWIRE_IOCTL_UNLOCK", _IOC_NONE, 0x48fa, 0x00 },
+{ "sound/hda_hwdep.h", "HDA_IOCTL_GET_WCAP", _IOC_READ|_IOC_WRITE, 0x4812, 0x08 },
+{ "sound/hda_hwdep.h", "HDA_IOCTL_PVERSION", _IOC_READ, 0x4810, 0x04 },
+{ "sound/hda_hwdep.h", "HDA_IOCTL_VERB_WRITE", _IOC_READ|_IOC_WRITE, 0x4811, 0x08 },
+{ "sound/hdsp.h", "SNDRV_HDSP_IOCTL_GET_9632_AEB", _IOC_READ, 0x4845, 0x08 },
+{ "sound/hdsp.h", "SNDRV_HDSP_IOCTL_GET_CONFIG_INFO", _IOC_READ, 0x4841, 0x24 },
+{ "sound/hdsp.h", "SNDRV_HDSP_IOCTL_GET_MIXER", _IOC_READ, 0x4844, 0x1000 },
+{ "sound/hdsp.h", "SNDRV_HDSP_IOCTL_GET_PEAK_RMS", _IOC_READ, 0x4840, 0x3b0 },
+{ "sound/hdsp.h", "SNDRV_HDSP_IOCTL_GET_VERSION", _IOC_READ, 0x4843, 0x08 },
+{ "sound/hdsp.h", "SNDRV_HDSP_IOCTL_UPLOAD_FIRMWARE", _IOC_WRITE, 0x4842, 0x04 },
+{ "sound/hdspm.h", "SNDRV_HDSPM_IOCTL_GET_CONFIG", _IOC_READ, 0x4841, 0x18 },
+{ "sound/hdspm.h", "SNDRV_HDSPM_IOCTL_GET_LTC", _IOC_READ, 0x4846, 0x10 },
+{ "sound/hdspm.h", "SNDRV_HDSPM_IOCTL_GET_MIXER", _IOC_READ, 0x4844, 0x04 },
+{ "sound/hdspm.h", "SNDRV_HDSPM_IOCTL_GET_PEAK_RMS", _IOC_READ, 0x4842, 0x908 },
+{ "sound/hdspm.h", "SNDRV_HDSPM_IOCTL_GET_STATUS", _IOC_READ, 0x4847, 0x1c },
+{ "sound/hdspm.h", "SNDRV_HDSPM_IOCTL_GET_VERSION", _IOC_READ, 0x4848, 0x24 },
+{ "sound/pcm.h", "SNDRV_PCM_IOCTL_STATUS32", _IOC_READ, 0x4120, 0x6c },
+{ "sound/pcm.h", "SNDRV_PCM_IOCTL_STATUS64", _IOC_READ, 0x4120, 0x80 },
+{ "sound/pcm.h", "SNDRV_PCM_IOCTL_STATUS_EXT32", _IOC_READ|_IOC_WRITE, 0x4124, 0x6c },
+{ "sound/pcm.h", "SNDRV_PCM_IOCTL_STATUS_EXT64", _IOC_READ|_IOC_WRITE, 0x4124, 0x80 },
+{ "sound/sb16_csp.h", "SNDRV_SB_CSP_IOCTL_INFO", _IOC_READ, 0x4810, 0x28 },
+{ "sound/sb16_csp.h", "SNDRV_SB_CSP_IOCTL_LOAD_CODE", _IOC_WRITE, 0x4811, 0x3012 },
+{ "sound/sb16_csp.h", "SNDRV_SB_CSP_IOCTL_PAUSE", _IOC_NONE, 0x4815, 0x00 },
+{ "sound/sb16_csp.h", "SNDRV_SB_CSP_IOCTL_RESTART", _IOC_NONE, 0x4816, 0x00 },
+{ "sound/sb16_csp.h", "SNDRV_SB_CSP_IOCTL_START", _IOC_WRITE, 0x4813, 0x08 },
+{ "sound/sb16_csp.h", "SNDRV_SB_CSP_IOCTL_STOP", _IOC_NONE, 0x4814, 0x00 },
+{ "sound/sb16_csp.h", "SNDRV_SB_CSP_IOCTL_UNLOAD_CODE", _IOC_NONE, 0x4812, 0x00 },
+{ "sound/sfnt_info.h", "SNDRV_EMUX_IOCTL_LOAD_PATCH", _IOC_READ|_IOC_WRITE, 0x4881, 0x10 },
+{ "sound/sfnt_info.h", "SNDRV_EMUX_IOCTL_MEM_AVAIL", _IOC_WRITE, 0x4884, 0x04 },
+{ "sound/sfnt_info.h", "SNDRV_EMUX_IOCTL_MISC_MODE", _IOC_READ|_IOC_WRITE, 0x4884, 0x10 },
+{ "sound/sfnt_info.h", "SNDRV_EMUX_IOCTL_REMOVE_LAST_SAMPLES", _IOC_NONE, 0x4883, 0x00 },
+{ "sound/sfnt_info.h", "SNDRV_EMUX_IOCTL_RESET_SAMPLES", _IOC_NONE, 0x4882, 0x00 },
+{ "sound/sfnt_info.h", "SNDRV_EMUX_IOCTL_VERSION", _IOC_READ, 0x4880, 0x04 },
+{ "sound/usb_stream.h", "SNDRV_USB_STREAM_IOCTL_SET_PARAMS", _IOC_WRITE, 0x4890, 0x10 },
+{ "staging/android/ashmem.h", "ASHMEM_GET_NAME", _IOC_READ, 0x7702, 0x100 },
+{ "staging/android/ashmem.h", "ASHMEM_GET_PIN_STATUS", _IOC_NONE, 0x7709, 0x00 },
+{ "staging/android/ashmem.h", "ASHMEM_GET_PROT_MASK", _IOC_NONE, 0x7706, 0x00 },
+{ "staging/android/ashmem.h", "ASHMEM_GET_SIZE", _IOC_NONE, 0x7704, 0x00 },
+{ "staging/android/ashmem.h", "ASHMEM_PIN", _IOC_WRITE, 0x7707, 0x08 },
+{ "staging/android/ashmem.h", "ASHMEM_PURGE_ALL_CACHES", _IOC_NONE, 0x770a, 0x00 },
+{ "staging/android/ashmem.h", "ASHMEM_SET_NAME", _IOC_WRITE, 0x7701, 0x100 },
+{ "staging/android/ashmem.h", "ASHMEM_SET_PROT_MASK", _IOC_WRITE, 0x7705, 0x04 },
+{ "staging/android/ashmem.h", "ASHMEM_SET_SIZE", _IOC_WRITE, 0x7703, 0x04 },
+{ "staging/android/ashmem.h", "ASHMEM_UNPIN", _IOC_WRITE, 0x7708, 0x08 },
+{ "staging/android/ion.h", "ION_IOC_ALLOC", _IOC_READ|_IOC_WRITE, 0x4900, 0x18 },
+{ "staging/android/ion.h", "ION_IOC_HEAP_QUERY", _IOC_READ|_IOC_WRITE, 0x4908, 0x18 },
+{ "video/da8xx-fb.h", "FBIGET_BRIGHTNESS", _IOC_READ, 0x4603, 0x04 },
+{ "video/da8xx-fb.h", "FBIGET_COLOR", _IOC_READ, 0x4605, 0x04 },
+{ "video/da8xx-fb.h", "FBIOGET_CONTRAST", _IOC_READ, 0x4601, 0x04 },
+{ "video/da8xx-fb.h", "FBIOPUT_CONTRAST", _IOC_WRITE, 0x4602, 0x04 },
+{ "video/da8xx-fb.h", "FBIPUT_BRIGHTNESS", _IOC_WRITE, 0x4603, 0x04 },
+{ "video/da8xx-fb.h", "FBIPUT_COLOR", _IOC_WRITE, 0x4606, 0x04 },
+{ "video/da8xx-fb.h", "FBIPUT_HSYNC", _IOC_WRITE, 0x4609, 0x04 },
+{ "video/da8xx-fb.h", "FBIPUT_VSYNC", _IOC_WRITE, 0x460a, 0x04 },
+{ "video/kyro.h", "KYRO_IOCTL_OVERLAY_CREATE", _IOC_NONE, 0x6b00, 0x00 },
+{ "video/kyro.h", "KYRO_IOCTL_OVERLAY_OFFSET", _IOC_NONE, 0x6b04, 0x00 },
+{ "video/kyro.h", "KYRO_IOCTL_OVERLAY_VIEWPORT_SET", _IOC_NONE, 0x6b01, 0x00 },
+{ "video/kyro.h", "KYRO_IOCTL_SET_VIDEO_MODE", _IOC_NONE, 0x6b02, 0x00 },
+{ "video/kyro.h", "KYRO_IOCTL_STRIDE", _IOC_NONE, 0x6b05, 0x00 },
+{ "video/kyro.h", "KYRO_IOCTL_UVSTRIDE", _IOC_NONE, 0x6b03, 0x00 },
+{ "video/sisfb.h", "SISFB_COMMAND", _IOC_READ|_IOC_WRITE, 0xf305, 0x54 },
+{ "video/sisfb.h", "SISFB_GET_AUTOMAXIMIZE", _IOC_READ, 0xf303, 0x04 },
+{ "video/sisfb.h", "SISFB_GET_AUTOMAXIMIZE_OLD", _IOC_READ, 0x6efa, 0x04 },
+{ "video/sisfb.h", "SISFB_GET_INFO", _IOC_READ, 0xf301, 0x11c },
+{ "video/sisfb.h", "SISFB_GET_INFO_OLD", _IOC_READ, 0x6ef8, 0x04 },
+{ "video/sisfb.h", "SISFB_GET_INFO_SIZE", _IOC_READ, 0xf300, 0x04 },
+{ "video/sisfb.h", "SISFB_GET_TVPOSOFFSET", _IOC_READ, 0xf304, 0x04 },
+{ "video/sisfb.h", "SISFB_GET_VBRSTATUS", _IOC_READ, 0xf302, 0x04 },
+{ "video/sisfb.h", "SISFB_GET_VBRSTATUS_OLD", _IOC_READ, 0x6ef9, 0x04 },
+{ "video/sisfb.h", "SISFB_SET_AUTOMAXIMIZE", _IOC_WRITE, 0xf303, 0x04 },
+{ "video/sisfb.h", "SISFB_SET_AUTOMAXIMIZE_OLD", _IOC_WRITE, 0x6efa, 0x04 },
+{ "video/sisfb.h", "SISFB_SET_LOCK", _IOC_WRITE, 0xf306, 0x04 },
+{ "video/sisfb.h", "SISFB_SET_TVPOSOFFSET", _IOC_WRITE, 0xf304, 0x04 },
+{ "video/sstfb.h", "SSTFB_GET_VGAPASS", _IOC_READ, 0x46dd, 0x04 },
+{ "video/sstfb.h", "SSTFB_SET_VGAPASS", _IOC_WRITE, 0x46dd, 0x04 },
+{ "xen/evtchn.h", "IOCTL_EVTCHN_BIND_INTERDOMAIN", _IOC_NONE, 0x4501, 0x08 },
+{ "xen/evtchn.h", "IOCTL_EVTCHN_BIND_UNBOUND_PORT", _IOC_NONE, 0x4502, 0x04 },
+{ "xen/evtchn.h", "IOCTL_EVTCHN_BIND_VIRQ", _IOC_NONE, 0x4500, 0x04 },
+{ "xen/evtchn.h", "IOCTL_EVTCHN_NOTIFY", _IOC_NONE, 0x4504, 0x04 },
+{ "xen/evtchn.h", "IOCTL_EVTCHN_RESET", _IOC_NONE, 0x4505, 0x00 },
+{ "xen/evtchn.h", "IOCTL_EVTCHN_RESTRICT_DOMID", _IOC_NONE, 0x4506, 0x02 },
+{ "xen/evtchn.h", "IOCTL_EVTCHN_UNBIND", _IOC_NONE, 0x4503, 0x04 },
+{ "xen/gntdev.h", "IOCTL_GNTDEV_DMABUF_EXP_FROM_REFS", _IOC_NONE, 0x4709, 0x14 },
+{ "xen/gntdev.h", "IOCTL_GNTDEV_DMABUF_EXP_WAIT_RELEASED", _IOC_NONE, 0x470a, 0x08 },
+{ "xen/gntdev.h", "IOCTL_GNTDEV_DMABUF_IMP_RELEASE", _IOC_NONE, 0x470c, 0x08 },
+{ "xen/gntdev.h", "IOCTL_GNTDEV_DMABUF_IMP_TO_REFS", _IOC_NONE, 0x470b, 0x14 },
+{ "xen/gntdev.h", "IOCTL_GNTDEV_GET_OFFSET_FOR_VADDR", _IOC_NONE, 0x4702, 0x18 },
+{ "xen/gntdev.h", "IOCTL_GNTDEV_GRANT_COPY", _IOC_NONE, 0x4708, 0x08 },
+{ "xen/gntdev.h", "IOCTL_GNTDEV_MAP_GRANT_REF", _IOC_NONE, 0x4700, 0x18 },
+{ "xen/gntdev.h", "IOCTL_GNTDEV_SET_MAX_GRANTS", _IOC_NONE, 0x4703, 0x04 },
+{ "xen/gntdev.h", "IOCTL_GNTDEV_SET_UNMAP_NOTIFY", _IOC_NONE, 0x4707, 0x10 },
+{ "xen/gntdev.h", "IOCTL_GNTDEV_UNMAP_GRANT_REF", _IOC_NONE, 0x4701, 0x10 },
+{ "xen/xenbus_dev.h", "IOCTL_XENBUS_BACKEND_EVTCHN", _IOC_NONE, 0x4200, 0x00 },
+{ "xen/xenbus_dev.h", "IOCTL_XENBUS_BACKEND_SETUP", _IOC_NONE, 0x4201, 0x00 },
diff --git a/src/linux/32/ioctls_inc_align64.h b/src/linux/32/ioctls_inc_align64.h
new file mode 100644
index 000000000..6546c1f9f
--- /dev/null
+++ b/src/linux/32/ioctls_inc_align64.h
@@ -0,0 +1,2914 @@
+/* Generated by ioctls_gen.sh from definitions found in $linux/include/ tree. */
+{ "acpi/apei.h", "APEI_ERST_CLEAR_RECORD", _IOC_WRITE, 0x4501, 0x08 },
+{ "acpi/apei.h", "APEI_ERST_GET_RECORD_COUNT", _IOC_READ, 0x4502, 0x04 },
+{ "asm-generic/ioctls.h", "FIOASYNC", 0, 0x5452, 0 },
+{ "asm-generic/ioctls.h", "FIOCLEX", 0, 0x5451, 0 },
+{ "asm-generic/ioctls.h", "FIONBIO", 0, 0x5421, 0 },
+{ "asm-generic/ioctls.h", "FIONCLEX", 0, 0x5450, 0 },
+{ "asm-generic/ioctls.h", "FIONREAD", 0, 0x541B, 0 },
+{ "asm-generic/ioctls.h", "FIOQSIZE", 0, 0x5460, 0 },
+{ "asm-generic/ioctls.h", "TCFLSH", 0, 0x540B, 0 },
+{ "asm-generic/ioctls.h", "TCGETA", 0, 0x5405, 0 },
+{ "asm-generic/ioctls.h", "TCGETS", 0, 0x5401, 0 },
+{ "asm-generic/ioctls.h", "TCGETS2", _IOC_READ, 0x542a, 0x2c },
+{ "asm-generic/ioctls.h", "TCGETX", 0, 0x5432, 0 },
+{ "asm-generic/ioctls.h", "TCSBRK", 0, 0x5409, 0 },
+{ "asm-generic/ioctls.h", "TCSBRKP", 0, 0x5425, 0 },
+{ "asm-generic/ioctls.h", "TCSETA", 0, 0x5406, 0 },
+{ "asm-generic/ioctls.h", "TCSETAF", 0, 0x5408, 0 },
+{ "asm-generic/ioctls.h", "TCSETAW", 0, 0x5407, 0 },
+{ "asm-generic/ioctls.h", "TCSETS", 0, 0x5402, 0 },
+{ "asm-generic/ioctls.h", "TCSETS2", _IOC_WRITE, 0x542b, 0x2c },
+{ "asm-generic/ioctls.h", "TCSETSF", 0, 0x5404, 0 },
+{ "asm-generic/ioctls.h", "TCSETSF2", _IOC_WRITE, 0x542d, 0x2c },
+{ "asm-generic/ioctls.h", "TCSETSW", 0, 0x5403, 0 },
+{ "asm-generic/ioctls.h", "TCSETSW2", _IOC_WRITE, 0x542c, 0x2c },
+{ "asm-generic/ioctls.h", "TCSETX", 0, 0x5433, 0 },
+{ "asm-generic/ioctls.h", "TCSETXF", 0, 0x5434, 0 },
+{ "asm-generic/ioctls.h", "TCSETXW", 0, 0x5435, 0 },
+{ "asm-generic/ioctls.h", "TCXONC", 0, 0x540A, 0 },
+{ "asm-generic/ioctls.h", "TIOCCBRK", 0, 0x5428, 0 },
+{ "asm-generic/ioctls.h", "TIOCCONS", 0, 0x541D, 0 },
+{ "asm-generic/ioctls.h", "TIOCEXCL", 0, 0x540C, 0 },
+{ "asm-generic/ioctls.h", "TIOCGDEV", _IOC_READ, 0x5432, 0x04 },
+{ "asm-generic/ioctls.h", "TIOCGETD", 0, 0x5424, 0 },
+{ "asm-generic/ioctls.h", "TIOCGEXCL", _IOC_READ, 0x5440, 0x04 },
+{ "asm-generic/ioctls.h", "TIOCGICOUNT", 0, 0x545D, 0 },
+{ "asm-generic/ioctls.h", "TIOCGISO7816", _IOC_READ, 0x5442, 0x28 },
+{ "asm-generic/ioctls.h", "TIOCGLCKTRMIOS", 0, 0x5456, 0 },
+{ "asm-generic/ioctls.h", "TIOCGPGRP", 0, 0x540F, 0 },
+{ "asm-generic/ioctls.h", "TIOCGPKT", _IOC_READ, 0x5438, 0x04 },
+{ "asm-generic/ioctls.h", "TIOCGPTLCK", _IOC_READ, 0x5439, 0x04 },
+{ "asm-generic/ioctls.h", "TIOCGPTN", _IOC_READ, 0x5430, 0x04 },
+{ "asm-generic/ioctls.h", "TIOCGPTPEER", _IOC_NONE, 0x5441, 0x00 },
+{ "asm-generic/ioctls.h", "TIOCGRS485", 0, 0x542E, 0 },
+{ "asm-generic/ioctls.h", "TIOCGSERIAL", 0, 0x541E, 0 },
+{ "asm-generic/ioctls.h", "TIOCGSID", 0, 0x5429, 0 },
+{ "asm-generic/ioctls.h", "TIOCGSOFTCAR", 0, 0x5419, 0 },
+{ "asm-generic/ioctls.h", "TIOCGWINSZ", 0, 0x5413, 0 },
+{ "asm-generic/ioctls.h", "TIOCLINUX", 0, 0x541C, 0 },
+{ "asm-generic/ioctls.h", "TIOCMBIC", 0, 0x5417, 0 },
+{ "asm-generic/ioctls.h", "TIOCMBIS", 0, 0x5416, 0 },
+{ "asm-generic/ioctls.h", "TIOCMGET", 0, 0x5415, 0 },
+{ "asm-generic/ioctls.h", "TIOCMIWAIT", 0, 0x545C, 0 },
+{ "asm-generic/ioctls.h", "TIOCMSET", 0, 0x5418, 0 },
+{ "asm-generic/ioctls.h", "TIOCNOTTY", 0, 0x5422, 0 },
+{ "asm-generic/ioctls.h", "TIOCNXCL", 0, 0x540D, 0 },
+{ "asm-generic/ioctls.h", "TIOCOUTQ", 0, 0x5411, 0 },
+{ "asm-generic/ioctls.h", "TIOCPKT", 0, 0x5420, 0 },
+{ "asm-generic/ioctls.h", "TIOCSBRK", 0, 0x5427, 0 },
+{ "asm-generic/ioctls.h", "TIOCSCTTY", 0, 0x540E, 0 },
+{ "asm-generic/ioctls.h", "TIOCSERCONFIG", 0, 0x5453, 0 },
+{ "asm-generic/ioctls.h", "TIOCSERGETLSR", 0, 0x5459, 0 },
+{ "asm-generic/ioctls.h", "TIOCSERGETMULTI", 0, 0x545A, 0 },
+{ "asm-generic/ioctls.h", "TIOCSERGSTRUCT", 0, 0x5458, 0 },
+{ "asm-generic/ioctls.h", "TIOCSERGWILD", 0, 0x5454, 0 },
+{ "asm-generic/ioctls.h", "TIOCSERSETMULTI", 0, 0x545B, 0 },
+{ "asm-generic/ioctls.h", "TIOCSERSWILD", 0, 0x5455, 0 },
+{ "asm-generic/ioctls.h", "TIOCSETD", 0, 0x5423, 0 },
+{ "asm-generic/ioctls.h", "TIOCSIG", _IOC_WRITE, 0x5436, 0x04 },
+{ "asm-generic/ioctls.h", "TIOCSISO7816", _IOC_READ|_IOC_WRITE, 0x5443, 0x28 },
+{ "asm-generic/ioctls.h", "TIOCSLCKTRMIOS", 0, 0x5457, 0 },
+{ "asm-generic/ioctls.h", "TIOCSPGRP", 0, 0x5410, 0 },
+{ "asm-generic/ioctls.h", "TIOCSPTLCK", _IOC_WRITE, 0x5431, 0x04 },
+{ "asm-generic/ioctls.h", "TIOCSRS485", 0, 0x542F, 0 },
+{ "asm-generic/ioctls.h", "TIOCSSERIAL", 0, 0x541F, 0 },
+{ "asm-generic/ioctls.h", "TIOCSSOFTCAR", 0, 0x541A, 0 },
+{ "asm-generic/ioctls.h", "TIOCSTI", 0, 0x5412, 0 },
+{ "asm-generic/ioctls.h", "TIOCSWINSZ", 0, 0x5414, 0 },
+{ "asm-generic/ioctls.h", "TIOCVHANGUP", 0, 0x5437, 0 },
+{ "asm-generic/sockios.h", "FIOGETOWN", 0, 0x8903, 0 },
+{ "asm-generic/sockios.h", "FIOSETOWN", 0, 0x8901, 0 },
+{ "asm-generic/sockios.h", "SIOCATMARK", 0, 0x8905, 0 },
+{ "asm-generic/sockios.h", "SIOCGPGRP", 0, 0x8904, 0 },
+{ "asm-generic/sockios.h", "SIOCGSTAMPNS_OLD", 0, 0x8907, 0 },
+{ "asm-generic/sockios.h", "SIOCGSTAMP_OLD", 0, 0x8906, 0 },
+{ "asm-generic/sockios.h", "SIOCSPGRP", 0, 0x8902, 0 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_BO_LIST", _IOC_READ|_IOC_WRITE, 0x6443, 0x18 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_CS", _IOC_READ|_IOC_WRITE, 0x6444, 0x18 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_CTX", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_FENCE_TO_HANDLE", _IOC_READ|_IOC_WRITE, 0x6454, 0x20 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_CREATE", _IOC_READ|_IOC_WRITE, 0x6440, 0x20 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_METADATA", _IOC_READ|_IOC_WRITE, 0x6446, 0x120 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_MMAP", _IOC_READ|_IOC_WRITE, 0x6441, 0x08 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_OP", _IOC_READ|_IOC_WRITE, 0x6450, 0x10 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_USERPTR", _IOC_READ|_IOC_WRITE, 0x6451, 0x18 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_VA", _IOC_WRITE, 0x6448, 0x28 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_WAIT_IDLE", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_INFO", _IOC_WRITE, 0x6445, 0x20 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_SCHED", _IOC_WRITE, 0x6455, 0x10 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_VM", _IOC_READ|_IOC_WRITE, 0x6453, 0x08 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_WAIT_CS", _IOC_READ|_IOC_WRITE, 0x6449, 0x20 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_WAIT_FENCES", _IOC_READ|_IOC_WRITE, 0x6452, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_ADD_BUFS", _IOC_READ|_IOC_WRITE, 0x6416, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_ADD_CTX", _IOC_READ|_IOC_WRITE, 0x6420, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_ADD_DRAW", _IOC_READ|_IOC_WRITE, 0x6427, 0x04 },
+{ "drm/drm.h", "DRM_IOCTL_ADD_MAP", _IOC_READ|_IOC_WRITE, 0x6415, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_AGP_ACQUIRE", _IOC_NONE, 0x6430, 0x00 },
+{ "drm/drm.h", "DRM_IOCTL_AGP_ALLOC", _IOC_READ|_IOC_WRITE, 0x6434, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_AGP_BIND", _IOC_WRITE, 0x6436, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_AGP_ENABLE", _IOC_WRITE, 0x6432, 0x04 },
+{ "drm/drm.h", "DRM_IOCTL_AGP_FREE", _IOC_WRITE, 0x6435, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_AGP_INFO", _IOC_READ, 0x6433, 0x20 },
+{ "drm/drm.h", "DRM_IOCTL_AGP_RELEASE", _IOC_NONE, 0x6431, 0x00 },
+{ "drm/drm.h", "DRM_IOCTL_AGP_UNBIND", _IOC_WRITE, 0x6437, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_AUTH_MAGIC", _IOC_WRITE, 0x6411, 0x04 },
+{ "drm/drm.h", "DRM_IOCTL_BLOCK", _IOC_READ|_IOC_WRITE, 0x6412, 0x04 },
+{ "drm/drm.h", "DRM_IOCTL_CONTROL", _IOC_WRITE, 0x6414, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_CRTC_GET_SEQUENCE", _IOC_READ|_IOC_WRITE, 0x643b, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_CRTC_QUEUE_SEQUENCE", _IOC_READ|_IOC_WRITE, 0x643c, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_DMA", _IOC_READ|_IOC_WRITE, 0x6429, 0x28 },
+{ "drm/drm.h", "DRM_IOCTL_DROP_MASTER", _IOC_NONE, 0x641f, 0x00 },
+{ "drm/drm.h", "DRM_IOCTL_FINISH", _IOC_WRITE, 0x642c, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_FREE_BUFS", _IOC_WRITE, 0x641a, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_GEM_CLOSE", _IOC_WRITE, 0x6409, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_GEM_FLINK", _IOC_READ|_IOC_WRITE, 0x640a, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_GEM_OPEN", _IOC_READ|_IOC_WRITE, 0x640b, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_GET_CAP", _IOC_READ|_IOC_WRITE, 0x640c, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_GET_CLIENT", _IOC_READ|_IOC_WRITE, 0x6405, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_GET_CTX", _IOC_READ|_IOC_WRITE, 0x6423, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_GET_MAGIC", _IOC_READ, 0x6402, 0x04 },
+{ "drm/drm.h", "DRM_IOCTL_GET_MAP", _IOC_READ|_IOC_WRITE, 0x6404, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_GET_SAREA_CTX", _IOC_READ|_IOC_WRITE, 0x641d, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_GET_STATS", _IOC_READ, 0x6406, 0x7c },
+{ "drm/drm.h", "DRM_IOCTL_GET_UNIQUE", _IOC_READ|_IOC_WRITE, 0x6401, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_INFO_BUFS", _IOC_READ|_IOC_WRITE, 0x6418, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_IRQ_BUSID", _IOC_READ|_IOC_WRITE, 0x6403, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_LOCK", _IOC_WRITE, 0x642a, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_MAP_BUFS", _IOC_READ|_IOC_WRITE, 0x6419, 0x0c },
+{ "drm/drm.h", "DRM_IOCTL_MARK_BUFS", _IOC_WRITE, 0x6417, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_MODESET_CTL", _IOC_WRITE, 0x6408, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_ADDFB", _IOC_READ|_IOC_WRITE, 0x64ae, 0x1c },
+{ "drm/drm.h", "DRM_IOCTL_MODE_ADDFB2", _IOC_READ|_IOC_WRITE, 0x64b8, 0x68 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_ATOMIC", _IOC_READ|_IOC_WRITE, 0x64bc, 0x38 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_ATTACHMODE", _IOC_READ|_IOC_WRITE, 0x64a8, 0x48 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_CREATEPROPBLOB", _IOC_READ|_IOC_WRITE, 0x64bd, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_CREATE_DUMB", _IOC_READ|_IOC_WRITE, 0x64b2, 0x20 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_CREATE_LEASE", _IOC_READ|_IOC_WRITE, 0x64c6, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_CURSOR", _IOC_READ|_IOC_WRITE, 0x64a3, 0x1c },
+{ "drm/drm.h", "DRM_IOCTL_MODE_CURSOR2", _IOC_READ|_IOC_WRITE, 0x64bb, 0x24 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_DESTROYPROPBLOB", _IOC_READ|_IOC_WRITE, 0x64be, 0x04 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_DESTROY_DUMB", _IOC_READ|_IOC_WRITE, 0x64b4, 0x04 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_DETACHMODE", _IOC_READ|_IOC_WRITE, 0x64a9, 0x48 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_DIRTYFB", _IOC_READ|_IOC_WRITE, 0x64b1, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_GETCONNECTOR", _IOC_READ|_IOC_WRITE, 0x64a7, 0x50 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_GETCRTC", _IOC_READ|_IOC_WRITE, 0x64a1, 0x68 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_GETENCODER", _IOC_READ|_IOC_WRITE, 0x64a6, 0x14 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_GETFB", _IOC_READ|_IOC_WRITE, 0x64ad, 0x1c },
+{ "drm/drm.h", "DRM_IOCTL_MODE_GETFB2", _IOC_READ|_IOC_WRITE, 0x64ce, 0x68 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_GETGAMMA", _IOC_READ|_IOC_WRITE, 0x64a4, 0x20 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_GETPLANE", _IOC_READ|_IOC_WRITE, 0x64b6, 0x20 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_GETPLANERESOURCES", _IOC_READ|_IOC_WRITE, 0x64b5, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_GETPROPBLOB", _IOC_READ|_IOC_WRITE, 0x64ac, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_GETPROPERTY", _IOC_READ|_IOC_WRITE, 0x64aa, 0x40 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_GETRESOURCES", _IOC_READ|_IOC_WRITE, 0x64a0, 0x40 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_GET_LEASE", _IOC_READ|_IOC_WRITE, 0x64c8, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_LIST_LESSEES", _IOC_READ|_IOC_WRITE, 0x64c7, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_MAP_DUMB", _IOC_READ|_IOC_WRITE, 0x64b3, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_OBJ_GETPROPERTIES", _IOC_READ|_IOC_WRITE, 0x64b9, 0x20 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_OBJ_SETPROPERTY", _IOC_READ|_IOC_WRITE, 0x64ba, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_PAGE_FLIP", _IOC_READ|_IOC_WRITE, 0x64b0, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_REVOKE_LEASE", _IOC_READ|_IOC_WRITE, 0x64c9, 0x04 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_RMFB", _IOC_READ|_IOC_WRITE, 0x64af, 0x04 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_SETCRTC", _IOC_READ|_IOC_WRITE, 0x64a2, 0x68 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_SETGAMMA", _IOC_READ|_IOC_WRITE, 0x64a5, 0x20 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_SETPLANE", _IOC_READ|_IOC_WRITE, 0x64b7, 0x30 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_SETPROPERTY", _IOC_READ|_IOC_WRITE, 0x64ab, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_MOD_CTX", _IOC_WRITE, 0x6422, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_NEW_CTX", _IOC_WRITE, 0x6425, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_PRIME_FD_TO_HANDLE", _IOC_READ|_IOC_WRITE, 0x642e, 0x0c },
+{ "drm/drm.h", "DRM_IOCTL_PRIME_HANDLE_TO_FD", _IOC_READ|_IOC_WRITE, 0x642d, 0x0c },
+{ "drm/drm.h", "DRM_IOCTL_RES_CTX", _IOC_READ|_IOC_WRITE, 0x6426, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_RM_CTX", _IOC_READ|_IOC_WRITE, 0x6421, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_RM_DRAW", _IOC_READ|_IOC_WRITE, 0x6428, 0x04 },
+{ "drm/drm.h", "DRM_IOCTL_RM_MAP", _IOC_WRITE, 0x641b, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_SET_CLIENT_CAP", _IOC_WRITE, 0x640d, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_SET_MASTER", _IOC_NONE, 0x641e, 0x00 },
+{ "drm/drm.h", "DRM_IOCTL_SET_SAREA_CTX", _IOC_WRITE, 0x641c, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_SET_UNIQUE", _IOC_WRITE, 0x6410, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_SET_VERSION", _IOC_READ|_IOC_WRITE, 0x6407, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_SG_ALLOC", _IOC_READ|_IOC_WRITE, 0x6438, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_SG_FREE", _IOC_WRITE, 0x6439, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_SWITCH_CTX", _IOC_WRITE, 0x6424, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_CREATE", _IOC_READ|_IOC_WRITE, 0x64bf, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_DESTROY", _IOC_READ|_IOC_WRITE, 0x64c0, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_FD_TO_HANDLE", _IOC_READ|_IOC_WRITE, 0x64c2, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_HANDLE_TO_FD", _IOC_READ|_IOC_WRITE, 0x64c1, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_QUERY", _IOC_READ|_IOC_WRITE, 0x64cb, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_RESET", _IOC_READ|_IOC_WRITE, 0x64c4, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_SIGNAL", _IOC_READ|_IOC_WRITE, 0x64c5, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_TIMELINE_SIGNAL", _IOC_READ|_IOC_WRITE, 0x64cd, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_TIMELINE_WAIT", _IOC_READ|_IOC_WRITE, 0x64ca, 0x28 },
+{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_TRANSFER", _IOC_READ|_IOC_WRITE, 0x64cc, 0x20 },
+{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_WAIT", _IOC_READ|_IOC_WRITE, 0x64c3, 0x20 },
+{ "drm/drm.h", "DRM_IOCTL_UNBLOCK", _IOC_READ|_IOC_WRITE, 0x6413, 0x04 },
+{ "drm/drm.h", "DRM_IOCTL_UNLOCK", _IOC_WRITE, 0x642b, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_UPDATE_DRAW", _IOC_WRITE, 0x643f, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_VERSION", _IOC_READ|_IOC_WRITE, 0x6400, 0x24 },
+{ "drm/drm.h", "DRM_IOCTL_WAIT_VBLANK", _IOC_READ|_IOC_WRITE, 0x643a, 0x10 },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_CPU_FINI", _IOC_WRITE, 0x6445, 0x08 },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_CPU_PREP", _IOC_WRITE, 0x6444, 0x18 },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_NEW", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_SUBMIT", _IOC_READ|_IOC_WRITE, 0x6446, 0x48 },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_USERPTR", _IOC_READ|_IOC_WRITE, 0x6448, 0x18 },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_WAIT", _IOC_WRITE, 0x6449, 0x20 },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_PM_QUERY_DOM", _IOC_READ|_IOC_WRITE, 0x644a, 0x48 },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_PM_QUERY_SIG", _IOC_READ|_IOC_WRITE, 0x644b, 0x4c },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_WAIT_FENCE", _IOC_WRITE, 0x6447, 0x20 },
+{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_G2D_EXEC", _IOC_READ|_IOC_WRITE, 0x6462, 0x08 },
+{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_G2D_GET_VER", _IOC_READ|_IOC_WRITE, 0x6460, 0x08 },
+{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_G2D_SET_CMDLIST", _IOC_READ|_IOC_WRITE, 0x6461, 0x28 },
+{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_GEM_CREATE", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 },
+{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_GEM_GET", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 },
+{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_GEM_MAP", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 },
+{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_IPP_COMMIT", _IOC_READ|_IOC_WRITE, 0x6483, 0x20 },
+{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_IPP_GET_CAPS", _IOC_READ|_IOC_WRITE, 0x6481, 0x18 },
+{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_IPP_GET_LIMITS", _IOC_READ|_IOC_WRITE, 0x6482, 0x20 },
+{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_IPP_GET_RESOURCES", _IOC_READ|_IOC_WRITE, 0x6480, 0x10 },
+{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_VIDI_CONNECTION", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 },
+{ "drm/i810_drm.h", "DRM_IOCTL_I810_CLEAR", _IOC_WRITE, 0x6442, 0x0c },
+{ "drm/i810_drm.h", "DRM_IOCTL_I810_COPY", _IOC_WRITE, 0x6447, 0x0c },
+{ "drm/i810_drm.h", "DRM_IOCTL_I810_DOCOPY", _IOC_NONE, 0x6448, 0x00 },
+{ "drm/i810_drm.h", "DRM_IOCTL_I810_FLIP", _IOC_NONE, 0x644e, 0x00 },
+{ "drm/i810_drm.h", "DRM_IOCTL_I810_FLUSH", _IOC_NONE, 0x6443, 0x00 },
+{ "drm/i810_drm.h", "DRM_IOCTL_I810_FSTATUS", _IOC_NONE, 0x644a, 0x00 },
+{ "drm/i810_drm.h", "DRM_IOCTL_I810_GETAGE", _IOC_NONE, 0x6444, 0x00 },
+{ "drm/i810_drm.h", "DRM_IOCTL_I810_GETBUF", _IOC_READ|_IOC_WRITE, 0x6445, 0x10 },
+{ "drm/i810_drm.h", "DRM_IOCTL_I810_INIT", _IOC_WRITE, 0x6440, 0x40 },
+{ "drm/i810_drm.h", "DRM_IOCTL_I810_MC", _IOC_WRITE, 0x644c, 0x14 },
+{ "drm/i810_drm.h", "DRM_IOCTL_I810_OV0FLIP", _IOC_NONE, 0x644b, 0x00 },
+{ "drm/i810_drm.h", "DRM_IOCTL_I810_OV0INFO", _IOC_READ, 0x6449, 0x08 },
+{ "drm/i810_drm.h", "DRM_IOCTL_I810_RSTATUS", _IOC_NONE, 0x644d, 0x00 },
+{ "drm/i810_drm.h", "DRM_IOCTL_I810_SWAP", _IOC_NONE, 0x6446, 0x00 },
+{ "drm/i810_drm.h", "DRM_IOCTL_I810_VERTEX", _IOC_WRITE, 0x6441, 0x0c },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_ALLOC", _IOC_READ|_IOC_WRITE, 0x6448, 0x10 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_BATCHBUFFER", _IOC_WRITE, 0x6443, 0x18 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_CMDBUFFER", _IOC_WRITE, 0x644b, 0x18 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_DESTROY_HEAP", _IOC_WRITE, 0x644c, 0x04 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_FLIP", _IOC_NONE, 0x6442, 0x00 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_FLUSH", _IOC_NONE, 0x6441, 0x00 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_FREE", _IOC_WRITE, 0x6449, 0x08 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_BUSY", _IOC_READ|_IOC_WRITE, 0x6457, 0x08 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_CONTEXT_CREATE", _IOC_READ|_IOC_WRITE, 0x646d, 0x08 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_CONTEXT_CREATE_EXT", _IOC_READ|_IOC_WRITE, 0x646d, 0x10 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_CONTEXT_DESTROY", _IOC_WRITE, 0x646e, 0x08 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_CONTEXT_GETPARAM", _IOC_READ|_IOC_WRITE, 0x6474, 0x18 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_CONTEXT_SETPARAM", _IOC_READ|_IOC_WRITE, 0x6475, 0x18 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_CREATE", _IOC_READ|_IOC_WRITE, 0x645b, 0x10 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_ENTERVT", _IOC_NONE, 0x6459, 0x00 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_EXECBUFFER", _IOC_WRITE, 0x6454, 0x28 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_EXECBUFFER2", _IOC_WRITE, 0x6469, 0x40 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_EXECBUFFER2_WR", _IOC_READ|_IOC_WRITE, 0x6469, 0x40 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_GET_APERTURE", _IOC_READ, 0x6463, 0x10 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_GET_CACHING", _IOC_READ|_IOC_WRITE, 0x6470, 0x08 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_GET_TILING", _IOC_READ|_IOC_WRITE, 0x6462, 0x10 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_INIT", _IOC_WRITE, 0x6453, 0x10 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_LEAVEVT", _IOC_NONE, 0x645a, 0x00 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_MADVISE", _IOC_READ|_IOC_WRITE, 0x6466, 0x0c },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_MMAP", _IOC_READ|_IOC_WRITE, 0x645e, 0x28 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_MMAP_GTT", _IOC_READ|_IOC_WRITE, 0x6464, 0x10 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_MMAP_OFFSET", _IOC_READ|_IOC_WRITE, 0x6464, 0x20 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_PIN", _IOC_READ|_IOC_WRITE, 0x6455, 0x18 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_PREAD", _IOC_WRITE, 0x645c, 0x20 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_PWRITE", _IOC_WRITE, 0x645d, 0x20 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_SET_CACHING", _IOC_WRITE, 0x646f, 0x08 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_SET_DOMAIN", _IOC_WRITE, 0x645f, 0x0c },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_SET_TILING", _IOC_READ|_IOC_WRITE, 0x6461, 0x10 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_SW_FINISH", _IOC_WRITE, 0x6460, 0x04 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_THROTTLE", _IOC_NONE, 0x6458, 0x00 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_UNPIN", _IOC_WRITE, 0x6456, 0x08 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_USERPTR", _IOC_READ|_IOC_WRITE, 0x6473, 0x18 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_VM_CREATE", _IOC_READ|_IOC_WRITE, 0x647a, 0x10 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_VM_DESTROY", _IOC_WRITE, 0x647b, 0x10 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_WAIT", _IOC_READ|_IOC_WRITE, 0x646c, 0x10 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GETPARAM", _IOC_READ|_IOC_WRITE, 0x6446, 0x08 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GET_PIPE_FROM_CRTC_ID", _IOC_READ|_IOC_WRITE, 0x6465, 0x08 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GET_RESET_STATS", _IOC_READ|_IOC_WRITE, 0x6472, 0x18 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GET_SPRITE_COLORKEY", _IOC_READ|_IOC_WRITE, 0x646a, 0x14 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GET_VBLANK_PIPE", _IOC_READ, 0x644e, 0x04 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_HWS_ADDR", _IOC_WRITE, 0x6451, 0x10 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_INIT", _IOC_WRITE, 0x6440, 0x44 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_INIT_HEAP", _IOC_WRITE, 0x644a, 0x0c },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_IRQ_EMIT", _IOC_READ|_IOC_WRITE, 0x6444, 0x04 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_IRQ_WAIT", _IOC_WRITE, 0x6445, 0x04 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_OVERLAY_ATTRS", _IOC_READ|_IOC_WRITE, 0x6468, 0x2c },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_OVERLAY_PUT_IMAGE", _IOC_WRITE, 0x6467, 0x2c },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_PERF_ADD_CONFIG", _IOC_WRITE, 0x6477, 0x48 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_PERF_OPEN", _IOC_WRITE, 0x6476, 0x10 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_PERF_REMOVE_CONFIG", _IOC_WRITE, 0x6478, 0x08 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_QUERY", _IOC_READ|_IOC_WRITE, 0x6479, 0x10 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_REG_READ", _IOC_READ|_IOC_WRITE, 0x6471, 0x10 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_SETPARAM", _IOC_WRITE, 0x6447, 0x08 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_SET_SPRITE_COLORKEY", _IOC_READ|_IOC_WRITE, 0x646b, 0x14 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_SET_VBLANK_PIPE", _IOC_WRITE, 0x644d, 0x04 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_VBLANK_SWAP", _IOC_READ|_IOC_WRITE, 0x644f, 0x0c },
+{ "drm/i915_drm.h", "I915_PERF_IOCTL_CONFIG", _IOC_NONE, 0x6902, 0x00 },
+{ "drm/i915_drm.h", "I915_PERF_IOCTL_DISABLE", _IOC_NONE, 0x6901, 0x00 },
+{ "drm/i915_drm.h", "I915_PERF_IOCTL_ENABLE", _IOC_NONE, 0x6900, 0x00 },
+{ "drm/lima_drm.h", "DRM_IOCTL_LIMA_CTX_CREATE", _IOC_READ, 0x6445, 0x08 },
+{ "drm/lima_drm.h", "DRM_IOCTL_LIMA_CTX_FREE", _IOC_WRITE, 0x6446, 0x08 },
+{ "drm/lima_drm.h", "DRM_IOCTL_LIMA_GEM_CREATE", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 },
+{ "drm/lima_drm.h", "DRM_IOCTL_LIMA_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 },
+{ "drm/lima_drm.h", "DRM_IOCTL_LIMA_GEM_SUBMIT", _IOC_WRITE, 0x6443, 0x30 },
+{ "drm/lima_drm.h", "DRM_IOCTL_LIMA_GEM_WAIT", _IOC_WRITE, 0x6444, 0x10 },
+{ "drm/lima_drm.h", "DRM_IOCTL_LIMA_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 },
+{ "drm/mga_drm.h", "DRM_IOCTL_MGA_BLIT", _IOC_WRITE, 0x6448, 0x34 },
+{ "drm/mga_drm.h", "DRM_IOCTL_MGA_CLEAR", _IOC_WRITE, 0x6444, 0x14 },
+{ "drm/mga_drm.h", "DRM_IOCTL_MGA_DMA_BOOTSTRAP", _IOC_READ|_IOC_WRITE, 0x644c, 0x1c },
+{ "drm/mga_drm.h", "DRM_IOCTL_MGA_FLUSH", _IOC_WRITE, 0x6441, 0x08 },
+{ "drm/mga_drm.h", "DRM_IOCTL_MGA_GETPARAM", _IOC_READ|_IOC_WRITE, 0x6449, 0x08 },
+{ "drm/mga_drm.h", "DRM_IOCTL_MGA_ILOAD", _IOC_WRITE, 0x6447, 0x0c },
+{ "drm/mga_drm.h", "DRM_IOCTL_MGA_INDICES", _IOC_WRITE, 0x6446, 0x10 },
+{ "drm/mga_drm.h", "DRM_IOCTL_MGA_INIT", _IOC_WRITE, 0x6440, 0x5c },
+{ "drm/mga_drm.h", "DRM_IOCTL_MGA_RESET", _IOC_NONE, 0x6442, 0x00 },
+{ "drm/mga_drm.h", "DRM_IOCTL_MGA_SET_FENCE", _IOC_WRITE, 0x644a, 0x04 },
+{ "drm/mga_drm.h", "DRM_IOCTL_MGA_SWAP", _IOC_NONE, 0x6443, 0x00 },
+{ "drm/mga_drm.h", "DRM_IOCTL_MGA_VERTEX", _IOC_WRITE, 0x6445, 0x0c },
+{ "drm/mga_drm.h", "DRM_IOCTL_MGA_WAIT_FENCE", _IOC_READ|_IOC_WRITE, 0x644b, 0x04 },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_CPU_FINI", _IOC_WRITE, 0x6445, 0x04 },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_CPU_PREP", _IOC_WRITE, 0x6444, 0x18 },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6443, 0x18 },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_MADVISE", _IOC_READ|_IOC_WRITE, 0x6448, 0x0c },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_NEW", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_SUBMIT", _IOC_READ|_IOC_WRITE, 0x6446, 0x48 },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_SUBMITQUEUE_CLOSE", _IOC_WRITE, 0x644b, 0x04 },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_SUBMITQUEUE_NEW", _IOC_READ|_IOC_WRITE, 0x644a, 0x0c },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_SUBMITQUEUE_QUERY", _IOC_WRITE, 0x644c, 0x18 },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_WAIT_FENCE", _IOC_WRITE, 0x6447, 0x20 },
+{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_CPU_FINI", _IOC_WRITE, 0x6483, 0x04 },
+{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_CPU_PREP", _IOC_WRITE, 0x6482, 0x08 },
+{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6484, 0x28 },
+{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_NEW", _IOC_READ|_IOC_WRITE, 0x6480, 0x30 },
+{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_PUSHBUF", _IOC_READ|_IOC_WRITE, 0x6481, 0x40 },
+{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_SVM_BIND", _IOC_READ|_IOC_WRITE, 0x6449, 0x40 },
+{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_SVM_INIT", _IOC_READ|_IOC_WRITE, 0x6448, 0x10 },
+{ "drm/omap_drm.h", "DRM_IOCTL_OMAP_GEM_CPU_FINI", _IOC_WRITE, 0x6445, 0x10 },
+{ "drm/omap_drm.h", "DRM_IOCTL_OMAP_GEM_CPU_PREP", _IOC_WRITE, 0x6444, 0x08 },
+{ "drm/omap_drm.h", "DRM_IOCTL_OMAP_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6446, 0x18 },
+{ "drm/omap_drm.h", "DRM_IOCTL_OMAP_GEM_NEW", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 },
+{ "drm/omap_drm.h", "DRM_IOCTL_OMAP_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 },
+{ "drm/omap_drm.h", "DRM_IOCTL_OMAP_SET_PARAM", _IOC_WRITE, 0x6441, 0x10 },
+{ "drm/panfrost_drm.h", "DRM_IOCTL_PANFROST_CREATE_BO", _IOC_READ|_IOC_WRITE, 0x6442, 0x18 },
+{ "drm/panfrost_drm.h", "DRM_IOCTL_PANFROST_GET_BO_OFFSET", _IOC_READ|_IOC_WRITE, 0x6445, 0x10 },
+{ "drm/panfrost_drm.h", "DRM_IOCTL_PANFROST_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 },
+{ "drm/panfrost_drm.h", "DRM_IOCTL_PANFROST_MADVISE", _IOC_READ|_IOC_WRITE, 0x6448, 0x0c },
+{ "drm/panfrost_drm.h", "DRM_IOCTL_PANFROST_MMAP_BO", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 },
+{ "drm/panfrost_drm.h", "DRM_IOCTL_PANFROST_PERFCNT_DUMP", _IOC_WRITE, 0x6447, 0x08 },
+{ "drm/panfrost_drm.h", "DRM_IOCTL_PANFROST_PERFCNT_ENABLE", _IOC_WRITE, 0x6446, 0x08 },
+{ "drm/panfrost_drm.h", "DRM_IOCTL_PANFROST_SUBMIT", _IOC_WRITE, 0x6440, 0x28 },
+{ "drm/panfrost_drm.h", "DRM_IOCTL_PANFROST_WAIT_BO", _IOC_WRITE, 0x6441, 0x10 },
+{ "drm/qxl_drm.h", "DRM_IOCTL_QXL_ALLOC", _IOC_READ|_IOC_WRITE, 0x6440, 0x08 },
+{ "drm/qxl_drm.h", "DRM_IOCTL_QXL_ALLOC_SURF", _IOC_READ|_IOC_WRITE, 0x6446, 0x18 },
+{ "drm/qxl_drm.h", "DRM_IOCTL_QXL_CLIENTCAP", _IOC_WRITE, 0x6445, 0x08 },
+{ "drm/qxl_drm.h", "DRM_IOCTL_QXL_EXECBUFFER", _IOC_WRITE, 0x6442, 0x10 },
+{ "drm/qxl_drm.h", "DRM_IOCTL_QXL_GETPARAM", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 },
+{ "drm/qxl_drm.h", "DRM_IOCTL_QXL_MAP", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 },
+{ "drm/qxl_drm.h", "DRM_IOCTL_QXL_UPDATE_AREA", _IOC_WRITE, 0x6443, 0x18 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_BLIT", _IOC_WRITE, 0x644b, 0x18 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_CCE_IDLE", _IOC_NONE, 0x6444, 0x00 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_CCE_RESET", _IOC_NONE, 0x6443, 0x00 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_CCE_START", _IOC_NONE, 0x6441, 0x00 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_CCE_STOP", _IOC_WRITE, 0x6442, 0x08 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_CLEAR", _IOC_WRITE, 0x6448, 0x14 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_DEPTH", _IOC_WRITE, 0x644c, 0x18 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_FLIP", _IOC_NONE, 0x6453, 0x00 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_FULLSCREEN", _IOC_WRITE, 0x6450, 0x04 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_GETPARAM", _IOC_READ|_IOC_WRITE, 0x6452, 0x08 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_INDICES", _IOC_WRITE, 0x644a, 0x14 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_INDIRECT", _IOC_READ|_IOC_WRITE, 0x644f, 0x10 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_INIT", _IOC_WRITE, 0x6440, 0x58 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_RESET", _IOC_NONE, 0x6446, 0x00 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_STIPPLE", _IOC_WRITE, 0x644d, 0x04 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_SWAP", _IOC_NONE, 0x6447, 0x00 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_VERTEX", _IOC_WRITE, 0x6449, 0x10 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_ALLOC", _IOC_READ|_IOC_WRITE, 0x6453, 0x10 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CLEAR", _IOC_WRITE, 0x6448, 0x18 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CMDBUF", _IOC_WRITE, 0x6450, 0x10 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CP_IDLE", _IOC_NONE, 0x6444, 0x00 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CP_INIT", _IOC_WRITE, 0x6440, 0x54 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CP_RESET", _IOC_NONE, 0x6443, 0x00 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CP_RESUME", _IOC_NONE, 0x6458, 0x00 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CP_START", _IOC_NONE, 0x6441, 0x00 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CP_STOP", _IOC_WRITE, 0x6442, 0x08 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CS", _IOC_READ|_IOC_WRITE, 0x6466, 0x20 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_FLIP", _IOC_NONE, 0x6452, 0x00 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_FREE", _IOC_WRITE, 0x6454, 0x08 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_FULLSCREEN", _IOC_WRITE, 0x6446, 0x04 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_BUSY", _IOC_READ|_IOC_WRITE, 0x646a, 0x08 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_CREATE", _IOC_READ|_IOC_WRITE, 0x645d, 0x20 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_GET_TILING", _IOC_READ|_IOC_WRITE, 0x6469, 0x0c },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x645c, 0x18 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_MMAP", _IOC_READ|_IOC_WRITE, 0x645e, 0x20 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_OP", _IOC_READ|_IOC_WRITE, 0x646c, 0x10 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_PREAD", _IOC_READ|_IOC_WRITE, 0x6461, 0x20 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_PWRITE", _IOC_READ|_IOC_WRITE, 0x6462, 0x20 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_SET_DOMAIN", _IOC_READ|_IOC_WRITE, 0x6463, 0x0c },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_SET_TILING", _IOC_READ|_IOC_WRITE, 0x6468, 0x0c },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_USERPTR", _IOC_READ|_IOC_WRITE, 0x646d, 0x18 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_VA", _IOC_READ|_IOC_WRITE, 0x646b, 0x18 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_WAIT_IDLE", _IOC_WRITE, 0x6464, 0x08 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GETPARAM", _IOC_READ|_IOC_WRITE, 0x6451, 0x08 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_INDICES", _IOC_WRITE, 0x644a, 0x14 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_INDIRECT", _IOC_READ|_IOC_WRITE, 0x644d, 0x10 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_INFO", _IOC_READ|_IOC_WRITE, 0x6467, 0x10 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_INIT_HEAP", _IOC_WRITE, 0x6455, 0x0c },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_IRQ_EMIT", _IOC_READ|_IOC_WRITE, 0x6456, 0x04 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_IRQ_WAIT", _IOC_WRITE, 0x6457, 0x04 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_RESET", _IOC_NONE, 0x6445, 0x00 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_SETPARAM", _IOC_WRITE, 0x6459, 0x10 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_STIPPLE", _IOC_WRITE, 0x644c, 0x04 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_SURF_ALLOC", _IOC_WRITE, 0x645a, 0x0c },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_SURF_FREE", _IOC_WRITE, 0x645b, 0x04 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_SWAP", _IOC_NONE, 0x6447, 0x00 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_TEXTURE", _IOC_READ|_IOC_WRITE, 0x644e, 0x18 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_VERTEX", _IOC_WRITE, 0x6449, 0x10 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_VERTEX2", _IOC_WRITE, 0x644f, 0x18 },
+{ "drm/savage_drm.h", "DRM_IOCTL_SAVAGE_BCI_CMDBUF", _IOC_WRITE, 0x6441, 0x24 },
+{ "drm/savage_drm.h", "DRM_IOCTL_SAVAGE_BCI_EVENT_EMIT", _IOC_READ|_IOC_WRITE, 0x6442, 0x08 },
+{ "drm/savage_drm.h", "DRM_IOCTL_SAVAGE_BCI_EVENT_WAIT", _IOC_WRITE, 0x6443, 0x08 },
+{ "drm/savage_drm.h", "DRM_IOCTL_SAVAGE_BCI_INIT", _IOC_WRITE, 0x6440, 0x50 },
+{ "drm/sis_drm.h", "DRM_IOCTL_SIS_AGP_ALLOC", _IOC_READ|_IOC_WRITE, 0x6454, 0x10 },
+{ "drm/sis_drm.h", "DRM_IOCTL_SIS_AGP_FREE", _IOC_WRITE, 0x6455, 0x10 },
+{ "drm/sis_drm.h", "DRM_IOCTL_SIS_AGP_INIT", _IOC_READ|_IOC_WRITE, 0x6453, 0x08 },
+{ "drm/sis_drm.h", "DRM_IOCTL_SIS_FB_ALLOC", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 },
+{ "drm/sis_drm.h", "DRM_IOCTL_SIS_FB_FREE", _IOC_WRITE, 0x6445, 0x10 },
+{ "drm/sis_drm.h", "DRM_IOCTL_SIS_FB_INIT", _IOC_WRITE, 0x6456, 0x08 },
+{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_CLOSE_CHANNEL", _IOC_READ|_IOC_WRITE, 0x6446, 0x08 },
+{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GEM_CREATE", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 },
+{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GEM_GET_FLAGS", _IOC_READ|_IOC_WRITE, 0x644d, 0x08 },
+{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GEM_GET_TILING", _IOC_READ|_IOC_WRITE, 0x644b, 0x10 },
+{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GEM_MMAP", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 },
+{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GEM_SET_FLAGS", _IOC_READ|_IOC_WRITE, 0x644c, 0x08 },
+{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GEM_SET_TILING", _IOC_READ|_IOC_WRITE, 0x644a, 0x10 },
+{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GET_SYNCPT", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 },
+{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GET_SYNCPT_BASE", _IOC_READ|_IOC_WRITE, 0x6449, 0x10 },
+{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_OPEN_CHANNEL", _IOC_READ|_IOC_WRITE, 0x6445, 0x10 },
+{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_SUBMIT", _IOC_READ|_IOC_WRITE, 0x6448, 0x58 },
+{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_SYNCPT_INCR", _IOC_READ|_IOC_WRITE, 0x6443, 0x08 },
+{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_SYNCPT_READ", _IOC_READ|_IOC_WRITE, 0x6442, 0x08 },
+{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_SYNCPT_WAIT", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 },
+{ "drm/v3d_drm.h", "DRM_IOCTL_V3D_CREATE_BO", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 },
+{ "drm/v3d_drm.h", "DRM_IOCTL_V3D_GET_BO_OFFSET", _IOC_READ|_IOC_WRITE, 0x6445, 0x08 },
+{ "drm/v3d_drm.h", "DRM_IOCTL_V3D_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 },
+{ "drm/v3d_drm.h", "DRM_IOCTL_V3D_MMAP_BO", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 },
+{ "drm/v3d_drm.h", "DRM_IOCTL_V3D_SUBMIT_CL", _IOC_READ|_IOC_WRITE, 0x6440, 0x38 },
+{ "drm/v3d_drm.h", "DRM_IOCTL_V3D_SUBMIT_CSD", _IOC_WRITE, 0x6447, 0x48 },
+{ "drm/v3d_drm.h", "DRM_IOCTL_V3D_SUBMIT_TFU", _IOC_WRITE, 0x6446, 0x44 },
+{ "drm/v3d_drm.h", "DRM_IOCTL_V3D_WAIT_BO", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_CREATE_BO", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_CREATE_SHADER_BO", _IOC_READ|_IOC_WRITE, 0x6445, 0x18 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_GEM_MADVISE", _IOC_READ|_IOC_WRITE, 0x644b, 0x10 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_GET_HANG_STATE", _IOC_READ|_IOC_WRITE, 0x6446, 0xa0 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_GET_TILING", _IOC_READ|_IOC_WRITE, 0x6449, 0x10 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_LABEL_BO", _IOC_READ|_IOC_WRITE, 0x644a, 0x10 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_MMAP_BO", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_PERFMON_CREATE", _IOC_READ|_IOC_WRITE, 0x644c, 0x18 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_PERFMON_DESTROY", _IOC_READ|_IOC_WRITE, 0x644d, 0x04 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_PERFMON_GET_VALUES", _IOC_READ|_IOC_WRITE, 0x644e, 0x10 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_SET_TILING", _IOC_READ|_IOC_WRITE, 0x6448, 0x10 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_SUBMIT_CL", _IOC_READ|_IOC_WRITE, 0x6440, 0xb0 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_WAIT_BO", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_WAIT_SEQNO", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 },
+{ "drm/vgem_drm.h", "DRM_IOCTL_VGEM_FENCE_ATTACH", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 },
+{ "drm/vgem_drm.h", "DRM_IOCTL_VGEM_FENCE_SIGNAL", _IOC_WRITE, 0x6442, 0x08 },
+{ "drm/via_drm.h", "DRM_IOCTL_VIA_AGP_INIT", _IOC_READ|_IOC_WRITE, 0x6442, 0x08 },
+{ "drm/via_drm.h", "DRM_IOCTL_VIA_ALLOCMEM", _IOC_READ|_IOC_WRITE, 0x6440, 0x14 },
+{ "drm/via_drm.h", "DRM_IOCTL_VIA_BLIT_SYNC", _IOC_WRITE, 0x644f, 0x08 },
+{ "drm/via_drm.h", "DRM_IOCTL_VIA_CMDBUFFER", _IOC_WRITE, 0x6448, 0x08 },
+{ "drm/via_drm.h", "DRM_IOCTL_VIA_CMDBUF_SIZE", _IOC_READ|_IOC_WRITE, 0x644b, 0x0c },
+{ "drm/via_drm.h", "DRM_IOCTL_VIA_DEC_FUTEX", _IOC_WRITE, 0x6445, 0x10 },
+{ "drm/via_drm.h", "DRM_IOCTL_VIA_DMA_BLIT", _IOC_WRITE, 0x644e, 0x28 },
+{ "drm/via_drm.h", "DRM_IOCTL_VIA_DMA_INIT", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 },
+{ "drm/via_drm.h", "DRM_IOCTL_VIA_FB_INIT", _IOC_READ|_IOC_WRITE, 0x6443, 0x08 },
+{ "drm/via_drm.h", "DRM_IOCTL_VIA_FLUSH", _IOC_NONE, 0x6449, 0x00 },
+{ "drm/via_drm.h", "DRM_IOCTL_VIA_FREEMEM", _IOC_WRITE, 0x6441, 0x14 },
+{ "drm/via_drm.h", "DRM_IOCTL_VIA_MAP_INIT", _IOC_READ|_IOC_WRITE, 0x6444, 0x14 },
+{ "drm/via_drm.h", "DRM_IOCTL_VIA_PCICMD", _IOC_WRITE, 0x644a, 0x08 },
+{ "drm/via_drm.h", "DRM_IOCTL_VIA_WAIT_IRQ", _IOC_READ|_IOC_WRITE, 0x644d, 0x10 },
+{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_EXECBUFFER", _IOC_READ|_IOC_WRITE, 0x6442, 0x20 },
+{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_GETPARAM", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 },
+{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_GET_CAPS", _IOC_READ|_IOC_WRITE, 0x6449, 0x18 },
+{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_MAP", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 },
+{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_RESOURCE_CREATE", _IOC_READ|_IOC_WRITE, 0x6444, 0x38 },
+{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_RESOURCE_INFO", _IOC_READ|_IOC_WRITE, 0x6445, 0x10 },
+{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_TRANSFER_FROM_HOST", _IOC_READ|_IOC_WRITE, 0x6446, 0x24 },
+{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_TRANSFER_TO_HOST", _IOC_READ|_IOC_WRITE, 0x6447, 0x24 },
+{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_WAIT", _IOC_READ|_IOC_WRITE, 0x6448, 0x08 },
+{ "linux/agpgart.h", "AGPIOC_ACQUIRE", _IOC_NONE, 0x4101, 0x00 },
+{ "linux/agpgart.h", "AGPIOC_ALLOCATE", _IOC_READ|_IOC_WRITE, 0x4106, 0x04 },
+{ "linux/agpgart.h", "AGPIOC_BIND", _IOC_WRITE, 0x4108, 0x04 },
+{ "linux/agpgart.h", "AGPIOC_CHIPSET_FLUSH", _IOC_NONE, 0x410a, 0x00 },
+{ "linux/agpgart.h", "AGPIOC_DEALLOCATE", _IOC_WRITE, 0x4107, 0x04 },
+{ "linux/agpgart.h", "AGPIOC_INFO", _IOC_READ, 0x4100, 0x04 },
+{ "linux/agpgart.h", "AGPIOC_PROTECT", _IOC_WRITE, 0x4105, 0x04 },
+{ "linux/agpgart.h", "AGPIOC_RELEASE", _IOC_NONE, 0x4102, 0x00 },
+{ "linux/agpgart.h", "AGPIOC_RESERVE", _IOC_WRITE, 0x4104, 0x04 },
+{ "linux/agpgart.h", "AGPIOC_SETUP", _IOC_WRITE, 0x4103, 0x04 },
+{ "linux/agpgart.h", "AGPIOC_UNBIND", _IOC_WRITE, 0x4109, 0x04 },
+{ "linux/am437x-vpfe.h", "VIDIOC_AM437X_CCDC_CFG", _IOC_WRITE, 0x56c1, 0x04 },
+{ "linux/android/binder.h", "BC_ACQUIRE", _IOC_WRITE, 0x6305, 0x04 },
+{ "linux/android/binder.h", "BC_ACQUIRE_DONE", _IOC_WRITE, 0x6309, 0x10 },
+{ "linux/android/binder.h", "BC_ACQUIRE_RESULT", _IOC_WRITE, 0x6302, 0x04 },
+{ "linux/android/binder.h", "BC_ATTEMPT_ACQUIRE", _IOC_WRITE, 0x630a, 0x08 },
+{ "linux/android/binder.h", "BC_CLEAR_DEATH_NOTIFICATION", _IOC_WRITE, 0x630f, 0x0c },
+{ "linux/android/binder.h", "BC_DEAD_BINDER_DONE", _IOC_WRITE, 0x6310, 0x08 },
+{ "linux/android/binder.h", "BC_DECREFS", _IOC_WRITE, 0x6307, 0x04 },
+{ "linux/android/binder.h", "BC_ENTER_LOOPER", _IOC_NONE, 0x630c, 0x00 },
+{ "linux/android/binder.h", "BC_EXIT_LOOPER", _IOC_NONE, 0x630d, 0x00 },
+{ "linux/android/binder.h", "BC_FREE_BUFFER", _IOC_WRITE, 0x6303, 0x08 },
+{ "linux/android/binder.h", "BC_INCREFS", _IOC_WRITE, 0x6304, 0x04 },
+{ "linux/android/binder.h", "BC_INCREFS_DONE", _IOC_WRITE, 0x6308, 0x10 },
+{ "linux/android/binder.h", "BC_REGISTER_LOOPER", _IOC_NONE, 0x630b, 0x00 },
+{ "linux/android/binder.h", "BC_RELEASE", _IOC_WRITE, 0x6306, 0x04 },
+{ "linux/android/binder.h", "BC_REPLY", _IOC_WRITE, 0x6301, 0x40 },
+{ "linux/android/binder.h", "BC_REPLY_SG", _IOC_WRITE, 0x6312, 0x48 },
+{ "linux/android/binder.h", "BC_REQUEST_DEATH_NOTIFICATION", _IOC_WRITE, 0x630e, 0x0c },
+{ "linux/android/binder.h", "BC_TRANSACTION", _IOC_WRITE, 0x6300, 0x40 },
+{ "linux/android/binder.h", "BC_TRANSACTION_SG", _IOC_WRITE, 0x6311, 0x48 },
+{ "linux/android/binder.h", "BINDER_GET_NODE_DEBUG_INFO", _IOC_READ|_IOC_WRITE, 0x620b, 0x18 },
+{ "linux/android/binder.h", "BINDER_GET_NODE_INFO_FOR_REF", _IOC_READ|_IOC_WRITE, 0x620c, 0x18 },
+{ "linux/android/binder.h", "BINDER_SET_CONTEXT_MGR", _IOC_WRITE, 0x6207, 0x04 },
+{ "linux/android/binder.h", "BINDER_SET_CONTEXT_MGR_EXT", _IOC_WRITE, 0x620d, 0x18 },
+{ "linux/android/binder.h", "BINDER_SET_IDLE_PRIORITY", _IOC_WRITE, 0x6206, 0x04 },
+{ "linux/android/binder.h", "BINDER_SET_IDLE_TIMEOUT", _IOC_WRITE, 0x6203, 0x08 },
+{ "linux/android/binder.h", "BINDER_SET_MAX_THREADS", _IOC_WRITE, 0x6205, 0x04 },
+{ "linux/android/binder.h", "BINDER_THREAD_EXIT", _IOC_WRITE, 0x6208, 0x04 },
+{ "linux/android/binder.h", "BINDER_VERSION", _IOC_READ|_IOC_WRITE, 0x6209, 0x04 },
+{ "linux/android/binder.h", "BINDER_WRITE_READ", _IOC_READ|_IOC_WRITE, 0x6201, 0x30 },
+{ "linux/android/binder.h", "BR_ACQUIRE", _IOC_READ, 0x7208, 0x10 },
+{ "linux/android/binder.h", "BR_ACQUIRE_RESULT", _IOC_READ, 0x7204, 0x04 },
+{ "linux/android/binder.h", "BR_ATTEMPT_ACQUIRE", _IOC_READ, 0x720b, 0x18 },
+{ "linux/android/binder.h", "BR_CLEAR_DEATH_NOTIFICATION_DONE", _IOC_READ, 0x7210, 0x08 },
+{ "linux/android/binder.h", "BR_DEAD_BINDER", _IOC_READ, 0x720f, 0x08 },
+{ "linux/android/binder.h", "BR_DEAD_REPLY", _IOC_NONE, 0x7205, 0x00 },
+{ "linux/android/binder.h", "BR_DECREFS", _IOC_READ, 0x720a, 0x10 },
+{ "linux/android/binder.h", "BR_ERROR", _IOC_READ, 0x7200, 0x04 },
+{ "linux/android/binder.h", "BR_FAILED_REPLY", _IOC_NONE, 0x7211, 0x00 },
+{ "linux/android/binder.h", "BR_FINISHED", _IOC_NONE, 0x720e, 0x00 },
+{ "linux/android/binder.h", "BR_INCREFS", _IOC_READ, 0x7207, 0x10 },
+{ "linux/android/binder.h", "BR_NOOP", _IOC_NONE, 0x720c, 0x00 },
+{ "linux/android/binder.h", "BR_OK", _IOC_NONE, 0x7201, 0x00 },
+{ "linux/android/binder.h", "BR_RELEASE", _IOC_READ, 0x7209, 0x10 },
+{ "linux/android/binder.h", "BR_REPLY", _IOC_READ, 0x7203, 0x40 },
+{ "linux/android/binder.h", "BR_SPAWN_LOOPER", _IOC_NONE, 0x720d, 0x00 },
+{ "linux/android/binder.h", "BR_TRANSACTION", _IOC_READ, 0x7202, 0x40 },
+{ "linux/android/binder.h", "BR_TRANSACTION_COMPLETE", _IOC_NONE, 0x7206, 0x00 },
+{ "linux/android/binder.h", "BR_TRANSACTION_SEC_CTX", _IOC_READ, 0x7202, 0x48 },
+{ "linux/android/binderfs.h", "BINDER_CTL_ADD", _IOC_READ|_IOC_WRITE, 0x6201, 0x108 },
+{ "linux/apm_bios.h", "APM_IOC_STANDBY", _IOC_NONE, 0x4101, 0x00 },
+{ "linux/apm_bios.h", "APM_IOC_SUSPEND", _IOC_NONE, 0x4102, 0x00 },
+{ "linux/arcfb.h", "FBIO_GETCONTROL2", _IOC_READ, 0x4689, 0x04 },
+{ "linux/arcfb.h", "FBIO_WAITEVENT", _IOC_NONE, 0x4688, 0x00 },
+{ "linux/aspeed-lpc-ctrl.h", "ASPEED_LPC_CTRL_IOCTL_GET_SIZE", _IOC_READ|_IOC_WRITE, 0xb200, 0x10 },
+{ "linux/aspeed-lpc-ctrl.h", "ASPEED_LPC_CTRL_IOCTL_MAP", _IOC_WRITE, 0xb201, 0x10 },
+{ "linux/aspeed-p2a-ctrl.h", "ASPEED_P2A_CTRL_IOCTL_GET_MEMORY_CONFIG", _IOC_READ|_IOC_WRITE, 0xb301, 0x10 },
+{ "linux/aspeed-p2a-ctrl.h", "ASPEED_P2A_CTRL_IOCTL_SET_WINDOW", _IOC_WRITE, 0xb300, 0x10 },
+{ "linux/atm_eni.h", "ENI_MEMDUMP", _IOC_WRITE, 0x6160, 0x0c },
+{ "linux/atm_eni.h", "ENI_SETMULT", _IOC_WRITE, 0x6167, 0x0c },
+{ "linux/atm_he.h", "HE_GET_REG", _IOC_WRITE, 0x6160, 0x0c },
+{ "linux/atm_idt77105.h", "IDT77105_GETSTAT", _IOC_WRITE, 0x6132, 0x0c },
+{ "linux/atm_idt77105.h", "IDT77105_GETSTATZ", _IOC_WRITE, 0x6133, 0x0c },
+{ "linux/atm_nicstar.h", "NS_ADJBUFLEV", _IOC_NONE, 0x6163, 0x00 },
+{ "linux/atm_nicstar.h", "NS_GETPSTAT", _IOC_READ|_IOC_WRITE, 0x6161, 0x0c },
+{ "linux/atm_nicstar.h", "NS_SETBUFLEV", _IOC_WRITE, 0x6162, 0x0c },
+{ "linux/atm_tcp.h", "ATMTCP_CREATE", _IOC_NONE, 0x618e, 0x00 },
+{ "linux/atm_tcp.h", "ATMTCP_REMOVE", _IOC_NONE, 0x618f, 0x00 },
+{ "linux/atm_tcp.h", "SIOCSIFATMTCP", _IOC_NONE, 0x6180, 0x00 },
+{ "linux/atm_zatm.h", "ZATM_GETPOOL", _IOC_WRITE, 0x6161, 0x0c },
+{ "linux/atm_zatm.h", "ZATM_GETPOOLZ", _IOC_WRITE, 0x6162, 0x0c },
+{ "linux/atm_zatm.h", "ZATM_SETPOOL", _IOC_WRITE, 0x6163, 0x0c },
+{ "linux/atmarp.h", "ATMARPD_CTRL", _IOC_NONE, 0x61e1, 0x00 },
+{ "linux/atmarp.h", "ATMARP_ENCAP", _IOC_NONE, 0x61e5, 0x00 },
+{ "linux/atmarp.h", "ATMARP_MKIP", _IOC_NONE, 0x61e2, 0x00 },
+{ "linux/atmarp.h", "ATMARP_SETENTRY", _IOC_NONE, 0x61e3, 0x00 },
+{ "linux/atmbr2684.h", "BR2684_SETFILT", _IOC_WRITE, 0x6190, 0x1c },
+{ "linux/atmclip.h", "SIOCMKCLIP", _IOC_NONE, 0x61e0, 0x00 },
+{ "linux/atmdev.h", "ATM_ADDADDR", _IOC_WRITE, 0x6188, 0x0c },
+{ "linux/atmdev.h", "ATM_ADDLECSADDR", _IOC_WRITE, 0x618e, 0x0c },
+{ "linux/atmdev.h", "ATM_ADDPARTY", _IOC_WRITE, 0x61f4, 0x08 },
+{ "linux/atmdev.h", "ATM_DELADDR", _IOC_WRITE, 0x6189, 0x0c },
+{ "linux/atmdev.h", "ATM_DELLECSADDR", _IOC_WRITE, 0x618f, 0x0c },
+{ "linux/atmdev.h", "ATM_DROPPARTY", _IOC_WRITE, 0x61f5, 0x04 },
+{ "linux/atmdev.h", "ATM_GETADDR", _IOC_WRITE, 0x6186, 0x0c },
+{ "linux/atmdev.h", "ATM_GETCIRANGE", _IOC_WRITE, 0x618a, 0x0c },
+{ "linux/atmdev.h", "ATM_GETESI", _IOC_WRITE, 0x6185, 0x0c },
+{ "linux/atmdev.h", "ATM_GETLECSADDR", _IOC_WRITE, 0x6190, 0x0c },
+{ "linux/atmdev.h", "ATM_GETLINKRATE", _IOC_WRITE, 0x6181, 0x0c },
+{ "linux/atmdev.h", "ATM_GETLOOP", _IOC_WRITE, 0x6152, 0x0c },
+{ "linux/atmdev.h", "ATM_GETNAMES", _IOC_WRITE, 0x6183, 0x08 },
+{ "linux/atmdev.h", "ATM_GETSTAT", _IOC_WRITE, 0x6150, 0x0c },
+{ "linux/atmdev.h", "ATM_GETSTATZ", _IOC_WRITE, 0x6151, 0x0c },
+{ "linux/atmdev.h", "ATM_GETTYPE", _IOC_WRITE, 0x6184, 0x0c },
+{ "linux/atmdev.h", "ATM_NEWBACKENDIF", _IOC_WRITE, 0x61f3, 0x02 },
+{ "linux/atmdev.h", "ATM_QUERYLOOP", _IOC_WRITE, 0x6154, 0x0c },
+{ "linux/atmdev.h", "ATM_RSTADDR", _IOC_WRITE, 0x6187, 0x0c },
+{ "linux/atmdev.h", "ATM_SETBACKEND", _IOC_WRITE, 0x61f2, 0x02 },
+{ "linux/atmdev.h", "ATM_SETCIRANGE", _IOC_WRITE, 0x618b, 0x0c },
+{ "linux/atmdev.h", "ATM_SETESI", _IOC_WRITE, 0x618c, 0x0c },
+{ "linux/atmdev.h", "ATM_SETESIF", _IOC_WRITE, 0x618d, 0x0c },
+{ "linux/atmdev.h", "ATM_SETLOOP", _IOC_WRITE, 0x6153, 0x0c },
+{ "linux/atmdev.h", "ATM_SETSC", _IOC_WRITE, 0x61f1, 0x04 },
+{ "linux/atmlec.h", "ATMLEC_CTRL", _IOC_NONE, 0x61d0, 0x00 },
+{ "linux/atmlec.h", "ATMLEC_DATA", _IOC_NONE, 0x61d1, 0x00 },
+{ "linux/atmlec.h", "ATMLEC_MCAST", _IOC_NONE, 0x61d2, 0x00 },
+{ "linux/atmmpc.h", "ATMMPC_CTRL", _IOC_NONE, 0x61d8, 0x00 },
+{ "linux/atmmpc.h", "ATMMPC_DATA", _IOC_NONE, 0x61d9, 0x00 },
+{ "linux/atmsvc.h", "ATMSIGD_CTRL", _IOC_NONE, 0x61f0, 0x00 },
+{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_ASKUMOUNT", _IOC_READ|_IOC_WRITE, 0x937d, 0x18 },
+{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_CATATONIC", _IOC_READ|_IOC_WRITE, 0x9379, 0x18 },
+{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_CLOSEMOUNT", _IOC_READ|_IOC_WRITE, 0x9375, 0x18 },
+{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_EXPIRE", _IOC_READ|_IOC_WRITE, 0x937c, 0x18 },
+{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_FAIL", _IOC_READ|_IOC_WRITE, 0x9377, 0x18 },
+{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_ISMOUNTPOINT", _IOC_READ|_IOC_WRITE, 0x937e, 0x18 },
+{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_OPENMOUNT", _IOC_READ|_IOC_WRITE, 0x9374, 0x18 },
+{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_PROTOSUBVER", _IOC_READ|_IOC_WRITE, 0x9373, 0x18 },
+{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_PROTOVER", _IOC_READ|_IOC_WRITE, 0x9372, 0x18 },
+{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_READY", _IOC_READ|_IOC_WRITE, 0x9376, 0x18 },
+{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_REQUESTER", _IOC_READ|_IOC_WRITE, 0x937b, 0x18 },
+{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_SETPIPEFD", _IOC_READ|_IOC_WRITE, 0x9378, 0x18 },
+{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_TIMEOUT", _IOC_READ|_IOC_WRITE, 0x937a, 0x18 },
+{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_VERSION", _IOC_READ|_IOC_WRITE, 0x9371, 0x18 },
+{ "linux/auto_fs.h", "AUTOFS_IOC_ASKUMOUNT", _IOC_READ, 0x9370, 0x04 },
+{ "linux/auto_fs.h", "AUTOFS_IOC_CATATONIC", _IOC_NONE, 0x9362, 0x00 },
+{ "linux/auto_fs.h", "AUTOFS_IOC_EXPIRE", _IOC_READ, 0x9365, 0x10c },
+{ "linux/auto_fs.h", "AUTOFS_IOC_EXPIRE_MULTI", _IOC_WRITE, 0x9366, 0x04 },
+{ "linux/auto_fs.h", "AUTOFS_IOC_FAIL", _IOC_NONE, 0x9361, 0x00 },
+{ "linux/auto_fs.h", "AUTOFS_IOC_PROTOSUBVER", _IOC_READ, 0x9367, 0x04 },
+{ "linux/auto_fs.h", "AUTOFS_IOC_PROTOVER", _IOC_READ, 0x9363, 0x04 },
+{ "linux/auto_fs.h", "AUTOFS_IOC_READY", _IOC_NONE, 0x9360, 0x00 },
+{ "linux/auto_fs.h", "AUTOFS_IOC_SETTIMEOUT32", _IOC_READ|_IOC_WRITE, 0x9364, 0x04 },
+{ "linux/blkpg.h", "BLKPG", _IOC_NONE, 0x1269, 0x00 },
+{ "linux/blkzoned.h", "BLKCLOSEZONE", _IOC_WRITE, 0x1287, 0x10 },
+{ "linux/blkzoned.h", "BLKFINISHZONE", _IOC_WRITE, 0x1288, 0x10 },
+{ "linux/blkzoned.h", "BLKGETNRZONES", _IOC_READ, 0x1285, 0x04 },
+{ "linux/blkzoned.h", "BLKGETZONESZ", _IOC_READ, 0x1284, 0x04 },
+{ "linux/blkzoned.h", "BLKOPENZONE", _IOC_WRITE, 0x1286, 0x10 },
+{ "linux/blkzoned.h", "BLKREPORTZONE", _IOC_READ|_IOC_WRITE, 0x1282, 0x10 },
+{ "linux/blkzoned.h", "BLKRESETZONE", _IOC_WRITE, 0x1283, 0x10 },
+{ "linux/bt-bmc.h", "BT_BMC_IOCTL_SMS_ATN", _IOC_NONE, 0xb100, 0x00 },
+{ "linux/btrfs.h", "BTRFS_IOC_ADD_DEV", _IOC_WRITE, 0x940a, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_BALANCE", _IOC_WRITE, 0x940c, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_BALANCE_CTL", _IOC_WRITE, 0x9421, 0x04 },
+{ "linux/btrfs.h", "BTRFS_IOC_BALANCE_PROGRESS", _IOC_READ, 0x9422, 0x400 },
+{ "linux/btrfs.h", "BTRFS_IOC_BALANCE_V2", _IOC_READ|_IOC_WRITE, 0x9420, 0x400 },
+{ "linux/btrfs.h", "BTRFS_IOC_CLONE", _IOC_WRITE, 0x9409, 0x04 },
+{ "linux/btrfs.h", "BTRFS_IOC_CLONE_RANGE", _IOC_WRITE, 0x940d, 0x20 },
+{ "linux/btrfs.h", "BTRFS_IOC_DEFAULT_SUBVOL", _IOC_WRITE, 0x9413, 0x08 },
+{ "linux/btrfs.h", "BTRFS_IOC_DEFRAG", _IOC_WRITE, 0x9402, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_DEFRAG_RANGE", _IOC_WRITE, 0x9410, 0x30 },
+{ "linux/btrfs.h", "BTRFS_IOC_DEVICES_READY", _IOC_READ, 0x9427, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_DEV_INFO", _IOC_READ|_IOC_WRITE, 0x941e, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_DEV_REPLACE", _IOC_READ|_IOC_WRITE, 0x9435, 0xa28 },
+{ "linux/btrfs.h", "BTRFS_IOC_FILE_EXTENT_SAME", _IOC_READ|_IOC_WRITE, 0x9436, 0x18 },
+{ "linux/btrfs.h", "BTRFS_IOC_FORGET_DEV", _IOC_WRITE, 0x9405, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_FS_INFO", _IOC_READ, 0x941f, 0x400 },
+{ "linux/btrfs.h", "BTRFS_IOC_GET_DEV_STATS", _IOC_READ|_IOC_WRITE, 0x9434, 0x408 },
+{ "linux/btrfs.h", "BTRFS_IOC_GET_FEATURES", _IOC_READ, 0x9439, 0x18 },
+{ "linux/btrfs.h", "BTRFS_IOC_GET_SUBVOL_INFO", _IOC_READ, 0x943c, 0x1f8 },
+{ "linux/btrfs.h", "BTRFS_IOC_GET_SUBVOL_ROOTREF", _IOC_READ|_IOC_WRITE, 0x943d, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_GET_SUPPORTED_FEATURES", _IOC_READ, 0x9439, 0x48 },
+{ "linux/btrfs.h", "BTRFS_IOC_INO_LOOKUP", _IOC_READ|_IOC_WRITE, 0x9412, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_INO_LOOKUP_USER", _IOC_READ|_IOC_WRITE, 0x943e, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_INO_PATHS", _IOC_READ|_IOC_WRITE, 0x9423, 0x38 },
+{ "linux/btrfs.h", "BTRFS_IOC_LOGICAL_INO", _IOC_READ|_IOC_WRITE, 0x9424, 0x38 },
+{ "linux/btrfs.h", "BTRFS_IOC_LOGICAL_INO_V2", _IOC_READ|_IOC_WRITE, 0x943b, 0x38 },
+{ "linux/btrfs.h", "BTRFS_IOC_QGROUP_ASSIGN", _IOC_WRITE, 0x9429, 0x18 },
+{ "linux/btrfs.h", "BTRFS_IOC_QGROUP_CREATE", _IOC_WRITE, 0x942a, 0x10 },
+{ "linux/btrfs.h", "BTRFS_IOC_QGROUP_LIMIT", _IOC_READ, 0x942b, 0x30 },
+{ "linux/btrfs.h", "BTRFS_IOC_QUOTA_CTL", _IOC_READ|_IOC_WRITE, 0x9428, 0x10 },
+{ "linux/btrfs.h", "BTRFS_IOC_QUOTA_RESCAN", _IOC_WRITE, 0x942c, 0x40 },
+{ "linux/btrfs.h", "BTRFS_IOC_QUOTA_RESCAN_STATUS", _IOC_READ, 0x942d, 0x40 },
+{ "linux/btrfs.h", "BTRFS_IOC_QUOTA_RESCAN_WAIT", _IOC_NONE, 0x942e, 0x00 },
+{ "linux/btrfs.h", "BTRFS_IOC_RESIZE", _IOC_WRITE, 0x9403, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_RM_DEV", _IOC_WRITE, 0x940b, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_RM_DEV_V2", _IOC_WRITE, 0x943a, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_SCAN_DEV", _IOC_WRITE, 0x9404, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_SCRUB", _IOC_READ|_IOC_WRITE, 0x941b, 0x400 },
+{ "linux/btrfs.h", "BTRFS_IOC_SCRUB_CANCEL", _IOC_NONE, 0x941c, 0x00 },
+{ "linux/btrfs.h", "BTRFS_IOC_SCRUB_PROGRESS", _IOC_READ|_IOC_WRITE, 0x941d, 0x400 },
+{ "linux/btrfs.h", "BTRFS_IOC_SEND", _IOC_WRITE, 0x9426, 0x48 },
+{ "linux/btrfs.h", "BTRFS_IOC_SET_FEATURES", _IOC_WRITE, 0x9439, 0x30 },
+{ "linux/btrfs.h", "BTRFS_IOC_SET_RECEIVED_SUBVOL", _IOC_READ|_IOC_WRITE, 0x9425, 0xc8 },
+{ "linux/btrfs.h", "BTRFS_IOC_SNAP_CREATE", _IOC_WRITE, 0x9401, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_SNAP_CREATE_V2", _IOC_WRITE, 0x9417, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_SNAP_DESTROY", _IOC_WRITE, 0x940f, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_SNAP_DESTROY_V2", _IOC_WRITE, 0x943f, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_SPACE_INFO", _IOC_READ|_IOC_WRITE, 0x9414, 0x10 },
+{ "linux/btrfs.h", "BTRFS_IOC_START_SYNC", _IOC_READ, 0x9418, 0x08 },
+{ "linux/btrfs.h", "BTRFS_IOC_SUBVOL_CREATE", _IOC_WRITE, 0x940e, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_SUBVOL_CREATE_V2", _IOC_WRITE, 0x9418, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_SUBVOL_GETFLAGS", _IOC_READ, 0x9419, 0x08 },
+{ "linux/btrfs.h", "BTRFS_IOC_SUBVOL_SETFLAGS", _IOC_WRITE, 0x941a, 0x08 },
+{ "linux/btrfs.h", "BTRFS_IOC_SYNC", _IOC_NONE, 0x9408, 0x00 },
+{ "linux/btrfs.h", "BTRFS_IOC_TRANS_END", _IOC_NONE, 0x9407, 0x00 },
+{ "linux/btrfs.h", "BTRFS_IOC_TRANS_START", _IOC_NONE, 0x9406, 0x00 },
+{ "linux/btrfs.h", "BTRFS_IOC_TREE_SEARCH", _IOC_READ|_IOC_WRITE, 0x9411, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_TREE_SEARCH_V2", _IOC_READ|_IOC_WRITE, 0x9411, 0x70 },
+{ "linux/btrfs.h", "BTRFS_IOC_WAIT_SYNC", _IOC_WRITE, 0x9416, 0x08 },
+{ "linux/capi.h", "CAPI_CLR_FLAGS", _IOC_READ, 0x4325, 0x04 },
+{ "linux/capi.h", "CAPI_GET_ERRCODE", _IOC_READ, 0x4321, 0x02 },
+{ "linux/capi.h", "CAPI_GET_FLAGS", _IOC_READ, 0x4323, 0x04 },
+{ "linux/capi.h", "CAPI_GET_MANUFACTURER", _IOC_READ|_IOC_WRITE, 0x4306, 0x04 },
+{ "linux/capi.h", "CAPI_GET_PROFILE", _IOC_READ|_IOC_WRITE, 0x4309, 0x40 },
+{ "linux/capi.h", "CAPI_GET_SERIAL", _IOC_READ|_IOC_WRITE, 0x4308, 0x04 },
+{ "linux/capi.h", "CAPI_GET_VERSION", _IOC_READ|_IOC_WRITE, 0x4307, 0x10 },
+{ "linux/capi.h", "CAPI_INSTALLED", _IOC_READ, 0x4322, 0x02 },
+{ "linux/capi.h", "CAPI_MANUFACTURER_CMD", _IOC_READ|_IOC_WRITE, 0x4320, 0x08 },
+{ "linux/capi.h", "CAPI_NCCI_GETUNIT", _IOC_READ, 0x4327, 0x04 },
+{ "linux/capi.h", "CAPI_NCCI_OPENCOUNT", _IOC_READ, 0x4326, 0x04 },
+{ "linux/capi.h", "CAPI_REGISTER", _IOC_WRITE, 0x4301, 0x0c },
+{ "linux/capi.h", "CAPI_SET_FLAGS", _IOC_READ, 0x4324, 0x04 },
+{ "linux/cciss_ioctl.h", "CCISS_BIG_PASSTHRU", _IOC_READ|_IOC_WRITE, 0x4212, 0x58 },
+{ "linux/cciss_ioctl.h", "CCISS_DEREGDISK", _IOC_NONE, 0x420c, 0x00 },
+{ "linux/cciss_ioctl.h", "CCISS_GETBUSTYPES", _IOC_READ, 0x4207, 0x04 },
+{ "linux/cciss_ioctl.h", "CCISS_GETDRIVVER", _IOC_READ, 0x4209, 0x04 },
+{ "linux/cciss_ioctl.h", "CCISS_GETFIRMVER", _IOC_READ, 0x4208, 0x04 },
+{ "linux/cciss_ioctl.h", "CCISS_GETHEARTBEAT", _IOC_READ, 0x4206, 0x04 },
+{ "linux/cciss_ioctl.h", "CCISS_GETINTINFO", _IOC_READ, 0x4202, 0x08 },
+{ "linux/cciss_ioctl.h", "CCISS_GETLUNINFO", _IOC_READ, 0x4211, 0x0c },
+{ "linux/cciss_ioctl.h", "CCISS_GETNODENAME", _IOC_READ, 0x4204, 0x10 },
+{ "linux/cciss_ioctl.h", "CCISS_GETPCIINFO", _IOC_READ, 0x4201, 0x08 },
+{ "linux/cciss_ioctl.h", "CCISS_PASSTHRU", _IOC_READ|_IOC_WRITE, 0x420b, 0x54 },
+{ "linux/cciss_ioctl.h", "CCISS_REGNEWD", _IOC_NONE, 0x420e, 0x00 },
+{ "linux/cciss_ioctl.h", "CCISS_REGNEWDISK", _IOC_WRITE, 0x420d, 0x04 },
+{ "linux/cciss_ioctl.h", "CCISS_RESCANDISK", _IOC_NONE, 0x4210, 0x00 },
+{ "linux/cciss_ioctl.h", "CCISS_REVALIDVOLS", _IOC_NONE, 0x420a, 0x00 },
+{ "linux/cciss_ioctl.h", "CCISS_SETINTINFO", _IOC_WRITE, 0x4203, 0x08 },
+{ "linux/cciss_ioctl.h", "CCISS_SETNODENAME", _IOC_WRITE, 0x4205, 0x10 },
+{ "linux/cdrom.h", "CDROMAUDIOBUFSIZ", 0, 0x5382, 0 },
+{ "linux/cdrom.h", "CDROMCLOSETRAY", 0, 0x5319, 0 },
+{ "linux/cdrom.h", "CDROMEJECT", 0, 0x5309, 0 },
+{ "linux/cdrom.h", "CDROMEJECT_SW", 0, 0x530f, 0 },
+{ "linux/cdrom.h", "CDROMGETSPINDOWN", 0, 0x531d, 0 },
+{ "linux/cdrom.h", "CDROMMULTISESSION", 0, 0x5310, 0 },
+{ "linux/cdrom.h", "CDROMPAUSE", 0, 0x5301, 0 },
+{ "linux/cdrom.h", "CDROMPLAYBLK", 0, 0x5317, 0 },
+{ "linux/cdrom.h", "CDROMPLAYMSF", 0, 0x5303, 0 },
+{ "linux/cdrom.h", "CDROMPLAYTRKIND", 0, 0x5304, 0 },
+{ "linux/cdrom.h", "CDROMREADALL", 0, 0x5318, 0 },
+{ "linux/cdrom.h", "CDROMREADAUDIO", 0, 0x530e, 0 },
+{ "linux/cdrom.h", "CDROMREADCOOKED", 0, 0x5315, 0 },
+{ "linux/cdrom.h", "CDROMREADMODE1", 0, 0x530d, 0 },
+{ "linux/cdrom.h", "CDROMREADMODE2", 0, 0x530c, 0 },
+{ "linux/cdrom.h", "CDROMREADRAW", 0, 0x5314, 0 },
+{ "linux/cdrom.h", "CDROMREADTOCENTRY", 0, 0x5306, 0 },
+{ "linux/cdrom.h", "CDROMREADTOCHDR", 0, 0x5305, 0 },
+{ "linux/cdrom.h", "CDROMRESET", 0, 0x5312, 0 },
+{ "linux/cdrom.h", "CDROMRESUME", 0, 0x5302, 0 },
+{ "linux/cdrom.h", "CDROMSEEK", 0, 0x5316, 0 },
+{ "linux/cdrom.h", "CDROMSETSPINDOWN", 0, 0x531e, 0 },
+{ "linux/cdrom.h", "CDROMSTART", 0, 0x5308, 0 },
+{ "linux/cdrom.h", "CDROMSTOP", 0, 0x5307, 0 },
+{ "linux/cdrom.h", "CDROMSUBCHNL", 0, 0x530b, 0 },
+{ "linux/cdrom.h", "CDROMVOLCTRL", 0, 0x530a, 0 },
+{ "linux/cdrom.h", "CDROMVOLREAD", 0, 0x5313, 0 },
+{ "linux/cdrom.h", "CDROM_CHANGER_NSLOTS", 0, 0x5328, 0 },
+{ "linux/cdrom.h", "CDROM_CLEAR_OPTIONS", 0, 0x5321, 0 },
+{ "linux/cdrom.h", "CDROM_DEBUG", 0, 0x5330, 0 },
+{ "linux/cdrom.h", "CDROM_DISC_STATUS", 0, 0x5327, 0 },
+{ "linux/cdrom.h", "CDROM_DRIVE_STATUS", 0, 0x5326, 0 },
+{ "linux/cdrom.h", "CDROM_GET_CAPABILITY", 0, 0x5331, 0 },
+{ "linux/cdrom.h", "CDROM_GET_MCN", 0, 0x5311, 0 },
+{ "linux/cdrom.h", "CDROM_LAST_WRITTEN", 0, 0x5395, 0 },
+{ "linux/cdrom.h", "CDROM_LOCKDOOR", 0, 0x5329, 0 },
+{ "linux/cdrom.h", "CDROM_MEDIA_CHANGED", 0, 0x5325, 0 },
+{ "linux/cdrom.h", "CDROM_NEXT_WRITABLE", 0, 0x5394, 0 },
+{ "linux/cdrom.h", "CDROM_SELECT_DISC", 0, 0x5323, 0 },
+{ "linux/cdrom.h", "CDROM_SELECT_SPEED", 0, 0x5322, 0 },
+{ "linux/cdrom.h", "CDROM_SEND_PACKET", 0, 0x5393, 0 },
+{ "linux/cdrom.h", "CDROM_SET_OPTIONS", 0, 0x5320, 0 },
+{ "linux/cdrom.h", "DVD_AUTH", 0, 0x5392, 0 },
+{ "linux/cdrom.h", "DVD_READ_STRUCT", 0, 0x5390, 0 },
+{ "linux/cdrom.h", "DVD_WRITE_STRUCT", 0, 0x5391, 0 },
+{ "linux/cec.h", "CEC_ADAP_G_CAPS", _IOC_READ|_IOC_WRITE, 0x6100, 0x4c },
+{ "linux/cec.h", "CEC_ADAP_G_CONNECTOR_INFO", _IOC_READ, 0x610a, 0x44 },
+{ "linux/cec.h", "CEC_ADAP_G_LOG_ADDRS", _IOC_READ, 0x6103, 0x5c },
+{ "linux/cec.h", "CEC_ADAP_G_PHYS_ADDR", _IOC_READ, 0x6101, 0x02 },
+{ "linux/cec.h", "CEC_ADAP_S_LOG_ADDRS", _IOC_READ|_IOC_WRITE, 0x6104, 0x5c },
+{ "linux/cec.h", "CEC_ADAP_S_PHYS_ADDR", _IOC_WRITE, 0x6102, 0x02 },
+{ "linux/cec.h", "CEC_DQEVENT", _IOC_READ|_IOC_WRITE, 0x6107, 0x50 },
+{ "linux/cec.h", "CEC_G_MODE", _IOC_READ, 0x6108, 0x04 },
+{ "linux/cec.h", "CEC_RECEIVE", _IOC_READ|_IOC_WRITE, 0x6106, 0x38 },
+{ "linux/cec.h", "CEC_S_MODE", _IOC_WRITE, 0x6109, 0x04 },
+{ "linux/cec.h", "CEC_TRANSMIT", _IOC_READ|_IOC_WRITE, 0x6105, 0x38 },
+{ "linux/chio.h", "CHIOEXCHANGE", _IOC_WRITE, 0x6302, 0x1c },
+{ "linux/chio.h", "CHIOGELEM", _IOC_WRITE, 0x6310, 0x6c },
+{ "linux/chio.h", "CHIOGPARAMS", _IOC_READ, 0x6306, 0x14 },
+{ "linux/chio.h", "CHIOGPICKER", _IOC_READ, 0x6304, 0x04 },
+{ "linux/chio.h", "CHIOGSTATUS", _IOC_WRITE, 0x6308, 0x08 },
+{ "linux/chio.h", "CHIOGVPARAMS", _IOC_READ, 0x6313, 0x70 },
+{ "linux/chio.h", "CHIOINITELEM", _IOC_NONE, 0x6311, 0x00 },
+{ "linux/chio.h", "CHIOMOVE", _IOC_WRITE, 0x6301, 0x14 },
+{ "linux/chio.h", "CHIOPOSITION", _IOC_WRITE, 0x6303, 0x0c },
+{ "linux/chio.h", "CHIOSPICKER", _IOC_WRITE, 0x6305, 0x04 },
+{ "linux/chio.h", "CHIOSVOLTAG", _IOC_WRITE, 0x6312, 0x30 },
+{ "linux/cm4000_cs.h", "CM_IOCARDOFF", _IOC_NONE, 0x6304, 0x00 },
+{ "linux/cm4000_cs.h", "CM_IOCGATR", _IOC_READ|_IOC_WRITE, 0x6301, 0x04 },
+{ "linux/cm4000_cs.h", "CM_IOCGSTATUS", _IOC_READ, 0x6300, 0x04 },
+{ "linux/cm4000_cs.h", "CM_IOCSPTS", _IOC_WRITE, 0x6302, 0x04 },
+{ "linux/cm4000_cs.h", "CM_IOCSRDR", _IOC_NONE, 0x6303, 0x00 },
+{ "linux/cm4000_cs.h", "CM_IOSDBGLVL", _IOC_WRITE, 0x63fa, 0x04 },
+{ "linux/coda.h", "CIOC_KERNEL_VERSION", _IOC_READ|_IOC_WRITE, 0x630a, 0x04 },
+{ "linux/dm-ioctl.h", "DM_DEV_ARM_POLL", _IOC_READ|_IOC_WRITE, 0xfd10, 0x138 },
+{ "linux/dm-ioctl.h", "DM_DEV_CREATE", _IOC_READ|_IOC_WRITE, 0xfd03, 0x138 },
+{ "linux/dm-ioctl.h", "DM_DEV_REMOVE", _IOC_READ|_IOC_WRITE, 0xfd04, 0x138 },
+{ "linux/dm-ioctl.h", "DM_DEV_RENAME", _IOC_READ|_IOC_WRITE, 0xfd05, 0x138 },
+{ "linux/dm-ioctl.h", "DM_DEV_SET_GEOMETRY", _IOC_READ|_IOC_WRITE, 0xfd0f, 0x138 },
+{ "linux/dm-ioctl.h", "DM_DEV_STATUS", _IOC_READ|_IOC_WRITE, 0xfd07, 0x138 },
+{ "linux/dm-ioctl.h", "DM_DEV_SUSPEND", _IOC_READ|_IOC_WRITE, 0xfd06, 0x138 },
+{ "linux/dm-ioctl.h", "DM_DEV_WAIT", _IOC_READ|_IOC_WRITE, 0xfd08, 0x138 },
+{ "linux/dm-ioctl.h", "DM_GET_TARGET_VERSION", _IOC_READ|_IOC_WRITE, 0xfd11, 0x138 },
+{ "linux/dm-ioctl.h", "DM_LIST_DEVICES", _IOC_READ|_IOC_WRITE, 0xfd02, 0x138 },
+{ "linux/dm-ioctl.h", "DM_LIST_VERSIONS", _IOC_READ|_IOC_WRITE, 0xfd0d, 0x138 },
+{ "linux/dm-ioctl.h", "DM_REMOVE_ALL", _IOC_READ|_IOC_WRITE, 0xfd01, 0x138 },
+{ "linux/dm-ioctl.h", "DM_TABLE_CLEAR", _IOC_READ|_IOC_WRITE, 0xfd0a, 0x138 },
+{ "linux/dm-ioctl.h", "DM_TABLE_DEPS", _IOC_READ|_IOC_WRITE, 0xfd0b, 0x138 },
+{ "linux/dm-ioctl.h", "DM_TABLE_LOAD", _IOC_READ|_IOC_WRITE, 0xfd09, 0x138 },
+{ "linux/dm-ioctl.h", "DM_TABLE_STATUS", _IOC_READ|_IOC_WRITE, 0xfd0c, 0x138 },
+{ "linux/dm-ioctl.h", "DM_TARGET_MSG", _IOC_READ|_IOC_WRITE, 0xfd0e, 0x138 },
+{ "linux/dm-ioctl.h", "DM_VERSION", _IOC_READ|_IOC_WRITE, 0xfd00, 0x138 },
+{ "linux/dma-buf.h", "DMA_BUF_IOCTL_SYNC", _IOC_WRITE, 0x6200, 0x08 },
+{ "linux/dma-buf.h", "DMA_BUF_SET_NAME_A", _IOC_WRITE, 0x6201, 0x04 },
+{ "linux/dma-buf.h", "DMA_BUF_SET_NAME_B", _IOC_WRITE, 0x6201, 0x08 },
+{ "linux/dma-heap.h", "DMA_HEAP_IOCTL_ALLOC", _IOC_READ|_IOC_WRITE, 0x4800, 0x18 },
+{ "linux/dn.h", "OSIOCGNETADDR", _IOC_READ, 0x89e1, 0x04 },
+{ "linux/dn.h", "OSIOCSNETADDR", _IOC_WRITE, 0x89e0, 0x04 },
+{ "linux/dvb/audio.h", "AUDIO_BILINGUAL_CHANNEL_SELECT", _IOC_NONE, 0x6f14, 0x00 },
+{ "linux/dvb/audio.h", "AUDIO_CHANNEL_SELECT", _IOC_NONE, 0x6f09, 0x00 },
+{ "linux/dvb/audio.h", "AUDIO_CLEAR_BUFFER", _IOC_NONE, 0x6f0c, 0x00 },
+{ "linux/dvb/audio.h", "AUDIO_CONTINUE", _IOC_NONE, 0x6f04, 0x00 },
+{ "linux/dvb/audio.h", "AUDIO_GET_CAPABILITIES", _IOC_READ, 0x6f0b, 0x04 },
+{ "linux/dvb/audio.h", "AUDIO_GET_STATUS", _IOC_READ, 0x6f0a, 0x20 },
+{ "linux/dvb/audio.h", "AUDIO_PAUSE", _IOC_NONE, 0x6f03, 0x00 },
+{ "linux/dvb/audio.h", "AUDIO_PLAY", _IOC_NONE, 0x6f02, 0x00 },
+{ "linux/dvb/audio.h", "AUDIO_SELECT_SOURCE", _IOC_NONE, 0x6f05, 0x00 },
+{ "linux/dvb/audio.h", "AUDIO_SET_AV_SYNC", _IOC_NONE, 0x6f07, 0x00 },
+{ "linux/dvb/audio.h", "AUDIO_SET_BYPASS_MODE", _IOC_NONE, 0x6f08, 0x00 },
+{ "linux/dvb/audio.h", "AUDIO_SET_ID", _IOC_NONE, 0x6f0d, 0x00 },
+{ "linux/dvb/audio.h", "AUDIO_SET_MIXER", _IOC_WRITE, 0x6f0e, 0x08 },
+{ "linux/dvb/audio.h", "AUDIO_SET_MUTE", _IOC_NONE, 0x6f06, 0x00 },
+{ "linux/dvb/audio.h", "AUDIO_SET_STREAMTYPE", _IOC_NONE, 0x6f0f, 0x00 },
+{ "linux/dvb/audio.h", "AUDIO_STOP", _IOC_NONE, 0x6f01, 0x00 },
+{ "linux/dvb/ca.h", "CA_GET_CAP", _IOC_READ, 0x6f81, 0x10 },
+{ "linux/dvb/ca.h", "CA_GET_DESCR_INFO", _IOC_READ, 0x6f83, 0x08 },
+{ "linux/dvb/ca.h", "CA_GET_MSG", _IOC_READ, 0x6f84, 0x10c },
+{ "linux/dvb/ca.h", "CA_GET_SLOT_INFO", _IOC_READ, 0x6f82, 0x0c },
+{ "linux/dvb/ca.h", "CA_RESET", _IOC_NONE, 0x6f80, 0x00 },
+{ "linux/dvb/ca.h", "CA_SEND_MSG", _IOC_WRITE, 0x6f85, 0x10c },
+{ "linux/dvb/ca.h", "CA_SET_DESCR", _IOC_WRITE, 0x6f86, 0x10 },
+{ "linux/dvb/dmx.h", "DMX_ADD_PID", _IOC_WRITE, 0x6f33, 0x02 },
+{ "linux/dvb/dmx.h", "DMX_DQBUF", _IOC_READ|_IOC_WRITE, 0x6f40, 0x18 },
+{ "linux/dvb/dmx.h", "DMX_EXPBUF", _IOC_READ|_IOC_WRITE, 0x6f3e, 0x0c },
+{ "linux/dvb/dmx.h", "DMX_GET_PES_PIDS", _IOC_READ, 0x6f2f, 0x0a },
+{ "linux/dvb/dmx.h", "DMX_GET_STC", _IOC_READ|_IOC_WRITE, 0x6f32, 0x10 },
+{ "linux/dvb/dmx.h", "DMX_QBUF", _IOC_READ|_IOC_WRITE, 0x6f3f, 0x18 },
+{ "linux/dvb/dmx.h", "DMX_QUERYBUF", _IOC_READ|_IOC_WRITE, 0x6f3d, 0x18 },
+{ "linux/dvb/dmx.h", "DMX_REMOVE_PID", _IOC_WRITE, 0x6f34, 0x02 },
+{ "linux/dvb/dmx.h", "DMX_REQBUFS", _IOC_READ|_IOC_WRITE, 0x6f3c, 0x08 },
+{ "linux/dvb/dmx.h", "DMX_SET_BUFFER_SIZE", _IOC_NONE, 0x6f2d, 0x00 },
+{ "linux/dvb/dmx.h", "DMX_SET_FILTER", _IOC_WRITE, 0x6f2b, 0x3c },
+{ "linux/dvb/dmx.h", "DMX_SET_PES_FILTER", _IOC_WRITE, 0x6f2c, 0x14 },
+{ "linux/dvb/dmx.h", "DMX_START", _IOC_NONE, 0x6f29, 0x00 },
+{ "linux/dvb/dmx.h", "DMX_STOP", _IOC_NONE, 0x6f2a, 0x00 },
+{ "linux/dvb/frontend.h", "FE_DISEQC_RECV_SLAVE_REPLY", _IOC_READ, 0x6f40, 0x0c },
+{ "linux/dvb/frontend.h", "FE_DISEQC_RESET_OVERLOAD", _IOC_NONE, 0x6f3e, 0x00 },
+{ "linux/dvb/frontend.h", "FE_DISEQC_SEND_BURST", _IOC_NONE, 0x6f41, 0x00 },
+{ "linux/dvb/frontend.h", "FE_DISEQC_SEND_MASTER_CMD", _IOC_WRITE, 0x6f3f, 0x07 },
+{ "linux/dvb/frontend.h", "FE_DISHNETWORK_SEND_LEGACY_CMD", _IOC_NONE, 0x6f50, 0x00 },
+{ "linux/dvb/frontend.h", "FE_ENABLE_HIGH_LNB_VOLTAGE", _IOC_NONE, 0x6f44, 0x00 },
+{ "linux/dvb/frontend.h", "FE_GET_EVENT", _IOC_READ, 0x6f4e, 0x28 },
+{ "linux/dvb/frontend.h", "FE_GET_FRONTEND", _IOC_READ, 0x6f4d, 0x24 },
+{ "linux/dvb/frontend.h", "FE_GET_INFO", _IOC_READ, 0x6f3d, 0xa8 },
+{ "linux/dvb/frontend.h", "FE_GET_PROPERTY", _IOC_READ, 0x6f53, 0x08 },
+{ "linux/dvb/frontend.h", "FE_READ_BER", _IOC_READ, 0x6f46, 0x04 },
+{ "linux/dvb/frontend.h", "FE_READ_SIGNAL_STRENGTH", _IOC_READ, 0x6f47, 0x02 },
+{ "linux/dvb/frontend.h", "FE_READ_SNR", _IOC_READ, 0x6f48, 0x02 },
+{ "linux/dvb/frontend.h", "FE_READ_STATUS", _IOC_READ, 0x6f45, 0x04 },
+{ "linux/dvb/frontend.h", "FE_READ_UNCORRECTED_BLOCKS", _IOC_READ, 0x6f49, 0x04 },
+{ "linux/dvb/frontend.h", "FE_SET_FRONTEND", _IOC_WRITE, 0x6f4c, 0x24 },
+{ "linux/dvb/frontend.h", "FE_SET_FRONTEND_TUNE_MODE", _IOC_NONE, 0x6f51, 0x00 },
+{ "linux/dvb/frontend.h", "FE_SET_PROPERTY", _IOC_WRITE, 0x6f52, 0x08 },
+{ "linux/dvb/frontend.h", "FE_SET_TONE", _IOC_NONE, 0x6f42, 0x00 },
+{ "linux/dvb/frontend.h", "FE_SET_VOLTAGE", _IOC_NONE, 0x6f43, 0x00 },
+{ "linux/dvb/net.h", "NET_ADD_IF", _IOC_READ|_IOC_WRITE, 0x6f34, 0x06 },
+{ "linux/dvb/net.h", "NET_GET_IF", _IOC_READ|_IOC_WRITE, 0x6f36, 0x06 },
+{ "linux/dvb/net.h", "NET_REMOVE_IF", _IOC_NONE, 0x6f35, 0x00 },
+{ "linux/dvb/osd.h", "OSD_GET_CAPABILITY", _IOC_READ, 0x6fa1, 0x08 },
+{ "linux/dvb/osd.h", "OSD_SEND_CMD", _IOC_WRITE, 0x6fa0, 0x1c },
+{ "linux/dvb/video.h", "VIDEO_CLEAR_BUFFER", _IOC_NONE, 0x6f22, 0x00 },
+{ "linux/dvb/video.h", "VIDEO_COMMAND", _IOC_READ|_IOC_WRITE, 0x6f3b, 0x48 },
+{ "linux/dvb/video.h", "VIDEO_CONTINUE", _IOC_NONE, 0x6f18, 0x00 },
+{ "linux/dvb/video.h", "VIDEO_FAST_FORWARD", _IOC_NONE, 0x6f1f, 0x00 },
+{ "linux/dvb/video.h", "VIDEO_FREEZE", _IOC_NONE, 0x6f17, 0x00 },
+{ "linux/dvb/video.h", "VIDEO_GET_CAPABILITIES", _IOC_READ, 0x6f21, 0x04 },
+{ "linux/dvb/video.h", "VIDEO_GET_EVENT", _IOC_READ, 0x6f1c, 0x14 },
+{ "linux/dvb/video.h", "VIDEO_GET_FRAME_COUNT", _IOC_READ, 0x6f3a, 0x08 },
+{ "linux/dvb/video.h", "VIDEO_GET_PTS", _IOC_READ, 0x6f39, 0x08 },
+{ "linux/dvb/video.h", "VIDEO_GET_SIZE", _IOC_READ, 0x6f37, 0x0c },
+{ "linux/dvb/video.h", "VIDEO_GET_STATUS", _IOC_READ, 0x6f1b, 0x14 },
+{ "linux/dvb/video.h", "VIDEO_PLAY", _IOC_NONE, 0x6f16, 0x00 },
+{ "linux/dvb/video.h", "VIDEO_SELECT_SOURCE", _IOC_NONE, 0x6f19, 0x00 },
+{ "linux/dvb/video.h", "VIDEO_SET_BLANK", _IOC_NONE, 0x6f1a, 0x00 },
+{ "linux/dvb/video.h", "VIDEO_SET_DISPLAY_FORMAT", _IOC_NONE, 0x6f1d, 0x00 },
+{ "linux/dvb/video.h", "VIDEO_SET_FORMAT", _IOC_NONE, 0x6f25, 0x00 },
+{ "linux/dvb/video.h", "VIDEO_SET_STREAMTYPE", _IOC_NONE, 0x6f24, 0x00 },
+{ "linux/dvb/video.h", "VIDEO_SLOWMOTION", _IOC_NONE, 0x6f20, 0x00 },
+{ "linux/dvb/video.h", "VIDEO_STILLPICTURE", _IOC_WRITE, 0x6f1e, 0x08 },
+{ "linux/dvb/video.h", "VIDEO_STOP", _IOC_NONE, 0x6f15, 0x00 },
+{ "linux/dvb/video.h", "VIDEO_TRY_COMMAND", _IOC_READ|_IOC_WRITE, 0x6f3c, 0x48 },
+{ "linux/fb.h", "FBIOBLANK", 0, 0x4611, 0 },
+{ "linux/fb.h", "FBIOGETCMAP", 0, 0x4604, 0 },
+{ "linux/fb.h", "FBIOGET_CON2FBMAP", 0, 0x460F, 0 },
+{ "linux/fb.h", "FBIOGET_DISPINFO", 0, 0x4618, 0 },
+{ "linux/fb.h", "FBIOGET_FSCREENINFO", 0, 0x4602, 0 },
+{ "linux/fb.h", "FBIOGET_GLYPH", 0, 0x4615, 0 },
+{ "linux/fb.h", "FBIOGET_HWCINFO", 0, 0x4616, 0 },
+{ "linux/fb.h", "FBIOGET_VBLANK", _IOC_READ, 0x4612, 0x20 },
+{ "linux/fb.h", "FBIOGET_VSCREENINFO", 0, 0x4600, 0 },
+{ "linux/fb.h", "FBIOPAN_DISPLAY", 0, 0x4606, 0 },
+{ "linux/fb.h", "FBIOPUTCMAP", 0, 0x4605, 0 },
+{ "linux/fb.h", "FBIOPUT_CON2FBMAP", 0, 0x4610, 0 },
+{ "linux/fb.h", "FBIOPUT_MODEINFO", 0, 0x4617, 0 },
+{ "linux/fb.h", "FBIOPUT_VSCREENINFO", 0, 0x4601, 0 },
+{ "linux/fb.h", "FBIO_ALLOC", 0, 0x4613, 0 },
+{ "linux/fb.h", "FBIO_CURSOR", _IOC_READ|_IOC_WRITE, 0x4608, 0x48 },
+{ "linux/fb.h", "FBIO_FREE", 0, 0x4614, 0 },
+{ "linux/fb.h", "FBIO_WAITFORVSYNC", _IOC_WRITE, 0x4620, 0x04 },
+{ "linux/fd.h", "FDCLRPRM", _IOC_NONE, 0x0241, 0x00 },
+{ "linux/fd.h", "FDDEFPRM", _IOC_WRITE, 0x0243, 0x1c },
+{ "linux/fd.h", "FDEJECT", _IOC_NONE, 0x025a, 0x00 },
+{ "linux/fd.h", "FDFLUSH", _IOC_NONE, 0x024b, 0x00 },
+{ "linux/fd.h", "FDFMTBEG", _IOC_NONE, 0x0247, 0x00 },
+{ "linux/fd.h", "FDFMTEND", _IOC_NONE, 0x0249, 0x00 },
+{ "linux/fd.h", "FDFMTTRK", _IOC_WRITE, 0x0248, 0x0c },
+{ "linux/fd.h", "FDGETDRVPRM", _IOC_READ, 0x0211, 0x58 },
+{ "linux/fd.h", "FDGETDRVSTAT", _IOC_READ, 0x0212, 0x34 },
+{ "linux/fd.h", "FDGETDRVTYP", _IOC_READ, 0x020f, 0x10 },
+{ "linux/fd.h", "FDGETFDCSTAT", _IOC_READ, 0x0215, 0x20 },
+{ "linux/fd.h", "FDGETMAXERRS", _IOC_READ, 0x020e, 0x14 },
+{ "linux/fd.h", "FDGETPRM", _IOC_READ, 0x0204, 0x1c },
+{ "linux/fd.h", "FDMSGOFF", _IOC_NONE, 0x0246, 0x00 },
+{ "linux/fd.h", "FDMSGON", _IOC_NONE, 0x0245, 0x00 },
+{ "linux/fd.h", "FDPOLLDRVSTAT", _IOC_READ, 0x0213, 0x34 },
+{ "linux/fd.h", "FDRAWCMD", _IOC_NONE, 0x0258, 0x00 },
+{ "linux/fd.h", "FDRESET", _IOC_NONE, 0x0254, 0x00 },
+{ "linux/fd.h", "FDSETDRVPRM", _IOC_WRITE, 0x0290, 0x58 },
+{ "linux/fd.h", "FDSETEMSGTRESH", _IOC_NONE, 0x024a, 0x00 },
+{ "linux/fd.h", "FDSETMAXERRS", _IOC_WRITE, 0x024c, 0x14 },
+{ "linux/fd.h", "FDSETPRM", _IOC_WRITE, 0x0242, 0x1c },
+{ "linux/fd.h", "FDTWADDLE", _IOC_NONE, 0x0259, 0x00 },
+{ "linux/fd.h", "FDWERRORCLR", _IOC_NONE, 0x0256, 0x00 },
+{ "linux/fd.h", "FDWERRORGET", _IOC_READ, 0x0217, 0x18 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_ADD_DESCRIPTOR", _IOC_READ|_IOC_WRITE, 0x2306, 0x18 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_ALLOCATE", _IOC_READ|_IOC_WRITE, 0x2302, 0x20 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_ALLOCATE_ISO_RESOURCE", _IOC_READ|_IOC_WRITE, 0x230d, 0x18 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_ALLOCATE_ISO_RESOURCE_ONCE", _IOC_WRITE, 0x230f, 0x18 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_CREATE_ISO_CONTEXT", _IOC_READ|_IOC_WRITE, 0x2308, 0x20 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_DEALLOCATE", _IOC_WRITE, 0x2303, 0x04 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_DEALLOCATE_ISO_RESOURCE", _IOC_WRITE, 0x230e, 0x04 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_DEALLOCATE_ISO_RESOURCE_ONCE", _IOC_WRITE, 0x2310, 0x18 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_FLUSH_ISO", _IOC_WRITE, 0x2318, 0x04 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_GET_CYCLE_TIMER", _IOC_READ, 0x230c, 0x10 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_GET_CYCLE_TIMER2", _IOC_READ|_IOC_WRITE, 0x2314, 0x18 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_GET_INFO", _IOC_READ|_IOC_WRITE, 0x2300, 0x28 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_GET_SPEED", _IOC_NONE, 0x2311, 0x00 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_INITIATE_BUS_RESET", _IOC_WRITE, 0x2305, 0x04 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_QUEUE_ISO", _IOC_READ|_IOC_WRITE, 0x2309, 0x18 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_RECEIVE_PHY_PACKETS", _IOC_WRITE, 0x2316, 0x08 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_REMOVE_DESCRIPTOR", _IOC_WRITE, 0x2307, 0x04 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_SEND_BROADCAST_REQUEST", _IOC_WRITE, 0x2312, 0x28 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_SEND_PHY_PACKET", _IOC_READ|_IOC_WRITE, 0x2315, 0x18 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_SEND_REQUEST", _IOC_WRITE, 0x2301, 0x28 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_SEND_RESPONSE", _IOC_WRITE, 0x2304, 0x18 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_SEND_STREAM_PACKET", _IOC_WRITE, 0x2313, 0x28 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_SET_ISO_CHANNELS", _IOC_WRITE, 0x2317, 0x10 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_START_ISO", _IOC_WRITE, 0x230a, 0x10 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_STOP_ISO", _IOC_WRITE, 0x230b, 0x04 },
+{ "linux/fpga-dfl.h", "DFL_FPGA_CHECK_EXTENSION", _IOC_NONE, 0xb601, 0x00 },
+{ "linux/fpga-dfl.h", "DFL_FPGA_FME_ERR_GET_IRQ_NUM", _IOC_READ, 0xb683, 0x04 },
+{ "linux/fpga-dfl.h", "DFL_FPGA_FME_ERR_SET_IRQ", _IOC_WRITE, 0xb684, 0x08 },
+{ "linux/fpga-dfl.h", "DFL_FPGA_FME_PORT_ASSIGN", _IOC_WRITE, 0xb682, 0x04 },
+{ "linux/fpga-dfl.h", "DFL_FPGA_FME_PORT_PR", _IOC_NONE, 0xb680, 0x00 },
+{ "linux/fpga-dfl.h", "DFL_FPGA_FME_PORT_RELEASE", _IOC_WRITE, 0xb681, 0x04 },
+{ "linux/fpga-dfl.h", "DFL_FPGA_GET_API_VERSION", _IOC_NONE, 0xb600, 0x00 },
+{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_DMA_MAP", _IOC_NONE, 0xb643, 0x00 },
+{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_DMA_UNMAP", _IOC_NONE, 0xb644, 0x00 },
+{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_ERR_GET_IRQ_NUM", _IOC_READ, 0xb645, 0x04 },
+{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_ERR_SET_IRQ", _IOC_WRITE, 0xb646, 0x08 },
+{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_GET_INFO", _IOC_NONE, 0xb641, 0x00 },
+{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_GET_REGION_INFO", _IOC_NONE, 0xb642, 0x00 },
+{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_RESET", _IOC_NONE, 0xb640, 0x00 },
+{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_UINT_GET_IRQ_NUM", _IOC_READ, 0xb647, 0x04 },
+{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_UINT_SET_IRQ", _IOC_WRITE, 0xb648, 0x08 },
+{ "linux/fs.h", "BLKALIGNOFF", _IOC_NONE, 0x127a, 0x00 },
+{ "linux/fs.h", "BLKBSZGET", _IOC_READ, 0x1270, 0x04 },
+{ "linux/fs.h", "BLKBSZSET", _IOC_WRITE, 0x1271, 0x04 },
+{ "linux/fs.h", "BLKDISCARD", _IOC_NONE, 0x1277, 0x00 },
+{ "linux/fs.h", "BLKDISCARDZEROES", _IOC_NONE, 0x127c, 0x00 },
+{ "linux/fs.h", "BLKFLSBUF", _IOC_NONE, 0x1261, 0x00 },
+{ "linux/fs.h", "BLKFRAGET", _IOC_NONE, 0x1265, 0x00 },
+{ "linux/fs.h", "BLKFRASET", _IOC_NONE, 0x1264, 0x00 },
+{ "linux/fs.h", "BLKGETSIZE", _IOC_NONE, 0x1260, 0x00 },
+{ "linux/fs.h", "BLKGETSIZE64", _IOC_READ, 0x1272, 0x04 },
+{ "linux/fs.h", "BLKIOMIN", _IOC_NONE, 0x1278, 0x00 },
+{ "linux/fs.h", "BLKIOOPT", _IOC_NONE, 0x1279, 0x00 },
+{ "linux/fs.h", "BLKPBSZGET", _IOC_NONE, 0x127b, 0x00 },
+{ "linux/fs.h", "BLKRAGET", _IOC_NONE, 0x1263, 0x00 },
+{ "linux/fs.h", "BLKRASET", _IOC_NONE, 0x1262, 0x00 },
+{ "linux/fs.h", "BLKROGET", _IOC_NONE, 0x125e, 0x00 },
+{ "linux/fs.h", "BLKROSET", _IOC_NONE, 0x125d, 0x00 },
+{ "linux/fs.h", "BLKROTATIONAL", _IOC_NONE, 0x127e, 0x00 },
+{ "linux/fs.h", "BLKRRPART", _IOC_NONE, 0x125f, 0x00 },
+{ "linux/fs.h", "BLKSECDISCARD", _IOC_NONE, 0x127d, 0x00 },
+{ "linux/fs.h", "BLKSECTGET", _IOC_NONE, 0x1267, 0x00 },
+{ "linux/fs.h", "BLKSECTSET", _IOC_NONE, 0x1266, 0x00 },
+{ "linux/fs.h", "BLKSSZGET", _IOC_NONE, 0x1268, 0x00 },
+{ "linux/fs.h", "BLKTRACESETUP", _IOC_READ|_IOC_WRITE, 0x1273, 0x48 },
+{ "linux/fs.h", "BLKTRACESTART", _IOC_NONE, 0x1274, 0x00 },
+{ "linux/fs.h", "BLKTRACESTOP", _IOC_NONE, 0x1275, 0x00 },
+{ "linux/fs.h", "BLKTRACETEARDOWN", _IOC_NONE, 0x1276, 0x00 },
+{ "linux/fs.h", "BLKZEROOUT", _IOC_NONE, 0x127f, 0x00 },
+{ "linux/fs.h", "FIBMAP", _IOC_NONE, 0x0001, 0x00 },
+{ "linux/fs.h", "FICLONE", _IOC_WRITE, 0x9409, 0x04 },
+{ "linux/fs.h", "FICLONERANGE", _IOC_WRITE, 0x940d, 0x20 },
+{ "linux/fs.h", "FIDEDUPERANGE", _IOC_READ|_IOC_WRITE, 0x9436, 0x18 },
+{ "linux/fs.h", "FIFREEZE", _IOC_READ|_IOC_WRITE, 0x5877, 0x04 },
+{ "linux/fs.h", "FIGETBSZ", _IOC_NONE, 0x0002, 0x00 },
+{ "linux/fs.h", "FITHAW", _IOC_READ|_IOC_WRITE, 0x5878, 0x04 },
+{ "linux/fs.h", "FITRIM", _IOC_READ|_IOC_WRITE, 0x5879, 0x18 },
+{ "linux/fs.h", "FS_IOC32_GETFLAGS", _IOC_READ, 0x6601, 0x04 },
+{ "linux/fs.h", "FS_IOC32_GETVERSION", _IOC_READ, 0x7601, 0x04 },
+{ "linux/fs.h", "FS_IOC32_SETFLAGS", _IOC_WRITE, 0x6602, 0x04 },
+{ "linux/fs.h", "FS_IOC32_SETVERSION", _IOC_WRITE, 0x7602, 0x04 },
+{ "linux/fs.h", "FS_IOC_FIEMAP", _IOC_READ|_IOC_WRITE, 0x660b, 0x20 },
+{ "linux/fs.h", "FS_IOC_FSGETXATTR", _IOC_READ, 0x581f, 0x1c },
+{ "linux/fs.h", "FS_IOC_FSSETXATTR", _IOC_WRITE, 0x5820, 0x1c },
+{ "linux/fs.h", "FS_IOC_GETFSLABEL", _IOC_READ, 0x9431, 0x100 },
+{ "linux/fs.h", "FS_IOC_SETFSLABEL", _IOC_WRITE, 0x9432, 0x100 },
+{ "linux/fscrypt.h", "FS_IOC_ADD_ENCRYPTION_KEY", _IOC_READ|_IOC_WRITE, 0x6617, 0x50 },
+{ "linux/fscrypt.h", "FS_IOC_GET_ENCRYPTION_KEY_STATUS", _IOC_READ|_IOC_WRITE, 0x661a, 0x80 },
+{ "linux/fscrypt.h", "FS_IOC_GET_ENCRYPTION_NONCE", _IOC_READ, 0x661b, 0x10 },
+{ "linux/fscrypt.h", "FS_IOC_GET_ENCRYPTION_POLICY", _IOC_WRITE, 0x6615, 0x0c },
+{ "linux/fscrypt.h", "FS_IOC_GET_ENCRYPTION_POLICY_EX", _IOC_READ|_IOC_WRITE, 0x6616, 0x09 },
+{ "linux/fscrypt.h", "FS_IOC_GET_ENCRYPTION_PWSALT", _IOC_WRITE, 0x6614, 0x10 },
+{ "linux/fscrypt.h", "FS_IOC_REMOVE_ENCRYPTION_KEY", _IOC_READ|_IOC_WRITE, 0x6618, 0x40 },
+{ "linux/fscrypt.h", "FS_IOC_REMOVE_ENCRYPTION_KEY_ALL_USERS", _IOC_READ|_IOC_WRITE, 0x6619, 0x40 },
+{ "linux/fscrypt.h", "FS_IOC_SET_ENCRYPTION_POLICY", _IOC_READ, 0x6613, 0x0c },
+{ "linux/fsi.h", "FSI_SCOM_CHECK", _IOC_READ, 0x7300, 0x04 },
+{ "linux/fsi.h", "FSI_SCOM_READ", _IOC_READ|_IOC_WRITE, 0x7301, 0x20 },
+{ "linux/fsi.h", "FSI_SCOM_RESET", _IOC_WRITE, 0x7303, 0x04 },
+{ "linux/fsi.h", "FSI_SCOM_WRITE", _IOC_READ|_IOC_WRITE, 0x7302, 0x20 },
+{ "linux/fsl-diu-fb.h", "MFB_GET_ALPHA", _IOC_READ, 0x4d00, 0x01 },
+{ "linux/fsl-diu-fb.h", "MFB_GET_AOID", _IOC_READ, 0x4d04, 0x08 },
+{ "linux/fsl-diu-fb.h", "MFB_GET_GAMMA", _IOC_READ, 0x4d01, 0x01 },
+{ "linux/fsl-diu-fb.h", "MFB_GET_PIXFMT", _IOC_READ, 0x4d08, 0x04 },
+{ "linux/fsl-diu-fb.h", "MFB_SET_ALPHA", _IOC_WRITE, 0x4d00, 0x01 },
+{ "linux/fsl-diu-fb.h", "MFB_SET_AOID", _IOC_WRITE, 0x4d04, 0x08 },
+{ "linux/fsl-diu-fb.h", "MFB_SET_BRIGHTNESS", _IOC_WRITE, 0x4d03, 0x01 },
+{ "linux/fsl-diu-fb.h", "MFB_SET_CHROMA_KEY", _IOC_WRITE, 0x4d01, 0x0c },
+{ "linux/fsl-diu-fb.h", "MFB_SET_GAMMA", _IOC_WRITE, 0x4d01, 0x01 },
+{ "linux/fsl-diu-fb.h", "MFB_SET_PIXFMT", _IOC_WRITE, 0x4d08, 0x04 },
+{ "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_DOORBELL", _IOC_READ|_IOC_WRITE, 0xaf06, 0x08 },
+{ "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_GETPROP", _IOC_READ|_IOC_WRITE, 0xaf07, 0x28 },
+{ "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_MEMCPY", _IOC_READ|_IOC_WRITE, 0xaf05, 0x28 },
+{ "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_PARTITION_GET_STATUS", _IOC_READ|_IOC_WRITE, 0xaf02, 0x0c },
+{ "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_PARTITION_RESTART", _IOC_READ|_IOC_WRITE, 0xaf01, 0x08 },
+{ "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_PARTITION_START", _IOC_READ|_IOC_WRITE, 0xaf03, 0x10 },
+{ "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_PARTITION_STOP", _IOC_READ|_IOC_WRITE, 0xaf04, 0x08 },
+{ "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_SETPROP", _IOC_READ|_IOC_WRITE, 0xaf08, 0x28 },
+{ "linux/fsmap.h", "FS_IOC_GETFSMAP", _IOC_READ|_IOC_WRITE, 0x583b, 0xc0 },
+{ "linux/fsverity.h", "FS_IOC_ENABLE_VERITY", _IOC_WRITE, 0x6685, 0x80 },
+{ "linux/fsverity.h", "FS_IOC_MEASURE_VERITY", _IOC_READ|_IOC_WRITE, 0x6686, 0x04 },
+{ "linux/fuse.h", "FUSE_DEV_IOC_CLONE", _IOC_READ, 0xe500, 0x04 },
+{ "linux/genwqe/genwqe_card.h", "GENWQE_EXECUTE_DDCB", _IOC_READ|_IOC_WRITE, 0xa532, 0xe8 },
+{ "linux/genwqe/genwqe_card.h", "GENWQE_EXECUTE_RAW_DDCB", _IOC_READ|_IOC_WRITE, 0xa533, 0xe8 },
+{ "linux/genwqe/genwqe_card.h", "GENWQE_GET_CARD_STATE", _IOC_READ, 0xa524, 0x04 },
+{ "linux/genwqe/genwqe_card.h", "GENWQE_PIN_MEM", _IOC_READ|_IOC_WRITE, 0xa528, 0x20 },
+{ "linux/genwqe/genwqe_card.h", "GENWQE_READ_REG16", _IOC_READ, 0xa522, 0x10 },
+{ "linux/genwqe/genwqe_card.h", "GENWQE_READ_REG32", _IOC_READ, 0xa520, 0x10 },
+{ "linux/genwqe/genwqe_card.h", "GENWQE_READ_REG64", _IOC_READ, 0xa51e, 0x10 },
+{ "linux/genwqe/genwqe_card.h", "GENWQE_SLU_READ", _IOC_READ|_IOC_WRITE, 0xa551, 0x38 },
+{ "linux/genwqe/genwqe_card.h", "GENWQE_SLU_UPDATE", _IOC_READ|_IOC_WRITE, 0xa550, 0x38 },
+{ "linux/genwqe/genwqe_card.h", "GENWQE_UNPIN_MEM", _IOC_READ|_IOC_WRITE, 0xa529, 0x20 },
+{ "linux/genwqe/genwqe_card.h", "GENWQE_WRITE_REG16", _IOC_WRITE, 0xa523, 0x10 },
+{ "linux/genwqe/genwqe_card.h", "GENWQE_WRITE_REG32", _IOC_WRITE, 0xa521, 0x10 },
+{ "linux/genwqe/genwqe_card.h", "GENWQE_WRITE_REG64", _IOC_WRITE, 0xa51f, 0x10 },
+{ "linux/gpio.h", "GPIOHANDLE_GET_LINE_VALUES_IOCTL", _IOC_READ|_IOC_WRITE, 0xb408, 0x40 },
+{ "linux/gpio.h", "GPIOHANDLE_SET_CONFIG_IOCTL", _IOC_READ|_IOC_WRITE, 0xb40a, 0x54 },
+{ "linux/gpio.h", "GPIOHANDLE_SET_LINE_VALUES_IOCTL", _IOC_READ|_IOC_WRITE, 0xb409, 0x40 },
+{ "linux/gpio.h", "GPIO_GET_CHIPINFO_IOCTL", _IOC_READ, 0xb401, 0x44 },
+{ "linux/gpio.h", "GPIO_GET_LINEEVENT_IOCTL", _IOC_READ|_IOC_WRITE, 0xb404, 0x30 },
+{ "linux/gpio.h", "GPIO_GET_LINEHANDLE_IOCTL", _IOC_READ|_IOC_WRITE, 0xb403, 0x16c },
+{ "linux/gpio.h", "GPIO_GET_LINEINFO_IOCTL", _IOC_READ|_IOC_WRITE, 0xb402, 0x48 },
+{ "linux/gpio.h", "GPIO_GET_LINEINFO_UNWATCH_IOCTL", _IOC_READ|_IOC_WRITE, 0xb40c, 0x04 },
+{ "linux/gpio.h", "GPIO_GET_LINEINFO_WATCH_IOCTL", _IOC_READ|_IOC_WRITE, 0xb40b, 0x48 },
+{ "linux/gpio.h", "GPIO_V2_GET_LINEINFO_IOCTL", _IOC_READ|_IOC_WRITE, 0xb405, 0x100 },
+{ "linux/gpio.h", "GPIO_V2_GET_LINEINFO_WATCH_IOCTL", _IOC_READ|_IOC_WRITE, 0xb406, 0x100 },
+{ "linux/gpio.h", "GPIO_V2_GET_LINE_IOCTL", _IOC_READ|_IOC_WRITE, 0xb407, 0x250 },
+{ "linux/gpio.h", "GPIO_V2_LINE_GET_VALUES_IOCTL", _IOC_READ|_IOC_WRITE, 0xb40e, 0x10 },
+{ "linux/gpio.h", "GPIO_V2_LINE_SET_CONFIG_IOCTL", _IOC_READ|_IOC_WRITE, 0xb40d, 0x110 },
+{ "linux/gpio.h", "GPIO_V2_LINE_SET_VALUES_IOCTL", _IOC_READ|_IOC_WRITE, 0xb40f, 0x10 },
+{ "linux/gsmmux.h", "GSMIOC_DISABLE_NET", _IOC_NONE, 0x4703, 0x00 },
+{ "linux/gsmmux.h", "GSMIOC_ENABLE_NET", _IOC_WRITE, 0x4702, 0x34 },
+{ "linux/gsmmux.h", "GSMIOC_GETCONF", _IOC_READ, 0x4700, 0x4c },
+{ "linux/gsmmux.h", "GSMIOC_GETFIRST", _IOC_READ, 0x4704, 0x04 },
+{ "linux/gsmmux.h", "GSMIOC_SETCONF", _IOC_WRITE, 0x4701, 0x4c },
+{ "linux/hdreg.h", "HDIO_DRIVE_CMD", 0, 0x031f, 0 },
+{ "linux/hdreg.h", "HDIO_DRIVE_RESET", 0, 0x031c, 0 },
+{ "linux/hdreg.h", "HDIO_DRIVE_TASK", 0, 0x031e, 0 },
+{ "linux/hdreg.h", "HDIO_DRIVE_TASKFILE", 0, 0x031d, 0 },
+{ "linux/hdreg.h", "HDIO_GETGEO", 0, 0x0301, 0 },
+{ "linux/hdreg.h", "HDIO_GET_32BIT", 0, 0x0309, 0 },
+{ "linux/hdreg.h", "HDIO_GET_ACOUSTIC", 0, 0x030f, 0 },
+{ "linux/hdreg.h", "HDIO_GET_ADDRESS", 0, 0x0310, 0 },
+{ "linux/hdreg.h", "HDIO_GET_BUSSTATE", 0, 0x031a, 0 },
+{ "linux/hdreg.h", "HDIO_GET_DMA", 0, 0x030b, 0 },
+{ "linux/hdreg.h", "HDIO_GET_IDENTITY", 0, 0x030d, 0 },
+{ "linux/hdreg.h", "HDIO_GET_KEEPSETTINGS", 0, 0x0308, 0 },
+{ "linux/hdreg.h", "HDIO_GET_MULTCOUNT", 0, 0x0304, 0 },
+{ "linux/hdreg.h", "HDIO_GET_NICE", 0, 0x030c, 0 },
+{ "linux/hdreg.h", "HDIO_GET_NOWERR", 0, 0x030a, 0 },
+{ "linux/hdreg.h", "HDIO_GET_QDMA", 0, 0x0305, 0 },
+{ "linux/hdreg.h", "HDIO_GET_UNMASKINTR", 0, 0x0302, 0 },
+{ "linux/hdreg.h", "HDIO_GET_WCACHE", 0, 0x030e, 0 },
+{ "linux/hdreg.h", "HDIO_OBSOLETE_IDENTITY", 0, 0x0307, 0 },
+{ "linux/hdreg.h", "HDIO_SCAN_HWIF", 0, 0x0328, 0 },
+{ "linux/hdreg.h", "HDIO_SET_32BIT", 0, 0x0324, 0 },
+{ "linux/hdreg.h", "HDIO_SET_ACOUSTIC", 0, 0x032c, 0 },
+{ "linux/hdreg.h", "HDIO_SET_ADDRESS", 0, 0x032f, 0 },
+{ "linux/hdreg.h", "HDIO_SET_BUSSTATE", 0, 0x032d, 0 },
+{ "linux/hdreg.h", "HDIO_SET_DMA", 0, 0x0326, 0 },
+{ "linux/hdreg.h", "HDIO_SET_KEEPSETTINGS", 0, 0x0323, 0 },
+{ "linux/hdreg.h", "HDIO_SET_MULTCOUNT", 0, 0x0321, 0 },
+{ "linux/hdreg.h", "HDIO_SET_NICE", 0, 0x0329, 0 },
+{ "linux/hdreg.h", "HDIO_SET_NOWERR", 0, 0x0325, 0 },
+{ "linux/hdreg.h", "HDIO_SET_PIO_MODE", 0, 0x0327, 0 },
+{ "linux/hdreg.h", "HDIO_SET_QDMA", 0, 0x032e, 0 },
+{ "linux/hdreg.h", "HDIO_SET_UNMASKINTR", 0, 0x0322, 0 },
+{ "linux/hdreg.h", "HDIO_SET_WCACHE", 0, 0x032b, 0 },
+{ "linux/hdreg.h", "HDIO_SET_XFER", 0, 0x0306, 0 },
+{ "linux/hdreg.h", "HDIO_TRISTATE_HWIF", 0, 0x031b, 0 },
+{ "linux/hdreg.h", "HDIO_UNREGISTER_HWIF", 0, 0x032a, 0 },
+{ "linux/hid-roccat.h", "ROCCATIOCGREPSIZE", _IOC_READ, 0x48f1, 0x04 },
+{ "linux/hiddev.h", "HIDIOCAPPLICATION", _IOC_NONE, 0x4802, 0x00 },
+{ "linux/hiddev.h", "HIDIOCGCOLLECTIONINDEX", _IOC_WRITE, 0x4810, 0x18 },
+{ "linux/hiddev.h", "HIDIOCGCOLLECTIONINFO", _IOC_READ|_IOC_WRITE, 0x4811, 0x10 },
+{ "linux/hiddev.h", "HIDIOCGDEVINFO", _IOC_READ, 0x4803, 0x1c },
+{ "linux/hiddev.h", "HIDIOCGFIELDINFO", _IOC_READ|_IOC_WRITE, 0x480a, 0x38 },
+{ "linux/hiddev.h", "HIDIOCGFLAG", _IOC_READ, 0x480e, 0x04 },
+{ "linux/hiddev.h", "HIDIOCGREPORT", _IOC_WRITE, 0x4807, 0x0c },
+{ "linux/hiddev.h", "HIDIOCGREPORTINFO", _IOC_READ|_IOC_WRITE, 0x4809, 0x0c },
+{ "linux/hiddev.h", "HIDIOCGSTRING", _IOC_READ, 0x4804, 0x104 },
+{ "linux/hiddev.h", "HIDIOCGUCODE", _IOC_READ|_IOC_WRITE, 0x480d, 0x18 },
+{ "linux/hiddev.h", "HIDIOCGUSAGE", _IOC_READ|_IOC_WRITE, 0x480b, 0x18 },
+{ "linux/hiddev.h", "HIDIOCGUSAGES", _IOC_READ|_IOC_WRITE, 0x4813, 0x101c },
+{ "linux/hiddev.h", "HIDIOCGVERSION", _IOC_READ, 0x4801, 0x04 },
+{ "linux/hiddev.h", "HIDIOCINITREPORT", _IOC_NONE, 0x4805, 0x00 },
+{ "linux/hiddev.h", "HIDIOCSFLAG", _IOC_WRITE, 0x480f, 0x04 },
+{ "linux/hiddev.h", "HIDIOCSREPORT", _IOC_WRITE, 0x4808, 0x0c },
+{ "linux/hiddev.h", "HIDIOCSUSAGE", _IOC_WRITE, 0x480c, 0x18 },
+{ "linux/hiddev.h", "HIDIOCSUSAGES", _IOC_WRITE, 0x4814, 0x101c },
+{ "linux/hidraw.h", "HIDIOCGRAWINFO", _IOC_READ, 0x4803, 0x08 },
+{ "linux/hidraw.h", "HIDIOCGRDESC", _IOC_READ, 0x4802, 0x1004 },
+{ "linux/hidraw.h", "HIDIOCGRDESCSIZE", _IOC_READ, 0x4801, 0x04 },
+{ "linux/hpet.h", "HPET_DPI", _IOC_NONE, 0x6805, 0x00 },
+{ "linux/hpet.h", "HPET_EPI", _IOC_NONE, 0x6804, 0x00 },
+{ "linux/hpet.h", "HPET_IE_OFF", _IOC_NONE, 0x6802, 0x00 },
+{ "linux/hpet.h", "HPET_IE_ON", _IOC_NONE, 0x6801, 0x00 },
+{ "linux/hpet.h", "HPET_INFO", _IOC_READ, 0x6803, 0x0c },
+{ "linux/hpet.h", "HPET_IRQFREQ", _IOC_WRITE, 0x6806, 0x04 },
+{ "linux/hsi/cs-protocol.h", "CS_CONFIG_BUFS", _IOC_WRITE, 0x431f, 0x20 },
+{ "linux/hsi/cs-protocol.h", "CS_GET_IF_VERSION", _IOC_READ, 0x431e, 0x04 },
+{ "linux/hsi/cs-protocol.h", "CS_GET_STATE", _IOC_READ, 0x4315, 0x04 },
+{ "linux/hsi/cs-protocol.h", "CS_SET_WAKELINE", _IOC_WRITE, 0x4317, 0x04 },
+{ "linux/hsi/hsi_char.h", "HSC_GET_RX", _IOC_WRITE, 0x6b14, 0x0c },
+{ "linux/hsi/hsi_char.h", "HSC_GET_TX", _IOC_WRITE, 0x6b16, 0x10 },
+{ "linux/hsi/hsi_char.h", "HSC_RESET", _IOC_NONE, 0x6b10, 0x00 },
+{ "linux/hsi/hsi_char.h", "HSC_SEND_BREAK", _IOC_NONE, 0x6b12, 0x00 },
+{ "linux/hsi/hsi_char.h", "HSC_SET_PM", _IOC_NONE, 0x6b11, 0x00 },
+{ "linux/hsi/hsi_char.h", "HSC_SET_RX", _IOC_WRITE, 0x6b13, 0x0c },
+{ "linux/hsi/hsi_char.h", "HSC_SET_TX", _IOC_WRITE, 0x6b15, 0x10 },
+{ "linux/i2o-dev.h", "I2OEVTGET", _IOC_READ, 0x690b, 0x68 },
+{ "linux/i2o-dev.h", "I2OEVTREG", _IOC_WRITE, 0x690a, 0x0c },
+{ "linux/i2o-dev.h", "I2OGETIOPS", _IOC_READ, 0x6900, 0x20 },
+{ "linux/i2o-dev.h", "I2OHRTGET", _IOC_READ|_IOC_WRITE, 0x6901, 0x0c },
+{ "linux/i2o-dev.h", "I2OHTML", _IOC_READ|_IOC_WRITE, 0x6909, 0x1c },
+{ "linux/i2o-dev.h", "I2OLCTGET", _IOC_READ|_IOC_WRITE, 0x6902, 0x0c },
+{ "linux/i2o-dev.h", "I2OPARMGET", _IOC_READ|_IOC_WRITE, 0x6904, 0x18 },
+{ "linux/i2o-dev.h", "I2OPARMSET", _IOC_READ|_IOC_WRITE, 0x6903, 0x18 },
+{ "linux/i2o-dev.h", "I2OPASSTHRU32", _IOC_READ, 0x690c, 0x08 },
+{ "linux/i2o-dev.h", "I2OSWDEL", _IOC_READ|_IOC_WRITE, 0x6907, 0x1c },
+{ "linux/i2o-dev.h", "I2OSWDL", _IOC_READ|_IOC_WRITE, 0x6905, 0x1c },
+{ "linux/i2o-dev.h", "I2OSWUL", _IOC_READ|_IOC_WRITE, 0x6906, 0x1c },
+{ "linux/i2o-dev.h", "I2OVALIDATE", _IOC_READ, 0x6908, 0x04 },
+{ "linux/i8k.h", "I8K_BIOS_VERSION", _IOC_READ, 0x6980, 0x04 },
+{ "linux/i8k.h", "I8K_FN_STATUS", _IOC_READ, 0x6983, 0x04 },
+{ "linux/i8k.h", "I8K_GET_FAN", _IOC_READ|_IOC_WRITE, 0x6986, 0x04 },
+{ "linux/i8k.h", "I8K_GET_SPEED", _IOC_READ|_IOC_WRITE, 0x6985, 0x04 },
+{ "linux/i8k.h", "I8K_GET_TEMP", _IOC_READ, 0x6984, 0x04 },
+{ "linux/i8k.h", "I8K_MACHINE_ID", _IOC_READ, 0x6981, 0x04 },
+{ "linux/i8k.h", "I8K_POWER_STATUS", _IOC_READ, 0x6982, 0x04 },
+{ "linux/i8k.h", "I8K_SET_FAN", _IOC_READ|_IOC_WRITE, 0x6987, 0x04 },
+{ "linux/if_pppox.h", "PPPOEIOCDFWD", _IOC_NONE, 0xb101, 0x00 },
+{ "linux/if_pppox.h", "PPPOEIOCSFWD", _IOC_WRITE, 0xb100, 0x04 },
+{ "linux/if_tun.h", "TUNATTACHFILTER", _IOC_WRITE, 0x54d5, 0x08 },
+{ "linux/if_tun.h", "TUNDETACHFILTER", _IOC_WRITE, 0x54d6, 0x08 },
+{ "linux/if_tun.h", "TUNGETDEVNETNS", _IOC_NONE, 0x54e3, 0x00 },
+{ "linux/if_tun.h", "TUNGETFEATURES", _IOC_READ, 0x54cf, 0x04 },
+{ "linux/if_tun.h", "TUNGETFILTER", _IOC_READ, 0x54db, 0x08 },
+{ "linux/if_tun.h", "TUNGETIFF", _IOC_READ, 0x54d2, 0x04 },
+{ "linux/if_tun.h", "TUNGETSNDBUF", _IOC_READ, 0x54d3, 0x04 },
+{ "linux/if_tun.h", "TUNGETVNETBE", _IOC_READ, 0x54df, 0x04 },
+{ "linux/if_tun.h", "TUNGETVNETHDRSZ", _IOC_READ, 0x54d7, 0x04 },
+{ "linux/if_tun.h", "TUNGETVNETLE", _IOC_READ, 0x54dd, 0x04 },
+{ "linux/if_tun.h", "TUNSETCARRIER", _IOC_WRITE, 0x54e2, 0x04 },
+{ "linux/if_tun.h", "TUNSETDEBUG", _IOC_WRITE, 0x54c9, 0x04 },
+{ "linux/if_tun.h", "TUNSETFILTEREBPF", _IOC_READ, 0x54e1, 0x04 },
+{ "linux/if_tun.h", "TUNSETGROUP", _IOC_WRITE, 0x54ce, 0x04 },
+{ "linux/if_tun.h", "TUNSETIFF", _IOC_WRITE, 0x54ca, 0x04 },
+{ "linux/if_tun.h", "TUNSETIFINDEX", _IOC_WRITE, 0x54da, 0x04 },
+{ "linux/if_tun.h", "TUNSETLINK", _IOC_WRITE, 0x54cd, 0x04 },
+{ "linux/if_tun.h", "TUNSETNOCSUM", _IOC_WRITE, 0x54c8, 0x04 },
+{ "linux/if_tun.h", "TUNSETOFFLOAD", _IOC_WRITE, 0x54d0, 0x04 },
+{ "linux/if_tun.h", "TUNSETOWNER", _IOC_WRITE, 0x54cc, 0x04 },
+{ "linux/if_tun.h", "TUNSETPERSIST", _IOC_WRITE, 0x54cb, 0x04 },
+{ "linux/if_tun.h", "TUNSETQUEUE", _IOC_WRITE, 0x54d9, 0x04 },
+{ "linux/if_tun.h", "TUNSETSNDBUF", _IOC_WRITE, 0x54d4, 0x04 },
+{ "linux/if_tun.h", "TUNSETSTEERINGEBPF", _IOC_READ, 0x54e0, 0x04 },
+{ "linux/if_tun.h", "TUNSETTXFILTER", _IOC_WRITE, 0x54d1, 0x04 },
+{ "linux/if_tun.h", "TUNSETVNETBE", _IOC_WRITE, 0x54de, 0x04 },
+{ "linux/if_tun.h", "TUNSETVNETHDRSZ", _IOC_WRITE, 0x54d8, 0x04 },
+{ "linux/if_tun.h", "TUNSETVNETLE", _IOC_WRITE, 0x54dc, 0x04 },
+{ "linux/iio/events.h", "IIO_GET_EVENT_FD_IOCTL", _IOC_READ, 0x6990, 0x04 },
+{ "linux/inotify.h", "INOTIFY_IOC_SETNEXTWD", _IOC_WRITE, 0x4900, 0x04 },
+{ "linux/input.h", "EVIOCGEFFECTS", _IOC_READ, 0x4584, 0x04 },
+{ "linux/input.h", "EVIOCGID", _IOC_READ, 0x4502, 0x08 },
+{ "linux/input.h", "EVIOCGKEYCODE", _IOC_READ, 0x4504, 0x08 },
+{ "linux/input.h", "EVIOCGKEYCODE_V2", _IOC_READ, 0x4504, 0x28 },
+{ "linux/input.h", "EVIOCGMASK", _IOC_READ, 0x4592, 0x10 },
+{ "linux/input.h", "EVIOCGRAB", _IOC_WRITE, 0x4590, 0x04 },
+{ "linux/input.h", "EVIOCGREP", _IOC_READ, 0x4503, 0x08 },
+{ "linux/input.h", "EVIOCGVERSION", _IOC_READ, 0x4501, 0x04 },
+{ "linux/input.h", "EVIOCREVOKE", _IOC_WRITE, 0x4591, 0x04 },
+{ "linux/input.h", "EVIOCRMFF", _IOC_WRITE, 0x4581, 0x04 },
+{ "linux/input.h", "EVIOCSCLOCKID", _IOC_WRITE, 0x45a0, 0x04 },
+{ "linux/input.h", "EVIOCSFF", _IOC_WRITE, 0x4580, 0x2c },
+{ "linux/input.h", "EVIOCSKEYCODE", _IOC_WRITE, 0x4504, 0x08 },
+{ "linux/input.h", "EVIOCSKEYCODE_V2", _IOC_WRITE, 0x4504, 0x28 },
+{ "linux/input.h", "EVIOCSMASK", _IOC_WRITE, 0x4593, 0x10 },
+{ "linux/input.h", "EVIOCSREP", _IOC_WRITE, 0x4503, 0x08 },
+{ "linux/ipmi.h", "IPMICTL_GET_MAINTENANCE_MODE_CMD", _IOC_READ, 0x691e, 0x04 },
+{ "linux/ipmi.h", "IPMICTL_GET_MY_ADDRESS_CMD", _IOC_READ, 0x6912, 0x04 },
+{ "linux/ipmi.h", "IPMICTL_GET_MY_CHANNEL_ADDRESS_CMD", _IOC_READ, 0x6919, 0x04 },
+{ "linux/ipmi.h", "IPMICTL_GET_MY_CHANNEL_LUN_CMD", _IOC_READ, 0x691b, 0x04 },
+{ "linux/ipmi.h", "IPMICTL_GET_MY_LUN_CMD", _IOC_READ, 0x6914, 0x04 },
+{ "linux/ipmi.h", "IPMICTL_GET_TIMING_PARMS_CMD", _IOC_READ, 0x6917, 0x08 },
+{ "linux/ipmi.h", "IPMICTL_RECEIVE_MSG", _IOC_READ|_IOC_WRITE, 0x690c, 0x18 },
+{ "linux/ipmi.h", "IPMICTL_RECEIVE_MSG_TRUNC", _IOC_READ|_IOC_WRITE, 0x690b, 0x18 },
+{ "linux/ipmi.h", "IPMICTL_REGISTER_FOR_CMD", _IOC_READ, 0x690e, 0x02 },
+{ "linux/ipmi.h", "IPMICTL_REGISTER_FOR_CMD_CHANS", _IOC_READ, 0x691c, 0x0c },
+{ "linux/ipmi.h", "IPMICTL_SEND_COMMAND", _IOC_READ, 0x690d, 0x14 },
+{ "linux/ipmi.h", "IPMICTL_SEND_COMMAND_SETTIME", _IOC_READ, 0x6915, 0x1c },
+{ "linux/ipmi.h", "IPMICTL_SET_GETS_EVENTS_CMD", _IOC_READ, 0x6910, 0x04 },
+{ "linux/ipmi.h", "IPMICTL_SET_MAINTENANCE_MODE_CMD", _IOC_WRITE, 0x691f, 0x04 },
+{ "linux/ipmi.h", "IPMICTL_SET_MY_ADDRESS_CMD", _IOC_READ, 0x6911, 0x04 },
+{ "linux/ipmi.h", "IPMICTL_SET_MY_CHANNEL_ADDRESS_CMD", _IOC_READ, 0x6918, 0x04 },
+{ "linux/ipmi.h", "IPMICTL_SET_MY_CHANNEL_LUN_CMD", _IOC_READ, 0x691a, 0x04 },
+{ "linux/ipmi.h", "IPMICTL_SET_MY_LUN_CMD", _IOC_READ, 0x6913, 0x04 },
+{ "linux/ipmi.h", "IPMICTL_SET_TIMING_PARMS_CMD", _IOC_READ, 0x6916, 0x08 },
+{ "linux/ipmi.h", "IPMICTL_UNREGISTER_FOR_CMD", _IOC_READ, 0x690f, 0x02 },
+{ "linux/ipmi.h", "IPMICTL_UNREGISTER_FOR_CMD_CHANS", _IOC_READ, 0x691d, 0x0c },
+{ "linux/ipmi_bmc.h", "IPMI_BMC_IOCTL_CLEAR_SMS_ATN", _IOC_NONE, 0xb101, 0x00 },
+{ "linux/ipmi_bmc.h", "IPMI_BMC_IOCTL_FORCE_ABORT", _IOC_NONE, 0xb102, 0x00 },
+{ "linux/ipmi_bmc.h", "IPMI_BMC_IOCTL_SET_SMS_ATN", _IOC_NONE, 0xb100, 0x00 },
+{ "linux/isst_if.h", "ISST_IF_GET_PHY_ID", _IOC_READ|_IOC_WRITE, 0xfe01, 0x04 },
+{ "linux/isst_if.h", "ISST_IF_GET_PLATFORM_INFO", _IOC_READ, 0xfe00, 0x04 },
+{ "linux/isst_if.h", "ISST_IF_IO_CMD", _IOC_WRITE, 0xfe02, 0x04 },
+{ "linux/isst_if.h", "ISST_IF_MBOX_COMMAND", _IOC_READ|_IOC_WRITE, 0xfe03, 0x04 },
+{ "linux/isst_if.h", "ISST_IF_MSR_COMMAND", _IOC_READ|_IOC_WRITE, 0xfe04, 0x04 },
+{ "linux/ivtv.h", "IVTV_IOC_DMA_FRAME", _IOC_WRITE, 0x56c0, 0x38 },
+{ "linux/ivtv.h", "IVTV_IOC_PASSTHROUGH_MODE", _IOC_WRITE, 0x56c1, 0x04 },
+{ "linux/ivtvfb.h", "IVTVFB_IOC_DMA_FRAME", _IOC_WRITE, 0x56c0, 0x0c },
+{ "linux/joystick.h", "JSIOCGAXES", _IOC_READ, 0x6a11, 0x01 },
+{ "linux/joystick.h", "JSIOCGAXMAP", _IOC_READ, 0x6a32, 0x40 },
+{ "linux/joystick.h", "JSIOCGBTNMAP", _IOC_READ, 0x6a34, 0x400 },
+{ "linux/joystick.h", "JSIOCGBUTTONS", _IOC_READ, 0x6a12, 0x01 },
+{ "linux/joystick.h", "JSIOCGCORR", _IOC_READ, 0x6a22, 0x24 },
+{ "linux/joystick.h", "JSIOCGVERSION", _IOC_READ, 0x6a01, 0x04 },
+{ "linux/joystick.h", "JSIOCSAXMAP", _IOC_WRITE, 0x6a31, 0x40 },
+{ "linux/joystick.h", "JSIOCSBTNMAP", _IOC_WRITE, 0x6a33, 0x400 },
+{ "linux/joystick.h", "JSIOCSCORR", _IOC_WRITE, 0x6a21, 0x24 },
+{ "linux/kcov.h", "KCOV_DISABLE", _IOC_NONE, 0x6365, 0x00 },
+{ "linux/kcov.h", "KCOV_ENABLE", _IOC_NONE, 0x6364, 0x00 },
+{ "linux/kcov.h", "KCOV_INIT_TRACE", _IOC_READ, 0x6301, 0x04 },
+{ "linux/kcov.h", "KCOV_REMOTE_ENABLE", _IOC_WRITE, 0x6366, 0x18 },
+{ "linux/kd.h", "GIO_CMAP", 0, 0x4B70, 0 },
+{ "linux/kd.h", "GIO_FONT", 0, 0x4B60, 0 },
+{ "linux/kd.h", "GIO_FONTX", 0, 0x4B6B, 0 },
+{ "linux/kd.h", "GIO_SCRNMAP", 0, 0x4B40, 0 },
+{ "linux/kd.h", "GIO_UNIMAP", 0, 0x4B66, 0 },
+{ "linux/kd.h", "GIO_UNISCRNMAP", 0, 0x4B69, 0 },
+{ "linux/kd.h", "KDADDIO", 0, 0x4B34, 0 },
+{ "linux/kd.h", "KDDELIO", 0, 0x4B35, 0 },
+{ "linux/kd.h", "KDDISABIO", 0, 0x4B37, 0 },
+{ "linux/kd.h", "KDENABIO", 0, 0x4B36, 0 },
+{ "linux/kd.h", "KDFONTOP", 0, 0x4B72, 0 },
+{ "linux/kd.h", "KDGETKEYCODE", 0, 0x4B4C, 0 },
+{ "linux/kd.h", "KDGETLED", 0, 0x4B31, 0 },
+{ "linux/kd.h", "KDGETMODE", 0, 0x4B3B, 0 },
+{ "linux/kd.h", "KDGKBDIACR", 0, 0x4B4A, 0 },
+{ "linux/kd.h", "KDGKBDIACRUC", 0, 0x4BFA, 0 },
+{ "linux/kd.h", "KDGKBENT", 0, 0x4B46, 0 },
+{ "linux/kd.h", "KDGKBLED", 0, 0x4B64, 0 },
+{ "linux/kd.h", "KDGKBMETA", 0, 0x4B62, 0 },
+{ "linux/kd.h", "KDGKBMODE", 0, 0x4B44, 0 },
+{ "linux/kd.h", "KDGKBSENT", 0, 0x4B48, 0 },
+{ "linux/kd.h", "KDGKBTYPE", 0, 0x4B33, 0 },
+{ "linux/kd.h", "KDKBDREP", 0, 0x4B52, 0 },
+{ "linux/kd.h", "KDMAPDISP", 0, 0x4B3C, 0 },
+{ "linux/kd.h", "KDMKTONE", 0, 0x4B30, 0 },
+{ "linux/kd.h", "KDSETKEYCODE", 0, 0x4B4D, 0 },
+{ "linux/kd.h", "KDSETLED", 0, 0x4B32, 0 },
+{ "linux/kd.h", "KDSETMODE", 0, 0x4B3A, 0 },
+{ "linux/kd.h", "KDSIGACCEPT", 0, 0x4B4E, 0 },
+{ "linux/kd.h", "KDSKBDIACR", 0, 0x4B4B, 0 },
+{ "linux/kd.h", "KDSKBDIACRUC", 0, 0x4BFB, 0 },
+{ "linux/kd.h", "KDSKBENT", 0, 0x4B47, 0 },
+{ "linux/kd.h", "KDSKBLED", 0, 0x4B65, 0 },
+{ "linux/kd.h", "KDSKBMETA", 0, 0x4B63, 0 },
+{ "linux/kd.h", "KDSKBMODE", 0, 0x4B45, 0 },
+{ "linux/kd.h", "KDSKBSENT", 0, 0x4B49, 0 },
+{ "linux/kd.h", "KDUNMAPDISP", 0, 0x4B3D, 0 },
+{ "linux/kd.h", "KIOCSOUND", 0, 0x4B2F, 0 },
+{ "linux/kd.h", "PIO_CMAP", 0, 0x4B71, 0 },
+{ "linux/kd.h", "PIO_FONT", 0, 0x4B61, 0 },
+{ "linux/kd.h", "PIO_FONTRESET", 0, 0x4B6D, 0 },
+{ "linux/kd.h", "PIO_FONTX", 0, 0x4B6C, 0 },
+{ "linux/kd.h", "PIO_SCRNMAP", 0, 0x4B41, 0 },
+{ "linux/kd.h", "PIO_UNIMAP", 0, 0x4B67, 0 },
+{ "linux/kd.h", "PIO_UNIMAPCLR", 0, 0x4B68, 0 },
+{ "linux/kd.h", "PIO_UNISCRNMAP", 0, 0x4B6A, 0 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_ACQUIRE_VM", _IOC_WRITE, 0x4b15, 0x08 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_ALLOC_MEMORY_OF_GPU", _IOC_READ|_IOC_WRITE, 0x4b16, 0x28 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_ALLOC_QUEUE_GWS", _IOC_READ|_IOC_WRITE, 0x4b1e, 0x10 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_CREATE_EVENT", _IOC_READ|_IOC_WRITE, 0x4b08, 0x20 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_CREATE_QUEUE", _IOC_READ|_IOC_WRITE, 0x4b02, 0x58 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_DBG_ADDRESS_WATCH", _IOC_WRITE, 0x4b0f, 0x10 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_DBG_REGISTER", _IOC_WRITE, 0x4b0d, 0x08 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_DBG_UNREGISTER", _IOC_WRITE, 0x4b0e, 0x08 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_DBG_WAVE_CONTROL", _IOC_WRITE, 0x4b10, 0x10 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_DESTROY_EVENT", _IOC_WRITE, 0x4b09, 0x08 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_DESTROY_QUEUE", _IOC_READ|_IOC_WRITE, 0x4b03, 0x08 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_FREE_MEMORY_OF_GPU", _IOC_WRITE, 0x4b17, 0x08 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_CLOCK_COUNTERS", _IOC_READ|_IOC_WRITE, 0x4b05, 0x28 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_DMABUF_INFO", _IOC_READ|_IOC_WRITE, 0x4b1c, 0x20 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_PROCESS_APERTURES", _IOC_READ, 0x4b06, 0x190 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_PROCESS_APERTURES_NEW", _IOC_READ|_IOC_WRITE, 0x4b14, 0x10 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_QUEUE_WAVE_STATE", _IOC_READ|_IOC_WRITE, 0x4b1b, 0x18 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_TILE_CONFIG", _IOC_READ|_IOC_WRITE, 0x4b12, 0x28 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_VERSION", _IOC_READ, 0x4b01, 0x08 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_IMPORT_DMABUF", _IOC_READ|_IOC_WRITE, 0x4b1d, 0x18 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_MAP_MEMORY_TO_GPU", _IOC_READ|_IOC_WRITE, 0x4b18, 0x18 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_RESET_EVENT", _IOC_WRITE, 0x4b0b, 0x08 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_SET_CU_MASK", _IOC_WRITE, 0x4b1a, 0x10 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_SET_EVENT", _IOC_WRITE, 0x4b0a, 0x08 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_SET_MEMORY_POLICY", _IOC_WRITE, 0x4b04, 0x20 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_SET_SCRATCH_BACKING_VA", _IOC_READ|_IOC_WRITE, 0x4b11, 0x10 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_SET_TRAP_HANDLER", _IOC_WRITE, 0x4b13, 0x18 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_SMI_EVENTS", _IOC_READ|_IOC_WRITE, 0x4b1f, 0x08 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_UNMAP_MEMORY_FROM_GPU", _IOC_READ|_IOC_WRITE, 0x4b19, 0x18 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_UPDATE_QUEUE", _IOC_WRITE, 0x4b07, 0x18 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_WAIT_EVENTS", _IOC_READ|_IOC_WRITE, 0x4b0c, 0x18 },
+{ "linux/lightnvm.h", "NVME_NVM_IOCTL_ADMIN_VIO", _IOC_READ|_IOC_WRITE, 0x4c41, 0x50 },
+{ "linux/lightnvm.h", "NVME_NVM_IOCTL_IO_VIO", _IOC_READ|_IOC_WRITE, 0x4c43, 0x50 },
+{ "linux/lightnvm.h", "NVME_NVM_IOCTL_SUBMIT_VIO", _IOC_READ|_IOC_WRITE, 0x4c42, 0x40 },
+{ "linux/lightnvm.h", "NVM_DEV_CREATE", _IOC_WRITE, 0x4c22, 0x80 },
+{ "linux/lightnvm.h", "NVM_DEV_FACTORY", _IOC_WRITE, 0x4c25, 0x24 },
+{ "linux/lightnvm.h", "NVM_DEV_INIT", _IOC_WRITE, 0x4c24, 0x2c },
+{ "linux/lightnvm.h", "NVM_DEV_REMOVE", _IOC_WRITE, 0x4c23, 0x24 },
+{ "linux/lightnvm.h", "NVM_GET_DEVICES", _IOC_READ, 0x4c21, 0x1000 },
+{ "linux/lightnvm.h", "NVM_INFO", _IOC_READ|_IOC_WRITE, 0x4c20, 0x1000 },
+{ "linux/lirc.h", "LIRC_GET_FEATURES", _IOC_READ, 0x6900, 0x04 },
+{ "linux/lirc.h", "LIRC_GET_LENGTH", _IOC_READ, 0x690f, 0x04 },
+{ "linux/lirc.h", "LIRC_GET_MAX_TIMEOUT", _IOC_READ, 0x6909, 0x04 },
+{ "linux/lirc.h", "LIRC_GET_MIN_TIMEOUT", _IOC_READ, 0x6908, 0x04 },
+{ "linux/lirc.h", "LIRC_GET_REC_MODE", _IOC_READ, 0x6902, 0x04 },
+{ "linux/lirc.h", "LIRC_GET_REC_RESOLUTION", _IOC_READ, 0x6907, 0x04 },
+{ "linux/lirc.h", "LIRC_GET_REC_TIMEOUT", _IOC_READ, 0x6924, 0x04 },
+{ "linux/lirc.h", "LIRC_GET_SEND_MODE", _IOC_READ, 0x6901, 0x04 },
+{ "linux/lirc.h", "LIRC_SET_MEASURE_CARRIER_MODE", _IOC_WRITE, 0x691d, 0x04 },
+{ "linux/lirc.h", "LIRC_SET_REC_CARRIER", _IOC_WRITE, 0x6914, 0x04 },
+{ "linux/lirc.h", "LIRC_SET_REC_CARRIER_RANGE", _IOC_WRITE, 0x691f, 0x04 },
+{ "linux/lirc.h", "LIRC_SET_REC_MODE", _IOC_WRITE, 0x6912, 0x04 },
+{ "linux/lirc.h", "LIRC_SET_REC_TIMEOUT", _IOC_WRITE, 0x6918, 0x04 },
+{ "linux/lirc.h", "LIRC_SET_REC_TIMEOUT_REPORTS", _IOC_WRITE, 0x6919, 0x04 },
+{ "linux/lirc.h", "LIRC_SET_SEND_CARRIER", _IOC_WRITE, 0x6913, 0x04 },
+{ "linux/lirc.h", "LIRC_SET_SEND_DUTY_CYCLE", _IOC_WRITE, 0x6915, 0x04 },
+{ "linux/lirc.h", "LIRC_SET_SEND_MODE", _IOC_WRITE, 0x6911, 0x04 },
+{ "linux/lirc.h", "LIRC_SET_TRANSMITTER_MASK", _IOC_WRITE, 0x6917, 0x04 },
+{ "linux/lirc.h", "LIRC_SET_WIDEBAND_RECEIVER", _IOC_WRITE, 0x6923, 0x04 },
+{ "linux/loop.h", "LOOP_CHANGE_FD", 0, 0x4C06, 0 },
+{ "linux/loop.h", "LOOP_CLR_FD", 0, 0x4C01, 0 },
+{ "linux/loop.h", "LOOP_CONFIGURE", 0, 0x4C0A, 0 },
+{ "linux/loop.h", "LOOP_CTL_ADD", 0, 0x4C80, 0 },
+{ "linux/loop.h", "LOOP_CTL_GET_FREE", 0, 0x4C82, 0 },
+{ "linux/loop.h", "LOOP_CTL_REMOVE", 0, 0x4C81, 0 },
+{ "linux/loop.h", "LOOP_GET_STATUS", 0, 0x4C03, 0 },
+{ "linux/loop.h", "LOOP_GET_STATUS64", 0, 0x4C05, 0 },
+{ "linux/loop.h", "LOOP_SET_BLOCK_SIZE", 0, 0x4C09, 0 },
+{ "linux/loop.h", "LOOP_SET_CAPACITY", 0, 0x4C07, 0 },
+{ "linux/loop.h", "LOOP_SET_DIRECT_IO", 0, 0x4C08, 0 },
+{ "linux/loop.h", "LOOP_SET_FD", 0, 0x4C00, 0 },
+{ "linux/loop.h", "LOOP_SET_STATUS", 0, 0x4C02, 0 },
+{ "linux/loop.h", "LOOP_SET_STATUS64", 0, 0x4C04, 0 },
+{ "linux/lp.h", "LPSETTIMEOUT_NEW", _IOC_WRITE, 0x060f, 0x10 },
+{ "linux/mISDNif.h", "IMADDTIMER", _IOC_READ, 0x4940, 0x04 },
+{ "linux/mISDNif.h", "IMCLEAR_L2", _IOC_READ, 0x4946, 0x04 },
+{ "linux/mISDNif.h", "IMCTRLREQ", _IOC_READ, 0x4945, 0x04 },
+{ "linux/mISDNif.h", "IMDELTIMER", _IOC_READ, 0x4941, 0x04 },
+{ "linux/mISDNif.h", "IMGETCOUNT", _IOC_READ, 0x4943, 0x04 },
+{ "linux/mISDNif.h", "IMGETDEVINFO", _IOC_READ, 0x4944, 0x04 },
+{ "linux/mISDNif.h", "IMGETVERSION", _IOC_READ, 0x4942, 0x04 },
+{ "linux/mISDNif.h", "IMHOLD_L1", _IOC_READ, 0x4948, 0x04 },
+{ "linux/mISDNif.h", "IMSETDEVNAME", _IOC_READ, 0x4947, 0x18 },
+{ "linux/matroxfb.h", "MATROXFB_GET_ALL_OUTPUTS", _IOC_READ, 0x6efb, 0x04 },
+{ "linux/matroxfb.h", "MATROXFB_GET_AVAILABLE_OUTPUTS", _IOC_READ, 0x6ef9, 0x04 },
+{ "linux/matroxfb.h", "MATROXFB_GET_OUTPUT_CONNECTION", _IOC_READ, 0x6ef8, 0x04 },
+{ "linux/matroxfb.h", "MATROXFB_GET_OUTPUT_MODE", _IOC_READ|_IOC_WRITE, 0x6efa, 0x04 },
+{ "linux/matroxfb.h", "MATROXFB_SET_OUTPUT_CONNECTION", _IOC_WRITE, 0x6ef8, 0x04 },
+{ "linux/matroxfb.h", "MATROXFB_SET_OUTPUT_MODE", _IOC_WRITE, 0x6efa, 0x04 },
+{ "linux/media.h", "MEDIA_IOC_DEVICE_INFO", _IOC_READ|_IOC_WRITE, 0x7c00, 0x100 },
+{ "linux/media.h", "MEDIA_IOC_ENUM_ENTITIES", _IOC_READ|_IOC_WRITE, 0x7c01, 0x100 },
+{ "linux/media.h", "MEDIA_IOC_ENUM_LINKS", _IOC_READ|_IOC_WRITE, 0x7c02, 0x1c },
+{ "linux/media.h", "MEDIA_IOC_G_TOPOLOGY", _IOC_READ|_IOC_WRITE, 0x7c04, 0x48 },
+{ "linux/media.h", "MEDIA_IOC_REQUEST_ALLOC", _IOC_READ, 0x7c05, 0x04 },
+{ "linux/media.h", "MEDIA_IOC_SETUP_LINK", _IOC_READ|_IOC_WRITE, 0x7c03, 0x34 },
+{ "linux/media.h", "MEDIA_REQUEST_IOC_QUEUE", _IOC_NONE, 0x7c80, 0x00 },
+{ "linux/media.h", "MEDIA_REQUEST_IOC_REINIT", _IOC_NONE, 0x7c81, 0x00 },
+{ "linux/mei.h", "IOCTL_MEI_CONNECT_CLIENT", _IOC_READ|_IOC_WRITE, 0x4801, 0x10 },
+{ "linux/mei.h", "IOCTL_MEI_CONNECT_CLIENT_VTAG", _IOC_READ|_IOC_WRITE, 0x4804, 0x14 },
+{ "linux/mei.h", "IOCTL_MEI_NOTIFY_GET", _IOC_READ, 0x4803, 0x04 },
+{ "linux/mei.h", "IOCTL_MEI_NOTIFY_SET", _IOC_WRITE, 0x4802, 0x04 },
+{ "linux/meye.h", "MEYEIOC_G_PARAMS", _IOC_READ, 0x76c0, 0x06 },
+{ "linux/meye.h", "MEYEIOC_QBUF_CAPT", _IOC_WRITE, 0x76c2, 0x04 },
+{ "linux/meye.h", "MEYEIOC_STILLCAPT", _IOC_NONE, 0x76c4, 0x00 },
+{ "linux/meye.h", "MEYEIOC_STILLJCAPT", _IOC_READ, 0x76c5, 0x04 },
+{ "linux/meye.h", "MEYEIOC_SYNC", _IOC_READ|_IOC_WRITE, 0x76c3, 0x04 },
+{ "linux/meye.h", "MEYEIOC_S_PARAMS", _IOC_WRITE, 0x76c1, 0x06 },
+{ "linux/mmc/ioctl.h", "MMC_IOC_CMD", _IOC_READ|_IOC_WRITE, 0xb300, 0x48 },
+{ "linux/mmc/ioctl.h", "MMC_IOC_MULTI_CMD", _IOC_READ|_IOC_WRITE, 0xb301, 0x08 },
+{ "linux/mmtimer.h", "MMTIMER_GETBITS", _IOC_NONE, 0x6d04, 0x00 },
+{ "linux/mmtimer.h", "MMTIMER_GETCOUNTER", _IOC_READ, 0x6d09, 0x04 },
+{ "linux/mmtimer.h", "MMTIMER_GETFREQ", _IOC_READ, 0x6d02, 0x04 },
+{ "linux/mmtimer.h", "MMTIMER_GETOFFSET", _IOC_NONE, 0x6d00, 0x00 },
+{ "linux/mmtimer.h", "MMTIMER_GETRES", _IOC_READ, 0x6d01, 0x04 },
+{ "linux/mmtimer.h", "MMTIMER_MMAPAVAIL", _IOC_NONE, 0x6d06, 0x00 },
+{ "linux/msdos_fs.h", "FAT_IOCTL_GET_ATTRIBUTES", _IOC_READ, 0x7210, 0x04 },
+{ "linux/msdos_fs.h", "FAT_IOCTL_GET_VOLUME_ID", _IOC_READ, 0x7213, 0x04 },
+{ "linux/msdos_fs.h", "FAT_IOCTL_SET_ATTRIBUTES", _IOC_WRITE, 0x7211, 0x04 },
+{ "linux/msdos_fs.h", "VFAT_IOCTL_READDIR_BOTH", _IOC_READ, 0x7201, 0x218 },
+{ "linux/msdos_fs.h", "VFAT_IOCTL_READDIR_SHORT", _IOC_READ, 0x7202, 0x218 },
+{ "linux/mtio.h", "MTIOCGET", _IOC_READ, 0x6d02, 0x1c },
+{ "linux/mtio.h", "MTIOCPOS", _IOC_READ, 0x6d03, 0x04 },
+{ "linux/mtio.h", "MTIOCTOP", _IOC_WRITE, 0x6d01, 0x08 },
+{ "linux/nbd.h", "NBD_CLEAR_QUE", _IOC_NONE, 0xab05, 0x00 },
+{ "linux/nbd.h", "NBD_CLEAR_SOCK", _IOC_NONE, 0xab04, 0x00 },
+{ "linux/nbd.h", "NBD_DISCONNECT", _IOC_NONE, 0xab08, 0x00 },
+{ "linux/nbd.h", "NBD_DO_IT", _IOC_NONE, 0xab03, 0x00 },
+{ "linux/nbd.h", "NBD_PRINT_DEBUG", _IOC_NONE, 0xab06, 0x00 },
+{ "linux/nbd.h", "NBD_SET_BLKSIZE", _IOC_NONE, 0xab01, 0x00 },
+{ "linux/nbd.h", "NBD_SET_FLAGS", _IOC_NONE, 0xab0a, 0x00 },
+{ "linux/nbd.h", "NBD_SET_SIZE", _IOC_NONE, 0xab02, 0x00 },
+{ "linux/nbd.h", "NBD_SET_SIZE_BLOCKS", _IOC_NONE, 0xab07, 0x00 },
+{ "linux/nbd.h", "NBD_SET_SOCK", _IOC_NONE, 0xab00, 0x00 },
+{ "linux/nbd.h", "NBD_SET_TIMEOUT", _IOC_NONE, 0xab09, 0x00 },
+{ "linux/ndctl.h", "ND_IOCTL_ARS_CAP", _IOC_READ|_IOC_WRITE, 0x4e01, 0x20 },
+{ "linux/ndctl.h", "ND_IOCTL_ARS_START", _IOC_READ|_IOC_WRITE, 0x4e02, 0x20 },
+{ "linux/ndctl.h", "ND_IOCTL_ARS_STATUS", _IOC_READ|_IOC_WRITE, 0x4e03, 0x30 },
+{ "linux/ndctl.h", "ND_IOCTL_CALL", _IOC_READ|_IOC_WRITE, 0x4e0a, 0x40 },
+{ "linux/ndctl.h", "ND_IOCTL_CLEAR_ERROR", _IOC_READ|_IOC_WRITE, 0x4e04, 0x20 },
+{ "linux/ndctl.h", "ND_IOCTL_DIMM_FLAGS", _IOC_READ|_IOC_WRITE, 0x4e03, 0x08 },
+{ "linux/ndctl.h", "ND_IOCTL_GET_CONFIG_DATA", _IOC_READ|_IOC_WRITE, 0x4e05, 0x0c },
+{ "linux/ndctl.h", "ND_IOCTL_GET_CONFIG_SIZE", _IOC_READ|_IOC_WRITE, 0x4e04, 0x0c },
+{ "linux/ndctl.h", "ND_IOCTL_SET_CONFIG_DATA", _IOC_READ|_IOC_WRITE, 0x4e06, 0x08 },
+{ "linux/ndctl.h", "ND_IOCTL_VENDOR", _IOC_READ|_IOC_WRITE, 0x4e09, 0x08 },
+{ "linux/nilfs2_api.h", "NILFS_IOCTL_CHANGE_CPMODE", _IOC_WRITE, 0x6e80, 0x10 },
+{ "linux/nilfs2_api.h", "NILFS_IOCTL_CLEAN_SEGMENTS", _IOC_WRITE, 0x6e88, 0x78 },
+{ "linux/nilfs2_api.h", "NILFS_IOCTL_DELETE_CHECKPOINT", _IOC_WRITE, 0x6e81, 0x08 },
+{ "linux/nilfs2_api.h", "NILFS_IOCTL_GET_BDESCS", _IOC_READ|_IOC_WRITE, 0x6e87, 0x18 },
+{ "linux/nilfs2_api.h", "NILFS_IOCTL_GET_CPINFO", _IOC_READ, 0x6e82, 0x18 },
+{ "linux/nilfs2_api.h", "NILFS_IOCTL_GET_CPSTAT", _IOC_READ, 0x6e83, 0x18 },
+{ "linux/nilfs2_api.h", "NILFS_IOCTL_GET_SUINFO", _IOC_READ, 0x6e84, 0x18 },
+{ "linux/nilfs2_api.h", "NILFS_IOCTL_GET_SUSTAT", _IOC_READ, 0x6e85, 0x30 },
+{ "linux/nilfs2_api.h", "NILFS_IOCTL_GET_VINFO", _IOC_READ|_IOC_WRITE, 0x6e86, 0x18 },
+{ "linux/nilfs2_api.h", "NILFS_IOCTL_RESIZE", _IOC_WRITE, 0x6e8b, 0x08 },
+{ "linux/nilfs2_api.h", "NILFS_IOCTL_SET_ALLOC_RANGE", _IOC_WRITE, 0x6e8c, 0x10 },
+{ "linux/nilfs2_api.h", "NILFS_IOCTL_SET_SUINFO", _IOC_WRITE, 0x6e8d, 0x18 },
+{ "linux/nilfs2_api.h", "NILFS_IOCTL_SYNC", _IOC_READ, 0x6e8a, 0x08 },
+{ "linux/nitro_enclaves.h", "NE_ADD_VCPU", _IOC_READ|_IOC_WRITE, 0xae21, 0x04 },
+{ "linux/nitro_enclaves.h", "NE_CREATE_VM", _IOC_READ, 0xae20, 0x08 },
+{ "linux/nitro_enclaves.h", "NE_GET_IMAGE_LOAD_INFO", _IOC_READ|_IOC_WRITE, 0xae22, 0x10 },
+{ "linux/nitro_enclaves.h", "NE_SET_USER_MEMORY_REGION", _IOC_WRITE, 0xae23, 0x18 },
+{ "linux/nitro_enclaves.h", "NE_START_ENCLAVE", _IOC_READ|_IOC_WRITE, 0xae24, 0x10 },
+{ "linux/nsfs.h", "NS_GET_NSTYPE", _IOC_NONE, 0xb703, 0x00 },
+{ "linux/nsfs.h", "NS_GET_OWNER_UID", _IOC_NONE, 0xb704, 0x00 },
+{ "linux/nsfs.h", "NS_GET_PARENT", _IOC_NONE, 0xb702, 0x00 },
+{ "linux/nsfs.h", "NS_GET_USERNS", _IOC_NONE, 0xb701, 0x00 },
+{ "linux/nvme_ioctl.h", "NVME_IOCTL_ADMIN64_CMD", _IOC_READ|_IOC_WRITE, 0x4e47, 0x50 },
+{ "linux/nvme_ioctl.h", "NVME_IOCTL_ADMIN_CMD", _IOC_READ|_IOC_WRITE, 0x4e41, 0x48 },
+{ "linux/nvme_ioctl.h", "NVME_IOCTL_ID", _IOC_NONE, 0x4e40, 0x00 },
+{ "linux/nvme_ioctl.h", "NVME_IOCTL_IO64_CMD", _IOC_READ|_IOC_WRITE, 0x4e48, 0x50 },
+{ "linux/nvme_ioctl.h", "NVME_IOCTL_IO_CMD", _IOC_READ|_IOC_WRITE, 0x4e43, 0x48 },
+{ "linux/nvme_ioctl.h", "NVME_IOCTL_RESCAN", _IOC_NONE, 0x4e46, 0x00 },
+{ "linux/nvme_ioctl.h", "NVME_IOCTL_RESET", _IOC_NONE, 0x4e44, 0x00 },
+{ "linux/nvme_ioctl.h", "NVME_IOCTL_SUBMIT_IO", _IOC_WRITE, 0x4e42, 0x30 },
+{ "linux/nvme_ioctl.h", "NVME_IOCTL_SUBSYS_RESET", _IOC_NONE, 0x4e45, 0x00 },
+{ "linux/nvram.h", "NVRAM_INIT", _IOC_NONE, 0x7040, 0x00 },
+{ "linux/nvram.h", "NVRAM_SETCKS", _IOC_NONE, 0x7041, 0x00 },
+{ "linux/omap3isp.h", "VIDIOC_OMAP3ISP_AEWB_CFG", _IOC_READ|_IOC_WRITE, 0x56c3, 0x20 },
+{ "linux/omap3isp.h", "VIDIOC_OMAP3ISP_AF_CFG", _IOC_READ|_IOC_WRITE, 0x56c5, 0x4c },
+{ "linux/omap3isp.h", "VIDIOC_OMAP3ISP_CCDC_CFG", _IOC_READ|_IOC_WRITE, 0x56c1, 0x20 },
+{ "linux/omap3isp.h", "VIDIOC_OMAP3ISP_HIST_CFG", _IOC_READ|_IOC_WRITE, 0x56c4, 0x30 },
+{ "linux/omap3isp.h", "VIDIOC_OMAP3ISP_PRV_CFG", _IOC_READ|_IOC_WRITE, 0x56c2, 0x3c },
+{ "linux/omap3isp.h", "VIDIOC_OMAP3ISP_STAT_EN", _IOC_READ|_IOC_WRITE, 0x56c7, 0x04 },
+{ "linux/omap3isp.h", "VIDIOC_OMAP3ISP_STAT_REQ_TIME32", _IOC_READ|_IOC_WRITE, 0x56c6, 0x18 },
+{ "linux/omapfb.h", "OMAPFB_CTRL_TEST", _IOC_WRITE, 0x4f2e, 0x04 },
+{ "linux/omapfb.h", "OMAPFB_GET_CAPS", _IOC_READ, 0x4f2a, 0x0c },
+{ "linux/omapfb.h", "OMAPFB_GET_COLOR_KEY", _IOC_WRITE, 0x4f33, 0x10 },
+{ "linux/omapfb.h", "OMAPFB_GET_DISPLAY_INFO", _IOC_READ, 0x4f3f, 0x20 },
+{ "linux/omapfb.h", "OMAPFB_GET_OVERLAY_COLORMODE", _IOC_READ, 0x4f3b, 0x3c },
+{ "linux/omapfb.h", "OMAPFB_GET_UPDATE_MODE", _IOC_WRITE, 0x4f2b, 0x04 },
+{ "linux/omapfb.h", "OMAPFB_GET_VRAM_INFO", _IOC_READ, 0x4f3d, 0x20 },
+{ "linux/omapfb.h", "OMAPFB_LCD_TEST", _IOC_WRITE, 0x4f2d, 0x04 },
+{ "linux/omapfb.h", "OMAPFB_MEMORY_READ", _IOC_READ, 0x4f3a, 0x10 },
+{ "linux/omapfb.h", "OMAPFB_MIRROR", _IOC_WRITE, 0x4f1f, 0x04 },
+{ "linux/omapfb.h", "OMAPFB_QUERY_MEM", _IOC_WRITE, 0x4f38, 0x08 },
+{ "linux/omapfb.h", "OMAPFB_QUERY_PLANE", _IOC_WRITE, 0x4f35, 0x44 },
+{ "linux/omapfb.h", "OMAPFB_SETUP_MEM", _IOC_WRITE, 0x4f37, 0x08 },
+{ "linux/omapfb.h", "OMAPFB_SETUP_PLANE", _IOC_WRITE, 0x4f34, 0x44 },
+{ "linux/omapfb.h", "OMAPFB_SET_COLOR_KEY", _IOC_WRITE, 0x4f32, 0x10 },
+{ "linux/omapfb.h", "OMAPFB_SET_TEARSYNC", _IOC_WRITE, 0x4f3e, 0x08 },
+{ "linux/omapfb.h", "OMAPFB_SET_UPDATE_MODE", _IOC_WRITE, 0x4f28, 0x04 },
+{ "linux/omapfb.h", "OMAPFB_SYNC_GFX", _IOC_NONE, 0x4f25, 0x00 },
+{ "linux/omapfb.h", "OMAPFB_UPDATE_WINDOW", _IOC_WRITE, 0x4f36, 0x44 },
+{ "linux/omapfb.h", "OMAPFB_UPDATE_WINDOW_OLD", _IOC_WRITE, 0x4f2f, 0x14 },
+{ "linux/omapfb.h", "OMAPFB_VSYNC", _IOC_NONE, 0x4f26, 0x00 },
+{ "linux/omapfb.h", "OMAPFB_WAITFORGO", _IOC_NONE, 0x4f3c, 0x00 },
+{ "linux/omapfb.h", "OMAPFB_WAITFORVSYNC", _IOC_NONE, 0x4f39, 0x00 },
+{ "linux/pcitest.h", "PCITEST_BAR", _IOC_NONE, 0x5001, 0x00 },
+{ "linux/pcitest.h", "PCITEST_CLEAR_IRQ", _IOC_NONE, 0x5010, 0x00 },
+{ "linux/pcitest.h", "PCITEST_COPY", _IOC_WRITE, 0x5006, 0x04 },
+{ "linux/pcitest.h", "PCITEST_GET_IRQTYPE", _IOC_NONE, 0x5009, 0x00 },
+{ "linux/pcitest.h", "PCITEST_LEGACY_IRQ", _IOC_NONE, 0x5002, 0x00 },
+{ "linux/pcitest.h", "PCITEST_MSI", _IOC_WRITE, 0x5003, 0x04 },
+{ "linux/pcitest.h", "PCITEST_MSIX", _IOC_WRITE, 0x5007, 0x04 },
+{ "linux/pcitest.h", "PCITEST_READ", _IOC_WRITE, 0x5005, 0x04 },
+{ "linux/pcitest.h", "PCITEST_SET_IRQTYPE", _IOC_WRITE, 0x5008, 0x04 },
+{ "linux/pcitest.h", "PCITEST_WRITE", _IOC_WRITE, 0x5004, 0x04 },
+{ "linux/perf_event.h", "PERF_EVENT_IOC_DISABLE", _IOC_NONE, 0x2401, 0x00 },
+{ "linux/perf_event.h", "PERF_EVENT_IOC_ENABLE", _IOC_NONE, 0x2400, 0x00 },
+{ "linux/perf_event.h", "PERF_EVENT_IOC_ID", _IOC_READ, 0x2407, 0x04 },
+{ "linux/perf_event.h", "PERF_EVENT_IOC_MODIFY_ATTRIBUTES", _IOC_WRITE, 0x240b, 0x04 },
+{ "linux/perf_event.h", "PERF_EVENT_IOC_PAUSE_OUTPUT", _IOC_WRITE, 0x2409, 0x04 },
+{ "linux/perf_event.h", "PERF_EVENT_IOC_PERIOD", _IOC_WRITE, 0x2404, 0x08 },
+{ "linux/perf_event.h", "PERF_EVENT_IOC_QUERY_BPF", _IOC_READ|_IOC_WRITE, 0x240a, 0x04 },
+{ "linux/perf_event.h", "PERF_EVENT_IOC_REFRESH", _IOC_NONE, 0x2402, 0x00 },
+{ "linux/perf_event.h", "PERF_EVENT_IOC_RESET", _IOC_NONE, 0x2403, 0x00 },
+{ "linux/perf_event.h", "PERF_EVENT_IOC_SET_BPF", _IOC_WRITE, 0x2408, 0x04 },
+{ "linux/perf_event.h", "PERF_EVENT_IOC_SET_FILTER", _IOC_WRITE, 0x2406, 0x04 },
+{ "linux/perf_event.h", "PERF_EVENT_IOC_SET_OUTPUT", _IOC_NONE, 0x2405, 0x00 },
+{ "linux/phantom.h", "PHN_GETREG", _IOC_READ|_IOC_WRITE, 0x7005, 0x08 },
+{ "linux/phantom.h", "PHN_GETREGS", _IOC_READ|_IOC_WRITE, 0x7007, 0x28 },
+{ "linux/phantom.h", "PHN_GET_REG", _IOC_READ|_IOC_WRITE, 0x7000, 0x04 },
+{ "linux/phantom.h", "PHN_GET_REGS", _IOC_READ|_IOC_WRITE, 0x7002, 0x04 },
+{ "linux/phantom.h", "PHN_NOT_OH", _IOC_NONE, 0x7004, 0x00 },
+{ "linux/phantom.h", "PHN_SETREG", _IOC_WRITE, 0x7006, 0x08 },
+{ "linux/phantom.h", "PHN_SETREGS", _IOC_WRITE, 0x7008, 0x28 },
+{ "linux/phantom.h", "PHN_SET_REG", _IOC_WRITE, 0x7001, 0x04 },
+{ "linux/phantom.h", "PHN_SET_REGS", _IOC_WRITE, 0x7003, 0x04 },
+{ "linux/pktcdvd.h", "PACKET_CTRL_CMD", _IOC_READ|_IOC_WRITE, 0x5801, 0x18 },
+{ "linux/platform_data/cros_ec_chardev.h", "CROS_EC_DEV_IOCEVENTMASK", _IOC_NONE, 0xec02, 0x00 },
+{ "linux/platform_data/cros_ec_chardev.h", "CROS_EC_DEV_IOCRDMEM", _IOC_READ|_IOC_WRITE, 0xec01, 0x108 },
+{ "linux/platform_data/cros_ec_chardev.h", "CROS_EC_DEV_IOCXCMD", _IOC_READ|_IOC_WRITE, 0xec00, 0x14 },
+{ "linux/platform_data/media/si4713.h", "SI4713_IOC_MEASURE_RNL", _IOC_READ|_IOC_WRITE, 0x56c0, 0x1c },
+{ "linux/pmu.h", "PMU_IOC_CAN_SLEEP", _IOC_READ, 0x4205, 0x04 },
+{ "linux/pmu.h", "PMU_IOC_GET_BACKLIGHT", _IOC_READ, 0x4201, 0x04 },
+{ "linux/pmu.h", "PMU_IOC_GET_MODEL", _IOC_READ, 0x4203, 0x04 },
+{ "linux/pmu.h", "PMU_IOC_GRAB_BACKLIGHT", _IOC_READ, 0x4206, 0x04 },
+{ "linux/pmu.h", "PMU_IOC_HAS_ADB", _IOC_READ, 0x4204, 0x04 },
+{ "linux/pmu.h", "PMU_IOC_SET_BACKLIGHT", _IOC_WRITE, 0x4202, 0x04 },
+{ "linux/pmu.h", "PMU_IOC_SLEEP", _IOC_NONE, 0x4200, 0x00 },
+{ "linux/ppdev.h", "PPCLAIM", _IOC_NONE, 0x708b, 0x00 },
+{ "linux/ppdev.h", "PPCLRIRQ", _IOC_READ, 0x7093, 0x04 },
+{ "linux/ppdev.h", "PPDATADIR", _IOC_WRITE, 0x7090, 0x04 },
+{ "linux/ppdev.h", "PPEXCL", _IOC_NONE, 0x708f, 0x00 },
+{ "linux/ppdev.h", "PPFCONTROL", _IOC_WRITE, 0x708e, 0x02 },
+{ "linux/ppdev.h", "PPGETFLAGS", _IOC_READ, 0x709a, 0x04 },
+{ "linux/ppdev.h", "PPGETMODE", _IOC_READ, 0x7098, 0x04 },
+{ "linux/ppdev.h", "PPGETMODES", _IOC_READ, 0x7097, 0x04 },
+{ "linux/ppdev.h", "PPGETPHASE", _IOC_READ, 0x7099, 0x04 },
+{ "linux/ppdev.h", "PPGETTIME", _IOC_READ, 0x7095, 0x08 },
+{ "linux/ppdev.h", "PPNEGOT", _IOC_WRITE, 0x7091, 0x04 },
+{ "linux/ppdev.h", "PPRCONTROL", _IOC_READ, 0x7083, 0x01 },
+{ "linux/ppdev.h", "PPRDATA", _IOC_READ, 0x7085, 0x01 },
+{ "linux/ppdev.h", "PPRELEASE", _IOC_NONE, 0x708c, 0x00 },
+{ "linux/ppdev.h", "PPRSTATUS", _IOC_READ, 0x7081, 0x01 },
+{ "linux/ppdev.h", "PPSETFLAGS", _IOC_WRITE, 0x709b, 0x04 },
+{ "linux/ppdev.h", "PPSETMODE", _IOC_WRITE, 0x7080, 0x04 },
+{ "linux/ppdev.h", "PPSETPHASE", _IOC_WRITE, 0x7094, 0x04 },
+{ "linux/ppdev.h", "PPSETTIME", _IOC_WRITE, 0x7096, 0x08 },
+{ "linux/ppdev.h", "PPWCONTROL", _IOC_WRITE, 0x7084, 0x01 },
+{ "linux/ppdev.h", "PPWCTLONIRQ", _IOC_WRITE, 0x7092, 0x01 },
+{ "linux/ppdev.h", "PPWDATA", _IOC_WRITE, 0x7086, 0x01 },
+{ "linux/ppdev.h", "PPYIELD", _IOC_NONE, 0x708d, 0x00 },
+{ "linux/ppp-ioctl.h", "PPPIOCATTACH", _IOC_WRITE, 0x743d, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCATTCHAN", _IOC_WRITE, 0x7438, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCCONNECT", _IOC_WRITE, 0x743a, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCDETACH", _IOC_WRITE, 0x743c, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCDISCONN", _IOC_NONE, 0x7439, 0x00 },
+{ "linux/ppp-ioctl.h", "PPPIOCGASYNCMAP", _IOC_READ, 0x7458, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCGCHAN", _IOC_READ, 0x7437, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCGDEBUG", _IOC_READ, 0x7441, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCGFLAGS", _IOC_READ, 0x745a, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCGIDLE32", _IOC_READ, 0x743f, 0x08 },
+{ "linux/ppp-ioctl.h", "PPPIOCGIDLE64", _IOC_READ, 0x743f, 0x10 },
+{ "linux/ppp-ioctl.h", "PPPIOCGL2TPSTATS", _IOC_READ, 0x7436, 0x48 },
+{ "linux/ppp-ioctl.h", "PPPIOCGMRU", _IOC_READ, 0x7453, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCGNPMODE", _IOC_READ|_IOC_WRITE, 0x744c, 0x08 },
+{ "linux/ppp-ioctl.h", "PPPIOCGRASYNCMAP", _IOC_READ, 0x7455, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCGUNIT", _IOC_READ, 0x7456, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCGXASYNCMAP", _IOC_READ, 0x7450, 0x20 },
+{ "linux/ppp-ioctl.h", "PPPIOCNEWUNIT", _IOC_READ|_IOC_WRITE, 0x743e, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCSACTIVE", _IOC_WRITE, 0x7446, 0x08 },
+{ "linux/ppp-ioctl.h", "PPPIOCSASYNCMAP", _IOC_WRITE, 0x7457, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCSCOMPRESS", _IOC_WRITE, 0x744d, 0x0c },
+{ "linux/ppp-ioctl.h", "PPPIOCSDEBUG", _IOC_WRITE, 0x7440, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCSFLAGS", _IOC_WRITE, 0x7459, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCSMAXCID", _IOC_WRITE, 0x7451, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCSMRRU", _IOC_WRITE, 0x743b, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCSMRU", _IOC_WRITE, 0x7452, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCSNPMODE", _IOC_WRITE, 0x744b, 0x08 },
+{ "linux/ppp-ioctl.h", "PPPIOCSPASS", _IOC_WRITE, 0x7447, 0x08 },
+{ "linux/ppp-ioctl.h", "PPPIOCSRASYNCMAP", _IOC_WRITE, 0x7454, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCSXASYNCMAP", _IOC_WRITE, 0x744f, 0x20 },
+{ "linux/ppp-ioctl.h", "PPPIOCXFERUNIT", _IOC_NONE, 0x744e, 0x00 },
+{ "linux/pps.h", "PPS_FETCH", _IOC_READ|_IOC_WRITE, 0x70a4, 0x04 },
+{ "linux/pps.h", "PPS_GETCAP", _IOC_READ, 0x70a3, 0x04 },
+{ "linux/pps.h", "PPS_GETPARAMS", _IOC_READ, 0x70a1, 0x04 },
+{ "linux/pps.h", "PPS_KC_BIND", _IOC_WRITE, 0x70a5, 0x04 },
+{ "linux/pps.h", "PPS_SETPARAMS", _IOC_WRITE, 0x70a2, 0x04 },
+{ "linux/pr.h", "IOC_PR_CLEAR", _IOC_WRITE, 0x70cd, 0x10 },
+{ "linux/pr.h", "IOC_PR_PREEMPT", _IOC_WRITE, 0x70cb, 0x18 },
+{ "linux/pr.h", "IOC_PR_PREEMPT_ABORT", _IOC_WRITE, 0x70cc, 0x18 },
+{ "linux/pr.h", "IOC_PR_REGISTER", _IOC_WRITE, 0x70c8, 0x18 },
+{ "linux/pr.h", "IOC_PR_RELEASE", _IOC_WRITE, 0x70ca, 0x10 },
+{ "linux/pr.h", "IOC_PR_RESERVE", _IOC_WRITE, 0x70c9, 0x10 },
+{ "linux/psp-sev.h", "SEV_ISSUE_CMD", _IOC_READ|_IOC_WRITE, 0x5300, 0x10 },
+{ "linux/ptp_clock.h", "PTP_CLOCK_GETCAPS", _IOC_READ, 0x3d01, 0x50 },
+{ "linux/ptp_clock.h", "PTP_CLOCK_GETCAPS2", _IOC_READ, 0x3d0a, 0x50 },
+{ "linux/ptp_clock.h", "PTP_ENABLE_PPS", _IOC_WRITE, 0x3d04, 0x04 },
+{ "linux/ptp_clock.h", "PTP_ENABLE_PPS2", _IOC_WRITE, 0x3d0d, 0x04 },
+{ "linux/ptp_clock.h", "PTP_EXTTS_REQUEST", _IOC_WRITE, 0x3d02, 0x10 },
+{ "linux/ptp_clock.h", "PTP_EXTTS_REQUEST2", _IOC_WRITE, 0x3d0b, 0x10 },
+{ "linux/ptp_clock.h", "PTP_PEROUT_REQUEST", _IOC_WRITE, 0x3d03, 0x38 },
+{ "linux/ptp_clock.h", "PTP_PEROUT_REQUEST2", _IOC_WRITE, 0x3d0c, 0x38 },
+{ "linux/ptp_clock.h", "PTP_PIN_GETFUNC", _IOC_READ|_IOC_WRITE, 0x3d06, 0x60 },
+{ "linux/ptp_clock.h", "PTP_PIN_GETFUNC2", _IOC_READ|_IOC_WRITE, 0x3d0f, 0x60 },
+{ "linux/ptp_clock.h", "PTP_PIN_SETFUNC", _IOC_WRITE, 0x3d07, 0x60 },
+{ "linux/ptp_clock.h", "PTP_PIN_SETFUNC2", _IOC_WRITE, 0x3d10, 0x60 },
+{ "linux/ptp_clock.h", "PTP_SYS_OFFSET", _IOC_WRITE, 0x3d05, 0x340 },
+{ "linux/ptp_clock.h", "PTP_SYS_OFFSET2", _IOC_WRITE, 0x3d0e, 0x340 },
+{ "linux/ptp_clock.h", "PTP_SYS_OFFSET_EXTENDED", _IOC_READ|_IOC_WRITE, 0x3d09, 0x4c0 },
+{ "linux/ptp_clock.h", "PTP_SYS_OFFSET_EXTENDED2", _IOC_READ|_IOC_WRITE, 0x3d12, 0x4c0 },
+{ "linux/ptp_clock.h", "PTP_SYS_OFFSET_PRECISE", _IOC_READ|_IOC_WRITE, 0x3d08, 0x40 },
+{ "linux/ptp_clock.h", "PTP_SYS_OFFSET_PRECISE2", _IOC_READ|_IOC_WRITE, 0x3d11, 0x40 },
+{ "linux/radeonfb.h", "FBIO_RADEON_GET_MIRROR", _IOC_READ, 0x4003, 0x04 },
+{ "linux/radeonfb.h", "FBIO_RADEON_SET_MIRROR", _IOC_WRITE, 0x4004, 0x04 },
+{ "linux/raid/md_u.h", "ADD_NEW_DISK", _IOC_WRITE, 0x0921, 0x14 },
+{ "linux/raid/md_u.h", "CLEAR_ARRAY", _IOC_NONE, 0x0920, 0x00 },
+{ "linux/raid/md_u.h", "CLUSTERED_DISK_NACK", _IOC_NONE, 0x0935, 0x00 },
+{ "linux/raid/md_u.h", "GET_ARRAY_INFO", _IOC_READ, 0x0911, 0x48 },
+{ "linux/raid/md_u.h", "GET_BITMAP_FILE", _IOC_READ, 0x0915, 0x1000 },
+{ "linux/raid/md_u.h", "GET_DISK_INFO", _IOC_READ, 0x0912, 0x14 },
+{ "linux/raid/md_u.h", "HOT_ADD_DISK", _IOC_NONE, 0x0928, 0x00 },
+{ "linux/raid/md_u.h", "HOT_GENERATE_ERROR", _IOC_NONE, 0x092a, 0x00 },
+{ "linux/raid/md_u.h", "HOT_REMOVE_DISK", _IOC_NONE, 0x0922, 0x00 },
+{ "linux/raid/md_u.h", "PROTECT_ARRAY", _IOC_NONE, 0x0927, 0x00 },
+{ "linux/raid/md_u.h", "RAID_AUTORUN", _IOC_NONE, 0x0914, 0x00 },
+{ "linux/raid/md_u.h", "RAID_VERSION", _IOC_READ, 0x0910, 0x0c },
+{ "linux/raid/md_u.h", "RESTART_ARRAY_RW", _IOC_NONE, 0x0934, 0x00 },
+{ "linux/raid/md_u.h", "RUN_ARRAY", _IOC_WRITE, 0x0930, 0x0c },
+{ "linux/raid/md_u.h", "SET_ARRAY_INFO", _IOC_WRITE, 0x0923, 0x48 },
+{ "linux/raid/md_u.h", "SET_BITMAP_FILE", _IOC_WRITE, 0x092b, 0x04 },
+{ "linux/raid/md_u.h", "SET_DISK_FAULTY", _IOC_NONE, 0x0929, 0x00 },
+{ "linux/raid/md_u.h", "SET_DISK_INFO", _IOC_NONE, 0x0924, 0x00 },
+{ "linux/raid/md_u.h", "STOP_ARRAY", _IOC_NONE, 0x0932, 0x00 },
+{ "linux/raid/md_u.h", "STOP_ARRAY_RO", _IOC_NONE, 0x0933, 0x00 },
+{ "linux/raid/md_u.h", "UNPROTECT_ARRAY", _IOC_NONE, 0x0926, 0x00 },
+{ "linux/raid/md_u.h", "WRITE_RAID_INFO", _IOC_NONE, 0x0925, 0x00 },
+{ "linux/random.h", "RNDADDENTROPY", _IOC_WRITE, 0x5203, 0x08 },
+{ "linux/random.h", "RNDADDTOENTCNT", _IOC_WRITE, 0x5201, 0x04 },
+{ "linux/random.h", "RNDCLEARPOOL", _IOC_NONE, 0x5206, 0x00 },
+{ "linux/random.h", "RNDGETENTCNT", _IOC_READ, 0x5200, 0x04 },
+{ "linux/random.h", "RNDGETPOOL", _IOC_READ, 0x5202, 0x08 },
+{ "linux/random.h", "RNDRESEEDCRNG", _IOC_NONE, 0x5207, 0x00 },
+{ "linux/random.h", "RNDZAPENTCNT", _IOC_NONE, 0x5204, 0x00 },
+{ "linux/raw.h", "RAW_GETBIND", _IOC_NONE, 0xac01, 0x00 },
+{ "linux/raw.h", "RAW_SETBIND", _IOC_NONE, 0xac00, 0x00 },
+{ "linux/reiserfs_fs.h", "REISERFS_IOC_UNPACK", _IOC_WRITE, 0xcd01, 0x04 },
+{ "linux/remoteproc_cdev.h", "RPROC_GET_SHUTDOWN_ON_RELEASE", _IOC_READ, 0xb702, 0x04 },
+{ "linux/remoteproc_cdev.h", "RPROC_SET_SHUTDOWN_ON_RELEASE", _IOC_WRITE, 0xb701, 0x04 },
+{ "linux/rfkill.h", "RFKILL_IOCTL_NOINPUT", _IOC_NONE, 0x5201, 0x00 },
+{ "linux/rio_cm_cdev.h", "RIO_CM_CHAN_ACCEPT", _IOC_READ|_IOC_WRITE, 0x6307, 0x08 },
+{ "linux/rio_cm_cdev.h", "RIO_CM_CHAN_BIND", _IOC_WRITE, 0x6305, 0x08 },
+{ "linux/rio_cm_cdev.h", "RIO_CM_CHAN_CLOSE", _IOC_WRITE, 0x6304, 0x02 },
+{ "linux/rio_cm_cdev.h", "RIO_CM_CHAN_CONNECT", _IOC_WRITE, 0x6308, 0x08 },
+{ "linux/rio_cm_cdev.h", "RIO_CM_CHAN_CREATE", _IOC_READ|_IOC_WRITE, 0x6303, 0x02 },
+{ "linux/rio_cm_cdev.h", "RIO_CM_CHAN_LISTEN", _IOC_WRITE, 0x6306, 0x02 },
+{ "linux/rio_cm_cdev.h", "RIO_CM_CHAN_RECEIVE", _IOC_READ|_IOC_WRITE, 0x630a, 0x10 },
+{ "linux/rio_cm_cdev.h", "RIO_CM_CHAN_SEND", _IOC_WRITE, 0x6309, 0x10 },
+{ "linux/rio_cm_cdev.h", "RIO_CM_EP_GET_LIST", _IOC_READ|_IOC_WRITE, 0x6302, 0x04 },
+{ "linux/rio_cm_cdev.h", "RIO_CM_EP_GET_LIST_SIZE", _IOC_READ|_IOC_WRITE, 0x6301, 0x04 },
+{ "linux/rio_cm_cdev.h", "RIO_CM_MPORT_GET_LIST", _IOC_READ|_IOC_WRITE, 0x630b, 0x04 },
+{ "linux/rio_mport_cdev.h", "RIO_ALLOC_DMA", _IOC_READ|_IOC_WRITE, 0x6d13, 0x18 },
+{ "linux/rio_mport_cdev.h", "RIO_DEV_ADD", _IOC_WRITE, 0x6d17, 0x20 },
+{ "linux/rio_mport_cdev.h", "RIO_DEV_DEL", _IOC_WRITE, 0x6d18, 0x20 },
+{ "linux/rio_mport_cdev.h", "RIO_DISABLE_DOORBELL_RANGE", _IOC_WRITE, 0x6d0a, 0x08 },
+{ "linux/rio_mport_cdev.h", "RIO_DISABLE_PORTWRITE_RANGE", _IOC_WRITE, 0x6d0c, 0x10 },
+{ "linux/rio_mport_cdev.h", "RIO_ENABLE_DOORBELL_RANGE", _IOC_WRITE, 0x6d09, 0x08 },
+{ "linux/rio_mport_cdev.h", "RIO_ENABLE_PORTWRITE_RANGE", _IOC_WRITE, 0x6d0b, 0x10 },
+{ "linux/rio_mport_cdev.h", "RIO_FREE_DMA", _IOC_WRITE, 0x6d14, 0x08 },
+{ "linux/rio_mport_cdev.h", "RIO_GET_EVENT_MASK", _IOC_READ, 0x6d0e, 0x04 },
+{ "linux/rio_mport_cdev.h", "RIO_MAP_INBOUND", _IOC_READ|_IOC_WRITE, 0x6d11, 0x28 },
+{ "linux/rio_mport_cdev.h", "RIO_MAP_OUTBOUND", _IOC_READ|_IOC_WRITE, 0x6d0f, 0x28 },
+{ "linux/rio_mport_cdev.h", "RIO_MPORT_GET_PROPERTIES", _IOC_READ, 0x6d04, 0x30 },
+{ "linux/rio_mport_cdev.h", "RIO_MPORT_MAINT_COMPTAG_SET", _IOC_WRITE, 0x6d02, 0x04 },
+{ "linux/rio_mport_cdev.h", "RIO_MPORT_MAINT_HDID_SET", _IOC_WRITE, 0x6d01, 0x02 },
+{ "linux/rio_mport_cdev.h", "RIO_MPORT_MAINT_PORT_IDX_GET", _IOC_READ, 0x6d03, 0x04 },
+{ "linux/rio_mport_cdev.h", "RIO_MPORT_MAINT_READ_LOCAL", _IOC_READ, 0x6d05, 0x18 },
+{ "linux/rio_mport_cdev.h", "RIO_MPORT_MAINT_READ_REMOTE", _IOC_READ, 0x6d07, 0x18 },
+{ "linux/rio_mport_cdev.h", "RIO_MPORT_MAINT_WRITE_LOCAL", _IOC_WRITE, 0x6d06, 0x18 },
+{ "linux/rio_mport_cdev.h", "RIO_MPORT_MAINT_WRITE_REMOTE", _IOC_WRITE, 0x6d08, 0x18 },
+{ "linux/rio_mport_cdev.h", "RIO_SET_EVENT_MASK", _IOC_WRITE, 0x6d0d, 0x04 },
+{ "linux/rio_mport_cdev.h", "RIO_TRANSFER", _IOC_READ|_IOC_WRITE, 0x6d15, 0x18 },
+{ "linux/rio_mport_cdev.h", "RIO_UNMAP_INBOUND", _IOC_WRITE, 0x6d12, 0x08 },
+{ "linux/rio_mport_cdev.h", "RIO_UNMAP_OUTBOUND", _IOC_WRITE, 0x6d10, 0x28 },
+{ "linux/rio_mport_cdev.h", "RIO_WAIT_FOR_ASYNC", _IOC_WRITE, 0x6d16, 0x08 },
+{ "linux/rpmsg.h", "RPMSG_CREATE_EPT_IOCTL", _IOC_WRITE, 0xb501, 0x28 },
+{ "linux/rpmsg.h", "RPMSG_DESTROY_EPT_IOCTL", _IOC_NONE, 0xb502, 0x00 },
+{ "linux/rtc.h", "RTC_AIE_OFF", _IOC_NONE, 0x7002, 0x00 },
+{ "linux/rtc.h", "RTC_AIE_ON", _IOC_NONE, 0x7001, 0x00 },
+{ "linux/rtc.h", "RTC_ALM_READ", _IOC_READ, 0x7008, 0x24 },
+{ "linux/rtc.h", "RTC_ALM_SET", _IOC_WRITE, 0x7007, 0x24 },
+{ "linux/rtc.h", "RTC_EPOCH_READ", _IOC_READ, 0x700d, 0x04 },
+{ "linux/rtc.h", "RTC_EPOCH_SET", _IOC_WRITE, 0x700e, 0x04 },
+{ "linux/rtc.h", "RTC_IRQP_READ", _IOC_READ, 0x700b, 0x04 },
+{ "linux/rtc.h", "RTC_IRQP_SET", _IOC_WRITE, 0x700c, 0x04 },
+{ "linux/rtc.h", "RTC_PIE_OFF", _IOC_NONE, 0x7006, 0x00 },
+{ "linux/rtc.h", "RTC_PIE_ON", _IOC_NONE, 0x7005, 0x00 },
+{ "linux/rtc.h", "RTC_PLL_GET", _IOC_READ, 0x7011, 0x1c },
+{ "linux/rtc.h", "RTC_PLL_SET", _IOC_WRITE, 0x7012, 0x1c },
+{ "linux/rtc.h", "RTC_RD_TIME", _IOC_READ, 0x7009, 0x24 },
+{ "linux/rtc.h", "RTC_SET_TIME", _IOC_WRITE, 0x700a, 0x24 },
+{ "linux/rtc.h", "RTC_UIE_OFF", _IOC_NONE, 0x7004, 0x00 },
+{ "linux/rtc.h", "RTC_UIE_ON", _IOC_NONE, 0x7003, 0x00 },
+{ "linux/rtc.h", "RTC_VL_CLR", _IOC_NONE, 0x7014, 0x00 },
+{ "linux/rtc.h", "RTC_VL_READ", _IOC_READ, 0x7013, 0x04 },
+{ "linux/rtc.h", "RTC_WIE_OFF", _IOC_NONE, 0x7010, 0x00 },
+{ "linux/rtc.h", "RTC_WIE_ON", _IOC_NONE, 0x700f, 0x00 },
+{ "linux/rtc.h", "RTC_WKALM_RD", _IOC_READ, 0x7010, 0x28 },
+{ "linux/rtc.h", "RTC_WKALM_SET", _IOC_WRITE, 0x700f, 0x28 },
+{ "linux/scif_ioctl.h", "SCIF_ACCEPTREG", _IOC_READ|_IOC_WRITE, 0x7305, 0x08 },
+{ "linux/scif_ioctl.h", "SCIF_ACCEPTREQ", _IOC_READ|_IOC_WRITE, 0x7304, 0x10 },
+{ "linux/scif_ioctl.h", "SCIF_BIND", _IOC_READ|_IOC_WRITE, 0x7301, 0x08 },
+{ "linux/scif_ioctl.h", "SCIF_CONNECT", _IOC_READ|_IOC_WRITE, 0x7303, 0x08 },
+{ "linux/scif_ioctl.h", "SCIF_FENCE_MARK", _IOC_READ|_IOC_WRITE, 0x730f, 0x10 },
+{ "linux/scif_ioctl.h", "SCIF_FENCE_SIGNAL", _IOC_READ|_IOC_WRITE, 0x7311, 0x28 },
+{ "linux/scif_ioctl.h", "SCIF_FENCE_WAIT", _IOC_READ|_IOC_WRITE, 0x7310, 0x04 },
+{ "linux/scif_ioctl.h", "SCIF_GET_NODEIDS", _IOC_READ|_IOC_WRITE, 0x730e, 0x18 },
+{ "linux/scif_ioctl.h", "SCIF_LISTEN", _IOC_WRITE, 0x7302, 0x04 },
+{ "linux/scif_ioctl.h", "SCIF_READFROM", _IOC_READ|_IOC_WRITE, 0x730a, 0x28 },
+{ "linux/scif_ioctl.h", "SCIF_RECV", _IOC_READ|_IOC_WRITE, 0x7307, 0x18 },
+{ "linux/scif_ioctl.h", "SCIF_REG", _IOC_READ|_IOC_WRITE, 0x7308, 0x28 },
+{ "linux/scif_ioctl.h", "SCIF_SEND", _IOC_READ|_IOC_WRITE, 0x7306, 0x18 },
+{ "linux/scif_ioctl.h", "SCIF_UNREG", _IOC_READ|_IOC_WRITE, 0x7309, 0x10 },
+{ "linux/scif_ioctl.h", "SCIF_VREADFROM", _IOC_READ|_IOC_WRITE, 0x730c, 0x28 },
+{ "linux/scif_ioctl.h", "SCIF_VWRITETO", _IOC_READ|_IOC_WRITE, 0x730d, 0x28 },
+{ "linux/scif_ioctl.h", "SCIF_WRITETO", _IOC_READ|_IOC_WRITE, 0x730b, 0x28 },
+{ "linux/seccomp.h", "SECCOMP_IOCTL_NOTIF_ADDFD", _IOC_WRITE, 0x2103, 0x18 },
+{ "linux/seccomp.h", "SECCOMP_IOCTL_NOTIF_ID_VALID", _IOC_WRITE, 0x2102, 0x08 },
+{ "linux/seccomp.h", "SECCOMP_IOCTL_NOTIF_RECV", _IOC_READ|_IOC_WRITE, 0x2100, 0x50 },
+{ "linux/seccomp.h", "SECCOMP_IOCTL_NOTIF_SEND", _IOC_READ|_IOC_WRITE, 0x2101, 0x18 },
+{ "linux/sed-opal.h", "IOC_OPAL_ACTIVATE_LSP", _IOC_WRITE, 0x70df, 0x118 },
+{ "linux/sed-opal.h", "IOC_OPAL_ACTIVATE_USR", _IOC_WRITE, 0x70e1, 0x110 },
+{ "linux/sed-opal.h", "IOC_OPAL_ADD_USR_TO_LR", _IOC_WRITE, 0x70e4, 0x118 },
+{ "linux/sed-opal.h", "IOC_OPAL_ENABLE_DISABLE_MBR", _IOC_WRITE, 0x70e5, 0x110 },
+{ "linux/sed-opal.h", "IOC_OPAL_ERASE_LR", _IOC_WRITE, 0x70e6, 0x110 },
+{ "linux/sed-opal.h", "IOC_OPAL_GENERIC_TABLE_RW", _IOC_WRITE, 0x70eb, 0x138 },
+{ "linux/sed-opal.h", "IOC_OPAL_LOCK_UNLOCK", _IOC_WRITE, 0x70dd, 0x118 },
+{ "linux/sed-opal.h", "IOC_OPAL_LR_SETUP", _IOC_WRITE, 0x70e3, 0x128 },
+{ "linux/sed-opal.h", "IOC_OPAL_MBR_DONE", _IOC_WRITE, 0x70e9, 0x110 },
+{ "linux/sed-opal.h", "IOC_OPAL_PSID_REVERT_TPR", _IOC_WRITE, 0x70e8, 0x108 },
+{ "linux/sed-opal.h", "IOC_OPAL_REVERT_TPR", _IOC_WRITE, 0x70e2, 0x108 },
+{ "linux/sed-opal.h", "IOC_OPAL_SAVE", _IOC_WRITE, 0x70dc, 0x118 },
+{ "linux/sed-opal.h", "IOC_OPAL_SECURE_ERASE_LR", _IOC_WRITE, 0x70e7, 0x110 },
+{ "linux/sed-opal.h", "IOC_OPAL_SET_PW", _IOC_WRITE, 0x70e0, 0x220 },
+{ "linux/sed-opal.h", "IOC_OPAL_TAKE_OWNERSHIP", _IOC_WRITE, 0x70de, 0x108 },
+{ "linux/sed-opal.h", "IOC_OPAL_WRITE_SHADOW_MBR", _IOC_WRITE, 0x70ea, 0x120 },
+{ "linux/serio.h", "SPIOCSTYPE", _IOC_WRITE, 0x7101, 0x04 },
+{ "linux/sockios.h", "SIOCADDDLCI", 0, 0x8980, 0 },
+{ "linux/sockios.h", "SIOCADDMULTI", 0, 0x8931, 0 },
+{ "linux/sockios.h", "SIOCADDRT", 0, 0x890B, 0 },
+{ "linux/sockios.h", "SIOCBONDCHANGEACTIVE", 0, 0x8995, 0 },
+{ "linux/sockios.h", "SIOCBONDENSLAVE", 0, 0x8990, 0 },
+{ "linux/sockios.h", "SIOCBONDINFOQUERY", 0, 0x8994, 0 },
+{ "linux/sockios.h", "SIOCBONDRELEASE", 0, 0x8991, 0 },
+{ "linux/sockios.h", "SIOCBONDSETHWADDR", 0, 0x8992, 0 },
+{ "linux/sockios.h", "SIOCBONDSLAVEINFOQUERY", 0, 0x8993, 0 },
+{ "linux/sockios.h", "SIOCBRADDBR", 0, 0x89a0, 0 },
+{ "linux/sockios.h", "SIOCBRADDIF", 0, 0x89a2, 0 },
+{ "linux/sockios.h", "SIOCBRDELBR", 0, 0x89a1, 0 },
+{ "linux/sockios.h", "SIOCBRDELIF", 0, 0x89a3, 0 },
+{ "linux/sockios.h", "SIOCDARP", 0, 0x8953, 0 },
+{ "linux/sockios.h", "SIOCDELDLCI", 0, 0x8981, 0 },
+{ "linux/sockios.h", "SIOCDELMULTI", 0, 0x8932, 0 },
+{ "linux/sockios.h", "SIOCDELRT", 0, 0x890C, 0 },
+{ "linux/sockios.h", "SIOCDEVPRIVATE", 0, 0x89F0, 0 },
+{ "linux/sockios.h", "SIOCDIFADDR", 0, 0x8936, 0 },
+{ "linux/sockios.h", "SIOCDRARP", 0, 0x8960, 0 },
+{ "linux/sockios.h", "SIOCETHTOOL", 0, 0x8946, 0 },
+{ "linux/sockios.h", "SIOCGARP", 0, 0x8954, 0 },
+{ "linux/sockios.h", "SIOCGHWTSTAMP", 0, 0x89b1, 0 },
+{ "linux/sockios.h", "SIOCGIFADDR", 0, 0x8915, 0 },
+{ "linux/sockios.h", "SIOCGIFBR", 0, 0x8940, 0 },
+{ "linux/sockios.h", "SIOCGIFBRDADDR", 0, 0x8919, 0 },
+{ "linux/sockios.h", "SIOCGIFCONF", 0, 0x8912, 0 },
+{ "linux/sockios.h", "SIOCGIFCOUNT", 0, 0x8938, 0 },
+{ "linux/sockios.h", "SIOCGIFDSTADDR", 0, 0x8917, 0 },
+{ "linux/sockios.h", "SIOCGIFENCAP", 0, 0x8925, 0 },
+{ "linux/sockios.h", "SIOCGIFFLAGS", 0, 0x8913, 0 },
+{ "linux/sockios.h", "SIOCGIFHWADDR", 0, 0x8927, 0 },
+{ "linux/sockios.h", "SIOCGIFINDEX", 0, 0x8933, 0 },
+{ "linux/sockios.h", "SIOCGIFMAP", 0, 0x8970, 0 },
+{ "linux/sockios.h", "SIOCGIFMEM", 0, 0x891f, 0 },
+{ "linux/sockios.h", "SIOCGIFMETRIC", 0, 0x891d, 0 },
+{ "linux/sockios.h", "SIOCGIFMTU", 0, 0x8921, 0 },
+{ "linux/sockios.h", "SIOCGIFNAME", 0, 0x8910, 0 },
+{ "linux/sockios.h", "SIOCGIFNETMASK", 0, 0x891b, 0 },
+{ "linux/sockios.h", "SIOCGIFPFLAGS", 0, 0x8935, 0 },
+{ "linux/sockios.h", "SIOCGIFSLAVE", 0, 0x8929, 0 },
+{ "linux/sockios.h", "SIOCGIFTXQLEN", 0, 0x8942, 0 },
+{ "linux/sockios.h", "SIOCGIFVLAN", 0, 0x8982, 0 },
+{ "linux/sockios.h", "SIOCGMIIPHY", 0, 0x8947, 0 },
+{ "linux/sockios.h", "SIOCGMIIREG", 0, 0x8948, 0 },
+{ "linux/sockios.h", "SIOCGRARP", 0, 0x8961, 0 },
+{ "linux/sockios.h", "SIOCGSKNS", 0, 0x894C, 0 },
+{ "linux/sockios.h", "SIOCGSTAMPNS_NEW", _IOC_READ, 0x8907, 0x10 },
+{ "linux/sockios.h", "SIOCGSTAMP_NEW", _IOC_READ, 0x8906, 0x10 },
+{ "linux/sockios.h", "SIOCOUTQNSD", 0, 0x894B, 0 },
+{ "linux/sockios.h", "SIOCPROTOPRIVATE", 0, 0x89E0, 0 },
+{ "linux/sockios.h", "SIOCRTMSG", 0, 0x890D, 0 },
+{ "linux/sockios.h", "SIOCSARP", 0, 0x8955, 0 },
+{ "linux/sockios.h", "SIOCSHWTSTAMP", 0, 0x89b0, 0 },
+{ "linux/sockios.h", "SIOCSIFADDR", 0, 0x8916, 0 },
+{ "linux/sockios.h", "SIOCSIFBR", 0, 0x8941, 0 },
+{ "linux/sockios.h", "SIOCSIFBRDADDR", 0, 0x891a, 0 },
+{ "linux/sockios.h", "SIOCSIFDSTADDR", 0, 0x8918, 0 },
+{ "linux/sockios.h", "SIOCSIFENCAP", 0, 0x8926, 0 },
+{ "linux/sockios.h", "SIOCSIFFLAGS", 0, 0x8914, 0 },
+{ "linux/sockios.h", "SIOCSIFHWADDR", 0, 0x8924, 0 },
+{ "linux/sockios.h", "SIOCSIFHWBROADCAST", 0, 0x8937, 0 },
+{ "linux/sockios.h", "SIOCSIFLINK", 0, 0x8911, 0 },
+{ "linux/sockios.h", "SIOCSIFMAP", 0, 0x8971, 0 },
+{ "linux/sockios.h", "SIOCSIFMEM", 0, 0x8920, 0 },
+{ "linux/sockios.h", "SIOCSIFMETRIC", 0, 0x891e, 0 },
+{ "linux/sockios.h", "SIOCSIFMTU", 0, 0x8922, 0 },
+{ "linux/sockios.h", "SIOCSIFNAME", 0, 0x8923, 0 },
+{ "linux/sockios.h", "SIOCSIFNETMASK", 0, 0x891c, 0 },
+{ "linux/sockios.h", "SIOCSIFPFLAGS", 0, 0x8934, 0 },
+{ "linux/sockios.h", "SIOCSIFSLAVE", 0, 0x8930, 0 },
+{ "linux/sockios.h", "SIOCSIFTXQLEN", 0, 0x8943, 0 },
+{ "linux/sockios.h", "SIOCSIFVLAN", 0, 0x8983, 0 },
+{ "linux/sockios.h", "SIOCSMIIREG", 0, 0x8949, 0 },
+{ "linux/sockios.h", "SIOCSRARP", 0, 0x8962, 0 },
+{ "linux/sockios.h", "SIOCWANDEV", 0, 0x894A, 0 },
+{ "linux/sonet.h", "SONET_CLRDIAG", _IOC_READ|_IOC_WRITE, 0x6113, 0x04 },
+{ "linux/sonet.h", "SONET_GETDIAG", _IOC_READ, 0x6114, 0x04 },
+{ "linux/sonet.h", "SONET_GETFRAMING", _IOC_READ, 0x6116, 0x04 },
+{ "linux/sonet.h", "SONET_GETFRSENSE", _IOC_READ, 0x6117, 0x06 },
+{ "linux/sonet.h", "SONET_GETSTAT", _IOC_READ, 0x6110, 0x24 },
+{ "linux/sonet.h", "SONET_GETSTATZ", _IOC_READ, 0x6111, 0x24 },
+{ "linux/sonet.h", "SONET_SETDIAG", _IOC_READ|_IOC_WRITE, 0x6112, 0x04 },
+{ "linux/sonet.h", "SONET_SETFRAMING", _IOC_WRITE, 0x6115, 0x04 },
+{ "linux/sonypi.h", "SONYPI_IOCGBAT1CAP", _IOC_READ, 0x7602, 0x02 },
+{ "linux/sonypi.h", "SONYPI_IOCGBAT1REM", _IOC_READ, 0x7603, 0x02 },
+{ "linux/sonypi.h", "SONYPI_IOCGBAT2CAP", _IOC_READ, 0x7604, 0x02 },
+{ "linux/sonypi.h", "SONYPI_IOCGBAT2REM", _IOC_READ, 0x7605, 0x02 },
+{ "linux/sonypi.h", "SONYPI_IOCGBATFLAGS", _IOC_READ, 0x7607, 0x01 },
+{ "linux/sonypi.h", "SONYPI_IOCGBLUE", _IOC_READ, 0x7608, 0x01 },
+{ "linux/sonypi.h", "SONYPI_IOCGBRT", _IOC_READ, 0x7600, 0x01 },
+{ "linux/sonypi.h", "SONYPI_IOCGFAN", _IOC_READ, 0x760a, 0x01 },
+{ "linux/sonypi.h", "SONYPI_IOCGTEMP", _IOC_READ, 0x760c, 0x01 },
+{ "linux/sonypi.h", "SONYPI_IOCSBLUE", _IOC_WRITE, 0x7609, 0x01 },
+{ "linux/sonypi.h", "SONYPI_IOCSBRT", _IOC_WRITE, 0x7600, 0x01 },
+{ "linux/sonypi.h", "SONYPI_IOCSFAN", _IOC_WRITE, 0x760b, 0x01 },
+{ "linux/soundcard.h", "OSS_GETVERSION", _IOC_READ, 0x4d76, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_COPR_HALT", _IOC_READ|_IOC_WRITE, 0x4307, 0x14 },
+{ "linux/soundcard.h", "SNDCTL_COPR_LOAD", _IOC_READ|_IOC_WRITE, 0x4301, 0xfb0 },
+{ "linux/soundcard.h", "SNDCTL_COPR_RCODE", _IOC_READ|_IOC_WRITE, 0x4303, 0x14 },
+{ "linux/soundcard.h", "SNDCTL_COPR_RCVMSG", _IOC_READ, 0x4309, 0xfa4 },
+{ "linux/soundcard.h", "SNDCTL_COPR_RDATA", _IOC_READ|_IOC_WRITE, 0x4302, 0x14 },
+{ "linux/soundcard.h", "SNDCTL_COPR_RESET", _IOC_NONE, 0x4300, 0x00 },
+{ "linux/soundcard.h", "SNDCTL_COPR_RUN", _IOC_READ|_IOC_WRITE, 0x4306, 0x14 },
+{ "linux/soundcard.h", "SNDCTL_COPR_SENDMSG", _IOC_READ|_IOC_WRITE, 0x4308, 0xfa4 },
+{ "linux/soundcard.h", "SNDCTL_COPR_WCODE", _IOC_WRITE, 0x4305, 0x14 },
+{ "linux/soundcard.h", "SNDCTL_COPR_WDATA", _IOC_WRITE, 0x4304, 0x14 },
+{ "linux/soundcard.h", "SNDCTL_DSP_BIND_CHANNEL", _IOC_READ|_IOC_WRITE, 0x5041, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_CHANNELS", _IOC_READ|_IOC_WRITE, 0x5006, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_GETBLKSIZE", _IOC_READ|_IOC_WRITE, 0x5004, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_GETCAPS", _IOC_READ, 0x500f, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_GETCHANNELMASK", _IOC_READ|_IOC_WRITE, 0x5040, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_GETFMTS", _IOC_READ, 0x500b, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_GETIPTR", _IOC_READ, 0x5011, 0x0c },
+{ "linux/soundcard.h", "SNDCTL_DSP_GETISPACE", _IOC_READ, 0x500d, 0x10 },
+{ "linux/soundcard.h", "SNDCTL_DSP_GETODELAY", _IOC_READ, 0x5017, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_GETOPTR", _IOC_READ, 0x5012, 0x0c },
+{ "linux/soundcard.h", "SNDCTL_DSP_GETOSPACE", _IOC_READ, 0x500c, 0x10 },
+{ "linux/soundcard.h", "SNDCTL_DSP_GETSPDIF", _IOC_READ, 0x5043, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_GETTRIGGER", _IOC_READ, 0x5010, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_MAPINBUF", _IOC_READ, 0x5013, 0x08 },
+{ "linux/soundcard.h", "SNDCTL_DSP_MAPOUTBUF", _IOC_READ, 0x5014, 0x08 },
+{ "linux/soundcard.h", "SNDCTL_DSP_NONBLOCK", _IOC_NONE, 0x500e, 0x00 },
+{ "linux/soundcard.h", "SNDCTL_DSP_POST", _IOC_NONE, 0x5008, 0x00 },
+{ "linux/soundcard.h", "SNDCTL_DSP_PROFILE", _IOC_WRITE, 0x5017, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_RESET", _IOC_NONE, 0x5000, 0x00 },
+{ "linux/soundcard.h", "SNDCTL_DSP_SETDUPLEX", _IOC_NONE, 0x5016, 0x00 },
+{ "linux/soundcard.h", "SNDCTL_DSP_SETFMT", _IOC_READ|_IOC_WRITE, 0x5005, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_SETFRAGMENT", _IOC_READ|_IOC_WRITE, 0x500a, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_SETSPDIF", _IOC_WRITE, 0x5042, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_SETSYNCRO", _IOC_NONE, 0x5015, 0x00 },
+{ "linux/soundcard.h", "SNDCTL_DSP_SETTRIGGER", _IOC_WRITE, 0x5010, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_SPEED", _IOC_READ|_IOC_WRITE, 0x5002, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_STEREO", _IOC_READ|_IOC_WRITE, 0x5003, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_SUBDIVIDE", _IOC_READ|_IOC_WRITE, 0x5009, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_SYNC", _IOC_NONE, 0x5001, 0x00 },
+{ "linux/soundcard.h", "SNDCTL_FM_4OP_ENABLE", _IOC_WRITE, 0x510f, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_FM_LOAD_INSTR", _IOC_WRITE, 0x5107, 0x28 },
+{ "linux/soundcard.h", "SNDCTL_MIDI_INFO", _IOC_READ|_IOC_WRITE, 0x510c, 0x74 },
+{ "linux/soundcard.h", "SNDCTL_MIDI_MPUCMD", _IOC_READ|_IOC_WRITE, 0x6d02, 0x21 },
+{ "linux/soundcard.h", "SNDCTL_MIDI_MPUMODE", _IOC_READ|_IOC_WRITE, 0x6d01, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_MIDI_PRETIME", _IOC_READ|_IOC_WRITE, 0x6d00, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_SEQ_CTRLRATE", _IOC_READ|_IOC_WRITE, 0x5103, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_SEQ_GETINCOUNT", _IOC_READ, 0x5105, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_SEQ_GETOUTCOUNT", _IOC_READ, 0x5104, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_SEQ_GETTIME", _IOC_READ, 0x5113, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_SEQ_NRMIDIS", _IOC_READ, 0x510b, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_SEQ_NRSYNTHS", _IOC_READ, 0x510a, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_SEQ_OUTOFBAND", _IOC_WRITE, 0x5112, 0x08 },
+{ "linux/soundcard.h", "SNDCTL_SEQ_PANIC", _IOC_NONE, 0x5111, 0x00 },
+{ "linux/soundcard.h", "SNDCTL_SEQ_PERCMODE", _IOC_WRITE, 0x5106, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_SEQ_RESET", _IOC_NONE, 0x5100, 0x00 },
+{ "linux/soundcard.h", "SNDCTL_SEQ_RESETSAMPLES", _IOC_WRITE, 0x5109, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_SEQ_SYNC", _IOC_NONE, 0x5101, 0x00 },
+{ "linux/soundcard.h", "SNDCTL_SEQ_TESTMIDI", _IOC_WRITE, 0x5108, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_SEQ_THRESHOLD", _IOC_WRITE, 0x510d, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_SYNTH_CONTROL", _IOC_READ|_IOC_WRITE, 0x5115, 0xfa4 },
+{ "linux/soundcard.h", "SNDCTL_SYNTH_ID", _IOC_READ|_IOC_WRITE, 0x5114, 0x8c },
+{ "linux/soundcard.h", "SNDCTL_SYNTH_INFO", _IOC_READ|_IOC_WRITE, 0x5102, 0x8c },
+{ "linux/soundcard.h", "SNDCTL_SYNTH_MEMAVL", _IOC_READ|_IOC_WRITE, 0x510e, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_SYNTH_REMOVESAMPLE", _IOC_READ|_IOC_WRITE, 0x5116, 0x0c },
+{ "linux/soundcard.h", "SNDCTL_TMR_CONTINUE", _IOC_NONE, 0x5404, 0x00 },
+{ "linux/soundcard.h", "SNDCTL_TMR_METRONOME", _IOC_WRITE, 0x5407, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_TMR_SELECT", _IOC_WRITE, 0x5408, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_TMR_SOURCE", _IOC_READ|_IOC_WRITE, 0x5406, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_TMR_START", _IOC_NONE, 0x5402, 0x00 },
+{ "linux/soundcard.h", "SNDCTL_TMR_STOP", _IOC_NONE, 0x5403, 0x00 },
+{ "linux/soundcard.h", "SNDCTL_TMR_TEMPO", _IOC_READ|_IOC_WRITE, 0x5405, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_TMR_TIMEBASE", _IOC_READ|_IOC_WRITE, 0x5401, 0x04 },
+{ "linux/soundcard.h", "SOUND_MIXER_3DSE", _IOC_READ|_IOC_WRITE, 0x4d68, 0x04 },
+{ "linux/soundcard.h", "SOUND_MIXER_ACCESS", _IOC_READ|_IOC_WRITE, 0x4d66, 0x80 },
+{ "linux/soundcard.h", "SOUND_MIXER_AGC", _IOC_READ|_IOC_WRITE, 0x4d67, 0x04 },
+{ "linux/soundcard.h", "SOUND_MIXER_GETLEVELS", _IOC_READ|_IOC_WRITE, 0x4d74, 0xa4 },
+{ "linux/soundcard.h", "SOUND_MIXER_INFO", _IOC_READ, 0x4d65, 0x5c },
+{ "linux/soundcard.h", "SOUND_MIXER_PRIVATE1", _IOC_READ|_IOC_WRITE, 0x4d6f, 0x04 },
+{ "linux/soundcard.h", "SOUND_MIXER_PRIVATE2", _IOC_READ|_IOC_WRITE, 0x4d70, 0x04 },
+{ "linux/soundcard.h", "SOUND_MIXER_PRIVATE3", _IOC_READ|_IOC_WRITE, 0x4d71, 0x04 },
+{ "linux/soundcard.h", "SOUND_MIXER_PRIVATE4", _IOC_READ|_IOC_WRITE, 0x4d72, 0x04 },
+{ "linux/soundcard.h", "SOUND_MIXER_PRIVATE5", _IOC_READ|_IOC_WRITE, 0x4d73, 0x04 },
+{ "linux/soundcard.h", "SOUND_MIXER_SETLEVELS", _IOC_READ|_IOC_WRITE, 0x4d75, 0xa4 },
+{ "linux/soundcard.h", "SOUND_OLD_MIXER_INFO", _IOC_READ, 0x4d65, 0x30 },
+{ "linux/soundcard.h", "SOUND_PCM_READ_BITS", _IOC_READ, 0x5005, 0x04 },
+{ "linux/soundcard.h", "SOUND_PCM_READ_CHANNELS", _IOC_READ, 0x5006, 0x04 },
+{ "linux/soundcard.h", "SOUND_PCM_READ_FILTER", _IOC_READ, 0x5007, 0x04 },
+{ "linux/soundcard.h", "SOUND_PCM_READ_RATE", _IOC_READ, 0x5002, 0x04 },
+{ "linux/soundcard.h", "SOUND_PCM_WRITE_FILTER", _IOC_READ|_IOC_WRITE, 0x5007, 0x04 },
+{ "linux/spi/spidev.h", "SPI_IOC_RD_BITS_PER_WORD", _IOC_READ, 0x6b03, 0x01 },
+{ "linux/spi/spidev.h", "SPI_IOC_RD_LSB_FIRST", _IOC_READ, 0x6b02, 0x01 },
+{ "linux/spi/spidev.h", "SPI_IOC_RD_MAX_SPEED_HZ", _IOC_READ, 0x6b04, 0x04 },
+{ "linux/spi/spidev.h", "SPI_IOC_RD_MODE", _IOC_READ, 0x6b01, 0x01 },
+{ "linux/spi/spidev.h", "SPI_IOC_RD_MODE32", _IOC_READ, 0x6b05, 0x04 },
+{ "linux/spi/spidev.h", "SPI_IOC_WR_BITS_PER_WORD", _IOC_WRITE, 0x6b03, 0x01 },
+{ "linux/spi/spidev.h", "SPI_IOC_WR_LSB_FIRST", _IOC_WRITE, 0x6b02, 0x01 },
+{ "linux/spi/spidev.h", "SPI_IOC_WR_MAX_SPEED_HZ", _IOC_WRITE, 0x6b04, 0x04 },
+{ "linux/spi/spidev.h", "SPI_IOC_WR_MODE", _IOC_WRITE, 0x6b01, 0x01 },
+{ "linux/spi/spidev.h", "SPI_IOC_WR_MODE32", _IOC_WRITE, 0x6b05, 0x04 },
+{ "linux/stm.h", "STP_POLICY_ID_GET", _IOC_READ, 0x2501, 0x10 },
+{ "linux/stm.h", "STP_POLICY_ID_SET", _IOC_READ|_IOC_WRITE, 0x2500, 0x10 },
+{ "linux/stm.h", "STP_SET_OPTIONS", _IOC_WRITE, 0x2502, 0x08 },
+{ "linux/suspend_ioctls.h", "SNAPSHOT_ALLOC_SWAP_PAGE", _IOC_READ, 0x3314, 0x08 },
+{ "linux/suspend_ioctls.h", "SNAPSHOT_ATOMIC_RESTORE", _IOC_NONE, 0x3304, 0x00 },
+{ "linux/suspend_ioctls.h", "SNAPSHOT_AVAIL_SWAP_SIZE", _IOC_READ, 0x3313, 0x08 },
+{ "linux/suspend_ioctls.h", "SNAPSHOT_CREATE_IMAGE", _IOC_WRITE, 0x3311, 0x04 },
+{ "linux/suspend_ioctls.h", "SNAPSHOT_FREE", _IOC_NONE, 0x3305, 0x00 },
+{ "linux/suspend_ioctls.h", "SNAPSHOT_FREEZE", _IOC_NONE, 0x3301, 0x00 },
+{ "linux/suspend_ioctls.h", "SNAPSHOT_FREE_SWAP_PAGES", _IOC_NONE, 0x3309, 0x00 },
+{ "linux/suspend_ioctls.h", "SNAPSHOT_GET_IMAGE_SIZE", _IOC_READ, 0x330e, 0x08 },
+{ "linux/suspend_ioctls.h", "SNAPSHOT_PLATFORM_SUPPORT", _IOC_NONE, 0x330f, 0x00 },
+{ "linux/suspend_ioctls.h", "SNAPSHOT_POWER_OFF", _IOC_NONE, 0x3310, 0x00 },
+{ "linux/suspend_ioctls.h", "SNAPSHOT_PREF_IMAGE_SIZE", _IOC_NONE, 0x3312, 0x00 },
+{ "linux/suspend_ioctls.h", "SNAPSHOT_S2RAM", _IOC_NONE, 0x330b, 0x00 },
+{ "linux/suspend_ioctls.h", "SNAPSHOT_SET_SWAP_AREA", _IOC_WRITE, 0x330d, 0x0c },
+{ "linux/suspend_ioctls.h", "SNAPSHOT_UNFREEZE", _IOC_NONE, 0x3302, 0x00 },
+{ "linux/switchtec_ioctl.h", "SWITCHTEC_IOCTL_EVENT_CTL", _IOC_READ|_IOC_WRITE, 0x5743, 0x28 },
+{ "linux/switchtec_ioctl.h", "SWITCHTEC_IOCTL_EVENT_SUMMARY", _IOC_READ, 0x5742, 0x4d8 },
+{ "linux/switchtec_ioctl.h", "SWITCHTEC_IOCTL_EVENT_SUMMARY_LEGACY", _IOC_READ, 0x5742, 0x198 },
+{ "linux/switchtec_ioctl.h", "SWITCHTEC_IOCTL_FLASH_INFO", _IOC_READ, 0x5740, 0x10 },
+{ "linux/switchtec_ioctl.h", "SWITCHTEC_IOCTL_FLASH_PART_INFO", _IOC_READ|_IOC_WRITE, 0x5741, 0x10 },
+{ "linux/switchtec_ioctl.h", "SWITCHTEC_IOCTL_PFF_TO_PORT", _IOC_READ|_IOC_WRITE, 0x5744, 0x0c },
+{ "linux/switchtec_ioctl.h", "SWITCHTEC_IOCTL_PORT_TO_PFF", _IOC_READ|_IOC_WRITE, 0x5745, 0x0c },
+{ "linux/sync_file.h", "SYNC_IOC_FILE_INFO", _IOC_READ|_IOC_WRITE, 0x3e04, 0x38 },
+{ "linux/sync_file.h", "SYNC_IOC_MERGE", _IOC_READ|_IOC_WRITE, 0x3e03, 0x30 },
+{ "linux/synclink.h", "MGSL_IOCCLRMODCOUNT", _IOC_NONE, 0x6d0f, 0x00 },
+{ "linux/synclink.h", "MGSL_IOCGGPIO", _IOC_READ, 0x6d11, 0x10 },
+{ "linux/synclink.h", "MGSL_IOCGIF", _IOC_NONE, 0x6d0b, 0x00 },
+{ "linux/synclink.h", "MGSL_IOCGPARAMS", _IOC_READ, 0x6d01, 0x20 },
+{ "linux/synclink.h", "MGSL_IOCGSTATS", _IOC_NONE, 0x6d07, 0x00 },
+{ "linux/synclink.h", "MGSL_IOCGTXIDLE", _IOC_NONE, 0x6d03, 0x00 },
+{ "linux/synclink.h", "MGSL_IOCGXCTRL", _IOC_NONE, 0x6d16, 0x00 },
+{ "linux/synclink.h", "MGSL_IOCGXSYNC", _IOC_NONE, 0x6d14, 0x00 },
+{ "linux/synclink.h", "MGSL_IOCLOOPTXDONE", _IOC_NONE, 0x6d09, 0x00 },
+{ "linux/synclink.h", "MGSL_IOCRXENABLE", _IOC_NONE, 0x6d05, 0x00 },
+{ "linux/synclink.h", "MGSL_IOCSGPIO", _IOC_WRITE, 0x6d10, 0x10 },
+{ "linux/synclink.h", "MGSL_IOCSIF", _IOC_NONE, 0x6d0a, 0x00 },
+{ "linux/synclink.h", "MGSL_IOCSPARAMS", _IOC_WRITE, 0x6d00, 0x20 },
+{ "linux/synclink.h", "MGSL_IOCSTXIDLE", _IOC_NONE, 0x6d02, 0x00 },
+{ "linux/synclink.h", "MGSL_IOCSXCTRL", _IOC_NONE, 0x6d15, 0x00 },
+{ "linux/synclink.h", "MGSL_IOCSXSYNC", _IOC_NONE, 0x6d13, 0x00 },
+{ "linux/synclink.h", "MGSL_IOCTXABORT", _IOC_NONE, 0x6d06, 0x00 },
+{ "linux/synclink.h", "MGSL_IOCTXENABLE", _IOC_NONE, 0x6d04, 0x00 },
+{ "linux/synclink.h", "MGSL_IOCWAITEVENT", _IOC_READ|_IOC_WRITE, 0x6d08, 0x04 },
+{ "linux/synclink.h", "MGSL_IOCWAITGPIO", _IOC_READ|_IOC_WRITE, 0x6d12, 0x10 },
+{ "linux/tee.h", "TEE_IOC_CANCEL", _IOC_READ, 0xa404, 0x08 },
+{ "linux/tee.h", "TEE_IOC_CLOSE_SESSION", _IOC_READ, 0xa405, 0x04 },
+{ "linux/tee.h", "TEE_IOC_INVOKE", _IOC_READ, 0xa403, 0x10 },
+{ "linux/tee.h", "TEE_IOC_OPEN_SESSION", _IOC_READ, 0xa402, 0x10 },
+{ "linux/tee.h", "TEE_IOC_SHM_ALLOC", _IOC_READ|_IOC_WRITE, 0xa401, 0x10 },
+{ "linux/tee.h", "TEE_IOC_SHM_REGISTER", _IOC_READ|_IOC_WRITE, 0xa409, 0x18 },
+{ "linux/tee.h", "TEE_IOC_SUPPL_RECV", _IOC_READ, 0xa406, 0x10 },
+{ "linux/tee.h", "TEE_IOC_SUPPL_SEND", _IOC_READ, 0xa407, 0x10 },
+{ "linux/tee.h", "TEE_IOC_VERSION", _IOC_READ, 0xa400, 0x0c },
+{ "linux/timerfd.h", "TFD_IOC_SET_TICKS", _IOC_WRITE, 0x5400, 0x08 },
+{ "linux/toshiba.h", "TOSHIBA_ACPI_SCI", _IOC_READ|_IOC_WRITE, 0x7491, 0x18 },
+{ "linux/toshiba.h", "TOSH_SMM", _IOC_READ|_IOC_WRITE, 0x7490, 0x18 },
+{ "linux/udf_fs_i.h", "UDF_GETEABLOCK", _IOC_READ, 0x6c41, 0x04 },
+{ "linux/udf_fs_i.h", "UDF_GETEASIZE", _IOC_READ, 0x6c40, 0x04 },
+{ "linux/udf_fs_i.h", "UDF_GETVOLIDENT", _IOC_READ, 0x6c42, 0x04 },
+{ "linux/udf_fs_i.h", "UDF_RELOCATE_BLOCKS", _IOC_READ|_IOC_WRITE, 0x6c43, 0x04 },
+{ "linux/udmabuf.h", "UDMABUF_CREATE", _IOC_WRITE, 0x7542, 0x18 },
+{ "linux/udmabuf.h", "UDMABUF_CREATE_LIST", _IOC_WRITE, 0x7543, 0x08 },
+{ "linux/uinput.h", "UI_ABS_SETUP", _IOC_WRITE, 0x5504, 0x1c },
+{ "linux/uinput.h", "UI_BEGIN_FF_ERASE", _IOC_READ|_IOC_WRITE, 0x55ca, 0x0c },
+{ "linux/uinput.h", "UI_BEGIN_FF_UPLOAD", _IOC_READ|_IOC_WRITE, 0x55c8, 0x60 },
+{ "linux/uinput.h", "UI_DEV_CREATE", _IOC_NONE, 0x5501, 0x00 },
+{ "linux/uinput.h", "UI_DEV_DESTROY", _IOC_NONE, 0x5502, 0x00 },
+{ "linux/uinput.h", "UI_DEV_SETUP", _IOC_WRITE, 0x5503, 0x5c },
+{ "linux/uinput.h", "UI_END_FF_ERASE", _IOC_WRITE, 0x55cb, 0x0c },
+{ "linux/uinput.h", "UI_END_FF_UPLOAD", _IOC_WRITE, 0x55c9, 0x60 },
+{ "linux/uinput.h", "UI_GET_VERSION", _IOC_READ, 0x552d, 0x04 },
+{ "linux/uinput.h", "UI_SET_ABSBIT", _IOC_WRITE, 0x5567, 0x04 },
+{ "linux/uinput.h", "UI_SET_EVBIT", _IOC_WRITE, 0x5564, 0x04 },
+{ "linux/uinput.h", "UI_SET_FFBIT", _IOC_WRITE, 0x556b, 0x04 },
+{ "linux/uinput.h", "UI_SET_KEYBIT", _IOC_WRITE, 0x5565, 0x04 },
+{ "linux/uinput.h", "UI_SET_LEDBIT", _IOC_WRITE, 0x5569, 0x04 },
+{ "linux/uinput.h", "UI_SET_MSCBIT", _IOC_WRITE, 0x5568, 0x04 },
+{ "linux/uinput.h", "UI_SET_PHYS", _IOC_WRITE, 0x556c, 0x04 },
+{ "linux/uinput.h", "UI_SET_PROPBIT", _IOC_WRITE, 0x556e, 0x04 },
+{ "linux/uinput.h", "UI_SET_RELBIT", _IOC_WRITE, 0x5566, 0x04 },
+{ "linux/uinput.h", "UI_SET_SNDBIT", _IOC_WRITE, 0x556a, 0x04 },
+{ "linux/uinput.h", "UI_SET_SWBIT", _IOC_WRITE, 0x556d, 0x04 },
+{ "linux/usb/cdc-wdm.h", "IOCTL_WDM_MAX_COMMAND", _IOC_READ, 0x48a0, 0x02 },
+{ "linux/usb/functionfs.h", "FUNCTIONFS_CLEAR_HALT", _IOC_NONE, 0x6703, 0x00 },
+{ "linux/usb/functionfs.h", "FUNCTIONFS_ENDPOINT_DESC", _IOC_READ, 0x6782, 0x09 },
+{ "linux/usb/functionfs.h", "FUNCTIONFS_ENDPOINT_REVMAP", _IOC_NONE, 0x6781, 0x00 },
+{ "linux/usb/functionfs.h", "FUNCTIONFS_FIFO_FLUSH", _IOC_NONE, 0x6702, 0x00 },
+{ "linux/usb/functionfs.h", "FUNCTIONFS_FIFO_STATUS", _IOC_NONE, 0x6701, 0x00 },
+{ "linux/usb/functionfs.h", "FUNCTIONFS_INTERFACE_REVMAP", _IOC_NONE, 0x6780, 0x00 },
+{ "linux/usb/g_printer.h", "GADGET_GET_PRINTER_STATUS", _IOC_READ, 0x6721, 0x01 },
+{ "linux/usb/g_printer.h", "GADGET_SET_PRINTER_STATUS", _IOC_READ|_IOC_WRITE, 0x6722, 0x01 },
+{ "linux/usb/g_uvc.h", "UVCIOC_SEND_RESPONSE", _IOC_WRITE, 0x5501, 0x40 },
+{ "linux/usb/gadgetfs.h", "GADGETFS_CLEAR_HALT", _IOC_NONE, 0x6703, 0x00 },
+{ "linux/usb/gadgetfs.h", "GADGETFS_FIFO_FLUSH", _IOC_NONE, 0x6702, 0x00 },
+{ "linux/usb/gadgetfs.h", "GADGETFS_FIFO_STATUS", _IOC_NONE, 0x6701, 0x00 },
+{ "linux/usb/iowarrior.h", "IOW_GETINFO", _IOC_READ, 0xc003, 0x28 },
+{ "linux/usb/iowarrior.h", "IOW_READ", _IOC_WRITE, 0xc002, 0x04 },
+{ "linux/usb/iowarrior.h", "IOW_WRITE", _IOC_WRITE, 0xc001, 0x04 },
+{ "linux/usb/raw_gadget.h", "USB_RAW_IOCTL_CONFIGURE", _IOC_NONE, 0x5509, 0x00 },
+{ "linux/usb/raw_gadget.h", "USB_RAW_IOCTL_EP0_READ", _IOC_READ|_IOC_WRITE, 0x5504, 0x08 },
+{ "linux/usb/raw_gadget.h", "USB_RAW_IOCTL_EP0_STALL", _IOC_NONE, 0x550c, 0x00 },
+{ "linux/usb/raw_gadget.h", "USB_RAW_IOCTL_EP0_WRITE", _IOC_WRITE, 0x5503, 0x08 },
+{ "linux/usb/raw_gadget.h", "USB_RAW_IOCTL_EPS_INFO", _IOC_READ, 0x550b, 0x3c0 },
+{ "linux/usb/raw_gadget.h", "USB_RAW_IOCTL_EP_CLEAR_HALT", _IOC_WRITE, 0x550e, 0x04 },
+{ "linux/usb/raw_gadget.h", "USB_RAW_IOCTL_EP_DISABLE", _IOC_WRITE, 0x5506, 0x04 },
+{ "linux/usb/raw_gadget.h", "USB_RAW_IOCTL_EP_ENABLE", _IOC_WRITE, 0x5505, 0x09 },
+{ "linux/usb/raw_gadget.h", "USB_RAW_IOCTL_EP_READ", _IOC_READ|_IOC_WRITE, 0x5508, 0x08 },
+{ "linux/usb/raw_gadget.h", "USB_RAW_IOCTL_EP_SET_HALT", _IOC_WRITE, 0x550d, 0x04 },
+{ "linux/usb/raw_gadget.h", "USB_RAW_IOCTL_EP_SET_WEDGE", _IOC_WRITE, 0x550f, 0x04 },
+{ "linux/usb/raw_gadget.h", "USB_RAW_IOCTL_EP_WRITE", _IOC_WRITE, 0x5507, 0x08 },
+{ "linux/usb/raw_gadget.h", "USB_RAW_IOCTL_EVENT_FETCH", _IOC_READ, 0x5502, 0x08 },
+{ "linux/usb/raw_gadget.h", "USB_RAW_IOCTL_INIT", _IOC_WRITE, 0x5500, 0x101 },
+{ "linux/usb/raw_gadget.h", "USB_RAW_IOCTL_RUN", _IOC_NONE, 0x5501, 0x00 },
+{ "linux/usb/raw_gadget.h", "USB_RAW_IOCTL_VBUS_DRAW", _IOC_WRITE, 0x550a, 0x04 },
+{ "linux/usb/tmc.h", "USBTMC488_IOCTL_GET_CAPS", _IOC_READ, 0x5b11, 0x01 },
+{ "linux/usb/tmc.h", "USBTMC488_IOCTL_GOTO_LOCAL", _IOC_NONE, 0x5b14, 0x00 },
+{ "linux/usb/tmc.h", "USBTMC488_IOCTL_LOCAL_LOCKOUT", _IOC_NONE, 0x5b15, 0x00 },
+{ "linux/usb/tmc.h", "USBTMC488_IOCTL_READ_STB", _IOC_READ, 0x5b12, 0x01 },
+{ "linux/usb/tmc.h", "USBTMC488_IOCTL_REN_CONTROL", _IOC_WRITE, 0x5b13, 0x01 },
+{ "linux/usb/tmc.h", "USBTMC488_IOCTL_TRIGGER", _IOC_NONE, 0x5b16, 0x00 },
+{ "linux/usb/tmc.h", "USBTMC488_IOCTL_WAIT_SRQ", _IOC_WRITE, 0x5b17, 0x04 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_ABORT_BULK_IN", _IOC_NONE, 0x5b04, 0x00 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_ABORT_BULK_OUT", _IOC_NONE, 0x5b03, 0x00 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_API_VERSION", _IOC_READ, 0x5b10, 0x04 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_AUTO_ABORT", _IOC_WRITE, 0x5b19, 0x01 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_CANCEL_IO", _IOC_NONE, 0x5b23, 0x00 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_CLEANUP_IO", _IOC_NONE, 0x5b24, 0x00 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_CLEAR", _IOC_NONE, 0x5b02, 0x00 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_CLEAR_IN_HALT", _IOC_NONE, 0x5b07, 0x00 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_CLEAR_OUT_HALT", _IOC_NONE, 0x5b06, 0x00 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_CONFIG_TERMCHAR", _IOC_WRITE, 0x5b0c, 0x02 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_CTRL_REQUEST", _IOC_READ|_IOC_WRITE, 0x5b08, 0x0c },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_EOM_ENABLE", _IOC_WRITE, 0x5b0b, 0x01 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_GET_TIMEOUT", _IOC_READ, 0x5b09, 0x04 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_INDICATOR_PULSE", _IOC_NONE, 0x5b01, 0x00 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_MSG_IN_ATTR", _IOC_READ, 0x5b18, 0x01 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_READ", _IOC_READ|_IOC_WRITE, 0x5b0e, 0x10 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_SET_TIMEOUT", _IOC_WRITE, 0x5b0a, 0x04 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_WRITE", _IOC_READ|_IOC_WRITE, 0x5b0d, 0x10 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_WRITE_RESULT", _IOC_READ|_IOC_WRITE, 0x5b0f, 0x04 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_ALLOC_STREAMS", _IOC_READ, 0x551c, 0x08 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_ALLOW_SUSPEND", _IOC_NONE, 0x5522, 0x00 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_BULK32", _IOC_READ|_IOC_WRITE, 0x5502, 0x10 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_CLAIMINTERFACE", _IOC_READ, 0x550f, 0x04 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_CLAIM_PORT", _IOC_READ, 0x5518, 0x04 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_CLEAR_HALT", _IOC_READ, 0x5515, 0x04 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_CONNECT", _IOC_NONE, 0x5517, 0x00 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_CONNECTINFO", _IOC_WRITE, 0x5511, 0x08 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_CONTROL32", _IOC_READ|_IOC_WRITE, 0x5500, 0x10 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_DISCARDURB", _IOC_NONE, 0x550b, 0x00 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_DISCONNECT", _IOC_NONE, 0x5516, 0x00 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_DISCONNECT_CLAIM", _IOC_READ, 0x551b, 0x108 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_DISCSIGNAL32", _IOC_READ, 0x550e, 0x08 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_DROP_PRIVILEGES", _IOC_WRITE, 0x551e, 0x04 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_FORBID_SUSPEND", _IOC_NONE, 0x5521, 0x00 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_FREE_STREAMS", _IOC_READ, 0x551d, 0x08 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_GETDRIVER", _IOC_WRITE, 0x5508, 0x104 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_GET_CAPABILITIES", _IOC_READ, 0x551a, 0x04 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_GET_SPEED", _IOC_NONE, 0x551f, 0x00 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_HUB_PORTINFO", _IOC_READ, 0x5513, 0x80 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_IOCTL32", _IOC_READ|_IOC_WRITE, 0x5512, 0x0c },
+{ "linux/usbdevice_fs.h", "USBDEVFS_REAPURB32", _IOC_WRITE, 0x550c, 0x04 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_REAPURBNDELAY32", _IOC_WRITE, 0x550d, 0x04 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_RELEASEINTERFACE", _IOC_READ, 0x5510, 0x04 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_RELEASE_PORT", _IOC_READ, 0x5519, 0x04 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_RESET", _IOC_NONE, 0x5514, 0x00 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_RESETEP", _IOC_READ, 0x5503, 0x04 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_SETCONFIGURATION", _IOC_READ, 0x5505, 0x04 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_SETINTERFACE", _IOC_READ, 0x5504, 0x08 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_SUBMITURB", _IOC_READ, 0x550a, 0x2c },
+{ "linux/usbdevice_fs.h", "USBDEVFS_SUBMITURB32", _IOC_READ, 0x550a, 0x2a },
+{ "linux/usbdevice_fs.h", "USBDEVFS_WAIT_FOR_RESUME", _IOC_NONE, 0x5523, 0x00 },
+{ "linux/userfaultfd.h", "UFFDIO_API", _IOC_READ|_IOC_WRITE, 0xaa3f, 0x18 },
+{ "linux/userfaultfd.h", "UFFDIO_COPY", _IOC_READ|_IOC_WRITE, 0xaa03, 0x28 },
+{ "linux/userfaultfd.h", "UFFDIO_REGISTER", _IOC_READ|_IOC_WRITE, 0xaa00, 0x20 },
+{ "linux/userfaultfd.h", "UFFDIO_UNREGISTER", _IOC_READ, 0xaa01, 0x10 },
+{ "linux/userfaultfd.h", "UFFDIO_WAKE", _IOC_READ, 0xaa02, 0x10 },
+{ "linux/userfaultfd.h", "UFFDIO_WRITEPROTECT", _IOC_READ|_IOC_WRITE, 0xaa06, 0x18 },
+{ "linux/userfaultfd.h", "UFFDIO_ZEROPAGE", _IOC_READ|_IOC_WRITE, 0xaa04, 0x20 },
+{ "linux/uvcvideo.h", "UVCIOC_CTRL_MAP", _IOC_READ|_IOC_WRITE, 0x7520, 0x58 },
+{ "linux/uvcvideo.h", "UVCIOC_CTRL_QUERY", _IOC_READ|_IOC_WRITE, 0x7521, 0x0c },
+{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL", _IOC_READ|_IOC_WRITE, 0x564b, 0x40 },
+{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_ENUM_FRAME_SIZE", _IOC_READ|_IOC_WRITE, 0x564a, 0x40 },
+{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_ENUM_MBUS_CODE", _IOC_READ|_IOC_WRITE, 0x5602, 0x30 },
+{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_CROP", _IOC_READ|_IOC_WRITE, 0x563b, 0x38 },
+{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_FMT", _IOC_READ|_IOC_WRITE, 0x5604, 0x58 },
+{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_FRAME_INTERVAL", _IOC_READ|_IOC_WRITE, 0x5615, 0x30 },
+{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_SELECTION", _IOC_READ|_IOC_WRITE, 0x563d, 0x40 },
+{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_QUERYCAP", _IOC_READ, 0x5600, 0x40 },
+{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_CROP", _IOC_READ|_IOC_WRITE, 0x563c, 0x38 },
+{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_FMT", _IOC_READ|_IOC_WRITE, 0x5605, 0x58 },
+{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_FRAME_INTERVAL", _IOC_READ|_IOC_WRITE, 0x5616, 0x30 },
+{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_SELECTION", _IOC_READ|_IOC_WRITE, 0x563e, 0x40 },
+{ "linux/vboxguest.h", "VBG_IOCTL_ACQUIRE_GUEST_CAPABILITIES", _IOC_READ|_IOC_WRITE, 0x560d, 0x24 },
+{ "linux/vboxguest.h", "VBG_IOCTL_CHANGE_FILTER_MASK", _IOC_READ|_IOC_WRITE, 0x560c, 0x20 },
+{ "linux/vboxguest.h", "VBG_IOCTL_CHANGE_GUEST_CAPABILITIES", _IOC_READ|_IOC_WRITE, 0x560e, 0x20 },
+{ "linux/vboxguest.h", "VBG_IOCTL_CHECK_BALLOON", _IOC_READ|_IOC_WRITE, 0x5611, 0x20 },
+{ "linux/vboxguest.h", "VBG_IOCTL_DRIVER_VERSION_INFO", _IOC_READ|_IOC_WRITE, 0x5600, 0x2c },
+{ "linux/vboxguest.h", "VBG_IOCTL_HGCM_CONNECT", _IOC_READ|_IOC_WRITE, 0x5604, 0x9c },
+{ "linux/vboxguest.h", "VBG_IOCTL_HGCM_DISCONNECT", _IOC_READ|_IOC_WRITE, 0x5605, 0x1c },
+{ "linux/vboxguest.h", "VBG_IOCTL_INTERRUPT_ALL_WAIT_FOR_EVENTS", _IOC_READ|_IOC_WRITE, 0x560b, 0x18 },
+{ "linux/vboxguest.h", "VBG_IOCTL_VMMDEV_REQUEST_BIG", _IOC_NONE, 0x5603, 0x00 },
+{ "linux/vboxguest.h", "VBG_IOCTL_WAIT_FOR_EVENTS", _IOC_READ|_IOC_WRITE, 0x560a, 0x20 },
+{ "linux/vboxguest.h", "VBG_IOCTL_WRITE_CORE_DUMP", _IOC_READ|_IOC_WRITE, 0x5613, 0x1c },
+{ "linux/vfio.h", "VFIO_CHECK_EXTENSION", _IOC_NONE, 0x3b65, 0x00 },
+{ "linux/vfio.h", "VFIO_DEVICE_FEATURE", _IOC_NONE, 0x3b75, 0x00 },
+{ "linux/vfio.h", "VFIO_DEVICE_GET_GFX_DMABUF", _IOC_NONE, 0x3b73, 0x00 },
+{ "linux/vfio.h", "VFIO_DEVICE_GET_INFO", _IOC_NONE, 0x3b6b, 0x00 },
+{ "linux/vfio.h", "VFIO_DEVICE_GET_IRQ_INFO", _IOC_NONE, 0x3b6d, 0x00 },
+{ "linux/vfio.h", "VFIO_DEVICE_GET_PCI_HOT_RESET_INFO", _IOC_NONE, 0x3b70, 0x00 },
+{ "linux/vfio.h", "VFIO_DEVICE_GET_REGION_INFO", _IOC_NONE, 0x3b6c, 0x00 },
+{ "linux/vfio.h", "VFIO_DEVICE_IOEVENTFD", _IOC_NONE, 0x3b74, 0x00 },
+{ "linux/vfio.h", "VFIO_DEVICE_PCI_HOT_RESET", _IOC_NONE, 0x3b71, 0x00 },
+{ "linux/vfio.h", "VFIO_DEVICE_QUERY_GFX_PLANE", _IOC_NONE, 0x3b72, 0x00 },
+{ "linux/vfio.h", "VFIO_DEVICE_RESET", _IOC_NONE, 0x3b6f, 0x00 },
+{ "linux/vfio.h", "VFIO_DEVICE_SET_IRQS", _IOC_NONE, 0x3b6e, 0x00 },
+{ "linux/vfio.h", "VFIO_EEH_PE_OP", _IOC_NONE, 0x3b79, 0x00 },
+{ "linux/vfio.h", "VFIO_GET_API_VERSION", _IOC_NONE, 0x3b64, 0x00 },
+{ "linux/vfio.h", "VFIO_GROUP_GET_DEVICE_FD", _IOC_NONE, 0x3b6a, 0x00 },
+{ "linux/vfio.h", "VFIO_GROUP_GET_STATUS", _IOC_NONE, 0x3b67, 0x00 },
+{ "linux/vfio.h", "VFIO_GROUP_SET_CONTAINER", _IOC_NONE, 0x3b68, 0x00 },
+{ "linux/vfio.h", "VFIO_GROUP_UNSET_CONTAINER", _IOC_NONE, 0x3b69, 0x00 },
+{ "linux/vfio.h", "VFIO_IOMMU_DIRTY_PAGES", _IOC_NONE, 0x3b75, 0x00 },
+{ "linux/vfio.h", "VFIO_IOMMU_DISABLE", _IOC_NONE, 0x3b74, 0x00 },
+{ "linux/vfio.h", "VFIO_IOMMU_ENABLE", _IOC_NONE, 0x3b73, 0x00 },
+{ "linux/vfio.h", "VFIO_IOMMU_GET_INFO", _IOC_NONE, 0x3b70, 0x00 },
+{ "linux/vfio.h", "VFIO_IOMMU_MAP_DMA", _IOC_NONE, 0x3b71, 0x00 },
+{ "linux/vfio.h", "VFIO_IOMMU_SPAPR_REGISTER_MEMORY", _IOC_NONE, 0x3b75, 0x00 },
+{ "linux/vfio.h", "VFIO_IOMMU_SPAPR_TCE_CREATE", _IOC_NONE, 0x3b77, 0x00 },
+{ "linux/vfio.h", "VFIO_IOMMU_SPAPR_TCE_GET_INFO", _IOC_NONE, 0x3b70, 0x00 },
+{ "linux/vfio.h", "VFIO_IOMMU_SPAPR_TCE_REMOVE", _IOC_NONE, 0x3b78, 0x00 },
+{ "linux/vfio.h", "VFIO_IOMMU_SPAPR_UNREGISTER_MEMORY", _IOC_NONE, 0x3b76, 0x00 },
+{ "linux/vfio.h", "VFIO_IOMMU_UNMAP_DMA", _IOC_NONE, 0x3b72, 0x00 },
+{ "linux/vfio.h", "VFIO_SET_IOMMU", _IOC_NONE, 0x3b66, 0x00 },
+{ "linux/vhost.h", "VHOST_GET_BACKEND_FEATURES", _IOC_READ, 0xaf26, 0x08 },
+{ "linux/vhost.h", "VHOST_GET_FEATURES", _IOC_READ, 0xaf00, 0x08 },
+{ "linux/vhost.h", "VHOST_GET_VRING_BASE", _IOC_READ|_IOC_WRITE, 0xaf12, 0x08 },
+{ "linux/vhost.h", "VHOST_GET_VRING_BUSYLOOP_TIMEOUT", _IOC_WRITE, 0xaf24, 0x08 },
+{ "linux/vhost.h", "VHOST_GET_VRING_ENDIAN", _IOC_WRITE, 0xaf14, 0x08 },
+{ "linux/vhost.h", "VHOST_NET_SET_BACKEND", _IOC_WRITE, 0xaf30, 0x08 },
+{ "linux/vhost.h", "VHOST_RESET_OWNER", _IOC_NONE, 0xaf02, 0x00 },
+{ "linux/vhost.h", "VHOST_SCSI_CLEAR_ENDPOINT", _IOC_WRITE, 0xaf41, 0xe8 },
+{ "linux/vhost.h", "VHOST_SCSI_GET_ABI_VERSION", _IOC_WRITE, 0xaf42, 0x04 },
+{ "linux/vhost.h", "VHOST_SCSI_GET_EVENTS_MISSED", _IOC_WRITE, 0xaf44, 0x04 },
+{ "linux/vhost.h", "VHOST_SCSI_SET_ENDPOINT", _IOC_WRITE, 0xaf40, 0xe8 },
+{ "linux/vhost.h", "VHOST_SCSI_SET_EVENTS_MISSED", _IOC_WRITE, 0xaf43, 0x04 },
+{ "linux/vhost.h", "VHOST_SET_BACKEND_FEATURES", _IOC_WRITE, 0xaf25, 0x08 },
+{ "linux/vhost.h", "VHOST_SET_FEATURES", _IOC_WRITE, 0xaf00, 0x08 },
+{ "linux/vhost.h", "VHOST_SET_LOG_BASE", _IOC_WRITE, 0xaf04, 0x08 },
+{ "linux/vhost.h", "VHOST_SET_LOG_FD", _IOC_WRITE, 0xaf07, 0x04 },
+{ "linux/vhost.h", "VHOST_SET_MEM_TABLE", _IOC_WRITE, 0xaf03, 0x08 },
+{ "linux/vhost.h", "VHOST_SET_OWNER", _IOC_NONE, 0xaf01, 0x00 },
+{ "linux/vhost.h", "VHOST_SET_VRING_ADDR", _IOC_WRITE, 0xaf11, 0x28 },
+{ "linux/vhost.h", "VHOST_SET_VRING_BASE", _IOC_WRITE, 0xaf12, 0x08 },
+{ "linux/vhost.h", "VHOST_SET_VRING_BUSYLOOP_TIMEOUT", _IOC_WRITE, 0xaf23, 0x08 },
+{ "linux/vhost.h", "VHOST_SET_VRING_CALL", _IOC_WRITE, 0xaf21, 0x08 },
+{ "linux/vhost.h", "VHOST_SET_VRING_ENDIAN", _IOC_WRITE, 0xaf13, 0x08 },
+{ "linux/vhost.h", "VHOST_SET_VRING_ERR", _IOC_WRITE, 0xaf22, 0x08 },
+{ "linux/vhost.h", "VHOST_SET_VRING_KICK", _IOC_WRITE, 0xaf20, 0x08 },
+{ "linux/vhost.h", "VHOST_SET_VRING_NUM", _IOC_WRITE, 0xaf10, 0x08 },
+{ "linux/vhost.h", "VHOST_VDPA_GET_CONFIG", _IOC_READ, 0xaf73, 0x08 },
+{ "linux/vhost.h", "VHOST_VDPA_GET_DEVICE_ID", _IOC_READ, 0xaf70, 0x04 },
+{ "linux/vhost.h", "VHOST_VDPA_GET_IOVA_RANGE", _IOC_READ, 0xaf78, 0x10 },
+{ "linux/vhost.h", "VHOST_VDPA_GET_STATUS", _IOC_READ, 0xaf71, 0x01 },
+{ "linux/vhost.h", "VHOST_VDPA_GET_VRING_NUM", _IOC_READ, 0xaf76, 0x02 },
+{ "linux/vhost.h", "VHOST_VDPA_SET_CONFIG", _IOC_WRITE, 0xaf74, 0x08 },
+{ "linux/vhost.h", "VHOST_VDPA_SET_CONFIG_CALL", _IOC_WRITE, 0xaf77, 0x04 },
+{ "linux/vhost.h", "VHOST_VDPA_SET_STATUS", _IOC_WRITE, 0xaf72, 0x01 },
+{ "linux/vhost.h", "VHOST_VDPA_SET_VRING_ENABLE", _IOC_WRITE, 0xaf75, 0x08 },
+{ "linux/vhost.h", "VHOST_VSOCK_SET_GUEST_CID", _IOC_WRITE, 0xaf60, 0x08 },
+{ "linux/vhost.h", "VHOST_VSOCK_SET_RUNNING", _IOC_WRITE, 0xaf61, 0x04 },
+{ "linux/videodev2.h", "VIDIOC_CREATE_BUFS", _IOC_READ|_IOC_WRITE, 0x565c, 0xf8 },
+{ "linux/videodev2.h", "VIDIOC_CROPCAP", _IOC_READ|_IOC_WRITE, 0x563a, 0x2c },
+{ "linux/videodev2.h", "VIDIOC_DBG_G_CHIP_INFO", _IOC_READ|_IOC_WRITE, 0x5666, 0xc8 },
+{ "linux/videodev2.h", "VIDIOC_DBG_G_REGISTER", _IOC_READ|_IOC_WRITE, 0x5650, 0x38 },
+{ "linux/videodev2.h", "VIDIOC_DBG_S_REGISTER", _IOC_WRITE, 0x564f, 0x38 },
+{ "linux/videodev2.h", "VIDIOC_DECODER_CMD", _IOC_READ|_IOC_WRITE, 0x5660, 0x48 },
+{ "linux/videodev2.h", "VIDIOC_DQBUF", _IOC_READ|_IOC_WRITE, 0x5611, 0x50 },
+{ "linux/videodev2.h", "VIDIOC_DQEVENT", _IOC_READ, 0x5659, 0x88 },
+{ "linux/videodev2.h", "VIDIOC_DV_TIMINGS_CAP", _IOC_READ|_IOC_WRITE, 0x5664, 0x90 },
+{ "linux/videodev2.h", "VIDIOC_ENCODER_CMD", _IOC_READ|_IOC_WRITE, 0x564d, 0x28 },
+{ "linux/videodev2.h", "VIDIOC_ENUMAUDIO", _IOC_READ|_IOC_WRITE, 0x5641, 0x34 },
+{ "linux/videodev2.h", "VIDIOC_ENUMAUDOUT", _IOC_READ|_IOC_WRITE, 0x5642, 0x34 },
+{ "linux/videodev2.h", "VIDIOC_ENUMINPUT", _IOC_READ|_IOC_WRITE, 0x561a, 0x50 },
+{ "linux/videodev2.h", "VIDIOC_ENUMOUTPUT", _IOC_READ|_IOC_WRITE, 0x5630, 0x48 },
+{ "linux/videodev2.h", "VIDIOC_ENUMSTD", _IOC_READ|_IOC_WRITE, 0x5619, 0x48 },
+{ "linux/videodev2.h", "VIDIOC_ENUM_DV_TIMINGS", _IOC_READ|_IOC_WRITE, 0x5662, 0x94 },
+{ "linux/videodev2.h", "VIDIOC_ENUM_FMT", _IOC_READ|_IOC_WRITE, 0x5602, 0x40 },
+{ "linux/videodev2.h", "VIDIOC_ENUM_FRAMEINTERVALS", _IOC_READ|_IOC_WRITE, 0x564b, 0x34 },
+{ "linux/videodev2.h", "VIDIOC_ENUM_FRAMESIZES", _IOC_READ|_IOC_WRITE, 0x564a, 0x2c },
+{ "linux/videodev2.h", "VIDIOC_ENUM_FREQ_BANDS", _IOC_READ|_IOC_WRITE, 0x5665, 0x40 },
+{ "linux/videodev2.h", "VIDIOC_EXPBUF", _IOC_READ|_IOC_WRITE, 0x5610, 0x40 },
+{ "linux/videodev2.h", "VIDIOC_G_AUDIO", _IOC_READ, 0x5621, 0x34 },
+{ "linux/videodev2.h", "VIDIOC_G_AUDOUT", _IOC_READ, 0x5631, 0x34 },
+{ "linux/videodev2.h", "VIDIOC_G_CROP", _IOC_READ|_IOC_WRITE, 0x563b, 0x14 },
+{ "linux/videodev2.h", "VIDIOC_G_CTRL", _IOC_READ|_IOC_WRITE, 0x561b, 0x08 },
+{ "linux/videodev2.h", "VIDIOC_G_DV_TIMINGS", _IOC_READ|_IOC_WRITE, 0x5658, 0x84 },
+{ "linux/videodev2.h", "VIDIOC_G_EDID", _IOC_READ|_IOC_WRITE, 0x5628, 0x24 },
+{ "linux/videodev2.h", "VIDIOC_G_ENC_INDEX", _IOC_READ, 0x564c, 0x818 },
+{ "linux/videodev2.h", "VIDIOC_G_EXT_CTRLS", _IOC_READ|_IOC_WRITE, 0x5647, 0x18 },
+{ "linux/videodev2.h", "VIDIOC_G_FBUF", _IOC_READ, 0x560a, 0x2c },
+{ "linux/videodev2.h", "VIDIOC_G_FMT", _IOC_READ|_IOC_WRITE, 0x5604, 0xcc },
+{ "linux/videodev2.h", "VIDIOC_G_FREQUENCY", _IOC_READ|_IOC_WRITE, 0x5638, 0x2c },
+{ "linux/videodev2.h", "VIDIOC_G_INPUT", _IOC_READ, 0x5626, 0x04 },
+{ "linux/videodev2.h", "VIDIOC_G_JPEGCOMP", _IOC_READ, 0x563d, 0x8c },
+{ "linux/videodev2.h", "VIDIOC_G_MODULATOR", _IOC_READ|_IOC_WRITE, 0x5636, 0x44 },
+{ "linux/videodev2.h", "VIDIOC_G_OUTPUT", _IOC_READ, 0x562e, 0x04 },
+{ "linux/videodev2.h", "VIDIOC_G_PARM", _IOC_READ|_IOC_WRITE, 0x5615, 0xcc },
+{ "linux/videodev2.h", "VIDIOC_G_PRIORITY", _IOC_READ, 0x5643, 0x04 },
+{ "linux/videodev2.h", "VIDIOC_G_SELECTION", _IOC_READ|_IOC_WRITE, 0x565e, 0x40 },
+{ "linux/videodev2.h", "VIDIOC_G_SLICED_VBI_CAP", _IOC_READ|_IOC_WRITE, 0x5645, 0x74 },
+{ "linux/videodev2.h", "VIDIOC_G_STD", _IOC_READ, 0x5617, 0x08 },
+{ "linux/videodev2.h", "VIDIOC_G_TUNER", _IOC_READ|_IOC_WRITE, 0x561d, 0x54 },
+{ "linux/videodev2.h", "VIDIOC_LOG_STATUS", _IOC_NONE, 0x5646, 0x00 },
+{ "linux/videodev2.h", "VIDIOC_OVERLAY", _IOC_WRITE, 0x560e, 0x04 },
+{ "linux/videodev2.h", "VIDIOC_PREPARE_BUF", _IOC_READ|_IOC_WRITE, 0x565d, 0x50 },
+{ "linux/videodev2.h", "VIDIOC_QBUF", _IOC_READ|_IOC_WRITE, 0x560f, 0x50 },
+{ "linux/videodev2.h", "VIDIOC_QUERYBUF", _IOC_READ|_IOC_WRITE, 0x5609, 0x50 },
+{ "linux/videodev2.h", "VIDIOC_QUERYCAP", _IOC_READ, 0x5600, 0x68 },
+{ "linux/videodev2.h", "VIDIOC_QUERYCTRL", _IOC_READ|_IOC_WRITE, 0x5624, 0x44 },
+{ "linux/videodev2.h", "VIDIOC_QUERYMENU", _IOC_READ|_IOC_WRITE, 0x5625, 0x2c },
+{ "linux/videodev2.h", "VIDIOC_QUERYSTD", _IOC_READ, 0x563f, 0x08 },
+{ "linux/videodev2.h", "VIDIOC_QUERY_DV_TIMINGS", _IOC_READ, 0x5663, 0x84 },
+{ "linux/videodev2.h", "VIDIOC_QUERY_EXT_CTRL", _IOC_READ|_IOC_WRITE, 0x5667, 0xe8 },
+{ "linux/videodev2.h", "VIDIOC_REQBUFS", _IOC_READ|_IOC_WRITE, 0x5608, 0x14 },
+{ "linux/videodev2.h", "VIDIOC_STREAMOFF", _IOC_WRITE, 0x5613, 0x04 },
+{ "linux/videodev2.h", "VIDIOC_STREAMON", _IOC_WRITE, 0x5612, 0x04 },
+{ "linux/videodev2.h", "VIDIOC_SUBSCRIBE_EVENT", _IOC_WRITE, 0x565a, 0x20 },
+{ "linux/videodev2.h", "VIDIOC_S_AUDIO", _IOC_WRITE, 0x5622, 0x34 },
+{ "linux/videodev2.h", "VIDIOC_S_AUDOUT", _IOC_WRITE, 0x5632, 0x34 },
+{ "linux/videodev2.h", "VIDIOC_S_CROP", _IOC_WRITE, 0x563c, 0x14 },
+{ "linux/videodev2.h", "VIDIOC_S_CTRL", _IOC_READ|_IOC_WRITE, 0x561c, 0x08 },
+{ "linux/videodev2.h", "VIDIOC_S_DV_TIMINGS", _IOC_READ|_IOC_WRITE, 0x5657, 0x84 },
+{ "linux/videodev2.h", "VIDIOC_S_EDID", _IOC_READ|_IOC_WRITE, 0x5629, 0x24 },
+{ "linux/videodev2.h", "VIDIOC_S_EXT_CTRLS", _IOC_READ|_IOC_WRITE, 0x5648, 0x18 },
+{ "linux/videodev2.h", "VIDIOC_S_FBUF", _IOC_WRITE, 0x560b, 0x2c },
+{ "linux/videodev2.h", "VIDIOC_S_FMT", _IOC_READ|_IOC_WRITE, 0x5605, 0xcc },
+{ "linux/videodev2.h", "VIDIOC_S_FREQUENCY", _IOC_WRITE, 0x5639, 0x2c },
+{ "linux/videodev2.h", "VIDIOC_S_HW_FREQ_SEEK", _IOC_WRITE, 0x5652, 0x30 },
+{ "linux/videodev2.h", "VIDIOC_S_INPUT", _IOC_READ|_IOC_WRITE, 0x5627, 0x04 },
+{ "linux/videodev2.h", "VIDIOC_S_JPEGCOMP", _IOC_WRITE, 0x563e, 0x8c },
+{ "linux/videodev2.h", "VIDIOC_S_MODULATOR", _IOC_WRITE, 0x5637, 0x44 },
+{ "linux/videodev2.h", "VIDIOC_S_OUTPUT", _IOC_READ|_IOC_WRITE, 0x562f, 0x04 },
+{ "linux/videodev2.h", "VIDIOC_S_PARM", _IOC_READ|_IOC_WRITE, 0x5616, 0xcc },
+{ "linux/videodev2.h", "VIDIOC_S_PRIORITY", _IOC_WRITE, 0x5644, 0x04 },
+{ "linux/videodev2.h", "VIDIOC_S_SELECTION", _IOC_READ|_IOC_WRITE, 0x565f, 0x40 },
+{ "linux/videodev2.h", "VIDIOC_S_STD", _IOC_WRITE, 0x5618, 0x08 },
+{ "linux/videodev2.h", "VIDIOC_S_TUNER", _IOC_WRITE, 0x561e, 0x54 },
+{ "linux/videodev2.h", "VIDIOC_TRY_DECODER_CMD", _IOC_READ|_IOC_WRITE, 0x5661, 0x48 },
+{ "linux/videodev2.h", "VIDIOC_TRY_ENCODER_CMD", _IOC_READ|_IOC_WRITE, 0x564e, 0x28 },
+{ "linux/videodev2.h", "VIDIOC_TRY_EXT_CTRLS", _IOC_READ|_IOC_WRITE, 0x5649, 0x18 },
+{ "linux/videodev2.h", "VIDIOC_TRY_FMT", _IOC_READ|_IOC_WRITE, 0x5640, 0xcc },
+{ "linux/videodev2.h", "VIDIOC_UNSUBSCRIBE_EVENT", _IOC_WRITE, 0x565b, 0x20 },
+{ "linux/vm_sockets.h", "IOCTL_VM_SOCKETS_GET_LOCAL_CID", _IOC_NONE, 0x07b9, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_CTX_ADD_NOTIFICATION", _IOC_NONE, 0x07af, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_CTX_GET_CPT_STATE", _IOC_NONE, 0x07b1, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_CTX_REMOVE_NOTIFICATION", _IOC_NONE, 0x07b0, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_CTX_SET_CPT_STATE", _IOC_NONE, 0x07b2, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_DATAGRAM_RECEIVE", _IOC_NONE, 0x07ac, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_DATAGRAM_SEND", _IOC_NONE, 0x07ab, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_GET_CONTEXT_ID", _IOC_NONE, 0x07b3, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_INIT_CONTEXT", _IOC_NONE, 0x07a0, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_NOTIFICATIONS_RECEIVE", _IOC_NONE, 0x07a6, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_NOTIFY_RESOURCE", _IOC_NONE, 0x07a5, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_QUEUEPAIR_ALLOC", _IOC_NONE, 0x07a8, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_QUEUEPAIR_DETACH", _IOC_NONE, 0x07aa, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_QUEUEPAIR_SETPAGEFILE", _IOC_NONE, 0x07a9, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_QUEUEPAIR_SETVA", _IOC_NONE, 0x07a4, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_SET_NOTIFY", _IOC_NONE, 0x07cb, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_SOCKETS_GET_AF_VALUE", _IOC_NONE, 0x07b8, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_SOCKETS_GET_LOCAL_CID", _IOC_NONE, 0x07b9, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_SOCKETS_VERSION", _IOC_NONE, 0x07b4, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_VERSION", _IOC_NONE, 0x079f, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_VERSION2", _IOC_NONE, 0x07a7, 0x00 },
+{ "linux/vt.h", "VT_ACTIVATE", 0, 0x5606, 0 },
+{ "linux/vt.h", "VT_DISALLOCATE", 0, 0x5608, 0 },
+{ "linux/vt.h", "VT_GETHIFONTMASK", 0, 0x560D, 0 },
+{ "linux/vt.h", "VT_GETMODE", 0, 0x5601, 0 },
+{ "linux/vt.h", "VT_GETSTATE", 0, 0x5603, 0 },
+{ "linux/vt.h", "VT_LOCKSWITCH", 0, 0x560B, 0 },
+{ "linux/vt.h", "VT_OPENQRY", 0, 0x5600, 0 },
+{ "linux/vt.h", "VT_RELDISP", 0, 0x5605, 0 },
+{ "linux/vt.h", "VT_RESIZE", 0, 0x5609, 0 },
+{ "linux/vt.h", "VT_RESIZEX", 0, 0x560A, 0 },
+{ "linux/vt.h", "VT_SENDSIG", 0, 0x5604, 0 },
+{ "linux/vt.h", "VT_SETACTIVATE", 0, 0x560F, 0 },
+{ "linux/vt.h", "VT_SETMODE", 0, 0x5602, 0 },
+{ "linux/vt.h", "VT_UNLOCKSWITCH", 0, 0x560C, 0 },
+{ "linux/vt.h", "VT_WAITACTIVE", 0, 0x5607, 0 },
+{ "linux/vt.h", "VT_WAITEVENT", 0, 0x560E, 0 },
+{ "linux/vtpm_proxy.h", "VTPM_PROXY_IOC_NEW_DEV", _IOC_READ|_IOC_WRITE, 0xa100, 0x14 },
+{ "linux/watch_queue.h", "IOC_WATCH_QUEUE_SET_FILTER", _IOC_NONE, 0x5761, 0x00 },
+{ "linux/watch_queue.h", "IOC_WATCH_QUEUE_SET_SIZE", _IOC_NONE, 0x5760, 0x00 },
+{ "linux/watchdog.h", "WDIOC_GETBOOTSTATUS", _IOC_READ, 0x5702, 0x04 },
+{ "linux/watchdog.h", "WDIOC_GETPRETIMEOUT", _IOC_READ, 0x5709, 0x04 },
+{ "linux/watchdog.h", "WDIOC_GETSTATUS", _IOC_READ, 0x5701, 0x04 },
+{ "linux/watchdog.h", "WDIOC_GETSUPPORT", _IOC_READ, 0x5700, 0x28 },
+{ "linux/watchdog.h", "WDIOC_GETTEMP", _IOC_READ, 0x5703, 0x04 },
+{ "linux/watchdog.h", "WDIOC_GETTIMELEFT", _IOC_READ, 0x570a, 0x04 },
+{ "linux/watchdog.h", "WDIOC_GETTIMEOUT", _IOC_READ, 0x5707, 0x04 },
+{ "linux/watchdog.h", "WDIOC_KEEPALIVE", _IOC_READ, 0x5705, 0x04 },
+{ "linux/watchdog.h", "WDIOC_SETOPTIONS", _IOC_READ, 0x5704, 0x04 },
+{ "linux/watchdog.h", "WDIOC_SETPRETIMEOUT", _IOC_READ|_IOC_WRITE, 0x5708, 0x04 },
+{ "linux/watchdog.h", "WDIOC_SETTIMEOUT", _IOC_READ|_IOC_WRITE, 0x5706, 0x04 },
+{ "linux/wireless.h", "SIOCGIWAP", 0, 0x8B15, 0 },
+{ "linux/wireless.h", "SIOCGIWAPLIST", 0, 0x8B17, 0 },
+{ "linux/wireless.h", "SIOCGIWAUTH", 0, 0x8B33, 0 },
+{ "linux/wireless.h", "SIOCGIWENCODE", 0, 0x8B2B, 0 },
+{ "linux/wireless.h", "SIOCGIWENCODEEXT", 0, 0x8B35, 0 },
+{ "linux/wireless.h", "SIOCGIWESSID", 0, 0x8B1B, 0 },
+{ "linux/wireless.h", "SIOCGIWFRAG", 0, 0x8B25, 0 },
+{ "linux/wireless.h", "SIOCGIWFREQ", 0, 0x8B05, 0 },
+{ "linux/wireless.h", "SIOCGIWGENIE", 0, 0x8B31, 0 },
+{ "linux/wireless.h", "SIOCGIWMODE", 0, 0x8B07, 0 },
+{ "linux/wireless.h", "SIOCGIWNAME", 0, 0x8B01, 0 },
+{ "linux/wireless.h", "SIOCGIWNICKN", 0, 0x8B1D, 0 },
+{ "linux/wireless.h", "SIOCGIWNWID", 0, 0x8B03, 0 },
+{ "linux/wireless.h", "SIOCGIWPOWER", 0, 0x8B2D, 0 },
+{ "linux/wireless.h", "SIOCGIWPRIV", 0, 0x8B0D, 0 },
+{ "linux/wireless.h", "SIOCGIWRANGE", 0, 0x8B0B, 0 },
+{ "linux/wireless.h", "SIOCGIWRATE", 0, 0x8B21, 0 },
+{ "linux/wireless.h", "SIOCGIWRETRY", 0, 0x8B29, 0 },
+{ "linux/wireless.h", "SIOCGIWRTS", 0, 0x8B23, 0 },
+{ "linux/wireless.h", "SIOCGIWSCAN", 0, 0x8B19, 0 },
+{ "linux/wireless.h", "SIOCGIWSENS", 0, 0x8B09, 0 },
+{ "linux/wireless.h", "SIOCGIWSPY", 0, 0x8B11, 0 },
+{ "linux/wireless.h", "SIOCGIWSTATS", 0, 0x8B0F, 0 },
+{ "linux/wireless.h", "SIOCGIWTHRSPY", 0, 0x8B13, 0 },
+{ "linux/wireless.h", "SIOCGIWTXPOW", 0, 0x8B27, 0 },
+{ "linux/wireless.h", "SIOCIWFIRST", 0, 0x8B00, 0 },
+{ "linux/wireless.h", "SIOCIWFIRSTPRIV", 0, 0x8BE0, 0 },
+{ "linux/wireless.h", "SIOCIWLASTPRIV", 0, 0x8BFF, 0 },
+{ "linux/wireless.h", "SIOCSIWAP", 0, 0x8B14, 0 },
+{ "linux/wireless.h", "SIOCSIWAUTH", 0, 0x8B32, 0 },
+{ "linux/wireless.h", "SIOCSIWCOMMIT", 0, 0x8B00, 0 },
+{ "linux/wireless.h", "SIOCSIWENCODE", 0, 0x8B2A, 0 },
+{ "linux/wireless.h", "SIOCSIWENCODEEXT", 0, 0x8B34, 0 },
+{ "linux/wireless.h", "SIOCSIWESSID", 0, 0x8B1A, 0 },
+{ "linux/wireless.h", "SIOCSIWFRAG", 0, 0x8B24, 0 },
+{ "linux/wireless.h", "SIOCSIWFREQ", 0, 0x8B04, 0 },
+{ "linux/wireless.h", "SIOCSIWGENIE", 0, 0x8B30, 0 },
+{ "linux/wireless.h", "SIOCSIWMLME", 0, 0x8B16, 0 },
+{ "linux/wireless.h", "SIOCSIWMODE", 0, 0x8B06, 0 },
+{ "linux/wireless.h", "SIOCSIWNICKN", 0, 0x8B1C, 0 },
+{ "linux/wireless.h", "SIOCSIWNWID", 0, 0x8B02, 0 },
+{ "linux/wireless.h", "SIOCSIWPMKSA", 0, 0x8B36, 0 },
+{ "linux/wireless.h", "SIOCSIWPOWER", 0, 0x8B2C, 0 },
+{ "linux/wireless.h", "SIOCSIWPRIV", 0, 0x8B0C, 0 },
+{ "linux/wireless.h", "SIOCSIWRANGE", 0, 0x8B0A, 0 },
+{ "linux/wireless.h", "SIOCSIWRATE", 0, 0x8B20, 0 },
+{ "linux/wireless.h", "SIOCSIWRETRY", 0, 0x8B28, 0 },
+{ "linux/wireless.h", "SIOCSIWRTS", 0, 0x8B22, 0 },
+{ "linux/wireless.h", "SIOCSIWSCAN", 0, 0x8B18, 0 },
+{ "linux/wireless.h", "SIOCSIWSENS", 0, 0x8B08, 0 },
+{ "linux/wireless.h", "SIOCSIWSPY", 0, 0x8B10, 0 },
+{ "linux/wireless.h", "SIOCSIWSTATS", 0, 0x8B0E, 0 },
+{ "linux/wireless.h", "SIOCSIWTHRSPY", 0, 0x8B12, 0 },
+{ "linux/wireless.h", "SIOCSIWTXPOW", 0, 0x8B26, 0 },
+{ "linux/wmi.h", "DELL_WMI_SMBIOS_CMD", _IOC_READ|_IOC_WRITE, 0x5700, 0x34 },
+{ "media/drv-intf/exynos-fimc.h", "S5P_FIMC_TX_END_NOTIFY", _IOC_NONE, 0x6500, 0x00 },
+{ "media/i2c/adv7842.h", "ADV7842_CMD_RAM_TEST", _IOC_NONE, 0x56c0, 0x00 },
+{ "media/i2c/bt819.h", "BT819_FIFO_RESET_HIGH", _IOC_NONE, 0x6201, 0x00 },
+{ "media/i2c/bt819.h", "BT819_FIFO_RESET_LOW", _IOC_NONE, 0x6200, 0x00 },
+{ "media/i2c/saa6588.h", "SAA6588_CMD_CLOSE", _IOC_WRITE, 0x5202, 0x04 },
+{ "media/i2c/saa6588.h", "SAA6588_CMD_POLL", _IOC_READ, 0x5204, 0x04 },
+{ "media/i2c/saa6588.h", "SAA6588_CMD_READ", _IOC_READ, 0x5203, 0x04 },
+{ "media/v4l2-common.h", "TUNER_SET_CONFIG", _IOC_WRITE, 0x645c, 0x08 },
+{ "media/v4l2-common.h", "VIDIOC_INT_RESET", _IOC_WRITE, 0x6466, 0x04 },
+{ "media/v4l2-ioctl.h", "VIDIOC_DQBUF_TIME32", _IOC_READ|_IOC_WRITE, 0x5611, 0x44 },
+{ "media/v4l2-ioctl.h", "VIDIOC_DQEVENT_TIME32", _IOC_READ, 0x5659, 0x80 },
+{ "media/v4l2-ioctl.h", "VIDIOC_PREPARE_BUF_TIME32", _IOC_READ|_IOC_WRITE, 0x565d, 0x44 },
+{ "media/v4l2-ioctl.h", "VIDIOC_QBUF_TIME32", _IOC_READ|_IOC_WRITE, 0x560f, 0x44 },
+{ "media/v4l2-ioctl.h", "VIDIOC_QUERYBUF_TIME32", _IOC_READ|_IOC_WRITE, 0x5609, 0x44 },
+{ "media/v4l2-subdev.h", "V4L2_DEVICE_NOTIFY_EVENT", _IOC_WRITE, 0x7602, 0x88 },
+{ "media/v4l2-subdev.h", "V4L2_SUBDEV_IR_RX_NOTIFY", _IOC_WRITE, 0x7600, 0x04 },
+{ "media/v4l2-subdev.h", "V4L2_SUBDEV_IR_TX_NOTIFY", _IOC_WRITE, 0x7601, 0x04 },
+{ "misc/cxl.h", "CXL_IOCTL_DOWNLOAD_IMAGE", _IOC_WRITE, 0xca0a, 0x40 },
+{ "misc/cxl.h", "CXL_IOCTL_GET_AFU_ID", _IOC_READ, 0xca02, 0x40 },
+{ "misc/cxl.h", "CXL_IOCTL_GET_PROCESS_ELEMENT", _IOC_READ, 0xca01, 0x04 },
+{ "misc/cxl.h", "CXL_IOCTL_START_WORK", _IOC_WRITE, 0xca00, 0x40 },
+{ "misc/cxl.h", "CXL_IOCTL_VALIDATE_IMAGE", _IOC_WRITE, 0xca0b, 0x40 },
+{ "misc/fastrpc.h", "FASTRPC_IOCTL_ALLOC_DMA_BUFF", _IOC_READ|_IOC_WRITE, 0x5201, 0x10 },
+{ "misc/fastrpc.h", "FASTRPC_IOCTL_FREE_DMA_BUFF", _IOC_READ|_IOC_WRITE, 0x5202, 0x04 },
+{ "misc/fastrpc.h", "FASTRPC_IOCTL_INIT_ATTACH", _IOC_NONE, 0x5204, 0x00 },
+{ "misc/fastrpc.h", "FASTRPC_IOCTL_INIT_ATTACH_SNS", _IOC_NONE, 0x5208, 0x00 },
+{ "misc/fastrpc.h", "FASTRPC_IOCTL_INIT_CREATE", _IOC_READ|_IOC_WRITE, 0x5205, 0x18 },
+{ "misc/fastrpc.h", "FASTRPC_IOCTL_INVOKE", _IOC_READ|_IOC_WRITE, 0x5203, 0x10 },
+{ "misc/fastrpc.h", "FASTRPC_IOCTL_MMAP", _IOC_READ|_IOC_WRITE, 0x5206, 0x20 },
+{ "misc/fastrpc.h", "FASTRPC_IOCTL_MUNMAP", _IOC_READ|_IOC_WRITE, 0x5207, 0x10 },
+{ "misc/habanalabs.h", "HL_IOCTL_CB", _IOC_READ|_IOC_WRITE, 0x4802, 0x18 },
+{ "misc/habanalabs.h", "HL_IOCTL_CS", _IOC_READ|_IOC_WRITE, 0x4803, 0x30 },
+{ "misc/habanalabs.h", "HL_IOCTL_DEBUG", _IOC_READ|_IOC_WRITE, 0x4806, 0x28 },
+{ "misc/habanalabs.h", "HL_IOCTL_INFO", _IOC_READ|_IOC_WRITE, 0x4801, 0x18 },
+{ "misc/habanalabs.h", "HL_IOCTL_MEMORY", _IOC_READ|_IOC_WRITE, 0x4805, 0x28 },
+{ "misc/habanalabs.h", "HL_IOCTL_WAIT_CS", _IOC_READ|_IOC_WRITE, 0x4804, 0x18 },
+{ "misc/ocxl.h", "OCXL_IOCTL_ATTACH", _IOC_WRITE, 0xca10, 0x20 },
+{ "misc/ocxl.h", "OCXL_IOCTL_ENABLE_P9_WAIT", _IOC_READ, 0xca15, 0x20 },
+{ "misc/ocxl.h", "OCXL_IOCTL_GET_FEATURES", _IOC_READ, 0xca16, 0x20 },
+{ "misc/ocxl.h", "OCXL_IOCTL_GET_METADATA", _IOC_READ, 0xca14, 0x80 },
+{ "misc/ocxl.h", "OCXL_IOCTL_IRQ_ALLOC", _IOC_READ, 0xca11, 0x08 },
+{ "misc/ocxl.h", "OCXL_IOCTL_IRQ_FREE", _IOC_WRITE, 0xca12, 0x08 },
+{ "misc/ocxl.h", "OCXL_IOCTL_IRQ_SET_FD", _IOC_WRITE, 0xca13, 0x10 },
+{ "misc/uacce/hisi_qm.h", "UACCE_CMD_QM_SET_QP_CTX", _IOC_READ|_IOC_WRITE, 0x480a, 0x04 },
+{ "misc/uacce/uacce.h", "UACCE_CMD_PUT_Q", _IOC_NONE, 0x5701, 0x00 },
+{ "misc/uacce/uacce.h", "UACCE_CMD_START_Q", _IOC_NONE, 0x5700, 0x00 },
+{ "misc/xilinx_sdfec.h", "XSDFEC_ADD_LDPC_CODE_PARAMS", _IOC_WRITE, 0x6605, 0x4c },
+{ "misc/xilinx_sdfec.h", "XSDFEC_CLEAR_STATS", _IOC_NONE, 0x660b, 0x00 },
+{ "misc/xilinx_sdfec.h", "XSDFEC_GET_CONFIG", _IOC_READ, 0x6606, 0x1c },
+{ "misc/xilinx_sdfec.h", "XSDFEC_GET_STATS", _IOC_READ, 0x660c, 0x0c },
+{ "misc/xilinx_sdfec.h", "XSDFEC_GET_STATUS", _IOC_READ, 0x6602, 0x08 },
+{ "misc/xilinx_sdfec.h", "XSDFEC_GET_TURBO", _IOC_READ, 0x6607, 0x08 },
+{ "misc/xilinx_sdfec.h", "XSDFEC_IS_ACTIVE", _IOC_READ, 0x660a, 0x01 },
+{ "misc/xilinx_sdfec.h", "XSDFEC_SET_BYPASS", _IOC_WRITE, 0x6609, 0x01 },
+{ "misc/xilinx_sdfec.h", "XSDFEC_SET_DEFAULT_CONFIG", _IOC_NONE, 0x660d, 0x00 },
+{ "misc/xilinx_sdfec.h", "XSDFEC_SET_IRQ", _IOC_WRITE, 0x6603, 0x02 },
+{ "misc/xilinx_sdfec.h", "XSDFEC_SET_ORDER", _IOC_WRITE, 0x6608, 0x04 },
+{ "misc/xilinx_sdfec.h", "XSDFEC_SET_TURBO", _IOC_WRITE, 0x6604, 0x08 },
+{ "misc/xilinx_sdfec.h", "XSDFEC_START_DEV", _IOC_NONE, 0x6600, 0x00 },
+{ "misc/xilinx_sdfec.h", "XSDFEC_STOP_DEV", _IOC_NONE, 0x6601, 0x00 },
+{ "mtd/mtd-abi.h", "ECCGETLAYOUT", _IOC_READ, 0x4d11, 0x148 },
+{ "mtd/mtd-abi.h", "ECCGETSTATS", _IOC_READ, 0x4d12, 0x10 },
+{ "mtd/mtd-abi.h", "MEMERASE", _IOC_WRITE, 0x4d02, 0x08 },
+{ "mtd/mtd-abi.h", "MEMERASE64", _IOC_WRITE, 0x4d14, 0x10 },
+{ "mtd/mtd-abi.h", "MEMGETBADBLOCK", _IOC_WRITE, 0x4d0b, 0x08 },
+{ "mtd/mtd-abi.h", "MEMGETINFO", _IOC_READ, 0x4d01, 0x20 },
+{ "mtd/mtd-abi.h", "MEMGETOOBSEL", _IOC_READ, 0x4d0a, 0xc8 },
+{ "mtd/mtd-abi.h", "MEMGETREGIONCOUNT", _IOC_READ, 0x4d07, 0x04 },
+{ "mtd/mtd-abi.h", "MEMGETREGIONINFO", _IOC_READ|_IOC_WRITE, 0x4d08, 0x10 },
+{ "mtd/mtd-abi.h", "MEMISLOCKED", _IOC_READ, 0x4d17, 0x08 },
+{ "mtd/mtd-abi.h", "MEMLOCK", _IOC_WRITE, 0x4d05, 0x08 },
+{ "mtd/mtd-abi.h", "MEMREADOOB", _IOC_READ|_IOC_WRITE, 0x4d04, 0x0c },
+{ "mtd/mtd-abi.h", "MEMREADOOB64", _IOC_READ|_IOC_WRITE, 0x4d16, 0x18 },
+{ "mtd/mtd-abi.h", "MEMSETBADBLOCK", _IOC_WRITE, 0x4d0c, 0x08 },
+{ "mtd/mtd-abi.h", "MEMUNLOCK", _IOC_WRITE, 0x4d06, 0x08 },
+{ "mtd/mtd-abi.h", "MEMWRITE", _IOC_READ|_IOC_WRITE, 0x4d18, 0x30 },
+{ "mtd/mtd-abi.h", "MEMWRITEOOB", _IOC_READ|_IOC_WRITE, 0x4d03, 0x0c },
+{ "mtd/mtd-abi.h", "MEMWRITEOOB64", _IOC_READ|_IOC_WRITE, 0x4d15, 0x18 },
+{ "mtd/mtd-abi.h", "MTDFILEMODE", _IOC_NONE, 0x4d13, 0x00 },
+{ "mtd/mtd-abi.h", "OTPGETREGIONCOUNT", _IOC_WRITE, 0x4d0e, 0x04 },
+{ "mtd/mtd-abi.h", "OTPGETREGIONINFO", _IOC_WRITE, 0x4d0f, 0x0c },
+{ "mtd/mtd-abi.h", "OTPLOCK", _IOC_READ, 0x4d10, 0x0c },
+{ "mtd/mtd-abi.h", "OTPSELECT", _IOC_READ, 0x4d0d, 0x04 },
+{ "mtd/ubi-user.h", "UBI_IOCATT", _IOC_WRITE, 0x6f40, 0x18 },
+{ "mtd/ubi-user.h", "UBI_IOCDET", _IOC_WRITE, 0x6f41, 0x04 },
+{ "mtd/ubi-user.h", "UBI_IOCEBCH", _IOC_WRITE, 0x4f02, 0x04 },
+{ "mtd/ubi-user.h", "UBI_IOCEBER", _IOC_WRITE, 0x4f01, 0x04 },
+{ "mtd/ubi-user.h", "UBI_IOCEBISMAP", _IOC_READ, 0x4f05, 0x04 },
+{ "mtd/ubi-user.h", "UBI_IOCEBMAP", _IOC_WRITE, 0x4f03, 0x08 },
+{ "mtd/ubi-user.h", "UBI_IOCEBUNMAP", _IOC_WRITE, 0x4f04, 0x04 },
+{ "mtd/ubi-user.h", "UBI_IOCMKVOL", _IOC_WRITE, 0x6f00, 0x98 },
+{ "mtd/ubi-user.h", "UBI_IOCRMVOL", _IOC_WRITE, 0x6f01, 0x04 },
+{ "mtd/ubi-user.h", "UBI_IOCRNVOL", _IOC_WRITE, 0x6f03, 0x1110 },
+{ "mtd/ubi-user.h", "UBI_IOCRPEB", _IOC_WRITE, 0x6f04, 0x04 },
+{ "mtd/ubi-user.h", "UBI_IOCRSVOL", _IOC_WRITE, 0x6f02, 0x0c },
+{ "mtd/ubi-user.h", "UBI_IOCSETVOLPROP", _IOC_WRITE, 0x4f06, 0x10 },
+{ "mtd/ubi-user.h", "UBI_IOCSPEB", _IOC_WRITE, 0x6f05, 0x04 },
+{ "mtd/ubi-user.h", "UBI_IOCVOLCRBLK", _IOC_WRITE, 0x4f07, 0x80 },
+{ "mtd/ubi-user.h", "UBI_IOCVOLRMBLK", _IOC_NONE, 0x4f08, 0x00 },
+{ "mtd/ubi-user.h", "UBI_IOCVOLUP", _IOC_WRITE, 0x4f00, 0x08 },
+{ "net/bluetooth/hci_sock.h", "HCIBLOCKADDR", _IOC_WRITE, 0x48e6, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCIDEVDOWN", _IOC_WRITE, 0x48ca, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCIDEVRESET", _IOC_WRITE, 0x48cb, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCIDEVRESTAT", _IOC_WRITE, 0x48cc, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCIDEVUP", _IOC_WRITE, 0x48c9, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCIGETAUTHINFO", _IOC_READ, 0x48d7, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCIGETCONNINFO", _IOC_READ, 0x48d5, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCIGETCONNLIST", _IOC_READ, 0x48d4, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCIGETDEVINFO", _IOC_READ, 0x48d3, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCIGETDEVLIST", _IOC_READ, 0x48d2, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCIINQUIRY", _IOC_READ, 0x48f0, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCISETACLMTU", _IOC_WRITE, 0x48e3, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCISETAUTH", _IOC_WRITE, 0x48de, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCISETENCRYPT", _IOC_WRITE, 0x48df, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCISETLINKMODE", _IOC_WRITE, 0x48e2, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCISETLINKPOL", _IOC_WRITE, 0x48e1, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCISETPTYPE", _IOC_WRITE, 0x48e0, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCISETRAW", _IOC_WRITE, 0x48dc, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCISETSCAN", _IOC_WRITE, 0x48dd, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCISETSCOMTU", _IOC_WRITE, 0x48e4, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCIUNBLOCKADDR", _IOC_WRITE, 0x48e7, 0x04 },
+{ "net/bluetooth/rfcomm.h", "RFCOMMCREATEDEV", _IOC_WRITE, 0x52c8, 0x04 },
+{ "net/bluetooth/rfcomm.h", "RFCOMMGETDEVINFO", _IOC_READ, 0x52d3, 0x04 },
+{ "net/bluetooth/rfcomm.h", "RFCOMMGETDEVLIST", _IOC_READ, 0x52d2, 0x04 },
+{ "net/bluetooth/rfcomm.h", "RFCOMMRELEASEDEV", _IOC_WRITE, 0x52c9, 0x04 },
+{ "net/bluetooth/rfcomm.h", "RFCOMMSTEALDLC", _IOC_WRITE, 0x52dc, 0x04 },
+{ "net/nfc/nci_core.h", "NCIUARTSETDRIVER", _IOC_WRITE, 0x5500, 0x04 },
+{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_ACK_EVENT", _IOC_WRITE, 0x1bea, 0x04 },
+{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_ASSIGN_CTXT", _IOC_READ|_IOC_WRITE, 0x1be1, 0x1c },
+{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_CREDIT_UPD", _IOC_NONE, 0x1be6, 0x00 },
+{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_CTXT_INFO", _IOC_WRITE, 0x1be2, 0x28 },
+{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_CTXT_RESET", _IOC_NONE, 0x1bec, 0x00 },
+{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_GET_VERS", _IOC_READ, 0x1bee, 0x04 },
+{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_POLL_TYPE", _IOC_WRITE, 0x1be9, 0x04 },
+{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_RECV_CTRL", _IOC_WRITE, 0x1be8, 0x04 },
+{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_SET_PKEY", _IOC_WRITE, 0x1beb, 0x02 },
+{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_TID_FREE", _IOC_READ|_IOC_WRITE, 0x1be5, 0x18 },
+{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_TID_INVAL_READ", _IOC_READ|_IOC_WRITE, 0x1bed, 0x18 },
+{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_TID_UPDATE", _IOC_READ|_IOC_WRITE, 0x1be4, 0x18 },
+{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_USER_INFO", _IOC_WRITE, 0x1be3, 0x78 },
+{ "rdma/rdma_user_ioctl.h", "IB_USER_MAD_ENABLE_PKEY", _IOC_NONE, 0x1b03, 0x00 },
+{ "rdma/rdma_user_ioctl.h", "IB_USER_MAD_REGISTER_AGENT", _IOC_READ|_IOC_WRITE, 0x1b01, 0x1c },
+{ "rdma/rdma_user_ioctl.h", "IB_USER_MAD_REGISTER_AGENT2", _IOC_READ|_IOC_WRITE, 0x1b04, 0x28 },
+{ "rdma/rdma_user_ioctl.h", "IB_USER_MAD_UNREGISTER_AGENT", _IOC_WRITE, 0x1b02, 0x04 },
+{ "rdma/rdma_user_ioctl_cmds.h", "RDMA_VERBS_IOCTL", _IOC_READ|_IOC_WRITE, 0x1b01, 0x18 },
+{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_ATTACH", _IOC_READ|_IOC_WRITE, 0xca80, 0x90 },
+{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_DETACH", _IOC_READ|_IOC_WRITE, 0xca83, 0x60 },
+{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_MANAGE_LUN", _IOC_READ|_IOC_WRITE, 0xca86, 0x68 },
+{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_RECOVER_AFU", _IOC_READ|_IOC_WRITE, 0xca85, 0x78 },
+{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_RELEASE", _IOC_READ|_IOC_WRITE, 0xca82, 0x68 },
+{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_USER_DIRECT", _IOC_READ|_IOC_WRITE, 0xca81, 0x70 },
+{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_USER_VIRTUAL", _IOC_READ|_IOC_WRITE, 0xca87, 0x78 },
+{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_VERIFY", _IOC_READ|_IOC_WRITE, 0xca84, 0x90 },
+{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_VLUN_CLONE", _IOC_READ|_IOC_WRITE, 0xca89, 0x70 },
+{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_VLUN_RESIZE", _IOC_READ|_IOC_WRITE, 0xca88, 0x78 },
+{ "scsi/cxlflash_ioctl.h", "HT_CXLFLASH_AFU_DEBUG", _IOC_READ|_IOC_WRITE, 0xcabe, 0x78 },
+{ "scsi/cxlflash_ioctl.h", "HT_CXLFLASH_LUN_PROVISION", _IOC_READ|_IOC_WRITE, 0xcabf, 0xa0 },
+{ "scsi/scsi.h", "SCSI_IOCTL_GET_BUS_NUMBER", 0, 0x5386, 0 },
+{ "scsi/scsi.h", "SCSI_IOCTL_GET_IDLUN", 0, 0x5382, 0 },
+{ "scsi/scsi.h", "SCSI_IOCTL_GET_PCI", 0, 0x5387, 0 },
+{ "scsi/scsi.h", "SCSI_IOCTL_PROBE_HOST", 0, 0x5385, 0 },
+{ "scsi/scsi_ioctl.h", "SCSI_IOCTL_DOORLOCK", 0, 0x5380, 0 },
+{ "scsi/scsi_ioctl.h", "SCSI_IOCTL_DOORUNLOCK", 0, 0x5381, 0 },
+{ "scsi/sg.h", "SG_EMULATED_HOST", 0, 0x2203, 0 },
+{ "scsi/sg.h", "SG_GET_ACCESS_COUNT", 0, 0x2289, 0 },
+{ "scsi/sg.h", "SG_GET_COMMAND_Q", 0, 0x2270, 0 },
+{ "scsi/sg.h", "SG_GET_KEEP_ORPHAN", 0, 0x2288, 0 },
+{ "scsi/sg.h", "SG_GET_LOW_DMA", 0, 0x227a, 0 },
+{ "scsi/sg.h", "SG_GET_NUM_WAITING", 0, 0x227d, 0 },
+{ "scsi/sg.h", "SG_GET_PACK_ID", 0, 0x227c, 0 },
+{ "scsi/sg.h", "SG_GET_REQUEST_TABLE", 0, 0x2286, 0 },
+{ "scsi/sg.h", "SG_GET_RESERVED_SIZE", 0, 0x2272, 0 },
+{ "scsi/sg.h", "SG_GET_SCSI_ID", 0, 0x2276, 0 },
+{ "scsi/sg.h", "SG_GET_SG_TABLESIZE", 0, 0x227F, 0 },
+{ "scsi/sg.h", "SG_GET_TIMEOUT", 0, 0x2202, 0 },
+{ "scsi/sg.h", "SG_GET_TRANSFORM", 0, 0x2205, 0 },
+{ "scsi/sg.h", "SG_GET_VERSION_NUM", 0, 0x2282, 0 },
+{ "scsi/sg.h", "SG_IO", 0, 0x2285, 0 },
+{ "scsi/sg.h", "SG_NEXT_CMD_LEN", 0, 0x2283, 0 },
+{ "scsi/sg.h", "SG_SCSI_RESET", 0, 0x2284, 0 },
+{ "scsi/sg.h", "SG_SET_COMMAND_Q", 0, 0x2271, 0 },
+{ "scsi/sg.h", "SG_SET_DEBUG", 0, 0x227e, 0 },
+{ "scsi/sg.h", "SG_SET_FORCE_LOW_DMA", 0, 0x2279, 0 },
+{ "scsi/sg.h", "SG_SET_FORCE_PACK_ID", 0, 0x227b, 0 },
+{ "scsi/sg.h", "SG_SET_KEEP_ORPHAN", 0, 0x2287, 0 },
+{ "scsi/sg.h", "SG_SET_RESERVED_SIZE", 0, 0x2275, 0 },
+{ "scsi/sg.h", "SG_SET_TIMEOUT", 0, 0x2201, 0 },
+{ "scsi/sg.h", "SG_SET_TRANSFORM", 0, 0x2204, 0 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_CLIENT_ID", _IOC_READ, 0x5301, 0x04 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_CREATE_PORT", _IOC_READ|_IOC_WRITE, 0x5320, 0xa4 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_CREATE_QUEUE", _IOC_READ|_IOC_WRITE, 0x5332, 0x8c },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_DELETE_PORT", _IOC_WRITE, 0x5321, 0xa4 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_DELETE_QUEUE", _IOC_WRITE, 0x5333, 0x8c },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_CLIENT_INFO", _IOC_READ|_IOC_WRITE, 0x5310, 0xbc },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_CLIENT_POOL", _IOC_READ|_IOC_WRITE, 0x534b, 0x58 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_NAMED_QUEUE", _IOC_READ|_IOC_WRITE, 0x5336, 0x8c },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_PORT_INFO", _IOC_READ|_IOC_WRITE, 0x5322, 0xa4 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_QUEUE_CLIENT", _IOC_READ|_IOC_WRITE, 0x5349, 0x4c },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_QUEUE_INFO", _IOC_READ|_IOC_WRITE, 0x5334, 0x8c },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_QUEUE_STATUS", _IOC_READ|_IOC_WRITE, 0x5340, 0x5c },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_QUEUE_TEMPO", _IOC_READ|_IOC_WRITE, 0x5341, 0x2c },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_QUEUE_TIMER", _IOC_READ|_IOC_WRITE, 0x5345, 0x60 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_SUBSCRIPTION", _IOC_READ|_IOC_WRITE, 0x5350, 0x50 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_PVERSION", _IOC_READ, 0x5300, 0x04 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_QUERY_NEXT_CLIENT", _IOC_READ|_IOC_WRITE, 0x5351, 0xbc },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_QUERY_NEXT_PORT", _IOC_READ|_IOC_WRITE, 0x5352, 0xa4 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_QUERY_SUBS", _IOC_READ|_IOC_WRITE, 0x534f, 0x58 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_REMOVE_EVENTS", _IOC_WRITE, 0x534e, 0x40 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_RUNNING_MODE", _IOC_READ|_IOC_WRITE, 0x5303, 0x10 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SET_CLIENT_INFO", _IOC_WRITE, 0x5311, 0xbc },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SET_CLIENT_POOL", _IOC_WRITE, 0x534c, 0x58 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SET_PORT_INFO", _IOC_WRITE, 0x5323, 0xa4 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SET_QUEUE_CLIENT", _IOC_WRITE, 0x534a, 0x4c },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SET_QUEUE_INFO", _IOC_READ|_IOC_WRITE, 0x5335, 0x8c },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SET_QUEUE_TEMPO", _IOC_WRITE, 0x5342, 0x2c },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SET_QUEUE_TIMER", _IOC_WRITE, 0x5346, 0x60 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SUBSCRIBE_PORT", _IOC_WRITE, 0x5330, 0x50 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SYSTEM_INFO", _IOC_READ|_IOC_WRITE, 0x5302, 0x30 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_UNSUBSCRIBE_PORT", _IOC_WRITE, 0x5331, 0x50 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_CARD_INFO", _IOC_READ, 0x5501, 0x178 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_ADD", _IOC_READ|_IOC_WRITE, 0x5517, 0x110 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_INFO", _IOC_READ|_IOC_WRITE, 0x5511, 0x110 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_LIST", _IOC_READ|_IOC_WRITE, 0x5510, 0x48 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_LOCK", _IOC_WRITE, 0x5514, 0x40 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_READ", _IOC_READ|_IOC_WRITE, 0x5512, 0x2c8 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_REMOVE", _IOC_READ|_IOC_WRITE, 0x5519, 0x40 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_REPLACE", _IOC_READ|_IOC_WRITE, 0x5518, 0x110 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_UNLOCK", _IOC_WRITE, 0x5515, 0x40 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_WRITE", _IOC_READ|_IOC_WRITE, 0x5513, 0x2c8 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_HWDEP_INFO", _IOC_READ, 0x5521, 0xdc },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_HWDEP_NEXT_DEVICE", _IOC_READ|_IOC_WRITE, 0x5520, 0x04 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_PCM_INFO", _IOC_READ|_IOC_WRITE, 0x5531, 0x120 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_PCM_NEXT_DEVICE", _IOC_READ, 0x5530, 0x04 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_PCM_PREFER_SUBDEVICE", _IOC_WRITE, 0x5532, 0x04 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_POWER", _IOC_READ|_IOC_WRITE, 0x55d0, 0x04 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_POWER_STATE", _IOC_READ, 0x55d1, 0x04 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_PVERSION", _IOC_READ, 0x5500, 0x04 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_RAWMIDI_INFO", _IOC_READ|_IOC_WRITE, 0x5541, 0x10c },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_RAWMIDI_NEXT_DEVICE", _IOC_READ|_IOC_WRITE, 0x5540, 0x04 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_RAWMIDI_PREFER_SUBDEVICE", _IOC_WRITE, 0x5542, 0x04 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_SUBSCRIBE_EVENTS", _IOC_READ|_IOC_WRITE, 0x5516, 0x04 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_TLV_COMMAND", _IOC_READ|_IOC_WRITE, 0x551c, 0x08 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_TLV_READ", _IOC_READ|_IOC_WRITE, 0x551a, 0x08 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_TLV_WRITE", _IOC_READ|_IOC_WRITE, 0x551b, 0x08 },
+{ "sound/asound.h", "SNDRV_HWDEP_IOCTL_DSP_LOAD", _IOC_WRITE, 0x4803, 0x50 },
+{ "sound/asound.h", "SNDRV_HWDEP_IOCTL_DSP_STATUS", _IOC_READ, 0x4802, 0x40 },
+{ "sound/asound.h", "SNDRV_HWDEP_IOCTL_INFO", _IOC_READ, 0x4801, 0xdc },
+{ "sound/asound.h", "SNDRV_HWDEP_IOCTL_PVERSION", _IOC_READ, 0x4800, 0x04 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_CHANNEL_INFO", _IOC_READ, 0x4132, 0x10 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_DELAY", _IOC_READ, 0x4121, 0x04 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_DRAIN", _IOC_NONE, 0x4144, 0x00 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_DROP", _IOC_NONE, 0x4143, 0x00 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_FORWARD", _IOC_WRITE, 0x4149, 0x04 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_HWSYNC", _IOC_NONE, 0x4122, 0x00 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_HW_FREE", _IOC_NONE, 0x4112, 0x00 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_HW_PARAMS", _IOC_READ|_IOC_WRITE, 0x4111, 0x25c },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_HW_REFINE", _IOC_READ|_IOC_WRITE, 0x4110, 0x25c },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_INFO", _IOC_READ, 0x4101, 0x120 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_LINK", _IOC_WRITE, 0x4160, 0x04 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_PAUSE", _IOC_WRITE, 0x4145, 0x04 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_PREPARE", _IOC_NONE, 0x4140, 0x00 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_PVERSION", _IOC_READ, 0x4100, 0x04 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_READI_FRAMES", _IOC_READ, 0x4151, 0x0c },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_READN_FRAMES", _IOC_READ, 0x4153, 0x0c },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_RESET", _IOC_NONE, 0x4141, 0x00 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_RESUME", _IOC_NONE, 0x4147, 0x00 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_REWIND", _IOC_WRITE, 0x4146, 0x04 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_START", _IOC_NONE, 0x4142, 0x00 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_STATUS", _IOC_READ, 0x4120, 0x6c },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_STATUS_EXT", _IOC_READ|_IOC_WRITE, 0x4124, 0x6c },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_SW_PARAMS", _IOC_READ|_IOC_WRITE, 0x4113, 0x68 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_SYNC_PTR", _IOC_READ|_IOC_WRITE, 0x4123, 0x84 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_TSTAMP", _IOC_WRITE, 0x4102, 0x04 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_TTSTAMP", _IOC_WRITE, 0x4103, 0x04 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_UNLINK", _IOC_NONE, 0x4161, 0x00 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_USER_PVERSION", _IOC_WRITE, 0x4104, 0x04 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_WRITEI_FRAMES", _IOC_WRITE, 0x4150, 0x0c },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_WRITEN_FRAMES", _IOC_WRITE, 0x4152, 0x0c },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_XRUN", _IOC_NONE, 0x4148, 0x00 },
+{ "sound/asound.h", "SNDRV_RAWMIDI_IOCTL_DRAIN", _IOC_WRITE, 0x5731, 0x04 },
+{ "sound/asound.h", "SNDRV_RAWMIDI_IOCTL_DROP", _IOC_WRITE, 0x5730, 0x04 },
+{ "sound/asound.h", "SNDRV_RAWMIDI_IOCTL_INFO", _IOC_READ, 0x5701, 0x10c },
+{ "sound/asound.h", "SNDRV_RAWMIDI_IOCTL_PARAMS", _IOC_READ|_IOC_WRITE, 0x5710, 0x20 },
+{ "sound/asound.h", "SNDRV_RAWMIDI_IOCTL_PVERSION", _IOC_READ, 0x5700, 0x04 },
+{ "sound/asound.h", "SNDRV_RAWMIDI_IOCTL_STATUS", _IOC_READ|_IOC_WRITE, 0x5720, 0x24 },
+{ "sound/asound.h", "SNDRV_TIMER_IOCTL_CONTINUE", _IOC_NONE, 0x54a2, 0x00 },
+{ "sound/asound.h", "SNDRV_TIMER_IOCTL_GINFO", _IOC_READ|_IOC_WRITE, 0x5403, 0xe0 },
+{ "sound/asound.h", "SNDRV_TIMER_IOCTL_GPARAMS", _IOC_WRITE, 0x5404, 0x3c },
+{ "sound/asound.h", "SNDRV_TIMER_IOCTL_GSTATUS", _IOC_READ|_IOC_WRITE, 0x5405, 0x40 },
+{ "sound/asound.h", "SNDRV_TIMER_IOCTL_INFO", _IOC_READ, 0x5411, 0xe0 },
+{ "sound/asound.h", "SNDRV_TIMER_IOCTL_NEXT_DEVICE", _IOC_READ|_IOC_WRITE, 0x5401, 0x14 },
+{ "sound/asound.h", "SNDRV_TIMER_IOCTL_PARAMS", _IOC_WRITE, 0x5412, 0x50 },
+{ "sound/asound.h", "SNDRV_TIMER_IOCTL_PAUSE", _IOC_NONE, 0x54a3, 0x00 },
+{ "sound/asound.h", "SNDRV_TIMER_IOCTL_PVERSION", _IOC_READ, 0x5400, 0x04 },
+{ "sound/asound.h", "SNDRV_TIMER_IOCTL_SELECT", _IOC_WRITE, 0x5410, 0x34 },
+{ "sound/asound.h", "SNDRV_TIMER_IOCTL_START", _IOC_NONE, 0x54a0, 0x00 },
+{ "sound/asound.h", "SNDRV_TIMER_IOCTL_STATUS", _IOC_READ, 0x5414, 0x58 },
+{ "sound/asound.h", "SNDRV_TIMER_IOCTL_STOP", _IOC_NONE, 0x54a1, 0x00 },
+{ "sound/asound.h", "SNDRV_TIMER_IOCTL_TREAD64", _IOC_WRITE, 0x54a4, 0x04 },
+{ "sound/asound.h", "SNDRV_TIMER_IOCTL_TREAD_OLD", _IOC_WRITE, 0x5402, 0x04 },
+{ "sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_CLEAR_PATCHES", _IOC_NONE, 0x4840, 0x00 },
+{ "sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_INFO", _IOC_READ, 0x4820, 0x02 },
+{ "sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_PLAY_NOTE", _IOC_WRITE, 0x4822, 0x0c },
+{ "sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_RESET", _IOC_NONE, 0x4821, 0x00 },
+{ "sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_SET_CONNECTION", _IOC_WRITE, 0x4826, 0x04 },
+{ "sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_SET_MODE", _IOC_WRITE, 0x4825, 0x04 },
+{ "sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_SET_PARAMS", _IOC_WRITE, 0x4824, 0x09 },
+{ "sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_SET_VOICE", _IOC_WRITE, 0x4823, 0x12 },
+{ "sound/compress_offload.h", "SNDRV_COMPRESS_AVAIL", _IOC_READ, 0x4321, 0x1c },
+{ "sound/compress_offload.h", "SNDRV_COMPRESS_DRAIN", _IOC_NONE, 0x4334, 0x00 },
+{ "sound/compress_offload.h", "SNDRV_COMPRESS_GET_CAPS", _IOC_READ|_IOC_WRITE, 0x4310, 0xc4 },
+{ "sound/compress_offload.h", "SNDRV_COMPRESS_GET_CODEC_CAPS", _IOC_READ|_IOC_WRITE, 0x4311, 0x2b88 },
+{ "sound/compress_offload.h", "SNDRV_COMPRESS_GET_METADATA", _IOC_READ|_IOC_WRITE, 0x4315, 0x24 },
+{ "sound/compress_offload.h", "SNDRV_COMPRESS_GET_PARAMS", _IOC_READ, 0x4313, 0x78 },
+{ "sound/compress_offload.h", "SNDRV_COMPRESS_IOCTL_VERSION", _IOC_READ, 0x4300, 0x04 },
+{ "sound/compress_offload.h", "SNDRV_COMPRESS_NEXT_TRACK", _IOC_NONE, 0x4335, 0x00 },
+{ "sound/compress_offload.h", "SNDRV_COMPRESS_PARTIAL_DRAIN", _IOC_NONE, 0x4336, 0x00 },
+{ "sound/compress_offload.h", "SNDRV_COMPRESS_PAUSE", _IOC_NONE, 0x4330, 0x00 },
+{ "sound/compress_offload.h", "SNDRV_COMPRESS_RESUME", _IOC_NONE, 0x4331, 0x00 },
+{ "sound/compress_offload.h", "SNDRV_COMPRESS_SET_METADATA", _IOC_WRITE, 0x4314, 0x24 },
+{ "sound/compress_offload.h", "SNDRV_COMPRESS_SET_PARAMS", _IOC_WRITE, 0x4312, 0x84 },
+{ "sound/compress_offload.h", "SNDRV_COMPRESS_START", _IOC_NONE, 0x4332, 0x00 },
+{ "sound/compress_offload.h", "SNDRV_COMPRESS_STOP", _IOC_NONE, 0x4333, 0x00 },
+{ "sound/compress_offload.h", "SNDRV_COMPRESS_TSTAMP", _IOC_READ, 0x4320, 0x14 },
+{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_CODE_PEEK", _IOC_READ|_IOC_WRITE, 0x4812, 0x18c },
+{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_CODE_POKE", _IOC_WRITE, 0x4811, 0x18c },
+{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_CONTINUE", _IOC_NONE, 0x4881, 0x00 },
+{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_DBG_READ", _IOC_READ, 0x4884, 0x04 },
+{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_INFO", _IOC_READ, 0x4810, 0x80c },
+{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_PCM_PEEK", _IOC_READ|_IOC_WRITE, 0x4831, 0x48 },
+{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_PCM_POKE", _IOC_WRITE, 0x4830, 0x48 },
+{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_PVERSION", _IOC_READ, 0x4840, 0x04 },
+{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_SINGLE_STEP", _IOC_WRITE, 0x4883, 0x04 },
+{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_STOP", _IOC_NONE, 0x4880, 0x00 },
+{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_TRAM_PEEK", _IOC_READ|_IOC_WRITE, 0x4822, 0x0c },
+{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_TRAM_POKE", _IOC_WRITE, 0x4821, 0x0c },
+{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_TRAM_SETUP", _IOC_WRITE, 0x4820, 0x04 },
+{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_ZERO_TRAM_COUNTER", _IOC_NONE, 0x4882, 0x00 },
+{ "sound/firewire.h", "SNDRV_FIREWIRE_IOCTL_GET_INFO", _IOC_READ, 0x48f8, 0x20 },
+{ "sound/firewire.h", "SNDRV_FIREWIRE_IOCTL_LOCK", _IOC_NONE, 0x48f9, 0x00 },
+{ "sound/firewire.h", "SNDRV_FIREWIRE_IOCTL_TASCAM_STATE", _IOC_READ, 0x48fb, 0x100 },
+{ "sound/firewire.h", "SNDRV_FIREWIRE_IOCTL_UNLOCK", _IOC_NONE, 0x48fa, 0x00 },
+{ "sound/hda_hwdep.h", "HDA_IOCTL_GET_WCAP", _IOC_READ|_IOC_WRITE, 0x4812, 0x08 },
+{ "sound/hda_hwdep.h", "HDA_IOCTL_PVERSION", _IOC_READ, 0x4810, 0x04 },
+{ "sound/hda_hwdep.h", "HDA_IOCTL_VERB_WRITE", _IOC_READ|_IOC_WRITE, 0x4811, 0x08 },
+{ "sound/hdsp.h", "SNDRV_HDSP_IOCTL_GET_9632_AEB", _IOC_READ, 0x4845, 0x08 },
+{ "sound/hdsp.h", "SNDRV_HDSP_IOCTL_GET_CONFIG_INFO", _IOC_READ, 0x4841, 0x24 },
+{ "sound/hdsp.h", "SNDRV_HDSP_IOCTL_GET_MIXER", _IOC_READ, 0x4844, 0x1000 },
+{ "sound/hdsp.h", "SNDRV_HDSP_IOCTL_GET_PEAK_RMS", _IOC_READ, 0x4840, 0x3b0 },
+{ "sound/hdsp.h", "SNDRV_HDSP_IOCTL_GET_VERSION", _IOC_READ, 0x4843, 0x08 },
+{ "sound/hdsp.h", "SNDRV_HDSP_IOCTL_UPLOAD_FIRMWARE", _IOC_WRITE, 0x4842, 0x04 },
+{ "sound/hdspm.h", "SNDRV_HDSPM_IOCTL_GET_CONFIG", _IOC_READ, 0x4841, 0x18 },
+{ "sound/hdspm.h", "SNDRV_HDSPM_IOCTL_GET_LTC", _IOC_READ, 0x4846, 0x10 },
+{ "sound/hdspm.h", "SNDRV_HDSPM_IOCTL_GET_MIXER", _IOC_READ, 0x4844, 0x04 },
+{ "sound/hdspm.h", "SNDRV_HDSPM_IOCTL_GET_PEAK_RMS", _IOC_READ, 0x4842, 0x908 },
+{ "sound/hdspm.h", "SNDRV_HDSPM_IOCTL_GET_STATUS", _IOC_READ, 0x4847, 0x20 },
+{ "sound/hdspm.h", "SNDRV_HDSPM_IOCTL_GET_VERSION", _IOC_READ, 0x4848, 0x24 },
+{ "sound/pcm.h", "SNDRV_PCM_IOCTL_STATUS32", _IOC_READ, 0x4120, 0x6c },
+{ "sound/pcm.h", "SNDRV_PCM_IOCTL_STATUS64", _IOC_READ, 0x4120, 0x80 },
+{ "sound/pcm.h", "SNDRV_PCM_IOCTL_STATUS_EXT32", _IOC_READ|_IOC_WRITE, 0x4124, 0x6c },
+{ "sound/pcm.h", "SNDRV_PCM_IOCTL_STATUS_EXT64", _IOC_READ|_IOC_WRITE, 0x4124, 0x80 },
+{ "sound/sb16_csp.h", "SNDRV_SB_CSP_IOCTL_INFO", _IOC_READ, 0x4810, 0x28 },
+{ "sound/sb16_csp.h", "SNDRV_SB_CSP_IOCTL_LOAD_CODE", _IOC_WRITE, 0x4811, 0x3012 },
+{ "sound/sb16_csp.h", "SNDRV_SB_CSP_IOCTL_PAUSE", _IOC_NONE, 0x4815, 0x00 },
+{ "sound/sb16_csp.h", "SNDRV_SB_CSP_IOCTL_RESTART", _IOC_NONE, 0x4816, 0x00 },
+{ "sound/sb16_csp.h", "SNDRV_SB_CSP_IOCTL_START", _IOC_WRITE, 0x4813, 0x08 },
+{ "sound/sb16_csp.h", "SNDRV_SB_CSP_IOCTL_STOP", _IOC_NONE, 0x4814, 0x00 },
+{ "sound/sb16_csp.h", "SNDRV_SB_CSP_IOCTL_UNLOAD_CODE", _IOC_NONE, 0x4812, 0x00 },
+{ "sound/sfnt_info.h", "SNDRV_EMUX_IOCTL_LOAD_PATCH", _IOC_READ|_IOC_WRITE, 0x4881, 0x10 },
+{ "sound/sfnt_info.h", "SNDRV_EMUX_IOCTL_MEM_AVAIL", _IOC_WRITE, 0x4884, 0x04 },
+{ "sound/sfnt_info.h", "SNDRV_EMUX_IOCTL_MISC_MODE", _IOC_READ|_IOC_WRITE, 0x4884, 0x10 },
+{ "sound/sfnt_info.h", "SNDRV_EMUX_IOCTL_REMOVE_LAST_SAMPLES", _IOC_NONE, 0x4883, 0x00 },
+{ "sound/sfnt_info.h", "SNDRV_EMUX_IOCTL_RESET_SAMPLES", _IOC_NONE, 0x4882, 0x00 },
+{ "sound/sfnt_info.h", "SNDRV_EMUX_IOCTL_VERSION", _IOC_READ, 0x4880, 0x04 },
+{ "sound/usb_stream.h", "SNDRV_USB_STREAM_IOCTL_SET_PARAMS", _IOC_WRITE, 0x4890, 0x10 },
+{ "staging/android/ashmem.h", "ASHMEM_GET_NAME", _IOC_READ, 0x7702, 0x100 },
+{ "staging/android/ashmem.h", "ASHMEM_GET_PIN_STATUS", _IOC_NONE, 0x7709, 0x00 },
+{ "staging/android/ashmem.h", "ASHMEM_GET_PROT_MASK", _IOC_NONE, 0x7706, 0x00 },
+{ "staging/android/ashmem.h", "ASHMEM_GET_SIZE", _IOC_NONE, 0x7704, 0x00 },
+{ "staging/android/ashmem.h", "ASHMEM_PIN", _IOC_WRITE, 0x7707, 0x08 },
+{ "staging/android/ashmem.h", "ASHMEM_PURGE_ALL_CACHES", _IOC_NONE, 0x770a, 0x00 },
+{ "staging/android/ashmem.h", "ASHMEM_SET_NAME", _IOC_WRITE, 0x7701, 0x100 },
+{ "staging/android/ashmem.h", "ASHMEM_SET_PROT_MASK", _IOC_WRITE, 0x7705, 0x04 },
+{ "staging/android/ashmem.h", "ASHMEM_SET_SIZE", _IOC_WRITE, 0x7703, 0x04 },
+{ "staging/android/ashmem.h", "ASHMEM_UNPIN", _IOC_WRITE, 0x7708, 0x08 },
+{ "staging/android/ion.h", "ION_IOC_ALLOC", _IOC_READ|_IOC_WRITE, 0x4900, 0x18 },
+{ "staging/android/ion.h", "ION_IOC_HEAP_QUERY", _IOC_READ|_IOC_WRITE, 0x4908, 0x18 },
+{ "video/da8xx-fb.h", "FBIGET_BRIGHTNESS", _IOC_READ, 0x4603, 0x04 },
+{ "video/da8xx-fb.h", "FBIGET_COLOR", _IOC_READ, 0x4605, 0x04 },
+{ "video/da8xx-fb.h", "FBIOGET_CONTRAST", _IOC_READ, 0x4601, 0x04 },
+{ "video/da8xx-fb.h", "FBIOPUT_CONTRAST", _IOC_WRITE, 0x4602, 0x04 },
+{ "video/da8xx-fb.h", "FBIPUT_BRIGHTNESS", _IOC_WRITE, 0x4603, 0x04 },
+{ "video/da8xx-fb.h", "FBIPUT_COLOR", _IOC_WRITE, 0x4606, 0x04 },
+{ "video/da8xx-fb.h", "FBIPUT_HSYNC", _IOC_WRITE, 0x4609, 0x04 },
+{ "video/da8xx-fb.h", "FBIPUT_VSYNC", _IOC_WRITE, 0x460a, 0x04 },
+{ "video/kyro.h", "KYRO_IOCTL_OVERLAY_CREATE", _IOC_NONE, 0x6b00, 0x00 },
+{ "video/kyro.h", "KYRO_IOCTL_OVERLAY_OFFSET", _IOC_NONE, 0x6b04, 0x00 },
+{ "video/kyro.h", "KYRO_IOCTL_OVERLAY_VIEWPORT_SET", _IOC_NONE, 0x6b01, 0x00 },
+{ "video/kyro.h", "KYRO_IOCTL_SET_VIDEO_MODE", _IOC_NONE, 0x6b02, 0x00 },
+{ "video/kyro.h", "KYRO_IOCTL_STRIDE", _IOC_NONE, 0x6b05, 0x00 },
+{ "video/kyro.h", "KYRO_IOCTL_UVSTRIDE", _IOC_NONE, 0x6b03, 0x00 },
+{ "video/sisfb.h", "SISFB_COMMAND", _IOC_READ|_IOC_WRITE, 0xf305, 0x54 },
+{ "video/sisfb.h", "SISFB_GET_AUTOMAXIMIZE", _IOC_READ, 0xf303, 0x04 },
+{ "video/sisfb.h", "SISFB_GET_AUTOMAXIMIZE_OLD", _IOC_READ, 0x6efa, 0x04 },
+{ "video/sisfb.h", "SISFB_GET_INFO", _IOC_READ, 0xf301, 0x11c },
+{ "video/sisfb.h", "SISFB_GET_INFO_OLD", _IOC_READ, 0x6ef8, 0x04 },
+{ "video/sisfb.h", "SISFB_GET_INFO_SIZE", _IOC_READ, 0xf300, 0x04 },
+{ "video/sisfb.h", "SISFB_GET_TVPOSOFFSET", _IOC_READ, 0xf304, 0x04 },
+{ "video/sisfb.h", "SISFB_GET_VBRSTATUS", _IOC_READ, 0xf302, 0x04 },
+{ "video/sisfb.h", "SISFB_GET_VBRSTATUS_OLD", _IOC_READ, 0x6ef9, 0x04 },
+{ "video/sisfb.h", "SISFB_SET_AUTOMAXIMIZE", _IOC_WRITE, 0xf303, 0x04 },
+{ "video/sisfb.h", "SISFB_SET_AUTOMAXIMIZE_OLD", _IOC_WRITE, 0x6efa, 0x04 },
+{ "video/sisfb.h", "SISFB_SET_LOCK", _IOC_WRITE, 0xf306, 0x04 },
+{ "video/sisfb.h", "SISFB_SET_TVPOSOFFSET", _IOC_WRITE, 0xf304, 0x04 },
+{ "video/sstfb.h", "SSTFB_GET_VGAPASS", _IOC_READ, 0x46dd, 0x04 },
+{ "video/sstfb.h", "SSTFB_SET_VGAPASS", _IOC_WRITE, 0x46dd, 0x04 },
+{ "xen/evtchn.h", "IOCTL_EVTCHN_BIND_INTERDOMAIN", _IOC_NONE, 0x4501, 0x08 },
+{ "xen/evtchn.h", "IOCTL_EVTCHN_BIND_UNBOUND_PORT", _IOC_NONE, 0x4502, 0x04 },
+{ "xen/evtchn.h", "IOCTL_EVTCHN_BIND_VIRQ", _IOC_NONE, 0x4500, 0x04 },
+{ "xen/evtchn.h", "IOCTL_EVTCHN_NOTIFY", _IOC_NONE, 0x4504, 0x04 },
+{ "xen/evtchn.h", "IOCTL_EVTCHN_RESET", _IOC_NONE, 0x4505, 0x00 },
+{ "xen/evtchn.h", "IOCTL_EVTCHN_RESTRICT_DOMID", _IOC_NONE, 0x4506, 0x02 },
+{ "xen/evtchn.h", "IOCTL_EVTCHN_UNBIND", _IOC_NONE, 0x4503, 0x04 },
+{ "xen/gntdev.h", "IOCTL_GNTDEV_DMABUF_EXP_FROM_REFS", _IOC_NONE, 0x4709, 0x14 },
+{ "xen/gntdev.h", "IOCTL_GNTDEV_DMABUF_EXP_WAIT_RELEASED", _IOC_NONE, 0x470a, 0x08 },
+{ "xen/gntdev.h", "IOCTL_GNTDEV_DMABUF_IMP_RELEASE", _IOC_NONE, 0x470c, 0x08 },
+{ "xen/gntdev.h", "IOCTL_GNTDEV_DMABUF_IMP_TO_REFS", _IOC_NONE, 0x470b, 0x14 },
+{ "xen/gntdev.h", "IOCTL_GNTDEV_GET_OFFSET_FOR_VADDR", _IOC_NONE, 0x4702, 0x18 },
+{ "xen/gntdev.h", "IOCTL_GNTDEV_GRANT_COPY", _IOC_NONE, 0x4708, 0x08 },
+{ "xen/gntdev.h", "IOCTL_GNTDEV_MAP_GRANT_REF", _IOC_NONE, 0x4700, 0x18 },
+{ "xen/gntdev.h", "IOCTL_GNTDEV_SET_MAX_GRANTS", _IOC_NONE, 0x4703, 0x04 },
+{ "xen/gntdev.h", "IOCTL_GNTDEV_SET_UNMAP_NOTIFY", _IOC_NONE, 0x4707, 0x10 },
+{ "xen/gntdev.h", "IOCTL_GNTDEV_UNMAP_GRANT_REF", _IOC_NONE, 0x4701, 0x10 },
+{ "xen/xenbus_dev.h", "IOCTL_XENBUS_BACKEND_EVTCHN", _IOC_NONE, 0x4200, 0x00 },
+{ "xen/xenbus_dev.h", "IOCTL_XENBUS_BACKEND_SETUP", _IOC_NONE, 0x4201, 0x00 },
diff --git a/src/linux/32/syscallent-time32.h b/src/linux/32/syscallent-time32.h
new file mode 100644
index 000000000..5f9d0e448
--- /dev/null
+++ b/src/linux/32/syscallent-time32.h
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+[ 4] = { 5, 0, SEN(io_getevents_time32), "io_getevents" },
+[ 72] = { 6, TD, SEN(pselect6_time32), "pselect6" },
+[ 73] = { 5, TD, SEN(ppoll_time32), "ppoll" },
+[ 86] = { 4, TD, SEN(timerfd_settime32), "timerfd_settime" },
+[ 87] = { 2, TD, SEN(timerfd_gettime32), "timerfd_gettime" },
+[ 88] = { 4, TD|TF, SEN(utimensat_time32), "utimensat" },
+[ 98] = { 6, 0, SEN(futex_time32), "futex" },
+[101] = { 2, 0, SEN(nanosleep_time32), "nanosleep" },
+[108] = { 2, 0, SEN(timer_gettime32), "timer_gettime" },
+[110] = { 4, 0, SEN(timer_settime32), "timer_settime" },
+[112] = { 2, TCL, SEN(clock_settime32), "clock_settime" },
+[113] = { 2, TCL, SEN(clock_gettime32), "clock_gettime" },
+[114] = { 2, TCL, SEN(clock_getres_time32), "clock_getres" },
+[115] = { 4, 0, SEN(clock_nanosleep_time32), "clock_nanosleep" },
+[127] = { 2, 0, SEN(sched_rr_get_interval_time32),"sched_rr_get_interval"},
+[137] = { 4, TS, SEN(rt_sigtimedwait_time32), "rt_sigtimedwait" },
+[169] = { 2, TCL, SEN(gettimeofday), "gettimeofday" },
+[170] = { 2, TCL, SEN(settimeofday), "settimeofday" },
+[171] = { 1, TCL, SEN(adjtimex32), "adjtimex" },
+[182] = { 5, TD, SEN(mq_timedsend_time32), "mq_timedsend" },
+[183] = { 5, TD, SEN(mq_timedreceive_time32), "mq_timedreceive" },
+[192] = { 4, TI, SEN(semtimedop_time32), "semtimedop" },
+[243] = { 5, TN, SEN(recvmmsg_time32), "recvmmsg" },
+[260] = { 4, TP, SEN(wait4), "wait4" },
+[266] = { 2, TCL, SEN(clock_adjtime32), "clock_adjtime" },
+[292] = { 6, 0, SEN(io_pgetevents_time32), "io_pgetevents" },
diff --git a/src/linux/32/syscallent.h b/src/linux/32/syscallent.h
new file mode 100644
index 000000000..b31e2e503
--- /dev/null
+++ b/src/linux/32/syscallent.h
@@ -0,0 +1,303 @@
+/*
+ * Copyright (c) 2015-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef sys_ARCH_mmap
+# define sys_ARCH_mmap sys_mmap
+#endif
+[ 0] = { 2, TM, SEN(io_setup), "io_setup" },
+[ 1] = { 1, TM, SEN(io_destroy), "io_destroy" },
+[ 2] = { 3, 0, SEN(io_submit), "io_submit" },
+[ 3] = { 3, 0, SEN(io_cancel), "io_cancel" },
+/* [ 4] io_getevents */
+[ 5] = { 5, TF, SEN(setxattr), "setxattr" },
+[ 6] = { 5, TF, SEN(setxattr), "lsetxattr" },
+[ 7] = { 5, TD, SEN(fsetxattr), "fsetxattr" },
+[ 8] = { 4, TF, SEN(getxattr), "getxattr" },
+[ 9] = { 4, TF, SEN(getxattr), "lgetxattr" },
+[ 10] = { 4, TD, SEN(fgetxattr), "fgetxattr" },
+[ 11] = { 3, TF, SEN(listxattr), "listxattr" },
+[ 12] = { 3, TF, SEN(listxattr), "llistxattr" },
+[ 13] = { 3, TD, SEN(flistxattr), "flistxattr" },
+[ 14] = { 2, TF, SEN(removexattr), "removexattr" },
+[ 15] = { 2, TF, SEN(removexattr), "lremovexattr" },
+[ 16] = { 2, TD, SEN(fremovexattr), "fremovexattr" },
+[ 17] = { 2, TF, SEN(getcwd), "getcwd" },
+[ 18] = { 4, 0, SEN(lookup_dcookie), "lookup_dcookie" },
+[ 19] = { 2, TD, SEN(eventfd2), "eventfd2" },
+[ 20] = { 1, TD, SEN(epoll_create1), "epoll_create1" },
+[ 21] = { 4, TD, SEN(epoll_ctl), "epoll_ctl" },
+[ 22] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" },
+[ 23] = { 1, TD, SEN(dup), "dup" },
+[ 24] = { 3, TD, SEN(dup3), "dup3" },
+[ 25] = { 3, TD, SEN(fcntl64), "fcntl64" },
+[ 26] = { 1, TD, SEN(inotify_init1), "inotify_init1" },
+[ 27] = { 3, TD|TF, SEN(inotify_add_watch), "inotify_add_watch" },
+[ 28] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" },
+[ 29] = { 3, TD, SEN(ioctl), "ioctl" },
+[ 30] = { 3, 0, SEN(ioprio_set), "ioprio_set" },
+[ 31] = { 2, 0, SEN(ioprio_get), "ioprio_get" },
+[ 32] = { 2, TD, SEN(flock), "flock" },
+[ 33] = { 4, TD|TF, SEN(mknodat), "mknodat" },
+[ 34] = { 3, TD|TF, SEN(mkdirat), "mkdirat" },
+[ 35] = { 3, TD|TF, SEN(unlinkat), "unlinkat" },
+[ 36] = { 3, TD|TF, SEN(symlinkat), "symlinkat" },
+[ 37] = { 5, TD|TF, SEN(linkat), "linkat" },
+[ 38] = { 4, TD|TF, SEN(renameat), "renameat" },
+[ 39] = { 2, TF, SEN(umount2), "umount2" },
+[ 40] = { 5, TF, SEN(mount), "mount" },
+[ 41] = { 2, TF, SEN(pivotroot), "pivot_root" },
+[ 42] = { 3, 0, SEN(nfsservctl), "nfsservctl" },
+[ 43] = { 3, TF|TSF|TSFA, SEN(statfs64), "statfs64" },
+[ 44] = { 3, TD|TFSF|TSFA, SEN(fstatfs64), "fstatfs64" },
+[ 45] = { 3, TF, SEN(truncate64), "truncate64" },
+[ 46] = { 3, TD, SEN(ftruncate64), "ftruncate64" },
+[ 47] = { 6, TD, SEN(fallocate), "fallocate" },
+[ 48] = { 3, TD|TF, SEN(faccessat), "faccessat" },
+[ 49] = { 1, TF, SEN(chdir), "chdir" },
+[ 50] = { 1, TD, SEN(fchdir), "fchdir" },
+[ 51] = { 1, TF, SEN(chroot), "chroot" },
+[ 52] = { 2, TD, SEN(fchmod), "fchmod" },
+[ 53] = { 3, TD|TF, SEN(fchmodat), "fchmodat" },
+[ 54] = { 5, TD|TF, SEN(fchownat), "fchownat" },
+[ 55] = { 3, TD, SEN(fchown), "fchown" },
+[ 56] = { 4, TD|TF, SEN(openat), "openat" },
+[ 57] = { 1, TD, SEN(close), "close" },
+[ 58] = { 0, 0, SEN(vhangup), "vhangup" },
+[ 59] = { 2, TD, SEN(pipe2), "pipe2" },
+[ 60] = { 4, TF, SEN(quotactl), "quotactl" },
+[ 61] = { 3, TD, SEN(getdents64), "getdents64" },
+[ 62] = { 5, TD, SEN(llseek), "_llseek" },
+[ 63] = { 3, TD, SEN(read), "read" },
+[ 64] = { 3, TD, SEN(write), "write" },
+[ 65] = { 3, TD, SEN(readv), "readv" },
+[ 66] = { 3, TD, SEN(writev), "writev" },
+[ 67] = { 5, TD, SEN(pread), "pread64" },
+[ 68] = { 5, TD, SEN(pwrite), "pwrite64" },
+[ 69] = { 5, TD, SEN(preadv), "preadv" },
+[ 70] = { 5, TD, SEN(pwritev), "pwritev" },
+[ 71] = { 4, TD|TN, SEN(sendfile64), "sendfile64" },
+/* [ 72] pselect6 */
+/* [ 73] ppoll */
+[ 74] = { 4, TD|TS, SEN(signalfd4), "signalfd4" },
+[ 75] = { 4, TD, SEN(vmsplice), "vmsplice" },
+[ 76] = { 6, TD, SEN(splice), "splice" },
+[ 77] = { 4, TD, SEN(tee), "tee" },
+[ 78] = { 4, TD|TF, SEN(readlinkat), "readlinkat" },
+[ 79] = { 4, TD|TF|TFST|TSTA,SEN(fstatat64), "fstatat64" },
+[ 80] = { 2, TD|TFST|TSTA, SEN(fstat64), "fstat64" },
+[ 81] = { 0, 0, SEN(sync), "sync" },
+[ 82] = { 1, TD, SEN(fsync), "fsync" },
+[ 83] = { 1, TD, SEN(fdatasync), "fdatasync" },
+#ifdef ARCH_WANT_SYNC_FILE_RANGE2
+[ 84] = { 6, TD, SEN(sync_file_range2), "sync_file_range2" },
+#else
+[ 84] = { 6, TD, SEN(sync_file_range), "sync_file_range" },
+#endif
+[ 85] = { 2, TD, SEN(timerfd_create), "timerfd_create" },
+/* [ 86] timerfd_settime */
+/* [ 87] timerfd_gettime */
+/* [ 88] utimensat */
+[ 89] = { 1, TF, SEN(acct), "acct" },
+[ 90] = { 2, TC, SEN(capget), "capget" },
+[ 91] = { 2, TC, SEN(capset), "capset" },
+[ 92] = { 1, NF, SEN(personality), "personality" },
+[ 93] = { 1, TP|SE, SEN(exit), "exit" },
+[ 94] = { 1, TP|SE, SEN(exit), "exit_group" },
+[ 95] = { 5, TP, SEN(waitid), "waitid" },
+[ 96] = { 1, 0, SEN(set_tid_address), "set_tid_address" },
+[ 97] = { 1, 0, SEN(unshare), "unshare" },
+/* [ 98] futex */
+[ 99] = { 2, 0, SEN(set_robust_list), "set_robust_list" },
+[100] = { 3, 0, SEN(get_robust_list), "get_robust_list" },
+/* [101] nanosleep */
+[102] = { 2, 0, SEN(getitimer), "getitimer" },
+[103] = { 3, 0, SEN(setitimer), "setitimer" },
+[104] = { 4, 0, SEN(kexec_load), "kexec_load" },
+[105] = { 3, 0, SEN(init_module), "init_module" },
+[106] = { 2, 0, SEN(delete_module), "delete_module" },
+[107] = { 3, 0, SEN(timer_create), "timer_create" },
+/* [108] timer_gettime */
+[109] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" },
+/* [110] timer_settime */
+[111] = { 1, 0, SEN(timer_delete), "timer_delete" },
+/* [112] clock_settime */
+/* [113] clock_gettime */
+/* [114] clock_getres */
+/* [115] clock_nanosleep */
+[116] = { 3, 0, SEN(syslog), "syslog" },
+[117] = { 4, 0, SEN(ptrace), "ptrace" },
+[118] = { 2, 0, SEN(sched_setparam), "sched_setparam" },
+[119] = { 3, 0, SEN(sched_setscheduler), "sched_setscheduler" },
+[120] = { 1, 0, SEN(sched_getscheduler), "sched_getscheduler" },
+[121] = { 2, 0, SEN(sched_getparam), "sched_getparam" },
+[122] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" },
+[123] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" },
+[124] = { 0, 0, SEN(sched_yield), "sched_yield" },
+[125] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"},
+[126] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"},
+/* [127] sched_rr_get_interval */
+[128] = { 0, 0, SEN(restart_syscall), "restart_syscall" },
+[129] = { 2, TS|TP, SEN(kill), "kill" },
+[130] = { 2, TS|TP, SEN(tkill), "tkill" },
+[131] = { 3, TS|TP, SEN(tgkill), "tgkill" },
+[132] = { 2, TS, SEN(sigaltstack), "sigaltstack" },
+[133] = { 2, TS, SEN(rt_sigsuspend), "rt_sigsuspend" },
+[134] = { 4, TS, SEN(rt_sigaction), "rt_sigaction" },
+[135] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" },
+[136] = { 2, TS, SEN(rt_sigpending), "rt_sigpending" },
+/* [137] rt_sigtimedwait */
+[138] = { 3, TS|TP, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" },
+[139] = { 0, TS, SEN(rt_sigreturn), "rt_sigreturn" },
+[140] = { 3, 0, SEN(setpriority), "setpriority" },
+[141] = { 2, 0, SEN(getpriority), "getpriority" },
+[142] = { 4, 0, SEN(reboot), "reboot" },
+[143] = { 2, TC, SEN(setregid), "setregid" },
+[144] = { 1, TC, SEN(setgid), "setgid" },
+[145] = { 2, TC, SEN(setreuid), "setreuid" },
+[146] = { 1, TC, SEN(setuid), "setuid" },
+[147] = { 3, TC, SEN(setresuid), "setresuid" },
+[148] = { 3, TC, SEN(getresuid), "getresuid" },
+[149] = { 3, TC, SEN(setresgid), "setresgid" },
+[150] = { 3, TC, SEN(getresgid), "getresgid" },
+[151] = { 1, TC|NF, SEN(setfsuid), "setfsuid" },
+[152] = { 1, TC|NF, SEN(setfsgid), "setfsgid" },
+[153] = { 1, 0, SEN(times), "times" },
+[154] = { 2, 0, SEN(setpgid), "setpgid" },
+[155] = { 1, 0, SEN(getpgid), "getpgid" },
+[156] = { 1, 0, SEN(getsid), "getsid" },
+[157] = { 0, 0, SEN(setsid), "setsid" },
+[158] = { 2, TC, SEN(getgroups), "getgroups" },
+[159] = { 2, TC, SEN(setgroups), "setgroups" },
+[160] = { 1, 0, SEN(uname), "uname" },
+[161] = { 2, 0, SEN(sethostname), "sethostname" },
+[162] = { 2, 0, SEN(setdomainname), "setdomainname" },
+[163] = { 2, 0, SEN(getrlimit), "getrlimit" },
+[164] = { 2, 0, SEN(setrlimit), "setrlimit" },
+[165] = { 2, 0, SEN(getrusage), "getrusage" },
+[166] = { 1, NF, SEN(umask), "umask" },
+[167] = { 5, TC, SEN(prctl), "prctl" },
+[168] = { 3, 0, SEN(getcpu), "getcpu" },
+/* [169] gettimeofday */
+/* [170] settimeofday */
+/* [171] adjtimex */
+[172] = { 0, PU|NF, SEN(getpid), "getpid" },
+[173] = { 0, PU|NF, SEN(getppid), "getppid" },
+[174] = { 0, TC|PU|NF, SEN(getuid), "getuid" },
+[175] = { 0, TC|PU|NF, SEN(geteuid), "geteuid" },
+[176] = { 0, TC|PU|NF, SEN(getgid), "getgid" },
+[177] = { 0, TC|PU|NF, SEN(getegid), "getegid" },
+[178] = { 0, PU|NF, SEN(gettid), "gettid" },
+[179] = { 1, 0, SEN(sysinfo), "sysinfo" },
+[180] = { 4, TD, SEN(mq_open), "mq_open" },
+[181] = { 1, 0, SEN(mq_unlink), "mq_unlink" },
+/* [182] mq_timedsend */
+/* [183] mq_timedreceive */
+[184] = { 2, TD, SEN(mq_notify), "mq_notify" },
+[185] = { 3, TD, SEN(mq_getsetattr), "mq_getsetattr" },
+[186] = { 2, TI, SEN(msgget), "msgget" },
+[187] = { 3, TI, SEN(msgctl), "msgctl" },
+[188] = { 5, TI, SEN(msgrcv), "msgrcv" },
+[189] = { 4, TI, SEN(msgsnd), "msgsnd" },
+[190] = { 3, TI, SEN(semget), "semget" },
+[191] = { 4, TI, SEN(semctl), "semctl" },
+/* [192] semtimedop */
+[193] = { 3, TI, SEN(semop), "semop" },
+[194] = { 3, TI, SEN(shmget), "shmget" },
+[195] = { 3, TI, SEN(shmctl), "shmctl" },
+[196] = { 3, TI|TM|SI, SEN(shmat), "shmat" },
+[197] = { 1, TI|TM|SI, SEN(shmdt), "shmdt" },
+[198] = { 3, TN, SEN(socket), "socket" },
+[199] = { 4, TN, SEN(socketpair), "socketpair" },
+[200] = { 3, TN, SEN(bind), "bind" },
+[201] = { 2, TN, SEN(listen), "listen" },
+[202] = { 3, TN, SEN(accept), "accept" },
+[203] = { 3, TN, SEN(connect), "connect" },
+[204] = { 3, TN, SEN(getsockname), "getsockname" },
+[205] = { 3, TN, SEN(getpeername), "getpeername" },
+[206] = { 6, TN, SEN(sendto), "sendto" },
+[207] = { 6, TN, SEN(recvfrom), "recvfrom" },
+[208] = { 5, TN, SEN(setsockopt), "setsockopt" },
+[209] = { 5, TN, SEN(getsockopt), "getsockopt" },
+[210] = { 2, TN, SEN(shutdown), "shutdown" },
+[211] = { 3, TN, SEN(sendmsg), "sendmsg" },
+[212] = { 3, TN, SEN(recvmsg), "recvmsg" },
+[213] = { 4, TD, SEN(readahead), "readahead" },
+[214] = { 1, TM|SI, SEN(brk), "brk" },
+[215] = { 2, TM|SI, SEN(munmap), "munmap" },
+[216] = { 5, TM|SI, SEN(mremap), "mremap" },
+[217] = { 5, 0, SEN(add_key), "add_key" },
+[218] = { 4, 0, SEN(request_key), "request_key" },
+[219] = { 5, 0, SEN(keyctl), "keyctl" },
+[220] = { 5, TP, SEN(clone), "clone" },
+[221] = { 3, TF|TP|TSD|SE|SI, SEN(execve), "execve" },
+[222] = { 6, TD|TM|SI, SEN(ARCH_mmap), "mmap2" },
+[223] = { 6, TD, SEN(fadvise64_64), "fadvise64_64" },
+[224] = { 2, TF, SEN(swapon), "swapon" },
+[225] = { 1, TF, SEN(swapoff), "swapoff" },
+[226] = { 3, TM|SI, SEN(mprotect), "mprotect" },
+[227] = { 3, TM, SEN(msync), "msync" },
+[228] = { 2, TM, SEN(mlock), "mlock" },
+[229] = { 2, TM, SEN(munlock), "munlock" },
+[230] = { 1, TM, SEN(mlockall), "mlockall" },
+[231] = { 0, TM, SEN(munlockall), "munlockall" },
+[232] = { 3, TM, SEN(mincore), "mincore" },
+[233] = { 3, TM, SEN(madvise), "madvise" },
+[234] = { 5, TM|SI, SEN(remap_file_pages), "remap_file_pages" },
+[235] = { 6, TM, SEN(mbind), "mbind" },
+[236] = { 5, TM, SEN(get_mempolicy), "get_mempolicy" },
+[237] = { 3, TM, SEN(set_mempolicy), "set_mempolicy" },
+[238] = { 4, TM, SEN(migrate_pages), "migrate_pages" },
+[239] = { 6, TM, SEN(move_pages), "move_pages" },
+[240] = { 4, TP|TS, SEN(rt_tgsigqueueinfo), "rt_tgsigqueueinfo" },
+[241] = { 5, TD, SEN(perf_event_open), "perf_event_open" },
+[242] = { 4, TN, SEN(accept4), "accept4" },
+/* [243] recvmmsg */
+/* [244 ... 259] are arch specific */
+/* [260] wait4 */
+[261] = { 4, 0, SEN(prlimit64), "prlimit64" },
+[262] = { 2, TD, SEN(fanotify_init), "fanotify_init" },
+[263] = { 6, TD|TF, SEN(fanotify_mark), "fanotify_mark" },
+[264] = { 5, TD|TF, SEN(name_to_handle_at), "name_to_handle_at" },
+[265] = { 3, TD, SEN(open_by_handle_at), "open_by_handle_at" },
+/* [266] clock_adjtime */
+[267] = { 1, TD, SEN(syncfs), "syncfs" },
+[268] = { 2, TD, SEN(setns), "setns" },
+[269] = { 4, TN, SEN(sendmmsg), "sendmmsg" },
+[270] = { 6, 0, SEN(process_vm_readv), "process_vm_readv" },
+[271] = { 6, 0, SEN(process_vm_writev), "process_vm_writev" },
+[272] = { 5, 0, SEN(kcmp), "kcmp" },
+[273] = { 3, TD, SEN(finit_module), "finit_module" },
+[274] = { 3, 0, SEN(sched_setattr), "sched_setattr" },
+[275] = { 4, 0, SEN(sched_getattr), "sched_getattr" },
+[276] = { 5, TD|TF, SEN(renameat2), "renameat2" },
+[277] = { 3, 0, SEN(seccomp), "seccomp" },
+[278] = { 3, 0, SEN(getrandom), "getrandom" },
+[279] = { 2, TD, SEN(memfd_create), "memfd_create" },
+[280] = { 3, TD, SEN(bpf), "bpf" },
+[281] = { 5, TD|TF|TP|TSD|SE|SI, SEN(execveat), "execveat" },
+[282] = { 1, TD, SEN(userfaultfd), "userfaultfd" },
+[283] = { 3, 0, SEN(membarrier), "membarrier" },
+[284] = { 3, TM, SEN(mlock2), "mlock2" },
+[285] = { 6, TD, SEN(copy_file_range), "copy_file_range" },
+[286] = { 6, TD, SEN(preadv2), "preadv2" },
+[287] = { 6, TD, SEN(pwritev2), "pwritev2" },
+[288] = { 4, TM|SI, SEN(pkey_mprotect), "pkey_mprotect" },
+[289] = { 2, 0, SEN(pkey_alloc), "pkey_alloc" },
+[290] = { 1, 0, SEN(pkey_free), "pkey_free" },
+[291] = { 5, TD|TF|TFST|TSTA,SEN(statx), "statx" },
+/* [292] io_pgetevents */
+[293] = { 4, 0, SEN(rseq), "rseq" },
+[294] = { 5, TD, SEN(kexec_file_load), "kexec_file_load" },
+#if HAVE_ARCH_TIME32_SYSCALLS
+# include "32/syscallent-time32.h"
+#endif
+/* [295 ... 402] - reserved to sync up with other architectures */
+#include "syscallent-common-32.h"
+#include "syscallent-common.h"
+
+#undef sys_ARCH_mmap
+#undef ARCH_WANT_SYNC_FILE_RANGE2
diff --git a/src/linux/64/ioctls_inc.h b/src/linux/64/ioctls_inc.h
new file mode 100644
index 000000000..e144ca028
--- /dev/null
+++ b/src/linux/64/ioctls_inc.h
@@ -0,0 +1,2927 @@
+/* Generated by ioctls_gen.sh from definitions found in $linux/include/ tree. */
+{ "acpi/apei.h", "APEI_ERST_CLEAR_RECORD", _IOC_WRITE, 0x4501, 0x08 },
+{ "acpi/apei.h", "APEI_ERST_GET_RECORD_COUNT", _IOC_READ, 0x4502, 0x04 },
+{ "asm-generic/ioctls.h", "FIOASYNC", 0, 0x5452, 0 },
+{ "asm-generic/ioctls.h", "FIOCLEX", 0, 0x5451, 0 },
+{ "asm-generic/ioctls.h", "FIONBIO", 0, 0x5421, 0 },
+{ "asm-generic/ioctls.h", "FIONCLEX", 0, 0x5450, 0 },
+{ "asm-generic/ioctls.h", "FIONREAD", 0, 0x541B, 0 },
+{ "asm-generic/ioctls.h", "FIOQSIZE", 0, 0x5460, 0 },
+{ "asm-generic/ioctls.h", "TCFLSH", 0, 0x540B, 0 },
+{ "asm-generic/ioctls.h", "TCGETA", 0, 0x5405, 0 },
+{ "asm-generic/ioctls.h", "TCGETS", 0, 0x5401, 0 },
+{ "asm-generic/ioctls.h", "TCGETS2", _IOC_READ, 0x542a, 0x2c },
+{ "asm-generic/ioctls.h", "TCGETX", 0, 0x5432, 0 },
+{ "asm-generic/ioctls.h", "TCSBRK", 0, 0x5409, 0 },
+{ "asm-generic/ioctls.h", "TCSBRKP", 0, 0x5425, 0 },
+{ "asm-generic/ioctls.h", "TCSETA", 0, 0x5406, 0 },
+{ "asm-generic/ioctls.h", "TCSETAF", 0, 0x5408, 0 },
+{ "asm-generic/ioctls.h", "TCSETAW", 0, 0x5407, 0 },
+{ "asm-generic/ioctls.h", "TCSETS", 0, 0x5402, 0 },
+{ "asm-generic/ioctls.h", "TCSETS2", _IOC_WRITE, 0x542b, 0x2c },
+{ "asm-generic/ioctls.h", "TCSETSF", 0, 0x5404, 0 },
+{ "asm-generic/ioctls.h", "TCSETSF2", _IOC_WRITE, 0x542d, 0x2c },
+{ "asm-generic/ioctls.h", "TCSETSW", 0, 0x5403, 0 },
+{ "asm-generic/ioctls.h", "TCSETSW2", _IOC_WRITE, 0x542c, 0x2c },
+{ "asm-generic/ioctls.h", "TCSETX", 0, 0x5433, 0 },
+{ "asm-generic/ioctls.h", "TCSETXF", 0, 0x5434, 0 },
+{ "asm-generic/ioctls.h", "TCSETXW", 0, 0x5435, 0 },
+{ "asm-generic/ioctls.h", "TCXONC", 0, 0x540A, 0 },
+{ "asm-generic/ioctls.h", "TIOCCBRK", 0, 0x5428, 0 },
+{ "asm-generic/ioctls.h", "TIOCCONS", 0, 0x541D, 0 },
+{ "asm-generic/ioctls.h", "TIOCEXCL", 0, 0x540C, 0 },
+{ "asm-generic/ioctls.h", "TIOCGDEV", _IOC_READ, 0x5432, 0x04 },
+{ "asm-generic/ioctls.h", "TIOCGETD", 0, 0x5424, 0 },
+{ "asm-generic/ioctls.h", "TIOCGEXCL", _IOC_READ, 0x5440, 0x04 },
+{ "asm-generic/ioctls.h", "TIOCGICOUNT", 0, 0x545D, 0 },
+{ "asm-generic/ioctls.h", "TIOCGISO7816", _IOC_READ, 0x5442, 0x28 },
+{ "asm-generic/ioctls.h", "TIOCGLCKTRMIOS", 0, 0x5456, 0 },
+{ "asm-generic/ioctls.h", "TIOCGPGRP", 0, 0x540F, 0 },
+{ "asm-generic/ioctls.h", "TIOCGPKT", _IOC_READ, 0x5438, 0x04 },
+{ "asm-generic/ioctls.h", "TIOCGPTLCK", _IOC_READ, 0x5439, 0x04 },
+{ "asm-generic/ioctls.h", "TIOCGPTN", _IOC_READ, 0x5430, 0x04 },
+{ "asm-generic/ioctls.h", "TIOCGPTPEER", _IOC_NONE, 0x5441, 0x00 },
+{ "asm-generic/ioctls.h", "TIOCGRS485", 0, 0x542E, 0 },
+{ "asm-generic/ioctls.h", "TIOCGSERIAL", 0, 0x541E, 0 },
+{ "asm-generic/ioctls.h", "TIOCGSID", 0, 0x5429, 0 },
+{ "asm-generic/ioctls.h", "TIOCGSOFTCAR", 0, 0x5419, 0 },
+{ "asm-generic/ioctls.h", "TIOCGWINSZ", 0, 0x5413, 0 },
+{ "asm-generic/ioctls.h", "TIOCLINUX", 0, 0x541C, 0 },
+{ "asm-generic/ioctls.h", "TIOCMBIC", 0, 0x5417, 0 },
+{ "asm-generic/ioctls.h", "TIOCMBIS", 0, 0x5416, 0 },
+{ "asm-generic/ioctls.h", "TIOCMGET", 0, 0x5415, 0 },
+{ "asm-generic/ioctls.h", "TIOCMIWAIT", 0, 0x545C, 0 },
+{ "asm-generic/ioctls.h", "TIOCMSET", 0, 0x5418, 0 },
+{ "asm-generic/ioctls.h", "TIOCNOTTY", 0, 0x5422, 0 },
+{ "asm-generic/ioctls.h", "TIOCNXCL", 0, 0x540D, 0 },
+{ "asm-generic/ioctls.h", "TIOCOUTQ", 0, 0x5411, 0 },
+{ "asm-generic/ioctls.h", "TIOCPKT", 0, 0x5420, 0 },
+{ "asm-generic/ioctls.h", "TIOCSBRK", 0, 0x5427, 0 },
+{ "asm-generic/ioctls.h", "TIOCSCTTY", 0, 0x540E, 0 },
+{ "asm-generic/ioctls.h", "TIOCSERCONFIG", 0, 0x5453, 0 },
+{ "asm-generic/ioctls.h", "TIOCSERGETLSR", 0, 0x5459, 0 },
+{ "asm-generic/ioctls.h", "TIOCSERGETMULTI", 0, 0x545A, 0 },
+{ "asm-generic/ioctls.h", "TIOCSERGSTRUCT", 0, 0x5458, 0 },
+{ "asm-generic/ioctls.h", "TIOCSERGWILD", 0, 0x5454, 0 },
+{ "asm-generic/ioctls.h", "TIOCSERSETMULTI", 0, 0x545B, 0 },
+{ "asm-generic/ioctls.h", "TIOCSERSWILD", 0, 0x5455, 0 },
+{ "asm-generic/ioctls.h", "TIOCSETD", 0, 0x5423, 0 },
+{ "asm-generic/ioctls.h", "TIOCSIG", _IOC_WRITE, 0x5436, 0x04 },
+{ "asm-generic/ioctls.h", "TIOCSISO7816", _IOC_READ|_IOC_WRITE, 0x5443, 0x28 },
+{ "asm-generic/ioctls.h", "TIOCSLCKTRMIOS", 0, 0x5457, 0 },
+{ "asm-generic/ioctls.h", "TIOCSPGRP", 0, 0x5410, 0 },
+{ "asm-generic/ioctls.h", "TIOCSPTLCK", _IOC_WRITE, 0x5431, 0x04 },
+{ "asm-generic/ioctls.h", "TIOCSRS485", 0, 0x542F, 0 },
+{ "asm-generic/ioctls.h", "TIOCSSERIAL", 0, 0x541F, 0 },
+{ "asm-generic/ioctls.h", "TIOCSSOFTCAR", 0, 0x541A, 0 },
+{ "asm-generic/ioctls.h", "TIOCSTI", 0, 0x5412, 0 },
+{ "asm-generic/ioctls.h", "TIOCSWINSZ", 0, 0x5414, 0 },
+{ "asm-generic/ioctls.h", "TIOCVHANGUP", 0, 0x5437, 0 },
+{ "asm-generic/sockios.h", "FIOGETOWN", 0, 0x8903, 0 },
+{ "asm-generic/sockios.h", "FIOSETOWN", 0, 0x8901, 0 },
+{ "asm-generic/sockios.h", "SIOCATMARK", 0, 0x8905, 0 },
+{ "asm-generic/sockios.h", "SIOCGPGRP", 0, 0x8904, 0 },
+{ "asm-generic/sockios.h", "SIOCGSTAMPNS_OLD", 0, 0x8907, 0 },
+{ "asm-generic/sockios.h", "SIOCGSTAMP_OLD", 0, 0x8906, 0 },
+{ "asm-generic/sockios.h", "SIOCSPGRP", 0, 0x8902, 0 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_BO_LIST", _IOC_READ|_IOC_WRITE, 0x6443, 0x18 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_CS", _IOC_READ|_IOC_WRITE, 0x6444, 0x18 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_CTX", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_FENCE_TO_HANDLE", _IOC_READ|_IOC_WRITE, 0x6454, 0x20 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_CREATE", _IOC_READ|_IOC_WRITE, 0x6440, 0x20 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_METADATA", _IOC_READ|_IOC_WRITE, 0x6446, 0x120 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_MMAP", _IOC_READ|_IOC_WRITE, 0x6441, 0x08 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_OP", _IOC_READ|_IOC_WRITE, 0x6450, 0x10 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_USERPTR", _IOC_READ|_IOC_WRITE, 0x6451, 0x18 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_VA", _IOC_WRITE, 0x6448, 0x28 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_WAIT_IDLE", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_INFO", _IOC_WRITE, 0x6445, 0x20 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_SCHED", _IOC_WRITE, 0x6455, 0x10 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_VM", _IOC_READ|_IOC_WRITE, 0x6453, 0x08 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_WAIT_CS", _IOC_READ|_IOC_WRITE, 0x6449, 0x20 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_WAIT_FENCES", _IOC_READ|_IOC_WRITE, 0x6452, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_ADD_BUFS", _IOC_READ|_IOC_WRITE, 0x6416, 0x20 },
+{ "drm/drm.h", "DRM_IOCTL_ADD_CTX", _IOC_READ|_IOC_WRITE, 0x6420, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_ADD_DRAW", _IOC_READ|_IOC_WRITE, 0x6427, 0x04 },
+{ "drm/drm.h", "DRM_IOCTL_ADD_MAP", _IOC_READ|_IOC_WRITE, 0x6415, 0x28 },
+{ "drm/drm.h", "DRM_IOCTL_AGP_ACQUIRE", _IOC_NONE, 0x6430, 0x00 },
+{ "drm/drm.h", "DRM_IOCTL_AGP_ALLOC", _IOC_READ|_IOC_WRITE, 0x6434, 0x20 },
+{ "drm/drm.h", "DRM_IOCTL_AGP_BIND", _IOC_WRITE, 0x6436, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_AGP_ENABLE", _IOC_WRITE, 0x6432, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_AGP_FREE", _IOC_WRITE, 0x6435, 0x20 },
+{ "drm/drm.h", "DRM_IOCTL_AGP_INFO", _IOC_READ, 0x6433, 0x38 },
+{ "drm/drm.h", "DRM_IOCTL_AGP_RELEASE", _IOC_NONE, 0x6431, 0x00 },
+{ "drm/drm.h", "DRM_IOCTL_AGP_UNBIND", _IOC_WRITE, 0x6437, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_AUTH_MAGIC", _IOC_WRITE, 0x6411, 0x04 },
+{ "drm/drm.h", "DRM_IOCTL_BLOCK", _IOC_READ|_IOC_WRITE, 0x6412, 0x04 },
+{ "drm/drm.h", "DRM_IOCTL_CONTROL", _IOC_WRITE, 0x6414, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_CRTC_GET_SEQUENCE", _IOC_READ|_IOC_WRITE, 0x643b, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_CRTC_QUEUE_SEQUENCE", _IOC_READ|_IOC_WRITE, 0x643c, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_DMA", _IOC_READ|_IOC_WRITE, 0x6429, 0x40 },
+{ "drm/drm.h", "DRM_IOCTL_DROP_MASTER", _IOC_NONE, 0x641f, 0x00 },
+{ "drm/drm.h", "DRM_IOCTL_FINISH", _IOC_WRITE, 0x642c, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_FREE_BUFS", _IOC_WRITE, 0x641a, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_GEM_CLOSE", _IOC_WRITE, 0x6409, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_GEM_FLINK", _IOC_READ|_IOC_WRITE, 0x640a, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_GEM_OPEN", _IOC_READ|_IOC_WRITE, 0x640b, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_GET_CAP", _IOC_READ|_IOC_WRITE, 0x640c, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_GET_CLIENT", _IOC_READ|_IOC_WRITE, 0x6405, 0x28 },
+{ "drm/drm.h", "DRM_IOCTL_GET_CTX", _IOC_READ|_IOC_WRITE, 0x6423, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_GET_MAGIC", _IOC_READ, 0x6402, 0x04 },
+{ "drm/drm.h", "DRM_IOCTL_GET_MAP", _IOC_READ|_IOC_WRITE, 0x6404, 0x28 },
+{ "drm/drm.h", "DRM_IOCTL_GET_SAREA_CTX", _IOC_READ|_IOC_WRITE, 0x641d, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_GET_STATS", _IOC_READ, 0x6406, 0xf8 },
+{ "drm/drm.h", "DRM_IOCTL_GET_UNIQUE", _IOC_READ|_IOC_WRITE, 0x6401, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_INFO_BUFS", _IOC_READ|_IOC_WRITE, 0x6418, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_IRQ_BUSID", _IOC_READ|_IOC_WRITE, 0x6403, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_LOCK", _IOC_WRITE, 0x642a, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_MAP_BUFS", _IOC_READ|_IOC_WRITE, 0x6419, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_MARK_BUFS", _IOC_WRITE, 0x6417, 0x20 },
+{ "drm/drm.h", "DRM_IOCTL_MODESET_CTL", _IOC_WRITE, 0x6408, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_ADDFB", _IOC_READ|_IOC_WRITE, 0x64ae, 0x1c },
+{ "drm/drm.h", "DRM_IOCTL_MODE_ADDFB2", _IOC_READ|_IOC_WRITE, 0x64b8, 0x68 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_ATOMIC", _IOC_READ|_IOC_WRITE, 0x64bc, 0x38 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_ATTACHMODE", _IOC_READ|_IOC_WRITE, 0x64a8, 0x48 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_CREATEPROPBLOB", _IOC_READ|_IOC_WRITE, 0x64bd, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_CREATE_DUMB", _IOC_READ|_IOC_WRITE, 0x64b2, 0x20 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_CREATE_LEASE", _IOC_READ|_IOC_WRITE, 0x64c6, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_CURSOR", _IOC_READ|_IOC_WRITE, 0x64a3, 0x1c },
+{ "drm/drm.h", "DRM_IOCTL_MODE_CURSOR2", _IOC_READ|_IOC_WRITE, 0x64bb, 0x24 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_DESTROYPROPBLOB", _IOC_READ|_IOC_WRITE, 0x64be, 0x04 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_DESTROY_DUMB", _IOC_READ|_IOC_WRITE, 0x64b4, 0x04 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_DETACHMODE", _IOC_READ|_IOC_WRITE, 0x64a9, 0x48 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_DIRTYFB", _IOC_READ|_IOC_WRITE, 0x64b1, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_GETCONNECTOR", _IOC_READ|_IOC_WRITE, 0x64a7, 0x50 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_GETCRTC", _IOC_READ|_IOC_WRITE, 0x64a1, 0x68 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_GETENCODER", _IOC_READ|_IOC_WRITE, 0x64a6, 0x14 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_GETFB", _IOC_READ|_IOC_WRITE, 0x64ad, 0x1c },
+{ "drm/drm.h", "DRM_IOCTL_MODE_GETFB2", _IOC_READ|_IOC_WRITE, 0x64ce, 0x68 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_GETGAMMA", _IOC_READ|_IOC_WRITE, 0x64a4, 0x20 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_GETPLANE", _IOC_READ|_IOC_WRITE, 0x64b6, 0x20 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_GETPLANERESOURCES", _IOC_READ|_IOC_WRITE, 0x64b5, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_GETPROPBLOB", _IOC_READ|_IOC_WRITE, 0x64ac, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_GETPROPERTY", _IOC_READ|_IOC_WRITE, 0x64aa, 0x40 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_GETRESOURCES", _IOC_READ|_IOC_WRITE, 0x64a0, 0x40 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_GET_LEASE", _IOC_READ|_IOC_WRITE, 0x64c8, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_LIST_LESSEES", _IOC_READ|_IOC_WRITE, 0x64c7, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_MAP_DUMB", _IOC_READ|_IOC_WRITE, 0x64b3, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_OBJ_GETPROPERTIES", _IOC_READ|_IOC_WRITE, 0x64b9, 0x20 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_OBJ_SETPROPERTY", _IOC_READ|_IOC_WRITE, 0x64ba, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_PAGE_FLIP", _IOC_READ|_IOC_WRITE, 0x64b0, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_REVOKE_LEASE", _IOC_READ|_IOC_WRITE, 0x64c9, 0x04 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_RMFB", _IOC_READ|_IOC_WRITE, 0x64af, 0x04 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_SETCRTC", _IOC_READ|_IOC_WRITE, 0x64a2, 0x68 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_SETGAMMA", _IOC_READ|_IOC_WRITE, 0x64a5, 0x20 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_SETPLANE", _IOC_READ|_IOC_WRITE, 0x64b7, 0x30 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_SETPROPERTY", _IOC_READ|_IOC_WRITE, 0x64ab, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_MOD_CTX", _IOC_WRITE, 0x6422, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_NEW_CTX", _IOC_WRITE, 0x6425, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_PRIME_FD_TO_HANDLE", _IOC_READ|_IOC_WRITE, 0x642e, 0x0c },
+{ "drm/drm.h", "DRM_IOCTL_PRIME_HANDLE_TO_FD", _IOC_READ|_IOC_WRITE, 0x642d, 0x0c },
+{ "drm/drm.h", "DRM_IOCTL_RES_CTX", _IOC_READ|_IOC_WRITE, 0x6426, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_RM_CTX", _IOC_READ|_IOC_WRITE, 0x6421, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_RM_DRAW", _IOC_READ|_IOC_WRITE, 0x6428, 0x04 },
+{ "drm/drm.h", "DRM_IOCTL_RM_MAP", _IOC_WRITE, 0x641b, 0x28 },
+{ "drm/drm.h", "DRM_IOCTL_SET_CLIENT_CAP", _IOC_WRITE, 0x640d, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_SET_MASTER", _IOC_NONE, 0x641e, 0x00 },
+{ "drm/drm.h", "DRM_IOCTL_SET_SAREA_CTX", _IOC_WRITE, 0x641c, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_SET_UNIQUE", _IOC_WRITE, 0x6410, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_SET_VERSION", _IOC_READ|_IOC_WRITE, 0x6407, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_SG_ALLOC", _IOC_READ|_IOC_WRITE, 0x6438, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_SG_FREE", _IOC_WRITE, 0x6439, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_SWITCH_CTX", _IOC_WRITE, 0x6424, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_CREATE", _IOC_READ|_IOC_WRITE, 0x64bf, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_DESTROY", _IOC_READ|_IOC_WRITE, 0x64c0, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_FD_TO_HANDLE", _IOC_READ|_IOC_WRITE, 0x64c2, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_HANDLE_TO_FD", _IOC_READ|_IOC_WRITE, 0x64c1, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_QUERY", _IOC_READ|_IOC_WRITE, 0x64cb, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_RESET", _IOC_READ|_IOC_WRITE, 0x64c4, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_SIGNAL", _IOC_READ|_IOC_WRITE, 0x64c5, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_TIMELINE_SIGNAL", _IOC_READ|_IOC_WRITE, 0x64cd, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_TIMELINE_WAIT", _IOC_READ|_IOC_WRITE, 0x64ca, 0x28 },
+{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_TRANSFER", _IOC_READ|_IOC_WRITE, 0x64cc, 0x20 },
+{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_WAIT", _IOC_READ|_IOC_WRITE, 0x64c3, 0x20 },
+{ "drm/drm.h", "DRM_IOCTL_UNBLOCK", _IOC_READ|_IOC_WRITE, 0x6413, 0x04 },
+{ "drm/drm.h", "DRM_IOCTL_UNLOCK", _IOC_WRITE, 0x642b, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_UPDATE_DRAW", _IOC_WRITE, 0x643f, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_VERSION", _IOC_READ|_IOC_WRITE, 0x6400, 0x40 },
+{ "drm/drm.h", "DRM_IOCTL_WAIT_VBLANK", _IOC_READ|_IOC_WRITE, 0x643a, 0x18 },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_CPU_FINI", _IOC_WRITE, 0x6445, 0x08 },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_CPU_PREP", _IOC_WRITE, 0x6444, 0x18 },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_NEW", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_SUBMIT", _IOC_READ|_IOC_WRITE, 0x6446, 0x48 },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_USERPTR", _IOC_READ|_IOC_WRITE, 0x6448, 0x18 },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_WAIT", _IOC_WRITE, 0x6449, 0x20 },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_PM_QUERY_DOM", _IOC_READ|_IOC_WRITE, 0x644a, 0x48 },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_PM_QUERY_SIG", _IOC_READ|_IOC_WRITE, 0x644b, 0x4c },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_WAIT_FENCE", _IOC_WRITE, 0x6447, 0x20 },
+{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_G2D_EXEC", _IOC_READ|_IOC_WRITE, 0x6462, 0x08 },
+{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_G2D_GET_VER", _IOC_READ|_IOC_WRITE, 0x6460, 0x08 },
+{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_G2D_SET_CMDLIST", _IOC_READ|_IOC_WRITE, 0x6461, 0x28 },
+{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_GEM_CREATE", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 },
+{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_GEM_GET", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 },
+{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_GEM_MAP", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 },
+{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_IPP_COMMIT", _IOC_READ|_IOC_WRITE, 0x6483, 0x20 },
+{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_IPP_GET_CAPS", _IOC_READ|_IOC_WRITE, 0x6481, 0x18 },
+{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_IPP_GET_LIMITS", _IOC_READ|_IOC_WRITE, 0x6482, 0x20 },
+{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_IPP_GET_RESOURCES", _IOC_READ|_IOC_WRITE, 0x6480, 0x10 },
+{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_VIDI_CONNECTION", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 },
+{ "drm/i810_drm.h", "DRM_IOCTL_I810_CLEAR", _IOC_WRITE, 0x6442, 0x0c },
+{ "drm/i810_drm.h", "DRM_IOCTL_I810_COPY", _IOC_WRITE, 0x6447, 0x10 },
+{ "drm/i810_drm.h", "DRM_IOCTL_I810_DOCOPY", _IOC_NONE, 0x6448, 0x00 },
+{ "drm/i810_drm.h", "DRM_IOCTL_I810_FLIP", _IOC_NONE, 0x644e, 0x00 },
+{ "drm/i810_drm.h", "DRM_IOCTL_I810_FLUSH", _IOC_NONE, 0x6443, 0x00 },
+{ "drm/i810_drm.h", "DRM_IOCTL_I810_FSTATUS", _IOC_NONE, 0x644a, 0x00 },
+{ "drm/i810_drm.h", "DRM_IOCTL_I810_GETAGE", _IOC_NONE, 0x6444, 0x00 },
+{ "drm/i810_drm.h", "DRM_IOCTL_I810_GETBUF", _IOC_READ|_IOC_WRITE, 0x6445, 0x18 },
+{ "drm/i810_drm.h", "DRM_IOCTL_I810_INIT", _IOC_WRITE, 0x6440, 0x40 },
+{ "drm/i810_drm.h", "DRM_IOCTL_I810_MC", _IOC_WRITE, 0x644c, 0x20 },
+{ "drm/i810_drm.h", "DRM_IOCTL_I810_OV0FLIP", _IOC_NONE, 0x644b, 0x00 },
+{ "drm/i810_drm.h", "DRM_IOCTL_I810_OV0INFO", _IOC_READ, 0x6449, 0x08 },
+{ "drm/i810_drm.h", "DRM_IOCTL_I810_RSTATUS", _IOC_NONE, 0x644d, 0x00 },
+{ "drm/i810_drm.h", "DRM_IOCTL_I810_SWAP", _IOC_NONE, 0x6446, 0x00 },
+{ "drm/i810_drm.h", "DRM_IOCTL_I810_VERTEX", _IOC_WRITE, 0x6441, 0x0c },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_ALLOC", _IOC_READ|_IOC_WRITE, 0x6448, 0x18 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_BATCHBUFFER", _IOC_WRITE, 0x6443, 0x20 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_CMDBUFFER", _IOC_WRITE, 0x644b, 0x20 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_DESTROY_HEAP", _IOC_WRITE, 0x644c, 0x04 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_FLIP", _IOC_NONE, 0x6442, 0x00 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_FLUSH", _IOC_NONE, 0x6441, 0x00 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_FREE", _IOC_WRITE, 0x6449, 0x08 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_BUSY", _IOC_READ|_IOC_WRITE, 0x6457, 0x08 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_CONTEXT_CREATE", _IOC_READ|_IOC_WRITE, 0x646d, 0x08 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_CONTEXT_CREATE_EXT", _IOC_READ|_IOC_WRITE, 0x646d, 0x10 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_CONTEXT_DESTROY", _IOC_WRITE, 0x646e, 0x08 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_CONTEXT_GETPARAM", _IOC_READ|_IOC_WRITE, 0x6474, 0x18 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_CONTEXT_SETPARAM", _IOC_READ|_IOC_WRITE, 0x6475, 0x18 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_CREATE", _IOC_READ|_IOC_WRITE, 0x645b, 0x10 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_ENTERVT", _IOC_NONE, 0x6459, 0x00 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_EXECBUFFER", _IOC_WRITE, 0x6454, 0x28 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_EXECBUFFER2", _IOC_WRITE, 0x6469, 0x40 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_EXECBUFFER2_WR", _IOC_READ|_IOC_WRITE, 0x6469, 0x40 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_GET_APERTURE", _IOC_READ, 0x6463, 0x10 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_GET_CACHING", _IOC_READ|_IOC_WRITE, 0x6470, 0x08 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_GET_TILING", _IOC_READ|_IOC_WRITE, 0x6462, 0x10 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_INIT", _IOC_WRITE, 0x6453, 0x10 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_LEAVEVT", _IOC_NONE, 0x645a, 0x00 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_MADVISE", _IOC_READ|_IOC_WRITE, 0x6466, 0x0c },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_MMAP", _IOC_READ|_IOC_WRITE, 0x645e, 0x28 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_MMAP_GTT", _IOC_READ|_IOC_WRITE, 0x6464, 0x10 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_MMAP_OFFSET", _IOC_READ|_IOC_WRITE, 0x6464, 0x20 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_PIN", _IOC_READ|_IOC_WRITE, 0x6455, 0x18 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_PREAD", _IOC_WRITE, 0x645c, 0x20 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_PWRITE", _IOC_WRITE, 0x645d, 0x20 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_SET_CACHING", _IOC_WRITE, 0x646f, 0x08 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_SET_DOMAIN", _IOC_WRITE, 0x645f, 0x0c },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_SET_TILING", _IOC_READ|_IOC_WRITE, 0x6461, 0x10 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_SW_FINISH", _IOC_WRITE, 0x6460, 0x04 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_THROTTLE", _IOC_NONE, 0x6458, 0x00 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_UNPIN", _IOC_WRITE, 0x6456, 0x08 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_USERPTR", _IOC_READ|_IOC_WRITE, 0x6473, 0x18 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_VM_CREATE", _IOC_READ|_IOC_WRITE, 0x647a, 0x10 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_VM_DESTROY", _IOC_WRITE, 0x647b, 0x10 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_WAIT", _IOC_READ|_IOC_WRITE, 0x646c, 0x10 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GETPARAM", _IOC_READ|_IOC_WRITE, 0x6446, 0x10 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GET_PIPE_FROM_CRTC_ID", _IOC_READ|_IOC_WRITE, 0x6465, 0x08 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GET_RESET_STATS", _IOC_READ|_IOC_WRITE, 0x6472, 0x18 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GET_SPRITE_COLORKEY", _IOC_READ|_IOC_WRITE, 0x646a, 0x14 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GET_VBLANK_PIPE", _IOC_READ, 0x644e, 0x04 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_HWS_ADDR", _IOC_WRITE, 0x6451, 0x10 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_INIT", _IOC_WRITE, 0x6440, 0x44 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_INIT_HEAP", _IOC_WRITE, 0x644a, 0x0c },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_IRQ_EMIT", _IOC_READ|_IOC_WRITE, 0x6444, 0x08 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_IRQ_WAIT", _IOC_WRITE, 0x6445, 0x04 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_OVERLAY_ATTRS", _IOC_READ|_IOC_WRITE, 0x6468, 0x2c },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_OVERLAY_PUT_IMAGE", _IOC_WRITE, 0x6467, 0x2c },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_PERF_ADD_CONFIG", _IOC_WRITE, 0x6477, 0x48 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_PERF_OPEN", _IOC_WRITE, 0x6476, 0x10 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_PERF_REMOVE_CONFIG", _IOC_WRITE, 0x6478, 0x08 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_QUERY", _IOC_READ|_IOC_WRITE, 0x6479, 0x10 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_REG_READ", _IOC_READ|_IOC_WRITE, 0x6471, 0x10 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_SETPARAM", _IOC_WRITE, 0x6447, 0x08 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_SET_SPRITE_COLORKEY", _IOC_READ|_IOC_WRITE, 0x646b, 0x14 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_SET_VBLANK_PIPE", _IOC_WRITE, 0x644d, 0x04 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_VBLANK_SWAP", _IOC_READ|_IOC_WRITE, 0x644f, 0x0c },
+{ "drm/i915_drm.h", "I915_PERF_IOCTL_CONFIG", _IOC_NONE, 0x6902, 0x00 },
+{ "drm/i915_drm.h", "I915_PERF_IOCTL_DISABLE", _IOC_NONE, 0x6901, 0x00 },
+{ "drm/i915_drm.h", "I915_PERF_IOCTL_ENABLE", _IOC_NONE, 0x6900, 0x00 },
+{ "drm/lima_drm.h", "DRM_IOCTL_LIMA_CTX_CREATE", _IOC_READ, 0x6445, 0x08 },
+{ "drm/lima_drm.h", "DRM_IOCTL_LIMA_CTX_FREE", _IOC_WRITE, 0x6446, 0x08 },
+{ "drm/lima_drm.h", "DRM_IOCTL_LIMA_GEM_CREATE", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 },
+{ "drm/lima_drm.h", "DRM_IOCTL_LIMA_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 },
+{ "drm/lima_drm.h", "DRM_IOCTL_LIMA_GEM_SUBMIT", _IOC_WRITE, 0x6443, 0x30 },
+{ "drm/lima_drm.h", "DRM_IOCTL_LIMA_GEM_WAIT", _IOC_WRITE, 0x6444, 0x10 },
+{ "drm/lima_drm.h", "DRM_IOCTL_LIMA_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 },
+{ "drm/mga_drm.h", "DRM_IOCTL_MGA_BLIT", _IOC_WRITE, 0x6448, 0x34 },
+{ "drm/mga_drm.h", "DRM_IOCTL_MGA_CLEAR", _IOC_WRITE, 0x6444, 0x14 },
+{ "drm/mga_drm.h", "DRM_IOCTL_MGA_DMA_BOOTSTRAP", _IOC_READ|_IOC_WRITE, 0x644c, 0x20 },
+{ "drm/mga_drm.h", "DRM_IOCTL_MGA_FLUSH", _IOC_WRITE, 0x6441, 0x08 },
+{ "drm/mga_drm.h", "DRM_IOCTL_MGA_GETPARAM", _IOC_READ|_IOC_WRITE, 0x6449, 0x10 },
+{ "drm/mga_drm.h", "DRM_IOCTL_MGA_ILOAD", _IOC_WRITE, 0x6447, 0x0c },
+{ "drm/mga_drm.h", "DRM_IOCTL_MGA_INDICES", _IOC_WRITE, 0x6446, 0x10 },
+{ "drm/mga_drm.h", "DRM_IOCTL_MGA_INIT", _IOC_WRITE, 0x6440, 0x80 },
+{ "drm/mga_drm.h", "DRM_IOCTL_MGA_RESET", _IOC_NONE, 0x6442, 0x00 },
+{ "drm/mga_drm.h", "DRM_IOCTL_MGA_SET_FENCE", _IOC_WRITE, 0x644a, 0x04 },
+{ "drm/mga_drm.h", "DRM_IOCTL_MGA_SWAP", _IOC_NONE, 0x6443, 0x00 },
+{ "drm/mga_drm.h", "DRM_IOCTL_MGA_VERTEX", _IOC_WRITE, 0x6445, 0x0c },
+{ "drm/mga_drm.h", "DRM_IOCTL_MGA_WAIT_FENCE", _IOC_READ|_IOC_WRITE, 0x644b, 0x04 },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_CPU_FINI", _IOC_WRITE, 0x6445, 0x04 },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_CPU_PREP", _IOC_WRITE, 0x6444, 0x18 },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6443, 0x18 },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_MADVISE", _IOC_READ|_IOC_WRITE, 0x6448, 0x0c },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_NEW", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_SUBMIT", _IOC_READ|_IOC_WRITE, 0x6446, 0x48 },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_SUBMITQUEUE_CLOSE", _IOC_WRITE, 0x644b, 0x04 },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_SUBMITQUEUE_NEW", _IOC_READ|_IOC_WRITE, 0x644a, 0x0c },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_SUBMITQUEUE_QUERY", _IOC_WRITE, 0x644c, 0x18 },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_WAIT_FENCE", _IOC_WRITE, 0x6447, 0x20 },
+{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_CPU_FINI", _IOC_WRITE, 0x6483, 0x04 },
+{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_CPU_PREP", _IOC_WRITE, 0x6482, 0x08 },
+{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6484, 0x28 },
+{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_NEW", _IOC_READ|_IOC_WRITE, 0x6480, 0x30 },
+{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_PUSHBUF", _IOC_READ|_IOC_WRITE, 0x6481, 0x40 },
+{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_SVM_BIND", _IOC_READ|_IOC_WRITE, 0x6449, 0x40 },
+{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_SVM_INIT", _IOC_READ|_IOC_WRITE, 0x6448, 0x10 },
+{ "drm/omap_drm.h", "DRM_IOCTL_OMAP_GEM_CPU_FINI", _IOC_WRITE, 0x6445, 0x10 },
+{ "drm/omap_drm.h", "DRM_IOCTL_OMAP_GEM_CPU_PREP", _IOC_WRITE, 0x6444, 0x08 },
+{ "drm/omap_drm.h", "DRM_IOCTL_OMAP_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6446, 0x18 },
+{ "drm/omap_drm.h", "DRM_IOCTL_OMAP_GEM_NEW", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 },
+{ "drm/omap_drm.h", "DRM_IOCTL_OMAP_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 },
+{ "drm/omap_drm.h", "DRM_IOCTL_OMAP_SET_PARAM", _IOC_WRITE, 0x6441, 0x10 },
+{ "drm/panfrost_drm.h", "DRM_IOCTL_PANFROST_CREATE_BO", _IOC_READ|_IOC_WRITE, 0x6442, 0x18 },
+{ "drm/panfrost_drm.h", "DRM_IOCTL_PANFROST_GET_BO_OFFSET", _IOC_READ|_IOC_WRITE, 0x6445, 0x10 },
+{ "drm/panfrost_drm.h", "DRM_IOCTL_PANFROST_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 },
+{ "drm/panfrost_drm.h", "DRM_IOCTL_PANFROST_MADVISE", _IOC_READ|_IOC_WRITE, 0x6448, 0x0c },
+{ "drm/panfrost_drm.h", "DRM_IOCTL_PANFROST_MMAP_BO", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 },
+{ "drm/panfrost_drm.h", "DRM_IOCTL_PANFROST_PERFCNT_DUMP", _IOC_WRITE, 0x6447, 0x08 },
+{ "drm/panfrost_drm.h", "DRM_IOCTL_PANFROST_PERFCNT_ENABLE", _IOC_WRITE, 0x6446, 0x08 },
+{ "drm/panfrost_drm.h", "DRM_IOCTL_PANFROST_SUBMIT", _IOC_WRITE, 0x6440, 0x28 },
+{ "drm/panfrost_drm.h", "DRM_IOCTL_PANFROST_WAIT_BO", _IOC_WRITE, 0x6441, 0x10 },
+{ "drm/qxl_drm.h", "DRM_IOCTL_QXL_ALLOC", _IOC_READ|_IOC_WRITE, 0x6440, 0x08 },
+{ "drm/qxl_drm.h", "DRM_IOCTL_QXL_ALLOC_SURF", _IOC_READ|_IOC_WRITE, 0x6446, 0x18 },
+{ "drm/qxl_drm.h", "DRM_IOCTL_QXL_CLIENTCAP", _IOC_WRITE, 0x6445, 0x08 },
+{ "drm/qxl_drm.h", "DRM_IOCTL_QXL_EXECBUFFER", _IOC_WRITE, 0x6442, 0x10 },
+{ "drm/qxl_drm.h", "DRM_IOCTL_QXL_GETPARAM", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 },
+{ "drm/qxl_drm.h", "DRM_IOCTL_QXL_MAP", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 },
+{ "drm/qxl_drm.h", "DRM_IOCTL_QXL_UPDATE_AREA", _IOC_WRITE, 0x6443, 0x18 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_BLIT", _IOC_WRITE, 0x644b, 0x18 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_CCE_IDLE", _IOC_NONE, 0x6444, 0x00 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_CCE_RESET", _IOC_NONE, 0x6443, 0x00 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_CCE_START", _IOC_NONE, 0x6441, 0x00 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_CCE_STOP", _IOC_WRITE, 0x6442, 0x08 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_CLEAR", _IOC_WRITE, 0x6448, 0x14 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_DEPTH", _IOC_WRITE, 0x644c, 0x28 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_FLIP", _IOC_NONE, 0x6453, 0x00 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_FULLSCREEN", _IOC_WRITE, 0x6450, 0x04 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_GETPARAM", _IOC_READ|_IOC_WRITE, 0x6452, 0x10 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_INDICES", _IOC_WRITE, 0x644a, 0x14 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_INDIRECT", _IOC_READ|_IOC_WRITE, 0x644f, 0x10 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_INIT", _IOC_WRITE, 0x6440, 0x78 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_RESET", _IOC_NONE, 0x6446, 0x00 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_STIPPLE", _IOC_WRITE, 0x644d, 0x08 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_SWAP", _IOC_NONE, 0x6447, 0x00 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_VERTEX", _IOC_WRITE, 0x6449, 0x10 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_ALLOC", _IOC_READ|_IOC_WRITE, 0x6453, 0x18 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CLEAR", _IOC_WRITE, 0x6448, 0x20 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CMDBUF", _IOC_WRITE, 0x6450, 0x20 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CP_IDLE", _IOC_NONE, 0x6444, 0x00 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CP_INIT", _IOC_WRITE, 0x6440, 0x78 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CP_RESET", _IOC_NONE, 0x6443, 0x00 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CP_RESUME", _IOC_NONE, 0x6458, 0x00 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CP_START", _IOC_NONE, 0x6441, 0x00 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CP_STOP", _IOC_WRITE, 0x6442, 0x08 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CS", _IOC_READ|_IOC_WRITE, 0x6466, 0x20 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_FLIP", _IOC_NONE, 0x6452, 0x00 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_FREE", _IOC_WRITE, 0x6454, 0x08 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_FULLSCREEN", _IOC_WRITE, 0x6446, 0x04 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_BUSY", _IOC_READ|_IOC_WRITE, 0x646a, 0x08 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_CREATE", _IOC_READ|_IOC_WRITE, 0x645d, 0x20 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_GET_TILING", _IOC_READ|_IOC_WRITE, 0x6469, 0x0c },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x645c, 0x18 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_MMAP", _IOC_READ|_IOC_WRITE, 0x645e, 0x20 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_OP", _IOC_READ|_IOC_WRITE, 0x646c, 0x10 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_PREAD", _IOC_READ|_IOC_WRITE, 0x6461, 0x20 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_PWRITE", _IOC_READ|_IOC_WRITE, 0x6462, 0x20 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_SET_DOMAIN", _IOC_READ|_IOC_WRITE, 0x6463, 0x0c },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_SET_TILING", _IOC_READ|_IOC_WRITE, 0x6468, 0x0c },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_USERPTR", _IOC_READ|_IOC_WRITE, 0x646d, 0x18 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_VA", _IOC_READ|_IOC_WRITE, 0x646b, 0x18 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_WAIT_IDLE", _IOC_WRITE, 0x6464, 0x08 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GETPARAM", _IOC_READ|_IOC_WRITE, 0x6451, 0x10 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_INDICES", _IOC_WRITE, 0x644a, 0x14 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_INDIRECT", _IOC_READ|_IOC_WRITE, 0x644d, 0x10 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_INFO", _IOC_READ|_IOC_WRITE, 0x6467, 0x10 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_INIT_HEAP", _IOC_WRITE, 0x6455, 0x0c },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_IRQ_EMIT", _IOC_READ|_IOC_WRITE, 0x6456, 0x08 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_IRQ_WAIT", _IOC_WRITE, 0x6457, 0x04 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_RESET", _IOC_NONE, 0x6445, 0x00 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_SETPARAM", _IOC_WRITE, 0x6459, 0x10 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_STIPPLE", _IOC_WRITE, 0x644c, 0x08 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_SURF_ALLOC", _IOC_WRITE, 0x645a, 0x0c },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_SURF_FREE", _IOC_WRITE, 0x645b, 0x04 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_SWAP", _IOC_NONE, 0x6447, 0x00 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_TEXTURE", _IOC_READ|_IOC_WRITE, 0x644e, 0x20 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_VERTEX", _IOC_WRITE, 0x6449, 0x10 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_VERTEX2", _IOC_WRITE, 0x644f, 0x28 },
+{ "drm/savage_drm.h", "DRM_IOCTL_SAVAGE_BCI_CMDBUF", _IOC_WRITE, 0x6441, 0x38 },
+{ "drm/savage_drm.h", "DRM_IOCTL_SAVAGE_BCI_EVENT_EMIT", _IOC_READ|_IOC_WRITE, 0x6442, 0x08 },
+{ "drm/savage_drm.h", "DRM_IOCTL_SAVAGE_BCI_EVENT_WAIT", _IOC_WRITE, 0x6443, 0x08 },
+{ "drm/savage_drm.h", "DRM_IOCTL_SAVAGE_BCI_INIT", _IOC_WRITE, 0x6440, 0x60 },
+{ "drm/sis_drm.h", "DRM_IOCTL_SIS_AGP_ALLOC", _IOC_READ|_IOC_WRITE, 0x6454, 0x20 },
+{ "drm/sis_drm.h", "DRM_IOCTL_SIS_AGP_FREE", _IOC_WRITE, 0x6455, 0x20 },
+{ "drm/sis_drm.h", "DRM_IOCTL_SIS_AGP_INIT", _IOC_READ|_IOC_WRITE, 0x6453, 0x10 },
+{ "drm/sis_drm.h", "DRM_IOCTL_SIS_FB_ALLOC", _IOC_READ|_IOC_WRITE, 0x6444, 0x20 },
+{ "drm/sis_drm.h", "DRM_IOCTL_SIS_FB_FREE", _IOC_WRITE, 0x6445, 0x20 },
+{ "drm/sis_drm.h", "DRM_IOCTL_SIS_FB_INIT", _IOC_WRITE, 0x6456, 0x10 },
+{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_CLOSE_CHANNEL", _IOC_READ|_IOC_WRITE, 0x6446, 0x08 },
+{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GEM_CREATE", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 },
+{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GEM_GET_FLAGS", _IOC_READ|_IOC_WRITE, 0x644d, 0x08 },
+{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GEM_GET_TILING", _IOC_READ|_IOC_WRITE, 0x644b, 0x10 },
+{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GEM_MMAP", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 },
+{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GEM_SET_FLAGS", _IOC_READ|_IOC_WRITE, 0x644c, 0x08 },
+{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GEM_SET_TILING", _IOC_READ|_IOC_WRITE, 0x644a, 0x10 },
+{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GET_SYNCPT", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 },
+{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GET_SYNCPT_BASE", _IOC_READ|_IOC_WRITE, 0x6449, 0x10 },
+{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_OPEN_CHANNEL", _IOC_READ|_IOC_WRITE, 0x6445, 0x10 },
+{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_SUBMIT", _IOC_READ|_IOC_WRITE, 0x6448, 0x58 },
+{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_SYNCPT_INCR", _IOC_READ|_IOC_WRITE, 0x6443, 0x08 },
+{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_SYNCPT_READ", _IOC_READ|_IOC_WRITE, 0x6442, 0x08 },
+{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_SYNCPT_WAIT", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 },
+{ "drm/v3d_drm.h", "DRM_IOCTL_V3D_CREATE_BO", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 },
+{ "drm/v3d_drm.h", "DRM_IOCTL_V3D_GET_BO_OFFSET", _IOC_READ|_IOC_WRITE, 0x6445, 0x08 },
+{ "drm/v3d_drm.h", "DRM_IOCTL_V3D_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 },
+{ "drm/v3d_drm.h", "DRM_IOCTL_V3D_MMAP_BO", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 },
+{ "drm/v3d_drm.h", "DRM_IOCTL_V3D_SUBMIT_CL", _IOC_READ|_IOC_WRITE, 0x6440, 0x38 },
+{ "drm/v3d_drm.h", "DRM_IOCTL_V3D_SUBMIT_CSD", _IOC_WRITE, 0x6447, 0x48 },
+{ "drm/v3d_drm.h", "DRM_IOCTL_V3D_SUBMIT_TFU", _IOC_WRITE, 0x6446, 0x44 },
+{ "drm/v3d_drm.h", "DRM_IOCTL_V3D_WAIT_BO", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_CREATE_BO", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_CREATE_SHADER_BO", _IOC_READ|_IOC_WRITE, 0x6445, 0x18 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_GEM_MADVISE", _IOC_READ|_IOC_WRITE, 0x644b, 0x10 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_GET_HANG_STATE", _IOC_READ|_IOC_WRITE, 0x6446, 0xa0 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_GET_TILING", _IOC_READ|_IOC_WRITE, 0x6449, 0x10 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_LABEL_BO", _IOC_READ|_IOC_WRITE, 0x644a, 0x10 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_MMAP_BO", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_PERFMON_CREATE", _IOC_READ|_IOC_WRITE, 0x644c, 0x18 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_PERFMON_DESTROY", _IOC_READ|_IOC_WRITE, 0x644d, 0x04 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_PERFMON_GET_VALUES", _IOC_READ|_IOC_WRITE, 0x644e, 0x10 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_SET_TILING", _IOC_READ|_IOC_WRITE, 0x6448, 0x10 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_SUBMIT_CL", _IOC_READ|_IOC_WRITE, 0x6440, 0xb0 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_WAIT_BO", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_WAIT_SEQNO", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 },
+{ "drm/vgem_drm.h", "DRM_IOCTL_VGEM_FENCE_ATTACH", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 },
+{ "drm/vgem_drm.h", "DRM_IOCTL_VGEM_FENCE_SIGNAL", _IOC_WRITE, 0x6442, 0x08 },
+{ "drm/via_drm.h", "DRM_IOCTL_VIA_AGP_INIT", _IOC_READ|_IOC_WRITE, 0x6442, 0x08 },
+{ "drm/via_drm.h", "DRM_IOCTL_VIA_ALLOCMEM", _IOC_READ|_IOC_WRITE, 0x6440, 0x20 },
+{ "drm/via_drm.h", "DRM_IOCTL_VIA_BLIT_SYNC", _IOC_WRITE, 0x644f, 0x08 },
+{ "drm/via_drm.h", "DRM_IOCTL_VIA_CMDBUFFER", _IOC_WRITE, 0x6448, 0x10 },
+{ "drm/via_drm.h", "DRM_IOCTL_VIA_CMDBUF_SIZE", _IOC_READ|_IOC_WRITE, 0x644b, 0x0c },
+{ "drm/via_drm.h", "DRM_IOCTL_VIA_DEC_FUTEX", _IOC_WRITE, 0x6445, 0x10 },
+{ "drm/via_drm.h", "DRM_IOCTL_VIA_DMA_BLIT", _IOC_WRITE, 0x644e, 0x30 },
+{ "drm/via_drm.h", "DRM_IOCTL_VIA_DMA_INIT", _IOC_READ|_IOC_WRITE, 0x6447, 0x20 },
+{ "drm/via_drm.h", "DRM_IOCTL_VIA_FB_INIT", _IOC_READ|_IOC_WRITE, 0x6443, 0x08 },
+{ "drm/via_drm.h", "DRM_IOCTL_VIA_FLUSH", _IOC_NONE, 0x6449, 0x00 },
+{ "drm/via_drm.h", "DRM_IOCTL_VIA_FREEMEM", _IOC_WRITE, 0x6441, 0x20 },
+{ "drm/via_drm.h", "DRM_IOCTL_VIA_MAP_INIT", _IOC_READ|_IOC_WRITE, 0x6444, 0x28 },
+{ "drm/via_drm.h", "DRM_IOCTL_VIA_PCICMD", _IOC_WRITE, 0x644a, 0x10 },
+{ "drm/via_drm.h", "DRM_IOCTL_VIA_WAIT_IRQ", _IOC_READ|_IOC_WRITE, 0x644d, 0x18 },
+{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_EXECBUFFER", _IOC_READ|_IOC_WRITE, 0x6442, 0x20 },
+{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_GETPARAM", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 },
+{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_GET_CAPS", _IOC_READ|_IOC_WRITE, 0x6449, 0x18 },
+{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_MAP", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 },
+{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_RESOURCE_CREATE", _IOC_READ|_IOC_WRITE, 0x6444, 0x38 },
+{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_RESOURCE_INFO", _IOC_READ|_IOC_WRITE, 0x6445, 0x10 },
+{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_TRANSFER_FROM_HOST", _IOC_READ|_IOC_WRITE, 0x6446, 0x24 },
+{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_TRANSFER_TO_HOST", _IOC_READ|_IOC_WRITE, 0x6447, 0x24 },
+{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_WAIT", _IOC_READ|_IOC_WRITE, 0x6448, 0x08 },
+{ "linux/agpgart.h", "AGPIOC_ACQUIRE", _IOC_NONE, 0x4101, 0x00 },
+{ "linux/agpgart.h", "AGPIOC_ALLOCATE", _IOC_READ|_IOC_WRITE, 0x4106, 0x08 },
+{ "linux/agpgart.h", "AGPIOC_BIND", _IOC_WRITE, 0x4108, 0x08 },
+{ "linux/agpgart.h", "AGPIOC_CHIPSET_FLUSH", _IOC_NONE, 0x410a, 0x00 },
+{ "linux/agpgart.h", "AGPIOC_DEALLOCATE", _IOC_WRITE, 0x4107, 0x04 },
+{ "linux/agpgart.h", "AGPIOC_INFO", _IOC_READ, 0x4100, 0x08 },
+{ "linux/agpgart.h", "AGPIOC_PROTECT", _IOC_WRITE, 0x4105, 0x08 },
+{ "linux/agpgart.h", "AGPIOC_RELEASE", _IOC_NONE, 0x4102, 0x00 },
+{ "linux/agpgart.h", "AGPIOC_RESERVE", _IOC_WRITE, 0x4104, 0x08 },
+{ "linux/agpgart.h", "AGPIOC_SETUP", _IOC_WRITE, 0x4103, 0x08 },
+{ "linux/agpgart.h", "AGPIOC_UNBIND", _IOC_WRITE, 0x4109, 0x08 },
+{ "linux/am437x-vpfe.h", "VIDIOC_AM437X_CCDC_CFG", _IOC_WRITE, 0x56c1, 0x08 },
+{ "linux/android/binder.h", "BC_ACQUIRE", _IOC_WRITE, 0x6305, 0x04 },
+{ "linux/android/binder.h", "BC_ACQUIRE_DONE", _IOC_WRITE, 0x6309, 0x10 },
+{ "linux/android/binder.h", "BC_ACQUIRE_RESULT", _IOC_WRITE, 0x6302, 0x04 },
+{ "linux/android/binder.h", "BC_ATTEMPT_ACQUIRE", _IOC_WRITE, 0x630a, 0x08 },
+{ "linux/android/binder.h", "BC_CLEAR_DEATH_NOTIFICATION", _IOC_WRITE, 0x630f, 0x0c },
+{ "linux/android/binder.h", "BC_DEAD_BINDER_DONE", _IOC_WRITE, 0x6310, 0x08 },
+{ "linux/android/binder.h", "BC_DECREFS", _IOC_WRITE, 0x6307, 0x04 },
+{ "linux/android/binder.h", "BC_ENTER_LOOPER", _IOC_NONE, 0x630c, 0x00 },
+{ "linux/android/binder.h", "BC_EXIT_LOOPER", _IOC_NONE, 0x630d, 0x00 },
+{ "linux/android/binder.h", "BC_FREE_BUFFER", _IOC_WRITE, 0x6303, 0x08 },
+{ "linux/android/binder.h", "BC_INCREFS", _IOC_WRITE, 0x6304, 0x04 },
+{ "linux/android/binder.h", "BC_INCREFS_DONE", _IOC_WRITE, 0x6308, 0x10 },
+{ "linux/android/binder.h", "BC_REGISTER_LOOPER", _IOC_NONE, 0x630b, 0x00 },
+{ "linux/android/binder.h", "BC_RELEASE", _IOC_WRITE, 0x6306, 0x04 },
+{ "linux/android/binder.h", "BC_REPLY", _IOC_WRITE, 0x6301, 0x40 },
+{ "linux/android/binder.h", "BC_REPLY_SG", _IOC_WRITE, 0x6312, 0x48 },
+{ "linux/android/binder.h", "BC_REQUEST_DEATH_NOTIFICATION", _IOC_WRITE, 0x630e, 0x0c },
+{ "linux/android/binder.h", "BC_TRANSACTION", _IOC_WRITE, 0x6300, 0x40 },
+{ "linux/android/binder.h", "BC_TRANSACTION_SG", _IOC_WRITE, 0x6311, 0x48 },
+{ "linux/android/binder.h", "BINDER_GET_NODE_DEBUG_INFO", _IOC_READ|_IOC_WRITE, 0x620b, 0x18 },
+{ "linux/android/binder.h", "BINDER_GET_NODE_INFO_FOR_REF", _IOC_READ|_IOC_WRITE, 0x620c, 0x18 },
+{ "linux/android/binder.h", "BINDER_SET_CONTEXT_MGR", _IOC_WRITE, 0x6207, 0x04 },
+{ "linux/android/binder.h", "BINDER_SET_CONTEXT_MGR_EXT", _IOC_WRITE, 0x620d, 0x18 },
+{ "linux/android/binder.h", "BINDER_SET_IDLE_PRIORITY", _IOC_WRITE, 0x6206, 0x04 },
+{ "linux/android/binder.h", "BINDER_SET_IDLE_TIMEOUT", _IOC_WRITE, 0x6203, 0x08 },
+{ "linux/android/binder.h", "BINDER_SET_MAX_THREADS", _IOC_WRITE, 0x6205, 0x04 },
+{ "linux/android/binder.h", "BINDER_THREAD_EXIT", _IOC_WRITE, 0x6208, 0x04 },
+{ "linux/android/binder.h", "BINDER_VERSION", _IOC_READ|_IOC_WRITE, 0x6209, 0x04 },
+{ "linux/android/binder.h", "BINDER_WRITE_READ", _IOC_READ|_IOC_WRITE, 0x6201, 0x30 },
+{ "linux/android/binder.h", "BR_ACQUIRE", _IOC_READ, 0x7208, 0x10 },
+{ "linux/android/binder.h", "BR_ACQUIRE_RESULT", _IOC_READ, 0x7204, 0x04 },
+{ "linux/android/binder.h", "BR_ATTEMPT_ACQUIRE", _IOC_READ, 0x720b, 0x18 },
+{ "linux/android/binder.h", "BR_CLEAR_DEATH_NOTIFICATION_DONE", _IOC_READ, 0x7210, 0x08 },
+{ "linux/android/binder.h", "BR_DEAD_BINDER", _IOC_READ, 0x720f, 0x08 },
+{ "linux/android/binder.h", "BR_DEAD_REPLY", _IOC_NONE, 0x7205, 0x00 },
+{ "linux/android/binder.h", "BR_DECREFS", _IOC_READ, 0x720a, 0x10 },
+{ "linux/android/binder.h", "BR_ERROR", _IOC_READ, 0x7200, 0x04 },
+{ "linux/android/binder.h", "BR_FAILED_REPLY", _IOC_NONE, 0x7211, 0x00 },
+{ "linux/android/binder.h", "BR_FINISHED", _IOC_NONE, 0x720e, 0x00 },
+{ "linux/android/binder.h", "BR_INCREFS", _IOC_READ, 0x7207, 0x10 },
+{ "linux/android/binder.h", "BR_NOOP", _IOC_NONE, 0x720c, 0x00 },
+{ "linux/android/binder.h", "BR_OK", _IOC_NONE, 0x7201, 0x00 },
+{ "linux/android/binder.h", "BR_RELEASE", _IOC_READ, 0x7209, 0x10 },
+{ "linux/android/binder.h", "BR_REPLY", _IOC_READ, 0x7203, 0x40 },
+{ "linux/android/binder.h", "BR_SPAWN_LOOPER", _IOC_NONE, 0x720d, 0x00 },
+{ "linux/android/binder.h", "BR_TRANSACTION", _IOC_READ, 0x7202, 0x40 },
+{ "linux/android/binder.h", "BR_TRANSACTION_COMPLETE", _IOC_NONE, 0x7206, 0x00 },
+{ "linux/android/binder.h", "BR_TRANSACTION_SEC_CTX", _IOC_READ, 0x7202, 0x48 },
+{ "linux/android/binderfs.h", "BINDER_CTL_ADD", _IOC_READ|_IOC_WRITE, 0x6201, 0x108 },
+{ "linux/apm_bios.h", "APM_IOC_STANDBY", _IOC_NONE, 0x4101, 0x00 },
+{ "linux/apm_bios.h", "APM_IOC_SUSPEND", _IOC_NONE, 0x4102, 0x00 },
+{ "linux/arcfb.h", "FBIO_GETCONTROL2", _IOC_READ, 0x4689, 0x08 },
+{ "linux/arcfb.h", "FBIO_WAITEVENT", _IOC_NONE, 0x4688, 0x00 },
+{ "linux/aspeed-lpc-ctrl.h", "ASPEED_LPC_CTRL_IOCTL_GET_SIZE", _IOC_READ|_IOC_WRITE, 0xb200, 0x10 },
+{ "linux/aspeed-lpc-ctrl.h", "ASPEED_LPC_CTRL_IOCTL_MAP", _IOC_WRITE, 0xb201, 0x10 },
+{ "linux/aspeed-p2a-ctrl.h", "ASPEED_P2A_CTRL_IOCTL_GET_MEMORY_CONFIG", _IOC_READ|_IOC_WRITE, 0xb301, 0x10 },
+{ "linux/aspeed-p2a-ctrl.h", "ASPEED_P2A_CTRL_IOCTL_SET_WINDOW", _IOC_WRITE, 0xb300, 0x10 },
+{ "linux/atm_eni.h", "ENI_MEMDUMP", _IOC_WRITE, 0x6160, 0x10 },
+{ "linux/atm_eni.h", "ENI_SETMULT", _IOC_WRITE, 0x6167, 0x10 },
+{ "linux/atm_he.h", "HE_GET_REG", _IOC_WRITE, 0x6160, 0x10 },
+{ "linux/atm_idt77105.h", "IDT77105_GETSTAT", _IOC_WRITE, 0x6132, 0x10 },
+{ "linux/atm_idt77105.h", "IDT77105_GETSTATZ", _IOC_WRITE, 0x6133, 0x10 },
+{ "linux/atm_nicstar.h", "NS_ADJBUFLEV", _IOC_NONE, 0x6163, 0x00 },
+{ "linux/atm_nicstar.h", "NS_GETPSTAT", _IOC_READ|_IOC_WRITE, 0x6161, 0x10 },
+{ "linux/atm_nicstar.h", "NS_SETBUFLEV", _IOC_WRITE, 0x6162, 0x10 },
+{ "linux/atm_tcp.h", "ATMTCP_CREATE", _IOC_NONE, 0x618e, 0x00 },
+{ "linux/atm_tcp.h", "ATMTCP_REMOVE", _IOC_NONE, 0x618f, 0x00 },
+{ "linux/atm_tcp.h", "SIOCSIFATMTCP", _IOC_NONE, 0x6180, 0x00 },
+{ "linux/atm_zatm.h", "ZATM_GETPOOL", _IOC_WRITE, 0x6161, 0x10 },
+{ "linux/atm_zatm.h", "ZATM_GETPOOLZ", _IOC_WRITE, 0x6162, 0x10 },
+{ "linux/atm_zatm.h", "ZATM_SETPOOL", _IOC_WRITE, 0x6163, 0x10 },
+{ "linux/atmarp.h", "ATMARPD_CTRL", _IOC_NONE, 0x61e1, 0x00 },
+{ "linux/atmarp.h", "ATMARP_ENCAP", _IOC_NONE, 0x61e5, 0x00 },
+{ "linux/atmarp.h", "ATMARP_MKIP", _IOC_NONE, 0x61e2, 0x00 },
+{ "linux/atmarp.h", "ATMARP_SETENTRY", _IOC_NONE, 0x61e3, 0x00 },
+{ "linux/atmbr2684.h", "BR2684_SETFILT", _IOC_WRITE, 0x6190, 0x1c },
+{ "linux/atmclip.h", "SIOCMKCLIP", _IOC_NONE, 0x61e0, 0x00 },
+{ "linux/atmdev.h", "ATM_ADDADDR", _IOC_WRITE, 0x6188, 0x10 },
+{ "linux/atmdev.h", "ATM_ADDLECSADDR", _IOC_WRITE, 0x618e, 0x10 },
+{ "linux/atmdev.h", "ATM_ADDPARTY", _IOC_WRITE, 0x61f4, 0x10 },
+{ "linux/atmdev.h", "ATM_DELADDR", _IOC_WRITE, 0x6189, 0x10 },
+{ "linux/atmdev.h", "ATM_DELLECSADDR", _IOC_WRITE, 0x618f, 0x10 },
+{ "linux/atmdev.h", "ATM_DROPPARTY", _IOC_WRITE, 0x61f5, 0x04 },
+{ "linux/atmdev.h", "ATM_GETADDR", _IOC_WRITE, 0x6186, 0x10 },
+{ "linux/atmdev.h", "ATM_GETCIRANGE", _IOC_WRITE, 0x618a, 0x10 },
+{ "linux/atmdev.h", "ATM_GETESI", _IOC_WRITE, 0x6185, 0x10 },
+{ "linux/atmdev.h", "ATM_GETLECSADDR", _IOC_WRITE, 0x6190, 0x10 },
+{ "linux/atmdev.h", "ATM_GETLINKRATE", _IOC_WRITE, 0x6181, 0x10 },
+{ "linux/atmdev.h", "ATM_GETLOOP", _IOC_WRITE, 0x6152, 0x10 },
+{ "linux/atmdev.h", "ATM_GETNAMES", _IOC_WRITE, 0x6183, 0x10 },
+{ "linux/atmdev.h", "ATM_GETSTAT", _IOC_WRITE, 0x6150, 0x10 },
+{ "linux/atmdev.h", "ATM_GETSTATZ", _IOC_WRITE, 0x6151, 0x10 },
+{ "linux/atmdev.h", "ATM_GETTYPE", _IOC_WRITE, 0x6184, 0x10 },
+{ "linux/atmdev.h", "ATM_NEWBACKENDIF", _IOC_WRITE, 0x61f3, 0x02 },
+{ "linux/atmdev.h", "ATM_QUERYLOOP", _IOC_WRITE, 0x6154, 0x10 },
+{ "linux/atmdev.h", "ATM_RSTADDR", _IOC_WRITE, 0x6187, 0x10 },
+{ "linux/atmdev.h", "ATM_SETBACKEND", _IOC_WRITE, 0x61f2, 0x02 },
+{ "linux/atmdev.h", "ATM_SETCIRANGE", _IOC_WRITE, 0x618b, 0x10 },
+{ "linux/atmdev.h", "ATM_SETESI", _IOC_WRITE, 0x618c, 0x10 },
+{ "linux/atmdev.h", "ATM_SETESIF", _IOC_WRITE, 0x618d, 0x10 },
+{ "linux/atmdev.h", "ATM_SETLOOP", _IOC_WRITE, 0x6153, 0x10 },
+{ "linux/atmdev.h", "ATM_SETSC", _IOC_WRITE, 0x61f1, 0x04 },
+{ "linux/atmlec.h", "ATMLEC_CTRL", _IOC_NONE, 0x61d0, 0x00 },
+{ "linux/atmlec.h", "ATMLEC_DATA", _IOC_NONE, 0x61d1, 0x00 },
+{ "linux/atmlec.h", "ATMLEC_MCAST", _IOC_NONE, 0x61d2, 0x00 },
+{ "linux/atmmpc.h", "ATMMPC_CTRL", _IOC_NONE, 0x61d8, 0x00 },
+{ "linux/atmmpc.h", "ATMMPC_DATA", _IOC_NONE, 0x61d9, 0x00 },
+{ "linux/atmsvc.h", "ATMSIGD_CTRL", _IOC_NONE, 0x61f0, 0x00 },
+{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_ASKUMOUNT", _IOC_READ|_IOC_WRITE, 0x937d, 0x18 },
+{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_CATATONIC", _IOC_READ|_IOC_WRITE, 0x9379, 0x18 },
+{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_CLOSEMOUNT", _IOC_READ|_IOC_WRITE, 0x9375, 0x18 },
+{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_EXPIRE", _IOC_READ|_IOC_WRITE, 0x937c, 0x18 },
+{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_FAIL", _IOC_READ|_IOC_WRITE, 0x9377, 0x18 },
+{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_ISMOUNTPOINT", _IOC_READ|_IOC_WRITE, 0x937e, 0x18 },
+{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_OPENMOUNT", _IOC_READ|_IOC_WRITE, 0x9374, 0x18 },
+{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_PROTOSUBVER", _IOC_READ|_IOC_WRITE, 0x9373, 0x18 },
+{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_PROTOVER", _IOC_READ|_IOC_WRITE, 0x9372, 0x18 },
+{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_READY", _IOC_READ|_IOC_WRITE, 0x9376, 0x18 },
+{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_REQUESTER", _IOC_READ|_IOC_WRITE, 0x937b, 0x18 },
+{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_SETPIPEFD", _IOC_READ|_IOC_WRITE, 0x9378, 0x18 },
+{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_TIMEOUT", _IOC_READ|_IOC_WRITE, 0x937a, 0x18 },
+{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_VERSION", _IOC_READ|_IOC_WRITE, 0x9371, 0x18 },
+{ "linux/auto_fs.h", "AUTOFS_IOC_ASKUMOUNT", _IOC_READ, 0x9370, 0x04 },
+{ "linux/auto_fs.h", "AUTOFS_IOC_CATATONIC", _IOC_NONE, 0x9362, 0x00 },
+{ "linux/auto_fs.h", "AUTOFS_IOC_EXPIRE", _IOC_READ, 0x9365, 0x10c },
+{ "linux/auto_fs.h", "AUTOFS_IOC_EXPIRE_MULTI", _IOC_WRITE, 0x9366, 0x04 },
+{ "linux/auto_fs.h", "AUTOFS_IOC_FAIL", _IOC_NONE, 0x9361, 0x00 },
+{ "linux/auto_fs.h", "AUTOFS_IOC_PROTOSUBVER", _IOC_READ, 0x9367, 0x04 },
+{ "linux/auto_fs.h", "AUTOFS_IOC_PROTOVER", _IOC_READ, 0x9363, 0x04 },
+{ "linux/auto_fs.h", "AUTOFS_IOC_READY", _IOC_NONE, 0x9360, 0x00 },
+{ "linux/auto_fs.h", "AUTOFS_IOC_SETTIMEOUT", _IOC_READ|_IOC_WRITE, 0x9364, 0x08 },
+{ "linux/auto_fs.h", "AUTOFS_IOC_SETTIMEOUT32", _IOC_READ|_IOC_WRITE, 0x9364, 0x04 },
+{ "linux/blkpg.h", "BLKPG", _IOC_NONE, 0x1269, 0x00 },
+{ "linux/blkzoned.h", "BLKCLOSEZONE", _IOC_WRITE, 0x1287, 0x10 },
+{ "linux/blkzoned.h", "BLKFINISHZONE", _IOC_WRITE, 0x1288, 0x10 },
+{ "linux/blkzoned.h", "BLKGETNRZONES", _IOC_READ, 0x1285, 0x04 },
+{ "linux/blkzoned.h", "BLKGETZONESZ", _IOC_READ, 0x1284, 0x04 },
+{ "linux/blkzoned.h", "BLKOPENZONE", _IOC_WRITE, 0x1286, 0x10 },
+{ "linux/blkzoned.h", "BLKREPORTZONE", _IOC_READ|_IOC_WRITE, 0x1282, 0x10 },
+{ "linux/blkzoned.h", "BLKRESETZONE", _IOC_WRITE, 0x1283, 0x10 },
+{ "linux/bt-bmc.h", "BT_BMC_IOCTL_SMS_ATN", _IOC_NONE, 0xb100, 0x00 },
+{ "linux/btrfs.h", "BTRFS_IOC_ADD_DEV", _IOC_WRITE, 0x940a, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_BALANCE", _IOC_WRITE, 0x940c, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_BALANCE_CTL", _IOC_WRITE, 0x9421, 0x04 },
+{ "linux/btrfs.h", "BTRFS_IOC_BALANCE_PROGRESS", _IOC_READ, 0x9422, 0x400 },
+{ "linux/btrfs.h", "BTRFS_IOC_BALANCE_V2", _IOC_READ|_IOC_WRITE, 0x9420, 0x400 },
+{ "linux/btrfs.h", "BTRFS_IOC_CLONE", _IOC_WRITE, 0x9409, 0x04 },
+{ "linux/btrfs.h", "BTRFS_IOC_CLONE_RANGE", _IOC_WRITE, 0x940d, 0x20 },
+{ "linux/btrfs.h", "BTRFS_IOC_DEFAULT_SUBVOL", _IOC_WRITE, 0x9413, 0x08 },
+{ "linux/btrfs.h", "BTRFS_IOC_DEFRAG", _IOC_WRITE, 0x9402, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_DEFRAG_RANGE", _IOC_WRITE, 0x9410, 0x30 },
+{ "linux/btrfs.h", "BTRFS_IOC_DEVICES_READY", _IOC_READ, 0x9427, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_DEV_INFO", _IOC_READ|_IOC_WRITE, 0x941e, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_DEV_REPLACE", _IOC_READ|_IOC_WRITE, 0x9435, 0xa28 },
+{ "linux/btrfs.h", "BTRFS_IOC_FILE_EXTENT_SAME", _IOC_READ|_IOC_WRITE, 0x9436, 0x18 },
+{ "linux/btrfs.h", "BTRFS_IOC_FORGET_DEV", _IOC_WRITE, 0x9405, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_FS_INFO", _IOC_READ, 0x941f, 0x400 },
+{ "linux/btrfs.h", "BTRFS_IOC_GET_DEV_STATS", _IOC_READ|_IOC_WRITE, 0x9434, 0x408 },
+{ "linux/btrfs.h", "BTRFS_IOC_GET_FEATURES", _IOC_READ, 0x9439, 0x18 },
+{ "linux/btrfs.h", "BTRFS_IOC_GET_SUBVOL_INFO", _IOC_READ, 0x943c, 0x1f8 },
+{ "linux/btrfs.h", "BTRFS_IOC_GET_SUBVOL_ROOTREF", _IOC_READ|_IOC_WRITE, 0x943d, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_GET_SUPPORTED_FEATURES", _IOC_READ, 0x9439, 0x48 },
+{ "linux/btrfs.h", "BTRFS_IOC_INO_LOOKUP", _IOC_READ|_IOC_WRITE, 0x9412, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_INO_LOOKUP_USER", _IOC_READ|_IOC_WRITE, 0x943e, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_INO_PATHS", _IOC_READ|_IOC_WRITE, 0x9423, 0x38 },
+{ "linux/btrfs.h", "BTRFS_IOC_LOGICAL_INO", _IOC_READ|_IOC_WRITE, 0x9424, 0x38 },
+{ "linux/btrfs.h", "BTRFS_IOC_LOGICAL_INO_V2", _IOC_READ|_IOC_WRITE, 0x943b, 0x38 },
+{ "linux/btrfs.h", "BTRFS_IOC_QGROUP_ASSIGN", _IOC_WRITE, 0x9429, 0x18 },
+{ "linux/btrfs.h", "BTRFS_IOC_QGROUP_CREATE", _IOC_WRITE, 0x942a, 0x10 },
+{ "linux/btrfs.h", "BTRFS_IOC_QGROUP_LIMIT", _IOC_READ, 0x942b, 0x30 },
+{ "linux/btrfs.h", "BTRFS_IOC_QUOTA_CTL", _IOC_READ|_IOC_WRITE, 0x9428, 0x10 },
+{ "linux/btrfs.h", "BTRFS_IOC_QUOTA_RESCAN", _IOC_WRITE, 0x942c, 0x40 },
+{ "linux/btrfs.h", "BTRFS_IOC_QUOTA_RESCAN_STATUS", _IOC_READ, 0x942d, 0x40 },
+{ "linux/btrfs.h", "BTRFS_IOC_QUOTA_RESCAN_WAIT", _IOC_NONE, 0x942e, 0x00 },
+{ "linux/btrfs.h", "BTRFS_IOC_RESIZE", _IOC_WRITE, 0x9403, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_RM_DEV", _IOC_WRITE, 0x940b, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_RM_DEV_V2", _IOC_WRITE, 0x943a, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_SCAN_DEV", _IOC_WRITE, 0x9404, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_SCRUB", _IOC_READ|_IOC_WRITE, 0x941b, 0x400 },
+{ "linux/btrfs.h", "BTRFS_IOC_SCRUB_CANCEL", _IOC_NONE, 0x941c, 0x00 },
+{ "linux/btrfs.h", "BTRFS_IOC_SCRUB_PROGRESS", _IOC_READ|_IOC_WRITE, 0x941d, 0x400 },
+{ "linux/btrfs.h", "BTRFS_IOC_SEND", _IOC_WRITE, 0x9426, 0x48 },
+{ "linux/btrfs.h", "BTRFS_IOC_SET_FEATURES", _IOC_WRITE, 0x9439, 0x30 },
+{ "linux/btrfs.h", "BTRFS_IOC_SET_RECEIVED_SUBVOL", _IOC_READ|_IOC_WRITE, 0x9425, 0xc8 },
+{ "linux/btrfs.h", "BTRFS_IOC_SNAP_CREATE", _IOC_WRITE, 0x9401, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_SNAP_CREATE_V2", _IOC_WRITE, 0x9417, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_SNAP_DESTROY", _IOC_WRITE, 0x940f, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_SNAP_DESTROY_V2", _IOC_WRITE, 0x943f, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_SPACE_INFO", _IOC_READ|_IOC_WRITE, 0x9414, 0x10 },
+{ "linux/btrfs.h", "BTRFS_IOC_START_SYNC", _IOC_READ, 0x9418, 0x08 },
+{ "linux/btrfs.h", "BTRFS_IOC_SUBVOL_CREATE", _IOC_WRITE, 0x940e, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_SUBVOL_CREATE_V2", _IOC_WRITE, 0x9418, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_SUBVOL_GETFLAGS", _IOC_READ, 0x9419, 0x08 },
+{ "linux/btrfs.h", "BTRFS_IOC_SUBVOL_SETFLAGS", _IOC_WRITE, 0x941a, 0x08 },
+{ "linux/btrfs.h", "BTRFS_IOC_SYNC", _IOC_NONE, 0x9408, 0x00 },
+{ "linux/btrfs.h", "BTRFS_IOC_TRANS_END", _IOC_NONE, 0x9407, 0x00 },
+{ "linux/btrfs.h", "BTRFS_IOC_TRANS_START", _IOC_NONE, 0x9406, 0x00 },
+{ "linux/btrfs.h", "BTRFS_IOC_TREE_SEARCH", _IOC_READ|_IOC_WRITE, 0x9411, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_TREE_SEARCH_V2", _IOC_READ|_IOC_WRITE, 0x9411, 0x70 },
+{ "linux/btrfs.h", "BTRFS_IOC_WAIT_SYNC", _IOC_WRITE, 0x9416, 0x08 },
+{ "linux/capi.h", "CAPI_CLR_FLAGS", _IOC_READ, 0x4325, 0x04 },
+{ "linux/capi.h", "CAPI_GET_ERRCODE", _IOC_READ, 0x4321, 0x02 },
+{ "linux/capi.h", "CAPI_GET_FLAGS", _IOC_READ, 0x4323, 0x04 },
+{ "linux/capi.h", "CAPI_GET_MANUFACTURER", _IOC_READ|_IOC_WRITE, 0x4306, 0x04 },
+{ "linux/capi.h", "CAPI_GET_PROFILE", _IOC_READ|_IOC_WRITE, 0x4309, 0x40 },
+{ "linux/capi.h", "CAPI_GET_SERIAL", _IOC_READ|_IOC_WRITE, 0x4308, 0x04 },
+{ "linux/capi.h", "CAPI_GET_VERSION", _IOC_READ|_IOC_WRITE, 0x4307, 0x10 },
+{ "linux/capi.h", "CAPI_INSTALLED", _IOC_READ, 0x4322, 0x02 },
+{ "linux/capi.h", "CAPI_MANUFACTURER_CMD", _IOC_READ|_IOC_WRITE, 0x4320, 0x10 },
+{ "linux/capi.h", "CAPI_NCCI_GETUNIT", _IOC_READ, 0x4327, 0x04 },
+{ "linux/capi.h", "CAPI_NCCI_OPENCOUNT", _IOC_READ, 0x4326, 0x04 },
+{ "linux/capi.h", "CAPI_REGISTER", _IOC_WRITE, 0x4301, 0x0c },
+{ "linux/capi.h", "CAPI_SET_FLAGS", _IOC_READ, 0x4324, 0x04 },
+{ "linux/cciss_ioctl.h", "CCISS_BIG_PASSTHRU", _IOC_READ|_IOC_WRITE, 0x4212, 0x60 },
+{ "linux/cciss_ioctl.h", "CCISS_DEREGDISK", _IOC_NONE, 0x420c, 0x00 },
+{ "linux/cciss_ioctl.h", "CCISS_GETBUSTYPES", _IOC_READ, 0x4207, 0x04 },
+{ "linux/cciss_ioctl.h", "CCISS_GETDRIVVER", _IOC_READ, 0x4209, 0x04 },
+{ "linux/cciss_ioctl.h", "CCISS_GETFIRMVER", _IOC_READ, 0x4208, 0x04 },
+{ "linux/cciss_ioctl.h", "CCISS_GETHEARTBEAT", _IOC_READ, 0x4206, 0x04 },
+{ "linux/cciss_ioctl.h", "CCISS_GETINTINFO", _IOC_READ, 0x4202, 0x08 },
+{ "linux/cciss_ioctl.h", "CCISS_GETLUNINFO", _IOC_READ, 0x4211, 0x0c },
+{ "linux/cciss_ioctl.h", "CCISS_GETNODENAME", _IOC_READ, 0x4204, 0x10 },
+{ "linux/cciss_ioctl.h", "CCISS_GETPCIINFO", _IOC_READ, 0x4201, 0x08 },
+{ "linux/cciss_ioctl.h", "CCISS_PASSTHRU", _IOC_READ|_IOC_WRITE, 0x420b, 0x58 },
+{ "linux/cciss_ioctl.h", "CCISS_REGNEWD", _IOC_NONE, 0x420e, 0x00 },
+{ "linux/cciss_ioctl.h", "CCISS_REGNEWDISK", _IOC_WRITE, 0x420d, 0x04 },
+{ "linux/cciss_ioctl.h", "CCISS_RESCANDISK", _IOC_NONE, 0x4210, 0x00 },
+{ "linux/cciss_ioctl.h", "CCISS_REVALIDVOLS", _IOC_NONE, 0x420a, 0x00 },
+{ "linux/cciss_ioctl.h", "CCISS_SETINTINFO", _IOC_WRITE, 0x4203, 0x08 },
+{ "linux/cciss_ioctl.h", "CCISS_SETNODENAME", _IOC_WRITE, 0x4205, 0x10 },
+{ "linux/cdrom.h", "CDROMAUDIOBUFSIZ", 0, 0x5382, 0 },
+{ "linux/cdrom.h", "CDROMCLOSETRAY", 0, 0x5319, 0 },
+{ "linux/cdrom.h", "CDROMEJECT", 0, 0x5309, 0 },
+{ "linux/cdrom.h", "CDROMEJECT_SW", 0, 0x530f, 0 },
+{ "linux/cdrom.h", "CDROMGETSPINDOWN", 0, 0x531d, 0 },
+{ "linux/cdrom.h", "CDROMMULTISESSION", 0, 0x5310, 0 },
+{ "linux/cdrom.h", "CDROMPAUSE", 0, 0x5301, 0 },
+{ "linux/cdrom.h", "CDROMPLAYBLK", 0, 0x5317, 0 },
+{ "linux/cdrom.h", "CDROMPLAYMSF", 0, 0x5303, 0 },
+{ "linux/cdrom.h", "CDROMPLAYTRKIND", 0, 0x5304, 0 },
+{ "linux/cdrom.h", "CDROMREADALL", 0, 0x5318, 0 },
+{ "linux/cdrom.h", "CDROMREADAUDIO", 0, 0x530e, 0 },
+{ "linux/cdrom.h", "CDROMREADCOOKED", 0, 0x5315, 0 },
+{ "linux/cdrom.h", "CDROMREADMODE1", 0, 0x530d, 0 },
+{ "linux/cdrom.h", "CDROMREADMODE2", 0, 0x530c, 0 },
+{ "linux/cdrom.h", "CDROMREADRAW", 0, 0x5314, 0 },
+{ "linux/cdrom.h", "CDROMREADTOCENTRY", 0, 0x5306, 0 },
+{ "linux/cdrom.h", "CDROMREADTOCHDR", 0, 0x5305, 0 },
+{ "linux/cdrom.h", "CDROMRESET", 0, 0x5312, 0 },
+{ "linux/cdrom.h", "CDROMRESUME", 0, 0x5302, 0 },
+{ "linux/cdrom.h", "CDROMSEEK", 0, 0x5316, 0 },
+{ "linux/cdrom.h", "CDROMSETSPINDOWN", 0, 0x531e, 0 },
+{ "linux/cdrom.h", "CDROMSTART", 0, 0x5308, 0 },
+{ "linux/cdrom.h", "CDROMSTOP", 0, 0x5307, 0 },
+{ "linux/cdrom.h", "CDROMSUBCHNL", 0, 0x530b, 0 },
+{ "linux/cdrom.h", "CDROMVOLCTRL", 0, 0x530a, 0 },
+{ "linux/cdrom.h", "CDROMVOLREAD", 0, 0x5313, 0 },
+{ "linux/cdrom.h", "CDROM_CHANGER_NSLOTS", 0, 0x5328, 0 },
+{ "linux/cdrom.h", "CDROM_CLEAR_OPTIONS", 0, 0x5321, 0 },
+{ "linux/cdrom.h", "CDROM_DEBUG", 0, 0x5330, 0 },
+{ "linux/cdrom.h", "CDROM_DISC_STATUS", 0, 0x5327, 0 },
+{ "linux/cdrom.h", "CDROM_DRIVE_STATUS", 0, 0x5326, 0 },
+{ "linux/cdrom.h", "CDROM_GET_CAPABILITY", 0, 0x5331, 0 },
+{ "linux/cdrom.h", "CDROM_GET_MCN", 0, 0x5311, 0 },
+{ "linux/cdrom.h", "CDROM_LAST_WRITTEN", 0, 0x5395, 0 },
+{ "linux/cdrom.h", "CDROM_LOCKDOOR", 0, 0x5329, 0 },
+{ "linux/cdrom.h", "CDROM_MEDIA_CHANGED", 0, 0x5325, 0 },
+{ "linux/cdrom.h", "CDROM_NEXT_WRITABLE", 0, 0x5394, 0 },
+{ "linux/cdrom.h", "CDROM_SELECT_DISC", 0, 0x5323, 0 },
+{ "linux/cdrom.h", "CDROM_SELECT_SPEED", 0, 0x5322, 0 },
+{ "linux/cdrom.h", "CDROM_SEND_PACKET", 0, 0x5393, 0 },
+{ "linux/cdrom.h", "CDROM_SET_OPTIONS", 0, 0x5320, 0 },
+{ "linux/cdrom.h", "DVD_AUTH", 0, 0x5392, 0 },
+{ "linux/cdrom.h", "DVD_READ_STRUCT", 0, 0x5390, 0 },
+{ "linux/cdrom.h", "DVD_WRITE_STRUCT", 0, 0x5391, 0 },
+{ "linux/cec.h", "CEC_ADAP_G_CAPS", _IOC_READ|_IOC_WRITE, 0x6100, 0x4c },
+{ "linux/cec.h", "CEC_ADAP_G_CONNECTOR_INFO", _IOC_READ, 0x610a, 0x44 },
+{ "linux/cec.h", "CEC_ADAP_G_LOG_ADDRS", _IOC_READ, 0x6103, 0x5c },
+{ "linux/cec.h", "CEC_ADAP_G_PHYS_ADDR", _IOC_READ, 0x6101, 0x02 },
+{ "linux/cec.h", "CEC_ADAP_S_LOG_ADDRS", _IOC_READ|_IOC_WRITE, 0x6104, 0x5c },
+{ "linux/cec.h", "CEC_ADAP_S_PHYS_ADDR", _IOC_WRITE, 0x6102, 0x02 },
+{ "linux/cec.h", "CEC_DQEVENT", _IOC_READ|_IOC_WRITE, 0x6107, 0x50 },
+{ "linux/cec.h", "CEC_G_MODE", _IOC_READ, 0x6108, 0x04 },
+{ "linux/cec.h", "CEC_RECEIVE", _IOC_READ|_IOC_WRITE, 0x6106, 0x38 },
+{ "linux/cec.h", "CEC_S_MODE", _IOC_WRITE, 0x6109, 0x04 },
+{ "linux/cec.h", "CEC_TRANSMIT", _IOC_READ|_IOC_WRITE, 0x6105, 0x38 },
+{ "linux/chio.h", "CHIOEXCHANGE", _IOC_WRITE, 0x6302, 0x1c },
+{ "linux/chio.h", "CHIOGELEM", _IOC_WRITE, 0x6310, 0x6c },
+{ "linux/chio.h", "CHIOGPARAMS", _IOC_READ, 0x6306, 0x14 },
+{ "linux/chio.h", "CHIOGPICKER", _IOC_READ, 0x6304, 0x04 },
+{ "linux/chio.h", "CHIOGSTATUS", _IOC_WRITE, 0x6308, 0x10 },
+{ "linux/chio.h", "CHIOGVPARAMS", _IOC_READ, 0x6313, 0x70 },
+{ "linux/chio.h", "CHIOINITELEM", _IOC_NONE, 0x6311, 0x00 },
+{ "linux/chio.h", "CHIOMOVE", _IOC_WRITE, 0x6301, 0x14 },
+{ "linux/chio.h", "CHIOPOSITION", _IOC_WRITE, 0x6303, 0x0c },
+{ "linux/chio.h", "CHIOSPICKER", _IOC_WRITE, 0x6305, 0x04 },
+{ "linux/chio.h", "CHIOSVOLTAG", _IOC_WRITE, 0x6312, 0x30 },
+{ "linux/cm4000_cs.h", "CM_IOCARDOFF", _IOC_NONE, 0x6304, 0x00 },
+{ "linux/cm4000_cs.h", "CM_IOCGATR", _IOC_READ|_IOC_WRITE, 0x6301, 0x08 },
+{ "linux/cm4000_cs.h", "CM_IOCGSTATUS", _IOC_READ, 0x6300, 0x08 },
+{ "linux/cm4000_cs.h", "CM_IOCSPTS", _IOC_WRITE, 0x6302, 0x08 },
+{ "linux/cm4000_cs.h", "CM_IOCSRDR", _IOC_NONE, 0x6303, 0x00 },
+{ "linux/cm4000_cs.h", "CM_IOSDBGLVL", _IOC_WRITE, 0x63fa, 0x08 },
+{ "linux/coda.h", "CIOC_KERNEL_VERSION", _IOC_READ|_IOC_WRITE, 0x630a, 0x08 },
+{ "linux/dm-ioctl.h", "DM_DEV_ARM_POLL", _IOC_READ|_IOC_WRITE, 0xfd10, 0x138 },
+{ "linux/dm-ioctl.h", "DM_DEV_CREATE", _IOC_READ|_IOC_WRITE, 0xfd03, 0x138 },
+{ "linux/dm-ioctl.h", "DM_DEV_REMOVE", _IOC_READ|_IOC_WRITE, 0xfd04, 0x138 },
+{ "linux/dm-ioctl.h", "DM_DEV_RENAME", _IOC_READ|_IOC_WRITE, 0xfd05, 0x138 },
+{ "linux/dm-ioctl.h", "DM_DEV_SET_GEOMETRY", _IOC_READ|_IOC_WRITE, 0xfd0f, 0x138 },
+{ "linux/dm-ioctl.h", "DM_DEV_STATUS", _IOC_READ|_IOC_WRITE, 0xfd07, 0x138 },
+{ "linux/dm-ioctl.h", "DM_DEV_SUSPEND", _IOC_READ|_IOC_WRITE, 0xfd06, 0x138 },
+{ "linux/dm-ioctl.h", "DM_DEV_WAIT", _IOC_READ|_IOC_WRITE, 0xfd08, 0x138 },
+{ "linux/dm-ioctl.h", "DM_GET_TARGET_VERSION", _IOC_READ|_IOC_WRITE, 0xfd11, 0x138 },
+{ "linux/dm-ioctl.h", "DM_LIST_DEVICES", _IOC_READ|_IOC_WRITE, 0xfd02, 0x138 },
+{ "linux/dm-ioctl.h", "DM_LIST_VERSIONS", _IOC_READ|_IOC_WRITE, 0xfd0d, 0x138 },
+{ "linux/dm-ioctl.h", "DM_REMOVE_ALL", _IOC_READ|_IOC_WRITE, 0xfd01, 0x138 },
+{ "linux/dm-ioctl.h", "DM_TABLE_CLEAR", _IOC_READ|_IOC_WRITE, 0xfd0a, 0x138 },
+{ "linux/dm-ioctl.h", "DM_TABLE_DEPS", _IOC_READ|_IOC_WRITE, 0xfd0b, 0x138 },
+{ "linux/dm-ioctl.h", "DM_TABLE_LOAD", _IOC_READ|_IOC_WRITE, 0xfd09, 0x138 },
+{ "linux/dm-ioctl.h", "DM_TABLE_STATUS", _IOC_READ|_IOC_WRITE, 0xfd0c, 0x138 },
+{ "linux/dm-ioctl.h", "DM_TARGET_MSG", _IOC_READ|_IOC_WRITE, 0xfd0e, 0x138 },
+{ "linux/dm-ioctl.h", "DM_VERSION", _IOC_READ|_IOC_WRITE, 0xfd00, 0x138 },
+{ "linux/dma-buf.h", "DMA_BUF_IOCTL_SYNC", _IOC_WRITE, 0x6200, 0x08 },
+{ "linux/dma-buf.h", "DMA_BUF_SET_NAME_A", _IOC_WRITE, 0x6201, 0x04 },
+{ "linux/dma-buf.h", "DMA_BUF_SET_NAME_B", _IOC_WRITE, 0x6201, 0x08 },
+{ "linux/dma-heap.h", "DMA_HEAP_IOCTL_ALLOC", _IOC_READ|_IOC_WRITE, 0x4800, 0x18 },
+{ "linux/dn.h", "OSIOCGNETADDR", _IOC_READ, 0x89e1, 0x04 },
+{ "linux/dn.h", "OSIOCSNETADDR", _IOC_WRITE, 0x89e0, 0x04 },
+{ "linux/dvb/audio.h", "AUDIO_BILINGUAL_CHANNEL_SELECT", _IOC_NONE, 0x6f14, 0x00 },
+{ "linux/dvb/audio.h", "AUDIO_CHANNEL_SELECT", _IOC_NONE, 0x6f09, 0x00 },
+{ "linux/dvb/audio.h", "AUDIO_CLEAR_BUFFER", _IOC_NONE, 0x6f0c, 0x00 },
+{ "linux/dvb/audio.h", "AUDIO_CONTINUE", _IOC_NONE, 0x6f04, 0x00 },
+{ "linux/dvb/audio.h", "AUDIO_GET_CAPABILITIES", _IOC_READ, 0x6f0b, 0x04 },
+{ "linux/dvb/audio.h", "AUDIO_GET_STATUS", _IOC_READ, 0x6f0a, 0x20 },
+{ "linux/dvb/audio.h", "AUDIO_PAUSE", _IOC_NONE, 0x6f03, 0x00 },
+{ "linux/dvb/audio.h", "AUDIO_PLAY", _IOC_NONE, 0x6f02, 0x00 },
+{ "linux/dvb/audio.h", "AUDIO_SELECT_SOURCE", _IOC_NONE, 0x6f05, 0x00 },
+{ "linux/dvb/audio.h", "AUDIO_SET_AV_SYNC", _IOC_NONE, 0x6f07, 0x00 },
+{ "linux/dvb/audio.h", "AUDIO_SET_BYPASS_MODE", _IOC_NONE, 0x6f08, 0x00 },
+{ "linux/dvb/audio.h", "AUDIO_SET_ID", _IOC_NONE, 0x6f0d, 0x00 },
+{ "linux/dvb/audio.h", "AUDIO_SET_MIXER", _IOC_WRITE, 0x6f0e, 0x08 },
+{ "linux/dvb/audio.h", "AUDIO_SET_MUTE", _IOC_NONE, 0x6f06, 0x00 },
+{ "linux/dvb/audio.h", "AUDIO_SET_STREAMTYPE", _IOC_NONE, 0x6f0f, 0x00 },
+{ "linux/dvb/audio.h", "AUDIO_STOP", _IOC_NONE, 0x6f01, 0x00 },
+{ "linux/dvb/ca.h", "CA_GET_CAP", _IOC_READ, 0x6f81, 0x10 },
+{ "linux/dvb/ca.h", "CA_GET_DESCR_INFO", _IOC_READ, 0x6f83, 0x08 },
+{ "linux/dvb/ca.h", "CA_GET_MSG", _IOC_READ, 0x6f84, 0x10c },
+{ "linux/dvb/ca.h", "CA_GET_SLOT_INFO", _IOC_READ, 0x6f82, 0x0c },
+{ "linux/dvb/ca.h", "CA_RESET", _IOC_NONE, 0x6f80, 0x00 },
+{ "linux/dvb/ca.h", "CA_SEND_MSG", _IOC_WRITE, 0x6f85, 0x10c },
+{ "linux/dvb/ca.h", "CA_SET_DESCR", _IOC_WRITE, 0x6f86, 0x10 },
+{ "linux/dvb/dmx.h", "DMX_ADD_PID", _IOC_WRITE, 0x6f33, 0x02 },
+{ "linux/dvb/dmx.h", "DMX_DQBUF", _IOC_READ|_IOC_WRITE, 0x6f40, 0x18 },
+{ "linux/dvb/dmx.h", "DMX_EXPBUF", _IOC_READ|_IOC_WRITE, 0x6f3e, 0x0c },
+{ "linux/dvb/dmx.h", "DMX_GET_PES_PIDS", _IOC_READ, 0x6f2f, 0x0a },
+{ "linux/dvb/dmx.h", "DMX_GET_STC", _IOC_READ|_IOC_WRITE, 0x6f32, 0x10 },
+{ "linux/dvb/dmx.h", "DMX_QBUF", _IOC_READ|_IOC_WRITE, 0x6f3f, 0x18 },
+{ "linux/dvb/dmx.h", "DMX_QUERYBUF", _IOC_READ|_IOC_WRITE, 0x6f3d, 0x18 },
+{ "linux/dvb/dmx.h", "DMX_REMOVE_PID", _IOC_WRITE, 0x6f34, 0x02 },
+{ "linux/dvb/dmx.h", "DMX_REQBUFS", _IOC_READ|_IOC_WRITE, 0x6f3c, 0x08 },
+{ "linux/dvb/dmx.h", "DMX_SET_BUFFER_SIZE", _IOC_NONE, 0x6f2d, 0x00 },
+{ "linux/dvb/dmx.h", "DMX_SET_FILTER", _IOC_WRITE, 0x6f2b, 0x3c },
+{ "linux/dvb/dmx.h", "DMX_SET_PES_FILTER", _IOC_WRITE, 0x6f2c, 0x14 },
+{ "linux/dvb/dmx.h", "DMX_START", _IOC_NONE, 0x6f29, 0x00 },
+{ "linux/dvb/dmx.h", "DMX_STOP", _IOC_NONE, 0x6f2a, 0x00 },
+{ "linux/dvb/frontend.h", "FE_DISEQC_RECV_SLAVE_REPLY", _IOC_READ, 0x6f40, 0x0c },
+{ "linux/dvb/frontend.h", "FE_DISEQC_RESET_OVERLOAD", _IOC_NONE, 0x6f3e, 0x00 },
+{ "linux/dvb/frontend.h", "FE_DISEQC_SEND_BURST", _IOC_NONE, 0x6f41, 0x00 },
+{ "linux/dvb/frontend.h", "FE_DISEQC_SEND_MASTER_CMD", _IOC_WRITE, 0x6f3f, 0x07 },
+{ "linux/dvb/frontend.h", "FE_DISHNETWORK_SEND_LEGACY_CMD", _IOC_NONE, 0x6f50, 0x00 },
+{ "linux/dvb/frontend.h", "FE_ENABLE_HIGH_LNB_VOLTAGE", _IOC_NONE, 0x6f44, 0x00 },
+{ "linux/dvb/frontend.h", "FE_GET_EVENT", _IOC_READ, 0x6f4e, 0x28 },
+{ "linux/dvb/frontend.h", "FE_GET_FRONTEND", _IOC_READ, 0x6f4d, 0x24 },
+{ "linux/dvb/frontend.h", "FE_GET_INFO", _IOC_READ, 0x6f3d, 0xa8 },
+{ "linux/dvb/frontend.h", "FE_GET_PROPERTY", _IOC_READ, 0x6f53, 0x10 },
+{ "linux/dvb/frontend.h", "FE_READ_BER", _IOC_READ, 0x6f46, 0x04 },
+{ "linux/dvb/frontend.h", "FE_READ_SIGNAL_STRENGTH", _IOC_READ, 0x6f47, 0x02 },
+{ "linux/dvb/frontend.h", "FE_READ_SNR", _IOC_READ, 0x6f48, 0x02 },
+{ "linux/dvb/frontend.h", "FE_READ_STATUS", _IOC_READ, 0x6f45, 0x04 },
+{ "linux/dvb/frontend.h", "FE_READ_UNCORRECTED_BLOCKS", _IOC_READ, 0x6f49, 0x04 },
+{ "linux/dvb/frontend.h", "FE_SET_FRONTEND", _IOC_WRITE, 0x6f4c, 0x24 },
+{ "linux/dvb/frontend.h", "FE_SET_FRONTEND_TUNE_MODE", _IOC_NONE, 0x6f51, 0x00 },
+{ "linux/dvb/frontend.h", "FE_SET_PROPERTY", _IOC_WRITE, 0x6f52, 0x10 },
+{ "linux/dvb/frontend.h", "FE_SET_TONE", _IOC_NONE, 0x6f42, 0x00 },
+{ "linux/dvb/frontend.h", "FE_SET_VOLTAGE", _IOC_NONE, 0x6f43, 0x00 },
+{ "linux/dvb/net.h", "NET_ADD_IF", _IOC_READ|_IOC_WRITE, 0x6f34, 0x06 },
+{ "linux/dvb/net.h", "NET_GET_IF", _IOC_READ|_IOC_WRITE, 0x6f36, 0x06 },
+{ "linux/dvb/net.h", "NET_REMOVE_IF", _IOC_NONE, 0x6f35, 0x00 },
+{ "linux/dvb/osd.h", "OSD_GET_CAPABILITY", _IOC_READ, 0x6fa1, 0x10 },
+{ "linux/dvb/osd.h", "OSD_SEND_CMD", _IOC_WRITE, 0x6fa0, 0x20 },
+{ "linux/dvb/video.h", "VIDEO_CLEAR_BUFFER", _IOC_NONE, 0x6f22, 0x00 },
+{ "linux/dvb/video.h", "VIDEO_COMMAND", _IOC_READ|_IOC_WRITE, 0x6f3b, 0x48 },
+{ "linux/dvb/video.h", "VIDEO_CONTINUE", _IOC_NONE, 0x6f18, 0x00 },
+{ "linux/dvb/video.h", "VIDEO_FAST_FORWARD", _IOC_NONE, 0x6f1f, 0x00 },
+{ "linux/dvb/video.h", "VIDEO_FREEZE", _IOC_NONE, 0x6f17, 0x00 },
+{ "linux/dvb/video.h", "VIDEO_GET_CAPABILITIES", _IOC_READ, 0x6f21, 0x04 },
+{ "linux/dvb/video.h", "VIDEO_GET_EVENT", _IOC_READ, 0x6f1c, 0x20 },
+{ "linux/dvb/video.h", "VIDEO_GET_FRAME_COUNT", _IOC_READ, 0x6f3a, 0x08 },
+{ "linux/dvb/video.h", "VIDEO_GET_PTS", _IOC_READ, 0x6f39, 0x08 },
+{ "linux/dvb/video.h", "VIDEO_GET_SIZE", _IOC_READ, 0x6f37, 0x0c },
+{ "linux/dvb/video.h", "VIDEO_GET_STATUS", _IOC_READ, 0x6f1b, 0x14 },
+{ "linux/dvb/video.h", "VIDEO_PLAY", _IOC_NONE, 0x6f16, 0x00 },
+{ "linux/dvb/video.h", "VIDEO_SELECT_SOURCE", _IOC_NONE, 0x6f19, 0x00 },
+{ "linux/dvb/video.h", "VIDEO_SET_BLANK", _IOC_NONE, 0x6f1a, 0x00 },
+{ "linux/dvb/video.h", "VIDEO_SET_DISPLAY_FORMAT", _IOC_NONE, 0x6f1d, 0x00 },
+{ "linux/dvb/video.h", "VIDEO_SET_FORMAT", _IOC_NONE, 0x6f25, 0x00 },
+{ "linux/dvb/video.h", "VIDEO_SET_STREAMTYPE", _IOC_NONE, 0x6f24, 0x00 },
+{ "linux/dvb/video.h", "VIDEO_SLOWMOTION", _IOC_NONE, 0x6f20, 0x00 },
+{ "linux/dvb/video.h", "VIDEO_STILLPICTURE", _IOC_WRITE, 0x6f1e, 0x10 },
+{ "linux/dvb/video.h", "VIDEO_STOP", _IOC_NONE, 0x6f15, 0x00 },
+{ "linux/dvb/video.h", "VIDEO_TRY_COMMAND", _IOC_READ|_IOC_WRITE, 0x6f3c, 0x48 },
+{ "linux/fb.h", "FBIOBLANK", 0, 0x4611, 0 },
+{ "linux/fb.h", "FBIOGETCMAP", 0, 0x4604, 0 },
+{ "linux/fb.h", "FBIOGET_CON2FBMAP", 0, 0x460F, 0 },
+{ "linux/fb.h", "FBIOGET_DISPINFO", 0, 0x4618, 0 },
+{ "linux/fb.h", "FBIOGET_FSCREENINFO", 0, 0x4602, 0 },
+{ "linux/fb.h", "FBIOGET_GLYPH", 0, 0x4615, 0 },
+{ "linux/fb.h", "FBIOGET_HWCINFO", 0, 0x4616, 0 },
+{ "linux/fb.h", "FBIOGET_VBLANK", _IOC_READ, 0x4612, 0x20 },
+{ "linux/fb.h", "FBIOGET_VSCREENINFO", 0, 0x4600, 0 },
+{ "linux/fb.h", "FBIOPAN_DISPLAY", 0, 0x4606, 0 },
+{ "linux/fb.h", "FBIOPUTCMAP", 0, 0x4605, 0 },
+{ "linux/fb.h", "FBIOPUT_CON2FBMAP", 0, 0x4610, 0 },
+{ "linux/fb.h", "FBIOPUT_MODEINFO", 0, 0x4617, 0 },
+{ "linux/fb.h", "FBIOPUT_VSCREENINFO", 0, 0x4601, 0 },
+{ "linux/fb.h", "FBIO_ALLOC", 0, 0x4613, 0 },
+{ "linux/fb.h", "FBIO_CURSOR", _IOC_READ|_IOC_WRITE, 0x4608, 0x68 },
+{ "linux/fb.h", "FBIO_FREE", 0, 0x4614, 0 },
+{ "linux/fb.h", "FBIO_WAITFORVSYNC", _IOC_WRITE, 0x4620, 0x04 },
+{ "linux/fd.h", "FDCLRPRM", _IOC_NONE, 0x0241, 0x00 },
+{ "linux/fd.h", "FDDEFPRM", _IOC_WRITE, 0x0243, 0x20 },
+{ "linux/fd.h", "FDEJECT", _IOC_NONE, 0x025a, 0x00 },
+{ "linux/fd.h", "FDFLUSH", _IOC_NONE, 0x024b, 0x00 },
+{ "linux/fd.h", "FDFMTBEG", _IOC_NONE, 0x0247, 0x00 },
+{ "linux/fd.h", "FDFMTEND", _IOC_NONE, 0x0249, 0x00 },
+{ "linux/fd.h", "FDFMTTRK", _IOC_WRITE, 0x0248, 0x0c },
+{ "linux/fd.h", "FDGETDRVPRM", _IOC_READ, 0x0211, 0x80 },
+{ "linux/fd.h", "FDGETDRVSTAT", _IOC_READ, 0x0212, 0x50 },
+{ "linux/fd.h", "FDGETDRVTYP", _IOC_READ, 0x020f, 0x10 },
+{ "linux/fd.h", "FDGETFDCSTAT", _IOC_READ, 0x0215, 0x28 },
+{ "linux/fd.h", "FDGETMAXERRS", _IOC_READ, 0x020e, 0x14 },
+{ "linux/fd.h", "FDGETPRM", _IOC_READ, 0x0204, 0x20 },
+{ "linux/fd.h", "FDMSGOFF", _IOC_NONE, 0x0246, 0x00 },
+{ "linux/fd.h", "FDMSGON", _IOC_NONE, 0x0245, 0x00 },
+{ "linux/fd.h", "FDPOLLDRVSTAT", _IOC_READ, 0x0213, 0x50 },
+{ "linux/fd.h", "FDRAWCMD", _IOC_NONE, 0x0258, 0x00 },
+{ "linux/fd.h", "FDRESET", _IOC_NONE, 0x0254, 0x00 },
+{ "linux/fd.h", "FDSETDRVPRM", _IOC_WRITE, 0x0290, 0x80 },
+{ "linux/fd.h", "FDSETEMSGTRESH", _IOC_NONE, 0x024a, 0x00 },
+{ "linux/fd.h", "FDSETMAXERRS", _IOC_WRITE, 0x024c, 0x14 },
+{ "linux/fd.h", "FDSETPRM", _IOC_WRITE, 0x0242, 0x20 },
+{ "linux/fd.h", "FDTWADDLE", _IOC_NONE, 0x0259, 0x00 },
+{ "linux/fd.h", "FDWERRORCLR", _IOC_NONE, 0x0256, 0x00 },
+{ "linux/fd.h", "FDWERRORGET", _IOC_READ, 0x0217, 0x28 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_ADD_DESCRIPTOR", _IOC_READ|_IOC_WRITE, 0x2306, 0x18 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_ALLOCATE", _IOC_READ|_IOC_WRITE, 0x2302, 0x20 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_ALLOCATE_ISO_RESOURCE", _IOC_READ|_IOC_WRITE, 0x230d, 0x18 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_ALLOCATE_ISO_RESOURCE_ONCE", _IOC_WRITE, 0x230f, 0x18 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_CREATE_ISO_CONTEXT", _IOC_READ|_IOC_WRITE, 0x2308, 0x20 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_DEALLOCATE", _IOC_WRITE, 0x2303, 0x04 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_DEALLOCATE_ISO_RESOURCE", _IOC_WRITE, 0x230e, 0x04 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_DEALLOCATE_ISO_RESOURCE_ONCE", _IOC_WRITE, 0x2310, 0x18 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_FLUSH_ISO", _IOC_WRITE, 0x2318, 0x04 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_GET_CYCLE_TIMER", _IOC_READ, 0x230c, 0x10 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_GET_CYCLE_TIMER2", _IOC_READ|_IOC_WRITE, 0x2314, 0x18 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_GET_INFO", _IOC_READ|_IOC_WRITE, 0x2300, 0x28 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_GET_SPEED", _IOC_NONE, 0x2311, 0x00 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_INITIATE_BUS_RESET", _IOC_WRITE, 0x2305, 0x04 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_QUEUE_ISO", _IOC_READ|_IOC_WRITE, 0x2309, 0x18 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_RECEIVE_PHY_PACKETS", _IOC_WRITE, 0x2316, 0x08 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_REMOVE_DESCRIPTOR", _IOC_WRITE, 0x2307, 0x04 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_SEND_BROADCAST_REQUEST", _IOC_WRITE, 0x2312, 0x28 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_SEND_PHY_PACKET", _IOC_READ|_IOC_WRITE, 0x2315, 0x18 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_SEND_REQUEST", _IOC_WRITE, 0x2301, 0x28 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_SEND_RESPONSE", _IOC_WRITE, 0x2304, 0x18 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_SEND_STREAM_PACKET", _IOC_WRITE, 0x2313, 0x28 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_SET_ISO_CHANNELS", _IOC_WRITE, 0x2317, 0x10 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_START_ISO", _IOC_WRITE, 0x230a, 0x10 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_STOP_ISO", _IOC_WRITE, 0x230b, 0x04 },
+{ "linux/fpga-dfl.h", "DFL_FPGA_CHECK_EXTENSION", _IOC_NONE, 0xb601, 0x00 },
+{ "linux/fpga-dfl.h", "DFL_FPGA_FME_ERR_GET_IRQ_NUM", _IOC_READ, 0xb683, 0x04 },
+{ "linux/fpga-dfl.h", "DFL_FPGA_FME_ERR_SET_IRQ", _IOC_WRITE, 0xb684, 0x08 },
+{ "linux/fpga-dfl.h", "DFL_FPGA_FME_PORT_ASSIGN", _IOC_WRITE, 0xb682, 0x04 },
+{ "linux/fpga-dfl.h", "DFL_FPGA_FME_PORT_PR", _IOC_NONE, 0xb680, 0x00 },
+{ "linux/fpga-dfl.h", "DFL_FPGA_FME_PORT_RELEASE", _IOC_WRITE, 0xb681, 0x04 },
+{ "linux/fpga-dfl.h", "DFL_FPGA_GET_API_VERSION", _IOC_NONE, 0xb600, 0x00 },
+{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_DMA_MAP", _IOC_NONE, 0xb643, 0x00 },
+{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_DMA_UNMAP", _IOC_NONE, 0xb644, 0x00 },
+{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_ERR_GET_IRQ_NUM", _IOC_READ, 0xb645, 0x04 },
+{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_ERR_SET_IRQ", _IOC_WRITE, 0xb646, 0x08 },
+{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_GET_INFO", _IOC_NONE, 0xb641, 0x00 },
+{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_GET_REGION_INFO", _IOC_NONE, 0xb642, 0x00 },
+{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_RESET", _IOC_NONE, 0xb640, 0x00 },
+{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_UINT_GET_IRQ_NUM", _IOC_READ, 0xb647, 0x04 },
+{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_UINT_SET_IRQ", _IOC_WRITE, 0xb648, 0x08 },
+{ "linux/fs.h", "BLKALIGNOFF", _IOC_NONE, 0x127a, 0x00 },
+{ "linux/fs.h", "BLKBSZGET", _IOC_READ, 0x1270, 0x08 },
+{ "linux/fs.h", "BLKBSZSET", _IOC_WRITE, 0x1271, 0x08 },
+{ "linux/fs.h", "BLKDISCARD", _IOC_NONE, 0x1277, 0x00 },
+{ "linux/fs.h", "BLKDISCARDZEROES", _IOC_NONE, 0x127c, 0x00 },
+{ "linux/fs.h", "BLKFLSBUF", _IOC_NONE, 0x1261, 0x00 },
+{ "linux/fs.h", "BLKFRAGET", _IOC_NONE, 0x1265, 0x00 },
+{ "linux/fs.h", "BLKFRASET", _IOC_NONE, 0x1264, 0x00 },
+{ "linux/fs.h", "BLKGETSIZE", _IOC_NONE, 0x1260, 0x00 },
+{ "linux/fs.h", "BLKGETSIZE64", _IOC_READ, 0x1272, 0x08 },
+{ "linux/fs.h", "BLKIOMIN", _IOC_NONE, 0x1278, 0x00 },
+{ "linux/fs.h", "BLKIOOPT", _IOC_NONE, 0x1279, 0x00 },
+{ "linux/fs.h", "BLKPBSZGET", _IOC_NONE, 0x127b, 0x00 },
+{ "linux/fs.h", "BLKRAGET", _IOC_NONE, 0x1263, 0x00 },
+{ "linux/fs.h", "BLKRASET", _IOC_NONE, 0x1262, 0x00 },
+{ "linux/fs.h", "BLKROGET", _IOC_NONE, 0x125e, 0x00 },
+{ "linux/fs.h", "BLKROSET", _IOC_NONE, 0x125d, 0x00 },
+{ "linux/fs.h", "BLKROTATIONAL", _IOC_NONE, 0x127e, 0x00 },
+{ "linux/fs.h", "BLKRRPART", _IOC_NONE, 0x125f, 0x00 },
+{ "linux/fs.h", "BLKSECDISCARD", _IOC_NONE, 0x127d, 0x00 },
+{ "linux/fs.h", "BLKSECTGET", _IOC_NONE, 0x1267, 0x00 },
+{ "linux/fs.h", "BLKSECTSET", _IOC_NONE, 0x1266, 0x00 },
+{ "linux/fs.h", "BLKSSZGET", _IOC_NONE, 0x1268, 0x00 },
+{ "linux/fs.h", "BLKTRACESETUP", _IOC_READ|_IOC_WRITE, 0x1273, 0x48 },
+{ "linux/fs.h", "BLKTRACESTART", _IOC_NONE, 0x1274, 0x00 },
+{ "linux/fs.h", "BLKTRACESTOP", _IOC_NONE, 0x1275, 0x00 },
+{ "linux/fs.h", "BLKTRACETEARDOWN", _IOC_NONE, 0x1276, 0x00 },
+{ "linux/fs.h", "BLKZEROOUT", _IOC_NONE, 0x127f, 0x00 },
+{ "linux/fs.h", "FIBMAP", _IOC_NONE, 0x0001, 0x00 },
+{ "linux/fs.h", "FICLONE", _IOC_WRITE, 0x9409, 0x04 },
+{ "linux/fs.h", "FICLONERANGE", _IOC_WRITE, 0x940d, 0x20 },
+{ "linux/fs.h", "FIDEDUPERANGE", _IOC_READ|_IOC_WRITE, 0x9436, 0x18 },
+{ "linux/fs.h", "FIFREEZE", _IOC_READ|_IOC_WRITE, 0x5877, 0x04 },
+{ "linux/fs.h", "FIGETBSZ", _IOC_NONE, 0x0002, 0x00 },
+{ "linux/fs.h", "FITHAW", _IOC_READ|_IOC_WRITE, 0x5878, 0x04 },
+{ "linux/fs.h", "FITRIM", _IOC_READ|_IOC_WRITE, 0x5879, 0x18 },
+{ "linux/fs.h", "FS_IOC32_GETFLAGS", _IOC_READ, 0x6601, 0x04 },
+{ "linux/fs.h", "FS_IOC32_GETVERSION", _IOC_READ, 0x7601, 0x04 },
+{ "linux/fs.h", "FS_IOC32_SETFLAGS", _IOC_WRITE, 0x6602, 0x04 },
+{ "linux/fs.h", "FS_IOC32_SETVERSION", _IOC_WRITE, 0x7602, 0x04 },
+{ "linux/fs.h", "FS_IOC_FIEMAP", _IOC_READ|_IOC_WRITE, 0x660b, 0x20 },
+{ "linux/fs.h", "FS_IOC_FSGETXATTR", _IOC_READ, 0x581f, 0x1c },
+{ "linux/fs.h", "FS_IOC_FSSETXATTR", _IOC_WRITE, 0x5820, 0x1c },
+{ "linux/fs.h", "FS_IOC_GETFLAGS", _IOC_READ, 0x6601, 0x08 },
+{ "linux/fs.h", "FS_IOC_GETFSLABEL", _IOC_READ, 0x9431, 0x100 },
+{ "linux/fs.h", "FS_IOC_GETVERSION", _IOC_READ, 0x7601, 0x08 },
+{ "linux/fs.h", "FS_IOC_SETFLAGS", _IOC_WRITE, 0x6602, 0x08 },
+{ "linux/fs.h", "FS_IOC_SETFSLABEL", _IOC_WRITE, 0x9432, 0x100 },
+{ "linux/fs.h", "FS_IOC_SETVERSION", _IOC_WRITE, 0x7602, 0x08 },
+{ "linux/fscrypt.h", "FS_IOC_ADD_ENCRYPTION_KEY", _IOC_READ|_IOC_WRITE, 0x6617, 0x50 },
+{ "linux/fscrypt.h", "FS_IOC_GET_ENCRYPTION_KEY_STATUS", _IOC_READ|_IOC_WRITE, 0x661a, 0x80 },
+{ "linux/fscrypt.h", "FS_IOC_GET_ENCRYPTION_NONCE", _IOC_READ, 0x661b, 0x10 },
+{ "linux/fscrypt.h", "FS_IOC_GET_ENCRYPTION_POLICY", _IOC_WRITE, 0x6615, 0x0c },
+{ "linux/fscrypt.h", "FS_IOC_GET_ENCRYPTION_POLICY_EX", _IOC_READ|_IOC_WRITE, 0x6616, 0x09 },
+{ "linux/fscrypt.h", "FS_IOC_GET_ENCRYPTION_PWSALT", _IOC_WRITE, 0x6614, 0x10 },
+{ "linux/fscrypt.h", "FS_IOC_REMOVE_ENCRYPTION_KEY", _IOC_READ|_IOC_WRITE, 0x6618, 0x40 },
+{ "linux/fscrypt.h", "FS_IOC_REMOVE_ENCRYPTION_KEY_ALL_USERS", _IOC_READ|_IOC_WRITE, 0x6619, 0x40 },
+{ "linux/fscrypt.h", "FS_IOC_SET_ENCRYPTION_POLICY", _IOC_READ, 0x6613, 0x0c },
+{ "linux/fsi.h", "FSI_SCOM_CHECK", _IOC_READ, 0x7300, 0x04 },
+{ "linux/fsi.h", "FSI_SCOM_READ", _IOC_READ|_IOC_WRITE, 0x7301, 0x20 },
+{ "linux/fsi.h", "FSI_SCOM_RESET", _IOC_WRITE, 0x7303, 0x04 },
+{ "linux/fsi.h", "FSI_SCOM_WRITE", _IOC_READ|_IOC_WRITE, 0x7302, 0x20 },
+{ "linux/fsl-diu-fb.h", "MFB_GET_ALPHA", _IOC_READ, 0x4d00, 0x01 },
+{ "linux/fsl-diu-fb.h", "MFB_GET_AOID", _IOC_READ, 0x4d04, 0x08 },
+{ "linux/fsl-diu-fb.h", "MFB_GET_GAMMA", _IOC_READ, 0x4d01, 0x01 },
+{ "linux/fsl-diu-fb.h", "MFB_GET_PIXFMT", _IOC_READ, 0x4d08, 0x04 },
+{ "linux/fsl-diu-fb.h", "MFB_SET_ALPHA", _IOC_WRITE, 0x4d00, 0x01 },
+{ "linux/fsl-diu-fb.h", "MFB_SET_AOID", _IOC_WRITE, 0x4d04, 0x08 },
+{ "linux/fsl-diu-fb.h", "MFB_SET_BRIGHTNESS", _IOC_WRITE, 0x4d03, 0x01 },
+{ "linux/fsl-diu-fb.h", "MFB_SET_CHROMA_KEY", _IOC_WRITE, 0x4d01, 0x0c },
+{ "linux/fsl-diu-fb.h", "MFB_SET_GAMMA", _IOC_WRITE, 0x4d01, 0x01 },
+{ "linux/fsl-diu-fb.h", "MFB_SET_PIXFMT", _IOC_WRITE, 0x4d08, 0x04 },
+{ "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_DOORBELL", _IOC_READ|_IOC_WRITE, 0xaf06, 0x08 },
+{ "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_GETPROP", _IOC_READ|_IOC_WRITE, 0xaf07, 0x28 },
+{ "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_MEMCPY", _IOC_READ|_IOC_WRITE, 0xaf05, 0x28 },
+{ "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_PARTITION_GET_STATUS", _IOC_READ|_IOC_WRITE, 0xaf02, 0x0c },
+{ "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_PARTITION_RESTART", _IOC_READ|_IOC_WRITE, 0xaf01, 0x08 },
+{ "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_PARTITION_START", _IOC_READ|_IOC_WRITE, 0xaf03, 0x10 },
+{ "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_PARTITION_STOP", _IOC_READ|_IOC_WRITE, 0xaf04, 0x08 },
+{ "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_SETPROP", _IOC_READ|_IOC_WRITE, 0xaf08, 0x28 },
+{ "linux/fsmap.h", "FS_IOC_GETFSMAP", _IOC_READ|_IOC_WRITE, 0x583b, 0xc0 },
+{ "linux/fsverity.h", "FS_IOC_ENABLE_VERITY", _IOC_WRITE, 0x6685, 0x80 },
+{ "linux/fsverity.h", "FS_IOC_MEASURE_VERITY", _IOC_READ|_IOC_WRITE, 0x6686, 0x04 },
+{ "linux/fuse.h", "FUSE_DEV_IOC_CLONE", _IOC_READ, 0xe500, 0x04 },
+{ "linux/genwqe/genwqe_card.h", "GENWQE_EXECUTE_DDCB", _IOC_READ|_IOC_WRITE, 0xa532, 0xe8 },
+{ "linux/genwqe/genwqe_card.h", "GENWQE_EXECUTE_RAW_DDCB", _IOC_READ|_IOC_WRITE, 0xa533, 0xe8 },
+{ "linux/genwqe/genwqe_card.h", "GENWQE_GET_CARD_STATE", _IOC_READ, 0xa524, 0x04 },
+{ "linux/genwqe/genwqe_card.h", "GENWQE_PIN_MEM", _IOC_READ|_IOC_WRITE, 0xa528, 0x20 },
+{ "linux/genwqe/genwqe_card.h", "GENWQE_READ_REG16", _IOC_READ, 0xa522, 0x10 },
+{ "linux/genwqe/genwqe_card.h", "GENWQE_READ_REG32", _IOC_READ, 0xa520, 0x10 },
+{ "linux/genwqe/genwqe_card.h", "GENWQE_READ_REG64", _IOC_READ, 0xa51e, 0x10 },
+{ "linux/genwqe/genwqe_card.h", "GENWQE_SLU_READ", _IOC_READ|_IOC_WRITE, 0xa551, 0x38 },
+{ "linux/genwqe/genwqe_card.h", "GENWQE_SLU_UPDATE", _IOC_READ|_IOC_WRITE, 0xa550, 0x38 },
+{ "linux/genwqe/genwqe_card.h", "GENWQE_UNPIN_MEM", _IOC_READ|_IOC_WRITE, 0xa529, 0x20 },
+{ "linux/genwqe/genwqe_card.h", "GENWQE_WRITE_REG16", _IOC_WRITE, 0xa523, 0x10 },
+{ "linux/genwqe/genwqe_card.h", "GENWQE_WRITE_REG32", _IOC_WRITE, 0xa521, 0x10 },
+{ "linux/genwqe/genwqe_card.h", "GENWQE_WRITE_REG64", _IOC_WRITE, 0xa51f, 0x10 },
+{ "linux/gpio.h", "GPIOHANDLE_GET_LINE_VALUES_IOCTL", _IOC_READ|_IOC_WRITE, 0xb408, 0x40 },
+{ "linux/gpio.h", "GPIOHANDLE_SET_CONFIG_IOCTL", _IOC_READ|_IOC_WRITE, 0xb40a, 0x54 },
+{ "linux/gpio.h", "GPIOHANDLE_SET_LINE_VALUES_IOCTL", _IOC_READ|_IOC_WRITE, 0xb409, 0x40 },
+{ "linux/gpio.h", "GPIO_GET_CHIPINFO_IOCTL", _IOC_READ, 0xb401, 0x44 },
+{ "linux/gpio.h", "GPIO_GET_LINEEVENT_IOCTL", _IOC_READ|_IOC_WRITE, 0xb404, 0x30 },
+{ "linux/gpio.h", "GPIO_GET_LINEHANDLE_IOCTL", _IOC_READ|_IOC_WRITE, 0xb403, 0x16c },
+{ "linux/gpio.h", "GPIO_GET_LINEINFO_IOCTL", _IOC_READ|_IOC_WRITE, 0xb402, 0x48 },
+{ "linux/gpio.h", "GPIO_GET_LINEINFO_UNWATCH_IOCTL", _IOC_READ|_IOC_WRITE, 0xb40c, 0x04 },
+{ "linux/gpio.h", "GPIO_GET_LINEINFO_WATCH_IOCTL", _IOC_READ|_IOC_WRITE, 0xb40b, 0x48 },
+{ "linux/gpio.h", "GPIO_V2_GET_LINEINFO_IOCTL", _IOC_READ|_IOC_WRITE, 0xb405, 0x100 },
+{ "linux/gpio.h", "GPIO_V2_GET_LINEINFO_WATCH_IOCTL", _IOC_READ|_IOC_WRITE, 0xb406, 0x100 },
+{ "linux/gpio.h", "GPIO_V2_GET_LINE_IOCTL", _IOC_READ|_IOC_WRITE, 0xb407, 0x250 },
+{ "linux/gpio.h", "GPIO_V2_LINE_GET_VALUES_IOCTL", _IOC_READ|_IOC_WRITE, 0xb40e, 0x10 },
+{ "linux/gpio.h", "GPIO_V2_LINE_SET_CONFIG_IOCTL", _IOC_READ|_IOC_WRITE, 0xb40d, 0x110 },
+{ "linux/gpio.h", "GPIO_V2_LINE_SET_VALUES_IOCTL", _IOC_READ|_IOC_WRITE, 0xb40f, 0x10 },
+{ "linux/gsmmux.h", "GSMIOC_DISABLE_NET", _IOC_NONE, 0x4703, 0x00 },
+{ "linux/gsmmux.h", "GSMIOC_ENABLE_NET", _IOC_WRITE, 0x4702, 0x34 },
+{ "linux/gsmmux.h", "GSMIOC_GETCONF", _IOC_READ, 0x4700, 0x4c },
+{ "linux/gsmmux.h", "GSMIOC_GETFIRST", _IOC_READ, 0x4704, 0x04 },
+{ "linux/gsmmux.h", "GSMIOC_SETCONF", _IOC_WRITE, 0x4701, 0x4c },
+{ "linux/hdreg.h", "HDIO_DRIVE_CMD", 0, 0x031f, 0 },
+{ "linux/hdreg.h", "HDIO_DRIVE_RESET", 0, 0x031c, 0 },
+{ "linux/hdreg.h", "HDIO_DRIVE_TASK", 0, 0x031e, 0 },
+{ "linux/hdreg.h", "HDIO_DRIVE_TASKFILE", 0, 0x031d, 0 },
+{ "linux/hdreg.h", "HDIO_GETGEO", 0, 0x0301, 0 },
+{ "linux/hdreg.h", "HDIO_GET_32BIT", 0, 0x0309, 0 },
+{ "linux/hdreg.h", "HDIO_GET_ACOUSTIC", 0, 0x030f, 0 },
+{ "linux/hdreg.h", "HDIO_GET_ADDRESS", 0, 0x0310, 0 },
+{ "linux/hdreg.h", "HDIO_GET_BUSSTATE", 0, 0x031a, 0 },
+{ "linux/hdreg.h", "HDIO_GET_DMA", 0, 0x030b, 0 },
+{ "linux/hdreg.h", "HDIO_GET_IDENTITY", 0, 0x030d, 0 },
+{ "linux/hdreg.h", "HDIO_GET_KEEPSETTINGS", 0, 0x0308, 0 },
+{ "linux/hdreg.h", "HDIO_GET_MULTCOUNT", 0, 0x0304, 0 },
+{ "linux/hdreg.h", "HDIO_GET_NICE", 0, 0x030c, 0 },
+{ "linux/hdreg.h", "HDIO_GET_NOWERR", 0, 0x030a, 0 },
+{ "linux/hdreg.h", "HDIO_GET_QDMA", 0, 0x0305, 0 },
+{ "linux/hdreg.h", "HDIO_GET_UNMASKINTR", 0, 0x0302, 0 },
+{ "linux/hdreg.h", "HDIO_GET_WCACHE", 0, 0x030e, 0 },
+{ "linux/hdreg.h", "HDIO_OBSOLETE_IDENTITY", 0, 0x0307, 0 },
+{ "linux/hdreg.h", "HDIO_SCAN_HWIF", 0, 0x0328, 0 },
+{ "linux/hdreg.h", "HDIO_SET_32BIT", 0, 0x0324, 0 },
+{ "linux/hdreg.h", "HDIO_SET_ACOUSTIC", 0, 0x032c, 0 },
+{ "linux/hdreg.h", "HDIO_SET_ADDRESS", 0, 0x032f, 0 },
+{ "linux/hdreg.h", "HDIO_SET_BUSSTATE", 0, 0x032d, 0 },
+{ "linux/hdreg.h", "HDIO_SET_DMA", 0, 0x0326, 0 },
+{ "linux/hdreg.h", "HDIO_SET_KEEPSETTINGS", 0, 0x0323, 0 },
+{ "linux/hdreg.h", "HDIO_SET_MULTCOUNT", 0, 0x0321, 0 },
+{ "linux/hdreg.h", "HDIO_SET_NICE", 0, 0x0329, 0 },
+{ "linux/hdreg.h", "HDIO_SET_NOWERR", 0, 0x0325, 0 },
+{ "linux/hdreg.h", "HDIO_SET_PIO_MODE", 0, 0x0327, 0 },
+{ "linux/hdreg.h", "HDIO_SET_QDMA", 0, 0x032e, 0 },
+{ "linux/hdreg.h", "HDIO_SET_UNMASKINTR", 0, 0x0322, 0 },
+{ "linux/hdreg.h", "HDIO_SET_WCACHE", 0, 0x032b, 0 },
+{ "linux/hdreg.h", "HDIO_SET_XFER", 0, 0x0306, 0 },
+{ "linux/hdreg.h", "HDIO_TRISTATE_HWIF", 0, 0x031b, 0 },
+{ "linux/hdreg.h", "HDIO_UNREGISTER_HWIF", 0, 0x032a, 0 },
+{ "linux/hid-roccat.h", "ROCCATIOCGREPSIZE", _IOC_READ, 0x48f1, 0x04 },
+{ "linux/hiddev.h", "HIDIOCAPPLICATION", _IOC_NONE, 0x4802, 0x00 },
+{ "linux/hiddev.h", "HIDIOCGCOLLECTIONINDEX", _IOC_WRITE, 0x4810, 0x18 },
+{ "linux/hiddev.h", "HIDIOCGCOLLECTIONINFO", _IOC_READ|_IOC_WRITE, 0x4811, 0x10 },
+{ "linux/hiddev.h", "HIDIOCGDEVINFO", _IOC_READ, 0x4803, 0x1c },
+{ "linux/hiddev.h", "HIDIOCGFIELDINFO", _IOC_READ|_IOC_WRITE, 0x480a, 0x38 },
+{ "linux/hiddev.h", "HIDIOCGFLAG", _IOC_READ, 0x480e, 0x04 },
+{ "linux/hiddev.h", "HIDIOCGREPORT", _IOC_WRITE, 0x4807, 0x0c },
+{ "linux/hiddev.h", "HIDIOCGREPORTINFO", _IOC_READ|_IOC_WRITE, 0x4809, 0x0c },
+{ "linux/hiddev.h", "HIDIOCGSTRING", _IOC_READ, 0x4804, 0x104 },
+{ "linux/hiddev.h", "HIDIOCGUCODE", _IOC_READ|_IOC_WRITE, 0x480d, 0x18 },
+{ "linux/hiddev.h", "HIDIOCGUSAGE", _IOC_READ|_IOC_WRITE, 0x480b, 0x18 },
+{ "linux/hiddev.h", "HIDIOCGUSAGES", _IOC_READ|_IOC_WRITE, 0x4813, 0x101c },
+{ "linux/hiddev.h", "HIDIOCGVERSION", _IOC_READ, 0x4801, 0x04 },
+{ "linux/hiddev.h", "HIDIOCINITREPORT", _IOC_NONE, 0x4805, 0x00 },
+{ "linux/hiddev.h", "HIDIOCSFLAG", _IOC_WRITE, 0x480f, 0x04 },
+{ "linux/hiddev.h", "HIDIOCSREPORT", _IOC_WRITE, 0x4808, 0x0c },
+{ "linux/hiddev.h", "HIDIOCSUSAGE", _IOC_WRITE, 0x480c, 0x18 },
+{ "linux/hiddev.h", "HIDIOCSUSAGES", _IOC_WRITE, 0x4814, 0x101c },
+{ "linux/hidraw.h", "HIDIOCGRAWINFO", _IOC_READ, 0x4803, 0x08 },
+{ "linux/hidraw.h", "HIDIOCGRDESC", _IOC_READ, 0x4802, 0x1004 },
+{ "linux/hidraw.h", "HIDIOCGRDESCSIZE", _IOC_READ, 0x4801, 0x04 },
+{ "linux/hpet.h", "HPET_DPI", _IOC_NONE, 0x6805, 0x00 },
+{ "linux/hpet.h", "HPET_EPI", _IOC_NONE, 0x6804, 0x00 },
+{ "linux/hpet.h", "HPET_IE_OFF", _IOC_NONE, 0x6802, 0x00 },
+{ "linux/hpet.h", "HPET_IE_ON", _IOC_NONE, 0x6801, 0x00 },
+{ "linux/hpet.h", "HPET_INFO", _IOC_READ, 0x6803, 0x18 },
+{ "linux/hpet.h", "HPET_IRQFREQ", _IOC_WRITE, 0x6806, 0x08 },
+{ "linux/hsi/cs-protocol.h", "CS_CONFIG_BUFS", _IOC_WRITE, 0x431f, 0x20 },
+{ "linux/hsi/cs-protocol.h", "CS_GET_IF_VERSION", _IOC_READ, 0x431e, 0x04 },
+{ "linux/hsi/cs-protocol.h", "CS_GET_STATE", _IOC_READ, 0x4315, 0x04 },
+{ "linux/hsi/cs-protocol.h", "CS_SET_WAKELINE", _IOC_WRITE, 0x4317, 0x04 },
+{ "linux/hsi/hsi_char.h", "HSC_GET_RX", _IOC_WRITE, 0x6b14, 0x0c },
+{ "linux/hsi/hsi_char.h", "HSC_GET_TX", _IOC_WRITE, 0x6b16, 0x10 },
+{ "linux/hsi/hsi_char.h", "HSC_RESET", _IOC_NONE, 0x6b10, 0x00 },
+{ "linux/hsi/hsi_char.h", "HSC_SEND_BREAK", _IOC_NONE, 0x6b12, 0x00 },
+{ "linux/hsi/hsi_char.h", "HSC_SET_PM", _IOC_NONE, 0x6b11, 0x00 },
+{ "linux/hsi/hsi_char.h", "HSC_SET_RX", _IOC_WRITE, 0x6b13, 0x0c },
+{ "linux/hsi/hsi_char.h", "HSC_SET_TX", _IOC_WRITE, 0x6b15, 0x10 },
+{ "linux/i2o-dev.h", "I2OEVTGET", _IOC_READ, 0x690b, 0x68 },
+{ "linux/i2o-dev.h", "I2OEVTREG", _IOC_WRITE, 0x690a, 0x0c },
+{ "linux/i2o-dev.h", "I2OGETIOPS", _IOC_READ, 0x6900, 0x20 },
+{ "linux/i2o-dev.h", "I2OHRTGET", _IOC_READ|_IOC_WRITE, 0x6901, 0x18 },
+{ "linux/i2o-dev.h", "I2OHTML", _IOC_READ|_IOC_WRITE, 0x6909, 0x30 },
+{ "linux/i2o-dev.h", "I2OLCTGET", _IOC_READ|_IOC_WRITE, 0x6902, 0x18 },
+{ "linux/i2o-dev.h", "I2OPARMGET", _IOC_READ|_IOC_WRITE, 0x6904, 0x28 },
+{ "linux/i2o-dev.h", "I2OPARMSET", _IOC_READ|_IOC_WRITE, 0x6903, 0x28 },
+{ "linux/i2o-dev.h", "I2OPASSTHRU", _IOC_READ, 0x690c, 0x10 },
+{ "linux/i2o-dev.h", "I2OPASSTHRU32", _IOC_READ, 0x690c, 0x08 },
+{ "linux/i2o-dev.h", "I2OSWDEL", _IOC_READ|_IOC_WRITE, 0x6907, 0x30 },
+{ "linux/i2o-dev.h", "I2OSWDL", _IOC_READ|_IOC_WRITE, 0x6905, 0x30 },
+{ "linux/i2o-dev.h", "I2OSWUL", _IOC_READ|_IOC_WRITE, 0x6906, 0x30 },
+{ "linux/i2o-dev.h", "I2OVALIDATE", _IOC_READ, 0x6908, 0x04 },
+{ "linux/i8k.h", "I8K_BIOS_VERSION", _IOC_READ, 0x6980, 0x04 },
+{ "linux/i8k.h", "I8K_FN_STATUS", _IOC_READ, 0x6983, 0x08 },
+{ "linux/i8k.h", "I8K_GET_FAN", _IOC_READ|_IOC_WRITE, 0x6986, 0x08 },
+{ "linux/i8k.h", "I8K_GET_SPEED", _IOC_READ|_IOC_WRITE, 0x6985, 0x08 },
+{ "linux/i8k.h", "I8K_GET_TEMP", _IOC_READ, 0x6984, 0x08 },
+{ "linux/i8k.h", "I8K_MACHINE_ID", _IOC_READ, 0x6981, 0x04 },
+{ "linux/i8k.h", "I8K_POWER_STATUS", _IOC_READ, 0x6982, 0x08 },
+{ "linux/i8k.h", "I8K_SET_FAN", _IOC_READ|_IOC_WRITE, 0x6987, 0x08 },
+{ "linux/if_pppox.h", "PPPOEIOCDFWD", _IOC_NONE, 0xb101, 0x00 },
+{ "linux/if_pppox.h", "PPPOEIOCSFWD", _IOC_WRITE, 0xb100, 0x08 },
+{ "linux/if_tun.h", "TUNATTACHFILTER", _IOC_WRITE, 0x54d5, 0x10 },
+{ "linux/if_tun.h", "TUNDETACHFILTER", _IOC_WRITE, 0x54d6, 0x10 },
+{ "linux/if_tun.h", "TUNGETDEVNETNS", _IOC_NONE, 0x54e3, 0x00 },
+{ "linux/if_tun.h", "TUNGETFEATURES", _IOC_READ, 0x54cf, 0x04 },
+{ "linux/if_tun.h", "TUNGETFILTER", _IOC_READ, 0x54db, 0x10 },
+{ "linux/if_tun.h", "TUNGETIFF", _IOC_READ, 0x54d2, 0x04 },
+{ "linux/if_tun.h", "TUNGETSNDBUF", _IOC_READ, 0x54d3, 0x04 },
+{ "linux/if_tun.h", "TUNGETVNETBE", _IOC_READ, 0x54df, 0x04 },
+{ "linux/if_tun.h", "TUNGETVNETHDRSZ", _IOC_READ, 0x54d7, 0x04 },
+{ "linux/if_tun.h", "TUNGETVNETLE", _IOC_READ, 0x54dd, 0x04 },
+{ "linux/if_tun.h", "TUNSETCARRIER", _IOC_WRITE, 0x54e2, 0x04 },
+{ "linux/if_tun.h", "TUNSETDEBUG", _IOC_WRITE, 0x54c9, 0x04 },
+{ "linux/if_tun.h", "TUNSETFILTEREBPF", _IOC_READ, 0x54e1, 0x04 },
+{ "linux/if_tun.h", "TUNSETGROUP", _IOC_WRITE, 0x54ce, 0x04 },
+{ "linux/if_tun.h", "TUNSETIFF", _IOC_WRITE, 0x54ca, 0x04 },
+{ "linux/if_tun.h", "TUNSETIFINDEX", _IOC_WRITE, 0x54da, 0x04 },
+{ "linux/if_tun.h", "TUNSETLINK", _IOC_WRITE, 0x54cd, 0x04 },
+{ "linux/if_tun.h", "TUNSETNOCSUM", _IOC_WRITE, 0x54c8, 0x04 },
+{ "linux/if_tun.h", "TUNSETOFFLOAD", _IOC_WRITE, 0x54d0, 0x04 },
+{ "linux/if_tun.h", "TUNSETOWNER", _IOC_WRITE, 0x54cc, 0x04 },
+{ "linux/if_tun.h", "TUNSETPERSIST", _IOC_WRITE, 0x54cb, 0x04 },
+{ "linux/if_tun.h", "TUNSETQUEUE", _IOC_WRITE, 0x54d9, 0x04 },
+{ "linux/if_tun.h", "TUNSETSNDBUF", _IOC_WRITE, 0x54d4, 0x04 },
+{ "linux/if_tun.h", "TUNSETSTEERINGEBPF", _IOC_READ, 0x54e0, 0x04 },
+{ "linux/if_tun.h", "TUNSETTXFILTER", _IOC_WRITE, 0x54d1, 0x04 },
+{ "linux/if_tun.h", "TUNSETVNETBE", _IOC_WRITE, 0x54de, 0x04 },
+{ "linux/if_tun.h", "TUNSETVNETHDRSZ", _IOC_WRITE, 0x54d8, 0x04 },
+{ "linux/if_tun.h", "TUNSETVNETLE", _IOC_WRITE, 0x54dc, 0x04 },
+{ "linux/iio/events.h", "IIO_GET_EVENT_FD_IOCTL", _IOC_READ, 0x6990, 0x04 },
+{ "linux/inotify.h", "INOTIFY_IOC_SETNEXTWD", _IOC_WRITE, 0x4900, 0x04 },
+{ "linux/input.h", "EVIOCGEFFECTS", _IOC_READ, 0x4584, 0x04 },
+{ "linux/input.h", "EVIOCGID", _IOC_READ, 0x4502, 0x08 },
+{ "linux/input.h", "EVIOCGKEYCODE", _IOC_READ, 0x4504, 0x08 },
+{ "linux/input.h", "EVIOCGKEYCODE_V2", _IOC_READ, 0x4504, 0x28 },
+{ "linux/input.h", "EVIOCGMASK", _IOC_READ, 0x4592, 0x10 },
+{ "linux/input.h", "EVIOCGRAB", _IOC_WRITE, 0x4590, 0x04 },
+{ "linux/input.h", "EVIOCGREP", _IOC_READ, 0x4503, 0x08 },
+{ "linux/input.h", "EVIOCGVERSION", _IOC_READ, 0x4501, 0x04 },
+{ "linux/input.h", "EVIOCREVOKE", _IOC_WRITE, 0x4591, 0x04 },
+{ "linux/input.h", "EVIOCRMFF", _IOC_WRITE, 0x4581, 0x04 },
+{ "linux/input.h", "EVIOCSCLOCKID", _IOC_WRITE, 0x45a0, 0x04 },
+{ "linux/input.h", "EVIOCSFF", _IOC_WRITE, 0x4580, 0x30 },
+{ "linux/input.h", "EVIOCSKEYCODE", _IOC_WRITE, 0x4504, 0x08 },
+{ "linux/input.h", "EVIOCSKEYCODE_V2", _IOC_WRITE, 0x4504, 0x28 },
+{ "linux/input.h", "EVIOCSMASK", _IOC_WRITE, 0x4593, 0x10 },
+{ "linux/input.h", "EVIOCSREP", _IOC_WRITE, 0x4503, 0x08 },
+{ "linux/ipmi.h", "IPMICTL_GET_MAINTENANCE_MODE_CMD", _IOC_READ, 0x691e, 0x04 },
+{ "linux/ipmi.h", "IPMICTL_GET_MY_ADDRESS_CMD", _IOC_READ, 0x6912, 0x04 },
+{ "linux/ipmi.h", "IPMICTL_GET_MY_CHANNEL_ADDRESS_CMD", _IOC_READ, 0x6919, 0x04 },
+{ "linux/ipmi.h", "IPMICTL_GET_MY_CHANNEL_LUN_CMD", _IOC_READ, 0x691b, 0x04 },
+{ "linux/ipmi.h", "IPMICTL_GET_MY_LUN_CMD", _IOC_READ, 0x6914, 0x04 },
+{ "linux/ipmi.h", "IPMICTL_GET_TIMING_PARMS_CMD", _IOC_READ, 0x6917, 0x08 },
+{ "linux/ipmi.h", "IPMICTL_RECEIVE_MSG", _IOC_READ|_IOC_WRITE, 0x690c, 0x30 },
+{ "linux/ipmi.h", "IPMICTL_RECEIVE_MSG_TRUNC", _IOC_READ|_IOC_WRITE, 0x690b, 0x30 },
+{ "linux/ipmi.h", "IPMICTL_REGISTER_FOR_CMD", _IOC_READ, 0x690e, 0x02 },
+{ "linux/ipmi.h", "IPMICTL_REGISTER_FOR_CMD_CHANS", _IOC_READ, 0x691c, 0x0c },
+{ "linux/ipmi.h", "IPMICTL_SEND_COMMAND", _IOC_READ, 0x690d, 0x28 },
+{ "linux/ipmi.h", "IPMICTL_SEND_COMMAND_SETTIME", _IOC_READ, 0x6915, 0x30 },
+{ "linux/ipmi.h", "IPMICTL_SET_GETS_EVENTS_CMD", _IOC_READ, 0x6910, 0x04 },
+{ "linux/ipmi.h", "IPMICTL_SET_MAINTENANCE_MODE_CMD", _IOC_WRITE, 0x691f, 0x04 },
+{ "linux/ipmi.h", "IPMICTL_SET_MY_ADDRESS_CMD", _IOC_READ, 0x6911, 0x04 },
+{ "linux/ipmi.h", "IPMICTL_SET_MY_CHANNEL_ADDRESS_CMD", _IOC_READ, 0x6918, 0x04 },
+{ "linux/ipmi.h", "IPMICTL_SET_MY_CHANNEL_LUN_CMD", _IOC_READ, 0x691a, 0x04 },
+{ "linux/ipmi.h", "IPMICTL_SET_MY_LUN_CMD", _IOC_READ, 0x6913, 0x04 },
+{ "linux/ipmi.h", "IPMICTL_SET_TIMING_PARMS_CMD", _IOC_READ, 0x6916, 0x08 },
+{ "linux/ipmi.h", "IPMICTL_UNREGISTER_FOR_CMD", _IOC_READ, 0x690f, 0x02 },
+{ "linux/ipmi.h", "IPMICTL_UNREGISTER_FOR_CMD_CHANS", _IOC_READ, 0x691d, 0x0c },
+{ "linux/ipmi_bmc.h", "IPMI_BMC_IOCTL_CLEAR_SMS_ATN", _IOC_NONE, 0xb101, 0x00 },
+{ "linux/ipmi_bmc.h", "IPMI_BMC_IOCTL_FORCE_ABORT", _IOC_NONE, 0xb102, 0x00 },
+{ "linux/ipmi_bmc.h", "IPMI_BMC_IOCTL_SET_SMS_ATN", _IOC_NONE, 0xb100, 0x00 },
+{ "linux/isst_if.h", "ISST_IF_GET_PHY_ID", _IOC_READ|_IOC_WRITE, 0xfe01, 0x08 },
+{ "linux/isst_if.h", "ISST_IF_GET_PLATFORM_INFO", _IOC_READ, 0xfe00, 0x08 },
+{ "linux/isst_if.h", "ISST_IF_IO_CMD", _IOC_WRITE, 0xfe02, 0x08 },
+{ "linux/isst_if.h", "ISST_IF_MBOX_COMMAND", _IOC_READ|_IOC_WRITE, 0xfe03, 0x08 },
+{ "linux/isst_if.h", "ISST_IF_MSR_COMMAND", _IOC_READ|_IOC_WRITE, 0xfe04, 0x08 },
+{ "linux/ivtv.h", "IVTV_IOC_DMA_FRAME", _IOC_WRITE, 0x56c0, 0x40 },
+{ "linux/ivtv.h", "IVTV_IOC_PASSTHROUGH_MODE", _IOC_WRITE, 0x56c1, 0x04 },
+{ "linux/ivtvfb.h", "IVTVFB_IOC_DMA_FRAME", _IOC_WRITE, 0x56c0, 0x18 },
+{ "linux/joystick.h", "JSIOCGAXES", _IOC_READ, 0x6a11, 0x01 },
+{ "linux/joystick.h", "JSIOCGAXMAP", _IOC_READ, 0x6a32, 0x40 },
+{ "linux/joystick.h", "JSIOCGBTNMAP", _IOC_READ, 0x6a34, 0x400 },
+{ "linux/joystick.h", "JSIOCGBUTTONS", _IOC_READ, 0x6a12, 0x01 },
+{ "linux/joystick.h", "JSIOCGCORR", _IOC_READ, 0x6a22, 0x24 },
+{ "linux/joystick.h", "JSIOCGVERSION", _IOC_READ, 0x6a01, 0x04 },
+{ "linux/joystick.h", "JSIOCSAXMAP", _IOC_WRITE, 0x6a31, 0x40 },
+{ "linux/joystick.h", "JSIOCSBTNMAP", _IOC_WRITE, 0x6a33, 0x400 },
+{ "linux/joystick.h", "JSIOCSCORR", _IOC_WRITE, 0x6a21, 0x24 },
+{ "linux/kcov.h", "KCOV_DISABLE", _IOC_NONE, 0x6365, 0x00 },
+{ "linux/kcov.h", "KCOV_ENABLE", _IOC_NONE, 0x6364, 0x00 },
+{ "linux/kcov.h", "KCOV_INIT_TRACE", _IOC_READ, 0x6301, 0x08 },
+{ "linux/kcov.h", "KCOV_REMOTE_ENABLE", _IOC_WRITE, 0x6366, 0x18 },
+{ "linux/kd.h", "GIO_CMAP", 0, 0x4B70, 0 },
+{ "linux/kd.h", "GIO_FONT", 0, 0x4B60, 0 },
+{ "linux/kd.h", "GIO_FONTX", 0, 0x4B6B, 0 },
+{ "linux/kd.h", "GIO_SCRNMAP", 0, 0x4B40, 0 },
+{ "linux/kd.h", "GIO_UNIMAP", 0, 0x4B66, 0 },
+{ "linux/kd.h", "GIO_UNISCRNMAP", 0, 0x4B69, 0 },
+{ "linux/kd.h", "KDADDIO", 0, 0x4B34, 0 },
+{ "linux/kd.h", "KDDELIO", 0, 0x4B35, 0 },
+{ "linux/kd.h", "KDDISABIO", 0, 0x4B37, 0 },
+{ "linux/kd.h", "KDENABIO", 0, 0x4B36, 0 },
+{ "linux/kd.h", "KDFONTOP", 0, 0x4B72, 0 },
+{ "linux/kd.h", "KDGETKEYCODE", 0, 0x4B4C, 0 },
+{ "linux/kd.h", "KDGETLED", 0, 0x4B31, 0 },
+{ "linux/kd.h", "KDGETMODE", 0, 0x4B3B, 0 },
+{ "linux/kd.h", "KDGKBDIACR", 0, 0x4B4A, 0 },
+{ "linux/kd.h", "KDGKBDIACRUC", 0, 0x4BFA, 0 },
+{ "linux/kd.h", "KDGKBENT", 0, 0x4B46, 0 },
+{ "linux/kd.h", "KDGKBLED", 0, 0x4B64, 0 },
+{ "linux/kd.h", "KDGKBMETA", 0, 0x4B62, 0 },
+{ "linux/kd.h", "KDGKBMODE", 0, 0x4B44, 0 },
+{ "linux/kd.h", "KDGKBSENT", 0, 0x4B48, 0 },
+{ "linux/kd.h", "KDGKBTYPE", 0, 0x4B33, 0 },
+{ "linux/kd.h", "KDKBDREP", 0, 0x4B52, 0 },
+{ "linux/kd.h", "KDMAPDISP", 0, 0x4B3C, 0 },
+{ "linux/kd.h", "KDMKTONE", 0, 0x4B30, 0 },
+{ "linux/kd.h", "KDSETKEYCODE", 0, 0x4B4D, 0 },
+{ "linux/kd.h", "KDSETLED", 0, 0x4B32, 0 },
+{ "linux/kd.h", "KDSETMODE", 0, 0x4B3A, 0 },
+{ "linux/kd.h", "KDSIGACCEPT", 0, 0x4B4E, 0 },
+{ "linux/kd.h", "KDSKBDIACR", 0, 0x4B4B, 0 },
+{ "linux/kd.h", "KDSKBDIACRUC", 0, 0x4BFB, 0 },
+{ "linux/kd.h", "KDSKBENT", 0, 0x4B47, 0 },
+{ "linux/kd.h", "KDSKBLED", 0, 0x4B65, 0 },
+{ "linux/kd.h", "KDSKBMETA", 0, 0x4B63, 0 },
+{ "linux/kd.h", "KDSKBMODE", 0, 0x4B45, 0 },
+{ "linux/kd.h", "KDSKBSENT", 0, 0x4B49, 0 },
+{ "linux/kd.h", "KDUNMAPDISP", 0, 0x4B3D, 0 },
+{ "linux/kd.h", "KIOCSOUND", 0, 0x4B2F, 0 },
+{ "linux/kd.h", "PIO_CMAP", 0, 0x4B71, 0 },
+{ "linux/kd.h", "PIO_FONT", 0, 0x4B61, 0 },
+{ "linux/kd.h", "PIO_FONTRESET", 0, 0x4B6D, 0 },
+{ "linux/kd.h", "PIO_FONTX", 0, 0x4B6C, 0 },
+{ "linux/kd.h", "PIO_SCRNMAP", 0, 0x4B41, 0 },
+{ "linux/kd.h", "PIO_UNIMAP", 0, 0x4B67, 0 },
+{ "linux/kd.h", "PIO_UNIMAPCLR", 0, 0x4B68, 0 },
+{ "linux/kd.h", "PIO_UNISCRNMAP", 0, 0x4B6A, 0 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_ACQUIRE_VM", _IOC_WRITE, 0x4b15, 0x08 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_ALLOC_MEMORY_OF_GPU", _IOC_READ|_IOC_WRITE, 0x4b16, 0x28 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_ALLOC_QUEUE_GWS", _IOC_READ|_IOC_WRITE, 0x4b1e, 0x10 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_CREATE_EVENT", _IOC_READ|_IOC_WRITE, 0x4b08, 0x20 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_CREATE_QUEUE", _IOC_READ|_IOC_WRITE, 0x4b02, 0x58 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_DBG_ADDRESS_WATCH", _IOC_WRITE, 0x4b0f, 0x10 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_DBG_REGISTER", _IOC_WRITE, 0x4b0d, 0x08 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_DBG_UNREGISTER", _IOC_WRITE, 0x4b0e, 0x08 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_DBG_WAVE_CONTROL", _IOC_WRITE, 0x4b10, 0x10 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_DESTROY_EVENT", _IOC_WRITE, 0x4b09, 0x08 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_DESTROY_QUEUE", _IOC_READ|_IOC_WRITE, 0x4b03, 0x08 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_FREE_MEMORY_OF_GPU", _IOC_WRITE, 0x4b17, 0x08 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_CLOCK_COUNTERS", _IOC_READ|_IOC_WRITE, 0x4b05, 0x28 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_DMABUF_INFO", _IOC_READ|_IOC_WRITE, 0x4b1c, 0x20 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_PROCESS_APERTURES", _IOC_READ, 0x4b06, 0x190 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_PROCESS_APERTURES_NEW", _IOC_READ|_IOC_WRITE, 0x4b14, 0x10 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_QUEUE_WAVE_STATE", _IOC_READ|_IOC_WRITE, 0x4b1b, 0x18 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_TILE_CONFIG", _IOC_READ|_IOC_WRITE, 0x4b12, 0x28 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_VERSION", _IOC_READ, 0x4b01, 0x08 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_IMPORT_DMABUF", _IOC_READ|_IOC_WRITE, 0x4b1d, 0x18 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_MAP_MEMORY_TO_GPU", _IOC_READ|_IOC_WRITE, 0x4b18, 0x18 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_RESET_EVENT", _IOC_WRITE, 0x4b0b, 0x08 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_SET_CU_MASK", _IOC_WRITE, 0x4b1a, 0x10 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_SET_EVENT", _IOC_WRITE, 0x4b0a, 0x08 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_SET_MEMORY_POLICY", _IOC_WRITE, 0x4b04, 0x20 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_SET_SCRATCH_BACKING_VA", _IOC_READ|_IOC_WRITE, 0x4b11, 0x10 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_SET_TRAP_HANDLER", _IOC_WRITE, 0x4b13, 0x18 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_SMI_EVENTS", _IOC_READ|_IOC_WRITE, 0x4b1f, 0x08 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_UNMAP_MEMORY_FROM_GPU", _IOC_READ|_IOC_WRITE, 0x4b19, 0x18 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_UPDATE_QUEUE", _IOC_WRITE, 0x4b07, 0x18 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_WAIT_EVENTS", _IOC_READ|_IOC_WRITE, 0x4b0c, 0x18 },
+{ "linux/lightnvm.h", "NVME_NVM_IOCTL_ADMIN_VIO", _IOC_READ|_IOC_WRITE, 0x4c41, 0x50 },
+{ "linux/lightnvm.h", "NVME_NVM_IOCTL_IO_VIO", _IOC_READ|_IOC_WRITE, 0x4c43, 0x50 },
+{ "linux/lightnvm.h", "NVME_NVM_IOCTL_SUBMIT_VIO", _IOC_READ|_IOC_WRITE, 0x4c42, 0x40 },
+{ "linux/lightnvm.h", "NVM_DEV_CREATE", _IOC_WRITE, 0x4c22, 0x80 },
+{ "linux/lightnvm.h", "NVM_DEV_FACTORY", _IOC_WRITE, 0x4c25, 0x24 },
+{ "linux/lightnvm.h", "NVM_DEV_INIT", _IOC_WRITE, 0x4c24, 0x2c },
+{ "linux/lightnvm.h", "NVM_DEV_REMOVE", _IOC_WRITE, 0x4c23, 0x24 },
+{ "linux/lightnvm.h", "NVM_GET_DEVICES", _IOC_READ, 0x4c21, 0x1000 },
+{ "linux/lightnvm.h", "NVM_INFO", _IOC_READ|_IOC_WRITE, 0x4c20, 0x1000 },
+{ "linux/lirc.h", "LIRC_GET_FEATURES", _IOC_READ, 0x6900, 0x04 },
+{ "linux/lirc.h", "LIRC_GET_LENGTH", _IOC_READ, 0x690f, 0x04 },
+{ "linux/lirc.h", "LIRC_GET_MAX_TIMEOUT", _IOC_READ, 0x6909, 0x04 },
+{ "linux/lirc.h", "LIRC_GET_MIN_TIMEOUT", _IOC_READ, 0x6908, 0x04 },
+{ "linux/lirc.h", "LIRC_GET_REC_MODE", _IOC_READ, 0x6902, 0x04 },
+{ "linux/lirc.h", "LIRC_GET_REC_RESOLUTION", _IOC_READ, 0x6907, 0x04 },
+{ "linux/lirc.h", "LIRC_GET_REC_TIMEOUT", _IOC_READ, 0x6924, 0x04 },
+{ "linux/lirc.h", "LIRC_GET_SEND_MODE", _IOC_READ, 0x6901, 0x04 },
+{ "linux/lirc.h", "LIRC_SET_MEASURE_CARRIER_MODE", _IOC_WRITE, 0x691d, 0x04 },
+{ "linux/lirc.h", "LIRC_SET_REC_CARRIER", _IOC_WRITE, 0x6914, 0x04 },
+{ "linux/lirc.h", "LIRC_SET_REC_CARRIER_RANGE", _IOC_WRITE, 0x691f, 0x04 },
+{ "linux/lirc.h", "LIRC_SET_REC_MODE", _IOC_WRITE, 0x6912, 0x04 },
+{ "linux/lirc.h", "LIRC_SET_REC_TIMEOUT", _IOC_WRITE, 0x6918, 0x04 },
+{ "linux/lirc.h", "LIRC_SET_REC_TIMEOUT_REPORTS", _IOC_WRITE, 0x6919, 0x04 },
+{ "linux/lirc.h", "LIRC_SET_SEND_CARRIER", _IOC_WRITE, 0x6913, 0x04 },
+{ "linux/lirc.h", "LIRC_SET_SEND_DUTY_CYCLE", _IOC_WRITE, 0x6915, 0x04 },
+{ "linux/lirc.h", "LIRC_SET_SEND_MODE", _IOC_WRITE, 0x6911, 0x04 },
+{ "linux/lirc.h", "LIRC_SET_TRANSMITTER_MASK", _IOC_WRITE, 0x6917, 0x04 },
+{ "linux/lirc.h", "LIRC_SET_WIDEBAND_RECEIVER", _IOC_WRITE, 0x6923, 0x04 },
+{ "linux/loop.h", "LOOP_CHANGE_FD", 0, 0x4C06, 0 },
+{ "linux/loop.h", "LOOP_CLR_FD", 0, 0x4C01, 0 },
+{ "linux/loop.h", "LOOP_CONFIGURE", 0, 0x4C0A, 0 },
+{ "linux/loop.h", "LOOP_CTL_ADD", 0, 0x4C80, 0 },
+{ "linux/loop.h", "LOOP_CTL_GET_FREE", 0, 0x4C82, 0 },
+{ "linux/loop.h", "LOOP_CTL_REMOVE", 0, 0x4C81, 0 },
+{ "linux/loop.h", "LOOP_GET_STATUS", 0, 0x4C03, 0 },
+{ "linux/loop.h", "LOOP_GET_STATUS64", 0, 0x4C05, 0 },
+{ "linux/loop.h", "LOOP_SET_BLOCK_SIZE", 0, 0x4C09, 0 },
+{ "linux/loop.h", "LOOP_SET_CAPACITY", 0, 0x4C07, 0 },
+{ "linux/loop.h", "LOOP_SET_DIRECT_IO", 0, 0x4C08, 0 },
+{ "linux/loop.h", "LOOP_SET_FD", 0, 0x4C00, 0 },
+{ "linux/loop.h", "LOOP_SET_STATUS", 0, 0x4C02, 0 },
+{ "linux/loop.h", "LOOP_SET_STATUS64", 0, 0x4C04, 0 },
+{ "linux/lp.h", "LPSETTIMEOUT_NEW", _IOC_WRITE, 0x060f, 0x10 },
+{ "linux/mISDNif.h", "IMADDTIMER", _IOC_READ, 0x4940, 0x04 },
+{ "linux/mISDNif.h", "IMCLEAR_L2", _IOC_READ, 0x4946, 0x04 },
+{ "linux/mISDNif.h", "IMCTRLREQ", _IOC_READ, 0x4945, 0x04 },
+{ "linux/mISDNif.h", "IMDELTIMER", _IOC_READ, 0x4941, 0x04 },
+{ "linux/mISDNif.h", "IMGETCOUNT", _IOC_READ, 0x4943, 0x04 },
+{ "linux/mISDNif.h", "IMGETDEVINFO", _IOC_READ, 0x4944, 0x04 },
+{ "linux/mISDNif.h", "IMGETVERSION", _IOC_READ, 0x4942, 0x04 },
+{ "linux/mISDNif.h", "IMHOLD_L1", _IOC_READ, 0x4948, 0x04 },
+{ "linux/mISDNif.h", "IMSETDEVNAME", _IOC_READ, 0x4947, 0x18 },
+{ "linux/matroxfb.h", "MATROXFB_GET_ALL_OUTPUTS", _IOC_READ, 0x6efb, 0x08 },
+{ "linux/matroxfb.h", "MATROXFB_GET_AVAILABLE_OUTPUTS", _IOC_READ, 0x6ef9, 0x08 },
+{ "linux/matroxfb.h", "MATROXFB_GET_OUTPUT_CONNECTION", _IOC_READ, 0x6ef8, 0x08 },
+{ "linux/matroxfb.h", "MATROXFB_GET_OUTPUT_MODE", _IOC_READ|_IOC_WRITE, 0x6efa, 0x08 },
+{ "linux/matroxfb.h", "MATROXFB_SET_OUTPUT_CONNECTION", _IOC_WRITE, 0x6ef8, 0x08 },
+{ "linux/matroxfb.h", "MATROXFB_SET_OUTPUT_MODE", _IOC_WRITE, 0x6efa, 0x08 },
+{ "linux/media.h", "MEDIA_IOC_DEVICE_INFO", _IOC_READ|_IOC_WRITE, 0x7c00, 0x100 },
+{ "linux/media.h", "MEDIA_IOC_ENUM_ENTITIES", _IOC_READ|_IOC_WRITE, 0x7c01, 0x100 },
+{ "linux/media.h", "MEDIA_IOC_ENUM_LINKS", _IOC_READ|_IOC_WRITE, 0x7c02, 0x28 },
+{ "linux/media.h", "MEDIA_IOC_G_TOPOLOGY", _IOC_READ|_IOC_WRITE, 0x7c04, 0x48 },
+{ "linux/media.h", "MEDIA_IOC_REQUEST_ALLOC", _IOC_READ, 0x7c05, 0x04 },
+{ "linux/media.h", "MEDIA_IOC_SETUP_LINK", _IOC_READ|_IOC_WRITE, 0x7c03, 0x34 },
+{ "linux/media.h", "MEDIA_REQUEST_IOC_QUEUE", _IOC_NONE, 0x7c80, 0x00 },
+{ "linux/media.h", "MEDIA_REQUEST_IOC_REINIT", _IOC_NONE, 0x7c81, 0x00 },
+{ "linux/mei.h", "IOCTL_MEI_CONNECT_CLIENT", _IOC_READ|_IOC_WRITE, 0x4801, 0x10 },
+{ "linux/mei.h", "IOCTL_MEI_CONNECT_CLIENT_VTAG", _IOC_READ|_IOC_WRITE, 0x4804, 0x14 },
+{ "linux/mei.h", "IOCTL_MEI_NOTIFY_GET", _IOC_READ, 0x4803, 0x04 },
+{ "linux/mei.h", "IOCTL_MEI_NOTIFY_SET", _IOC_WRITE, 0x4802, 0x04 },
+{ "linux/meye.h", "MEYEIOC_G_PARAMS", _IOC_READ, 0x76c0, 0x06 },
+{ "linux/meye.h", "MEYEIOC_QBUF_CAPT", _IOC_WRITE, 0x76c2, 0x04 },
+{ "linux/meye.h", "MEYEIOC_STILLCAPT", _IOC_NONE, 0x76c4, 0x00 },
+{ "linux/meye.h", "MEYEIOC_STILLJCAPT", _IOC_READ, 0x76c5, 0x04 },
+{ "linux/meye.h", "MEYEIOC_SYNC", _IOC_READ|_IOC_WRITE, 0x76c3, 0x04 },
+{ "linux/meye.h", "MEYEIOC_S_PARAMS", _IOC_WRITE, 0x76c1, 0x06 },
+{ "linux/mmc/ioctl.h", "MMC_IOC_CMD", _IOC_READ|_IOC_WRITE, 0xb300, 0x48 },
+{ "linux/mmc/ioctl.h", "MMC_IOC_MULTI_CMD", _IOC_READ|_IOC_WRITE, 0xb301, 0x08 },
+{ "linux/mmtimer.h", "MMTIMER_GETBITS", _IOC_NONE, 0x6d04, 0x00 },
+{ "linux/mmtimer.h", "MMTIMER_GETCOUNTER", _IOC_READ, 0x6d09, 0x08 },
+{ "linux/mmtimer.h", "MMTIMER_GETFREQ", _IOC_READ, 0x6d02, 0x08 },
+{ "linux/mmtimer.h", "MMTIMER_GETOFFSET", _IOC_NONE, 0x6d00, 0x00 },
+{ "linux/mmtimer.h", "MMTIMER_GETRES", _IOC_READ, 0x6d01, 0x08 },
+{ "linux/mmtimer.h", "MMTIMER_MMAPAVAIL", _IOC_NONE, 0x6d06, 0x00 },
+{ "linux/msdos_fs.h", "FAT_IOCTL_GET_ATTRIBUTES", _IOC_READ, 0x7210, 0x04 },
+{ "linux/msdos_fs.h", "FAT_IOCTL_GET_VOLUME_ID", _IOC_READ, 0x7213, 0x04 },
+{ "linux/msdos_fs.h", "FAT_IOCTL_SET_ATTRIBUTES", _IOC_WRITE, 0x7211, 0x04 },
+{ "linux/msdos_fs.h", "VFAT_IOCTL_READDIR_BOTH", _IOC_READ, 0x7201, 0x230 },
+{ "linux/msdos_fs.h", "VFAT_IOCTL_READDIR_SHORT", _IOC_READ, 0x7202, 0x230 },
+{ "linux/mtio.h", "MTIOCGET", _IOC_READ, 0x6d02, 0x30 },
+{ "linux/mtio.h", "MTIOCPOS", _IOC_READ, 0x6d03, 0x08 },
+{ "linux/mtio.h", "MTIOCTOP", _IOC_WRITE, 0x6d01, 0x08 },
+{ "linux/nbd.h", "NBD_CLEAR_QUE", _IOC_NONE, 0xab05, 0x00 },
+{ "linux/nbd.h", "NBD_CLEAR_SOCK", _IOC_NONE, 0xab04, 0x00 },
+{ "linux/nbd.h", "NBD_DISCONNECT", _IOC_NONE, 0xab08, 0x00 },
+{ "linux/nbd.h", "NBD_DO_IT", _IOC_NONE, 0xab03, 0x00 },
+{ "linux/nbd.h", "NBD_PRINT_DEBUG", _IOC_NONE, 0xab06, 0x00 },
+{ "linux/nbd.h", "NBD_SET_BLKSIZE", _IOC_NONE, 0xab01, 0x00 },
+{ "linux/nbd.h", "NBD_SET_FLAGS", _IOC_NONE, 0xab0a, 0x00 },
+{ "linux/nbd.h", "NBD_SET_SIZE", _IOC_NONE, 0xab02, 0x00 },
+{ "linux/nbd.h", "NBD_SET_SIZE_BLOCKS", _IOC_NONE, 0xab07, 0x00 },
+{ "linux/nbd.h", "NBD_SET_SOCK", _IOC_NONE, 0xab00, 0x00 },
+{ "linux/nbd.h", "NBD_SET_TIMEOUT", _IOC_NONE, 0xab09, 0x00 },
+{ "linux/ndctl.h", "ND_IOCTL_ARS_CAP", _IOC_READ|_IOC_WRITE, 0x4e01, 0x20 },
+{ "linux/ndctl.h", "ND_IOCTL_ARS_START", _IOC_READ|_IOC_WRITE, 0x4e02, 0x20 },
+{ "linux/ndctl.h", "ND_IOCTL_ARS_STATUS", _IOC_READ|_IOC_WRITE, 0x4e03, 0x30 },
+{ "linux/ndctl.h", "ND_IOCTL_CALL", _IOC_READ|_IOC_WRITE, 0x4e0a, 0x40 },
+{ "linux/ndctl.h", "ND_IOCTL_CLEAR_ERROR", _IOC_READ|_IOC_WRITE, 0x4e04, 0x20 },
+{ "linux/ndctl.h", "ND_IOCTL_DIMM_FLAGS", _IOC_READ|_IOC_WRITE, 0x4e03, 0x08 },
+{ "linux/ndctl.h", "ND_IOCTL_GET_CONFIG_DATA", _IOC_READ|_IOC_WRITE, 0x4e05, 0x0c },
+{ "linux/ndctl.h", "ND_IOCTL_GET_CONFIG_SIZE", _IOC_READ|_IOC_WRITE, 0x4e04, 0x0c },
+{ "linux/ndctl.h", "ND_IOCTL_SET_CONFIG_DATA", _IOC_READ|_IOC_WRITE, 0x4e06, 0x08 },
+{ "linux/ndctl.h", "ND_IOCTL_VENDOR", _IOC_READ|_IOC_WRITE, 0x4e09, 0x08 },
+{ "linux/nilfs2_api.h", "NILFS_IOCTL_CHANGE_CPMODE", _IOC_WRITE, 0x6e80, 0x10 },
+{ "linux/nilfs2_api.h", "NILFS_IOCTL_CLEAN_SEGMENTS", _IOC_WRITE, 0x6e88, 0x78 },
+{ "linux/nilfs2_api.h", "NILFS_IOCTL_DELETE_CHECKPOINT", _IOC_WRITE, 0x6e81, 0x08 },
+{ "linux/nilfs2_api.h", "NILFS_IOCTL_GET_BDESCS", _IOC_READ|_IOC_WRITE, 0x6e87, 0x18 },
+{ "linux/nilfs2_api.h", "NILFS_IOCTL_GET_CPINFO", _IOC_READ, 0x6e82, 0x18 },
+{ "linux/nilfs2_api.h", "NILFS_IOCTL_GET_CPSTAT", _IOC_READ, 0x6e83, 0x18 },
+{ "linux/nilfs2_api.h", "NILFS_IOCTL_GET_SUINFO", _IOC_READ, 0x6e84, 0x18 },
+{ "linux/nilfs2_api.h", "NILFS_IOCTL_GET_SUSTAT", _IOC_READ, 0x6e85, 0x30 },
+{ "linux/nilfs2_api.h", "NILFS_IOCTL_GET_VINFO", _IOC_READ|_IOC_WRITE, 0x6e86, 0x18 },
+{ "linux/nilfs2_api.h", "NILFS_IOCTL_RESIZE", _IOC_WRITE, 0x6e8b, 0x08 },
+{ "linux/nilfs2_api.h", "NILFS_IOCTL_SET_ALLOC_RANGE", _IOC_WRITE, 0x6e8c, 0x10 },
+{ "linux/nilfs2_api.h", "NILFS_IOCTL_SET_SUINFO", _IOC_WRITE, 0x6e8d, 0x18 },
+{ "linux/nilfs2_api.h", "NILFS_IOCTL_SYNC", _IOC_READ, 0x6e8a, 0x08 },
+{ "linux/nitro_enclaves.h", "NE_ADD_VCPU", _IOC_READ|_IOC_WRITE, 0xae21, 0x04 },
+{ "linux/nitro_enclaves.h", "NE_CREATE_VM", _IOC_READ, 0xae20, 0x08 },
+{ "linux/nitro_enclaves.h", "NE_GET_IMAGE_LOAD_INFO", _IOC_READ|_IOC_WRITE, 0xae22, 0x10 },
+{ "linux/nitro_enclaves.h", "NE_SET_USER_MEMORY_REGION", _IOC_WRITE, 0xae23, 0x18 },
+{ "linux/nitro_enclaves.h", "NE_START_ENCLAVE", _IOC_READ|_IOC_WRITE, 0xae24, 0x10 },
+{ "linux/nsfs.h", "NS_GET_NSTYPE", _IOC_NONE, 0xb703, 0x00 },
+{ "linux/nsfs.h", "NS_GET_OWNER_UID", _IOC_NONE, 0xb704, 0x00 },
+{ "linux/nsfs.h", "NS_GET_PARENT", _IOC_NONE, 0xb702, 0x00 },
+{ "linux/nsfs.h", "NS_GET_USERNS", _IOC_NONE, 0xb701, 0x00 },
+{ "linux/nvme_ioctl.h", "NVME_IOCTL_ADMIN64_CMD", _IOC_READ|_IOC_WRITE, 0x4e47, 0x50 },
+{ "linux/nvme_ioctl.h", "NVME_IOCTL_ADMIN_CMD", _IOC_READ|_IOC_WRITE, 0x4e41, 0x48 },
+{ "linux/nvme_ioctl.h", "NVME_IOCTL_ID", _IOC_NONE, 0x4e40, 0x00 },
+{ "linux/nvme_ioctl.h", "NVME_IOCTL_IO64_CMD", _IOC_READ|_IOC_WRITE, 0x4e48, 0x50 },
+{ "linux/nvme_ioctl.h", "NVME_IOCTL_IO_CMD", _IOC_READ|_IOC_WRITE, 0x4e43, 0x48 },
+{ "linux/nvme_ioctl.h", "NVME_IOCTL_RESCAN", _IOC_NONE, 0x4e46, 0x00 },
+{ "linux/nvme_ioctl.h", "NVME_IOCTL_RESET", _IOC_NONE, 0x4e44, 0x00 },
+{ "linux/nvme_ioctl.h", "NVME_IOCTL_SUBMIT_IO", _IOC_WRITE, 0x4e42, 0x30 },
+{ "linux/nvme_ioctl.h", "NVME_IOCTL_SUBSYS_RESET", _IOC_NONE, 0x4e45, 0x00 },
+{ "linux/nvram.h", "NVRAM_INIT", _IOC_NONE, 0x7040, 0x00 },
+{ "linux/nvram.h", "NVRAM_SETCKS", _IOC_NONE, 0x7041, 0x00 },
+{ "linux/omap3isp.h", "VIDIOC_OMAP3ISP_AEWB_CFG", _IOC_READ|_IOC_WRITE, 0x56c3, 0x20 },
+{ "linux/omap3isp.h", "VIDIOC_OMAP3ISP_AF_CFG", _IOC_READ|_IOC_WRITE, 0x56c5, 0x4c },
+{ "linux/omap3isp.h", "VIDIOC_OMAP3ISP_CCDC_CFG", _IOC_READ|_IOC_WRITE, 0x56c1, 0x38 },
+{ "linux/omap3isp.h", "VIDIOC_OMAP3ISP_HIST_CFG", _IOC_READ|_IOC_WRITE, 0x56c4, 0x30 },
+{ "linux/omap3isp.h", "VIDIOC_OMAP3ISP_PRV_CFG", _IOC_READ|_IOC_WRITE, 0x56c2, 0x70 },
+{ "linux/omap3isp.h", "VIDIOC_OMAP3ISP_STAT_EN", _IOC_READ|_IOC_WRITE, 0x56c7, 0x08 },
+{ "linux/omap3isp.h", "VIDIOC_OMAP3ISP_STAT_REQ", _IOC_READ|_IOC_WRITE, 0x56c6, 0x28 },
+{ "linux/omap3isp.h", "VIDIOC_OMAP3ISP_STAT_REQ_TIME32", _IOC_READ|_IOC_WRITE, 0x56c6, 0x18 },
+{ "linux/omapfb.h", "OMAPFB_CTRL_TEST", _IOC_WRITE, 0x4f2e, 0x04 },
+{ "linux/omapfb.h", "OMAPFB_GET_CAPS", _IOC_READ, 0x4f2a, 0x0c },
+{ "linux/omapfb.h", "OMAPFB_GET_COLOR_KEY", _IOC_WRITE, 0x4f33, 0x10 },
+{ "linux/omapfb.h", "OMAPFB_GET_DISPLAY_INFO", _IOC_READ, 0x4f3f, 0x20 },
+{ "linux/omapfb.h", "OMAPFB_GET_OVERLAY_COLORMODE", _IOC_READ, 0x4f3b, 0x3c },
+{ "linux/omapfb.h", "OMAPFB_GET_UPDATE_MODE", _IOC_WRITE, 0x4f2b, 0x04 },
+{ "linux/omapfb.h", "OMAPFB_GET_VRAM_INFO", _IOC_READ, 0x4f3d, 0x20 },
+{ "linux/omapfb.h", "OMAPFB_LCD_TEST", _IOC_WRITE, 0x4f2d, 0x04 },
+{ "linux/omapfb.h", "OMAPFB_MEMORY_READ", _IOC_READ, 0x4f3a, 0x18 },
+{ "linux/omapfb.h", "OMAPFB_MIRROR", _IOC_WRITE, 0x4f1f, 0x04 },
+{ "linux/omapfb.h", "OMAPFB_QUERY_MEM", _IOC_WRITE, 0x4f38, 0x08 },
+{ "linux/omapfb.h", "OMAPFB_QUERY_PLANE", _IOC_WRITE, 0x4f35, 0x44 },
+{ "linux/omapfb.h", "OMAPFB_SETUP_MEM", _IOC_WRITE, 0x4f37, 0x08 },
+{ "linux/omapfb.h", "OMAPFB_SETUP_PLANE", _IOC_WRITE, 0x4f34, 0x44 },
+{ "linux/omapfb.h", "OMAPFB_SET_COLOR_KEY", _IOC_WRITE, 0x4f32, 0x10 },
+{ "linux/omapfb.h", "OMAPFB_SET_TEARSYNC", _IOC_WRITE, 0x4f3e, 0x08 },
+{ "linux/omapfb.h", "OMAPFB_SET_UPDATE_MODE", _IOC_WRITE, 0x4f28, 0x04 },
+{ "linux/omapfb.h", "OMAPFB_SYNC_GFX", _IOC_NONE, 0x4f25, 0x00 },
+{ "linux/omapfb.h", "OMAPFB_UPDATE_WINDOW", _IOC_WRITE, 0x4f36, 0x44 },
+{ "linux/omapfb.h", "OMAPFB_UPDATE_WINDOW_OLD", _IOC_WRITE, 0x4f2f, 0x14 },
+{ "linux/omapfb.h", "OMAPFB_VSYNC", _IOC_NONE, 0x4f26, 0x00 },
+{ "linux/omapfb.h", "OMAPFB_WAITFORGO", _IOC_NONE, 0x4f3c, 0x00 },
+{ "linux/omapfb.h", "OMAPFB_WAITFORVSYNC", _IOC_NONE, 0x4f39, 0x00 },
+{ "linux/pcitest.h", "PCITEST_BAR", _IOC_NONE, 0x5001, 0x00 },
+{ "linux/pcitest.h", "PCITEST_CLEAR_IRQ", _IOC_NONE, 0x5010, 0x00 },
+{ "linux/pcitest.h", "PCITEST_COPY", _IOC_WRITE, 0x5006, 0x08 },
+{ "linux/pcitest.h", "PCITEST_GET_IRQTYPE", _IOC_NONE, 0x5009, 0x00 },
+{ "linux/pcitest.h", "PCITEST_LEGACY_IRQ", _IOC_NONE, 0x5002, 0x00 },
+{ "linux/pcitest.h", "PCITEST_MSI", _IOC_WRITE, 0x5003, 0x04 },
+{ "linux/pcitest.h", "PCITEST_MSIX", _IOC_WRITE, 0x5007, 0x04 },
+{ "linux/pcitest.h", "PCITEST_READ", _IOC_WRITE, 0x5005, 0x08 },
+{ "linux/pcitest.h", "PCITEST_SET_IRQTYPE", _IOC_WRITE, 0x5008, 0x04 },
+{ "linux/pcitest.h", "PCITEST_WRITE", _IOC_WRITE, 0x5004, 0x08 },
+{ "linux/perf_event.h", "PERF_EVENT_IOC_DISABLE", _IOC_NONE, 0x2401, 0x00 },
+{ "linux/perf_event.h", "PERF_EVENT_IOC_ENABLE", _IOC_NONE, 0x2400, 0x00 },
+{ "linux/perf_event.h", "PERF_EVENT_IOC_ID", _IOC_READ, 0x2407, 0x08 },
+{ "linux/perf_event.h", "PERF_EVENT_IOC_MODIFY_ATTRIBUTES", _IOC_WRITE, 0x240b, 0x08 },
+{ "linux/perf_event.h", "PERF_EVENT_IOC_PAUSE_OUTPUT", _IOC_WRITE, 0x2409, 0x04 },
+{ "linux/perf_event.h", "PERF_EVENT_IOC_PERIOD", _IOC_WRITE, 0x2404, 0x08 },
+{ "linux/perf_event.h", "PERF_EVENT_IOC_QUERY_BPF", _IOC_READ|_IOC_WRITE, 0x240a, 0x08 },
+{ "linux/perf_event.h", "PERF_EVENT_IOC_REFRESH", _IOC_NONE, 0x2402, 0x00 },
+{ "linux/perf_event.h", "PERF_EVENT_IOC_RESET", _IOC_NONE, 0x2403, 0x00 },
+{ "linux/perf_event.h", "PERF_EVENT_IOC_SET_BPF", _IOC_WRITE, 0x2408, 0x04 },
+{ "linux/perf_event.h", "PERF_EVENT_IOC_SET_FILTER", _IOC_WRITE, 0x2406, 0x08 },
+{ "linux/perf_event.h", "PERF_EVENT_IOC_SET_OUTPUT", _IOC_NONE, 0x2405, 0x00 },
+{ "linux/phantom.h", "PHN_GETREG", _IOC_READ|_IOC_WRITE, 0x7005, 0x08 },
+{ "linux/phantom.h", "PHN_GETREGS", _IOC_READ|_IOC_WRITE, 0x7007, 0x28 },
+{ "linux/phantom.h", "PHN_GET_REG", _IOC_READ|_IOC_WRITE, 0x7000, 0x08 },
+{ "linux/phantom.h", "PHN_GET_REGS", _IOC_READ|_IOC_WRITE, 0x7002, 0x08 },
+{ "linux/phantom.h", "PHN_NOT_OH", _IOC_NONE, 0x7004, 0x00 },
+{ "linux/phantom.h", "PHN_SETREG", _IOC_WRITE, 0x7006, 0x08 },
+{ "linux/phantom.h", "PHN_SETREGS", _IOC_WRITE, 0x7008, 0x28 },
+{ "linux/phantom.h", "PHN_SET_REG", _IOC_WRITE, 0x7001, 0x08 },
+{ "linux/phantom.h", "PHN_SET_REGS", _IOC_WRITE, 0x7003, 0x08 },
+{ "linux/pktcdvd.h", "PACKET_CTRL_CMD", _IOC_READ|_IOC_WRITE, 0x5801, 0x18 },
+{ "linux/platform_data/cros_ec_chardev.h", "CROS_EC_DEV_IOCEVENTMASK", _IOC_NONE, 0xec02, 0x00 },
+{ "linux/platform_data/cros_ec_chardev.h", "CROS_EC_DEV_IOCRDMEM", _IOC_READ|_IOC_WRITE, 0xec01, 0x108 },
+{ "linux/platform_data/cros_ec_chardev.h", "CROS_EC_DEV_IOCXCMD", _IOC_READ|_IOC_WRITE, 0xec00, 0x14 },
+{ "linux/platform_data/media/si4713.h", "SI4713_IOC_MEASURE_RNL", _IOC_READ|_IOC_WRITE, 0x56c0, 0x1c },
+{ "linux/pmu.h", "PMU_IOC_CAN_SLEEP", _IOC_READ, 0x4205, 0x08 },
+{ "linux/pmu.h", "PMU_IOC_GET_BACKLIGHT", _IOC_READ, 0x4201, 0x08 },
+{ "linux/pmu.h", "PMU_IOC_GET_MODEL", _IOC_READ, 0x4203, 0x08 },
+{ "linux/pmu.h", "PMU_IOC_GRAB_BACKLIGHT", _IOC_READ, 0x4206, 0x08 },
+{ "linux/pmu.h", "PMU_IOC_HAS_ADB", _IOC_READ, 0x4204, 0x08 },
+{ "linux/pmu.h", "PMU_IOC_SET_BACKLIGHT", _IOC_WRITE, 0x4202, 0x08 },
+{ "linux/pmu.h", "PMU_IOC_SLEEP", _IOC_NONE, 0x4200, 0x00 },
+{ "linux/ppdev.h", "PPCLAIM", _IOC_NONE, 0x708b, 0x00 },
+{ "linux/ppdev.h", "PPCLRIRQ", _IOC_READ, 0x7093, 0x04 },
+{ "linux/ppdev.h", "PPDATADIR", _IOC_WRITE, 0x7090, 0x04 },
+{ "linux/ppdev.h", "PPEXCL", _IOC_NONE, 0x708f, 0x00 },
+{ "linux/ppdev.h", "PPFCONTROL", _IOC_WRITE, 0x708e, 0x02 },
+{ "linux/ppdev.h", "PPGETFLAGS", _IOC_READ, 0x709a, 0x04 },
+{ "linux/ppdev.h", "PPGETMODE", _IOC_READ, 0x7098, 0x04 },
+{ "linux/ppdev.h", "PPGETMODES", _IOC_READ, 0x7097, 0x04 },
+{ "linux/ppdev.h", "PPGETPHASE", _IOC_READ, 0x7099, 0x04 },
+{ "linux/ppdev.h", "PPGETTIME", _IOC_READ, 0x7095, 0x10 },
+{ "linux/ppdev.h", "PPNEGOT", _IOC_WRITE, 0x7091, 0x04 },
+{ "linux/ppdev.h", "PPRCONTROL", _IOC_READ, 0x7083, 0x01 },
+{ "linux/ppdev.h", "PPRDATA", _IOC_READ, 0x7085, 0x01 },
+{ "linux/ppdev.h", "PPRELEASE", _IOC_NONE, 0x708c, 0x00 },
+{ "linux/ppdev.h", "PPRSTATUS", _IOC_READ, 0x7081, 0x01 },
+{ "linux/ppdev.h", "PPSETFLAGS", _IOC_WRITE, 0x709b, 0x04 },
+{ "linux/ppdev.h", "PPSETMODE", _IOC_WRITE, 0x7080, 0x04 },
+{ "linux/ppdev.h", "PPSETPHASE", _IOC_WRITE, 0x7094, 0x04 },
+{ "linux/ppdev.h", "PPSETTIME", _IOC_WRITE, 0x7096, 0x10 },
+{ "linux/ppdev.h", "PPWCONTROL", _IOC_WRITE, 0x7084, 0x01 },
+{ "linux/ppdev.h", "PPWCTLONIRQ", _IOC_WRITE, 0x7092, 0x01 },
+{ "linux/ppdev.h", "PPWDATA", _IOC_WRITE, 0x7086, 0x01 },
+{ "linux/ppdev.h", "PPYIELD", _IOC_NONE, 0x708d, 0x00 },
+{ "linux/ppp-ioctl.h", "PPPIOCATTACH", _IOC_WRITE, 0x743d, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCATTCHAN", _IOC_WRITE, 0x7438, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCCONNECT", _IOC_WRITE, 0x743a, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCDETACH", _IOC_WRITE, 0x743c, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCDISCONN", _IOC_NONE, 0x7439, 0x00 },
+{ "linux/ppp-ioctl.h", "PPPIOCGASYNCMAP", _IOC_READ, 0x7458, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCGCHAN", _IOC_READ, 0x7437, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCGDEBUG", _IOC_READ, 0x7441, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCGFLAGS", _IOC_READ, 0x745a, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCGIDLE32", _IOC_READ, 0x743f, 0x08 },
+{ "linux/ppp-ioctl.h", "PPPIOCGIDLE64", _IOC_READ, 0x743f, 0x10 },
+{ "linux/ppp-ioctl.h", "PPPIOCGL2TPSTATS", _IOC_READ, 0x7436, 0x48 },
+{ "linux/ppp-ioctl.h", "PPPIOCGMRU", _IOC_READ, 0x7453, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCGNPMODE", _IOC_READ|_IOC_WRITE, 0x744c, 0x08 },
+{ "linux/ppp-ioctl.h", "PPPIOCGRASYNCMAP", _IOC_READ, 0x7455, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCGUNIT", _IOC_READ, 0x7456, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCGXASYNCMAP", _IOC_READ, 0x7450, 0x20 },
+{ "linux/ppp-ioctl.h", "PPPIOCNEWUNIT", _IOC_READ|_IOC_WRITE, 0x743e, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCSACTIVE", _IOC_WRITE, 0x7446, 0x10 },
+{ "linux/ppp-ioctl.h", "PPPIOCSASYNCMAP", _IOC_WRITE, 0x7457, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCSCOMPRESS", _IOC_WRITE, 0x744d, 0x10 },
+{ "linux/ppp-ioctl.h", "PPPIOCSDEBUG", _IOC_WRITE, 0x7440, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCSFLAGS", _IOC_WRITE, 0x7459, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCSMAXCID", _IOC_WRITE, 0x7451, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCSMRRU", _IOC_WRITE, 0x743b, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCSMRU", _IOC_WRITE, 0x7452, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCSNPMODE", _IOC_WRITE, 0x744b, 0x08 },
+{ "linux/ppp-ioctl.h", "PPPIOCSPASS", _IOC_WRITE, 0x7447, 0x10 },
+{ "linux/ppp-ioctl.h", "PPPIOCSRASYNCMAP", _IOC_WRITE, 0x7454, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCSXASYNCMAP", _IOC_WRITE, 0x744f, 0x20 },
+{ "linux/ppp-ioctl.h", "PPPIOCXFERUNIT", _IOC_NONE, 0x744e, 0x00 },
+{ "linux/pps.h", "PPS_FETCH", _IOC_READ|_IOC_WRITE, 0x70a4, 0x08 },
+{ "linux/pps.h", "PPS_GETCAP", _IOC_READ, 0x70a3, 0x08 },
+{ "linux/pps.h", "PPS_GETPARAMS", _IOC_READ, 0x70a1, 0x08 },
+{ "linux/pps.h", "PPS_KC_BIND", _IOC_WRITE, 0x70a5, 0x08 },
+{ "linux/pps.h", "PPS_SETPARAMS", _IOC_WRITE, 0x70a2, 0x08 },
+{ "linux/pr.h", "IOC_PR_CLEAR", _IOC_WRITE, 0x70cd, 0x10 },
+{ "linux/pr.h", "IOC_PR_PREEMPT", _IOC_WRITE, 0x70cb, 0x18 },
+{ "linux/pr.h", "IOC_PR_PREEMPT_ABORT", _IOC_WRITE, 0x70cc, 0x18 },
+{ "linux/pr.h", "IOC_PR_REGISTER", _IOC_WRITE, 0x70c8, 0x18 },
+{ "linux/pr.h", "IOC_PR_RELEASE", _IOC_WRITE, 0x70ca, 0x10 },
+{ "linux/pr.h", "IOC_PR_RESERVE", _IOC_WRITE, 0x70c9, 0x10 },
+{ "linux/psp-sev.h", "SEV_ISSUE_CMD", _IOC_READ|_IOC_WRITE, 0x5300, 0x10 },
+{ "linux/ptp_clock.h", "PTP_CLOCK_GETCAPS", _IOC_READ, 0x3d01, 0x50 },
+{ "linux/ptp_clock.h", "PTP_CLOCK_GETCAPS2", _IOC_READ, 0x3d0a, 0x50 },
+{ "linux/ptp_clock.h", "PTP_ENABLE_PPS", _IOC_WRITE, 0x3d04, 0x04 },
+{ "linux/ptp_clock.h", "PTP_ENABLE_PPS2", _IOC_WRITE, 0x3d0d, 0x04 },
+{ "linux/ptp_clock.h", "PTP_EXTTS_REQUEST", _IOC_WRITE, 0x3d02, 0x10 },
+{ "linux/ptp_clock.h", "PTP_EXTTS_REQUEST2", _IOC_WRITE, 0x3d0b, 0x10 },
+{ "linux/ptp_clock.h", "PTP_PEROUT_REQUEST", _IOC_WRITE, 0x3d03, 0x38 },
+{ "linux/ptp_clock.h", "PTP_PEROUT_REQUEST2", _IOC_WRITE, 0x3d0c, 0x38 },
+{ "linux/ptp_clock.h", "PTP_PIN_GETFUNC", _IOC_READ|_IOC_WRITE, 0x3d06, 0x60 },
+{ "linux/ptp_clock.h", "PTP_PIN_GETFUNC2", _IOC_READ|_IOC_WRITE, 0x3d0f, 0x60 },
+{ "linux/ptp_clock.h", "PTP_PIN_SETFUNC", _IOC_WRITE, 0x3d07, 0x60 },
+{ "linux/ptp_clock.h", "PTP_PIN_SETFUNC2", _IOC_WRITE, 0x3d10, 0x60 },
+{ "linux/ptp_clock.h", "PTP_SYS_OFFSET", _IOC_WRITE, 0x3d05, 0x340 },
+{ "linux/ptp_clock.h", "PTP_SYS_OFFSET2", _IOC_WRITE, 0x3d0e, 0x340 },
+{ "linux/ptp_clock.h", "PTP_SYS_OFFSET_EXTENDED", _IOC_READ|_IOC_WRITE, 0x3d09, 0x4c0 },
+{ "linux/ptp_clock.h", "PTP_SYS_OFFSET_EXTENDED2", _IOC_READ|_IOC_WRITE, 0x3d12, 0x4c0 },
+{ "linux/ptp_clock.h", "PTP_SYS_OFFSET_PRECISE", _IOC_READ|_IOC_WRITE, 0x3d08, 0x40 },
+{ "linux/ptp_clock.h", "PTP_SYS_OFFSET_PRECISE2", _IOC_READ|_IOC_WRITE, 0x3d11, 0x40 },
+{ "linux/radeonfb.h", "FBIO_RADEON_GET_MIRROR", _IOC_READ, 0x4003, 0x08 },
+{ "linux/radeonfb.h", "FBIO_RADEON_SET_MIRROR", _IOC_WRITE, 0x4004, 0x08 },
+{ "linux/raid/md_u.h", "ADD_NEW_DISK", _IOC_WRITE, 0x0921, 0x14 },
+{ "linux/raid/md_u.h", "CLEAR_ARRAY", _IOC_NONE, 0x0920, 0x00 },
+{ "linux/raid/md_u.h", "CLUSTERED_DISK_NACK", _IOC_NONE, 0x0935, 0x00 },
+{ "linux/raid/md_u.h", "GET_ARRAY_INFO", _IOC_READ, 0x0911, 0x48 },
+{ "linux/raid/md_u.h", "GET_BITMAP_FILE", _IOC_READ, 0x0915, 0x1000 },
+{ "linux/raid/md_u.h", "GET_DISK_INFO", _IOC_READ, 0x0912, 0x14 },
+{ "linux/raid/md_u.h", "HOT_ADD_DISK", _IOC_NONE, 0x0928, 0x00 },
+{ "linux/raid/md_u.h", "HOT_GENERATE_ERROR", _IOC_NONE, 0x092a, 0x00 },
+{ "linux/raid/md_u.h", "HOT_REMOVE_DISK", _IOC_NONE, 0x0922, 0x00 },
+{ "linux/raid/md_u.h", "PROTECT_ARRAY", _IOC_NONE, 0x0927, 0x00 },
+{ "linux/raid/md_u.h", "RAID_AUTORUN", _IOC_NONE, 0x0914, 0x00 },
+{ "linux/raid/md_u.h", "RAID_VERSION", _IOC_READ, 0x0910, 0x0c },
+{ "linux/raid/md_u.h", "RESTART_ARRAY_RW", _IOC_NONE, 0x0934, 0x00 },
+{ "linux/raid/md_u.h", "RUN_ARRAY", _IOC_WRITE, 0x0930, 0x0c },
+{ "linux/raid/md_u.h", "SET_ARRAY_INFO", _IOC_WRITE, 0x0923, 0x48 },
+{ "linux/raid/md_u.h", "SET_BITMAP_FILE", _IOC_WRITE, 0x092b, 0x04 },
+{ "linux/raid/md_u.h", "SET_DISK_FAULTY", _IOC_NONE, 0x0929, 0x00 },
+{ "linux/raid/md_u.h", "SET_DISK_INFO", _IOC_NONE, 0x0924, 0x00 },
+{ "linux/raid/md_u.h", "STOP_ARRAY", _IOC_NONE, 0x0932, 0x00 },
+{ "linux/raid/md_u.h", "STOP_ARRAY_RO", _IOC_NONE, 0x0933, 0x00 },
+{ "linux/raid/md_u.h", "UNPROTECT_ARRAY", _IOC_NONE, 0x0926, 0x00 },
+{ "linux/raid/md_u.h", "WRITE_RAID_INFO", _IOC_NONE, 0x0925, 0x00 },
+{ "linux/random.h", "RNDADDENTROPY", _IOC_WRITE, 0x5203, 0x08 },
+{ "linux/random.h", "RNDADDTOENTCNT", _IOC_WRITE, 0x5201, 0x04 },
+{ "linux/random.h", "RNDCLEARPOOL", _IOC_NONE, 0x5206, 0x00 },
+{ "linux/random.h", "RNDGETENTCNT", _IOC_READ, 0x5200, 0x04 },
+{ "linux/random.h", "RNDGETPOOL", _IOC_READ, 0x5202, 0x08 },
+{ "linux/random.h", "RNDRESEEDCRNG", _IOC_NONE, 0x5207, 0x00 },
+{ "linux/random.h", "RNDZAPENTCNT", _IOC_NONE, 0x5204, 0x00 },
+{ "linux/raw.h", "RAW_GETBIND", _IOC_NONE, 0xac01, 0x00 },
+{ "linux/raw.h", "RAW_SETBIND", _IOC_NONE, 0xac00, 0x00 },
+{ "linux/reiserfs_fs.h", "REISERFS_IOC_UNPACK", _IOC_WRITE, 0xcd01, 0x08 },
+{ "linux/remoteproc_cdev.h", "RPROC_GET_SHUTDOWN_ON_RELEASE", _IOC_READ, 0xb702, 0x04 },
+{ "linux/remoteproc_cdev.h", "RPROC_SET_SHUTDOWN_ON_RELEASE", _IOC_WRITE, 0xb701, 0x04 },
+{ "linux/rfkill.h", "RFKILL_IOCTL_NOINPUT", _IOC_NONE, 0x5201, 0x00 },
+{ "linux/rio_cm_cdev.h", "RIO_CM_CHAN_ACCEPT", _IOC_READ|_IOC_WRITE, 0x6307, 0x08 },
+{ "linux/rio_cm_cdev.h", "RIO_CM_CHAN_BIND", _IOC_WRITE, 0x6305, 0x08 },
+{ "linux/rio_cm_cdev.h", "RIO_CM_CHAN_CLOSE", _IOC_WRITE, 0x6304, 0x02 },
+{ "linux/rio_cm_cdev.h", "RIO_CM_CHAN_CONNECT", _IOC_WRITE, 0x6308, 0x08 },
+{ "linux/rio_cm_cdev.h", "RIO_CM_CHAN_CREATE", _IOC_READ|_IOC_WRITE, 0x6303, 0x02 },
+{ "linux/rio_cm_cdev.h", "RIO_CM_CHAN_LISTEN", _IOC_WRITE, 0x6306, 0x02 },
+{ "linux/rio_cm_cdev.h", "RIO_CM_CHAN_RECEIVE", _IOC_READ|_IOC_WRITE, 0x630a, 0x10 },
+{ "linux/rio_cm_cdev.h", "RIO_CM_CHAN_SEND", _IOC_WRITE, 0x6309, 0x10 },
+{ "linux/rio_cm_cdev.h", "RIO_CM_EP_GET_LIST", _IOC_READ|_IOC_WRITE, 0x6302, 0x04 },
+{ "linux/rio_cm_cdev.h", "RIO_CM_EP_GET_LIST_SIZE", _IOC_READ|_IOC_WRITE, 0x6301, 0x04 },
+{ "linux/rio_cm_cdev.h", "RIO_CM_MPORT_GET_LIST", _IOC_READ|_IOC_WRITE, 0x630b, 0x04 },
+{ "linux/rio_mport_cdev.h", "RIO_ALLOC_DMA", _IOC_READ|_IOC_WRITE, 0x6d13, 0x18 },
+{ "linux/rio_mport_cdev.h", "RIO_DEV_ADD", _IOC_WRITE, 0x6d17, 0x20 },
+{ "linux/rio_mport_cdev.h", "RIO_DEV_DEL", _IOC_WRITE, 0x6d18, 0x20 },
+{ "linux/rio_mport_cdev.h", "RIO_DISABLE_DOORBELL_RANGE", _IOC_WRITE, 0x6d0a, 0x08 },
+{ "linux/rio_mport_cdev.h", "RIO_DISABLE_PORTWRITE_RANGE", _IOC_WRITE, 0x6d0c, 0x10 },
+{ "linux/rio_mport_cdev.h", "RIO_ENABLE_DOORBELL_RANGE", _IOC_WRITE, 0x6d09, 0x08 },
+{ "linux/rio_mport_cdev.h", "RIO_ENABLE_PORTWRITE_RANGE", _IOC_WRITE, 0x6d0b, 0x10 },
+{ "linux/rio_mport_cdev.h", "RIO_FREE_DMA", _IOC_WRITE, 0x6d14, 0x08 },
+{ "linux/rio_mport_cdev.h", "RIO_GET_EVENT_MASK", _IOC_READ, 0x6d0e, 0x04 },
+{ "linux/rio_mport_cdev.h", "RIO_MAP_INBOUND", _IOC_READ|_IOC_WRITE, 0x6d11, 0x28 },
+{ "linux/rio_mport_cdev.h", "RIO_MAP_OUTBOUND", _IOC_READ|_IOC_WRITE, 0x6d0f, 0x28 },
+{ "linux/rio_mport_cdev.h", "RIO_MPORT_GET_PROPERTIES", _IOC_READ, 0x6d04, 0x30 },
+{ "linux/rio_mport_cdev.h", "RIO_MPORT_MAINT_COMPTAG_SET", _IOC_WRITE, 0x6d02, 0x04 },
+{ "linux/rio_mport_cdev.h", "RIO_MPORT_MAINT_HDID_SET", _IOC_WRITE, 0x6d01, 0x02 },
+{ "linux/rio_mport_cdev.h", "RIO_MPORT_MAINT_PORT_IDX_GET", _IOC_READ, 0x6d03, 0x04 },
+{ "linux/rio_mport_cdev.h", "RIO_MPORT_MAINT_READ_LOCAL", _IOC_READ, 0x6d05, 0x18 },
+{ "linux/rio_mport_cdev.h", "RIO_MPORT_MAINT_READ_REMOTE", _IOC_READ, 0x6d07, 0x18 },
+{ "linux/rio_mport_cdev.h", "RIO_MPORT_MAINT_WRITE_LOCAL", _IOC_WRITE, 0x6d06, 0x18 },
+{ "linux/rio_mport_cdev.h", "RIO_MPORT_MAINT_WRITE_REMOTE", _IOC_WRITE, 0x6d08, 0x18 },
+{ "linux/rio_mport_cdev.h", "RIO_SET_EVENT_MASK", _IOC_WRITE, 0x6d0d, 0x04 },
+{ "linux/rio_mport_cdev.h", "RIO_TRANSFER", _IOC_READ|_IOC_WRITE, 0x6d15, 0x18 },
+{ "linux/rio_mport_cdev.h", "RIO_UNMAP_INBOUND", _IOC_WRITE, 0x6d12, 0x08 },
+{ "linux/rio_mport_cdev.h", "RIO_UNMAP_OUTBOUND", _IOC_WRITE, 0x6d10, 0x28 },
+{ "linux/rio_mport_cdev.h", "RIO_WAIT_FOR_ASYNC", _IOC_WRITE, 0x6d16, 0x08 },
+{ "linux/rpmsg.h", "RPMSG_CREATE_EPT_IOCTL", _IOC_WRITE, 0xb501, 0x28 },
+{ "linux/rpmsg.h", "RPMSG_DESTROY_EPT_IOCTL", _IOC_NONE, 0xb502, 0x00 },
+{ "linux/rtc.h", "RTC_AIE_OFF", _IOC_NONE, 0x7002, 0x00 },
+{ "linux/rtc.h", "RTC_AIE_ON", _IOC_NONE, 0x7001, 0x00 },
+{ "linux/rtc.h", "RTC_ALM_READ", _IOC_READ, 0x7008, 0x24 },
+{ "linux/rtc.h", "RTC_ALM_SET", _IOC_WRITE, 0x7007, 0x24 },
+{ "linux/rtc.h", "RTC_EPOCH_READ", _IOC_READ, 0x700d, 0x08 },
+{ "linux/rtc.h", "RTC_EPOCH_SET", _IOC_WRITE, 0x700e, 0x08 },
+{ "linux/rtc.h", "RTC_IRQP_READ", _IOC_READ, 0x700b, 0x08 },
+{ "linux/rtc.h", "RTC_IRQP_SET", _IOC_WRITE, 0x700c, 0x08 },
+{ "linux/rtc.h", "RTC_PIE_OFF", _IOC_NONE, 0x7006, 0x00 },
+{ "linux/rtc.h", "RTC_PIE_ON", _IOC_NONE, 0x7005, 0x00 },
+{ "linux/rtc.h", "RTC_PLL_GET", _IOC_READ, 0x7011, 0x20 },
+{ "linux/rtc.h", "RTC_PLL_SET", _IOC_WRITE, 0x7012, 0x20 },
+{ "linux/rtc.h", "RTC_RD_TIME", _IOC_READ, 0x7009, 0x24 },
+{ "linux/rtc.h", "RTC_SET_TIME", _IOC_WRITE, 0x700a, 0x24 },
+{ "linux/rtc.h", "RTC_UIE_OFF", _IOC_NONE, 0x7004, 0x00 },
+{ "linux/rtc.h", "RTC_UIE_ON", _IOC_NONE, 0x7003, 0x00 },
+{ "linux/rtc.h", "RTC_VL_CLR", _IOC_NONE, 0x7014, 0x00 },
+{ "linux/rtc.h", "RTC_VL_READ", _IOC_READ, 0x7013, 0x04 },
+{ "linux/rtc.h", "RTC_WIE_OFF", _IOC_NONE, 0x7010, 0x00 },
+{ "linux/rtc.h", "RTC_WIE_ON", _IOC_NONE, 0x700f, 0x00 },
+{ "linux/rtc.h", "RTC_WKALM_RD", _IOC_READ, 0x7010, 0x28 },
+{ "linux/rtc.h", "RTC_WKALM_SET", _IOC_WRITE, 0x700f, 0x28 },
+{ "linux/scif_ioctl.h", "SCIF_ACCEPTREG", _IOC_READ|_IOC_WRITE, 0x7305, 0x08 },
+{ "linux/scif_ioctl.h", "SCIF_ACCEPTREQ", _IOC_READ|_IOC_WRITE, 0x7304, 0x10 },
+{ "linux/scif_ioctl.h", "SCIF_BIND", _IOC_READ|_IOC_WRITE, 0x7301, 0x08 },
+{ "linux/scif_ioctl.h", "SCIF_CONNECT", _IOC_READ|_IOC_WRITE, 0x7303, 0x08 },
+{ "linux/scif_ioctl.h", "SCIF_FENCE_MARK", _IOC_READ|_IOC_WRITE, 0x730f, 0x10 },
+{ "linux/scif_ioctl.h", "SCIF_FENCE_SIGNAL", _IOC_READ|_IOC_WRITE, 0x7311, 0x28 },
+{ "linux/scif_ioctl.h", "SCIF_FENCE_WAIT", _IOC_READ|_IOC_WRITE, 0x7310, 0x04 },
+{ "linux/scif_ioctl.h", "SCIF_GET_NODEIDS", _IOC_READ|_IOC_WRITE, 0x730e, 0x18 },
+{ "linux/scif_ioctl.h", "SCIF_LISTEN", _IOC_WRITE, 0x7302, 0x04 },
+{ "linux/scif_ioctl.h", "SCIF_READFROM", _IOC_READ|_IOC_WRITE, 0x730a, 0x28 },
+{ "linux/scif_ioctl.h", "SCIF_RECV", _IOC_READ|_IOC_WRITE, 0x7307, 0x18 },
+{ "linux/scif_ioctl.h", "SCIF_REG", _IOC_READ|_IOC_WRITE, 0x7308, 0x28 },
+{ "linux/scif_ioctl.h", "SCIF_SEND", _IOC_READ|_IOC_WRITE, 0x7306, 0x18 },
+{ "linux/scif_ioctl.h", "SCIF_UNREG", _IOC_READ|_IOC_WRITE, 0x7309, 0x10 },
+{ "linux/scif_ioctl.h", "SCIF_VREADFROM", _IOC_READ|_IOC_WRITE, 0x730c, 0x28 },
+{ "linux/scif_ioctl.h", "SCIF_VWRITETO", _IOC_READ|_IOC_WRITE, 0x730d, 0x28 },
+{ "linux/scif_ioctl.h", "SCIF_WRITETO", _IOC_READ|_IOC_WRITE, 0x730b, 0x28 },
+{ "linux/seccomp.h", "SECCOMP_IOCTL_NOTIF_ADDFD", _IOC_WRITE, 0x2103, 0x18 },
+{ "linux/seccomp.h", "SECCOMP_IOCTL_NOTIF_ID_VALID", _IOC_WRITE, 0x2102, 0x08 },
+{ "linux/seccomp.h", "SECCOMP_IOCTL_NOTIF_RECV", _IOC_READ|_IOC_WRITE, 0x2100, 0x50 },
+{ "linux/seccomp.h", "SECCOMP_IOCTL_NOTIF_SEND", _IOC_READ|_IOC_WRITE, 0x2101, 0x18 },
+{ "linux/sed-opal.h", "IOC_OPAL_ACTIVATE_LSP", _IOC_WRITE, 0x70df, 0x118 },
+{ "linux/sed-opal.h", "IOC_OPAL_ACTIVATE_USR", _IOC_WRITE, 0x70e1, 0x110 },
+{ "linux/sed-opal.h", "IOC_OPAL_ADD_USR_TO_LR", _IOC_WRITE, 0x70e4, 0x118 },
+{ "linux/sed-opal.h", "IOC_OPAL_ENABLE_DISABLE_MBR", _IOC_WRITE, 0x70e5, 0x110 },
+{ "linux/sed-opal.h", "IOC_OPAL_ERASE_LR", _IOC_WRITE, 0x70e6, 0x110 },
+{ "linux/sed-opal.h", "IOC_OPAL_GENERIC_TABLE_RW", _IOC_WRITE, 0x70eb, 0x138 },
+{ "linux/sed-opal.h", "IOC_OPAL_LOCK_UNLOCK", _IOC_WRITE, 0x70dd, 0x118 },
+{ "linux/sed-opal.h", "IOC_OPAL_LR_SETUP", _IOC_WRITE, 0x70e3, 0x128 },
+{ "linux/sed-opal.h", "IOC_OPAL_MBR_DONE", _IOC_WRITE, 0x70e9, 0x110 },
+{ "linux/sed-opal.h", "IOC_OPAL_PSID_REVERT_TPR", _IOC_WRITE, 0x70e8, 0x108 },
+{ "linux/sed-opal.h", "IOC_OPAL_REVERT_TPR", _IOC_WRITE, 0x70e2, 0x108 },
+{ "linux/sed-opal.h", "IOC_OPAL_SAVE", _IOC_WRITE, 0x70dc, 0x118 },
+{ "linux/sed-opal.h", "IOC_OPAL_SECURE_ERASE_LR", _IOC_WRITE, 0x70e7, 0x110 },
+{ "linux/sed-opal.h", "IOC_OPAL_SET_PW", _IOC_WRITE, 0x70e0, 0x220 },
+{ "linux/sed-opal.h", "IOC_OPAL_TAKE_OWNERSHIP", _IOC_WRITE, 0x70de, 0x108 },
+{ "linux/sed-opal.h", "IOC_OPAL_WRITE_SHADOW_MBR", _IOC_WRITE, 0x70ea, 0x120 },
+{ "linux/serio.h", "SPIOCSTYPE", _IOC_WRITE, 0x7101, 0x08 },
+{ "linux/sockios.h", "SIOCADDDLCI", 0, 0x8980, 0 },
+{ "linux/sockios.h", "SIOCADDMULTI", 0, 0x8931, 0 },
+{ "linux/sockios.h", "SIOCADDRT", 0, 0x890B, 0 },
+{ "linux/sockios.h", "SIOCBONDCHANGEACTIVE", 0, 0x8995, 0 },
+{ "linux/sockios.h", "SIOCBONDENSLAVE", 0, 0x8990, 0 },
+{ "linux/sockios.h", "SIOCBONDINFOQUERY", 0, 0x8994, 0 },
+{ "linux/sockios.h", "SIOCBONDRELEASE", 0, 0x8991, 0 },
+{ "linux/sockios.h", "SIOCBONDSETHWADDR", 0, 0x8992, 0 },
+{ "linux/sockios.h", "SIOCBONDSLAVEINFOQUERY", 0, 0x8993, 0 },
+{ "linux/sockios.h", "SIOCBRADDBR", 0, 0x89a0, 0 },
+{ "linux/sockios.h", "SIOCBRADDIF", 0, 0x89a2, 0 },
+{ "linux/sockios.h", "SIOCBRDELBR", 0, 0x89a1, 0 },
+{ "linux/sockios.h", "SIOCBRDELIF", 0, 0x89a3, 0 },
+{ "linux/sockios.h", "SIOCDARP", 0, 0x8953, 0 },
+{ "linux/sockios.h", "SIOCDELDLCI", 0, 0x8981, 0 },
+{ "linux/sockios.h", "SIOCDELMULTI", 0, 0x8932, 0 },
+{ "linux/sockios.h", "SIOCDELRT", 0, 0x890C, 0 },
+{ "linux/sockios.h", "SIOCDEVPRIVATE", 0, 0x89F0, 0 },
+{ "linux/sockios.h", "SIOCDIFADDR", 0, 0x8936, 0 },
+{ "linux/sockios.h", "SIOCDRARP", 0, 0x8960, 0 },
+{ "linux/sockios.h", "SIOCETHTOOL", 0, 0x8946, 0 },
+{ "linux/sockios.h", "SIOCGARP", 0, 0x8954, 0 },
+{ "linux/sockios.h", "SIOCGHWTSTAMP", 0, 0x89b1, 0 },
+{ "linux/sockios.h", "SIOCGIFADDR", 0, 0x8915, 0 },
+{ "linux/sockios.h", "SIOCGIFBR", 0, 0x8940, 0 },
+{ "linux/sockios.h", "SIOCGIFBRDADDR", 0, 0x8919, 0 },
+{ "linux/sockios.h", "SIOCGIFCONF", 0, 0x8912, 0 },
+{ "linux/sockios.h", "SIOCGIFCOUNT", 0, 0x8938, 0 },
+{ "linux/sockios.h", "SIOCGIFDSTADDR", 0, 0x8917, 0 },
+{ "linux/sockios.h", "SIOCGIFENCAP", 0, 0x8925, 0 },
+{ "linux/sockios.h", "SIOCGIFFLAGS", 0, 0x8913, 0 },
+{ "linux/sockios.h", "SIOCGIFHWADDR", 0, 0x8927, 0 },
+{ "linux/sockios.h", "SIOCGIFINDEX", 0, 0x8933, 0 },
+{ "linux/sockios.h", "SIOCGIFMAP", 0, 0x8970, 0 },
+{ "linux/sockios.h", "SIOCGIFMEM", 0, 0x891f, 0 },
+{ "linux/sockios.h", "SIOCGIFMETRIC", 0, 0x891d, 0 },
+{ "linux/sockios.h", "SIOCGIFMTU", 0, 0x8921, 0 },
+{ "linux/sockios.h", "SIOCGIFNAME", 0, 0x8910, 0 },
+{ "linux/sockios.h", "SIOCGIFNETMASK", 0, 0x891b, 0 },
+{ "linux/sockios.h", "SIOCGIFPFLAGS", 0, 0x8935, 0 },
+{ "linux/sockios.h", "SIOCGIFSLAVE", 0, 0x8929, 0 },
+{ "linux/sockios.h", "SIOCGIFTXQLEN", 0, 0x8942, 0 },
+{ "linux/sockios.h", "SIOCGIFVLAN", 0, 0x8982, 0 },
+{ "linux/sockios.h", "SIOCGMIIPHY", 0, 0x8947, 0 },
+{ "linux/sockios.h", "SIOCGMIIREG", 0, 0x8948, 0 },
+{ "linux/sockios.h", "SIOCGRARP", 0, 0x8961, 0 },
+{ "linux/sockios.h", "SIOCGSKNS", 0, 0x894C, 0 },
+{ "linux/sockios.h", "SIOCGSTAMPNS_NEW", _IOC_READ, 0x8907, 0x10 },
+{ "linux/sockios.h", "SIOCGSTAMP_NEW", _IOC_READ, 0x8906, 0x10 },
+{ "linux/sockios.h", "SIOCOUTQNSD", 0, 0x894B, 0 },
+{ "linux/sockios.h", "SIOCPROTOPRIVATE", 0, 0x89E0, 0 },
+{ "linux/sockios.h", "SIOCRTMSG", 0, 0x890D, 0 },
+{ "linux/sockios.h", "SIOCSARP", 0, 0x8955, 0 },
+{ "linux/sockios.h", "SIOCSHWTSTAMP", 0, 0x89b0, 0 },
+{ "linux/sockios.h", "SIOCSIFADDR", 0, 0x8916, 0 },
+{ "linux/sockios.h", "SIOCSIFBR", 0, 0x8941, 0 },
+{ "linux/sockios.h", "SIOCSIFBRDADDR", 0, 0x891a, 0 },
+{ "linux/sockios.h", "SIOCSIFDSTADDR", 0, 0x8918, 0 },
+{ "linux/sockios.h", "SIOCSIFENCAP", 0, 0x8926, 0 },
+{ "linux/sockios.h", "SIOCSIFFLAGS", 0, 0x8914, 0 },
+{ "linux/sockios.h", "SIOCSIFHWADDR", 0, 0x8924, 0 },
+{ "linux/sockios.h", "SIOCSIFHWBROADCAST", 0, 0x8937, 0 },
+{ "linux/sockios.h", "SIOCSIFLINK", 0, 0x8911, 0 },
+{ "linux/sockios.h", "SIOCSIFMAP", 0, 0x8971, 0 },
+{ "linux/sockios.h", "SIOCSIFMEM", 0, 0x8920, 0 },
+{ "linux/sockios.h", "SIOCSIFMETRIC", 0, 0x891e, 0 },
+{ "linux/sockios.h", "SIOCSIFMTU", 0, 0x8922, 0 },
+{ "linux/sockios.h", "SIOCSIFNAME", 0, 0x8923, 0 },
+{ "linux/sockios.h", "SIOCSIFNETMASK", 0, 0x891c, 0 },
+{ "linux/sockios.h", "SIOCSIFPFLAGS", 0, 0x8934, 0 },
+{ "linux/sockios.h", "SIOCSIFSLAVE", 0, 0x8930, 0 },
+{ "linux/sockios.h", "SIOCSIFTXQLEN", 0, 0x8943, 0 },
+{ "linux/sockios.h", "SIOCSIFVLAN", 0, 0x8983, 0 },
+{ "linux/sockios.h", "SIOCSMIIREG", 0, 0x8949, 0 },
+{ "linux/sockios.h", "SIOCSRARP", 0, 0x8962, 0 },
+{ "linux/sockios.h", "SIOCWANDEV", 0, 0x894A, 0 },
+{ "linux/sonet.h", "SONET_CLRDIAG", _IOC_READ|_IOC_WRITE, 0x6113, 0x04 },
+{ "linux/sonet.h", "SONET_GETDIAG", _IOC_READ, 0x6114, 0x04 },
+{ "linux/sonet.h", "SONET_GETFRAMING", _IOC_READ, 0x6116, 0x04 },
+{ "linux/sonet.h", "SONET_GETFRSENSE", _IOC_READ, 0x6117, 0x06 },
+{ "linux/sonet.h", "SONET_GETSTAT", _IOC_READ, 0x6110, 0x24 },
+{ "linux/sonet.h", "SONET_GETSTATZ", _IOC_READ, 0x6111, 0x24 },
+{ "linux/sonet.h", "SONET_SETDIAG", _IOC_READ|_IOC_WRITE, 0x6112, 0x04 },
+{ "linux/sonet.h", "SONET_SETFRAMING", _IOC_WRITE, 0x6115, 0x04 },
+{ "linux/sonypi.h", "SONYPI_IOCGBAT1CAP", _IOC_READ, 0x7602, 0x02 },
+{ "linux/sonypi.h", "SONYPI_IOCGBAT1REM", _IOC_READ, 0x7603, 0x02 },
+{ "linux/sonypi.h", "SONYPI_IOCGBAT2CAP", _IOC_READ, 0x7604, 0x02 },
+{ "linux/sonypi.h", "SONYPI_IOCGBAT2REM", _IOC_READ, 0x7605, 0x02 },
+{ "linux/sonypi.h", "SONYPI_IOCGBATFLAGS", _IOC_READ, 0x7607, 0x01 },
+{ "linux/sonypi.h", "SONYPI_IOCGBLUE", _IOC_READ, 0x7608, 0x01 },
+{ "linux/sonypi.h", "SONYPI_IOCGBRT", _IOC_READ, 0x7600, 0x01 },
+{ "linux/sonypi.h", "SONYPI_IOCGFAN", _IOC_READ, 0x760a, 0x01 },
+{ "linux/sonypi.h", "SONYPI_IOCGTEMP", _IOC_READ, 0x760c, 0x01 },
+{ "linux/sonypi.h", "SONYPI_IOCSBLUE", _IOC_WRITE, 0x7609, 0x01 },
+{ "linux/sonypi.h", "SONYPI_IOCSBRT", _IOC_WRITE, 0x7600, 0x01 },
+{ "linux/sonypi.h", "SONYPI_IOCSFAN", _IOC_WRITE, 0x760b, 0x01 },
+{ "linux/soundcard.h", "OSS_GETVERSION", _IOC_READ, 0x4d76, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_COPR_HALT", _IOC_READ|_IOC_WRITE, 0x4307, 0x14 },
+{ "linux/soundcard.h", "SNDCTL_COPR_LOAD", _IOC_READ|_IOC_WRITE, 0x4301, 0xfb0 },
+{ "linux/soundcard.h", "SNDCTL_COPR_RCODE", _IOC_READ|_IOC_WRITE, 0x4303, 0x14 },
+{ "linux/soundcard.h", "SNDCTL_COPR_RCVMSG", _IOC_READ, 0x4309, 0xfa4 },
+{ "linux/soundcard.h", "SNDCTL_COPR_RDATA", _IOC_READ|_IOC_WRITE, 0x4302, 0x14 },
+{ "linux/soundcard.h", "SNDCTL_COPR_RESET", _IOC_NONE, 0x4300, 0x00 },
+{ "linux/soundcard.h", "SNDCTL_COPR_RUN", _IOC_READ|_IOC_WRITE, 0x4306, 0x14 },
+{ "linux/soundcard.h", "SNDCTL_COPR_SENDMSG", _IOC_READ|_IOC_WRITE, 0x4308, 0xfa4 },
+{ "linux/soundcard.h", "SNDCTL_COPR_WCODE", _IOC_WRITE, 0x4305, 0x14 },
+{ "linux/soundcard.h", "SNDCTL_COPR_WDATA", _IOC_WRITE, 0x4304, 0x14 },
+{ "linux/soundcard.h", "SNDCTL_DSP_BIND_CHANNEL", _IOC_READ|_IOC_WRITE, 0x5041, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_CHANNELS", _IOC_READ|_IOC_WRITE, 0x5006, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_GETBLKSIZE", _IOC_READ|_IOC_WRITE, 0x5004, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_GETCAPS", _IOC_READ, 0x500f, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_GETCHANNELMASK", _IOC_READ|_IOC_WRITE, 0x5040, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_GETFMTS", _IOC_READ, 0x500b, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_GETIPTR", _IOC_READ, 0x5011, 0x0c },
+{ "linux/soundcard.h", "SNDCTL_DSP_GETISPACE", _IOC_READ, 0x500d, 0x10 },
+{ "linux/soundcard.h", "SNDCTL_DSP_GETODELAY", _IOC_READ, 0x5017, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_GETOPTR", _IOC_READ, 0x5012, 0x0c },
+{ "linux/soundcard.h", "SNDCTL_DSP_GETOSPACE", _IOC_READ, 0x500c, 0x10 },
+{ "linux/soundcard.h", "SNDCTL_DSP_GETSPDIF", _IOC_READ, 0x5043, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_GETTRIGGER", _IOC_READ, 0x5010, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_MAPINBUF", _IOC_READ, 0x5013, 0x10 },
+{ "linux/soundcard.h", "SNDCTL_DSP_MAPOUTBUF", _IOC_READ, 0x5014, 0x10 },
+{ "linux/soundcard.h", "SNDCTL_DSP_NONBLOCK", _IOC_NONE, 0x500e, 0x00 },
+{ "linux/soundcard.h", "SNDCTL_DSP_POST", _IOC_NONE, 0x5008, 0x00 },
+{ "linux/soundcard.h", "SNDCTL_DSP_PROFILE", _IOC_WRITE, 0x5017, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_RESET", _IOC_NONE, 0x5000, 0x00 },
+{ "linux/soundcard.h", "SNDCTL_DSP_SETDUPLEX", _IOC_NONE, 0x5016, 0x00 },
+{ "linux/soundcard.h", "SNDCTL_DSP_SETFMT", _IOC_READ|_IOC_WRITE, 0x5005, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_SETFRAGMENT", _IOC_READ|_IOC_WRITE, 0x500a, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_SETSPDIF", _IOC_WRITE, 0x5042, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_SETSYNCRO", _IOC_NONE, 0x5015, 0x00 },
+{ "linux/soundcard.h", "SNDCTL_DSP_SETTRIGGER", _IOC_WRITE, 0x5010, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_SPEED", _IOC_READ|_IOC_WRITE, 0x5002, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_STEREO", _IOC_READ|_IOC_WRITE, 0x5003, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_SUBDIVIDE", _IOC_READ|_IOC_WRITE, 0x5009, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_SYNC", _IOC_NONE, 0x5001, 0x00 },
+{ "linux/soundcard.h", "SNDCTL_FM_4OP_ENABLE", _IOC_WRITE, 0x510f, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_FM_LOAD_INSTR", _IOC_WRITE, 0x5107, 0x28 },
+{ "linux/soundcard.h", "SNDCTL_MIDI_INFO", _IOC_READ|_IOC_WRITE, 0x510c, 0x74 },
+{ "linux/soundcard.h", "SNDCTL_MIDI_MPUCMD", _IOC_READ|_IOC_WRITE, 0x6d02, 0x21 },
+{ "linux/soundcard.h", "SNDCTL_MIDI_MPUMODE", _IOC_READ|_IOC_WRITE, 0x6d01, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_MIDI_PRETIME", _IOC_READ|_IOC_WRITE, 0x6d00, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_SEQ_CTRLRATE", _IOC_READ|_IOC_WRITE, 0x5103, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_SEQ_GETINCOUNT", _IOC_READ, 0x5105, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_SEQ_GETOUTCOUNT", _IOC_READ, 0x5104, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_SEQ_GETTIME", _IOC_READ, 0x5113, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_SEQ_NRMIDIS", _IOC_READ, 0x510b, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_SEQ_NRSYNTHS", _IOC_READ, 0x510a, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_SEQ_OUTOFBAND", _IOC_WRITE, 0x5112, 0x08 },
+{ "linux/soundcard.h", "SNDCTL_SEQ_PANIC", _IOC_NONE, 0x5111, 0x00 },
+{ "linux/soundcard.h", "SNDCTL_SEQ_PERCMODE", _IOC_WRITE, 0x5106, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_SEQ_RESET", _IOC_NONE, 0x5100, 0x00 },
+{ "linux/soundcard.h", "SNDCTL_SEQ_RESETSAMPLES", _IOC_WRITE, 0x5109, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_SEQ_SYNC", _IOC_NONE, 0x5101, 0x00 },
+{ "linux/soundcard.h", "SNDCTL_SEQ_TESTMIDI", _IOC_WRITE, 0x5108, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_SEQ_THRESHOLD", _IOC_WRITE, 0x510d, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_SYNTH_CONTROL", _IOC_READ|_IOC_WRITE, 0x5115, 0xfa4 },
+{ "linux/soundcard.h", "SNDCTL_SYNTH_ID", _IOC_READ|_IOC_WRITE, 0x5114, 0x8c },
+{ "linux/soundcard.h", "SNDCTL_SYNTH_INFO", _IOC_READ|_IOC_WRITE, 0x5102, 0x8c },
+{ "linux/soundcard.h", "SNDCTL_SYNTH_MEMAVL", _IOC_READ|_IOC_WRITE, 0x510e, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_SYNTH_REMOVESAMPLE", _IOC_READ|_IOC_WRITE, 0x5116, 0x0c },
+{ "linux/soundcard.h", "SNDCTL_TMR_CONTINUE", _IOC_NONE, 0x5404, 0x00 },
+{ "linux/soundcard.h", "SNDCTL_TMR_METRONOME", _IOC_WRITE, 0x5407, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_TMR_SELECT", _IOC_WRITE, 0x5408, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_TMR_SOURCE", _IOC_READ|_IOC_WRITE, 0x5406, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_TMR_START", _IOC_NONE, 0x5402, 0x00 },
+{ "linux/soundcard.h", "SNDCTL_TMR_STOP", _IOC_NONE, 0x5403, 0x00 },
+{ "linux/soundcard.h", "SNDCTL_TMR_TEMPO", _IOC_READ|_IOC_WRITE, 0x5405, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_TMR_TIMEBASE", _IOC_READ|_IOC_WRITE, 0x5401, 0x04 },
+{ "linux/soundcard.h", "SOUND_MIXER_3DSE", _IOC_READ|_IOC_WRITE, 0x4d68, 0x04 },
+{ "linux/soundcard.h", "SOUND_MIXER_ACCESS", _IOC_READ|_IOC_WRITE, 0x4d66, 0x80 },
+{ "linux/soundcard.h", "SOUND_MIXER_AGC", _IOC_READ|_IOC_WRITE, 0x4d67, 0x04 },
+{ "linux/soundcard.h", "SOUND_MIXER_GETLEVELS", _IOC_READ|_IOC_WRITE, 0x4d74, 0xa4 },
+{ "linux/soundcard.h", "SOUND_MIXER_INFO", _IOC_READ, 0x4d65, 0x5c },
+{ "linux/soundcard.h", "SOUND_MIXER_PRIVATE1", _IOC_READ|_IOC_WRITE, 0x4d6f, 0x04 },
+{ "linux/soundcard.h", "SOUND_MIXER_PRIVATE2", _IOC_READ|_IOC_WRITE, 0x4d70, 0x04 },
+{ "linux/soundcard.h", "SOUND_MIXER_PRIVATE3", _IOC_READ|_IOC_WRITE, 0x4d71, 0x04 },
+{ "linux/soundcard.h", "SOUND_MIXER_PRIVATE4", _IOC_READ|_IOC_WRITE, 0x4d72, 0x04 },
+{ "linux/soundcard.h", "SOUND_MIXER_PRIVATE5", _IOC_READ|_IOC_WRITE, 0x4d73, 0x04 },
+{ "linux/soundcard.h", "SOUND_MIXER_SETLEVELS", _IOC_READ|_IOC_WRITE, 0x4d75, 0xa4 },
+{ "linux/soundcard.h", "SOUND_OLD_MIXER_INFO", _IOC_READ, 0x4d65, 0x30 },
+{ "linux/soundcard.h", "SOUND_PCM_READ_BITS", _IOC_READ, 0x5005, 0x04 },
+{ "linux/soundcard.h", "SOUND_PCM_READ_CHANNELS", _IOC_READ, 0x5006, 0x04 },
+{ "linux/soundcard.h", "SOUND_PCM_READ_FILTER", _IOC_READ, 0x5007, 0x04 },
+{ "linux/soundcard.h", "SOUND_PCM_READ_RATE", _IOC_READ, 0x5002, 0x04 },
+{ "linux/soundcard.h", "SOUND_PCM_WRITE_FILTER", _IOC_READ|_IOC_WRITE, 0x5007, 0x04 },
+{ "linux/spi/spidev.h", "SPI_IOC_RD_BITS_PER_WORD", _IOC_READ, 0x6b03, 0x01 },
+{ "linux/spi/spidev.h", "SPI_IOC_RD_LSB_FIRST", _IOC_READ, 0x6b02, 0x01 },
+{ "linux/spi/spidev.h", "SPI_IOC_RD_MAX_SPEED_HZ", _IOC_READ, 0x6b04, 0x04 },
+{ "linux/spi/spidev.h", "SPI_IOC_RD_MODE", _IOC_READ, 0x6b01, 0x01 },
+{ "linux/spi/spidev.h", "SPI_IOC_RD_MODE32", _IOC_READ, 0x6b05, 0x04 },
+{ "linux/spi/spidev.h", "SPI_IOC_WR_BITS_PER_WORD", _IOC_WRITE, 0x6b03, 0x01 },
+{ "linux/spi/spidev.h", "SPI_IOC_WR_LSB_FIRST", _IOC_WRITE, 0x6b02, 0x01 },
+{ "linux/spi/spidev.h", "SPI_IOC_WR_MAX_SPEED_HZ", _IOC_WRITE, 0x6b04, 0x04 },
+{ "linux/spi/spidev.h", "SPI_IOC_WR_MODE", _IOC_WRITE, 0x6b01, 0x01 },
+{ "linux/spi/spidev.h", "SPI_IOC_WR_MODE32", _IOC_WRITE, 0x6b05, 0x04 },
+{ "linux/stm.h", "STP_POLICY_ID_GET", _IOC_READ, 0x2501, 0x10 },
+{ "linux/stm.h", "STP_POLICY_ID_SET", _IOC_READ|_IOC_WRITE, 0x2500, 0x10 },
+{ "linux/stm.h", "STP_SET_OPTIONS", _IOC_WRITE, 0x2502, 0x08 },
+{ "linux/suspend_ioctls.h", "SNAPSHOT_ALLOC_SWAP_PAGE", _IOC_READ, 0x3314, 0x08 },
+{ "linux/suspend_ioctls.h", "SNAPSHOT_ATOMIC_RESTORE", _IOC_NONE, 0x3304, 0x00 },
+{ "linux/suspend_ioctls.h", "SNAPSHOT_AVAIL_SWAP_SIZE", _IOC_READ, 0x3313, 0x08 },
+{ "linux/suspend_ioctls.h", "SNAPSHOT_CREATE_IMAGE", _IOC_WRITE, 0x3311, 0x04 },
+{ "linux/suspend_ioctls.h", "SNAPSHOT_FREE", _IOC_NONE, 0x3305, 0x00 },
+{ "linux/suspend_ioctls.h", "SNAPSHOT_FREEZE", _IOC_NONE, 0x3301, 0x00 },
+{ "linux/suspend_ioctls.h", "SNAPSHOT_FREE_SWAP_PAGES", _IOC_NONE, 0x3309, 0x00 },
+{ "linux/suspend_ioctls.h", "SNAPSHOT_GET_IMAGE_SIZE", _IOC_READ, 0x330e, 0x08 },
+{ "linux/suspend_ioctls.h", "SNAPSHOT_PLATFORM_SUPPORT", _IOC_NONE, 0x330f, 0x00 },
+{ "linux/suspend_ioctls.h", "SNAPSHOT_POWER_OFF", _IOC_NONE, 0x3310, 0x00 },
+{ "linux/suspend_ioctls.h", "SNAPSHOT_PREF_IMAGE_SIZE", _IOC_NONE, 0x3312, 0x00 },
+{ "linux/suspend_ioctls.h", "SNAPSHOT_S2RAM", _IOC_NONE, 0x330b, 0x00 },
+{ "linux/suspend_ioctls.h", "SNAPSHOT_SET_SWAP_AREA", _IOC_WRITE, 0x330d, 0x0c },
+{ "linux/suspend_ioctls.h", "SNAPSHOT_UNFREEZE", _IOC_NONE, 0x3302, 0x00 },
+{ "linux/switchtec_ioctl.h", "SWITCHTEC_IOCTL_EVENT_CTL", _IOC_READ|_IOC_WRITE, 0x5743, 0x28 },
+{ "linux/switchtec_ioctl.h", "SWITCHTEC_IOCTL_EVENT_SUMMARY", _IOC_READ, 0x5742, 0x4d8 },
+{ "linux/switchtec_ioctl.h", "SWITCHTEC_IOCTL_EVENT_SUMMARY_LEGACY", _IOC_READ, 0x5742, 0x198 },
+{ "linux/switchtec_ioctl.h", "SWITCHTEC_IOCTL_FLASH_INFO", _IOC_READ, 0x5740, 0x10 },
+{ "linux/switchtec_ioctl.h", "SWITCHTEC_IOCTL_FLASH_PART_INFO", _IOC_READ|_IOC_WRITE, 0x5741, 0x10 },
+{ "linux/switchtec_ioctl.h", "SWITCHTEC_IOCTL_PFF_TO_PORT", _IOC_READ|_IOC_WRITE, 0x5744, 0x0c },
+{ "linux/switchtec_ioctl.h", "SWITCHTEC_IOCTL_PORT_TO_PFF", _IOC_READ|_IOC_WRITE, 0x5745, 0x0c },
+{ "linux/sync_file.h", "SYNC_IOC_FILE_INFO", _IOC_READ|_IOC_WRITE, 0x3e04, 0x38 },
+{ "linux/sync_file.h", "SYNC_IOC_MERGE", _IOC_READ|_IOC_WRITE, 0x3e03, 0x30 },
+{ "linux/synclink.h", "MGSL_IOCCLRMODCOUNT", _IOC_NONE, 0x6d0f, 0x00 },
+{ "linux/synclink.h", "MGSL_IOCGGPIO", _IOC_READ, 0x6d11, 0x10 },
+{ "linux/synclink.h", "MGSL_IOCGIF", _IOC_NONE, 0x6d0b, 0x00 },
+{ "linux/synclink.h", "MGSL_IOCGPARAMS", _IOC_READ, 0x6d01, 0x30 },
+{ "linux/synclink.h", "MGSL_IOCGSTATS", _IOC_NONE, 0x6d07, 0x00 },
+{ "linux/synclink.h", "MGSL_IOCGTXIDLE", _IOC_NONE, 0x6d03, 0x00 },
+{ "linux/synclink.h", "MGSL_IOCGXCTRL", _IOC_NONE, 0x6d16, 0x00 },
+{ "linux/synclink.h", "MGSL_IOCGXSYNC", _IOC_NONE, 0x6d14, 0x00 },
+{ "linux/synclink.h", "MGSL_IOCLOOPTXDONE", _IOC_NONE, 0x6d09, 0x00 },
+{ "linux/synclink.h", "MGSL_IOCRXENABLE", _IOC_NONE, 0x6d05, 0x00 },
+{ "linux/synclink.h", "MGSL_IOCSGPIO", _IOC_WRITE, 0x6d10, 0x10 },
+{ "linux/synclink.h", "MGSL_IOCSIF", _IOC_NONE, 0x6d0a, 0x00 },
+{ "linux/synclink.h", "MGSL_IOCSPARAMS", _IOC_WRITE, 0x6d00, 0x30 },
+{ "linux/synclink.h", "MGSL_IOCSTXIDLE", _IOC_NONE, 0x6d02, 0x00 },
+{ "linux/synclink.h", "MGSL_IOCSXCTRL", _IOC_NONE, 0x6d15, 0x00 },
+{ "linux/synclink.h", "MGSL_IOCSXSYNC", _IOC_NONE, 0x6d13, 0x00 },
+{ "linux/synclink.h", "MGSL_IOCTXABORT", _IOC_NONE, 0x6d06, 0x00 },
+{ "linux/synclink.h", "MGSL_IOCTXENABLE", _IOC_NONE, 0x6d04, 0x00 },
+{ "linux/synclink.h", "MGSL_IOCWAITEVENT", _IOC_READ|_IOC_WRITE, 0x6d08, 0x04 },
+{ "linux/synclink.h", "MGSL_IOCWAITGPIO", _IOC_READ|_IOC_WRITE, 0x6d12, 0x10 },
+{ "linux/tee.h", "TEE_IOC_CANCEL", _IOC_READ, 0xa404, 0x08 },
+{ "linux/tee.h", "TEE_IOC_CLOSE_SESSION", _IOC_READ, 0xa405, 0x04 },
+{ "linux/tee.h", "TEE_IOC_INVOKE", _IOC_READ, 0xa403, 0x10 },
+{ "linux/tee.h", "TEE_IOC_OPEN_SESSION", _IOC_READ, 0xa402, 0x10 },
+{ "linux/tee.h", "TEE_IOC_SHM_ALLOC", _IOC_READ|_IOC_WRITE, 0xa401, 0x10 },
+{ "linux/tee.h", "TEE_IOC_SHM_REGISTER", _IOC_READ|_IOC_WRITE, 0xa409, 0x18 },
+{ "linux/tee.h", "TEE_IOC_SUPPL_RECV", _IOC_READ, 0xa406, 0x10 },
+{ "linux/tee.h", "TEE_IOC_SUPPL_SEND", _IOC_READ, 0xa407, 0x10 },
+{ "linux/tee.h", "TEE_IOC_VERSION", _IOC_READ, 0xa400, 0x0c },
+{ "linux/timerfd.h", "TFD_IOC_SET_TICKS", _IOC_WRITE, 0x5400, 0x08 },
+{ "linux/toshiba.h", "TOSHIBA_ACPI_SCI", _IOC_READ|_IOC_WRITE, 0x7491, 0x18 },
+{ "linux/toshiba.h", "TOSH_SMM", _IOC_READ|_IOC_WRITE, 0x7490, 0x18 },
+{ "linux/udf_fs_i.h", "UDF_GETEABLOCK", _IOC_READ, 0x6c41, 0x08 },
+{ "linux/udf_fs_i.h", "UDF_GETEASIZE", _IOC_READ, 0x6c40, 0x04 },
+{ "linux/udf_fs_i.h", "UDF_GETVOLIDENT", _IOC_READ, 0x6c42, 0x08 },
+{ "linux/udf_fs_i.h", "UDF_RELOCATE_BLOCKS", _IOC_READ|_IOC_WRITE, 0x6c43, 0x08 },
+{ "linux/udmabuf.h", "UDMABUF_CREATE", _IOC_WRITE, 0x7542, 0x18 },
+{ "linux/udmabuf.h", "UDMABUF_CREATE_LIST", _IOC_WRITE, 0x7543, 0x08 },
+{ "linux/uinput.h", "UI_ABS_SETUP", _IOC_WRITE, 0x5504, 0x1c },
+{ "linux/uinput.h", "UI_BEGIN_FF_ERASE", _IOC_READ|_IOC_WRITE, 0x55ca, 0x0c },
+{ "linux/uinput.h", "UI_BEGIN_FF_UPLOAD", _IOC_READ|_IOC_WRITE, 0x55c8, 0x68 },
+{ "linux/uinput.h", "UI_DEV_CREATE", _IOC_NONE, 0x5501, 0x00 },
+{ "linux/uinput.h", "UI_DEV_DESTROY", _IOC_NONE, 0x5502, 0x00 },
+{ "linux/uinput.h", "UI_DEV_SETUP", _IOC_WRITE, 0x5503, 0x5c },
+{ "linux/uinput.h", "UI_END_FF_ERASE", _IOC_WRITE, 0x55cb, 0x0c },
+{ "linux/uinput.h", "UI_END_FF_UPLOAD", _IOC_WRITE, 0x55c9, 0x68 },
+{ "linux/uinput.h", "UI_GET_VERSION", _IOC_READ, 0x552d, 0x04 },
+{ "linux/uinput.h", "UI_SET_ABSBIT", _IOC_WRITE, 0x5567, 0x04 },
+{ "linux/uinput.h", "UI_SET_EVBIT", _IOC_WRITE, 0x5564, 0x04 },
+{ "linux/uinput.h", "UI_SET_FFBIT", _IOC_WRITE, 0x556b, 0x04 },
+{ "linux/uinput.h", "UI_SET_KEYBIT", _IOC_WRITE, 0x5565, 0x04 },
+{ "linux/uinput.h", "UI_SET_LEDBIT", _IOC_WRITE, 0x5569, 0x04 },
+{ "linux/uinput.h", "UI_SET_MSCBIT", _IOC_WRITE, 0x5568, 0x04 },
+{ "linux/uinput.h", "UI_SET_PHYS", _IOC_WRITE, 0x556c, 0x08 },
+{ "linux/uinput.h", "UI_SET_PROPBIT", _IOC_WRITE, 0x556e, 0x04 },
+{ "linux/uinput.h", "UI_SET_RELBIT", _IOC_WRITE, 0x5566, 0x04 },
+{ "linux/uinput.h", "UI_SET_SNDBIT", _IOC_WRITE, 0x556a, 0x04 },
+{ "linux/uinput.h", "UI_SET_SWBIT", _IOC_WRITE, 0x556d, 0x04 },
+{ "linux/usb/cdc-wdm.h", "IOCTL_WDM_MAX_COMMAND", _IOC_READ, 0x48a0, 0x02 },
+{ "linux/usb/functionfs.h", "FUNCTIONFS_CLEAR_HALT", _IOC_NONE, 0x6703, 0x00 },
+{ "linux/usb/functionfs.h", "FUNCTIONFS_ENDPOINT_DESC", _IOC_READ, 0x6782, 0x09 },
+{ "linux/usb/functionfs.h", "FUNCTIONFS_ENDPOINT_REVMAP", _IOC_NONE, 0x6781, 0x00 },
+{ "linux/usb/functionfs.h", "FUNCTIONFS_FIFO_FLUSH", _IOC_NONE, 0x6702, 0x00 },
+{ "linux/usb/functionfs.h", "FUNCTIONFS_FIFO_STATUS", _IOC_NONE, 0x6701, 0x00 },
+{ "linux/usb/functionfs.h", "FUNCTIONFS_INTERFACE_REVMAP", _IOC_NONE, 0x6780, 0x00 },
+{ "linux/usb/g_printer.h", "GADGET_GET_PRINTER_STATUS", _IOC_READ, 0x6721, 0x01 },
+{ "linux/usb/g_printer.h", "GADGET_SET_PRINTER_STATUS", _IOC_READ|_IOC_WRITE, 0x6722, 0x01 },
+{ "linux/usb/g_uvc.h", "UVCIOC_SEND_RESPONSE", _IOC_WRITE, 0x5501, 0x40 },
+{ "linux/usb/gadgetfs.h", "GADGETFS_CLEAR_HALT", _IOC_NONE, 0x6703, 0x00 },
+{ "linux/usb/gadgetfs.h", "GADGETFS_FIFO_FLUSH", _IOC_NONE, 0x6702, 0x00 },
+{ "linux/usb/gadgetfs.h", "GADGETFS_FIFO_STATUS", _IOC_NONE, 0x6701, 0x00 },
+{ "linux/usb/iowarrior.h", "IOW_GETINFO", _IOC_READ, 0xc003, 0x28 },
+{ "linux/usb/iowarrior.h", "IOW_READ", _IOC_WRITE, 0xc002, 0x08 },
+{ "linux/usb/iowarrior.h", "IOW_WRITE", _IOC_WRITE, 0xc001, 0x08 },
+{ "linux/usb/raw_gadget.h", "USB_RAW_IOCTL_CONFIGURE", _IOC_NONE, 0x5509, 0x00 },
+{ "linux/usb/raw_gadget.h", "USB_RAW_IOCTL_EP0_READ", _IOC_READ|_IOC_WRITE, 0x5504, 0x08 },
+{ "linux/usb/raw_gadget.h", "USB_RAW_IOCTL_EP0_STALL", _IOC_NONE, 0x550c, 0x00 },
+{ "linux/usb/raw_gadget.h", "USB_RAW_IOCTL_EP0_WRITE", _IOC_WRITE, 0x5503, 0x08 },
+{ "linux/usb/raw_gadget.h", "USB_RAW_IOCTL_EPS_INFO", _IOC_READ, 0x550b, 0x3c0 },
+{ "linux/usb/raw_gadget.h", "USB_RAW_IOCTL_EP_CLEAR_HALT", _IOC_WRITE, 0x550e, 0x04 },
+{ "linux/usb/raw_gadget.h", "USB_RAW_IOCTL_EP_DISABLE", _IOC_WRITE, 0x5506, 0x04 },
+{ "linux/usb/raw_gadget.h", "USB_RAW_IOCTL_EP_ENABLE", _IOC_WRITE, 0x5505, 0x09 },
+{ "linux/usb/raw_gadget.h", "USB_RAW_IOCTL_EP_READ", _IOC_READ|_IOC_WRITE, 0x5508, 0x08 },
+{ "linux/usb/raw_gadget.h", "USB_RAW_IOCTL_EP_SET_HALT", _IOC_WRITE, 0x550d, 0x04 },
+{ "linux/usb/raw_gadget.h", "USB_RAW_IOCTL_EP_SET_WEDGE", _IOC_WRITE, 0x550f, 0x04 },
+{ "linux/usb/raw_gadget.h", "USB_RAW_IOCTL_EP_WRITE", _IOC_WRITE, 0x5507, 0x08 },
+{ "linux/usb/raw_gadget.h", "USB_RAW_IOCTL_EVENT_FETCH", _IOC_READ, 0x5502, 0x08 },
+{ "linux/usb/raw_gadget.h", "USB_RAW_IOCTL_INIT", _IOC_WRITE, 0x5500, 0x101 },
+{ "linux/usb/raw_gadget.h", "USB_RAW_IOCTL_RUN", _IOC_NONE, 0x5501, 0x00 },
+{ "linux/usb/raw_gadget.h", "USB_RAW_IOCTL_VBUS_DRAW", _IOC_WRITE, 0x550a, 0x04 },
+{ "linux/usb/tmc.h", "USBTMC488_IOCTL_GET_CAPS", _IOC_READ, 0x5b11, 0x01 },
+{ "linux/usb/tmc.h", "USBTMC488_IOCTL_GOTO_LOCAL", _IOC_NONE, 0x5b14, 0x00 },
+{ "linux/usb/tmc.h", "USBTMC488_IOCTL_LOCAL_LOCKOUT", _IOC_NONE, 0x5b15, 0x00 },
+{ "linux/usb/tmc.h", "USBTMC488_IOCTL_READ_STB", _IOC_READ, 0x5b12, 0x01 },
+{ "linux/usb/tmc.h", "USBTMC488_IOCTL_REN_CONTROL", _IOC_WRITE, 0x5b13, 0x01 },
+{ "linux/usb/tmc.h", "USBTMC488_IOCTL_TRIGGER", _IOC_NONE, 0x5b16, 0x00 },
+{ "linux/usb/tmc.h", "USBTMC488_IOCTL_WAIT_SRQ", _IOC_WRITE, 0x5b17, 0x04 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_ABORT_BULK_IN", _IOC_NONE, 0x5b04, 0x00 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_ABORT_BULK_OUT", _IOC_NONE, 0x5b03, 0x00 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_API_VERSION", _IOC_READ, 0x5b10, 0x04 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_AUTO_ABORT", _IOC_WRITE, 0x5b19, 0x01 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_CANCEL_IO", _IOC_NONE, 0x5b23, 0x00 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_CLEANUP_IO", _IOC_NONE, 0x5b24, 0x00 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_CLEAR", _IOC_NONE, 0x5b02, 0x00 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_CLEAR_IN_HALT", _IOC_NONE, 0x5b07, 0x00 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_CLEAR_OUT_HALT", _IOC_NONE, 0x5b06, 0x00 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_CONFIG_TERMCHAR", _IOC_WRITE, 0x5b0c, 0x02 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_CTRL_REQUEST", _IOC_READ|_IOC_WRITE, 0x5b08, 0x10 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_EOM_ENABLE", _IOC_WRITE, 0x5b0b, 0x01 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_GET_TIMEOUT", _IOC_READ, 0x5b09, 0x04 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_INDICATOR_PULSE", _IOC_NONE, 0x5b01, 0x00 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_MSG_IN_ATTR", _IOC_READ, 0x5b18, 0x01 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_READ", _IOC_READ|_IOC_WRITE, 0x5b0e, 0x14 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_SET_TIMEOUT", _IOC_WRITE, 0x5b0a, 0x04 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_WRITE", _IOC_READ|_IOC_WRITE, 0x5b0d, 0x14 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_WRITE_RESULT", _IOC_READ|_IOC_WRITE, 0x5b0f, 0x04 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_ALLOC_STREAMS", _IOC_READ, 0x551c, 0x08 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_ALLOW_SUSPEND", _IOC_NONE, 0x5522, 0x00 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_BULK", _IOC_READ|_IOC_WRITE, 0x5502, 0x18 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_BULK32", _IOC_READ|_IOC_WRITE, 0x5502, 0x10 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_CLAIMINTERFACE", _IOC_READ, 0x550f, 0x04 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_CLAIM_PORT", _IOC_READ, 0x5518, 0x04 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_CLEAR_HALT", _IOC_READ, 0x5515, 0x04 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_CONNECT", _IOC_NONE, 0x5517, 0x00 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_CONNECTINFO", _IOC_WRITE, 0x5511, 0x08 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_CONTROL", _IOC_READ|_IOC_WRITE, 0x5500, 0x18 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_CONTROL32", _IOC_READ|_IOC_WRITE, 0x5500, 0x10 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_DISCARDURB", _IOC_NONE, 0x550b, 0x00 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_DISCONNECT", _IOC_NONE, 0x5516, 0x00 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_DISCONNECT_CLAIM", _IOC_READ, 0x551b, 0x108 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_DISCSIGNAL", _IOC_READ, 0x550e, 0x10 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_DISCSIGNAL32", _IOC_READ, 0x550e, 0x08 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_DROP_PRIVILEGES", _IOC_WRITE, 0x551e, 0x04 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_FORBID_SUSPEND", _IOC_NONE, 0x5521, 0x00 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_FREE_STREAMS", _IOC_READ, 0x551d, 0x08 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_GETDRIVER", _IOC_WRITE, 0x5508, 0x104 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_GET_CAPABILITIES", _IOC_READ, 0x551a, 0x04 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_GET_SPEED", _IOC_NONE, 0x551f, 0x00 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_HUB_PORTINFO", _IOC_READ, 0x5513, 0x80 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_IOCTL", _IOC_READ|_IOC_WRITE, 0x5512, 0x10 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_IOCTL32", _IOC_READ|_IOC_WRITE, 0x5512, 0x0c },
+{ "linux/usbdevice_fs.h", "USBDEVFS_REAPURB", _IOC_WRITE, 0x550c, 0x08 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_REAPURB32", _IOC_WRITE, 0x550c, 0x04 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_REAPURBNDELAY", _IOC_WRITE, 0x550d, 0x08 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_REAPURBNDELAY32", _IOC_WRITE, 0x550d, 0x04 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_RELEASEINTERFACE", _IOC_READ, 0x5510, 0x04 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_RELEASE_PORT", _IOC_READ, 0x5519, 0x04 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_RESET", _IOC_NONE, 0x5514, 0x00 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_RESETEP", _IOC_READ, 0x5503, 0x04 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_SETCONFIGURATION", _IOC_READ, 0x5505, 0x04 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_SETINTERFACE", _IOC_READ, 0x5504, 0x08 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_SUBMITURB", _IOC_READ, 0x550a, 0x38 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_SUBMITURB32", _IOC_READ, 0x550a, 0x2a },
+{ "linux/usbdevice_fs.h", "USBDEVFS_WAIT_FOR_RESUME", _IOC_NONE, 0x5523, 0x00 },
+{ "linux/userfaultfd.h", "UFFDIO_API", _IOC_READ|_IOC_WRITE, 0xaa3f, 0x18 },
+{ "linux/userfaultfd.h", "UFFDIO_COPY", _IOC_READ|_IOC_WRITE, 0xaa03, 0x28 },
+{ "linux/userfaultfd.h", "UFFDIO_REGISTER", _IOC_READ|_IOC_WRITE, 0xaa00, 0x20 },
+{ "linux/userfaultfd.h", "UFFDIO_UNREGISTER", _IOC_READ, 0xaa01, 0x10 },
+{ "linux/userfaultfd.h", "UFFDIO_WAKE", _IOC_READ, 0xaa02, 0x10 },
+{ "linux/userfaultfd.h", "UFFDIO_WRITEPROTECT", _IOC_READ|_IOC_WRITE, 0xaa06, 0x18 },
+{ "linux/userfaultfd.h", "UFFDIO_ZEROPAGE", _IOC_READ|_IOC_WRITE, 0xaa04, 0x20 },
+{ "linux/uvcvideo.h", "UVCIOC_CTRL_MAP", _IOC_READ|_IOC_WRITE, 0x7520, 0x60 },
+{ "linux/uvcvideo.h", "UVCIOC_CTRL_QUERY", _IOC_READ|_IOC_WRITE, 0x7521, 0x10 },
+{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL", _IOC_READ|_IOC_WRITE, 0x564b, 0x40 },
+{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_ENUM_FRAME_SIZE", _IOC_READ|_IOC_WRITE, 0x564a, 0x40 },
+{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_ENUM_MBUS_CODE", _IOC_READ|_IOC_WRITE, 0x5602, 0x30 },
+{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_CROP", _IOC_READ|_IOC_WRITE, 0x563b, 0x38 },
+{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_FMT", _IOC_READ|_IOC_WRITE, 0x5604, 0x58 },
+{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_FRAME_INTERVAL", _IOC_READ|_IOC_WRITE, 0x5615, 0x30 },
+{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_SELECTION", _IOC_READ|_IOC_WRITE, 0x563d, 0x40 },
+{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_QUERYCAP", _IOC_READ, 0x5600, 0x40 },
+{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_CROP", _IOC_READ|_IOC_WRITE, 0x563c, 0x38 },
+{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_FMT", _IOC_READ|_IOC_WRITE, 0x5605, 0x58 },
+{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_FRAME_INTERVAL", _IOC_READ|_IOC_WRITE, 0x5616, 0x30 },
+{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_SELECTION", _IOC_READ|_IOC_WRITE, 0x563e, 0x40 },
+{ "linux/vboxguest.h", "VBG_IOCTL_ACQUIRE_GUEST_CAPABILITIES", _IOC_READ|_IOC_WRITE, 0x560d, 0x24 },
+{ "linux/vboxguest.h", "VBG_IOCTL_CHANGE_FILTER_MASK", _IOC_READ|_IOC_WRITE, 0x560c, 0x20 },
+{ "linux/vboxguest.h", "VBG_IOCTL_CHANGE_GUEST_CAPABILITIES", _IOC_READ|_IOC_WRITE, 0x560e, 0x20 },
+{ "linux/vboxguest.h", "VBG_IOCTL_CHECK_BALLOON", _IOC_READ|_IOC_WRITE, 0x5611, 0x20 },
+{ "linux/vboxguest.h", "VBG_IOCTL_DRIVER_VERSION_INFO", _IOC_READ|_IOC_WRITE, 0x5600, 0x2c },
+{ "linux/vboxguest.h", "VBG_IOCTL_HGCM_CONNECT", _IOC_READ|_IOC_WRITE, 0x5604, 0x9c },
+{ "linux/vboxguest.h", "VBG_IOCTL_HGCM_DISCONNECT", _IOC_READ|_IOC_WRITE, 0x5605, 0x1c },
+{ "linux/vboxguest.h", "VBG_IOCTL_INTERRUPT_ALL_WAIT_FOR_EVENTS", _IOC_READ|_IOC_WRITE, 0x560b, 0x18 },
+{ "linux/vboxguest.h", "VBG_IOCTL_VMMDEV_REQUEST_BIG", _IOC_NONE, 0x5603, 0x00 },
+{ "linux/vboxguest.h", "VBG_IOCTL_WAIT_FOR_EVENTS", _IOC_READ|_IOC_WRITE, 0x560a, 0x20 },
+{ "linux/vboxguest.h", "VBG_IOCTL_WRITE_CORE_DUMP", _IOC_READ|_IOC_WRITE, 0x5613, 0x1c },
+{ "linux/vfio.h", "VFIO_CHECK_EXTENSION", _IOC_NONE, 0x3b65, 0x00 },
+{ "linux/vfio.h", "VFIO_DEVICE_FEATURE", _IOC_NONE, 0x3b75, 0x00 },
+{ "linux/vfio.h", "VFIO_DEVICE_GET_GFX_DMABUF", _IOC_NONE, 0x3b73, 0x00 },
+{ "linux/vfio.h", "VFIO_DEVICE_GET_INFO", _IOC_NONE, 0x3b6b, 0x00 },
+{ "linux/vfio.h", "VFIO_DEVICE_GET_IRQ_INFO", _IOC_NONE, 0x3b6d, 0x00 },
+{ "linux/vfio.h", "VFIO_DEVICE_GET_PCI_HOT_RESET_INFO", _IOC_NONE, 0x3b70, 0x00 },
+{ "linux/vfio.h", "VFIO_DEVICE_GET_REGION_INFO", _IOC_NONE, 0x3b6c, 0x00 },
+{ "linux/vfio.h", "VFIO_DEVICE_IOEVENTFD", _IOC_NONE, 0x3b74, 0x00 },
+{ "linux/vfio.h", "VFIO_DEVICE_PCI_HOT_RESET", _IOC_NONE, 0x3b71, 0x00 },
+{ "linux/vfio.h", "VFIO_DEVICE_QUERY_GFX_PLANE", _IOC_NONE, 0x3b72, 0x00 },
+{ "linux/vfio.h", "VFIO_DEVICE_RESET", _IOC_NONE, 0x3b6f, 0x00 },
+{ "linux/vfio.h", "VFIO_DEVICE_SET_IRQS", _IOC_NONE, 0x3b6e, 0x00 },
+{ "linux/vfio.h", "VFIO_EEH_PE_OP", _IOC_NONE, 0x3b79, 0x00 },
+{ "linux/vfio.h", "VFIO_GET_API_VERSION", _IOC_NONE, 0x3b64, 0x00 },
+{ "linux/vfio.h", "VFIO_GROUP_GET_DEVICE_FD", _IOC_NONE, 0x3b6a, 0x00 },
+{ "linux/vfio.h", "VFIO_GROUP_GET_STATUS", _IOC_NONE, 0x3b67, 0x00 },
+{ "linux/vfio.h", "VFIO_GROUP_SET_CONTAINER", _IOC_NONE, 0x3b68, 0x00 },
+{ "linux/vfio.h", "VFIO_GROUP_UNSET_CONTAINER", _IOC_NONE, 0x3b69, 0x00 },
+{ "linux/vfio.h", "VFIO_IOMMU_DIRTY_PAGES", _IOC_NONE, 0x3b75, 0x00 },
+{ "linux/vfio.h", "VFIO_IOMMU_DISABLE", _IOC_NONE, 0x3b74, 0x00 },
+{ "linux/vfio.h", "VFIO_IOMMU_ENABLE", _IOC_NONE, 0x3b73, 0x00 },
+{ "linux/vfio.h", "VFIO_IOMMU_GET_INFO", _IOC_NONE, 0x3b70, 0x00 },
+{ "linux/vfio.h", "VFIO_IOMMU_MAP_DMA", _IOC_NONE, 0x3b71, 0x00 },
+{ "linux/vfio.h", "VFIO_IOMMU_SPAPR_REGISTER_MEMORY", _IOC_NONE, 0x3b75, 0x00 },
+{ "linux/vfio.h", "VFIO_IOMMU_SPAPR_TCE_CREATE", _IOC_NONE, 0x3b77, 0x00 },
+{ "linux/vfio.h", "VFIO_IOMMU_SPAPR_TCE_GET_INFO", _IOC_NONE, 0x3b70, 0x00 },
+{ "linux/vfio.h", "VFIO_IOMMU_SPAPR_TCE_REMOVE", _IOC_NONE, 0x3b78, 0x00 },
+{ "linux/vfio.h", "VFIO_IOMMU_SPAPR_UNREGISTER_MEMORY", _IOC_NONE, 0x3b76, 0x00 },
+{ "linux/vfio.h", "VFIO_IOMMU_UNMAP_DMA", _IOC_NONE, 0x3b72, 0x00 },
+{ "linux/vfio.h", "VFIO_SET_IOMMU", _IOC_NONE, 0x3b66, 0x00 },
+{ "linux/vhost.h", "VHOST_GET_BACKEND_FEATURES", _IOC_READ, 0xaf26, 0x08 },
+{ "linux/vhost.h", "VHOST_GET_FEATURES", _IOC_READ, 0xaf00, 0x08 },
+{ "linux/vhost.h", "VHOST_GET_VRING_BASE", _IOC_READ|_IOC_WRITE, 0xaf12, 0x08 },
+{ "linux/vhost.h", "VHOST_GET_VRING_BUSYLOOP_TIMEOUT", _IOC_WRITE, 0xaf24, 0x08 },
+{ "linux/vhost.h", "VHOST_GET_VRING_ENDIAN", _IOC_WRITE, 0xaf14, 0x08 },
+{ "linux/vhost.h", "VHOST_NET_SET_BACKEND", _IOC_WRITE, 0xaf30, 0x08 },
+{ "linux/vhost.h", "VHOST_RESET_OWNER", _IOC_NONE, 0xaf02, 0x00 },
+{ "linux/vhost.h", "VHOST_SCSI_CLEAR_ENDPOINT", _IOC_WRITE, 0xaf41, 0xe8 },
+{ "linux/vhost.h", "VHOST_SCSI_GET_ABI_VERSION", _IOC_WRITE, 0xaf42, 0x04 },
+{ "linux/vhost.h", "VHOST_SCSI_GET_EVENTS_MISSED", _IOC_WRITE, 0xaf44, 0x04 },
+{ "linux/vhost.h", "VHOST_SCSI_SET_ENDPOINT", _IOC_WRITE, 0xaf40, 0xe8 },
+{ "linux/vhost.h", "VHOST_SCSI_SET_EVENTS_MISSED", _IOC_WRITE, 0xaf43, 0x04 },
+{ "linux/vhost.h", "VHOST_SET_BACKEND_FEATURES", _IOC_WRITE, 0xaf25, 0x08 },
+{ "linux/vhost.h", "VHOST_SET_FEATURES", _IOC_WRITE, 0xaf00, 0x08 },
+{ "linux/vhost.h", "VHOST_SET_LOG_BASE", _IOC_WRITE, 0xaf04, 0x08 },
+{ "linux/vhost.h", "VHOST_SET_LOG_FD", _IOC_WRITE, 0xaf07, 0x04 },
+{ "linux/vhost.h", "VHOST_SET_MEM_TABLE", _IOC_WRITE, 0xaf03, 0x08 },
+{ "linux/vhost.h", "VHOST_SET_OWNER", _IOC_NONE, 0xaf01, 0x00 },
+{ "linux/vhost.h", "VHOST_SET_VRING_ADDR", _IOC_WRITE, 0xaf11, 0x28 },
+{ "linux/vhost.h", "VHOST_SET_VRING_BASE", _IOC_WRITE, 0xaf12, 0x08 },
+{ "linux/vhost.h", "VHOST_SET_VRING_BUSYLOOP_TIMEOUT", _IOC_WRITE, 0xaf23, 0x08 },
+{ "linux/vhost.h", "VHOST_SET_VRING_CALL", _IOC_WRITE, 0xaf21, 0x08 },
+{ "linux/vhost.h", "VHOST_SET_VRING_ENDIAN", _IOC_WRITE, 0xaf13, 0x08 },
+{ "linux/vhost.h", "VHOST_SET_VRING_ERR", _IOC_WRITE, 0xaf22, 0x08 },
+{ "linux/vhost.h", "VHOST_SET_VRING_KICK", _IOC_WRITE, 0xaf20, 0x08 },
+{ "linux/vhost.h", "VHOST_SET_VRING_NUM", _IOC_WRITE, 0xaf10, 0x08 },
+{ "linux/vhost.h", "VHOST_VDPA_GET_CONFIG", _IOC_READ, 0xaf73, 0x08 },
+{ "linux/vhost.h", "VHOST_VDPA_GET_DEVICE_ID", _IOC_READ, 0xaf70, 0x04 },
+{ "linux/vhost.h", "VHOST_VDPA_GET_IOVA_RANGE", _IOC_READ, 0xaf78, 0x10 },
+{ "linux/vhost.h", "VHOST_VDPA_GET_STATUS", _IOC_READ, 0xaf71, 0x01 },
+{ "linux/vhost.h", "VHOST_VDPA_GET_VRING_NUM", _IOC_READ, 0xaf76, 0x02 },
+{ "linux/vhost.h", "VHOST_VDPA_SET_CONFIG", _IOC_WRITE, 0xaf74, 0x08 },
+{ "linux/vhost.h", "VHOST_VDPA_SET_CONFIG_CALL", _IOC_WRITE, 0xaf77, 0x04 },
+{ "linux/vhost.h", "VHOST_VDPA_SET_STATUS", _IOC_WRITE, 0xaf72, 0x01 },
+{ "linux/vhost.h", "VHOST_VDPA_SET_VRING_ENABLE", _IOC_WRITE, 0xaf75, 0x08 },
+{ "linux/vhost.h", "VHOST_VSOCK_SET_GUEST_CID", _IOC_WRITE, 0xaf60, 0x08 },
+{ "linux/vhost.h", "VHOST_VSOCK_SET_RUNNING", _IOC_WRITE, 0xaf61, 0x04 },
+{ "linux/videodev2.h", "VIDIOC_CREATE_BUFS", _IOC_READ|_IOC_WRITE, 0x565c, 0x100 },
+{ "linux/videodev2.h", "VIDIOC_CROPCAP", _IOC_READ|_IOC_WRITE, 0x563a, 0x2c },
+{ "linux/videodev2.h", "VIDIOC_DBG_G_CHIP_INFO", _IOC_READ|_IOC_WRITE, 0x5666, 0xc8 },
+{ "linux/videodev2.h", "VIDIOC_DBG_G_REGISTER", _IOC_READ|_IOC_WRITE, 0x5650, 0x38 },
+{ "linux/videodev2.h", "VIDIOC_DBG_S_REGISTER", _IOC_WRITE, 0x564f, 0x38 },
+{ "linux/videodev2.h", "VIDIOC_DECODER_CMD", _IOC_READ|_IOC_WRITE, 0x5660, 0x48 },
+{ "linux/videodev2.h", "VIDIOC_DQBUF", _IOC_READ|_IOC_WRITE, 0x5611, 0x58 },
+{ "linux/videodev2.h", "VIDIOC_DQEVENT", _IOC_READ, 0x5659, 0x88 },
+{ "linux/videodev2.h", "VIDIOC_DV_TIMINGS_CAP", _IOC_READ|_IOC_WRITE, 0x5664, 0x90 },
+{ "linux/videodev2.h", "VIDIOC_ENCODER_CMD", _IOC_READ|_IOC_WRITE, 0x564d, 0x28 },
+{ "linux/videodev2.h", "VIDIOC_ENUMAUDIO", _IOC_READ|_IOC_WRITE, 0x5641, 0x34 },
+{ "linux/videodev2.h", "VIDIOC_ENUMAUDOUT", _IOC_READ|_IOC_WRITE, 0x5642, 0x34 },
+{ "linux/videodev2.h", "VIDIOC_ENUMINPUT", _IOC_READ|_IOC_WRITE, 0x561a, 0x50 },
+{ "linux/videodev2.h", "VIDIOC_ENUMOUTPUT", _IOC_READ|_IOC_WRITE, 0x5630, 0x48 },
+{ "linux/videodev2.h", "VIDIOC_ENUMSTD", _IOC_READ|_IOC_WRITE, 0x5619, 0x48 },
+{ "linux/videodev2.h", "VIDIOC_ENUM_DV_TIMINGS", _IOC_READ|_IOC_WRITE, 0x5662, 0x94 },
+{ "linux/videodev2.h", "VIDIOC_ENUM_FMT", _IOC_READ|_IOC_WRITE, 0x5602, 0x40 },
+{ "linux/videodev2.h", "VIDIOC_ENUM_FRAMEINTERVALS", _IOC_READ|_IOC_WRITE, 0x564b, 0x34 },
+{ "linux/videodev2.h", "VIDIOC_ENUM_FRAMESIZES", _IOC_READ|_IOC_WRITE, 0x564a, 0x2c },
+{ "linux/videodev2.h", "VIDIOC_ENUM_FREQ_BANDS", _IOC_READ|_IOC_WRITE, 0x5665, 0x40 },
+{ "linux/videodev2.h", "VIDIOC_EXPBUF", _IOC_READ|_IOC_WRITE, 0x5610, 0x40 },
+{ "linux/videodev2.h", "VIDIOC_G_AUDIO", _IOC_READ, 0x5621, 0x34 },
+{ "linux/videodev2.h", "VIDIOC_G_AUDOUT", _IOC_READ, 0x5631, 0x34 },
+{ "linux/videodev2.h", "VIDIOC_G_CROP", _IOC_READ|_IOC_WRITE, 0x563b, 0x14 },
+{ "linux/videodev2.h", "VIDIOC_G_CTRL", _IOC_READ|_IOC_WRITE, 0x561b, 0x08 },
+{ "linux/videodev2.h", "VIDIOC_G_DV_TIMINGS", _IOC_READ|_IOC_WRITE, 0x5658, 0x84 },
+{ "linux/videodev2.h", "VIDIOC_G_EDID", _IOC_READ|_IOC_WRITE, 0x5628, 0x28 },
+{ "linux/videodev2.h", "VIDIOC_G_ENC_INDEX", _IOC_READ, 0x564c, 0x818 },
+{ "linux/videodev2.h", "VIDIOC_G_EXT_CTRLS", _IOC_READ|_IOC_WRITE, 0x5647, 0x20 },
+{ "linux/videodev2.h", "VIDIOC_G_FBUF", _IOC_READ, 0x560a, 0x30 },
+{ "linux/videodev2.h", "VIDIOC_G_FMT", _IOC_READ|_IOC_WRITE, 0x5604, 0xd0 },
+{ "linux/videodev2.h", "VIDIOC_G_FREQUENCY", _IOC_READ|_IOC_WRITE, 0x5638, 0x2c },
+{ "linux/videodev2.h", "VIDIOC_G_INPUT", _IOC_READ, 0x5626, 0x04 },
+{ "linux/videodev2.h", "VIDIOC_G_JPEGCOMP", _IOC_READ, 0x563d, 0x8c },
+{ "linux/videodev2.h", "VIDIOC_G_MODULATOR", _IOC_READ|_IOC_WRITE, 0x5636, 0x44 },
+{ "linux/videodev2.h", "VIDIOC_G_OUTPUT", _IOC_READ, 0x562e, 0x04 },
+{ "linux/videodev2.h", "VIDIOC_G_PARM", _IOC_READ|_IOC_WRITE, 0x5615, 0xcc },
+{ "linux/videodev2.h", "VIDIOC_G_PRIORITY", _IOC_READ, 0x5643, 0x04 },
+{ "linux/videodev2.h", "VIDIOC_G_SELECTION", _IOC_READ|_IOC_WRITE, 0x565e, 0x40 },
+{ "linux/videodev2.h", "VIDIOC_G_SLICED_VBI_CAP", _IOC_READ|_IOC_WRITE, 0x5645, 0x74 },
+{ "linux/videodev2.h", "VIDIOC_G_STD", _IOC_READ, 0x5617, 0x08 },
+{ "linux/videodev2.h", "VIDIOC_G_TUNER", _IOC_READ|_IOC_WRITE, 0x561d, 0x54 },
+{ "linux/videodev2.h", "VIDIOC_LOG_STATUS", _IOC_NONE, 0x5646, 0x00 },
+{ "linux/videodev2.h", "VIDIOC_OVERLAY", _IOC_WRITE, 0x560e, 0x04 },
+{ "linux/videodev2.h", "VIDIOC_PREPARE_BUF", _IOC_READ|_IOC_WRITE, 0x565d, 0x58 },
+{ "linux/videodev2.h", "VIDIOC_QBUF", _IOC_READ|_IOC_WRITE, 0x560f, 0x58 },
+{ "linux/videodev2.h", "VIDIOC_QUERYBUF", _IOC_READ|_IOC_WRITE, 0x5609, 0x58 },
+{ "linux/videodev2.h", "VIDIOC_QUERYCAP", _IOC_READ, 0x5600, 0x68 },
+{ "linux/videodev2.h", "VIDIOC_QUERYCTRL", _IOC_READ|_IOC_WRITE, 0x5624, 0x44 },
+{ "linux/videodev2.h", "VIDIOC_QUERYMENU", _IOC_READ|_IOC_WRITE, 0x5625, 0x2c },
+{ "linux/videodev2.h", "VIDIOC_QUERYSTD", _IOC_READ, 0x563f, 0x08 },
+{ "linux/videodev2.h", "VIDIOC_QUERY_DV_TIMINGS", _IOC_READ, 0x5663, 0x84 },
+{ "linux/videodev2.h", "VIDIOC_QUERY_EXT_CTRL", _IOC_READ|_IOC_WRITE, 0x5667, 0xe8 },
+{ "linux/videodev2.h", "VIDIOC_REQBUFS", _IOC_READ|_IOC_WRITE, 0x5608, 0x14 },
+{ "linux/videodev2.h", "VIDIOC_STREAMOFF", _IOC_WRITE, 0x5613, 0x04 },
+{ "linux/videodev2.h", "VIDIOC_STREAMON", _IOC_WRITE, 0x5612, 0x04 },
+{ "linux/videodev2.h", "VIDIOC_SUBSCRIBE_EVENT", _IOC_WRITE, 0x565a, 0x20 },
+{ "linux/videodev2.h", "VIDIOC_S_AUDIO", _IOC_WRITE, 0x5622, 0x34 },
+{ "linux/videodev2.h", "VIDIOC_S_AUDOUT", _IOC_WRITE, 0x5632, 0x34 },
+{ "linux/videodev2.h", "VIDIOC_S_CROP", _IOC_WRITE, 0x563c, 0x14 },
+{ "linux/videodev2.h", "VIDIOC_S_CTRL", _IOC_READ|_IOC_WRITE, 0x561c, 0x08 },
+{ "linux/videodev2.h", "VIDIOC_S_DV_TIMINGS", _IOC_READ|_IOC_WRITE, 0x5657, 0x84 },
+{ "linux/videodev2.h", "VIDIOC_S_EDID", _IOC_READ|_IOC_WRITE, 0x5629, 0x28 },
+{ "linux/videodev2.h", "VIDIOC_S_EXT_CTRLS", _IOC_READ|_IOC_WRITE, 0x5648, 0x20 },
+{ "linux/videodev2.h", "VIDIOC_S_FBUF", _IOC_WRITE, 0x560b, 0x30 },
+{ "linux/videodev2.h", "VIDIOC_S_FMT", _IOC_READ|_IOC_WRITE, 0x5605, 0xd0 },
+{ "linux/videodev2.h", "VIDIOC_S_FREQUENCY", _IOC_WRITE, 0x5639, 0x2c },
+{ "linux/videodev2.h", "VIDIOC_S_HW_FREQ_SEEK", _IOC_WRITE, 0x5652, 0x30 },
+{ "linux/videodev2.h", "VIDIOC_S_INPUT", _IOC_READ|_IOC_WRITE, 0x5627, 0x04 },
+{ "linux/videodev2.h", "VIDIOC_S_JPEGCOMP", _IOC_WRITE, 0x563e, 0x8c },
+{ "linux/videodev2.h", "VIDIOC_S_MODULATOR", _IOC_WRITE, 0x5637, 0x44 },
+{ "linux/videodev2.h", "VIDIOC_S_OUTPUT", _IOC_READ|_IOC_WRITE, 0x562f, 0x04 },
+{ "linux/videodev2.h", "VIDIOC_S_PARM", _IOC_READ|_IOC_WRITE, 0x5616, 0xcc },
+{ "linux/videodev2.h", "VIDIOC_S_PRIORITY", _IOC_WRITE, 0x5644, 0x04 },
+{ "linux/videodev2.h", "VIDIOC_S_SELECTION", _IOC_READ|_IOC_WRITE, 0x565f, 0x40 },
+{ "linux/videodev2.h", "VIDIOC_S_STD", _IOC_WRITE, 0x5618, 0x08 },
+{ "linux/videodev2.h", "VIDIOC_S_TUNER", _IOC_WRITE, 0x561e, 0x54 },
+{ "linux/videodev2.h", "VIDIOC_TRY_DECODER_CMD", _IOC_READ|_IOC_WRITE, 0x5661, 0x48 },
+{ "linux/videodev2.h", "VIDIOC_TRY_ENCODER_CMD", _IOC_READ|_IOC_WRITE, 0x564e, 0x28 },
+{ "linux/videodev2.h", "VIDIOC_TRY_EXT_CTRLS", _IOC_READ|_IOC_WRITE, 0x5649, 0x20 },
+{ "linux/videodev2.h", "VIDIOC_TRY_FMT", _IOC_READ|_IOC_WRITE, 0x5640, 0xd0 },
+{ "linux/videodev2.h", "VIDIOC_UNSUBSCRIBE_EVENT", _IOC_WRITE, 0x565b, 0x20 },
+{ "linux/vm_sockets.h", "IOCTL_VM_SOCKETS_GET_LOCAL_CID", _IOC_NONE, 0x07b9, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_CTX_ADD_NOTIFICATION", _IOC_NONE, 0x07af, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_CTX_GET_CPT_STATE", _IOC_NONE, 0x07b1, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_CTX_REMOVE_NOTIFICATION", _IOC_NONE, 0x07b0, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_CTX_SET_CPT_STATE", _IOC_NONE, 0x07b2, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_DATAGRAM_RECEIVE", _IOC_NONE, 0x07ac, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_DATAGRAM_SEND", _IOC_NONE, 0x07ab, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_GET_CONTEXT_ID", _IOC_NONE, 0x07b3, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_INIT_CONTEXT", _IOC_NONE, 0x07a0, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_NOTIFICATIONS_RECEIVE", _IOC_NONE, 0x07a6, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_NOTIFY_RESOURCE", _IOC_NONE, 0x07a5, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_QUEUEPAIR_ALLOC", _IOC_NONE, 0x07a8, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_QUEUEPAIR_DETACH", _IOC_NONE, 0x07aa, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_QUEUEPAIR_SETPAGEFILE", _IOC_NONE, 0x07a9, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_QUEUEPAIR_SETVA", _IOC_NONE, 0x07a4, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_SET_NOTIFY", _IOC_NONE, 0x07cb, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_SOCKETS_GET_AF_VALUE", _IOC_NONE, 0x07b8, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_SOCKETS_GET_LOCAL_CID", _IOC_NONE, 0x07b9, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_SOCKETS_VERSION", _IOC_NONE, 0x07b4, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_VERSION", _IOC_NONE, 0x079f, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_VERSION2", _IOC_NONE, 0x07a7, 0x00 },
+{ "linux/vt.h", "VT_ACTIVATE", 0, 0x5606, 0 },
+{ "linux/vt.h", "VT_DISALLOCATE", 0, 0x5608, 0 },
+{ "linux/vt.h", "VT_GETHIFONTMASK", 0, 0x560D, 0 },
+{ "linux/vt.h", "VT_GETMODE", 0, 0x5601, 0 },
+{ "linux/vt.h", "VT_GETSTATE", 0, 0x5603, 0 },
+{ "linux/vt.h", "VT_LOCKSWITCH", 0, 0x560B, 0 },
+{ "linux/vt.h", "VT_OPENQRY", 0, 0x5600, 0 },
+{ "linux/vt.h", "VT_RELDISP", 0, 0x5605, 0 },
+{ "linux/vt.h", "VT_RESIZE", 0, 0x5609, 0 },
+{ "linux/vt.h", "VT_RESIZEX", 0, 0x560A, 0 },
+{ "linux/vt.h", "VT_SENDSIG", 0, 0x5604, 0 },
+{ "linux/vt.h", "VT_SETACTIVATE", 0, 0x560F, 0 },
+{ "linux/vt.h", "VT_SETMODE", 0, 0x5602, 0 },
+{ "linux/vt.h", "VT_UNLOCKSWITCH", 0, 0x560C, 0 },
+{ "linux/vt.h", "VT_WAITACTIVE", 0, 0x5607, 0 },
+{ "linux/vt.h", "VT_WAITEVENT", 0, 0x560E, 0 },
+{ "linux/vtpm_proxy.h", "VTPM_PROXY_IOC_NEW_DEV", _IOC_READ|_IOC_WRITE, 0xa100, 0x14 },
+{ "linux/watch_queue.h", "IOC_WATCH_QUEUE_SET_FILTER", _IOC_NONE, 0x5761, 0x00 },
+{ "linux/watch_queue.h", "IOC_WATCH_QUEUE_SET_SIZE", _IOC_NONE, 0x5760, 0x00 },
+{ "linux/watchdog.h", "WDIOC_GETBOOTSTATUS", _IOC_READ, 0x5702, 0x04 },
+{ "linux/watchdog.h", "WDIOC_GETPRETIMEOUT", _IOC_READ, 0x5709, 0x04 },
+{ "linux/watchdog.h", "WDIOC_GETSTATUS", _IOC_READ, 0x5701, 0x04 },
+{ "linux/watchdog.h", "WDIOC_GETSUPPORT", _IOC_READ, 0x5700, 0x28 },
+{ "linux/watchdog.h", "WDIOC_GETTEMP", _IOC_READ, 0x5703, 0x04 },
+{ "linux/watchdog.h", "WDIOC_GETTIMELEFT", _IOC_READ, 0x570a, 0x04 },
+{ "linux/watchdog.h", "WDIOC_GETTIMEOUT", _IOC_READ, 0x5707, 0x04 },
+{ "linux/watchdog.h", "WDIOC_KEEPALIVE", _IOC_READ, 0x5705, 0x04 },
+{ "linux/watchdog.h", "WDIOC_SETOPTIONS", _IOC_READ, 0x5704, 0x04 },
+{ "linux/watchdog.h", "WDIOC_SETPRETIMEOUT", _IOC_READ|_IOC_WRITE, 0x5708, 0x04 },
+{ "linux/watchdog.h", "WDIOC_SETTIMEOUT", _IOC_READ|_IOC_WRITE, 0x5706, 0x04 },
+{ "linux/wireless.h", "SIOCGIWAP", 0, 0x8B15, 0 },
+{ "linux/wireless.h", "SIOCGIWAPLIST", 0, 0x8B17, 0 },
+{ "linux/wireless.h", "SIOCGIWAUTH", 0, 0x8B33, 0 },
+{ "linux/wireless.h", "SIOCGIWENCODE", 0, 0x8B2B, 0 },
+{ "linux/wireless.h", "SIOCGIWENCODEEXT", 0, 0x8B35, 0 },
+{ "linux/wireless.h", "SIOCGIWESSID", 0, 0x8B1B, 0 },
+{ "linux/wireless.h", "SIOCGIWFRAG", 0, 0x8B25, 0 },
+{ "linux/wireless.h", "SIOCGIWFREQ", 0, 0x8B05, 0 },
+{ "linux/wireless.h", "SIOCGIWGENIE", 0, 0x8B31, 0 },
+{ "linux/wireless.h", "SIOCGIWMODE", 0, 0x8B07, 0 },
+{ "linux/wireless.h", "SIOCGIWNAME", 0, 0x8B01, 0 },
+{ "linux/wireless.h", "SIOCGIWNICKN", 0, 0x8B1D, 0 },
+{ "linux/wireless.h", "SIOCGIWNWID", 0, 0x8B03, 0 },
+{ "linux/wireless.h", "SIOCGIWPOWER", 0, 0x8B2D, 0 },
+{ "linux/wireless.h", "SIOCGIWPRIV", 0, 0x8B0D, 0 },
+{ "linux/wireless.h", "SIOCGIWRANGE", 0, 0x8B0B, 0 },
+{ "linux/wireless.h", "SIOCGIWRATE", 0, 0x8B21, 0 },
+{ "linux/wireless.h", "SIOCGIWRETRY", 0, 0x8B29, 0 },
+{ "linux/wireless.h", "SIOCGIWRTS", 0, 0x8B23, 0 },
+{ "linux/wireless.h", "SIOCGIWSCAN", 0, 0x8B19, 0 },
+{ "linux/wireless.h", "SIOCGIWSENS", 0, 0x8B09, 0 },
+{ "linux/wireless.h", "SIOCGIWSPY", 0, 0x8B11, 0 },
+{ "linux/wireless.h", "SIOCGIWSTATS", 0, 0x8B0F, 0 },
+{ "linux/wireless.h", "SIOCGIWTHRSPY", 0, 0x8B13, 0 },
+{ "linux/wireless.h", "SIOCGIWTXPOW", 0, 0x8B27, 0 },
+{ "linux/wireless.h", "SIOCIWFIRST", 0, 0x8B00, 0 },
+{ "linux/wireless.h", "SIOCIWFIRSTPRIV", 0, 0x8BE0, 0 },
+{ "linux/wireless.h", "SIOCIWLASTPRIV", 0, 0x8BFF, 0 },
+{ "linux/wireless.h", "SIOCSIWAP", 0, 0x8B14, 0 },
+{ "linux/wireless.h", "SIOCSIWAUTH", 0, 0x8B32, 0 },
+{ "linux/wireless.h", "SIOCSIWCOMMIT", 0, 0x8B00, 0 },
+{ "linux/wireless.h", "SIOCSIWENCODE", 0, 0x8B2A, 0 },
+{ "linux/wireless.h", "SIOCSIWENCODEEXT", 0, 0x8B34, 0 },
+{ "linux/wireless.h", "SIOCSIWESSID", 0, 0x8B1A, 0 },
+{ "linux/wireless.h", "SIOCSIWFRAG", 0, 0x8B24, 0 },
+{ "linux/wireless.h", "SIOCSIWFREQ", 0, 0x8B04, 0 },
+{ "linux/wireless.h", "SIOCSIWGENIE", 0, 0x8B30, 0 },
+{ "linux/wireless.h", "SIOCSIWMLME", 0, 0x8B16, 0 },
+{ "linux/wireless.h", "SIOCSIWMODE", 0, 0x8B06, 0 },
+{ "linux/wireless.h", "SIOCSIWNICKN", 0, 0x8B1C, 0 },
+{ "linux/wireless.h", "SIOCSIWNWID", 0, 0x8B02, 0 },
+{ "linux/wireless.h", "SIOCSIWPMKSA", 0, 0x8B36, 0 },
+{ "linux/wireless.h", "SIOCSIWPOWER", 0, 0x8B2C, 0 },
+{ "linux/wireless.h", "SIOCSIWPRIV", 0, 0x8B0C, 0 },
+{ "linux/wireless.h", "SIOCSIWRANGE", 0, 0x8B0A, 0 },
+{ "linux/wireless.h", "SIOCSIWRATE", 0, 0x8B20, 0 },
+{ "linux/wireless.h", "SIOCSIWRETRY", 0, 0x8B28, 0 },
+{ "linux/wireless.h", "SIOCSIWRTS", 0, 0x8B22, 0 },
+{ "linux/wireless.h", "SIOCSIWSCAN", 0, 0x8B18, 0 },
+{ "linux/wireless.h", "SIOCSIWSENS", 0, 0x8B08, 0 },
+{ "linux/wireless.h", "SIOCSIWSPY", 0, 0x8B10, 0 },
+{ "linux/wireless.h", "SIOCSIWSTATS", 0, 0x8B0E, 0 },
+{ "linux/wireless.h", "SIOCSIWTHRSPY", 0, 0x8B12, 0 },
+{ "linux/wireless.h", "SIOCSIWTXPOW", 0, 0x8B26, 0 },
+{ "linux/wmi.h", "DELL_WMI_SMBIOS_CMD", _IOC_READ|_IOC_WRITE, 0x5700, 0x34 },
+{ "media/drv-intf/exynos-fimc.h", "S5P_FIMC_TX_END_NOTIFY", _IOC_NONE, 0x6500, 0x00 },
+{ "media/i2c/adv7842.h", "ADV7842_CMD_RAM_TEST", _IOC_NONE, 0x56c0, 0x00 },
+{ "media/i2c/bt819.h", "BT819_FIFO_RESET_HIGH", _IOC_NONE, 0x6201, 0x00 },
+{ "media/i2c/bt819.h", "BT819_FIFO_RESET_LOW", _IOC_NONE, 0x6200, 0x00 },
+{ "media/i2c/saa6588.h", "SAA6588_CMD_CLOSE", _IOC_WRITE, 0x5202, 0x04 },
+{ "media/i2c/saa6588.h", "SAA6588_CMD_POLL", _IOC_READ, 0x5204, 0x04 },
+{ "media/i2c/saa6588.h", "SAA6588_CMD_READ", _IOC_READ, 0x5203, 0x04 },
+{ "media/v4l2-common.h", "TUNER_SET_CONFIG", _IOC_WRITE, 0x645c, 0x10 },
+{ "media/v4l2-common.h", "VIDIOC_INT_RESET", _IOC_WRITE, 0x6466, 0x04 },
+{ "media/v4l2-ioctl.h", "VIDIOC_DQBUF_TIME32", _IOC_READ|_IOC_WRITE, 0x5611, 0x50 },
+{ "media/v4l2-ioctl.h", "VIDIOC_DQEVENT_TIME32", _IOC_READ, 0x5659, 0x80 },
+{ "media/v4l2-ioctl.h", "VIDIOC_PREPARE_BUF_TIME32", _IOC_READ|_IOC_WRITE, 0x565d, 0x50 },
+{ "media/v4l2-ioctl.h", "VIDIOC_QBUF_TIME32", _IOC_READ|_IOC_WRITE, 0x560f, 0x50 },
+{ "media/v4l2-ioctl.h", "VIDIOC_QUERYBUF_TIME32", _IOC_READ|_IOC_WRITE, 0x5609, 0x50 },
+{ "media/v4l2-subdev.h", "V4L2_DEVICE_NOTIFY_EVENT", _IOC_WRITE, 0x7602, 0x88 },
+{ "media/v4l2-subdev.h", "V4L2_SUBDEV_IR_RX_NOTIFY", _IOC_WRITE, 0x7600, 0x04 },
+{ "media/v4l2-subdev.h", "V4L2_SUBDEV_IR_TX_NOTIFY", _IOC_WRITE, 0x7601, 0x04 },
+{ "misc/cxl.h", "CXL_IOCTL_DOWNLOAD_IMAGE", _IOC_WRITE, 0xca0a, 0x40 },
+{ "misc/cxl.h", "CXL_IOCTL_GET_AFU_ID", _IOC_READ, 0xca02, 0x40 },
+{ "misc/cxl.h", "CXL_IOCTL_GET_PROCESS_ELEMENT", _IOC_READ, 0xca01, 0x04 },
+{ "misc/cxl.h", "CXL_IOCTL_START_WORK", _IOC_WRITE, 0xca00, 0x40 },
+{ "misc/cxl.h", "CXL_IOCTL_VALIDATE_IMAGE", _IOC_WRITE, 0xca0b, 0x40 },
+{ "misc/fastrpc.h", "FASTRPC_IOCTL_ALLOC_DMA_BUFF", _IOC_READ|_IOC_WRITE, 0x5201, 0x10 },
+{ "misc/fastrpc.h", "FASTRPC_IOCTL_FREE_DMA_BUFF", _IOC_READ|_IOC_WRITE, 0x5202, 0x04 },
+{ "misc/fastrpc.h", "FASTRPC_IOCTL_INIT_ATTACH", _IOC_NONE, 0x5204, 0x00 },
+{ "misc/fastrpc.h", "FASTRPC_IOCTL_INIT_ATTACH_SNS", _IOC_NONE, 0x5208, 0x00 },
+{ "misc/fastrpc.h", "FASTRPC_IOCTL_INIT_CREATE", _IOC_READ|_IOC_WRITE, 0x5205, 0x18 },
+{ "misc/fastrpc.h", "FASTRPC_IOCTL_INVOKE", _IOC_READ|_IOC_WRITE, 0x5203, 0x10 },
+{ "misc/fastrpc.h", "FASTRPC_IOCTL_MMAP", _IOC_READ|_IOC_WRITE, 0x5206, 0x20 },
+{ "misc/fastrpc.h", "FASTRPC_IOCTL_MUNMAP", _IOC_READ|_IOC_WRITE, 0x5207, 0x10 },
+{ "misc/habanalabs.h", "HL_IOCTL_CB", _IOC_READ|_IOC_WRITE, 0x4802, 0x18 },
+{ "misc/habanalabs.h", "HL_IOCTL_CS", _IOC_READ|_IOC_WRITE, 0x4803, 0x30 },
+{ "misc/habanalabs.h", "HL_IOCTL_DEBUG", _IOC_READ|_IOC_WRITE, 0x4806, 0x28 },
+{ "misc/habanalabs.h", "HL_IOCTL_INFO", _IOC_READ|_IOC_WRITE, 0x4801, 0x18 },
+{ "misc/habanalabs.h", "HL_IOCTL_MEMORY", _IOC_READ|_IOC_WRITE, 0x4805, 0x28 },
+{ "misc/habanalabs.h", "HL_IOCTL_WAIT_CS", _IOC_READ|_IOC_WRITE, 0x4804, 0x18 },
+{ "misc/ocxl.h", "OCXL_IOCTL_ATTACH", _IOC_WRITE, 0xca10, 0x20 },
+{ "misc/ocxl.h", "OCXL_IOCTL_ENABLE_P9_WAIT", _IOC_READ, 0xca15, 0x20 },
+{ "misc/ocxl.h", "OCXL_IOCTL_GET_FEATURES", _IOC_READ, 0xca16, 0x20 },
+{ "misc/ocxl.h", "OCXL_IOCTL_GET_METADATA", _IOC_READ, 0xca14, 0x80 },
+{ "misc/ocxl.h", "OCXL_IOCTL_IRQ_ALLOC", _IOC_READ, 0xca11, 0x08 },
+{ "misc/ocxl.h", "OCXL_IOCTL_IRQ_FREE", _IOC_WRITE, 0xca12, 0x08 },
+{ "misc/ocxl.h", "OCXL_IOCTL_IRQ_SET_FD", _IOC_WRITE, 0xca13, 0x10 },
+{ "misc/uacce/hisi_qm.h", "UACCE_CMD_QM_SET_QP_CTX", _IOC_READ|_IOC_WRITE, 0x480a, 0x04 },
+{ "misc/uacce/uacce.h", "UACCE_CMD_PUT_Q", _IOC_NONE, 0x5701, 0x00 },
+{ "misc/uacce/uacce.h", "UACCE_CMD_START_Q", _IOC_NONE, 0x5700, 0x00 },
+{ "misc/xilinx_sdfec.h", "XSDFEC_ADD_LDPC_CODE_PARAMS", _IOC_WRITE, 0x6605, 0x60 },
+{ "misc/xilinx_sdfec.h", "XSDFEC_CLEAR_STATS", _IOC_NONE, 0x660b, 0x00 },
+{ "misc/xilinx_sdfec.h", "XSDFEC_GET_CONFIG", _IOC_READ, 0x6606, 0x1c },
+{ "misc/xilinx_sdfec.h", "XSDFEC_GET_STATS", _IOC_READ, 0x660c, 0x0c },
+{ "misc/xilinx_sdfec.h", "XSDFEC_GET_STATUS", _IOC_READ, 0x6602, 0x08 },
+{ "misc/xilinx_sdfec.h", "XSDFEC_GET_TURBO", _IOC_READ, 0x6607, 0x08 },
+{ "misc/xilinx_sdfec.h", "XSDFEC_IS_ACTIVE", _IOC_READ, 0x660a, 0x01 },
+{ "misc/xilinx_sdfec.h", "XSDFEC_SET_BYPASS", _IOC_WRITE, 0x6609, 0x01 },
+{ "misc/xilinx_sdfec.h", "XSDFEC_SET_DEFAULT_CONFIG", _IOC_NONE, 0x660d, 0x00 },
+{ "misc/xilinx_sdfec.h", "XSDFEC_SET_IRQ", _IOC_WRITE, 0x6603, 0x02 },
+{ "misc/xilinx_sdfec.h", "XSDFEC_SET_ORDER", _IOC_WRITE, 0x6608, 0x08 },
+{ "misc/xilinx_sdfec.h", "XSDFEC_SET_TURBO", _IOC_WRITE, 0x6604, 0x08 },
+{ "misc/xilinx_sdfec.h", "XSDFEC_START_DEV", _IOC_NONE, 0x6600, 0x00 },
+{ "misc/xilinx_sdfec.h", "XSDFEC_STOP_DEV", _IOC_NONE, 0x6601, 0x00 },
+{ "mtd/mtd-abi.h", "ECCGETLAYOUT", _IOC_READ, 0x4d11, 0x148 },
+{ "mtd/mtd-abi.h", "ECCGETSTATS", _IOC_READ, 0x4d12, 0x10 },
+{ "mtd/mtd-abi.h", "MEMERASE", _IOC_WRITE, 0x4d02, 0x08 },
+{ "mtd/mtd-abi.h", "MEMERASE64", _IOC_WRITE, 0x4d14, 0x10 },
+{ "mtd/mtd-abi.h", "MEMGETBADBLOCK", _IOC_WRITE, 0x4d0b, 0x08 },
+{ "mtd/mtd-abi.h", "MEMGETINFO", _IOC_READ, 0x4d01, 0x20 },
+{ "mtd/mtd-abi.h", "MEMGETOOBSEL", _IOC_READ, 0x4d0a, 0xc8 },
+{ "mtd/mtd-abi.h", "MEMGETREGIONCOUNT", _IOC_READ, 0x4d07, 0x04 },
+{ "mtd/mtd-abi.h", "MEMGETREGIONINFO", _IOC_READ|_IOC_WRITE, 0x4d08, 0x10 },
+{ "mtd/mtd-abi.h", "MEMISLOCKED", _IOC_READ, 0x4d17, 0x08 },
+{ "mtd/mtd-abi.h", "MEMLOCK", _IOC_WRITE, 0x4d05, 0x08 },
+{ "mtd/mtd-abi.h", "MEMREADOOB", _IOC_READ|_IOC_WRITE, 0x4d04, 0x10 },
+{ "mtd/mtd-abi.h", "MEMREADOOB64", _IOC_READ|_IOC_WRITE, 0x4d16, 0x18 },
+{ "mtd/mtd-abi.h", "MEMSETBADBLOCK", _IOC_WRITE, 0x4d0c, 0x08 },
+{ "mtd/mtd-abi.h", "MEMUNLOCK", _IOC_WRITE, 0x4d06, 0x08 },
+{ "mtd/mtd-abi.h", "MEMWRITE", _IOC_READ|_IOC_WRITE, 0x4d18, 0x30 },
+{ "mtd/mtd-abi.h", "MEMWRITEOOB", _IOC_READ|_IOC_WRITE, 0x4d03, 0x10 },
+{ "mtd/mtd-abi.h", "MEMWRITEOOB64", _IOC_READ|_IOC_WRITE, 0x4d15, 0x18 },
+{ "mtd/mtd-abi.h", "MTDFILEMODE", _IOC_NONE, 0x4d13, 0x00 },
+{ "mtd/mtd-abi.h", "OTPGETREGIONCOUNT", _IOC_WRITE, 0x4d0e, 0x04 },
+{ "mtd/mtd-abi.h", "OTPGETREGIONINFO", _IOC_WRITE, 0x4d0f, 0x0c },
+{ "mtd/mtd-abi.h", "OTPLOCK", _IOC_READ, 0x4d10, 0x0c },
+{ "mtd/mtd-abi.h", "OTPSELECT", _IOC_READ, 0x4d0d, 0x04 },
+{ "mtd/ubi-user.h", "UBI_IOCATT", _IOC_WRITE, 0x6f40, 0x18 },
+{ "mtd/ubi-user.h", "UBI_IOCDET", _IOC_WRITE, 0x6f41, 0x04 },
+{ "mtd/ubi-user.h", "UBI_IOCEBCH", _IOC_WRITE, 0x4f02, 0x04 },
+{ "mtd/ubi-user.h", "UBI_IOCEBER", _IOC_WRITE, 0x4f01, 0x04 },
+{ "mtd/ubi-user.h", "UBI_IOCEBISMAP", _IOC_READ, 0x4f05, 0x04 },
+{ "mtd/ubi-user.h", "UBI_IOCEBMAP", _IOC_WRITE, 0x4f03, 0x08 },
+{ "mtd/ubi-user.h", "UBI_IOCEBUNMAP", _IOC_WRITE, 0x4f04, 0x04 },
+{ "mtd/ubi-user.h", "UBI_IOCMKVOL", _IOC_WRITE, 0x6f00, 0x98 },
+{ "mtd/ubi-user.h", "UBI_IOCRMVOL", _IOC_WRITE, 0x6f01, 0x04 },
+{ "mtd/ubi-user.h", "UBI_IOCRNVOL", _IOC_WRITE, 0x6f03, 0x1110 },
+{ "mtd/ubi-user.h", "UBI_IOCRPEB", _IOC_WRITE, 0x6f04, 0x04 },
+{ "mtd/ubi-user.h", "UBI_IOCRSVOL", _IOC_WRITE, 0x6f02, 0x0c },
+{ "mtd/ubi-user.h", "UBI_IOCSETVOLPROP", _IOC_WRITE, 0x4f06, 0x10 },
+{ "mtd/ubi-user.h", "UBI_IOCSPEB", _IOC_WRITE, 0x6f05, 0x04 },
+{ "mtd/ubi-user.h", "UBI_IOCVOLCRBLK", _IOC_WRITE, 0x4f07, 0x80 },
+{ "mtd/ubi-user.h", "UBI_IOCVOLRMBLK", _IOC_NONE, 0x4f08, 0x00 },
+{ "mtd/ubi-user.h", "UBI_IOCVOLUP", _IOC_WRITE, 0x4f00, 0x08 },
+{ "net/bluetooth/hci_sock.h", "HCIBLOCKADDR", _IOC_WRITE, 0x48e6, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCIDEVDOWN", _IOC_WRITE, 0x48ca, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCIDEVRESET", _IOC_WRITE, 0x48cb, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCIDEVRESTAT", _IOC_WRITE, 0x48cc, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCIDEVUP", _IOC_WRITE, 0x48c9, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCIGETAUTHINFO", _IOC_READ, 0x48d7, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCIGETCONNINFO", _IOC_READ, 0x48d5, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCIGETCONNLIST", _IOC_READ, 0x48d4, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCIGETDEVINFO", _IOC_READ, 0x48d3, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCIGETDEVLIST", _IOC_READ, 0x48d2, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCIINQUIRY", _IOC_READ, 0x48f0, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCISETACLMTU", _IOC_WRITE, 0x48e3, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCISETAUTH", _IOC_WRITE, 0x48de, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCISETENCRYPT", _IOC_WRITE, 0x48df, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCISETLINKMODE", _IOC_WRITE, 0x48e2, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCISETLINKPOL", _IOC_WRITE, 0x48e1, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCISETPTYPE", _IOC_WRITE, 0x48e0, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCISETRAW", _IOC_WRITE, 0x48dc, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCISETSCAN", _IOC_WRITE, 0x48dd, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCISETSCOMTU", _IOC_WRITE, 0x48e4, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCIUNBLOCKADDR", _IOC_WRITE, 0x48e7, 0x04 },
+{ "net/bluetooth/rfcomm.h", "RFCOMMCREATEDEV", _IOC_WRITE, 0x52c8, 0x04 },
+{ "net/bluetooth/rfcomm.h", "RFCOMMGETDEVINFO", _IOC_READ, 0x52d3, 0x04 },
+{ "net/bluetooth/rfcomm.h", "RFCOMMGETDEVLIST", _IOC_READ, 0x52d2, 0x04 },
+{ "net/bluetooth/rfcomm.h", "RFCOMMRELEASEDEV", _IOC_WRITE, 0x52c9, 0x04 },
+{ "net/bluetooth/rfcomm.h", "RFCOMMSTEALDLC", _IOC_WRITE, 0x52dc, 0x04 },
+{ "net/nfc/nci_core.h", "NCIUARTSETDRIVER", _IOC_WRITE, 0x5500, 0x08 },
+{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_ACK_EVENT", _IOC_WRITE, 0x1bea, 0x08 },
+{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_ASSIGN_CTXT", _IOC_READ|_IOC_WRITE, 0x1be1, 0x1c },
+{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_CREDIT_UPD", _IOC_NONE, 0x1be6, 0x00 },
+{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_CTXT_INFO", _IOC_WRITE, 0x1be2, 0x28 },
+{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_CTXT_RESET", _IOC_NONE, 0x1bec, 0x00 },
+{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_GET_VERS", _IOC_READ, 0x1bee, 0x04 },
+{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_POLL_TYPE", _IOC_WRITE, 0x1be9, 0x04 },
+{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_RECV_CTRL", _IOC_WRITE, 0x1be8, 0x04 },
+{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_SET_PKEY", _IOC_WRITE, 0x1beb, 0x02 },
+{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_TID_FREE", _IOC_READ|_IOC_WRITE, 0x1be5, 0x18 },
+{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_TID_INVAL_READ", _IOC_READ|_IOC_WRITE, 0x1bed, 0x18 },
+{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_TID_UPDATE", _IOC_READ|_IOC_WRITE, 0x1be4, 0x18 },
+{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_USER_INFO", _IOC_WRITE, 0x1be3, 0x78 },
+{ "rdma/rdma_user_ioctl.h", "IB_USER_MAD_ENABLE_PKEY", _IOC_NONE, 0x1b03, 0x00 },
+{ "rdma/rdma_user_ioctl.h", "IB_USER_MAD_REGISTER_AGENT", _IOC_READ|_IOC_WRITE, 0x1b01, 0x1c },
+{ "rdma/rdma_user_ioctl.h", "IB_USER_MAD_REGISTER_AGENT2", _IOC_READ|_IOC_WRITE, 0x1b04, 0x28 },
+{ "rdma/rdma_user_ioctl.h", "IB_USER_MAD_UNREGISTER_AGENT", _IOC_WRITE, 0x1b02, 0x04 },
+{ "rdma/rdma_user_ioctl_cmds.h", "RDMA_VERBS_IOCTL", _IOC_READ|_IOC_WRITE, 0x1b01, 0x18 },
+{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_ATTACH", _IOC_READ|_IOC_WRITE, 0xca80, 0x90 },
+{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_DETACH", _IOC_READ|_IOC_WRITE, 0xca83, 0x60 },
+{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_MANAGE_LUN", _IOC_READ|_IOC_WRITE, 0xca86, 0x68 },
+{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_RECOVER_AFU", _IOC_READ|_IOC_WRITE, 0xca85, 0x78 },
+{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_RELEASE", _IOC_READ|_IOC_WRITE, 0xca82, 0x68 },
+{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_USER_DIRECT", _IOC_READ|_IOC_WRITE, 0xca81, 0x70 },
+{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_USER_VIRTUAL", _IOC_READ|_IOC_WRITE, 0xca87, 0x78 },
+{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_VERIFY", _IOC_READ|_IOC_WRITE, 0xca84, 0x90 },
+{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_VLUN_CLONE", _IOC_READ|_IOC_WRITE, 0xca89, 0x70 },
+{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_VLUN_RESIZE", _IOC_READ|_IOC_WRITE, 0xca88, 0x78 },
+{ "scsi/cxlflash_ioctl.h", "HT_CXLFLASH_AFU_DEBUG", _IOC_READ|_IOC_WRITE, 0xcabe, 0x78 },
+{ "scsi/cxlflash_ioctl.h", "HT_CXLFLASH_LUN_PROVISION", _IOC_READ|_IOC_WRITE, 0xcabf, 0xa0 },
+{ "scsi/scsi.h", "SCSI_IOCTL_GET_BUS_NUMBER", 0, 0x5386, 0 },
+{ "scsi/scsi.h", "SCSI_IOCTL_GET_IDLUN", 0, 0x5382, 0 },
+{ "scsi/scsi.h", "SCSI_IOCTL_GET_PCI", 0, 0x5387, 0 },
+{ "scsi/scsi.h", "SCSI_IOCTL_PROBE_HOST", 0, 0x5385, 0 },
+{ "scsi/scsi_ioctl.h", "SCSI_IOCTL_DOORLOCK", 0, 0x5380, 0 },
+{ "scsi/scsi_ioctl.h", "SCSI_IOCTL_DOORUNLOCK", 0, 0x5381, 0 },
+{ "scsi/sg.h", "SG_EMULATED_HOST", 0, 0x2203, 0 },
+{ "scsi/sg.h", "SG_GET_ACCESS_COUNT", 0, 0x2289, 0 },
+{ "scsi/sg.h", "SG_GET_COMMAND_Q", 0, 0x2270, 0 },
+{ "scsi/sg.h", "SG_GET_KEEP_ORPHAN", 0, 0x2288, 0 },
+{ "scsi/sg.h", "SG_GET_LOW_DMA", 0, 0x227a, 0 },
+{ "scsi/sg.h", "SG_GET_NUM_WAITING", 0, 0x227d, 0 },
+{ "scsi/sg.h", "SG_GET_PACK_ID", 0, 0x227c, 0 },
+{ "scsi/sg.h", "SG_GET_REQUEST_TABLE", 0, 0x2286, 0 },
+{ "scsi/sg.h", "SG_GET_RESERVED_SIZE", 0, 0x2272, 0 },
+{ "scsi/sg.h", "SG_GET_SCSI_ID", 0, 0x2276, 0 },
+{ "scsi/sg.h", "SG_GET_SG_TABLESIZE", 0, 0x227F, 0 },
+{ "scsi/sg.h", "SG_GET_TIMEOUT", 0, 0x2202, 0 },
+{ "scsi/sg.h", "SG_GET_TRANSFORM", 0, 0x2205, 0 },
+{ "scsi/sg.h", "SG_GET_VERSION_NUM", 0, 0x2282, 0 },
+{ "scsi/sg.h", "SG_IO", 0, 0x2285, 0 },
+{ "scsi/sg.h", "SG_NEXT_CMD_LEN", 0, 0x2283, 0 },
+{ "scsi/sg.h", "SG_SCSI_RESET", 0, 0x2284, 0 },
+{ "scsi/sg.h", "SG_SET_COMMAND_Q", 0, 0x2271, 0 },
+{ "scsi/sg.h", "SG_SET_DEBUG", 0, 0x227e, 0 },
+{ "scsi/sg.h", "SG_SET_FORCE_LOW_DMA", 0, 0x2279, 0 },
+{ "scsi/sg.h", "SG_SET_FORCE_PACK_ID", 0, 0x227b, 0 },
+{ "scsi/sg.h", "SG_SET_KEEP_ORPHAN", 0, 0x2287, 0 },
+{ "scsi/sg.h", "SG_SET_RESERVED_SIZE", 0, 0x2275, 0 },
+{ "scsi/sg.h", "SG_SET_TIMEOUT", 0, 0x2201, 0 },
+{ "scsi/sg.h", "SG_SET_TRANSFORM", 0, 0x2204, 0 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_CLIENT_ID", _IOC_READ, 0x5301, 0x04 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_CREATE_PORT", _IOC_READ|_IOC_WRITE, 0x5320, 0xa8 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_CREATE_QUEUE", _IOC_READ|_IOC_WRITE, 0x5332, 0x8c },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_DELETE_PORT", _IOC_WRITE, 0x5321, 0xa8 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_DELETE_QUEUE", _IOC_WRITE, 0x5333, 0x8c },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_CLIENT_INFO", _IOC_READ|_IOC_WRITE, 0x5310, 0xbc },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_CLIENT_POOL", _IOC_READ|_IOC_WRITE, 0x534b, 0x58 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_NAMED_QUEUE", _IOC_READ|_IOC_WRITE, 0x5336, 0x8c },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_PORT_INFO", _IOC_READ|_IOC_WRITE, 0x5322, 0xa8 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_QUEUE_CLIENT", _IOC_READ|_IOC_WRITE, 0x5349, 0x4c },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_QUEUE_INFO", _IOC_READ|_IOC_WRITE, 0x5334, 0x8c },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_QUEUE_STATUS", _IOC_READ|_IOC_WRITE, 0x5340, 0x5c },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_QUEUE_TEMPO", _IOC_READ|_IOC_WRITE, 0x5341, 0x2c },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_QUEUE_TIMER", _IOC_READ|_IOC_WRITE, 0x5345, 0x60 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_SUBSCRIPTION", _IOC_READ|_IOC_WRITE, 0x5350, 0x50 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_PVERSION", _IOC_READ, 0x5300, 0x04 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_QUERY_NEXT_CLIENT", _IOC_READ|_IOC_WRITE, 0x5351, 0xbc },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_QUERY_NEXT_PORT", _IOC_READ|_IOC_WRITE, 0x5352, 0xa8 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_QUERY_SUBS", _IOC_READ|_IOC_WRITE, 0x534f, 0x58 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_REMOVE_EVENTS", _IOC_WRITE, 0x534e, 0x40 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_RUNNING_MODE", _IOC_READ|_IOC_WRITE, 0x5303, 0x10 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SET_CLIENT_INFO", _IOC_WRITE, 0x5311, 0xbc },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SET_CLIENT_POOL", _IOC_WRITE, 0x534c, 0x58 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SET_PORT_INFO", _IOC_WRITE, 0x5323, 0xa8 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SET_QUEUE_CLIENT", _IOC_WRITE, 0x534a, 0x4c },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SET_QUEUE_INFO", _IOC_READ|_IOC_WRITE, 0x5335, 0x8c },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SET_QUEUE_TEMPO", _IOC_WRITE, 0x5342, 0x2c },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SET_QUEUE_TIMER", _IOC_WRITE, 0x5346, 0x60 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SUBSCRIBE_PORT", _IOC_WRITE, 0x5330, 0x50 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SYSTEM_INFO", _IOC_READ|_IOC_WRITE, 0x5302, 0x30 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_UNSUBSCRIBE_PORT", _IOC_WRITE, 0x5331, 0x50 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_CARD_INFO", _IOC_READ, 0x5501, 0x178 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_ADD", _IOC_READ|_IOC_WRITE, 0x5517, 0x110 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_INFO", _IOC_READ|_IOC_WRITE, 0x5511, 0x110 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_LIST", _IOC_READ|_IOC_WRITE, 0x5510, 0x50 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_LOCK", _IOC_WRITE, 0x5514, 0x40 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_READ", _IOC_READ|_IOC_WRITE, 0x5512, 0x4c8 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_REMOVE", _IOC_READ|_IOC_WRITE, 0x5519, 0x40 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_REPLACE", _IOC_READ|_IOC_WRITE, 0x5518, 0x110 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_UNLOCK", _IOC_WRITE, 0x5515, 0x40 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_WRITE", _IOC_READ|_IOC_WRITE, 0x5513, 0x4c8 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_HWDEP_INFO", _IOC_READ, 0x5521, 0xdc },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_HWDEP_NEXT_DEVICE", _IOC_READ|_IOC_WRITE, 0x5520, 0x04 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_PCM_INFO", _IOC_READ|_IOC_WRITE, 0x5531, 0x120 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_PCM_NEXT_DEVICE", _IOC_READ, 0x5530, 0x04 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_PCM_PREFER_SUBDEVICE", _IOC_WRITE, 0x5532, 0x04 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_POWER", _IOC_READ|_IOC_WRITE, 0x55d0, 0x04 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_POWER_STATE", _IOC_READ, 0x55d1, 0x04 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_PVERSION", _IOC_READ, 0x5500, 0x04 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_RAWMIDI_INFO", _IOC_READ|_IOC_WRITE, 0x5541, 0x10c },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_RAWMIDI_NEXT_DEVICE", _IOC_READ|_IOC_WRITE, 0x5540, 0x04 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_RAWMIDI_PREFER_SUBDEVICE", _IOC_WRITE, 0x5542, 0x04 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_SUBSCRIBE_EVENTS", _IOC_READ|_IOC_WRITE, 0x5516, 0x04 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_TLV_COMMAND", _IOC_READ|_IOC_WRITE, 0x551c, 0x08 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_TLV_READ", _IOC_READ|_IOC_WRITE, 0x551a, 0x08 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_TLV_WRITE", _IOC_READ|_IOC_WRITE, 0x551b, 0x08 },
+{ "sound/asound.h", "SNDRV_HWDEP_IOCTL_DSP_LOAD", _IOC_WRITE, 0x4803, 0x60 },
+{ "sound/asound.h", "SNDRV_HWDEP_IOCTL_DSP_STATUS", _IOC_READ, 0x4802, 0x40 },
+{ "sound/asound.h", "SNDRV_HWDEP_IOCTL_INFO", _IOC_READ, 0x4801, 0xdc },
+{ "sound/asound.h", "SNDRV_HWDEP_IOCTL_PVERSION", _IOC_READ, 0x4800, 0x04 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_CHANNEL_INFO", _IOC_READ, 0x4132, 0x18 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_DELAY", _IOC_READ, 0x4121, 0x08 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_DRAIN", _IOC_NONE, 0x4144, 0x00 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_DROP", _IOC_NONE, 0x4143, 0x00 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_FORWARD", _IOC_WRITE, 0x4149, 0x08 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_HWSYNC", _IOC_NONE, 0x4122, 0x00 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_HW_FREE", _IOC_NONE, 0x4112, 0x00 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_HW_PARAMS", _IOC_READ|_IOC_WRITE, 0x4111, 0x260 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_HW_REFINE", _IOC_READ|_IOC_WRITE, 0x4110, 0x260 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_INFO", _IOC_READ, 0x4101, 0x120 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_LINK", _IOC_WRITE, 0x4160, 0x04 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_PAUSE", _IOC_WRITE, 0x4145, 0x04 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_PREPARE", _IOC_NONE, 0x4140, 0x00 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_PVERSION", _IOC_READ, 0x4100, 0x04 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_READI_FRAMES", _IOC_READ, 0x4151, 0x18 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_READN_FRAMES", _IOC_READ, 0x4153, 0x18 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_RESET", _IOC_NONE, 0x4141, 0x00 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_RESUME", _IOC_NONE, 0x4147, 0x00 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_REWIND", _IOC_WRITE, 0x4146, 0x08 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_START", _IOC_NONE, 0x4142, 0x00 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_STATUS", _IOC_READ, 0x4120, 0x98 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_STATUS_EXT", _IOC_READ|_IOC_WRITE, 0x4124, 0x98 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_SW_PARAMS", _IOC_READ|_IOC_WRITE, 0x4113, 0x88 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_SYNC_PTR", _IOC_READ|_IOC_WRITE, 0x4123, 0x88 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_TSTAMP", _IOC_WRITE, 0x4102, 0x04 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_TTSTAMP", _IOC_WRITE, 0x4103, 0x04 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_UNLINK", _IOC_NONE, 0x4161, 0x00 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_USER_PVERSION", _IOC_WRITE, 0x4104, 0x04 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_WRITEI_FRAMES", _IOC_WRITE, 0x4150, 0x18 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_WRITEN_FRAMES", _IOC_WRITE, 0x4152, 0x18 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_XRUN", _IOC_NONE, 0x4148, 0x00 },
+{ "sound/asound.h", "SNDRV_RAWMIDI_IOCTL_DRAIN", _IOC_WRITE, 0x5731, 0x04 },
+{ "sound/asound.h", "SNDRV_RAWMIDI_IOCTL_DROP", _IOC_WRITE, 0x5730, 0x04 },
+{ "sound/asound.h", "SNDRV_RAWMIDI_IOCTL_INFO", _IOC_READ, 0x5701, 0x10c },
+{ "sound/asound.h", "SNDRV_RAWMIDI_IOCTL_PARAMS", _IOC_READ|_IOC_WRITE, 0x5710, 0x30 },
+{ "sound/asound.h", "SNDRV_RAWMIDI_IOCTL_PVERSION", _IOC_READ, 0x5700, 0x04 },
+{ "sound/asound.h", "SNDRV_RAWMIDI_IOCTL_STATUS", _IOC_READ|_IOC_WRITE, 0x5720, 0x38 },
+{ "sound/asound.h", "SNDRV_TIMER_IOCTL_CONTINUE", _IOC_NONE, 0x54a2, 0x00 },
+{ "sound/asound.h", "SNDRV_TIMER_IOCTL_GINFO", _IOC_READ|_IOC_WRITE, 0x5403, 0xf8 },
+{ "sound/asound.h", "SNDRV_TIMER_IOCTL_GPARAMS", _IOC_WRITE, 0x5404, 0x48 },
+{ "sound/asound.h", "SNDRV_TIMER_IOCTL_GSTATUS", _IOC_READ|_IOC_WRITE, 0x5405, 0x50 },
+{ "sound/asound.h", "SNDRV_TIMER_IOCTL_INFO", _IOC_READ, 0x5411, 0xe8 },
+{ "sound/asound.h", "SNDRV_TIMER_IOCTL_NEXT_DEVICE", _IOC_READ|_IOC_WRITE, 0x5401, 0x14 },
+{ "sound/asound.h", "SNDRV_TIMER_IOCTL_PARAMS", _IOC_WRITE, 0x5412, 0x50 },
+{ "sound/asound.h", "SNDRV_TIMER_IOCTL_PAUSE", _IOC_NONE, 0x54a3, 0x00 },
+{ "sound/asound.h", "SNDRV_TIMER_IOCTL_PVERSION", _IOC_READ, 0x5400, 0x04 },
+{ "sound/asound.h", "SNDRV_TIMER_IOCTL_SELECT", _IOC_WRITE, 0x5410, 0x34 },
+{ "sound/asound.h", "SNDRV_TIMER_IOCTL_START", _IOC_NONE, 0x54a0, 0x00 },
+{ "sound/asound.h", "SNDRV_TIMER_IOCTL_STATUS", _IOC_READ, 0x5414, 0x60 },
+{ "sound/asound.h", "SNDRV_TIMER_IOCTL_STOP", _IOC_NONE, 0x54a1, 0x00 },
+{ "sound/asound.h", "SNDRV_TIMER_IOCTL_TREAD64", _IOC_WRITE, 0x54a4, 0x04 },
+{ "sound/asound.h", "SNDRV_TIMER_IOCTL_TREAD_OLD", _IOC_WRITE, 0x5402, 0x04 },
+{ "sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_CLEAR_PATCHES", _IOC_NONE, 0x4840, 0x00 },
+{ "sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_INFO", _IOC_READ, 0x4820, 0x02 },
+{ "sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_PLAY_NOTE", _IOC_WRITE, 0x4822, 0x0c },
+{ "sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_RESET", _IOC_NONE, 0x4821, 0x00 },
+{ "sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_SET_CONNECTION", _IOC_WRITE, 0x4826, 0x04 },
+{ "sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_SET_MODE", _IOC_WRITE, 0x4825, 0x04 },
+{ "sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_SET_PARAMS", _IOC_WRITE, 0x4824, 0x09 },
+{ "sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_SET_VOICE", _IOC_WRITE, 0x4823, 0x12 },
+{ "sound/compress_offload.h", "SNDRV_COMPRESS_AVAIL", _IOC_READ, 0x4321, 0x1c },
+{ "sound/compress_offload.h", "SNDRV_COMPRESS_DRAIN", _IOC_NONE, 0x4334, 0x00 },
+{ "sound/compress_offload.h", "SNDRV_COMPRESS_GET_CAPS", _IOC_READ|_IOC_WRITE, 0x4310, 0xc4 },
+{ "sound/compress_offload.h", "SNDRV_COMPRESS_GET_CODEC_CAPS", _IOC_READ|_IOC_WRITE, 0x4311, 0x2b88 },
+{ "sound/compress_offload.h", "SNDRV_COMPRESS_GET_METADATA", _IOC_READ|_IOC_WRITE, 0x4315, 0x24 },
+{ "sound/compress_offload.h", "SNDRV_COMPRESS_GET_PARAMS", _IOC_READ, 0x4313, 0x78 },
+{ "sound/compress_offload.h", "SNDRV_COMPRESS_IOCTL_VERSION", _IOC_READ, 0x4300, 0x04 },
+{ "sound/compress_offload.h", "SNDRV_COMPRESS_NEXT_TRACK", _IOC_NONE, 0x4335, 0x00 },
+{ "sound/compress_offload.h", "SNDRV_COMPRESS_PARTIAL_DRAIN", _IOC_NONE, 0x4336, 0x00 },
+{ "sound/compress_offload.h", "SNDRV_COMPRESS_PAUSE", _IOC_NONE, 0x4330, 0x00 },
+{ "sound/compress_offload.h", "SNDRV_COMPRESS_RESUME", _IOC_NONE, 0x4331, 0x00 },
+{ "sound/compress_offload.h", "SNDRV_COMPRESS_SET_METADATA", _IOC_WRITE, 0x4314, 0x24 },
+{ "sound/compress_offload.h", "SNDRV_COMPRESS_SET_PARAMS", _IOC_WRITE, 0x4312, 0x84 },
+{ "sound/compress_offload.h", "SNDRV_COMPRESS_START", _IOC_NONE, 0x4332, 0x00 },
+{ "sound/compress_offload.h", "SNDRV_COMPRESS_STOP", _IOC_NONE, 0x4333, 0x00 },
+{ "sound/compress_offload.h", "SNDRV_COMPRESS_TSTAMP", _IOC_READ, 0x4320, 0x14 },
+{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_CODE_PEEK", _IOC_READ|_IOC_WRITE, 0x4812, 0x1b0 },
+{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_CODE_POKE", _IOC_WRITE, 0x4811, 0x1b0 },
+{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_CONTINUE", _IOC_NONE, 0x4881, 0x00 },
+{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_DBG_READ", _IOC_READ, 0x4884, 0x04 },
+{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_INFO", _IOC_READ, 0x4810, 0x80c },
+{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_PCM_PEEK", _IOC_READ|_IOC_WRITE, 0x4831, 0x48 },
+{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_PCM_POKE", _IOC_WRITE, 0x4830, 0x48 },
+{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_PVERSION", _IOC_READ, 0x4840, 0x04 },
+{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_SINGLE_STEP", _IOC_WRITE, 0x4883, 0x04 },
+{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_STOP", _IOC_NONE, 0x4880, 0x00 },
+{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_TRAM_PEEK", _IOC_READ|_IOC_WRITE, 0x4822, 0x10 },
+{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_TRAM_POKE", _IOC_WRITE, 0x4821, 0x10 },
+{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_TRAM_SETUP", _IOC_WRITE, 0x4820, 0x04 },
+{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_ZERO_TRAM_COUNTER", _IOC_NONE, 0x4882, 0x00 },
+{ "sound/firewire.h", "SNDRV_FIREWIRE_IOCTL_GET_INFO", _IOC_READ, 0x48f8, 0x20 },
+{ "sound/firewire.h", "SNDRV_FIREWIRE_IOCTL_LOCK", _IOC_NONE, 0x48f9, 0x00 },
+{ "sound/firewire.h", "SNDRV_FIREWIRE_IOCTL_TASCAM_STATE", _IOC_READ, 0x48fb, 0x100 },
+{ "sound/firewire.h", "SNDRV_FIREWIRE_IOCTL_UNLOCK", _IOC_NONE, 0x48fa, 0x00 },
+{ "sound/hda_hwdep.h", "HDA_IOCTL_GET_WCAP", _IOC_READ|_IOC_WRITE, 0x4812, 0x08 },
+{ "sound/hda_hwdep.h", "HDA_IOCTL_PVERSION", _IOC_READ, 0x4810, 0x04 },
+{ "sound/hda_hwdep.h", "HDA_IOCTL_VERB_WRITE", _IOC_READ|_IOC_WRITE, 0x4811, 0x08 },
+{ "sound/hdsp.h", "SNDRV_HDSP_IOCTL_GET_9632_AEB", _IOC_READ, 0x4845, 0x08 },
+{ "sound/hdsp.h", "SNDRV_HDSP_IOCTL_GET_CONFIG_INFO", _IOC_READ, 0x4841, 0x24 },
+{ "sound/hdsp.h", "SNDRV_HDSP_IOCTL_GET_MIXER", _IOC_READ, 0x4844, 0x1000 },
+{ "sound/hdsp.h", "SNDRV_HDSP_IOCTL_GET_PEAK_RMS", _IOC_READ, 0x4840, 0x3b0 },
+{ "sound/hdsp.h", "SNDRV_HDSP_IOCTL_GET_VERSION", _IOC_READ, 0x4843, 0x08 },
+{ "sound/hdsp.h", "SNDRV_HDSP_IOCTL_UPLOAD_FIRMWARE", _IOC_WRITE, 0x4842, 0x08 },
+{ "sound/hdspm.h", "SNDRV_HDSPM_IOCTL_GET_CONFIG", _IOC_READ, 0x4841, 0x18 },
+{ "sound/hdspm.h", "SNDRV_HDSPM_IOCTL_GET_LTC", _IOC_READ, 0x4846, 0x10 },
+{ "sound/hdspm.h", "SNDRV_HDSPM_IOCTL_GET_MIXER", _IOC_READ, 0x4844, 0x08 },
+{ "sound/hdspm.h", "SNDRV_HDSPM_IOCTL_GET_PEAK_RMS", _IOC_READ, 0x4842, 0x908 },
+{ "sound/hdspm.h", "SNDRV_HDSPM_IOCTL_GET_STATUS", _IOC_READ, 0x4847, 0x20 },
+{ "sound/hdspm.h", "SNDRV_HDSPM_IOCTL_GET_VERSION", _IOC_READ, 0x4848, 0x24 },
+{ "sound/pcm.h", "SNDRV_PCM_IOCTL_STATUS32", _IOC_READ, 0x4120, 0x6c },
+{ "sound/pcm.h", "SNDRV_PCM_IOCTL_STATUS64", _IOC_READ, 0x4120, 0x98 },
+{ "sound/pcm.h", "SNDRV_PCM_IOCTL_STATUS_EXT32", _IOC_READ|_IOC_WRITE, 0x4124, 0x6c },
+{ "sound/pcm.h", "SNDRV_PCM_IOCTL_STATUS_EXT64", _IOC_READ|_IOC_WRITE, 0x4124, 0x98 },
+{ "sound/sb16_csp.h", "SNDRV_SB_CSP_IOCTL_INFO", _IOC_READ, 0x4810, 0x28 },
+{ "sound/sb16_csp.h", "SNDRV_SB_CSP_IOCTL_LOAD_CODE", _IOC_WRITE, 0x4811, 0x3012 },
+{ "sound/sb16_csp.h", "SNDRV_SB_CSP_IOCTL_PAUSE", _IOC_NONE, 0x4815, 0x00 },
+{ "sound/sb16_csp.h", "SNDRV_SB_CSP_IOCTL_RESTART", _IOC_NONE, 0x4816, 0x00 },
+{ "sound/sb16_csp.h", "SNDRV_SB_CSP_IOCTL_START", _IOC_WRITE, 0x4813, 0x08 },
+{ "sound/sb16_csp.h", "SNDRV_SB_CSP_IOCTL_STOP", _IOC_NONE, 0x4814, 0x00 },
+{ "sound/sb16_csp.h", "SNDRV_SB_CSP_IOCTL_UNLOAD_CODE", _IOC_NONE, 0x4812, 0x00 },
+{ "sound/sfnt_info.h", "SNDRV_EMUX_IOCTL_LOAD_PATCH", _IOC_READ|_IOC_WRITE, 0x4881, 0x10 },
+{ "sound/sfnt_info.h", "SNDRV_EMUX_IOCTL_MEM_AVAIL", _IOC_WRITE, 0x4884, 0x04 },
+{ "sound/sfnt_info.h", "SNDRV_EMUX_IOCTL_MISC_MODE", _IOC_READ|_IOC_WRITE, 0x4884, 0x10 },
+{ "sound/sfnt_info.h", "SNDRV_EMUX_IOCTL_REMOVE_LAST_SAMPLES", _IOC_NONE, 0x4883, 0x00 },
+{ "sound/sfnt_info.h", "SNDRV_EMUX_IOCTL_RESET_SAMPLES", _IOC_NONE, 0x4882, 0x00 },
+{ "sound/sfnt_info.h", "SNDRV_EMUX_IOCTL_VERSION", _IOC_READ, 0x4880, 0x04 },
+{ "sound/usb_stream.h", "SNDRV_USB_STREAM_IOCTL_SET_PARAMS", _IOC_WRITE, 0x4890, 0x10 },
+{ "staging/android/ashmem.h", "ASHMEM_GET_NAME", _IOC_READ, 0x7702, 0x100 },
+{ "staging/android/ashmem.h", "ASHMEM_GET_PIN_STATUS", _IOC_NONE, 0x7709, 0x00 },
+{ "staging/android/ashmem.h", "ASHMEM_GET_PROT_MASK", _IOC_NONE, 0x7706, 0x00 },
+{ "staging/android/ashmem.h", "ASHMEM_GET_SIZE", _IOC_NONE, 0x7704, 0x00 },
+{ "staging/android/ashmem.h", "ASHMEM_PIN", _IOC_WRITE, 0x7707, 0x08 },
+{ "staging/android/ashmem.h", "ASHMEM_PURGE_ALL_CACHES", _IOC_NONE, 0x770a, 0x00 },
+{ "staging/android/ashmem.h", "ASHMEM_SET_NAME", _IOC_WRITE, 0x7701, 0x100 },
+{ "staging/android/ashmem.h", "ASHMEM_SET_PROT_MASK", _IOC_WRITE, 0x7705, 0x08 },
+{ "staging/android/ashmem.h", "ASHMEM_SET_SIZE", _IOC_WRITE, 0x7703, 0x08 },
+{ "staging/android/ashmem.h", "ASHMEM_UNPIN", _IOC_WRITE, 0x7708, 0x08 },
+{ "staging/android/ion.h", "ION_IOC_ALLOC", _IOC_READ|_IOC_WRITE, 0x4900, 0x18 },
+{ "staging/android/ion.h", "ION_IOC_HEAP_QUERY", _IOC_READ|_IOC_WRITE, 0x4908, 0x18 },
+{ "video/da8xx-fb.h", "FBIGET_BRIGHTNESS", _IOC_READ, 0x4603, 0x04 },
+{ "video/da8xx-fb.h", "FBIGET_COLOR", _IOC_READ, 0x4605, 0x04 },
+{ "video/da8xx-fb.h", "FBIOGET_CONTRAST", _IOC_READ, 0x4601, 0x04 },
+{ "video/da8xx-fb.h", "FBIOPUT_CONTRAST", _IOC_WRITE, 0x4602, 0x04 },
+{ "video/da8xx-fb.h", "FBIPUT_BRIGHTNESS", _IOC_WRITE, 0x4603, 0x04 },
+{ "video/da8xx-fb.h", "FBIPUT_COLOR", _IOC_WRITE, 0x4606, 0x04 },
+{ "video/da8xx-fb.h", "FBIPUT_HSYNC", _IOC_WRITE, 0x4609, 0x04 },
+{ "video/da8xx-fb.h", "FBIPUT_VSYNC", _IOC_WRITE, 0x460a, 0x04 },
+{ "video/kyro.h", "KYRO_IOCTL_OVERLAY_CREATE", _IOC_NONE, 0x6b00, 0x00 },
+{ "video/kyro.h", "KYRO_IOCTL_OVERLAY_OFFSET", _IOC_NONE, 0x6b04, 0x00 },
+{ "video/kyro.h", "KYRO_IOCTL_OVERLAY_VIEWPORT_SET", _IOC_NONE, 0x6b01, 0x00 },
+{ "video/kyro.h", "KYRO_IOCTL_SET_VIDEO_MODE", _IOC_NONE, 0x6b02, 0x00 },
+{ "video/kyro.h", "KYRO_IOCTL_STRIDE", _IOC_NONE, 0x6b05, 0x00 },
+{ "video/kyro.h", "KYRO_IOCTL_UVSTRIDE", _IOC_NONE, 0x6b03, 0x00 },
+{ "video/sisfb.h", "SISFB_COMMAND", _IOC_READ|_IOC_WRITE, 0xf305, 0x54 },
+{ "video/sisfb.h", "SISFB_GET_AUTOMAXIMIZE", _IOC_READ, 0xf303, 0x04 },
+{ "video/sisfb.h", "SISFB_GET_AUTOMAXIMIZE_OLD", _IOC_READ, 0x6efa, 0x04 },
+{ "video/sisfb.h", "SISFB_GET_INFO", _IOC_READ, 0xf301, 0x11c },
+{ "video/sisfb.h", "SISFB_GET_INFO_OLD", _IOC_READ, 0x6ef8, 0x04 },
+{ "video/sisfb.h", "SISFB_GET_INFO_SIZE", _IOC_READ, 0xf300, 0x04 },
+{ "video/sisfb.h", "SISFB_GET_TVPOSOFFSET", _IOC_READ, 0xf304, 0x04 },
+{ "video/sisfb.h", "SISFB_GET_VBRSTATUS", _IOC_READ, 0xf302, 0x04 },
+{ "video/sisfb.h", "SISFB_GET_VBRSTATUS_OLD", _IOC_READ, 0x6ef9, 0x04 },
+{ "video/sisfb.h", "SISFB_SET_AUTOMAXIMIZE", _IOC_WRITE, 0xf303, 0x04 },
+{ "video/sisfb.h", "SISFB_SET_AUTOMAXIMIZE_OLD", _IOC_WRITE, 0x6efa, 0x04 },
+{ "video/sisfb.h", "SISFB_SET_LOCK", _IOC_WRITE, 0xf306, 0x04 },
+{ "video/sisfb.h", "SISFB_SET_TVPOSOFFSET", _IOC_WRITE, 0xf304, 0x04 },
+{ "video/sstfb.h", "SSTFB_GET_VGAPASS", _IOC_READ, 0x46dd, 0x04 },
+{ "video/sstfb.h", "SSTFB_SET_VGAPASS", _IOC_WRITE, 0x46dd, 0x04 },
+{ "xen/evtchn.h", "IOCTL_EVTCHN_BIND_INTERDOMAIN", _IOC_NONE, 0x4501, 0x08 },
+{ "xen/evtchn.h", "IOCTL_EVTCHN_BIND_UNBOUND_PORT", _IOC_NONE, 0x4502, 0x04 },
+{ "xen/evtchn.h", "IOCTL_EVTCHN_BIND_VIRQ", _IOC_NONE, 0x4500, 0x04 },
+{ "xen/evtchn.h", "IOCTL_EVTCHN_NOTIFY", _IOC_NONE, 0x4504, 0x04 },
+{ "xen/evtchn.h", "IOCTL_EVTCHN_RESET", _IOC_NONE, 0x4505, 0x00 },
+{ "xen/evtchn.h", "IOCTL_EVTCHN_RESTRICT_DOMID", _IOC_NONE, 0x4506, 0x02 },
+{ "xen/evtchn.h", "IOCTL_EVTCHN_UNBIND", _IOC_NONE, 0x4503, 0x04 },
+{ "xen/gntdev.h", "IOCTL_GNTDEV_DMABUF_EXP_FROM_REFS", _IOC_NONE, 0x4709, 0x14 },
+{ "xen/gntdev.h", "IOCTL_GNTDEV_DMABUF_EXP_WAIT_RELEASED", _IOC_NONE, 0x470a, 0x08 },
+{ "xen/gntdev.h", "IOCTL_GNTDEV_DMABUF_IMP_RELEASE", _IOC_NONE, 0x470c, 0x08 },
+{ "xen/gntdev.h", "IOCTL_GNTDEV_DMABUF_IMP_TO_REFS", _IOC_NONE, 0x470b, 0x14 },
+{ "xen/gntdev.h", "IOCTL_GNTDEV_GET_OFFSET_FOR_VADDR", _IOC_NONE, 0x4702, 0x18 },
+{ "xen/gntdev.h", "IOCTL_GNTDEV_GRANT_COPY", _IOC_NONE, 0x4708, 0x10 },
+{ "xen/gntdev.h", "IOCTL_GNTDEV_MAP_GRANT_REF", _IOC_NONE, 0x4700, 0x18 },
+{ "xen/gntdev.h", "IOCTL_GNTDEV_SET_MAX_GRANTS", _IOC_NONE, 0x4703, 0x04 },
+{ "xen/gntdev.h", "IOCTL_GNTDEV_SET_UNMAP_NOTIFY", _IOC_NONE, 0x4707, 0x10 },
+{ "xen/gntdev.h", "IOCTL_GNTDEV_UNMAP_GRANT_REF", _IOC_NONE, 0x4701, 0x10 },
+{ "xen/xenbus_dev.h", "IOCTL_XENBUS_BACKEND_EVTCHN", _IOC_NONE, 0x4200, 0x00 },
+{ "xen/xenbus_dev.h", "IOCTL_XENBUS_BACKEND_SETUP", _IOC_NONE, 0x4201, 0x00 },
diff --git a/src/linux/64/syscallent.h b/src/linux/64/syscallent.h
new file mode 100644
index 000000000..e73cecddc
--- /dev/null
+++ b/src/linux/64/syscallent.h
@@ -0,0 +1,289 @@
+/*
+ * Copyright (c) 2015-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+[ 0] = { 2, TM, SEN(io_setup), "io_setup" },
+[ 1] = { 1, TM, SEN(io_destroy), "io_destroy" },
+[ 2] = { 3, 0, SEN(io_submit), "io_submit" },
+[ 3] = { 3, 0, SEN(io_cancel), "io_cancel" },
+[ 4] = { 5, 0, SEN(io_getevents_time64), "io_getevents" },
+[ 5] = { 5, TF, SEN(setxattr), "setxattr" },
+[ 6] = { 5, TF, SEN(setxattr), "lsetxattr" },
+[ 7] = { 5, TD, SEN(fsetxattr), "fsetxattr" },
+[ 8] = { 4, TF, SEN(getxattr), "getxattr" },
+[ 9] = { 4, TF, SEN(getxattr), "lgetxattr" },
+[ 10] = { 4, TD, SEN(fgetxattr), "fgetxattr" },
+[ 11] = { 3, TF, SEN(listxattr), "listxattr" },
+[ 12] = { 3, TF, SEN(listxattr), "llistxattr" },
+[ 13] = { 3, TD, SEN(flistxattr), "flistxattr" },
+[ 14] = { 2, TF, SEN(removexattr), "removexattr" },
+[ 15] = { 2, TF, SEN(removexattr), "lremovexattr" },
+[ 16] = { 2, TD, SEN(fremovexattr), "fremovexattr" },
+[ 17] = { 2, TF, SEN(getcwd), "getcwd" },
+[ 18] = { 3, 0, SEN(lookup_dcookie), "lookup_dcookie" },
+[ 19] = { 2, TD, SEN(eventfd2), "eventfd2" },
+[ 20] = { 1, TD, SEN(epoll_create1), "epoll_create1" },
+[ 21] = { 4, TD, SEN(epoll_ctl), "epoll_ctl" },
+[ 22] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" },
+[ 23] = { 1, TD, SEN(dup), "dup" },
+[ 24] = { 3, TD, SEN(dup3), "dup3" },
+[ 25] = { 3, TD, SEN(fcntl), "fcntl" },
+[ 26] = { 1, TD, SEN(inotify_init1), "inotify_init1" },
+[ 27] = { 3, TD|TF, SEN(inotify_add_watch), "inotify_add_watch" },
+[ 28] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" },
+[ 29] = { 3, TD, SEN(ioctl), "ioctl" },
+[ 30] = { 3, 0, SEN(ioprio_set), "ioprio_set" },
+[ 31] = { 2, 0, SEN(ioprio_get), "ioprio_get" },
+[ 32] = { 2, TD, SEN(flock), "flock" },
+[ 33] = { 4, TD|TF, SEN(mknodat), "mknodat" },
+[ 34] = { 3, TD|TF, SEN(mkdirat), "mkdirat" },
+[ 35] = { 3, TD|TF, SEN(unlinkat), "unlinkat" },
+[ 36] = { 3, TD|TF, SEN(symlinkat), "symlinkat" },
+[ 37] = { 5, TD|TF, SEN(linkat), "linkat" },
+[ 38] = { 4, TD|TF, SEN(renameat), "renameat" },
+[ 39] = { 2, TF, SEN(umount2), "umount2" },
+[ 40] = { 5, TF, SEN(mount), "mount" },
+[ 41] = { 2, TF, SEN(pivotroot), "pivot_root" },
+[ 42] = { 3, 0, SEN(nfsservctl), "nfsservctl" },
+[ 43] = { 2, TF|TSF|TSFA, SEN(statfs), "statfs" },
+[ 44] = { 2, TD|TFSF|TSFA, SEN(fstatfs), "fstatfs" },
+[ 45] = { 2, TF, SEN(truncate), "truncate" },
+[ 46] = { 2, TD, SEN(ftruncate), "ftruncate" },
+[ 47] = { 4, TD, SEN(fallocate), "fallocate" },
+[ 48] = { 3, TD|TF, SEN(faccessat), "faccessat" },
+[ 49] = { 1, TF, SEN(chdir), "chdir" },
+[ 50] = { 1, TD, SEN(fchdir), "fchdir" },
+[ 51] = { 1, TF, SEN(chroot), "chroot" },
+[ 52] = { 2, TD, SEN(fchmod), "fchmod" },
+[ 53] = { 3, TD|TF, SEN(fchmodat), "fchmodat" },
+[ 54] = { 5, TD|TF, SEN(fchownat), "fchownat" },
+[ 55] = { 3, TD, SEN(fchown), "fchown" },
+[ 56] = { 4, TD|TF, SEN(openat), "openat" },
+[ 57] = { 1, TD, SEN(close), "close" },
+[ 58] = { 0, 0, SEN(vhangup), "vhangup" },
+[ 59] = { 2, TD, SEN(pipe2), "pipe2" },
+[ 60] = { 4, TF, SEN(quotactl), "quotactl" },
+[ 61] = { 3, TD, SEN(getdents64), "getdents64" },
+[ 62] = { 3, TD, SEN(lseek), "lseek" },
+[ 63] = { 3, TD, SEN(read), "read" },
+[ 64] = { 3, TD, SEN(write), "write" },
+[ 65] = { 3, TD, SEN(readv), "readv" },
+[ 66] = { 3, TD, SEN(writev), "writev" },
+[ 67] = { 4, TD, SEN(pread), "pread64" },
+[ 68] = { 4, TD, SEN(pwrite), "pwrite64" },
+[ 69] = { 4, TD, SEN(preadv), "preadv" },
+[ 70] = { 4, TD, SEN(pwritev), "pwritev" },
+[ 71] = { 4, TD|TN, SEN(sendfile64), "sendfile" },
+[ 72] = { 6, TD, SEN(pselect6_time64), "pselect6" },
+[ 73] = { 5, TD, SEN(ppoll_time64), "ppoll" },
+[ 74] = { 4, TD|TS, SEN(signalfd4), "signalfd4" },
+[ 75] = { 4, TD, SEN(vmsplice), "vmsplice" },
+[ 76] = { 6, TD, SEN(splice), "splice" },
+[ 77] = { 4, TD, SEN(tee), "tee" },
+[ 78] = { 4, TD|TF, SEN(readlinkat), "readlinkat" },
+[ 79] = { 4, TD|TF|TFST|TSTA,SEN(newfstatat), "newfstatat" },
+[ 80] = { 2, TD|TFST|TSTA, SEN(fstat), "fstat" },
+[ 81] = { 0, 0, SEN(sync), "sync" },
+[ 82] = { 1, TD, SEN(fsync), "fsync" },
+[ 83] = { 1, TD, SEN(fdatasync), "fdatasync" },
+[ 84] = { 4, TD, SEN(sync_file_range), "sync_file_range" },
+[ 85] = { 2, TD, SEN(timerfd_create), "timerfd_create" },
+[ 86] = { 4, TD, SEN(timerfd_settime64), "timerfd_settime" },
+[ 87] = { 2, TD, SEN(timerfd_gettime64), "timerfd_gettime" },
+[ 88] = { 4, TD|TF, SEN(utimensat_time64), "utimensat" },
+[ 89] = { 1, TF, SEN(acct), "acct" },
+[ 90] = { 2, TC, SEN(capget), "capget" },
+[ 91] = { 2, TC, SEN(capset), "capset" },
+[ 92] = { 1, NF, SEN(personality), "personality" },
+[ 93] = { 1, TP|SE, SEN(exit), "exit" },
+[ 94] = { 1, TP|SE, SEN(exit), "exit_group" },
+[ 95] = { 5, TP, SEN(waitid), "waitid" },
+[ 96] = { 1, 0, SEN(set_tid_address), "set_tid_address" },
+[ 97] = { 1, 0, SEN(unshare), "unshare" },
+[ 98] = { 6, 0, SEN(futex_time64), "futex" },
+[ 99] = { 2, 0, SEN(set_robust_list), "set_robust_list" },
+[100] = { 3, 0, SEN(get_robust_list), "get_robust_list" },
+[101] = { 2, 0, SEN(nanosleep_time64), "nanosleep" },
+[102] = { 2, 0, SEN(getitimer), "getitimer" },
+[103] = { 3, 0, SEN(setitimer), "setitimer" },
+[104] = { 4, 0, SEN(kexec_load), "kexec_load" },
+[105] = { 3, 0, SEN(init_module), "init_module" },
+[106] = { 2, 0, SEN(delete_module), "delete_module" },
+[107] = { 3, 0, SEN(timer_create), "timer_create" },
+[108] = { 2, 0, SEN(timer_gettime64), "timer_gettime" },
+[109] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" },
+[110] = { 4, 0, SEN(timer_settime64), "timer_settime" },
+[111] = { 1, 0, SEN(timer_delete), "timer_delete" },
+[112] = { 2, TCL, SEN(clock_settime64), "clock_settime" },
+[113] = { 2, TCL, SEN(clock_gettime64), "clock_gettime" },
+[114] = { 2, TCL, SEN(clock_getres_time64), "clock_getres" },
+[115] = { 4, 0, SEN(clock_nanosleep_time64), "clock_nanosleep" },
+[116] = { 3, 0, SEN(syslog), "syslog" },
+[117] = { 4, 0, SEN(ptrace), "ptrace" },
+[118] = { 2, 0, SEN(sched_setparam), "sched_setparam" },
+[119] = { 3, 0, SEN(sched_setscheduler), "sched_setscheduler" },
+[120] = { 1, 0, SEN(sched_getscheduler), "sched_getscheduler" },
+[121] = { 2, 0, SEN(sched_getparam), "sched_getparam" },
+[122] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" },
+[123] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" },
+[124] = { 0, 0, SEN(sched_yield), "sched_yield" },
+[125] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"},
+[126] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"},
+[127] = { 2, 0, SEN(sched_rr_get_interval_time64),"sched_rr_get_interval"},
+[128] = { 0, 0, SEN(restart_syscall), "restart_syscall" },
+[129] = { 2, TS|TP, SEN(kill), "kill" },
+[130] = { 2, TS|TP, SEN(tkill), "tkill" },
+[131] = { 3, TS|TP, SEN(tgkill), "tgkill" },
+[132] = { 2, TS, SEN(sigaltstack), "sigaltstack" },
+[133] = { 2, TS, SEN(rt_sigsuspend), "rt_sigsuspend" },
+[134] = { 4, TS, SEN(rt_sigaction), "rt_sigaction" },
+[135] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" },
+[136] = { 2, TS, SEN(rt_sigpending), "rt_sigpending" },
+[137] = { 4, TS, SEN(rt_sigtimedwait_time64), "rt_sigtimedwait" },
+[138] = { 3, TS|TP, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" },
+[139] = { 0, TS, SEN(rt_sigreturn), "rt_sigreturn" },
+[140] = { 3, 0, SEN(setpriority), "setpriority" },
+[141] = { 2, 0, SEN(getpriority), "getpriority" },
+[142] = { 4, 0, SEN(reboot), "reboot" },
+[143] = { 2, TC, SEN(setregid), "setregid" },
+[144] = { 1, TC, SEN(setgid), "setgid" },
+[145] = { 2, TC, SEN(setreuid), "setreuid" },
+[146] = { 1, TC, SEN(setuid), "setuid" },
+[147] = { 3, TC, SEN(setresuid), "setresuid" },
+[148] = { 3, TC, SEN(getresuid), "getresuid" },
+[149] = { 3, TC, SEN(setresgid), "setresgid" },
+[150] = { 3, TC, SEN(getresgid), "getresgid" },
+[151] = { 1, TC|NF, SEN(setfsuid), "setfsuid" },
+[152] = { 1, TC|NF, SEN(setfsgid), "setfsgid" },
+[153] = { 1, 0, SEN(times), "times" },
+[154] = { 2, 0, SEN(setpgid), "setpgid" },
+[155] = { 1, 0, SEN(getpgid), "getpgid" },
+[156] = { 1, 0, SEN(getsid), "getsid" },
+[157] = { 0, 0, SEN(setsid), "setsid" },
+[158] = { 2, TC, SEN(getgroups), "getgroups" },
+[159] = { 2, TC, SEN(setgroups), "setgroups" },
+[160] = { 1, 0, SEN(uname), "uname" },
+[161] = { 2, 0, SEN(sethostname), "sethostname" },
+[162] = { 2, 0, SEN(setdomainname), "setdomainname" },
+[163] = { 2, 0, SEN(getrlimit), "getrlimit" },
+[164] = { 2, 0, SEN(setrlimit), "setrlimit" },
+[165] = { 2, 0, SEN(getrusage), "getrusage" },
+[166] = { 1, NF, SEN(umask), "umask" },
+[167] = { 5, TC, SEN(prctl), "prctl" },
+[168] = { 3, 0, SEN(getcpu), "getcpu" },
+[169] = { 2, TCL, SEN(gettimeofday), "gettimeofday" },
+[170] = { 2, TCL, SEN(settimeofday), "settimeofday" },
+[171] = { 1, TCL, SEN(adjtimex64), "adjtimex" },
+[172] = { 0, PU|NF, SEN(getpid), "getpid" },
+[173] = { 0, PU|NF, SEN(getppid), "getppid" },
+[174] = { 0, TC|PU|NF, SEN(getuid), "getuid" },
+[175] = { 0, TC|PU|NF, SEN(geteuid), "geteuid" },
+[176] = { 0, TC|PU|NF, SEN(getgid), "getgid" },
+[177] = { 0, TC|PU|NF, SEN(getegid), "getegid" },
+[178] = { 0, PU|NF, SEN(gettid), "gettid" },
+[179] = { 1, 0, SEN(sysinfo), "sysinfo" },
+[180] = { 4, TD, SEN(mq_open), "mq_open" },
+[181] = { 1, 0, SEN(mq_unlink), "mq_unlink" },
+[182] = { 5, TD, SEN(mq_timedsend_time64), "mq_timedsend" },
+[183] = { 5, TD, SEN(mq_timedreceive_time64), "mq_timedreceive" },
+[184] = { 2, TD, SEN(mq_notify), "mq_notify" },
+[185] = { 3, TD, SEN(mq_getsetattr), "mq_getsetattr" },
+[186] = { 2, TI, SEN(msgget), "msgget" },
+[187] = { 3, TI, SEN(msgctl), "msgctl" },
+[188] = { 5, TI, SEN(msgrcv), "msgrcv" },
+[189] = { 4, TI, SEN(msgsnd), "msgsnd" },
+[190] = { 3, TI, SEN(semget), "semget" },
+[191] = { 4, TI, SEN(semctl), "semctl" },
+[192] = { 4, TI, SEN(semtimedop_time64), "semtimedop" },
+[193] = { 3, TI, SEN(semop), "semop" },
+[194] = { 3, TI, SEN(shmget), "shmget" },
+[195] = { 3, TI, SEN(shmctl), "shmctl" },
+[196] = { 3, TI|TM|SI, SEN(shmat), "shmat" },
+[197] = { 1, TI|TM|SI, SEN(shmdt), "shmdt" },
+[198] = { 3, TN, SEN(socket), "socket" },
+[199] = { 4, TN, SEN(socketpair), "socketpair" },
+[200] = { 3, TN, SEN(bind), "bind" },
+[201] = { 2, TN, SEN(listen), "listen" },
+[202] = { 3, TN, SEN(accept), "accept" },
+[203] = { 3, TN, SEN(connect), "connect" },
+[204] = { 3, TN, SEN(getsockname), "getsockname" },
+[205] = { 3, TN, SEN(getpeername), "getpeername" },
+[206] = { 6, TN, SEN(sendto), "sendto" },
+[207] = { 6, TN, SEN(recvfrom), "recvfrom" },
+[208] = { 5, TN, SEN(setsockopt), "setsockopt" },
+[209] = { 5, TN, SEN(getsockopt), "getsockopt" },
+[210] = { 2, TN, SEN(shutdown), "shutdown" },
+[211] = { 3, TN, SEN(sendmsg), "sendmsg" },
+[212] = { 3, TN, SEN(recvmsg), "recvmsg" },
+[213] = { 3, TD, SEN(readahead), "readahead" },
+[214] = { 1, TM|SI, SEN(brk), "brk" },
+[215] = { 2, TM|SI, SEN(munmap), "munmap" },
+[216] = { 5, TM|SI, SEN(mremap), "mremap" },
+[217] = { 5, 0, SEN(add_key), "add_key" },
+[218] = { 4, 0, SEN(request_key), "request_key" },
+[219] = { 5, 0, SEN(keyctl), "keyctl" },
+[220] = { 5, TP, SEN(clone), "clone" },
+[221] = { 3, TF|TP|TSD|SE|SI, SEN(execve), "execve" },
+[222] = { 6, TD|TM|SI, SEN(mmap), "mmap" },
+[223] = { 4, TD, SEN(fadvise64), "fadvise64" },
+[224] = { 2, TF, SEN(swapon), "swapon" },
+[225] = { 1, TF, SEN(swapoff), "swapoff" },
+[226] = { 3, TM|SI, SEN(mprotect), "mprotect" },
+[227] = { 3, TM, SEN(msync), "msync" },
+[228] = { 2, TM, SEN(mlock), "mlock" },
+[229] = { 2, TM, SEN(munlock), "munlock" },
+[230] = { 1, TM, SEN(mlockall), "mlockall" },
+[231] = { 0, TM, SEN(munlockall), "munlockall" },
+[232] = { 3, TM, SEN(mincore), "mincore" },
+[233] = { 3, TM, SEN(madvise), "madvise" },
+[234] = { 5, TM|SI, SEN(remap_file_pages), "remap_file_pages" },
+[235] = { 6, TM, SEN(mbind), "mbind" },
+[236] = { 5, TM, SEN(get_mempolicy), "get_mempolicy" },
+[237] = { 3, TM, SEN(set_mempolicy), "set_mempolicy" },
+[238] = { 4, TM, SEN(migrate_pages), "migrate_pages" },
+[239] = { 6, TM, SEN(move_pages), "move_pages" },
+[240] = { 4, TP|TS, SEN(rt_tgsigqueueinfo), "rt_tgsigqueueinfo" },
+[241] = { 5, TD, SEN(perf_event_open), "perf_event_open" },
+[242] = { 4, TN, SEN(accept4), "accept4" },
+[243] = { 5, TN, SEN(recvmmsg_time64), "recvmmsg" },
+/* [244 ... 259] are arch specific */
+[260] = { 4, TP, SEN(wait4), "wait4" },
+[261] = { 4, 0, SEN(prlimit64), "prlimit64" },
+[262] = { 2, TD, SEN(fanotify_init), "fanotify_init" },
+[263] = { 5, TD|TF, SEN(fanotify_mark), "fanotify_mark" },
+[264] = { 5, TD|TF, SEN(name_to_handle_at), "name_to_handle_at" },
+[265] = { 3, TD, SEN(open_by_handle_at), "open_by_handle_at" },
+[266] = { 2, TCL, SEN(clock_adjtime64), "clock_adjtime" },
+[267] = { 1, TD, SEN(syncfs), "syncfs" },
+[268] = { 2, TD, SEN(setns), "setns" },
+[269] = { 4, TN, SEN(sendmmsg), "sendmmsg" },
+[270] = { 6, 0, SEN(process_vm_readv), "process_vm_readv" },
+[271] = { 6, 0, SEN(process_vm_writev), "process_vm_writev" },
+[272] = { 5, 0, SEN(kcmp), "kcmp" },
+[273] = { 3, TD, SEN(finit_module), "finit_module" },
+[274] = { 3, 0, SEN(sched_setattr), "sched_setattr" },
+[275] = { 4, 0, SEN(sched_getattr), "sched_getattr" },
+[276] = { 5, TD|TF, SEN(renameat2), "renameat2" },
+[277] = { 3, 0, SEN(seccomp), "seccomp" },
+[278] = { 3, 0, SEN(getrandom), "getrandom" },
+[279] = { 2, TD, SEN(memfd_create), "memfd_create" },
+[280] = { 3, TD, SEN(bpf), "bpf" },
+[281] = { 5, TD|TF|TP|TSD|SE|SI, SEN(execveat), "execveat" },
+[282] = { 1, TD, SEN(userfaultfd), "userfaultfd" },
+[283] = { 3, 0, SEN(membarrier), "membarrier" },
+[284] = { 3, TM, SEN(mlock2), "mlock2" },
+[285] = { 6, TD, SEN(copy_file_range), "copy_file_range" },
+[286] = { 6, TD, SEN(preadv2), "preadv2" },
+[287] = { 6, TD, SEN(pwritev2), "pwritev2" },
+[288] = { 4, TM|SI, SEN(pkey_mprotect), "pkey_mprotect" },
+[289] = { 2, 0, SEN(pkey_alloc), "pkey_alloc" },
+[290] = { 1, 0, SEN(pkey_free), "pkey_free" },
+[291] = { 5, TD|TF|TFST|TSTA,SEN(statx), "statx" },
+[292] = { 6, 0, SEN(io_pgetevents_time64), "io_pgetevents" },
+[293] = { 4, 0, SEN(rseq), "rseq" },
+[294] = { 5, TD, SEN(kexec_file_load), "kexec_file_load" },
+/* [295 ... 423] - reserved to sync up with other architectures */
+#include "syscallent-common.h"
diff --git a/src/linux/aarch64/arch_defs_.h b/src/linux/aarch64/arch_defs_.h
new file mode 100644
index 000000000..fb75722f6
--- /dev/null
+++ b/src/linux/aarch64/arch_defs_.h
@@ -0,0 +1,13 @@
+/*
+ * Copyright (c) 2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#define HAVE_ARCH_OLD_MMAP 1
+#define HAVE_ARCH_OLD_SELECT 1
+#define HAVE_ARCH_UID16_SYSCALLS 1
+#define SUPPORTED_PERSONALITIES 2
+#define PERSONALITY0_AUDIT_ARCH { AUDIT_ARCH_AARCH64, 0 }
+#define PERSONALITY1_AUDIT_ARCH { AUDIT_ARCH_ARM, 0 }
diff --git a/src/linux/aarch64/arch_get_personality.c b/src/linux/aarch64/arch_get_personality.c
new file mode 100644
index 000000000..4cf0cb1e8
--- /dev/null
+++ b/src/linux/aarch64/arch_get_personality.c
@@ -0,0 +1,13 @@
+/*
+ * Copyright (c) 2018 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2018-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+int
+get_personality_from_syscall_info(const struct_ptrace_syscall_info *sci)
+{
+ return sci->arch == AUDIT_ARCH_ARM;
+}
diff --git a/src/linux/aarch64/arch_regs.c b/src/linux/aarch64/arch_regs.c
new file mode 100644
index 000000000..f88067dbe
--- /dev/null
+++ b/src/linux/aarch64/arch_regs.c
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+struct arm_pt_regs {
+ uint32_t uregs[18];
+};
+#define ARM_cpsr uregs[16]
+#define ARM_pc uregs[15]
+#define ARM_lr uregs[14]
+#define ARM_sp uregs[13]
+#define ARM_ip uregs[12]
+#define ARM_fp uregs[11]
+#define ARM_r10 uregs[10]
+#define ARM_r9 uregs[9]
+#define ARM_r8 uregs[8]
+#define ARM_r7 uregs[7]
+#define ARM_r6 uregs[6]
+#define ARM_r5 uregs[5]
+#define ARM_r4 uregs[4]
+#define ARM_r3 uregs[3]
+#define ARM_r2 uregs[2]
+#define ARM_r1 uregs[1]
+#define ARM_r0 uregs[0]
+#define ARM_ORIG_r0 uregs[17]
+
+static union {
+ struct user_pt_regs aarch64_r;
+ struct arm_pt_regs arm_r;
+} arm_regs_union;
+#define aarch64_regs arm_regs_union.aarch64_r
+#define arm_regs arm_regs_union.arm_r
+
+static struct iovec aarch64_io = {
+ .iov_base = &arm_regs_union
+};
+
+#define ARCH_REGS_FOR_GETREGSET arm_regs_union
+#define ARCH_IOVEC_FOR_GETREGSET aarch64_io
+#define ARCH_PC_REG \
+ ((aarch64_io.iov_len == sizeof(arm_regs)) ? arm_regs.ARM_pc : aarch64_regs.pc)
+#define ARCH_SP_REG \
+ ((aarch64_io.iov_len == sizeof(arm_regs)) ? arm_regs.ARM_sp : aarch64_regs.sp)
+
+#define ARCH_PERSONALITY_0_IOV_SIZE sizeof(aarch64_regs)
+#define ARCH_PERSONALITY_1_IOV_SIZE sizeof(arm_regs)
diff --git a/src/linux/aarch64/arch_sigreturn.c b/src/linux/aarch64/arch_sigreturn.c
new file mode 100644
index 000000000..f0e29c26c
--- /dev/null
+++ b/src/linux/aarch64/arch_sigreturn.c
@@ -0,0 +1 @@
+#include "arm/arch_sigreturn.c"
diff --git a/src/linux/aarch64/get_error.c b/src/linux/aarch64/get_error.c
new file mode 100644
index 000000000..38856a978
--- /dev/null
+++ b/src/linux/aarch64/get_error.c
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "negated_errno.h"
+
+#define arch_get_error arm_get_error
+#include "arm/get_error.c"
+#undef arch_get_error
+
+static void
+arch_get_error(struct tcb *tcp, const bool check_errno)
+{
+ if (tcp->currpers == 1) {
+ arm_get_error(tcp, check_errno);
+ return;
+ }
+
+ if (check_errno && is_negated_errno(aarch64_regs.regs[0])) {
+ tcp->u_rval = -1;
+ tcp->u_error = -aarch64_regs.regs[0];
+ } else {
+ tcp->u_rval = aarch64_regs.regs[0];
+ }
+}
diff --git a/src/linux/aarch64/get_scno.c b/src/linux/aarch64/get_scno.c
new file mode 100644
index 000000000..af758aeee
--- /dev/null
+++ b/src/linux/aarch64/get_scno.c
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+/* Return codes: 1 - ok, 0 - ignore, other - error. */
+static int
+arch_get_scno(struct tcb *tcp)
+{
+ kernel_ulong_t scno = 0;
+
+ switch (aarch64_io.iov_len) {
+ case sizeof(aarch64_regs):
+ /* We are in 64-bit mode */
+ scno = aarch64_regs.regs[8];
+ break;
+ case sizeof(arm_regs):
+ /* We are in 32-bit mode */
+ /* Note: we don't support OABI, unlike 32-bit ARM build */
+ scno = arm_regs.ARM_r7;
+ break;
+ }
+
+ tcp->scno = scno;
+ return 1;
+}
diff --git a/src/linux/aarch64/get_syscall_args.c b/src/linux/aarch64/get_syscall_args.c
new file mode 100644
index 000000000..fce96273a
--- /dev/null
+++ b/src/linux/aarch64/get_syscall_args.c
@@ -0,0 +1,25 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#define arch_get_syscall_args arm_get_syscall_args
+#include "arm/get_syscall_args.c"
+#undef arch_get_syscall_args
+
+/* Return -1 on error or 1 on success (never 0!). */
+static int
+arch_get_syscall_args(struct tcb *tcp)
+{
+ if (tcp->currpers == 1)
+ return arm_get_syscall_args(tcp);
+ tcp->u_arg[0] = aarch64_regs.regs[0];
+ tcp->u_arg[1] = aarch64_regs.regs[1];
+ tcp->u_arg[2] = aarch64_regs.regs[2];
+ tcp->u_arg[3] = aarch64_regs.regs[3];
+ tcp->u_arg[4] = aarch64_regs.regs[4];
+ tcp->u_arg[5] = aarch64_regs.regs[5];
+ return 1;
+}
diff --git a/src/linux/aarch64/ioctls_arch0.h b/src/linux/aarch64/ioctls_arch0.h
new file mode 100644
index 000000000..5b5121d9d
--- /dev/null
+++ b/src/linux/aarch64/ioctls_arch0.h
@@ -0,0 +1,74 @@
+/* Generated by ioctls_gen.sh from definitions found in $linux/arch/arm64/include/ tree. */
+{ "linux/kvm.h", "KVM_ARM_PREFERRED_TARGET", _IOC_READ, 0xaeaf, 0x20 },
+{ "linux/kvm.h", "KVM_ARM_SET_DEVICE_ADDR", _IOC_WRITE, 0xaeab, 0x10 },
+{ "linux/kvm.h", "KVM_ARM_VCPU_FINALIZE", _IOC_WRITE, 0xaec2, 0x04 },
+{ "linux/kvm.h", "KVM_ARM_VCPU_INIT", _IOC_WRITE, 0xaeae, 0x20 },
+{ "linux/kvm.h", "KVM_ASSIGN_DEV_IRQ", _IOC_WRITE, 0xae70, 0x40 },
+{ "linux/kvm.h", "KVM_ASSIGN_PCI_DEVICE", _IOC_READ, 0xae69, 0x40 },
+{ "linux/kvm.h", "KVM_ASSIGN_SET_INTX_MASK", _IOC_WRITE, 0xaea4, 0x40 },
+{ "linux/kvm.h", "KVM_ASSIGN_SET_MSIX_ENTRY", _IOC_WRITE, 0xae74, 0x10 },
+{ "linux/kvm.h", "KVM_ASSIGN_SET_MSIX_NR", _IOC_WRITE, 0xae73, 0x08 },
+{ "linux/kvm.h", "KVM_CHECK_EXTENSION", _IOC_NONE, 0xae03, 0x00 },
+{ "linux/kvm.h", "KVM_CLEAR_DIRTY_LOG", _IOC_READ|_IOC_WRITE, 0xaec0, 0x18 },
+{ "linux/kvm.h", "KVM_CREATE_DEVICE", _IOC_READ|_IOC_WRITE, 0xaee0, 0x0c },
+{ "linux/kvm.h", "KVM_CREATE_IRQCHIP", _IOC_NONE, 0xae60, 0x00 },
+{ "linux/kvm.h", "KVM_CREATE_PIT", _IOC_NONE, 0xae64, 0x00 },
+{ "linux/kvm.h", "KVM_CREATE_PIT2", _IOC_WRITE, 0xae77, 0x40 },
+{ "linux/kvm.h", "KVM_CREATE_VCPU", _IOC_NONE, 0xae41, 0x00 },
+{ "linux/kvm.h", "KVM_CREATE_VM", _IOC_NONE, 0xae01, 0x00 },
+{ "linux/kvm.h", "KVM_DEASSIGN_DEV_IRQ", _IOC_WRITE, 0xae75, 0x40 },
+{ "linux/kvm.h", "KVM_DEASSIGN_PCI_DEVICE", _IOC_WRITE, 0xae72, 0x40 },
+{ "linux/kvm.h", "KVM_DIRTY_TLB", _IOC_WRITE, 0xaeaa, 0x10 },
+{ "linux/kvm.h", "KVM_ENABLE_CAP", _IOC_WRITE, 0xaea3, 0x68 },
+{ "linux/kvm.h", "KVM_GET_API_VERSION", _IOC_NONE, 0xae00, 0x00 },
+{ "linux/kvm.h", "KVM_GET_CLOCK", _IOC_READ, 0xae7c, 0x30 },
+{ "linux/kvm.h", "KVM_GET_DEVICE_ATTR", _IOC_WRITE, 0xaee2, 0x18 },
+{ "linux/kvm.h", "KVM_GET_DIRTY_LOG", _IOC_WRITE, 0xae42, 0x10 },
+{ "linux/kvm.h", "KVM_GET_FPU", _IOC_READ, 0xae8c, 0x00 },
+{ "linux/kvm.h", "KVM_GET_IRQCHIP", _IOC_READ|_IOC_WRITE, 0xae62, 0x208 },
+{ "linux/kvm.h", "KVM_GET_MP_STATE", _IOC_READ, 0xae98, 0x04 },
+{ "linux/kvm.h", "KVM_GET_NR_MMU_PAGES", _IOC_NONE, 0xae45, 0x00 },
+{ "linux/kvm.h", "KVM_GET_ONE_REG", _IOC_WRITE, 0xaeab, 0x10 },
+{ "linux/kvm.h", "KVM_GET_REGS", _IOC_READ, 0xae81, 0x360 },
+{ "linux/kvm.h", "KVM_GET_REG_LIST", _IOC_READ|_IOC_WRITE, 0xaeb0, 0x08 },
+{ "linux/kvm.h", "KVM_GET_SREGS", _IOC_READ, 0xae83, 0x00 },
+{ "linux/kvm.h", "KVM_GET_TSC_KHZ", _IOC_NONE, 0xaea3, 0x00 },
+{ "linux/kvm.h", "KVM_GET_VCPU_MMAP_SIZE", _IOC_NONE, 0xae04, 0x00 },
+{ "linux/kvm.h", "KVM_HAS_DEVICE_ATTR", _IOC_WRITE, 0xaee3, 0x18 },
+{ "linux/kvm.h", "KVM_INTERRUPT", _IOC_WRITE, 0xae86, 0x04 },
+{ "linux/kvm.h", "KVM_IOEVENTFD", _IOC_WRITE, 0xae79, 0x40 },
+{ "linux/kvm.h", "KVM_IRQFD", _IOC_WRITE, 0xae76, 0x20 },
+{ "linux/kvm.h", "KVM_IRQ_LINE", _IOC_WRITE, 0xae61, 0x08 },
+{ "linux/kvm.h", "KVM_IRQ_LINE_STATUS", _IOC_READ|_IOC_WRITE, 0xae67, 0x08 },
+{ "linux/kvm.h", "KVM_KVMCLOCK_CTRL", _IOC_NONE, 0xaead, 0x00 },
+{ "linux/kvm.h", "KVM_MEMORY_ENCRYPT_OP", _IOC_READ|_IOC_WRITE, 0xaeba, 0x08 },
+{ "linux/kvm.h", "KVM_MEMORY_ENCRYPT_REG_REGION", _IOC_READ, 0xaebb, 0x10 },
+{ "linux/kvm.h", "KVM_MEMORY_ENCRYPT_UNREG_REGION", _IOC_READ, 0xaebc, 0x10 },
+{ "linux/kvm.h", "KVM_NMI", _IOC_NONE, 0xae9a, 0x00 },
+{ "linux/kvm.h", "KVM_REGISTER_COALESCED_MMIO", _IOC_WRITE, 0xae67, 0x10 },
+{ "linux/kvm.h", "KVM_REINJECT_CONTROL", _IOC_NONE, 0xae71, 0x00 },
+{ "linux/kvm.h", "KVM_RUN", _IOC_NONE, 0xae80, 0x00 },
+{ "linux/kvm.h", "KVM_SET_BOOT_CPU_ID", _IOC_NONE, 0xae78, 0x00 },
+{ "linux/kvm.h", "KVM_SET_CLOCK", _IOC_WRITE, 0xae7b, 0x30 },
+{ "linux/kvm.h", "KVM_SET_DEVICE_ATTR", _IOC_WRITE, 0xaee1, 0x18 },
+{ "linux/kvm.h", "KVM_SET_FPU", _IOC_WRITE, 0xae8d, 0x00 },
+{ "linux/kvm.h", "KVM_SET_GSI_ROUTING", _IOC_WRITE, 0xae6a, 0x08 },
+{ "linux/kvm.h", "KVM_SET_GUEST_DEBUG", _IOC_WRITE, 0xae9b, 0x208 },
+{ "linux/kvm.h", "KVM_SET_IDENTITY_MAP_ADDR", _IOC_WRITE, 0xae48, 0x08 },
+{ "linux/kvm.h", "KVM_SET_IRQCHIP", _IOC_READ, 0xae63, 0x208 },
+{ "linux/kvm.h", "KVM_SET_MEMORY_REGION", _IOC_WRITE, 0xae40, 0x18 },
+{ "linux/kvm.h", "KVM_SET_MP_STATE", _IOC_WRITE, 0xae99, 0x04 },
+{ "linux/kvm.h", "KVM_SET_NR_MMU_PAGES", _IOC_NONE, 0xae44, 0x00 },
+{ "linux/kvm.h", "KVM_SET_ONE_REG", _IOC_WRITE, 0xaeac, 0x10 },
+{ "linux/kvm.h", "KVM_SET_REGS", _IOC_WRITE, 0xae82, 0x360 },
+{ "linux/kvm.h", "KVM_SET_SIGNAL_MASK", _IOC_WRITE, 0xae8b, 0x04 },
+{ "linux/kvm.h", "KVM_SET_SREGS", _IOC_WRITE, 0xae84, 0x00 },
+{ "linux/kvm.h", "KVM_SET_TSC_KHZ", _IOC_NONE, 0xaea2, 0x00 },
+{ "linux/kvm.h", "KVM_SET_TSS_ADDR", _IOC_NONE, 0xae47, 0x00 },
+{ "linux/kvm.h", "KVM_SET_USER_MEMORY_REGION", _IOC_WRITE, 0xae46, 0x20 },
+{ "linux/kvm.h", "KVM_SET_VAPIC_ADDR", _IOC_WRITE, 0xae93, 0x08 },
+{ "linux/kvm.h", "KVM_SIGNAL_MSI", _IOC_WRITE, 0xaea5, 0x20 },
+{ "linux/kvm.h", "KVM_SMI", _IOC_NONE, 0xaeb7, 0x00 },
+{ "linux/kvm.h", "KVM_TPR_ACCESS_REPORTING", _IOC_READ|_IOC_WRITE, 0xae92, 0x28 },
+{ "linux/kvm.h", "KVM_TRANSLATE", _IOC_READ|_IOC_WRITE, 0xae85, 0x18 },
+{ "linux/kvm.h", "KVM_UNREGISTER_COALESCED_MMIO", _IOC_WRITE, 0xae68, 0x10 },
diff --git a/src/linux/aarch64/ioctls_arch1.h b/src/linux/aarch64/ioctls_arch1.h
new file mode 100644
index 000000000..b722d22b4
--- /dev/null
+++ b/src/linux/aarch64/ioctls_arch1.h
@@ -0,0 +1 @@
+#include "arm/ioctls_arch0.h"
diff --git a/src/linux/aarch64/ioctls_inc0.h b/src/linux/aarch64/ioctls_inc0.h
new file mode 100644
index 000000000..f9939faa4
--- /dev/null
+++ b/src/linux/aarch64/ioctls_inc0.h
@@ -0,0 +1 @@
+#include "64/ioctls_inc.h"
diff --git a/src/linux/aarch64/ioctls_inc1.h b/src/linux/aarch64/ioctls_inc1.h
new file mode 100644
index 000000000..46c11b11f
--- /dev/null
+++ b/src/linux/aarch64/ioctls_inc1.h
@@ -0,0 +1 @@
+#include "arm/ioctls_inc0.h"
diff --git a/src/linux/aarch64/nr_prefix.c b/src/linux/aarch64/nr_prefix.c
new file mode 100644
index 000000000..49fe77ae6
--- /dev/null
+++ b/src/linux/aarch64/nr_prefix.c
@@ -0,0 +1 @@
+#include "../arm/nr_prefix.c"
diff --git a/src/linux/aarch64/raw_syscall.h b/src/linux/aarch64/raw_syscall.h
new file mode 100644
index 000000000..aa27e1d5f
--- /dev/null
+++ b/src/linux/aarch64/raw_syscall.h
@@ -0,0 +1,29 @@
+/*
+ * Raw syscalls.
+ *
+ * Copyright (c) 2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_RAW_SYSCALL_H
+# define STRACE_RAW_SYSCALL_H
+
+# include "kernel_types.h"
+
+static inline kernel_ulong_t
+raw_syscall_0(const kernel_ulong_t nr, kernel_ulong_t *err)
+{
+ *err = 0;
+ register kernel_ulong_t x8 __asm__("x8") = nr;
+ register kernel_ulong_t x0 __asm__("x0");
+ __asm__ __volatile__("svc 0"
+ : "=r"(x0)
+ : "r"(x8)
+ : "memory");
+ return x0;
+}
+# define raw_syscall_0 raw_syscall_0
+
+#endif /* !STRACE_RAW_SYSCALL_H */
diff --git a/src/linux/aarch64/set_error.c b/src/linux/aarch64/set_error.c
new file mode 100644
index 000000000..bb04450d6
--- /dev/null
+++ b/src/linux/aarch64/set_error.c
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2016-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#define arch_set_error arm_set_error
+#define arch_set_success arm_set_success
+#include "arm/set_error.c"
+#undef arch_set_success
+#undef arch_set_error
+
+static int
+arch_set_error(struct tcb *tcp)
+{
+ if (aarch64_io.iov_len == sizeof(arm_regs))
+ return arm_set_error(tcp);
+
+ aarch64_regs.regs[0] = -tcp->u_error;
+ return set_regs(tcp->pid);
+}
+
+static int
+arch_set_success(struct tcb *tcp)
+{
+ if (aarch64_io.iov_len == sizeof(arm_regs))
+ return arm_set_success(tcp);
+
+ aarch64_regs.regs[0] = tcp->u_rval;
+ return set_regs(tcp->pid);
+}
diff --git a/src/linux/aarch64/set_scno.c b/src/linux/aarch64/set_scno.c
new file mode 100644
index 000000000..668a7570d
--- /dev/null
+++ b/src/linux/aarch64/set_scno.c
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2016-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef NT_ARM_SYSTEM_CALL
+# define NT_ARM_SYSTEM_CALL 0x404
+#endif
+/*
+ * NT_ARM_SYSTEM_CALL regset is supported by linux kernel
+ * starting with commit v3.19-rc1~59^2~16.
+ */
+
+static int
+arch_set_scno(struct tcb *tcp, kernel_ulong_t scno)
+{
+ unsigned int n = (uint16_t) scno;
+ const struct iovec io = {
+ .iov_base = &n,
+ .iov_len = sizeof(n)
+ };
+ int rc = ptrace(PTRACE_SETREGSET, tcp->pid, NT_ARM_SYSTEM_CALL, &io);
+ if (rc && errno != ESRCH)
+ perror_func_msg("NT_ARM_SYSTEM_CALL pid:%d scno:%#x",
+ tcp->pid, n);
+ return rc;
+}
diff --git a/src/linux/aarch64/shuffle_scno.c b/src/linux/aarch64/shuffle_scno.c
new file mode 100644
index 000000000..a4c0d3bec
--- /dev/null
+++ b/src/linux/aarch64/shuffle_scno.c
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#define shuffle_scno arm_shuffle_scno
+#include "../arm/shuffle_scno.c"
+#undef shuffle_scno
+
+kernel_ulong_t
+shuffle_scno(kernel_ulong_t scno)
+{
+ if (current_personality == 1)
+ return arm_shuffle_scno(scno);
+
+ return scno;
+}
diff --git a/src/linux/aarch64/syscallent.h b/src/linux/aarch64/syscallent.h
new file mode 100644
index 000000000..4750cd999
--- /dev/null
+++ b/src/linux/aarch64/syscallent.h
@@ -0,0 +1,13 @@
+/*
+ * Copyright (c) 2012-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "64/syscallent.h"
+
+/*
+ * Arch-specific block, not used on AArch64.
+ * [244 ... 259] = { },
+ */
diff --git a/src/linux/aarch64/syscallent1.h b/src/linux/aarch64/syscallent1.h
new file mode 100644
index 000000000..1b892be03
--- /dev/null
+++ b/src/linux/aarch64/syscallent1.h
@@ -0,0 +1 @@
+#include "../arm/syscallent.h"
diff --git a/src/linux/alpha/arch_defs_.h b/src/linux/alpha/arch_defs_.h
new file mode 100644
index 000000000..78227c79f
--- /dev/null
+++ b/src/linux/alpha/arch_defs_.h
@@ -0,0 +1,10 @@
+/*
+ * Copyright (c) 2018-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#define HAVE_ARCH_GETRVAL2 1
+#define HAVE_ARCH_DEDICATED_ERR_REG 1
+#define HAVE_ARCH_TIME32_SYSCALLS 1
diff --git a/src/linux/alpha/arch_getrval2.c b/src/linux/alpha/arch_getrval2.c
new file mode 100644
index 000000000..6232f6fcb
--- /dev/null
+++ b/src/linux/alpha/arch_getrval2.c
@@ -0,0 +1,15 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+long
+getrval2(struct tcb *tcp)
+{
+ unsigned long r20;
+ if (upeek(tcp, 20, &r20) < 0)
+ return -1;
+ return r20;
+}
diff --git a/src/linux/alpha/arch_regs.c b/src/linux/alpha/arch_regs.c
new file mode 100644
index 000000000..ac6c35f27
--- /dev/null
+++ b/src/linux/alpha/arch_regs.c
@@ -0,0 +1,18 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static unsigned long alpha_r0;
+static unsigned long alpha_a3;
+
+#define REG_R0 0
+#define REG_A0 16
+#define REG_A3 19
+#define REG_SP 30
+#define REG_PC 64
+
+#define ARCH_PC_PEEK_ADDR REG_PC
+#define ARCH_SP_PEEK_ADDR REG_SP
diff --git a/src/linux/alpha/arch_sigreturn.c b/src/linux/alpha/arch_sigreturn.c
new file mode 100644
index 000000000..c6a254554
--- /dev/null
+++ b/src/linux/alpha/arch_sigreturn.c
@@ -0,0 +1,18 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static void
+arch_sigreturn(struct tcb *tcp)
+{
+ unsigned long addr;
+
+ if (!get_stack_pointer(tcp, &addr))
+ return;
+ addr += offsetof(struct sigcontext, sc_mask);
+
+ print_sigset_addr(tcp, addr);
+}
diff --git a/src/linux/alpha/errnoent.h b/src/linux/alpha/errnoent.h
new file mode 100644
index 000000000..4f3ec926f
--- /dev/null
+++ b/src/linux/alpha/errnoent.h
@@ -0,0 +1,156 @@
+/*
+ * Copyright (c) 1999-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+[ 1] = "EPERM",
+[ 2] = "ENOENT",
+[ 3] = "ESRCH",
+[ 4] = "EINTR",
+[ 5] = "EIO",
+[ 6] = "ENXIO",
+[ 7] = "E2BIG",
+[ 8] = "ENOEXEC",
+[ 9] = "EBADF",
+[ 10] = "ECHILD",
+[ 11] = "EDEADLK",
+[ 12] = "ENOMEM",
+[ 13] = "EACCES",
+[ 14] = "EFAULT",
+[ 15] = "ENOTBLK",
+[ 16] = "EBUSY",
+[ 17] = "EEXIST",
+[ 18] = "EXDEV",
+[ 19] = "ENODEV",
+[ 20] = "ENOTDIR",
+[ 21] = "EISDIR",
+[ 22] = "EINVAL",
+[ 23] = "ENFILE",
+[ 24] = "EMFILE",
+[ 25] = "ENOTTY",
+[ 26] = "ETXTBSY",
+[ 27] = "EFBIG",
+[ 28] = "ENOSPC",
+[ 29] = "ESPIPE",
+[ 30] = "EROFS",
+[ 31] = "EMLINK",
+[ 32] = "EPIPE",
+[ 33] = "EDOM",
+[ 34] = "ERANGE",
+[ 35] = "EAGAIN",
+[ 36] = "EINPROGRESS",
+[ 37] = "EALREADY",
+[ 38] = "ENOTSOCK",
+[ 39] = "EDESTADDRREQ",
+[ 40] = "EMSGSIZE",
+[ 41] = "EPROTOTYPE",
+[ 42] = "ENOPROTOOPT",
+[ 43] = "EPROTONOSUPPORT",
+[ 44] = "ESOCKTNOSUPPORT",
+[ 45] = "EOPNOTSUPP",
+[ 46] = "EPFNOSUPPORT",
+[ 47] = "EAFNOSUPPORT",
+[ 48] = "EADDRINUSE",
+[ 49] = "EADDRNOTAVAIL",
+[ 50] = "ENETDOWN",
+[ 51] = "ENETUNREACH",
+[ 52] = "ENETRESET",
+[ 53] = "ECONNABORTED",
+[ 54] = "ECONNRESET",
+[ 55] = "ENOBUFS",
+[ 56] = "EISCONN",
+[ 57] = "ENOTCONN",
+[ 58] = "ESHUTDOWN",
+[ 59] = "ETOOMANYREFS",
+[ 60] = "ETIMEDOUT",
+[ 61] = "ECONNREFUSED",
+[ 62] = "ELOOP",
+[ 63] = "ENAMETOOLONG",
+[ 64] = "EHOSTDOWN",
+[ 65] = "EHOSTUNREACH",
+[ 66] = "ENOTEMPTY",
+[ 68] = "EUSERS",
+[ 69] = "EDQUOT",
+[ 70] = "ESTALE",
+[ 71] = "EREMOTE",
+[ 77] = "ENOLCK",
+[ 78] = "ENOSYS",
+[ 80] = "ENOMSG",
+[ 81] = "EIDRM",
+[ 82] = "ENOSR",
+[ 83] = "ETIME",
+[ 84] = "EBADMSG",
+[ 85] = "EPROTO",
+[ 86] = "ENODATA",
+[ 87] = "ENOSTR",
+[ 88] = "ECHRNG",
+[ 89] = "EL2NSYNC",
+[ 90] = "EL3HLT",
+[ 91] = "EL3RST",
+[ 92] = "ENOPKG",
+[ 93] = "ELNRNG",
+[ 94] = "EUNATCH",
+[ 95] = "ENOCSI",
+[ 96] = "EL2HLT",
+[ 97] = "EBADE",
+[ 98] = "EBADR",
+[ 99] = "EXFULL",
+[100] = "ENOANO",
+[101] = "EBADRQC",
+[102] = "EBADSLT",
+[103] = "EDEADLOCK",
+[104] = "EBFONT",
+[105] = "ENONET",
+[106] = "ENOLINK",
+[107] = "EADV",
+[108] = "ESRMNT",
+[109] = "ECOMM",
+[110] = "EMULTIHOP",
+[111] = "EDOTDOT",
+[112] = "EOVERFLOW",
+[113] = "ENOTUNIQ",
+[114] = "EBADFD",
+[115] = "EREMCHG",
+[116] = "EILSEQ",
+[117] = "EUCLEAN",
+[118] = "ENOTNAM",
+[119] = "ENAVAIL",
+[120] = "EISNAM",
+[121] = "EREMOTEIO",
+[122] = "ELIBACC",
+[123] = "ELIBBAD",
+[124] = "ELIBSCN",
+[125] = "ELIBMAX",
+[126] = "ELIBEXEC",
+[127] = "ERESTART",
+[128] = "ESTRPIPE",
+[129] = "ENOMEDIUM",
+[130] = "EMEDIUMTYPE",
+[131] = "ECANCELED",
+[132] = "ENOKEY",
+[133] = "EKEYEXPIRED",
+[134] = "EKEYREVOKED",
+[135] = "EKEYREJECTED",
+[136] = "EOWNERDEAD",
+[137] = "ENOTRECOVERABLE",
+[138] = "ERFKILL",
+[139] = "EHWPOISON",
+[512] = "ERESTARTSYS",
+[513] = "ERESTARTNOINTR",
+[514] = "ERESTARTNOHAND",
+[515] = "ENOIOCTLCMD",
+[516] = "ERESTART_RESTARTBLOCK",
+[517] = "EPROBE_DEFER",
+[518] = "EOPENSTALE",
+[521] = "EBADHANDLE",
+[522] = "ENOTSYNC",
+[523] = "EBADCOOKIE",
+[524] = "ENOTSUPP",
+[525] = "ETOOSMALL",
+[526] = "ESERVERFAULT",
+[527] = "EBADTYPE",
+[528] = "EJUKEBOX",
+[529] = "EIOCBQUEUED",
+[530] = "ERECALLCONFLICT",
diff --git a/src/linux/alpha/get_error.c b/src/linux/alpha/get_error.c
new file mode 100644
index 000000000..3c8e8ebff
--- /dev/null
+++ b/src/linux/alpha/get_error.c
@@ -0,0 +1,17 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static void
+arch_get_error(struct tcb *tcp, const bool check_errno)
+{
+ if (alpha_a3) {
+ tcp->u_rval = -1;
+ tcp->u_error = alpha_r0;
+ } else {
+ tcp->u_rval = alpha_r0;
+ }
+}
diff --git a/src/linux/alpha/get_scno.c b/src/linux/alpha/get_scno.c
new file mode 100644
index 000000000..7cb61fa18
--- /dev/null
+++ b/src/linux/alpha/get_scno.c
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2015-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+/* Return codes: 1 - ok, 0 - ignore, other - error. */
+static int
+arch_get_scno(struct tcb *tcp)
+{
+ kernel_ulong_t scno = 0;
+
+ if (upeek(tcp, REG_A3, &alpha_a3) < 0)
+ return -1;
+ if (upeek(tcp, REG_R0, &scno) < 0)
+ return -1;
+
+ /*
+ * Do some sanity checks to figure out if it's
+ * really a syscall entry
+ */
+ if (!scno_in_range(scno)) {
+ if (alpha_a3 == 0 || alpha_a3 == -1UL) {
+ debug_msg("stray syscall exit: r0 = %lu", scno);
+ return 0;
+ }
+ }
+
+ tcp->scno = scno;
+ return 1;
+}
diff --git a/src/linux/alpha/get_syscall_args.c b/src/linux/alpha/get_syscall_args.c
new file mode 100644
index 000000000..83f4d4541
--- /dev/null
+++ b/src/linux/alpha/get_syscall_args.c
@@ -0,0 +1,18 @@
+/*
+ * Copyright (c) 2015-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+/* Return -1 on error or 1 on success (never 0!). */
+static int
+arch_get_syscall_args(struct tcb *tcp)
+{
+ unsigned int i;
+
+ for (i = 0; i < n_args(tcp); ++i)
+ if (upeek(tcp, REG_A0+i, &tcp->u_arg[i]) < 0)
+ return -1;
+ return 1;
+}
diff --git a/src/linux/alpha/get_syscall_result.c b/src/linux/alpha/get_syscall_result.c
new file mode 100644
index 000000000..85fef4f94
--- /dev/null
+++ b/src/linux/alpha/get_syscall_result.c
@@ -0,0 +1,13 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static int
+get_syscall_result_regs(struct tcb *tcp)
+{
+ return (upeek(tcp, REG_A3, &alpha_a3) < 0 ||
+ upeek(tcp, REG_R0, &alpha_r0) < 0) ? -1 : 0;
+}
diff --git a/src/linux/alpha/ioctls_arch0.h b/src/linux/alpha/ioctls_arch0.h
new file mode 100644
index 000000000..39f87ce86
--- /dev/null
+++ b/src/linux/alpha/ioctls_arch0.h
@@ -0,0 +1,80 @@
+/* Generated by ioctls_gen.sh from definitions found in $linux/arch/alpha/include/ tree. */
+{ "asm/ioctls.h", "FIOASYNC", _IOC_WRITE, 0x667d, 0x04 },
+{ "asm/ioctls.h", "FIOCLEX", _IOC_NONE, 0x6601, 0x00 },
+{ "asm/ioctls.h", "FIONBIO", _IOC_WRITE, 0x667e, 0x04 },
+{ "asm/ioctls.h", "FIONCLEX", _IOC_NONE, 0x6602, 0x00 },
+{ "asm/ioctls.h", "FIONREAD", _IOC_READ, 0x667f, 0x04 },
+{ "asm/ioctls.h", "FIOQSIZE", _IOC_READ, 0x6680, 0x08 },
+{ "asm/ioctls.h", "TCFLSH", _IOC_NONE, 0x741f, 0x00 },
+{ "asm/ioctls.h", "TCGETA", _IOC_READ, 0x7417, 0x12 },
+{ "asm/ioctls.h", "TCGETS", _IOC_READ, 0x7413, 0x2c },
+{ "asm/ioctls.h", "TCSBRK", _IOC_NONE, 0x741d, 0x00 },
+{ "asm/ioctls.h", "TCSBRKP", 0, 0x5425, 0 },
+{ "asm/ioctls.h", "TCSETA", _IOC_WRITE, 0x7418, 0x12 },
+{ "asm/ioctls.h", "TCSETAF", _IOC_WRITE, 0x741c, 0x12 },
+{ "asm/ioctls.h", "TCSETAW", _IOC_WRITE, 0x7419, 0x12 },
+{ "asm/ioctls.h", "TCSETS", _IOC_WRITE, 0x7414, 0x2c },
+{ "asm/ioctls.h", "TCSETSF", _IOC_WRITE, 0x7416, 0x2c },
+{ "asm/ioctls.h", "TCSETSW", _IOC_WRITE, 0x7415, 0x2c },
+{ "asm/ioctls.h", "TCXONC", _IOC_NONE, 0x741e, 0x00 },
+{ "asm/ioctls.h", "TIOCCBRK", 0, 0x5428, 0 },
+{ "asm/ioctls.h", "TIOCCONS", 0, 0x541D, 0 },
+{ "asm/ioctls.h", "TIOCEXCL", 0, 0x540C, 0 },
+{ "asm/ioctls.h", "TIOCGDEV", _IOC_READ, 0x5432, 0x04 },
+{ "asm/ioctls.h", "TIOCGETC", _IOC_READ, 0x7412, 0x06 },
+{ "asm/ioctls.h", "TIOCGETD", 0, 0x5424, 0 },
+{ "asm/ioctls.h", "TIOCGETP", _IOC_READ, 0x7408, 0x06 },
+{ "asm/ioctls.h", "TIOCGEXCL", _IOC_READ, 0x5440, 0x04 },
+{ "asm/ioctls.h", "TIOCGICOUNT", 0, 0x545D, 0 },
+{ "asm/ioctls.h", "TIOCGLCKTRMIOS", 0, 0x5456, 0 },
+{ "asm/ioctls.h", "TIOCGLTC", _IOC_READ, 0x7474, 0x06 },
+{ "asm/ioctls.h", "TIOCGPGRP", _IOC_READ, 0x7477, 0x04 },
+{ "asm/ioctls.h", "TIOCGPKT", _IOC_READ, 0x5438, 0x04 },
+{ "asm/ioctls.h", "TIOCGPTLCK", _IOC_READ, 0x5439, 0x04 },
+{ "asm/ioctls.h", "TIOCGPTN", _IOC_READ, 0x5430, 0x04 },
+{ "asm/ioctls.h", "TIOCGRS485", _IOC_READ, 0x542e, 0x20 },
+{ "asm/ioctls.h", "TIOCGSERIAL", 0, 0x541E, 0 },
+{ "asm/ioctls.h", "TIOCGSID", 0, 0x5429, 0 },
+{ "asm/ioctls.h", "TIOCGSOFTCAR", 0, 0x5419, 0 },
+{ "asm/ioctls.h", "TIOCGWINSZ", _IOC_READ, 0x7468, 0x08 },
+{ "asm/ioctls.h", "TIOCLINUX", 0, 0x541C, 0 },
+{ "asm/ioctls.h", "TIOCMBIC", 0, 0x5417, 0 },
+{ "asm/ioctls.h", "TIOCMBIS", 0, 0x5416, 0 },
+{ "asm/ioctls.h", "TIOCMGET", 0, 0x5415, 0 },
+{ "asm/ioctls.h", "TIOCMIWAIT", 0, 0x545C, 0 },
+{ "asm/ioctls.h", "TIOCMSET", 0, 0x5418, 0 },
+{ "asm/ioctls.h", "TIOCNOTTY", 0, 0x5422, 0 },
+{ "asm/ioctls.h", "TIOCNXCL", 0, 0x540D, 0 },
+{ "asm/ioctls.h", "TIOCOUTQ", _IOC_READ, 0x7473, 0x04 },
+{ "asm/ioctls.h", "TIOCPKT", 0, 0x5420, 0 },
+{ "asm/ioctls.h", "TIOCSBRK", 0, 0x5427, 0 },
+{ "asm/ioctls.h", "TIOCSCTTY", 0, 0x540E, 0 },
+{ "asm/ioctls.h", "TIOCSERCONFIG", 0, 0x5453, 0 },
+{ "asm/ioctls.h", "TIOCSERGETLSR", 0, 0x5459, 0 },
+{ "asm/ioctls.h", "TIOCSERGETMULTI", 0, 0x545A, 0 },
+{ "asm/ioctls.h", "TIOCSERGSTRUCT", 0, 0x5458, 0 },
+{ "asm/ioctls.h", "TIOCSERGWILD", 0, 0x5454, 0 },
+{ "asm/ioctls.h", "TIOCSERSETMULTI", 0, 0x545B, 0 },
+{ "asm/ioctls.h", "TIOCSERSWILD", 0, 0x5455, 0 },
+{ "asm/ioctls.h", "TIOCSETC", _IOC_WRITE, 0x7411, 0x06 },
+{ "asm/ioctls.h", "TIOCSETD", 0, 0x5423, 0 },
+{ "asm/ioctls.h", "TIOCSETN", _IOC_WRITE, 0x740a, 0x06 },
+{ "asm/ioctls.h", "TIOCSETP", _IOC_WRITE, 0x7409, 0x06 },
+{ "asm/ioctls.h", "TIOCSIG", _IOC_WRITE, 0x5436, 0x04 },
+{ "asm/ioctls.h", "TIOCSLCKTRMIOS", 0, 0x5457, 0 },
+{ "asm/ioctls.h", "TIOCSLTC", _IOC_WRITE, 0x7475, 0x06 },
+{ "asm/ioctls.h", "TIOCSPGRP", _IOC_WRITE, 0x7476, 0x04 },
+{ "asm/ioctls.h", "TIOCSPTLCK", _IOC_WRITE, 0x5431, 0x04 },
+{ "asm/ioctls.h", "TIOCSRS485", _IOC_READ|_IOC_WRITE, 0x542f, 0x20 },
+{ "asm/ioctls.h", "TIOCSSERIAL", 0, 0x541F, 0 },
+{ "asm/ioctls.h", "TIOCSSOFTCAR", 0, 0x541A, 0 },
+{ "asm/ioctls.h", "TIOCSTART", _IOC_NONE, 0x746e, 0x00 },
+{ "asm/ioctls.h", "TIOCSTI", 0, 0x5412, 0 },
+{ "asm/ioctls.h", "TIOCSTOP", _IOC_NONE, 0x746f, 0x00 },
+{ "asm/ioctls.h", "TIOCSWINSZ", _IOC_WRITE, 0x7467, 0x08 },
+{ "asm/ioctls.h", "TIOCVHANGUP", 0, 0x5437, 0 },
+{ "asm/sockios.h", "FIOGETOWN", _IOC_READ, 0x667b, 0x04 },
+{ "asm/sockios.h", "FIOSETOWN", _IOC_WRITE, 0x667c, 0x04 },
+{ "asm/sockios.h", "SIOCATMARK", _IOC_READ, 0x7307, 0x04 },
+{ "asm/sockios.h", "SIOCGPGRP", _IOC_READ, 0x7309, 0x04 },
+{ "asm/sockios.h", "SIOCSPGRP", _IOC_WRITE, 0x7308, 0x04 },
diff --git a/src/linux/alpha/ioctls_inc0.h b/src/linux/alpha/ioctls_inc0.h
new file mode 100644
index 000000000..f9939faa4
--- /dev/null
+++ b/src/linux/alpha/ioctls_inc0.h
@@ -0,0 +1 @@
+#include "64/ioctls_inc.h"
diff --git a/src/linux/alpha/raw_syscall.h b/src/linux/alpha/raw_syscall.h
new file mode 100644
index 000000000..f44dd27f8
--- /dev/null
+++ b/src/linux/alpha/raw_syscall.h
@@ -0,0 +1,31 @@
+/*
+ * Raw syscalls.
+ *
+ * Copyright (c) 2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_RAW_SYSCALL_H
+# define STRACE_RAW_SYSCALL_H
+
+# include "kernel_types.h"
+
+static inline kernel_ulong_t
+raw_syscall_0(const kernel_ulong_t nr, kernel_ulong_t *err)
+{
+ kernel_ulong_t sc_0 = nr;
+ register kernel_ulong_t sc_19 __asm__("$19");
+ __asm__ __volatile__("callsys"
+ : "+v"(sc_0), "=r"(sc_19)
+ :
+ : "memory", "$1", "$2", "$3", "$4", "$5", "$6",
+ "$7", "$8", "$16", "$17", "$18", "$20", "$21",
+ "$22", "$23", "$24", "$25", "$27", "$28");
+ *err = sc_19;
+ return sc_0;
+}
+# define raw_syscall_0 raw_syscall_0
+
+#endif /* !STRACE_RAW_SYSCALL_H */
diff --git a/src/linux/alpha/set_error.c b/src/linux/alpha/set_error.c
new file mode 100644
index 000000000..2136e994a
--- /dev/null
+++ b/src/linux/alpha/set_error.c
@@ -0,0 +1,20 @@
+/*
+ * Copyright (c) 2016-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static int
+arch_set_error(struct tcb *tcp)
+{
+ return upoke(tcp, REG_A3, (alpha_a3 = 1))
+ || upoke(tcp, REG_R0, (alpha_r0 = tcp->u_error));
+}
+
+static int
+arch_set_success(struct tcb *tcp)
+{
+ return upoke(tcp, REG_A3, (alpha_a3 = 0))
+ || upoke(tcp, REG_R0, (alpha_r0 = tcp->u_rval));
+}
diff --git a/src/linux/alpha/set_scno.c b/src/linux/alpha/set_scno.c
new file mode 100644
index 000000000..09059a38e
--- /dev/null
+++ b/src/linux/alpha/set_scno.c
@@ -0,0 +1,12 @@
+/*
+ * Copyright (c) 2016-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static int
+arch_set_scno(struct tcb *tcp, kernel_ulong_t scno)
+{
+ return upoke(tcp, REG_R0, scno);
+}
diff --git a/src/linux/alpha/signalent.h b/src/linux/alpha/signalent.h
new file mode 100644
index 000000000..f086a42a4
--- /dev/null
+++ b/src/linux/alpha/signalent.h
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 1999-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+ "0", /* 0 */
+ "SIGHUP", /* 1 */
+ "SIGINT", /* 2 */
+ "SIGQUIT", /* 3 */
+ "SIGILL", /* 4 */
+ "SIGTRAP", /* 5 */
+ "SIGABRT", /* 6 */
+ "SIGEMT", /* 7 */
+ "SIGFPE", /* 8 */
+ "SIGKILL", /* 9 */
+ "SIGBUS", /* 10 */
+ "SIGSEGV", /* 11 */
+ "SIGSYS", /* 12 */
+ "SIGPIPE", /* 13 */
+ "SIGALRM", /* 14 */
+ "SIGTERM", /* 15 */
+ "SIGURG", /* 16 */
+ "SIGSTOP", /* 17 */
+ "SIGTSTP", /* 18 */
+ "SIGCONT", /* 19 */
+ "SIGCHLD", /* 20 */
+ "SIGTTIN", /* 21 */
+ "SIGTTOU", /* 22 */
+ "SIGIO", /* 23 */
+ "SIGXCPU", /* 24 */
+ "SIGXFSZ", /* 25 */
+ "SIGVTALRM", /* 26 */
+ "SIGPROF", /* 27 */
+ "SIGWINCH", /* 28 */
+ "SIGINFO", /* 29 */
+ "SIGUSR1", /* 30 */
+ "SIGUSR2", /* 31 */
+ "SIGRTMIN", /* 32 */
diff --git a/src/linux/alpha/syscallent.h b/src/linux/alpha/syscallent.h
new file mode 100644
index 000000000..235e52ec5
--- /dev/null
+++ b/src/linux/alpha/syscallent.h
@@ -0,0 +1,483 @@
+/*
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993, 1994, 1995 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1995-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+[ 0] = { 6, 0, SEN(printargs), "osf_syscall" }, /* not implemented */
+[ 1] = { 1, TP|SE, SEN(exit), "exit" },
+[ 2] = { 0, TP, SEN(fork), "fork" },
+[ 3] = { 3, TD, SEN(read), "read" },
+[ 4] = { 3, TD, SEN(write), "write" },
+[ 5] = { 5, 0, SEN(printargs), "osf_old_open" }, /* not implemented */
+[ 6] = { 1, TD, SEN(close), "close" },
+[ 7] = { 4, TP, SEN(osf_wait4), "osf_wait4" },
+[ 8] = { 5, 0, SEN(printargs), "osf_old_creat" }, /* not implemented */
+[ 9] = { 2, TF, SEN(link), "link" },
+[ 10] = { 1, TF, SEN(unlink), "unlink" },
+[ 11] = { 5, 0, SEN(printargs), "osf_execve" }, /* not implemented */
+[ 12] = { 1, TF, SEN(chdir), "chdir" },
+[ 13] = { 1, TD, SEN(fchdir), "fchdir" },
+[ 14] = { 3, TF, SEN(mknod), "mknod" },
+[ 15] = { 2, TF, SEN(chmod), "chmod" },
+[ 16] = { 3, TF, SEN(chown), "chown" },
+[ 17] = { 1, TM|SI, SEN(brk), "brk" },
+[ 18] = { 5, TSFA, SEN(printargs), "osf_getfsstat" }, /* not implemented */
+[ 19] = { 3, TD, SEN(lseek), "lseek" },
+[ 20] = { 0, PU|NF, SEN(getxpid), "getxpid" },
+[ 21] = { 4, 0, SEN(printargs), "osf_mount" },
+[ 22] = { 2, TF, SEN(umount2), "umount" },
+[ 23] = { 1, TC, SEN(setuid), "setuid" },
+[ 24] = { 0, TC|PU|NF, SEN(getxuid), "getxuid" },
+[ 25] = { 5, 0, SEN(printargs), "exec_with_loader" }, /* not implemented */
+[ 26] = { 4, 0, SEN(ptrace), "ptrace" },
+[ 27] = { 5, 0, SEN(printargs), "osf_nrecvmsg" }, /* not implemented */
+[ 28] = { 5, 0, SEN(printargs), "osf_nsendmsg" }, /* not implemented */
+[ 29] = { 5, 0, SEN(printargs), "osf_nrecvfrom" }, /* not implemented */
+[ 30] = { 5, 0, SEN(printargs), "osf_naccept" }, /* not implemented */
+[ 31] = { 5, 0, SEN(printargs), "osf_ngetpeername" }, /* not implemented */
+[ 32] = { 5, 0, SEN(printargs), "osf_ngetsockname" }, /* not implemented */
+[ 33] = { 2, TF, SEN(access), "access" },
+[ 34] = { 5, 0, SEN(printargs), "osf_chflags" }, /* not implemented */
+[ 35] = { 5, 0, SEN(printargs), "osf_fchflags" }, /* not implemented */
+[ 36] = { 0, 0, SEN(sync), "sync" },
+[ 37] = { 2, TS|TP, SEN(kill), "kill" },
+[ 38] = { 5, TF|TST|TSTA, SEN(printargs), "osf_old_stat" }, /* not implemented */
+[ 39] = { 2, 0, SEN(setpgid), "setpgid" },
+[ 40] = { 5, TF|TLST|TSTA, SEN(printargs), "osf_old_lstat" }, /* not implemented */
+[ 41] = { 1, TD, SEN(dup), "dup" },
+[ 42] = { 0, TD, SEN(pipe), "pipe" },
+[ 43] = { 4, 0, SEN(printargs), "osf_set_program_attributes" },
+[ 44] = { 5, 0, SEN(printargs), "osf_profil" }, /* not implemented */
+[ 45] = { 3, TD|TF, SEN(open), "open" },
+[ 46] = { 5, 0, SEN(printargs), "osf_old_sigaction" }, /* not implemented */
+[ 47] = { 0, TC|PU|NF, SEN(getxgid), "getxgid" },
+[ 48] = { 2, TS, SEN(osf_sigprocmask), "osf_sigprocmask" },
+[ 49] = { 5, 0, SEN(printargs), "osf_getlogin" }, /* not implemented */
+[ 50] = { 5, 0, SEN(printargs), "osf_setlogin" }, /* not implemented */
+[ 51] = { 1, TF, SEN(acct), "acct" },
+[ 52] = { 1, TS, SEN(sigpending), "sigpending" },
+[ 53] = { },
+[ 54] = { 3, TD, SEN(ioctl), "ioctl" },
+[ 55] = { 5, 0, SEN(printargs), "osf_reboot" }, /* not implemented */
+[ 56] = { 5, 0, SEN(printargs), "osf_revoke" }, /* not implemented */
+[ 57] = { 2, TF, SEN(symlink), "symlink" },
+[ 58] = { 3, TF, SEN(readlink), "readlink" },
+[ 59] = { 3, TF|TP|TSD|SE|SI, SEN(execve), "execve" },
+[ 60] = { 1, NF, SEN(umask), "umask" },
+[ 61] = { 1, TF, SEN(chroot), "chroot" },
+[ 62] = { 5, TD|TFST|TSTA, SEN(printargs), "osf_old_fstat" }, /* not implemented */
+[ 63] = { 0, PU|NF, SEN(getpgrp), "getpgrp" },
+[ 64] = { 0, PU|NF, SEN(getpagesize), "getpagesize" },
+[ 65] = { 5, TM, SEN(printargs), "osf_mremap" }, /* not implemented */
+[ 66] = { 0, TP, SEN(vfork), "vfork" },
+[ 67] = { 2, TF|TST|TSTA, SEN(stat), "stat" },
+[ 68] = { 2, TF|TLST|TSTA, SEN(lstat), "lstat" },
+[ 69] = { 5, TM, SEN(printargs), "osf_sbrk" }, /* not implemented */
+[ 70] = { 5, 0, SEN(printargs), "osf_sstk" }, /* not implemented */
+[ 71] = { 6, TD|TM|SI, SEN(mmap), "mmap" },
+[ 72] = { 5, 0, SEN(printargs), "osf_old_vadvise" }, /* not implemented */
+[ 73] = { 2, TM|SI, SEN(munmap), "munmap" },
+[ 74] = { 3, TM|SI, SEN(mprotect), "mprotect" },
+[ 75] = { 3, TM, SEN(madvise), "madvise" },
+[ 76] = { 0, 0, SEN(vhangup), "vhangup" },
+[ 77] = { 5, 0, SEN(printargs), "osf_kmodcall" }, /* not implemented */
+[ 78] = { 5, TM, SEN(printargs), "osf_mincore" }, /* not implemented */
+[ 79] = { 2, TC, SEN(getgroups), "getgroups" },
+[ 80] = { 2, TC, SEN(setgroups), "setgroups" },
+[ 81] = { 5, 0, SEN(printargs), "osf_old_getpgrp" }, /* not implemented */
+[ 82] = { 2, 0, SEN(setpgrp), "setpgrp" },
+[ 83] = { 3, 0, SEN(osf_setitimer), "osf_setitimer" },
+[ 84] = { 5, 0, SEN(printargs), "osf_old_wait" }, /* not implemented */
+[ 85] = { 5, 0, SEN(printargs), "osf_table" }, /* not implemented */
+[ 86] = { 2, 0, SEN(osf_getitimer), "osf_getitimer" },
+[ 87] = { 2, 0, SEN(gethostname), "gethostname" },
+[ 88] = { 2, 0, SEN(sethostname), "sethostname" },
+[ 89] = { 0, PU|NF, SEN(getdtablesize), "getdtablesize" },
+[ 90] = { 2, TD, SEN(dup2), "dup2" },
+[ 91] = { 2, TD|TFST|TSTA, SEN(fstat), "fstat" },
+[ 92] = { 3, TD, SEN(fcntl), "fcntl" },
+[ 93] = { 5, TD, SEN(osf_select), "osf_select" },
+[ 94] = { 3, TD, SEN(poll_time64), "poll" },
+[ 95] = { 1, TD, SEN(fsync), "fsync" },
+[ 96] = { 3, 0, SEN(setpriority), "setpriority" },
+[ 97] = { 3, TN, SEN(socket), "socket" },
+[ 98] = { 3, TN, SEN(connect), "connect" },
+[ 99] = { 3, TN, SEN(accept), "accept" },
+[100] = { 2, 0, SEN(getpriority), "getpriority" },
+[101] = { 4, TN, SEN(send), "send" },
+[102] = { 4, TN, SEN(recv), "recv" },
+[103] = { 0, TS, SEN(sigreturn), "sigreturn" },
+[104] = { 3, TN, SEN(bind), "bind" },
+[105] = { 5, TN, SEN(setsockopt), "setsockopt" },
+[106] = { 2, TN, SEN(listen), "listen" },
+[107] = { 5, 0, SEN(printargs), "osf_plock" }, /* not implemented */
+[108] = { 5, 0, SEN(printargs), "osf_old_sigvec" }, /* not implemented */
+[109] = { 5, 0, SEN(printargs), "osf_old_sigblock" }, /* not implemented */
+[110] = { 5, 0, SEN(printargs), "osf_old_sigsetmask" }, /* not implemented */
+[111] = { 1, TS, SEN(sigsuspend), "sigsuspend" },
+[112] = { 2, 0, SEN(printargs), "osf_sigstack" },
+[113] = { 3, TN, SEN(recvmsg), "recvmsg" },
+[114] = { 3, TN, SEN(sendmsg), "sendmsg" },
+[115] = { 5, 0, SEN(printargs), "osf_old_vtrace" }, /* not implemented */
+[116] = { 2, TCL, SEN(osf_gettimeofday), "osf_gettimeofday" },
+[117] = { 2, 0, SEN(osf_getrusage), "osf_getrusage" },
+[118] = { 5, TN, SEN(getsockopt), "getsockopt" },
+[119] = { },
+[120] = { 3, TD, SEN(readv), "readv" },
+[121] = { 3, TD, SEN(writev), "writev" },
+[122] = { 2, TCL, SEN(osf_settimeofday), "osf_settimeofday" },
+[123] = { 3, TD, SEN(fchown), "fchown" },
+[124] = { 2, TD, SEN(fchmod), "fchmod" },
+[125] = { 6, TN, SEN(recvfrom), "recvfrom" },
+[126] = { 2, TC, SEN(setreuid), "setreuid" },
+[127] = { 2, TC, SEN(setregid), "setregid" },
+[128] = { 2, TF, SEN(rename), "rename" },
+[129] = { 2, TF, SEN(truncate), "truncate" },
+[130] = { 2, TD, SEN(ftruncate), "ftruncate" },
+[131] = { 2, TD, SEN(flock), "flock" },
+[132] = { 1, TC, SEN(setgid), "setgid" },
+[133] = { 6, TN, SEN(sendto), "sendto" },
+[134] = { 2, TN, SEN(shutdown), "shutdown" },
+[135] = { 4, TN, SEN(socketpair), "socketpair" },
+[136] = { 2, TF, SEN(mkdir), "mkdir" },
+[137] = { 1, TF, SEN(rmdir), "rmdir" },
+[138] = { 2, TF, SEN(osf_utimes), "osf_utimes" },
+[139] = { 5, 0, SEN(printargs), "osf_old_sigreturn" }, /* not implemented */
+[140] = { 5, TCL, SEN(printargs), "osf_adjtime" }, /* not implemented */
+[141] = { 3, TN, SEN(getpeername), "getpeername" },
+[142] = { 5, 0, SEN(printargs), "osf_gethostid" }, /* not implemented */
+[143] = { 5, 0, SEN(printargs), "osf_sethostid" }, /* not implemented */
+[144] = { 2, 0, SEN(getrlimit), "getrlimit" },
+[145] = { 2, 0, SEN(setrlimit), "setrlimit" },
+[146] = { 5, TP, SEN(printargs), "osf_old_killpg" }, /* not implemented */
+[147] = { 0, 0, SEN(setsid), "setsid" },
+[148] = { 4, TF, SEN(quotactl), "quotactl" },
+[149] = { 5, 0, SEN(printargs), "osf_oldquota" }, /* not implemented */
+[150] = { 3, TN, SEN(getsockname), "getsockname" },
+[151 ... 152] = { },
+[153] = { 5, 0, SEN(printargs), "osf_pid_block" }, /* not implemented */
+[154] = { 5, 0, SEN(printargs), "osf_pid_unblock" }, /* not implemented */
+[155] = { },
+[156] = { 3, TS, SEN(sigaction), "sigaction" },
+[157] = { 5, 0, SEN(printargs), "osf_sigwaitprim" }, /* not implemented */
+[158] = { 5, 0, SEN(printargs), "osf_nfssvc" }, /* not implemented */
+[159] = { 4, 0, SEN(printargs), "osf_getdirentries" },
+[160] = { 3, TF|TSF|TSFA, SEN(osf_statfs), "osf_statfs" },
+[161] = { 3, TD|TFSF|TSFA, SEN(osf_fstatfs), "osf_fstatfs" },
+[162] = { },
+[163] = { 5, 0, SEN(printargs), "osf_asynch_daemon" }, /* not implemented */
+[164] = { 5, 0, SEN(printargs), "osf_getfh" }, /* not implemented */
+[165] = { 2, 0, SEN(printargs), "osf_getdomainname" },
+[166] = { 2, 0, SEN(setdomainname), "setdomainname" },
+[167 ... 168] = { },
+[169] = { 5, 0, SEN(printargs), "osf_exportfs" }, /* not implemented */
+[170 ... 180] = { },
+[181] = { 5, 0, SEN(printargs), "osf_alt_plock" }, /* not implemented */
+[182 ... 183] = { },
+[184] = { 5, 0, SEN(printargs), "osf_getmnt" }, /* not implemented */
+[185 ... 186] = { },
+[187] = { 5, 0, SEN(printargs), "osf_alt_sigpending" }, /* not implemented */
+[188] = { 5, 0, SEN(printargs), "osf_alt_setsid" }, /* not implemented */
+[189 ... 198] = { },
+[199] = { 4, 0, SEN(printargs), "osf_swapon" },
+[200] = { 3, TI, SEN(msgctl), "msgctl" },
+[201] = { 2, TI, SEN(msgget), "msgget" },
+[202] = { 5, TI, SEN(msgrcv), "msgrcv" },
+[203] = { 4, TI, SEN(msgsnd), "msgsnd" },
+[204] = { 4, TI, SEN(semctl), "semctl" },
+[205] = { 3, TI, SEN(semget), "semget" },
+[206] = { 3, TI, SEN(semop), "semop" },
+[207] = { 1, 0, SEN(printargs), "osf_utsname" },
+[208] = { 3, TF, SEN(chown), "lchown" },
+[209] = { 3, TI|TM|SI, SEN(shmat), "osf_shmat" },
+[210] = { 3, TI, SEN(shmctl), "shmctl" },
+[211] = { 1, TI|TM|SI, SEN(shmdt), "shmdt" },
+[212] = { 3, TI, SEN(shmget), "shmget" },
+[213] = { 5, 0, SEN(printargs), "osf_mvalid" }, /* not implemented */
+[214] = { 5, 0, SEN(printargs), "osf_getaddressconf" }, /* not implemented */
+[215] = { 5, 0, SEN(printargs), "osf_msleep" }, /* not implemented */
+[216] = { 5, 0, SEN(printargs), "osf_mwakeup" }, /* not implemented */
+[217] = { 3, TM, SEN(msync), "msync" },
+[218] = { 5, 0, SEN(printargs), "osf_signal" }, /* not implemented */
+[219] = { 5, 0, SEN(printargs), "osf_utc_gettime" }, /* not implemented */
+[220] = { 5, TCL, SEN(printargs), "osf_utc_adjtime" }, /* not implemented */
+[221] = { },
+[222] = { 5, 0, SEN(printargs), "osf_security" }, /* not implemented */
+[223] = { 5, 0, SEN(printargs), "osf_kloadcall" }, /* not implemented */
+[224] = { 2, TF|TST|TSTA, SEN(printargs), "osf_stat" },
+[225] = { 2, TF|TLST|TSTA, SEN(printargs), "osf_lstat" },
+[226] = { 2, TD|TFST|TSTA, SEN(printargs), "osf_fstat" },
+[227] = { 3, TF|TSF|TSFA, SEN(osf_statfs), "osf_statfs64" },
+[228] = { 3, TD|TFSF|TSFA, SEN(osf_fstatfs), "osf_fstatfs64" },
+[229 ... 232] = { },
+[233] = { 1, 0, SEN(getpgid), "getpgid" },
+[234] = { 1, 0, SEN(getsid), "getsid" },
+[235] = { 2, TS, SEN(sigaltstack), "sigaltstack" },
+[236] = { 5, 0, SEN(printargs), "osf_waitid" }, /* not implemented */
+[237] = { 5, 0, SEN(printargs), "osf_priocntlset" }, /* not implemented */
+[238] = { 5, 0, SEN(printargs), "osf_sigsendset" }, /* not implemented */
+[239] = { 5, 0, SEN(printargs), "osf_set_speculative" }, /* not implemented */
+[240] = { 5, 0, SEN(printargs), "osf_msfs_syscall" }, /* not implemented */
+[241] = { 3, 0, SEN(printargs), "osf_sysinfo" },
+[242] = { 5, 0, SEN(printargs), "osf_uadmin" }, /* not implemented */
+[243] = { 5, 0, SEN(printargs), "osf_fuser" }, /* not implemented */
+[244] = { 2, 0, SEN(printargs), "osf_proplist_syscall" },
+[245] = { 5, TCL, SEN(printargs), "osf_ntp_adjtime" }, /* not implemented */
+[246] = { 5, 0, SEN(printargs), "osf_ntp_gettime" }, /* not implemented */
+[247] = { 5, 0, SEN(printargs), "osf_pathconf" }, /* not implemented */
+[248] = { 5, 0, SEN(printargs), "osf_fpathconf" }, /* not implemented */
+[249] = { },
+[250] = { 5, 0, SEN(printargs), "osf_uswitch" }, /* not implemented */
+[251] = { 2, 0, SEN(printargs), "osf_usleep_thread" },
+[252] = { 5, 0, SEN(printargs), "osf_audcntl" }, /* not implemented */
+[253] = { 5, 0, SEN(printargs), "osf_audgen" }, /* not implemented */
+[254] = { 3, 0, SEN(sysfs), "sysfs" },
+[255] = { 5, 0, SEN(printargs), "osf_subsys_info" }, /* not implemented */
+[256] = { 5, 0, SEN(printargs), "osf_getsysinfo" },
+[257] = { 5, 0, SEN(printargs), "osf_setsysinfo" },
+[258] = { 5, 0, SEN(printargs), "osf_afs_syscall" }, /* not implemented */
+[259] = { 5, 0, SEN(printargs), "osf_swapctl" }, /* not implemented */
+[260] = { 5, 0, SEN(printargs), "osf_memcntl" }, /* not implemented */
+[261] = { 5, 0, SEN(printargs), "osf_fdatasync" }, /* not implemented */
+[262 ... 299] = { },
+[300] = { 2, 0, SEN(bdflush), "bdflush" },
+[301] = { 1, 0, SEN(printargs), "sethae" },
+[302] = { 5, TF, SEN(mount), "mount" },
+[303] = { 1, TCL, SEN(adjtimex32), "old_adjtimex" },
+[304] = { 1, TF, SEN(swapoff), "swapoff" },
+[305] = { 3, TD, SEN(getdents), "getdents" },
+[306] = { 2, 0, SEN(create_module), "create_module" }, /* not implemented */
+[307] = { 3, 0, SEN(init_module), "init_module" },
+[308] = { 2, 0, SEN(delete_module), "delete_module" },
+[309] = { 1, 0, SEN(get_kernel_syms), "get_kernel_syms" }, /* not implemented */
+[310] = { 3, 0, SEN(syslog), "syslog" },
+[311] = { 4, 0, SEN(reboot), "reboot" },
+[312] = { 5, TP, SEN(clone), "clone" },
+[313] = { 1, TF, SEN(uselib), "uselib" },
+[314] = { 2, TM, SEN(mlock), "mlock" },
+[315] = { 2, TM, SEN(munlock), "munlock" },
+[316] = { 1, TM, SEN(mlockall), "mlockall" },
+[317] = { 0, TM, SEN(munlockall), "munlockall" },
+[318] = { 1, 0, SEN(sysinfo), "sysinfo" },
+[319] = { 1, 0, SEN(sysctl), "_sysctl" },
+[320] = { },
+[321] = { 1, TF, SEN(umount), "oldumount" },
+[322] = { 2, TF, SEN(swapon), "swapon" },
+[323] = { 1, 0, SEN(times), "times" },
+[324] = { 1, NF, SEN(personality), "personality" },
+[325] = { 1, TC|NF, SEN(setfsuid), "setfsuid" },
+[326] = { 1, TC|NF, SEN(setfsgid), "setfsgid" },
+[327] = { 2, TSFA, SEN(ustat), "ustat" },
+[328] = { 2, TF|TSF|TSFA, SEN(statfs), "statfs" },
+[329] = { 2, TD|TFSF|TSFA, SEN(fstatfs), "fstatfs" },
+[330] = { 2, 0, SEN(sched_setparam), "sched_setparam" },
+[331] = { 2, 0, SEN(sched_getparam), "sched_getparam" },
+[332] = { 3, 0, SEN(sched_setscheduler), "sched_setscheduler" },
+[333] = { 1, 0, SEN(sched_getscheduler), "sched_getscheduler" },
+[334] = { 0, 0, SEN(sched_yield), "sched_yield" },
+[335] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"},
+[336] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"},
+[337] = { 2, 0, SEN(sched_rr_get_interval_time64),"sched_rr_get_interval"},
+[338] = { 5, 0, SEN(afs_syscall), "afs_syscall" }, /* not implemented */
+[339] = { 1, 0, SEN(uname), "uname" },
+[340] = { 2, 0, SEN(nanosleep_time64), "nanosleep" },
+[341] = { 5, TM|SI, SEN(mremap), "mremap" },
+[342] = { 3, 0, SEN(nfsservctl), "nfsservctl" }, /* not implemented */
+[343] = { 3, TC, SEN(setresuid), "setresuid" },
+[344] = { 3, TC, SEN(getresuid), "getresuid" },
+[345] = { 5, 0, SEN(printargs), "pciconfig_read" },
+[346] = { 5, 0, SEN(printargs), "pciconfig_write" },
+[347] = { 5, 0, SEN(query_module), "query_module" }, /* not implemented */
+[348] = { 5, TC, SEN(prctl), "prctl" },
+[349] = { 4, TD, SEN(pread), "pread64" },
+[350] = { 4, TD, SEN(pwrite), "pwrite64" },
+[351] = { 0, TS, SEN(rt_sigreturn), "rt_sigreturn" },
+[352] = { 5, TS, SEN(rt_sigaction), "rt_sigaction" },
+[353] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" },
+[354] = { 2, TS, SEN(rt_sigpending), "rt_sigpending" },
+[355] = { 4, TS, SEN(rt_sigtimedwait_time64), "rt_sigtimedwait" },
+[356] = { 3, TS|TP, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" },
+[357] = { 2, TS, SEN(rt_sigsuspend), "rt_sigsuspend" },
+[358] = { 5, TD, SEN(select), "select" },
+[359] = { 2, TCL, SEN(gettimeofday), "gettimeofday" },
+[360] = { 2, TCL, SEN(settimeofday), "settimeofday" },
+[361] = { 2, 0, SEN(getitimer), "getitimer" },
+[362] = { 3, 0, SEN(setitimer), "setitimer" },
+[363] = { 2, TF, SEN(utimes), "utimes" },
+[364] = { 2, 0, SEN(getrusage), "getrusage" },
+[365] = { 4, TP, SEN(wait4), "wait4" },
+[366] = { 1, TCL, SEN(adjtimex64), "adjtimex" },
+[367] = { 2, TF, SEN(getcwd), "getcwd" },
+[368] = { 2, TC, SEN(capget), "capget" },
+[369] = { 2, TC, SEN(capset), "capset" },
+[370] = { 4, TD|TN, SEN(sendfile), "sendfile" },
+[371] = { 3, TC, SEN(setresgid), "setresgid" },
+[372] = { 3, TC, SEN(getresgid), "getresgid" },
+[373] = { 4, 0, SEN(printargs), "dipc" }, /* not implemented */
+[374] = { 2, TF, SEN(pivotroot), "pivot_root" },
+[375] = { 3, TM, SEN(mincore), "mincore" },
+[376] = { 3, 0, SEN(printargs), "pciconfig_iobase" },
+[377] = { 3, TD, SEN(getdents64), "getdents64" },
+[378] = { 0, PU|NF, SEN(gettid), "gettid" },
+[379] = { 3, TD, SEN(readahead), "readahead" },
+[380] = { },
+[381] = { 2, TS|TP, SEN(tkill), "tkill" },
+[382] = { 5, TF, SEN(setxattr), "setxattr" },
+[383] = { 5, TF, SEN(setxattr), "lsetxattr" },
+[384] = { 5, TD, SEN(fsetxattr), "fsetxattr" },
+[385] = { 4, TF, SEN(getxattr), "getxattr" },
+[386] = { 4, TF, SEN(getxattr), "lgetxattr" },
+[387] = { 4, TD, SEN(fgetxattr), "fgetxattr" },
+[388] = { 3, TF, SEN(listxattr), "listxattr" },
+[389] = { 3, TF, SEN(listxattr), "llistxattr" },
+[390] = { 3, TD, SEN(flistxattr), "flistxattr" },
+[391] = { 2, TF, SEN(removexattr), "removexattr" },
+[392] = { 2, TF, SEN(removexattr), "lremovexattr" },
+[393] = { 2, TD, SEN(fremovexattr), "fremovexattr" },
+[394] = { 6, 0, SEN(futex_time64), "futex" },
+[395] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" },
+[396] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" },
+[397] = { 5, 0, SEN(tuxcall), "tuxcall" }, /* not implemented */
+[398] = { 2, TM, SEN(io_setup), "io_setup" },
+[399] = { 1, TM, SEN(io_destroy), "io_destroy" },
+[400] = { 5, 0, SEN(io_getevents_time64), "io_getevents" },
+[401] = { 3, 0, SEN(io_submit), "io_submit" },
+[402] = { 3, 0, SEN(io_cancel), "io_cancel" },
+[403 ... 404] = { },
+[405] = { 1, TP|SE, SEN(exit), "exit_group" },
+[406] = { 3, 0, SEN(lookup_dcookie), "lookup_dcookie" },
+[407] = { 1, TD, SEN(epoll_create), "epoll_create" },
+[408] = { 4, TD, SEN(epoll_ctl), "epoll_ctl" },
+[409] = { 4, TD, SEN(epoll_wait), "epoll_wait" },
+[410] = { 5, TM|SI, SEN(remap_file_pages), "remap_file_pages" },
+[411] = { 1, 0, SEN(set_tid_address), "set_tid_address" },
+[412] = { 0, 0, SEN(restart_syscall), "restart_syscall" },
+[413] = { 4, TD, SEN(fadvise64), "fadvise64" },
+[414] = { 3, 0, SEN(timer_create), "timer_create" },
+[415] = { 4, 0, SEN(timer_settime64), "timer_settime" },
+[416] = { 2, 0, SEN(timer_gettime64), "timer_gettime" },
+[417] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" },
+[418] = { 1, 0, SEN(timer_delete), "timer_delete" },
+[419] = { 2, TCL, SEN(clock_settime64), "clock_settime" },
+[420] = { 2, TCL, SEN(clock_gettime64), "clock_gettime" },
+[421] = { 2, TCL, SEN(clock_getres_time64), "clock_getres" },
+[422] = { 4, 0, SEN(clock_nanosleep_time64), "clock_nanosleep" },
+[423] = { 4, TI, SEN(semtimedop_time64), "semtimedop" },
+[424] = { 3, TS|TP, SEN(tgkill), "tgkill" },
+[425] = { 2, TF|TST|TSTA, SEN(stat64), "stat64" },
+[426] = { 2, TF|TLST|TSTA, SEN(lstat64), "lstat64" },
+[427] = { 2, TD|TFST|TSTA, SEN(fstat64), "fstat64" },
+[428] = { 5, 0, SEN(vserver), "vserver" }, /* not implemented */
+[429] = { 6, TM, SEN(mbind), "mbind" }, /* not implemented */
+[430] = { 5, TM, SEN(get_mempolicy), "get_mempolicy" }, /* not implemented */
+[431] = { 3, TM, SEN(set_mempolicy), "set_mempolicy" }, /* not implemented */
+[432] = { 4, TD, SEN(mq_open), "mq_open" },
+[433] = { 1, 0, SEN(mq_unlink), "mq_unlink" },
+[434] = { 5, TD, SEN(mq_timedsend_time64), "mq_timedsend" },
+[435] = { 5, TD, SEN(mq_timedreceive_time64), "mq_timedreceive" },
+[436] = { 2, TD, SEN(mq_notify), "mq_notify" },
+[437] = { 3, TD, SEN(mq_getsetattr), "mq_getsetattr" },
+[438] = { 5, TP, SEN(waitid), "waitid" },
+[439] = { 5, 0, SEN(add_key), "add_key" },
+[440] = { 4, 0, SEN(request_key), "request_key" },
+[441] = { 5, 0, SEN(keyctl), "keyctl" },
+[442] = { 3, 0, SEN(ioprio_set), "ioprio_set" },
+[443] = { 2, 0, SEN(ioprio_get), "ioprio_get" },
+[444] = { 0, TD, SEN(inotify_init), "inotify_init" },
+[445] = { 3, TD|TF, SEN(inotify_add_watch), "inotify_add_watch" },
+[446] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" },
+[447] = { 1, TD, SEN(fdatasync), "fdatasync" },
+[448] = { 4, 0, SEN(kexec_load), "kexec_load" },
+[449] = { 4, TM, SEN(migrate_pages), "migrate_pages" },
+[450] = { 4, TD|TF, SEN(openat), "openat" },
+[451] = { 3, TD|TF, SEN(mkdirat), "mkdirat" },
+[452] = { 4, TD|TF, SEN(mknodat), "mknodat" },
+[453] = { 5, TD|TF, SEN(fchownat), "fchownat" },
+[454] = { 3, TD|TF, SEN(futimesat), "futimesat" },
+[455] = { 4, TD|TF|TFST|TSTA,SEN(fstatat64), "fstatat64" },
+[456] = { 3, TD|TF, SEN(unlinkat), "unlinkat" },
+[457] = { 4, TD|TF, SEN(renameat), "renameat" },
+[458] = { 5, TD|TF, SEN(linkat), "linkat" },
+[459] = { 3, TD|TF, SEN(symlinkat), "symlinkat" },
+[460] = { 4, TD|TF, SEN(readlinkat), "readlinkat" },
+[461] = { 3, TD|TF, SEN(fchmodat), "fchmodat" },
+[462] = { 3, TD|TF, SEN(faccessat), "faccessat" },
+[463] = { 6, TD, SEN(pselect6_time64), "pselect6" },
+[464] = { 5, TD, SEN(ppoll_time64), "ppoll" },
+[465] = { 1, 0, SEN(unshare), "unshare" },
+[466] = { 2, 0, SEN(set_robust_list), "set_robust_list" },
+[467] = { 3, 0, SEN(get_robust_list), "get_robust_list" },
+[468] = { 6, TD, SEN(splice), "splice" },
+[469] = { 4, TD, SEN(sync_file_range), "sync_file_range" },
+[470] = { 4, TD, SEN(tee), "tee" },
+[471] = { 4, TD, SEN(vmsplice), "vmsplice" },
+[472] = { 6, TM, SEN(move_pages), "move_pages" },
+[473] = { 3, 0, SEN(getcpu), "getcpu" },
+[474] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" },
+[475] = { 4, TD|TF, SEN(utimensat_time64), "utimensat" },
+[476] = { 3, TD|TS, SEN(signalfd), "signalfd" },
+[477] = { 4, TD, SEN(timerfd), "timerfd" }, /* not implemented */
+[478] = { 1, TD, SEN(eventfd), "eventfd" },
+[479] = { 5, TN, SEN(recvmmsg_time64), "recvmmsg" },
+[480] = { 4, TD, SEN(fallocate), "fallocate" },
+[481] = { 2, TD, SEN(timerfd_create), "timerfd_create" },
+[482] = { 4, TD, SEN(timerfd_settime64), "timerfd_settime" },
+[483] = { 2, TD, SEN(timerfd_gettime64), "timerfd_gettime" },
+[484] = { 4, TD|TS, SEN(signalfd4), "signalfd4" },
+[485] = { 2, TD, SEN(eventfd2), "eventfd2" },
+[486] = { 1, TD, SEN(epoll_create1), "epoll_create1" },
+[487] = { 3, TD, SEN(dup3), "dup3" },
+[488] = { 2, TD, SEN(pipe2), "pipe2" },
+[489] = { 1, TD, SEN(inotify_init1), "inotify_init1" },
+[490] = { 4, TD, SEN(preadv), "preadv" },
+[491] = { 4, TD, SEN(pwritev), "pwritev" },
+[492] = { 4, TP|TS, SEN(rt_tgsigqueueinfo), "rt_tgsigqueueinfo" },
+[493] = { 5, TD, SEN(perf_event_open), "perf_event_open" },
+[494] = { 2, TD, SEN(fanotify_init), "fanotify_init" },
+[495] = { 5, TD|TF, SEN(fanotify_mark), "fanotify_mark" },
+[496] = { 4, 0, SEN(prlimit64), "prlimit64" },
+[497] = { 5, TD|TF, SEN(name_to_handle_at), "name_to_handle_at" },
+[498] = { 3, TD, SEN(open_by_handle_at), "open_by_handle_at" },
+[499] = { 2, TCL, SEN(clock_adjtime64), "clock_adjtime" },
+[500] = { 1, TD, SEN(syncfs), "syncfs" },
+[501] = { 2, TD, SEN(setns), "setns" },
+[502] = { 4, TN, SEN(accept4), "accept4" },
+[503] = { 4, TN, SEN(sendmmsg), "sendmmsg" },
+[504] = { 6, 0, SEN(process_vm_readv), "process_vm_readv" },
+[505] = { 6, 0, SEN(process_vm_writev), "process_vm_writev" },
+[506] = { 5, 0, SEN(kcmp), "kcmp" },
+[507] = { 3, TD, SEN(finit_module), "finit_module" },
+[508] = { 3, 0, SEN(sched_setattr), "sched_setattr" },
+[509] = { 4, 0, SEN(sched_getattr), "sched_getattr" },
+[510] = { 5, TD|TF, SEN(renameat2), "renameat2" },
+[511] = { 3, 0, SEN(getrandom), "getrandom" },
+[512] = { 2, TD, SEN(memfd_create), "memfd_create" },
+[513] = { 5, TD|TF|TP|TSD|SE|SI, SEN(execveat), "execveat" },
+[514] = { 3, 0, SEN(seccomp), "seccomp" },
+[515] = { 3, TD, SEN(bpf), "bpf" },
+[516] = { 1, TD, SEN(userfaultfd), "userfaultfd" },
+[517] = { 3, 0, SEN(membarrier), "membarrier" },
+[518] = { 3, TM, SEN(mlock2), "mlock2" },
+[519] = { 6, TD, SEN(copy_file_range), "copy_file_range" },
+[520] = { 6, TD, SEN(preadv2), "preadv2" },
+[521] = { 6, TD, SEN(pwritev2), "pwritev2" },
+[522] = { 5, TD|TF|TFST|TSTA,SEN(statx), "statx" },
+[523] = { 6, 0, SEN(io_pgetevents_time64), "io_pgetevents" },
+[524] = { 4, TM|SI, SEN(pkey_mprotect), "pkey_mprotect" },
+[525] = { 2, 0, SEN(pkey_alloc), "pkey_alloc" },
+[526] = { 1, 0, SEN(pkey_free), "pkey_free" },
+[527] = { 4, 0, SEN(rseq), "rseq" },
+[528] = { 3, TF|TSF|TSFA, SEN(statfs64), "statfs64" },
+[529] = { 3, TD|TFSF|TSFA, SEN(fstatfs64), "fstatfs64" },
+[530] = { 0, TC|PU|NF, SEN(getegid), "getegid" },
+[531] = { 0, TC|PU|NF, SEN(geteuid), "geteuid" },
+[532] = { 0, PU|NF, SEN(getppid), "getppid" },
+/* all other architectures have common numbers for new syscalls, alpha is the exception */
+/* 534 - 424 == 110 */
+#define BASE_NR 110
+#include "syscallent-common.h"
+#undef BASE_NR
diff --git a/src/linux/alpha/userent.h b/src/linux/alpha/userent.h
new file mode 100644
index 000000000..fa5240f3a
--- /dev/null
+++ b/src/linux/alpha/userent.h
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2014-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+{ 0, "r0" },
+{ 1, "r1" },
+{ 2, "r2" },
+{ 3, "r3" },
+{ 4, "r4" },
+{ 5, "r5" },
+{ 6, "r6" },
+{ 7, "r7" },
+{ 8, "r8" },
+{ 9, "r9" },
+{ 10, "r10" },
+{ 11, "r11" },
+{ 12, "r12" },
+{ 13, "r13" },
+{ 14, "r14" },
+{ 15, "r15" },
+{ 16, "r16" },
+{ 17, "r17" },
+{ 18, "r18" },
+{ 19, "r19" },
+{ 20, "r20" },
+{ 21, "r21" },
+{ 22, "r22" },
+{ 23, "r23" },
+{ 24, "r24" },
+{ 25, "r25" },
+{ 26, "r26" },
+{ 27, "r27" },
+{ 28, "r28" },
+{ 29, "gp" },
+{ 30, "fp" },
+{ 31, "zero" },
+{ 32, "fp0" },
+{ 33, "fp" },
+{ 34, "fp2" },
+{ 35, "fp3" },
+{ 36, "fp4" },
+{ 37, "fp5" },
+{ 38, "fp6" },
+{ 39, "fp7" },
+{ 40, "fp8" },
+{ 41, "fp9" },
+{ 42, "fp10" },
+{ 43, "fp11" },
+{ 44, "fp12" },
+{ 45, "fp13" },
+{ 46, "fp14" },
+{ 47, "fp15" },
+{ 48, "fp16" },
+{ 49, "fp17" },
+{ 50, "fp18" },
+{ 51, "fp19" },
+{ 52, "fp20" },
+{ 53, "fp21" },
+{ 54, "fp22" },
+{ 55, "fp23" },
+{ 56, "fp24" },
+{ 57, "fp25" },
+{ 58, "fp26" },
+{ 59, "fp27" },
+{ 60, "fp28" },
+{ 61, "fp29" },
+{ 62, "fp30" },
+{ 63, "fp31" },
+{ 64, "pc" },
+/* Other fields in "struct user" */
+#include "../userent0.h"
diff --git a/src/linux/arc/arch_regs.c b/src/linux/arc/arch_regs.c
new file mode 100644
index 000000000..ee11f21b1
--- /dev/null
+++ b/src/linux/arc/arch_regs.c
@@ -0,0 +1,11 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static struct user_regs_struct arc_regs;
+#define ARCH_REGS_FOR_GETREGSET arc_regs
+#define ARCH_PC_REG arc_regs.efa
+#define ARCH_SP_REG arc_regs.scratch.sp
diff --git a/src/linux/arc/get_error.c b/src/linux/arc/get_error.c
new file mode 100644
index 000000000..791a0aabd
--- /dev/null
+++ b/src/linux/arc/get_error.c
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "negated_errno.h"
+
+static void
+arch_get_error(struct tcb *tcp, const bool check_errno)
+{
+ if (check_errno && is_negated_errno(arc_regs.scratch.r0)) {
+ tcp->u_rval = -1;
+ tcp->u_error = -arc_regs.scratch.r0;
+ } else {
+ tcp->u_rval = arc_regs.scratch.r0;
+ }
+}
diff --git a/src/linux/arc/get_scno.c b/src/linux/arc/get_scno.c
new file mode 100644
index 000000000..4d9a93e60
--- /dev/null
+++ b/src/linux/arc/get_scno.c
@@ -0,0 +1,14 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+/* Return codes: 1 - ok, 0 - ignore, other - error. */
+static int
+arch_get_scno(struct tcb *tcp)
+{
+ tcp->scno = arc_regs.scratch.r8;
+ return 1;
+}
diff --git a/src/linux/arc/get_syscall_args.c b/src/linux/arc/get_syscall_args.c
new file mode 100644
index 000000000..94b886ea2
--- /dev/null
+++ b/src/linux/arc/get_syscall_args.c
@@ -0,0 +1,18 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+/* Return -1 on error or 1 on success (never 0!). */
+static int
+arch_get_syscall_args(struct tcb *tcp)
+{
+ unsigned long *arc_args = &arc_regs.scratch.r0;
+ unsigned int i;
+
+ for (i = 0; i < MAX_ARGS; ++i)
+ tcp->u_arg[i] = *arc_args--;
+ return 1;
+}
diff --git a/src/linux/arc/ioctls_arch0.h b/src/linux/arc/ioctls_arch0.h
new file mode 100644
index 000000000..2103d5b0f
--- /dev/null
+++ b/src/linux/arc/ioctls_arch0.h
@@ -0,0 +1 @@
+/* Generated by ioctls_gen.sh from definitions found in $linux/arch/arc/include/ tree. */
diff --git a/src/linux/arc/ioctls_inc0.h b/src/linux/arc/ioctls_inc0.h
new file mode 100644
index 000000000..4aecf983e
--- /dev/null
+++ b/src/linux/arc/ioctls_inc0.h
@@ -0,0 +1 @@
+#include "32/ioctls_inc.h"
diff --git a/src/linux/arc/raw_syscall.h b/src/linux/arc/raw_syscall.h
new file mode 100644
index 000000000..f51c84ecd
--- /dev/null
+++ b/src/linux/arc/raw_syscall.h
@@ -0,0 +1,41 @@
+/*
+ * Raw syscalls.
+ *
+ * Copyright (c) 2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_RAW_SYSCALL_H
+# define STRACE_RAW_SYSCALL_H
+
+# include "kernel_types.h"
+
+static inline kernel_ulong_t
+raw_syscall_0(const kernel_ulong_t nr, kernel_ulong_t *err)
+{
+ *err = 0;
+ register kernel_ulong_t r8 __asm__("r8") = nr;
+ register kernel_ulong_t r0 __asm__("r0");
+
+# ifdef __A7__
+# define ARC_TRAP_INSN "trap0"
+# elif defined __HS__
+# define ARC_TRAP_INSN "trap_s 0 "
+# else
+# error unrecognized arc
+# endif
+
+ __asm__ __volatile__(ARC_TRAP_INSN
+ : "=r"(r0)
+ : "r"(r8)
+ : "memory");
+
+# undef ARC_TRAP_INSN
+
+ return r0;
+}
+# define raw_syscall_0 raw_syscall_0
+
+#endif /* !STRACE_RAW_SYSCALL_H */
diff --git a/src/linux/arc/set_error.c b/src/linux/arc/set_error.c
new file mode 100644
index 000000000..546362e43
--- /dev/null
+++ b/src/linux/arc/set_error.c
@@ -0,0 +1,20 @@
+/*
+ * Copyright (c) 2016-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static int
+arch_set_error(struct tcb *tcp)
+{
+ arc_regs.scratch.r0 = -tcp->u_error;
+ return set_regs(tcp->pid);
+}
+
+static int
+arch_set_success(struct tcb *tcp)
+{
+ arc_regs.scratch.r0 = tcp->u_rval;
+ return set_regs(tcp->pid);
+}
diff --git a/src/linux/arc/set_scno.c b/src/linux/arc/set_scno.c
new file mode 100644
index 000000000..9433655a6
--- /dev/null
+++ b/src/linux/arc/set_scno.c
@@ -0,0 +1,15 @@
+/*
+ * Copyright (c) 2016-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static int
+arch_set_scno(struct tcb *tcp, kernel_ulong_t scno)
+{
+ if (ptrace_syscall_info_is_valid() && get_regs(tcp) < 0)
+ return -1;
+ arc_regs.scratch.r8 = scno;
+ return set_regs(tcp->pid);
+}
diff --git a/src/linux/arc/syscallent.h b/src/linux/arc/syscallent.h
new file mode 100644
index 000000000..aed2e55a6
--- /dev/null
+++ b/src/linux/arc/syscallent.h
@@ -0,0 +1,15 @@
+/*
+ * Copyright (c) 2013-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#define sys_ARCH_mmap sys_mmap_pgoff
+#include "32/syscallent.h"
+/* [244 ... 259] are arch specific */
+[244] = { 3, 0, SEN(printargs), "cacheflush" },
+[245] = { 1, 0, SEN(printargs), "arc_settls" },
+[246] = { 0, PU|NF, SEN(printargs), "arc_gettls" },
+[247] = { 3, 0, SEN(sysfs), "sysfs" },
+[248] = { 3, 0, SEN(printargs), "arc_usr_cmpxchg"},
diff --git a/src/linux/arch_defs_.h b/src/linux/arch_defs_.h
new file mode 100644
index 000000000..eb2f97eb9
--- /dev/null
+++ b/src/linux/arch_defs_.h
@@ -0,0 +1,76 @@
+/*
+ * Fallback file for arch-specific definitions.
+ *
+ * Copyright (c) 2018-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef HAVE_ARCH_GETRVAL2
+# define HAVE_ARCH_GETRVAL2 0
+#endif
+
+#ifndef HAVE_ARCH_OLD_MMAP
+# define HAVE_ARCH_OLD_MMAP 0
+#endif
+
+#ifndef HAVE_ARCH_OLD_MMAP_PGOFF
+# define HAVE_ARCH_OLD_MMAP_PGOFF 0
+#endif
+
+#ifndef HAVE_ARCH_OLD_SELECT
+# define HAVE_ARCH_OLD_SELECT 0
+#endif
+
+#ifndef HAVE_ARCH_UID16_SYSCALLS
+# define HAVE_ARCH_UID16_SYSCALLS 0
+#endif
+
+#ifndef DEFAULT_PERSONALITY
+# define DEFAULT_PERSONALITY 0
+#endif
+
+#ifndef SUPPORTED_PERSONALITIES
+# define SUPPORTED_PERSONALITIES 1
+#endif
+
+#ifndef HAVE_ARCH_DEDICATED_ERR_REG
+# define HAVE_ARCH_DEDICATED_ERR_REG 0
+#endif
+
+#ifndef CAN_ARCH_BE_COMPAT_ON_64BIT_KERNEL
+# define CAN_ARCH_BE_COMPAT_ON_64BIT_KERNEL 0
+#endif
+
+#ifndef ARCH_NEEDS_SET_ERROR_FOR_SCNO_TAMPERING
+# define ARCH_NEEDS_SET_ERROR_FOR_SCNO_TAMPERING 0
+#endif
+
+#ifndef MIN_WORDSIZE
+# if SUPPORTED_PERSONALITIES > 1
+# define MIN_WORDSIZE 4
+# else
+# define MIN_WORDSIZE SIZEOF_LONG
+# endif
+#endif
+
+#ifndef HAVE_ARCH_TIME32_SYSCALLS
+# define HAVE_ARCH_TIME32_SYSCALLS (MIN_WORDSIZE == 4)
+#endif
+
+#ifndef HAVE_ARCH_OLD_TIME64_SYSCALLS
+# define HAVE_ARCH_OLD_TIME64_SYSCALLS (SIZEOF_LONG == 8)
+#endif
+
+#ifndef MIN_KLONGSIZE
+# if SUPPORTED_PERSONALITIES > 1
+# define MIN_KLONGSIZE 4
+# else
+# define MIN_KLONGSIZE SIZEOF_KERNEL_LONG_T
+# endif
+#endif
+
+#ifndef HAVE_ARCH_TIMESPEC32
+# define HAVE_ARCH_TIMESPEC32 (MIN_KLONGSIZE == 4)
+#endif
diff --git a/src/linux/arch_kvm.c b/src/linux/arch_kvm.c
new file mode 100644
index 000000000..c7ae7b7be
--- /dev/null
+++ b/src/linux/arch_kvm.c
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2017-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifdef HAVE_STRUCT_KVM_REGS
+static void
+arch_print_kvm_regs(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const struct kvm_regs *const regs)
+{
+ printaddr(addr);
+}
+#endif /* HAVE_STRUCT_KVM_REGS */
+
+#ifdef HAVE_STRUCT_KVM_SREGS
+static void
+arch_print_kvm_sregs(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const struct kvm_sregs *const sregs)
+{
+ printaddr(addr);
+}
+#endif /* HAVE_STRUCT_KVM_SREGS */
diff --git a/src/linux/arch_regs.h b/src/linux/arch_regs.h
new file mode 100644
index 000000000..da84fa5f6
--- /dev/null
+++ b/src/linux/arch_regs.h
@@ -0,0 +1 @@
+/* nothing */
diff --git a/src/linux/arch_rt_sigframe.c b/src/linux/arch_rt_sigframe.c
new file mode 100644
index 000000000..24c3c0fcf
--- /dev/null
+++ b/src/linux/arch_rt_sigframe.c
@@ -0,0 +1,14 @@
+/*
+ * Copyright (c) 2017-2018 Dmitry V. Levin <ldv@strace.io>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+/* This is a generic definition for compatible architectures. */
+
+FUNC_GET_RT_SIGFRAME_ADDR
+{
+ kernel_ulong_t sp;
+ return get_stack_pointer(tcp, &sp) ? sp : 0;
+}
diff --git a/src/linux/arch_sigreturn.c b/src/linux/arch_sigreturn.c
new file mode 100644
index 000000000..318901a9b
--- /dev/null
+++ b/src/linux/arch_sigreturn.c
@@ -0,0 +1,11 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static void
+arch_sigreturn(struct tcb *tcp)
+{
+}
diff --git a/src/linux/arm/arch_defs_.h b/src/linux/arm/arch_defs_.h
new file mode 100644
index 000000000..0b2f3b0d6
--- /dev/null
+++ b/src/linux/arm/arch_defs_.h
@@ -0,0 +1,11 @@
+/*
+ * Copyright (c) 2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#define HAVE_ARCH_OLD_MMAP 1
+#define HAVE_ARCH_OLD_SELECT 1
+#define HAVE_ARCH_UID16_SYSCALLS 1
+#define CAN_ARCH_BE_COMPAT_ON_64BIT_KERNEL 1
diff --git a/src/linux/arm/arch_regs.c b/src/linux/arm/arch_regs.c
new file mode 100644
index 000000000..bc453bb79
--- /dev/null
+++ b/src/linux/arm/arch_regs.c
@@ -0,0 +1,12 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static struct pt_regs arm_regs;
+
+#define ARCH_REGS_FOR_GETREGS arm_regs
+#define ARCH_PC_REG arm_regs.ARM_pc
+#define ARCH_SP_REG arm_regs.ARM_sp
diff --git a/src/linux/arm/arch_sigreturn.c b/src/linux/arm/arch_sigreturn.c
new file mode 100644
index 000000000..3b1ee64ac
--- /dev/null
+++ b/src/linux/arm/arch_sigreturn.c
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static void
+arch_sigreturn(struct tcb *tcp)
+{
+ kernel_ulong_t sp;
+ if (!get_stack_pointer(tcp, &sp))
+ return;
+
+#define SIZEOF_STRUCT_SIGINFO 128
+#define SIZEOF_STRUCT_SIGCONTEXT (21 * 4)
+#define OFFSETOF_STRUCT_UCONTEXT_UC_SIGMASK (5 * 4 + SIZEOF_STRUCT_SIGCONTEXT)
+
+ const kernel_ulong_t addr =
+#ifdef AARCH64
+ tcp->currpers == 0 ?
+ (sp + SIZEOF_STRUCT_SIGINFO +
+ offsetof(ucontext_t, uc_sigmask)) :
+#endif
+ (sp + OFFSETOF_STRUCT_UCONTEXT_UC_SIGMASK);
+
+ print_sigset_addr(tcp, addr);
+}
diff --git a/src/linux/arm/get_error.c b/src/linux/arm/get_error.c
new file mode 100644
index 000000000..df0571c9e
--- /dev/null
+++ b/src/linux/arm/get_error.c
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "negated_errno.h"
+
+static void
+arch_get_error(struct tcb *tcp, const bool check_errno)
+{
+ if (check_errno && is_negated_errno(arm_regs.ARM_r0)) {
+ tcp->u_rval = -1;
+ tcp->u_error = -arm_regs.ARM_r0;
+ } else {
+ tcp->u_rval = arm_regs.ARM_r0;
+ }
+}
diff --git a/src/linux/arm/get_scno.c b/src/linux/arm/get_scno.c
new file mode 100644
index 000000000..fde0f83c9
--- /dev/null
+++ b/src/linux/arm/get_scno.c
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2003 Russell King <rmk@arm.linux.org.uk>
+ * Copyright (c) 2011-2013 Denys Vlasenko <vda.linux@googlemail.com>
+ * Copyright (c) 2011-2015 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+/* Return codes: 1 - ok, 0 - ignore, other - error. */
+static int
+arch_get_scno(struct tcb *tcp)
+{
+ kernel_ulong_t scno = 0;
+
+ /* Note: we support only 32-bit CPUs, not 26-bit */
+
+#if !defined(__ARM_EABI__) || ENABLE_ARM_OABI
+ if (arm_regs.ARM_cpsr & 0x20) {
+ /* Thumb mode */
+ goto scno_in_r7;
+ }
+ /* ARM mode */
+ /* Check EABI/OABI by examining SVC insn's low 24 bits */
+ errno = 0;
+ scno = ptrace(PTRACE_PEEKTEXT, tcp->pid, (void *)(arm_regs.ARM_pc - 4), NULL);
+ if (errno)
+ return -1;
+ /* EABI syscall convention? */
+ if (scno != 0xef000000) {
+ /* No, it's OABI */
+ if ((scno & 0x0ff00000) != 0x0f900000) {
+ error_msg("pid %d unknown syscall trap 0x%08lx",
+ tcp->pid, scno);
+ return -1;
+ }
+ /* Fixup the syscall number */
+ scno &= 0x000fffff;
+ } else {
+scno_in_r7:
+ scno = arm_regs.ARM_r7;
+ }
+#else /* __ARM_EABI__ || !ENABLE_ARM_OABI */
+
+ scno = arm_regs.ARM_r7;
+
+#endif
+
+ /*
+ * Do some sanity checks to figure out
+ * whether it's really a syscall entry.
+ */
+ if (arm_regs.ARM_ip && !scno_in_range(scno)) {
+ debug_msg("pid %d stray syscall exit: ARM_ip = %ld, scno = %ld",
+ tcp->pid, arm_regs.ARM_ip, scno);
+ return 0;
+ }
+
+ tcp->scno = scno;
+ return 1;
+}
diff --git a/src/linux/arm/get_syscall_args.c b/src/linux/arm/get_syscall_args.c
new file mode 100644
index 000000000..bc8e9c4ab
--- /dev/null
+++ b/src/linux/arm/get_syscall_args.c
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+/* Return -1 on error or 1 on success (never 0!). */
+static int
+arch_get_syscall_args(struct tcb *tcp)
+{
+ tcp->u_arg[0] = arm_regs.uregs[0];
+ tcp->u_arg[1] = arm_regs.uregs[1];
+ tcp->u_arg[2] = arm_regs.uregs[2];
+ tcp->u_arg[3] = arm_regs.uregs[3];
+ tcp->u_arg[4] = arm_regs.uregs[4];
+ tcp->u_arg[5] = arm_regs.uregs[5];
+ return 1;
+}
diff --git a/src/linux/arm/ioctls_arch0.h b/src/linux/arm/ioctls_arch0.h
new file mode 100644
index 000000000..35d9ce8c0
--- /dev/null
+++ b/src/linux/arm/ioctls_arch0.h
@@ -0,0 +1,75 @@
+/* Generated by ioctls_gen.sh from definitions found in $linux/arch/arm/include/ tree. */
+{ "asm/ioctls.h", "FIOQSIZE", 0, 0x545E, 0 },
+{ "linux/kvm.h", "KVM_ARM_PREFERRED_TARGET", _IOC_READ, 0xaeaf, 0x20 },
+{ "linux/kvm.h", "KVM_ARM_SET_DEVICE_ADDR", _IOC_WRITE, 0xaeab, 0x10 },
+{ "linux/kvm.h", "KVM_ARM_VCPU_FINALIZE", _IOC_WRITE, 0xaec2, 0x04 },
+{ "linux/kvm.h", "KVM_ARM_VCPU_INIT", _IOC_WRITE, 0xaeae, 0x20 },
+{ "linux/kvm.h", "KVM_ASSIGN_DEV_IRQ", _IOC_WRITE, 0xae70, 0x40 },
+{ "linux/kvm.h", "KVM_ASSIGN_PCI_DEVICE", _IOC_READ, 0xae69, 0x40 },
+{ "linux/kvm.h", "KVM_ASSIGN_SET_INTX_MASK", _IOC_WRITE, 0xaea4, 0x40 },
+{ "linux/kvm.h", "KVM_ASSIGN_SET_MSIX_ENTRY", _IOC_WRITE, 0xae74, 0x10 },
+{ "linux/kvm.h", "KVM_ASSIGN_SET_MSIX_NR", _IOC_WRITE, 0xae73, 0x08 },
+{ "linux/kvm.h", "KVM_CHECK_EXTENSION", _IOC_NONE, 0xae03, 0x00 },
+{ "linux/kvm.h", "KVM_CLEAR_DIRTY_LOG", _IOC_READ|_IOC_WRITE, 0xaec0, 0x18 },
+{ "linux/kvm.h", "KVM_CREATE_DEVICE", _IOC_READ|_IOC_WRITE, 0xaee0, 0x0c },
+{ "linux/kvm.h", "KVM_CREATE_IRQCHIP", _IOC_NONE, 0xae60, 0x00 },
+{ "linux/kvm.h", "KVM_CREATE_PIT", _IOC_NONE, 0xae64, 0x00 },
+{ "linux/kvm.h", "KVM_CREATE_PIT2", _IOC_WRITE, 0xae77, 0x40 },
+{ "linux/kvm.h", "KVM_CREATE_VCPU", _IOC_NONE, 0xae41, 0x00 },
+{ "linux/kvm.h", "KVM_CREATE_VM", _IOC_NONE, 0xae01, 0x00 },
+{ "linux/kvm.h", "KVM_DEASSIGN_DEV_IRQ", _IOC_WRITE, 0xae75, 0x40 },
+{ "linux/kvm.h", "KVM_DEASSIGN_PCI_DEVICE", _IOC_WRITE, 0xae72, 0x40 },
+{ "linux/kvm.h", "KVM_DIRTY_TLB", _IOC_WRITE, 0xaeaa, 0x10 },
+{ "linux/kvm.h", "KVM_ENABLE_CAP", _IOC_WRITE, 0xaea3, 0x68 },
+{ "linux/kvm.h", "KVM_GET_API_VERSION", _IOC_NONE, 0xae00, 0x00 },
+{ "linux/kvm.h", "KVM_GET_CLOCK", _IOC_READ, 0xae7c, 0x30 },
+{ "linux/kvm.h", "KVM_GET_DEVICE_ATTR", _IOC_WRITE, 0xaee2, 0x18 },
+{ "linux/kvm.h", "KVM_GET_DIRTY_LOG", _IOC_WRITE, 0xae42, 0x10 },
+{ "linux/kvm.h", "KVM_GET_FPU", _IOC_READ, 0xae8c, 0x00 },
+{ "linux/kvm.h", "KVM_GET_IRQCHIP", _IOC_READ|_IOC_WRITE, 0xae62, 0x208 },
+{ "linux/kvm.h", "KVM_GET_MP_STATE", _IOC_READ, 0xae98, 0x04 },
+{ "linux/kvm.h", "KVM_GET_NR_MMU_PAGES", _IOC_NONE, 0xae45, 0x00 },
+{ "linux/kvm.h", "KVM_GET_ONE_REG", _IOC_WRITE, 0xaeab, 0x10 },
+{ "linux/kvm.h", "KVM_GET_REGS", _IOC_READ, 0xae81, 0x98 },
+{ "linux/kvm.h", "KVM_GET_REG_LIST", _IOC_READ|_IOC_WRITE, 0xaeb0, 0x08 },
+{ "linux/kvm.h", "KVM_GET_SREGS", _IOC_READ, 0xae83, 0x00 },
+{ "linux/kvm.h", "KVM_GET_TSC_KHZ", _IOC_NONE, 0xaea3, 0x00 },
+{ "linux/kvm.h", "KVM_GET_VCPU_MMAP_SIZE", _IOC_NONE, 0xae04, 0x00 },
+{ "linux/kvm.h", "KVM_HAS_DEVICE_ATTR", _IOC_WRITE, 0xaee3, 0x18 },
+{ "linux/kvm.h", "KVM_INTERRUPT", _IOC_WRITE, 0xae86, 0x04 },
+{ "linux/kvm.h", "KVM_IOEVENTFD", _IOC_WRITE, 0xae79, 0x40 },
+{ "linux/kvm.h", "KVM_IRQFD", _IOC_WRITE, 0xae76, 0x20 },
+{ "linux/kvm.h", "KVM_IRQ_LINE", _IOC_WRITE, 0xae61, 0x08 },
+{ "linux/kvm.h", "KVM_IRQ_LINE_STATUS", _IOC_READ|_IOC_WRITE, 0xae67, 0x08 },
+{ "linux/kvm.h", "KVM_KVMCLOCK_CTRL", _IOC_NONE, 0xaead, 0x00 },
+{ "linux/kvm.h", "KVM_MEMORY_ENCRYPT_OP", _IOC_READ|_IOC_WRITE, 0xaeba, 0x04 },
+{ "linux/kvm.h", "KVM_MEMORY_ENCRYPT_REG_REGION", _IOC_READ, 0xaebb, 0x10 },
+{ "linux/kvm.h", "KVM_MEMORY_ENCRYPT_UNREG_REGION", _IOC_READ, 0xaebc, 0x10 },
+{ "linux/kvm.h", "KVM_NMI", _IOC_NONE, 0xae9a, 0x00 },
+{ "linux/kvm.h", "KVM_REGISTER_COALESCED_MMIO", _IOC_WRITE, 0xae67, 0x10 },
+{ "linux/kvm.h", "KVM_REINJECT_CONTROL", _IOC_NONE, 0xae71, 0x00 },
+{ "linux/kvm.h", "KVM_RUN", _IOC_NONE, 0xae80, 0x00 },
+{ "linux/kvm.h", "KVM_SET_BOOT_CPU_ID", _IOC_NONE, 0xae78, 0x00 },
+{ "linux/kvm.h", "KVM_SET_CLOCK", _IOC_WRITE, 0xae7b, 0x30 },
+{ "linux/kvm.h", "KVM_SET_DEVICE_ATTR", _IOC_WRITE, 0xaee1, 0x18 },
+{ "linux/kvm.h", "KVM_SET_FPU", _IOC_WRITE, 0xae8d, 0x00 },
+{ "linux/kvm.h", "KVM_SET_GSI_ROUTING", _IOC_WRITE, 0xae6a, 0x08 },
+{ "linux/kvm.h", "KVM_SET_GUEST_DEBUG", _IOC_WRITE, 0xae9b, 0x08 },
+{ "linux/kvm.h", "KVM_SET_IDENTITY_MAP_ADDR", _IOC_WRITE, 0xae48, 0x08 },
+{ "linux/kvm.h", "KVM_SET_IRQCHIP", _IOC_READ, 0xae63, 0x208 },
+{ "linux/kvm.h", "KVM_SET_MEMORY_REGION", _IOC_WRITE, 0xae40, 0x18 },
+{ "linux/kvm.h", "KVM_SET_MP_STATE", _IOC_WRITE, 0xae99, 0x04 },
+{ "linux/kvm.h", "KVM_SET_NR_MMU_PAGES", _IOC_NONE, 0xae44, 0x00 },
+{ "linux/kvm.h", "KVM_SET_ONE_REG", _IOC_WRITE, 0xaeac, 0x10 },
+{ "linux/kvm.h", "KVM_SET_REGS", _IOC_WRITE, 0xae82, 0x98 },
+{ "linux/kvm.h", "KVM_SET_SIGNAL_MASK", _IOC_WRITE, 0xae8b, 0x04 },
+{ "linux/kvm.h", "KVM_SET_SREGS", _IOC_WRITE, 0xae84, 0x00 },
+{ "linux/kvm.h", "KVM_SET_TSC_KHZ", _IOC_NONE, 0xaea2, 0x00 },
+{ "linux/kvm.h", "KVM_SET_TSS_ADDR", _IOC_NONE, 0xae47, 0x00 },
+{ "linux/kvm.h", "KVM_SET_USER_MEMORY_REGION", _IOC_WRITE, 0xae46, 0x20 },
+{ "linux/kvm.h", "KVM_SET_VAPIC_ADDR", _IOC_WRITE, 0xae93, 0x08 },
+{ "linux/kvm.h", "KVM_SIGNAL_MSI", _IOC_WRITE, 0xaea5, 0x20 },
+{ "linux/kvm.h", "KVM_SMI", _IOC_NONE, 0xaeb7, 0x00 },
+{ "linux/kvm.h", "KVM_TPR_ACCESS_REPORTING", _IOC_READ|_IOC_WRITE, 0xae92, 0x28 },
+{ "linux/kvm.h", "KVM_TRANSLATE", _IOC_READ|_IOC_WRITE, 0xae85, 0x18 },
+{ "linux/kvm.h", "KVM_UNREGISTER_COALESCED_MMIO", _IOC_WRITE, 0xae68, 0x10 },
diff --git a/src/linux/arm/ioctls_inc0.h b/src/linux/arm/ioctls_inc0.h
new file mode 100644
index 000000000..4aecf983e
--- /dev/null
+++ b/src/linux/arm/ioctls_inc0.h
@@ -0,0 +1 @@
+#include "32/ioctls_inc.h"
diff --git a/src/linux/arm/nr_prefix.c b/src/linux/arm/nr_prefix.c
new file mode 100644
index 000000000..bbbcf80b3
--- /dev/null
+++ b/src/linux/arm/nr_prefix.c
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static inline const char *
+nr_prefix(kernel_ulong_t scno)
+{
+ /*
+ * For now, the set of syscalls that are shuffled is equivalent to the
+ * set of syscalls that have __ARM_NR_ prefix.
+ */
+ if (shuffle_scno(scno) != scno)
+ return "__ARM_NR_";
+ else
+ return "__NR_";
+}
diff --git a/src/linux/arm/raw_syscall.h b/src/linux/arm/raw_syscall.h
new file mode 100644
index 000000000..c052a2983
--- /dev/null
+++ b/src/linux/arm/raw_syscall.h
@@ -0,0 +1,44 @@
+/*
+ * Raw syscalls.
+ *
+ * Copyright (c) 2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_RAW_SYSCALL_H
+# define STRACE_RAW_SYSCALL_H
+
+# include "kernel_types.h"
+
+static inline kernel_ulong_t
+raw_syscall_0(const kernel_ulong_t nr, kernel_ulong_t *err)
+{
+ *err = 0;
+
+# ifdef __thumb__ /* && FRAME_POINTERS_ENABLED */
+
+ register kernel_ulong_t rt;
+ register kernel_ulong_t r0 __asm__("r0");
+ __asm__ __volatile__("mov %1,r7; mov r7,%2; swi 0x0; mov r7,%1"
+ : "=r"(r0), "=&r"(rt)
+ : "r"(nr)
+ : "memory");
+
+# else
+
+ register kernel_ulong_t r7 __asm__("r7") = nr;
+ register kernel_ulong_t r0 __asm__("r0");
+ __asm__ __volatile__("swi 0x0"
+ : "=r"(r0)
+ : "r"(r7)
+ : "memory");
+
+# endif
+
+ return r0;
+}
+# define raw_syscall_0 raw_syscall_0
+
+#endif /* !STRACE_RAW_SYSCALL_H */
diff --git a/src/linux/arm/set_error.c b/src/linux/arm/set_error.c
new file mode 100644
index 000000000..8b754dca1
--- /dev/null
+++ b/src/linux/arm/set_error.c
@@ -0,0 +1,20 @@
+/*
+ * Copyright (c) 2016-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static int
+arch_set_error(struct tcb *tcp)
+{
+ arm_regs.ARM_r0 = -tcp->u_error;
+ return set_regs(tcp->pid);
+}
+
+static int
+arch_set_success(struct tcb *tcp)
+{
+ arm_regs.ARM_r0 = tcp->u_rval;
+ return set_regs(tcp->pid);
+}
diff --git a/src/linux/arm/set_scno.c b/src/linux/arm/set_scno.c
new file mode 100644
index 000000000..0c4de440a
--- /dev/null
+++ b/src/linux/arm/set_scno.c
@@ -0,0 +1,25 @@
+/*
+ * Copyright (c) 2016-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef PTRACE_SET_SYSCALL
+# define PTRACE_SET_SYSCALL 23
+#endif
+/*
+ * PTRACE_SET_SYSCALL is supported by linux kernel
+ * starting with commit v2.6.16-rc1~107^2
+ */
+
+static int
+arch_set_scno(struct tcb *tcp, kernel_ulong_t scno)
+{
+ unsigned int n = (uint16_t) scno;
+ int rc = ptrace(PTRACE_SET_SYSCALL, tcp->pid, NULL, (unsigned long) n);
+ if (rc && errno != ESRCH)
+ perror_msg("arch_set_scno: PTRACE_SET_SYSCALL pid:%d scno:%#x",
+ tcp->pid, n);
+ return rc;
+}
diff --git a/src/linux/arm/shuffle_scno.c b/src/linux/arm/shuffle_scno.c
new file mode 100644
index 000000000..68199cfcb
--- /dev/null
+++ b/src/linux/arm/shuffle_scno.c
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+kernel_ulong_t
+shuffle_scno(kernel_ulong_t scno)
+{
+ if (scno < ARM_FIRST_SHUFFLED_SYSCALL)
+ return scno;
+
+ /* __ARM_NR_cmpxchg? Swap with LAST_ORDINARY+1 */
+ if (scno == ARM_FIRST_SHUFFLED_SYSCALL)
+ return 0x000ffff0;
+ if (scno == 0x000ffff0)
+ return ARM_FIRST_SHUFFLED_SYSCALL;
+
+#define ARM_SECOND_SHUFFLED_SYSCALL (ARM_FIRST_SHUFFLED_SYSCALL + 1)
+ /*
+ * Is it ARM specific syscall?
+ * Swap [0x000f0000, 0x000f0000 + LAST_SPECIAL] range
+ * with [SECOND_SHUFFLED, SECOND_SHUFFLED + LAST_SPECIAL] range.
+ */
+ if (scno >= 0x000f0000 &&
+ scno <= 0x000f0000 + ARM_LAST_SPECIAL_SYSCALL) {
+ return scno - 0x000f0000 + ARM_SECOND_SHUFFLED_SYSCALL;
+ }
+ if (scno <= ARM_SECOND_SHUFFLED_SYSCALL + ARM_LAST_SPECIAL_SYSCALL) {
+ return scno + 0x000f0000 - ARM_SECOND_SHUFFLED_SYSCALL;
+ }
+
+ return scno;
+}
diff --git a/src/linux/arm/syscallent.h b/src/linux/arm/syscallent.h
new file mode 100644
index 000000000..b6b105de2
--- /dev/null
+++ b/src/linux/arm/syscallent.h
@@ -0,0 +1,443 @@
+/*
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993, 1994, 1995 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1995-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+[ 0] = { 0, 0, SEN(restart_syscall), "restart_syscall" },
+[ 1] = { 1, TP|SE, SEN(exit), "exit" },
+[ 2] = { 0, TP, SEN(fork), "fork" },
+[ 3] = { 3, TD, SEN(read), "read" },
+[ 4] = { 3, TD, SEN(write), "write" },
+[ 5] = { 3, TD|TF, SEN(open), "open" },
+[ 6] = { 1, TD, SEN(close), "close" },
+[ 7] = { 3, TP, SEN(waitpid), "waitpid" },
+[ 8] = { 2, TD|TF, SEN(creat), "creat" },
+[ 9] = { 2, TF, SEN(link), "link" },
+[ 10] = { 1, TF, SEN(unlink), "unlink" },
+[ 11] = { 3, TF|TP|TSD|SE|SI, SEN(execve), "execve" },
+[ 12] = { 1, TF, SEN(chdir), "chdir" },
+[ 13] = { 1, TCL, SEN(time), "time" },
+[ 14] = { 3, TF, SEN(mknod), "mknod" },
+[ 15] = { 2, TF, SEN(chmod), "chmod" },
+[ 16] = { 3, TF, SEN(chown16), "lchown" },
+[ 17] = { 0, TM, SEN(break), "break" },
+[ 18] = { 2, TF|TST|TSTA, SEN(oldstat), "oldstat" },
+[ 19] = { 3, TD, SEN(lseek), "lseek" },
+[ 20] = { 0, PU|NF, SEN(getpid), "getpid" },
+[ 21] = { 5, TF, SEN(mount), "mount" },
+[ 22] = { 1, TF, SEN(umount), "umount" },
+[ 23] = { 1, TC, SEN(setuid16), "setuid" },
+[ 24] = { 0, TC|PU|NF, SEN(getuid16), "getuid" },
+[ 25] = { 1, 0, SEN(stime), "stime" },
+[ 26] = { 4, 0, SEN(ptrace), "ptrace" },
+[ 27] = { 1, 0, SEN(alarm), "alarm" },
+[ 28] = { 2, TD|TFST|TSTA, SEN(oldfstat), "oldfstat" },
+[ 29] = { 0, TS, SEN(pause), "pause" },
+[ 30] = { 2, TF, SEN(utime), "utime" },
+[ 31] = { 2, 0, SEN(stty), "stty" },
+[ 32] = { 2, 0, SEN(gtty), "gtty" },
+[ 33] = { 2, TF, SEN(access), "access" },
+[ 34] = { 1, 0, SEN(nice), "nice" },
+[ 35] = { 0, 0, SEN(ftime), "ftime" },
+[ 36] = { 0, 0, SEN(sync), "sync" },
+[ 37] = { 2, TS|TP, SEN(kill), "kill" },
+[ 38] = { 2, TF, SEN(rename), "rename" },
+[ 39] = { 2, TF, SEN(mkdir), "mkdir" },
+[ 40] = { 1, TF, SEN(rmdir), "rmdir" },
+[ 41] = { 1, TD, SEN(dup), "dup" },
+[ 42] = { 1, TD, SEN(pipe), "pipe" },
+[ 43] = { 1, 0, SEN(times), "times" },
+[ 44] = { 0, 0, SEN(prof), "prof" },
+[ 45] = { 1, TM|SI, SEN(brk), "brk" },
+[ 46] = { 1, TC, SEN(setgid16), "setgid" },
+[ 47] = { 0, TC|PU|NF, SEN(getgid16), "getgid" },
+[ 48] = { 2, TS, SEN(signal), "signal" },
+[ 49] = { 0, TC|PU|NF, SEN(geteuid16), "geteuid" },
+[ 50] = { 0, TC|PU|NF, SEN(getegid16), "getegid" },
+[ 51] = { 1, TF, SEN(acct), "acct" },
+[ 52] = { 2, TF, SEN(umount2), "umount2" },
+[ 53] = { 0, 0, SEN(lock), "lock" },
+[ 54] = { 3, TD, SEN(ioctl), "ioctl" },
+[ 55] = { 3, TD, SEN(fcntl), "fcntl" },
+[ 56] = { 0, 0, SEN(mpx), "mpx" },
+[ 57] = { 2, 0, SEN(setpgid), "setpgid" },
+[ 58] = { 2, 0, SEN(ulimit), "ulimit" },
+[ 59] = { 1, 0, SEN(oldolduname), "oldolduname" },
+[ 60] = { 1, NF, SEN(umask), "umask" },
+[ 61] = { 1, TF, SEN(chroot), "chroot" },
+[ 62] = { 2, TSFA, SEN(ustat), "ustat" },
+[ 63] = { 2, TD, SEN(dup2), "dup2" },
+[ 64] = { 0, PU|NF, SEN(getppid), "getppid" },
+[ 65] = { 0, PU|NF, SEN(getpgrp), "getpgrp" },
+[ 66] = { 0, 0, SEN(setsid), "setsid" },
+[ 67] = { 3, TS, SEN(sigaction), "sigaction" },
+[ 68] = { 0, TS, SEN(sgetmask), "sgetmask" },
+[ 69] = { 1, TS, SEN(ssetmask), "ssetmask" },
+[ 70] = { 2, TC, SEN(setreuid16), "setreuid" },
+[ 71] = { 2, TC, SEN(setregid16), "setregid" },
+[ 72] = { 3, TS, SEN(sigsuspend), "sigsuspend" },
+[ 73] = { 1, TS, SEN(sigpending), "sigpending" },
+[ 74] = { 2, 0, SEN(sethostname), "sethostname" },
+[ 75] = { 2, 0, SEN(setrlimit), "setrlimit" },
+[ 76] = { 2, 0, SEN(getrlimit), "getrlimit" },
+[ 77] = { 2, 0, SEN(getrusage), "getrusage" },
+[ 78] = { 2, TCL, SEN(gettimeofday), "gettimeofday" },
+[ 79] = { 2, TCL, SEN(settimeofday), "settimeofday" },
+[ 80] = { 2, TC, SEN(getgroups16), "getgroups" },
+[ 81] = { 2, TC, SEN(setgroups16), "setgroups" },
+[ 82] = { 1, TD, SEN(oldselect), "select" },
+[ 83] = { 2, TF, SEN(symlink), "symlink" },
+[ 84] = { 2, TF|TLST|TSTA, SEN(oldlstat), "oldlstat" },
+[ 85] = { 3, TF, SEN(readlink), "readlink" },
+[ 86] = { 1, TF, SEN(uselib), "uselib" },
+[ 87] = { 2, TF, SEN(swapon), "swapon" },
+[ 88] = { 4, 0, SEN(reboot), "reboot" },
+[ 89] = { 3, TD, SEN(readdir), "readdir" },
+[ 90] = { 1, TD|TM|SI, SEN(old_mmap), "mmap" },
+[ 91] = { 2, TM|SI, SEN(munmap), "munmap" },
+[ 92] = { 2, TF, SEN(truncate), "truncate" },
+[ 93] = { 2, TD, SEN(ftruncate), "ftruncate" },
+[ 94] = { 2, TD, SEN(fchmod), "fchmod" },
+[ 95] = { 3, TD, SEN(fchown16), "fchown" },
+[ 96] = { 2, 0, SEN(getpriority), "getpriority" },
+[ 97] = { 3, 0, SEN(setpriority), "setpriority" },
+[ 98] = { 4, 0, SEN(profil), "profil" },
+[ 99] = { 2, TF|TSF|TSFA, SEN(statfs), "statfs" },
+[100] = { 2, TD|TFSF|TSFA, SEN(fstatfs), "fstatfs" },
+[101] = { 3, 0, SEN(ioperm), "ioperm" },
+[102] = { 2, TD|TSD, SEN(socketcall), "socketcall" },
+[103] = { 3, 0, SEN(syslog), "syslog" },
+[104] = { 3, 0, SEN(setitimer), "setitimer" },
+[105] = { 2, 0, SEN(getitimer), "getitimer" },
+[106] = { 2, TF|TST|TSTA, SEN(stat), "stat" },
+[107] = { 2, TF|TLST|TSTA, SEN(lstat), "lstat" },
+[108] = { 2, TD|TFST|TSTA, SEN(fstat), "fstat" },
+[109] = { 1, 0, SEN(olduname), "olduname" },
+[110] = { 1, 0, SEN(iopl), "iopl" },
+[111] = { 0, 0, SEN(vhangup), "vhangup" },
+[112] = { 0, 0, SEN(idle), "idle" },
+[113] = { 5, 0, SEN(printargs), "syscall" },
+[114] = { 4, TP, SEN(wait4), "wait4" },
+[115] = { 1, TF, SEN(swapoff), "swapoff" },
+[116] = { 1, 0, SEN(sysinfo), "sysinfo" },
+[117] = { 6, TI|TSD, SEN(ipc), "ipc" },
+[118] = { 1, TD, SEN(fsync), "fsync" },
+[119] = { 0, TS, SEN(sigreturn), "sigreturn" },
+[120] = { 5, TP, SEN(clone), "clone" },
+[121] = { 2, 0, SEN(setdomainname), "setdomainname" },
+[122] = { 1, 0, SEN(uname), "uname" },
+[123] = { 3, 0, SEN(modify_ldt), "modify_ldt" },
+[124] = { 1, TCL, SEN(adjtimex32), "adjtimex" },
+[125] = { 3, TM|SI, SEN(mprotect), "mprotect" },
+[126] = { 3, TS, SEN(sigprocmask), "sigprocmask" },
+[127] = { 2, 0, SEN(create_module), "create_module" },
+[128] = { 3, 0, SEN(init_module), "init_module" },
+[129] = { 2, 0, SEN(delete_module), "delete_module" },
+[130] = { 1, 0, SEN(get_kernel_syms), "get_kernel_syms" },
+[131] = { 4, TF, SEN(quotactl), "quotactl" },
+[132] = { 1, 0, SEN(getpgid), "getpgid" },
+[133] = { 1, TD, SEN(fchdir), "fchdir" },
+[134] = { 2, 0, SEN(bdflush), "bdflush" },
+[135] = { 3, 0, SEN(sysfs), "sysfs" },
+[136] = { 1, NF, SEN(personality), "personality" },
+[137] = { 5, 0, SEN(afs_syscall), "afs_syscall" },
+[138] = { 1, TC|NF, SEN(setfsuid16), "setfsuid" },
+[139] = { 1, TC|NF, SEN(setfsgid16), "setfsgid" },
+[140] = { 5, TD, SEN(llseek), "_llseek" },
+[141] = { 3, TD, SEN(getdents), "getdents" },
+[142] = { 5, TD, SEN(select), "_newselect" },
+[143] = { 2, TD, SEN(flock), "flock" },
+[144] = { 3, TM, SEN(msync), "msync" },
+[145] = { 3, TD, SEN(readv), "readv" },
+[146] = { 3, TD, SEN(writev), "writev" },
+[147] = { 1, 0, SEN(getsid), "getsid" },
+[148] = { 1, TD, SEN(fdatasync), "fdatasync" },
+[149] = { 1, 0, SEN(sysctl), "_sysctl" },
+[150] = { 2, TM, SEN(mlock), "mlock" },
+[151] = { 2, TM, SEN(munlock), "munlock" },
+[152] = { 1, TM, SEN(mlockall), "mlockall" },
+[153] = { 0, TM, SEN(munlockall), "munlockall" },
+[154] = { 2, 0, SEN(sched_setparam), "sched_setparam" },
+[155] = { 2, 0, SEN(sched_getparam), "sched_getparam" },
+[156] = { 3, 0, SEN(sched_setscheduler), "sched_setscheduler" },
+[157] = { 1, 0, SEN(sched_getscheduler), "sched_getscheduler" },
+[158] = { 0, 0, SEN(sched_yield), "sched_yield" },
+[159] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"},
+[160] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"},
+[161] = { 2, 0, SEN(sched_rr_get_interval_time32),"sched_rr_get_interval"},
+[162] = { 2, 0, SEN(nanosleep_time32), "nanosleep" },
+[163] = { 5, TM|SI, SEN(mremap), "mremap" },
+[164] = { 3, TC, SEN(setresuid16), "setresuid" },
+[165] = { 3, TC, SEN(getresuid16), "getresuid" },
+[166] = { 5, 0, SEN(vm86), "vm86" },
+[167] = { 5, 0, SEN(query_module), "query_module" },
+[168] = { 3, TD, SEN(poll_time32), "poll" },
+[169] = { 3, 0, SEN(nfsservctl), "nfsservctl" },
+[170] = { 3, TC, SEN(setresgid16), "setresgid" },
+[171] = { 3, TC, SEN(getresgid16), "getresgid" },
+[172] = { 5, TC, SEN(prctl), "prctl" },
+[173] = { 0, TS, SEN(rt_sigreturn), "rt_sigreturn" },
+[174] = { 4, TS, SEN(rt_sigaction), "rt_sigaction" },
+[175] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" },
+[176] = { 2, TS, SEN(rt_sigpending), "rt_sigpending" },
+[177] = { 4, TS, SEN(rt_sigtimedwait_time32), "rt_sigtimedwait" },
+[178] = { 3, TS|TP, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" },
+[179] = { 2, TS, SEN(rt_sigsuspend), "rt_sigsuspend" },
+[180] = { 6, TD, SEN(pread), "pread64" },
+[181] = { 6, TD, SEN(pwrite), "pwrite64" },
+[182] = { 3, TF, SEN(chown16), "chown" },
+[183] = { 2, TF, SEN(getcwd), "getcwd" },
+[184] = { 2, TC, SEN(capget), "capget" },
+[185] = { 2, TC, SEN(capset), "capset" },
+[186] = { 2, TS, SEN(sigaltstack), "sigaltstack" },
+[187] = { 4, TD|TN, SEN(sendfile), "sendfile" },
+[188] = { 5, TN, SEN(getpmsg), "getpmsg" },
+[189] = { 5, TN, SEN(putpmsg), "putpmsg" },
+[190] = { 0, TP, SEN(vfork), "vfork" },
+[191] = { 2, 0, SEN(getrlimit), "ugetrlimit" },
+[192] = { 6, TD|TM|SI, SEN(mmap_4koff), "mmap2" },
+[193] = { 4, TF, SEN(truncate64), "truncate64" },
+[194] = { 4, TD, SEN(ftruncate64), "ftruncate64" },
+[195] = { 2, TF|TST|TSTA, SEN(stat64), "stat64" },
+[196] = { 2, TF|TLST|TSTA, SEN(lstat64), "lstat64" },
+[197] = { 2, TD|TFST|TSTA, SEN(fstat64), "fstat64" },
+[198] = { 3, TF, SEN(chown), "lchown32" },
+[199] = { 0, TC|PU|NF, SEN(getuid), "getuid32" },
+[200] = { 0, TC|PU|NF, SEN(getgid), "getgid32" },
+[201] = { 0, TC|PU|NF, SEN(geteuid), "geteuid32" },
+[202] = { 0, TC|PU|NF, SEN(geteuid), "getegid32" },
+[203] = { 2, TC, SEN(setreuid), "setreuid32" },
+[204] = { 2, TC, SEN(setregid), "setregid32" },
+[205] = { 2, TC, SEN(getgroups), "getgroups32" },
+[206] = { 2, TC, SEN(setgroups), "setgroups32" },
+[207] = { 3, TD, SEN(fchown), "fchown32" },
+[208] = { 3, TC, SEN(setresuid), "setresuid32" },
+[209] = { 3, TC, SEN(getresuid), "getresuid32" },
+[210] = { 3, TC, SEN(setresgid), "setresgid32" },
+[211] = { 3, TC, SEN(getresgid), "getresgid32" },
+[212] = { 3, TF, SEN(chown), "chown32" },
+[213] = { 1, TC, SEN(setuid), "setuid32" },
+[214] = { 1, TC, SEN(setgid), "setgid32" },
+[215] = { 1, TC|NF, SEN(setfsuid), "setfsuid32" },
+[216] = { 1, TC|NF, SEN(setfsgid), "setfsgid32" },
+[217] = { 3, TD, SEN(getdents64), "getdents64" },
+[218] = { 2, TF, SEN(pivotroot), "pivot_root" },
+[219] = { 3, TM, SEN(mincore), "mincore" },
+[220] = { 3, TM, SEN(madvise), "madvise" },
+[221] = { 3, TD, SEN(fcntl64), "fcntl64" },
+/* [222] - tux */
+/* [223] - unused */
+[224] = { 0, PU|NF, SEN(gettid), "gettid" },
+[225] = { 5, TD, SEN(readahead), "readahead" },
+[226] = { 5, TF, SEN(setxattr), "setxattr" },
+[227] = { 5, TF, SEN(setxattr), "lsetxattr" },
+[228] = { 5, TD, SEN(fsetxattr), "fsetxattr" },
+[229] = { 4, TF, SEN(getxattr), "getxattr" },
+[230] = { 4, TF, SEN(getxattr), "lgetxattr" },
+[231] = { 4, TD, SEN(fgetxattr), "fgetxattr" },
+[232] = { 3, TF, SEN(listxattr), "listxattr" },
+[233] = { 3, TF, SEN(listxattr), "llistxattr" },
+[234] = { 3, TD, SEN(flistxattr), "flistxattr" },
+[235] = { 2, TF, SEN(removexattr), "removexattr" },
+[236] = { 2, TF, SEN(removexattr), "lremovexattr" },
+[237] = { 2, TD, SEN(fremovexattr), "fremovexattr" },
+[238] = { 2, TS|TP, SEN(tkill), "tkill" },
+[239] = { 4, TD|TN, SEN(sendfile64), "sendfile64" },
+[240] = { 6, 0, SEN(futex_time32), "futex" },
+[241] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" },
+[242] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" },
+[243] = { 2, TM, SEN(io_setup), "io_setup" },
+[244] = { 1, TM, SEN(io_destroy), "io_destroy" },
+[245] = { 5, 0, SEN(io_getevents_time32), "io_getevents" },
+[246] = { 3, 0, SEN(io_submit), "io_submit" },
+[247] = { 3, 0, SEN(io_cancel), "io_cancel" },
+[248] = { 1, TP|SE, SEN(exit), "exit_group" },
+[249] = { 4, 0, SEN(lookup_dcookie), "lookup_dcookie" },
+[250] = { 1, TD, SEN(epoll_create), "epoll_create" },
+[251] = { 4, TD, SEN(epoll_ctl), "epoll_ctl" },
+[252] = { 4, TD, SEN(epoll_wait), "epoll_wait" },
+[253] = { 5, TM|SI, SEN(remap_file_pages), "remap_file_pages" },
+/* [254] - set_thread_area */
+/* [255] - get_thread_area */
+[256] = { 1, 0, SEN(set_tid_address), "set_tid_address" },
+[257] = { 3, 0, SEN(timer_create), "timer_create" },
+[258] = { 4, 0, SEN(timer_settime32), "timer_settime" },
+[259] = { 2, 0, SEN(timer_gettime32), "timer_gettime" },
+[260] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" },
+[261] = { 1, 0, SEN(timer_delete), "timer_delete" },
+[262] = { 2, TCL, SEN(clock_settime32), "clock_settime" },
+[263] = { 2, TCL, SEN(clock_gettime32), "clock_gettime" },
+[264] = { 2, TCL, SEN(clock_getres_time32), "clock_getres" },
+[265] = { 4, 0, SEN(clock_nanosleep_time32), "clock_nanosleep" },
+[266] = { 3, TF|TSF|TSFA, SEN(statfs64), "statfs64" },
+[267] = { 3, TD|TFSF|TSFA, SEN(fstatfs64), "fstatfs64" },
+[268] = { 3, TS|TP, SEN(tgkill), "tgkill" },
+[269] = { 2, TF, SEN(utimes), "utimes" },
+[270] = { 6, TD, SEN(fadvise64_64), "fadvise64_64" },
+[271] = { 3, 0, SEN(printargs), "pciconfig_iobase" },
+[272] = { 5, 0, SEN(printargs), "pciconfig_read" },
+[273] = { 5, 0, SEN(printargs), "pciconfig_write" },
+[274] = { 4, TD, SEN(mq_open), "mq_open" },
+[275] = { 1, 0, SEN(mq_unlink), "mq_unlink" },
+[276] = { 5, TD, SEN(mq_timedsend_time32), "mq_timedsend" },
+[277] = { 5, TD, SEN(mq_timedreceive_time32), "mq_timedreceive" },
+[278] = { 2, TD, SEN(mq_notify), "mq_notify" },
+[279] = { 3, TD, SEN(mq_getsetattr), "mq_getsetattr" },
+[280] = { 5, TP, SEN(waitid), "waitid" },
+[281] = { 3, TN, SEN(socket), "socket" },
+[282] = { 3, TN, SEN(bind), "bind" },
+[283] = { 3, TN, SEN(connect), "connect" },
+[284] = { 2, TN, SEN(listen), "listen" },
+[285] = { 3, TN, SEN(accept), "accept" },
+[286] = { 3, TN, SEN(getsockname), "getsockname" },
+[287] = { 3, TN, SEN(getpeername), "getpeername" },
+[288] = { 4, TN, SEN(socketpair), "socketpair" },
+[289] = { 4, TN, SEN(send), "send" },
+[290] = { 6, TN, SEN(sendto), "sendto" },
+[291] = { 4, TN, SEN(recv), "recv" },
+[292] = { 6, TN, SEN(recvfrom), "recvfrom" },
+[293] = { 2, TN, SEN(shutdown), "shutdown" },
+[294] = { 5, TN, SEN(setsockopt), "setsockopt" },
+[295] = { 5, TN, SEN(getsockopt), "getsockopt" },
+[296] = { 3, TN, SEN(sendmsg), "sendmsg" },
+[297] = { 3, TN, SEN(recvmsg), "recvmsg" },
+[298] = { 3, TI, SEN(semop), "semop" },
+[299] = { 3, TI, SEN(semget), "semget" },
+[300] = { 4, TI, SEN(semctl), "semctl" },
+[301] = { 4, TI, SEN(msgsnd), "msgsnd" },
+[302] = { 5, TI, SEN(msgrcv), "msgrcv" },
+[303] = { 2, TI, SEN(msgget), "msgget" },
+[304] = { 3, TI, SEN(msgctl), "msgctl" },
+[305] = { 3, TI|TM|SI, SEN(shmat), "shmat" },
+[306] = { 1, TI|TM|SI, SEN(shmdt), "shmdt" },
+[307] = { 3, TI, SEN(shmget), "shmget" },
+[308] = { 3, TI, SEN(shmctl), "shmctl" },
+[309] = { 5, 0, SEN(add_key), "add_key" },
+[310] = { 4, 0, SEN(request_key), "request_key" },
+[311] = { 5, 0, SEN(keyctl), "keyctl" },
+[312] = { 4, TI, SEN(semtimedop_time32), "semtimedop" },
+[313] = { 5, 0, SEN(vserver), "vserver" },
+[314] = { 3, 0, SEN(ioprio_set), "ioprio_set" },
+[315] = { 2, 0, SEN(ioprio_get), "ioprio_get" },
+[316] = { 0, TD, SEN(inotify_init), "inotify_init" },
+[317] = { 3, TD|TF, SEN(inotify_add_watch), "inotify_add_watch" },
+[318] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" },
+[319] = { 6, TM, SEN(mbind), "mbind" },
+[320] = { 5, TM, SEN(get_mempolicy), "get_mempolicy" },
+[321] = { 3, TM, SEN(set_mempolicy), "set_mempolicy" },
+[322] = { 4, TD|TF, SEN(openat), "openat" },
+[323] = { 3, TD|TF, SEN(mkdirat), "mkdirat" },
+[324] = { 4, TD|TF, SEN(mknodat), "mknodat" },
+[325] = { 5, TD|TF, SEN(fchownat), "fchownat" },
+[326] = { 3, TD|TF, SEN(futimesat), "futimesat" },
+[327] = { 4, TD|TF|TFST|TSTA,SEN(fstatat64), "fstatat64" },
+[328] = { 3, TD|TF, SEN(unlinkat), "unlinkat" },
+[329] = { 4, TD|TF, SEN(renameat), "renameat" },
+[330] = { 5, TD|TF, SEN(linkat), "linkat" },
+[331] = { 3, TD|TF, SEN(symlinkat), "symlinkat" },
+[332] = { 4, TD|TF, SEN(readlinkat), "readlinkat" },
+[333] = { 3, TD|TF, SEN(fchmodat), "fchmodat" },
+[334] = { 3, TD|TF, SEN(faccessat), "faccessat" },
+[335] = { 6, TD, SEN(pselect6_time32), "pselect6" },
+[336] = { 5, TD, SEN(ppoll_time32), "ppoll" },
+[337] = { 1, 0, SEN(unshare), "unshare" },
+[338] = { 2, 0, SEN(set_robust_list), "set_robust_list" },
+[339] = { 3, 0, SEN(get_robust_list), "get_robust_list" },
+[340] = { 6, TD, SEN(splice), "splice" },
+[341] = { 6, TD, SEN(sync_file_range2), "sync_file_range2" },
+[342] = { 4, TD, SEN(tee), "tee" },
+[343] = { 4, TD, SEN(vmsplice), "vmsplice" },
+[344] = { 6, TM, SEN(move_pages), "move_pages" },
+[345] = { 3, 0, SEN(getcpu), "getcpu" },
+[346] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" },
+[347] = { 4, 0, SEN(kexec_load), "kexec_load" },
+[348] = { 4, TD|TF, SEN(utimensat_time32), "utimensat" },
+[349] = { 3, TD|TS, SEN(signalfd), "signalfd" },
+[350] = { 2, TD, SEN(timerfd_create), "timerfd_create" },
+[351] = { 1, TD, SEN(eventfd), "eventfd" },
+[352] = { 6, TD, SEN(fallocate), "fallocate" },
+[353] = { 4, TD, SEN(timerfd_settime32), "timerfd_settime" },
+[354] = { 2, TD, SEN(timerfd_gettime32), "timerfd_gettime" },
+[355] = { 4, TD|TS, SEN(signalfd4), "signalfd4" },
+[356] = { 2, TD, SEN(eventfd2), "eventfd2" },
+[357] = { 1, TD, SEN(epoll_create1), "epoll_create1" },
+[358] = { 3, TD, SEN(dup3), "dup3" },
+[359] = { 2, TD, SEN(pipe2), "pipe2" },
+[360] = { 1, TD, SEN(inotify_init1), "inotify_init1" },
+[361] = { 5, TD, SEN(preadv), "preadv" },
+[362] = { 5, TD, SEN(pwritev), "pwritev" },
+[363] = { 4, TP|TS, SEN(rt_tgsigqueueinfo), "rt_tgsigqueueinfo" },
+[364] = { 5, TD, SEN(perf_event_open), "perf_event_open" },
+[365] = { 5, TN, SEN(recvmmsg_time32), "recvmmsg" },
+[366] = { 4, TN, SEN(accept4), "accept4" },
+[367] = { 2, TD, SEN(fanotify_init), "fanotify_init" },
+[368] = { 6, TD|TF, SEN(fanotify_mark), "fanotify_mark" },
+[369] = { 4, 0, SEN(prlimit64), "prlimit64" },
+[370] = { 5, TD|TF, SEN(name_to_handle_at), "name_to_handle_at" },
+[371] = { 3, TD, SEN(open_by_handle_at), "open_by_handle_at" },
+[372] = { 2, TCL, SEN(clock_adjtime32), "clock_adjtime" },
+[373] = { 1, TD, SEN(syncfs), "syncfs" },
+[374] = { 4, TN, SEN(sendmmsg), "sendmmsg" },
+[375] = { 2, TD, SEN(setns), "setns" },
+[376] = { 6, 0, SEN(process_vm_readv), "process_vm_readv" },
+[377] = { 6, 0, SEN(process_vm_writev), "process_vm_writev" },
+[378] = { 5, 0, SEN(kcmp), "kcmp" },
+[379] = { 3, TD, SEN(finit_module), "finit_module" },
+[380] = { 3, 0, SEN(sched_setattr), "sched_setattr" },
+[381] = { 4, 0, SEN(sched_getattr), "sched_getattr" },
+[382] = { 5, TD|TF, SEN(renameat2), "renameat2" },
+[383] = { 3, 0, SEN(seccomp), "seccomp" },
+[384] = { 3, 0, SEN(getrandom), "getrandom" },
+[385] = { 2, TD, SEN(memfd_create), "memfd_create" },
+[386] = { 3, TD, SEN(bpf), "bpf" },
+[387] = { 5, TD|TF|TP|TSD|SE|SI, SEN(execveat), "execveat" },
+[388] = { 1, TD, SEN(userfaultfd), "userfaultfd" },
+[389] = { 3, 0, SEN(membarrier), "membarrier" },
+[390] = { 3, TM, SEN(mlock2), "mlock2" },
+[391] = { 6, TD, SEN(copy_file_range), "copy_file_range" },
+[392] = { 6, TD, SEN(preadv2), "preadv2" },
+[393] = { 6, TD, SEN(pwritev2), "pwritev2" },
+[394] = { 4, TM|SI, SEN(pkey_mprotect), "pkey_mprotect" },
+[395] = { 2, 0, SEN(pkey_alloc), "pkey_alloc" },
+[396] = { 1, 0, SEN(pkey_free), "pkey_free" },
+[397] = { 5, TD|TF|TFST|TSTA,SEN(statx), "statx" },
+[398] = { 4, 0, SEN(rseq), "rseq" },
+[399] = { 6, 0, SEN(io_pgetevents_time32), "io_pgetevents" },
+[400] = { 4, TM, SEN(migrate_pages), "migrate_pages" },
+[401] = { 5, TD, SEN(kexec_file_load), "kexec_file_load" },
+/* [402] - unused */
+#include "syscallent-common-32.h"
+#include "syscallent-common.h"
+
+#ifdef __ARM_EABI__
+# define ARM_FIRST_SHUFFLED_SYSCALL 500
+#else
+# define SYS_socket_subcall 500
+# include "subcall32.h"
+# define ARM_FIRST_SHUFFLED_SYSCALL (SYS_ipc_subcall + SYS_ipc_nsubcalls)
+#endif /* !__ARM_EABI__ */
+
+/*
+ * __ARM_NR_cmpxchg (0x000ffff0).
+ * Remapped by shuffle_scno() to be directly after ordinary syscalls
+ * in this table.
+ * Removed in v4.4-rc1~163^2^3~13.
+ */
+[ARM_FIRST_SHUFFLED_SYSCALL ] = { 5, 0, SEN(printargs), "cmpxchg" },
+
+/*
+ * ARM specific syscalls. Encoded with scno 0x000f00xx.
+ * Remapped by shuffle_scno() to be directly after __ARM_NR_cmpxchg.
+ */
+[ARM_FIRST_SHUFFLED_SYSCALL+1+0] = { },
+[ARM_FIRST_SHUFFLED_SYSCALL+1+1] = { 0, 0, SEN(printargs), "breakpoint" },
+[ARM_FIRST_SHUFFLED_SYSCALL+1+2] = { 3, TM, SEN(printargs), "cacheflush" },
+[ARM_FIRST_SHUFFLED_SYSCALL+1+3] = { 0, 0, SEN(printargs), "usr26" },
+[ARM_FIRST_SHUFFLED_SYSCALL+1+4] = { 0, 0, SEN(printargs), "usr32" },
+[ARM_FIRST_SHUFFLED_SYSCALL+1+5] = { 1, 0, SEN(printargs), "set_tls" },
+[ARM_FIRST_SHUFFLED_SYSCALL+1+6] = { 0, PU|NF, SEN(printargs), "get_tls" },
+#define ARM_LAST_SPECIAL_SYSCALL 6
diff --git a/src/linux/arm/userent.h b/src/linux/arm/userent.h
new file mode 100644
index 000000000..a3555def6
--- /dev/null
+++ b/src/linux/arm/userent.h
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2014-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+{ uoff(regs.ARM_r0), "r0" },
+{ uoff(regs.ARM_r1), "r1" },
+{ uoff(regs.ARM_r2), "r2" },
+{ uoff(regs.ARM_r3), "r3" },
+{ uoff(regs.ARM_r4), "r4" },
+{ uoff(regs.ARM_r5), "r5" },
+{ uoff(regs.ARM_r6), "r6" },
+{ uoff(regs.ARM_r7), "r7" },
+{ uoff(regs.ARM_r8), "r8" },
+{ uoff(regs.ARM_r9), "r9" },
+{ uoff(regs.ARM_r10), "r10" },
+{ uoff(regs.ARM_fp), "fp" },
+{ uoff(regs.ARM_ip), "ip" },
+{ uoff(regs.ARM_sp), "sp" },
+{ uoff(regs.ARM_lr), "lr" },
+{ uoff(regs.ARM_pc), "pc" },
+{ uoff(regs.ARM_cpsr), "cpsr" },
+/* Other fields in "struct user" */
+XLAT_UOFF(u_fpvalid),
+XLAT_UOFF(u_tsize),
+XLAT_UOFF(u_dsize),
+XLAT_UOFF(u_ssize),
+XLAT_UOFF(start_code),
+XLAT_UOFF(start_stack),
+XLAT_UOFF(signal),
+XLAT_UOFF(reserved),
+XLAT_UOFF(u_ar0),
+XLAT_UOFF(magic),
+XLAT_UOFF(u_comm),
+#include "../userent0.h"
diff --git a/src/linux/asm_stat.h b/src/linux/asm_stat.h
new file mode 100644
index 000000000..b3510a5d1
--- /dev/null
+++ b/src/linux/asm_stat.h
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_ASM_STAT_H
+# define STRACE_ASM_STAT_H
+
+# undef dev_t
+# undef gid_t
+# undef ino_t
+# undef loff_t
+# undef mode_t
+# undef nlink_t
+# undef off64_t
+# undef off_t
+# undef time_t
+# undef uid_t
+
+# define dev_t __kernel_dev_t
+# define gid_t __kernel_gid_t
+# define ino_t __kernel_ino_t
+# define loff_t __kernel_loff_t
+# define mode_t __kernel_mode_t
+# define nlink_t __kernel_nlink_t
+# define off64_t __kernel_off64_t
+# define off_t __kernel_off_t
+# define time_t __kernel_time_t
+# define uid_t __kernel_uid_t
+
+# include <asm/stat.h>
+
+# undef dev_t
+# undef gid_t
+# undef ino_t
+# undef loff_t
+# undef mode_t
+# undef nlink_t
+# undef off64_t
+# undef off_t
+# undef time_t
+# undef uid_t
+
+# define dev_t dev_t
+# define gid_t gid_t
+# define ino_t ino_t
+# define loff_t loff_t
+# define mode_t mode_t
+# define nlink_t nlink_t
+# define off64_t off64_t
+# define off_t off_t
+# define time_t time_t
+# define uid_t uid_t
+
+#endif /* !STRACE_ASM_STAT_H */
diff --git a/src/linux/avr32/arch_regs.c b/src/linux/avr32/arch_regs.c
new file mode 100644
index 000000000..f3d60dac3
--- /dev/null
+++ b/src/linux/avr32/arch_regs.c
@@ -0,0 +1,11 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static struct pt_regs avr32_regs;
+#define ARCH_REGS_FOR_GETREGS avr32_regs
+#define ARCH_PC_REG avr32_regs.pc
+#define ARCH_SP_REG avr32_regs.sp
diff --git a/src/linux/avr32/get_error.c b/src/linux/avr32/get_error.c
new file mode 100644
index 000000000..bd1013f15
--- /dev/null
+++ b/src/linux/avr32/get_error.c
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "negated_errno.h"
+
+static void
+arch_get_error(struct tcb *tcp, const bool check_errno)
+{
+ if (check_errno && is_negated_errno(avr32_regs.r12)) {
+ tcp->u_rval = -1;
+ tcp->u_error = -avr32_regs.r12;
+ } else {
+ tcp->u_rval = avr32_regs.r12;
+ }
+}
diff --git a/src/linux/avr32/get_scno.c b/src/linux/avr32/get_scno.c
new file mode 100644
index 000000000..22ace6f4d
--- /dev/null
+++ b/src/linux/avr32/get_scno.c
@@ -0,0 +1,14 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+/* Return codes: 1 - ok, 0 - ignore, other - error. */
+static int
+arch_get_scno(struct tcb *tcp)
+{
+ tcp->scno = avr32_regs.r8;
+ return 1;
+}
diff --git a/src/linux/avr32/get_syscall_args.c b/src/linux/avr32/get_syscall_args.c
new file mode 100644
index 000000000..796b68a88
--- /dev/null
+++ b/src/linux/avr32/get_syscall_args.c
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+/* Return -1 on error or 1 on success (never 0!). */
+static int
+arch_get_syscall_args(struct tcb *tcp)
+{
+ tcp->u_arg[0] = avr32_regs.r12;
+ tcp->u_arg[1] = avr32_regs.r11;
+ tcp->u_arg[2] = avr32_regs.r10;
+ tcp->u_arg[3] = avr32_regs.r9;
+ tcp->u_arg[4] = avr32_regs.r5;
+ tcp->u_arg[5] = avr32_regs.r3;
+ return 1;
+}
diff --git a/src/linux/avr32/ioctls_arch0.h b/src/linux/avr32/ioctls_arch0.h
new file mode 100644
index 000000000..96538c704
--- /dev/null
+++ b/src/linux/avr32/ioctls_arch0.h
@@ -0,0 +1 @@
+/* Generated by ioctls_gen.sh from definitions found in $linux/arch/avr32/include/ tree. */
diff --git a/src/linux/avr32/ioctls_inc0.h b/src/linux/avr32/ioctls_inc0.h
new file mode 100644
index 000000000..4aecf983e
--- /dev/null
+++ b/src/linux/avr32/ioctls_inc0.h
@@ -0,0 +1 @@
+#include "32/ioctls_inc.h"
diff --git a/src/linux/avr32/raw_syscall.h b/src/linux/avr32/raw_syscall.h
new file mode 100644
index 000000000..518adb117
--- /dev/null
+++ b/src/linux/avr32/raw_syscall.h
@@ -0,0 +1,29 @@
+/*
+ * Raw syscalls.
+ *
+ * Copyright (c) 2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_RAW_SYSCALL_H
+# define STRACE_RAW_SYSCALL_H
+
+# include "kernel_types.h"
+
+static inline kernel_ulong_t
+raw_syscall_0(const kernel_ulong_t nr, kernel_ulong_t *err)
+{
+ *err = 0;
+ register kernel_ulong_t r8 __asm__("r8") = nr;
+ register kernel_ulong_t r12 __asm__("r12");
+ __asm__ __volatile__("scall"
+ : "=r"(r12)
+ : "r"(r8)
+ : "memory", "cc");
+ return r12;
+}
+# define raw_syscall_0 raw_syscall_0
+
+#endif /* !STRACE_RAW_SYSCALL_H */
diff --git a/src/linux/avr32/set_error.c b/src/linux/avr32/set_error.c
new file mode 100644
index 000000000..5b7137c79
--- /dev/null
+++ b/src/linux/avr32/set_error.c
@@ -0,0 +1,20 @@
+/*
+ * Copyright (c) 2016-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static int
+arch_set_error(struct tcb *tcp)
+{
+ avr32_regs.r12 = -tcp->u_error;
+ return set_regs(tcp->pid);
+}
+
+static int
+arch_set_success(struct tcb *tcp)
+{
+ avr32_regs.r12 = tcp->u_rval;
+ return set_regs(tcp->pid);
+}
diff --git a/src/linux/avr32/set_scno.c b/src/linux/avr32/set_scno.c
new file mode 100644
index 000000000..77dd9477a
--- /dev/null
+++ b/src/linux/avr32/set_scno.c
@@ -0,0 +1,15 @@
+/*
+ * Copyright (c) 2016-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static int
+arch_set_scno(struct tcb *tcp, kernel_ulong_t scno)
+{
+ if (ptrace_syscall_info_is_valid() && get_regs(tcp) < 0)
+ return -1;
+ avr32_regs.r8 = scno;
+ return set_regs(tcp->pid);
+}
diff --git a/src/linux/avr32/syscallent.h b/src/linux/avr32/syscallent.h
new file mode 100644
index 000000000..a58edda73
--- /dev/null
+++ b/src/linux/avr32/syscallent.h
@@ -0,0 +1,339 @@
+/*
+ * Copyright (c) 2004-2009 Atmel Corporation
+ * Copyright (c) 2009-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+[ 0] = { 0, 0, SEN(restart_syscall), "restart_syscall" },
+[ 1] = { 1, TP|SE, SEN(exit), "exit" },
+[ 2] = { 0, TP, SEN(fork), "fork" },
+[ 3] = { 3, TD, SEN(read), "read" },
+[ 4] = { 3, TD, SEN(write), "write" },
+[ 5] = { 3, TD|TF, SEN(open), "open" },
+[ 6] = { 1, TD, SEN(close), "close" },
+[ 7] = { 1, NF, SEN(umask), "umask" },
+[ 8] = { 2, TD|TF, SEN(creat), "creat" },
+[ 9] = { 2, TF, SEN(link), "link" },
+[ 10] = { 1, TF, SEN(unlink), "unlink" },
+[ 11] = { 3, TF|TP|TSD|SE|SI, SEN(execve), "execve" },
+[ 12] = { 1, TF, SEN(chdir), "chdir" },
+[ 13] = { 1, TCL, SEN(time), "time" },
+[ 14] = { 3, TF, SEN(mknod), "mknod" },
+[ 15] = { 2, TF, SEN(chmod), "chmod" },
+[ 16] = { 3, TF, SEN(chown), "chown" },
+[ 17] = { 3, TF, SEN(chown), "lchown" },
+[ 18] = { 3, TD, SEN(lseek), "lseek" },
+[ 19] = { 5, TD, SEN(llseek), "_llseek" },
+[ 20] = { 0, PU|NF, SEN(getpid), "getpid" },
+[ 21] = { 5, TF, SEN(mount), "mount" },
+[ 22] = { 1, TF, SEN(umount2), "umount2" },
+[ 23] = { 1, TC, SEN(setuid), "setuid" },
+[ 24] = { 0, TC|PU|NF, SEN(getuid), "getuid" },
+[ 25] = { 1, 0, SEN(stime), "stime" },
+[ 26] = { 4, 0, SEN(ptrace), "ptrace" },
+[ 27] = { 1, 0, SEN(alarm), "alarm" },
+[ 28] = { 0, TS, SEN(pause), "pause" },
+[ 29] = { 2, TF, SEN(utime), "utime" },
+[ 30] = { 2, TF|TST|TSTA, SEN(stat), "stat" },
+[ 31] = { 2, TD|TFST|TSTA, SEN(fstat), "fstat" },
+[ 32] = { 2, TF|TLST|TSTA, SEN(lstat), "lstat" },
+[ 33] = { 2, TF, SEN(access), "access" },
+[ 34] = { 1, TF, SEN(chroot), "chroot" },
+[ 35] = { 0, 0, SEN(sync), "sync" },
+[ 36] = { 1, TD, SEN(fsync), "fsync" },
+[ 37] = { 2, TS|TP, SEN(kill), "kill" },
+[ 38] = { 2, TF, SEN(rename), "rename" },
+[ 39] = { 2, TF, SEN(mkdir), "mkdir" },
+[ 40] = { 1, TF, SEN(rmdir), "rmdir" },
+[ 41] = { 1, TD, SEN(dup), "dup" },
+[ 42] = { 1, TD, SEN(pipe), "pipe" },
+[ 43] = { 1, 0, SEN(times), "times" },
+[ 44] = { 5, TP, SEN(clone), "clone" },
+[ 45] = { 1, TM|SI, SEN(brk), "brk" },
+[ 46] = { 1, TC, SEN(setgid), "setgid" },
+[ 47] = { 0, TC|PU|NF, SEN(getgid), "getgid" },
+[ 48] = { 2, TF, SEN(getcwd), "getcwd" },
+[ 49] = { 0, TC|PU|NF, SEN(geteuid), "geteuid" },
+[ 50] = { 0, TC|PU|NF, SEN(getegid), "getegid" },
+[ 51] = { 1, TF, SEN(acct), "acct" },
+[ 52] = { 1, TC|NF, SEN(setfsuid), "setfsuid" },
+[ 53] = { 1, TC|NF, SEN(setfsgid), "setfsgid" },
+[ 54] = { 3, TD, SEN(ioctl), "ioctl" },
+[ 55] = { 3, TD, SEN(fcntl), "fcntl" },
+[ 56] = { 2, 0, SEN(setpgid), "setpgid" },
+[ 57] = { 5, TM|SI, SEN(mremap), "mremap" },
+[ 58] = { 3, TC, SEN(setresuid), "setresuid" },
+[ 59] = { 3, TC, SEN(getresuid), "getresuid" },
+[ 60] = { 2, TC, SEN(setreuid), "setreuid" },
+[ 61] = { 2, TC, SEN(setregid), "setregid" },
+[ 62] = { 2, TSFA, SEN(ustat), "ustat" },
+[ 63] = { 2, TD, SEN(dup2), "dup2" },
+[ 64] = { 0, PU|NF, SEN(getppid), "getppid" },
+[ 65] = { 0, PU|NF, SEN(getpgrp), "getpgrp" },
+[ 66] = { 0, 0, SEN(setsid), "setsid" },
+[ 67] = { 4, TS, SEN(rt_sigaction), "rt_sigaction" },
+[ 68] = { 0, TS, SEN(rt_sigreturn), "rt_sigreturn" },
+[ 69] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" },
+[ 70] = { 2, TS, SEN(rt_sigpending), "rt_sigpending" },
+[ 71] = { 4, TS, SEN(rt_sigtimedwait_time32), "rt_sigtimedwait" },
+[ 72] = { 3, TS|TP, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" },
+[ 73] = { 2, TS, SEN(rt_sigsuspend), "rt_sigsuspend" },
+[ 74] = { 2, 0, SEN(sethostname), "sethostname" },
+[ 75] = { 2, 0, SEN(setrlimit), "setrlimit" },
+[ 76] = { 2, 0, SEN(getrlimit), "getrlimit" },
+[ 77] = { 2, 0, SEN(getrusage), "getrusage" },
+[ 78] = { 2, TCL, SEN(gettimeofday), "gettimeofday" },
+[ 79] = { 2, TCL, SEN(settimeofday), "settimeofday" },
+[ 80] = { 2, TC, SEN(getgroups), "getgroups" },
+[ 81] = { 2, TC, SEN(setgroups), "setgroups" },
+[ 82] = { 5, TD, SEN(select), "select" },
+[ 83] = { 2, TF, SEN(symlink), "symlink" },
+[ 84] = { 1, TD, SEN(fchdir), "fchdir" },
+[ 85] = { 3, TF, SEN(readlink), "readlink" },
+[ 86] = { 5, TD, SEN(pread), "pread" },
+[ 87] = { 5, TD, SEN(pwrite), "pwrite" },
+[ 88] = { 2, TF, SEN(swapon), "swapon" },
+[ 89] = { 4, 0, SEN(reboot), "reboot" },
+[ 90] = { 6, TD|TM|SI, SEN(mmap_pgoff), "mmap2" },
+[ 91] = { 2, TM|SI, SEN(munmap), "munmap" },
+[ 92] = { 2, TF, SEN(truncate), "truncate" },
+[ 93] = { 2, TD, SEN(ftruncate), "ftruncate" },
+[ 94] = { 2, TD, SEN(fchmod), "fchmod" },
+[ 95] = { 3, TD, SEN(fchown), "fchown" },
+[ 96] = { 2, 0, SEN(getpriority), "getpriority" },
+[ 97] = { 3, 0, SEN(setpriority), "setpriority" },
+[ 98] = { 4, TP, SEN(wait4), "wait4" },
+[ 99] = { 2, TF|TSF|TSFA, SEN(statfs), "statfs" },
+[100] = { 2, TD|TFSF|TSFA, SEN(fstatfs), "fstatfs" },
+[101] = { 0, 0, SEN(vhangup), "vhangup" },
+[102] = { 2, TS, SEN(sigaltstack), "sigaltstack" },
+[103] = { 3, 0, SEN(syslog), "syslog" },
+[104] = { 3, 0, SEN(setitimer), "setitimer" },
+[105] = { 2, 0, SEN(getitimer), "getitimer" },
+[106] = { 1, TF, SEN(swapoff), "swapoff" },
+[107] = { 1, 0, SEN(sysinfo), "sysinfo" },
+[108] = { 6, TI|TSD, SEN(ipc), "ipc" },
+[109] = { 4, TD|TN, SEN(sendfile), "sendfile" },
+[110] = { 2, 0, SEN(setdomainname), "setdomainname" },
+[111] = { 1, 0, SEN(uname), "uname" },
+[112] = { 1, TCL, SEN(adjtimex32), "adjtimex" },
+[113] = { 3, TM|SI, SEN(mprotect), "mprotect" },
+[114] = { 0, TP, SEN(vfork), "vfork" },
+[115] = { 3, 0, SEN(init_module), "init_module" },
+[116] = { 2, 0, SEN(delete_module), "delete_module" },
+[117] = { 4, TF, SEN(quotactl), "quotactl" },
+[118] = { 1, 0, SEN(getpgid), "getpgid" },
+[119] = { 2, 0, SEN(bdflush), "bdflush" },
+[120] = { 3, 0, SEN(sysfs), "sysfs" },
+[121] = { 1, NF, SEN(personality), "personality" },
+[122] = { 5, 0, SEN(afs_syscall), "afs_syscall" },
+[123] = { 3, TD, SEN(getdents), "getdents" },
+[124] = { 2, TD, SEN(flock), "flock" },
+[125] = { 3, TM, SEN(msync), "msync" },
+[126] = { 3, TD, SEN(readv), "readv" },
+[127] = { 3, TD, SEN(writev), "writev" },
+[128] = { 1, 0, SEN(getsid), "getsid" },
+[129] = { 1, TD, SEN(fdatasync), "fdatasync" },
+[130] = { 1, 0, SEN(sysctl), "_sysctl" },
+[131] = { 2, TM, SEN(mlock), "mlock" },
+[132] = { 2, TM, SEN(munlock), "munlock" },
+[133] = { 1, TM, SEN(mlockall), "mlockall" },
+[134] = { 0, TM, SEN(munlockall), "munlockall" },
+[135] = { 2, 0, SEN(sched_setparam), "sched_setparam" },
+[136] = { 2, 0, SEN(sched_getparam), "sched_getparam" },
+[137] = { 3, 0, SEN(sched_setscheduler), "sched_setscheduler" },
+[138] = { 1, 0, SEN(sched_getscheduler), "sched_getscheduler" },
+[139] = { 0, 0, SEN(sched_yield), "sched_yield" },
+[140] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"},
+[141] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"},
+[142] = { 2, 0, SEN(sched_rr_get_interval_time32),"sched_rr_get_interval"},
+[143] = { 2, 0, SEN(nanosleep_time32), "nanosleep" },
+[144] = { 3, TD, SEN(poll_time32), "poll" },
+[145] = { 3, 0, SEN(nfsservctl), "nfsservctl" },
+[146] = { 3, TC, SEN(setresgid), "setresgid" },
+[147] = { 3, TC, SEN(getresgid), "getresgid" },
+[148] = { 5, TC, SEN(prctl), "prctl" },
+[149] = { 3, TN, SEN(socket), "socket" },
+[150] = { 3, TN, SEN(bind), "bind" },
+[151] = { 3, TN, SEN(connect), "connect" },
+[152] = { 2, TN, SEN(listen), "listen" },
+[153] = { 3, TN, SEN(accept), "accept" },
+[154] = { 3, TN, SEN(getsockname), "getsockname" },
+[155] = { 3, TN, SEN(getpeername), "getpeername" },
+[156] = { 4, TN, SEN(socketpair), "socketpair" },
+[157] = { 4, TN, SEN(send), "send" },
+[158] = { 4, TN, SEN(recv), "recv" },
+[159] = { 6, TN, SEN(sendto), "sendto" },
+[160] = { 6, TN, SEN(recvfrom), "recvfrom" },
+[161] = { 2, TN, SEN(shutdown), "shutdown" },
+[162] = { 5, TN, SEN(setsockopt), "setsockopt" },
+[163] = { 5, TN, SEN(getsockopt), "getsockopt" },
+[164] = { 3, TN, SEN(sendmsg), "sendmsg" },
+[165] = { 3, TN, SEN(recvmsg), "recvmsg" },
+[166] = { 3, TF, SEN(truncate64), "truncate64" },
+[167] = { 3, TD, SEN(ftruncate64), "ftruncate64" },
+[168] = { 2, TF|TST|TSTA, SEN(stat64), "stat64" },
+[169] = { 2, TF|TLST|TSTA, SEN(lstat64), "lstat64" },
+[170] = { 2, TD|TFST|TSTA, SEN(fstat64), "fstat64" },
+[171] = { 2, TF, SEN(pivotroot), "pivot_root" },
+[172] = { 3, TM, SEN(mincore), "mincore" },
+[173] = { 3, TM, SEN(madvise), "madvise" },
+[174] = { 3, TD, SEN(getdents64), "getdents64" },
+[175] = { 3, TD, SEN(fcntl64), "fcntl64" },
+[176] = { 0, PU|NF, SEN(gettid), "gettid" },
+[177] = { 4, TD, SEN(readahead), "readahead" },
+[178] = { 5, TF, SEN(setxattr), "setxattr" },
+[179] = { 5, TF, SEN(setxattr), "lsetxattr" },
+[180] = { 5, TD, SEN(fsetxattr), "fsetxattr" },
+[181] = { 4, TF, SEN(getxattr), "getxattr" },
+[182] = { 4, TF, SEN(getxattr), "lgetxattr" },
+[183] = { 4, TD, SEN(fgetxattr), "fgetxattr" },
+[184] = { 3, TF, SEN(listxattr), "listxattr" },
+[185] = { 3, TF, SEN(listxattr), "llistxattr" },
+[186] = { 3, TD, SEN(flistxattr), "flistxattr" },
+[187] = { 2, TF, SEN(removexattr), "removexattr" },
+[188] = { 2, TF, SEN(removexattr), "lremovexattr" },
+[189] = { 2, TD, SEN(fremovexattr), "fremovexattr" },
+[190] = { 2, TS|TP, SEN(tkill), "tkill" },
+[191] = { 4, TD|TN, SEN(sendfile64), "sendfile64" },
+[192] = { 6, 0, SEN(futex_time32), "futex" },
+[193] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" },
+[194] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" },
+[195] = { 2, TC, SEN(capget), "capget" },
+[196] = { 2, TC, SEN(capset), "capset" },
+[197] = { 2, TM, SEN(io_setup), "io_setup" },
+[198] = { 1, TM, SEN(io_destroy), "io_destroy" },
+[199] = { 5, 0, SEN(io_getevents_time32), "io_getevents" },
+[200] = { 3, 0, SEN(io_submit), "io_submit" },
+[201] = { 3, 0, SEN(io_cancel), "io_cancel" },
+[202] = { 5, TD, SEN(fadvise64), "fadvise64" },
+[203] = { 1, TP|SE, SEN(exit), "exit_group" },
+[204] = { 4, 0, SEN(lookup_dcookie), "lookup_dcookie" },
+[205] = { 1, TD, SEN(epoll_create), "epoll_create" },
+[206] = { 4, TD, SEN(epoll_ctl), "epoll_ctl" },
+[207] = { 4, TD, SEN(epoll_wait), "epoll_wait" },
+[208] = { 5, TM|SI, SEN(remap_file_pages), "remap_file_pages" },
+[209] = { 1, 0, SEN(set_tid_address), "set_tid_address" },
+[210] = { 3, 0, SEN(timer_create), "timer_create" },
+[211] = { 4, 0, SEN(timer_settime32), "timer_settime" },
+[212] = { 2, 0, SEN(timer_gettime32), "timer_gettime" },
+[213] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" },
+[214] = { 1, 0, SEN(timer_delete), "timer_delete" },
+[215] = { 2, TCL, SEN(clock_settime32), "clock_settime" },
+[216] = { 2, TCL, SEN(clock_gettime32), "clock_gettime" },
+[217] = { 2, TCL, SEN(clock_getres_time32), "clock_getres" },
+[218] = { 4, 0, SEN(clock_nanosleep_time32), "clock_nanosleep" },
+[219] = { 3, TF|TSF|TSFA, SEN(statfs64), "statfs64" },
+[220] = { 3, TD|TFSF|TSFA, SEN(fstatfs64), "fstatfs64" },
+[221] = { 3, TS|TP, SEN(tgkill), "tgkill" },
+[222] = { },
+[223] = { 2, TF, SEN(utimes), "utimes" },
+[224] = { 6, TD, SEN(fadvise64_64), "fadvise64_64" },
+[225] = { 3, 0, SEN(printargs), "cacheflush" },
+[226] = { 5, 0, SEN(vserver), "vserver" },
+[227] = { 4, TD, SEN(mq_open), "mq_open" },
+[228] = { 1, 0, SEN(mq_unlink), "mq_unlink" },
+[229] = { 5, TD, SEN(mq_timedsend_time32), "mq_timedsend" },
+[230] = { 5, TD, SEN(mq_timedreceive_time32), "mq_timedreceive" },
+[231] = { 2, TD, SEN(mq_notify), "mq_notify" },
+[232] = { 3, TD, SEN(mq_getsetattr), "mq_getsetattr" },
+[233] = { 4, 0, SEN(kexec_load), "kexec_load" },
+[234] = { 5, TP, SEN(waitid), "waitid" },
+[235] = { 5, 0, SEN(add_key), "add_key" },
+[236] = { 4, 0, SEN(request_key), "request_key" },
+[237] = { 5, 0, SEN(keyctl), "keyctl" },
+[238] = { 3, 0, SEN(ioprio_set), "ioprio_set" },
+[239] = { 2, 0, SEN(ioprio_get), "ioprio_get" },
+[240] = { 0, TD, SEN(inotify_init), "inotify_init" },
+[241] = { 3, TD|TF, SEN(inotify_add_watch), "inotify_add_watch" },
+[242] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" },
+[243] = { 4, TD|TF, SEN(openat), "openat" },
+[244] = { 3, TD|TF, SEN(mkdirat), "mkdirat" },
+[245] = { 4, TD|TF, SEN(mknodat), "mknodat" },
+[246] = { 5, TD|TF, SEN(fchownat), "fchownat" },
+[247] = { 3, TD|TF, SEN(futimesat), "futimesat" },
+[248] = { 4, TD|TF|TFST|TSTA,SEN(fstatat64), "fstatat64" },
+[249] = { 3, TD|TF, SEN(unlinkat), "unlinkat" },
+[250] = { 4, TD|TF, SEN(renameat), "renameat" },
+[251] = { 5, TD|TF, SEN(linkat), "linkat" },
+[252] = { 3, TD|TF, SEN(symlinkat), "symlinkat" },
+[253] = { 4, TD|TF, SEN(readlinkat), "readlinkat" },
+[254] = { 3, TD|TF, SEN(fchmodat), "fchmodat" },
+[255] = { 3, TD|TF, SEN(faccessat), "faccessat" },
+[256] = { 6, TD, SEN(pselect6_time32), "pselect6" },
+[257] = { 5, TD, SEN(ppoll_time32), "ppoll" },
+[258] = { 1, 0, SEN(unshare), "unshare" },
+[259] = { 2, 0, SEN(set_robust_list), "set_robust_list" },
+[260] = { 3, 0, SEN(get_robust_list), "get_robust_list" },
+[261] = { 6, TD, SEN(splice), "splice" },
+[262] = { 6, TD, SEN(sync_file_range), "sync_file_range" },
+[263] = { 4, TD, SEN(tee), "tee" },
+[264] = { 4, TD, SEN(vmsplice), "vmsplice" },
+[265] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" },
+[266] = { 2, TI, SEN(msgget), "msgget" },
+[267] = { 4, TI, SEN(msgsnd), "msgsnd" },
+[268] = { 5, TI, SEN(msgrcv), "msgrcv" },
+[269] = { 3, TI, SEN(msgctl), "msgctl" },
+[270] = { 3, TI, SEN(semget), "semget" },
+[271] = { 3, TI, SEN(semop), "semop" },
+[272] = { 4, TI, SEN(semctl), "semctl" },
+[273] = { 4, TI, SEN(semtimedop_time32), "semtimedop" },
+[274] = { 3, TI|TM|SI, SEN(shmat), "shmat" },
+[275] = { 3, TI, SEN(shmget), "shmget" },
+[276] = { 1, TI|TM|SI, SEN(shmdt), "shmdt" },
+[277] = { 3, TI, SEN(shmctl), "shmctl" },
+[278] = { 4, TD|TF, SEN(utimensat_time32), "utimensat" },
+[279] = { 3, TD|TS, SEN(signalfd), "signalfd" },
+[280] = { 4, TD, SEN(timerfd), "timerfd" },
+[281] = { 1, TD, SEN(eventfd), "eventfd" },
+[282] = { },
+[283] = { 2, TD, SEN(setns), "setns" },
+[284] = { 5, TD, SEN(pread), "pread64" },
+[285] = { 5, TD, SEN(pwrite), "pwrite64" },
+[286] = { 2, TD, SEN(timerfd_create), "timerfd_create" },
+[287] = { 6, TD, SEN(fallocate), "fallocate" },
+[288] = { 4, TD, SEN(timerfd_settime32), "timerfd_settime" },
+[289] = { 2, TD, SEN(timerfd_gettime32), "timerfd_gettime" },
+[290] = { 4, TD|TS, SEN(signalfd4), "signalfd4" },
+[291] = { 2, TD, SEN(eventfd2), "eventfd2" },
+[292] = { 1, TD, SEN(epoll_create1), "epoll_create1" },
+[293] = { 3, TD, SEN(dup3), "dup3" },
+[294] = { 2, TD, SEN(pipe2), "pipe2" },
+[295] = { 1, TD, SEN(inotify_init1), "inotify_init1" },
+[296] = { 5, TD, SEN(preadv), "preadv" },
+[297] = { 5, TD, SEN(pwritev), "pwritev" },
+[298] = { 4, TP|TS, SEN(rt_tgsigqueueinfo), "rt_tgsigqueueinfo" },
+[299] = { 5, TD, SEN(perf_event_open), "perf_event_open" },
+[300] = { 5, TN, SEN(recvmmsg_time32), "recvmmsg" },
+[301] = { 2, TD, SEN(fanotify_init), "fanotify_init" },
+[302] = { 6, TD|TF, SEN(fanotify_mark), "fanotify_mark" },
+[303] = { 4, 0, SEN(prlimit64), "prlimit64" },
+[304] = { 5, TD|TF, SEN(name_to_handle_at), "name_to_handle_at" },
+[305] = { 3, TD, SEN(open_by_handle_at), "open_by_handle_at" },
+[306] = { 2, TCL, SEN(clock_adjtime32), "clock_adjtime" },
+[307] = { 1, TD, SEN(syncfs), "syncfs" },
+[308] = { 4, TN, SEN(sendmmsg), "sendmmsg" },
+[309] = { 6, 0, SEN(process_vm_readv), "process_vm_readv" },
+[310] = { 6, 0, SEN(process_vm_writev), "process_vm_writev" },
+[311] = { 5, 0, SEN(kcmp), "kcmp" },
+[312] = { 3, TD, SEN(finit_module), "finit_module" },
+[313] = { 3, 0, SEN(sched_setattr), "sched_setattr" },
+[314] = { 4, 0, SEN(sched_getattr), "sched_getattr" },
+[315] = { 5, TD|TF, SEN(renameat2), "renameat2" },
+[316] = { 3, 0, SEN(seccomp), "seccomp" },
+[317] = { 3, 0, SEN(getrandom), "getrandom" },
+[318] = { 2, TD, SEN(memfd_create), "memfd_create" },
+[319] = { 3, TD, SEN(bpf), "bpf" },
+[320] = { 5, TD|TF|TP|TSD|SE|SI, SEN(execveat), "execveat" },
+[321] = { 4, TN, SEN(accept4), "accept4" },
+[322] = { 1, TD, SEN(userfaultfd), "userfaultfd" },
+[323] = { 3, 0, SEN(membarrier), "membarrier" },
+[324] = { 3, TM, SEN(mlock2), "mlock2" },
+[325] = { 6, TD, SEN(copy_file_range), "copy_file_range" },
+[326] = { 6, TD, SEN(preadv2), "preadv2" },
+[327] = { 6, TD, SEN(pwritev2), "pwritev2" },
+[328] = { 4, TM|SI, SEN(pkey_mprotect), "pkey_mprotect" },
+[329] = { 2, 0, SEN(pkey_alloc), "pkey_alloc" },
+[330] = { 1, 0, SEN(pkey_free), "pkey_free" },
diff --git a/src/linux/avr32/userent.h b/src/linux/avr32/userent.h
new file mode 100644
index 000000000..b1b52fe5d
--- /dev/null
+++ b/src/linux/avr32/userent.h
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2014-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+{ uoff(regs.sr), "sr" },
+{ uoff(regs.pc), "pc" },
+{ uoff(regs.lr), "lr" },
+{ uoff(regs.sp), "sp" },
+{ uoff(regs.r12), "r12" },
+{ uoff(regs.r11), "r11" },
+{ uoff(regs.r10), "r10" },
+{ uoff(regs.r9), "r9" },
+{ uoff(regs.r8), "r8" },
+{ uoff(regs.r7), "r7" },
+{ uoff(regs.r6), "r6" },
+{ uoff(regs.r5), "r5" },
+{ uoff(regs.r4), "r4" },
+{ uoff(regs.r3), "r3" },
+{ uoff(regs.r2), "r2" },
+{ uoff(regs.r1), "r1" },
+{ uoff(regs.r0), "r0" },
+{ uoff(regs.r12_orig), "orig_r12" },
+/* Other fields in "struct user" */
+XLAT_UOFF(u_tsize),
+XLAT_UOFF(u_dsize),
+XLAT_UOFF(u_ssize),
+XLAT_UOFF(start_code),
+XLAT_UOFF(start_data),
+XLAT_UOFF(start_stack),
+XLAT_UOFF(signal),
+XLAT_UOFF(u_ar0),
+XLAT_UOFF(magic),
+XLAT_UOFF(u_comm),
+#include "../userent0.h"
diff --git a/src/linux/bfin/arch_defs_.h b/src/linux/bfin/arch_defs_.h
new file mode 100644
index 000000000..309d8e7e0
--- /dev/null
+++ b/src/linux/bfin/arch_defs_.h
@@ -0,0 +1,9 @@
+/*
+ * Copyright (c) 2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#define HAVE_ARCH_OLD_SELECT 1
+#define HAVE_ARCH_UID16_SYSCALLS 1
diff --git a/src/linux/bfin/arch_regs.c b/src/linux/bfin/arch_regs.c
new file mode 100644
index 000000000..426e589c2
--- /dev/null
+++ b/src/linux/bfin/arch_regs.c
@@ -0,0 +1,10 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static unsigned long bfin_r0;
+#define ARCH_PC_PEEK_ADDR PT_PC
+#define ARCH_SP_PEEK_ADDR PT_USP
diff --git a/src/linux/bfin/get_error.c b/src/linux/bfin/get_error.c
new file mode 100644
index 000000000..2d1059a1c
--- /dev/null
+++ b/src/linux/bfin/get_error.c
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "negated_errno.h"
+
+static void
+arch_get_error(struct tcb *tcp, const bool check_errno)
+{
+ if (check_errno && is_negated_errno(bfin_r0)) {
+ tcp->u_rval = -1;
+ tcp->u_error = -bfin_r0;
+ } else {
+ tcp->u_rval = bfin_r0;
+ }
+}
diff --git a/src/linux/bfin/get_scno.c b/src/linux/bfin/get_scno.c
new file mode 100644
index 000000000..6968e4806
--- /dev/null
+++ b/src/linux/bfin/get_scno.c
@@ -0,0 +1,13 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+/* Return codes: 1 - ok, 0 - ignore, other - error. */
+static int
+arch_get_scno(struct tcb *tcp)
+{
+ return upeek(tcp, PT_ORIG_P0, &tcp->scno) < 0 ? -1 : 1;
+}
diff --git a/src/linux/bfin/get_syscall_args.c b/src/linux/bfin/get_syscall_args.c
new file mode 100644
index 000000000..c0eb7a5b4
--- /dev/null
+++ b/src/linux/bfin/get_syscall_args.c
@@ -0,0 +1,21 @@
+/*
+ * Copyright (c) 2015-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+/* Return -1 on error or 1 on success (never 0!). */
+static int
+arch_get_syscall_args(struct tcb *tcp)
+{
+ static const int argreg[MAX_ARGS] = {
+ PT_R0, PT_R1, PT_R2, PT_R3, PT_R4, PT_R5
+ };
+ unsigned int i;
+
+ for (i = 0; i < n_args(tcp); ++i)
+ if (upeek(tcp, argreg[i], &tcp->u_arg[i]) < 0)
+ return -1;
+ return 1;
+}
diff --git a/src/linux/bfin/get_syscall_result.c b/src/linux/bfin/get_syscall_result.c
new file mode 100644
index 000000000..923542f94
--- /dev/null
+++ b/src/linux/bfin/get_syscall_result.c
@@ -0,0 +1,12 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static int
+get_syscall_result_regs(struct tcb *tcp)
+{
+ return upeek(tcp, PT_R0, &bfin_r0) < 0 ? -1 : 0;
+}
diff --git a/src/linux/bfin/ioctls_arch0.h b/src/linux/bfin/ioctls_arch0.h
new file mode 100644
index 000000000..7d9804d6f
--- /dev/null
+++ b/src/linux/bfin/ioctls_arch0.h
@@ -0,0 +1,12 @@
+/* Generated by ioctls_gen.sh from definitions found in $linux/arch/blackfin/include/ tree. */
+{ "asm/bfin_simple_timer.h", "BFIN_SIMPLE_TIMER_READ", _IOC_NONE, 0x740a, 0x00 },
+{ "asm/bfin_simple_timer.h", "BFIN_SIMPLE_TIMER_READ_COUNTER", _IOC_NONE, 0x740b, 0x00 },
+{ "asm/bfin_simple_timer.h", "BFIN_SIMPLE_TIMER_SET_MODE", _IOC_NONE, 0x7404, 0x00 },
+{ "asm/bfin_simple_timer.h", "BFIN_SIMPLE_TIMER_SET_PERIOD", _IOC_NONE, 0x7402, 0x00 },
+{ "asm/bfin_simple_timer.h", "BFIN_SIMPLE_TIMER_SET_WIDTH", _IOC_NONE, 0x7403, 0x00 },
+{ "asm/bfin_simple_timer.h", "BFIN_SIMPLE_TIMER_START", _IOC_NONE, 0x7406, 0x00 },
+{ "asm/bfin_simple_timer.h", "BFIN_SIMPLE_TIMER_STOP", _IOC_NONE, 0x7408, 0x00 },
+{ "asm/bfin_sport.h", "SPORT_IOC_CONFIG", _IOC_READ|_IOC_WRITE, 0x5001, 0x24 },
+{ "asm/bfin_sport.h", "SPORT_IOC_GET_SYSTEMCLOCK", _IOC_READ, 0x5002, 0x04 },
+{ "asm/bfin_sport.h", "SPORT_IOC_SET_BAUDRATE", _IOC_WRITE, 0x5003, 0x04 },
+{ "asm/ioctls.h", "FIOQSIZE", 0, 0x545E, 0 },
diff --git a/src/linux/bfin/ioctls_inc0.h b/src/linux/bfin/ioctls_inc0.h
new file mode 100644
index 000000000..4aecf983e
--- /dev/null
+++ b/src/linux/bfin/ioctls_inc0.h
@@ -0,0 +1 @@
+#include "32/ioctls_inc.h"
diff --git a/src/linux/bfin/raw_syscall.h b/src/linux/bfin/raw_syscall.h
new file mode 100644
index 000000000..8ac705cc7
--- /dev/null
+++ b/src/linux/bfin/raw_syscall.h
@@ -0,0 +1,28 @@
+/*
+ * Raw syscalls.
+ *
+ * Copyright (c) 2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_RAW_SYSCALL_H
+# define STRACE_RAW_SYSCALL_H
+
+# include "kernel_types.h"
+
+static inline kernel_ulong_t
+raw_syscall_0(const kernel_ulong_t nr, kernel_ulong_t *err)
+{
+ *err = 0;
+ register kernel_ulong_t ret;
+ __asm__ __volatile__("excpt 0"
+ : "=q0"(ret)
+ : "qA"(nr)
+ : "memory", "cc");
+ return ret;
+}
+# define raw_syscall_0 raw_syscall_0
+
+#endif /* !STRACE_RAW_SYSCALL_H */
diff --git a/src/linux/bfin/rt_sigframe.h b/src/linux/bfin/rt_sigframe.h
new file mode 100644
index 000000000..b375272d9
--- /dev/null
+++ b/src/linux/bfin/rt_sigframe.h
@@ -0,0 +1,22 @@
+/*
+ * Copyright (c) 2017-2018 Dmitry V. Levin <ldv@strace.io>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_RT_SIGFRAME_H
+# define STRACE_RT_SIGFRAME_H
+
+# include <signal.h>
+
+typedef struct {
+ int sig;
+ siginfo_t *pinfo;
+ void *puc;
+ char retcode[8];
+ siginfo_t info;
+ ucontext_t uc;
+} struct_rt_sigframe;
+
+#endif /* !STRACE_RT_SIGFRAME_H */
diff --git a/src/linux/bfin/set_error.c b/src/linux/bfin/set_error.c
new file mode 100644
index 000000000..c39cde27a
--- /dev/null
+++ b/src/linux/bfin/set_error.c
@@ -0,0 +1,20 @@
+/*
+ * Copyright (c) 2016-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static int
+arch_set_error(struct tcb *tcp)
+{
+ bfin_r0 = -tcp->u_error;
+ return upoke(tcp, PT_R0, bfin_r0);
+}
+
+static int
+arch_set_success(struct tcb *tcp)
+{
+ bfin_r0 = tcp->u_rval;
+ return upoke(tcp, PT_R0, bfin_r0);
+}
diff --git a/src/linux/bfin/set_scno.c b/src/linux/bfin/set_scno.c
new file mode 100644
index 000000000..00a325b45
--- /dev/null
+++ b/src/linux/bfin/set_scno.c
@@ -0,0 +1,12 @@
+/*
+ * Copyright (c) 2016-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static int
+arch_set_scno(struct tcb *tcp, kernel_ulong_t scno)
+{
+ return upoke(tcp, PT_ORIG_P0, scno);
+}
diff --git a/src/linux/bfin/syscallent.h b/src/linux/bfin/syscallent.h
new file mode 100644
index 000000000..53d5c235d
--- /dev/null
+++ b/src/linux/bfin/syscallent.h
@@ -0,0 +1,401 @@
+/*
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993, 1994, 1995 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1995-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+[ 0] = { 0, 0, SEN(restart_syscall), "restart_syscall" },
+[ 1] = { 1, TP|SE, SEN(exit), "exit" },
+[ 2] = { 0, TP, SEN(fork), "fork" },
+[ 3] = { 3, TD, SEN(read), "read" },
+[ 4] = { 3, TD, SEN(write), "write" },
+[ 5] = { 3, TD|TF, SEN(open), "open" },
+[ 6] = { 1, TD, SEN(close), "close" },
+[ 7] = { 3, TP, SEN(waitpid), "waitpid" },
+[ 8] = { 2, TD|TF, SEN(creat), "creat" },
+[ 9] = { 2, TF, SEN(link), "link" },
+[ 10] = { 1, TF, SEN(unlink), "unlink" },
+[ 11] = { 3, TF|TP|TSD|SE|SI, SEN(execve), "execve" },
+[ 12] = { 1, TF, SEN(chdir), "chdir" },
+[ 13] = { 1, TCL, SEN(time), "time" },
+[ 14] = { 3, TF, SEN(mknod), "mknod" },
+[ 15] = { 2, TF, SEN(chmod), "chmod" },
+[ 16] = { 3, TF, SEN(chown16), "chown" },
+[ 17] = { 0, TM, SEN(break), "break" },
+[ 18] = { 2, TF|TST|TSTA, SEN(oldstat), "oldstat" },
+[ 19] = { 3, TD, SEN(lseek), "lseek" },
+[ 20] = { 0, PU|NF, SEN(getpid), "getpid" },
+[ 21] = { 5, TF, SEN(mount), "mount" },
+[ 22] = { 1, TF, SEN(umount), "umount" },
+[ 23] = { 1, TC, SEN(setuid16), "setuid" },
+[ 24] = { 0, TC|PU|NF, SEN(getuid16), "getuid" },
+[ 25] = { 1, 0, SEN(stime), "stime" },
+[ 26] = { 4, 0, SEN(ptrace), "ptrace" },
+[ 27] = { 1, 0, SEN(alarm), "alarm" },
+[ 28] = { 2, TD|TFST|TSTA, SEN(oldfstat), "oldfstat" },
+[ 29] = { 0, TS, SEN(pause), "pause" },
+[ 30] = { 2, TF, SEN(utime), "utime" },
+[ 31] = { 2, 0, SEN(stty), "stty" },
+[ 32] = { 2, 0, SEN(gtty), "gtty" },
+[ 33] = { 2, TF, SEN(access), "access" },
+[ 34] = { 1, 0, SEN(nice), "nice" },
+[ 35] = { 0, 0, SEN(ftime), "ftime" },
+[ 36] = { 0, 0, SEN(sync), "sync" },
+[ 37] = { 2, TS|TP, SEN(kill), "kill" },
+[ 38] = { 2, TF, SEN(rename), "rename" },
+[ 39] = { 2, TF, SEN(mkdir), "mkdir" },
+[ 40] = { 1, TF, SEN(rmdir), "rmdir" },
+[ 41] = { 1, TD, SEN(dup), "dup" },
+[ 42] = { 1, TD, SEN(pipe), "pipe" },
+[ 43] = { 1, 0, SEN(times), "times" },
+[ 44] = { 0, 0, SEN(prof), "prof" },
+[ 45] = { 1, TM|SI, SEN(brk), "brk" },
+[ 46] = { 1, TC, SEN(setgid16), "setgid" },
+[ 47] = { 0, TC|PU|NF, SEN(getgid16), "getgid" },
+[ 48] = { 2, TS, SEN(signal), "signal" },
+[ 49] = { 0, TC|PU|NF, SEN(geteuid16), "geteuid" },
+[ 50] = { 0, TC|PU|NF, SEN(getegid16), "getegid" },
+[ 51] = { 1, TF, SEN(acct), "acct" },
+[ 52] = { 2, TF, SEN(umount2), "umount2" },
+[ 53] = { 0, 0, SEN(lock), "lock" },
+[ 54] = { 3, TD, SEN(ioctl), "ioctl" },
+[ 55] = { 3, TD, SEN(fcntl), "fcntl" },
+[ 56] = { 0, 0, SEN(mpx), "mpx" },
+[ 57] = { 2, 0, SEN(setpgid), "setpgid" },
+[ 58] = { 2, 0, SEN(ulimit), "ulimit" },
+[ 59] = { 1, 0, SEN(oldolduname), "oldolduname" },
+[ 60] = { 1, NF, SEN(umask), "umask" },
+[ 61] = { 1, TF, SEN(chroot), "chroot" },
+[ 62] = { 2, TSFA, SEN(ustat), "ustat" },
+[ 63] = { 2, TD, SEN(dup2), "dup2" },
+[ 64] = { 0, PU|NF, SEN(getppid), "getppid" },
+[ 65] = { 0, PU|NF, SEN(getpgrp), "getpgrp" },
+[ 66] = { 0, 0, SEN(setsid), "setsid" },
+[ 67] = { 3, TS, SEN(sigaction), "sigaction" },
+[ 68] = { 0, TS, SEN(sgetmask), "sgetmask" },
+[ 69] = { 1, TS, SEN(ssetmask), "ssetmask" },
+[ 70] = { 2, TC, SEN(setreuid16), "setreuid" },
+[ 71] = { 2, TC, SEN(setregid16), "setregid" },
+[ 72] = { 3, TS, SEN(sigsuspend), "sigsuspend" },
+[ 73] = { 1, TS, SEN(sigpending), "sigpending" },
+[ 74] = { 2, 0, SEN(sethostname), "sethostname" },
+[ 75] = { 2, 0, SEN(setrlimit), "setrlimit" },
+[ 76] = { 2, 0, SEN(getrlimit), "old_getrlimit" },
+[ 77] = { 2, 0, SEN(getrusage), "getrusage" },
+[ 78] = { 2, TCL, SEN(gettimeofday), "gettimeofday" },
+[ 79] = { 2, TCL, SEN(settimeofday), "settimeofday" },
+[ 80] = { 2, TC, SEN(getgroups16), "getgroups" },
+[ 81] = { 2, TC, SEN(setgroups16), "setgroups" },
+[ 82] = { 1, TD, SEN(oldselect), "select" },
+[ 83] = { 2, TF, SEN(symlink), "symlink" },
+[ 84] = { 2, TF|TLST|TSTA, SEN(oldlstat), "oldlstat" },
+[ 85] = { 3, TF, SEN(readlink), "readlink" },
+[ 86] = { 1, TF, SEN(uselib), "uselib" },
+[ 87] = { 2, TF, SEN(swapon), "swapon" },
+[ 88] = { 4, 0, SEN(reboot), "reboot" },
+[ 89] = { 3, TD, SEN(readdir), "readdir" },
+[ 90] = { 6, TD|TM|SI, SEN(printargs), "mmap" }, /*not implemented in kernel */
+[ 91] = { 2, TM|SI, SEN(munmap), "munmap" },
+[ 92] = { 2, TF, SEN(truncate), "truncate" },
+[ 93] = { 2, TD, SEN(ftruncate), "ftruncate" },
+[ 94] = { 2, TD, SEN(fchmod), "fchmod" },
+[ 95] = { 3, TD, SEN(fchown16), "fchown" },
+[ 96] = { 2, 0, SEN(getpriority), "getpriority" },
+[ 97] = { 3, 0, SEN(setpriority), "setpriority" },
+[ 98] = { 4, 0, SEN(profil), "profil" },
+[ 99] = { 2, TF|TSF|TSFA, SEN(statfs), "statfs" },
+[100] = { 2, TD|TFSF|TSFA, SEN(fstatfs), "fstatfs" },
+[101] = { 3, 0, SEN(ioperm), "ioperm" },
+[102] = { 2, TD|TSD, SEN(socketcall), "socketcall" },
+[103] = { 3, 0, SEN(syslog), "syslog" },
+[104] = { 3, 0, SEN(setitimer), "setitimer" },
+[105] = { 2, 0, SEN(getitimer), "getitimer" },
+[106] = { 2, TF|TST|TSTA, SEN(stat), "stat" },
+[107] = { 2, TF|TLST|TSTA, SEN(lstat), "lstat" },
+[108] = { 2, TD|TFST|TSTA, SEN(fstat), "fstat" },
+[109] = { 1, 0, SEN(olduname), "olduname" },
+[110] = { 1, 0, SEN(iopl), "iopl" },
+[111] = { 0, 0, SEN(vhangup), "vhangup" },
+[112] = { 0, 0, SEN(idle), "idle" },
+[113] = { 1, 0, SEN(vm86old), "vm86old" },
+[114] = { 4, TP, SEN(wait4), "wait4" },
+[115] = { 1, TF, SEN(swapoff), "swapoff" },
+[116] = { 1, 0, SEN(sysinfo), "sysinfo" },
+[117] = { 6, TI|TSD, SEN(ipc), "ipc" },
+[118] = { 1, TD, SEN(fsync), "fsync" },
+[119] = { 0, TS, SEN(sigreturn), "sigreturn" },
+[120] = { 5, TP, SEN(clone), "clone" },
+[121] = { 2, 0, SEN(setdomainname), "setdomainname" },
+[122] = { 1, 0, SEN(uname), "uname" },
+[123] = { 3, 0, SEN(modify_ldt), "modify_ldt" },
+[124] = { 1, TCL, SEN(adjtimex32), "adjtimex" },
+[125] = { 3, TM|SI, SEN(mprotect), "mprotect" },
+[126] = { 3, TS, SEN(sigprocmask), "sigprocmask" },
+[127] = { 2, 0, SEN(create_module), "create_module" },
+[128] = { 3, 0, SEN(init_module), "init_module" },
+[129] = { 2, 0, SEN(delete_module), "delete_module" },
+[130] = { 1, 0, SEN(get_kernel_syms), "get_kernel_syms" },
+[131] = { 4, TF, SEN(quotactl), "quotactl" },
+[132] = { 1, 0, SEN(getpgid), "getpgid" },
+[133] = { 1, TD, SEN(fchdir), "fchdir" },
+[134] = { 2, 0, SEN(bdflush), "bdflush" },
+[135] = { 3, 0, SEN(sysfs), "sysfs" },
+[136] = { 1, NF, SEN(personality), "personality" },
+[137] = { 5, 0, SEN(afs_syscall), "afs_syscall" },
+[138] = { 1, TC|NF, SEN(setfsuid16), "setfsuid" },
+[139] = { 1, TC|NF, SEN(setfsgid16), "setfsgid" },
+[140] = { 5, TD, SEN(llseek), "_llseek" },
+[141] = { 3, TD, SEN(getdents), "getdents" },
+[142] = { 5, TD, SEN(select), "_newselect" },
+[143] = { 2, TD, SEN(flock), "flock" },
+[144] = { 3, TM, SEN(msync), "msync" },
+[145] = { 3, TD, SEN(readv), "readv" },
+[146] = { 3, TD, SEN(writev), "writev" },
+[147] = { 1, 0, SEN(getsid), "getsid" },
+[148] = { 1, TD, SEN(fdatasync), "fdatasync" },
+[149] = { 1, 0, SEN(sysctl), "_sysctl" },
+[150] = { 2, TM, SEN(mlock), "mlock" },
+[151] = { 2, TM, SEN(munlock), "munlock" },
+[152] = { 1, TM, SEN(mlockall), "mlockall" },
+[153] = { 0, TM, SEN(munlockall), "munlockall" },
+[154] = { 2, 0, SEN(sched_setparam), "sched_setparam" },
+[155] = { 2, 0, SEN(sched_getparam), "sched_getparam" },
+[156] = { 3, 0, SEN(sched_setscheduler), "sched_setscheduler" },
+[157] = { 1, 0, SEN(sched_getscheduler), "sched_getscheduler" },
+[158] = { 0, 0, SEN(sched_yield), "sched_yield" },
+[159] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"},
+[160] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"},
+[161] = { 2, 0, SEN(sched_rr_get_interval_time32),"sched_rr_get_interval"},
+[162] = { 2, 0, SEN(nanosleep_time32), "nanosleep" },
+[163] = { 5, TM|SI, SEN(mremap), "mremap" },
+[164] = { 3, TC, SEN(setresuid16), "setresuid" },
+[165] = { 3, TC, SEN(getresuid16), "getresuid" },
+[166] = { 5, 0, SEN(vm86), "vm86" },
+[167] = { 5, 0, SEN(query_module), "query_module" },
+[168] = { 3, TD, SEN(poll_time32), "poll" },
+[169] = { 3, 0, SEN(nfsservctl), "nfsservctl" },
+[170] = { 3, TC, SEN(setresgid16), "setresgid" },
+[171] = { 3, TC, SEN(getresgid16), "getresgid" },
+[172] = { 5, TC, SEN(prctl), "prctl" },
+[173] = { 0, TS, SEN(rt_sigreturn), "rt_sigreturn" },
+[174] = { 4, TS, SEN(rt_sigaction), "rt_sigaction" },
+[175] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" },
+[176] = { 2, TS, SEN(rt_sigpending), "rt_sigpending" },
+[177] = { 4, TS, SEN(rt_sigtimedwait_time32), "rt_sigtimedwait" },
+[178] = { 3, TS|TP, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" },
+[179] = { 2, TS, SEN(rt_sigsuspend), "rt_sigsuspend" },
+[180] = { 5, TD, SEN(pread), "pread" },
+[181] = { 5, TD, SEN(pwrite), "pwrite" },
+[182] = { 3, TF, SEN(chown16), "lchown" },
+[183] = { 2, TF, SEN(getcwd), "getcwd" },
+[184] = { 2, TC, SEN(capget), "capget" },
+[185] = { 2, TC, SEN(capset), "capset" },
+[186] = { 2, TS, SEN(sigaltstack), "sigaltstack" },
+[187] = { 4, TD|TN, SEN(sendfile), "sendfile" },
+[188] = { 5, TN, SEN(getpmsg), "getpmsg" },
+[189] = { 5, TN, SEN(putpmsg), "putpmsg" },
+[190] = { 0, TP, SEN(vfork), "vfork" },
+[191] = { 2, 0, SEN(getrlimit), "getrlimit" },
+[192] = { 6, TD|TM|SI, SEN(mmap_pgoff), "mmap2" },
+[193] = { 3, TF, SEN(truncate64), "truncate64" },
+[194] = { 3, TD, SEN(ftruncate64), "ftruncate64" },
+[195] = { 2, TF|TST|TSTA, SEN(stat64), "stat64" },
+[196] = { 2, TF|TLST|TSTA, SEN(lstat64), "lstat64" },
+[197] = { 2, TD|TFST|TSTA, SEN(fstat64), "fstat64" },
+[198] = { 3, TF, SEN(chown), "chown32" },
+[199] = { 0, TC|PU|NF, SEN(getuid), "getuid32" },
+[200] = { 0, TC|PU|NF, SEN(getgid), "getgid32" },
+[201] = { 0, TC|PU|NF, SEN(geteuid), "geteuid32" },
+[202] = { 0, TC|PU|NF, SEN(geteuid), "getegid32" },
+[203] = { 2, TC, SEN(setreuid), "setreuid32" },
+[204] = { 2, TC, SEN(setregid), "setregid32" },
+[205] = { 2, TC, SEN(getgroups), "getgroups32" },
+[206] = { 2, TC, SEN(setgroups), "setgroups32" },
+[207] = { 3, TD, SEN(fchown), "fchown32" },
+[208] = { 3, TC, SEN(setresuid), "setresuid32" },
+[209] = { 3, TC, SEN(getresuid), "getresuid32" },
+[210] = { 3, TC, SEN(setresgid), "setresgid32" },
+[211] = { 3, TC, SEN(getresgid), "getresgid32" },
+[212] = { 3, TF, SEN(chown), "lchown32" },
+[213] = { 1, TC, SEN(setuid), "setuid32" },
+[214] = { 1, TC, SEN(setgid), "setgid32" },
+[215] = { 1, TC|NF, SEN(setfsuid), "setfsuid32" },
+[216] = { 1, TC|NF, SEN(setfsgid), "setfsgid32" },
+[217] = { 2, TF, SEN(pivotroot), "pivot_root" },
+[218] = { 3, TM, SEN(mincore), "mincore" },
+[219] = { 3, TM, SEN(madvise), "madvise" },
+[220] = { 3, TD, SEN(getdents64), "getdents64" },
+[221] = { 3, TD, SEN(fcntl64), "fcntl64" },
+[222 ... 223] = { },
+[224] = { 0, PU|NF, SEN(gettid), "gettid" },
+[225] = { 4, TD, SEN(readahead), "readahead" },
+[226] = { 5, TF, SEN(setxattr), "setxattr" },
+[227] = { 5, TF, SEN(setxattr), "lsetxattr" },
+[228] = { 5, TD, SEN(fsetxattr), "fsetxattr" },
+[229] = { 4, TF, SEN(getxattr), "getxattr" },
+[230] = { 4, TF, SEN(getxattr), "lgetxattr" },
+[231] = { 4, TD, SEN(fgetxattr), "fgetxattr" },
+[232] = { 3, TF, SEN(listxattr), "listxattr" },
+[233] = { 3, TF, SEN(listxattr), "llistxattr" },
+[234] = { 3, TD, SEN(flistxattr), "flistxattr" },
+[235] = { 2, TF, SEN(removexattr), "removexattr" },
+[236] = { 2, TF, SEN(removexattr), "lremovexattr" },
+[237] = { 2, TD, SEN(fremovexattr), "fremovexattr" },
+[238] = { 2, TS|TP, SEN(tkill), "tkill" },
+[239] = { 4, TD|TN, SEN(sendfile64), "sendfile64" },
+[240] = { 6, 0, SEN(futex_time32), "futex" },
+[241] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" },
+[242] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" },
+[243] = { 1, 0, SEN(set_thread_area), "set_thread_area" },
+[244] = { 1, 0, SEN(get_thread_area), "get_thread_area" },
+[245] = { 2, TM, SEN(io_setup), "io_setup" },
+[246] = { 1, TM, SEN(io_destroy), "io_destroy" },
+[247] = { 5, 0, SEN(io_getevents_time32), "io_getevents" },
+[248] = { 3, 0, SEN(io_submit), "io_submit" },
+[249] = { 3, 0, SEN(io_cancel), "io_cancel" },
+[250] = { 5, 0, SEN(printargs), "alloc_hugepages" },
+[251] = { 1, 0, SEN(printargs), "free_hugepages" },
+[252] = { 1, TP|SE, SEN(exit), "exit_group" },
+[253] = { 4, 0, SEN(lookup_dcookie), "lookup_dcookie" },
+[254] = { 1, 0, SEN(printargs), "bfin_spinlock" },
+[255] = { 1, TD, SEN(epoll_create), "epoll_create" },
+[256] = { 4, TD, SEN(epoll_ctl), "epoll_ctl" },
+[257] = { 4, TD, SEN(epoll_wait), "epoll_wait" },
+[258] = { 5, TM|SI, SEN(remap_file_pages), "remap_file_pages" },
+[259] = { 1, 0, SEN(set_tid_address), "set_tid_address" },
+[260] = { 3, 0, SEN(timer_create), "timer_create" },
+[261] = { 4, 0, SEN(timer_settime32), "timer_settime" },
+[262] = { 2, 0, SEN(timer_gettime32), "timer_gettime" },
+[263] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" },
+[264] = { 1, 0, SEN(timer_delete), "timer_delete" },
+[265] = { 2, TCL, SEN(clock_settime32), "clock_settime" },
+[266] = { 2, TCL, SEN(clock_gettime32), "clock_gettime" },
+[267] = { 2, TCL, SEN(clock_getres_time32), "clock_getres" },
+[268] = { 4, 0, SEN(clock_nanosleep_time32), "clock_nanosleep" },
+[269] = { 3, TF|TSF|TSFA, SEN(statfs64), "statfs64" },
+[270] = { 3, TD|TFSF|TSFA, SEN(fstatfs64), "fstatfs64" },
+[271] = { 3, TS|TP, SEN(tgkill), "tgkill" },
+[272] = { 2, TF, SEN(utimes), "utimes" },
+[273] = { 6, TD, SEN(fadvise64_64), "fadvise64_64" },
+[274] = { 5, 0, SEN(vserver), "vserver" },
+[275] = { 6, TM, SEN(mbind), "mbind" },
+[276] = { 5, TM, SEN(get_mempolicy), "get_mempolicy" },
+[277] = { 3, TM, SEN(set_mempolicy), "set_mempolicy" },
+[278] = { 4, TD, SEN(mq_open), "mq_open" },
+[279] = { 1, 0, SEN(mq_unlink), "mq_unlink" },
+[280] = { 5, TD, SEN(mq_timedsend_time32), "mq_timedsend" },
+[281] = { 5, TD, SEN(mq_timedreceive_time32), "mq_timedreceive" },
+[282] = { 2, TD, SEN(mq_notify), "mq_notify" },
+[283] = { 3, TD, SEN(mq_getsetattr), "mq_getsetattr" },
+[284] = { 4, 0, SEN(kexec_load), "kexec_load" },
+[285] = { 5, TP, SEN(waitid), "waitid" },
+[286] = { 5, 0, SEN(add_key), "add_key" },
+[287] = { 4, 0, SEN(request_key), "request_key" },
+[288] = { 5, 0, SEN(keyctl), "keyctl" },
+[289] = { 3, 0, SEN(ioprio_set), "ioprio_set" },
+[290] = { 2, 0, SEN(ioprio_get), "ioprio_get" },
+[291] = { 0, TD, SEN(inotify_init), "inotify_init" },
+[292] = { 3, TD|TF, SEN(inotify_add_watch), "inotify_add_watch" },
+[293] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" },
+[294] = { 4, TM, SEN(migrate_pages), "migrate_pages" },
+[295] = { 4, TD|TF, SEN(openat), "openat" },
+[296] = { 3, TD|TF, SEN(mkdirat), "mkdirat" },
+[297] = { 4, TD|TF, SEN(mknodat), "mknodat" },
+[298] = { 5, TD|TF, SEN(fchownat), "fchownat" },
+[299] = { 3, TD|TF, SEN(futimesat), "futimesat" },
+[300] = { 4, TD|TF|TFST|TSTA,SEN(fstatat64), "fstatat64" },
+[301] = { 3, TD|TF, SEN(unlinkat), "unlinkat" },
+[302] = { 4, TD|TF, SEN(renameat), "renameat" },
+[303] = { 5, TD|TF, SEN(linkat), "linkat" },
+[304] = { 3, TD|TF, SEN(symlinkat), "symlinkat" },
+[305] = { 4, TD|TF, SEN(readlinkat), "readlinkat" },
+[306] = { 3, TD|TF, SEN(fchmodat), "fchmodat" },
+[307] = { 3, TD|TF, SEN(faccessat), "faccessat" },
+[308] = { 6, TD, SEN(pselect6_time32), "pselect6" },
+[309] = { 5, TD, SEN(ppoll_time32), "ppoll" },
+[310] = { 1, 0, SEN(unshare), "unshare" },
+[311] = { 2, 0, SEN(sram_alloc), "sram_alloc" },
+[312] = { 1, 0, SEN(printargs), "sram_free" },
+[313] = { 3, 0, SEN(printargs), "dma_memcpy" },
+[314] = { 3, TN, SEN(accept), "accept" },
+[315] = { 3, TN, SEN(bind), "bind" },
+[316] = { 3, TN, SEN(connect), "connect" },
+[317] = { 3, TN, SEN(getpeername), "getpeername" },
+[318] = { 3, TN, SEN(getsockname), "getsockname" },
+[319] = { 5, TN, SEN(getsockopt), "getsockopt" },
+[320] = { 2, TN, SEN(listen), "listen" },
+[321] = { 4, TN, SEN(recv), "recv" },
+[322] = { 6, TN, SEN(recvfrom), "recvfrom" },
+[323] = { 3, TN, SEN(recvmsg), "recvmsg" },
+[324] = { 4, TN, SEN(send), "send" },
+[325] = { 3, TN, SEN(sendmsg), "sendmsg" },
+[326] = { 6, TN, SEN(sendto), "sendto" },
+[327] = { 5, TN, SEN(setsockopt), "setsockopt" },
+[328] = { 2, TN, SEN(shutdown), "shutdown" },
+[329] = { 3, TN, SEN(socket), "socket" },
+[330] = { 4, TN, SEN(socketpair), "socketpair" },
+[331] = { 4, TI, SEN(semctl), "semctl" },
+[332] = { 3, TI, SEN(semget), "semget" },
+[333] = { 3, TI, SEN(semop), "semop" },
+[334] = { 3, TI, SEN(msgctl), "msgctl" },
+[335] = { 2, TI, SEN(msgget), "msgget" },
+[336] = { 5, TI, SEN(msgrcv), "msgrcv" },
+[337] = { 4, TI, SEN(msgsnd), "msgsnd" },
+[338] = { 3, TI|TM|SI, SEN(shmat), "shmat" },
+[339] = { 3, TI, SEN(shmctl), "shmctl" },
+[340] = { 1, TI|TM|SI, SEN(shmdt), "shmdt" },
+[341] = { 3, TI, SEN(shmget), "shmget" },
+[342] = { 6, TD, SEN(splice), "splice" },
+[343] = { 6, TD, SEN(sync_file_range), "sync_file_range" },
+[344] = { 4, TD, SEN(tee), "tee" },
+[345] = { 4, TD, SEN(vmsplice), "vmsplice" },
+[346] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" },
+[347] = { 4, TD|TF, SEN(utimensat_time32), "utimensat" },
+[348] = { 3, TD|TS, SEN(signalfd), "signalfd" },
+[349] = { 2, TD, SEN(timerfd_create), "timerfd_create" },
+[350] = { 1, TD, SEN(eventfd), "eventfd" },
+[351] = { 5, TD, SEN(pread), "pread64" },
+[352] = { 5, TD, SEN(pwrite), "pwrite64" },
+[353] = { 5, TD, SEN(fadvise64), "fadvise64" },
+[354] = { 2, 0, SEN(set_robust_list), "set_robust_list" },
+[355] = { 3, 0, SEN(get_robust_list), "get_robust_list" },
+[356] = { 6, TD, SEN(fallocate), "fallocate" },
+[357] = { 4, TI, SEN(semtimedop_time32), "semtimedop" },
+[358] = { 4, TD, SEN(timerfd_settime32), "timerfd_settime" },
+[359] = { 2, TD, SEN(timerfd_gettime32), "timerfd_gettime" },
+[360] = { 4, TD|TS, SEN(signalfd4), "signalfd4" },
+[361] = { 2, TD, SEN(eventfd2), "eventfd2" },
+[362] = { 1, TD, SEN(epoll_create1), "epoll_create1" },
+[363] = { 3, TD, SEN(dup3), "dup3" },
+[364] = { 2, TD, SEN(pipe2), "pipe2" },
+[365] = { 1, TD, SEN(inotify_init1), "inotify_init1" },
+[366] = { 5, TD, SEN(preadv), "preadv" },
+[367] = { 5, TD, SEN(pwritev), "pwritev" },
+[368] = { 4, TP|TS, SEN(rt_tgsigqueueinfo), "rt_tgsigqueueinfo" },
+[369] = { 5, TD, SEN(perf_event_open), "perf_event_open" },
+[370] = { 5, TN, SEN(recvmmsg_time32), "recvmmsg" },
+[371] = { 2, TD, SEN(fanotify_init), "fanotify_init" },
+[372] = { 6, TD|TF, SEN(fanotify_mark), "fanotify_mark" },
+[373] = { 4, 0, SEN(prlimit64), "prlimit64" },
+[374] = { 3, 0, SEN(cacheflush), "cacheflush" },
+[375] = { 5, TD|TF, SEN(name_to_handle_at), "name_to_handle_at" },
+[376] = { 3, TD, SEN(open_by_handle_at), "open_by_handle_at" },
+[377] = { 2, TCL, SEN(clock_adjtime32), "clock_adjtime" },
+[378] = { 1, TD, SEN(syncfs), "syncfs" },
+[379] = { 2, TD, SEN(setns), "setns" },
+[380] = { 4, TN, SEN(sendmmsg), "sendmmsg" },
+[381] = { 6, 0, SEN(process_vm_readv), "process_vm_readv" },
+[382] = { 6, 0, SEN(process_vm_writev), "process_vm_writev" },
+[383] = { 5, 0, SEN(kcmp), "kcmp" },
+[384] = { 3, TD, SEN(finit_module), "finit_module" },
+[385] = { 3, 0, SEN(sched_setattr), "sched_setattr" },
+[386] = { 4, 0, SEN(sched_getattr), "sched_getattr" },
+[387] = { 5, TD|TF, SEN(renameat2), "renameat2" },
+[388] = { 3, 0, SEN(seccomp), "seccomp" },
+[389] = { 3, 0, SEN(getrandom), "getrandom" },
+[390] = { 2, TD, SEN(memfd_create), "memfd_create" },
+[391] = { 3, TD, SEN(bpf), "bpf" },
+[392] = { 5, TD|TF|TP|TSD|SE|SI, SEN(execveat), "execveat" },
diff --git a/src/linux/bfin/userent.h b/src/linux/bfin/userent.h
new file mode 100644
index 000000000..a35ba9fd4
--- /dev/null
+++ b/src/linux/bfin/userent.h
@@ -0,0 +1,16 @@
+/*
+ * Copyright (c) 2014-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+XLAT_UOFF(u_tsize),
+XLAT_UOFF(u_dsize),
+XLAT_UOFF(u_ssize),
+XLAT_UOFF(start_code),
+XLAT_UOFF(signal),
+XLAT_UOFF(u_ar0),
+XLAT_UOFF(magic),
+XLAT_UOFF(u_comm),
+#include "../userent0.h"
diff --git a/src/linux/check_scno.c b/src/linux/check_scno.c
new file mode 100644
index 000000000..acadab257
--- /dev/null
+++ b/src/linux/check_scno.c
@@ -0,0 +1,13 @@
+/*
+ * Copyright (c) 2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+/* Return codes: 1 - ok, 0 - ignore, other - error. */
+static int
+arch_check_scno(struct tcb *tcp)
+{
+ return 1;
+}
diff --git a/src/linux/csky/arch_regs.c b/src/linux/csky/arch_regs.c
new file mode 100644
index 000000000..3caed7b1b
--- /dev/null
+++ b/src/linux/csky/arch_regs.c
@@ -0,0 +1,12 @@
+/*
+ * Copyright (c) 2015-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static struct pt_regs csky_regs;
+
+#define ARCH_REGS_FOR_GETREGSET csky_regs
+#define ARCH_PC_REG csky_regs.pc
+#define ARCH_SP_REG csky_regs.usp
diff --git a/src/linux/csky/get_error.c b/src/linux/csky/get_error.c
new file mode 100644
index 000000000..c21a92486
--- /dev/null
+++ b/src/linux/csky/get_error.c
@@ -0,0 +1,18 @@
+/*
+ * Copyright (c) 2015-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+#include "negated_errno.h"
+
+static void
+arch_get_error(struct tcb *tcp, const bool check_errno)
+{
+ if (check_errno && is_negated_errno(csky_regs.a0)) {
+ tcp->u_rval = -1;
+ tcp->u_error = -csky_regs.a0;
+ } else {
+ tcp->u_rval = csky_regs.a0;
+ }
+}
diff --git a/src/linux/csky/get_scno.c b/src/linux/csky/get_scno.c
new file mode 100644
index 000000000..bfc8619f8
--- /dev/null
+++ b/src/linux/csky/get_scno.c
@@ -0,0 +1,18 @@
+/*
+ * Copyright (c) 2015-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+/* Return codes: 1 - ok, 0 - ignore, other - error. */
+static int
+arch_get_scno(struct tcb *tcp)
+{
+#if defined(__CSKYABIV2__)
+ tcp->scno = csky_regs.regs[3];
+#else
+ tcp->scno = csky_regs.a1;
+#endif
+ return 1;
+}
diff --git a/src/linux/csky/get_syscall_args.c b/src/linux/csky/get_syscall_args.c
new file mode 100644
index 000000000..05dbfb4f1
--- /dev/null
+++ b/src/linux/csky/get_syscall_args.c
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2015-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+/* Return -1 on error or 1 on success (never 0!). */
+static int
+arch_get_syscall_args(struct tcb *tcp)
+{
+ tcp->u_arg[0] = csky_regs.orig_a0;
+ tcp->u_arg[1] = csky_regs.a1;
+ tcp->u_arg[2] = csky_regs.a2;
+ tcp->u_arg[3] = csky_regs.a3;
+ tcp->u_arg[4] = csky_regs.regs[0];
+ tcp->u_arg[5] = csky_regs.regs[1];
+ return 1;
+}
diff --git a/src/linux/csky/ioctls_arch0.h b/src/linux/csky/ioctls_arch0.h
new file mode 100644
index 000000000..8b7ac89b3
--- /dev/null
+++ b/src/linux/csky/ioctls_arch0.h
@@ -0,0 +1 @@
+/* Generated by ioctls_gen.sh from definitions found in $linux/arch/csky/include/ tree. */
diff --git a/src/linux/csky/ioctls_inc0.h b/src/linux/csky/ioctls_inc0.h
new file mode 100644
index 000000000..4aecf983e
--- /dev/null
+++ b/src/linux/csky/ioctls_inc0.h
@@ -0,0 +1 @@
+#include "32/ioctls_inc.h"
diff --git a/src/linux/csky/raw_syscall.h b/src/linux/csky/raw_syscall.h
new file mode 100644
index 000000000..0ffb83ca2
--- /dev/null
+++ b/src/linux/csky/raw_syscall.h
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2018-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_RAW_SYSCALL_H
+# define STRACE_RAW_SYSCALL_H
+
+# include "kernel_types.h"
+
+static inline kernel_ulong_t
+raw_syscall_0(const kernel_ulong_t nr, kernel_ulong_t *err)
+{
+# if defined(__CSKYABIV2__)
+ register kernel_ulong_t scno __asm__("r7") = nr;
+# else
+ register kernel_ulong_t scno __asm__("r1") = nr;
+# endif
+ register kernel_ulong_t a0 __asm__("a0");
+ asm volatile("trap 0"
+ : "+r"(scno), "=r"(a0)
+ :
+ : "memory");
+
+ *err = 0;
+ return a0;
+}
+# define raw_syscall_0 raw_syscall_0
+
+#endif /* !STRACE_RAW_SYSCALL_H */
diff --git a/src/linux/csky/set_error.c b/src/linux/csky/set_error.c
new file mode 100644
index 000000000..f8cb6333c
--- /dev/null
+++ b/src/linux/csky/set_error.c
@@ -0,0 +1,20 @@
+/*
+ * Copyright (c) 2016-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static int
+arch_set_error(struct tcb *tcp)
+{
+ csky_regs.a0 = -tcp->u_error;
+ return set_regs(tcp->pid);
+}
+
+static int
+arch_set_success(struct tcb *tcp)
+{
+ csky_regs.a0 = tcp->u_rval;
+ return set_regs(tcp->pid);
+}
diff --git a/src/linux/csky/set_scno.c b/src/linux/csky/set_scno.c
new file mode 100644
index 000000000..88870e524
--- /dev/null
+++ b/src/linux/csky/set_scno.c
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2016-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static int
+arch_set_scno(struct tcb *tcp, kernel_ulong_t scno)
+{
+ if (ptrace_syscall_info_is_valid() && get_regs(tcp) < 0)
+ return -1;
+#if defined(__CSKYABIV2__)
+ csky_regs.regs[3] = scno;
+#else
+ csky_regs.a1 = scno;
+#endif
+ return set_regs(tcp->pid);
+}
diff --git a/src/linux/csky/syscallent.h b/src/linux/csky/syscallent.h
new file mode 100644
index 000000000..33e3e73fc
--- /dev/null
+++ b/src/linux/csky/syscallent.h
@@ -0,0 +1,4 @@
+#include "32/syscallent.h"
+/* [244 ... 259] are arch specific */
+[244] = {1, 0, SEN(set_thread_area), "set_thread_area"},
+[245] = {3, 0, SEN(cacheflush), "cacheflush"},
diff --git a/src/linux/dummy.h b/src/linux/dummy.h
new file mode 100644
index 000000000..61047190b
--- /dev/null
+++ b/src/linux/dummy.h
@@ -0,0 +1,141 @@
+/*
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993, 1994, 1995 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1995-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_LINUX_DUMMY_H
+# define STRACE_LINUX_DUMMY_H
+
+# ifndef HAVE_STRUCT___OLD_KERNEL_STAT
+# define sys_oldfstat printargs
+# define sys_oldstat printargs
+# endif
+
+/* still unfinished */
+# define sys_rseq printargs
+# define sys_vm86 printargs
+# define sys_vm86old printargs
+
+/* machine-specific */
+# ifndef HAVE_STRUCT_USER_DESC
+# define sys_modify_ldt printargs
+# endif
+
+# if !(defined HAVE_STRUCT_USER_DESC || defined M68K || defined MIPS)
+# define sys_set_thread_area printargs
+# endif
+
+# if !(defined HAVE_STRUCT_USER_DESC || defined M68K)
+# define sys_get_thread_area printargs
+# endif
+
+# ifdef ALPHA
+# define sys_getdtablesize printargs
+# endif
+
+/* like another call */
+# define sys_acct sys_chdir
+# define sys_chroot sys_chdir
+# define sys_clock_getres_time32 sys_clock_gettime32
+# define sys_clock_getres_time64 sys_clock_gettime64
+# define sys_connect sys_bind
+# define sys_fchdir sys_close
+# define sys_fdatasync sys_close
+# define sys_fsync sys_close
+# define sys_getegid sys_getuid
+# define sys_getegid16 sys_geteuid16
+# define sys_geteuid sys_getuid
+# define sys_geteuid16 sys_getuid16
+# define sys_getgid sys_getuid
+# define sys_getgid16 sys_getuid16
+# define sys_getpeername sys_getsockname
+# define sys_getppid sys_getpid
+# define sys_getresgid sys_getresuid
+# define sys_getresgid16 sys_getresuid16
+# define sys_lstat sys_stat
+# define sys_lstat64 sys_stat64
+# define sys_mkdir sys_chmod
+# define sys_mkdirat sys_fchmodat
+# define sys_mlock sys_munmap
+# define sys_mq_unlink sys_chdir
+# define sys_munlock sys_munmap
+# define sys_oldlstat sys_oldstat
+# define sys_pivotroot sys_link
+# define sys_rename sys_link
+# define sys_rmdir sys_chdir
+# define sys_sched_get_priority_max sys_sched_get_priority_min
+# define sys_set_robust_list sys_munmap
+# define sys_setdomainname sys_sethostname
+# define sys_setfsgid sys_setfsuid
+# define sys_setfsgid16 sys_setfsuid16
+# define sys_setgid sys_setuid
+# define sys_setgid16 sys_setuid16
+# define sys_setregid sys_setreuid
+# define sys_setregid16 sys_setreuid16
+# define sys_setresgid sys_setresuid
+# define sys_setresgid16 sys_setresuid16
+# define sys_stime sys_time
+# define sys_swapoff sys_chdir
+# define sys_symlink sys_link
+# define sys_syncfs sys_close
+# define sys_umount sys_chdir
+# define sys_unlink sys_chdir
+# define sys_uselib sys_chdir
+# define sys_vfork sys_fork
+
+/* printargs does the right thing */
+# define sys_idle printargs
+# define sys_munlockall printargs
+# define sys_pause printargs
+# define sys_printargs printargs
+# define sys_sched_yield printargs
+# define sys_setsid printargs
+# define sys_set_tid_address printargs
+# define sys_setup printargs
+# define sys_sync printargs
+# define sys_syscall printargs
+# define sys_vhangup printargs
+
+/* printargs_u does the right thing */
+# define sys_alarm printargs_u
+
+/* printargs_d does the right thing */
+# define sys_exit printargs_d
+# define sys_nice printargs_d
+# define sys_setpgrp printargs_d
+# define sys_timer_delete printargs_d
+# define sys_timer_getoverrun printargs_d
+
+/* unimplemented */
+# define sys_afs_syscall printargs
+# define sys_break printargs
+# define sys_create_module printargs
+# define sys_ftime printargs
+# define sys_get_kernel_syms printargs
+# define sys_getpmsg printargs
+# define sys_gtty printargs
+# define sys_lock printargs
+# define sys_mpx printargs
+# define sys_nfsservctl printargs
+# define sys_prof printargs
+# define sys_profil printargs
+# define sys_putpmsg printargs
+# define sys_query_module printargs
+# define sys_security printargs
+# define sys_stty printargs
+# define sys_timerfd printargs
+# define sys_tuxcall printargs
+# define sys_ulimit printargs
+# define sys_vserver printargs
+
+/* deprecated */
+# define sys_bdflush printargs
+# define sys_oldolduname printargs
+# define sys_olduname printargs
+# define sys_sysfs printargs
+
+#endif /* !STRACE_LINUX_DUMMY_H */
diff --git a/src/linux/errnoent.h b/src/linux/errnoent.h
new file mode 100644
index 000000000..1b1dbbed9
--- /dev/null
+++ b/src/linux/errnoent.h
@@ -0,0 +1,155 @@
+/*
+ * Copyright (c) 1999-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+[ 1] = "EPERM",
+[ 2] = "ENOENT",
+[ 3] = "ESRCH",
+[ 4] = "EINTR",
+[ 5] = "EIO",
+[ 6] = "ENXIO",
+[ 7] = "E2BIG",
+[ 8] = "ENOEXEC",
+[ 9] = "EBADF",
+[ 10] = "ECHILD",
+[ 11] = "EAGAIN",
+[ 12] = "ENOMEM",
+[ 13] = "EACCES",
+[ 14] = "EFAULT",
+[ 15] = "ENOTBLK",
+[ 16] = "EBUSY",
+[ 17] = "EEXIST",
+[ 18] = "EXDEV",
+[ 19] = "ENODEV",
+[ 20] = "ENOTDIR",
+[ 21] = "EISDIR",
+[ 22] = "EINVAL",
+[ 23] = "ENFILE",
+[ 24] = "EMFILE",
+[ 25] = "ENOTTY",
+[ 26] = "ETXTBSY",
+[ 27] = "EFBIG",
+[ 28] = "ENOSPC",
+[ 29] = "ESPIPE",
+[ 30] = "EROFS",
+[ 31] = "EMLINK",
+[ 32] = "EPIPE",
+[ 33] = "EDOM",
+[ 34] = "ERANGE",
+[ 35] = "EDEADLK",
+[ 36] = "ENAMETOOLONG",
+[ 37] = "ENOLCK",
+[ 38] = "ENOSYS",
+[ 39] = "ENOTEMPTY",
+[ 40] = "ELOOP",
+[ 42] = "ENOMSG",
+[ 43] = "EIDRM",
+[ 44] = "ECHRNG",
+[ 45] = "EL2NSYNC",
+[ 46] = "EL3HLT",
+[ 47] = "EL3RST",
+[ 48] = "ELNRNG",
+[ 49] = "EUNATCH",
+[ 50] = "ENOCSI",
+[ 51] = "EL2HLT",
+[ 52] = "EBADE",
+[ 53] = "EBADR",
+[ 54] = "EXFULL",
+[ 55] = "ENOANO",
+[ 56] = "EBADRQC",
+[ 57] = "EBADSLT",
+[ 59] = "EBFONT",
+[ 60] = "ENOSTR",
+[ 61] = "ENODATA",
+[ 62] = "ETIME",
+[ 63] = "ENOSR",
+[ 64] = "ENONET",
+[ 65] = "ENOPKG",
+[ 66] = "EREMOTE",
+[ 67] = "ENOLINK",
+[ 68] = "EADV",
+[ 69] = "ESRMNT",
+[ 70] = "ECOMM",
+[ 71] = "EPROTO",
+[ 72] = "EMULTIHOP",
+[ 73] = "EDOTDOT",
+[ 74] = "EBADMSG",
+[ 75] = "EOVERFLOW",
+[ 76] = "ENOTUNIQ",
+[ 77] = "EBADFD",
+[ 78] = "EREMCHG",
+[ 79] = "ELIBACC",
+[ 80] = "ELIBBAD",
+[ 81] = "ELIBSCN",
+[ 82] = "ELIBMAX",
+[ 83] = "ELIBEXEC",
+[ 84] = "EILSEQ",
+[ 85] = "ERESTART",
+[ 86] = "ESTRPIPE",
+[ 87] = "EUSERS",
+[ 88] = "ENOTSOCK",
+[ 89] = "EDESTADDRREQ",
+[ 90] = "EMSGSIZE",
+[ 91] = "EPROTOTYPE",
+[ 92] = "ENOPROTOOPT",
+[ 93] = "EPROTONOSUPPORT",
+[ 94] = "ESOCKTNOSUPPORT",
+[ 95] = "EOPNOTSUPP",
+[ 96] = "EPFNOSUPPORT",
+[ 97] = "EAFNOSUPPORT",
+[ 98] = "EADDRINUSE",
+[ 99] = "EADDRNOTAVAIL",
+[100] = "ENETDOWN",
+[101] = "ENETUNREACH",
+[102] = "ENETRESET",
+[103] = "ECONNABORTED",
+[104] = "ECONNRESET",
+[105] = "ENOBUFS",
+[106] = "EISCONN",
+[107] = "ENOTCONN",
+[108] = "ESHUTDOWN",
+[109] = "ETOOMANYREFS",
+[110] = "ETIMEDOUT",
+[111] = "ECONNREFUSED",
+[112] = "EHOSTDOWN",
+[113] = "EHOSTUNREACH",
+[114] = "EALREADY",
+[115] = "EINPROGRESS",
+[116] = "ESTALE",
+[117] = "EUCLEAN",
+[118] = "ENOTNAM",
+[119] = "ENAVAIL",
+[120] = "EISNAM",
+[121] = "EREMOTEIO",
+[122] = "EDQUOT",
+[123] = "ENOMEDIUM",
+[124] = "EMEDIUMTYPE",
+[125] = "ECANCELED",
+[126] = "ENOKEY",
+[127] = "EKEYEXPIRED",
+[128] = "EKEYREVOKED",
+[129] = "EKEYREJECTED",
+[130] = "EOWNERDEAD",
+[131] = "ENOTRECOVERABLE",
+[132] = "ERFKILL",
+[133] = "EHWPOISON",
+[512] = "ERESTARTSYS",
+[513] = "ERESTARTNOINTR",
+[514] = "ERESTARTNOHAND",
+[515] = "ENOIOCTLCMD",
+[516] = "ERESTART_RESTARTBLOCK",
+[517] = "EPROBE_DEFER",
+[518] = "EOPENSTALE",
+[521] = "EBADHANDLE",
+[522] = "ENOTSYNC",
+[523] = "EBADCOOKIE",
+[524] = "ENOTSUPP",
+[525] = "ETOOSMALL",
+[526] = "ESERVERFAULT",
+[527] = "EBADTYPE",
+[528] = "EJUKEBOX",
+[529] = "EIOCBQUEUED",
+[530] = "ERECALLCONFLICT",
diff --git a/src/linux/getregs_old.h b/src/linux/getregs_old.h
new file mode 100644
index 000000000..5c73c9f93
--- /dev/null
+++ b/src/linux/getregs_old.h
@@ -0,0 +1,8 @@
+/*
+ * Copyright (c) 2016-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#undef HAVE_GETREGS_OLD
diff --git a/src/linux/hppa/arch_defs_.h b/src/linux/hppa/arch_defs_.h
new file mode 100644
index 000000000..1bc3590b9
--- /dev/null
+++ b/src/linux/hppa/arch_defs_.h
@@ -0,0 +1,16 @@
+/*
+ * Copyright (c) 2018-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#define HAVE_ARCH_SA_RESTORER 0
+/*
+ * Linux kernel commit v4.6-rc2~20^2 introduced a regression:
+ * when tracer changes syscall number to -1, the kernel fails
+ * to initialize %r28 with -ENOSYS and subsequently fails
+ * to return the error code of the failed syscall to userspace.
+ * Workaround this by initializing %r28 ourselves.
+ */
+#define ARCH_NEEDS_SET_ERROR_FOR_SCNO_TAMPERING 1
diff --git a/src/linux/hppa/arch_regs.c b/src/linux/hppa/arch_regs.c
new file mode 100644
index 000000000..ec09f9c78
--- /dev/null
+++ b/src/linux/hppa/arch_regs.c
@@ -0,0 +1,11 @@
+/*
+ * Copyright (c) 2015-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static struct user_regs_struct hppa_regs;
+#define ARCH_REGS_FOR_GETREGS hppa_regs
+#define ARCH_PC_REG hppa_regs.iaoq[0]
+#define ARCH_SP_REG hppa_regs.gr[30]
diff --git a/src/linux/hppa/arch_rt_sigframe.c b/src/linux/hppa/arch_rt_sigframe.c
new file mode 100644
index 000000000..ecaaef608
--- /dev/null
+++ b/src/linux/hppa/arch_rt_sigframe.c
@@ -0,0 +1,21 @@
+/*
+ * Copyright (c) 2017-2018 Dmitry V. Levin <ldv@strace.io>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "rt_sigframe.h"
+
+#define SIGFRAME (sizeof(long) * 16)
+#define FUNCTIONCALLFRAME (sizeof(long) * 12)
+#define RT_SIGFRAME_SIZE \
+ (((sizeof(struct_rt_sigframe) + FUNCTIONCALLFRAME)) & -SIGFRAME)
+
+FUNC_GET_RT_SIGFRAME_ADDR
+{
+ unsigned long addr;
+
+ return get_stack_pointer(tcp, &addr)
+ ? (addr & ~1UL) - RT_SIGFRAME_SIZE : 0;
+}
diff --git a/src/linux/hppa/errnoent.h b/src/linux/hppa/errnoent.h
new file mode 100644
index 000000000..3c8b06fd6
--- /dev/null
+++ b/src/linux/hppa/errnoent.h
@@ -0,0 +1,159 @@
+/*
+ * Copyright (c) 2001-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+[ 1] = "EPERM",
+[ 2] = "ENOENT",
+[ 3] = "ESRCH",
+[ 4] = "EINTR",
+[ 5] = "EIO",
+[ 6] = "ENXIO",
+[ 7] = "E2BIG",
+[ 8] = "ENOEXEC",
+[ 9] = "EBADF",
+[ 10] = "ECHILD",
+[ 11] = "EAGAIN",
+[ 12] = "ENOMEM",
+[ 13] = "EACCES",
+[ 14] = "EFAULT",
+[ 15] = "ENOTBLK",
+[ 16] = "EBUSY",
+[ 17] = "EEXIST",
+[ 18] = "EXDEV",
+[ 19] = "ENODEV",
+[ 20] = "ENOTDIR",
+[ 21] = "EISDIR",
+[ 22] = "EINVAL",
+[ 23] = "ENFILE",
+[ 24] = "EMFILE",
+[ 25] = "ENOTTY",
+[ 26] = "ETXTBSY",
+[ 27] = "EFBIG",
+[ 28] = "ENOSPC",
+[ 29] = "ESPIPE",
+[ 30] = "EROFS",
+[ 31] = "EMLINK",
+[ 32] = "EPIPE",
+[ 33] = "EDOM",
+[ 34] = "ERANGE",
+[ 35] = "ENOMSG",
+[ 36] = "EIDRM",
+[ 37] = "ECHRNG",
+[ 38] = "EL2NSYNC",
+[ 39] = "EL3HLT",
+[ 40] = "EL3RST",
+[ 41] = "ELNRNG",
+[ 42] = "EUNATCH",
+[ 43] = "ENOCSI",
+[ 44] = "EL2HLT",
+[ 45] = "EDEADLK",
+[ 46] = "ENOLCK",
+[ 47] = "EILSEQ",
+[ 50] = "ENONET",
+[ 51] = "ENODATA",
+[ 52] = "ETIME",
+[ 53] = "ENOSR",
+[ 54] = "ENOSTR",
+[ 55] = "ENOPKG",
+[ 57] = "ENOLINK",
+[ 58] = "EADV",
+[ 59] = "ESRMNT",
+[ 60] = "ECOMM",
+[ 61] = "EPROTO",
+[ 64] = "EMULTIHOP",
+[ 66] = "EDOTDOT",
+[ 67] = "EBADMSG",
+[ 68] = "EUSERS",
+[ 69] = "EDQUOT",
+[ 70] = "ESTALE",
+[ 71] = "EREMOTE",
+[ 72] = "EOVERFLOW",
+[160] = "EBADE",
+[161] = "EBADR",
+[162] = "EXFULL",
+[163] = "ENOANO",
+[164] = "EBADRQC",
+[165] = "EBADSLT",
+[166] = "EBFONT",
+[167] = "ENOTUNIQ",
+[168] = "EBADFD",
+[169] = "EREMCHG",
+[170] = "ELIBACC",
+[171] = "ELIBBAD",
+[172] = "ELIBSCN",
+[173] = "ELIBMAX",
+[174] = "ELIBEXEC",
+[175] = "ERESTART",
+[176] = "ESTRPIPE",
+[177] = "EUCLEAN",
+[178] = "ENOTNAM",
+[179] = "ENAVAIL",
+[180] = "EISNAM",
+[181] = "EREMOTEIO",
+[182] = "ENOMEDIUM",
+[183] = "EMEDIUMTYPE",
+[184] = "ENOKEY",
+[185] = "EKEYEXPIRED",
+[186] = "EKEYREVOKED",
+[187] = "EKEYREJECTED",
+[215] = "ENOSYM",
+[216] = "ENOTSOCK",
+[217] = "EDESTADDRREQ",
+[218] = "EMSGSIZE",
+[219] = "EPROTOTYPE",
+[220] = "ENOPROTOOPT",
+[221] = "EPROTONOSUPPORT",
+[222] = "ESOCKTNOSUPPORT",
+[223] = "EOPNOTSUPP",
+[224] = "EPFNOSUPPORT",
+[225] = "EAFNOSUPPORT",
+[226] = "EADDRINUSE",
+[227] = "EADDRNOTAVAIL",
+[228] = "ENETDOWN",
+[229] = "ENETUNREACH",
+[230] = "ENETRESET",
+[231] = "ECONNABORTED",
+[232] = "ECONNRESET",
+[233] = "ENOBUFS",
+[234] = "EISCONN",
+[235] = "ENOTCONN",
+[236] = "ESHUTDOWN",
+[237] = "ETOOMANYREFS",
+[238] = "ETIMEDOUT",
+[239] = "ECONNREFUSED",
+[240] = "EREMOTERELEASE",
+[241] = "EHOSTDOWN",
+[242] = "EHOSTUNREACH",
+[244] = "EALREADY",
+[245] = "EINPROGRESS",
+[246] = "EWOULDBLOCK",
+[247] = "ENOTEMPTY",
+[248] = "ENAMETOOLONG",
+[249] = "ELOOP",
+[251] = "ENOSYS",
+[252] = "ENOTSUP",
+[253] = "ECANCELED",
+[254] = "EOWNERDEAD",
+[255] = "ENOTRECOVERABLE",
+[256] = "ERFKILL",
+[257] = "EHWPOISON",
+[512] = "ERESTARTSYS",
+[513] = "ERESTARTNOINTR",
+[514] = "ERESTARTNOHAND",
+[515] = "ENOIOCTLCMD",
+[516] = "ERESTART_RESTARTBLOCK",
+[517] = "EPROBE_DEFER",
+[518] = "EOPENSTALE",
+[521] = "EBADHANDLE",
+[522] = "ENOTSYNC",
+[523] = "EBADCOOKIE",
+[524] = "ENOTSUPP",
+[525] = "ETOOSMALL",
+[526] = "ESERVERFAULT",
+[527] = "EBADTYPE",
+[528] = "EJUKEBOX",
+[529] = "EIOCBQUEUED",
+[530] = "ERECALLCONFLICT",
diff --git a/src/linux/hppa/get_error.c b/src/linux/hppa/get_error.c
new file mode 100644
index 000000000..a3721797f
--- /dev/null
+++ b/src/linux/hppa/get_error.c
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2015-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "negated_errno.h"
+
+static void
+arch_get_error(struct tcb *tcp, const bool check_errno)
+{
+ if (check_errno && is_negated_errno(hppa_regs.gr[28])) {
+ tcp->u_rval = -1;
+ tcp->u_error = -hppa_regs.gr[28];
+ } else {
+ tcp->u_rval = hppa_regs.gr[28];
+ }
+}
diff --git a/src/linux/hppa/get_scno.c b/src/linux/hppa/get_scno.c
new file mode 100644
index 000000000..d20c8011a
--- /dev/null
+++ b/src/linux/hppa/get_scno.c
@@ -0,0 +1,14 @@
+/*
+ * Copyright (c) 2015-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+/* Return codes: 1 - ok, 0 - ignore, other - error. */
+static int
+arch_get_scno(struct tcb *tcp)
+{
+ tcp->scno = hppa_regs.gr[20];
+ return 1;
+}
diff --git a/src/linux/hppa/get_syscall_args.c b/src/linux/hppa/get_syscall_args.c
new file mode 100644
index 000000000..7ed762fd4
--- /dev/null
+++ b/src/linux/hppa/get_syscall_args.c
@@ -0,0 +1,15 @@
+/*
+ * Copyright (c) 2015-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+/* Return -1 on error or 1 on success (never 0!). */
+static int
+arch_get_syscall_args(struct tcb *tcp)
+{
+ for (unsigned int i = 0; i < n_args(tcp); ++i)
+ tcp->u_arg[i] = hppa_regs.gr[26 - i];
+ return 1;
+}
diff --git a/src/linux/hppa/ioctls_arch0.h b/src/linux/hppa/ioctls_arch0.h
new file mode 100644
index 000000000..b13386bb3
--- /dev/null
+++ b/src/linux/hppa/ioctls_arch0.h
@@ -0,0 +1,94 @@
+/* Generated by ioctls_gen.sh from definitions found in $linux/arch/parisc/include/ tree. */
+{ "asm/grfioctl.h", "GCAOFF", _IOC_NONE, 0x4704, 0x00 },
+{ "asm/grfioctl.h", "GCAON", _IOC_NONE, 0x4703, 0x00 },
+{ "asm/grfioctl.h", "GCDESCRIBE", _IOC_READ, 0x4715, 0x70 },
+{ "asm/grfioctl.h", "GCFASTLOCK", _IOC_NONE, 0x471a, 0x00 },
+{ "asm/grfioctl.h", "GCID", _IOC_READ, 0x4700, 0x04 },
+{ "asm/grfioctl.h", "GCLOCK", _IOC_NONE, 0x4707, 0x00 },
+{ "asm/grfioctl.h", "GCLOCK_MINIMUM", _IOC_NONE, 0x4709, 0x00 },
+{ "asm/grfioctl.h", "GCMAP", _IOC_READ|_IOC_WRITE, 0x4705, 0x04 },
+{ "asm/grfioctl.h", "GCMAP_HPUX", _IOC_NONE, 0x4705, 0x00 },
+{ "asm/grfioctl.h", "GCOFF", _IOC_NONE, 0x4702, 0x00 },
+{ "asm/grfioctl.h", "GCON", _IOC_NONE, 0x4701, 0x00 },
+{ "asm/grfioctl.h", "GCSTATIC_CMAP", _IOC_NONE, 0x470b, 0x00 },
+{ "asm/grfioctl.h", "GCTERM", _IOC_READ|_IOC_WRITE, 0x4714, 0x04 },
+{ "asm/grfioctl.h", "GCUNLOCK", _IOC_NONE, 0x4708, 0x00 },
+{ "asm/grfioctl.h", "GCUNLOCK_MINIMUM", _IOC_NONE, 0x470a, 0x00 },
+{ "asm/grfioctl.h", "GCUNMAP", _IOC_READ|_IOC_WRITE, 0x4706, 0x04 },
+{ "asm/grfioctl.h", "GCUNMAP_HPUX", _IOC_NONE, 0x4706, 0x00 },
+{ "asm/grfioctl.h", "GCVARIABLE_CMAP", _IOC_NONE, 0x470c, 0x00 },
+{ "asm/ioctls.h", "FIOASYNC", 0, 0x5452, 0 },
+{ "asm/ioctls.h", "FIOCLEX", 0, 0x5451, 0 },
+{ "asm/ioctls.h", "FIONBIO", 0, 0x5421, 0 },
+{ "asm/ioctls.h", "FIONCLEX", 0, 0x5450, 0 },
+{ "asm/ioctls.h", "FIONREAD", 0, 0x541B, 0 },
+{ "asm/ioctls.h", "FIOQSIZE", 0, 0x5460, 0 },
+{ "asm/ioctls.h", "TCFLSH", _IOC_NONE, 0x5407, 0x00 },
+{ "asm/ioctls.h", "TCGETA", _IOC_READ, 0x5401, 0x12 },
+{ "asm/ioctls.h", "TCGETS", _IOC_READ, 0x5410, 0x24 },
+{ "asm/ioctls.h", "TCGETS2", _IOC_READ, 0x542a, 0x2c },
+{ "asm/ioctls.h", "TCSBRK", _IOC_NONE, 0x5405, 0x00 },
+{ "asm/ioctls.h", "TCSBRKP", 0, 0x5425, 0 },
+{ "asm/ioctls.h", "TCSETA", _IOC_WRITE, 0x5402, 0x12 },
+{ "asm/ioctls.h", "TCSETAF", _IOC_WRITE, 0x5404, 0x12 },
+{ "asm/ioctls.h", "TCSETAW", _IOC_WRITE, 0x5403, 0x12 },
+{ "asm/ioctls.h", "TCSETS", _IOC_WRITE, 0x5411, 0x24 },
+{ "asm/ioctls.h", "TCSETS2", _IOC_WRITE, 0x542b, 0x2c },
+{ "asm/ioctls.h", "TCSETSF", _IOC_WRITE, 0x5413, 0x24 },
+{ "asm/ioctls.h", "TCSETSF2", _IOC_WRITE, 0x542d, 0x2c },
+{ "asm/ioctls.h", "TCSETSW", _IOC_WRITE, 0x5412, 0x24 },
+{ "asm/ioctls.h", "TCSETSW2", _IOC_WRITE, 0x542c, 0x2c },
+{ "asm/ioctls.h", "TCXONC", _IOC_NONE, 0x5406, 0x00 },
+{ "asm/ioctls.h", "TIOCCBRK", 0, 0x5428, 0 },
+{ "asm/ioctls.h", "TIOCCONS", 0, 0x541D, 0 },
+{ "asm/ioctls.h", "TIOCEXCL", 0, 0x540C, 0 },
+{ "asm/ioctls.h", "TIOCGDEV", _IOC_READ, 0x5432, 0x04 },
+{ "asm/ioctls.h", "TIOCGETD", 0, 0x5424, 0 },
+{ "asm/ioctls.h", "TIOCGEXCL", _IOC_READ, 0x5440, 0x04 },
+{ "asm/ioctls.h", "TIOCGICOUNT", 0, 0x545D, 0 },
+{ "asm/ioctls.h", "TIOCGLCKTRMIOS", 0, 0x5456, 0 },
+{ "asm/ioctls.h", "TIOCGPGRP", _IOC_READ, 0x541e, 0x04 },
+{ "asm/ioctls.h", "TIOCGPKT", _IOC_READ, 0x5438, 0x04 },
+{ "asm/ioctls.h", "TIOCGPTLCK", _IOC_READ, 0x5439, 0x04 },
+{ "asm/ioctls.h", "TIOCGPTN", _IOC_READ, 0x5430, 0x04 },
+{ "asm/ioctls.h", "TIOCGRS485", _IOC_READ, 0x542e, 0x20 },
+{ "asm/ioctls.h", "TIOCGSERIAL", 0, 0x541E, 0 },
+{ "asm/ioctls.h", "TIOCGSID", _IOC_READ, 0x5414, 0x04 },
+{ "asm/ioctls.h", "TIOCGSOFTCAR", 0, 0x5419, 0 },
+{ "asm/ioctls.h", "TIOCGWINSZ", 0, 0x5413, 0 },
+{ "asm/ioctls.h", "TIOCLINUX", 0, 0x541C, 0 },
+{ "asm/ioctls.h", "TIOCMBIC", 0, 0x5417, 0 },
+{ "asm/ioctls.h", "TIOCMBIS", 0, 0x5416, 0 },
+{ "asm/ioctls.h", "TIOCMGET", 0, 0x5415, 0 },
+{ "asm/ioctls.h", "TIOCMIWAIT", 0, 0x545C, 0 },
+{ "asm/ioctls.h", "TIOCMSET", 0, 0x5418, 0 },
+{ "asm/ioctls.h", "TIOCNOTTY", 0, 0x5422, 0 },
+{ "asm/ioctls.h", "TIOCNXCL", 0, 0x540D, 0 },
+{ "asm/ioctls.h", "TIOCOUTQ", 0, 0x5411, 0 },
+{ "asm/ioctls.h", "TIOCPKT", 0, 0x5420, 0 },
+{ "asm/ioctls.h", "TIOCSBRK", 0, 0x5427, 0 },
+{ "asm/ioctls.h", "TIOCSCTTY", 0, 0x540E, 0 },
+{ "asm/ioctls.h", "TIOCSERCONFIG", 0, 0x5453, 0 },
+{ "asm/ioctls.h", "TIOCSERGETLSR", 0, 0x5459, 0 },
+{ "asm/ioctls.h", "TIOCSERGETMULTI", 0, 0x545A, 0 },
+{ "asm/ioctls.h", "TIOCSERGSTRUCT", 0, 0x5458, 0 },
+{ "asm/ioctls.h", "TIOCSERGWILD", 0, 0x5454, 0 },
+{ "asm/ioctls.h", "TIOCSERSETMULTI", 0, 0x545B, 0 },
+{ "asm/ioctls.h", "TIOCSERSWILD", 0, 0x5455, 0 },
+{ "asm/ioctls.h", "TIOCSETD", 0, 0x5423, 0 },
+{ "asm/ioctls.h", "TIOCSIG", _IOC_WRITE, 0x5436, 0x04 },
+{ "asm/ioctls.h", "TIOCSLCKTRMIOS", 0, 0x5457, 0 },
+{ "asm/ioctls.h", "TIOCSLTC", 0, 0x5462, 0 },
+{ "asm/ioctls.h", "TIOCSPGRP", _IOC_WRITE, 0x541d, 0x04 },
+{ "asm/ioctls.h", "TIOCSPTLCK", _IOC_WRITE, 0x5431, 0x04 },
+{ "asm/ioctls.h", "TIOCSRS485", _IOC_READ|_IOC_WRITE, 0x542f, 0x20 },
+{ "asm/ioctls.h", "TIOCSSERIAL", 0, 0x541F, 0 },
+{ "asm/ioctls.h", "TIOCSSOFTCAR", 0, 0x541A, 0 },
+{ "asm/ioctls.h", "TIOCSTART", 0, 0x5461, 0 },
+{ "asm/ioctls.h", "TIOCSTI", 0, 0x5412, 0 },
+{ "asm/ioctls.h", "TIOCSTOP", 0, 0x5462, 0 },
+{ "asm/ioctls.h", "TIOCSWINSZ", 0, 0x5414, 0 },
+{ "asm/ioctls.h", "TIOCVHANGUP", 0, 0x5437, 0 },
+{ "asm/perf.h", "PA_PERF_OFF", _IOC_READ, 0x7002, 0x04 },
+{ "asm/perf.h", "PA_PERF_ON", _IOC_NONE, 0x7001, 0x00 },
+{ "asm/perf.h", "PA_PERF_VERSION", _IOC_READ, 0x7003, 0x04 },
diff --git a/src/linux/hppa/ioctls_inc0.h b/src/linux/hppa/ioctls_inc0.h
new file mode 100644
index 000000000..4aecf983e
--- /dev/null
+++ b/src/linux/hppa/ioctls_inc0.h
@@ -0,0 +1 @@
+#include "32/ioctls_inc.h"
diff --git a/src/linux/hppa/raw_syscall.h b/src/linux/hppa/raw_syscall.h
new file mode 100644
index 000000000..82a4de944
--- /dev/null
+++ b/src/linux/hppa/raw_syscall.h
@@ -0,0 +1,32 @@
+/*
+ * Raw syscalls.
+ *
+ * Copyright (c) 2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_RAW_SYSCALL_H
+# define STRACE_RAW_SYSCALL_H
+
+# include "kernel_types.h"
+
+static inline kernel_ulong_t
+raw_syscall_0(const kernel_ulong_t nr, kernel_ulong_t *err)
+{
+ *err = 0;
+ register kernel_ulong_t r28 __asm__("r28");
+ __asm__ __volatile__("copy %%r19, %%r4\n\t"
+ "ble 0x100(%%sr2, %%r0)\n\t"
+ "copy %1, %%r20\n\t"
+ "copy %%r4, %%r19\n\t"
+ : "=r"(r28)
+ : "r"(nr)
+ : "memory", "%r1", "%r2", "%r4",
+ "%r21", "%r22", "%r23", "%r24", "%r25", "%r26" );
+ return r28;
+}
+# define raw_syscall_0 raw_syscall_0
+
+#endif /* !STRACE_RAW_SYSCALL_H */
diff --git a/src/linux/hppa/rt_sigframe.h b/src/linux/hppa/rt_sigframe.h
new file mode 100644
index 000000000..acc0381c0
--- /dev/null
+++ b/src/linux/hppa/rt_sigframe.h
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2017-2018 Dmitry V. Levin <ldv@strace.io>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_RT_SIGFRAME_H
+# define STRACE_RT_SIGFRAME_H
+
+# include <signal.h>
+
+typedef struct {
+ unsigned int tramp[9];
+ siginfo_t info;
+ ucontext_t uc;
+} struct_rt_sigframe;
+
+#endif /* !STRACE_RT_SIGFRAME_H */
diff --git a/src/linux/hppa/set_error.c b/src/linux/hppa/set_error.c
new file mode 100644
index 000000000..a61c576d1
--- /dev/null
+++ b/src/linux/hppa/set_error.c
@@ -0,0 +1,20 @@
+/*
+ * Copyright (c) 2016-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static int
+arch_set_error(struct tcb *tcp)
+{
+ hppa_regs.gr[28] = -tcp->u_error;
+ return set_regs(tcp->pid);
+}
+
+static int
+arch_set_success(struct tcb *tcp)
+{
+ hppa_regs.gr[28] = tcp->u_rval;
+ return set_regs(tcp->pid);
+}
diff --git a/src/linux/hppa/set_scno.c b/src/linux/hppa/set_scno.c
new file mode 100644
index 000000000..8553352cb
--- /dev/null
+++ b/src/linux/hppa/set_scno.c
@@ -0,0 +1,15 @@
+/*
+ * Copyright (c) 2016-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static int
+arch_set_scno(struct tcb *tcp, kernel_ulong_t scno)
+{
+ if (ptrace_syscall_info_is_valid() && get_regs(tcp) < 0)
+ return -1;
+ hppa_regs.gr[20] = scno;
+ return set_regs(tcp->pid);
+}
diff --git a/src/linux/hppa/signalent.h b/src/linux/hppa/signalent.h
new file mode 100644
index 000000000..7f38ee499
--- /dev/null
+++ b/src/linux/hppa/signalent.h
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2001-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+ "0", /* 0 */
+ "SIGHUP", /* 1 */
+ "SIGINT", /* 2 */
+ "SIGQUIT", /* 3 */
+ "SIGILL", /* 4 */
+ "SIGTRAP", /* 5 */
+ "SIGABRT", /* 6 */
+ "SIGSTKFLT", /* 7 */
+ "SIGFPE", /* 8 */
+ "SIGKILL", /* 9 */
+ "SIGBUS", /* 10 */
+ "SIGSEGV", /* 11 */
+ "SIGXCPU", /* 12 */
+ "SIGPIPE", /* 13 */
+ "SIGALRM", /* 14 */
+ "SIGTERM", /* 15 */
+ "SIGUSR1", /* 16 */
+ "SIGUSR2", /* 17 */
+ "SIGCHLD", /* 18 */
+ "SIGPWR", /* 19 */
+ "SIGVTALRM", /* 20 */
+ "SIGPROF", /* 21 */
+ "SIGIO", /* 22 */
+ "SIGWINCH", /* 23 */
+ "SIGSTOP", /* 24 */
+ "SIGTSTP", /* 25 */
+ "SIGCONT", /* 26 */
+ "SIGTTIN", /* 27 */
+ "SIGTTOU", /* 28 */
+ "SIGURG", /* 29 */
+ "SIGXFSZ", /* 30 */
+ "SIGSYS", /* 31 */
+ "SIGRTMIN", /* 32 */
diff --git a/src/linux/hppa/syscallent.h b/src/linux/hppa/syscallent.h
new file mode 100644
index 000000000..0c5887f2c
--- /dev/null
+++ b/src/linux/hppa/syscallent.h
@@ -0,0 +1,364 @@
+/*
+ * Copyright (c) 2001 Hewlett-Packard, Matthew Wilcox
+ * Copyright (c) 2001-2020 The strace developers.
+ */
+
+[ 0] = { 0, 0, SEN(restart_syscall), "restart_syscall" },
+[ 1] = { 1, TP|SE, SEN(exit), "exit" },
+[ 2] = { 0, TP, SEN(fork), "fork" },
+[ 3] = { 3, TD, SEN(read), "read" },
+[ 4] = { 3, TD, SEN(write), "write" },
+[ 5] = { 3, TD|TF, SEN(open), "open" },
+[ 6] = { 1, TD, SEN(close), "close" },
+[ 7] = { 3, TP, SEN(waitpid), "waitpid" },
+[ 8] = { 2, TD|TF, SEN(creat), "creat" },
+[ 9] = { 2, TF, SEN(link), "link" },
+[ 10] = { 1, TF, SEN(unlink), "unlink" },
+[ 11] = { 3, TF|TP|TSD|SE|SI, SEN(execve), "execve" },
+[ 12] = { 1, TF, SEN(chdir), "chdir" },
+[ 13] = { 1, TCL, SEN(time), "time" },
+[ 14] = { 3, TF, SEN(mknod), "mknod" },
+[ 15] = { 2, TF, SEN(chmod), "chmod" },
+[ 16] = { 3, TF, SEN(chown), "lchown" },
+[ 17] = { 3, TN, SEN(socket), "socket" },
+[ 18] = { 2, TF|TST|TSTA, SEN(stat), "stat" },
+[ 19] = { 3, TD, SEN(lseek), "lseek" },
+[ 20] = { 0, PU|NF, SEN(getpid), "getpid" },
+[ 21] = { 5, TF, SEN(mount), "mount" },
+[ 22] = { 3, TN, SEN(bind), "bind" },
+[ 23] = { 1, TC, SEN(setuid), "setuid" },
+[ 24] = { 0, TC|PU|NF, SEN(getuid), "getuid" },
+[ 25] = { 1, 0, SEN(stime), "stime" },
+[ 26] = { 4, 0, SEN(ptrace), "ptrace" },
+[ 27] = { 1, 0, SEN(alarm), "alarm" },
+[ 28] = { 2, TD|TFST|TSTA, SEN(fstat), "fstat" },
+[ 29] = { 0, TS, SEN(pause), "pause" },
+[ 30] = { 2, TF, SEN(utime), "utime" },
+[ 31] = { 3, TN, SEN(connect), "connect" },
+[ 32] = { 2, TN, SEN(listen), "listen" },
+[ 33] = { 2, TF, SEN(access), "access" },
+[ 34] = { 1, 0, SEN(nice), "nice" },
+[ 35] = { 3, TN, SEN(accept), "accept" },
+[ 36] = { 0, 0, SEN(sync), "sync" },
+[ 37] = { 2, TS|TP, SEN(kill), "kill" },
+[ 38] = { 2, TF, SEN(rename), "rename" },
+[ 39] = { 2, TF, SEN(mkdir), "mkdir" },
+[ 40] = { 1, TF, SEN(rmdir), "rmdir" },
+[ 41] = { 1, TD, SEN(dup), "dup" },
+[ 42] = { 1, TD, SEN(pipe), "pipe" },
+[ 43] = { 1, 0, SEN(times), "times" },
+[ 44] = { 3, TN, SEN(getsockname), "getsockname" },
+[ 45] = { 1, TM|SI, SEN(brk), "brk" },
+[ 46] = { 1, TC, SEN(setgid), "setgid" },
+[ 47] = { 0, TC|PU|NF, SEN(getgid), "getgid" },
+[ 48] = { 2, TS, SEN(signal), "signal" },
+[ 49] = { 0, TC|PU|NF, SEN(geteuid), "geteuid" },
+[ 50] = { 0, TC|PU|NF, SEN(getegid), "getegid" },
+[ 51] = { 1, TF, SEN(acct), "acct" },
+[ 52] = { 2, TF, SEN(umount2), "umount2" },
+[ 53] = { 3, TN, SEN(getpeername), "getpeername" },
+[ 54] = { 3, TD, SEN(ioctl), "ioctl" },
+[ 55] = { 3, TD, SEN(fcntl), "fcntl" },
+[ 56] = { 4, TN, SEN(socketpair), "socketpair" },
+[ 57] = { 2, 0, SEN(setpgid), "setpgid" },
+[ 58] = { 4, TN, SEN(send), "send" },
+[ 59] = { 1, 0, SEN(uname), "uname" },
+[ 60] = { 1, NF, SEN(umask), "umask" },
+[ 61] = { 1, TF, SEN(chroot), "chroot" },
+[ 62] = { 2, TSFA, SEN(ustat), "ustat" },
+[ 63] = { 2, TD, SEN(dup2), "dup2" },
+[ 64] = { 0, PU|NF, SEN(getppid), "getppid" },
+[ 65] = { 0, PU|NF, SEN(getpgrp), "getpgrp" },
+[ 66] = { 0, 0, SEN(setsid), "setsid" },
+[ 67] = { 2, TF, SEN(pivotroot), "pivot_root" },
+[ 68] = { 0, TS, SEN(sgetmask), "sgetmask" },
+[ 69] = { 1, TS, SEN(ssetmask), "ssetmask" },
+[ 70] = { 2, TC, SEN(setreuid), "setreuid" },
+[ 71] = { 2, TC, SEN(setregid), "setregid" },
+[ 72] = { 3, TM, SEN(mincore), "mincore" },
+[ 73] = { 1, TS, SEN(sigpending), "sigpending" },
+[ 74] = { 2, 0, SEN(sethostname), "sethostname" },
+[ 75] = { 2, 0, SEN(setrlimit), "setrlimit" },
+[ 76] = { 2, 0, SEN(getrlimit), "getrlimit" },
+[ 77] = { 2, 0, SEN(getrusage), "getrusage" },
+[ 78] = { 2, TCL, SEN(gettimeofday), "gettimeofday" },
+[ 79] = { 2, TCL, SEN(settimeofday), "settimeofday" },
+[ 80] = { 2, TC, SEN(getgroups), "getgroups" },
+[ 81] = { 2, TC, SEN(setgroups), "setgroups" },
+[ 82] = { 6, TN, SEN(sendto), "sendto" },
+[ 83] = { 2, TF, SEN(symlink), "symlink" },
+[ 84] = { 2, TF|TLST|TSTA, SEN(lstat), "lstat" },
+[ 85] = { 3, TF, SEN(readlink), "readlink" },
+[ 86] = { 1, TF, SEN(uselib), "uselib" },
+[ 87] = { 2, TF, SEN(swapon), "swapon" },
+[ 88] = { 4, 0, SEN(reboot), "reboot" },
+[ 89] = { 6, TD|TM|SI, SEN(mmap_4koff), "mmap2" },
+[ 90] = { 6, TD|TM|SI, SEN(mmap), "mmap" },
+[ 91] = { 2, TM|SI, SEN(munmap), "munmap" },
+[ 92] = { 2, TF, SEN(truncate), "truncate" },
+[ 93] = { 2, TD, SEN(ftruncate), "ftruncate" },
+[ 94] = { 2, TD, SEN(fchmod), "fchmod" },
+[ 95] = { 3, TD, SEN(fchown), "fchown" },
+[ 96] = { 2, 0, SEN(getpriority), "getpriority" },
+[ 97] = { 3, 0, SEN(setpriority), "setpriority" },
+[ 98] = { 4, TN, SEN(recv), "recv" },
+[ 99] = { 2, TF|TSF|TSFA, SEN(statfs), "statfs" },
+[100] = { 2, TD|TFSF|TSFA, SEN(fstatfs), "fstatfs" },
+[101] = { 2, TF|TST|TSTA, SEN(stat64), "stat64" },
+/* [102] - was socketcall */
+[103] = { 3, 0, SEN(syslog), "syslog" },
+[104] = { 3, 0, SEN(setitimer), "setitimer" },
+[105] = { 2, 0, SEN(getitimer), "getitimer" },
+[106] = { 2, TC, SEN(capget), "capget" },
+[107] = { 2, TC, SEN(capset), "capset" },
+[108] = { 5, TD, SEN(pread), "pread64" },
+[109] = { 5, TD, SEN(pwrite), "pwrite64" },
+[110] = { 2, TF, SEN(getcwd), "getcwd" },
+[111] = { 0, 0, SEN(vhangup), "vhangup" },
+[112] = { 2, TD|TFST|TSTA, SEN(fstat64), "fstat64" },
+[113] = { 0, TP, SEN(vfork), "vfork" },
+[114] = { 4, TP, SEN(wait4), "wait4" },
+[115] = { 1, TF, SEN(swapoff), "swapoff" },
+[116] = { 1, 0, SEN(sysinfo), "sysinfo" },
+[117] = { 2, TN, SEN(shutdown), "shutdown" },
+[118] = { 1, TD, SEN(fsync), "fsync" },
+[119] = { 3, TM, SEN(madvise), "madvise" },
+[120] = { 5, TP, SEN(clone), "clone" },
+[121] = { 2, 0, SEN(setdomainname), "setdomainname" },
+[122] = { 4, TD|TN, SEN(sendfile), "sendfile" },
+[123] = { 6, TN, SEN(recvfrom), "recvfrom" },
+[124] = { 1, TCL, SEN(adjtimex32), "adjtimex" },
+[125] = { 3, TM|SI, SEN(mprotect), "mprotect" },
+[126] = { 3, TS, SEN(sigprocmask), "sigprocmask" },
+[127] = { 2, 0, SEN(create_module), "create_module" },
+[128] = { 3, 0, SEN(init_module), "init_module" },
+[129] = { 2, 0, SEN(delete_module), "delete_module" },
+[130] = { 1, 0, SEN(get_kernel_syms), "get_kernel_syms" },
+[131] = { 4, TF, SEN(quotactl), "quotactl" },
+[132] = { 1, 0, SEN(getpgid), "getpgid" },
+[133] = { 1, TD, SEN(fchdir), "fchdir" },
+[134] = { 2, 0, SEN(bdflush), "bdflush" },
+[135] = { 3, 0, SEN(sysfs), "sysfs" },
+[136] = { 1, NF, SEN(personality), "personality" },
+[137] = { 5, 0, SEN(afs_syscall), "afs_syscall" },
+[138] = { 1, TC|NF, SEN(setfsuid), "setfsuid" },
+[139] = { 1, TC|NF, SEN(setfsgid), "setfsgid" },
+[140] = { 5, TD, SEN(llseek), "_llseek" },
+[141] = { 3, TD, SEN(getdents), "getdents" },
+[142] = { 5, TD, SEN(select), "_newselect" },
+[143] = { 2, TD, SEN(flock), "flock" },
+[144] = { 3, TM, SEN(msync), "msync" },
+[145] = { 3, TD, SEN(readv), "readv" },
+[146] = { 3, TD, SEN(writev), "writev" },
+[147] = { 1, 0, SEN(getsid), "getsid" },
+[148] = { 1, TD, SEN(fdatasync), "fdatasync" },
+[149] = { 1, 0, SEN(sysctl), "_sysctl" },
+[150] = { 2, TM, SEN(mlock), "mlock" },
+[151] = { 2, TM, SEN(munlock), "munlock" },
+[152] = { 1, TM, SEN(mlockall), "mlockall" },
+[153] = { 0, TM, SEN(munlockall), "munlockall" },
+[154] = { 2, 0, SEN(sched_setparam), "sched_setparam" },
+[155] = { 2, 0, SEN(sched_getparam), "sched_getparam" },
+[156] = { 3, 0, SEN(sched_setscheduler), "sched_setscheduler" },
+[157] = { 1, 0, SEN(sched_getscheduler), "sched_getscheduler" },
+[158] = { 0, 0, SEN(sched_yield), "sched_yield" },
+[159] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"},
+[160] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"},
+[161] = { 2, 0, SEN(sched_rr_get_interval_time32),"sched_rr_get_interval"},
+[162] = { 2, 0, SEN(nanosleep_time32), "nanosleep" },
+[163] = { 5, TM|SI, SEN(mremap), "mremap" },
+[164] = { 3, TC, SEN(setresuid), "setresuid" },
+[165] = { 3, TC, SEN(getresuid), "getresuid" },
+[166] = { 2, TS, SEN(sigaltstack), "sigaltstack" },
+[167] = { 5, 0, SEN(query_module), "query_module" },
+[168] = { 3, TD, SEN(poll_time32), "poll" },
+[169] = { 3, 0, SEN(nfsservctl), "nfsservctl" },
+[170] = { 3, TC, SEN(setresgid), "setresgid" },
+[171] = { 3, TC, SEN(getresgid), "getresgid" },
+[172] = { 5, TC, SEN(prctl), "prctl" },
+[173] = { 0, TS, SEN(rt_sigreturn), "rt_sigreturn" },
+[174] = { 4, TS, SEN(rt_sigaction), "rt_sigaction" },
+[175] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" },
+[176] = { 2, TS, SEN(rt_sigpending), "rt_sigpending" },
+[177] = { 4, TS, SEN(rt_sigtimedwait_time32), "rt_sigtimedwait" },
+[178] = { 3, TS|TP, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" },
+[179] = { 2, TS, SEN(rt_sigsuspend), "rt_sigsuspend" },
+[180] = { 3, TF, SEN(chown), "chown" },
+[181] = { 5, TN, SEN(setsockopt), "setsockopt" },
+[182] = { 5, TN, SEN(getsockopt), "getsockopt" },
+[183] = { 3, TN, SEN(sendmsg), "sendmsg" },
+[184] = { 3, TN, SEN(recvmsg), "recvmsg" },
+[185] = { 3, TI, SEN(semop), "semop" },
+[186] = { 3, TI, SEN(semget), "semget" },
+[187] = { 4, TI, SEN(semctl), "semctl" },
+[188] = { 4, TI, SEN(msgsnd), "msgsnd" },
+[189] = { 5, TI, SEN(msgrcv), "msgrcv" },
+[190] = { 2, TI, SEN(msgget), "msgget" },
+[191] = { 3, TI, SEN(msgctl), "msgctl" },
+[192] = { 3, TI|TM|SI, SEN(shmat), "shmat" },
+[193] = { 1, TI|TM|SI, SEN(shmdt), "shmdt" },
+[194] = { 3, TI, SEN(shmget), "shmget" },
+[195] = { 3, TI, SEN(shmctl), "shmctl" },
+[196] = { 5, TN, SEN(getpmsg), "getpmsg" },
+[197] = { 5, TN, SEN(putpmsg), "putpmsg" },
+[198] = { 2, TF|TLST|TSTA, SEN(lstat64), "lstat64" },
+[199] = { 3, TF, SEN(truncate64), "truncate64" },
+[200] = { 3, TD, SEN(ftruncate64), "ftruncate64" },
+[201] = { 3, TD, SEN(getdents64), "getdents64" },
+[202] = { 3, TD, SEN(fcntl64), "fcntl64" },
+[203] = { 5, 0, SEN(printargs), "attrctl" },
+[204] = { 5, 0, SEN(printargs), "acl_get" },
+[205] = { 5, 0, SEN(printargs), "acl_set" },
+[206] = { 0, PU|NF, SEN(gettid), "gettid" },
+[207] = { 4, TD, SEN(readahead), "readahead" },
+[208] = { 2, TS|TP, SEN(tkill), "tkill" },
+[209] = { 4, TD|TN, SEN(sendfile64), "sendfile64" },
+[210] = { 6, 0, SEN(futex_time32), "futex" },
+[211] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" },
+[212] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" },
+[213] = { 5, 0, SEN(printargs), "set_thread_area" },
+[214] = { 5, 0, SEN(printargs), "get_thread_area" },
+[215] = { 2, TM, SEN(io_setup), "io_setup" },
+[216] = { 1, TM, SEN(io_destroy), "io_destroy" },
+[217] = { 5, 0, SEN(io_getevents_time32), "io_getevents" },
+[218] = { 3, 0, SEN(io_submit), "io_submit" },
+[219] = { 3, 0, SEN(io_cancel), "io_cancel" },
+[220] = { 5, 0, SEN(printargs), "alloc_hugepages" },
+[221] = { 1, 0, SEN(printargs), "free_hugepages" },
+[222] = { 1, TP|SE, SEN(exit), "exit_group" },
+[223] = { 4, 0, SEN(lookup_dcookie), "lookup_dcookie" },
+[224] = { 1, TD, SEN(epoll_create), "epoll_create" },
+[225] = { 4, TD, SEN(epoll_ctl), "epoll_ctl" },
+[226] = { 4, TD, SEN(epoll_wait), "epoll_wait" },
+[227] = { 5, TM|SI, SEN(remap_file_pages), "remap_file_pages" },
+[228] = { 4, TI, SEN(semtimedop_time32), "semtimedop" },
+[229] = { 4, TD, SEN(mq_open), "mq_open" },
+[230] = { 1, 0, SEN(mq_unlink), "mq_unlink" },
+[231] = { 5, TD, SEN(mq_timedsend_time32), "mq_timedsend" },
+[232] = { 5, TD, SEN(mq_timedreceive_time32), "mq_timedreceive" },
+[233] = { 2, TD, SEN(mq_notify), "mq_notify" },
+[234] = { 3, TD, SEN(mq_getsetattr), "mq_getsetattr" },
+[235] = { 5, TP, SEN(waitid), "waitid" },
+[236] = { 6, TD, SEN(fadvise64_64), "fadvise64_64" },
+[237] = { 1, 0, SEN(set_tid_address), "set_tid_address" },
+[238] = { 5, TF, SEN(setxattr), "setxattr" },
+[239] = { 5, TF, SEN(setxattr), "lsetxattr" },
+[240] = { 5, TD, SEN(fsetxattr), "fsetxattr" },
+[241] = { 4, TF, SEN(getxattr), "getxattr" },
+[242] = { 4, TF, SEN(getxattr), "lgetxattr" },
+[243] = { 4, TD, SEN(fgetxattr), "fgetxattr" },
+[244] = { 3, TF, SEN(listxattr), "listxattr" },
+[245] = { 3, TF, SEN(listxattr), "llistxattr" },
+[246] = { 3, TD, SEN(flistxattr), "flistxattr" },
+[247] = { 2, TF, SEN(removexattr), "removexattr" },
+[248] = { 2, TF, SEN(removexattr), "lremovexattr" },
+[249] = { 2, TD, SEN(fremovexattr), "fremovexattr" },
+[250] = { 3, 0, SEN(timer_create), "timer_create" },
+[251] = { 4, 0, SEN(timer_settime32), "timer_settime" },
+[252] = { 2, 0, SEN(timer_gettime32), "timer_gettime" },
+[253] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" },
+[254] = { 1, 0, SEN(timer_delete), "timer_delete" },
+[255] = { 2, TCL, SEN(clock_settime32), "clock_settime" },
+[256] = { 2, TCL, SEN(clock_gettime32), "clock_gettime" },
+[257] = { 2, TCL, SEN(clock_getres_time32), "clock_getres" },
+[258] = { 4, 0, SEN(clock_nanosleep_time32), "clock_nanosleep" },
+[259] = { 3, TS|TP, SEN(tgkill), "tgkill" },
+[260] = { 6, TM, SEN(mbind), "mbind" },
+[261] = { 5, TM, SEN(get_mempolicy), "get_mempolicy" },
+[262] = { 3, TM, SEN(set_mempolicy), "set_mempolicy" },
+[263] = { 5, 0, SEN(vserver), "vserver" },
+[264] = { 5, 0, SEN(add_key), "add_key" },
+[265] = { 4, 0, SEN(request_key), "request_key" },
+[266] = { 5, 0, SEN(keyctl), "keyctl" },
+[267] = { 3, 0, SEN(ioprio_set), "ioprio_set" },
+[268] = { 2, 0, SEN(ioprio_get), "ioprio_get" },
+[269] = { 0, TD, SEN(inotify_init), "inotify_init" },
+[270] = { 3, TD|TF, SEN(inotify_add_watch), "inotify_add_watch" },
+[271] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" },
+[272] = { 4, TM, SEN(migrate_pages), "migrate_pages" },
+[273] = { 6, TD, SEN(pselect6_time32), "pselect6" },
+[274] = { 5, TD, SEN(ppoll_time32), "ppoll" },
+[275] = { 4, TD|TF, SEN(openat), "openat" },
+[276] = { 3, TD|TF, SEN(mkdirat), "mkdirat" },
+[277] = { 4, TD|TF, SEN(mknodat), "mknodat" },
+[278] = { 5, TD|TF, SEN(fchownat), "fchownat" },
+[279] = { 3, TD|TF, SEN(futimesat), "futimesat" },
+[280] = { 4, TD|TF|TFST|TSTA,SEN(fstatat64), "fstatat64" },
+[281] = { 3, TD|TF, SEN(unlinkat), "unlinkat" },
+[282] = { 4, TD|TF, SEN(renameat), "renameat" },
+[283] = { 5, TD|TF, SEN(linkat), "linkat" },
+[284] = { 3, TD|TF, SEN(symlinkat), "symlinkat" },
+[285] = { 4, TD|TF, SEN(readlinkat), "readlinkat" },
+[286] = { 3, TD|TF, SEN(fchmodat), "fchmodat" },
+[287] = { 3, TD|TF, SEN(faccessat), "faccessat" },
+[288] = { 1, 0, SEN(unshare), "unshare" },
+[289] = { 2, 0, SEN(set_robust_list), "set_robust_list" },
+[290] = { 3, 0, SEN(get_robust_list), "get_robust_list" },
+[291] = { 6, TD, SEN(splice), "splice" },
+[292] = { 6, TD, SEN(sync_file_range), "sync_file_range" },
+[293] = { 4, TD, SEN(tee), "tee" },
+[294] = { 4, TD, SEN(vmsplice), "vmsplice" },
+[295] = { 6, TM, SEN(move_pages), "move_pages" },
+[296] = { 3, 0, SEN(getcpu), "getcpu" },
+[297] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" },
+[298] = { 3, TF|TSF|TSFA, SEN(statfs64), "statfs64" },
+[299] = { 3, TD|TFSF|TSFA, SEN(fstatfs64), "fstatfs64" },
+[300] = { 4, 0, SEN(kexec_load), "kexec_load" },
+[301] = { 4, TD|TF, SEN(utimensat_time32), "utimensat" },
+[302] = { 3, TD|TS, SEN(signalfd), "signalfd" },
+[303] = { 4, TD, SEN(timerfd), "timerfd" },
+[304] = { 1, TD, SEN(eventfd), "eventfd" },
+[305] = { 6, TD, SEN(fallocate), "fallocate" },
+[306] = { 2, TD, SEN(timerfd_create), "timerfd_create" },
+[307] = { 4, TD, SEN(timerfd_settime32), "timerfd_settime" },
+[308] = { 2, TD, SEN(timerfd_gettime32), "timerfd_gettime" },
+[309] = { 4, TD|TS, SEN(signalfd4), "signalfd4" },
+[310] = { 2, TD, SEN(eventfd2), "eventfd2" },
+[311] = { 1, TD, SEN(epoll_create1), "epoll_create1" },
+[312] = { 3, TD, SEN(dup3), "dup3" },
+[313] = { 2, TD, SEN(pipe2), "pipe2" },
+[314] = { 1, TD, SEN(inotify_init1), "inotify_init1" },
+[315] = { 5, TD, SEN(preadv), "preadv" },
+[316] = { 5, TD, SEN(pwritev), "pwritev" },
+[317] = { 4, TP|TS, SEN(rt_tgsigqueueinfo), "rt_tgsigqueueinfo" },
+[318] = { 5, TD, SEN(perf_event_open), "perf_event_open" },
+[319] = { 5, TN, SEN(recvmmsg_time32), "recvmmsg" },
+[320] = { 4, TN, SEN(accept4), "accept4" },
+[321] = { 4, 0, SEN(prlimit64), "prlimit64" },
+[322] = { 2, TD, SEN(fanotify_init), "fanotify_init" },
+[323] = { 6, TD|TF, SEN(fanotify_mark), "fanotify_mark" },
+[324] = { 2, TCL, SEN(clock_adjtime32), "clock_adjtime" },
+[325] = { 5, TD|TF, SEN(name_to_handle_at), "name_to_handle_at" },
+[326] = { 3, TD, SEN(open_by_handle_at), "open_by_handle_at" },
+[327] = { 1, TD, SEN(syncfs), "syncfs" },
+[328] = { 2, TD, SEN(setns), "setns" },
+[329] = { 4, TN, SEN(sendmmsg), "sendmmsg" },
+[330] = { 6, 0, SEN(process_vm_readv), "process_vm_readv" },
+[331] = { 6, 0, SEN(process_vm_writev), "process_vm_writev" },
+[332] = { 5, 0, SEN(kcmp), "kcmp" },
+[333] = { 3, TD, SEN(finit_module), "finit_module" },
+[334] = { 3, 0, SEN(sched_setattr), "sched_setattr" },
+[335] = { 4, 0, SEN(sched_getattr), "sched_getattr" },
+[336] = { 2, TF, SEN(utimes), "utimes" },
+[337] = { 5, TD|TF, SEN(renameat2), "renameat2" },
+[338] = { 3, 0, SEN(seccomp), "seccomp" },
+[339] = { 3, 0, SEN(getrandom), "getrandom" },
+[340] = { 2, TD, SEN(memfd_create), "memfd_create" },
+[341] = { 3, TD, SEN(bpf), "bpf" },
+[342] = { 5, TD|TF|TP|TSD|SE|SI, SEN(execveat), "execveat" },
+[343] = { 3, 0, SEN(membarrier), "membarrier" },
+[344] = { 1, TD, SEN(userfaultfd), "userfaultfd" },
+[345] = { 3, TM, SEN(mlock2), "mlock2" },
+[346] = { 6, TD, SEN(copy_file_range), "copy_file_range" },
+[347] = { 6, TD, SEN(preadv2), "preadv2" },
+[348] = { 6, TD, SEN(pwritev2), "pwritev2" },
+[349] = { 5, TD|TF|TFST|TSTA,SEN(statx), "statx" },
+[350] = { 6, 0, SEN(io_pgetevents_time32), "io_pgetevents" },
+[351] = { 4, TM|SI, SEN(pkey_mprotect), "pkey_mprotect" },
+[352] = { 2, 0, SEN(pkey_alloc), "pkey_alloc" },
+[353] = { 1, 0, SEN(pkey_free), "pkey_free" },
+[354] = { 4, 0, SEN(rseq), "rseq" },
+[355] = { 5, TD, SEN(kexec_file_load), "kexec_file_load" },
+/* [356 ... 402] - reserved to sync up with other architectures */
+#include "syscallent-common-32.h"
+#include "syscallent-common.h"
diff --git a/src/linux/hppa/userent.h b/src/linux/hppa/userent.h
new file mode 100644
index 000000000..454b95a4d
--- /dev/null
+++ b/src/linux/hppa/userent.h
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#define XLAT_PT_REGS_OFF(member) \
+ { offsetof(struct pt_regs, member), \
+ "offsetof(struct pt_regs, " #member ")" }
+
+XLAT_PT_REGS_OFF(gr[0]),
+XLAT_PT_REGS_OFF(gr[1]),
+XLAT_PT_REGS_OFF(gr[2]),
+XLAT_PT_REGS_OFF(gr[3]),
+XLAT_PT_REGS_OFF(gr[4]),
+XLAT_PT_REGS_OFF(gr[5]),
+XLAT_PT_REGS_OFF(gr[6]),
+XLAT_PT_REGS_OFF(gr[7]),
+XLAT_PT_REGS_OFF(gr[8]),
+XLAT_PT_REGS_OFF(gr[9]),
+XLAT_PT_REGS_OFF(gr[10]),
+XLAT_PT_REGS_OFF(gr[11]),
+XLAT_PT_REGS_OFF(gr[12]),
+XLAT_PT_REGS_OFF(gr[13]),
+XLAT_PT_REGS_OFF(gr[14]),
+XLAT_PT_REGS_OFF(gr[15]),
+XLAT_PT_REGS_OFF(gr[16]),
+XLAT_PT_REGS_OFF(gr[17]),
+XLAT_PT_REGS_OFF(gr[18]),
+XLAT_PT_REGS_OFF(gr[19]),
+XLAT_PT_REGS_OFF(gr[20]),
+XLAT_PT_REGS_OFF(gr[21]),
+XLAT_PT_REGS_OFF(gr[22]),
+XLAT_PT_REGS_OFF(gr[23]),
+XLAT_PT_REGS_OFF(gr[24]),
+XLAT_PT_REGS_OFF(gr[25]),
+XLAT_PT_REGS_OFF(gr[26]),
+XLAT_PT_REGS_OFF(gr[27]),
+XLAT_PT_REGS_OFF(gr[28]),
+XLAT_PT_REGS_OFF(gr[29]),
+XLAT_PT_REGS_OFF(gr[30]),
+XLAT_PT_REGS_OFF(gr[31]),
+
+XLAT_PT_REGS_OFF(sr[0]),
+XLAT_PT_REGS_OFF(sr[1]),
+XLAT_PT_REGS_OFF(sr[2]),
+XLAT_PT_REGS_OFF(sr[3]),
+XLAT_PT_REGS_OFF(sr[4]),
+XLAT_PT_REGS_OFF(sr[5]),
+XLAT_PT_REGS_OFF(sr[6]),
+
+XLAT_PT_REGS_OFF(iasq[0]),
+XLAT_PT_REGS_OFF(iasq[1]),
+
+XLAT_PT_REGS_OFF(iaoq[0]),
+XLAT_PT_REGS_OFF(iaoq[1]),
+
+XLAT_PT_REGS_OFF(cr27),
+XLAT_PT_REGS_OFF(orig_r28),
+XLAT_PT_REGS_OFF(ksp),
+XLAT_PT_REGS_OFF(kpc),
+XLAT_PT_REGS_OFF(sar),
+XLAT_PT_REGS_OFF(iir),
+XLAT_PT_REGS_OFF(isr),
+XLAT_PT_REGS_OFF(ior),
+XLAT_PT_REGS_OFF(ipsw),
+
+#undef XLAT_PT_REGS_OFF
diff --git a/src/linux/i386/arch_defs_.h b/src/linux/i386/arch_defs_.h
new file mode 100644
index 000000000..0b2f3b0d6
--- /dev/null
+++ b/src/linux/i386/arch_defs_.h
@@ -0,0 +1,11 @@
+/*
+ * Copyright (c) 2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#define HAVE_ARCH_OLD_MMAP 1
+#define HAVE_ARCH_OLD_SELECT 1
+#define HAVE_ARCH_UID16_SYSCALLS 1
+#define CAN_ARCH_BE_COMPAT_ON_64BIT_KERNEL 1
diff --git a/src/linux/i386/arch_kvm.c b/src/linux/i386/arch_kvm.c
new file mode 100644
index 000000000..e8e982ee9
--- /dev/null
+++ b/src/linux/i386/arch_kvm.c
@@ -0,0 +1 @@
+#include "x86_64/arch_kvm.c"
diff --git a/src/linux/i386/arch_regs.c b/src/linux/i386/arch_regs.c
new file mode 100644
index 000000000..fac427441
--- /dev/null
+++ b/src/linux/i386/arch_regs.c
@@ -0,0 +1,15 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static struct user_regs_struct i386_regs;
+
+#define ARCH_REGS_FOR_GETREGS i386_regs
+#define ARCH_PC_REG i386_regs.eip
+#define ARCH_SP_REG i386_regs.esp
+
+#undef ARCH_MIGHT_USE_SET_REGS
+#define ARCH_MIGHT_USE_SET_REGS 0
diff --git a/src/linux/i386/arch_rt_sigframe.c b/src/linux/i386/arch_rt_sigframe.c
new file mode 100644
index 000000000..1172e602b
--- /dev/null
+++ b/src/linux/i386/arch_rt_sigframe.c
@@ -0,0 +1,12 @@
+/*
+ * Copyright (c) 2017-2018 Dmitry V. Levin <ldv@strace.io>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+FUNC_GET_RT_SIGFRAME_ADDR
+{
+ kernel_ulong_t sp;
+ return get_stack_pointer(tcp, &sp) ? sp - current_klongsize : 0;
+}
diff --git a/src/linux/i386/arch_sigreturn.c b/src/linux/i386/arch_sigreturn.c
new file mode 100644
index 000000000..f9c4a2878
--- /dev/null
+++ b/src/linux/i386/arch_sigreturn.c
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static void
+arch_sigreturn(struct tcb *tcp)
+{
+ /*
+ * On i386, sigcontext is followed on stack by struct fpstate
+ * and after it an additional u32 extramask which holds
+ * upper half of the mask.
+ */
+ struct {
+ uint32_t struct_sigcontext_padding1[20];
+ uint32_t oldmask;
+ uint32_t struct_sigcontext_padding2;
+ uint32_t struct_fpstate_padding[156];
+ uint32_t extramask;
+ } frame;
+ kernel_ulong_t sp;
+
+ if (get_stack_pointer(tcp, &sp) &&
+ !umove_or_printaddr(tcp, sp, &frame)) {
+ uint32_t mask[2] = { frame.oldmask, frame.extramask };
+ tprintsigmask_addr(mask);
+ }
+}
diff --git a/src/linux/i386/get_error.c b/src/linux/i386/get_error.c
new file mode 100644
index 000000000..c5e95c170
--- /dev/null
+++ b/src/linux/i386/get_error.c
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "negated_errno.h"
+
+static void
+arch_get_error(struct tcb *tcp, const bool check_errno)
+{
+ if (check_errno && is_negated_errno(i386_regs.eax)) {
+ tcp->u_rval = -1;
+ tcp->u_error = -i386_regs.eax;
+ } else {
+ tcp->u_rval = i386_regs.eax;
+ }
+}
diff --git a/src/linux/i386/get_scno.c b/src/linux/i386/get_scno.c
new file mode 100644
index 000000000..980952f35
--- /dev/null
+++ b/src/linux/i386/get_scno.c
@@ -0,0 +1,14 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+/* Return codes: 1 - ok, 0 - ignore, other - error. */
+static int
+arch_get_scno(struct tcb *tcp)
+{
+ tcp->scno = i386_regs.orig_eax;
+ return 1;
+}
diff --git a/src/linux/i386/get_syscall_args.c b/src/linux/i386/get_syscall_args.c
new file mode 100644
index 000000000..c048285a5
--- /dev/null
+++ b/src/linux/i386/get_syscall_args.c
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+/* Return -1 on error or 1 on success (never 0!). */
+static int
+arch_get_syscall_args(struct tcb *tcp)
+{
+ tcp->u_arg[0] = i386_regs.ebx;
+ tcp->u_arg[1] = i386_regs.ecx;
+ tcp->u_arg[2] = i386_regs.edx;
+ tcp->u_arg[3] = i386_regs.esi;
+ tcp->u_arg[4] = i386_regs.edi;
+ tcp->u_arg[5] = i386_regs.ebp;
+ return 1;
+}
diff --git a/src/linux/i386/ioctls_arch0.h b/src/linux/i386/ioctls_arch0.h
new file mode 100644
index 000000000..eaf140adc
--- /dev/null
+++ b/src/linux/i386/ioctls_arch0.h
@@ -0,0 +1,119 @@
+/* Generated by ioctls_gen.sh from definitions found in $linux/arch/x86/include/ tree. */
+{ "asm/mce.h", "MCE_GETCLEAR_FLAGS", _IOC_READ, 0x4d03, 0x04 },
+{ "asm/mce.h", "MCE_GET_LOG_LEN", _IOC_READ, 0x4d02, 0x04 },
+{ "asm/mce.h", "MCE_GET_RECORD_LEN", _IOC_READ, 0x4d01, 0x04 },
+{ "asm/msr.h", "X86_IOC_RDMSR_REGS", _IOC_READ|_IOC_WRITE, 0x63a0, 0x20 },
+{ "asm/msr.h", "X86_IOC_WRMSR_REGS", _IOC_READ|_IOC_WRITE, 0x63a1, 0x20 },
+{ "asm/mtrr.h", "MTRRIOC_ADD_ENTRY", _IOC_WRITE, 0x4d00, 0x0c },
+{ "asm/mtrr.h", "MTRRIOC_ADD_PAGE_ENTRY", _IOC_WRITE, 0x4d05, 0x0c },
+{ "asm/mtrr.h", "MTRRIOC_DEL_ENTRY", _IOC_WRITE, 0x4d02, 0x0c },
+{ "asm/mtrr.h", "MTRRIOC_DEL_PAGE_ENTRY", _IOC_WRITE, 0x4d07, 0x0c },
+{ "asm/mtrr.h", "MTRRIOC_GET_ENTRY", _IOC_READ|_IOC_WRITE, 0x4d03, 0x10 },
+{ "asm/mtrr.h", "MTRRIOC_GET_PAGE_ENTRY", _IOC_READ|_IOC_WRITE, 0x4d08, 0x10 },
+{ "asm/mtrr.h", "MTRRIOC_KILL_ENTRY", _IOC_WRITE, 0x4d04, 0x0c },
+{ "asm/mtrr.h", "MTRRIOC_KILL_PAGE_ENTRY", _IOC_WRITE, 0x4d09, 0x0c },
+{ "asm/mtrr.h", "MTRRIOC_SET_ENTRY", _IOC_WRITE, 0x4d01, 0x0c },
+{ "asm/mtrr.h", "MTRRIOC_SET_PAGE_ENTRY", _IOC_WRITE, 0x4d06, 0x0c },
+{ "linux/kvm.h", "KVM_ASSIGN_DEV_IRQ", _IOC_WRITE, 0xae70, 0x40 },
+{ "linux/kvm.h", "KVM_ASSIGN_PCI_DEVICE", _IOC_READ, 0xae69, 0x40 },
+{ "linux/kvm.h", "KVM_ASSIGN_SET_INTX_MASK", _IOC_WRITE, 0xaea4, 0x40 },
+{ "linux/kvm.h", "KVM_ASSIGN_SET_MSIX_ENTRY", _IOC_WRITE, 0xae74, 0x10 },
+{ "linux/kvm.h", "KVM_ASSIGN_SET_MSIX_NR", _IOC_WRITE, 0xae73, 0x08 },
+{ "linux/kvm.h", "KVM_CHECK_EXTENSION", _IOC_NONE, 0xae03, 0x00 },
+{ "linux/kvm.h", "KVM_CLEAR_DIRTY_LOG", _IOC_READ|_IOC_WRITE, 0xaec0, 0x18 },
+{ "linux/kvm.h", "KVM_CREATE_DEVICE", _IOC_READ|_IOC_WRITE, 0xaee0, 0x0c },
+{ "linux/kvm.h", "KVM_CREATE_IRQCHIP", _IOC_NONE, 0xae60, 0x00 },
+{ "linux/kvm.h", "KVM_CREATE_PIT", _IOC_NONE, 0xae64, 0x00 },
+{ "linux/kvm.h", "KVM_CREATE_PIT2", _IOC_WRITE, 0xae77, 0x40 },
+{ "linux/kvm.h", "KVM_CREATE_VCPU", _IOC_NONE, 0xae41, 0x00 },
+{ "linux/kvm.h", "KVM_CREATE_VM", _IOC_NONE, 0xae01, 0x00 },
+{ "linux/kvm.h", "KVM_DEASSIGN_DEV_IRQ", _IOC_WRITE, 0xae75, 0x40 },
+{ "linux/kvm.h", "KVM_DEASSIGN_PCI_DEVICE", _IOC_WRITE, 0xae72, 0x40 },
+{ "linux/kvm.h", "KVM_DIRTY_TLB", _IOC_WRITE, 0xaeaa, 0x0c },
+{ "linux/kvm.h", "KVM_ENABLE_CAP", _IOC_WRITE, 0xaea3, 0x68 },
+{ "linux/kvm.h", "KVM_GET_API_VERSION", _IOC_NONE, 0xae00, 0x00 },
+{ "linux/kvm.h", "KVM_GET_CLOCK", _IOC_READ, 0xae7c, 0x30 },
+{ "linux/kvm.h", "KVM_GET_CPUID2", _IOC_READ|_IOC_WRITE, 0xae91, 0x08 },
+{ "linux/kvm.h", "KVM_GET_DEBUGREGS", _IOC_READ, 0xaea1, 0x80 },
+{ "linux/kvm.h", "KVM_GET_DEVICE_ATTR", _IOC_WRITE, 0xaee2, 0x18 },
+{ "linux/kvm.h", "KVM_GET_DIRTY_LOG", _IOC_WRITE, 0xae42, 0x10 },
+{ "linux/kvm.h", "KVM_GET_EMULATED_CPUID", _IOC_READ|_IOC_WRITE, 0xae09, 0x08 },
+{ "linux/kvm.h", "KVM_GET_FPU", _IOC_READ, 0xae8c, 0x1a0 },
+{ "linux/kvm.h", "KVM_GET_IRQCHIP", _IOC_READ|_IOC_WRITE, 0xae62, 0x208 },
+{ "linux/kvm.h", "KVM_GET_LAPIC", _IOC_READ, 0xae8e, 0x400 },
+{ "linux/kvm.h", "KVM_GET_MP_STATE", _IOC_READ, 0xae98, 0x04 },
+{ "linux/kvm.h", "KVM_GET_MSRS", _IOC_READ|_IOC_WRITE, 0xae88, 0x08 },
+{ "linux/kvm.h", "KVM_GET_MSR_FEATURE_INDEX_LIST", _IOC_READ|_IOC_WRITE, 0xae0a, 0x04 },
+{ "linux/kvm.h", "KVM_GET_MSR_INDEX_LIST", _IOC_READ|_IOC_WRITE, 0xae02, 0x04 },
+{ "linux/kvm.h", "KVM_GET_NESTED_STATE", _IOC_READ|_IOC_WRITE, 0xaebe, 0x80 },
+{ "linux/kvm.h", "KVM_GET_NR_MMU_PAGES", _IOC_NONE, 0xae45, 0x00 },
+{ "linux/kvm.h", "KVM_GET_ONE_REG", _IOC_WRITE, 0xaeab, 0x10 },
+{ "linux/kvm.h", "KVM_GET_PIT", _IOC_READ|_IOC_WRITE, 0xae65, 0x48 },
+{ "linux/kvm.h", "KVM_GET_PIT2", _IOC_READ, 0xae9f, 0x70 },
+{ "linux/kvm.h", "KVM_GET_REGS", _IOC_READ, 0xae81, 0x90 },
+{ "linux/kvm.h", "KVM_GET_REG_LIST", _IOC_READ|_IOC_WRITE, 0xaeb0, 0x08 },
+{ "linux/kvm.h", "KVM_GET_SREGS", _IOC_READ, 0xae83, 0x138 },
+{ "linux/kvm.h", "KVM_GET_SUPPORTED_CPUID", _IOC_READ|_IOC_WRITE, 0xae05, 0x08 },
+{ "linux/kvm.h", "KVM_GET_SUPPORTED_HV_CPUID", _IOC_READ|_IOC_WRITE, 0xaec1, 0x08 },
+{ "linux/kvm.h", "KVM_GET_TSC_KHZ", _IOC_NONE, 0xaea3, 0x00 },
+{ "linux/kvm.h", "KVM_GET_VCPU_EVENTS", _IOC_READ, 0xae9f, 0x40 },
+{ "linux/kvm.h", "KVM_GET_VCPU_MMAP_SIZE", _IOC_NONE, 0xae04, 0x00 },
+{ "linux/kvm.h", "KVM_GET_XCRS", _IOC_READ, 0xaea6, 0x188 },
+{ "linux/kvm.h", "KVM_GET_XSAVE", _IOC_READ, 0xaea4, 0x1000 },
+{ "linux/kvm.h", "KVM_HAS_DEVICE_ATTR", _IOC_WRITE, 0xaee3, 0x18 },
+{ "linux/kvm.h", "KVM_HYPERV_EVENTFD", _IOC_WRITE, 0xaebd, 0x18 },
+{ "linux/kvm.h", "KVM_INTERRUPT", _IOC_WRITE, 0xae86, 0x04 },
+{ "linux/kvm.h", "KVM_IOEVENTFD", _IOC_WRITE, 0xae79, 0x40 },
+{ "linux/kvm.h", "KVM_IRQFD", _IOC_WRITE, 0xae76, 0x20 },
+{ "linux/kvm.h", "KVM_IRQ_LINE", _IOC_WRITE, 0xae61, 0x08 },
+{ "linux/kvm.h", "KVM_IRQ_LINE_STATUS", _IOC_READ|_IOC_WRITE, 0xae67, 0x08 },
+{ "linux/kvm.h", "KVM_KVMCLOCK_CTRL", _IOC_NONE, 0xaead, 0x00 },
+{ "linux/kvm.h", "KVM_MEMORY_ENCRYPT_OP", _IOC_READ|_IOC_WRITE, 0xaeba, 0x04 },
+{ "linux/kvm.h", "KVM_MEMORY_ENCRYPT_REG_REGION", _IOC_READ, 0xaebb, 0x10 },
+{ "linux/kvm.h", "KVM_MEMORY_ENCRYPT_UNREG_REGION", _IOC_READ, 0xaebc, 0x10 },
+{ "linux/kvm.h", "KVM_NMI", _IOC_NONE, 0xae9a, 0x00 },
+{ "linux/kvm.h", "KVM_REGISTER_COALESCED_MMIO", _IOC_WRITE, 0xae67, 0x10 },
+{ "linux/kvm.h", "KVM_REINJECT_CONTROL", _IOC_NONE, 0xae71, 0x00 },
+{ "linux/kvm.h", "KVM_RUN", _IOC_NONE, 0xae80, 0x00 },
+{ "linux/kvm.h", "KVM_SET_BOOT_CPU_ID", _IOC_NONE, 0xae78, 0x00 },
+{ "linux/kvm.h", "KVM_SET_CLOCK", _IOC_WRITE, 0xae7b, 0x30 },
+{ "linux/kvm.h", "KVM_SET_CPUID", _IOC_WRITE, 0xae8a, 0x08 },
+{ "linux/kvm.h", "KVM_SET_CPUID2", _IOC_WRITE, 0xae90, 0x08 },
+{ "linux/kvm.h", "KVM_SET_DEBUGREGS", _IOC_WRITE, 0xaea2, 0x80 },
+{ "linux/kvm.h", "KVM_SET_DEVICE_ATTR", _IOC_WRITE, 0xaee1, 0x18 },
+{ "linux/kvm.h", "KVM_SET_FPU", _IOC_WRITE, 0xae8d, 0x1a0 },
+{ "linux/kvm.h", "KVM_SET_GSI_ROUTING", _IOC_WRITE, 0xae6a, 0x08 },
+{ "linux/kvm.h", "KVM_SET_GUEST_DEBUG", _IOC_WRITE, 0xae9b, 0x48 },
+{ "linux/kvm.h", "KVM_SET_IDENTITY_MAP_ADDR", _IOC_WRITE, 0xae48, 0x08 },
+{ "linux/kvm.h", "KVM_SET_IRQCHIP", _IOC_READ, 0xae63, 0x208 },
+{ "linux/kvm.h", "KVM_SET_LAPIC", _IOC_WRITE, 0xae8f, 0x400 },
+{ "linux/kvm.h", "KVM_SET_MEMORY_ALIAS", _IOC_WRITE, 0xae43, 0x20 },
+{ "linux/kvm.h", "KVM_SET_MEMORY_REGION", _IOC_WRITE, 0xae40, 0x18 },
+{ "linux/kvm.h", "KVM_SET_MP_STATE", _IOC_WRITE, 0xae99, 0x04 },
+{ "linux/kvm.h", "KVM_SET_MSRS", _IOC_WRITE, 0xae89, 0x08 },
+{ "linux/kvm.h", "KVM_SET_NESTED_STATE", _IOC_WRITE, 0xaebf, 0x80 },
+{ "linux/kvm.h", "KVM_SET_NR_MMU_PAGES", _IOC_NONE, 0xae44, 0x00 },
+{ "linux/kvm.h", "KVM_SET_ONE_REG", _IOC_WRITE, 0xaeac, 0x10 },
+{ "linux/kvm.h", "KVM_SET_PIT", _IOC_READ, 0xae66, 0x48 },
+{ "linux/kvm.h", "KVM_SET_PIT2", _IOC_WRITE, 0xaea0, 0x70 },
+{ "linux/kvm.h", "KVM_SET_PMU_EVENT_FILTER", _IOC_WRITE, 0xaeb2, 0x20 },
+{ "linux/kvm.h", "KVM_SET_REGS", _IOC_WRITE, 0xae82, 0x90 },
+{ "linux/kvm.h", "KVM_SET_SIGNAL_MASK", _IOC_WRITE, 0xae8b, 0x04 },
+{ "linux/kvm.h", "KVM_SET_SREGS", _IOC_WRITE, 0xae84, 0x138 },
+{ "linux/kvm.h", "KVM_SET_TSC_KHZ", _IOC_NONE, 0xaea2, 0x00 },
+{ "linux/kvm.h", "KVM_SET_TSS_ADDR", _IOC_NONE, 0xae47, 0x00 },
+{ "linux/kvm.h", "KVM_SET_USER_MEMORY_REGION", _IOC_WRITE, 0xae46, 0x20 },
+{ "linux/kvm.h", "KVM_SET_VAPIC_ADDR", _IOC_WRITE, 0xae93, 0x08 },
+{ "linux/kvm.h", "KVM_SET_VCPU_EVENTS", _IOC_WRITE, 0xaea0, 0x40 },
+{ "linux/kvm.h", "KVM_SET_XCRS", _IOC_WRITE, 0xaea7, 0x188 },
+{ "linux/kvm.h", "KVM_SET_XSAVE", _IOC_WRITE, 0xaea5, 0x1000 },
+{ "linux/kvm.h", "KVM_SIGNAL_MSI", _IOC_WRITE, 0xaea5, 0x20 },
+{ "linux/kvm.h", "KVM_SMI", _IOC_NONE, 0xaeb7, 0x00 },
+{ "linux/kvm.h", "KVM_TPR_ACCESS_REPORTING", _IOC_READ|_IOC_WRITE, 0xae92, 0x28 },
+{ "linux/kvm.h", "KVM_TRANSLATE", _IOC_READ|_IOC_WRITE, 0xae85, 0x18 },
+{ "linux/kvm.h", "KVM_UNREGISTER_COALESCED_MMIO", _IOC_WRITE, 0xae68, 0x10 },
+{ "linux/kvm.h", "KVM_X86_GET_MCE_CAP_SUPPORTED", _IOC_READ, 0xae9d, 0x08 },
+{ "linux/kvm.h", "KVM_X86_SETUP_MCE", _IOC_WRITE, 0xae9c, 0x08 },
+{ "linux/kvm.h", "KVM_X86_SET_MCE", _IOC_WRITE, 0xae9e, 0x40 },
+{ "linux/kvm.h", "KVM_X86_SET_MSR_FILTER", _IOC_WRITE, 0xaec6, 0x104 },
+{ "linux/kvm.h", "KVM_XEN_HVM_CONFIG", _IOC_WRITE, 0xae7a, 0x38 },
diff --git a/src/linux/i386/ioctls_inc0.h b/src/linux/i386/ioctls_inc0.h
new file mode 100644
index 000000000..4aecf983e
--- /dev/null
+++ b/src/linux/i386/ioctls_inc0.h
@@ -0,0 +1 @@
+#include "32/ioctls_inc.h"
diff --git a/src/linux/i386/raw_syscall.h b/src/linux/i386/raw_syscall.h
new file mode 100644
index 000000000..71160397d
--- /dev/null
+++ b/src/linux/i386/raw_syscall.h
@@ -0,0 +1,28 @@
+/*
+ * Raw syscalls.
+ *
+ * Copyright (c) 2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_RAW_SYSCALL_H
+# define STRACE_RAW_SYSCALL_H
+
+# include "kernel_types.h"
+
+static inline kernel_ulong_t
+raw_syscall_0(const kernel_ulong_t nr, kernel_ulong_t *err)
+{
+ *err = 0;
+ kernel_ulong_t ret;
+ __asm__ __volatile__("int $0x80"
+ : "=a"(ret)
+ : "a"(nr)
+ : "memory", "cc");
+ return ret;
+}
+# define raw_syscall_0 raw_syscall_0
+
+#endif /* !STRACE_RAW_SYSCALL_H */
diff --git a/src/linux/i386/rt_sigframe.h b/src/linux/i386/rt_sigframe.h
new file mode 100644
index 000000000..0d14e2260
--- /dev/null
+++ b/src/linux/i386/rt_sigframe.h
@@ -0,0 +1,23 @@
+/*
+ * Copyright (c) 2017-2018 Dmitry V. Levin <ldv@strace.io>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_RT_SIGFRAME_H
+# define STRACE_RT_SIGFRAME_H
+
+# include <signal.h>
+
+typedef struct {
+ uint32_t pretcode;
+ int sig;
+ uint32_t pinfo;
+ uint32_t puc;
+ siginfo_t info;
+ ucontext_t uc;
+ /* more data follows */
+} struct_rt_sigframe;
+
+#endif /* !STRACE_RT_SIGFRAME_H */
diff --git a/src/linux/i386/set_error.c b/src/linux/i386/set_error.c
new file mode 100644
index 000000000..07861ac31
--- /dev/null
+++ b/src/linux/i386/set_error.c
@@ -0,0 +1,20 @@
+/*
+ * Copyright (c) 2016-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static int
+arch_set_error(struct tcb *tcp)
+{
+ i386_regs.eax = -tcp->u_error;
+ return upoke(tcp, 4 * EAX, i386_regs.eax);
+}
+
+static int
+arch_set_success(struct tcb *tcp)
+{
+ i386_regs.eax = tcp->u_rval;
+ return upoke(tcp, 4 * EAX, i386_regs.eax);
+}
diff --git a/src/linux/i386/set_scno.c b/src/linux/i386/set_scno.c
new file mode 100644
index 000000000..fcff8aeba
--- /dev/null
+++ b/src/linux/i386/set_scno.c
@@ -0,0 +1,12 @@
+/*
+ * Copyright (c) 2016-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static int
+arch_set_scno(struct tcb *tcp, kernel_ulong_t scno)
+{
+ return upoke(tcp, 4 * ORIG_EAX, scno);
+}
diff --git a/src/linux/i386/syscallent.h b/src/linux/i386/syscallent.h
new file mode 100644
index 000000000..be41734a0
--- /dev/null
+++ b/src/linux/i386/syscallent.h
@@ -0,0 +1,411 @@
+/*
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993, 1994, 1995 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1995-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+[ 0] = { 0, 0, SEN(restart_syscall), "restart_syscall" },
+[ 1] = { 1, TP|SE, SEN(exit), "exit" },
+[ 2] = { 0, TP, SEN(fork), "fork" },
+[ 3] = { 3, TD, SEN(read), "read" },
+[ 4] = { 3, TD, SEN(write), "write" },
+[ 5] = { 3, TD|TF, SEN(open), "open" },
+[ 6] = { 1, TD, SEN(close), "close" },
+[ 7] = { 3, TP, SEN(waitpid), "waitpid" },
+[ 8] = { 2, TD|TF, SEN(creat), "creat" },
+[ 9] = { 2, TF, SEN(link), "link" },
+[ 10] = { 1, TF, SEN(unlink), "unlink" },
+[ 11] = { 3, TF|TP|TSD|SE|SI, SEN(execve), "execve" },
+[ 12] = { 1, TF, SEN(chdir), "chdir" },
+[ 13] = { 1, TCL, SEN(time), "time" },
+[ 14] = { 3, TF, SEN(mknod), "mknod" },
+[ 15] = { 2, TF, SEN(chmod), "chmod" },
+[ 16] = { 3, TF, SEN(chown16), "lchown" },
+[ 17] = { 0, TM, SEN(break), "break" },
+[ 18] = { 2, TF|TST|TSTA, SEN(oldstat), "oldstat" },
+[ 19] = { 3, TD, SEN(lseek), "lseek" },
+[ 20] = { 0, PU|NF, SEN(getpid), "getpid" },
+[ 21] = { 5, TF, SEN(mount), "mount" },
+[ 22] = { 1, TF, SEN(umount), "umount" },
+[ 23] = { 1, TC, SEN(setuid16), "setuid" },
+[ 24] = { 0, TC|PU|NF, SEN(getuid16), "getuid" },
+[ 25] = { 1, 0, SEN(stime), "stime" },
+[ 26] = { 4, 0, SEN(ptrace), "ptrace" },
+[ 27] = { 1, 0, SEN(alarm), "alarm" },
+[ 28] = { 2, TD|TFST|TSTA, SEN(oldfstat), "oldfstat" },
+[ 29] = { 0, TS, SEN(pause), "pause" },
+[ 30] = { 2, TF, SEN(utime), "utime" },
+[ 31] = { 2, 0, SEN(stty), "stty" },
+[ 32] = { 2, 0, SEN(gtty), "gtty" },
+[ 33] = { 2, TF, SEN(access), "access" },
+[ 34] = { 1, 0, SEN(nice), "nice" },
+[ 35] = { 0, 0, SEN(ftime), "ftime" },
+[ 36] = { 0, 0, SEN(sync), "sync" },
+[ 37] = { 2, TS|TP, SEN(kill), "kill" },
+[ 38] = { 2, TF, SEN(rename), "rename" },
+[ 39] = { 2, TF, SEN(mkdir), "mkdir" },
+[ 40] = { 1, TF, SEN(rmdir), "rmdir" },
+[ 41] = { 1, TD, SEN(dup), "dup" },
+[ 42] = { 1, TD, SEN(pipe), "pipe" },
+[ 43] = { 1, 0, SEN(times), "times" },
+[ 44] = { 0, 0, SEN(prof), "prof" },
+[ 45] = { 1, TM|SI, SEN(brk), "brk" },
+[ 46] = { 1, TC, SEN(setgid16), "setgid" },
+[ 47] = { 0, TC|PU|NF, SEN(getgid16), "getgid" },
+[ 48] = { 2, TS, SEN(signal), "signal" },
+[ 49] = { 0, TC|PU|NF, SEN(geteuid16), "geteuid" },
+[ 50] = { 0, TC|PU|NF, SEN(getegid16), "getegid" },
+[ 51] = { 1, TF, SEN(acct), "acct" },
+[ 52] = { 2, TF, SEN(umount2), "umount2" },
+[ 53] = { 0, 0, SEN(lock), "lock" },
+[ 54] = { 3, TD, SEN(ioctl), "ioctl" },
+[ 55] = { 3, TD, SEN(fcntl), "fcntl" },
+[ 56] = { 0, 0, SEN(mpx), "mpx" },
+[ 57] = { 2, 0, SEN(setpgid), "setpgid" },
+[ 58] = { 2, 0, SEN(ulimit), "ulimit" },
+[ 59] = { 1, 0, SEN(oldolduname), "oldolduname" },
+[ 60] = { 1, NF, SEN(umask), "umask" },
+[ 61] = { 1, TF, SEN(chroot), "chroot" },
+[ 62] = { 2, TSFA, SEN(ustat), "ustat" },
+[ 63] = { 2, TD, SEN(dup2), "dup2" },
+[ 64] = { 0, PU|NF, SEN(getppid), "getppid" },
+[ 65] = { 0, PU|NF, SEN(getpgrp), "getpgrp" },
+[ 66] = { 0, 0, SEN(setsid), "setsid" },
+[ 67] = { 3, TS, SEN(sigaction), "sigaction" },
+[ 68] = { 0, TS, SEN(sgetmask), "sgetmask" },
+[ 69] = { 1, TS, SEN(ssetmask), "ssetmask" },
+[ 70] = { 2, TC, SEN(setreuid16), "setreuid" },
+[ 71] = { 2, TC, SEN(setregid16), "setregid" },
+[ 72] = { 3, TS, SEN(sigsuspend), "sigsuspend" },
+[ 73] = { 1, TS, SEN(sigpending), "sigpending" },
+[ 74] = { 2, 0, SEN(sethostname), "sethostname" },
+[ 75] = { 2, 0, SEN(setrlimit), "setrlimit" },
+[ 76] = { 2, 0, SEN(getrlimit), "getrlimit" },
+[ 77] = { 2, 0, SEN(getrusage), "getrusage" },
+[ 78] = { 2, TCL, SEN(gettimeofday), "gettimeofday" },
+[ 79] = { 2, TCL, SEN(settimeofday), "settimeofday" },
+[ 80] = { 2, TC, SEN(getgroups16), "getgroups" },
+[ 81] = { 2, TC, SEN(setgroups16), "setgroups" },
+[ 82] = { 1, TD, SEN(oldselect), "select" },
+[ 83] = { 2, TF, SEN(symlink), "symlink" },
+[ 84] = { 2, TF|TLST|TSTA, SEN(oldlstat), "oldlstat" },
+[ 85] = { 3, TF, SEN(readlink), "readlink" },
+[ 86] = { 1, TF, SEN(uselib), "uselib" },
+[ 87] = { 2, TF, SEN(swapon), "swapon" },
+[ 88] = { 4, 0, SEN(reboot), "reboot" },
+[ 89] = { 3, TD, SEN(readdir), "readdir" },
+[ 90] = { 1, TD|TM|SI, SEN(old_mmap), "mmap" },
+[ 91] = { 2, TM|SI, SEN(munmap), "munmap" },
+[ 92] = { 2, TF, SEN(truncate), "truncate" },
+[ 93] = { 2, TD, SEN(ftruncate), "ftruncate" },
+[ 94] = { 2, TD, SEN(fchmod), "fchmod" },
+[ 95] = { 3, TD, SEN(fchown16), "fchown" },
+[ 96] = { 2, 0, SEN(getpriority), "getpriority" },
+[ 97] = { 3, 0, SEN(setpriority), "setpriority" },
+[ 98] = { 4, 0, SEN(profil), "profil" },
+[ 99] = { 2, TF|TSF|TSFA, SEN(statfs), "statfs" },
+[100] = { 2, TD|TFSF|TSFA, SEN(fstatfs), "fstatfs" },
+[101] = { 3, 0, SEN(ioperm), "ioperm" },
+[102] = { 2, TD|TSD, SEN(socketcall), "socketcall" },
+[103] = { 3, 0, SEN(syslog), "syslog" },
+[104] = { 3, 0, SEN(setitimer), "setitimer" },
+[105] = { 2, 0, SEN(getitimer), "getitimer" },
+[106] = { 2, TF|TST|TSTA, SEN(stat), "stat" },
+[107] = { 2, TF|TLST|TSTA, SEN(lstat), "lstat" },
+[108] = { 2, TD|TFST|TSTA, SEN(fstat), "fstat" },
+[109] = { 1, 0, SEN(olduname), "olduname" },
+[110] = { 1, 0, SEN(iopl), "iopl" },
+[111] = { 0, 0, SEN(vhangup), "vhangup" },
+[112] = { 0, 0, SEN(idle), "idle" },
+[113] = { 1, 0, SEN(vm86old), "vm86old" },
+[114] = { 4, TP, SEN(wait4), "wait4" },
+[115] = { 1, TF, SEN(swapoff), "swapoff" },
+[116] = { 1, 0, SEN(sysinfo), "sysinfo" },
+[117] = { 6, TI|TSD, SEN(ipc), "ipc" },
+[118] = { 1, TD, SEN(fsync), "fsync" },
+[119] = { 0, TS, SEN(sigreturn), "sigreturn" },
+[120] = { 5, TP, SEN(clone), "clone" },
+[121] = { 2, 0, SEN(setdomainname), "setdomainname" },
+[122] = { 1, 0, SEN(uname), "uname" },
+[123] = { 3, 0, SEN(modify_ldt), "modify_ldt" },
+[124] = { 1, TCL, SEN(adjtimex32), "adjtimex" },
+[125] = { 3, TM|SI, SEN(mprotect), "mprotect" },
+[126] = { 3, TS, SEN(sigprocmask), "sigprocmask" },
+[127] = { 2, 0, SEN(create_module), "create_module" },
+[128] = { 3, 0, SEN(init_module), "init_module" },
+[129] = { 2, 0, SEN(delete_module), "delete_module" },
+[130] = { 1, 0, SEN(get_kernel_syms), "get_kernel_syms" },
+[131] = { 4, TF, SEN(quotactl), "quotactl" },
+[132] = { 1, 0, SEN(getpgid), "getpgid" },
+[133] = { 1, TD, SEN(fchdir), "fchdir" },
+[134] = { 2, 0, SEN(bdflush), "bdflush" },
+[135] = { 3, 0, SEN(sysfs), "sysfs" },
+[136] = { 1, NF, SEN(personality), "personality" },
+[137] = { 5, 0, SEN(afs_syscall), "afs_syscall" },
+[138] = { 1, TC|NF, SEN(setfsuid16), "setfsuid" },
+[139] = { 1, TC|NF, SEN(setfsgid16), "setfsgid" },
+[140] = { 5, TD, SEN(llseek), "_llseek" },
+[141] = { 3, TD, SEN(getdents), "getdents" },
+[142] = { 5, TD, SEN(select), "_newselect" },
+[143] = { 2, TD, SEN(flock), "flock" },
+[144] = { 3, TM, SEN(msync), "msync" },
+[145] = { 3, TD, SEN(readv), "readv" },
+[146] = { 3, TD, SEN(writev), "writev" },
+[147] = { 1, 0, SEN(getsid), "getsid" },
+[148] = { 1, TD, SEN(fdatasync), "fdatasync" },
+[149] = { 1, 0, SEN(sysctl), "_sysctl" },
+[150] = { 2, TM, SEN(mlock), "mlock" },
+[151] = { 2, TM, SEN(munlock), "munlock" },
+[152] = { 1, TM, SEN(mlockall), "mlockall" },
+[153] = { 0, TM, SEN(munlockall), "munlockall" },
+[154] = { 2, 0, SEN(sched_setparam), "sched_setparam" },
+[155] = { 2, 0, SEN(sched_getparam), "sched_getparam" },
+[156] = { 3, 0, SEN(sched_setscheduler), "sched_setscheduler" },
+[157] = { 1, 0, SEN(sched_getscheduler), "sched_getscheduler" },
+[158] = { 0, 0, SEN(sched_yield), "sched_yield" },
+[159] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"},
+[160] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"},
+[161] = { 2, 0, SEN(sched_rr_get_interval_time32),"sched_rr_get_interval"},
+[162] = { 2, 0, SEN(nanosleep_time32), "nanosleep" },
+[163] = { 5, TM|SI, SEN(mremap), "mremap" },
+[164] = { 3, TC, SEN(setresuid16), "setresuid" },
+[165] = { 3, TC, SEN(getresuid16), "getresuid" },
+[166] = { 5, 0, SEN(vm86), "vm86" },
+[167] = { 5, 0, SEN(query_module), "query_module" },
+[168] = { 3, TD, SEN(poll_time32), "poll" },
+[169] = { 3, 0, SEN(nfsservctl), "nfsservctl" },
+[170] = { 3, TC, SEN(setresgid16), "setresgid" },
+[171] = { 3, TC, SEN(getresgid16), "getresgid" },
+[172] = { 5, TC, SEN(prctl), "prctl" },
+[173] = { 0, TS, SEN(rt_sigreturn), "rt_sigreturn" },
+[174] = { 4, TS, SEN(rt_sigaction), "rt_sigaction" },
+[175] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" },
+[176] = { 2, TS, SEN(rt_sigpending), "rt_sigpending" },
+[177] = { 4, TS, SEN(rt_sigtimedwait_time32), "rt_sigtimedwait" },
+[178] = { 3, TS|TP, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" },
+[179] = { 2, TS, SEN(rt_sigsuspend), "rt_sigsuspend" },
+[180] = { 5, TD, SEN(pread), "pread64" },
+[181] = { 5, TD, SEN(pwrite), "pwrite64" },
+[182] = { 3, TF, SEN(chown16), "chown" },
+[183] = { 2, TF, SEN(getcwd), "getcwd" },
+[184] = { 2, TC, SEN(capget), "capget" },
+[185] = { 2, TC, SEN(capset), "capset" },
+[186] = { 2, TS, SEN(sigaltstack), "sigaltstack" },
+[187] = { 4, TD|TN, SEN(sendfile), "sendfile" },
+[188] = { 5, TN, SEN(getpmsg), "getpmsg" },
+[189] = { 5, TN, SEN(putpmsg), "putpmsg" },
+[190] = { 0, TP, SEN(vfork), "vfork" },
+[191] = { 2, 0, SEN(getrlimit), "ugetrlimit" },
+[192] = { 6, TD|TM|SI, SEN(mmap_pgoff), "mmap2" },
+[193] = { 3, TF, SEN(truncate64), "truncate64" },
+[194] = { 3, TD, SEN(ftruncate64), "ftruncate64" },
+[195] = { 2, TF|TST|TSTA, SEN(stat64), "stat64" },
+[196] = { 2, TF|TLST|TSTA, SEN(lstat64), "lstat64" },
+[197] = { 2, TD|TFST|TSTA, SEN(fstat64), "fstat64" },
+[198] = { 3, TF, SEN(chown), "lchown32" },
+[199] = { 0, TC|PU|NF, SEN(getuid), "getuid32" },
+[200] = { 0, TC|PU|NF, SEN(getgid), "getgid32" },
+[201] = { 0, TC|PU|NF, SEN(geteuid), "geteuid32" },
+[202] = { 0, TC|PU|NF, SEN(getegid), "getegid32" },
+[203] = { 2, TC, SEN(setreuid), "setreuid32" },
+[204] = { 2, TC, SEN(setregid), "setregid32" },
+[205] = { 2, TC, SEN(getgroups), "getgroups32" },
+[206] = { 2, TC, SEN(setgroups), "setgroups32" },
+[207] = { 3, TD, SEN(fchown), "fchown32" },
+[208] = { 3, TC, SEN(setresuid), "setresuid32" },
+[209] = { 3, TC, SEN(getresuid), "getresuid32" },
+[210] = { 3, TC, SEN(setresgid), "setresgid32" },
+[211] = { 3, TC, SEN(getresgid), "getresgid32" },
+[212] = { 3, TF, SEN(chown), "chown32" },
+[213] = { 1, TC, SEN(setuid), "setuid32" },
+[214] = { 1, TC, SEN(setgid), "setgid32" },
+[215] = { 1, TC|NF, SEN(setfsuid), "setfsuid32" },
+[216] = { 1, TC|NF, SEN(setfsgid), "setfsgid32" },
+[217] = { 2, TF, SEN(pivotroot), "pivot_root" },
+[218] = { 3, TM, SEN(mincore), "mincore" },
+[219] = { 3, TM, SEN(madvise), "madvise" },
+[220] = { 3, TD, SEN(getdents64), "getdents64" },
+[221] = { 3, TD, SEN(fcntl64), "fcntl64" },
+[222 ... 223] = { },
+[224] = { 0, PU|NF, SEN(gettid), "gettid" },
+[225] = { 4, TD, SEN(readahead), "readahead" },
+[226] = { 5, TF, SEN(setxattr), "setxattr" },
+[227] = { 5, TF, SEN(setxattr), "lsetxattr" },
+[228] = { 5, TD, SEN(fsetxattr), "fsetxattr" },
+[229] = { 4, TF, SEN(getxattr), "getxattr" },
+[230] = { 4, TF, SEN(getxattr), "lgetxattr" },
+[231] = { 4, TD, SEN(fgetxattr), "fgetxattr" },
+[232] = { 3, TF, SEN(listxattr), "listxattr" },
+[233] = { 3, TF, SEN(listxattr), "llistxattr" },
+[234] = { 3, TD, SEN(flistxattr), "flistxattr" },
+[235] = { 2, TF, SEN(removexattr), "removexattr" },
+[236] = { 2, TF, SEN(removexattr), "lremovexattr" },
+[237] = { 2, TD, SEN(fremovexattr), "fremovexattr" },
+[238] = { 2, TS|TP, SEN(tkill), "tkill" },
+[239] = { 4, TD|TN, SEN(sendfile64), "sendfile64" },
+[240] = { 6, 0, SEN(futex_time32), "futex" },
+[241] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" },
+[242] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" },
+[243] = { 1, 0, SEN(set_thread_area), "set_thread_area" },
+[244] = { 1, 0, SEN(get_thread_area), "get_thread_area" },
+[245] = { 2, TM, SEN(io_setup), "io_setup" },
+[246] = { 1, TM, SEN(io_destroy), "io_destroy" },
+[247] = { 5, 0, SEN(io_getevents_time32), "io_getevents" },
+[248] = { 3, 0, SEN(io_submit), "io_submit" },
+[249] = { 3, 0, SEN(io_cancel), "io_cancel" },
+[250] = { 5, TD, SEN(fadvise64), "fadvise64" },
+[251] = { }, /* sys_set_zone_reclaim */
+[252] = { 1, TP|SE, SEN(exit), "exit_group" },
+[253] = { 4, 0, SEN(lookup_dcookie), "lookup_dcookie" },
+[254] = { 1, TD, SEN(epoll_create), "epoll_create" },
+[255] = { 4, TD, SEN(epoll_ctl), "epoll_ctl" },
+[256] = { 4, TD, SEN(epoll_wait), "epoll_wait" },
+[257] = { 5, TM|SI, SEN(remap_file_pages), "remap_file_pages" },
+[258] = { 1, 0, SEN(set_tid_address), "set_tid_address" },
+[259] = { 3, 0, SEN(timer_create), "timer_create" },
+[260] = { 4, 0, SEN(timer_settime32), "timer_settime" },
+[261] = { 2, 0, SEN(timer_gettime32), "timer_gettime" },
+[262] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" },
+[263] = { 1, 0, SEN(timer_delete), "timer_delete" },
+[264] = { 2, TCL, SEN(clock_settime32), "clock_settime" },
+[265] = { 2, TCL, SEN(clock_gettime32), "clock_gettime" },
+[266] = { 2, TCL, SEN(clock_getres_time32), "clock_getres" },
+[267] = { 4, 0, SEN(clock_nanosleep_time32), "clock_nanosleep" },
+[268] = { 3, TF|TSF|TSFA, SEN(statfs64), "statfs64" },
+[269] = { 3, TD|TFSF|TSFA, SEN(fstatfs64), "fstatfs64" },
+[270] = { 3, TS|TP, SEN(tgkill), "tgkill" },
+[271] = { 2, TF, SEN(utimes), "utimes" },
+[272] = { 6, TD, SEN(fadvise64_64), "fadvise64_64" },
+[273] = { 5, 0, SEN(vserver), "vserver" },
+[274] = { 6, TM, SEN(mbind), "mbind" },
+[275] = { 5, TM, SEN(get_mempolicy), "get_mempolicy" },
+[276] = { 3, TM, SEN(set_mempolicy), "set_mempolicy" },
+[277] = { 4, TD, SEN(mq_open), "mq_open" },
+[278] = { 1, 0, SEN(mq_unlink), "mq_unlink" },
+[279] = { 5, TD, SEN(mq_timedsend_time32), "mq_timedsend" },
+[280] = { 5, TD, SEN(mq_timedreceive_time32), "mq_timedreceive" },
+[281] = { 2, TD, SEN(mq_notify), "mq_notify" },
+[282] = { 3, TD, SEN(mq_getsetattr), "mq_getsetattr" },
+[283] = { 4, 0, SEN(kexec_load), "kexec_load" },
+[284] = { 5, TP, SEN(waitid), "waitid" },
+[285] = { }, /* sys_setaltroot */
+[286] = { 5, 0, SEN(add_key), "add_key" },
+[287] = { 4, 0, SEN(request_key), "request_key" },
+[288] = { 5, 0, SEN(keyctl), "keyctl" },
+[289] = { 3, 0, SEN(ioprio_set), "ioprio_set" },
+[290] = { 2, 0, SEN(ioprio_get), "ioprio_get" },
+[291] = { 0, TD, SEN(inotify_init), "inotify_init" },
+[292] = { 3, TD|TF, SEN(inotify_add_watch), "inotify_add_watch" },
+[293] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" },
+[294] = { 4, TM, SEN(migrate_pages), "migrate_pages" },
+[295] = { 4, TD|TF, SEN(openat), "openat" },
+[296] = { 3, TD|TF, SEN(mkdirat), "mkdirat" },
+[297] = { 4, TD|TF, SEN(mknodat), "mknodat" },
+[298] = { 5, TD|TF, SEN(fchownat), "fchownat" },
+[299] = { 3, TD|TF, SEN(futimesat), "futimesat" },
+[300] = { 4, TD|TF|TFST|TSTA,SEN(fstatat64), "fstatat64" },
+[301] = { 3, TD|TF, SEN(unlinkat), "unlinkat" },
+[302] = { 4, TD|TF, SEN(renameat), "renameat" },
+[303] = { 5, TD|TF, SEN(linkat), "linkat" },
+[304] = { 3, TD|TF, SEN(symlinkat), "symlinkat" },
+[305] = { 4, TD|TF, SEN(readlinkat), "readlinkat" },
+[306] = { 3, TD|TF, SEN(fchmodat), "fchmodat" },
+[307] = { 3, TD|TF, SEN(faccessat), "faccessat" },
+[308] = { 6, TD, SEN(pselect6_time32), "pselect6" },
+[309] = { 5, TD, SEN(ppoll_time32), "ppoll" },
+[310] = { 1, 0, SEN(unshare), "unshare" },
+[311] = { 2, 0, SEN(set_robust_list), "set_robust_list" },
+[312] = { 3, 0, SEN(get_robust_list), "get_robust_list" },
+[313] = { 6, TD, SEN(splice), "splice" },
+[314] = { 6, TD, SEN(sync_file_range), "sync_file_range" },
+[315] = { 4, TD, SEN(tee), "tee" },
+[316] = { 4, TD, SEN(vmsplice), "vmsplice" },
+[317] = { 6, TM, SEN(move_pages), "move_pages" },
+[318] = { 3, 0, SEN(getcpu), "getcpu" },
+[319] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" },
+[320] = { 4, TD|TF, SEN(utimensat_time32), "utimensat" },
+[321] = { 3, TD|TS, SEN(signalfd), "signalfd" },
+[322] = { 2, TD, SEN(timerfd_create), "timerfd_create" },
+[323] = { 1, TD, SEN(eventfd), "eventfd" },
+[324] = { 6, TD, SEN(fallocate), "fallocate" },
+[325] = { 4, TD, SEN(timerfd_settime32), "timerfd_settime" },
+[326] = { 2, TD, SEN(timerfd_gettime32), "timerfd_gettime" },
+[327] = { 4, TD|TS, SEN(signalfd4), "signalfd4" },
+[328] = { 2, TD, SEN(eventfd2), "eventfd2" },
+[329] = { 1, TD, SEN(epoll_create1), "epoll_create1" },
+[330] = { 3, TD, SEN(dup3), "dup3" },
+[331] = { 2, TD, SEN(pipe2), "pipe2" },
+[332] = { 1, TD, SEN(inotify_init1), "inotify_init1" },
+[333] = { 5, TD, SEN(preadv), "preadv" },
+[334] = { 5, TD, SEN(pwritev), "pwritev" },
+[335] = { 4, TP|TS, SEN(rt_tgsigqueueinfo), "rt_tgsigqueueinfo" },
+[336] = { 5, TD, SEN(perf_event_open), "perf_event_open" },
+[337] = { 5, TN, SEN(recvmmsg_time32), "recvmmsg" },
+[338] = { 2, TD, SEN(fanotify_init), "fanotify_init" },
+[339] = { 6, TD|TF, SEN(fanotify_mark), "fanotify_mark" },
+[340] = { 4, 0, SEN(prlimit64), "prlimit64" },
+[341] = { 5, TD|TF, SEN(name_to_handle_at), "name_to_handle_at" },
+[342] = { 3, TD, SEN(open_by_handle_at), "open_by_handle_at" },
+[343] = { 2, TCL, SEN(clock_adjtime32), "clock_adjtime" },
+[344] = { 1, TD, SEN(syncfs), "syncfs" },
+[345] = { 4, TN, SEN(sendmmsg), "sendmmsg" },
+[346] = { 2, TD, SEN(setns), "setns" },
+[347] = { 6, 0, SEN(process_vm_readv), "process_vm_readv" },
+[348] = { 6, 0, SEN(process_vm_writev), "process_vm_writev" },
+[349] = { 5, 0, SEN(kcmp), "kcmp" },
+[350] = { 3, TD, SEN(finit_module), "finit_module" },
+[351] = { 3, 0, SEN(sched_setattr), "sched_setattr" },
+[352] = { 4, 0, SEN(sched_getattr), "sched_getattr" },
+[353] = { 5, TD|TF, SEN(renameat2), "renameat2" },
+[354] = { 3, 0, SEN(seccomp), "seccomp" },
+[355] = { 3, 0, SEN(getrandom), "getrandom" },
+[356] = { 2, TD, SEN(memfd_create), "memfd_create" },
+[357] = { 3, TD, SEN(bpf), "bpf" },
+[358] = { 5, TD|TF|TP|TSD|SE|SI, SEN(execveat), "execveat" },
+[359] = { 3, TN, SEN(socket), "socket" },
+[360] = { 4, TN, SEN(socketpair), "socketpair" },
+[361] = { 3, TN, SEN(bind), "bind" },
+[362] = { 3, TN, SEN(connect), "connect" },
+[363] = { 2, TN, SEN(listen), "listen" },
+[364] = { 4, TN, SEN(accept4), "accept4" },
+[365] = { 5, TN, SEN(getsockopt), "getsockopt" },
+[366] = { 5, TN, SEN(setsockopt), "setsockopt" },
+[367] = { 3, TN, SEN(getsockname), "getsockname" },
+[368] = { 3, TN, SEN(getpeername), "getpeername" },
+[369] = { 6, TN, SEN(sendto), "sendto" },
+[370] = { 3, TN, SEN(sendmsg), "sendmsg" },
+[371] = { 6, TN, SEN(recvfrom), "recvfrom" },
+[372] = { 3, TN, SEN(recvmsg), "recvmsg" },
+[373] = { 2, TN, SEN(shutdown), "shutdown" },
+[374] = { 1, TD, SEN(userfaultfd), "userfaultfd" },
+[375] = { 3, 0, SEN(membarrier), "membarrier" },
+[376] = { 3, TM, SEN(mlock2), "mlock2" },
+[377] = { 6, TD, SEN(copy_file_range), "copy_file_range" },
+[378] = { 6, TD, SEN(preadv2), "preadv2" },
+[379] = { 6, TD, SEN(pwritev2), "pwritev2" },
+[380] = { 4, TM|SI, SEN(pkey_mprotect), "pkey_mprotect" },
+[381] = { 2, 0, SEN(pkey_alloc), "pkey_alloc" },
+[382] = { 1, 0, SEN(pkey_free), "pkey_free" },
+[383] = { 5, TD|TF|TFST|TSTA,SEN(statx), "statx" },
+[384] = { 2, 0, SEN(arch_prctl), "arch_prctl" },
+[385] = { 6, 0, SEN(io_pgetevents_time32), "io_pgetevents" },
+[386] = { 4, 0, SEN(rseq), "rseq" },
+/* room for arch specific calls */
+[393] = { 3, TI, SEN(semget), "semget" },
+[394] = { 4, TI, SEN(semctl), "semctl" },
+[395] = { 3, TI, SEN(shmget), "shmget" },
+[396] = { 3, TI, SEN(shmctl), "shmctl" },
+[397] = { 3, TI|TM|SI, SEN(shmat), "shmat" },
+[398] = { 1, TI|TM|SI, SEN(shmdt), "shmdt" },
+[399] = { 2, TI, SEN(msgget), "msgget" },
+[400] = { 4, TI, SEN(msgsnd), "msgsnd" },
+[401] = { 5, TI, SEN(msgrcv), "msgrcv" },
+[402] = { 3, TI, SEN(msgctl), "msgctl" },
+#include "syscallent-common-32.h"
+#include "syscallent-common.h"
+
+#define SYS_socket_subcall 500
+#include "subcall32.h"
diff --git a/src/linux/i386/userent.h b/src/linux/i386/userent.h
new file mode 100644
index 000000000..bdbefd8c8
--- /dev/null
+++ b/src/linux/i386/userent.h
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2014-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+XLAT(4*EBX),
+XLAT(4*ECX),
+XLAT(4*EDX),
+XLAT(4*ESI),
+XLAT(4*EDI),
+XLAT(4*EBP),
+XLAT(4*EAX),
+XLAT(4*DS),
+XLAT(4*ES),
+XLAT(4*FS),
+XLAT(4*GS),
+XLAT(4*ORIG_EAX),
+XLAT(4*EIP),
+XLAT(4*CS),
+XLAT(4*EFL),
+XLAT(4*UESP),
+XLAT(4*SS),
+/* Other fields in "struct user" */
+#include "userent0.h"
diff --git a/src/linux/i386/userent0.h b/src/linux/i386/userent0.h
new file mode 100644
index 000000000..da7d4440e
--- /dev/null
+++ b/src/linux/i386/userent0.h
@@ -0,0 +1,22 @@
+/*
+ * Copyright (c) 2014-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+XLAT_UOFF(u_fpvalid),
+XLAT_UOFF(i387),
+XLAT_UOFF(u_tsize),
+XLAT_UOFF(u_dsize),
+XLAT_UOFF(u_ssize),
+XLAT_UOFF(start_code),
+XLAT_UOFF(start_stack),
+XLAT_UOFF(signal),
+XLAT_UOFF(reserved),
+XLAT_UOFF(u_ar0),
+XLAT_UOFF(u_fpstate),
+XLAT_UOFF(magic),
+XLAT_UOFF(u_comm),
+XLAT_UOFF(u_debugreg),
+#include "../userent0.h"
diff --git a/src/linux/ia64/arch_defs_.h b/src/linux/ia64/arch_defs_.h
new file mode 100644
index 000000000..107a74df2
--- /dev/null
+++ b/src/linux/ia64/arch_defs_.h
@@ -0,0 +1,12 @@
+/*
+ * Copyright (c) 2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#define HAVE_ARCH_GETRVAL2 1
+#define HAVE_ARCH_UID16_SYSCALLS 1
+#define HAVE_ARCH_SA_RESTORER 0
+#define HAVE_ARCH_DEDICATED_ERR_REG 1
+#define PERSONALITY0_AUDIT_ARCH { AUDIT_ARCH_IA64, SYSCALLENT_BASE_NR }
diff --git a/src/linux/ia64/arch_getrval2.c b/src/linux/ia64/arch_getrval2.c
new file mode 100644
index 000000000..c518b607c
--- /dev/null
+++ b/src/linux/ia64/arch_getrval2.c
@@ -0,0 +1,14 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+long
+getrval2(struct tcb *tcp)
+{
+ if (ptrace_syscall_info_is_valid() && get_regs(tcp) < 0)
+ return -1;
+ return ia64_regs.gr[9];
+}
diff --git a/src/linux/ia64/arch_regs.c b/src/linux/ia64/arch_regs.c
new file mode 100644
index 000000000..9d539da5a
--- /dev/null
+++ b/src/linux/ia64/arch_regs.c
@@ -0,0 +1,12 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static struct pt_all_user_regs ia64_regs;
+
+#define ARCH_REGS_FOR_GETREGS ia64_regs
+#define ARCH_PC_REG ia64_regs.br[0]
+#define ARCH_SP_REG ia64_regs.gr[12]
diff --git a/src/linux/ia64/arch_regs.h b/src/linux/ia64/arch_regs.h
new file mode 100644
index 000000000..2dcdc4148
--- /dev/null
+++ b/src/linux/ia64/arch_regs.h
@@ -0,0 +1 @@
+#include <asm/ptrace_offsets.h>
diff --git a/src/linux/ia64/arch_rt_sigframe.c b/src/linux/ia64/arch_rt_sigframe.c
new file mode 100644
index 000000000..5a36d2024
--- /dev/null
+++ b/src/linux/ia64/arch_rt_sigframe.c
@@ -0,0 +1,12 @@
+/*
+ * Copyright (c) 2017-2018 Dmitry V. Levin <ldv@strace.io>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+FUNC_GET_RT_SIGFRAME_ADDR
+{
+ kernel_ulong_t sp;
+ return get_stack_pointer(tcp, &sp) ? sp + 16 : 0;
+}
diff --git a/src/linux/ia64/get_error.c b/src/linux/ia64/get_error.c
new file mode 100644
index 000000000..ce196bce1
--- /dev/null
+++ b/src/linux/ia64/get_error.c
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "negated_errno.h"
+
+static void
+arch_get_error(struct tcb *tcp, const bool check_errno)
+{
+ if (ia64_regs.gr[10]) {
+ tcp->u_rval = -1;
+ tcp->u_error = ia64_regs.gr[8];
+ } else {
+ tcp->u_rval = ia64_regs.gr[8];
+ }
+}
diff --git a/src/linux/ia64/get_scno.c b/src/linux/ia64/get_scno.c
new file mode 100644
index 000000000..6aba4097b
--- /dev/null
+++ b/src/linux/ia64/get_scno.c
@@ -0,0 +1,14 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+/* Return codes: 1 - ok, 0 - ignore, other - error. */
+static int
+arch_get_scno(struct tcb *tcp)
+{
+ tcp->scno = ia64_regs.gr[15];
+ return 1;
+}
diff --git a/src/linux/ia64/get_syscall_args.c b/src/linux/ia64/get_syscall_args.c
new file mode 100644
index 000000000..83a933eb5
--- /dev/null
+++ b/src/linux/ia64/get_syscall_args.c
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2015-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include <asm/rse.h>
+
+/* Return -1 on error or 1 on success (never 0!). */
+static int
+arch_get_syscall_args(struct tcb *tcp)
+{
+ unsigned long *rbs_end =
+ (unsigned long *) ia64_regs.ar[PT_AUR_BSP];
+ unsigned long sof = (ia64_regs.cfm >> 0) & 0x7f;
+ unsigned long sol = (ia64_regs.cfm >> 7) & 0x7f;
+ unsigned long *out0 = ia64_rse_skip_regs(rbs_end, -sof + sol);
+ unsigned int i;
+
+ for (i = 0; i < n_args(tcp); ++i) {
+ if (umove(tcp,
+ (unsigned long) ia64_rse_skip_regs(out0, i),
+ &tcp->u_arg[i]) < 0) {
+ if (errno == EPERM)
+ tcp->u_arg[i] = 0;
+ else
+ return -1;
+ }
+ }
+
+ return 1;
+}
diff --git a/src/linux/ia64/ioctls_arch0.h b/src/linux/ia64/ioctls_arch0.h
new file mode 100644
index 000000000..455b9dee6
--- /dev/null
+++ b/src/linux/ia64/ioctls_arch0.h
@@ -0,0 +1 @@
+/* Generated by ioctls_gen.sh from definitions found in $linux/arch/ia64/include/ tree. */
diff --git a/src/linux/ia64/ioctls_inc0.h b/src/linux/ia64/ioctls_inc0.h
new file mode 100644
index 000000000..f9939faa4
--- /dev/null
+++ b/src/linux/ia64/ioctls_inc0.h
@@ -0,0 +1 @@
+#include "64/ioctls_inc.h"
diff --git a/src/linux/ia64/raw_syscall.h b/src/linux/ia64/raw_syscall.h
new file mode 100644
index 000000000..1e1f540fe
--- /dev/null
+++ b/src/linux/ia64/raw_syscall.h
@@ -0,0 +1,41 @@
+/*
+ * Raw syscalls.
+ *
+ * Copyright (c) 2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_RAW_SYSCALL_H
+# define STRACE_RAW_SYSCALL_H
+
+# include "kernel_types.h"
+
+static inline kernel_ulong_t
+raw_syscall_0(const kernel_ulong_t nr, kernel_ulong_t *err)
+{
+ register kernel_ulong_t r15 __asm__("r15") = nr;
+ register kernel_ulong_t r8 __asm__("r8");
+ register kernel_ulong_t r10 __asm__("r10");
+ __asm__ __volatile__("break 0x100000"
+ : "=r"(r8), "=r"(r10), "+r"(r15)
+ :
+ : "memory", "out0", "out1", "out2",
+ "out3", "out4", "out5", "out6", "out7",
+ "r2", "r3", "r9", "r11", "r13",
+ "r14", "r16", "r17", "r18", "r19", "r20",
+ "r21", "r22", "r23", "r24", "r25", "r26",
+ "r27", "r28", "r29", "r30", "r31",
+ "p6", "p7", "p8", "p9", "p10",
+ "p11", "p12", "p13", "p14", "p15",
+ "f6", "f7", "f8", "f9", "f10",
+ "f11", "f12", "f13", "f14", "f15",
+ "f5", "f6", "f7", "f8", "f9", "f10", "f11",
+ "b6", "b7");
+ *err = !!r10;
+ return r8;
+}
+# define raw_syscall_0 raw_syscall_0
+
+#endif /* !STRACE_RAW_SYSCALL_H */
diff --git a/src/linux/ia64/rt_sigframe.h b/src/linux/ia64/rt_sigframe.h
new file mode 100644
index 000000000..15c0ea60d
--- /dev/null
+++ b/src/linux/ia64/rt_sigframe.h
@@ -0,0 +1,25 @@
+/*
+ * Copyright (c) 2017-2018 Dmitry V. Levin <ldv@strace.io>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_RT_SIGFRAME_H
+# define STRACE_RT_SIGFRAME_H
+
+# include <signal.h>
+
+typedef struct {
+ unsigned long arg0;
+ unsigned long arg1;
+ unsigned long arg2;
+ void *handler;
+ siginfo_t info;
+ struct sigcontext sc;
+} struct_rt_sigframe;
+
+# define OFFSETOF_SIGMASK_IN_RT_SIGFRAME \
+ offsetof(struct_rt_sigframe, sc.sc_mask)
+
+#endif /* !STRACE_RT_SIGFRAME_H */
diff --git a/src/linux/ia64/set_error.c b/src/linux/ia64/set_error.c
new file mode 100644
index 000000000..b27154e13
--- /dev/null
+++ b/src/linux/ia64/set_error.c
@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2016-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static int
+arch_set_error(struct tcb *tcp)
+{
+ ia64_regs.gr[8] = tcp->u_error;
+ ia64_regs.gr[10] = -1;
+
+ return set_regs(tcp->pid);
+}
+
+static int
+arch_set_success(struct tcb *tcp)
+{
+ ia64_regs.gr[8] = tcp->u_rval;
+ ia64_regs.gr[10] = 0;
+
+ return set_regs(tcp->pid);
+}
diff --git a/src/linux/ia64/set_scno.c b/src/linux/ia64/set_scno.c
new file mode 100644
index 000000000..c68c4cd8f
--- /dev/null
+++ b/src/linux/ia64/set_scno.c
@@ -0,0 +1,15 @@
+/*
+ * Copyright (c) 2016-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static int
+arch_set_scno(struct tcb *tcp, kernel_ulong_t scno)
+{
+ if (ptrace_syscall_info_is_valid() && get_regs(tcp) < 0)
+ return -1;
+ ia64_regs.gr[15] = scno;
+ return set_regs(tcp->pid);
+}
diff --git a/src/linux/ia64/shuffle_scno.c b/src/linux/ia64/shuffle_scno.c
new file mode 100644
index 000000000..6bac3a8b7
--- /dev/null
+++ b/src/linux/ia64/shuffle_scno.c
@@ -0,0 +1,11 @@
+static_assert(!(SYSCALLENT_BASE_NR & (SYSCALLENT_BASE_NR - 1)),
+ "SYSCALLENT_BASE_NR is not a power of 2 (or zero)");
+static_assert(nsyscalls0 < SYSCALLENT_BASE_NR,
+ "syscall table is too big, "
+ "shuffling will only make everything worse");
+
+kernel_ulong_t
+shuffle_scno(kernel_ulong_t scno)
+{
+ return scno ^ SYSCALLENT_BASE_NR;
+}
diff --git a/src/linux/ia64/syscallent.h b/src/linux/ia64/syscallent.h
new file mode 100644
index 000000000..7affb9730
--- /dev/null
+++ b/src/linux/ia64/syscallent.h
@@ -0,0 +1,359 @@
+/*
+ * Copyright (c) 1999, 2001 Hewlett-Packard Co
+ * David Mosberger-Tang <davidm@hpl.hp.com>
+ * Copyright (c) 2000-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifdef SYSCALLENT_BASE_NR
+/*
+ * The syscallent table starts from 0 because
+ * it is optimized for use with shuffle_scno.
+ */
+# define BASE_NR 0
+#else
+/*
+ * __NR_* constants start from 1024 as usual.
+ * (1U << 10) cannot be used here because SCNO_SED is not smart enough.
+ */
+# define BASE_NR 1024
+#endif
+[BASE_NR + 0] = { 0, 0, SEN(printargs), "ni_syscall" },
+[BASE_NR + 1] = { 1, TP|SE, SEN(exit), "exit" },
+[BASE_NR + 2] = { 3, TD, SEN(read), "read" },
+[BASE_NR + 3] = { 3, TD, SEN(write), "write" },
+[BASE_NR + 4] = { 3, TD|TF, SEN(open), "open" },
+[BASE_NR + 5] = { 1, TD, SEN(close), "close" },
+[BASE_NR + 6] = { 2, TD|TF, SEN(creat), "creat" },
+[BASE_NR + 7] = { 2, TF, SEN(link), "link" },
+[BASE_NR + 8] = { 1, TF, SEN(unlink), "unlink" },
+[BASE_NR + 9] = { 3, TF|TP|TSD|SE|SI, SEN(execve), "execve" },
+[BASE_NR + 10] = { 1, TF, SEN(chdir), "chdir" },
+[BASE_NR + 11] = { 1, TD, SEN(fchdir), "fchdir" },
+[BASE_NR + 12] = { 2, TF, SEN(utimes), "utimes" },
+[BASE_NR + 13] = { 3, TF, SEN(mknod), "mknod" },
+[BASE_NR + 14] = { 2, TF, SEN(chmod), "chmod" },
+[BASE_NR + 15] = { 3, TF, SEN(chown), "chown" },
+[BASE_NR + 16] = { 3, TD, SEN(lseek), "lseek" },
+[BASE_NR + 17] = { 0, PU|NF, SEN(getpid), "getpid" },
+[BASE_NR + 18] = { 0, PU|NF, SEN(getppid), "getppid" },
+[BASE_NR + 19] = { 5, TF, SEN(mount), "mount" },
+[BASE_NR + 20] = { 2, TF, SEN(umount2), "umount" },
+[BASE_NR + 21] = { 1, TC, SEN(setuid), "setuid" },
+[BASE_NR + 22] = { 0, TC|PU|NF, SEN(getuid), "getuid" },
+[BASE_NR + 23] = { 0, TC|PU|NF, SEN(geteuid), "geteuid" },
+[BASE_NR + 24] = { 4, 0, SEN(ptrace), "ptrace" },
+[BASE_NR + 25] = { 2, TF, SEN(access), "access" },
+[BASE_NR + 26] = { 0, 0, SEN(sync), "sync" },
+[BASE_NR + 27] = { 1, TD, SEN(fsync), "fsync" },
+[BASE_NR + 28] = { 1, TD, SEN(fdatasync), "fdatasync" },
+[BASE_NR + 29] = { 2, TS|TP, SEN(kill), "kill" },
+[BASE_NR + 30] = { 2, TF, SEN(rename), "rename" },
+[BASE_NR + 31] = { 2, TF, SEN(mkdir), "mkdir" },
+[BASE_NR + 32] = { 1, TF, SEN(rmdir), "rmdir" },
+[BASE_NR + 33] = { 1, TD, SEN(dup), "dup" },
+[BASE_NR + 34] = { 0, TD, SEN(pipe), "pipe" },
+[BASE_NR + 35] = { 1, 0, SEN(times), "times" },
+[BASE_NR + 36] = { 1, TM|SI, SEN(brk), "brk" },
+[BASE_NR + 37] = { 1, TC, SEN(setgid), "setgid" },
+[BASE_NR + 38] = { 0, TC|PU|NF, SEN(getgid), "getgid" },
+[BASE_NR + 39] = { 0, TC|PU|NF, SEN(getegid), "getegid" },
+[BASE_NR + 40] = { 1, TF, SEN(acct), "acct" },
+[BASE_NR + 41] = { 3, TD, SEN(ioctl), "ioctl" },
+[BASE_NR + 42] = { 3, TD, SEN(fcntl), "fcntl" },
+[BASE_NR + 43] = { 1, NF, SEN(umask), "umask" },
+[BASE_NR + 44] = { 1, TF, SEN(chroot), "chroot" },
+[BASE_NR + 45] = { 2, TSFA, SEN(ustat), "ustat" },
+[BASE_NR + 46] = { 2, TD, SEN(dup2), "dup2" },
+[BASE_NR + 47] = { 2, TC, SEN(setreuid), "setreuid" },
+[BASE_NR + 48] = { 2, TC, SEN(setregid), "setregid" },
+[BASE_NR + 49] = { 3, TC, SEN(getresuid), "getresuid" },
+[BASE_NR + 50] = { 3, TC, SEN(setresuid), "setresuid" },
+[BASE_NR + 51] = { 3, TC, SEN(getresgid), "getresgid" },
+[BASE_NR + 52] = { 3, TC, SEN(setresgid), "setresgid" },
+[BASE_NR + 53] = { 2, TC, SEN(getgroups), "getgroups" },
+[BASE_NR + 54] = { 2, TC, SEN(setgroups), "setgroups" },
+[BASE_NR + 55] = { 1, 0, SEN(getpgid), "getpgid" },
+[BASE_NR + 56] = { 2, 0, SEN(setpgid), "setpgid" },
+[BASE_NR + 57] = { 0, 0, SEN(setsid), "setsid" },
+[BASE_NR + 58] = { 1, 0, SEN(getsid), "getsid" },
+[BASE_NR + 59] = { 2, 0, SEN(sethostname), "sethostname" },
+[BASE_NR + 60] = { 2, 0, SEN(setrlimit), "setrlimit" },
+[BASE_NR + 61] = { 2, 0, SEN(getrlimit), "getrlimit" },
+[BASE_NR + 62] = { 2, 0, SEN(getrusage), "getrusage" },
+[BASE_NR + 63] = { 2, TCL, SEN(gettimeofday), "gettimeofday" },
+[BASE_NR + 64] = { 2, TCL, SEN(settimeofday), "settimeofday" },
+[BASE_NR + 65] = { 5, TD, SEN(select), "select" },
+[BASE_NR + 66] = { 3, TD, SEN(poll_time64), "poll" },
+[BASE_NR + 67] = { 2, TF, SEN(symlink), "symlink" },
+[BASE_NR + 68] = { 3, TF, SEN(readlink), "readlink" },
+[BASE_NR + 69] = { 1, TF, SEN(uselib), "uselib" },
+[BASE_NR + 70] = { 2, TF, SEN(swapon), "swapon" },
+[BASE_NR + 71] = { 1, TF, SEN(swapoff), "swapoff" },
+[BASE_NR + 72] = { 4, 0, SEN(reboot), "reboot" },
+[BASE_NR + 73] = { 2, TF, SEN(truncate), "truncate" },
+[BASE_NR + 74] = { 2, TD, SEN(ftruncate), "ftruncate" },
+[BASE_NR + 75] = { 2, TD, SEN(fchmod), "fchmod" },
+[BASE_NR + 76] = { 3, TD, SEN(fchown), "fchown" },
+[BASE_NR + 77] = { 2, 0, SEN(getpriority), "getpriority" },
+[BASE_NR + 78] = { 3, 0, SEN(setpriority), "setpriority" },
+[BASE_NR + 79] = { 2, TF|TSF|TSFA, SEN(statfs), "statfs" },
+[BASE_NR + 80] = { 2, TD|TFSF|TSFA, SEN(fstatfs), "fstatfs" },
+[BASE_NR + 81] = { 0, PU|NF, SEN(gettid), "gettid" },
+[BASE_NR + 82] = { 3, TI, SEN(semget), "semget" },
+[BASE_NR + 83] = { 3, TI, SEN(semop), "semop" },
+[BASE_NR + 84] = { 4, TI, SEN(semctl), "semctl" },
+[BASE_NR + 85] = { 2, TI, SEN(msgget), "msgget" },
+[BASE_NR + 86] = { 4, TI, SEN(msgsnd), "msgsnd" },
+[BASE_NR + 87] = { 5, TI, SEN(msgrcv), "msgrcv" },
+[BASE_NR + 88] = { 3, TI, SEN(msgctl), "msgctl" },
+[BASE_NR + 89] = { 3, TI, SEN(shmget), "shmget" },
+[BASE_NR + 90] = { 3, TI|TM|SI, SEN(shmat), "shmat" },
+[BASE_NR + 91] = { 1, TI|TM|SI, SEN(shmdt), "shmdt" },
+[BASE_NR + 92] = { 3, TI, SEN(shmctl), "shmctl" },
+[BASE_NR + 93] = { 3, 0, SEN(syslog), "syslog" },
+[BASE_NR + 94] = { 3, 0, SEN(setitimer), "setitimer" },
+[BASE_NR + 95] = { 2, 0, SEN(getitimer), "getitimer" },
+[BASE_NR + 96] = { 2, TF|TST|TSTA, SEN(stat), "stat" },
+[BASE_NR + 97] = { 2, TF|TLST|TSTA, SEN(lstat), "lstat" },
+[BASE_NR + 98] = { 2, TD|TFST|TSTA, SEN(fstat), "fstat" },
+[BASE_NR + 99] = { 0, 0, SEN(vhangup), "vhangup" },
+[BASE_NR + 100] = { 3, TF, SEN(chown), "lchown" },
+[BASE_NR + 101] = { 5, TM|SI, SEN(remap_file_pages), "remap_file_pages" },
+[BASE_NR + 102] = { 4, TP, SEN(wait4), "wait4" },
+[BASE_NR + 103] = { 1, 0, SEN(sysinfo), "sysinfo" },
+[BASE_NR + 104] = { 5, TP, SEN(clone), "clone" },
+[BASE_NR + 105] = { 2, 0, SEN(setdomainname), "setdomainname" },
+[BASE_NR + 106] = { 1, 0, SEN(uname), "uname" },
+[BASE_NR + 107] = { 1, TCL, SEN(adjtimex64), "adjtimex" },
+[BASE_NR + 108] = { 2, 0, SEN(create_module), "create_module" },
+[BASE_NR + 109] = { 3, 0, SEN(init_module), "init_module" },
+[BASE_NR + 110] = { 2, 0, SEN(delete_module), "delete_module" },
+[BASE_NR + 111] = { 1, 0, SEN(get_kernel_syms), "get_kernel_syms" },
+[BASE_NR + 112] = { 5, 0, SEN(query_module), "query_module" },
+[BASE_NR + 113] = { 4, TF, SEN(quotactl), "quotactl" },
+[BASE_NR + 114] = { 2, 0, SEN(bdflush), "bdflush" },
+[BASE_NR + 115] = { 3, 0, SEN(sysfs), "sysfs" },
+[BASE_NR + 116] = { 1, NF, SEN(personality), "personality" },
+[BASE_NR + 117] = { 5, 0, SEN(afs_syscall), "afs_syscall" },
+[BASE_NR + 118] = { 1, TC|NF, SEN(setfsuid), "setfsuid" },
+[BASE_NR + 119] = { 1, TC|NF, SEN(setfsgid), "setfsgid" },
+[BASE_NR + 120] = { 3, TD, SEN(getdents), "getdents" },
+[BASE_NR + 121] = { 2, TD, SEN(flock), "flock" },
+[BASE_NR + 122] = { 3, TD, SEN(readv), "readv" },
+[BASE_NR + 123] = { 3, TD, SEN(writev), "writev" },
+[BASE_NR + 124] = { 4, TD, SEN(pread), "pread64" },
+[BASE_NR + 125] = { 4, TD, SEN(pwrite), "pwrite64" },
+[BASE_NR + 126] = { 1, 0, SEN(printargs), "_sysctl" },
+[BASE_NR + 127] = { 6, TD|TM|SI, SEN(mmap), "mmap" },
+[BASE_NR + 128] = { 2, TM|SI, SEN(munmap), "munmap" },
+[BASE_NR + 129] = { 2, TM, SEN(mlock), "mlock" },
+[BASE_NR + 130] = { 1, TM, SEN(mlockall), "mlockall" },
+[BASE_NR + 131] = { 3, TM|SI, SEN(mprotect), "mprotect" },
+[BASE_NR + 132] = { 5, TM|SI, SEN(mremap), "mremap" },
+[BASE_NR + 133] = { 3, TM, SEN(msync), "msync" },
+[BASE_NR + 134] = { 2, TM, SEN(munlock), "munlock" },
+[BASE_NR + 135] = { 0, TM, SEN(munlockall), "munlockall" },
+[BASE_NR + 136] = { 2, 0, SEN(sched_getparam), "sched_getparam" },
+[BASE_NR + 137] = { 2, 0, SEN(sched_setparam), "sched_setparam" },
+[BASE_NR + 138] = { 1, 0, SEN(sched_getscheduler), "sched_getscheduler" },
+[BASE_NR + 139] = { 3, 0, SEN(sched_setscheduler), "sched_setscheduler" },
+[BASE_NR + 140] = { 0, 0, SEN(sched_yield), "sched_yield" },
+[BASE_NR + 141] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"},
+[BASE_NR + 142] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"},
+[BASE_NR + 143] = { 2, 0, SEN(sched_rr_get_interval_time64),"sched_rr_get_interval"},
+[BASE_NR + 144] = { 2, 0, SEN(nanosleep_time64), "nanosleep" },
+[BASE_NR + 145] = { 3, 0, SEN(nfsservctl), "nfsservctl" },
+[BASE_NR + 146] = { 5, TC, SEN(prctl), "prctl" },
+[BASE_NR + 147] = { 0, PU|NF, SEN(getpagesize), "old_getpagesize" },
+[BASE_NR + 148] = { 6, TD|TM|SI, SEN(mmap_pgoff), "mmap2" },
+[BASE_NR + 149] = { 5, 0, SEN(printargs), "pciconfig_read" },
+[BASE_NR + 150] = { 5, 0, SEN(printargs), "pciconfig_write" },
+[BASE_NR + 151] = { MA, 0, SEN(printargs), "perfmonctl" },
+[BASE_NR + 152] = { 2, TS, SEN(sigaltstack), "sigaltstack" },
+[BASE_NR + 153] = { 4, TS, SEN(rt_sigaction), "rt_sigaction" },
+[BASE_NR + 154] = { 2, TS, SEN(rt_sigpending), "rt_sigpending" },
+[BASE_NR + 155] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" },
+[BASE_NR + 156] = { 3, TS|TP, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" },
+[BASE_NR + 157] = { 0, TS, SEN(rt_sigreturn), "rt_sigreturn" },
+[BASE_NR + 158] = { 2, TS, SEN(rt_sigsuspend), "rt_sigsuspend" },
+[BASE_NR + 159] = { 4, TS, SEN(rt_sigtimedwait_time64), "rt_sigtimedwait" },
+[BASE_NR + 160] = { 2, TF, SEN(getcwd), "getcwd" },
+[BASE_NR + 161] = { 2, TC, SEN(capget), "capget" },
+[BASE_NR + 162] = { 2, TC, SEN(capset), "capset" },
+[BASE_NR + 163] = { 4, TD|TN, SEN(sendfile), "sendfile" },
+[BASE_NR + 164] = { 5, TN, SEN(getpmsg), "getpmsg" },
+[BASE_NR + 165] = { 5, TN, SEN(putpmsg), "putpmsg" },
+[BASE_NR + 166] = { 3, TN, SEN(socket), "socket" },
+[BASE_NR + 167] = { 3, TN, SEN(bind), "bind" },
+[BASE_NR + 168] = { 3, TN, SEN(connect), "connect" },
+[BASE_NR + 169] = { 2, TN, SEN(listen), "listen" },
+[BASE_NR + 170] = { 3, TN, SEN(accept), "accept" },
+[BASE_NR + 171] = { 3, TN, SEN(getsockname), "getsockname" },
+[BASE_NR + 172] = { 3, TN, SEN(getpeername), "getpeername" },
+[BASE_NR + 173] = { 4, TN, SEN(socketpair), "socketpair" },
+[BASE_NR + 174] = { 4, TN, SEN(send), "send" },
+[BASE_NR + 175] = { 6, TN, SEN(sendto), "sendto" },
+[BASE_NR + 176] = { 4, TN, SEN(recv), "recv" },
+[BASE_NR + 177] = { 6, TN, SEN(recvfrom), "recvfrom" },
+[BASE_NR + 178] = { 2, TN, SEN(shutdown), "shutdown" },
+[BASE_NR + 179] = { 5, TN, SEN(setsockopt), "setsockopt" },
+[BASE_NR + 180] = { 5, TN, SEN(getsockopt), "getsockopt" },
+[BASE_NR + 181] = { 3, TN, SEN(sendmsg), "sendmsg" },
+[BASE_NR + 182] = { 3, TN, SEN(recvmsg), "recvmsg" },
+[BASE_NR + 183] = { 2, TF, SEN(pivotroot), "pivot_root" },
+[BASE_NR + 184] = { 3, TM, SEN(mincore), "mincore" },
+[BASE_NR + 185] = { 3, TM, SEN(madvise), "madvise" },
+[BASE_NR + 186] = { 2, TF|TST|TSTA, SEN(stat), "stat" },
+[BASE_NR + 187] = { 2, TF|TLST|TSTA, SEN(lstat), "lstat" },
+[BASE_NR + 188] = { 2, TD|TFST|TSTA, SEN(fstat), "fstat" },
+[BASE_NR + 189] = { 6, TP, SEN(clone), "clone2" },
+[BASE_NR + 190] = { 3, TD, SEN(getdents64), "getdents64" },
+[BASE_NR + 191] = { 2, 0, SEN(printargs), "getunwind" },
+[BASE_NR + 192] = { 3, TD, SEN(readahead), "readahead" },
+[BASE_NR + 193] = { 5, TF, SEN(setxattr), "setxattr" },
+[BASE_NR + 194] = { 5, TF, SEN(setxattr), "lsetxattr" },
+[BASE_NR + 195] = { 5, TD, SEN(fsetxattr), "fsetxattr" },
+[BASE_NR + 196] = { 4, TF, SEN(getxattr), "getxattr" },
+[BASE_NR + 197] = { 4, TF, SEN(getxattr), "lgetxattr" },
+[BASE_NR + 198] = { 4, TD, SEN(fgetxattr), "fgetxattr" },
+[BASE_NR + 199] = { 3, TF, SEN(listxattr), "listxattr" },
+[BASE_NR + 200] = { 3, TF, SEN(listxattr), "llistxattr" },
+[BASE_NR + 201] = { 3, TD, SEN(flistxattr), "flistxattr" },
+[BASE_NR + 202] = { 2, TF, SEN(removexattr), "removexattr" },
+[BASE_NR + 203] = { 2, TF, SEN(removexattr), "lremovexattr" },
+[BASE_NR + 204] = { 2, TD, SEN(fremovexattr), "fremovexattr" },
+[BASE_NR + 205] = { 2, TS|TP, SEN(tkill), "tkill" },
+[BASE_NR + 206] = { 6, 0, SEN(futex_time64), "futex" },
+[BASE_NR + 207] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" },
+[BASE_NR + 208] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" },
+[BASE_NR + 209] = { 1, 0, SEN(set_tid_address), "set_tid_address" },
+[BASE_NR + 210] = { 4, TD, SEN(fadvise64), "fadvise64" },
+[BASE_NR + 211] = { 3, TS|TP, SEN(tgkill), "tgkill" },
+[BASE_NR + 212] = { 1, TP|SE, SEN(exit), "exit_group" },
+[BASE_NR + 213] = { 3, 0, SEN(lookup_dcookie), "lookup_dcookie" },
+[BASE_NR + 214] = { 2, TM, SEN(io_setup), "io_setup" },
+[BASE_NR + 215] = { 1, TM, SEN(io_destroy), "io_destroy" },
+[BASE_NR + 216] = { 5, 0, SEN(io_getevents_time64), "io_getevents" },
+[BASE_NR + 217] = { 3, 0, SEN(io_submit), "io_submit" },
+[BASE_NR + 218] = { 3, 0, SEN(io_cancel), "io_cancel" },
+[BASE_NR + 219] = { 1, TD, SEN(epoll_create), "epoll_create" },
+[BASE_NR + 220] = { 4, TD, SEN(epoll_ctl), "epoll_ctl" },
+[BASE_NR + 221] = { 4, TD, SEN(epoll_wait), "epoll_wait" },
+[BASE_NR + 222] = { 0, 0, SEN(restart_syscall), "restart_syscall" },
+[BASE_NR + 223] = { 4, TI, SEN(semtimedop_time64), "semtimedop" },
+[BASE_NR + 224] = { 3, 0, SEN(timer_create), "timer_create" },
+[BASE_NR + 225] = { 4, 0, SEN(timer_settime64), "timer_settime" },
+[BASE_NR + 226] = { 2, 0, SEN(timer_gettime64), "timer_gettime" },
+[BASE_NR + 227] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" },
+[BASE_NR + 228] = { 1, 0, SEN(timer_delete), "timer_delete" },
+[BASE_NR + 229] = { 2, TCL, SEN(clock_settime64), "clock_settime" },
+[BASE_NR + 230] = { 2, TCL, SEN(clock_gettime64), "clock_gettime" },
+[BASE_NR + 231] = { 2, TCL, SEN(clock_getres_time64), "clock_getres" },
+[BASE_NR + 232] = { 4, 0, SEN(clock_nanosleep_time64), "clock_nanosleep" },
+[BASE_NR + 233] = { 3, TD|TFSF|TSFA, SEN(fstatfs64), "fstatfs64" },
+[BASE_NR + 234] = { 3, TF|TSF|TSFA, SEN(statfs64), "statfs64" },
+[BASE_NR + 235] = { 6, TM, SEN(mbind), "mbind" },
+[BASE_NR + 236] = { 5, TM, SEN(get_mempolicy), "get_mempolicy" },
+[BASE_NR + 237] = { 3, TM, SEN(set_mempolicy), "set_mempolicy" },
+[BASE_NR + 238] = { 4, TD, SEN(mq_open), "mq_open" },
+[BASE_NR + 239] = { 1, 0, SEN(mq_unlink), "mq_unlink" },
+[BASE_NR + 240] = { 5, TD, SEN(mq_timedsend_time64), "mq_timedsend" },
+[BASE_NR + 241] = { 5, TD, SEN(mq_timedreceive_time64), "mq_timedreceive" },
+[BASE_NR + 242] = { 2, TD, SEN(mq_notify), "mq_notify" },
+[BASE_NR + 243] = { 3, TD, SEN(mq_getsetattr), "mq_getsetattr" },
+[BASE_NR + 244] = { 4, 0, SEN(kexec_load), "kexec_load" },
+[BASE_NR + 245] = { 5, 0, SEN(vserver), "vserver" },
+[BASE_NR + 246] = { 5, TP, SEN(waitid), "waitid" },
+[BASE_NR + 247] = { 5, 0, SEN(add_key), "add_key" },
+[BASE_NR + 248] = { 4, 0, SEN(request_key), "request_key" },
+[BASE_NR + 249] = { 5, 0, SEN(keyctl), "keyctl" },
+[BASE_NR + 250] = { 3, 0, SEN(ioprio_set), "ioprio_set" },
+[BASE_NR + 251] = { 2, 0, SEN(ioprio_get), "ioprio_get" },
+[BASE_NR + 252] = { 6, TM, SEN(move_pages), "move_pages" },
+[BASE_NR + 253] = { 0, TD, SEN(inotify_init), "inotify_init" },
+[BASE_NR + 254] = { 3, TD|TF, SEN(inotify_add_watch), "inotify_add_watch" },
+[BASE_NR + 255] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" },
+[BASE_NR + 256] = { 4, TM, SEN(migrate_pages), "migrate_pages" },
+[BASE_NR + 257] = { 4, TD|TF, SEN(openat), "openat" },
+[BASE_NR + 258] = { 3, TD|TF, SEN(mkdirat), "mkdirat" },
+[BASE_NR + 259] = { 4, TD|TF, SEN(mknodat), "mknodat" },
+[BASE_NR + 260] = { 5, TD|TF, SEN(fchownat), "fchownat" },
+[BASE_NR + 261] = { 3, TD|TF, SEN(futimesat), "futimesat" },
+[BASE_NR + 262] = { 4, TD|TF|TFST|TSTA,SEN(newfstatat), "newfstatat" },
+[BASE_NR + 263] = { 3, TD|TF, SEN(unlinkat), "unlinkat" },
+[BASE_NR + 264] = { 4, TD|TF, SEN(renameat), "renameat" },
+[BASE_NR + 265] = { 5, TD|TF, SEN(linkat), "linkat" },
+[BASE_NR + 266] = { 3, TD|TF, SEN(symlinkat), "symlinkat" },
+[BASE_NR + 267] = { 4, TD|TF, SEN(readlinkat), "readlinkat" },
+[BASE_NR + 268] = { 3, TD|TF, SEN(fchmodat), "fchmodat" },
+[BASE_NR + 269] = { 3, TD|TF, SEN(faccessat), "faccessat" },
+[BASE_NR + 270] = { 6, TD, SEN(pselect6_time64), "pselect6" },
+[BASE_NR + 271] = { 5, TD, SEN(ppoll_time64), "ppoll" },
+[BASE_NR + 272] = { 1, 0, SEN(unshare), "unshare" },
+[BASE_NR + 273] = { 6, TD, SEN(splice), "splice" },
+[BASE_NR + 274] = { 2, 0, SEN(set_robust_list), "set_robust_list" },
+[BASE_NR + 275] = { 3, 0, SEN(get_robust_list), "get_robust_list" },
+[BASE_NR + 276] = { 4, TD, SEN(sync_file_range), "sync_file_range" },
+[BASE_NR + 277] = { 4, TD, SEN(tee), "tee" },
+[BASE_NR + 278] = { 4, TD, SEN(vmsplice), "vmsplice" },
+[BASE_NR + 279] = { 4, TD, SEN(fallocate), "fallocate" },
+[BASE_NR + 280] = { 3, 0, SEN(getcpu), "getcpu" },
+[BASE_NR + 281] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" },
+[BASE_NR + 282] = { 4, TD|TF, SEN(utimensat_time64), "utimensat" },
+[BASE_NR + 283] = { 3, TD|TS, SEN(signalfd), "signalfd" },
+[BASE_NR + 284] = { 4, TD, SEN(timerfd), "timerfd" },
+[BASE_NR + 285] = { 1, TD, SEN(eventfd), "eventfd" },
+[BASE_NR + 286] = { 2, TD, SEN(timerfd_create), "timerfd_create" },
+[BASE_NR + 287] = { 4, TD, SEN(timerfd_settime64), "timerfd_settime" },
+[BASE_NR + 288] = { 2, TD, SEN(timerfd_gettime64), "timerfd_gettime" },
+[BASE_NR + 289] = { 4, TD|TS, SEN(signalfd4), "signalfd4" },
+[BASE_NR + 290] = { 2, TD, SEN(eventfd2), "eventfd2" },
+[BASE_NR + 291] = { 1, TD, SEN(epoll_create1), "epoll_create1" },
+[BASE_NR + 292] = { 3, TD, SEN(dup3), "dup3" },
+[BASE_NR + 293] = { 2, TD, SEN(pipe2), "pipe2" },
+[BASE_NR + 294] = { 1, TD, SEN(inotify_init1), "inotify_init1" },
+[BASE_NR + 295] = { 4, TD, SEN(preadv), "preadv" },
+[BASE_NR + 296] = { 4, TD, SEN(pwritev), "pwritev" },
+[BASE_NR + 297] = { 4, TP|TS, SEN(rt_tgsigqueueinfo), "rt_tgsigqueueinfo" },
+[BASE_NR + 298] = { 5, TN, SEN(recvmmsg_time64), "recvmmsg" },
+[BASE_NR + 299] = { 2, TD, SEN(fanotify_init), "fanotify_init" },
+[BASE_NR + 300] = { 5, TD|TF, SEN(fanotify_mark), "fanotify_mark" },
+[BASE_NR + 301] = { 4, 0, SEN(prlimit64), "prlimit64" },
+[BASE_NR + 302] = { 5, TD|TF, SEN(name_to_handle_at), "name_to_handle_at" },
+[BASE_NR + 303] = { 3, TD, SEN(open_by_handle_at), "open_by_handle_at" },
+[BASE_NR + 304] = { 2, TCL, SEN(clock_adjtime64), "clock_adjtime" },
+[BASE_NR + 305] = { 1, TD, SEN(syncfs), "syncfs" },
+[BASE_NR + 306] = { 2, TD, SEN(setns), "setns" },
+[BASE_NR + 307] = { 4, TN, SEN(sendmmsg), "sendmmsg" },
+[BASE_NR + 308] = { 6, 0, SEN(process_vm_readv), "process_vm_readv" },
+[BASE_NR + 309] = { 6, 0, SEN(process_vm_writev), "process_vm_writev" },
+[BASE_NR + 310] = { 4, TN, SEN(accept4), "accept4" },
+[BASE_NR + 311] = { 3, TD, SEN(finit_module), "finit_module" },
+[BASE_NR + 312] = { 3, 0, SEN(sched_setattr), "sched_setattr" },
+[BASE_NR + 313] = { 4, 0, SEN(sched_getattr), "sched_getattr" },
+[BASE_NR + 314] = { 5, TD|TF, SEN(renameat2), "renameat2" },
+[BASE_NR + 315] = { 3, 0, SEN(getrandom), "getrandom" },
+[BASE_NR + 316] = { 2, TD, SEN(memfd_create), "memfd_create" },
+[BASE_NR + 317] = { 3, TD, SEN(bpf), "bpf" },
+[BASE_NR + 318] = { 5, TD|TF|TP|TSD|SE|SI, SEN(execveat), "execveat" },
+[BASE_NR + 319] = { 1, TD, SEN(userfaultfd), "userfaultfd" },
+[BASE_NR + 320] = { 3, 0, SEN(membarrier), "membarrier" },
+[BASE_NR + 321] = { 5, 0, SEN(kcmp), "kcmp" },
+[BASE_NR + 322] = { 3, TM, SEN(mlock2), "mlock2" },
+[BASE_NR + 323] = { 6, TD, SEN(copy_file_range), "copy_file_range" },
+[BASE_NR + 324] = { 6, TD, SEN(preadv2), "preadv2" },
+[BASE_NR + 325] = { 6, TD, SEN(pwritev2), "pwritev2" },
+[BASE_NR + 326] = { 5, TD|TF|TFST|TSTA,SEN(statx), "statx" },
+[BASE_NR + 327] = { 6, 0, SEN(io_pgetevents_time64), "io_pgetevents" },
+[BASE_NR + 328] = { 5, TD, SEN(perf_event_open), "perf_event_open" },
+[BASE_NR + 329] = { 3, 0, SEN(seccomp), "seccomp" },
+[BASE_NR + 330] = { 4, TM|SI, SEN(pkey_mprotect), "pkey_mprotect" },
+[BASE_NR + 331] = { 2, 0, SEN(pkey_alloc), "pkey_alloc" },
+[BASE_NR + 332] = { 1, 0, SEN(pkey_free), "pkey_free" },
+[BASE_NR + 333] = { 4, 0, SEN(rseq), "rseq" },
+/* [BASE_NR + 334 ... BASE_NR + 423] - reserved to sync up with other architectures */
+#include "syscallent-common.h"
+#undef BASE_NR
diff --git a/src/linux/ia64/syscallent_base_nr.h b/src/linux/ia64/syscallent_base_nr.h
new file mode 100644
index 000000000..612668ec8
--- /dev/null
+++ b/src/linux/ia64/syscallent_base_nr.h
@@ -0,0 +1 @@
+#define SYSCALLENT_BASE_NR (1U << 10)
diff --git a/src/linux/ia64/userent.h b/src/linux/ia64/userent.h
new file mode 100644
index 000000000..f6f637243
--- /dev/null
+++ b/src/linux/ia64/userent.h
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2014-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+{ PT_F32, "f32" }, { PT_F33, "f33" }, { PT_F34, "f34" },
+{ PT_F35, "f35" }, { PT_F36, "f36" }, { PT_F37, "f37" },
+{ PT_F38, "f38" }, { PT_F39, "f39" }, { PT_F40, "f40" },
+{ PT_F41, "f41" }, { PT_F42, "f42" }, { PT_F43, "f43" },
+{ PT_F44, "f44" }, { PT_F45, "f45" }, { PT_F46, "f46" },
+{ PT_F47, "f47" }, { PT_F48, "f48" }, { PT_F49, "f49" },
+{ PT_F50, "f50" }, { PT_F51, "f51" }, { PT_F52, "f52" },
+{ PT_F53, "f53" }, { PT_F54, "f54" }, { PT_F55, "f55" },
+{ PT_F56, "f56" }, { PT_F57, "f57" }, { PT_F58, "f58" },
+{ PT_F59, "f59" }, { PT_F60, "f60" }, { PT_F61, "f61" },
+{ PT_F62, "f62" }, { PT_F63, "f63" }, { PT_F64, "f64" },
+{ PT_F65, "f65" }, { PT_F66, "f66" }, { PT_F67, "f67" },
+{ PT_F68, "f68" }, { PT_F69, "f69" }, { PT_F70, "f70" },
+{ PT_F71, "f71" }, { PT_F72, "f72" }, { PT_F73, "f73" },
+{ PT_F74, "f74" }, { PT_F75, "f75" }, { PT_F76, "f76" },
+{ PT_F77, "f77" }, { PT_F78, "f78" }, { PT_F79, "f79" },
+{ PT_F80, "f80" }, { PT_F81, "f81" }, { PT_F82, "f82" },
+{ PT_F83, "f83" }, { PT_F84, "f84" }, { PT_F85, "f85" },
+{ PT_F86, "f86" }, { PT_F87, "f87" }, { PT_F88, "f88" },
+{ PT_F89, "f89" }, { PT_F90, "f90" }, { PT_F91, "f91" },
+{ PT_F92, "f92" }, { PT_F93, "f93" }, { PT_F94, "f94" },
+{ PT_F95, "f95" }, { PT_F96, "f96" }, { PT_F97, "f97" },
+{ PT_F98, "f98" }, { PT_F99, "f99" }, { PT_F100, "f100" },
+{ PT_F101, "f101" }, { PT_F102, "f102" }, { PT_F103, "f103" },
+{ PT_F104, "f104" }, { PT_F105, "f105" }, { PT_F106, "f106" },
+{ PT_F107, "f107" }, { PT_F108, "f108" }, { PT_F109, "f109" },
+{ PT_F110, "f110" }, { PT_F111, "f111" }, { PT_F112, "f112" },
+{ PT_F113, "f113" }, { PT_F114, "f114" }, { PT_F115, "f115" },
+{ PT_F116, "f116" }, { PT_F117, "f117" }, { PT_F118, "f118" },
+{ PT_F119, "f119" }, { PT_F120, "f120" }, { PT_F121, "f121" },
+{ PT_F122, "f122" }, { PT_F123, "f123" }, { PT_F124, "f124" },
+{ PT_F125, "f125" }, { PT_F126, "f126" }, { PT_F127, "f127" },
+/* switch stack: */
+{ PT_F2, "f2" }, { PT_F3, "f3" }, { PT_F4, "f4" },
+{ PT_F5, "f5" }, { PT_F10, "f10" }, { PT_F11, "f11" },
+{ PT_F12, "f12" }, { PT_F13, "f13" }, { PT_F14, "f14" },
+{ PT_F15, "f15" }, { PT_F16, "f16" }, { PT_F17, "f17" },
+{ PT_F18, "f18" }, { PT_F19, "f19" }, { PT_F20, "f20" },
+{ PT_F21, "f21" }, { PT_F22, "f22" }, { PT_F23, "f23" },
+{ PT_F24, "f24" }, { PT_F25, "f25" }, { PT_F26, "f26" },
+{ PT_F27, "f27" }, { PT_F28, "f28" }, { PT_F29, "f29" },
+{ PT_F30, "f30" }, { PT_F31, "f31" }, { PT_R4, "r4" },
+{ PT_R5, "r5" }, { PT_R6, "r6" }, { PT_R7, "r7" },
+{ PT_B1, "b1" }, { PT_B2, "b2" }, { PT_B3, "b3" },
+{ PT_B4, "b4" }, { PT_B5, "b5" },
+{ PT_AR_EC, "ar.ec" }, { PT_AR_LC, "ar.lc" },
+/* pt_regs */
+{ PT_CR_IPSR, "psr" }, { PT_CR_IIP, "ip" },
+{ PT_CFM, "cfm" }, { PT_AR_UNAT, "ar.unat" },
+{ PT_AR_PFS, "ar.pfs" }, { PT_AR_RSC, "ar.rsc" },
+{ PT_AR_RNAT, "ar.rnat" }, { PT_AR_BSPSTORE, "ar.bspstore" },
+{ PT_PR, "pr" }, { PT_B6, "b6" }, { PT_AR_BSP, "ar.bsp" },
+{ PT_R1, "r1" }, { PT_R2, "r2" }, { PT_R3, "r3" },
+{ PT_R12, "r12" }, { PT_R13, "r13" }, { PT_R14, "r14" },
+{ PT_R15, "r15" }, { PT_R8, "r8" }, { PT_R9, "r9" },
+{ PT_R10, "r10" }, { PT_R11, "r11" }, { PT_R16, "r16" },
+{ PT_R17, "r17" }, { PT_R18, "r18" }, { PT_R19, "r19" },
+{ PT_R20, "r20" }, { PT_R21, "r21" }, { PT_R22, "r22" },
+{ PT_R23, "r23" }, { PT_R24, "r24" }, { PT_R25, "r25" },
+{ PT_R26, "r26" }, { PT_R27, "r27" }, { PT_R28, "r28" },
+{ PT_R29, "r29" }, { PT_R30, "r30" }, { PT_R31, "r31" },
+{ PT_AR_CCV, "ar.ccv" }, { PT_AR_FPSR, "ar.fpsr" },
+{ PT_B0, "b0" }, { PT_B7, "b7" }, { PT_F6, "f6" },
+{ PT_F7, "f7" }, { PT_F8, "f8" }, { PT_F9, "f9" },
+#ifdef PT_AR_CSD
+{ PT_AR_CSD, "ar.csd" },
+#endif
+#ifdef PT_AR_SSD
+{ PT_AR_SSD, "ar.ssd" },
+#endif
+{ PT_DBR, "dbr" }, { PT_IBR, "ibr" }, { PT_PMD, "pmd" },
+/* Other fields in "struct user" */
+#include "../userent0.h"
diff --git a/src/linux/inet_diag.h b/src/linux/inet_diag.h
new file mode 100644
index 000000000..e21b92770
--- /dev/null
+++ b/src/linux/inet_diag.h
@@ -0,0 +1,163 @@
+/*
+ * Copyright (c) 2014-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_LINUX_INET_DIAG_H
+# define STRACE_LINUX_INET_DIAG_H
+
+# define TCPDIAG_GETSOCK 18
+# define DCCPDIAG_GETSOCK 19
+
+/* Socket identity */
+struct inet_diag_sockid {
+ uint16_t idiag_sport;
+ uint16_t idiag_dport;
+ uint32_t idiag_src[4];
+ uint32_t idiag_dst[4];
+ uint32_t idiag_if;
+ uint32_t idiag_cookie[2];
+};
+
+/* Request structures */
+struct inet_diag_req {
+ uint8_t idiag_family;
+ uint8_t idiag_src_len;
+ uint8_t idiag_dst_len;
+ uint8_t idiag_ext;
+ struct inet_diag_sockid id;
+ uint32_t idiag_states;
+ uint32_t idiag_dbs;
+};
+
+struct inet_diag_req_v2 {
+ uint8_t sdiag_family;
+ uint8_t sdiag_protocol;
+ uint8_t idiag_ext;
+ uint8_t pad;
+ uint32_t idiag_states;
+ struct inet_diag_sockid id;
+};
+
+enum {
+ INET_DIAG_REQ_NONE,
+ INET_DIAG_REQ_BYTECODE,
+ INET_DIAG_REQ_SK_BPF_STORAGES,
+ INET_DIAG_REQ_PROTOCOL,
+};
+
+struct inet_diag_bc_op {
+ unsigned char code;
+ unsigned char yes;
+ unsigned short no;
+};
+
+enum {
+ INET_DIAG_BC_NOP,
+ INET_DIAG_BC_JMP,
+ INET_DIAG_BC_S_GE,
+ INET_DIAG_BC_S_LE,
+ INET_DIAG_BC_D_GE,
+ INET_DIAG_BC_D_LE,
+ INET_DIAG_BC_AUTO,
+ INET_DIAG_BC_S_COND,
+ INET_DIAG_BC_D_COND,
+ INET_DIAG_BC_DEV_COND, /* u32 ifindex */
+ INET_DIAG_BC_MARK_COND,
+ INET_DIAG_BC_S_EQ,
+ INET_DIAG_BC_D_EQ,
+ INET_DIAG_BC_CGROUP_COND,
+};
+
+struct inet_diag_hostcond {
+ uint8_t family;
+ uint8_t prefix_len;
+ int port;
+ uint32_t addr[0];
+};
+
+struct inet_diag_markcond {
+ uint32_t mark;
+ uint32_t mask;
+};
+
+/* Info structure */
+struct inet_diag_msg {
+ uint8_t idiag_family;
+ uint8_t idiag_state;
+ uint8_t idiag_timer;
+ uint8_t idiag_retrans;
+
+ struct inet_diag_sockid id;
+
+ uint32_t idiag_expires;
+ uint32_t idiag_rqueue;
+ uint32_t idiag_wqueue;
+ uint32_t idiag_uid;
+ uint32_t idiag_inode;
+};
+
+/* Extensions */
+enum {
+ INET_DIAG_NONE,
+ INET_DIAG_MEMINFO,
+ INET_DIAG_INFO,
+ INET_DIAG_VEGASINFO,
+ INET_DIAG_CONG,
+ INET_DIAG_TOS,
+ INET_DIAG_TCLASS,
+ INET_DIAG_SKMEMINFO,
+ INET_DIAG_SHUTDOWN,
+ INET_DIAG_DCTCPINFO,
+ INET_DIAG_PROTOCOL, /* response attribute only */
+ INET_DIAG_SKV6ONLY,
+ INET_DIAG_LOCALS,
+ INET_DIAG_PEERS,
+ INET_DIAG_PAD,
+ INET_DIAG_MARK,
+ INET_DIAG_BBRINFO,
+ INET_DIAG_CLASS_ID,
+ INET_DIAG_MD5SIG,
+ INET_DIAG_ULP_INFO,
+ INET_DIAG_SK_BPF_STORAGES,
+ INET_DIAG_CGROUP_ID,
+ INET_DIAG_SOCKOPT,
+};
+
+/* INET_DIAG_MEM */
+struct inet_diag_meminfo {
+ uint32_t idiag_rmem;
+ uint32_t idiag_wmem;
+ uint32_t idiag_fmem;
+ uint32_t idiag_tmem;
+};
+
+/* INET_DIAG_VEGASINFO */
+struct tcpvegas_info {
+ uint32_t tcpv_enabled;
+ uint32_t tcpv_rttcnt;
+ uint32_t tcpv_rtt;
+ uint32_t tcpv_minrtt;
+};
+
+/* INET_DIAG_DCTCPINFO */
+struct tcp_dctcp_info {
+ uint16_t dctcp_enabled;
+ uint16_t dctcp_ce_state;
+ uint32_t dctcp_alpha;
+ uint32_t dctcp_ab_ecn;
+ uint32_t dctcp_ab_tot;
+};
+
+/* INET_DIAG_BBRINFO */
+struct tcp_bbr_info {
+ uint32_t bbr_bw_lo;
+ uint32_t bbr_bw_hi;
+ uint32_t bbr_min_rtt;
+ uint32_t bbr_pacing_gain;
+ uint32_t bbr_cwnd_gain;
+};
+
+#endif /* !STRACE_LINUX_INET_DIAG_H */
diff --git a/src/linux/m68k/arch_defs_.h b/src/linux/m68k/arch_defs_.h
new file mode 100644
index 000000000..1a8da94f6
--- /dev/null
+++ b/src/linux/m68k/arch_defs_.h
@@ -0,0 +1,11 @@
+/*
+ * Copyright (c) 2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#define HAVE_ARCH_OLD_MMAP 1
+#define HAVE_ARCH_OLD_SELECT 1
+#define HAVE_ARCH_UID16_SYSCALLS 1
+#define HAVE_ARCH_SA_RESTORER 1
diff --git a/src/linux/m68k/arch_regs.c b/src/linux/m68k/arch_regs.c
new file mode 100644
index 000000000..13b82eb09
--- /dev/null
+++ b/src/linux/m68k/arch_regs.c
@@ -0,0 +1,11 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static struct user_regs_struct m68k_regs;
+#define ARCH_REGS_FOR_GETREGS m68k_regs
+#define ARCH_PC_REG m68k_regs.pc
+#define ARCH_SP_REG m68k_regs.usp
diff --git a/src/linux/m68k/arch_rt_sigframe.c b/src/linux/m68k/arch_rt_sigframe.c
new file mode 100644
index 000000000..bb60b44d4
--- /dev/null
+++ b/src/linux/m68k/arch_rt_sigframe.c
@@ -0,0 +1 @@
+#include "i386/arch_rt_sigframe.c"
diff --git a/src/linux/m68k/arch_sigreturn.c b/src/linux/m68k/arch_sigreturn.c
new file mode 100644
index 000000000..cfdaaf226
--- /dev/null
+++ b/src/linux/m68k/arch_sigreturn.c
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static void
+arch_sigreturn(struct tcb *tcp)
+{
+ unsigned long addr, sp;
+
+ /* Fetch pointer to struct sigcontext. */
+ if (!get_stack_pointer(tcp, &sp) ||
+ umove_or_printaddr(tcp, sp + 2 * sizeof(int), &addr))
+ return;
+
+ unsigned long mask[NSIG_BYTES / sizeof(long)];
+ /* Fetch first word of signal mask. */
+ if (umove_or_printaddr(tcp, addr, &mask[0]))
+ return;
+
+ /* Fetch remaining words of signal mask, located immediately before. */
+ addr -= sizeof(mask) - sizeof(long);
+ if (umoven_or_printaddr(tcp, addr, sizeof(mask) - sizeof(long), &mask[1]))
+ return;
+
+ tprintsigmask_addr(mask);
+}
diff --git a/src/linux/m68k/get_error.c b/src/linux/m68k/get_error.c
new file mode 100644
index 000000000..9af044783
--- /dev/null
+++ b/src/linux/m68k/get_error.c
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "negated_errno.h"
+
+static void
+arch_get_error(struct tcb *tcp, const bool check_errno)
+{
+ if (check_errno && is_negated_errno(m68k_regs.d0)) {
+ tcp->u_rval = -1;
+ tcp->u_error = -m68k_regs.d0;
+ } else {
+ tcp->u_rval = m68k_regs.d0;
+ }
+}
diff --git a/src/linux/m68k/get_scno.c b/src/linux/m68k/get_scno.c
new file mode 100644
index 000000000..41db19c56
--- /dev/null
+++ b/src/linux/m68k/get_scno.c
@@ -0,0 +1,14 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+/* Return codes: 1 - ok, 0 - ignore, other - error. */
+static int
+arch_get_scno(struct tcb *tcp)
+{
+ tcp->scno = m68k_regs.orig_d0;
+ return 1;
+}
diff --git a/src/linux/m68k/get_syscall_args.c b/src/linux/m68k/get_syscall_args.c
new file mode 100644
index 000000000..f2657b375
--- /dev/null
+++ b/src/linux/m68k/get_syscall_args.c
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+/* Return -1 on error or 1 on success (never 0!). */
+static int
+arch_get_syscall_args(struct tcb *tcp)
+{
+ tcp->u_arg[0] = m68k_regs.d1;
+ tcp->u_arg[1] = m68k_regs.d2;
+ tcp->u_arg[2] = m68k_regs.d3;
+ tcp->u_arg[3] = m68k_regs.d4;
+ tcp->u_arg[4] = m68k_regs.d5;
+ tcp->u_arg[5] = m68k_regs.a0;
+ return 1;
+}
diff --git a/src/linux/m68k/ioctls_arch0.h b/src/linux/m68k/ioctls_arch0.h
new file mode 100644
index 000000000..c8636ab23
--- /dev/null
+++ b/src/linux/m68k/ioctls_arch0.h
@@ -0,0 +1,24 @@
+/* Generated by ioctls_gen.sh from definitions found in $linux/arch/m68k/include/ tree. */
+{ "asm/fbio.h", "FBIOGATTR", _IOC_READ, 0x4606, 0x58 },
+{ "asm/fbio.h", "FBIOGCURMAX", _IOC_READ, 0x461c, 0x04 },
+{ "asm/fbio.h", "FBIOGCURPOS", _IOC_WRITE, 0x461b, 0x04 },
+{ "asm/fbio.h", "FBIOGCURSOR", _IOC_READ|_IOC_WRITE, 0x4619, 0x2c },
+{ "asm/fbio.h", "FBIOGETCMAP", _IOC_WRITE, 0x4604, 0x14 },
+{ "asm/fbio.h", "FBIOGTYPE", _IOC_READ, 0x4600, 0x18 },
+{ "asm/fbio.h", "FBIOGVIDEO", _IOC_READ, 0x4608, 0x04 },
+{ "asm/fbio.h", "FBIOPUTCMAP", _IOC_WRITE, 0x4603, 0x14 },
+{ "asm/fbio.h", "FBIOSATTR", _IOC_WRITE, 0x4605, 0x58 },
+{ "asm/fbio.h", "FBIOSCURPOS", _IOC_WRITE, 0x461a, 0x04 },
+{ "asm/fbio.h", "FBIOSCURSOR", _IOC_WRITE, 0x4618, 0x2c },
+{ "asm/fbio.h", "FBIOSVIDEO", _IOC_WRITE, 0x4607, 0x04 },
+{ "asm/fbio.h", "FBIO_WID_ALLOC", _IOC_READ|_IOC_WRITE, 0x461e, 0x0c },
+{ "asm/fbio.h", "FBIO_WID_FREE", _IOC_WRITE, 0x461f, 0x0c },
+{ "asm/fbio.h", "FBIO_WID_GET", _IOC_READ|_IOC_WRITE, 0x4621, 0x0c },
+{ "asm/fbio.h", "FBIO_WID_PUT", _IOC_WRITE, 0x4620, 0x0c },
+{ "asm/fbio.h", "LEO_CLUTALLOC", _IOC_READ|_IOC_WRITE, 0x4c35, 0x0c },
+{ "asm/fbio.h", "LEO_CLUTFREE", _IOC_WRITE, 0x4c36, 0x0c },
+{ "asm/fbio.h", "LEO_CLUTPOST", _IOC_WRITE, 0x4c38, 0x1c },
+{ "asm/fbio.h", "LEO_CLUTREAD", _IOC_WRITE, 0x4c37, 0x1c },
+{ "asm/fbio.h", "LEO_GETGAMMA", _IOC_READ, 0x4c45, 0x04 },
+{ "asm/fbio.h", "LEO_SETGAMMA", _IOC_WRITE, 0x4c44, 0x04 },
+{ "asm/ioctls.h", "FIOQSIZE", 0, 0x545E, 0 },
diff --git a/src/linux/m68k/ioctls_inc0.h b/src/linux/m68k/ioctls_inc0.h
new file mode 100644
index 000000000..4aecf983e
--- /dev/null
+++ b/src/linux/m68k/ioctls_inc0.h
@@ -0,0 +1 @@
+#include "32/ioctls_inc.h"
diff --git a/src/linux/m68k/raw_syscall.h b/src/linux/m68k/raw_syscall.h
new file mode 100644
index 000000000..345bc7672
--- /dev/null
+++ b/src/linux/m68k/raw_syscall.h
@@ -0,0 +1,28 @@
+/*
+ * Raw syscalls.
+ *
+ * Copyright (c) 2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_RAW_SYSCALL_H
+# define STRACE_RAW_SYSCALL_H
+
+# include "kernel_types.h"
+
+static inline kernel_ulong_t
+raw_syscall_0(const kernel_ulong_t nr, kernel_ulong_t *err)
+{
+ *err = 0;
+ register kernel_ulong_t d0 __asm__("%d0") = nr;
+ __asm__ __volatile__("trap #0"
+ : "=d"(d0)
+ : "0"(d0)
+ : "memory");
+ return d0;
+}
+# define raw_syscall_0 raw_syscall_0
+
+#endif /* !STRACE_RAW_SYSCALL_H */
diff --git a/src/linux/m68k/rt_sigframe.h b/src/linux/m68k/rt_sigframe.h
new file mode 100644
index 000000000..5d6ff22f5
--- /dev/null
+++ b/src/linux/m68k/rt_sigframe.h
@@ -0,0 +1,23 @@
+/*
+ * Copyright (c) 2017-2018 Dmitry V. Levin <ldv@strace.io>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_RT_SIGFRAME_H
+# define STRACE_RT_SIGFRAME_H
+
+# include <signal.h>
+
+typedef struct {
+ char *pretcode;
+ int sig;
+ siginfo_t *pinfo;
+ void *puc;
+ char retcode[8];
+ siginfo_t info;
+ ucontext_t uc;
+} struct_rt_sigframe;
+
+#endif /* !STRACE_RT_SIGFRAME_H */
diff --git a/src/linux/m68k/set_error.c b/src/linux/m68k/set_error.c
new file mode 100644
index 000000000..bf01eef76
--- /dev/null
+++ b/src/linux/m68k/set_error.c
@@ -0,0 +1,20 @@
+/*
+ * Copyright (c) 2016-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static int
+arch_set_error(struct tcb *tcp)
+{
+ m68k_regs.d0 = -tcp->u_error;
+ return set_regs(tcp->pid);
+}
+
+static int
+arch_set_success(struct tcb *tcp)
+{
+ m68k_regs.d0 = tcp->u_rval;
+ return set_regs(tcp->pid);
+}
diff --git a/src/linux/m68k/set_scno.c b/src/linux/m68k/set_scno.c
new file mode 100644
index 000000000..05af3dee0
--- /dev/null
+++ b/src/linux/m68k/set_scno.c
@@ -0,0 +1,15 @@
+/*
+ * Copyright (c) 2016-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static int
+arch_set_scno(struct tcb *tcp, kernel_ulong_t scno)
+{
+ if (ptrace_syscall_info_is_valid() && get_regs(tcp) < 0)
+ return -1;
+ m68k_regs.orig_d0 = scno;
+ return set_regs(tcp->pid);
+}
diff --git a/src/linux/m68k/syscallent.h b/src/linux/m68k/syscallent.h
new file mode 100644
index 000000000..d4e50c72b
--- /dev/null
+++ b/src/linux/m68k/syscallent.h
@@ -0,0 +1,409 @@
+/*
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993, 1994, 1995 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1995-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+[ 0] = { 0, 0, SEN(restart_syscall), "restart_syscall" },
+[ 1] = { 1, TP|SE, SEN(exit), "exit" },
+[ 2] = { 0, TP, SEN(fork), "fork" },
+[ 3] = { 3, TD, SEN(read), "read" },
+[ 4] = { 3, TD, SEN(write), "write" },
+[ 5] = { 3, TD|TF, SEN(open), "open" },
+[ 6] = { 1, TD, SEN(close), "close" },
+[ 7] = { 3, TP, SEN(waitpid), "waitpid" },
+[ 8] = { 2, TD|TF, SEN(creat), "creat" },
+[ 9] = { 2, TF, SEN(link), "link" },
+[ 10] = { 1, TF, SEN(unlink), "unlink" },
+[ 11] = { 3, TF|TP|TSD|SE|SI, SEN(execve), "execve" },
+[ 12] = { 1, TF, SEN(chdir), "chdir" },
+[ 13] = { 1, TCL, SEN(time), "time" },
+[ 14] = { 3, TF, SEN(mknod), "mknod" },
+[ 15] = { 2, TF, SEN(chmod), "chmod" },
+[ 16] = { 3, TF, SEN(chown16), "chown" },
+[ 17] = { 0, TM, SEN(break), "break" },
+[ 18] = { 2, TF|TST|TSTA, SEN(oldstat), "oldstat" },
+[ 19] = { 3, TD, SEN(lseek), "lseek" },
+[ 20] = { 0, PU|NF, SEN(getpid), "getpid" },
+[ 21] = { 5, TF, SEN(mount), "mount" },
+[ 22] = { 1, TF, SEN(umount), "umount" },
+[ 23] = { 1, TC, SEN(setuid16), "setuid" },
+[ 24] = { 0, TC|PU|NF, SEN(getuid16), "getuid" },
+[ 25] = { 1, 0, SEN(stime), "stime" },
+[ 26] = { 4, 0, SEN(ptrace), "ptrace" },
+[ 27] = { 1, 0, SEN(alarm), "alarm" },
+[ 28] = { 2, TD|TFST|TSTA, SEN(oldfstat), "oldfstat" },
+[ 29] = { 0, TS, SEN(pause), "pause" },
+[ 30] = { 2, TF, SEN(utime), "utime" },
+[ 31] = { 2, 0, SEN(stty), "stty" },
+[ 32] = { 2, 0, SEN(gtty), "gtty" },
+[ 33] = { 2, TF, SEN(access), "access" },
+[ 34] = { 1, 0, SEN(nice), "nice" },
+[ 35] = { 0, 0, SEN(ftime), "ftime" },
+[ 36] = { 0, 0, SEN(sync), "sync" },
+[ 37] = { 2, TS|TP, SEN(kill), "kill" },
+[ 38] = { 2, TF, SEN(rename), "rename" },
+[ 39] = { 2, TF, SEN(mkdir), "mkdir" },
+[ 40] = { 1, TF, SEN(rmdir), "rmdir" },
+[ 41] = { 1, TD, SEN(dup), "dup" },
+[ 42] = { 1, TD, SEN(pipe), "pipe" },
+[ 43] = { 1, 0, SEN(times), "times" },
+[ 44] = { 0, 0, SEN(prof), "prof" },
+[ 45] = { 1, TM|SI, SEN(brk), "brk" },
+[ 46] = { 1, TC, SEN(setgid16), "setgid" },
+[ 47] = { 0, TC|PU|NF, SEN(getgid16), "getgid" },
+[ 48] = { 2, TS, SEN(signal), "signal" },
+[ 49] = { 0, TC|PU|NF, SEN(geteuid16), "geteuid" },
+[ 50] = { 0, TC|PU|NF, SEN(getegid16), "getegid" },
+[ 51] = { 1, TF, SEN(acct), "acct" },
+[ 52] = { 2, TF, SEN(umount2), "umount2" },
+[ 53] = { 0, 0, SEN(lock), "lock" },
+[ 54] = { 3, TD, SEN(ioctl), "ioctl" },
+[ 55] = { 3, TD, SEN(fcntl), "fcntl" },
+[ 56] = { 0, 0, SEN(mpx), "mpx" },
+[ 57] = { 2, 0, SEN(setpgid), "setpgid" },
+[ 58] = { 2, 0, SEN(ulimit), "ulimit" },
+[ 59] = { 1, 0, SEN(oldolduname), "oldolduname" },
+[ 60] = { 1, NF, SEN(umask), "umask" },
+[ 61] = { 1, TF, SEN(chroot), "chroot" },
+[ 62] = { 2, TSFA, SEN(ustat), "ustat" },
+[ 63] = { 2, TD, SEN(dup2), "dup2" },
+[ 64] = { 0, PU|NF, SEN(getppid), "getppid" },
+[ 65] = { 0, PU|NF, SEN(getpgrp), "getpgrp" },
+[ 66] = { 0, 0, SEN(setsid), "setsid" },
+[ 67] = { 3, TS, SEN(sigaction), "sigaction" },
+[ 68] = { 0, TS, SEN(sgetmask), "sgetmask" },
+[ 69] = { 1, TS, SEN(ssetmask), "ssetmask" },
+[ 70] = { 2, TC, SEN(setreuid16), "setreuid" },
+[ 71] = { 2, TC, SEN(setregid16), "setregid" },
+[ 72] = { 3, TS, SEN(sigsuspend), "sigsuspend" },
+[ 73] = { 1, TS, SEN(sigpending), "sigpending" },
+[ 74] = { 2, 0, SEN(sethostname), "sethostname" },
+[ 75] = { 2, 0, SEN(setrlimit), "setrlimit" },
+[ 76] = { 2, 0, SEN(getrlimit), "getrlimit" },
+[ 77] = { 2, 0, SEN(getrusage), "getrusage" },
+[ 78] = { 2, TCL, SEN(gettimeofday), "gettimeofday" },
+[ 79] = { 2, TCL, SEN(settimeofday), "settimeofday" },
+[ 80] = { 2, TC, SEN(getgroups16), "getgroups" },
+[ 81] = { 2, TC, SEN(setgroups16), "setgroups" },
+[ 82] = { 1, TD, SEN(oldselect), "select" },
+[ 83] = { 2, TF, SEN(symlink), "symlink" },
+[ 84] = { 2, TF|TLST|TSTA, SEN(oldlstat), "oldlstat" },
+[ 85] = { 3, TF, SEN(readlink), "readlink" },
+[ 86] = { 1, TF, SEN(uselib), "uselib" },
+[ 87] = { 2, TF, SEN(swapon), "swapon" },
+[ 88] = { 4, 0, SEN(reboot), "reboot" },
+[ 89] = { 3, TD, SEN(readdir), "readdir" },
+[ 90] = { 1, TD|TM|SI, SEN(old_mmap), "mmap" },
+[ 91] = { 2, TM|SI, SEN(munmap), "munmap" },
+[ 92] = { 2, TF, SEN(truncate), "truncate" },
+[ 93] = { 2, TD, SEN(ftruncate), "ftruncate" },
+[ 94] = { 2, TD, SEN(fchmod), "fchmod" },
+[ 95] = { 3, TD, SEN(fchown16), "fchown" },
+[ 96] = { 2, 0, SEN(getpriority), "getpriority" },
+[ 97] = { 3, 0, SEN(setpriority), "setpriority" },
+[ 98] = { 4, 0, SEN(profil), "profil" },
+[ 99] = { 2, TF|TSF|TSFA, SEN(statfs), "statfs" },
+[100] = { 2, TD|TFSF|TSFA, SEN(fstatfs), "fstatfs" },
+[101] = { 3, 0, SEN(ioperm), "ioperm" },
+[102] = { 2, TD|TSD, SEN(socketcall), "socketcall" },
+[103] = { 3, 0, SEN(syslog), "syslog" },
+[104] = { 3, 0, SEN(setitimer), "setitimer" },
+[105] = { 2, 0, SEN(getitimer), "getitimer" },
+[106] = { 2, TF|TST|TSTA, SEN(stat), "stat" },
+[107] = { 2, TF|TLST|TSTA, SEN(lstat), "lstat" },
+[108] = { 2, TD|TFST|TSTA, SEN(fstat), "fstat" },
+[109] = { 1, 0, SEN(olduname), "olduname" },
+[110] = { 1, 0, SEN(iopl), "iopl" },
+[111] = { 0, 0, SEN(vhangup), "vhangup" },
+[112] = { 0, 0, SEN(idle), "idle" },
+[113] = { 1, 0, SEN(vm86old), "vm86old" },
+[114] = { 4, TP, SEN(wait4), "wait4" },
+[115] = { 1, TF, SEN(swapoff), "swapoff" },
+[116] = { 1, 0, SEN(sysinfo), "sysinfo" },
+[117] = { 6, TI|TSD, SEN(ipc), "ipc" },
+[118] = { 1, TD, SEN(fsync), "fsync" },
+[119] = { 0, TS, SEN(sigreturn), "sigreturn" },
+[120] = { 5, TP, SEN(clone), "clone" },
+[121] = { 2, 0, SEN(setdomainname), "setdomainname" },
+[122] = { 1, 0, SEN(uname), "uname" },
+[123] = { 4, 0, SEN(cacheflush), "cacheflush" },
+[124] = { 1, TCL, SEN(adjtimex32), "adjtimex" },
+[125] = { 3, TM|SI, SEN(mprotect), "mprotect" },
+[126] = { 3, TS, SEN(sigprocmask), "sigprocmask" },
+[127] = { 2, 0, SEN(create_module), "create_module" },
+[128] = { 3, 0, SEN(init_module), "init_module" },
+[129] = { 2, 0, SEN(delete_module), "delete_module" },
+[130] = { 1, 0, SEN(get_kernel_syms), "get_kernel_syms" },
+[131] = { 4, TF, SEN(quotactl), "quotactl" },
+[132] = { 1, 0, SEN(getpgid), "getpgid" },
+[133] = { 1, TD, SEN(fchdir), "fchdir" },
+[134] = { 2, 0, SEN(bdflush), "bdflush" },
+[135] = { 3, 0, SEN(sysfs), "sysfs" },
+[136] = { 1, NF, SEN(personality), "personality" },
+[137] = { 5, 0, SEN(afs_syscall), "afs_syscall" },
+[138] = { 1, TC|NF, SEN(setfsuid16), "setfsuid" },
+[139] = { 1, TC|NF, SEN(setfsgid16), "setfsgid" },
+[140] = { 5, TD, SEN(llseek), "_llseek" },
+[141] = { 3, TD, SEN(getdents), "getdents" },
+[142] = { 5, TD, SEN(select), "_newselect" },
+[143] = { 2, TD, SEN(flock), "flock" },
+[144] = { 3, TM, SEN(msync), "msync" },
+[145] = { 3, TD, SEN(readv), "readv" },
+[146] = { 3, TD, SEN(writev), "writev" },
+[147] = { 1, 0, SEN(getsid), "getsid" },
+[148] = { 1, TD, SEN(fdatasync), "fdatasync" },
+[149] = { 1, 0, SEN(sysctl), "_sysctl" },
+[150] = { 2, TM, SEN(mlock), "mlock" },
+[151] = { 2, TM, SEN(munlock), "munlock" },
+[152] = { 1, TM, SEN(mlockall), "mlockall" },
+[153] = { 0, TM, SEN(munlockall), "munlockall" },
+[154] = { 2, 0, SEN(sched_setparam), "sched_setparam" },
+[155] = { 2, 0, SEN(sched_getparam), "sched_getparam" },
+[156] = { 3, 0, SEN(sched_setscheduler), "sched_setscheduler" },
+[157] = { 1, 0, SEN(sched_getscheduler), "sched_getscheduler" },
+[158] = { 0, 0, SEN(sched_yield), "sched_yield" },
+[159] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"},
+[160] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"},
+[161] = { 2, 0, SEN(sched_rr_get_interval_time32),"sched_rr_get_interval"},
+[162] = { 2, 0, SEN(nanosleep_time32), "nanosleep" },
+[163] = { 5, TM|SI, SEN(mremap), "mremap" },
+[164] = { 3, TC, SEN(setresuid16), "setresuid" },
+[165] = { 3, TC, SEN(getresuid16), "getresuid" },
+[166] = { 0, PU|NF, SEN(getpagesize), "getpagesize" },
+[167] = { 5, 0, SEN(query_module), "query_module" },
+[168] = { 3, TD, SEN(poll_time32), "poll" },
+[169] = { 3, 0, SEN(nfsservctl), "nfsservctl" },
+[170] = { 3, TC, SEN(setresgid16), "setresgid" },
+[171] = { 3, TC, SEN(getresgid16), "getresgid" },
+[172] = { 5, TC, SEN(prctl), "prctl" },
+[173] = { 0, TS, SEN(rt_sigreturn), "rt_sigreturn" },
+[174] = { 4, TS, SEN(rt_sigaction), "rt_sigaction" },
+[175] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" },
+[176] = { 2, TS, SEN(rt_sigpending), "rt_sigpending" },
+[177] = { 4, TS, SEN(rt_sigtimedwait_time32), "rt_sigtimedwait" },
+[178] = { 3, TS|TP, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" },
+[179] = { 2, TS, SEN(rt_sigsuspend), "rt_sigsuspend" },
+[180] = { 5, TD, SEN(pread), "pread64" },
+[181] = { 5, TD, SEN(pwrite), "pwrite64" },
+[182] = { 3, TF, SEN(chown16), "lchown" },
+[183] = { 2, TF, SEN(getcwd), "getcwd" },
+[184] = { 2, TC, SEN(capget), "capget" },
+[185] = { 2, TC, SEN(capset), "capset" },
+[186] = { 2, TS, SEN(sigaltstack), "sigaltstack" },
+[187] = { 4, TD|TN, SEN(sendfile), "sendfile" },
+[188] = { 5, TN, SEN(getpmsg), "getpmsg" },
+[189] = { 5, TN, SEN(putpmsg), "putpmsg" },
+[190] = { 0, TP, SEN(vfork), "vfork" },
+[191] = { 2, 0, SEN(getrlimit), "ugetrlimit" },
+[192] = { 6, TD|TM|SI, SEN(mmap_pgoff), "mmap2" },
+[193] = { 3, TF, SEN(truncate64), "truncate64" },
+[194] = { 3, TD, SEN(ftruncate64), "ftruncate64" },
+[195] = { 2, TF|TST|TSTA, SEN(stat64), "stat64" },
+[196] = { 2, TF|TLST|TSTA, SEN(lstat64), "lstat64" },
+[197] = { 2, TD|TFST|TSTA, SEN(fstat64), "fstat64" },
+[198] = { 3, TF, SEN(chown), "chown32" },
+[199] = { 0, TC|PU|NF, SEN(getuid), "getuid32" },
+[200] = { 0, TC|PU|NF, SEN(getgid), "getgid32" },
+[201] = { 0, TC|PU|NF, SEN(geteuid), "geteuid32" },
+[202] = { 0, TC|PU|NF, SEN(geteuid), "getegid32" },
+[203] = { 2, TC, SEN(setreuid), "setreuid32" },
+[204] = { 2, TC, SEN(setregid), "setregid32" },
+[205] = { 2, TC, SEN(getgroups), "getgroups32" },
+[206] = { 2, TC, SEN(setgroups), "setgroups32" },
+[207] = { 3, TD, SEN(fchown), "fchown32" },
+[208] = { 3, TC, SEN(setresuid), "setresuid32" },
+[209] = { 3, TC, SEN(getresuid), "getresuid32" },
+[210] = { 3, TC, SEN(setresgid), "setresgid32" },
+[211] = { 3, TC, SEN(getresgid), "getresgid32" },
+[212] = { 3, TF, SEN(chown), "lchown32" },
+[213] = { 1, TC, SEN(setuid), "setuid32" },
+[214] = { 1, TC, SEN(setgid), "setgid32" },
+[215] = { 1, TC|NF, SEN(setfsuid), "setfsuid32" },
+[216] = { 1, TC|NF, SEN(setfsgid), "setfsgid32" },
+[217] = { 2, TF, SEN(pivotroot), "pivot_root" },
+[218 ... 219] = { },
+[220] = { 3, TD, SEN(getdents64), "getdents64" },
+[221] = { 0, PU|NF, SEN(gettid), "gettid" },
+[222] = { 2, TS|TP, SEN(tkill), "tkill" },
+[223] = { 5, TF, SEN(setxattr), "setxattr" },
+[224] = { 5, TF, SEN(setxattr), "lsetxattr" },
+[225] = { 5, TD, SEN(fsetxattr), "fsetxattr" },
+[226] = { 4, TF, SEN(getxattr), "getxattr" },
+[227] = { 4, TF, SEN(getxattr), "lgetxattr" },
+[228] = { 4, TD, SEN(fgetxattr), "fgetxattr" },
+[229] = { 3, TF, SEN(listxattr), "listxattr" },
+[230] = { 3, TF, SEN(listxattr), "llistxattr" },
+[231] = { 3, TD, SEN(flistxattr), "flistxattr" },
+[232] = { 2, TF, SEN(removexattr), "removexattr" },
+[233] = { 2, TF, SEN(removexattr), "lremovexattr" },
+[234] = { 2, TD, SEN(fremovexattr), "fremovexattr" },
+[235] = { 6, 0, SEN(futex_time32), "futex" },
+[236] = { 4, TD|TN, SEN(sendfile64), "sendfile64" },
+[237] = { 3, TM, SEN(mincore), "mincore" },
+[238] = { 3, TM, SEN(madvise), "madvise" },
+[239] = { 3, TD, SEN(fcntl64), "fcntl64" },
+[240] = { 4, TD, SEN(readahead), "readahead" },
+[241] = { 2, TM, SEN(io_setup), "io_setup" },
+[242] = { 1, TM, SEN(io_destroy), "io_destroy" },
+[243] = { 5, 0, SEN(io_getevents_time32), "io_getevents" },
+[244] = { 3, 0, SEN(io_submit), "io_submit" },
+[245] = { 3, 0, SEN(io_cancel), "io_cancel" },
+[246] = { 5, TD, SEN(fadvise64), "fadvise64" },
+[247] = { 1, TP|SE, SEN(exit), "exit_group" },
+[248] = { 4, 0, SEN(lookup_dcookie), "lookup_dcookie" },
+[249] = { 1, TD, SEN(epoll_create), "epoll_create" },
+[250] = { 4, TD, SEN(epoll_ctl), "epoll_ctl" },
+[251] = { 4, TD, SEN(epoll_wait), "epoll_wait" },
+[252] = { 5, TM|SI, SEN(remap_file_pages), "remap_file_pages" },
+[253] = { 1, 0, SEN(set_tid_address), "set_tid_address" },
+[254] = { 3, 0, SEN(timer_create), "timer_create" },
+[255] = { 4, 0, SEN(timer_settime32), "timer_settime" },
+[256] = { 2, 0, SEN(timer_gettime32), "timer_gettime" },
+[257] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" },
+[258] = { 1, 0, SEN(timer_delete), "timer_delete" },
+[259] = { 2, TCL, SEN(clock_settime32), "clock_settime" },
+[260] = { 2, TCL, SEN(clock_gettime32), "clock_gettime" },
+[261] = { 2, TCL, SEN(clock_getres_time32), "clock_getres" },
+[262] = { 4, 0, SEN(clock_nanosleep_time32), "clock_nanosleep" },
+[263] = { 3, TF|TSF|TSFA, SEN(statfs64), "statfs64" },
+[264] = { 3, TD|TFSF|TSFA, SEN(fstatfs64), "fstatfs64" },
+[265] = { 3, TS|TP, SEN(tgkill), "tgkill" },
+[266] = { 2, TF, SEN(utimes), "utimes" },
+[267] = { 6, TD, SEN(fadvise64_64), "fadvise64_64" },
+[268] = { 6, TM, SEN(mbind), "mbind" },
+[269] = { 5, TM, SEN(get_mempolicy), "get_mempolicy" },
+[270] = { 3, TM, SEN(set_mempolicy), "set_mempolicy" },
+[271] = { 4, TD, SEN(mq_open), "mq_open" },
+[272] = { 1, 0, SEN(mq_unlink), "mq_unlink" },
+[273] = { 5, TD, SEN(mq_timedsend_time32), "mq_timedsend" },
+[274] = { 5, TD, SEN(mq_timedreceive_time32), "mq_timedreceive" },
+[275] = { 2, TD, SEN(mq_notify), "mq_notify" },
+[276] = { 3, TD, SEN(mq_getsetattr), "mq_getsetattr" },
+[277] = { 5, TP, SEN(waitid), "waitid" },
+[278] = { 5, 0, SEN(vserver), "vserver" },
+[279] = { 5, 0, SEN(add_key), "add_key" },
+[280] = { 4, 0, SEN(request_key), "request_key" },
+[281] = { 5, 0, SEN(keyctl), "keyctl" },
+[282] = { 3, 0, SEN(ioprio_set), "ioprio_set" },
+[283] = { 2, 0, SEN(ioprio_get), "ioprio_get" },
+[284] = { 0, TD, SEN(inotify_init), "inotify_init" },
+[285] = { 3, TD|TF, SEN(inotify_add_watch), "inotify_add_watch" },
+[286] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" },
+[287] = { 4, TM, SEN(migrate_pages), "migrate_pages" },
+[288] = { 4, TD|TF, SEN(openat), "openat" },
+[289] = { 3, TD|TF, SEN(mkdirat), "mkdirat" },
+[290] = { 4, TD|TF, SEN(mknodat), "mknodat" },
+[291] = { 5, TD|TF, SEN(fchownat), "fchownat" },
+[292] = { 3, TD|TF, SEN(futimesat), "futimesat" },
+[293] = { 4, TD|TF|TFST|TSTA,SEN(fstatat64), "fstatat64" },
+[294] = { 3, TD|TF, SEN(unlinkat), "unlinkat" },
+[295] = { 4, TD|TF, SEN(renameat), "renameat" },
+[296] = { 5, TD|TF, SEN(linkat), "linkat" },
+[297] = { 3, TD|TF, SEN(symlinkat), "symlinkat" },
+[298] = { 4, TD|TF, SEN(readlinkat), "readlinkat" },
+[299] = { 3, TD|TF, SEN(fchmodat), "fchmodat" },
+[300] = { 3, TD|TF, SEN(faccessat), "faccessat" },
+[301] = { 6, TD, SEN(pselect6_time32), "pselect6" },
+[302] = { 5, TD, SEN(ppoll_time32), "ppoll" },
+[303] = { 1, 0, SEN(unshare), "unshare" },
+[304] = { 2, 0, SEN(set_robust_list), "set_robust_list" },
+[305] = { 3, 0, SEN(get_robust_list), "get_robust_list" },
+[306] = { 6, TD, SEN(splice), "splice" },
+[307] = { 6, TD, SEN(sync_file_range), "sync_file_range" },
+[308] = { 4, TD, SEN(tee), "tee" },
+[309] = { 4, TD, SEN(vmsplice), "vmsplice" },
+[310] = { 6, TM, SEN(move_pages), "move_pages" },
+[311] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" },
+[312] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" },
+[313] = { 4, 0, SEN(kexec_load), "kexec_load" },
+[314] = { 3, 0, SEN(getcpu), "getcpu" },
+[315] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" },
+[316] = { 4, TD|TF, SEN(utimensat_time32), "utimensat" },
+[317] = { 3, TD|TS, SEN(signalfd), "signalfd" },
+[318] = { 2, TD, SEN(timerfd_create), "timerfd_create" },
+[319] = { 1, TD, SEN(eventfd), "eventfd" },
+[320] = { 6, TD, SEN(fallocate), "fallocate" },
+[321] = { 4, TD, SEN(timerfd_settime32), "timerfd_settime" },
+[322] = { 2, TD, SEN(timerfd_gettime32), "timerfd_gettime" },
+[323] = { 4, TD|TS, SEN(signalfd4), "signalfd4" },
+[324] = { 2, TD, SEN(eventfd2), "eventfd2" },
+[325] = { 1, TD, SEN(epoll_create1), "epoll_create1" },
+[326] = { 3, TD, SEN(dup3), "dup3" },
+[327] = { 2, TD, SEN(pipe2), "pipe2" },
+[328] = { 1, TD, SEN(inotify_init1), "inotify_init1" },
+[329] = { 5, TD, SEN(preadv), "preadv" },
+[330] = { 5, TD, SEN(pwritev), "pwritev" },
+[331] = { 4, TP|TS, SEN(rt_tgsigqueueinfo), "rt_tgsigqueueinfo" },
+[332] = { 5, TD, SEN(perf_event_open), "perf_event_open" },
+[333] = { 0, PU|NF, SEN(get_thread_area), "get_thread_area" },
+[334] = { 1, 0, SEN(set_thread_area), "set_thread_area" },
+[335] = { 6, 0, SEN(printargs), "atomic_cmpxchg_32" },
+[336] = { 0, 0, SEN(printargs), "atomic_barrier" },
+[337] = { 2, TD, SEN(fanotify_init), "fanotify_init" },
+[338] = { 6, TD|TF, SEN(fanotify_mark), "fanotify_mark" },
+[339] = { 4, 0, SEN(prlimit64), "prlimit64" },
+[340] = { 5, TD|TF, SEN(name_to_handle_at), "name_to_handle_at" },
+[341] = { 3, TD, SEN(open_by_handle_at), "open_by_handle_at" },
+[342] = { 2, TCL, SEN(clock_adjtime32), "clock_adjtime" },
+[343] = { 1, TD, SEN(syncfs), "syncfs" },
+[344] = { 2, TD, SEN(setns), "setns" },
+[345] = { 6, 0, SEN(process_vm_readv), "process_vm_readv" },
+[346] = { 6, 0, SEN(process_vm_writev), "process_vm_writev" },
+[347] = { 5, 0, SEN(kcmp), "kcmp" },
+[348] = { 3, TD, SEN(finit_module), "finit_module" },
+[349] = { 3, 0, SEN(sched_setattr), "sched_setattr" },
+[350] = { 4, 0, SEN(sched_getattr), "sched_getattr" },
+[351] = { 5, TD|TF, SEN(renameat2), "renameat2" },
+[352] = { 3, 0, SEN(getrandom), "getrandom" },
+[353] = { 2, TD, SEN(memfd_create), "memfd_create" },
+[354] = { 3, TD, SEN(bpf), "bpf" },
+[355] = { 5, TD|TF|TP|TSD|SE|SI, SEN(execveat), "execveat" },
+[356] = { 3, TN, SEN(socket), "socket" },
+[357] = { 4, TN, SEN(socketpair), "socketpair" },
+[358] = { 3, TN, SEN(bind), "bind" },
+[359] = { 3, TN, SEN(connect), "connect" },
+[360] = { 2, TN, SEN(listen), "listen" },
+[361] = { 4, TN, SEN(accept4), "accept4" },
+[362] = { 5, TN, SEN(getsockopt), "getsockopt" },
+[363] = { 5, TN, SEN(setsockopt), "setsockopt" },
+[364] = { 3, TN, SEN(getsockname), "getsockname" },
+[365] = { 3, TN, SEN(getpeername), "getpeername" },
+[366] = { 6, TN, SEN(sendto), "sendto" },
+[367] = { 3, TN, SEN(sendmsg), "sendmsg" },
+[368] = { 6, TN, SEN(recvfrom), "recvfrom" },
+[369] = { 3, TN, SEN(recvmsg), "recvmsg" },
+[370] = { 2, TN, SEN(shutdown), "shutdown" },
+[371] = { 5, TN, SEN(recvmmsg_time32), "recvmmsg" },
+[372] = { 4, TN, SEN(sendmmsg), "sendmmsg" },
+[373] = { 1, TD, SEN(userfaultfd), "userfaultfd" },
+[374] = { 3, 0, SEN(membarrier), "membarrier" },
+[375] = { 3, TM, SEN(mlock2), "mlock2" },
+[376] = { 6, TD, SEN(copy_file_range), "copy_file_range" },
+[377] = { 6, TD, SEN(preadv2), "preadv2" },
+[378] = { 6, TD, SEN(pwritev2), "pwritev2" },
+[379] = { 5, TD|TF|TFST|TSTA,SEN(statx), "statx" },
+[380] = { 3, 0, SEN(seccomp), "seccomp" },
+[381] = { 4, TM|SI, SEN(pkey_mprotect), "pkey_mprotect" },
+[382] = { 2, 0, SEN(pkey_alloc), "pkey_alloc" },
+[383] = { 1, 0, SEN(pkey_free), "pkey_free" },
+[384] = { 4, 0, SEN(rseq), "rseq" },
+/* room for arch specific calls */
+[393] = { 3, TI, SEN(semget), "semget" },
+[394] = { 4, TI, SEN(semctl), "semctl" },
+[395] = { 3, TI, SEN(shmget), "shmget" },
+[396] = { 3, TI, SEN(shmctl), "shmctl" },
+[397] = { 3, TI|TM|SI, SEN(shmat), "shmat" },
+[398] = { 1, TI|TM|SI, SEN(shmdt), "shmdt" },
+[399] = { 2, TI, SEN(msgget), "msgget" },
+[400] = { 4, TI, SEN(msgsnd), "msgsnd" },
+[401] = { 5, TI, SEN(msgrcv), "msgrcv" },
+[402] = { 3, TI, SEN(msgctl), "msgctl" },
+#include "syscallent-common-32.h"
+#include "syscallent-common.h"
+
+#define SYS_socket_subcall 500
+#include "subcall32.h"
diff --git a/src/linux/m68k/userent.h b/src/linux/m68k/userent.h
new file mode 100644
index 000000000..ba14c11ab
--- /dev/null
+++ b/src/linux/m68k/userent.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2014-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+XLAT(4*PT_D1),
+XLAT(4*PT_D2),
+XLAT(4*PT_D3),
+XLAT(4*PT_D4),
+XLAT(4*PT_D5),
+XLAT(4*PT_D6),
+XLAT(4*PT_D7),
+XLAT(4*PT_A0),
+XLAT(4*PT_A1),
+XLAT(4*PT_A2),
+XLAT(4*PT_A3),
+XLAT(4*PT_A4),
+XLAT(4*PT_A5),
+XLAT(4*PT_A6),
+XLAT(4*PT_D0),
+XLAT(4*PT_USP),
+XLAT(4*PT_ORIG_D0),
+XLAT(4*PT_SR),
+XLAT(4*PT_PC),
+/* Other fields in "struct user" */
+XLAT_UOFF(u_fpvalid),
+XLAT_UOFF(m68kfp),
+XLAT_UOFF(u_tsize),
+XLAT_UOFF(u_dsize),
+XLAT_UOFF(u_ssize),
+XLAT_UOFF(start_code),
+XLAT_UOFF(start_stack),
+XLAT_UOFF(signal),
+XLAT_UOFF(reserved),
+XLAT_UOFF(u_ar0),
+XLAT_UOFF(u_fpstate),
+XLAT_UOFF(magic),
+XLAT_UOFF(u_comm),
+#include "../userent0.h"
diff --git a/src/linux/metag/arch_regs.c b/src/linux/metag/arch_regs.c
new file mode 100644
index 000000000..67ee70fe9
--- /dev/null
+++ b/src/linux/metag/arch_regs.c
@@ -0,0 +1,11 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static struct user_gp_regs metag_regs;
+#define ARCH_REGS_FOR_GETREGSET metag_regs
+#define ARCH_PC_REG metag_regs.pc
+#define ARCH_SP_REG metag_regs.ax[0][0]
diff --git a/src/linux/metag/arch_rt_sigframe.c b/src/linux/metag/arch_rt_sigframe.c
new file mode 100644
index 000000000..13f95f608
--- /dev/null
+++ b/src/linux/metag/arch_rt_sigframe.c
@@ -0,0 +1,15 @@
+/*
+ * Copyright (c) 2017-2018 Dmitry V. Levin <ldv@strace.io>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "rt_sigframe.h"
+
+FUNC_GET_RT_SIGFRAME_ADDR
+{
+ kernel_ulong_t sp;
+ return get_stack_pointer(tcp, &sp)
+ ? sp - sizeof(struct_rt_sigframe) : 0;
+}
diff --git a/src/linux/metag/get_error.c b/src/linux/metag/get_error.c
new file mode 100644
index 000000000..b1e1649c3
--- /dev/null
+++ b/src/linux/metag/get_error.c
@@ -0,0 +1,20 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "negated_errno.h"
+
+static void
+arch_get_error(struct tcb *tcp, const bool check_errno)
+{
+ /* result pointer in D0Re0 (D0.0) */
+ if (check_errno && is_negated_errno(metag_regs.dx[0][0])) {
+ tcp->u_rval = -1;
+ tcp->u_error = -metag_regs.dx[0][0];
+ } else {
+ tcp->u_rval = metag_regs.dx[0][0];
+ }
+}
diff --git a/src/linux/metag/get_scno.c b/src/linux/metag/get_scno.c
new file mode 100644
index 000000000..e7b83e285
--- /dev/null
+++ b/src/linux/metag/get_scno.c
@@ -0,0 +1,14 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+/* Return codes: 1 - ok, 0 - ignore, other - error. */
+static int
+arch_get_scno(struct tcb *tcp)
+{
+ tcp->scno = metag_regs.dx[0][1]; /* syscall number in D1Re0 (D1.0) */
+ return 1;
+}
diff --git a/src/linux/metag/get_syscall_args.c b/src/linux/metag/get_syscall_args.c
new file mode 100644
index 000000000..7f3c5cf2c
--- /dev/null
+++ b/src/linux/metag/get_syscall_args.c
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+/* Return -1 on error or 1 on success (never 0!). */
+static int
+arch_get_syscall_args(struct tcb *tcp)
+{
+ unsigned int i;
+
+ for (i = 0; i < MAX_ARGS; i++) {
+ /* arguments go backwards from D1Ar1 (D1.3) */
+ tcp->u_arg[i] = (&metag_regs.dx[3][1])[-i];
+ }
+ return 1;
+}
diff --git a/src/linux/metag/ioctls_arch0.h b/src/linux/metag/ioctls_arch0.h
new file mode 100644
index 000000000..191bb36ec
--- /dev/null
+++ b/src/linux/metag/ioctls_arch0.h
@@ -0,0 +1 @@
+/* Generated by ioctls_gen.sh from definitions found in $linux/arch/metag/include/ tree. */
diff --git a/src/linux/metag/ioctls_inc0.h b/src/linux/metag/ioctls_inc0.h
new file mode 100644
index 000000000..4aecf983e
--- /dev/null
+++ b/src/linux/metag/ioctls_inc0.h
@@ -0,0 +1 @@
+#include "32/ioctls_inc.h"
diff --git a/src/linux/metag/raw_syscall.h b/src/linux/metag/raw_syscall.h
new file mode 100644
index 000000000..f8d12d5fc
--- /dev/null
+++ b/src/linux/metag/raw_syscall.h
@@ -0,0 +1,29 @@
+/*
+ * Raw syscalls.
+ *
+ * Copyright (c) 2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_RAW_SYSCALL_H
+# define STRACE_RAW_SYSCALL_H
+
+# include "kernel_types.h"
+
+static inline kernel_ulong_t
+raw_syscall_0(const kernel_ulong_t nr, kernel_ulong_t *err)
+{
+ *err = 0;
+ register kernel_ulong_t num __asm__("D1Re0") = nr;
+ register kernel_ulong_t ret __asm__("D0Re0");
+ __asm__ __volatile__("SWITCH #0x440001"
+ : "=r"(ret)
+ : "d"(num)
+ : "memory");
+ return ret;
+}
+# define raw_syscall_0 raw_syscall_0
+
+#endif /* !STRACE_RAW_SYSCALL_H */
diff --git a/src/linux/metag/set_error.c b/src/linux/metag/set_error.c
new file mode 100644
index 000000000..18e42dd40
--- /dev/null
+++ b/src/linux/metag/set_error.c
@@ -0,0 +1,20 @@
+/*
+ * Copyright (c) 2016-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static int
+arch_set_error(struct tcb *tcp)
+{
+ metag_regs.dx[0][0] = -tcp->u_error;
+ return set_regs(tcp->pid);
+}
+
+static int
+arch_set_success(struct tcb *tcp)
+{
+ metag_regs.dx[0][0] = tcp->u_rval;
+ return set_regs(tcp->pid);
+}
diff --git a/src/linux/metag/set_scno.c b/src/linux/metag/set_scno.c
new file mode 100644
index 000000000..ae8f52dc3
--- /dev/null
+++ b/src/linux/metag/set_scno.c
@@ -0,0 +1,15 @@
+/*
+ * Copyright (c) 2016-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static int
+arch_set_scno(struct tcb *tcp, kernel_ulong_t scno)
+{
+ if (ptrace_syscall_info_is_valid() && get_regs(tcp) < 0)
+ return -1;
+ metag_regs.dx[0][1] = scno;
+ return set_regs(tcp->pid);
+}
diff --git a/src/linux/metag/syscallent.h b/src/linux/metag/syscallent.h
new file mode 100644
index 000000000..f305974e6
--- /dev/null
+++ b/src/linux/metag/syscallent.h
@@ -0,0 +1,13 @@
+/*
+ * Copyright (c) 2013-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "32/syscallent.h"
+/* [244 ... 259] are arch specific */
+[245] = { 2, 0, SEN(printargs), "metag_setglobalbit" },
+[246] = { 1, 0, SEN(printargs), "metag_set_fpu_flags" },
+[247] = { 1, 0, SEN(printargs), "metag_set_tls" },
+[248] = { 0, PU|NF, SEN(printargs), "metag_get_tls" },
diff --git a/src/linux/microblaze/arch_defs_.h b/src/linux/microblaze/arch_defs_.h
new file mode 100644
index 000000000..309d8e7e0
--- /dev/null
+++ b/src/linux/microblaze/arch_defs_.h
@@ -0,0 +1,9 @@
+/*
+ * Copyright (c) 2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#define HAVE_ARCH_OLD_SELECT 1
+#define HAVE_ARCH_UID16_SYSCALLS 1
diff --git a/src/linux/microblaze/arch_regs.c b/src/linux/microblaze/arch_regs.c
new file mode 100644
index 000000000..4faf93764
--- /dev/null
+++ b/src/linux/microblaze/arch_regs.c
@@ -0,0 +1,10 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static unsigned long microblaze_r3;
+#define ARCH_PC_PEEK_ADDR PT_PC
+#define ARCH_SP_PEEK_ADDR PT_GPR(1)
diff --git a/src/linux/microblaze/arch_sigreturn.c b/src/linux/microblaze/arch_sigreturn.c
new file mode 100644
index 000000000..c15d1773b
--- /dev/null
+++ b/src/linux/microblaze/arch_sigreturn.c
@@ -0,0 +1,21 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static void
+arch_sigreturn(struct tcb *tcp)
+{
+ /* TODO: Verify that this is correct... */
+
+ unsigned long addr;
+
+ /* Read r1, the stack pointer. */
+ if (upeek(tcp, 1 * 4, &addr) < 0)
+ return;
+ addr += offsetof(struct sigcontext, oldmask);
+
+ print_sigset_addr(tcp, addr);
+}
diff --git a/src/linux/microblaze/get_error.c b/src/linux/microblaze/get_error.c
new file mode 100644
index 000000000..b7ad28dc9
--- /dev/null
+++ b/src/linux/microblaze/get_error.c
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "negated_errno.h"
+
+static void
+arch_get_error(struct tcb *tcp, const bool check_errno)
+{
+ if (check_errno && is_negated_errno(microblaze_r3)) {
+ tcp->u_rval = -1;
+ tcp->u_error = -microblaze_r3;
+ } else {
+ tcp->u_rval = microblaze_r3;
+ }
+}
diff --git a/src/linux/microblaze/get_scno.c b/src/linux/microblaze/get_scno.c
new file mode 100644
index 000000000..aaf2dcb34
--- /dev/null
+++ b/src/linux/microblaze/get_scno.c
@@ -0,0 +1,13 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+/* Return codes: 1 - ok, 0 - ignore, other - error. */
+static int
+arch_get_scno(struct tcb *tcp)
+{
+ return upeek(tcp, 0, &tcp->scno) < 0 ? -1 : 1;
+}
diff --git a/src/linux/microblaze/get_syscall_args.c b/src/linux/microblaze/get_syscall_args.c
new file mode 100644
index 000000000..0be850156
--- /dev/null
+++ b/src/linux/microblaze/get_syscall_args.c
@@ -0,0 +1,18 @@
+/*
+ * Copyright (c) 2015-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+/* Return -1 on error or 1 on success (never 0!). */
+static int
+arch_get_syscall_args(struct tcb *tcp)
+{
+ unsigned int i;
+
+ for (i = 0; i < n_args(tcp); ++i)
+ if (upeek(tcp, (5 + i) * 4, &tcp->u_arg[i]) < 0)
+ return -1;
+ return 1;
+}
diff --git a/src/linux/microblaze/get_syscall_result.c b/src/linux/microblaze/get_syscall_result.c
new file mode 100644
index 000000000..79f23ca49
--- /dev/null
+++ b/src/linux/microblaze/get_syscall_result.c
@@ -0,0 +1,12 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static int
+get_syscall_result_regs(struct tcb *tcp)
+{
+ return upeek(tcp, 3 * 4, &microblaze_r3) < 0 ? -1 : 0;
+}
diff --git a/src/linux/microblaze/ioctls_arch0.h b/src/linux/microblaze/ioctls_arch0.h
new file mode 100644
index 000000000..e310f8e7e
--- /dev/null
+++ b/src/linux/microblaze/ioctls_arch0.h
@@ -0,0 +1 @@
+/* Generated by ioctls_gen.sh from definitions found in $linux/arch/microblaze/include/ tree. */
diff --git a/src/linux/microblaze/ioctls_inc0.h b/src/linux/microblaze/ioctls_inc0.h
new file mode 100644
index 000000000..4aecf983e
--- /dev/null
+++ b/src/linux/microblaze/ioctls_inc0.h
@@ -0,0 +1 @@
+#include "32/ioctls_inc.h"
diff --git a/src/linux/microblaze/raw_syscall.h b/src/linux/microblaze/raw_syscall.h
new file mode 100644
index 000000000..fe47aa346
--- /dev/null
+++ b/src/linux/microblaze/raw_syscall.h
@@ -0,0 +1,30 @@
+/*
+ * Raw syscalls.
+ *
+ * Copyright (c) 2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_RAW_SYSCALL_H
+# define STRACE_RAW_SYSCALL_H
+
+# include "kernel_types.h"
+
+static inline kernel_ulong_t
+raw_syscall_0(const kernel_ulong_t nr, kernel_ulong_t *err)
+{
+ *err = 0;
+ register kernel_ulong_t r12 __asm__("r12") = nr;
+ register kernel_ulong_t r3 __asm__("r3");
+ __asm__ __volatile__("brki r14, 8"
+ : "=r"(r3)
+ : "r"(r12)
+ : "memory", "r4", "r5", "r6", "r7",
+ "r8", "r9", "r10", "r11");
+ return r3;
+}
+# define raw_syscall_0 raw_syscall_0
+
+#endif /* !STRACE_RAW_SYSCALL_H */
diff --git a/src/linux/microblaze/set_error.c b/src/linux/microblaze/set_error.c
new file mode 100644
index 000000000..71b3fbc31
--- /dev/null
+++ b/src/linux/microblaze/set_error.c
@@ -0,0 +1,20 @@
+/*
+ * Copyright (c) 2016-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static int
+arch_set_error(struct tcb *tcp)
+{
+ microblaze_r3 = -tcp->u_error;
+ return upoke(tcp, 3 * 4, microblaze_r3);
+}
+
+static int
+arch_set_success(struct tcb *tcp)
+{
+ microblaze_r3 = tcp->u_rval;
+ return upoke(tcp, 3 * 4, microblaze_r3);
+}
diff --git a/src/linux/microblaze/set_scno.c b/src/linux/microblaze/set_scno.c
new file mode 100644
index 000000000..cf896cc20
--- /dev/null
+++ b/src/linux/microblaze/set_scno.c
@@ -0,0 +1,12 @@
+/*
+ * Copyright (c) 2016-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static int
+arch_set_scno(struct tcb *tcp, kernel_ulong_t scno)
+{
+ return upoke(tcp, 0, scno);
+}
diff --git a/src/linux/microblaze/syscallent.h b/src/linux/microblaze/syscallent.h
new file mode 100644
index 000000000..6e557b300
--- /dev/null
+++ b/src/linux/microblaze/syscallent.h
@@ -0,0 +1,412 @@
+/*
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993, 1994, 1995 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1995-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+[ 0] = { 0, 0, SEN(restart_syscall), "restart_syscall" },
+[ 1] = { 1, TP|SE, SEN(exit), "exit" },
+[ 2] = { 0, TP, SEN(fork), "fork" },
+[ 3] = { 3, TD, SEN(read), "read" },
+[ 4] = { 3, TD, SEN(write), "write" },
+[ 5] = { 3, TD|TF, SEN(open), "open" },
+[ 6] = { 1, TD, SEN(close), "close" },
+[ 7] = { 3, TP, SEN(waitpid), "waitpid" },
+[ 8] = { 2, TD|TF, SEN(creat), "creat" },
+[ 9] = { 2, TF, SEN(link), "link" },
+[ 10] = { 1, TF, SEN(unlink), "unlink" },
+[ 11] = { 3, TF|TP|TSD|SE|SI, SEN(execve), "execve" },
+[ 12] = { 1, TF, SEN(chdir), "chdir" },
+[ 13] = { 1, TCL, SEN(time), "time" },
+[ 14] = { 3, TF, SEN(mknod), "mknod" },
+[ 15] = { 2, TF, SEN(chmod), "chmod" },
+[ 16] = { 3, TF, SEN(chown16), "lchown" },
+[ 17] = { 0, TM, SEN(break), "break" },
+[ 18] = { 2, TF|TST|TSTA, SEN(oldstat), "oldstat" },
+[ 19] = { 3, TD, SEN(lseek), "lseek" },
+[ 20] = { 0, PU|NF, SEN(getpid), "getpid" },
+[ 21] = { 5, TF, SEN(mount), "mount" },
+[ 22] = { 1, TF, SEN(umount), "umount" },
+[ 23] = { 1, TC, SEN(setuid16), "setuid" },
+[ 24] = { 0, TC|PU|NF, SEN(getuid16), "getuid" },
+[ 25] = { 1, 0, SEN(stime), "stime" },
+[ 26] = { 4, 0, SEN(ptrace), "ptrace" },
+[ 27] = { 1, 0, SEN(alarm), "alarm" },
+[ 28] = { 2, TD|TFST|TSTA, SEN(oldfstat), "oldfstat" },
+[ 29] = { 0, TS, SEN(pause), "pause" },
+[ 30] = { 2, TF, SEN(utime), "utime" },
+[ 31] = { 2, 0, SEN(stty), "stty" },
+[ 32] = { 2, 0, SEN(gtty), "gtty" },
+[ 33] = { 2, TF, SEN(access), "access" },
+[ 34] = { 1, 0, SEN(nice), "nice" },
+[ 35] = { 0, 0, SEN(ftime), "ftime" },
+[ 36] = { 0, 0, SEN(sync), "sync" },
+[ 37] = { 2, TS|TP, SEN(kill), "kill" },
+[ 38] = { 2, TF, SEN(rename), "rename" },
+[ 39] = { 2, TF, SEN(mkdir), "mkdir" },
+[ 40] = { 1, TF, SEN(rmdir), "rmdir" },
+[ 41] = { 1, TD, SEN(dup), "dup" },
+[ 42] = { 1, TD, SEN(pipe), "pipe" },
+[ 43] = { 1, 0, SEN(times), "times" },
+[ 44] = { 0, 0, SEN(prof), "prof" },
+[ 45] = { 1, TM|SI, SEN(brk), "brk" },
+[ 46] = { 1, TC, SEN(setgid16), "setgid" },
+[ 47] = { 0, TC|PU|NF, SEN(getgid16), "getgid" },
+[ 48] = { 2, TS, SEN(signal), "signal" },
+[ 49] = { 0, TC|PU|NF, SEN(geteuid16), "geteuid" },
+[ 50] = { 0, TC|PU|NF, SEN(getegid16), "getegid" },
+[ 51] = { 1, TF, SEN(acct), "acct" },
+[ 52] = { 2, TF, SEN(umount2), "umount2" },
+[ 53] = { 0, 0, SEN(lock), "lock" },
+[ 54] = { 3, TD, SEN(ioctl), "ioctl" },
+[ 55] = { 3, TD, SEN(fcntl), "fcntl" },
+[ 56] = { 0, 0, SEN(mpx), "mpx" },
+[ 57] = { 2, 0, SEN(setpgid), "setpgid" },
+[ 58] = { 2, 0, SEN(ulimit), "ulimit" },
+[ 59] = { 1, 0, SEN(oldolduname), "oldolduname" },
+[ 60] = { 1, NF, SEN(umask), "umask" },
+[ 61] = { 1, TF, SEN(chroot), "chroot" },
+[ 62] = { 2, TSFA, SEN(ustat), "ustat" },
+[ 63] = { 2, TD, SEN(dup2), "dup2" },
+[ 64] = { 0, PU|NF, SEN(getppid), "getppid" },
+[ 65] = { 0, PU|NF, SEN(getpgrp), "getpgrp" },
+[ 66] = { 0, 0, SEN(setsid), "setsid" },
+[ 67] = { 3, TS, SEN(sigaction), "sigaction" },
+[ 68] = { 0, TS, SEN(sgetmask), "sgetmask" },
+[ 69] = { 1, TS, SEN(ssetmask), "ssetmask" },
+[ 70] = { 2, TC, SEN(setreuid16), "setreuid" },
+[ 71] = { 2, TC, SEN(setregid16), "setregid" },
+[ 72] = { 3, TS, SEN(sigsuspend), "sigsuspend" },
+[ 73] = { 1, TS, SEN(sigpending), "sigpending" },
+[ 74] = { 2, 0, SEN(sethostname), "sethostname" },
+[ 75] = { 2, 0, SEN(setrlimit), "setrlimit" },
+[ 76] = { 2, 0, SEN(getrlimit), "getrlimit" },
+[ 77] = { 2, 0, SEN(getrusage), "getrusage" },
+[ 78] = { 2, TCL, SEN(gettimeofday), "gettimeofday" },
+[ 79] = { 2, TCL, SEN(settimeofday), "settimeofday" },
+[ 80] = { 2, TC, SEN(getgroups16), "getgroups" },
+[ 81] = { 2, TC, SEN(setgroups16), "setgroups" },
+[ 82] = { 1, TD, SEN(oldselect), "select" },
+[ 83] = { 2, TF, SEN(symlink), "symlink" },
+[ 84] = { 2, TF|TLST|TSTA, SEN(oldlstat), "oldlstat" },
+[ 85] = { 3, TF, SEN(readlink), "readlink" },
+[ 86] = { 1, TF, SEN(uselib), "uselib" },
+[ 87] = { 2, TF, SEN(swapon), "swapon" },
+[ 88] = { 4, 0, SEN(reboot), "reboot" },
+[ 89] = { 3, TD, SEN(readdir), "readdir" },
+[ 90] = { 6, TD|TM|SI, SEN(mmap), "mmap" },
+[ 91] = { 2, TM|SI, SEN(munmap), "munmap" },
+[ 92] = { 2, TF, SEN(truncate), "truncate" },
+[ 93] = { 2, TD, SEN(ftruncate), "ftruncate" },
+[ 94] = { 2, TD, SEN(fchmod), "fchmod" },
+[ 95] = { 3, TD, SEN(fchown16), "fchown" },
+[ 96] = { 2, 0, SEN(getpriority), "getpriority" },
+[ 97] = { 3, 0, SEN(setpriority), "setpriority" },
+[ 98] = { 4, 0, SEN(profil), "profil" },
+[ 99] = { 2, TF|TSF|TSFA, SEN(statfs), "statfs" },
+[100] = { 2, TD|TFSF|TSFA, SEN(fstatfs), "fstatfs" },
+[101] = { 3, 0, SEN(ioperm), "ioperm" },
+[102] = { 2, TD|TSD, SEN(socketcall), "socketcall" },
+[103] = { 3, 0, SEN(syslog), "syslog" },
+[104] = { 3, 0, SEN(setitimer), "setitimer" },
+[105] = { 2, 0, SEN(getitimer), "getitimer" },
+[106] = { 2, TF|TST|TSTA, SEN(stat), "stat" },
+[107] = { 2, TF|TLST|TSTA, SEN(lstat), "lstat" },
+[108] = { 2, TD|TFST|TSTA, SEN(fstat), "fstat" },
+[109] = { 1, 0, SEN(olduname), "olduname" },
+[110] = { 1, 0, SEN(iopl), "iopl" },
+[111] = { 0, 0, SEN(vhangup), "vhangup" },
+[112] = { 0, 0, SEN(idle), "idle" },
+[113] = { 1, 0, SEN(vm86old), "vm86old" },
+[114] = { 4, TP, SEN(wait4), "wait4" },
+[115] = { 1, TF, SEN(swapoff), "swapoff" },
+[116] = { 1, 0, SEN(sysinfo), "sysinfo" },
+[117] = { 6, TI|TSD, SEN(ipc), "ipc" },
+[118] = { 1, TD, SEN(fsync), "fsync" },
+[119] = { 0, TS, SEN(sigreturn), "sigreturn" },
+[120] = { 6, TP, SEN(clone), "clone" },
+[121] = { 2, 0, SEN(setdomainname), "setdomainname" },
+[122] = { 1, 0, SEN(uname), "uname" },
+[123] = { 3, 0, SEN(modify_ldt), "modify_ldt" },
+[124] = { 1, TCL, SEN(adjtimex32), "adjtimex" },
+[125] = { 3, TM|SI, SEN(mprotect), "mprotect" },
+[126] = { 3, TS, SEN(sigprocmask), "sigprocmask" },
+[127] = { 2, 0, SEN(create_module), "create_module" },
+[128] = { 3, 0, SEN(init_module), "init_module" },
+[129] = { 2, 0, SEN(delete_module), "delete_module" },
+[130] = { 1, 0, SEN(get_kernel_syms), "get_kernel_syms" },
+[131] = { 4, TF, SEN(quotactl), "quotactl" },
+[132] = { 1, 0, SEN(getpgid), "getpgid" },
+[133] = { 1, TD, SEN(fchdir), "fchdir" },
+[134] = { 2, 0, SEN(bdflush), "bdflush" },
+[135] = { 3, 0, SEN(sysfs), "sysfs" },
+[136] = { 1, NF, SEN(personality), "personality" },
+[137] = { 5, 0, SEN(afs_syscall), "afs_syscall" },
+[138] = { 1, TC|NF, SEN(setfsuid16), "setfsuid" },
+[139] = { 1, TC|NF, SEN(setfsgid16), "setfsgid" },
+[140] = { 5, TD, SEN(llseek), "_llseek" },
+[141] = { 3, TD, SEN(getdents), "getdents" },
+[142] = { 5, TD, SEN(select), "_newselect" },
+[143] = { 2, TD, SEN(flock), "flock" },
+[144] = { 3, TM, SEN(msync), "msync" },
+[145] = { 3, TD, SEN(readv), "readv" },
+[146] = { 3, TD, SEN(writev), "writev" },
+[147] = { 1, 0, SEN(getsid), "getsid" },
+[148] = { 1, TD, SEN(fdatasync), "fdatasync" },
+[149] = { 1, 0, SEN(sysctl), "_sysctl" },
+[150] = { 2, TM, SEN(mlock), "mlock" },
+[151] = { 2, TM, SEN(munlock), "munlock" },
+[152] = { 1, TM, SEN(mlockall), "mlockall" },
+[153] = { 0, TM, SEN(munlockall), "munlockall" },
+[154] = { 2, 0, SEN(sched_setparam), "sched_setparam" },
+[155] = { 2, 0, SEN(sched_getparam), "sched_getparam" },
+[156] = { 3, 0, SEN(sched_setscheduler), "sched_setscheduler" },
+[157] = { 1, 0, SEN(sched_getscheduler), "sched_getscheduler" },
+[158] = { 0, 0, SEN(sched_yield), "sched_yield" },
+[159] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"},
+[160] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"},
+[161] = { 2, 0, SEN(sched_rr_get_interval_time32),"sched_rr_get_interval"},
+[162] = { 2, 0, SEN(nanosleep_time32), "nanosleep" },
+[163] = { 5, TM|SI, SEN(mremap), "mremap" },
+[164] = { 3, TC, SEN(setresuid16), "setresuid" },
+[165] = { 3, TC, SEN(getresuid16), "getresuid" },
+[166] = { 5, 0, SEN(vm86), "vm86" },
+[167] = { 5, 0, SEN(query_module), "query_module" },
+[168] = { 3, TD, SEN(poll_time32), "poll" },
+[169] = { 3, 0, SEN(nfsservctl), "nfsservctl" },
+[170] = { 3, TC, SEN(setresgid16), "setresgid" },
+[171] = { 3, TC, SEN(getresgid16), "getresgid" },
+[172] = { 5, TC, SEN(prctl), "prctl" },
+[173] = { 0, TS, SEN(rt_sigreturn), "rt_sigreturn" },
+[174] = { 4, TS, SEN(rt_sigaction), "rt_sigaction" },
+[175] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" },
+[176] = { 2, TS, SEN(rt_sigpending), "rt_sigpending" },
+[177] = { 4, TS, SEN(rt_sigtimedwait_time32), "rt_sigtimedwait" },
+[178] = { 3, TS|TP, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" },
+[179] = { 2, TS, SEN(rt_sigsuspend), "rt_sigsuspend" },
+[180] = { 5, TD, SEN(pread), "pread64" },
+[181] = { 5, TD, SEN(pwrite), "pwrite64" },
+[182] = { 3, TF, SEN(chown16), "chown" },
+[183] = { 2, TF, SEN(getcwd), "getcwd" },
+[184] = { 2, TC, SEN(capget), "capget" },
+[185] = { 2, TC, SEN(capset), "capset" },
+[186] = { 2, TS, SEN(sigaltstack), "sigaltstack" },
+[187] = { 4, TD|TN, SEN(sendfile), "sendfile" },
+[188] = { 5, TN, SEN(getpmsg), "getpmsg" },
+[189] = { 5, TN, SEN(putpmsg), "putpmsg" },
+[190] = { 0, TP, SEN(vfork), "vfork" },
+[191] = { 2, 0, SEN(getrlimit), "ugetrlimit" },
+[192] = { 6, TD|TM|SI, SEN(mmap_pgoff), "mmap2" },
+[193] = { 3, TF, SEN(truncate64), "truncate64" },
+[194] = { 3, TD, SEN(ftruncate64), "ftruncate64" },
+[195] = { 2, TF|TST|TSTA, SEN(stat64), "stat64" },
+[196] = { 2, TF|TLST|TSTA, SEN(lstat64), "lstat64" },
+[197] = { 2, TD|TFST|TSTA, SEN(fstat64), "fstat64" },
+[198] = { 3, TF, SEN(chown), "lchown32" },
+[199] = { 0, TC|PU|NF, SEN(getuid), "getuid32" },
+[200] = { 0, TC|PU|NF, SEN(getgid), "getgid32" },
+[201] = { 0, TC|PU|NF, SEN(geteuid), "geteuid32" },
+[202] = { 0, TC|PU|NF, SEN(geteuid), "getegid32" },
+[203] = { 2, TC, SEN(setreuid), "setreuid32" },
+[204] = { 2, TC, SEN(setregid), "setregid32" },
+[205] = { 2, TC, SEN(getgroups), "getgroups32" },
+[206] = { 2, TC, SEN(setgroups), "setgroups32" },
+[207] = { 3, TD, SEN(fchown), "fchown32" },
+[208] = { 3, TC, SEN(setresuid), "setresuid32" },
+[209] = { 3, TC, SEN(getresuid), "getresuid32" },
+[210] = { 3, TC, SEN(setresgid), "setresgid32" },
+[211] = { 3, TC, SEN(getresgid), "getresgid32" },
+[212] = { 3, TF, SEN(chown), "chown32" },
+[213] = { 1, TC, SEN(setuid), "setuid32" },
+[214] = { 1, TC, SEN(setgid), "setgid32" },
+[215] = { 1, TC|NF, SEN(setfsuid), "setfsuid32" },
+[216] = { 1, TC|NF, SEN(setfsgid), "setfsgid32" },
+[217] = { 2, TF, SEN(pivotroot), "pivot_root" },
+[218] = { 3, TM, SEN(mincore), "mincore" },
+[219] = { 3, TM, SEN(madvise), "madvise" },
+[220] = { 3, TD, SEN(getdents64), "getdents64" },
+[221] = { 3, TD, SEN(fcntl64), "fcntl64" },
+[222 ... 223] = { },
+[224] = { 0, PU|NF, SEN(gettid), "gettid" },
+[225] = { 4, TD, SEN(readahead), "readahead" },
+[226] = { 5, TF, SEN(setxattr), "setxattr" },
+[227] = { 5, TF, SEN(setxattr), "lsetxattr" },
+[228] = { 5, TD, SEN(fsetxattr), "fsetxattr" },
+[229] = { 4, TF, SEN(getxattr), "getxattr" },
+[230] = { 4, TF, SEN(getxattr), "lgetxattr" },
+[231] = { 4, TD, SEN(fgetxattr), "fgetxattr" },
+[232] = { 3, TF, SEN(listxattr), "listxattr" },
+[233] = { 3, TF, SEN(listxattr), "llistxattr" },
+[234] = { 3, TD, SEN(flistxattr), "flistxattr" },
+[235] = { 2, TF, SEN(removexattr), "removexattr" },
+[236] = { 2, TF, SEN(removexattr), "lremovexattr" },
+[237] = { 2, TD, SEN(fremovexattr), "fremovexattr" },
+[238] = { 2, TS|TP, SEN(tkill), "tkill" },
+[239] = { 4, TD|TN, SEN(sendfile64), "sendfile64" },
+[240] = { 6, 0, SEN(futex_time32), "futex" },
+[241] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" },
+[242] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" },
+[243] = { 1, 0, SEN(set_thread_area), "set_thread_area" },
+[244] = { 1, 0, SEN(get_thread_area), "get_thread_area" },
+[245] = { 2, TM, SEN(io_setup), "io_setup" },
+[246] = { 1, TM, SEN(io_destroy), "io_destroy" },
+[247] = { 5, 0, SEN(io_getevents_time32), "io_getevents" },
+[248] = { 3, 0, SEN(io_submit), "io_submit" },
+[249] = { 3, 0, SEN(io_cancel), "io_cancel" },
+[250] = { 5, TD, SEN(fadvise64), "fadvise64" },
+[251] = { },
+[252] = { 1, TP|SE, SEN(exit), "exit_group" },
+[253] = { 4, 0, SEN(lookup_dcookie), "lookup_dcookie" },
+[254] = { 1, TD, SEN(epoll_create), "epoll_create" },
+[255] = { 4, TD, SEN(epoll_ctl), "epoll_ctl" },
+[256] = { 4, TD, SEN(epoll_wait), "epoll_wait" },
+[257] = { 5, TM|SI, SEN(remap_file_pages), "remap_file_pages" },
+[258] = { 1, 0, SEN(set_tid_address), "set_tid_address" },
+[259] = { 3, 0, SEN(timer_create), "timer_create" },
+[260] = { 4, 0, SEN(timer_settime32), "timer_settime" },
+[261] = { 2, 0, SEN(timer_gettime32), "timer_gettime" },
+[262] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" },
+[263] = { 1, 0, SEN(timer_delete), "timer_delete" },
+[264] = { 2, TCL, SEN(clock_settime32), "clock_settime" },
+[265] = { 2, TCL, SEN(clock_gettime32), "clock_gettime" },
+[266] = { 2, TCL, SEN(clock_getres_time32), "clock_getres" },
+[267] = { 4, 0, SEN(clock_nanosleep_time32), "clock_nanosleep" },
+[268] = { 3, TF|TSF|TSFA, SEN(statfs64), "statfs64" },
+[269] = { 3, TD|TFSF|TSFA, SEN(fstatfs64), "fstatfs64" },
+[270] = { 3, TS|TP, SEN(tgkill), "tgkill" },
+[271] = { 2, TF, SEN(utimes), "utimes" },
+[272] = { 6, TD, SEN(fadvise64_64), "fadvise64_64" },
+[273] = { 5, 0, SEN(vserver), "vserver" },
+[274] = { 6, TM, SEN(mbind), "mbind" },
+[275] = { 5, TM, SEN(get_mempolicy), "get_mempolicy" },
+[276] = { 3, TM, SEN(set_mempolicy), "set_mempolicy" },
+[277] = { 4, TD, SEN(mq_open), "mq_open" },
+[278] = { 1, 0, SEN(mq_unlink), "mq_unlink" },
+[279] = { 5, TD, SEN(mq_timedsend_time32), "mq_timedsend" },
+[280] = { 5, TD, SEN(mq_timedreceive_time32), "mq_timedreceive" },
+[281] = { 2, TD, SEN(mq_notify), "mq_notify" },
+[282] = { 3, TD, SEN(mq_getsetattr), "mq_getsetattr" },
+[283] = { 4, 0, SEN(kexec_load), "kexec_load" },
+[284] = { 5, TP, SEN(waitid), "waitid" },
+[285] = { },
+[286] = { 5, 0, SEN(add_key), "add_key" },
+[287] = { 4, 0, SEN(request_key), "request_key" },
+[288] = { 5, 0, SEN(keyctl), "keyctl" },
+[289] = { 3, 0, SEN(ioprio_set), "ioprio_set" },
+[290] = { 2, 0, SEN(ioprio_get), "ioprio_get" },
+[291] = { 0, TD, SEN(inotify_init), "inotify_init" },
+[292] = { 3, TD|TF, SEN(inotify_add_watch), "inotify_add_watch" },
+[293] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" },
+[294] = { 4, TM, SEN(migrate_pages), "migrate_pages" },
+[295] = { 4, TD|TF, SEN(openat), "openat" },
+[296] = { 3, TD|TF, SEN(mkdirat), "mkdirat" },
+[297] = { 4, TD|TF, SEN(mknodat), "mknodat" },
+[298] = { 5, TD|TF, SEN(fchownat), "fchownat" },
+[299] = { 3, TD|TF, SEN(futimesat), "futimesat" },
+[300] = { 4, TD|TF|TFST|TSTA,SEN(fstatat64), "fstatat64" },
+[301] = { 3, TD|TF, SEN(unlinkat), "unlinkat" },
+[302] = { 4, TD|TF, SEN(renameat), "renameat" },
+[303] = { 5, TD|TF, SEN(linkat), "linkat" },
+[304] = { 3, TD|TF, SEN(symlinkat), "symlinkat" },
+[305] = { 4, TD|TF, SEN(readlinkat), "readlinkat" },
+[306] = { 3, TD|TF, SEN(fchmodat), "fchmodat" },
+[307] = { 3, TD|TF, SEN(faccessat), "faccessat" },
+[308] = { 6, TD, SEN(pselect6_time32), "pselect6" },
+[309] = { 5, TD, SEN(ppoll_time32), "ppoll" },
+[310] = { 1, 0, SEN(unshare), "unshare" },
+[311] = { 2, 0, SEN(set_robust_list), "set_robust_list" },
+[312] = { 3, 0, SEN(get_robust_list), "get_robust_list" },
+[313] = { 6, TD, SEN(splice), "splice" },
+[314] = { 6, TD, SEN(sync_file_range), "sync_file_range" },
+[315] = { 4, TD, SEN(tee), "tee" },
+[316] = { 4, TD, SEN(vmsplice), "vmsplice" },
+[317] = { 6, TM, SEN(move_pages), "move_pages" },
+[318] = { 3, 0, SEN(getcpu), "getcpu" },
+[319] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" },
+[320] = { 4, TD|TF, SEN(utimensat_time32), "utimensat" },
+[321] = { 3, TD|TS, SEN(signalfd), "signalfd" },
+[322] = { 2, TD, SEN(timerfd_create), "timerfd_create" },
+[323] = { 1, TD, SEN(eventfd), "eventfd" },
+[324] = { 6, TD, SEN(fallocate), "fallocate" },
+[325] = { 4, TI, SEN(semtimedop_time32), "semtimedop" },
+[326] = { 4, TD, SEN(timerfd_settime32), "timerfd_settime" },
+[327] = { 2, TD, SEN(timerfd_gettime32), "timerfd_gettime" },
+[328] = { 4, TI, SEN(semctl), "semctl" },
+[329] = { 3, TI, SEN(semget), "semget" },
+[330] = { 3, TI, SEN(semop), "semop" },
+[331] = { 3, TI, SEN(msgctl), "msgctl" },
+[332] = { 2, TI, SEN(msgget), "msgget" },
+[333] = { 5, TI, SEN(msgrcv), "msgrcv" },
+[334] = { 4, TI, SEN(msgsnd), "msgsnd" },
+[335] = { 3, TI|TM|SI, SEN(shmat), "shmat" },
+[336] = { 3, TI, SEN(shmctl), "shmctl" },
+[337] = { 1, TI|TM|SI, SEN(shmdt), "shmdt" },
+[338] = { 3, TI, SEN(shmget), "shmget" },
+[339] = { 4, TD|TS, SEN(signalfd4), "signalfd4" },
+[340] = { 2, TD, SEN(eventfd2), "eventfd2" },
+[341] = { 1, TD, SEN(epoll_create1), "epoll_create1" },
+[342] = { 3, TD, SEN(dup3), "dup3" },
+[343] = { 2, TD, SEN(pipe2), "pipe2" },
+[344] = { 1, TD, SEN(inotify_init1), "inotify_init1" },
+[345] = { 3, TN, SEN(socket), "socket" },
+[346] = { 4, TN, SEN(socketpair), "socketpair" },
+[347] = { 3, TN, SEN(bind), "bind" },
+[348] = { 2, TN, SEN(listen), "listen" },
+[349] = { 3, TN, SEN(accept), "accept" },
+[350] = { 3, TN, SEN(connect), "connect" },
+[351] = { 3, TN, SEN(getsockname), "getsockname" },
+[352] = { 3, TN, SEN(getpeername), "getpeername" },
+[353] = { 6, TN, SEN(sendto), "sendto" },
+[354] = { 4, TN, SEN(send), "send" },
+[355] = { 6, TN, SEN(recvfrom), "recvfrom" },
+[356] = { 4, TN, SEN(recv), "recv" },
+[357] = { 5, TN, SEN(setsockopt), "setsockopt" },
+[358] = { 5, TN, SEN(getsockopt), "getsockopt" },
+[359] = { 2, TN, SEN(shutdown), "shutdown" },
+[360] = { 3, TN, SEN(sendmsg), "sendmsg" },
+[361] = { 3, TN, SEN(recvmsg), "recvmsg" },
+[362] = { 4, TN, SEN(accept4), "accept4" },
+[363] = { 5, TD, SEN(preadv), "preadv" },
+[364] = { 5, TD, SEN(pwritev), "pwritev" },
+[365] = { 4, TP|TS, SEN(rt_tgsigqueueinfo), "rt_tgsigqueueinfo" },
+[366] = { 5, TD, SEN(perf_event_open), "perf_event_open" },
+[367] = { 5, TN, SEN(recvmmsg_time32), "recvmmsg" },
+[368] = { 2, TD, SEN(fanotify_init), "fanotify_init" },
+[369] = { 6, TD|TF, SEN(fanotify_mark), "fanotify_mark" },
+[370] = { 4, 0, SEN(prlimit64), "prlimit64" },
+[371] = { 5, TD|TF, SEN(name_to_handle_at), "name_to_handle_at" },
+[372] = { 3, TD, SEN(open_by_handle_at), "open_by_handle_at" },
+[373] = { 2, TCL, SEN(clock_adjtime32), "clock_adjtime" },
+[374] = { 1, TD, SEN(syncfs), "syncfs" },
+[375] = { 2, TD, SEN(setns), "setns" },
+[376] = { 4, TN, SEN(sendmmsg), "sendmmsg" },
+[377] = { 6, 0, SEN(process_vm_readv), "process_vm_readv" },
+[378] = { 6, 0, SEN(process_vm_writev), "process_vm_writev" },
+[379] = { 5, 0, SEN(kcmp), "kcmp" },
+[380] = { 3, TD, SEN(finit_module), "finit_module" },
+[381] = { 3, 0, SEN(sched_setattr), "sched_setattr" },
+[382] = { 4, 0, SEN(sched_getattr), "sched_getattr" },
+[383] = { 5, TD|TF, SEN(renameat2), "renameat2" },
+[384] = { 3, 0, SEN(seccomp), "seccomp" },
+[385] = { 3, 0, SEN(getrandom), "getrandom" },
+[386] = { 2, TD, SEN(memfd_create), "memfd_create" },
+[387] = { 3, TD, SEN(bpf), "bpf" },
+[388] = { 5, TD|TF|TP|TSD|SE|SI, SEN(execveat), "execveat" },
+[389] = { 1, TD, SEN(userfaultfd), "userfaultfd" },
+[390] = { 3, 0, SEN(membarrier), "membarrier" },
+[391] = { 3, TM, SEN(mlock2), "mlock2" },
+[392] = { 6, TD, SEN(copy_file_range), "copy_file_range" },
+[393] = { 6, TD, SEN(preadv2), "preadv2" },
+[394] = { 6, TD, SEN(pwritev2), "pwritev2" },
+[395] = { 4, TM|SI, SEN(pkey_mprotect), "pkey_mprotect" },
+[396] = { 2, 0, SEN(pkey_alloc), "pkey_alloc" },
+[397] = { 1, 0, SEN(pkey_free), "pkey_free" },
+[398] = { 5, TD|TF|TFST|TSTA,SEN(statx), "statx" },
+[399] = { 6, 0, SEN(io_pgetevents_time32), "io_pgetevents" },
+[400] = { 4, 0, SEN(rseq), "rseq" },
+/* [401 ... 402] - unused */
+#include "syscallent-common-32.h"
+#include "syscallent-common.h"
diff --git a/src/linux/microblaze/userent.h b/src/linux/microblaze/userent.h
new file mode 100644
index 000000000..d3b64880f
--- /dev/null
+++ b/src/linux/microblaze/userent.h
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2014-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+{ PT_GPR(0), "r0" },
+{ PT_GPR(1), "r1" },
+{ PT_GPR(2), "r2" },
+{ PT_GPR(3), "r3" },
+{ PT_GPR(4), "r4" },
+{ PT_GPR(5), "r5" },
+{ PT_GPR(6), "r6" },
+{ PT_GPR(7), "r7" },
+{ PT_GPR(8), "r8" },
+{ PT_GPR(9), "r9" },
+{ PT_GPR(10), "r10" },
+{ PT_GPR(11), "r11" },
+{ PT_GPR(12), "r12" },
+{ PT_GPR(13), "r13" },
+{ PT_GPR(14), "r14" },
+{ PT_GPR(15), "r15" },
+{ PT_GPR(16), "r16" },
+{ PT_GPR(17), "r17" },
+{ PT_GPR(18), "r18" },
+{ PT_GPR(19), "r19" },
+{ PT_GPR(20), "r20" },
+{ PT_GPR(21), "r21" },
+{ PT_GPR(22), "r22" },
+{ PT_GPR(23), "r23" },
+{ PT_GPR(24), "r24" },
+{ PT_GPR(25), "r25" },
+{ PT_GPR(26), "r26" },
+{ PT_GPR(27), "r27" },
+{ PT_GPR(28), "r28" },
+{ PT_GPR(29), "r29" },
+{ PT_GPR(30), "r30" },
+{ PT_GPR(31), "r31" },
+{ PT_PC, "rpc" },
+{ PT_MSR, "rmsr" },
+{ PT_EAR, "rear" },
+{ PT_ESR, "resr" },
+{ PT_FSR, "rfsr" },
+{ PT_KERNEL_MODE, "kernel_mode" },
+/* Other fields in "struct user" */
+#include "../userent0.h"
diff --git a/src/linux/mips/.gitignore b/src/linux/mips/.gitignore
new file mode 100644
index 000000000..ece2db345
--- /dev/null
+++ b/src/linux/mips/.gitignore
@@ -0,0 +1,5 @@
+syscallent-common-32-stub.h
+syscallent-common-stub.h
+syscallent-n32-stub.h
+syscallent-n64-stub.h
+syscallent-o32-stub.h
diff --git a/src/linux/mips/arch_defs_.h b/src/linux/mips/arch_defs_.h
new file mode 100644
index 000000000..f789e18d9
--- /dev/null
+++ b/src/linux/mips/arch_defs_.h
@@ -0,0 +1,10 @@
+/*
+ * Copyright (c) 2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#define HAVE_ARCH_GETRVAL2 1
+#define HAVE_ARCH_DEDICATED_ERR_REG 1
+#define CAN_ARCH_BE_COMPAT_ON_64BIT_KERNEL 1
diff --git a/src/linux/mips/arch_getrval2.c b/src/linux/mips/arch_getrval2.c
new file mode 100644
index 000000000..33b53ba2b
--- /dev/null
+++ b/src/linux/mips/arch_getrval2.c
@@ -0,0 +1,14 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+long
+getrval2(struct tcb *tcp)
+{
+ if (ptrace_syscall_info_is_valid() && get_regs(tcp) < 0)
+ return -1;
+ return mips_regs.uregs[3];
+}
diff --git a/src/linux/mips/arch_regs.c b/src/linux/mips/arch_regs.c
new file mode 100644
index 000000000..0874e31ef
--- /dev/null
+++ b/src/linux/mips/arch_regs.c
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static struct {
+ uint64_t uregs[38];
+} mips_regs;
+
+#define REG_V0 2
+#define REG_A0 4
+
+#define mips_REG_V0 mips_regs.uregs[REG_V0]
+#define mips_REG_A0 mips_regs.uregs[REG_A0 + 0]
+#define mips_REG_A1 mips_regs.uregs[REG_A0 + 1]
+#define mips_REG_A2 mips_regs.uregs[REG_A0 + 2]
+#define mips_REG_A3 mips_regs.uregs[REG_A0 + 3]
+#define mips_REG_A4 mips_regs.uregs[REG_A0 + 4]
+#define mips_REG_A5 mips_regs.uregs[REG_A0 + 5]
+#define mips_REG_SP mips_regs.uregs[29]
+#define mips_REG_EPC mips_regs.uregs[34]
+
+/* PTRACE_GETREGS on MIPS is available since linux v2.6.15. */
+#define ARCH_REGS_FOR_GETREGS mips_regs
+#define ARCH_PC_REG mips_REG_EPC
+#define ARCH_SP_REG mips_REG_SP
diff --git a/src/linux/mips/arch_sigreturn.c b/src/linux/mips/arch_sigreturn.c
new file mode 100644
index 000000000..14546b95c
--- /dev/null
+++ b/src/linux/mips/arch_sigreturn.c
@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static void
+arch_sigreturn(struct tcb *tcp)
+{
+ /* 64-bit ABIs do not have old sigreturn. */
+#ifdef LINUX_MIPSO32
+ kernel_ulong_t addr;
+ if (!get_stack_pointer(tcp, &addr))
+ return;
+ /*
+ * offsetof(struct sigframe, sf_mask) ==
+ * sizeof(sf_ass) + sizeof(sf_pad) + sizeof(struct sigcontext)
+ */
+ addr += 6 * 4 + sizeof(struct sigcontext);
+
+ print_sigset_addr(tcp, addr);
+#endif
+}
diff --git a/src/linux/mips/errnoent.h b/src/linux/mips/errnoent.h
new file mode 100644
index 000000000..6f0c16fb6
--- /dev/null
+++ b/src/linux/mips/errnoent.h
@@ -0,0 +1,158 @@
+/*
+ * Copyright (c) 1999-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+[ 1] = "EPERM",
+[ 2] = "ENOENT",
+[ 3] = "ESRCH",
+[ 4] = "EINTR",
+[ 5] = "EIO",
+[ 6] = "ENXIO",
+[ 7] = "E2BIG",
+[ 8] = "ENOEXEC",
+[ 9] = "EBADF",
+[ 10] = "ECHILD",
+[ 11] = "EAGAIN",
+[ 12] = "ENOMEM",
+[ 13] = "EACCES",
+[ 14] = "EFAULT",
+[ 15] = "ENOTBLK",
+[ 16] = "EBUSY",
+[ 17] = "EEXIST",
+[ 18] = "EXDEV",
+[ 19] = "ENODEV",
+[ 20] = "ENOTDIR",
+[ 21] = "EISDIR",
+[ 22] = "EINVAL",
+[ 23] = "ENFILE",
+[ 24] = "EMFILE",
+[ 25] = "ENOTTY",
+[ 26] = "ETXTBSY",
+[ 27] = "EFBIG",
+[ 28] = "ENOSPC",
+[ 29] = "ESPIPE",
+[ 30] = "EROFS",
+[ 31] = "EMLINK",
+[ 32] = "EPIPE",
+[ 33] = "EDOM",
+[ 34] = "ERANGE",
+[ 35] = "ENOMSG",
+[ 36] = "EIDRM",
+[ 37] = "ECHRNG",
+[ 38] = "EL2NSYNC",
+[ 39] = "EL3HLT",
+[ 40] = "EL3RST",
+[ 41] = "ELNRNG",
+[ 42] = "EUNATCH",
+[ 43] = "ENOCSI",
+[ 44] = "EL2HLT",
+[ 45] = "EDEADLK",
+[ 46] = "ENOLCK",
+[ 50] = "EBADE",
+[ 51] = "EBADR",
+[ 52] = "EXFULL",
+[ 53] = "ENOANO",
+[ 54] = "EBADRQC",
+[ 55] = "EBADSLT",
+[ 56] = "EDEADLOCK",
+[ 59] = "EBFONT",
+[ 60] = "ENOSTR",
+[ 61] = "ENODATA",
+[ 62] = "ETIME",
+[ 63] = "ENOSR",
+[ 64] = "ENONET",
+[ 65] = "ENOPKG",
+[ 66] = "EREMOTE",
+[ 67] = "ENOLINK",
+[ 68] = "EADV",
+[ 69] = "ESRMNT",
+[ 70] = "ECOMM",
+[ 71] = "EPROTO",
+[ 73] = "EDOTDOT",
+[ 74] = "EMULTIHOP",
+[ 77] = "EBADMSG",
+[ 78] = "ENAMETOOLONG",
+[ 79] = "EOVERFLOW",
+[ 80] = "ENOTUNIQ",
+[ 81] = "EBADFD",
+[ 82] = "EREMCHG",
+[ 83] = "ELIBACC",
+[ 84] = "ELIBBAD",
+[ 85] = "ELIBSCN",
+[ 86] = "ELIBMAX",
+[ 87] = "ELIBEXEC",
+[ 88] = "EILSEQ",
+[ 89] = "ENOSYS",
+[ 90] = "ELOOP",
+[ 91] = "ERESTART",
+[ 92] = "ESTRPIPE",
+[ 93] = "ENOTEMPTY",
+[ 94] = "EUSERS",
+[ 95] = "ENOTSOCK",
+[ 96] = "EDESTADDRREQ",
+[ 97] = "EMSGSIZE",
+[ 98] = "EPROTOTYPE",
+[ 99] = "ENOPROTOOPT",
+[120] = "EPROTONOSUPPORT",
+[121] = "ESOCKTNOSUPPORT",
+[122] = "EOPNOTSUPP",
+[123] = "EPFNOSUPPORT",
+[124] = "EAFNOSUPPORT",
+[125] = "EADDRINUSE",
+[126] = "EADDRNOTAVAIL",
+[127] = "ENETDOWN",
+[128] = "ENETUNREACH",
+[129] = "ENETRESET",
+[130] = "ECONNABORTED",
+[131] = "ECONNRESET",
+[132] = "ENOBUFS",
+[133] = "EISCONN",
+[134] = "ENOTCONN",
+[135] = "EUCLEAN",
+[137] = "ENOTNAM",
+[138] = "ENAVAIL",
+[139] = "EISNAM",
+[140] = "EREMOTEIO",
+[141] = "EINIT",
+[142] = "EREMDEV",
+[143] = "ESHUTDOWN",
+[144] = "ETOOMANYREFS",
+[145] = "ETIMEDOUT",
+[146] = "ECONNREFUSED",
+[147] = "EHOSTDOWN",
+[148] = "EHOSTUNREACH",
+[149] = "EALREADY",
+[150] = "EINPROGRESS",
+[151] = "ESTALE",
+[158] = "ECANCELED",
+[159] = "ENOMEDIUM",
+[160] = "EMEDIUMTYPE",
+[161] = "ENOKEY",
+[162] = "EKEYEXPIRED",
+[163] = "EKEYREVOKED",
+[164] = "EKEYREJECTED",
+[165] = "EOWNERDEAD",
+[166] = "ENOTRECOVERABLE",
+[167] = "ERFKILL",
+[168] = "EHWPOISON",
+[512] = "ERESTARTSYS",
+[513] = "ERESTARTNOINTR",
+[514] = "ERESTARTNOHAND",
+[515] = "ENOIOCTLCMD",
+[516] = "ERESTART_RESTARTBLOCK",
+[517] = "EPROBE_DEFER",
+[518] = "EOPENSTALE",
+[521] = "EBADHANDLE",
+[522] = "ENOTSYNC",
+[523] = "EBADCOOKIE",
+[524] = "ENOTSUPP",
+[525] = "ETOOSMALL",
+[526] = "ESERVERFAULT",
+[527] = "EBADTYPE",
+[528] = "EJUKEBOX",
+[529] = "EIOCBQUEUED",
+[530] = "ERECALLCONFLICT",
+[1133] = "EDQUOT",
diff --git a/src/linux/mips/genstub.sh b/src/linux/mips/genstub.sh
new file mode 100755
index 000000000..68775ba3a
--- /dev/null
+++ b/src/linux/mips/genstub.sh
@@ -0,0 +1,15 @@
+#!/bin/sh -e
+#
+# Copyright (c) 2015-2019 The strace developers.
+# All rights reserved.
+#
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+srcdir="$1"; shift
+dstdir="$1"; shift
+
+for n; do
+ in="$srcdir/syscallent-$n.h"
+ out="$dstdir/syscallent-$n-stub.h"
+ sed -r -n '/^#if/,/^#else/ {s/^([^{]*\{[^,]*,[^,]*,[[:space:]]*)[^,[:space:]]+,[[:space:]]*"([^"]+".*)/\1SEN(printargs), SYSCALL_NAME_PREFIX "\2/; s/^\[.*/&/p}' < "$in" > "$out"
+done
diff --git a/src/linux/mips/get_error.c b/src/linux/mips/get_error.c
new file mode 100644
index 000000000..bcc219d59
--- /dev/null
+++ b/src/linux/mips/get_error.c
@@ -0,0 +1,17 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static void
+arch_get_error(struct tcb *tcp, const bool check_errno)
+{
+ if (mips_REG_A3) {
+ tcp->u_rval = -1;
+ tcp->u_error = mips_REG_V0;
+ } else {
+ tcp->u_rval = mips_REG_V0;
+ }
+}
diff --git a/src/linux/mips/get_scno.c b/src/linux/mips/get_scno.c
new file mode 100644
index 000000000..d9815f630
--- /dev/null
+++ b/src/linux/mips/get_scno.c
@@ -0,0 +1,22 @@
+/*
+ * Copyright (c) 2015-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+/* Return codes: 1 - ok, 0 - ignore, other - error. */
+static int
+arch_get_scno(struct tcb *tcp)
+{
+ tcp->scno = mips_REG_V0;
+
+ if (!scno_in_range(tcp->scno)) {
+ if (mips_REG_A3 == 0 || mips_REG_A3 == (uint64_t) -1) {
+ debug_msg("stray syscall exit: v0 = %ld", tcp->scno);
+ return 0;
+ }
+ }
+
+ return 1;
+}
diff --git a/src/linux/mips/get_syscall_args.c b/src/linux/mips/get_syscall_args.c
new file mode 100644
index 000000000..96cd1ce1b
--- /dev/null
+++ b/src/linux/mips/get_syscall_args.c
@@ -0,0 +1,87 @@
+/*
+ * Copyright (c) 2015-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+/* Return -1 on error or 1 on success (never 0!). */
+static int
+arch_get_syscall_args(struct tcb *tcp)
+{
+#if defined LINUX_MIPSN64 || defined LINUX_MIPSN32
+ tcp->u_arg[0] = mips_REG_A0;
+ tcp->u_arg[1] = mips_REG_A1;
+ tcp->u_arg[2] = mips_REG_A2;
+ tcp->u_arg[3] = mips_REG_A3;
+ tcp->u_arg[4] = mips_REG_A4;
+ tcp->u_arg[5] = mips_REG_A5;
+#elif defined LINUX_MIPSO32
+ tcp->u_arg[0] = mips_REG_A0;
+ tcp->u_arg[1] = mips_REG_A1;
+ tcp->u_arg[2] = mips_REG_A2;
+ tcp->u_arg[3] = mips_REG_A3;
+ if (n_args(tcp) > 4
+ && umoven(tcp, mips_REG_SP + 4 * sizeof(tcp->u_arg[0]),
+ (n_args(tcp) - 4) * sizeof(tcp->u_arg[0]),
+ &tcp->u_arg[4]) < 0) {
+ error_msg("pid %d: cannot fetch 5th and 6th syscall arguments"
+ " from tracee's memory", tcp->pid);
+
+ /*
+ * Let's proceed with the first 4 arguments
+ * instead of reporting the failure.
+ */
+ memset(&tcp->u_arg[4], 0,
+ (n_args(tcp) - 4) * sizeof(tcp->u_arg[0]));
+ }
+#else
+# error unsupported mips abi
+#endif
+ return 1;
+}
+
+#ifdef LINUX_MIPSO32
+static void
+arch_get_syscall_args_extra(struct tcb *tcp, const unsigned int n)
+{
+ /* This assumes n >= 4. */
+ if (n_args(tcp) > n
+ && umoven(tcp, mips_REG_SP + n * sizeof(tcp->u_arg[0]),
+ (n_args(tcp) - n) * sizeof(tcp->u_arg[0]),
+ &tcp->u_arg[n]) < 0) {
+ /*
+ * Let's proceed with the first n arguments
+ * instead of reporting the failure.
+ */
+ memset(&tcp->u_arg[n], 0,
+ (n_args(tcp) - n) * sizeof(tcp->u_arg[0]));
+ }
+}
+#endif
+
+#ifdef SYS_syscall_subcall
+static void
+decode_syscall_subcall(struct tcb *tcp)
+{
+ if (!scno_is_valid(tcp->u_arg[0]))
+ return;
+ tcp->true_scno = tcp->scno = tcp->u_arg[0];
+ tcp->qual_flg = qual_flags(tcp->scno);
+ tcp->s_ent = &sysent[tcp->scno];
+ memmove(&tcp->u_arg[0], &tcp->u_arg[1],
+ sizeof(tcp->u_arg) - sizeof(tcp->u_arg[0]));
+ /*
+ * Fetching the last arg of 7-arg syscalls (fadvise64_64
+ * and sync_file_range) requires additional code,
+ * see arch_get_syscall_args() above.
+ */
+ if (n_args(tcp) == MAX_ARGS) {
+ if (umoven(tcp,
+ mips_REG_SP + MAX_ARGS * sizeof(tcp->u_arg[0]),
+ sizeof(tcp->u_arg[0]),
+ &tcp->u_arg[MAX_ARGS - 1]) < 0)
+ tcp->u_arg[MAX_ARGS - 1] = 0;
+ }
+}
+#endif /* SYS_syscall_subcall */
diff --git a/src/linux/mips/ioctls_arch0.h b/src/linux/mips/ioctls_arch0.h
new file mode 100644
index 000000000..146c27bfb
--- /dev/null
+++ b/src/linux/mips/ioctls_arch0.h
@@ -0,0 +1,152 @@
+/* Generated by ioctls_gen.sh from definitions found in $linux/arch/mips/include/ tree. */
+{ "asm/ioctls.h", "FIOASYNC", 0, 0x667d, 0 },
+{ "asm/ioctls.h", "FIOCLEX", 0, 0x6601, 0 },
+{ "asm/ioctls.h", "FIONBIO", 0, 0x667e, 0 },
+{ "asm/ioctls.h", "FIONCLEX", 0, 0x6602, 0 },
+{ "asm/ioctls.h", "FIONREAD", 0, 0x467f, 0 },
+{ "asm/ioctls.h", "FIOQSIZE", 0, 0x667f, 0 },
+{ "asm/ioctls.h", "TCFLSH", 0, 0x5407, 0 },
+{ "asm/ioctls.h", "TCGETA", 0, 0x5401, 0 },
+{ "asm/ioctls.h", "TCGETS", 0, 0x540d, 0 },
+{ "asm/ioctls.h", "TCGETS2", _IOC_READ, 0x542a, 0x30 },
+{ "asm/ioctls.h", "TCSBRK", 0, 0x5405, 0 },
+{ "asm/ioctls.h", "TCSBRKP", 0, 0x5486, 0 },
+{ "asm/ioctls.h", "TCSETA", 0, 0x5402, 0 },
+{ "asm/ioctls.h", "TCSETAF", 0, 0x5404, 0 },
+{ "asm/ioctls.h", "TCSETAW", 0, 0x5403, 0 },
+{ "asm/ioctls.h", "TCSETS", 0, 0x540e, 0 },
+{ "asm/ioctls.h", "TCSETS2", _IOC_WRITE, 0x542b, 0x30 },
+{ "asm/ioctls.h", "TCSETSF", 0, 0x5410, 0 },
+{ "asm/ioctls.h", "TCSETSF2", _IOC_WRITE, 0x542d, 0x30 },
+{ "asm/ioctls.h", "TCSETSW", 0, 0x540f, 0 },
+{ "asm/ioctls.h", "TCSETSW2", _IOC_WRITE, 0x542c, 0x30 },
+{ "asm/ioctls.h", "TCXONC", 0, 0x5406, 0 },
+{ "asm/ioctls.h", "TIOCCBRK", 0, 0x5428, 0 },
+{ "asm/ioctls.h", "TIOCCONS", _IOC_WRITE, 0x7478, 0x04 },
+{ "asm/ioctls.h", "TIOCEXCL", 0, 0x740d, 0 },
+{ "asm/ioctls.h", "TIOCGDEV", _IOC_READ, 0x5432, 0x04 },
+{ "asm/ioctls.h", "TIOCGETD", 0, 0x7400, 0 },
+{ "asm/ioctls.h", "TIOCGETP", 0, 0x7408, 0 },
+{ "asm/ioctls.h", "TIOCGEXCL", _IOC_READ, 0x5440, 0x04 },
+{ "asm/ioctls.h", "TIOCGICOUNT", 0, 0x5492, 0 },
+{ "asm/ioctls.h", "TIOCGISO7816", _IOC_READ, 0x5442, 0x28 },
+{ "asm/ioctls.h", "TIOCGLCKTRMIOS", 0, 0x548b, 0 },
+{ "asm/ioctls.h", "TIOCGLTC", 0, 0x7474, 0 },
+{ "asm/ioctls.h", "TIOCGPGRP", _IOC_READ, 0x7477, 0x04 },
+{ "asm/ioctls.h", "TIOCGPKT", _IOC_READ, 0x5438, 0x04 },
+{ "asm/ioctls.h", "TIOCGPTLCK", _IOC_READ, 0x5439, 0x04 },
+{ "asm/ioctls.h", "TIOCGPTN", _IOC_READ, 0x5430, 0x04 },
+{ "asm/ioctls.h", "TIOCGPTPEER", _IOC_NONE, 0x5441, 0x00 },
+{ "asm/ioctls.h", "TIOCGRS485", _IOC_READ, 0x542e, 0x20 },
+{ "asm/ioctls.h", "TIOCGSERIAL", 0, 0x5484, 0 },
+{ "asm/ioctls.h", "TIOCGSID", 0, 0x7416, 0 },
+{ "asm/ioctls.h", "TIOCGSOFTCAR", 0, 0x5481, 0 },
+{ "asm/ioctls.h", "TIOCGWINSZ", _IOC_READ, 0x7468, 0x08 },
+{ "asm/ioctls.h", "TIOCLINUX", 0, 0x5483, 0 },
+{ "asm/ioctls.h", "TIOCMBIC", 0, 0x741c, 0 },
+{ "asm/ioctls.h", "TIOCMBIS", 0, 0x741b, 0 },
+{ "asm/ioctls.h", "TIOCMGET", 0, 0x741d, 0 },
+{ "asm/ioctls.h", "TIOCMIWAIT", 0, 0x5491, 0 },
+{ "asm/ioctls.h", "TIOCMSET", 0, 0x741a, 0 },
+{ "asm/ioctls.h", "TIOCNOTTY", 0, 0x5471, 0 },
+{ "asm/ioctls.h", "TIOCNXCL", 0, 0x740e, 0 },
+{ "asm/ioctls.h", "TIOCOUTQ", 0, 0x7472, 0 },
+{ "asm/ioctls.h", "TIOCPKT", 0, 0x5470, 0 },
+{ "asm/ioctls.h", "TIOCSBRK", 0, 0x5427, 0 },
+{ "asm/ioctls.h", "TIOCSCTTY", 0, 0x5480, 0 },
+{ "asm/ioctls.h", "TIOCSERCONFIG", 0, 0x5488, 0 },
+{ "asm/ioctls.h", "TIOCSERGETLSR", 0, 0x548e, 0 },
+{ "asm/ioctls.h", "TIOCSERGETMULTI", 0, 0x548f, 0 },
+{ "asm/ioctls.h", "TIOCSERGSTRUCT", 0, 0x548d, 0 },
+{ "asm/ioctls.h", "TIOCSERGWILD", 0, 0x5489, 0 },
+{ "asm/ioctls.h", "TIOCSERSETMULTI", 0, 0x5490, 0 },
+{ "asm/ioctls.h", "TIOCSERSWILD", 0, 0x548a, 0 },
+{ "asm/ioctls.h", "TIOCSETD", 0, 0x7401, 0 },
+{ "asm/ioctls.h", "TIOCSETN", 0, 0x740a, 0 },
+{ "asm/ioctls.h", "TIOCSETP", 0, 0x7409, 0 },
+{ "asm/ioctls.h", "TIOCSIG", _IOC_WRITE, 0x5436, 0x04 },
+{ "asm/ioctls.h", "TIOCSISO7816", _IOC_READ|_IOC_WRITE, 0x5443, 0x28 },
+{ "asm/ioctls.h", "TIOCSLCKTRMIOS", 0, 0x548c, 0 },
+{ "asm/ioctls.h", "TIOCSLTC", 0, 0x7475, 0 },
+{ "asm/ioctls.h", "TIOCSPGRP", _IOC_WRITE, 0x7476, 0x04 },
+{ "asm/ioctls.h", "TIOCSPTLCK", _IOC_WRITE, 0x5431, 0x04 },
+{ "asm/ioctls.h", "TIOCSRS485", _IOC_READ|_IOC_WRITE, 0x542f, 0x20 },
+{ "asm/ioctls.h", "TIOCSSERIAL", 0, 0x5485, 0 },
+{ "asm/ioctls.h", "TIOCSSOFTCAR", 0, 0x5482, 0 },
+{ "asm/ioctls.h", "TIOCSTI", 0, 0x5472, 0 },
+{ "asm/ioctls.h", "TIOCSWINSZ", _IOC_WRITE, 0x7467, 0x08 },
+{ "asm/ioctls.h", "TIOCVHANGUP", 0, 0x5437, 0 },
+{ "asm/sockios.h", "FIOGETOWN", _IOC_READ, 0x667b, 0x04 },
+{ "asm/sockios.h", "FIOSETOWN", _IOC_WRITE, 0x667c, 0x04 },
+{ "asm/sockios.h", "SIOCATMARK", _IOC_READ, 0x7307, 0x04 },
+{ "asm/sockios.h", "SIOCGPGRP", _IOC_READ, 0x7309, 0x04 },
+{ "asm/sockios.h", "SIOCSPGRP", _IOC_WRITE, 0x7308, 0x04 },
+{ "linux/kvm.h", "KVM_ASSIGN_DEV_IRQ", _IOC_WRITE, 0xae70, 0x40 },
+{ "linux/kvm.h", "KVM_ASSIGN_PCI_DEVICE", _IOC_READ, 0xae69, 0x40 },
+{ "linux/kvm.h", "KVM_ASSIGN_SET_INTX_MASK", _IOC_WRITE, 0xaea4, 0x40 },
+{ "linux/kvm.h", "KVM_ASSIGN_SET_MSIX_ENTRY", _IOC_WRITE, 0xae74, 0x10 },
+{ "linux/kvm.h", "KVM_ASSIGN_SET_MSIX_NR", _IOC_WRITE, 0xae73, 0x08 },
+{ "linux/kvm.h", "KVM_CHECK_EXTENSION", _IOC_NONE, 0xae03, 0x00 },
+{ "linux/kvm.h", "KVM_CLEAR_DIRTY_LOG", _IOC_READ|_IOC_WRITE, 0xaec0, 0x18 },
+{ "linux/kvm.h", "KVM_CREATE_DEVICE", _IOC_READ|_IOC_WRITE, 0xaee0, 0x0c },
+{ "linux/kvm.h", "KVM_CREATE_IRQCHIP", _IOC_NONE, 0xae60, 0x00 },
+{ "linux/kvm.h", "KVM_CREATE_PIT", _IOC_NONE, 0xae64, 0x00 },
+{ "linux/kvm.h", "KVM_CREATE_PIT2", _IOC_WRITE, 0xae77, 0x40 },
+{ "linux/kvm.h", "KVM_CREATE_VCPU", _IOC_NONE, 0xae41, 0x00 },
+{ "linux/kvm.h", "KVM_CREATE_VM", _IOC_NONE, 0xae01, 0x00 },
+{ "linux/kvm.h", "KVM_DEASSIGN_DEV_IRQ", _IOC_WRITE, 0xae75, 0x40 },
+{ "linux/kvm.h", "KVM_DEASSIGN_PCI_DEVICE", _IOC_WRITE, 0xae72, 0x40 },
+{ "linux/kvm.h", "KVM_DIRTY_TLB", _IOC_WRITE, 0xaeaa, 0x10 },
+{ "linux/kvm.h", "KVM_ENABLE_CAP", _IOC_WRITE, 0xaea3, 0x68 },
+{ "linux/kvm.h", "KVM_GET_API_VERSION", _IOC_NONE, 0xae00, 0x00 },
+{ "linux/kvm.h", "KVM_GET_CLOCK", _IOC_READ, 0xae7c, 0x30 },
+{ "linux/kvm.h", "KVM_GET_DEVICE_ATTR", _IOC_WRITE, 0xaee2, 0x18 },
+{ "linux/kvm.h", "KVM_GET_DIRTY_LOG", _IOC_WRITE, 0xae42, 0x10 },
+{ "linux/kvm.h", "KVM_GET_FPU", _IOC_READ, 0xae8c, 0x00 },
+{ "linux/kvm.h", "KVM_GET_IRQCHIP", _IOC_READ|_IOC_WRITE, 0xae62, 0x208 },
+{ "linux/kvm.h", "KVM_GET_MP_STATE", _IOC_READ, 0xae98, 0x04 },
+{ "linux/kvm.h", "KVM_GET_NR_MMU_PAGES", _IOC_NONE, 0xae45, 0x00 },
+{ "linux/kvm.h", "KVM_GET_ONE_REG", _IOC_WRITE, 0xaeab, 0x10 },
+{ "linux/kvm.h", "KVM_GET_REGS", _IOC_READ, 0xae81, 0x118 },
+{ "linux/kvm.h", "KVM_GET_REG_LIST", _IOC_READ|_IOC_WRITE, 0xaeb0, 0x08 },
+{ "linux/kvm.h", "KVM_GET_SREGS", _IOC_READ, 0xae83, 0x00 },
+{ "linux/kvm.h", "KVM_GET_TSC_KHZ", _IOC_NONE, 0xaea3, 0x00 },
+{ "linux/kvm.h", "KVM_GET_VCPU_MMAP_SIZE", _IOC_NONE, 0xae04, 0x00 },
+{ "linux/kvm.h", "KVM_HAS_DEVICE_ATTR", _IOC_WRITE, 0xaee3, 0x18 },
+{ "linux/kvm.h", "KVM_INTERRUPT", _IOC_WRITE, 0xae86, 0x04 },
+{ "linux/kvm.h", "KVM_IOEVENTFD", _IOC_WRITE, 0xae79, 0x40 },
+{ "linux/kvm.h", "KVM_IRQFD", _IOC_WRITE, 0xae76, 0x20 },
+{ "linux/kvm.h", "KVM_IRQ_LINE", _IOC_WRITE, 0xae61, 0x08 },
+{ "linux/kvm.h", "KVM_IRQ_LINE_STATUS", _IOC_READ|_IOC_WRITE, 0xae67, 0x08 },
+{ "linux/kvm.h", "KVM_KVMCLOCK_CTRL", _IOC_NONE, 0xaead, 0x00 },
+{ "linux/kvm.h", "KVM_MEMORY_ENCRYPT_OP", _IOC_READ|_IOC_WRITE, 0xaeba, 0x08 },
+{ "linux/kvm.h", "KVM_MEMORY_ENCRYPT_REG_REGION", _IOC_READ, 0xaebb, 0x10 },
+{ "linux/kvm.h", "KVM_MEMORY_ENCRYPT_UNREG_REGION", _IOC_READ, 0xaebc, 0x10 },
+{ "linux/kvm.h", "KVM_NMI", _IOC_NONE, 0xae9a, 0x00 },
+{ "linux/kvm.h", "KVM_REGISTER_COALESCED_MMIO", _IOC_WRITE, 0xae67, 0x10 },
+{ "linux/kvm.h", "KVM_REINJECT_CONTROL", _IOC_NONE, 0xae71, 0x00 },
+{ "linux/kvm.h", "KVM_RUN", _IOC_NONE, 0xae80, 0x00 },
+{ "linux/kvm.h", "KVM_SET_BOOT_CPU_ID", _IOC_NONE, 0xae78, 0x00 },
+{ "linux/kvm.h", "KVM_SET_CLOCK", _IOC_WRITE, 0xae7b, 0x30 },
+{ "linux/kvm.h", "KVM_SET_DEVICE_ATTR", _IOC_WRITE, 0xaee1, 0x18 },
+{ "linux/kvm.h", "KVM_SET_FPU", _IOC_WRITE, 0xae8d, 0x00 },
+{ "linux/kvm.h", "KVM_SET_GSI_ROUTING", _IOC_WRITE, 0xae6a, 0x08 },
+{ "linux/kvm.h", "KVM_SET_GUEST_DEBUG", _IOC_WRITE, 0xae9b, 0x08 },
+{ "linux/kvm.h", "KVM_SET_IDENTITY_MAP_ADDR", _IOC_WRITE, 0xae48, 0x08 },
+{ "linux/kvm.h", "KVM_SET_IRQCHIP", _IOC_READ, 0xae63, 0x208 },
+{ "linux/kvm.h", "KVM_SET_MEMORY_REGION", _IOC_WRITE, 0xae40, 0x18 },
+{ "linux/kvm.h", "KVM_SET_MP_STATE", _IOC_WRITE, 0xae99, 0x04 },
+{ "linux/kvm.h", "KVM_SET_NR_MMU_PAGES", _IOC_NONE, 0xae44, 0x00 },
+{ "linux/kvm.h", "KVM_SET_ONE_REG", _IOC_WRITE, 0xaeac, 0x10 },
+{ "linux/kvm.h", "KVM_SET_REGS", _IOC_WRITE, 0xae82, 0x118 },
+{ "linux/kvm.h", "KVM_SET_SIGNAL_MASK", _IOC_WRITE, 0xae8b, 0x04 },
+{ "linux/kvm.h", "KVM_SET_SREGS", _IOC_WRITE, 0xae84, 0x00 },
+{ "linux/kvm.h", "KVM_SET_TSC_KHZ", _IOC_NONE, 0xaea2, 0x00 },
+{ "linux/kvm.h", "KVM_SET_TSS_ADDR", _IOC_NONE, 0xae47, 0x00 },
+{ "linux/kvm.h", "KVM_SET_USER_MEMORY_REGION", _IOC_WRITE, 0xae46, 0x20 },
+{ "linux/kvm.h", "KVM_SET_VAPIC_ADDR", _IOC_WRITE, 0xae93, 0x08 },
+{ "linux/kvm.h", "KVM_SIGNAL_MSI", _IOC_WRITE, 0xaea5, 0x20 },
+{ "linux/kvm.h", "KVM_SMI", _IOC_NONE, 0xaeb7, 0x00 },
+{ "linux/kvm.h", "KVM_TPR_ACCESS_REPORTING", _IOC_READ|_IOC_WRITE, 0xae92, 0x28 },
+{ "linux/kvm.h", "KVM_TRANSLATE", _IOC_READ|_IOC_WRITE, 0xae85, 0x18 },
+{ "linux/kvm.h", "KVM_UNREGISTER_COALESCED_MMIO", _IOC_WRITE, 0xae68, 0x10 },
diff --git a/src/linux/mips/ioctls_inc0.h b/src/linux/mips/ioctls_inc0.h
new file mode 100644
index 000000000..da4259efd
--- /dev/null
+++ b/src/linux/mips/ioctls_inc0.h
@@ -0,0 +1,12 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifdef LINUX_MIPSN64
+# include "64/ioctls_inc.h"
+#else
+# include "32/ioctls_inc.h"
+#endif
diff --git a/src/linux/mips/raw_syscall.h b/src/linux/mips/raw_syscall.h
new file mode 100644
index 000000000..d1d33bc63
--- /dev/null
+++ b/src/linux/mips/raw_syscall.h
@@ -0,0 +1,35 @@
+/*
+ * Raw syscalls.
+ *
+ * Copyright (c) 2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_RAW_SYSCALL_H
+# define STRACE_RAW_SYSCALL_H
+
+# include "kernel_types.h"
+
+static inline kernel_ulong_t
+raw_syscall_0(const kernel_ulong_t nr, kernel_ulong_t *err)
+{
+ register kernel_ulong_t s0 __asm__("$16") = nr;
+ register kernel_ulong_t v0 __asm__("$2");
+ register kernel_ulong_t a3 __asm__("$7");
+ __asm__ __volatile__(".set noreorder\n\t"
+ "move %0, %2\n\t"
+ "syscall\n\t"
+ ".set reorder"
+ : "=r"(v0), "=r"(a3)
+ : "r"(s0)
+ : "memory", "hi", "lo", "$1", "$3", "$8", "$9",
+ "$10", "$11", "$12", "$13", "$14", "$15",
+ "$24", "$25");
+ *err = a3;
+ return v0;
+}
+# define raw_syscall_0 raw_syscall_0
+
+#endif /* !STRACE_RAW_SYSCALL_H */
diff --git a/src/linux/mips/rt_sigframe.h b/src/linux/mips/rt_sigframe.h
new file mode 100644
index 000000000..d8e3797bd
--- /dev/null
+++ b/src/linux/mips/rt_sigframe.h
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2017-2018 Dmitry V. Levin <ldv@strace.io>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_RT_SIGFRAME_H
+# define STRACE_RT_SIGFRAME_H
+
+# include <signal.h>
+
+typedef struct {
+ uint32_t pad[6];
+ siginfo_t info;
+ ucontext_t uc;
+} struct_rt_sigframe;
+
+#endif /* !STRACE_RT_SIGFRAME_H */
diff --git a/src/linux/mips/set_error.c b/src/linux/mips/set_error.c
new file mode 100644
index 000000000..af019ae02
--- /dev/null
+++ b/src/linux/mips/set_error.c
@@ -0,0 +1,22 @@
+/*
+ * Copyright (c) 2016-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static int
+arch_set_error(struct tcb *tcp)
+{
+ mips_REG_V0 = tcp->u_error;
+ mips_REG_A3 = -1;
+ return set_regs(tcp->pid);
+}
+
+static int
+arch_set_success(struct tcb *tcp)
+{
+ mips_REG_V0 = tcp->u_rval;
+ mips_REG_A3 = 0;
+ return set_regs(tcp->pid);
+}
diff --git a/src/linux/mips/set_scno.c b/src/linux/mips/set_scno.c
new file mode 100644
index 000000000..66448cfee
--- /dev/null
+++ b/src/linux/mips/set_scno.c
@@ -0,0 +1,15 @@
+/*
+ * Copyright (c) 2016-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static int
+arch_set_scno(struct tcb *tcp, kernel_ulong_t scno)
+{
+ if (ptrace_syscall_info_is_valid() && get_regs(tcp) < 0)
+ return -1;
+ mips_REG_V0 = scno;
+ return set_regs(tcp->pid);
+}
diff --git a/src/linux/mips/signalent.h b/src/linux/mips/signalent.h
new file mode 100644
index 000000000..c3caf2bb4
--- /dev/null
+++ b/src/linux/mips/signalent.h
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 1999-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+ "0", /* 0 */
+ "SIGHUP", /* 1 */
+ "SIGINT", /* 2 */
+ "SIGQUIT", /* 3 */
+ "SIGILL", /* 4 */
+ "SIGTRAP", /* 5 */
+ "SIGIOT", /* 6 */
+ "SIGEMT", /* 7 */
+ "SIGFPE", /* 8 */
+ "SIGKILL", /* 9 */
+ "SIGBUS", /* 10 */
+ "SIGSEGV", /* 11 */
+ "SIGSYS", /* 12 */
+ "SIGPIPE", /* 13 */
+ "SIGALRM", /* 14 */
+ "SIGTERM", /* 15 */
+ "SIGUSR1", /* 16 */
+ "SIGUSR2", /* 17 */
+ "SIGCHLD", /* 18 */
+ "SIGPWR", /* 19 */
+ "SIGWINCH", /* 20 */
+ "SIGURG", /* 21 */
+ "SIGIO", /* 22 */
+ "SIGSTOP", /* 23 */
+ "SIGTSTP", /* 24 */
+ "SIGCONT", /* 25 */
+ "SIGTTIN", /* 26 */
+ "SIGTTOU", /* 27 */
+ "SIGVTALRM", /* 28 */
+ "SIGPROF", /* 29 */
+ "SIGXCPU", /* 30 */
+ "SIGXFSZ", /* 31 */
+ "SIGRTMIN", /* 32 */
diff --git a/src/linux/mips/syscallent-compat.h b/src/linux/mips/syscallent-compat.h
new file mode 100644
index 000000000..61ccfe4ed
--- /dev/null
+++ b/src/linux/mips/syscallent-compat.h
@@ -0,0 +1,707 @@
+/*
+ * Copyright (c) 2013-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+[ 0] = { 0, 0, SEN(printargs), "svr4_syscall" },
+[ 1] = { 0, 0, SEN(printargs), "svr4_exit" },
+[ 2] = { 0, 0, SEN(printargs), "svr4_fork" },
+[ 3] = { 0, 0, SEN(printargs), "svr4_read" },
+[ 4] = { 0, 0, SEN(printargs), "svr4_write" },
+[ 5] = { 0, 0, SEN(printargs), "svr4_open" },
+[ 6] = { 0, 0, SEN(printargs), "svr4_close" },
+[ 7] = { 0, 0, SEN(printargs), "svr4_wait" },
+[ 8] = { 0, 0, SEN(printargs), "svr4_creat" },
+[ 9] = { 0, 0, SEN(printargs), "svr4_link" },
+[ 10] = { 0, 0, SEN(printargs), "svr4_unlink" },
+[ 11] = { 0, 0, SEN(printargs), "svr4_exec" },
+[ 12] = { 0, 0, SEN(printargs), "svr4_chdir" },
+[ 13] = { 0, 0, SEN(printargs), "svr4_gtime" },
+[ 14] = { 0, 0, SEN(printargs), "svr4_mknod" },
+[ 15] = { 0, 0, SEN(printargs), "svr4_chmod" },
+[ 16] = { 0, 0, SEN(printargs), "svr4_chown" },
+[ 17] = { 0, TM, SEN(printargs), "svr4_sbreak" },
+[ 18] = { 0, TF|TST|TSTA,SEN(printargs), "svr4_stat" },
+[ 19] = { 0, 0, SEN(printargs), "svr4_lseek" },
+[ 20] = { 0, 0, SEN(printargs), "svr4_getpid" },
+[ 21] = { 0, 0, SEN(printargs), "svr4_mount" },
+[ 22] = { 0, 0, SEN(printargs), "svr4_umount" },
+[ 23] = { 0, TC, SEN(printargs), "svr4_setuid" },
+[ 24] = { 0, TC, SEN(printargs), "svr4_getuid" },
+[ 25] = { 0, 0, SEN(printargs), "svr4_stime" },
+[ 26] = { 0, 0, SEN(printargs), "svr4_ptrace" },
+[ 27] = { 0, 0, SEN(printargs), "svr4_alarm" },
+[ 28] = { 0, TD|TFST|TSTA,SEN(printargs), "svr4_fstat" },
+[ 29] = { 0, 0, SEN(printargs), "svr4_pause" },
+[ 30] = { 0, 0, SEN(printargs), "svr4_utime" },
+[ 31] = { 0, 0, SEN(printargs), "svr4_stty" },
+[ 32] = { 0, 0, SEN(printargs), "svr4_gtty" },
+[ 33] = { 0, 0, SEN(printargs), "svr4_access" },
+[ 34] = { 0, 0, SEN(printargs), "svr4_nice" },
+[ 35] = { 0, TF|TSF|TSFA,SEN(printargs), "svr4_statfs" },
+[ 36] = { 0, 0, SEN(printargs), "svr4_sync" },
+[ 37] = { 0, TP, SEN(printargs), "svr4_kill" },
+[ 38] = { 0, TD|TFSF|TSFA,SEN(printargs), "svr4_fstatfs" },
+[ 39] = { 0, 0, SEN(printargs), "svr4_setpgrp" },
+[ 40] = { 0, 0, SEN(printargs), "svr4_cxenix" },
+[ 41] = { 0, 0, SEN(printargs), "svr4_dup" },
+[ 42] = { 0, 0, SEN(printargs), "svr4_pipe" },
+[ 43] = { 0, 0, SEN(printargs), "svr4_times" },
+[ 44] = { 0, 0, SEN(printargs), "svr4_profil" },
+[ 45] = { 0, 0, SEN(printargs), "svr4_plock" },
+[ 46] = { 0, TC, SEN(printargs), "svr4_setgid" },
+[ 47] = { 0, TC, SEN(printargs), "svr4_getgid" },
+[ 48] = { 0, 0, SEN(printargs), "svr4_sig" },
+[ 49] = { 0, 0, SEN(printargs), "svr4_msgsys" },
+[ 50] = { 0, 0, SEN(printargs), "svr4_sysmips" },
+[ 51] = { 0, 0, SEN(printargs), "svr4_sysacct" },
+[ 52] = { 0, 0, SEN(printargs), "svr4_shmsys" },
+[ 53] = { 0, 0, SEN(printargs), "svr4_semsys" },
+[ 54] = { 0, 0, SEN(printargs), "svr4_ioctl" },
+[ 55] = { 0, 0, SEN(printargs), "svr4_uadmin" },
+[ 56] = { 0, 0, SEN(printargs), "svr4_exch" },
+[ 57] = { 0, 0, SEN(printargs), "svr4_utssys" },
+[ 58] = { 0, 0, SEN(printargs), "svr4_fsync" },
+[ 59] = { 0, 0, SEN(printargs), "svr4_exece" },
+[ 60] = { 0, 0, SEN(printargs), "svr4_umask" },
+[ 61] = { 0, 0, SEN(printargs), "svr4_chroot" },
+[ 62] = { 0, 0, SEN(printargs), "svr4_fcntl" },
+[ 63] = { 0, 0, SEN(printargs), "svr4_ulimit" },
+[64 ... 69] = { },
+[ 70] = { 0, 0, SEN(printargs), "svr4_advfs" },
+[ 71] = { 0, 0, SEN(printargs), "svr4_unadvfs" },
+[ 72] = { },
+[ 73] = { },
+[ 74] = { 0, 0, SEN(printargs), "svr4_rfstart" },
+[ 75] = { },
+[ 76] = { 0, 0, SEN(printargs), "svr4_rdebug" },
+[ 77] = { 0, 0, SEN(printargs), "svr4_rfstop" },
+[ 78] = { 0, 0, SEN(printargs), "svr4_rfsys" },
+[ 79] = { 0, 0, SEN(printargs), "svr4_rmdir" },
+[ 80] = { 0, 0, SEN(printargs), "svr4_mkdir" },
+[ 81] = { 0, 0, SEN(printargs), "svr4_getdents" },
+[ 82] = { 0, 0, SEN(printargs), "svr4_libattach" },
+[ 83] = { 0, 0, SEN(printargs), "svr4_libdetach" },
+[ 84] = { 0, 0, SEN(printargs), "svr4_sysfs" },
+[ 85] = { 0, 0, SEN(printargs), "svr4_getmsg" },
+[ 86] = { 0, 0, SEN(printargs), "svr4_putmsg" },
+[ 87] = { 0, 0, SEN(printargs), "svr4_poll" },
+[ 88] = { 0, TF|TLST|TSTA,SEN(printargs), "svr4_lstat" },
+[ 89] = { 0, 0, SEN(printargs), "svr4_symlink" },
+[ 90] = { 0, 0, SEN(printargs), "svr4_readlink" },
+[ 91] = { 0, TC, SEN(printargs), "svr4_setgroups" },
+[ 92] = { 0, TC, SEN(printargs), "svr4_getgroups" },
+[ 93] = { 0, 0, SEN(printargs), "svr4_fchmod" },
+[ 94] = { 0, 0, SEN(printargs), "svr4_fchown" },
+[ 95] = { 0, 0, SEN(printargs), "svr4_sigprocmask" },
+[ 96] = { 0, 0, SEN(printargs), "svr4_sigsuspend" },
+[ 97] = { 0, 0, SEN(printargs), "svr4_sigaltstack" },
+[ 98] = { 0, 0, SEN(printargs), "svr4_sigaction" },
+[ 99] = { 0, 0, SEN(printargs), "svr4_sigpending" },
+[ 100] = { 0, 0, SEN(printargs), "svr4_setcontext" },
+[ 101] = { 0, 0, SEN(printargs), "svr4_evsys" },
+[ 102] = { 0, 0, SEN(printargs), "svr4_evtrapret" },
+[ 103] = { 0, TF|TSF|TSFA,SEN(printargs), "svr4_statvfs" },
+[ 104] = { 0, TD|TFSF|TSFA,SEN(printargs), "svr4_fstatvfs" },
+[ 105] = { },
+[ 106] = { 0, 0, SEN(printargs), "svr4_nfssys" },
+[ 107] = { 0, 0, SEN(printargs), "svr4_waitid" },
+[ 108] = { 0, 0, SEN(printargs), "svr4_sigsendset" },
+[ 109] = { 0, 0, SEN(printargs), "svr4_hrtsys" },
+[ 110] = { 0, 0, SEN(printargs), "svr4_acancel" },
+[ 111] = { 0, 0, SEN(printargs), "svr4_async" },
+[ 112] = { 0, 0, SEN(printargs), "svr4_priocntlset" },
+[ 113] = { 0, 0, SEN(printargs), "svr4_pathconf" },
+[ 114] = { 0, TM, SEN(printargs), "svr4_mincore" },
+[ 115] = { 0, TD|TM|SI, SEN(printargs), "svr4_mmap" },
+[ 116] = { 0, TM|SI, SEN(printargs), "svr4_mprotect" },
+[ 117] = { 0, TM|SI, SEN(printargs), "svr4_munmap" },
+[ 118] = { 0, 0, SEN(printargs), "svr4_fpathconf" },
+[ 119] = { 0, 0, SEN(printargs), "svr4_vfork" },
+[ 120] = { 0, 0, SEN(printargs), "svr4_fchdir" },
+[ 121] = { 0, 0, SEN(printargs), "svr4_readv" },
+[ 122] = { 0, 0, SEN(printargs), "svr4_writev" },
+[ 123] = { 0, TF|TST|TSTA,SEN(printargs), "svr4_xstat" },
+[ 124] = { 0, TF|TLST|TSTA,SEN(printargs), "svr4_lxstat" },
+[ 125] = { 0, TD|TFST|TSTA,SEN(printargs), "svr4_fxstat" },
+[ 126] = { 0, 0, SEN(printargs), "svr4_xmknod" },
+[ 127] = { 0, 0, SEN(printargs), "svr4_clocal" },
+[ 128] = { 0, 0, SEN(printargs), "svr4_setrlimit" },
+[ 129] = { 0, 0, SEN(printargs), "svr4_getrlimit" },
+[ 130] = { 0, 0, SEN(printargs), "svr4_lchown" },
+[ 131] = { 0, 0, SEN(printargs), "svr4_memcntl" },
+[ 132] = { 0, 0, SEN(printargs), "svr4_getpmsg" },
+[ 133] = { 0, 0, SEN(printargs), "svr4_putpmsg" },
+[ 134] = { 0, 0, SEN(printargs), "svr4_rename" },
+[ 135] = { 0, 0, SEN(printargs), "svr4_nuname" },
+[ 136] = { 0, TC, SEN(printargs), "svr4_setegid" },
+[ 137] = { 0, 0, SEN(printargs), "svr4_sysconf" },
+[ 138] = { 0, TCL, SEN(printargs), "svr4_adjtime" },
+[ 139] = { 0, 0, SEN(printargs), "svr4_sysinfo" },
+[ 140] = { },
+[ 141] = { 0, TC, SEN(printargs), "svr4_seteuid" },
+[ 142] = { 0, 0, SEN(printargs), "svr4_PYRAMID_statis" },
+[ 143] = { 0, 0, SEN(printargs), "svr4_PYRAMID_tuning" },
+[ 144] = { 0, 0, SEN(printargs), "svr4_PYRAMID_forcerr" },
+[ 145] = { 0, 0, SEN(printargs), "svr4_PYRAMID_mpcntl" },
+[146 ... 200] = { },
+[ 201] = { 0, 0, SEN(printargs), "svr4_aread" },
+[ 202] = { 0, 0, SEN(printargs), "svr4_awrite" },
+[ 203] = { 0, 0, SEN(printargs), "svr4_listio" },
+[ 204] = { 0, 0, SEN(printargs), "svr4_mips_acancel" },
+[ 205] = { 0, 0, SEN(printargs), "svr4_astatus" },
+[ 206] = { 0, 0, SEN(printargs), "svr4_await" },
+[ 207] = { 0, 0, SEN(printargs), "svr4_areadv" },
+[ 208] = { 0, 0, SEN(printargs), "svr4_awritev" },
+
+[1000] = { 0, 0, SEN(printargs), "sysv_syscall" }, /* start of SYSV */
+[1001] = { 0, 0, SEN(printargs), "sysv_exit" },
+[1002] = { 0, 0, SEN(printargs), "sysv_fork" },
+[1003] = { 0, 0, SEN(printargs), "sysv_read" },
+[1004] = { 0, 0, SEN(printargs), "sysv_write" },
+[1005] = { 0, 0, SEN(printargs), "sysv_open" },
+[1006] = { 0, 0, SEN(printargs), "sysv_close" },
+[1007] = { 0, 0, SEN(printargs), "sysv_wait" },
+[1008] = { 0, 0, SEN(printargs), "sysv_creat" },
+[1009] = { 0, 0, SEN(printargs), "sysv_link" },
+[1010] = { 0, 0, SEN(printargs), "sysv_unlink" },
+[1011] = { 0, 0, SEN(printargs), "sysv_execv" },
+[1012] = { 0, 0, SEN(printargs), "sysv_chdir" },
+[1013] = { 0, 0, SEN(printargs), "sysv_time" },
+[1014] = { 0, 0, SEN(printargs), "sysv_mknod" },
+[1015] = { 0, 0, SEN(printargs), "sysv_chmod" },
+[1016] = { 0, 0, SEN(printargs), "sysv_chown" },
+[1017] = { 0, TM|SI, SEN(printargs), "sysv_brk" },
+[1018] = { 0, TF|TST|TSTA,SEN(printargs), "sysv_stat" },
+[1019] = { 0, 0, SEN(printargs), "sysv_lseek" },
+[1020] = { 0, 0, SEN(printargs), "sysv_getpid" },
+[1021] = { 0, 0, SEN(printargs), "sysv_mount" },
+[1022] = { 0, 0, SEN(printargs), "sysv_umount" },
+[1023] = { 0, TC, SEN(printargs), "sysv_setuid" },
+[1024] = { 0, TC, SEN(printargs), "sysv_getuid" },
+[1025] = { 0, 0, SEN(printargs), "sysv_stime" },
+[1026] = { 0, 0, SEN(printargs), "sysv_ptrace" },
+[1027] = { 0, 0, SEN(printargs), "sysv_alarm" },
+[1028] = { 0, TD|TFST|TSTA,SEN(printargs), "sysv_fstat" },
+[1029] = { 0, 0, SEN(printargs), "sysv_pause" },
+[1030] = { 0, 0, SEN(printargs), "sysv_utime" },
+[1031] = { 0, 0, SEN(printargs), "sysv_stty" },
+[1032] = { 0, 0, SEN(printargs), "sysv_gtty" },
+[1033] = { 0, 0, SEN(printargs), "sysv_access" },
+[1034] = { 0, 0, SEN(printargs), "sysv_nice" },
+[1035] = { 0, TF|TSF|TSFA,SEN(printargs), "sysv_statfs" },
+[1036] = { 0, 0, SEN(printargs), "sysv_sync" },
+[1037] = { 0, TP, SEN(printargs), "sysv_kill" },
+[1038] = { 0, TD|TFSF|TSFA,SEN(printargs), "sysv_fstatfs" },
+[1039] = { 0, 0, SEN(printargs), "sysv_setpgrp" },
+[1040] = { 0, 0, SEN(printargs), "sysv_syssgi" },
+[1041] = { 0, 0, SEN(printargs), "sysv_dup" },
+[1042] = { 0, 0, SEN(printargs), "sysv_pipe" },
+[1043] = { 0, 0, SEN(printargs), "sysv_times" },
+[1044] = { 0, 0, SEN(printargs), "sysv_profil" },
+[1045] = { 0, 0, SEN(printargs), "sysv_plock" },
+[1046] = { 0, TC, SEN(printargs), "sysv_setgid" },
+[1047] = { 0, TC, SEN(printargs), "sysv_getgid" },
+[1048] = { 0, 0, SEN(printargs), "sysv_sig" },
+[1049] = { 0, 0, SEN(printargs), "sysv_msgsys" },
+[1050] = { 0, 0, SEN(printargs), "sysv_sysmips" },
+[1051] = { 0, 0, SEN(printargs), "sysv_acct" },
+[1052] = { 0, 0, SEN(printargs), "sysv_shmsys" },
+[1053] = { 0, 0, SEN(printargs), "sysv_semsys" },
+[1054] = { 0, 0, SEN(printargs), "sysv_ioctl" },
+[1055] = { 0, 0, SEN(printargs), "sysv_uadmin" },
+[1056] = { 0, 0, SEN(printargs), "sysv_sysmp" },
+[1057] = { 0, 0, SEN(printargs), "sysv_utssys" },
+[1058] = { },
+[1059] = { 0, 0, SEN(printargs), "sysv_execve" },
+[1060] = { 0, 0, SEN(printargs), "sysv_umask" },
+[1061] = { 0, 0, SEN(printargs), "sysv_chroot" },
+[1062] = { 0, 0, SEN(printargs), "sysv_fcntl" },
+[1063] = { 0, 0, SEN(printargs), "sysv_ulimit" },
+[1064 ... 1069] = { },
+[1070] = { 0, 0, SEN(printargs), "sysv_advfs" },
+[1071] = { 0, 0, SEN(printargs), "sysv_unadvfs" },
+[1072] = { 0, 0, SEN(printargs), "sysv_rmount" },
+[1073] = { 0, 0, SEN(printargs), "sysv_rumount" },
+[1074] = { 0, 0, SEN(printargs), "sysv_rfstart" },
+[1075] = { 0, 0, SEN(printargs), "sysv_getrlimit64" },
+[1076] = { 0, 0, SEN(printargs), "sysv_setrlimit64" },
+[1077] = { 0, 0, SEN(printargs), "sysv_nanosleep" },
+[1078] = { 0, 0, SEN(printargs), "sysv_lseek64" },
+[1079] = { 0, 0, SEN(printargs), "sysv_rmdir" },
+[1080] = { 0, 0, SEN(printargs), "sysv_mkdir" },
+[1081] = { 0, 0, SEN(printargs), "sysv_getdents" },
+[1082] = { 0, 0, SEN(printargs), "sysv_sginap" },
+[1083] = { 0, 0, SEN(printargs), "sysv_sgikopt" },
+[1084] = { 0, 0, SEN(printargs), "sysv_sysfs" },
+[1085] = { 0, 0, SEN(printargs), "sysv_getmsg" },
+[1086] = { 0, 0, SEN(printargs), "sysv_putmsg" },
+[1087] = { 0, 0, SEN(printargs), "sysv_poll" },
+[1088] = { 0, 0, SEN(printargs), "sysv_sigreturn" },
+[1089] = { 0, 0, SEN(printargs), "sysv_accept" },
+[1090] = { 0, 0, SEN(printargs), "sysv_bind" },
+[1091] = { 0, 0, SEN(printargs), "sysv_connect" },
+[1092] = { 0, 0, SEN(printargs), "sysv_gethostid" },
+[1093] = { 0, 0, SEN(printargs), "sysv_getpeername" },
+[1094] = { 0, 0, SEN(printargs), "sysv_getsockname" },
+[1095] = { 0, 0, SEN(printargs), "sysv_getsockopt" },
+[1096] = { 0, 0, SEN(printargs), "sysv_listen" },
+[1097] = { 0, 0, SEN(printargs), "sysv_recv" },
+[1098] = { 0, 0, SEN(printargs), "sysv_recvfrom" },
+[1099] = { 0, 0, SEN(printargs), "sysv_recvmsg" },
+[1100] = { 0, 0, SEN(printargs), "sysv_select" },
+[1101] = { 0, 0, SEN(printargs), "sysv_send" },
+[1102] = { 0, 0, SEN(printargs), "sysv_sendmsg" },
+[1103] = { 0, 0, SEN(printargs), "sysv_sendto" },
+[1104] = { 0, 0, SEN(printargs), "sysv_sethostid" },
+[1105] = { 0, 0, SEN(printargs), "sysv_setsockopt" },
+[1106] = { 0, 0, SEN(printargs), "sysv_shutdown" },
+[1107] = { 0, 0, SEN(printargs), "sysv_socket" },
+[1108] = { 0, 0, SEN(printargs), "sysv_gethostname" },
+[1109] = { 0, 0, SEN(printargs), "sysv_sethostname" },
+[1110] = { 0, 0, SEN(printargs), "sysv_getdomainname" },
+[1111] = { 0, 0, SEN(printargs), "sysv_setdomainname" },
+[1112] = { 0, 0, SEN(printargs), "sysv_truncate" },
+[1113] = { 0, 0, SEN(printargs), "sysv_ftruncate" },
+[1114] = { 0, 0, SEN(printargs), "sysv_rename" },
+[1115] = { 0, 0, SEN(printargs), "sysv_symlink" },
+[1116] = { 0, 0, SEN(printargs), "sysv_readlink" },
+[1117] = { 0, TF|TLST|TSTA,SEN(printargs), "sysv_lstat" },
+[1118] = { 0, 0, SEN(printargs), "sysv_nfsmount" },
+[1119] = { 0, 0, SEN(printargs), "sysv_nfssvc" },
+[1120] = { 0, 0, SEN(printargs), "sysv_getfh" },
+[1121] = { 0, 0, SEN(printargs), "sysv_async_daemon" },
+[1122] = { 0, 0, SEN(printargs), "sysv_exportfs" },
+[1123] = { 0, TC, SEN(printargs), "sysv_setregid" },
+[1124] = { 0, TC, SEN(printargs), "sysv_setreuid" },
+[1125] = { 0, 0, SEN(printargs), "sysv_getitimer" },
+[1126] = { 0, 0, SEN(printargs), "sysv_setitimer" },
+[1127] = { 0, TCL, SEN(printargs), "sysv_adjtime" },
+[1128] = { 0, 0, SEN(printargs), "sysv_BSD_getime" },
+[1129] = { 0, 0, SEN(printargs), "sysv_sproc" },
+[1130] = { 0, 0, SEN(printargs), "sysv_prctl" },
+[1131] = { 0, 0, SEN(printargs), "sysv_procblk" },
+[1132] = { 0, 0, SEN(printargs), "sysv_sprocsp" },
+[1133] = { 0, 0, SEN(printargs), "sysv_sgigsc" },
+[1134] = { 0, TD|TM|SI, SEN(printargs), "sysv_mmap" },
+[1135] = { 0, TM|SI, SEN(printargs), "sysv_munmap" },
+[1136] = { 0, TM|SI, SEN(printargs), "sysv_mprotect" },
+[1137] = { 0, TM, SEN(printargs), "sysv_msync" },
+[1138] = { 0, TM, SEN(printargs), "sysv_madvise" },
+[1139] = { 0, 0, SEN(printargs), "sysv_pagelock" },
+[1140] = { 0, 0, SEN(printargs), "sysv_getpagesize" },
+[1141] = { 0, TF, SEN(printargs), "sysv_quotactl" },
+[1142] = { 0, 0, SEN(printargs), "sysv_libdetach" },
+[1143] = { 0, 0, SEN(printargs), "sysv_BSDgetpgrp" },
+[1144] = { 0, 0, SEN(printargs), "sysv_BSDsetpgrp" },
+[1145] = { 0, 0, SEN(printargs), "sysv_vhangup" },
+[1146] = { 0, 0, SEN(printargs), "sysv_fsync" },
+[1147] = { 0, 0, SEN(printargs), "sysv_fchdir" },
+[1148] = { 0, 0, SEN(printargs), "sysv_getrlimit" },
+[1149] = { 0, 0, SEN(printargs), "sysv_setrlimit" },
+[1150] = { 0, 0, SEN(printargs), "sysv_cacheflush" },
+[1151] = { 0, 0, SEN(printargs), "sysv_cachectl" },
+[1152] = { 0, 0, SEN(printargs), "sysv_fchown" },
+[1153] = { 0, 0, SEN(printargs), "sysv_fchmod" },
+[1154] = { 0, 0, SEN(printargs), "sysv_wait3" },
+[1155] = { 0, 0, SEN(printargs), "sysv_socketpair" },
+[1156] = { 0, 0, SEN(printargs), "sysv_sysinfo" },
+[1157] = { 0, 0, SEN(printargs), "sysv_nuname" },
+[1158] = { 0, TF|TST|TSTA,SEN(printargs), "sysv_xstat" },
+[1159] = { 0, TF|TLST|TSTA,SEN(printargs), "sysv_lxstat" },
+[1160] = { 0, TD|TFST|TSTA,SEN(printargs), "sysv_fxstat" },
+[1161] = { 0, 0, SEN(printargs), "sysv_xmknod" },
+[1162] = { 0, 0, SEN(printargs), "sysv_ksigaction" },
+[1163] = { 0, 0, SEN(printargs), "sysv_sigpending" },
+[1164] = { 0, 0, SEN(printargs), "sysv_sigprocmask" },
+[1165] = { 0, 0, SEN(printargs), "sysv_sigsuspend" },
+[1166] = { 0, 0, SEN(printargs), "sysv_sigpoll" },
+[1167] = { 0, 0, SEN(printargs), "sysv_swapctl" },
+[1168] = { 0, 0, SEN(printargs), "sysv_getcontext" },
+[1169] = { 0, 0, SEN(printargs), "sysv_setcontext" },
+[1170] = { 0, 0, SEN(printargs), "sysv_waitsys" },
+[1171] = { 0, 0, SEN(printargs), "sysv_sigstack" },
+[1172] = { 0, 0, SEN(printargs), "sysv_sigaltstack" },
+[1173] = { 0, 0, SEN(printargs), "sysv_sigsendset" },
+[1174] = { 0, TF|TSF|TSFA,SEN(printargs), "sysv_statvfs" },
+[1175] = { 0, TD|TFSF|TSFA,SEN(printargs), "sysv_fstatvfs" },
+[1176] = { 0, 0, SEN(printargs), "sysv_getpmsg" },
+[1177] = { 0, 0, SEN(printargs), "sysv_putpmsg" },
+[1178] = { 0, 0, SEN(printargs), "sysv_lchown" },
+[1179] = { 0, 0, SEN(printargs), "sysv_priocntl" },
+[1180] = { 0, 0, SEN(printargs), "sysv_ksigqueue" },
+[1181] = { 0, 0, SEN(printargs), "sysv_readv" },
+[1182] = { 0, 0, SEN(printargs), "sysv_writev" },
+[1183] = { 0, 0, SEN(printargs), "sysv_truncate64" },
+[1184] = { 0, 0, SEN(printargs), "sysv_ftruncate64" },
+[1185] = { 0, TD|TM|SI, SEN(printargs), "sysv_mmap64" },
+[1186] = { 0, 0, SEN(printargs), "sysv_dmi" },
+[1187] = { 0, 0, SEN(printargs), "sysv_pread" },
+[1188] = { 0, 0, SEN(printargs), "sysv_pwrite" },
+
+[2000] = { 0, 0, SEN(printargs), "bsd43_syscall" }, /* start of BSD 4.3 */
+[2001] = { 0, 0, SEN(printargs), "bsd43_exit" },
+[2002] = { 0, 0, SEN(printargs), "bsd43_fork" },
+[2003] = { 0, 0, SEN(printargs), "bsd43_read" },
+[2004] = { 0, 0, SEN(printargs), "bsd43_write" },
+[2005] = { 0, 0, SEN(printargs), "bsd43_open" },
+[2006] = { 0, 0, SEN(printargs), "bsd43_close" },
+[2007] = { 0, 0, SEN(printargs), "bsd43_wait" },
+[2008] = { 0, 0, SEN(printargs), "bsd43_creat" },
+[2009] = { 0, 0, SEN(printargs), "bsd43_link" },
+[2010] = { 0, 0, SEN(printargs), "bsd43_unlink" },
+[2011] = { 0, 0, SEN(printargs), "bsd43_exec" },
+[2012] = { 0, 0, SEN(printargs), "bsd43_chdir" },
+[2013] = { 0, 0, SEN(printargs), "bsd43_time" },
+[2014] = { 0, 0, SEN(printargs), "bsd43_mknod" },
+[2015] = { 0, 0, SEN(printargs), "bsd43_chmod" },
+[2016] = { 0, 0, SEN(printargs), "bsd43_chown" },
+[2017] = { 0, TM, SEN(printargs), "bsd43_sbreak" },
+[2018] = { 0, TF|TST|TSTA,SEN(printargs), "bsd43_oldstat" },
+[2019] = { 0, 0, SEN(printargs), "bsd43_lseek" },
+[2020] = { 0, 0, SEN(printargs), "bsd43_getpid" },
+[2021] = { 0, 0, SEN(printargs), "bsd43_oldmount" },
+[2022] = { 0, 0, SEN(printargs), "bsd43_umount" },
+[2023] = { 0, TC, SEN(printargs), "bsd43_setuid" },
+[2024] = { 0, TC, SEN(printargs), "bsd43_getuid" },
+[2025] = { 0, 0, SEN(printargs), "bsd43_stime" },
+[2026] = { 0, 0, SEN(printargs), "bsd43_ptrace" },
+[2027] = { 0, 0, SEN(printargs), "bsd43_alarm" },
+[2028] = { 0, TD|TFST|TSTA,SEN(printargs), "bsd43_oldfstat" },
+[2029] = { 0, 0, SEN(printargs), "bsd43_pause" },
+[2030] = { 0, 0, SEN(printargs), "bsd43_utime" },
+[2031] = { 0, 0, SEN(printargs), "bsd43_stty" },
+[2032] = { 0, 0, SEN(printargs), "bsd43_gtty" },
+[2033] = { 0, 0, SEN(printargs), "bsd43_access" },
+[2034] = { 0, 0, SEN(printargs), "bsd43_nice" },
+[2035] = { 0, 0, SEN(printargs), "bsd43_ftime" },
+[2036] = { 0, 0, SEN(printargs), "bsd43_sync" },
+[2037] = { 0, TP, SEN(printargs), "bsd43_kill" },
+[2038] = { 0, TF|TST|TSTA,SEN(printargs), "bsd43_stat" },
+[2039] = { 0, 0, SEN(printargs), "bsd43_oldsetpgrp" },
+[2040] = { 0, TF|TLST|TSTA,SEN(printargs), "bsd43_lstat" },
+[2041] = { 0, 0, SEN(printargs), "bsd43_dup" },
+[2042] = { 0, 0, SEN(printargs), "bsd43_pipe" },
+[2043] = { 0, 0, SEN(printargs), "bsd43_times" },
+[2044] = { 0, 0, SEN(printargs), "bsd43_profil" },
+[2045] = { 0, 0, SEN(printargs), "bsd43_msgsys" },
+[2046] = { 0, TC, SEN(printargs), "bsd43_setgid" },
+[2047] = { 0, TC, SEN(printargs), "bsd43_getgid" },
+[2048] = { 0, 0, SEN(printargs), "bsd43_ssig" },
+[2049] = { },
+[2050] = { },
+[2051] = { 0, 0, SEN(printargs), "bsd43_sysacct" },
+[2052] = { 0, 0, SEN(printargs), "bsd43_phys" },
+[2053] = { 0, 0, SEN(printargs), "bsd43_lock" },
+[2054] = { 0, 0, SEN(printargs), "bsd43_ioctl" },
+[2055] = { 0, 0, SEN(printargs), "bsd43_reboot" },
+[2056] = { 0, 0, SEN(printargs), "bsd43_mpxchan" },
+[2057] = { 0, 0, SEN(printargs), "bsd43_symlink" },
+[2058] = { 0, 0, SEN(printargs), "bsd43_readlink" },
+[2059] = { 0, 0, SEN(printargs), "bsd43_execve" },
+[2060] = { 0, 0, SEN(printargs), "bsd43_umask" },
+[2061] = { 0, 0, SEN(printargs), "bsd43_chroot" },
+[2062] = { 0, TD|TFST|TSTA,SEN(printargs), "bsd43_fstat" },
+[2063] = { },
+[2064] = { 0, 0, SEN(printargs), "bsd43_getpagesize" },
+[2065] = { 0, TM|SI, SEN(printargs), "bsd43_mremap" },
+[2066] = { 0, 0, SEN(printargs), "bsd43_vfork" },
+[2067] = { 0, 0, SEN(printargs), "bsd43_vread" },
+[2068] = { 0, 0, SEN(printargs), "bsd43_vwrite" },
+[2069] = { 0, TM|SI, SEN(printargs), "bsd43_sbrk" },
+[2070] = { 0, 0, SEN(printargs), "bsd43_sstk" },
+[2071] = { 0, TD|TM|SI, SEN(printargs), "bsd43_mmap" },
+[2072] = { 0, 0, SEN(printargs), "bsd43_vadvise" },
+[2073] = { 0, TM|SI, SEN(printargs), "bsd43_munmap" },
+[2074] = { 0, TM|SI, SEN(printargs), "bsd43_mprotect" },
+[2075] = { 0, TM, SEN(printargs), "bsd43_madvise" },
+[2076] = { 0, 0, SEN(printargs), "bsd43_vhangup" },
+[2077] = { 0, 0, SEN(printargs), "bsd43_vlimit" },
+[2078] = { 0, TM, SEN(printargs), "bsd43_mincore" },
+[2079] = { 0, TC, SEN(printargs), "bsd43_getgroups" },
+[2080] = { 0, TC, SEN(printargs), "bsd43_setgroups" },
+[2081] = { 0, 0, SEN(printargs), "bsd43_getpgrp" },
+[2082] = { 0, 0, SEN(printargs), "bsd43_setpgrp" },
+[2083] = { 0, 0, SEN(printargs), "bsd43_setitimer" },
+[2084] = { 0, 0, SEN(printargs), "bsd43_wait3" },
+[2085] = { 0, 0, SEN(printargs), "bsd43_swapon" },
+[2086] = { 0, 0, SEN(printargs), "bsd43_getitimer" },
+[2087] = { 0, 0, SEN(printargs), "bsd43_gethostname" },
+[2088] = { 0, 0, SEN(printargs), "bsd43_sethostname" },
+[2089] = { 0, 0, SEN(printargs), "bsd43_getdtablesize" },
+[2090] = { 0, 0, SEN(printargs), "bsd43_dup2" },
+[2091] = { 0, 0, SEN(printargs), "bsd43_getdopt" },
+[2092] = { 0, 0, SEN(printargs), "bsd43_fcntl" },
+[2093] = { 0, 0, SEN(printargs), "bsd43_select" },
+[2094] = { 0, 0, SEN(printargs), "bsd43_setdopt" },
+[2095] = { 0, 0, SEN(printargs), "bsd43_fsync" },
+[2096] = { 0, 0, SEN(printargs), "bsd43_setpriority" },
+[2097] = { 0, 0, SEN(printargs), "bsd43_socket" },
+[2098] = { 0, 0, SEN(printargs), "bsd43_connect" },
+[2099] = { 0, 0, SEN(printargs), "bsd43_oldaccept" },
+[2100] = { 0, 0, SEN(printargs), "bsd43_getpriority" },
+[2101] = { 0, 0, SEN(printargs), "bsd43_send" },
+[2102] = { 0, 0, SEN(printargs), "bsd43_recv" },
+[2103] = { 0, 0, SEN(printargs), "bsd43_sigreturn" },
+[2104] = { 0, 0, SEN(printargs), "bsd43_bind" },
+[2105] = { 0, 0, SEN(printargs), "bsd43_setsockopt" },
+[2106] = { 0, 0, SEN(printargs), "bsd43_listen" },
+[2107] = { 0, 0, SEN(printargs), "bsd43_vtimes" },
+[2108] = { 0, 0, SEN(printargs), "bsd43_sigvec" },
+[2109] = { 0, 0, SEN(printargs), "bsd43_sigblock" },
+[2110] = { 0, 0, SEN(printargs), "bsd43_sigsetmask" },
+[2111] = { 0, 0, SEN(printargs), "bsd43_sigpause" },
+[2112] = { 0, 0, SEN(printargs), "bsd43_sigstack" },
+[2113] = { 0, 0, SEN(printargs), "bsd43_oldrecvmsg" },
+[2114] = { 0, 0, SEN(printargs), "bsd43_oldsendmsg" },
+[2115] = { 0, 0, SEN(printargs), "bsd43_vtrace" },
+[2116] = { 0, TCL, SEN(printargs), "bsd43_gettimeofday" },
+[2117] = { 0, 0, SEN(printargs), "bsd43_getrusage" },
+[2118] = { 0, 0, SEN(printargs), "bsd43_getsockopt" },
+[2119] = { },
+[2120] = { 0, 0, SEN(printargs), "bsd43_readv" },
+[2121] = { 0, 0, SEN(printargs), "bsd43_writev" },
+[2122] = { 0, TCL, SEN(printargs), "bsd43_settimeofday" },
+[2123] = { 0, 0, SEN(printargs), "bsd43_fchown" },
+[2124] = { 0, 0, SEN(printargs), "bsd43_fchmod" },
+[2125] = { 0, 0, SEN(printargs), "bsd43_oldrecvfrom" },
+[2126] = { 0, TC, SEN(printargs), "bsd43_setreuid" },
+[2127] = { 0, TC, SEN(printargs), "bsd43_setregid" },
+[2128] = { 0, 0, SEN(printargs), "bsd43_rename" },
+[2129] = { 0, 0, SEN(printargs), "bsd43_truncate" },
+[2130] = { 0, 0, SEN(printargs), "bsd43_ftruncate" },
+[2131] = { 0, 0, SEN(printargs), "bsd43_flock" },
+[2132] = { 0, 0, SEN(printargs), "bsd43_semsys" },
+[2133] = { 0, 0, SEN(printargs), "bsd43_sendto" },
+[2134] = { 0, 0, SEN(printargs), "bsd43_shutdown" },
+[2135] = { 0, 0, SEN(printargs), "bsd43_socketpair" },
+[2136] = { 0, 0, SEN(printargs), "bsd43_mkdir" },
+[2137] = { 0, 0, SEN(printargs), "bsd43_rmdir" },
+[2138] = { 0, 0, SEN(printargs), "bsd43_utimes" },
+[2139] = { 0, 0, SEN(printargs), "bsd43_sigcleanup" },
+[2140] = { 0, TCL, SEN(printargs), "bsd43_adjtime" },
+[2141] = { 0, 0, SEN(printargs), "bsd43_oldgetpeername" },
+[2142] = { 0, 0, SEN(printargs), "bsd43_gethostid" },
+[2143] = { 0, 0, SEN(printargs), "bsd43_sethostid" },
+[2144] = { 0, 0, SEN(printargs), "bsd43_getrlimit" },
+[2145] = { 0, 0, SEN(printargs), "bsd43_setrlimit" },
+[2146] = { 0, TP, SEN(printargs), "bsd43_killpg" },
+[2147] = { 0, 0, SEN(printargs), "bsd43_shmsys" },
+[2148] = { 0, 0, SEN(printargs), "bsd43_quota" },
+[2149] = { 0, 0, SEN(printargs), "bsd43_qquota" },
+[2150] = { 0, 0, SEN(printargs), "bsd43_oldgetsockname" },
+[2151] = { 0, 0, SEN(printargs), "bsd43_sysmips" },
+[2152] = { 0, 0, SEN(printargs), "bsd43_cacheflush" },
+[2153] = { 0, 0, SEN(printargs), "bsd43_cachectl" },
+[2154] = { 0, 0, SEN(printargs), "bsd43_debug" },
+[2155] = { },
+[2156] = { },
+[2157] = { 0, 0, SEN(printargs), "bsd43_nfs_mount" },
+[2158] = { 0, 0, SEN(printargs), "bsd43_nfs_svc" },
+[2159] = { 0, 0, SEN(printargs), "bsd43_getdirentries" },
+[2160] = { 0, TF|TSF|TSFA,SEN(printargs), "bsd43_statfs" },
+[2161] = { 0, TD|TFSF|TSFA,SEN(printargs), "bsd43_fstatfs" },
+[2162] = { 0, 0, SEN(printargs), "bsd43_unmount" },
+[2163] = { 0, 0, SEN(printargs), "bsd43_async_daemon" },
+[2164] = { 0, 0, SEN(printargs), "bsd43_nfs_getfh" },
+[2165] = { 0, 0, SEN(printargs), "bsd43_getdomainname" },
+[2166] = { 0, 0, SEN(printargs), "bsd43_setdomainname" },
+[2167] = { 0, 0, SEN(printargs), "bsd43_pcfs_mount" },
+[2168] = { 0, TF, SEN(printargs), "bsd43_quotactl" },
+[2169] = { 0, 0, SEN(printargs), "bsd43_oldexportfs" },
+[2170] = { 0, 0, SEN(printargs), "bsd43_smount" },
+[2171] = { 0, 0, SEN(printargs), "bsd43_mipshwconf" },
+[2172] = { 0, 0, SEN(printargs), "bsd43_exportfs" },
+[2173] = { 0, 0, SEN(printargs), "bsd43_nfsfh_open" },
+[2174] = { 0, 0, SEN(printargs), "bsd43_libattach" },
+[2175] = { 0, 0, SEN(printargs), "bsd43_libdetach" },
+[2176] = { 0, 0, SEN(printargs), "bsd43_accept" },
+[2177] = { },
+[2178] = { },
+[2179] = { 0, 0, SEN(printargs), "bsd43_recvmsg" },
+[2180] = { 0, 0, SEN(printargs), "bsd43_recvfrom" },
+[2181] = { 0, 0, SEN(printargs), "bsd43_sendmsg" },
+[2182] = { 0, 0, SEN(printargs), "bsd43_getpeername" },
+[2183] = { 0, 0, SEN(printargs), "bsd43_getsockname" },
+[2184] = { 0, 0, SEN(printargs), "bsd43_aread" },
+[2185] = { 0, 0, SEN(printargs), "bsd43_awrite" },
+[2186] = { 0, 0, SEN(printargs), "bsd43_listio" },
+[2187] = { 0, 0, SEN(printargs), "bsd43_acancel" },
+[2188] = { 0, 0, SEN(printargs), "bsd43_astatus" },
+[2189] = { 0, 0, SEN(printargs), "bsd43_await" },
+[2190] = { 0, 0, SEN(printargs), "bsd43_areadv" },
+[2191] = { 0, 0, SEN(printargs), "bsd43_awritev" },
+
+[3000] = { 0, 0, SEN(printargs), "posix_syscall" }, /* start of POSIX */
+[3001] = { 0, 0, SEN(printargs), "posix_exit" },
+[3002] = { 0, 0, SEN(printargs), "posix_fork" },
+[3003] = { 0, 0, SEN(printargs), "posix_read" },
+[3004] = { 0, 0, SEN(printargs), "posix_write" },
+[3005] = { 0, 0, SEN(printargs), "posix_open" },
+[3006] = { 0, 0, SEN(printargs), "posix_close" },
+[3007] = { 0, 0, SEN(printargs), "posix_wait" },
+[3008] = { 0, 0, SEN(printargs), "posix_creat" },
+[3009] = { 0, 0, SEN(printargs), "posix_link" },
+[3010] = { 0, 0, SEN(printargs), "posix_unlink" },
+[3011] = { 0, 0, SEN(printargs), "posix_exec" },
+[3012] = { 0, 0, SEN(printargs), "posix_chdir" },
+[3013] = { 0, 0, SEN(printargs), "posix_gtime" },
+[3014] = { 0, 0, SEN(printargs), "posix_mknod" },
+[3015] = { 0, 0, SEN(printargs), "posix_chmod" },
+[3016] = { 0, 0, SEN(printargs), "posix_chown" },
+[3017] = { 0, TM, SEN(printargs), "posix_sbreak" },
+[3018] = { 0, TF|TST|TSTA,SEN(printargs), "posix_stat" },
+[3019] = { 0, 0, SEN(printargs), "posix_lseek" },
+[3020] = { 0, 0, SEN(printargs), "posix_getpid" },
+[3021] = { 0, 0, SEN(printargs), "posix_mount" },
+[3022] = { 0, 0, SEN(printargs), "posix_umount" },
+[3023] = { 0, TC, SEN(printargs), "posix_setuid" },
+[3024] = { 0, TC, SEN(printargs), "posix_getuid" },
+[3025] = { 0, 0, SEN(printargs), "posix_stime" },
+[3026] = { 0, 0, SEN(printargs), "posix_ptrace" },
+[3027] = { 0, 0, SEN(printargs), "posix_alarm" },
+[3028] = { 0, TD|TFST|TSTA,SEN(printargs), "posix_fstat" },
+[3029] = { 0, 0, SEN(printargs), "posix_pause" },
+[3030] = { 0, 0, SEN(printargs), "posix_utime" },
+[3031] = { 0, 0, SEN(printargs), "posix_stty" },
+[3032] = { 0, 0, SEN(printargs), "posix_gtty" },
+[3033] = { 0, 0, SEN(printargs), "posix_access" },
+[3034] = { 0, 0, SEN(printargs), "posix_nice" },
+[3035] = { 0, TF|TSF|TSFA,SEN(printargs), "posix_statfs" },
+[3036] = { 0, 0, SEN(printargs), "posix_sync" },
+[3037] = { 0, TP, SEN(printargs), "posix_kill" },
+[3038] = { 0, TD|TFSF|TSFA,SEN(printargs), "posix_fstatfs" },
+[3039] = { 0, 0, SEN(printargs), "posix_getpgrp" },
+[3040] = { 0, 0, SEN(printargs), "posix_syssgi" },
+[3041] = { 0, 0, SEN(printargs), "posix_dup" },
+[3042] = { 0, 0, SEN(printargs), "posix_pipe" },
+[3043] = { 0, 0, SEN(printargs), "posix_times" },
+[3044] = { 0, 0, SEN(printargs), "posix_profil" },
+[3045] = { 0, 0, SEN(printargs), "posix_lock" },
+[3046] = { 0, TC, SEN(printargs), "posix_setgid" },
+[3047] = { 0, TC, SEN(printargs), "posix_getgid" },
+[3048] = { 0, 0, SEN(printargs), "posix_sig" },
+[3049] = { 0, 0, SEN(printargs), "posix_msgsys" },
+[3050] = { 0, 0, SEN(printargs), "posix_sysmips" },
+[3051] = { 0, 0, SEN(printargs), "posix_sysacct" },
+[3052] = { 0, 0, SEN(printargs), "posix_shmsys" },
+[3053] = { 0, 0, SEN(printargs), "posix_semsys" },
+[3054] = { 0, 0, SEN(printargs), "posix_ioctl" },
+[3055] = { 0, 0, SEN(printargs), "posix_uadmin" },
+[3056] = { 0, 0, SEN(printargs), "posix_exch" },
+[3057] = { 0, 0, SEN(printargs), "posix_utssys" },
+[3058] = { },
+[3059] = { 0, 0, SEN(printargs), "posix_exece" },
+[3060] = { 0, 0, SEN(printargs), "posix_umask" },
+[3061] = { 0, 0, SEN(printargs), "posix_chroot" },
+[3062] = { 0, 0, SEN(printargs), "posix_fcntl" },
+[3063] = { 0, 0, SEN(printargs), "posix_ulimit" },
+[3064 ... 3069] = { },
+[3070] = { 0, 0, SEN(printargs), "posix_advfs" },
+[3071] = { 0, 0, SEN(printargs), "posix_unadvfs" },
+[3072] = { 0, 0, SEN(printargs), "posix_rmount" },
+[3073] = { 0, 0, SEN(printargs), "posix_rumount" },
+[3074] = { 0, 0, SEN(printargs), "posix_rfstart" },
+[3075] = { },
+[3076] = { 0, 0, SEN(printargs), "posix_rdebug" },
+[3077] = { 0, 0, SEN(printargs), "posix_rfstop" },
+[3078] = { 0, 0, SEN(printargs), "posix_rfsys" },
+[3079] = { 0, 0, SEN(printargs), "posix_rmdir" },
+[3080] = { 0, 0, SEN(printargs), "posix_mkdir" },
+[3081] = { 0, 0, SEN(printargs), "posix_getdents" },
+[3082] = { 0, 0, SEN(printargs), "posix_sginap" },
+[3083] = { 0, 0, SEN(printargs), "posix_sgikopt" },
+[3084] = { 0, 0, SEN(printargs), "posix_sysfs" },
+[3085] = { 0, 0, SEN(printargs), "posix_getmsg" },
+[3086] = { 0, 0, SEN(printargs), "posix_putmsg" },
+[3087] = { 0, 0, SEN(printargs), "posix_poll" },
+[3088] = { 0, 0, SEN(printargs), "posix_sigreturn" },
+[3089] = { 0, 0, SEN(printargs), "posix_accept" },
+[3090] = { 0, 0, SEN(printargs), "posix_bind" },
+[3091] = { 0, 0, SEN(printargs), "posix_connect" },
+[3092] = { 0, 0, SEN(printargs), "posix_gethostid" },
+[3093] = { 0, 0, SEN(printargs), "posix_getpeername" },
+[3094] = { 0, 0, SEN(printargs), "posix_getsockname" },
+[3095] = { 0, 0, SEN(printargs), "posix_getsockopt" },
+[3096] = { 0, 0, SEN(printargs), "posix_listen" },
+[3097] = { 0, 0, SEN(printargs), "posix_recv" },
+[3098] = { 0, 0, SEN(printargs), "posix_recvfrom" },
+[3099] = { 0, 0, SEN(printargs), "posix_recvmsg" },
+[3100] = { 0, 0, SEN(printargs), "posix_select" },
+[3101] = { 0, 0, SEN(printargs), "posix_send" },
+[3102] = { 0, 0, SEN(printargs), "posix_sendmsg" },
+[3103] = { 0, 0, SEN(printargs), "posix_sendto" },
+[3104] = { 0, 0, SEN(printargs), "posix_sethostid" },
+[3105] = { 0, 0, SEN(printargs), "posix_setsockopt" },
+[3106] = { 0, 0, SEN(printargs), "posix_shutdown" },
+[3107] = { 0, 0, SEN(printargs), "posix_socket" },
+[3108] = { 0, 0, SEN(printargs), "posix_gethostname" },
+[3109] = { 0, 0, SEN(printargs), "posix_sethostname" },
+[3110] = { 0, 0, SEN(printargs), "posix_getdomainname" },
+[3111] = { 0, 0, SEN(printargs), "posix_setdomainname" },
+[3112] = { 0, 0, SEN(printargs), "posix_truncate" },
+[3113] = { 0, 0, SEN(printargs), "posix_ftruncate" },
+[3114] = { 0, 0, SEN(printargs), "posix_rename" },
+[3115] = { 0, 0, SEN(printargs), "posix_symlink" },
+[3116] = { 0, 0, SEN(printargs), "posix_readlink" },
+[3117] = { 0, TF|TLST|TSTA,SEN(printargs), "posix_lstat" },
+[3118] = { 0, 0, SEN(printargs), "posix_nfs_mount" },
+[3119] = { 0, 0, SEN(printargs), "posix_nfs_svc" },
+[3120] = { 0, 0, SEN(printargs), "posix_nfs_getfh" },
+[3121] = { 0, 0, SEN(printargs), "posix_async_daemon" },
+[3122] = { 0, 0, SEN(printargs), "posix_exportfs" },
+[3123] = { 0, TC, SEN(printargs), "posix_SGI_setregid" },
+[3124] = { 0, TC, SEN(printargs), "posix_SGI_setreuid" },
+[3125] = { 0, 0, SEN(printargs), "posix_getitimer" },
+[3126] = { 0, 0, SEN(printargs), "posix_setitimer" },
+[3127] = { 0, TCL, SEN(printargs), "posix_adjtime" },
+[3128] = { 0, 0, SEN(printargs), "posix_SGI_bsdgettime" },
+[3129] = { 0, 0, SEN(printargs), "posix_SGI_sproc" },
+[3130] = { 0, 0, SEN(printargs), "posix_SGI_prctl" },
+[3131] = { 0, 0, SEN(printargs), "posix_SGI_blkproc" },
+[3132] = { },
+[3133] = { 0, 0, SEN(printargs), "posix_SGI_sgigsc" },
+[3134] = { 0, TD|TM|SI, SEN(printargs), "posix_SGI_mmap" },
+[3135] = { 0, TM|SI, SEN(printargs), "posix_SGI_munmap" },
+[3136] = { 0, TM|SI, SEN(printargs), "posix_SGI_mprotect" },
+[3137] = { 0, TM, SEN(printargs), "posix_SGI_msync" },
+[3138] = { 0, TM, SEN(printargs), "posix_SGI_madvise" },
+[3139] = { 0, 0, SEN(printargs), "posix_SGI_mpin" },
+[3140] = { 0, 0, SEN(printargs), "posix_SGI_getpagesize" },
+[3141] = { 0, 0, SEN(printargs), "posix_SGI_libattach" },
+[3142] = { 0, 0, SEN(printargs), "posix_SGI_libdetach" },
+[3143] = { 0, 0, SEN(printargs), "posix_SGI_getpgrp" },
+[3144] = { 0, 0, SEN(printargs), "posix_SGI_setpgrp" },
+[3145 ... 3149] = { },
+[3150] = { 0, 0, SEN(printargs), "posix_cacheflush" },
+[3151] = { 0, 0, SEN(printargs), "posix_cachectl" },
+[3152] = { 0, 0, SEN(printargs), "posix_fchown" },
+[3153] = { 0, 0, SEN(printargs), "posix_fchmod" },
+[3154] = { 0, 0, SEN(printargs), "posix_wait3" },
+[3155] = { 0, TD|TM|SI, SEN(printargs), "posix_mmap" },
+[3156] = { 0, TM|SI, SEN(printargs), "posix_munmap" },
+[3157] = { 0, TM, SEN(printargs), "posix_madvise" },
+[3158] = { 0, 0, SEN(printargs), "posix_BSD_getpagesize" },
+[3159] = { 0, TC, SEN(printargs), "posix_setreuid" },
+[3160] = { 0, TC, SEN(printargs), "posix_setregid" },
+[3161] = { 0, 0, SEN(printargs), "posix_setpgid" },
+[3162] = { 0, TC, SEN(printargs), "posix_getgroups" },
+[3163] = { 0, TC, SEN(printargs), "posix_setgroups" },
+[3164] = { 0, TCL, SEN(printargs), "posix_gettimeofday" },
+[3165] = { 0, 0, SEN(printargs), "posix_getrusage" },
+[3166] = { 0, 0, SEN(printargs), "posix_getrlimit" },
+[3167] = { 0, 0, SEN(printargs), "posix_setrlimit" },
+[3168] = { 0, 0, SEN(printargs), "posix_waitpid" },
+[3169] = { 0, 0, SEN(printargs), "posix_dup2" },
+[3170 ... 3259] = { },
+[3260] = { 0, 0, SEN(printargs), "posix_netboot" },
+[3261] = { 0, 0, SEN(printargs), "posix_netunboot" },
+[3262] = { 0, 0, SEN(printargs), "posix_rdump" },
+[3263] = { 0, 0, SEN(printargs), "posix_setsid" },
+[3264] = { 0, 0, SEN(printargs), "posix_getmaxsig" },
+[3265] = { 0, 0, SEN(printargs), "posix_sigpending" },
+[3266] = { 0, 0, SEN(printargs), "posix_sigprocmask" },
+[3267] = { 0, 0, SEN(printargs), "posix_sigsuspend" },
+[3268] = { 0, 0, SEN(printargs), "posix_sigaction" },
diff --git a/src/linux/mips/syscallent-n32.h b/src/linux/mips/syscallent-n32.h
new file mode 100644
index 000000000..9a23126ec
--- /dev/null
+++ b/src/linux/mips/syscallent-n32.h
@@ -0,0 +1,359 @@
+/*
+ * Copyright (c) 2013-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#define BASE_NR 6000
+#if defined LINUX_MIPSN32
+/* For an N32 strace decode the N32 64-bit syscalls. */
+[BASE_NR + 0] = { 3, TD, SEN(read), "read" }, /* start of Linux N32 */
+[BASE_NR + 1] = { 3, TD, SEN(write), "write" },
+[BASE_NR + 2] = { 3, TD|TF, SEN(open), "open" },
+[BASE_NR + 3] = { 1, TD, SEN(close), "close" },
+[BASE_NR + 4] = { 2, TF|TST|TSTA, SEN(stat64), "stat" },
+[BASE_NR + 5] = { 2, TD|TFST|TSTA, SEN(fstat64), "fstat" },
+[BASE_NR + 6] = { 2, TF|TLST|TSTA, SEN(lstat64), "lstat" },
+[BASE_NR + 7] = { 3, TD, SEN(poll_time32), "poll" },
+[BASE_NR + 8] = { 3, TD, SEN(lseek), "lseek" },
+[BASE_NR + 9] = { 6, TD|TM|SI, SEN(mmap), "mmap" },
+[BASE_NR + 10] = { 3, TM|SI, SEN(mprotect), "mprotect" },
+[BASE_NR + 11] = { 2, TM|SI, SEN(munmap), "munmap" },
+[BASE_NR + 12] = { 1, TM|SI, SEN(brk), "brk" },
+[BASE_NR + 13] = { 4, TS, SEN(rt_sigaction), "rt_sigaction" },
+[BASE_NR + 14] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" },
+[BASE_NR + 15] = { 3, TD, SEN(ioctl), "ioctl" },
+[BASE_NR + 16] = { 4, TD, SEN(pread), "pread64" },
+[BASE_NR + 17] = { 4, TD, SEN(pwrite), "pwrite64" },
+[BASE_NR + 18] = { 3, TD, SEN(readv), "readv" },
+[BASE_NR + 19] = { 3, TD, SEN(writev), "writev" },
+[BASE_NR + 20] = { 2, TF, SEN(access), "access" },
+[BASE_NR + 21] = { 0, TD, SEN(pipe), "pipe" },
+[BASE_NR + 22] = { 5, TD, SEN(select), "_newselect" },
+[BASE_NR + 23] = { 0, 0, SEN(sched_yield), "sched_yield" },
+[BASE_NR + 24] = { 5, TM|SI, SEN(mremap), "mremap" },
+[BASE_NR + 25] = { 3, TM, SEN(msync), "msync" },
+[BASE_NR + 26] = { 3, TM, SEN(mincore), "mincore" },
+[BASE_NR + 27] = { 3, TM, SEN(madvise), "madvise" },
+[BASE_NR + 28] = { 3, TI, SEN(shmget), "shmget" },
+[BASE_NR + 29] = { 3, TI|TM|SI, SEN(shmat), "shmat" },
+[BASE_NR + 30] = { 3, TI, SEN(shmctl), "shmctl" },
+[BASE_NR + 31] = { 1, TD, SEN(dup), "dup" },
+[BASE_NR + 32] = { 2, TD, SEN(dup2), "dup2" },
+[BASE_NR + 33] = { 0, TS, SEN(pause), "pause" },
+[BASE_NR + 34] = { 2, 0, SEN(nanosleep_time32), "nanosleep" },
+[BASE_NR + 35] = { 2, 0, SEN(getitimer), "getitimer" },
+[BASE_NR + 36] = { 3, 0, SEN(setitimer), "setitimer" },
+[BASE_NR + 37] = { 1, 0, SEN(alarm), "alarm" },
+[BASE_NR + 38] = { 0, PU|NF, SEN(getpid), "getpid" },
+[BASE_NR + 39] = { 4, TD|TN, SEN(sendfile), "sendfile" },
+[BASE_NR + 40] = { 3, TN, SEN(socket), "socket" },
+[BASE_NR + 41] = { 3, TN, SEN(connect), "connect" },
+[BASE_NR + 42] = { 3, TN, SEN(accept), "accept" },
+[BASE_NR + 43] = { 6, TN, SEN(sendto), "sendto" },
+[BASE_NR + 44] = { 6, TN, SEN(recvfrom), "recvfrom" },
+[BASE_NR + 45] = { 3, TN, SEN(sendmsg), "sendmsg" },
+[BASE_NR + 46] = { 3, TN, SEN(recvmsg), "recvmsg" },
+[BASE_NR + 47] = { 2, TN, SEN(shutdown), "shutdown" },
+[BASE_NR + 48] = { 3, TN, SEN(bind), "bind" },
+[BASE_NR + 49] = { 2, TN, SEN(listen), "listen" },
+[BASE_NR + 50] = { 3, TN, SEN(getsockname), "getsockname" },
+[BASE_NR + 51] = { 3, TN, SEN(getpeername), "getpeername" },
+[BASE_NR + 52] = { 4, TN, SEN(socketpair), "socketpair" },
+[BASE_NR + 53] = { 5, TN, SEN(setsockopt), "setsockopt" },
+[BASE_NR + 54] = { 5, TN, SEN(getsockopt), "getsockopt" },
+[BASE_NR + 55] = { 5, TP, SEN(clone), "clone" },
+[BASE_NR + 56] = { 0, TP, SEN(fork), "fork" },
+[BASE_NR + 57] = { 3, TF|TP|TSD|SE|SI, SEN(execve), "execve" },
+[BASE_NR + 58] = { 1, TP|SE, SEN(exit), "exit" },
+[BASE_NR + 59] = { 4, TP, SEN(wait4), "wait4" },
+[BASE_NR + 60] = { 2, TS|TP, SEN(kill), "kill" },
+[BASE_NR + 61] = { 1, 0, SEN(uname), "uname" },
+[BASE_NR + 62] = { 3, TI, SEN(semget), "semget" },
+[BASE_NR + 63] = { 3, TI, SEN(semop), "semop" },
+[BASE_NR + 64] = { 4, TI, SEN(semctl), "semctl" },
+[BASE_NR + 65] = { 1, TI|TM|SI, SEN(shmdt), "shmdt" },
+[BASE_NR + 66] = { 2, TI, SEN(msgget), "msgget" },
+[BASE_NR + 67] = { 4, TI, SEN(msgsnd), "msgsnd" },
+[BASE_NR + 68] = { 5, TI, SEN(msgrcv), "msgrcv" },
+[BASE_NR + 69] = { 3, TI, SEN(msgctl), "msgctl" },
+[BASE_NR + 70] = { 3, TD, SEN(fcntl), "fcntl" },
+[BASE_NR + 71] = { 2, TD, SEN(flock), "flock" },
+[BASE_NR + 72] = { 1, TD, SEN(fsync), "fsync" },
+[BASE_NR + 73] = { 1, TD, SEN(fdatasync), "fdatasync" },
+[BASE_NR + 74] = { 2, TF, SEN(truncate64), "truncate" },
+[BASE_NR + 75] = { 2, TD, SEN(ftruncate64), "ftruncate" },
+[BASE_NR + 76] = { 3, TD, SEN(getdents), "getdents" },
+[BASE_NR + 77] = { 2, TF, SEN(getcwd), "getcwd" },
+[BASE_NR + 78] = { 1, TF, SEN(chdir), "chdir" },
+[BASE_NR + 79] = { 1, TD, SEN(fchdir), "fchdir" },
+[BASE_NR + 80] = { 2, TF, SEN(rename), "rename" },
+[BASE_NR + 81] = { 2, TF, SEN(mkdir), "mkdir" },
+[BASE_NR + 82] = { 1, TF, SEN(rmdir), "rmdir" },
+[BASE_NR + 83] = { 2, TD|TF, SEN(creat), "creat" },
+[BASE_NR + 84] = { 2, TF, SEN(link), "link" },
+[BASE_NR + 85] = { 1, TF, SEN(unlink), "unlink" },
+[BASE_NR + 86] = { 2, TF, SEN(symlink), "symlink" },
+[BASE_NR + 87] = { 3, TF, SEN(readlink), "readlink" },
+[BASE_NR + 88] = { 2, TF, SEN(chmod), "chmod" },
+[BASE_NR + 89] = { 2, TD, SEN(fchmod), "fchmod" },
+[BASE_NR + 90] = { 3, TF, SEN(chown), "chown" },
+[BASE_NR + 91] = { 3, TD, SEN(fchown), "fchown" },
+[BASE_NR + 92] = { 3, TF, SEN(chown), "lchown" },
+[BASE_NR + 93] = { 1, NF, SEN(umask), "umask" },
+[BASE_NR + 94] = { 2, TCL, SEN(gettimeofday), "gettimeofday" },
+[BASE_NR + 95] = { 2, 0, SEN(getrlimit), "getrlimit" },
+[BASE_NR + 96] = { 2, 0, SEN(getrusage), "getrusage" },
+[BASE_NR + 97] = { 1, 0, SEN(sysinfo), "sysinfo" },
+[BASE_NR + 98] = { 1, 0, SEN(times), "times" },
+[BASE_NR + 99] = { 4, 0, SEN(ptrace), "ptrace" },
+[BASE_NR + 100] = { 0, TC|PU|NF, SEN(getuid), "getuid" },
+[BASE_NR + 101] = { 3, 0, SEN(syslog), "syslog" },
+[BASE_NR + 102] = { 0, TC|PU|NF, SEN(getgid), "getgid" },
+[BASE_NR + 103] = { 1, TC, SEN(setuid), "setuid" },
+[BASE_NR + 104] = { 1, TC, SEN(setgid), "setgid" },
+[BASE_NR + 105] = { 0, TC|PU|NF, SEN(geteuid), "geteuid" },
+[BASE_NR + 106] = { 0, TC|PU|NF, SEN(getegid), "getegid" },
+[BASE_NR + 107] = { 2, 0, SEN(setpgid), "setpgid" },
+[BASE_NR + 108] = { 0, PU|NF, SEN(getppid), "getppid" },
+[BASE_NR + 109] = { 0, PU|NF, SEN(getpgrp), "getpgrp" },
+[BASE_NR + 110] = { 0, 0, SEN(setsid), "setsid" },
+[BASE_NR + 111] = { 2, TC, SEN(setreuid), "setreuid" },
+[BASE_NR + 112] = { 2, TC, SEN(setregid), "setregid" },
+[BASE_NR + 113] = { 2, TC, SEN(getgroups), "getgroups" },
+[BASE_NR + 114] = { 2, TC, SEN(setgroups), "setgroups" },
+[BASE_NR + 115] = { 3, TC, SEN(setresuid), "setresuid" },
+[BASE_NR + 116] = { 3, TC, SEN(getresuid), "getresuid" },
+[BASE_NR + 117] = { 3, TC, SEN(setresgid), "setresgid" },
+[BASE_NR + 118] = { 3, TC, SEN(getresgid), "getresgid" },
+[BASE_NR + 119] = { 1, 0, SEN(getpgid), "getpgid" },
+[BASE_NR + 120] = { 1, TC|NF, SEN(setfsuid), "setfsuid" },
+[BASE_NR + 121] = { 1, TC|NF, SEN(setfsgid), "setfsgid" },
+[BASE_NR + 122] = { 1, 0, SEN(getsid), "getsid" },
+[BASE_NR + 123] = { 2, TC, SEN(capget), "capget" },
+[BASE_NR + 124] = { 2, TC, SEN(capset), "capset" },
+[BASE_NR + 125] = { 2, TS, SEN(rt_sigpending), "rt_sigpending" },
+[BASE_NR + 126] = { 4, TS, SEN(rt_sigtimedwait_time32), "rt_sigtimedwait" },
+[BASE_NR + 127] = { 3, TS|TP, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" },
+[BASE_NR + 128] = { 2, TS, SEN(rt_sigsuspend), "rt_sigsuspend" },
+[BASE_NR + 129] = { 2, TS, SEN(sigaltstack), "sigaltstack" },
+[BASE_NR + 130] = { 2, TF, SEN(utime), "utime" },
+[BASE_NR + 131] = { 3, TF, SEN(mknod), "mknod" },
+[BASE_NR + 132] = { 1, NF, SEN(personality), "personality" },
+[BASE_NR + 133] = { 2, TSFA, SEN(ustat), "ustat" },
+[BASE_NR + 134] = { 2, TF|TSF|TSFA, SEN(statfs), "statfs" },
+[BASE_NR + 135] = { 2, TD|TFSF|TSFA, SEN(fstatfs), "fstatfs" },
+[BASE_NR + 136] = { 3, 0, SEN(sysfs), "sysfs" },
+[BASE_NR + 137] = { 2, 0, SEN(getpriority), "getpriority" },
+[BASE_NR + 138] = { 3, 0, SEN(setpriority), "setpriority" },
+[BASE_NR + 139] = { 2, 0, SEN(sched_setparam), "sched_setparam" },
+[BASE_NR + 140] = { 2, 0, SEN(sched_getparam), "sched_getparam" },
+[BASE_NR + 141] = { 3, 0, SEN(sched_setscheduler), "sched_setscheduler" },
+[BASE_NR + 142] = { 1, 0, SEN(sched_getscheduler), "sched_getscheduler" },
+[BASE_NR + 143] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"},
+[BASE_NR + 144] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"},
+[BASE_NR + 145] = { 2, 0, SEN(sched_rr_get_interval_time32),"sched_rr_get_interval"},
+[BASE_NR + 146] = { 2, TM, SEN(mlock), "mlock" },
+[BASE_NR + 147] = { 2, TM, SEN(munlock), "munlock" },
+[BASE_NR + 148] = { 1, TM, SEN(mlockall), "mlockall" },
+[BASE_NR + 149] = { 0, TM, SEN(munlockall), "munlockall" },
+[BASE_NR + 150] = { 0, 0, SEN(vhangup), "vhangup" },
+[BASE_NR + 151] = { 2, TF, SEN(pivotroot), "pivot_root" },
+[BASE_NR + 152] = { 1, 0, SEN(sysctl), "_sysctl" },
+[BASE_NR + 153] = { 5, TC, SEN(prctl), "prctl" },
+[BASE_NR + 154] = { 1, TCL, SEN(adjtimex32), "adjtimex" },
+[BASE_NR + 155] = { 2, 0, SEN(setrlimit), "setrlimit" },
+[BASE_NR + 156] = { 1, TF, SEN(chroot), "chroot" },
+[BASE_NR + 157] = { 0, 0, SEN(sync), "sync" },
+[BASE_NR + 158] = { 1, TF, SEN(acct), "acct" },
+[BASE_NR + 159] = { 2, TCL, SEN(settimeofday), "settimeofday" },
+[BASE_NR + 160] = { 5, TF, SEN(mount), "mount" },
+[BASE_NR + 161] = { 2, TF, SEN(umount2), "umount2" },
+[BASE_NR + 162] = { 2, TF, SEN(swapon), "swapon" },
+[BASE_NR + 163] = { 1, TF, SEN(swapoff), "swapoff" },
+[BASE_NR + 164] = { 4, 0, SEN(reboot), "reboot" },
+[BASE_NR + 165] = { 2, 0, SEN(sethostname), "sethostname" },
+[BASE_NR + 166] = { 2, 0, SEN(setdomainname), "setdomainname" },
+[BASE_NR + 167] = { 2, 0, SEN(create_module), "create_module" },
+[BASE_NR + 168] = { 3, 0, SEN(init_module), "init_module" },
+[BASE_NR + 169] = { 2, 0, SEN(delete_module), "delete_module" },
+[BASE_NR + 170] = { 1, 0, SEN(get_kernel_syms), "get_kernel_syms" },
+[BASE_NR + 171] = { 5, 0, SEN(query_module), "query_module" },
+[BASE_NR + 172] = { 4, TF, SEN(quotactl), "quotactl" },
+[BASE_NR + 173] = { 3, 0, SEN(nfsservctl), "nfsservctl" },
+[BASE_NR + 174] = { 5, TN, SEN(getpmsg), "getpmsg" },
+[BASE_NR + 175] = { 5, TN, SEN(putpmsg), "putpmsg" },
+[BASE_NR + 176] = { 0, 0, SEN(afs_syscall), "afs_syscall" },
+[BASE_NR + 177] = { 0, 0, SEN(printargs), "reserved177" },
+[BASE_NR + 178] = { 0, PU|NF, SEN(gettid), "gettid" },
+[BASE_NR + 179] = { 3, TD, SEN(readahead), "readahead" },
+[BASE_NR + 180] = { 5, TF, SEN(setxattr), "setxattr" },
+[BASE_NR + 181] = { 5, TF, SEN(setxattr), "lsetxattr" },
+[BASE_NR + 182] = { 5, TD, SEN(fsetxattr), "fsetxattr" },
+[BASE_NR + 183] = { 4, TF, SEN(getxattr), "getxattr" },
+[BASE_NR + 184] = { 4, TF, SEN(getxattr), "lgetxattr" },
+[BASE_NR + 185] = { 4, TD, SEN(fgetxattr), "fgetxattr" },
+[BASE_NR + 186] = { 3, TF, SEN(listxattr), "listxattr" },
+[BASE_NR + 187] = { 3, TF, SEN(listxattr), "llistxattr" },
+[BASE_NR + 188] = { 3, TD, SEN(flistxattr), "flistxattr" },
+[BASE_NR + 189] = { 2, TF, SEN(removexattr), "removexattr" },
+[BASE_NR + 190] = { 2, TF, SEN(removexattr), "lremovexattr" },
+[BASE_NR + 191] = { 2, TD, SEN(fremovexattr), "fremovexattr" },
+[BASE_NR + 192] = { 2, TS|TP, SEN(tkill), "tkill" },
+[BASE_NR + 193] = { 1, TCL, SEN(time), "time" },
+[BASE_NR + 194] = { 6, 0, SEN(futex_time32), "futex" },
+[BASE_NR + 195] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" },
+[BASE_NR + 196] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" },
+[BASE_NR + 197] = { 3, 0, SEN(printargs), "cacheflush" },
+[BASE_NR + 198] = { 3, 0, SEN(printargs), "cachectl" },
+[BASE_NR + 199] = { 4, 0, SEN(sysmips), "sysmips" },
+[BASE_NR + 200] = { 2, TM, SEN(io_setup), "io_setup" },
+[BASE_NR + 201] = { 1, TM, SEN(io_destroy), "io_destroy" },
+[BASE_NR + 202] = { 5, 0, SEN(io_getevents_time32), "io_getevents" },
+[BASE_NR + 203] = { 3, 0, SEN(io_submit), "io_submit" },
+[BASE_NR + 204] = { 3, 0, SEN(io_cancel), "io_cancel" },
+[BASE_NR + 205] = { 1, TP|SE, SEN(exit), "exit_group" },
+[BASE_NR + 206] = { 3, 0, SEN(lookup_dcookie), "lookup_dcookie" },
+[BASE_NR + 207] = { 1, TD, SEN(epoll_create), "epoll_create" },
+[BASE_NR + 208] = { 4, TD, SEN(epoll_ctl), "epoll_ctl" },
+[BASE_NR + 209] = { 4, TD, SEN(epoll_wait), "epoll_wait" },
+[BASE_NR + 210] = { 5, TM|SI, SEN(remap_file_pages), "remap_file_pages" },
+[BASE_NR + 211] = { 0, TS, SEN(rt_sigreturn), "rt_sigreturn" },
+[BASE_NR + 212] = { 3, TD, SEN(fcntl64), "fcntl64" },
+[BASE_NR + 213] = { 1, 0, SEN(set_tid_address), "set_tid_address" },
+[BASE_NR + 214] = { 0, 0, SEN(restart_syscall), "restart_syscall" },
+[BASE_NR + 215] = { 4, TI, SEN(semtimedop_time32), "semtimedop" },
+[BASE_NR + 216] = { 4, TD, SEN(fadvise64_64), "fadvise64" },
+[BASE_NR + 217] = { 3, TF|TSF|TSFA, SEN(statfs64), "statfs64" },
+[BASE_NR + 218] = { 3, TD|TFSF|TSFA, SEN(fstatfs64), "fstatfs64" },
+[BASE_NR + 219] = { 4, TD|TN, SEN(sendfile64), "sendfile64" },
+[BASE_NR + 220] = { 3, 0, SEN(timer_create), "timer_create" },
+[BASE_NR + 221] = { 4, 0, SEN(timer_settime32), "timer_settime" },
+[BASE_NR + 222] = { 2, 0, SEN(timer_gettime32), "timer_gettime" },
+[BASE_NR + 223] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" },
+[BASE_NR + 224] = { 1, 0, SEN(timer_delete), "timer_delete" },
+[BASE_NR + 225] = { 2, TCL, SEN(clock_settime32), "clock_settime" },
+[BASE_NR + 226] = { 2, TCL, SEN(clock_gettime32), "clock_gettime" },
+[BASE_NR + 227] = { 2, TCL, SEN(clock_getres_time32), "clock_getres" },
+[BASE_NR + 228] = { 4, 0, SEN(clock_nanosleep_time32), "clock_nanosleep" },
+[BASE_NR + 229] = { 3, TS|TP, SEN(tgkill), "tgkill" },
+[BASE_NR + 230] = { 2, TF, SEN(utimes), "utimes" },
+[BASE_NR + 231] = { 6, TM, SEN(mbind), "mbind" },
+[BASE_NR + 232] = { 5, TM, SEN(get_mempolicy), "get_mempolicy" },
+[BASE_NR + 233] = { 3, TM, SEN(set_mempolicy), "set_mempolicy" },
+[BASE_NR + 234] = { 4, TD, SEN(mq_open), "mq_open" },
+[BASE_NR + 235] = { 1, 0, SEN(mq_unlink), "mq_unlink" },
+[BASE_NR + 236] = { 5, TD, SEN(mq_timedsend_time32), "mq_timedsend" },
+[BASE_NR + 237] = { 5, TD, SEN(mq_timedreceive_time32), "mq_timedreceive" },
+[BASE_NR + 238] = { 2, TD, SEN(mq_notify), "mq_notify" },
+[BASE_NR + 239] = { 3, TD, SEN(mq_getsetattr), "mq_getsetattr" },
+[BASE_NR + 240] = { 5, 0, SEN(vserver), "vserver" },
+[BASE_NR + 241] = { 5, TP, SEN(waitid), "waitid" },
+[BASE_NR + 242] = { },
+[BASE_NR + 243] = { 5, 0, SEN(add_key), "add_key" },
+[BASE_NR + 244] = { 4, 0, SEN(request_key), "request_key" },
+[BASE_NR + 245] = { 5, 0, SEN(keyctl), "keyctl" },
+[BASE_NR + 246] = { 1, 0, SEN(set_thread_area), "set_thread_area" },
+[BASE_NR + 247] = { 0, TD, SEN(inotify_init), "inotify_init" },
+[BASE_NR + 248] = { 3, TD|TF, SEN(inotify_add_watch), "inotify_add_watch" },
+[BASE_NR + 249] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" },
+[BASE_NR + 250] = { 4, TM, SEN(migrate_pages), "migrate_pages" },
+[BASE_NR + 251] = { 4, TD|TF, SEN(openat), "openat" },
+[BASE_NR + 252] = { 3, TD|TF, SEN(mkdirat), "mkdirat" },
+[BASE_NR + 253] = { 4, TD|TF, SEN(mknodat), "mknodat" },
+[BASE_NR + 254] = { 5, TD|TF, SEN(fchownat), "fchownat" },
+[BASE_NR + 255] = { 3, TD|TF, SEN(futimesat), "futimesat" },
+[BASE_NR + 256] = { 4, TD|TF|TFST|TSTA,SEN(newfstatat), "newfstatat" },
+[BASE_NR + 257] = { 3, TD|TF, SEN(unlinkat), "unlinkat" },
+[BASE_NR + 258] = { 4, TD|TF, SEN(renameat), "renameat" },
+[BASE_NR + 259] = { 5, TD|TF, SEN(linkat), "linkat" },
+[BASE_NR + 260] = { 3, TD|TF, SEN(symlinkat), "symlinkat" },
+[BASE_NR + 261] = { 4, TD|TF, SEN(readlinkat), "readlinkat" },
+[BASE_NR + 262] = { 3, TD|TF, SEN(fchmodat), "fchmodat" },
+[BASE_NR + 263] = { 3, TD|TF, SEN(faccessat), "faccessat" },
+[BASE_NR + 264] = { 6, TD, SEN(pselect6_time32), "pselect6" },
+[BASE_NR + 265] = { 5, TD, SEN(ppoll_time32), "ppoll" },
+[BASE_NR + 266] = { 1, 0, SEN(unshare), "unshare" },
+[BASE_NR + 267] = { 6, TD, SEN(splice), "splice" },
+[BASE_NR + 268] = { 4, TD, SEN(sync_file_range), "sync_file_range" },
+[BASE_NR + 269] = { 4, TD, SEN(tee), "tee" },
+[BASE_NR + 270] = { 4, TD, SEN(vmsplice), "vmsplice" },
+[BASE_NR + 271] = { 6, TM, SEN(move_pages), "move_pages" },
+[BASE_NR + 272] = { 2, 0, SEN(set_robust_list), "set_robust_list" },
+[BASE_NR + 273] = { 3, 0, SEN(get_robust_list), "get_robust_list" },
+[BASE_NR + 274] = { 4, 0, SEN(kexec_load), "kexec_load" },
+[BASE_NR + 275] = { 3, 0, SEN(getcpu), "getcpu" },
+[BASE_NR + 276] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" },
+[BASE_NR + 277] = { 3, 0, SEN(ioprio_set), "ioprio_set" },
+[BASE_NR + 278] = { 2, 0, SEN(ioprio_get), "ioprio_get" },
+[BASE_NR + 279] = { 4, TD|TF, SEN(utimensat_time32), "utimensat" },
+[BASE_NR + 280] = { 3, TD|TS, SEN(signalfd), "signalfd" },
+[BASE_NR + 281] = { 4, TD, SEN(timerfd), "timerfd" },
+[BASE_NR + 282] = { 1, TD, SEN(eventfd), "eventfd" },
+[BASE_NR + 283] = { 4, TD, SEN(fallocate), "fallocate" },
+[BASE_NR + 284] = { 2, TD, SEN(timerfd_create), "timerfd_create" },
+[BASE_NR + 285] = { 2, TD, SEN(timerfd_gettime32), "timerfd_gettime" },
+[BASE_NR + 286] = { 4, TD, SEN(timerfd_settime32), "timerfd_settime" },
+[BASE_NR + 287] = { 4, TD|TS, SEN(signalfd4), "signalfd4" },
+[BASE_NR + 288] = { 2, TD, SEN(eventfd2), "eventfd2" },
+[BASE_NR + 289] = { 1, TD, SEN(epoll_create1), "epoll_create1" },
+[BASE_NR + 290] = { 3, TD, SEN(dup3), "dup3" },
+[BASE_NR + 291] = { 2, TD, SEN(pipe2), "pipe2" },
+[BASE_NR + 292] = { 1, TD, SEN(inotify_init1), "inotify_init1" },
+[BASE_NR + 293] = { 4, TD, SEN(preadv), "preadv" },
+[BASE_NR + 294] = { 4, TD, SEN(pwritev), "pwritev" },
+[BASE_NR + 295] = { 4, TP|TS, SEN(rt_tgsigqueueinfo), "rt_tgsigqueueinfo" },
+[BASE_NR + 296] = { 5, TD, SEN(perf_event_open), "perf_event_open" },
+[BASE_NR + 297] = { 4, TN, SEN(accept4), "accept4" },
+[BASE_NR + 298] = { 5, TN, SEN(recvmmsg_time32), "recvmmsg" },
+[BASE_NR + 299] = { 3, TD, SEN(getdents64), "getdents64" },
+[BASE_NR + 300] = { 2, TD, SEN(fanotify_init), "fanotify_init" },
+[BASE_NR + 301] = { 5, TD|TF, SEN(fanotify_mark), "fanotify_mark" },
+[BASE_NR + 302] = { 4, 0, SEN(prlimit64), "prlimit64" },
+[BASE_NR + 303] = { 5, TD|TF, SEN(name_to_handle_at), "name_to_handle_at" },
+[BASE_NR + 304] = { 3, TD, SEN(open_by_handle_at), "open_by_handle_at" },
+[BASE_NR + 305] = { 2, TCL, SEN(clock_adjtime32), "clock_adjtime" },
+[BASE_NR + 306] = { 1, TD, SEN(syncfs), "syncfs" },
+[BASE_NR + 307] = { 4, TN, SEN(sendmmsg), "sendmmsg" },
+[BASE_NR + 308] = { 2, TD, SEN(setns), "setns" },
+[BASE_NR + 309] = { 6, 0, SEN(process_vm_readv), "process_vm_readv" },
+[BASE_NR + 310] = { 6, 0, SEN(process_vm_writev), "process_vm_writev" },
+[BASE_NR + 311] = { 5, 0, SEN(kcmp), "kcmp" },
+[BASE_NR + 312] = { 3, TD, SEN(finit_module), "finit_module" },
+[BASE_NR + 313] = { 3, 0, SEN(sched_setattr), "sched_setattr" },
+[BASE_NR + 314] = { 4, 0, SEN(sched_getattr), "sched_getattr" },
+[BASE_NR + 315] = { 5, TD|TF, SEN(renameat2), "renameat2" },
+[BASE_NR + 316] = { 3, 0, SEN(seccomp), "seccomp" },
+[BASE_NR + 317] = { 3, 0, SEN(getrandom), "getrandom" },
+[BASE_NR + 318] = { 2, TD, SEN(memfd_create), "memfd_create" },
+[BASE_NR + 319] = { 3, TD, SEN(bpf), "bpf" },
+[BASE_NR + 320] = { 5, TD|TF|TP|TSD|SE|SI, SEN(execveat), "execveat" },
+[BASE_NR + 321] = { 1, TD, SEN(userfaultfd), "userfaultfd" },
+[BASE_NR + 322] = { 3, 0, SEN(membarrier), "membarrier" },
+[BASE_NR + 323] = { 3, TM, SEN(mlock2), "mlock2" },
+[BASE_NR + 324] = { 6, TD, SEN(copy_file_range), "copy_file_range" },
+[BASE_NR + 325] = { 6, TD, SEN(preadv2), "preadv2" },
+[BASE_NR + 326] = { 6, TD, SEN(pwritev2), "pwritev2" },
+[BASE_NR + 327] = { 4, TM|SI, SEN(pkey_mprotect), "pkey_mprotect" },
+[BASE_NR + 328] = { 2, 0, SEN(pkey_alloc), "pkey_alloc" },
+[BASE_NR + 329] = { 1, 0, SEN(pkey_free), "pkey_free" },
+[BASE_NR + 330] = { 5, TD|TF|TFST|TSTA,SEN(statx), "statx" },
+[BASE_NR + 331] = { 4, 0, SEN(rseq), "rseq" },
+[BASE_NR + 332] = { 6, 0, SEN(io_pgetevents_time32), "io_pgetevents" },
+# include "syscallent-common-32.h"
+# include "syscallent-common.h"
+
+# define SYS_socket_subcall 6500
+# include "subcall32.h"
+
+#else
+
+# define SYSCALL_NAME_PREFIX "n32:"
+# include "syscallent-n32-stub.h"
+# include "syscallent-common-32-stub.h"
+# include "syscallent-common-stub.h"
+# undef SYSCALL_NAME_PREFIX
+
+#endif
+#undef BASE_NR
diff --git a/src/linux/mips/syscallent-n64.h b/src/linux/mips/syscallent-n64.h
new file mode 100644
index 000000000..ada21ba43
--- /dev/null
+++ b/src/linux/mips/syscallent-n64.h
@@ -0,0 +1,353 @@
+/*
+ * Copyright (c) 2013-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#define BASE_NR 5000
+#if defined LINUX_MIPSN64
+/* For an N64 strace decode the N64 64-bit syscalls. */
+[BASE_NR + 0] = { 3, TD, SEN(read), "read" }, /* start of Linux N64 */
+[BASE_NR + 1] = { 3, TD, SEN(write), "write" },
+[BASE_NR + 2] = { 3, TD|TF, SEN(open), "open" },
+[BASE_NR + 3] = { 1, TD, SEN(close), "close" },
+[BASE_NR + 4] = { 2, TF|TST|TSTA, SEN(stat), "stat" },
+[BASE_NR + 5] = { 2, TD|TFST|TSTA, SEN(fstat), "fstat" },
+[BASE_NR + 6] = { 2, TF|TLST|TSTA, SEN(lstat), "lstat" },
+[BASE_NR + 7] = { 3, TD, SEN(poll_time64), "poll" },
+[BASE_NR + 8] = { 3, TD, SEN(lseek), "lseek" },
+[BASE_NR + 9] = { 6, TD|TM|SI, SEN(mmap), "mmap" },
+[BASE_NR + 10] = { 3, TM|SI, SEN(mprotect), "mprotect" },
+[BASE_NR + 11] = { 2, TM|SI, SEN(munmap), "munmap" },
+[BASE_NR + 12] = { 1, TM|SI, SEN(brk), "brk" },
+[BASE_NR + 13] = { 4, TS, SEN(rt_sigaction), "rt_sigaction" },
+[BASE_NR + 14] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" },
+[BASE_NR + 15] = { 3, TD, SEN(ioctl), "ioctl" },
+[BASE_NR + 16] = { 4, TD, SEN(pread), "pread64" },
+[BASE_NR + 17] = { 4, TD, SEN(pwrite), "pwrite64" },
+[BASE_NR + 18] = { 3, TD, SEN(readv), "readv" },
+[BASE_NR + 19] = { 3, TD, SEN(writev), "writev" },
+[BASE_NR + 20] = { 2, TF, SEN(access), "access" },
+[BASE_NR + 21] = { 0, TD, SEN(pipe), "pipe" },
+[BASE_NR + 22] = { 5, TD, SEN(select), "_newselect" },
+[BASE_NR + 23] = { 0, 0, SEN(sched_yield), "sched_yield" },
+[BASE_NR + 24] = { 5, TM|SI, SEN(mremap), "mremap" },
+[BASE_NR + 25] = { 3, TM, SEN(msync), "msync" },
+[BASE_NR + 26] = { 3, TM, SEN(mincore), "mincore" },
+[BASE_NR + 27] = { 3, TM, SEN(madvise), "madvise" },
+[BASE_NR + 28] = { 3, TI, SEN(shmget), "shmget" },
+[BASE_NR + 29] = { 3, TI|TM|SI, SEN(shmat), "shmat" },
+[BASE_NR + 30] = { 3, TI, SEN(shmctl), "shmctl" },
+[BASE_NR + 31] = { 1, TD, SEN(dup), "dup" },
+[BASE_NR + 32] = { 2, TD, SEN(dup2), "dup2" },
+[BASE_NR + 33] = { 0, TS, SEN(pause), "pause" },
+[BASE_NR + 34] = { 2, 0, SEN(nanosleep_time64), "nanosleep" },
+[BASE_NR + 35] = { 2, 0, SEN(getitimer), "getitimer" },
+[BASE_NR + 36] = { 3, 0, SEN(setitimer), "setitimer" },
+[BASE_NR + 37] = { 1, 0, SEN(alarm), "alarm" },
+[BASE_NR + 38] = { 0, PU|NF, SEN(getpid), "getpid" },
+[BASE_NR + 39] = { 4, TD|TN, SEN(sendfile), "sendfile" },
+[BASE_NR + 40] = { 3, TN, SEN(socket), "socket" },
+[BASE_NR + 41] = { 3, TN, SEN(connect), "connect" },
+[BASE_NR + 42] = { 3, TN, SEN(accept), "accept" },
+[BASE_NR + 43] = { 6, TN, SEN(sendto), "sendto" },
+[BASE_NR + 44] = { 6, TN, SEN(recvfrom), "recvfrom" },
+[BASE_NR + 45] = { 3, TN, SEN(sendmsg), "sendmsg" },
+[BASE_NR + 46] = { 3, TN, SEN(recvmsg), "recvmsg" },
+[BASE_NR + 47] = { 2, TN, SEN(shutdown), "shutdown" },
+[BASE_NR + 48] = { 3, TN, SEN(bind), "bind" },
+[BASE_NR + 49] = { 2, TN, SEN(listen), "listen" },
+[BASE_NR + 50] = { 3, TN, SEN(getsockname), "getsockname" },
+[BASE_NR + 51] = { 3, TN, SEN(getpeername), "getpeername" },
+[BASE_NR + 52] = { 4, TN, SEN(socketpair), "socketpair" },
+[BASE_NR + 53] = { 5, TN, SEN(setsockopt), "setsockopt" },
+[BASE_NR + 54] = { 5, TN, SEN(getsockopt), "getsockopt" },
+[BASE_NR + 55] = { 5, TP, SEN(clone), "clone" },
+[BASE_NR + 56] = { 0, TP, SEN(fork), "fork" },
+[BASE_NR + 57] = { 3, TF|TP|TSD|SE|SI, SEN(execve), "execve" },
+[BASE_NR + 58] = { 1, TP|SE, SEN(exit), "exit" },
+[BASE_NR + 59] = { 4, TP, SEN(wait4), "wait4" },
+[BASE_NR + 60] = { 2, TS|TP, SEN(kill), "kill" },
+[BASE_NR + 61] = { 1, 0, SEN(uname), "uname" },
+[BASE_NR + 62] = { 3, TI, SEN(semget), "semget" },
+[BASE_NR + 63] = { 3, TI, SEN(semop), "semop" },
+[BASE_NR + 64] = { 4, TI, SEN(semctl), "semctl" },
+[BASE_NR + 65] = { 1, TI|TM|SI, SEN(shmdt), "shmdt" },
+[BASE_NR + 66] = { 2, TI, SEN(msgget), "msgget" },
+[BASE_NR + 67] = { 4, TI, SEN(msgsnd), "msgsnd" },
+[BASE_NR + 68] = { 5, TI, SEN(msgrcv), "msgrcv" },
+[BASE_NR + 69] = { 3, TI, SEN(msgctl), "msgctl" },
+[BASE_NR + 70] = { 3, TD, SEN(fcntl), "fcntl" },
+[BASE_NR + 71] = { 2, TD, SEN(flock), "flock" },
+[BASE_NR + 72] = { 1, TD, SEN(fsync), "fsync" },
+[BASE_NR + 73] = { 1, TD, SEN(fdatasync), "fdatasync" },
+[BASE_NR + 74] = { 2, TF, SEN(truncate), "truncate" },
+[BASE_NR + 75] = { 2, TD, SEN(ftruncate), "ftruncate" },
+[BASE_NR + 76] = { 3, TD, SEN(getdents), "getdents" },
+[BASE_NR + 77] = { 2, TF, SEN(getcwd), "getcwd" },
+[BASE_NR + 78] = { 1, TF, SEN(chdir), "chdir" },
+[BASE_NR + 79] = { 1, TD, SEN(fchdir), "fchdir" },
+[BASE_NR + 80] = { 2, TF, SEN(rename), "rename" },
+[BASE_NR + 81] = { 2, TF, SEN(mkdir), "mkdir" },
+[BASE_NR + 82] = { 1, TF, SEN(rmdir), "rmdir" },
+[BASE_NR + 83] = { 2, TD|TF, SEN(creat), "creat" },
+[BASE_NR + 84] = { 2, TF, SEN(link), "link" },
+[BASE_NR + 85] = { 1, TF, SEN(unlink), "unlink" },
+[BASE_NR + 86] = { 2, TF, SEN(symlink), "symlink" },
+[BASE_NR + 87] = { 3, TF, SEN(readlink), "readlink" },
+[BASE_NR + 88] = { 2, TF, SEN(chmod), "chmod" },
+[BASE_NR + 89] = { 2, TD, SEN(fchmod), "fchmod" },
+[BASE_NR + 90] = { 3, TF, SEN(chown), "chown" },
+[BASE_NR + 91] = { 3, TD, SEN(fchown), "fchown" },
+[BASE_NR + 92] = { 3, TF, SEN(chown), "lchown" },
+[BASE_NR + 93] = { 1, NF, SEN(umask), "umask" },
+[BASE_NR + 94] = { 2, TCL, SEN(gettimeofday), "gettimeofday" },
+[BASE_NR + 95] = { 2, 0, SEN(getrlimit), "getrlimit" },
+[BASE_NR + 96] = { 2, 0, SEN(getrusage), "getrusage" },
+[BASE_NR + 97] = { 1, 0, SEN(sysinfo), "sysinfo" },
+[BASE_NR + 98] = { 1, 0, SEN(times), "times" },
+[BASE_NR + 99] = { 4, 0, SEN(ptrace), "ptrace" },
+[BASE_NR + 100] = { 0, TC|PU|NF, SEN(getuid), "getuid" },
+[BASE_NR + 101] = { 3, 0, SEN(syslog), "syslog" },
+[BASE_NR + 102] = { 0, TC|PU|NF, SEN(getgid), "getgid" },
+[BASE_NR + 103] = { 1, TC, SEN(setuid), "setuid" },
+[BASE_NR + 104] = { 1, TC, SEN(setgid), "setgid" },
+[BASE_NR + 105] = { 0, TC|PU|NF, SEN(geteuid), "geteuid" },
+[BASE_NR + 106] = { 0, TC|PU|NF, SEN(getegid), "getegid" },
+[BASE_NR + 107] = { 2, 0, SEN(setpgid), "setpgid" },
+[BASE_NR + 108] = { 0, PU|NF, SEN(getppid), "getppid" },
+[BASE_NR + 109] = { 0, PU|NF, SEN(getpgrp), "getpgrp" },
+[BASE_NR + 110] = { 0, 0, SEN(setsid), "setsid" },
+[BASE_NR + 111] = { 2, TC, SEN(setreuid), "setreuid" },
+[BASE_NR + 112] = { 2, TC, SEN(setregid), "setregid" },
+[BASE_NR + 113] = { 2, TC, SEN(getgroups), "getgroups" },
+[BASE_NR + 114] = { 2, TC, SEN(setgroups), "setgroups" },
+[BASE_NR + 115] = { 3, TC, SEN(setresuid), "setresuid" },
+[BASE_NR + 116] = { 3, TC, SEN(getresuid), "getresuid" },
+[BASE_NR + 117] = { 3, TC, SEN(setresgid), "setresgid" },
+[BASE_NR + 118] = { 3, TC, SEN(getresgid), "getresgid" },
+[BASE_NR + 119] = { 1, 0, SEN(getpgid), "getpgid" },
+[BASE_NR + 120] = { 1, TC|NF, SEN(setfsuid), "setfsuid" },
+[BASE_NR + 121] = { 1, TC|NF, SEN(setfsgid), "setfsgid" },
+[BASE_NR + 122] = { 1, 0, SEN(getsid), "getsid" },
+[BASE_NR + 123] = { 2, TC, SEN(capget), "capget" },
+[BASE_NR + 124] = { 2, TC, SEN(capset), "capset" },
+[BASE_NR + 125] = { 2, TS, SEN(rt_sigpending), "rt_sigpending" },
+[BASE_NR + 126] = { 4, TS, SEN(rt_sigtimedwait_time64), "rt_sigtimedwait" },
+[BASE_NR + 127] = { 3, TS|TP, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" },
+[BASE_NR + 128] = { 2, TS, SEN(rt_sigsuspend), "rt_sigsuspend" },
+[BASE_NR + 129] = { 2, TS, SEN(sigaltstack), "sigaltstack" },
+[BASE_NR + 130] = { 2, TF, SEN(utime), "utime" },
+[BASE_NR + 131] = { 3, TF, SEN(mknod), "mknod" },
+[BASE_NR + 132] = { 1, NF, SEN(personality), "personality" },
+[BASE_NR + 133] = { 2, TSFA, SEN(ustat), "ustat" },
+[BASE_NR + 134] = { 2, TF|TSF|TSFA, SEN(statfs), "statfs" },
+[BASE_NR + 135] = { 2, TD|TFSF|TSFA, SEN(fstatfs), "fstatfs" },
+[BASE_NR + 136] = { 3, 0, SEN(sysfs), "sysfs" },
+[BASE_NR + 137] = { 2, 0, SEN(getpriority), "getpriority" },
+[BASE_NR + 138] = { 3, 0, SEN(setpriority), "setpriority" },
+[BASE_NR + 139] = { 2, 0, SEN(sched_setparam), "sched_setparam" },
+[BASE_NR + 140] = { 2, 0, SEN(sched_getparam), "sched_getparam" },
+[BASE_NR + 141] = { 3, 0, SEN(sched_setscheduler), "sched_setscheduler" },
+[BASE_NR + 142] = { 1, 0, SEN(sched_getscheduler), "sched_getscheduler" },
+[BASE_NR + 143] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"},
+[BASE_NR + 144] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"},
+[BASE_NR + 145] = { 2, 0, SEN(sched_rr_get_interval_time64),"sched_rr_get_interval"},
+[BASE_NR + 146] = { 2, TM, SEN(mlock), "mlock" },
+[BASE_NR + 147] = { 2, TM, SEN(munlock), "munlock" },
+[BASE_NR + 148] = { 1, TM, SEN(mlockall), "mlockall" },
+[BASE_NR + 149] = { 0, TM, SEN(munlockall), "munlockall" },
+[BASE_NR + 150] = { 0, 0, SEN(vhangup), "vhangup" },
+[BASE_NR + 151] = { 2, TF, SEN(pivotroot), "pivot_root" },
+[BASE_NR + 152] = { 1, 0, SEN(sysctl), "_sysctl" },
+[BASE_NR + 153] = { 5, TC, SEN(prctl), "prctl" },
+[BASE_NR + 154] = { 1, TCL, SEN(adjtimex64), "adjtimex" },
+[BASE_NR + 155] = { 2, 0, SEN(setrlimit), "setrlimit" },
+[BASE_NR + 156] = { 1, TF, SEN(chroot), "chroot" },
+[BASE_NR + 157] = { 0, 0, SEN(sync), "sync" },
+[BASE_NR + 158] = { 1, TF, SEN(acct), "acct" },
+[BASE_NR + 159] = { 2, TCL, SEN(settimeofday), "settimeofday" },
+[BASE_NR + 160] = { 5, TF, SEN(mount), "mount" },
+[BASE_NR + 161] = { 2, TF, SEN(umount2), "umount2" },
+[BASE_NR + 162] = { 2, TF, SEN(swapon), "swapon" },
+[BASE_NR + 163] = { 1, TF, SEN(swapoff), "swapoff" },
+[BASE_NR + 164] = { 4, 0, SEN(reboot), "reboot" },
+[BASE_NR + 165] = { 2, 0, SEN(sethostname), "sethostname" },
+[BASE_NR + 166] = { 2, 0, SEN(setdomainname), "setdomainname" },
+[BASE_NR + 167] = { 2, 0, SEN(create_module), "create_module" },
+[BASE_NR + 168] = { 3, 0, SEN(init_module), "init_module" },
+[BASE_NR + 169] = { 2, 0, SEN(delete_module), "delete_module" },
+[BASE_NR + 170] = { 1, 0, SEN(get_kernel_syms), "get_kernel_syms" },
+[BASE_NR + 171] = { 5, 0, SEN(query_module), "query_module" },
+[BASE_NR + 172] = { 4, TF, SEN(quotactl), "quotactl" },
+[BASE_NR + 173] = { 3, 0, SEN(nfsservctl), "nfsservctl" },
+[BASE_NR + 174] = { 5, TN, SEN(getpmsg), "getpmsg" },
+[BASE_NR + 175] = { 5, TN, SEN(putpmsg), "putpmsg" },
+[BASE_NR + 176] = { 0, 0, SEN(afs_syscall), "afs_syscall" },
+[BASE_NR + 177] = { 0, 0, SEN(printargs), "reserved177" },
+[BASE_NR + 178] = { 0, PU|NF, SEN(gettid), "gettid" },
+[BASE_NR + 179] = { 3, TD, SEN(readahead), "readahead" },
+[BASE_NR + 180] = { 5, TF, SEN(setxattr), "setxattr" },
+[BASE_NR + 181] = { 5, TF, SEN(setxattr), "lsetxattr" },
+[BASE_NR + 182] = { 5, TD, SEN(fsetxattr), "fsetxattr" },
+[BASE_NR + 183] = { 4, TF, SEN(getxattr), "getxattr" },
+[BASE_NR + 184] = { 4, TF, SEN(getxattr), "lgetxattr" },
+[BASE_NR + 185] = { 4, TD, SEN(fgetxattr), "fgetxattr" },
+[BASE_NR + 186] = { 3, TF, SEN(listxattr), "listxattr" },
+[BASE_NR + 187] = { 3, TF, SEN(listxattr), "llistxattr" },
+[BASE_NR + 188] = { 3, TD, SEN(flistxattr), "flistxattr" },
+[BASE_NR + 189] = { 2, TF, SEN(removexattr), "removexattr" },
+[BASE_NR + 190] = { 2, TF, SEN(removexattr), "lremovexattr" },
+[BASE_NR + 191] = { 2, TD, SEN(fremovexattr), "fremovexattr" },
+[BASE_NR + 192] = { 2, TS|TP, SEN(tkill), "tkill" },
+[BASE_NR + 193] = { 1, TCL, SEN(time), "time" },
+[BASE_NR + 194] = { 6, 0, SEN(futex_time64), "futex" },
+[BASE_NR + 195] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" },
+[BASE_NR + 196] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" },
+[BASE_NR + 197] = { 3, 0, SEN(printargs), "cacheflush" },
+[BASE_NR + 198] = { 3, 0, SEN(printargs), "cachectl" },
+[BASE_NR + 199] = { 4, 0, SEN(sysmips), "sysmips" },
+[BASE_NR + 200] = { 2, TM, SEN(io_setup), "io_setup" },
+[BASE_NR + 201] = { 1, TM, SEN(io_destroy), "io_destroy" },
+[BASE_NR + 202] = { 5, 0, SEN(io_getevents_time64), "io_getevents" },
+[BASE_NR + 203] = { 3, 0, SEN(io_submit), "io_submit" },
+[BASE_NR + 204] = { 3, 0, SEN(io_cancel), "io_cancel" },
+[BASE_NR + 205] = { 1, TP|SE, SEN(exit), "exit_group" },
+[BASE_NR + 206] = { 3, 0, SEN(lookup_dcookie), "lookup_dcookie" },
+[BASE_NR + 207] = { 1, TD, SEN(epoll_create), "epoll_create" },
+[BASE_NR + 208] = { 4, TD, SEN(epoll_ctl), "epoll_ctl" },
+[BASE_NR + 209] = { 4, TD, SEN(epoll_wait), "epoll_wait" },
+[BASE_NR + 210] = { 5, TM|SI, SEN(remap_file_pages), "remap_file_pages" },
+[BASE_NR + 211] = { 0, TS, SEN(rt_sigreturn), "rt_sigreturn" },
+[BASE_NR + 212] = { 1, 0, SEN(set_tid_address), "set_tid_address" },
+[BASE_NR + 213] = { 0, 0, SEN(restart_syscall), "restart_syscall" },
+[BASE_NR + 214] = { 4, TI, SEN(semtimedop_time64), "semtimedop" },
+[BASE_NR + 215] = { 4, TD, SEN(fadvise64), "fadvise64" },
+[BASE_NR + 216] = { 3, 0, SEN(timer_create), "timer_create" },
+[BASE_NR + 217] = { 4, 0, SEN(timer_settime64), "timer_settime" },
+[BASE_NR + 218] = { 2, 0, SEN(timer_gettime64), "timer_gettime" },
+[BASE_NR + 219] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" },
+[BASE_NR + 220] = { 1, 0, SEN(timer_delete), "timer_delete" },
+[BASE_NR + 221] = { 2, TCL, SEN(clock_settime64), "clock_settime" },
+[BASE_NR + 222] = { 2, TCL, SEN(clock_gettime64), "clock_gettime" },
+[BASE_NR + 223] = { 2, TCL, SEN(clock_getres_time64), "clock_getres" },
+[BASE_NR + 224] = { 4, 0, SEN(clock_nanosleep_time64), "clock_nanosleep" },
+[BASE_NR + 225] = { 3, TS|TP, SEN(tgkill), "tgkill" },
+[BASE_NR + 226] = { 2, TF, SEN(utimes), "utimes" },
+[BASE_NR + 227] = { 6, TM, SEN(mbind), "mbind" },
+[BASE_NR + 228] = { 5, TM, SEN(get_mempolicy), "get_mempolicy" },
+[BASE_NR + 229] = { 3, TM, SEN(set_mempolicy), "set_mempolicy" },
+[BASE_NR + 230] = { 4, TD, SEN(mq_open), "mq_open" },
+[BASE_NR + 231] = { 1, 0, SEN(mq_unlink), "mq_unlink" },
+[BASE_NR + 232] = { 5, TD, SEN(mq_timedsend_time64), "mq_timedsend" },
+[BASE_NR + 233] = { 5, TD, SEN(mq_timedreceive_time64), "mq_timedreceive" },
+[BASE_NR + 234] = { 2, TD, SEN(mq_notify), "mq_notify" },
+[BASE_NR + 235] = { 3, TD, SEN(mq_getsetattr), "mq_getsetattr" },
+[BASE_NR + 236] = { 5, 0, SEN(vserver), "vserver" },
+[BASE_NR + 237] = { 5, TP, SEN(waitid), "waitid" },
+[BASE_NR + 238] = { },
+[BASE_NR + 239] = { 5, 0, SEN(add_key), "add_key" },
+[BASE_NR + 240] = { 4, 0, SEN(request_key), "request_key" },
+[BASE_NR + 241] = { 5, 0, SEN(keyctl), "keyctl" },
+[BASE_NR + 242] = { 1, 0, SEN(set_thread_area), "set_thread_area" },
+[BASE_NR + 243] = { 0, TD, SEN(inotify_init), "inotify_init" },
+[BASE_NR + 244] = { 3, TD|TF, SEN(inotify_add_watch), "inotify_add_watch" },
+[BASE_NR + 245] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" },
+[BASE_NR + 246] = { 4, TM, SEN(migrate_pages), "migrate_pages" },
+[BASE_NR + 247] = { 4, TD|TF, SEN(openat), "openat" },
+[BASE_NR + 248] = { 3, TD|TF, SEN(mkdirat), "mkdirat" },
+[BASE_NR + 249] = { 4, TD|TF, SEN(mknodat), "mknodat" },
+[BASE_NR + 250] = { 5, TD|TF, SEN(fchownat), "fchownat" },
+[BASE_NR + 251] = { 3, TD|TF, SEN(futimesat), "futimesat" },
+[BASE_NR + 252] = { 4, TD|TF|TFST|TSTA,SEN(newfstatat), "newfstatat" },
+[BASE_NR + 253] = { 3, TD|TF, SEN(unlinkat), "unlinkat" },
+[BASE_NR + 254] = { 4, TD|TF, SEN(renameat), "renameat" },
+[BASE_NR + 255] = { 5, TD|TF, SEN(linkat), "linkat" },
+[BASE_NR + 256] = { 3, TD|TF, SEN(symlinkat), "symlinkat" },
+[BASE_NR + 257] = { 4, TD|TF, SEN(readlinkat), "readlinkat" },
+[BASE_NR + 258] = { 3, TD|TF, SEN(fchmodat), "fchmodat" },
+[BASE_NR + 259] = { 3, TD|TF, SEN(faccessat), "faccessat" },
+[BASE_NR + 260] = { 6, TD, SEN(pselect6_time64), "pselect6" },
+[BASE_NR + 261] = { 5, TD, SEN(ppoll_time64), "ppoll" },
+[BASE_NR + 262] = { 1, 0, SEN(unshare), "unshare" },
+[BASE_NR + 263] = { 6, TD, SEN(splice), "splice" },
+[BASE_NR + 264] = { 4, TD, SEN(sync_file_range), "sync_file_range" },
+[BASE_NR + 265] = { 4, TD, SEN(tee), "tee" },
+[BASE_NR + 266] = { 4, TD, SEN(vmsplice), "vmsplice" },
+[BASE_NR + 267] = { 6, TM, SEN(move_pages), "move_pages" },
+[BASE_NR + 268] = { 2, 0, SEN(set_robust_list), "set_robust_list" },
+[BASE_NR + 269] = { 3, 0, SEN(get_robust_list), "get_robust_list" },
+[BASE_NR + 270] = { 4, 0, SEN(kexec_load), "kexec_load" },
+[BASE_NR + 271] = { 3, 0, SEN(getcpu), "getcpu" },
+[BASE_NR + 272] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" },
+[BASE_NR + 273] = { 3, 0, SEN(ioprio_set), "ioprio_set" },
+[BASE_NR + 274] = { 2, 0, SEN(ioprio_get), "ioprio_get" },
+[BASE_NR + 275] = { 4, TD|TF, SEN(utimensat_time64), "utimensat" },
+[BASE_NR + 276] = { 3, TD|TS, SEN(signalfd), "signalfd" },
+[BASE_NR + 277] = { 4, TD, SEN(timerfd), "timerfd" },
+[BASE_NR + 278] = { 1, TD, SEN(eventfd), "eventfd" },
+[BASE_NR + 279] = { 4, TD, SEN(fallocate), "fallocate" },
+[BASE_NR + 280] = { 2, TD, SEN(timerfd_create), "timerfd_create" },
+[BASE_NR + 281] = { 2, TD, SEN(timerfd_gettime64), "timerfd_gettime" },
+[BASE_NR + 282] = { 4, TD, SEN(timerfd_settime64), "timerfd_settime" },
+[BASE_NR + 283] = { 4, TD|TS, SEN(signalfd4), "signalfd4" },
+[BASE_NR + 284] = { 2, TD, SEN(eventfd2), "eventfd2" },
+[BASE_NR + 285] = { 1, TD, SEN(epoll_create1), "epoll_create1" },
+[BASE_NR + 286] = { 3, TD, SEN(dup3), "dup3" },
+[BASE_NR + 287] = { 2, TD, SEN(pipe2), "pipe2" },
+[BASE_NR + 288] = { 1, TD, SEN(inotify_init1), "inotify_init1" },
+[BASE_NR + 289] = { 4, TD, SEN(preadv), "preadv" },
+[BASE_NR + 290] = { 4, TD, SEN(pwritev), "pwritev" },
+[BASE_NR + 291] = { 4, TP|TS, SEN(rt_tgsigqueueinfo), "rt_tgsigqueueinfo" },
+[BASE_NR + 292] = { 5, TD, SEN(perf_event_open), "perf_event_open" },
+[BASE_NR + 293] = { 4, TN, SEN(accept4), "accept4" },
+[BASE_NR + 294] = { 5, TN, SEN(recvmmsg_time64), "recvmmsg" },
+[BASE_NR + 295] = { 2, TD, SEN(fanotify_init), "fanotify_init" },
+[BASE_NR + 296] = { 5, TD|TF, SEN(fanotify_mark), "fanotify_mark" },
+[BASE_NR + 297] = { 4, 0, SEN(prlimit64), "prlimit64" },
+[BASE_NR + 298] = { 5, TD|TF, SEN(name_to_handle_at), "name_to_handle_at" },
+[BASE_NR + 299] = { 3, TD, SEN(open_by_handle_at), "open_by_handle_at" },
+[BASE_NR + 300] = { 2, TCL, SEN(clock_adjtime64), "clock_adjtime" },
+[BASE_NR + 301] = { 1, TD, SEN(syncfs), "syncfs" },
+[BASE_NR + 302] = { 4, TN, SEN(sendmmsg), "sendmmsg" },
+[BASE_NR + 303] = { 2, TD, SEN(setns), "setns" },
+[BASE_NR + 304] = { 6, 0, SEN(process_vm_readv), "process_vm_readv" },
+[BASE_NR + 305] = { 6, 0, SEN(process_vm_writev), "process_vm_writev" },
+[BASE_NR + 306] = { 5, 0, SEN(kcmp), "kcmp" },
+[BASE_NR + 307] = { 3, TD, SEN(finit_module), "finit_module" },
+[BASE_NR + 308] = { 3, TD, SEN(getdents64), "getdents64" },
+[BASE_NR + 309] = { 3, 0, SEN(sched_setattr), "sched_setattr" },
+[BASE_NR + 310] = { 4, 0, SEN(sched_getattr), "sched_getattr" },
+[BASE_NR + 311] = { 5, TD|TF, SEN(renameat2), "renameat2" },
+[BASE_NR + 312] = { 3, 0, SEN(seccomp), "seccomp" },
+[BASE_NR + 313] = { 3, 0, SEN(getrandom), "getrandom" },
+[BASE_NR + 314] = { 2, TD, SEN(memfd_create), "memfd_create" },
+[BASE_NR + 315] = { 3, TD, SEN(bpf), "bpf" },
+[BASE_NR + 316] = { 5, TD|TF|TP|TSD|SE|SI, SEN(execveat), "execveat" },
+[BASE_NR + 317] = { 1, TD, SEN(userfaultfd), "userfaultfd" },
+[BASE_NR + 318] = { 3, 0, SEN(membarrier), "membarrier" },
+[BASE_NR + 319] = { 3, TM, SEN(mlock2), "mlock2" },
+[BASE_NR + 320] = { 6, TD, SEN(copy_file_range), "copy_file_range" },
+[BASE_NR + 321] = { 6, TD, SEN(preadv2), "preadv2" },
+[BASE_NR + 322] = { 6, TD, SEN(pwritev2), "pwritev2" },
+[BASE_NR + 323] = { 4, TM|SI, SEN(pkey_mprotect), "pkey_mprotect" },
+[BASE_NR + 324] = { 2, 0, SEN(pkey_alloc), "pkey_alloc" },
+[BASE_NR + 325] = { 1, 0, SEN(pkey_free), "pkey_free" },
+[BASE_NR + 326] = { 5, TD|TF|TFST|TSTA,SEN(statx), "statx" },
+[BASE_NR + 327] = { 4, 0, SEN(rseq), "rseq" },
+[BASE_NR + 328] = { 6, 0, SEN(io_pgetevents_time64), "io_pgetevents" },
+# include "syscallent-common.h"
+
+# define SYS_socket_subcall 5500
+# include "subcall64.h"
+
+#else
+
+# define SYSCALL_NAME_PREFIX "n64:"
+# include "syscallent-n64-stub.h"
+# include "syscallent-common-stub.h"
+# undef SYSCALL_NAME_PREFIX
+
+#endif
+#undef BASE_NR
diff --git a/src/linux/mips/syscallent-o32.h b/src/linux/mips/syscallent-o32.h
new file mode 100644
index 000000000..f6954a9df
--- /dev/null
+++ b/src/linux/mips/syscallent-o32.h
@@ -0,0 +1,407 @@
+/*
+ * Copyright (c) 2013-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#define BASE_NR 4000
+#if defined LINUX_MIPSO32
+/* For an O32 strace, decode the o32 syscalls. */
+# define SYS_syscall_subcall 4000
+[BASE_NR + 0] = { MA, TSD, SEN(syscall), "syscall" }, /* start of Linux o32 */
+[BASE_NR + 1] = { 1, TP|SE, SEN(exit), "exit" },
+[BASE_NR + 2] = { 0, TP, SEN(fork), "fork" },
+[BASE_NR + 3] = { 3, TD, SEN(read), "read" },
+[BASE_NR + 4] = { 3, TD, SEN(write), "write" },
+[BASE_NR + 5] = { 3, TD|TF, SEN(open), "open" },
+[BASE_NR + 6] = { 1, TD, SEN(close), "close" },
+[BASE_NR + 7] = { 3, TP, SEN(waitpid), "waitpid" },
+[BASE_NR + 8] = { 2, TD|TF, SEN(creat), "creat" },
+[BASE_NR + 9] = { 2, TF, SEN(link), "link" },
+[BASE_NR + 10] = { 1, TF, SEN(unlink), "unlink" },
+[BASE_NR + 11] = { 3, TF|TP|TSD|SE|SI, SEN(execve), "execve" },
+[BASE_NR + 12] = { 1, TF, SEN(chdir), "chdir" },
+[BASE_NR + 13] = { 1, TCL, SEN(time), "time" },
+[BASE_NR + 14] = { 3, TF, SEN(mknod), "mknod" },
+[BASE_NR + 15] = { 2, TF, SEN(chmod), "chmod" },
+[BASE_NR + 16] = { 3, TF, SEN(chown), "lchown" },
+[BASE_NR + 17] = { 0, TM, SEN(break), "break" },
+[BASE_NR + 18] = { 2, TF|TST|TSTA, SEN(oldstat), "oldstat" },
+[BASE_NR + 19] = { 3, TD, SEN(lseek), "lseek" },
+[BASE_NR + 20] = { 0, PU|NF, SEN(getpid), "getpid" },
+[BASE_NR + 21] = { 5, TF, SEN(mount), "mount" },
+[BASE_NR + 22] = { 1, TF, SEN(umount), "umount" },
+[BASE_NR + 23] = { 1, TC, SEN(setuid), "setuid" },
+[BASE_NR + 24] = { 0, TC|PU|NF, SEN(getuid), "getuid" },
+[BASE_NR + 25] = { 1, 0, SEN(stime), "stime" },
+[BASE_NR + 26] = { 4, 0, SEN(ptrace), "ptrace" },
+[BASE_NR + 27] = { 1, 0, SEN(alarm), "alarm" },
+[BASE_NR + 28] = { 2, TD|TFST|TSTA, SEN(oldfstat), "oldfstat" },
+[BASE_NR + 29] = { 0, TS, SEN(pause), "pause" },
+[BASE_NR + 30] = { 2, TF, SEN(utime), "utime" },
+[BASE_NR + 31] = { 0, 0, SEN(stty), "stty" },
+[BASE_NR + 32] = { 0, 0, SEN(gtty), "gtty" },
+[BASE_NR + 33] = { 2, TF, SEN(access), "access" },
+[BASE_NR + 34] = { 1, 0, SEN(nice), "nice" },
+[BASE_NR + 35] = { 1, 0, SEN(ftime), "ftime" },
+[BASE_NR + 36] = { 0, 0, SEN(sync), "sync" },
+[BASE_NR + 37] = { 2, TS|TP, SEN(kill), "kill" },
+[BASE_NR + 38] = { 2, TF, SEN(rename), "rename" },
+[BASE_NR + 39] = { 2, TF, SEN(mkdir), "mkdir" },
+[BASE_NR + 40] = { 1, TF, SEN(rmdir), "rmdir" },
+[BASE_NR + 41] = { 1, TD, SEN(dup), "dup" },
+[BASE_NR + 42] = { 0, TD, SEN(pipe), "pipe" },
+[BASE_NR + 43] = { 1, 0, SEN(times), "times" },
+[BASE_NR + 44] = { 0, 0, SEN(prof), "prof" },
+[BASE_NR + 45] = { 1, TM|SI, SEN(brk), "brk" },
+[BASE_NR + 46] = { 1, TC, SEN(setgid), "setgid" },
+[BASE_NR + 47] = { 0, TC|PU|NF, SEN(getgid), "getgid" },
+[BASE_NR + 48] = { 2, TS, SEN(signal), "signal" },
+[BASE_NR + 49] = { 0, TC|PU|NF, SEN(geteuid), "geteuid" },
+[BASE_NR + 50] = { 0, TC|PU|NF, SEN(getegid), "getegid" },
+[BASE_NR + 51] = { 1, TF, SEN(acct), "acct" },
+[BASE_NR + 52] = { 2, TF, SEN(umount2), "umount2" },
+[BASE_NR + 53] = { 0, 0, SEN(lock), "lock" },
+[BASE_NR + 54] = { 3, TD, SEN(ioctl), "ioctl" },
+[BASE_NR + 55] = { 3, TD, SEN(fcntl), "fcntl" },
+[BASE_NR + 56] = { 0, 0, SEN(mpx), "mpx" },
+[BASE_NR + 57] = { 2, 0, SEN(setpgid), "setpgid" },
+[BASE_NR + 58] = { 0, 0, SEN(ulimit), "ulimit" },
+[BASE_NR + 59] = { 1, 0, SEN(oldolduname), "oldolduname" },
+[BASE_NR + 60] = { 1, NF, SEN(umask), "umask" },
+[BASE_NR + 61] = { 1, TF, SEN(chroot), "chroot" },
+[BASE_NR + 62] = { 2, TSFA, SEN(ustat), "ustat" },
+[BASE_NR + 63] = { 2, TD, SEN(dup2), "dup2" },
+[BASE_NR + 64] = { 0, PU|NF, SEN(getppid), "getppid" },
+[BASE_NR + 65] = { 0, PU|NF, SEN(getpgrp), "getpgrp" },
+[BASE_NR + 66] = { 0, 0, SEN(setsid), "setsid" },
+[BASE_NR + 67] = { 3, TS, SEN(sigaction), "sigaction" },
+[BASE_NR + 68] = { 0, TS, SEN(sgetmask), "sgetmask" },
+[BASE_NR + 69] = { 1, TS, SEN(ssetmask), "ssetmask" },
+[BASE_NR + 70] = { 2, TC, SEN(setreuid), "setreuid" },
+[BASE_NR + 71] = { 2, TC, SEN(setregid), "setregid" },
+[BASE_NR + 72] = { 1, TS, SEN(sigsuspend), "sigsuspend" },
+[BASE_NR + 73] = { 1, TS, SEN(sigpending), "sigpending" },
+[BASE_NR + 74] = { 2, 0, SEN(sethostname), "sethostname" },
+[BASE_NR + 75] = { 2, 0, SEN(setrlimit), "setrlimit" },
+[BASE_NR + 76] = { 2, 0, SEN(getrlimit), "getrlimit" },
+[BASE_NR + 77] = { 2, 0, SEN(getrusage), "getrusage" },
+[BASE_NR + 78] = { 2, TCL, SEN(gettimeofday), "gettimeofday" },
+[BASE_NR + 79] = { 2, TCL, SEN(settimeofday), "settimeofday" },
+[BASE_NR + 80] = { 2, TC, SEN(getgroups), "getgroups" },
+[BASE_NR + 81] = { 2, TC, SEN(setgroups), "setgroups" },
+[BASE_NR + 82] = { 0, 0, SEN(printargs), "reserved82" },
+[BASE_NR + 83] = { 2, TF, SEN(symlink), "symlink" },
+[BASE_NR + 84] = { 2, TF|TLST|TSTA, SEN(oldlstat), "oldlstat" },
+[BASE_NR + 85] = { 3, TF, SEN(readlink), "readlink" },
+[BASE_NR + 86] = { 1, TF, SEN(uselib), "uselib" },
+[BASE_NR + 87] = { 2, TF, SEN(swapon), "swapon" },
+[BASE_NR + 88] = { 4, 0, SEN(reboot), "reboot" },
+[BASE_NR + 89] = { 3, TD, SEN(readdir), "readdir" },
+[BASE_NR + 90] = { 6, TD|TM|SI, SEN(mmap), "mmap" },
+[BASE_NR + 91] = { 2, TM|SI, SEN(munmap), "munmap" },
+[BASE_NR + 92] = { 2, TF, SEN(truncate), "truncate" },
+[BASE_NR + 93] = { 2, TD, SEN(ftruncate), "ftruncate" },
+[BASE_NR + 94] = { 2, TD, SEN(fchmod), "fchmod" },
+[BASE_NR + 95] = { 3, TD, SEN(fchown), "fchown" },
+[BASE_NR + 96] = { 2, 0, SEN(getpriority), "getpriority" },
+[BASE_NR + 97] = { 3, 0, SEN(setpriority), "setpriority" },
+[BASE_NR + 98] = { 0, 0, SEN(profil), "profil" },
+[BASE_NR + 99] = { 2, TF|TSF|TSFA, SEN(statfs), "statfs" },
+[BASE_NR + 100] = { 2, TD|TFSF|TSFA, SEN(fstatfs), "fstatfs" },
+[BASE_NR + 101] = { 3, 0, SEN(ioperm), "ioperm" },
+[BASE_NR + 102] = { 2, TD|TSD, SEN(socketcall), "socketcall" },
+[BASE_NR + 103] = { 3, 0, SEN(syslog), "syslog" },
+[BASE_NR + 104] = { 3, 0, SEN(setitimer), "setitimer" },
+[BASE_NR + 105] = { 2, 0, SEN(getitimer), "getitimer" },
+[BASE_NR + 106] = { 2, TF|TST|TSTA, SEN(stat), "stat" },
+[BASE_NR + 107] = { 2, TF|TLST|TSTA, SEN(lstat), "lstat" },
+[BASE_NR + 108] = { 2, TD|TFST|TSTA, SEN(fstat), "fstat" },
+[BASE_NR + 109] = { 1, 0, SEN(olduname), "olduname" },
+[BASE_NR + 110] = { 1, 0, SEN(iopl), "iopl" },
+[BASE_NR + 111] = { 0, 0, SEN(vhangup), "vhangup" },
+[BASE_NR + 112] = { 0, 0, SEN(idle), "idle" },
+[BASE_NR + 113] = { 5, 0, SEN(vm86old), "vm86" },
+[BASE_NR + 114] = { 4, TP, SEN(wait4), "wait4" },
+[BASE_NR + 115] = { 1, TF, SEN(swapoff), "swapoff" },
+[BASE_NR + 116] = { 1, 0, SEN(sysinfo), "sysinfo" },
+[BASE_NR + 117] = { 6, TI|TSD, SEN(ipc), "ipc" },
+[BASE_NR + 118] = { 1, TD, SEN(fsync), "fsync" },
+[BASE_NR + 119] = { 0, TS, SEN(sigreturn), "sigreturn" },
+[BASE_NR + 120] = { 5, TP, SEN(clone), "clone" },
+[BASE_NR + 121] = { 2, 0, SEN(setdomainname), "setdomainname" },
+[BASE_NR + 122] = { 1, 0, SEN(uname), "uname" },
+[BASE_NR + 123] = { 0, 0, SEN(modify_ldt), "modify_ldt" },
+[BASE_NR + 124] = { 1, TCL, SEN(adjtimex32), "adjtimex" },
+[BASE_NR + 125] = { 3, TM|SI, SEN(mprotect), "mprotect" },
+[BASE_NR + 126] = { 3, TS, SEN(sigprocmask), "sigprocmask" },
+[BASE_NR + 127] = { 2, 0, SEN(create_module), "create_module" },
+[BASE_NR + 128] = { 3, 0, SEN(init_module), "init_module" },
+[BASE_NR + 129] = { 2, 0, SEN(delete_module), "delete_module" },
+[BASE_NR + 130] = { 1, 0, SEN(get_kernel_syms), "get_kernel_syms" },
+[BASE_NR + 131] = { 4, TF, SEN(quotactl), "quotactl" },
+[BASE_NR + 132] = { 1, 0, SEN(getpgid), "getpgid" },
+[BASE_NR + 133] = { 1, TD, SEN(fchdir), "fchdir" },
+[BASE_NR + 134] = { 2, 0, SEN(bdflush), "bdflush" },
+[BASE_NR + 135] = { 3, 0, SEN(sysfs), "sysfs" },
+[BASE_NR + 136] = { 1, NF, SEN(personality), "personality" },
+[BASE_NR + 137] = { 0, 0, SEN(afs_syscall), "afs_syscall" },
+[BASE_NR + 138] = { 1, TC|NF, SEN(setfsuid), "setfsuid" },
+[BASE_NR + 139] = { 1, TC|NF, SEN(setfsgid), "setfsgid" },
+[BASE_NR + 140] = { 5, TD, SEN(llseek), "_llseek" },
+[BASE_NR + 141] = { 3, TD, SEN(getdents), "getdents" },
+[BASE_NR + 142] = { 5, TD, SEN(select), "_newselect" },
+[BASE_NR + 143] = { 2, TD, SEN(flock), "flock" },
+[BASE_NR + 144] = { 3, TM, SEN(msync), "msync" },
+[BASE_NR + 145] = { 3, TD, SEN(readv), "readv" },
+[BASE_NR + 146] = { 3, TD, SEN(writev), "writev" },
+[BASE_NR + 147] = { 3, 0, SEN(printargs), "cacheflush" },
+[BASE_NR + 148] = { 3, 0, SEN(printargs), "cachectl" },
+[BASE_NR + 149] = { 4, 0, SEN(sysmips), "sysmips" },
+[BASE_NR + 150] = { 0, 0, SEN(setup), "setup" },
+[BASE_NR + 151] = { 1, 0, SEN(getsid), "getsid" },
+[BASE_NR + 152] = { 1, TD, SEN(fdatasync), "fdatasync" },
+[BASE_NR + 153] = { 1, 0, SEN(sysctl), "_sysctl" },
+[BASE_NR + 154] = { 2, TM, SEN(mlock), "mlock" },
+[BASE_NR + 155] = { 2, TM, SEN(munlock), "munlock" },
+[BASE_NR + 156] = { 1, TM, SEN(mlockall), "mlockall" },
+[BASE_NR + 157] = { 0, TM, SEN(munlockall), "munlockall" },
+[BASE_NR + 158] = { 2, 0, SEN(sched_setparam), "sched_setparam" },
+[BASE_NR + 159] = { 2, 0, SEN(sched_getparam), "sched_getparam" },
+[BASE_NR + 160] = { 3, 0, SEN(sched_setscheduler), "sched_setscheduler" },
+[BASE_NR + 161] = { 1, 0, SEN(sched_getscheduler), "sched_getscheduler" },
+[BASE_NR + 162] = { 0, 0, SEN(sched_yield), "sched_yield" },
+[BASE_NR + 163] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"},
+[BASE_NR + 164] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"},
+[BASE_NR + 165] = { 2, 0, SEN(sched_rr_get_interval_time32),"sched_rr_get_interval"},
+[BASE_NR + 166] = { 2, 0, SEN(nanosleep_time32), "nanosleep" },
+[BASE_NR + 167] = { 5, TM|SI, SEN(mremap), "mremap" },
+[BASE_NR + 168] = { 3, TN, SEN(accept), "accept" },
+[BASE_NR + 169] = { 3, TN, SEN(bind), "bind" },
+[BASE_NR + 170] = { 3, TN, SEN(connect), "connect" },
+[BASE_NR + 171] = { 3, TN, SEN(getpeername), "getpeername" },
+[BASE_NR + 172] = { 3, TN, SEN(getsockname), "getsockname" },
+[BASE_NR + 173] = { 5, TN, SEN(getsockopt), "getsockopt" },
+[BASE_NR + 174] = { 2, TN, SEN(listen), "listen" },
+[BASE_NR + 175] = { 4, TN, SEN(recv), "recv" },
+[BASE_NR + 176] = { 6, TN, SEN(recvfrom), "recvfrom" },
+[BASE_NR + 177] = { 3, TN, SEN(recvmsg), "recvmsg" },
+[BASE_NR + 178] = { 4, TN, SEN(send), "send" },
+[BASE_NR + 179] = { 3, TN, SEN(sendmsg), "sendmsg" },
+[BASE_NR + 180] = { 6, TN, SEN(sendto), "sendto" },
+[BASE_NR + 181] = { 5, TN, SEN(setsockopt), "setsockopt" },
+[BASE_NR + 182] = { 2, TN, SEN(shutdown), "shutdown" },
+[BASE_NR + 183] = { 3, TN, SEN(socket), "socket" },
+[BASE_NR + 184] = { 4, TN, SEN(socketpair), "socketpair" },
+[BASE_NR + 185] = { 3, TC, SEN(setresuid), "setresuid" },
+[BASE_NR + 186] = { 3, TC, SEN(getresuid), "getresuid" },
+[BASE_NR + 187] = { 5, 0, SEN(query_module), "query_module" },
+[BASE_NR + 188] = { 3, TD, SEN(poll_time32), "poll" },
+[BASE_NR + 189] = { 3, 0, SEN(nfsservctl), "nfsservctl" },
+[BASE_NR + 190] = { 3, TC, SEN(setresgid), "setresgid" },
+[BASE_NR + 191] = { 3, TC, SEN(getresgid), "getresgid" },
+[BASE_NR + 192] = { 5, TC, SEN(prctl), "prctl" },
+[BASE_NR + 193] = { 0, TS, SEN(rt_sigreturn), "rt_sigreturn" },
+[BASE_NR + 194] = { 4, TS, SEN(rt_sigaction), "rt_sigaction" },
+[BASE_NR + 195] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" },
+[BASE_NR + 196] = { 2, TS, SEN(rt_sigpending), "rt_sigpending" },
+[BASE_NR + 197] = { 4, TS, SEN(rt_sigtimedwait_time32), "rt_sigtimedwait" },
+[BASE_NR + 198] = { 3, TS|TP, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" },
+[BASE_NR + 199] = { 2, TS, SEN(rt_sigsuspend), "rt_sigsuspend" },
+[BASE_NR + 200] = { 6, TD, SEN(pread), "pread64" },
+[BASE_NR + 201] = { 6, TD, SEN(pwrite), "pwrite64" },
+[BASE_NR + 202] = { 3, TF, SEN(chown), "chown" },
+[BASE_NR + 203] = { 2, TF, SEN(getcwd), "getcwd" },
+[BASE_NR + 204] = { 2, TC, SEN(capget), "capget" },
+[BASE_NR + 205] = { 2, TC, SEN(capset), "capset" },
+[BASE_NR + 206] = { 2, TS, SEN(sigaltstack), "sigaltstack" },
+[BASE_NR + 207] = { 4, TD|TN, SEN(sendfile), "sendfile" },
+[BASE_NR + 208] = { 5, TN, SEN(getpmsg), "getpmsg" },
+[BASE_NR + 209] = { 5, TN, SEN(putpmsg), "putpmsg" },
+[BASE_NR + 210] = { 6, TD|TM|SI, SEN(mmap_4koff), "mmap2" },
+[BASE_NR + 211] = { 4, TF, SEN(truncate64), "truncate64" },
+[BASE_NR + 212] = { 4, TD, SEN(ftruncate64), "ftruncate64" },
+[BASE_NR + 213] = { 2, TF|TST|TSTA, SEN(stat64), "stat64" },
+[BASE_NR + 214] = { 2, TF|TLST|TSTA, SEN(lstat64), "lstat64" },
+[BASE_NR + 215] = { 2, TD|TFST|TSTA, SEN(fstat64), "fstat64" },
+[BASE_NR + 216] = { 2, TF, SEN(pivotroot), "pivot_root" },
+[BASE_NR + 217] = { 3, TM, SEN(mincore), "mincore" },
+[BASE_NR + 218] = { 3, TM, SEN(madvise), "madvise" },
+[BASE_NR + 219] = { 3, TD, SEN(getdents64), "getdents64" },
+[BASE_NR + 220] = { 3, TD, SEN(fcntl64), "fcntl64" },
+[BASE_NR + 221] = { 0, 0, SEN(printargs), "reserved221" },
+[BASE_NR + 222] = { 0, PU|NF, SEN(gettid), "gettid" },
+[BASE_NR + 223] = { 5, TD, SEN(readahead), "readahead" },
+[BASE_NR + 224] = { 5, TF, SEN(setxattr), "setxattr" },
+[BASE_NR + 225] = { 5, TF, SEN(setxattr), "lsetxattr" },
+[BASE_NR + 226] = { 5, TD, SEN(fsetxattr), "fsetxattr" },
+[BASE_NR + 227] = { 4, TF, SEN(getxattr), "getxattr" },
+[BASE_NR + 228] = { 4, TF, SEN(getxattr), "lgetxattr" },
+[BASE_NR + 229] = { 4, TD, SEN(fgetxattr), "fgetxattr" },
+[BASE_NR + 230] = { 3, TF, SEN(listxattr), "listxattr" },
+[BASE_NR + 231] = { 3, TF, SEN(listxattr), "llistxattr" },
+[BASE_NR + 232] = { 3, TD, SEN(flistxattr), "flistxattr" },
+[BASE_NR + 233] = { 2, TF, SEN(removexattr), "removexattr" },
+[BASE_NR + 234] = { 2, TF, SEN(removexattr), "lremovexattr" },
+[BASE_NR + 235] = { 2, TD, SEN(fremovexattr), "fremovexattr" },
+[BASE_NR + 236] = { 2, TS|TP, SEN(tkill), "tkill" },
+[BASE_NR + 237] = { 4, TD|TN, SEN(sendfile64), "sendfile64" },
+[BASE_NR + 238] = { 6, 0, SEN(futex_time32), "futex" },
+[BASE_NR + 239] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" },
+[BASE_NR + 240] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" },
+[BASE_NR + 241] = { 2, TM, SEN(io_setup), "io_setup" },
+[BASE_NR + 242] = { 1, TM, SEN(io_destroy), "io_destroy" },
+[BASE_NR + 243] = { 5, 0, SEN(io_getevents_time32), "io_getevents" },
+[BASE_NR + 244] = { 3, 0, SEN(io_submit), "io_submit" },
+[BASE_NR + 245] = { 3, 0, SEN(io_cancel), "io_cancel" },
+[BASE_NR + 246] = { 1, TP|SE, SEN(exit), "exit_group" },
+[BASE_NR + 247] = { 4, 0, SEN(lookup_dcookie), "lookup_dcookie" },
+[BASE_NR + 248] = { 1, TD, SEN(epoll_create), "epoll_create" },
+[BASE_NR + 249] = { 4, TD, SEN(epoll_ctl), "epoll_ctl" },
+[BASE_NR + 250] = { 4, TD, SEN(epoll_wait), "epoll_wait" },
+[BASE_NR + 251] = { 5, TM|SI, SEN(remap_file_pages), "remap_file_pages" },
+[BASE_NR + 252] = { 1, 0, SEN(set_tid_address), "set_tid_address" },
+[BASE_NR + 253] = { 0, 0, SEN(restart_syscall), "restart_syscall" },
+[BASE_NR + 254] = { 7, TD, SEN(fadvise64_64), "fadvise64" },
+[BASE_NR + 255] = { 3, TF|TSF|TSFA, SEN(statfs64), "statfs64" },
+[BASE_NR + 256] = { 3, TD|TFSF|TSFA, SEN(fstatfs64), "fstatfs64" },
+[BASE_NR + 257] = { 3, 0, SEN(timer_create), "timer_create" },
+[BASE_NR + 258] = { 4, 0, SEN(timer_settime32), "timer_settime" },
+[BASE_NR + 259] = { 2, 0, SEN(timer_gettime32), "timer_gettime" },
+[BASE_NR + 260] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" },
+[BASE_NR + 261] = { 1, 0, SEN(timer_delete), "timer_delete" },
+[BASE_NR + 262] = { 2, TCL, SEN(clock_settime32), "clock_settime" },
+[BASE_NR + 263] = { 2, TCL, SEN(clock_gettime32), "clock_gettime" },
+[BASE_NR + 264] = { 2, TCL, SEN(clock_getres_time32), "clock_getres" },
+[BASE_NR + 265] = { 4, 0, SEN(clock_nanosleep_time32), "clock_nanosleep" },
+[BASE_NR + 266] = { 3, TS|TP, SEN(tgkill), "tgkill" },
+[BASE_NR + 267] = { 2, TF, SEN(utimes), "utimes" },
+[BASE_NR + 268] = { 6, TM, SEN(mbind), "mbind" },
+[BASE_NR + 269] = { 5, TM, SEN(get_mempolicy), "get_mempolicy" },
+[BASE_NR + 270] = { 3, TM, SEN(set_mempolicy), "set_mempolicy" },
+[BASE_NR + 271] = { 4, TD, SEN(mq_open), "mq_open" },
+[BASE_NR + 272] = { 1, 0, SEN(mq_unlink), "mq_unlink" },
+[BASE_NR + 273] = { 5, TD, SEN(mq_timedsend_time32), "mq_timedsend" },
+[BASE_NR + 274] = { 5, TD, SEN(mq_timedreceive_time32), "mq_timedreceive" },
+[BASE_NR + 275] = { 2, TD, SEN(mq_notify), "mq_notify" },
+[BASE_NR + 276] = { 3, TD, SEN(mq_getsetattr), "mq_getsetattr" },
+[BASE_NR + 277] = { 5, 0, SEN(vserver), "vserver" },
+[BASE_NR + 278] = { 5, TP, SEN(waitid), "waitid" },
+[BASE_NR + 279] = { },
+[BASE_NR + 280] = { 5, 0, SEN(add_key), "add_key" },
+[BASE_NR + 281] = { 4, 0, SEN(request_key), "request_key" },
+[BASE_NR + 282] = { 5, 0, SEN(keyctl), "keyctl" },
+[BASE_NR + 283] = { 1, 0, SEN(set_thread_area), "set_thread_area" },
+[BASE_NR + 284] = { 0, TD, SEN(inotify_init), "inotify_init" },
+[BASE_NR + 285] = { 3, TD|TF, SEN(inotify_add_watch), "inotify_add_watch" },
+[BASE_NR + 286] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" },
+[BASE_NR + 287] = { 4, TM, SEN(migrate_pages), "migrate_pages" },
+[BASE_NR + 288] = { 4, TD|TF, SEN(openat), "openat" },
+[BASE_NR + 289] = { 3, TD|TF, SEN(mkdirat), "mkdirat" },
+[BASE_NR + 290] = { 4, TD|TF, SEN(mknodat), "mknodat" },
+[BASE_NR + 291] = { 5, TD|TF, SEN(fchownat), "fchownat" },
+[BASE_NR + 292] = { 3, TD|TF, SEN(futimesat), "futimesat" },
+[BASE_NR + 293] = { 4, TD|TF|TFST|TSTA,SEN(fstatat64), "fstatat64" },
+[BASE_NR + 294] = { 3, TD|TF, SEN(unlinkat), "unlinkat" },
+[BASE_NR + 295] = { 4, TD|TF, SEN(renameat), "renameat" },
+[BASE_NR + 296] = { 5, TD|TF, SEN(linkat), "linkat" },
+[BASE_NR + 297] = { 3, TD|TF, SEN(symlinkat), "symlinkat" },
+[BASE_NR + 298] = { 4, TD|TF, SEN(readlinkat), "readlinkat" },
+[BASE_NR + 299] = { 3, TD|TF, SEN(fchmodat), "fchmodat" },
+[BASE_NR + 300] = { 3, TD|TF, SEN(faccessat), "faccessat" },
+[BASE_NR + 301] = { 6, TD, SEN(pselect6_time32), "pselect6" },
+[BASE_NR + 302] = { 5, TD, SEN(ppoll_time32), "ppoll" },
+[BASE_NR + 303] = { 1, 0, SEN(unshare), "unshare" },
+[BASE_NR + 304] = { 6, TD, SEN(splice), "splice" },
+[BASE_NR + 305] = { 7, TD, SEN(sync_file_range), "sync_file_range" },
+[BASE_NR + 306] = { 4, TD, SEN(tee), "tee" },
+[BASE_NR + 307] = { 4, TD, SEN(vmsplice), "vmsplice" },
+[BASE_NR + 308] = { 6, TM, SEN(move_pages), "move_pages" },
+[BASE_NR + 309] = { 2, 0, SEN(set_robust_list), "set_robust_list" },
+[BASE_NR + 310] = { 3, 0, SEN(get_robust_list), "get_robust_list" },
+[BASE_NR + 311] = { 4, 0, SEN(kexec_load), "kexec_load" },
+[BASE_NR + 312] = { 3, 0, SEN(getcpu), "getcpu" },
+[BASE_NR + 313] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" },
+[BASE_NR + 314] = { 3, 0, SEN(ioprio_set), "ioprio_set" },
+[BASE_NR + 315] = { 2, 0, SEN(ioprio_get), "ioprio_get" },
+[BASE_NR + 316] = { 4, TD|TF, SEN(utimensat_time32), "utimensat" },
+[BASE_NR + 317] = { 3, TD|TS, SEN(signalfd), "signalfd" },
+[BASE_NR + 318] = { 4, TD, SEN(timerfd), "timerfd" },
+[BASE_NR + 319] = { 1, TD, SEN(eventfd), "eventfd" },
+[BASE_NR + 320] = { 6, TD, SEN(fallocate), "fallocate" },
+[BASE_NR + 321] = { 2, TD, SEN(timerfd_create), "timerfd_create" },
+[BASE_NR + 322] = { 2, TD, SEN(timerfd_gettime32), "timerfd_gettime" },
+[BASE_NR + 323] = { 4, TD, SEN(timerfd_settime32), "timerfd_settime" },
+[BASE_NR + 324] = { 4, TD|TS, SEN(signalfd4), "signalfd4" },
+[BASE_NR + 325] = { 2, TD, SEN(eventfd2), "eventfd2" },
+[BASE_NR + 326] = { 1, TD, SEN(epoll_create1), "epoll_create1" },
+[BASE_NR + 327] = { 3, TD, SEN(dup3), "dup3" },
+[BASE_NR + 328] = { 2, TD, SEN(pipe2), "pipe2" },
+[BASE_NR + 329] = { 1, TD, SEN(inotify_init1), "inotify_init1" },
+[BASE_NR + 330] = { 5, TD, SEN(preadv), "preadv" },
+[BASE_NR + 331] = { 5, TD, SEN(pwritev), "pwritev" },
+[BASE_NR + 332] = { 4, TP|TS, SEN(rt_tgsigqueueinfo), "rt_tgsigqueueinfo" },
+[BASE_NR + 333] = { 5, TD, SEN(perf_event_open), "perf_event_open" },
+[BASE_NR + 334] = { 4, TN, SEN(accept4), "accept4" },
+[BASE_NR + 335] = { 5, TN, SEN(recvmmsg_time32), "recvmmsg" },
+[BASE_NR + 336] = { 2, TD, SEN(fanotify_init), "fanotify_init" },
+[BASE_NR + 337] = { 6, TD|TF, SEN(fanotify_mark), "fanotify_mark" },
+[BASE_NR + 338] = { 4, 0, SEN(prlimit64), "prlimit64" },
+[BASE_NR + 339] = { 5, TD|TF, SEN(name_to_handle_at), "name_to_handle_at" },
+[BASE_NR + 340] = { 3, TD, SEN(open_by_handle_at), "open_by_handle_at" },
+[BASE_NR + 341] = { 2, TCL, SEN(clock_adjtime32), "clock_adjtime" },
+[BASE_NR + 342] = { 1, TD, SEN(syncfs), "syncfs" },
+[BASE_NR + 343] = { 4, TN, SEN(sendmmsg), "sendmmsg" },
+[BASE_NR + 344] = { 2, TD, SEN(setns), "setns" },
+[BASE_NR + 345] = { 6, 0, SEN(process_vm_readv), "process_vm_readv" },
+[BASE_NR + 346] = { 6, 0, SEN(process_vm_writev), "process_vm_writev" },
+[BASE_NR + 347] = { 5, 0, SEN(kcmp), "kcmp" },
+[BASE_NR + 348] = { 3, TD, SEN(finit_module), "finit_module" },
+[BASE_NR + 349] = { 3, 0, SEN(sched_setattr), "sched_setattr" },
+[BASE_NR + 350] = { 4, 0, SEN(sched_getattr), "sched_getattr" },
+[BASE_NR + 351] = { 5, TD|TF, SEN(renameat2), "renameat2" },
+[BASE_NR + 352] = { 3, 0, SEN(seccomp), "seccomp" },
+[BASE_NR + 353] = { 3, 0, SEN(getrandom), "getrandom" },
+[BASE_NR + 354] = { 2, TD, SEN(memfd_create), "memfd_create" },
+[BASE_NR + 355] = { 3, TD, SEN(bpf), "bpf" },
+[BASE_NR + 356] = { 5, TD|TF|TP|TSD|SE|SI, SEN(execveat), "execveat" },
+[BASE_NR + 357] = { 1, TD, SEN(userfaultfd), "userfaultfd" },
+[BASE_NR + 358] = { 3, 0, SEN(membarrier), "membarrier" },
+[BASE_NR + 359] = { 3, TM, SEN(mlock2), "mlock2" },
+[BASE_NR + 360] = { 6, TD, SEN(copy_file_range), "copy_file_range" },
+[BASE_NR + 361] = { 6, TD, SEN(preadv2), "preadv2" },
+[BASE_NR + 362] = { 6, TD, SEN(pwritev2), "pwritev2" },
+[BASE_NR + 363] = { 4, TM|SI, SEN(pkey_mprotect), "pkey_mprotect" },
+[BASE_NR + 364] = { 2, 0, SEN(pkey_alloc), "pkey_alloc" },
+[BASE_NR + 365] = { 1, 0, SEN(pkey_free), "pkey_free" },
+[BASE_NR + 366] = { 5, TD|TF|TFST|TSTA,SEN(statx), "statx" },
+[BASE_NR + 367] = { 4, 0, SEN(rseq), "rseq" },
+[BASE_NR + 368] = { 6, 0, SEN(io_pgetevents_time32), "io_pgetevents" },
+/* room for arch specific calls */
+[BASE_NR + 393] = { 3, TI, SEN(semget), "semget" },
+[BASE_NR + 394] = { 4, TI, SEN(semctl), "semctl" },
+[BASE_NR + 395] = { 3, TI, SEN(shmget), "shmget" },
+[BASE_NR + 396] = { 3, TI, SEN(shmctl), "shmctl" },
+[BASE_NR + 397] = { 3, TI|TM|SI, SEN(shmat), "shmat" },
+[BASE_NR + 398] = { 1, TI|TM|SI, SEN(shmdt), "shmdt" },
+[BASE_NR + 399] = { 2, TI, SEN(msgget), "msgget" },
+[BASE_NR + 400] = { 4, TI, SEN(msgsnd), "msgsnd" },
+[BASE_NR + 401] = { 5, TI, SEN(msgrcv), "msgrcv" },
+[BASE_NR + 402] = { 3, TI, SEN(msgctl), "msgctl" },
+# include "syscallent-common-32.h"
+# include "syscallent-common.h"
+
+# define SYS_socket_subcall 4500
+# include "subcall32.h"
+
+#else
+
+# define SYSCALL_NAME_PREFIX "o32:"
+# include "syscallent-o32-stub.h"
+# include "syscallent-common-32-stub.h"
+# include "syscallent-common-stub.h"
+# undef SYSCALL_NAME_PREFIX
+
+#endif
+#undef BASE_NR
diff --git a/src/linux/mips/syscallent.h b/src/linux/mips/syscallent.h
new file mode 100644
index 000000000..61430d215
--- /dev/null
+++ b/src/linux/mips/syscallent.h
@@ -0,0 +1,5 @@
+#include "../dummy.h"
+#include "syscallent-compat.h"
+#include "syscallent-o32.h"
+#include "syscallent-n64.h"
+#include "syscallent-n32.h"
diff --git a/src/linux/mips/userent.h b/src/linux/mips/userent.h
new file mode 100644
index 000000000..77cf50da3
--- /dev/null
+++ b/src/linux/mips/userent.h
@@ -0,0 +1,90 @@
+/*
+ * Copyright (c) 2014-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+{ 0, "r0" },
+{ 1, "r1" },
+{ 2, "r2" },
+{ 3, "r3" },
+{ 4, "r4" },
+{ 5, "r5" },
+{ 6, "r6" },
+{ 7, "r7" },
+{ 8, "r8" },
+{ 9, "r9" },
+{ 10, "r10" },
+{ 11, "r11" },
+{ 12, "r12" },
+{ 13, "r13" },
+{ 14, "r14" },
+{ 15, "r15" },
+{ 16, "r16" },
+{ 17, "r17" },
+{ 18, "r18" },
+{ 19, "r19" },
+{ 20, "r20" },
+{ 21, "r21" },
+{ 22, "r22" },
+{ 23, "r23" },
+{ 24, "r24" },
+{ 25, "r25" },
+{ 26, "r26" },
+{ 27, "r27" },
+{ 28, "r28" },
+{ 29, "r29" },
+{ 30, "r30" },
+{ 31, "r31" },
+{ 32, "f0" },
+{ 33, "f1" },
+{ 34, "f2" },
+{ 35, "f3" },
+{ 36, "f4" },
+{ 37, "f5" },
+{ 38, "f6" },
+{ 39, "f7" },
+{ 40, "f8" },
+{ 41, "f9" },
+{ 42, "f10" },
+{ 43, "f11" },
+{ 44, "f12" },
+{ 45, "f13" },
+{ 46, "f14" },
+{ 47, "f15" },
+{ 48, "f16" },
+{ 49, "f17" },
+{ 50, "f18" },
+{ 51, "f19" },
+{ 52, "f20" },
+{ 53, "f21" },
+{ 54, "f22" },
+{ 55, "f23" },
+{ 56, "f24" },
+{ 57, "f25" },
+{ 58, "f26" },
+{ 59, "f27" },
+{ 60, "f28" },
+{ 61, "f29" },
+{ 62, "f30" },
+{ 63, "f31" },
+{ 64, "pc" },
+{ 65, "cause" },
+{ 66, "badvaddr" },
+{ 67, "mmhi" },
+{ 68, "mmlo" },
+{ 69, "fpcsr" },
+{ 70, "fpeir" },
+/* Other fields in "struct user" */
+XLAT_UOFF(u_tsize),
+XLAT_UOFF(u_dsize),
+XLAT_UOFF(u_ssize),
+XLAT_UOFF(start_code),
+XLAT_UOFF(start_data),
+XLAT_UOFF(start_stack),
+XLAT_UOFF(signal),
+XLAT_UOFF(u_ar0),
+XLAT_UOFF(magic),
+XLAT_UOFF(u_comm),
+#include "../userent0.h"
diff --git a/src/linux/netlink_diag.h b/src/linux/netlink_diag.h
new file mode 100644
index 000000000..02ea34242
--- /dev/null
+++ b/src/linux/netlink_diag.h
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2016-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_LINUX_NETLINK_DIAG_H
+# define STRACE_LINUX_NETLINK_DIAG_H
+
+struct netlink_diag_req {
+ uint8_t sdiag_family;
+ uint8_t sdiag_protocol;
+ uint16_t pad;
+ uint32_t ndiag_ino;
+ uint32_t ndiag_show;
+ uint32_t ndiag_cookie[2];
+};
+
+struct netlink_diag_msg {
+ uint8_t ndiag_family;
+ uint8_t ndiag_type;
+ uint8_t ndiag_protocol;
+ uint8_t ndiag_state;
+
+ uint32_t ndiag_portid;
+ uint32_t ndiag_dst_portid;
+ uint32_t ndiag_dst_group;
+ uint32_t ndiag_ino;
+ uint32_t ndiag_cookie[2];
+};
+
+struct netlink_diag_ring {
+ uint32_t ndr_block_size;
+ uint32_t ndr_block_nr;
+ uint32_t ndr_frame_size;
+ uint32_t ndr_frame_nr;
+};
+
+enum {
+ NETLINK_DIAG_MEMINFO,
+ NETLINK_DIAG_GROUPS,
+ NETLINK_DIAG_RX_RING,
+ NETLINK_DIAG_TX_RING,
+ NETLINK_DIAG_FLAGS,
+};
+
+# define NDIAG_SHOW_MEMINFO 0x00000001
+# define NDIAG_SHOW_GROUPS 0x00000002
+# define NDIAG_SHOW_RING_CFG 0x00000004 /* deprecated since 4.6 */
+# define NDIAG_SHOW_FLAGS 0x00000008
+# define NDIAG_PROTO_ALL ((uint8_t) ~0)
+
+/* flags */
+# define NDIAG_FLAG_CB_RUNNING 0x00000001
+# define NDIAG_FLAG_PKTINFO 0x00000002
+# define NDIAG_FLAG_BROADCAST_ERROR 0x00000004
+# define NDIAG_FLAG_NO_ENOBUFS 0x00000008
+# define NDIAG_FLAG_LISTEN_ALL_NSID 0x00000010
+# define NDIAG_FLAG_CAP_ACK 0x00000020
+
+#endif /* !STRACE_LINUX_NETLINK_DIAG_H */
diff --git a/src/linux/nios2/arch_defs_.h b/src/linux/nios2/arch_defs_.h
new file mode 100644
index 000000000..9c778e248
--- /dev/null
+++ b/src/linux/nios2/arch_defs_.h
@@ -0,0 +1,8 @@
+/*
+ * Copyright (c) 2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#define HAVE_ARCH_DEDICATED_ERR_REG 1
diff --git a/src/linux/nios2/arch_regs.c b/src/linux/nios2/arch_regs.c
new file mode 100644
index 000000000..3c28e6208
--- /dev/null
+++ b/src/linux/nios2/arch_regs.c
@@ -0,0 +1,11 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static struct user_pt_regs nios2_regs;
+#define ARCH_REGS_FOR_GETREGSET nios2_regs
+#define ARCH_PC_REG nios2_regs.regs[PTR_EA]
+#define ARCH_SP_REG nios2_regs.regs[PTR_SP]
diff --git a/src/linux/nios2/get_error.c b/src/linux/nios2/get_error.c
new file mode 100644
index 000000000..d202abd9c
--- /dev/null
+++ b/src/linux/nios2/get_error.c
@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static void
+arch_get_error(struct tcb *tcp, const bool check_errno)
+{
+ /*
+ * The system call convention specifies that r2 contains the return
+ * value on success or a positive error number on failure. A flag
+ * indicating successful completion is written to r7; r7=0 indicates
+ * the system call success, r7=1 indicates an error. The positive
+ * errno value written in r2.
+ */
+ if (nios2_regs.regs[7]) {
+ tcp->u_rval = -1;
+ tcp->u_error = nios2_regs.regs[2];
+ } else {
+ tcp->u_rval = nios2_regs.regs[2];
+ }
+}
diff --git a/src/linux/nios2/get_scno.c b/src/linux/nios2/get_scno.c
new file mode 100644
index 000000000..cc0bd06d0
--- /dev/null
+++ b/src/linux/nios2/get_scno.c
@@ -0,0 +1,14 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+/* Return codes: 1 - ok, 0 - ignore, other - error. */
+static int
+arch_get_scno(struct tcb *tcp)
+{
+ tcp->scno = nios2_regs.regs[2];
+ return 1;
+}
diff --git a/src/linux/nios2/get_syscall_args.c b/src/linux/nios2/get_syscall_args.c
new file mode 100644
index 000000000..1e42fcd75
--- /dev/null
+++ b/src/linux/nios2/get_syscall_args.c
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+/* Return -1 on error or 1 on success (never 0!). */
+static int
+arch_get_syscall_args(struct tcb *tcp)
+{
+ tcp->u_arg[0] = nios2_regs.regs[4];
+ tcp->u_arg[1] = nios2_regs.regs[5];
+ tcp->u_arg[2] = nios2_regs.regs[6];
+ tcp->u_arg[3] = nios2_regs.regs[7];
+ tcp->u_arg[4] = nios2_regs.regs[8];
+ tcp->u_arg[5] = nios2_regs.regs[9];
+ return 1;
+}
diff --git a/src/linux/nios2/ioctls_arch0.h b/src/linux/nios2/ioctls_arch0.h
new file mode 100644
index 000000000..f015def48
--- /dev/null
+++ b/src/linux/nios2/ioctls_arch0.h
@@ -0,0 +1 @@
+/* Generated by ioctls_gen.sh from definitions found in $linux/arch/nios2/include/ tree. */
diff --git a/src/linux/nios2/ioctls_inc0.h b/src/linux/nios2/ioctls_inc0.h
new file mode 100644
index 000000000..4aecf983e
--- /dev/null
+++ b/src/linux/nios2/ioctls_inc0.h
@@ -0,0 +1 @@
+#include "32/ioctls_inc.h"
diff --git a/src/linux/nios2/raw_syscall.h b/src/linux/nios2/raw_syscall.h
new file mode 100644
index 000000000..02f6e7ee7
--- /dev/null
+++ b/src/linux/nios2/raw_syscall.h
@@ -0,0 +1,29 @@
+/*
+ * Raw syscalls.
+ *
+ * Copyright (c) 2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_RAW_SYSCALL_H
+# define STRACE_RAW_SYSCALL_H
+
+# include "kernel_types.h"
+
+static inline kernel_ulong_t
+raw_syscall_0(const kernel_ulong_t nr, kernel_ulong_t *err)
+{
+ register kernel_ulong_t r2 __asm__("r2") = nr;
+ register kernel_ulong_t r7 __asm__("r7");
+ __asm__ __volatile__("trap"
+ : "+r"(r2), "=r"(r7)
+ :
+ : "memory");
+ *err = r7;
+ return r2;
+}
+# define raw_syscall_0 raw_syscall_0
+
+#endif /* !STRACE_RAW_SYSCALL_H */
diff --git a/src/linux/nios2/set_error.c b/src/linux/nios2/set_error.c
new file mode 100644
index 000000000..61fc03003
--- /dev/null
+++ b/src/linux/nios2/set_error.c
@@ -0,0 +1,22 @@
+/*
+ * Copyright (c) 2016-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static int
+arch_set_error(struct tcb *tcp)
+{
+ nios2_regs.regs[7] = 1;
+ nios2_regs.regs[2] = -tcp->u_error;
+ return set_regs(tcp->pid);
+}
+
+static int
+arch_set_success(struct tcb *tcp)
+{
+ nios2_regs.regs[7] = 0;
+ nios2_regs.regs[2] = tcp->u_rval;
+ return set_regs(tcp->pid);
+}
diff --git a/src/linux/nios2/set_scno.c b/src/linux/nios2/set_scno.c
new file mode 100644
index 000000000..ae1b196fa
--- /dev/null
+++ b/src/linux/nios2/set_scno.c
@@ -0,0 +1,15 @@
+/*
+ * Copyright (c) 2016-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static int
+arch_set_scno(struct tcb *tcp, kernel_ulong_t scno)
+{
+ if (ptrace_syscall_info_is_valid() && get_regs(tcp) < 0)
+ return -1;
+ nios2_regs.regs[2] = scno;
+ return set_regs(tcp->pid);
+}
diff --git a/src/linux/nios2/syscallent.h b/src/linux/nios2/syscallent.h
new file mode 100644
index 000000000..31431cf0d
--- /dev/null
+++ b/src/linux/nios2/syscallent.h
@@ -0,0 +1,11 @@
+/*
+ * Copyright (c) 2014-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#define sys_ARCH_mmap sys_mmap_pgoff
+#include "32/syscallent.h"
+/* [244 ... 259] are arch specific */
+[244] = {4, 0, SEN(cacheflush), "cacheflush"},
diff --git a/src/linux/nr_prefix.c b/src/linux/nr_prefix.c
new file mode 100644
index 000000000..3b3d2d4ef
--- /dev/null
+++ b/src/linux/nr_prefix.c
@@ -0,0 +1,18 @@
+/*
+ * Copyright (c) 2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+/**
+ * Returns prefix for a syscall constant literal. It is has to be that way
+ * thanks to ARM that decided to prefix their special system calls like sys32
+ * and sys26 with __ARM_NR_* prefix instead of __NR_*, so we can't simply print
+ * "__NR_".
+ */
+static inline const char *
+nr_prefix(kernel_ulong_t scno)
+{
+ return "__NR_";
+}
diff --git a/src/linux/or1k/arch_regs.c b/src/linux/or1k/arch_regs.c
new file mode 100644
index 000000000..196419dfc
--- /dev/null
+++ b/src/linux/or1k/arch_regs.c
@@ -0,0 +1,11 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static struct user_regs_struct or1k_regs;
+#define ARCH_REGS_FOR_GETREGSET or1k_regs
+#define ARCH_PC_REG or1k_regs.pc
+#define ARCH_SP_REG or1k_regs.gpr[1]
diff --git a/src/linux/or1k/get_error.c b/src/linux/or1k/get_error.c
new file mode 100644
index 000000000..e551f13f5
--- /dev/null
+++ b/src/linux/or1k/get_error.c
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "negated_errno.h"
+
+static void
+arch_get_error(struct tcb *tcp, const bool check_errno)
+{
+ if (check_errno && is_negated_errno(or1k_regs.gpr[11])) {
+ tcp->u_rval = -1;
+ tcp->u_error = -or1k_regs.gpr[11];
+ } else {
+ tcp->u_rval = or1k_regs.gpr[11];
+ }
+}
diff --git a/src/linux/or1k/get_scno.c b/src/linux/or1k/get_scno.c
new file mode 100644
index 000000000..f997abd4e
--- /dev/null
+++ b/src/linux/or1k/get_scno.c
@@ -0,0 +1,14 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+/* Return codes: 1 - ok, 0 - ignore, other - error. */
+static int
+arch_get_scno(struct tcb *tcp)
+{
+ tcp->scno = or1k_regs.gpr[11];
+ return 1;
+}
diff --git a/src/linux/or1k/get_syscall_args.c b/src/linux/or1k/get_syscall_args.c
new file mode 100644
index 000000000..f06d0a886
--- /dev/null
+++ b/src/linux/or1k/get_syscall_args.c
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+/* Return -1 on error or 1 on success (never 0!). */
+static int
+arch_get_syscall_args(struct tcb *tcp)
+{
+ tcp->u_arg[0] = or1k_regs.gpr[3 + 0];
+ tcp->u_arg[1] = or1k_regs.gpr[3 + 1];
+ tcp->u_arg[2] = or1k_regs.gpr[3 + 2];
+ tcp->u_arg[3] = or1k_regs.gpr[3 + 3];
+ tcp->u_arg[4] = or1k_regs.gpr[3 + 4];
+ tcp->u_arg[5] = or1k_regs.gpr[3 + 5];
+ return 1;
+}
diff --git a/src/linux/or1k/ioctls_arch0.h b/src/linux/or1k/ioctls_arch0.h
new file mode 100644
index 000000000..5950cbeca
--- /dev/null
+++ b/src/linux/or1k/ioctls_arch0.h
@@ -0,0 +1 @@
+/* Generated by ioctls_gen.sh from definitions found in $linux/arch/openrisc/include/ tree. */
diff --git a/src/linux/or1k/ioctls_inc0.h b/src/linux/or1k/ioctls_inc0.h
new file mode 100644
index 000000000..4aecf983e
--- /dev/null
+++ b/src/linux/or1k/ioctls_inc0.h
@@ -0,0 +1 @@
+#include "32/ioctls_inc.h"
diff --git a/src/linux/or1k/raw_syscall.h b/src/linux/or1k/raw_syscall.h
new file mode 100644
index 000000000..e31df27e8
--- /dev/null
+++ b/src/linux/or1k/raw_syscall.h
@@ -0,0 +1,30 @@
+/*
+ * Raw syscalls.
+ *
+ * Copyright (c) 2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_RAW_SYSCALL_H
+# define STRACE_RAW_SYSCALL_H
+
+# include "kernel_types.h"
+
+static inline kernel_ulong_t
+raw_syscall_0(const kernel_ulong_t nr, kernel_ulong_t *err)
+{
+ *err = 0;
+ register kernel_ulong_t r11 __asm__("r11") = nr;
+ __asm__ __volatile__("l.sys 1"
+ : "+r"(r11)
+ :
+ : "memory", "r3", "r4", "r5", "r6", "r7", "r8",
+ "r12", "r13", "r15", "r17", "r19", "r21",
+ "r23", "r25", "r27", "r29", "r31");
+ return r11;
+}
+# define raw_syscall_0 raw_syscall_0
+
+#endif /* !STRACE_RAW_SYSCALL_H */
diff --git a/src/linux/or1k/set_error.c b/src/linux/or1k/set_error.c
new file mode 100644
index 000000000..b5cb7016f
--- /dev/null
+++ b/src/linux/or1k/set_error.c
@@ -0,0 +1,20 @@
+/*
+ * Copyright (c) 2016-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static int
+arch_set_error(struct tcb *tcp)
+{
+ or1k_regs.gpr[11] = -tcp->u_error;
+ return set_regs(tcp->pid);
+}
+
+static int
+arch_set_success(struct tcb *tcp)
+{
+ or1k_regs.gpr[11] = tcp->u_rval;
+ return set_regs(tcp->pid);
+}
diff --git a/src/linux/or1k/set_scno.c b/src/linux/or1k/set_scno.c
new file mode 100644
index 000000000..853364acd
--- /dev/null
+++ b/src/linux/or1k/set_scno.c
@@ -0,0 +1,15 @@
+/*
+ * Copyright (c) 2016-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static int
+arch_set_scno(struct tcb *tcp, kernel_ulong_t scno)
+{
+ if (ptrace_syscall_info_is_valid() && get_regs(tcp) < 0)
+ return -1;
+ or1k_regs.gpr[11] = scno;
+ return set_regs(tcp->pid);
+}
diff --git a/src/linux/or1k/syscallent.h b/src/linux/or1k/syscallent.h
new file mode 100644
index 000000000..ac339463a
--- /dev/null
+++ b/src/linux/or1k/syscallent.h
@@ -0,0 +1,11 @@
+/*
+ * Copyright (c) 2013-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#define sys_ARCH_mmap sys_mmap_pgoff
+#include "32/syscallent.h"
+/* [244 ... 259] are arch specific */
+[244] = { 3, NF, SEN(or1k_atomic), "or1k_atomic" },
diff --git a/src/linux/or1k/userent.h b/src/linux/or1k/userent.h
new file mode 100644
index 000000000..056d1009e
--- /dev/null
+++ b/src/linux/or1k/userent.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2014-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+{ 4*0, "r0" },
+{ 4*1, "r1" },
+{ 4*2, "r2" },
+{ 4*3, "r3" },
+{ 4*4, "r4" },
+{ 4*5, "r5" },
+{ 4*6, "r6" },
+{ 4*7, "r7" },
+{ 4*8, "r8" },
+{ 4*9, "r9" },
+{ 4*10, "r10" },
+{ 4*11, "r11" },
+{ 4*12, "r12" },
+{ 4*13, "r13" },
+{ 4*14, "r14" },
+{ 4*15, "r15" },
+{ 4*16, "r16" },
+{ 4*17, "r17" },
+{ 4*18, "r18" },
+{ 4*19, "r19" },
+{ 4*20, "r20" },
+{ 4*21, "r21" },
+{ 4*22, "r22" },
+{ 4*23, "r23" },
+{ 4*24, "r24" },
+{ 4*25, "r25" },
+{ 4*26, "r26" },
+{ 4*27, "r27" },
+{ 4*28, "r28" },
+{ 4*29, "r29" },
+{ 4*30, "r30" },
+{ 4*31, "r31" },
+{ 4*32, "pc" },
+{ 4*33, "sr" },
diff --git a/src/linux/packet_diag.h b/src/linux/packet_diag.h
new file mode 100644
index 000000000..0efb76752
--- /dev/null
+++ b/src/linux/packet_diag.h
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2017-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_LINUX_PACKET_DIAG_H
+# define STRACE_LINUX_PACKET_DIAG_H
+
+struct packet_diag_req {
+ uint8_t sdiag_family;
+ uint8_t sdiag_protocol;
+ uint16_t pad;
+ uint32_t pdiag_ino;
+ uint32_t pdiag_show;
+ uint32_t pdiag_cookie[2];
+};
+
+# define PACKET_SHOW_INFO 0x00000001
+# define PACKET_SHOW_MCLIST 0x00000002
+# define PACKET_SHOW_RING_CFG 0x00000004
+# define PACKET_SHOW_FANOUT 0x00000008
+# define PACKET_SHOW_MEMINFO 0x00000010
+# define PACKET_SHOW_FILTER 0x00000020
+
+struct packet_diag_msg {
+ uint8_t pdiag_family;
+ uint8_t pdiag_type;
+ uint16_t pdiag_num;
+
+ uint32_t pdiag_ino;
+ uint32_t pdiag_cookie[2];
+};
+
+enum {
+ PACKET_DIAG_INFO,
+ PACKET_DIAG_MCLIST,
+ PACKET_DIAG_RX_RING,
+ PACKET_DIAG_TX_RING,
+ PACKET_DIAG_FANOUT,
+ PACKET_DIAG_UID,
+ PACKET_DIAG_MEMINFO,
+ PACKET_DIAG_FILTER,
+};
+
+struct packet_diag_info {
+ uint32_t pdi_index;
+ uint32_t pdi_version;
+ uint32_t pdi_reserve;
+ uint32_t pdi_copy_thresh;
+ uint32_t pdi_tstamp;
+ uint32_t pdi_flags;
+
+# define PDI_RUNNING 0x1
+# define PDI_AUXDATA 0x2
+# define PDI_ORIGDEV 0x4
+# define PDI_VNETHDR 0x8
+# define PDI_LOSS 0x10
+};
+
+struct packet_diag_mclist {
+ uint32_t pdmc_index;
+ uint32_t pdmc_count;
+ uint16_t pdmc_type;
+ uint16_t pdmc_alen;
+ uint8_t pdmc_addr[32]; /* MAX_ADDR_LEN */
+};
+
+struct packet_diag_ring {
+ uint32_t pdr_block_size;
+ uint32_t pdr_block_nr;
+ uint32_t pdr_frame_size;
+ uint32_t pdr_frame_nr;
+ uint32_t pdr_retire_tmo;
+ uint32_t pdr_sizeof_priv;
+ uint32_t pdr_features;
+};
+
+#endif /* !STRACE_LINUX_PACKET_DIAG_H */
diff --git a/src/linux/powerpc/arch_defs_.h b/src/linux/powerpc/arch_defs_.h
new file mode 100644
index 000000000..310337129
--- /dev/null
+++ b/src/linux/powerpc/arch_defs_.h
@@ -0,0 +1,10 @@
+/*
+ * Copyright (c) 2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#define HAVE_ARCH_OLD_SELECT 1
+#define HAVE_ARCH_DEDICATED_ERR_REG 1
+#define CAN_ARCH_BE_COMPAT_ON_64BIT_KERNEL 1
diff --git a/src/linux/powerpc/arch_regs.c b/src/linux/powerpc/arch_regs.c
new file mode 100644
index 000000000..f9d0de596
--- /dev/null
+++ b/src/linux/powerpc/arch_regs.c
@@ -0,0 +1,15 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static struct pt_regs ppc_regs;
+
+#define ARCH_REGS_FOR_GETREGS ppc_regs
+#define ARCH_PC_REG ppc_regs.nip
+#define ARCH_SP_REG ppc_regs.gpr[1]
+
+#undef ARCH_MIGHT_USE_SET_REGS
+#define ARCH_MIGHT_USE_SET_REGS 0
diff --git a/src/linux/powerpc/arch_rt_sigframe.c b/src/linux/powerpc/arch_rt_sigframe.c
new file mode 100644
index 000000000..4fdad4810
--- /dev/null
+++ b/src/linux/powerpc/arch_rt_sigframe.c
@@ -0,0 +1,14 @@
+/*
+ * Copyright (c) 2017-2018 Dmitry V. Levin <ldv@strace.io>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#define SIGNAL_FRAMESIZE32 64
+
+FUNC_GET_RT_SIGFRAME_ADDR
+{
+ kernel_ulong_t sp;
+ return get_stack_pointer(tcp, &sp) ? sp + SIGNAL_FRAMESIZE32 + 16 : 0;
+}
diff --git a/src/linux/powerpc/arch_sigreturn.c b/src/linux/powerpc/arch_sigreturn.c
new file mode 100644
index 000000000..0926e4faf
--- /dev/null
+++ b/src/linux/powerpc/arch_sigreturn.c
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static void
+arch_sigreturn(struct tcb *tcp)
+{
+ kernel_ulong_t addr;
+ if (!get_stack_pointer(tcp, &addr))
+ return;
+
+ /* Skip dummy stack frame. */
+ addr += 64;
+
+#ifdef POWERPC64
+ /* The only sigreturn on ppc64 is compat_sys_sigreturn. */
+ typedef struct {
+ unsigned int _unused[4];
+ int signal;
+ unsigned int handler;
+ unsigned int oldmask;
+ /* all the rest is irrelevant */
+ } sigreturn_context;
+#else
+ typedef struct sigcontext sigreturn_context;
+#endif
+
+ sigreturn_context sc;
+
+ if (!umove_or_printaddr(tcp, addr, &sc)) {
+ const unsigned int mask[NSIG_BYTES / sizeof(int)] = {
+ sc.oldmask,
+ sc._unused[3]
+ };
+
+ tprintsigmask_addr(mask);
+ }
+}
diff --git a/src/linux/powerpc/errnoent.h b/src/linux/powerpc/errnoent.h
new file mode 100644
index 000000000..23d2111b1
--- /dev/null
+++ b/src/linux/powerpc/errnoent.h
@@ -0,0 +1,9 @@
+/*
+ * Copyright (c) 1999-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "../errnoent.h"
+[ 58] = "EDEADLOCK",
diff --git a/src/linux/powerpc/get_error.c b/src/linux/powerpc/get_error.c
new file mode 100644
index 000000000..716e8782c
--- /dev/null
+++ b/src/linux/powerpc/get_error.c
@@ -0,0 +1,17 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static void
+arch_get_error(struct tcb *tcp, const bool check_errno)
+{
+ if (ppc_regs.ccr & 0x10000000) {
+ tcp->u_rval = -1;
+ tcp->u_error = ppc_regs.gpr[3];
+ } else {
+ tcp->u_rval = ppc_regs.gpr[3];
+ }
+}
diff --git a/src/linux/powerpc/get_scno.c b/src/linux/powerpc/get_scno.c
new file mode 100644
index 000000000..6624614ad
--- /dev/null
+++ b/src/linux/powerpc/get_scno.c
@@ -0,0 +1,14 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+/* Return codes: 1 - ok, 0 - ignore, other - error. */
+static int
+arch_get_scno(struct tcb *tcp)
+{
+ tcp->scno = ppc_regs.gpr[0];
+ return 1;
+}
diff --git a/src/linux/powerpc/get_syscall_args.c b/src/linux/powerpc/get_syscall_args.c
new file mode 100644
index 000000000..823d7839d
--- /dev/null
+++ b/src/linux/powerpc/get_syscall_args.c
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+/* Return -1 on error or 1 on success (never 0!). */
+static int
+arch_get_syscall_args(struct tcb *tcp)
+{
+ if (current_personality != 0) {
+ /*
+ * Zero-extend from 32 bits.
+ * Use truncate_klong_to_current_wordsize(tcp->u_arg[N])
+ * in syscall handlers
+ * if you need to use *sign-extended* parameter.
+ */
+ tcp->u_arg[0] = (uint32_t) ppc_regs.orig_gpr3;
+ tcp->u_arg[1] = (uint32_t) ppc_regs.gpr[4];
+ tcp->u_arg[2] = (uint32_t) ppc_regs.gpr[5];
+ tcp->u_arg[3] = (uint32_t) ppc_regs.gpr[6];
+ tcp->u_arg[4] = (uint32_t) ppc_regs.gpr[7];
+ tcp->u_arg[5] = (uint32_t) ppc_regs.gpr[8];
+ } else {
+ tcp->u_arg[0] = ppc_regs.orig_gpr3;
+ tcp->u_arg[1] = ppc_regs.gpr[4];
+ tcp->u_arg[2] = ppc_regs.gpr[5];
+ tcp->u_arg[3] = ppc_regs.gpr[6];
+ tcp->u_arg[4] = ppc_regs.gpr[7];
+ tcp->u_arg[5] = ppc_regs.gpr[8];
+ }
+ return 1;
+}
diff --git a/src/linux/powerpc/getregs_old.c b/src/linux/powerpc/getregs_old.c
new file mode 100644
index 000000000..7edb796f2
--- /dev/null
+++ b/src/linux/powerpc/getregs_old.c
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+/*
+ * PTRACE_GETREGS was added to the PowerPC kernel in v2.6.23,
+ * we provide a slow fallback for old kernels.
+ */
+static int
+getregs_old(struct tcb *tcp)
+{
+ int i;
+ long r;
+
+ if (iflag) {
+ r = upeek(tcp, sizeof(long) * PT_NIP, &ppc_regs.nip);
+ if (r)
+ goto out;
+ }
+#ifdef POWERPC64 /* else we never use it */
+ r = upeek(tcp, sizeof(long) * PT_MSR, &ppc_regs.msr);
+ if (r)
+ goto out;
+#endif
+ r = upeek(tcp, sizeof(long) * PT_CCR, &ppc_regs.ccr);
+ if (r)
+ goto out;
+ r = upeek(tcp, sizeof(long) * PT_ORIG_R3, &ppc_regs.orig_gpr3);
+ if (r)
+ goto out;
+ for (i = 0; i <= 8; i++) {
+ r = upeek(tcp, sizeof(long) * (PT_R0 + i),
+ &ppc_regs.gpr[i]);
+ if (r)
+ goto out;
+ }
+ out:
+ return r;
+}
diff --git a/src/linux/powerpc/getregs_old.h b/src/linux/powerpc/getregs_old.h
new file mode 100644
index 000000000..31388e27d
--- /dev/null
+++ b/src/linux/powerpc/getregs_old.h
@@ -0,0 +1 @@
+#include "x86_64/getregs_old.h"
diff --git a/src/linux/powerpc/ioctls_arch0.h b/src/linux/powerpc/ioctls_arch0.h
new file mode 100644
index 000000000..c52552429
--- /dev/null
+++ b/src/linux/powerpc/ioctls_arch0.h
@@ -0,0 +1,175 @@
+/* Generated by ioctls_gen.sh from definitions found in $linux/arch/powerpc/include/ tree. */
+{ "asm/ioctls.h", "FIOASYNC", _IOC_WRITE, 0x667d, 0x04 },
+{ "asm/ioctls.h", "FIOCLEX", _IOC_NONE, 0x6601, 0x00 },
+{ "asm/ioctls.h", "FIONBIO", _IOC_WRITE, 0x667e, 0x04 },
+{ "asm/ioctls.h", "FIONCLEX", _IOC_NONE, 0x6602, 0x00 },
+{ "asm/ioctls.h", "FIONREAD", _IOC_READ, 0x667f, 0x04 },
+{ "asm/ioctls.h", "FIOQSIZE", _IOC_READ, 0x6680, 0x08 },
+{ "asm/ioctls.h", "TCFLSH", _IOC_NONE, 0x741f, 0x00 },
+{ "asm/ioctls.h", "TCGETA", _IOC_READ, 0x7417, 0x14 },
+{ "asm/ioctls.h", "TCGETS", _IOC_READ, 0x7413, 0x2c },
+{ "asm/ioctls.h", "TCSBRK", _IOC_NONE, 0x741d, 0x00 },
+{ "asm/ioctls.h", "TCSBRKP", 0, 0x5425, 0 },
+{ "asm/ioctls.h", "TCSETA", _IOC_WRITE, 0x7418, 0x14 },
+{ "asm/ioctls.h", "TCSETAF", _IOC_WRITE, 0x741c, 0x14 },
+{ "asm/ioctls.h", "TCSETAW", _IOC_WRITE, 0x7419, 0x14 },
+{ "asm/ioctls.h", "TCSETS", _IOC_WRITE, 0x7414, 0x2c },
+{ "asm/ioctls.h", "TCSETSF", _IOC_WRITE, 0x7416, 0x2c },
+{ "asm/ioctls.h", "TCSETSW", _IOC_WRITE, 0x7415, 0x2c },
+{ "asm/ioctls.h", "TCXONC", _IOC_NONE, 0x741e, 0x00 },
+{ "asm/ioctls.h", "TIOCCBRK", 0, 0x5428, 0 },
+{ "asm/ioctls.h", "TIOCCONS", 0, 0x541D, 0 },
+{ "asm/ioctls.h", "TIOCEXCL", 0, 0x540C, 0 },
+{ "asm/ioctls.h", "TIOCGDEV", _IOC_READ, 0x5432, 0x04 },
+{ "asm/ioctls.h", "TIOCGETC", _IOC_READ, 0x7412, 0x06 },
+{ "asm/ioctls.h", "TIOCGETD", 0, 0x5424, 0 },
+{ "asm/ioctls.h", "TIOCGETP", _IOC_READ, 0x7408, 0x06 },
+{ "asm/ioctls.h", "TIOCGEXCL", _IOC_READ, 0x5440, 0x04 },
+{ "asm/ioctls.h", "TIOCGICOUNT", 0, 0x545D, 0 },
+{ "asm/ioctls.h", "TIOCGISO7816", _IOC_READ, 0x5442, 0x28 },
+{ "asm/ioctls.h", "TIOCGLCKTRMIOS", 0, 0x5456, 0 },
+{ "asm/ioctls.h", "TIOCGLTC", _IOC_READ, 0x7474, 0x06 },
+{ "asm/ioctls.h", "TIOCGPGRP", _IOC_READ, 0x7477, 0x04 },
+{ "asm/ioctls.h", "TIOCGPKT", _IOC_READ, 0x5438, 0x04 },
+{ "asm/ioctls.h", "TIOCGPTLCK", _IOC_READ, 0x5439, 0x04 },
+{ "asm/ioctls.h", "TIOCGPTN", _IOC_READ, 0x5430, 0x04 },
+{ "asm/ioctls.h", "TIOCGPTPEER", _IOC_NONE, 0x5441, 0x00 },
+{ "asm/ioctls.h", "TIOCGRS485", 0, 0x542e, 0 },
+{ "asm/ioctls.h", "TIOCGSERIAL", 0, 0x541E, 0 },
+{ "asm/ioctls.h", "TIOCGSID", 0, 0x5429, 0 },
+{ "asm/ioctls.h", "TIOCGSOFTCAR", 0, 0x5419, 0 },
+{ "asm/ioctls.h", "TIOCGWINSZ", _IOC_READ, 0x7468, 0x08 },
+{ "asm/ioctls.h", "TIOCLINUX", 0, 0x541C, 0 },
+{ "asm/ioctls.h", "TIOCMBIC", 0, 0x5417, 0 },
+{ "asm/ioctls.h", "TIOCMBIS", 0, 0x5416, 0 },
+{ "asm/ioctls.h", "TIOCMGET", 0, 0x5415, 0 },
+{ "asm/ioctls.h", "TIOCMIWAIT", 0, 0x545C, 0 },
+{ "asm/ioctls.h", "TIOCMSET", 0, 0x5418, 0 },
+{ "asm/ioctls.h", "TIOCNOTTY", 0, 0x5422, 0 },
+{ "asm/ioctls.h", "TIOCNXCL", 0, 0x540D, 0 },
+{ "asm/ioctls.h", "TIOCOUTQ", _IOC_READ, 0x7473, 0x04 },
+{ "asm/ioctls.h", "TIOCPKT", 0, 0x5420, 0 },
+{ "asm/ioctls.h", "TIOCSBRK", 0, 0x5427, 0 },
+{ "asm/ioctls.h", "TIOCSCTTY", 0, 0x540E, 0 },
+{ "asm/ioctls.h", "TIOCSERCONFIG", 0, 0x5453, 0 },
+{ "asm/ioctls.h", "TIOCSERGETLSR", 0, 0x5459, 0 },
+{ "asm/ioctls.h", "TIOCSERGETMULTI", 0, 0x545A, 0 },
+{ "asm/ioctls.h", "TIOCSERGSTRUCT", 0, 0x5458, 0 },
+{ "asm/ioctls.h", "TIOCSERGWILD", 0, 0x5454, 0 },
+{ "asm/ioctls.h", "TIOCSERSETMULTI", 0, 0x545B, 0 },
+{ "asm/ioctls.h", "TIOCSERSWILD", 0, 0x5455, 0 },
+{ "asm/ioctls.h", "TIOCSETC", _IOC_WRITE, 0x7411, 0x06 },
+{ "asm/ioctls.h", "TIOCSETD", 0, 0x5423, 0 },
+{ "asm/ioctls.h", "TIOCSETN", _IOC_WRITE, 0x740a, 0x06 },
+{ "asm/ioctls.h", "TIOCSETP", _IOC_WRITE, 0x7409, 0x06 },
+{ "asm/ioctls.h", "TIOCSIG", _IOC_WRITE, 0x5436, 0x04 },
+{ "asm/ioctls.h", "TIOCSISO7816", _IOC_READ|_IOC_WRITE, 0x5443, 0x28 },
+{ "asm/ioctls.h", "TIOCSLCKTRMIOS", 0, 0x5457, 0 },
+{ "asm/ioctls.h", "TIOCSLTC", _IOC_WRITE, 0x7475, 0x06 },
+{ "asm/ioctls.h", "TIOCSPGRP", _IOC_WRITE, 0x7476, 0x04 },
+{ "asm/ioctls.h", "TIOCSPTLCK", _IOC_WRITE, 0x5431, 0x04 },
+{ "asm/ioctls.h", "TIOCSRS485", 0, 0x542f, 0 },
+{ "asm/ioctls.h", "TIOCSSERIAL", 0, 0x541F, 0 },
+{ "asm/ioctls.h", "TIOCSSOFTCAR", 0, 0x541A, 0 },
+{ "asm/ioctls.h", "TIOCSTART", _IOC_NONE, 0x746e, 0x00 },
+{ "asm/ioctls.h", "TIOCSTI", 0, 0x5412, 0 },
+{ "asm/ioctls.h", "TIOCSTOP", _IOC_NONE, 0x746f, 0x00 },
+{ "asm/ioctls.h", "TIOCSWINSZ", _IOC_WRITE, 0x7467, 0x08 },
+{ "asm/ioctls.h", "TIOCVHANGUP", 0, 0x5437, 0 },
+{ "asm/nvram.h", "IOC_NVRAM_GET_OFFSET", _IOC_READ|_IOC_WRITE, 0x7042, 0x04 },
+{ "asm/nvram.h", "IOC_NVRAM_SYNC", _IOC_NONE, 0x7043, 0x00 },
+{ "asm/nvram.h", "OBSOLETE_PMAC_NVRAM_GET_OFFSET", _IOC_READ|_IOC_WRITE, 0x7040, 0x04 },
+{ "asm/opal-prd.h", "OPAL_PRD_GET_INFO", _IOC_READ, 0x6f01, 0x20 },
+{ "asm/opal-prd.h", "OPAL_PRD_SCOM_READ", _IOC_READ, 0x6f02, 0x20 },
+{ "asm/opal-prd.h", "OPAL_PRD_SCOM_WRITE", _IOC_WRITE, 0x6f03, 0x20 },
+{ "asm/ps3fb.h", "FBIO_WAITFORVSYNC", _IOC_WRITE, 0x4620, 0x04 },
+{ "asm/ps3fb.h", "PS3FB_IOCTL_FSEL", _IOC_WRITE, 0x7206, 0x04 },
+{ "asm/ps3fb.h", "PS3FB_IOCTL_GETMODE", _IOC_READ, 0x7202, 0x04 },
+{ "asm/ps3fb.h", "PS3FB_IOCTL_OFF", _IOC_NONE, 0x7205, 0x00 },
+{ "asm/ps3fb.h", "PS3FB_IOCTL_ON", _IOC_NONE, 0x7204, 0x00 },
+{ "asm/ps3fb.h", "PS3FB_IOCTL_SCREENINFO", _IOC_READ, 0x7203, 0x04 },
+{ "asm/ps3fb.h", "PS3FB_IOCTL_SETMODE", _IOC_WRITE, 0x7201, 0x04 },
+{ "asm/vas-api.h", "VAS_TX_WIN_OPEN", _IOC_WRITE, 0x7620, 0x40 },
+{ "linux/kvm.h", "KVM_ALLOCATE_RMA", _IOC_READ, 0xaea9, 0x08 },
+{ "linux/kvm.h", "KVM_ASSIGN_DEV_IRQ", _IOC_WRITE, 0xae70, 0x40 },
+{ "linux/kvm.h", "KVM_ASSIGN_PCI_DEVICE", _IOC_READ, 0xae69, 0x40 },
+{ "linux/kvm.h", "KVM_ASSIGN_SET_INTX_MASK", _IOC_WRITE, 0xaea4, 0x40 },
+{ "linux/kvm.h", "KVM_ASSIGN_SET_MSIX_ENTRY", _IOC_WRITE, 0xae74, 0x10 },
+{ "linux/kvm.h", "KVM_ASSIGN_SET_MSIX_NR", _IOC_WRITE, 0xae73, 0x08 },
+{ "linux/kvm.h", "KVM_CHECK_EXTENSION", _IOC_NONE, 0xae03, 0x00 },
+{ "linux/kvm.h", "KVM_CLEAR_DIRTY_LOG", _IOC_READ|_IOC_WRITE, 0xaec0, 0x18 },
+{ "linux/kvm.h", "KVM_CREATE_DEVICE", _IOC_READ|_IOC_WRITE, 0xaee0, 0x0c },
+{ "linux/kvm.h", "KVM_CREATE_IRQCHIP", _IOC_NONE, 0xae60, 0x00 },
+{ "linux/kvm.h", "KVM_CREATE_PIT", _IOC_NONE, 0xae64, 0x00 },
+{ "linux/kvm.h", "KVM_CREATE_PIT2", _IOC_WRITE, 0xae77, 0x40 },
+{ "linux/kvm.h", "KVM_CREATE_SPAPR_TCE", _IOC_WRITE, 0xaea8, 0x10 },
+{ "linux/kvm.h", "KVM_CREATE_SPAPR_TCE_64", _IOC_WRITE, 0xaea8, 0x20 },
+{ "linux/kvm.h", "KVM_CREATE_VCPU", _IOC_NONE, 0xae41, 0x00 },
+{ "linux/kvm.h", "KVM_CREATE_VM", _IOC_NONE, 0xae01, 0x00 },
+{ "linux/kvm.h", "KVM_DEASSIGN_DEV_IRQ", _IOC_WRITE, 0xae75, 0x40 },
+{ "linux/kvm.h", "KVM_DEASSIGN_PCI_DEVICE", _IOC_WRITE, 0xae72, 0x40 },
+{ "linux/kvm.h", "KVM_DIRTY_TLB", _IOC_WRITE, 0xaeaa, 0x10 },
+{ "linux/kvm.h", "KVM_ENABLE_CAP", _IOC_WRITE, 0xaea3, 0x68 },
+{ "linux/kvm.h", "KVM_GET_API_VERSION", _IOC_NONE, 0xae00, 0x00 },
+{ "linux/kvm.h", "KVM_GET_CLOCK", _IOC_READ, 0xae7c, 0x30 },
+{ "linux/kvm.h", "KVM_GET_DEVICE_ATTR", _IOC_WRITE, 0xaee2, 0x18 },
+{ "linux/kvm.h", "KVM_GET_DIRTY_LOG", _IOC_WRITE, 0xae42, 0x10 },
+{ "linux/kvm.h", "KVM_GET_FPU", _IOC_READ, 0xae8c, 0x100 },
+{ "linux/kvm.h", "KVM_GET_IRQCHIP", _IOC_READ|_IOC_WRITE, 0xae62, 0x208 },
+{ "linux/kvm.h", "KVM_GET_MP_STATE", _IOC_READ, 0xae98, 0x04 },
+{ "linux/kvm.h", "KVM_GET_NR_MMU_PAGES", _IOC_NONE, 0xae45, 0x00 },
+{ "linux/kvm.h", "KVM_GET_ONE_REG", _IOC_WRITE, 0xaeab, 0x10 },
+{ "linux/kvm.h", "KVM_GET_REGS", _IOC_READ, 0xae81, 0x188 },
+{ "linux/kvm.h", "KVM_GET_REG_LIST", _IOC_READ|_IOC_WRITE, 0xaeb0, 0x08 },
+{ "linux/kvm.h", "KVM_GET_SREGS", _IOC_READ, 0xae83, 0x4d0 },
+{ "linux/kvm.h", "KVM_GET_TSC_KHZ", _IOC_NONE, 0xaea3, 0x00 },
+{ "linux/kvm.h", "KVM_GET_VCPU_MMAP_SIZE", _IOC_NONE, 0xae04, 0x00 },
+{ "linux/kvm.h", "KVM_HAS_DEVICE_ATTR", _IOC_WRITE, 0xaee3, 0x18 },
+{ "linux/kvm.h", "KVM_INTERRUPT", _IOC_WRITE, 0xae86, 0x04 },
+{ "linux/kvm.h", "KVM_IOEVENTFD", _IOC_WRITE, 0xae79, 0x40 },
+{ "linux/kvm.h", "KVM_IRQFD", _IOC_WRITE, 0xae76, 0x20 },
+{ "linux/kvm.h", "KVM_IRQ_LINE", _IOC_WRITE, 0xae61, 0x08 },
+{ "linux/kvm.h", "KVM_IRQ_LINE_STATUS", _IOC_READ|_IOC_WRITE, 0xae67, 0x08 },
+{ "linux/kvm.h", "KVM_KVMCLOCK_CTRL", _IOC_NONE, 0xaead, 0x00 },
+{ "linux/kvm.h", "KVM_MEMORY_ENCRYPT_OP", _IOC_READ|_IOC_WRITE, 0xaeba, 0x08 },
+{ "linux/kvm.h", "KVM_MEMORY_ENCRYPT_REG_REGION", _IOC_READ, 0xaebb, 0x10 },
+{ "linux/kvm.h", "KVM_MEMORY_ENCRYPT_UNREG_REGION", _IOC_READ, 0xaebc, 0x10 },
+{ "linux/kvm.h", "KVM_NMI", _IOC_NONE, 0xae9a, 0x00 },
+{ "linux/kvm.h", "KVM_PPC_ALLOCATE_HTAB", _IOC_READ|_IOC_WRITE, 0xaea7, 0x04 },
+{ "linux/kvm.h", "KVM_PPC_CONFIGURE_V3_MMU", _IOC_WRITE, 0xaeaf, 0x10 },
+{ "linux/kvm.h", "KVM_PPC_GET_CPU_CHAR", _IOC_READ, 0xaeb1, 0x20 },
+{ "linux/kvm.h", "KVM_PPC_GET_HTAB_FD", _IOC_WRITE, 0xaeaa, 0x20 },
+{ "linux/kvm.h", "KVM_PPC_GET_PVINFO", _IOC_WRITE, 0xaea1, 0x80 },
+{ "linux/kvm.h", "KVM_PPC_GET_RMMU_INFO", _IOC_WRITE, 0xaeb0, 0x60 },
+{ "linux/kvm.h", "KVM_PPC_GET_SMMU_INFO", _IOC_READ, 0xaea6, 0x250 },
+{ "linux/kvm.h", "KVM_PPC_RESIZE_HPT_COMMIT", _IOC_READ, 0xaeae, 0x10 },
+{ "linux/kvm.h", "KVM_PPC_RESIZE_HPT_PREPARE", _IOC_READ, 0xaead, 0x10 },
+{ "linux/kvm.h", "KVM_PPC_RTAS_DEFINE_TOKEN", _IOC_WRITE, 0xaeac, 0x80 },
+{ "linux/kvm.h", "KVM_PPC_SVM_OFF", _IOC_NONE, 0xaeb3, 0x00 },
+{ "linux/kvm.h", "KVM_REGISTER_COALESCED_MMIO", _IOC_WRITE, 0xae67, 0x10 },
+{ "linux/kvm.h", "KVM_REINJECT_CONTROL", _IOC_NONE, 0xae71, 0x00 },
+{ "linux/kvm.h", "KVM_RUN", _IOC_NONE, 0xae80, 0x00 },
+{ "linux/kvm.h", "KVM_SET_BOOT_CPU_ID", _IOC_NONE, 0xae78, 0x00 },
+{ "linux/kvm.h", "KVM_SET_CLOCK", _IOC_WRITE, 0xae7b, 0x30 },
+{ "linux/kvm.h", "KVM_SET_DEVICE_ATTR", _IOC_WRITE, 0xaee1, 0x18 },
+{ "linux/kvm.h", "KVM_SET_FPU", _IOC_WRITE, 0xae8d, 0x100 },
+{ "linux/kvm.h", "KVM_SET_GSI_ROUTING", _IOC_WRITE, 0xae6a, 0x08 },
+{ "linux/kvm.h", "KVM_SET_GUEST_DEBUG", _IOC_WRITE, 0xae9b, 0x108 },
+{ "linux/kvm.h", "KVM_SET_IDENTITY_MAP_ADDR", _IOC_WRITE, 0xae48, 0x08 },
+{ "linux/kvm.h", "KVM_SET_IRQCHIP", _IOC_READ, 0xae63, 0x208 },
+{ "linux/kvm.h", "KVM_SET_MEMORY_REGION", _IOC_WRITE, 0xae40, 0x18 },
+{ "linux/kvm.h", "KVM_SET_MP_STATE", _IOC_WRITE, 0xae99, 0x04 },
+{ "linux/kvm.h", "KVM_SET_NR_MMU_PAGES", _IOC_NONE, 0xae44, 0x00 },
+{ "linux/kvm.h", "KVM_SET_ONE_REG", _IOC_WRITE, 0xaeac, 0x10 },
+{ "linux/kvm.h", "KVM_SET_REGS", _IOC_WRITE, 0xae82, 0x188 },
+{ "linux/kvm.h", "KVM_SET_SIGNAL_MASK", _IOC_WRITE, 0xae8b, 0x04 },
+{ "linux/kvm.h", "KVM_SET_SREGS", _IOC_WRITE, 0xae84, 0x4d0 },
+{ "linux/kvm.h", "KVM_SET_TSC_KHZ", _IOC_NONE, 0xaea2, 0x00 },
+{ "linux/kvm.h", "KVM_SET_TSS_ADDR", _IOC_NONE, 0xae47, 0x00 },
+{ "linux/kvm.h", "KVM_SET_USER_MEMORY_REGION", _IOC_WRITE, 0xae46, 0x20 },
+{ "linux/kvm.h", "KVM_SET_VAPIC_ADDR", _IOC_WRITE, 0xae93, 0x08 },
+{ "linux/kvm.h", "KVM_SIGNAL_MSI", _IOC_WRITE, 0xaea5, 0x20 },
+{ "linux/kvm.h", "KVM_SMI", _IOC_NONE, 0xaeb7, 0x00 },
+{ "linux/kvm.h", "KVM_TPR_ACCESS_REPORTING", _IOC_READ|_IOC_WRITE, 0xae92, 0x28 },
+{ "linux/kvm.h", "KVM_TRANSLATE", _IOC_READ|_IOC_WRITE, 0xae85, 0x18 },
+{ "linux/kvm.h", "KVM_UNREGISTER_COALESCED_MMIO", _IOC_WRITE, 0xae68, 0x10 },
diff --git a/src/linux/powerpc/ioctls_inc0.h b/src/linux/powerpc/ioctls_inc0.h
new file mode 100644
index 000000000..4aecf983e
--- /dev/null
+++ b/src/linux/powerpc/ioctls_inc0.h
@@ -0,0 +1 @@
+#include "32/ioctls_inc.h"
diff --git a/src/linux/powerpc/raw_syscall.h b/src/linux/powerpc/raw_syscall.h
new file mode 100644
index 000000000..e023fcd1c
--- /dev/null
+++ b/src/linux/powerpc/raw_syscall.h
@@ -0,0 +1,32 @@
+/*
+ * Raw syscalls.
+ *
+ * Copyright (c) 2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_RAW_SYSCALL_H
+# define STRACE_RAW_SYSCALL_H
+
+# include "kernel_types.h"
+
+static inline kernel_ulong_t
+raw_syscall_0(const kernel_ulong_t nr, kernel_ulong_t *err)
+{
+ register kernel_ulong_t r0 __asm__("r0") = nr;
+ register kernel_ulong_t r3 __asm__("r3");
+ __asm__ __volatile__("sc\n\t"
+ "mfcr %0"
+ : "+r"(r0), "=r"(r3)
+ :
+ : "memory", "cr0", "ctr", "lr",
+ "r4", "r5", "r6", "r7", "r8",
+ "r9", "r10", "r11", "r12");
+ *err = !!(r0 & 0x10000000);
+ return r3;
+}
+# define raw_syscall_0 raw_syscall_0
+
+#endif /* !STRACE_RAW_SYSCALL_H */
diff --git a/src/linux/powerpc/set_error.c b/src/linux/powerpc/set_error.c
new file mode 100644
index 000000000..90dae8b6d
--- /dev/null
+++ b/src/linux/powerpc/set_error.c
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2016-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static int
+arch_set_r3_ccr(struct tcb *tcp, const unsigned long r3,
+ const unsigned long ccr_set, const unsigned long ccr_clear)
+{
+ if (ptrace_syscall_info_is_valid() &&
+ upeek(tcp, sizeof(long) * PT_CCR, &ppc_regs.ccr))
+ return -1;
+ const unsigned long old_ccr = ppc_regs.ccr;
+ ppc_regs.gpr[3] = r3;
+ ppc_regs.ccr |= ccr_set;
+ ppc_regs.ccr &= ~ccr_clear;
+ if (ppc_regs.ccr != old_ccr &&
+ upoke(tcp, sizeof(long) * PT_CCR, ppc_regs.ccr))
+ return -1;
+ return upoke(tcp, sizeof(long) * (PT_R0 + 3), ppc_regs.gpr[3]);
+}
+
+static int
+arch_set_error(struct tcb *tcp)
+{
+ return arch_set_r3_ccr(tcp, tcp->u_error, 0x10000000, 0);
+}
+
+static int
+arch_set_success(struct tcb *tcp)
+{
+ return arch_set_r3_ccr(tcp, tcp->u_rval, 0, 0x10000000);
+}
diff --git a/src/linux/powerpc/set_scno.c b/src/linux/powerpc/set_scno.c
new file mode 100644
index 000000000..f47ad85bd
--- /dev/null
+++ b/src/linux/powerpc/set_scno.c
@@ -0,0 +1,12 @@
+/*
+ * Copyright (c) 2016-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static int
+arch_set_scno(struct tcb *tcp, kernel_ulong_t scno)
+{
+ return upoke(tcp, sizeof(long) * PT_R0, scno);
+}
diff --git a/src/linux/powerpc/syscallent.h b/src/linux/powerpc/syscallent.h
new file mode 100644
index 000000000..d1fe9261c
--- /dev/null
+++ b/src/linux/powerpc/syscallent.h
@@ -0,0 +1,403 @@
+/*
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993, 1994, 1995 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1995-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+[ 0] = { 0, 0, SEN(restart_syscall), "restart_syscall" },
+[ 1] = { 1, TP|SE, SEN(exit), "exit" },
+[ 2] = { 0, TP, SEN(fork), "fork" },
+[ 3] = { 3, TD, SEN(read), "read" },
+[ 4] = { 3, TD, SEN(write), "write" },
+[ 5] = { 3, TD|TF, SEN(open), "open" },
+[ 6] = { 1, TD, SEN(close), "close" },
+[ 7] = { 3, TP, SEN(waitpid), "waitpid" },
+[ 8] = { 2, TD|TF, SEN(creat), "creat" },
+[ 9] = { 2, TF, SEN(link), "link" },
+[ 10] = { 1, TF, SEN(unlink), "unlink" },
+[ 11] = { 3, TF|TP|TSD|SE|SI, SEN(execve), "execve" },
+[ 12] = { 1, TF, SEN(chdir), "chdir" },
+[ 13] = { 1, TCL, SEN(time), "time" },
+[ 14] = { 3, TF, SEN(mknod), "mknod" },
+[ 15] = { 2, TF, SEN(chmod), "chmod" },
+[ 16] = { 3, TF, SEN(chown), "lchown" },
+[ 17] = { 0, TM, SEN(break), "break" },
+[ 18] = { 2, TF|TST|TSTA, SEN(oldstat), "oldstat" },
+[ 19] = { 3, TD, SEN(lseek), "lseek" },
+[ 20] = { 0, PU|NF, SEN(getpid), "getpid" },
+[ 21] = { 5, TF, SEN(mount), "mount" },
+[ 22] = { 1, TF, SEN(umount), "umount" },
+[ 23] = { 1, TC, SEN(setuid), "setuid" },
+[ 24] = { 0, TC|PU|NF, SEN(getuid), "getuid" },
+[ 25] = { 1, 0, SEN(stime), "stime" },
+[ 26] = { 4, 0, SEN(ptrace), "ptrace" },
+[ 27] = { 1, 0, SEN(alarm), "alarm" },
+[ 28] = { 2, TD|TFST|TSTA, SEN(oldfstat), "oldfstat" },
+[ 29] = { 0, TS, SEN(pause), "pause" },
+[ 30] = { 2, TF, SEN(utime), "utime" },
+[ 31] = { 2, 0, SEN(stty), "stty" },
+[ 32] = { 2, 0, SEN(gtty), "gtty" },
+[ 33] = { 2, TF, SEN(access), "access" },
+[ 34] = { 1, 0, SEN(nice), "nice" },
+[ 35] = { 0, 0, SEN(ftime), "ftime" },
+[ 36] = { 0, 0, SEN(sync), "sync" },
+[ 37] = { 2, TS|TP, SEN(kill), "kill" },
+[ 38] = { 2, TF, SEN(rename), "rename" },
+[ 39] = { 2, TF, SEN(mkdir), "mkdir" },
+[ 40] = { 1, TF, SEN(rmdir), "rmdir" },
+[ 41] = { 1, TD, SEN(dup), "dup" },
+[ 42] = { 1, TD, SEN(pipe), "pipe" },
+[ 43] = { 1, 0, SEN(times), "times" },
+[ 44] = { 0, 0, SEN(prof), "prof" },
+[ 45] = { 1, TM|SI, SEN(brk), "brk" },
+[ 46] = { 1, TC, SEN(setgid), "setgid" },
+[ 47] = { 0, TC|PU|NF, SEN(getgid), "getgid" },
+[ 48] = { 2, TS, SEN(signal), "signal" },
+[ 49] = { 0, TC|PU|NF, SEN(geteuid), "geteuid" },
+[ 50] = { 0, TC|PU|NF, SEN(getegid), "getegid" },
+[ 51] = { 1, TF, SEN(acct), "acct" },
+[ 52] = { 2, TF, SEN(umount2), "umount2" },
+[ 53] = { 0, 0, SEN(lock), "lock" },
+[ 54] = { 3, TD, SEN(ioctl), "ioctl" },
+[ 55] = { 3, TD, SEN(fcntl), "fcntl" },
+[ 56] = { 0, 0, SEN(mpx), "mpx" },
+[ 57] = { 2, 0, SEN(setpgid), "setpgid" },
+[ 58] = { 2, 0, SEN(ulimit), "ulimit" },
+[ 59] = { 1, 0, SEN(oldolduname), "oldolduname" },
+[ 60] = { 1, NF, SEN(umask), "umask" },
+[ 61] = { 1, TF, SEN(chroot), "chroot" },
+[ 62] = { 2, TSFA, SEN(ustat), "ustat" },
+[ 63] = { 2, TD, SEN(dup2), "dup2" },
+[ 64] = { 0, PU|NF, SEN(getppid), "getppid" },
+[ 65] = { 0, PU|NF, SEN(getpgrp), "getpgrp" },
+[ 66] = { 0, 0, SEN(setsid), "setsid" },
+[ 67] = { 3, TS, SEN(sigaction), "sigaction" },
+[ 68] = { 0, TS, SEN(sgetmask), "sgetmask" },
+[ 69] = { 1, TS, SEN(ssetmask), "ssetmask" },
+[ 70] = { 2, TC, SEN(setreuid), "setreuid" },
+[ 71] = { 2, TC, SEN(setregid), "setregid" },
+[ 72] = { 1, TS, SEN(sigsuspend), "sigsuspend" },
+[ 73] = { 1, TS, SEN(sigpending), "sigpending" },
+[ 74] = { 2, 0, SEN(sethostname), "sethostname" },
+[ 75] = { 2, 0, SEN(setrlimit), "setrlimit" },
+[ 76] = { 2, 0, SEN(getrlimit), "getrlimit" },
+[ 77] = { 2, 0, SEN(getrusage), "getrusage" },
+[ 78] = { 2, TCL, SEN(gettimeofday), "gettimeofday" },
+[ 79] = { 2, TCL, SEN(settimeofday), "settimeofday" },
+[ 80] = { 2, TC, SEN(getgroups), "getgroups" },
+[ 81] = { 2, TC, SEN(setgroups), "setgroups" },
+[ 82] = { 1, TD, SEN(oldselect), "select" },
+[ 83] = { 2, TF, SEN(symlink), "symlink" },
+[ 84] = { 2, TF|TLST|TSTA, SEN(oldlstat), "oldlstat" },
+[ 85] = { 3, TF, SEN(readlink), "readlink" },
+[ 86] = { 1, TF, SEN(uselib), "uselib" },
+[ 87] = { 2, TF, SEN(swapon), "swapon" },
+[ 88] = { 4, 0, SEN(reboot), "reboot" },
+[ 89] = { 3, TD, SEN(readdir), "readdir" },
+[ 90] = { 6, TD|TM|SI, SEN(mmap), "mmap" },
+[ 91] = { 2, TM|SI, SEN(munmap), "munmap" },
+[ 92] = { 2, TF, SEN(truncate), "truncate" },
+[ 93] = { 2, TD, SEN(ftruncate), "ftruncate" },
+[ 94] = { 2, TD, SEN(fchmod), "fchmod" },
+[ 95] = { 3, TD, SEN(fchown), "fchown" },
+[ 96] = { 2, 0, SEN(getpriority), "getpriority" },
+[ 97] = { 3, 0, SEN(setpriority), "setpriority" },
+[ 98] = { 4, 0, SEN(profil), "profil" },
+[ 99] = { 2, TF|TSF|TSFA, SEN(statfs), "statfs" },
+[100] = { 2, TD|TFSF|TSFA, SEN(fstatfs), "fstatfs" },
+[101] = { 3, 0, SEN(ioperm), "ioperm" },
+[102] = { 2, TD|TSD, SEN(socketcall), "socketcall" },
+[103] = { 3, 0, SEN(syslog), "syslog" },
+[104] = { 3, 0, SEN(setitimer), "setitimer" },
+[105] = { 2, 0, SEN(getitimer), "getitimer" },
+[106] = { 2, TF|TST|TSTA, SEN(stat), "stat" },
+[107] = { 2, TF|TLST|TSTA, SEN(lstat), "lstat" },
+[108] = { 2, TD|TFST|TSTA, SEN(fstat), "fstat" },
+[109] = { 1, 0, SEN(olduname), "olduname" },
+[110] = { 1, 0, SEN(iopl), "iopl" },
+[111] = { 0, 0, SEN(vhangup), "vhangup" },
+[112] = { 0, 0, SEN(idle), "idle" },
+[113] = { 5, 0, SEN(vm86), "vm86" },
+[114] = { 4, TP, SEN(wait4), "wait4" },
+[115] = { 1, TF, SEN(swapoff), "swapoff" },
+[116] = { 1, 0, SEN(sysinfo), "sysinfo" },
+[117] = { 6, TI|TSD, SEN(ipc), "ipc" },
+[118] = { 1, TD, SEN(fsync), "fsync" },
+[119] = { 0, TS, SEN(sigreturn), "sigreturn" },
+[120] = { 5, TP, SEN(clone), "clone" },
+[121] = { 2, 0, SEN(setdomainname), "setdomainname" },
+[122] = { 1, 0, SEN(uname), "uname" },
+[123] = { 5, 0, SEN(printargs), "modify_ldt" },
+[124] = { 1, TCL, SEN(adjtimex32), "adjtimex" },
+[125] = { 3, TM|SI, SEN(mprotect), "mprotect" },
+[126] = { 3, TS, SEN(sigprocmask), "sigprocmask" },
+[127] = { 2, 0, SEN(create_module), "create_module" },
+[128] = { 3, 0, SEN(init_module), "init_module" },
+[129] = { 2, 0, SEN(delete_module), "delete_module" },
+[130] = { 1, 0, SEN(get_kernel_syms), "get_kernel_syms" },
+[131] = { 4, TF, SEN(quotactl), "quotactl" },
+[132] = { 1, 0, SEN(getpgid), "getpgid" },
+[133] = { 1, TD, SEN(fchdir), "fchdir" },
+[134] = { 2, 0, SEN(bdflush), "bdflush" },
+[135] = { 3, 0, SEN(sysfs), "sysfs" },
+[136] = { 1, NF, SEN(personality), "personality" },
+[137] = { 5, 0, SEN(afs_syscall), "afs_syscall" },
+[138] = { 1, TC|NF, SEN(setfsuid), "setfsuid" },
+[139] = { 1, TC|NF, SEN(setfsgid), "setfsgid" },
+[140] = { 5, TD, SEN(llseek), "_llseek" },
+[141] = { 3, TD, SEN(getdents), "getdents" },
+[142] = { 5, TD, SEN(select), "_newselect" },
+[143] = { 2, TD, SEN(flock), "flock" },
+[144] = { 3, TM, SEN(msync), "msync" },
+[145] = { 3, TD, SEN(readv), "readv" },
+[146] = { 3, TD, SEN(writev), "writev" },
+[147] = { 1, 0, SEN(getsid), "getsid" },
+[148] = { 1, TD, SEN(fdatasync), "fdatasync" },
+[149] = { 1, 0, SEN(sysctl), "_sysctl" },
+[150] = { 2, TM, SEN(mlock), "mlock" },
+[151] = { 2, TM, SEN(munlock), "munlock" },
+[152] = { 1, TM, SEN(mlockall), "mlockall" },
+[153] = { 0, TM, SEN(munlockall), "munlockall" },
+[154] = { 2, 0, SEN(sched_setparam), "sched_setparam" },
+[155] = { 2, 0, SEN(sched_getparam), "sched_getparam" },
+[156] = { 3, 0, SEN(sched_setscheduler), "sched_setscheduler" },
+[157] = { 1, 0, SEN(sched_getscheduler), "sched_getscheduler" },
+[158] = { 0, 0, SEN(sched_yield), "sched_yield" },
+[159] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"},
+[160] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"},
+[161] = { 2, 0, SEN(sched_rr_get_interval_time32),"sched_rr_get_interval"},
+[162] = { 2, 0, SEN(nanosleep_time32), "nanosleep" },
+[163] = { 5, TM|SI, SEN(mremap), "mremap" },
+[164] = { 3, TC, SEN(setresuid), "setresuid" },
+[165] = { 3, TC, SEN(getresuid), "getresuid" },
+[166] = { 5, 0, SEN(query_module), "query_module" },
+[167] = { 3, TD, SEN(poll_time32), "poll" },
+[168] = { 3, 0, SEN(nfsservctl), "nfsservctl" },
+[169] = { 3, TC, SEN(setresgid), "setresgid" },
+[170] = { 3, TC, SEN(getresgid), "getresgid" },
+[171] = { 5, TC, SEN(prctl), "prctl" },
+[172] = { 0, TS, SEN(rt_sigreturn), "rt_sigreturn" },
+[173] = { 4, TS, SEN(rt_sigaction), "rt_sigaction" },
+[174] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" },
+[175] = { 2, TS, SEN(rt_sigpending), "rt_sigpending" },
+[176] = { 4, TS, SEN(rt_sigtimedwait_time32), "rt_sigtimedwait" },
+[177] = { 3, TS|TP, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" },
+[178] = { 2, TS, SEN(rt_sigsuspend), "rt_sigsuspend" },
+[179] = { 6, TD, SEN(pread), "pread64" },
+[180] = { 6, TD, SEN(pwrite), "pwrite64" },
+[181] = { 3, TF, SEN(chown), "chown" },
+[182] = { 2, TF, SEN(getcwd), "getcwd" },
+[183] = { 2, TC, SEN(capget), "capget" },
+[184] = { 2, TC, SEN(capset), "capset" },
+[185] = { 2, TS, SEN(sigaltstack), "sigaltstack" },
+[186] = { 4, TD|TN, SEN(sendfile), "sendfile" },
+[187] = { 5, TN, SEN(getpmsg), "getpmsg" },
+[188] = { 5, TN, SEN(putpmsg), "putpmsg" },
+[189] = { 0, TP, SEN(vfork), "vfork" },
+[190] = { 2, 0, SEN(getrlimit), "ugetrlimit" },
+[191] = { 5, TD, SEN(readahead), "readahead" },
+[192] = { 6, TD|TM|SI, SEN(mmap_4koff), "mmap2" },
+[193] = { 4, TF, SEN(truncate64), "truncate64" },
+[194] = { 4, TD, SEN(ftruncate64), "ftruncate64" },
+[195] = { 2, TF|TST|TSTA, SEN(stat64), "stat64" },
+[196] = { 2, TF|TLST|TSTA, SEN(lstat64), "lstat64" },
+[197] = { 2, TD|TFST|TSTA, SEN(fstat64), "fstat64" },
+[198] = { 5, 0, SEN(printargs), "pciconfig_read" },
+[199] = { 5, 0, SEN(printargs), "pciconfig_write" },
+[200] = { 3, 0, SEN(printargs), "pciconfig_iobase" },
+[201] = { 6, 0, SEN(printargs), "multiplexer" },
+[202] = { 3, TD, SEN(getdents64), "getdents64" },
+[203] = { 2, TF, SEN(pivotroot), "pivot_root" },
+[204] = { 3, TD, SEN(fcntl64), "fcntl64" },
+[205] = { 3, TM, SEN(madvise), "madvise" },
+[206] = { 3, TM, SEN(mincore), "mincore" },
+[207] = { 0, PU|NF, SEN(gettid), "gettid" },
+[208] = { 2, TS|TP, SEN(tkill), "tkill" },
+[209] = { 5, TF, SEN(setxattr), "setxattr" },
+[210] = { 5, TF, SEN(setxattr), "lsetxattr" },
+[211] = { 5, TD, SEN(fsetxattr), "fsetxattr" },
+[212] = { 4, TF, SEN(getxattr), "getxattr" },
+[213] = { 4, TF, SEN(getxattr), "lgetxattr" },
+[214] = { 4, TD, SEN(fgetxattr), "fgetxattr" },
+[215] = { 3, TF, SEN(listxattr), "listxattr" },
+[216] = { 3, TF, SEN(listxattr), "llistxattr" },
+[217] = { 3, TD, SEN(flistxattr), "flistxattr" },
+[218] = { 2, TF, SEN(removexattr), "removexattr" },
+[219] = { 2, TF, SEN(removexattr), "lremovexattr" },
+[220] = { 2, TD, SEN(fremovexattr), "fremovexattr" },
+[221] = { 6, 0, SEN(futex_time32), "futex" },
+[222] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" },
+[223] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" },
+[224] = { },
+[225] = { 5, 0, SEN(printargs), "tuxcall" },
+[226] = { 4, TD|TN, SEN(sendfile64), "sendfile64" },
+[227] = { 2, TM, SEN(io_setup), "io_setup" },
+[228] = { 1, TM, SEN(io_destroy), "io_destroy" },
+[229] = { 5, 0, SEN(io_getevents_time32), "io_getevents" },
+[230] = { 3, 0, SEN(io_submit), "io_submit" },
+[231] = { 3, 0, SEN(io_cancel), "io_cancel" },
+[232] = { 1, 0, SEN(set_tid_address), "set_tid_address" },
+[233] = { 6, TD, SEN(fadvise64), "fadvise64" },
+[234] = { 1, TP|SE, SEN(exit), "exit_group" },
+[235] = { 4, 0, SEN(lookup_dcookie), "lookup_dcookie" },
+[236] = { 1, TD, SEN(epoll_create), "epoll_create" },
+[237] = { 4, TD, SEN(epoll_ctl), "epoll_ctl" },
+[238] = { 4, TD, SEN(epoll_wait), "epoll_wait" },
+[239] = { 5, TM|SI, SEN(remap_file_pages), "remap_file_pages" },
+[240] = { 3, 0, SEN(timer_create), "timer_create" },
+[241] = { 4, 0, SEN(timer_settime32), "timer_settime" },
+[242] = { 2, 0, SEN(timer_gettime32), "timer_gettime" },
+[243] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" },
+[244] = { 1, 0, SEN(timer_delete), "timer_delete" },
+[245] = { 2, TCL, SEN(clock_settime32), "clock_settime" },
+[246] = { 2, TCL, SEN(clock_gettime32), "clock_gettime" },
+[247] = { 2, TCL, SEN(clock_getres_time32), "clock_getres" },
+[248] = { 4, 0, SEN(clock_nanosleep_time32), "clock_nanosleep" },
+[249] = { 2, 0, SEN(printargs), "swapcontext" },
+[250] = { 3, TS|TP, SEN(tgkill), "tgkill" },
+[251] = { 2, TF, SEN(utimes), "utimes" },
+[252] = { 3, TF|TSF|TSFA, SEN(statfs64), "statfs64" },
+[253] = { 3, TD|TFSF|TSFA, SEN(fstatfs64), "fstatfs64" },
+[254] = { 6, TD, SEN(fadvise64_64), "fadvise64_64" },
+[255] = { 1, 0, SEN(printargs), "rtas" },
+[256] = { 5, 0, SEN(printargs), "sys_debug_setcontext" },
+[257] = { 5, 0, SEN(vserver), "vserver" },
+[258] = { 4, TM, SEN(migrate_pages), "migrate_pages" },
+[259] = { 6, TM, SEN(mbind), "mbind" },
+[260] = { 5, TM, SEN(get_mempolicy), "get_mempolicy" },
+[261] = { 3, TM, SEN(set_mempolicy), "set_mempolicy" },
+[262] = { 4, TD, SEN(mq_open), "mq_open" },
+[263] = { 1, 0, SEN(mq_unlink), "mq_unlink" },
+[264] = { 5, TD, SEN(mq_timedsend_time32), "mq_timedsend" },
+[265] = { 5, TD, SEN(mq_timedreceive_time32), "mq_timedreceive" },
+[266] = { 2, TD, SEN(mq_notify), "mq_notify" },
+[267] = { 3, TD, SEN(mq_getsetattr), "mq_getsetattr" },
+[268] = { 4, 0, SEN(kexec_load), "kexec_load" },
+[269] = { 5, 0, SEN(add_key), "add_key" },
+[270] = { 4, 0, SEN(request_key), "request_key" },
+[271] = { 5, 0, SEN(keyctl), "keyctl" },
+[272] = { 5, TP, SEN(waitid), "waitid" },
+[273] = { 3, 0, SEN(ioprio_set), "ioprio_set" },
+[274] = { 2, 0, SEN(ioprio_get), "ioprio_get" },
+[275] = { 0, TD, SEN(inotify_init), "inotify_init" },
+[276] = { 3, TD|TF, SEN(inotify_add_watch), "inotify_add_watch" },
+[277] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" },
+[278] = { 3, 0, SEN(printargs), "spu_run" },
+[279] = { 4, 0, SEN(printargs), "spu_create" },
+[280] = { 6, TD, SEN(pselect6_time32), "pselect6" },
+[281] = { 5, TD, SEN(ppoll_time32), "ppoll" },
+[282] = { 1, 0, SEN(unshare), "unshare" },
+[283] = { 6, TD, SEN(splice), "splice" },
+[284] = { 4, TD, SEN(tee), "tee" },
+[285] = { 4, TD, SEN(vmsplice), "vmsplice" },
+[286] = { 4, TD|TF, SEN(openat), "openat" },
+[287] = { 3, TD|TF, SEN(mkdirat), "mkdirat" },
+[288] = { 4, TD|TF, SEN(mknodat), "mknodat" },
+[289] = { 5, TD|TF, SEN(fchownat), "fchownat" },
+[290] = { 3, TD|TF, SEN(futimesat), "futimesat" },
+[291] = { 4, TD|TF|TFST|TSTA,SEN(fstatat64), "fstatat64" },
+[292] = { 3, TD|TF, SEN(unlinkat), "unlinkat" },
+[293] = { 4, TD|TF, SEN(renameat), "renameat" },
+[294] = { 5, TD|TF, SEN(linkat), "linkat" },
+[295] = { 3, TD|TF, SEN(symlinkat), "symlinkat" },
+[296] = { 4, TD|TF, SEN(readlinkat), "readlinkat" },
+[297] = { 3, TD|TF, SEN(fchmodat), "fchmodat" },
+[298] = { 3, TD|TF, SEN(faccessat), "faccessat" },
+[299] = { 3, 0, SEN(get_robust_list), "get_robust_list" },
+[300] = { 2, 0, SEN(set_robust_list), "set_robust_list" },
+[301] = { 6, TM, SEN(move_pages), "move_pages" },
+[302] = { 3, 0, SEN(getcpu), "getcpu" },
+[303] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" },
+[304] = { 4, TD|TF, SEN(utimensat_time32), "utimensat" },
+[305] = { 3, TD|TS, SEN(signalfd), "signalfd" },
+[306] = { 2, TD, SEN(timerfd_create), "timerfd_create" },
+[307] = { 1, TD, SEN(eventfd), "eventfd" },
+[308] = { 6, TD, SEN(sync_file_range2), "sync_file_range2" },
+[309] = { 6, TD, SEN(fallocate), "fallocate" },
+[310] = { 3, 0, SEN(subpage_prot), "subpage_prot" },
+[311] = { 4, TD, SEN(timerfd_settime32), "timerfd_settime" },
+[312] = { 2, TD, SEN(timerfd_gettime32), "timerfd_gettime" },
+[313] = { 4, TD|TS, SEN(signalfd4), "signalfd4" },
+[314] = { 2, TD, SEN(eventfd2), "eventfd2" },
+[315] = { 1, TD, SEN(epoll_create1), "epoll_create1" },
+[316] = { 3, TD, SEN(dup3), "dup3" },
+[317] = { 2, TD, SEN(pipe2), "pipe2" },
+[318] = { 1, TD, SEN(inotify_init1), "inotify_init1" },
+[319] = { 5, TD, SEN(perf_event_open), "perf_event_open" },
+[320] = { 5, TD, SEN(preadv), "preadv" },
+[321] = { 5, TD, SEN(pwritev), "pwritev" },
+[322] = { 4, TP|TS, SEN(rt_tgsigqueueinfo), "rt_tgsigqueueinfo" },
+[323] = { 2, TD, SEN(fanotify_init), "fanotify_init" },
+[324] = { 6, TD|TF, SEN(fanotify_mark), "fanotify_mark" },
+[325] = { 4, 0, SEN(prlimit64), "prlimit64" },
+[326] = { 3, TN, SEN(socket), "socket" },
+[327] = { 3, TN, SEN(bind), "bind" },
+[328] = { 3, TN, SEN(connect), "connect" },
+[329] = { 2, TN, SEN(listen), "listen" },
+[330] = { 3, TN, SEN(accept), "accept" },
+[331] = { 3, TN, SEN(getsockname), "getsockname" },
+[332] = { 3, TN, SEN(getpeername), "getpeername" },
+[333] = { 4, TN, SEN(socketpair), "socketpair" },
+[334] = { 4, TN, SEN(send), "send" },
+[335] = { 6, TN, SEN(sendto), "sendto" },
+[336] = { 4, TN, SEN(recv), "recv" },
+[337] = { 6, TN, SEN(recvfrom), "recvfrom" },
+[338] = { 2, TN, SEN(shutdown), "shutdown" },
+[339] = { 5, TN, SEN(setsockopt), "setsockopt" },
+[340] = { 5, TN, SEN(getsockopt), "getsockopt" },
+[341] = { 3, TN, SEN(sendmsg), "sendmsg" },
+[342] = { 3, TN, SEN(recvmsg), "recvmsg" },
+[343] = { 5, TN, SEN(recvmmsg_time32), "recvmmsg" },
+[344] = { 4, TN, SEN(accept4), "accept4" },
+[345] = { 5, TD|TF, SEN(name_to_handle_at), "name_to_handle_at" },
+[346] = { 3, TD, SEN(open_by_handle_at), "open_by_handle_at" },
+[347] = { 2, TCL, SEN(clock_adjtime32), "clock_adjtime" },
+[348] = { 1, TD, SEN(syncfs), "syncfs" },
+[349] = { 4, TN, SEN(sendmmsg), "sendmmsg" },
+[350] = { 2, TD, SEN(setns), "setns" },
+[351] = { 6, 0, SEN(process_vm_readv), "process_vm_readv" },
+[352] = { 6, 0, SEN(process_vm_writev), "process_vm_writev" },
+[353] = { 3, TD, SEN(finit_module), "finit_module" },
+[354] = { 5, 0, SEN(kcmp), "kcmp" },
+[355] = { 3, 0, SEN(sched_setattr), "sched_setattr" },
+[356] = { 4, 0, SEN(sched_getattr), "sched_getattr" },
+[357] = { 5, TD|TF, SEN(renameat2), "renameat2" },
+[358] = { 3, 0, SEN(seccomp), "seccomp" },
+[359] = { 3, 0, SEN(getrandom), "getrandom" },
+[360] = { 2, TD, SEN(memfd_create), "memfd_create" },
+[361] = { 3, TD, SEN(bpf), "bpf" },
+[362] = { 5, TD|TF|TP|TSD|SE|SI, SEN(execveat), "execveat" },
+[363] = { 0, 0, SEN(printargs), "switch_endian" },
+[364] = { 1, TD, SEN(userfaultfd), "userfaultfd" },
+[365] = { 3, 0, SEN(membarrier), "membarrier" },
+/* originally left for IPC, now unused */
+[378] = { 3, TM, SEN(mlock2), "mlock2" },
+[379] = { 6, TD, SEN(copy_file_range), "copy_file_range" },
+[380] = { 6, TD, SEN(preadv2), "preadv2" },
+[381] = { 6, TD, SEN(pwritev2), "pwritev2" },
+[382] = { 5, TD, SEN(kexec_file_load), "kexec_file_load" },
+[383] = { 5, TD|TF|TFST|TSTA,SEN(statx), "statx" },
+[384] = { 2, 0, SEN(pkey_alloc), "pkey_alloc" },
+[385] = { 1, 0, SEN(pkey_free), "pkey_free" },
+[386] = { 4, TM|SI, SEN(pkey_mprotect), "pkey_mprotect" },
+[387] = { 4, 0, SEN(rseq), "rseq" },
+[388] = { 6, 0, SEN(io_pgetevents_time32), "io_pgetevents" },
+/* room for arch specific syscalls */
+[393] = { 3, TI, SEN(semget), "semget" },
+[394] = { 4, TI, SEN(semctl), "semctl" },
+[395] = { 3, TI, SEN(shmget), "shmget" },
+[396] = { 3, TI, SEN(shmctl), "shmctl" },
+[397] = { 3, TI|TM|SI, SEN(shmat), "shmat" },
+[398] = { 1, TI|TM|SI, SEN(shmdt), "shmdt" },
+[399] = { 2, TI, SEN(msgget), "msgget" },
+[400] = { 4, TI, SEN(msgsnd), "msgsnd" },
+[401] = { 5, TI, SEN(msgrcv), "msgrcv" },
+[402] = { 3, TI, SEN(msgctl), "msgctl" },
+#include "syscallent-common-32.h"
+#include "syscallent-common.h"
+
+#define SYS_socket_subcall 500
+#include "subcall32.h"
diff --git a/src/linux/powerpc/userent.h b/src/linux/powerpc/userent.h
new file mode 100644
index 000000000..93cc656b8
--- /dev/null
+++ b/src/linux/powerpc/userent.h
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2014-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef PT_ORIG_R3
+# define PT_ORIG_R3 34
+#endif
+#define REGSIZE (sizeof(unsigned long))
+{ REGSIZE*PT_R0, "r0" },
+{ REGSIZE*PT_R1, "r1" },
+{ REGSIZE*PT_R2, "r2" },
+{ REGSIZE*PT_R3, "r3" },
+{ REGSIZE*PT_R4, "r4" },
+{ REGSIZE*PT_R5, "r5" },
+{ REGSIZE*PT_R6, "r6" },
+{ REGSIZE*PT_R7, "r7" },
+{ REGSIZE*PT_R8, "r8" },
+{ REGSIZE*PT_R9, "r9" },
+{ REGSIZE*PT_R10, "r10" },
+{ REGSIZE*PT_R11, "r11" },
+{ REGSIZE*PT_R12, "r12" },
+{ REGSIZE*PT_R13, "r13" },
+{ REGSIZE*PT_R14, "r14" },
+{ REGSIZE*PT_R15, "r15" },
+{ REGSIZE*PT_R16, "r16" },
+{ REGSIZE*PT_R17, "r17" },
+{ REGSIZE*PT_R18, "r18" },
+{ REGSIZE*PT_R19, "r19" },
+{ REGSIZE*PT_R20, "r20" },
+{ REGSIZE*PT_R21, "r21" },
+{ REGSIZE*PT_R22, "r22" },
+{ REGSIZE*PT_R23, "r23" },
+{ REGSIZE*PT_R24, "r24" },
+{ REGSIZE*PT_R25, "r25" },
+{ REGSIZE*PT_R26, "r26" },
+{ REGSIZE*PT_R27, "r27" },
+{ REGSIZE*PT_R28, "r28" },
+{ REGSIZE*PT_R29, "r29" },
+{ REGSIZE*PT_R30, "r30" },
+{ REGSIZE*PT_R31, "r31" },
+{ REGSIZE*PT_NIP, "NIP" },
+{ REGSIZE*PT_MSR, "MSR" },
+{ REGSIZE*PT_ORIG_R3, "ORIG_R3" },
+{ REGSIZE*PT_CTR, "CTR" },
+{ REGSIZE*PT_LNK, "LNK" },
+{ REGSIZE*PT_XER, "XER" },
+{ REGSIZE*PT_CCR, "CCR" },
+{ REGSIZE*PT_FPR0, "FPR0" },
+#undef REGSIZE
+/* Other fields in "struct user" */
+#include "../userent0.h"
diff --git a/src/linux/powerpc64/arch_defs_.h b/src/linux/powerpc64/arch_defs_.h
new file mode 100644
index 000000000..a4ac007ef
--- /dev/null
+++ b/src/linux/powerpc64/arch_defs_.h
@@ -0,0 +1,12 @@
+/*
+ * Copyright (c) 2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#define HAVE_ARCH_OLD_SELECT 1
+#define SUPPORTED_PERSONALITIES 2
+#define HAVE_ARCH_DEDICATED_ERR_REG 1
+#define PERSONALITY0_AUDIT_ARCH { AUDIT_ARCH_PPC64, 0 }
+#define PERSONALITY1_AUDIT_ARCH { AUDIT_ARCH_PPC, 0 }
diff --git a/src/linux/powerpc64/arch_get_personality.c b/src/linux/powerpc64/arch_get_personality.c
new file mode 100644
index 000000000..ad311f6d6
--- /dev/null
+++ b/src/linux/powerpc64/arch_get_personality.c
@@ -0,0 +1,13 @@
+/*
+ * Copyright (c) 2018 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2018-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+int
+get_personality_from_syscall_info(const struct_ptrace_syscall_info *sci)
+{
+ return sci->arch == AUDIT_ARCH_PPC;
+}
diff --git a/src/linux/powerpc64/arch_regs.c b/src/linux/powerpc64/arch_regs.c
new file mode 100644
index 000000000..b5c572dcc
--- /dev/null
+++ b/src/linux/powerpc64/arch_regs.c
@@ -0,0 +1 @@
+#include "powerpc/arch_regs.c"
diff --git a/src/linux/powerpc64/arch_rt_sigframe.c b/src/linux/powerpc64/arch_rt_sigframe.c
new file mode 100644
index 000000000..43ba4c88b
--- /dev/null
+++ b/src/linux/powerpc64/arch_rt_sigframe.c
@@ -0,0 +1,23 @@
+/*
+ * Copyright (c) 2017-2018 Dmitry V. Levin <ldv@strace.io>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#undef FUNC_GET_RT_SIGFRAME_ADDR
+#define FUNC_GET_RT_SIGFRAME_ADDR \
+ static kernel_ulong_t ppc_get_rt_sigframe_addr(struct tcb *tcp)
+
+#include "powerpc/arch_rt_sigframe.c"
+
+#undef FUNC_GET_RT_SIGFRAME_ADDR
+#define FUNC_GET_RT_SIGFRAME_ADDR DEF_FUNC_GET_RT_SIGFRAME_ADDR
+
+FUNC_GET_RT_SIGFRAME_ADDR
+{
+ if (tcp->currpers == 1)
+ return ppc_get_rt_sigframe_addr(tcp);
+ kernel_ulong_t sp;
+ return get_stack_pointer(tcp, &sp) ? sp : 0;
+}
diff --git a/src/linux/powerpc64/arch_sigreturn.c b/src/linux/powerpc64/arch_sigreturn.c
new file mode 100644
index 000000000..316022fdc
--- /dev/null
+++ b/src/linux/powerpc64/arch_sigreturn.c
@@ -0,0 +1 @@
+#include "powerpc/arch_sigreturn.c"
diff --git a/src/linux/powerpc64/errnoent.h b/src/linux/powerpc64/errnoent.h
new file mode 100644
index 000000000..30f6425e2
--- /dev/null
+++ b/src/linux/powerpc64/errnoent.h
@@ -0,0 +1 @@
+#include "powerpc/errnoent.h"
diff --git a/src/linux/powerpc64/get_error.c b/src/linux/powerpc64/get_error.c
new file mode 100644
index 000000000..209bfd8f8
--- /dev/null
+++ b/src/linux/powerpc64/get_error.c
@@ -0,0 +1 @@
+#include "powerpc/get_error.c"
diff --git a/src/linux/powerpc64/get_scno.c b/src/linux/powerpc64/get_scno.c
new file mode 100644
index 000000000..03523d397
--- /dev/null
+++ b/src/linux/powerpc64/get_scno.c
@@ -0,0 +1,22 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+/* Return codes: 1 - ok, 0 - ignore, other - error. */
+static int
+arch_get_scno(struct tcb *tcp)
+{
+ tcp->scno = ppc_regs.gpr[0];
+ /*
+ * Check for 64/32 bit mode.
+ * Embedded implementations covered by Book E extension of PPC use
+ * bit 0 (CM) of 32-bit Machine state register (MSR).
+ * Other implementations use bit 0 (SF) of 64-bit MSR.
+ */
+ unsigned int currpers = (ppc_regs.msr & 0x8000000080000000) ? 0 : 1;
+ update_personality(tcp, currpers);
+ return 1;
+}
diff --git a/src/linux/powerpc64/get_syscall_args.c b/src/linux/powerpc64/get_syscall_args.c
new file mode 100644
index 000000000..5561a5519
--- /dev/null
+++ b/src/linux/powerpc64/get_syscall_args.c
@@ -0,0 +1 @@
+#include "powerpc/get_syscall_args.c"
diff --git a/src/linux/powerpc64/getregs_old.c b/src/linux/powerpc64/getregs_old.c
new file mode 100644
index 000000000..177ff74b7
--- /dev/null
+++ b/src/linux/powerpc64/getregs_old.c
@@ -0,0 +1 @@
+#include "powerpc/getregs_old.c"
diff --git a/src/linux/powerpc64/getregs_old.h b/src/linux/powerpc64/getregs_old.h
new file mode 100644
index 000000000..fdd98f9fb
--- /dev/null
+++ b/src/linux/powerpc64/getregs_old.h
@@ -0,0 +1 @@
+#include "powerpc/getregs_old.h"
diff --git a/src/linux/powerpc64/ioctls_arch0.h b/src/linux/powerpc64/ioctls_arch0.h
new file mode 100644
index 000000000..bf6962ce7
--- /dev/null
+++ b/src/linux/powerpc64/ioctls_arch0.h
@@ -0,0 +1 @@
+#include "powerpc/ioctls_arch0.h"
diff --git a/src/linux/powerpc64/ioctls_arch1.h b/src/linux/powerpc64/ioctls_arch1.h
new file mode 100644
index 000000000..bf6962ce7
--- /dev/null
+++ b/src/linux/powerpc64/ioctls_arch1.h
@@ -0,0 +1 @@
+#include "powerpc/ioctls_arch0.h"
diff --git a/src/linux/powerpc64/ioctls_inc0.h b/src/linux/powerpc64/ioctls_inc0.h
new file mode 100644
index 000000000..f9939faa4
--- /dev/null
+++ b/src/linux/powerpc64/ioctls_inc0.h
@@ -0,0 +1 @@
+#include "64/ioctls_inc.h"
diff --git a/src/linux/powerpc64/ioctls_inc1.h b/src/linux/powerpc64/ioctls_inc1.h
new file mode 100644
index 000000000..2e5b2de96
--- /dev/null
+++ b/src/linux/powerpc64/ioctls_inc1.h
@@ -0,0 +1 @@
+#include "powerpc/ioctls_inc0.h"
diff --git a/src/linux/powerpc64/raw_syscall.h b/src/linux/powerpc64/raw_syscall.h
new file mode 100644
index 000000000..05577ee9c
--- /dev/null
+++ b/src/linux/powerpc64/raw_syscall.h
@@ -0,0 +1 @@
+#include "powerpc/raw_syscall.h"
diff --git a/src/linux/powerpc64/rt_sigframe.h b/src/linux/powerpc64/rt_sigframe.h
new file mode 100644
index 000000000..78e13eac5
--- /dev/null
+++ b/src/linux/powerpc64/rt_sigframe.h
@@ -0,0 +1,22 @@
+/*
+ * Copyright (c) 2017-2018 Dmitry V. Levin <ldv@strace.io>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef __powerpc64__
+# include "../rt_sigframe.h"
+#else
+# ifndef STRACE_RT_SIGFRAME_H
+# define STRACE_RT_SIGFRAME_H
+
+# include <signal.h>
+
+typedef struct {
+ ucontext_t uc;
+ /* more data follows */
+} struct_rt_sigframe;
+
+# endif /* !STRACE_RT_SIGFRAME_H */
+#endif /* !__powerpc64__ */
diff --git a/src/linux/powerpc64/set_error.c b/src/linux/powerpc64/set_error.c
new file mode 100644
index 000000000..b8dc768fc
--- /dev/null
+++ b/src/linux/powerpc64/set_error.c
@@ -0,0 +1 @@
+#include "powerpc/set_error.c"
diff --git a/src/linux/powerpc64/set_scno.c b/src/linux/powerpc64/set_scno.c
new file mode 100644
index 000000000..c23bb83e9
--- /dev/null
+++ b/src/linux/powerpc64/set_scno.c
@@ -0,0 +1 @@
+#include "powerpc/set_scno.c"
diff --git a/src/linux/powerpc64/syscallent.h b/src/linux/powerpc64/syscallent.h
new file mode 100644
index 000000000..2feb068de
--- /dev/null
+++ b/src/linux/powerpc64/syscallent.h
@@ -0,0 +1,399 @@
+/*
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993, 1994, 1995 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1995-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+[ 0] = { 0, 0, SEN(restart_syscall), "restart_syscall" },
+[ 1] = { 1, TP|SE, SEN(exit), "exit" },
+[ 2] = { 0, TP, SEN(fork), "fork" },
+[ 3] = { 3, TD, SEN(read), "read" },
+[ 4] = { 3, TD, SEN(write), "write" },
+[ 5] = { 3, TD|TF, SEN(open), "open" },
+[ 6] = { 1, TD, SEN(close), "close" },
+[ 7] = { 3, TP, SEN(waitpid), "waitpid" },
+[ 8] = { 2, TD|TF, SEN(creat), "creat" },
+[ 9] = { 2, TF, SEN(link), "link" },
+[ 10] = { 1, TF, SEN(unlink), "unlink" },
+[ 11] = { 3, TF|TP|TSD|SE|SI, SEN(execve), "execve" },
+[ 12] = { 1, TF, SEN(chdir), "chdir" },
+[ 13] = { 1, TCL, SEN(time), "time" },
+[ 14] = { 3, TF, SEN(mknod), "mknod" },
+[ 15] = { 2, TF, SEN(chmod), "chmod" },
+[ 16] = { 3, TF, SEN(chown), "lchown" },
+[ 17] = { 0, TM, SEN(break), "break" },
+[ 18] = { 2, TF|TST|TSTA, SEN(oldstat), "oldstat" },
+[ 19] = { 3, TD, SEN(lseek), "lseek" },
+[ 20] = { 0, PU|NF, SEN(getpid), "getpid" },
+[ 21] = { 5, TF, SEN(mount), "mount" },
+[ 22] = { 1, TF, SEN(umount), "umount" },
+[ 23] = { 1, TC, SEN(setuid), "setuid" },
+[ 24] = { 0, TC|PU|NF, SEN(getuid), "getuid" },
+[ 25] = { 1, 0, SEN(stime), "stime" },
+[ 26] = { 4, 0, SEN(ptrace), "ptrace" },
+[ 27] = { 1, 0, SEN(alarm), "alarm" },
+[ 28] = { 2, TD|TFST|TSTA, SEN(oldfstat), "oldfstat" },
+[ 29] = { 0, TS, SEN(pause), "pause" },
+[ 30] = { 2, TF, SEN(utime), "utime" },
+[ 31] = { 2, 0, SEN(stty), "stty" },
+[ 32] = { 2, 0, SEN(gtty), "gtty" },
+[ 33] = { 2, TF, SEN(access), "access" },
+[ 34] = { 1, 0, SEN(nice), "nice" },
+[ 35] = { 0, 0, SEN(ftime), "ftime" },
+[ 36] = { 0, 0, SEN(sync), "sync" },
+[ 37] = { 2, TS|TP, SEN(kill), "kill" },
+[ 38] = { 2, TF, SEN(rename), "rename" },
+[ 39] = { 2, TF, SEN(mkdir), "mkdir" },
+[ 40] = { 1, TF, SEN(rmdir), "rmdir" },
+[ 41] = { 1, TD, SEN(dup), "dup" },
+[ 42] = { 1, TD, SEN(pipe), "pipe" },
+[ 43] = { 1, 0, SEN(times), "times" },
+[ 44] = { 0, 0, SEN(prof), "prof" },
+[ 45] = { 1, TM|SI, SEN(brk), "brk" },
+[ 46] = { 1, TC, SEN(setgid), "setgid" },
+[ 47] = { 0, TC|PU|NF, SEN(getgid), "getgid" },
+[ 48] = { 2, TS, SEN(signal), "signal" },
+[ 49] = { 0, TC|PU|NF, SEN(geteuid), "geteuid" },
+[ 50] = { 0, TC|PU|NF, SEN(getegid), "getegid" },
+[ 51] = { 1, TF, SEN(acct), "acct" },
+[ 52] = { 2, TF, SEN(umount2), "umount2" },
+[ 53] = { 0, 0, SEN(lock), "lock" },
+[ 54] = { 3, TD, SEN(ioctl), "ioctl" },
+[ 55] = { 3, TD, SEN(fcntl), "fcntl" },
+[ 56] = { 0, 0, SEN(mpx), "mpx" },
+[ 57] = { 2, 0, SEN(setpgid), "setpgid" },
+[ 58] = { 2, 0, SEN(ulimit), "ulimit" },
+[ 59] = { 1, 0, SEN(oldolduname), "oldolduname" },
+[ 60] = { 1, NF, SEN(umask), "umask" },
+[ 61] = { 1, TF, SEN(chroot), "chroot" },
+[ 62] = { 2, TSFA, SEN(ustat), "ustat" },
+[ 63] = { 2, TD, SEN(dup2), "dup2" },
+[ 64] = { 0, PU|NF, SEN(getppid), "getppid" },
+[ 65] = { 0, PU|NF, SEN(getpgrp), "getpgrp" },
+[ 66] = { 0, 0, SEN(setsid), "setsid" },
+[ 67] = { 3, TS, SEN(sigaction), "sigaction" },
+[ 68] = { 0, TS, SEN(sgetmask), "sgetmask" },
+[ 69] = { 1, TS, SEN(ssetmask), "ssetmask" },
+[ 70] = { 2, TC, SEN(setreuid), "setreuid" },
+[ 71] = { 2, TC, SEN(setregid), "setregid" },
+[ 72] = { 1, TS, SEN(sigsuspend), "sigsuspend" },
+[ 73] = { 1, TS, SEN(sigpending), "sigpending" },
+[ 74] = { 2, 0, SEN(sethostname), "sethostname" },
+[ 75] = { 2, 0, SEN(setrlimit), "setrlimit" },
+[ 76] = { 2, 0, SEN(getrlimit), "getrlimit" },
+[ 77] = { 2, 0, SEN(getrusage), "getrusage" },
+[ 78] = { 2, TCL, SEN(gettimeofday), "gettimeofday" },
+[ 79] = { 2, TCL, SEN(settimeofday), "settimeofday" },
+[ 80] = { 2, TC, SEN(getgroups), "getgroups" },
+[ 81] = { 2, TC, SEN(setgroups), "setgroups" },
+[ 82] = { 1, TD, SEN(oldselect), "select" },
+[ 83] = { 2, TF, SEN(symlink), "symlink" },
+[ 84] = { 2, TF|TLST|TSTA, SEN(oldlstat), "oldlstat" },
+[ 85] = { 3, TF, SEN(readlink), "readlink" },
+[ 86] = { 1, TF, SEN(uselib), "uselib" },
+[ 87] = { 2, TF, SEN(swapon), "swapon" },
+[ 88] = { 4, 0, SEN(reboot), "reboot" },
+[ 89] = { 3, TD, SEN(readdir), "readdir" },
+[ 90] = { 6, TD|TM|SI, SEN(mmap), "mmap" },
+[ 91] = { 2, TM|SI, SEN(munmap), "munmap" },
+[ 92] = { 2, TF, SEN(truncate), "truncate" },
+[ 93] = { 2, TD, SEN(ftruncate), "ftruncate" },
+[ 94] = { 2, TD, SEN(fchmod), "fchmod" },
+[ 95] = { 3, TD, SEN(fchown), "fchown" },
+[ 96] = { 2, 0, SEN(getpriority), "getpriority" },
+[ 97] = { 3, 0, SEN(setpriority), "setpriority" },
+[ 98] = { 4, 0, SEN(profil), "profil" },
+[ 99] = { 2, TF|TSF|TSFA, SEN(statfs), "statfs" },
+[100] = { 2, TD|TFSF|TSFA, SEN(fstatfs), "fstatfs" },
+[101] = { 3, 0, SEN(ioperm), "ioperm" },
+[102] = { 2, TD|TSD, SEN(socketcall), "socketcall" },
+[103] = { 3, 0, SEN(syslog), "syslog" },
+[104] = { 3, 0, SEN(setitimer), "setitimer" },
+[105] = { 2, 0, SEN(getitimer), "getitimer" },
+[106] = { 2, TF|TST|TSTA, SEN(stat), "stat" },
+[107] = { 2, TF|TLST|TSTA, SEN(lstat), "lstat" },
+[108] = { 2, TD|TFST|TSTA, SEN(fstat), "fstat" },
+[109] = { 1, 0, SEN(olduname), "olduname" },
+[110] = { 1, 0, SEN(iopl), "iopl" },
+[111] = { 0, 0, SEN(vhangup), "vhangup" },
+[112] = { 0, 0, SEN(idle), "idle" },
+[113] = { 5, 0, SEN(vm86), "vm86" },
+[114] = { 4, TP, SEN(wait4), "wait4" },
+[115] = { 1, TF, SEN(swapoff), "swapoff" },
+[116] = { 1, 0, SEN(sysinfo), "sysinfo" },
+[117] = { 6, TI|TSD, SEN(ipc), "ipc" },
+[118] = { 1, TD, SEN(fsync), "fsync" },
+[119] = { 0, TS, SEN(sigreturn), "sigreturn" },
+[120] = { 5, TP, SEN(clone), "clone" },
+[121] = { 2, 0, SEN(setdomainname), "setdomainname" },
+[122] = { 1, 0, SEN(uname), "uname" },
+[123] = { 5, 0, SEN(printargs), "modify_ldt" },
+[124] = { 1, TCL, SEN(adjtimex64), "adjtimex" },
+[125] = { 3, TM|SI, SEN(mprotect), "mprotect" },
+[126] = { 3, TS, SEN(sigprocmask), "sigprocmask" },
+[127] = { 2, 0, SEN(create_module), "create_module" },
+[128] = { 3, 0, SEN(init_module), "init_module" },
+[129] = { 2, 0, SEN(delete_module), "delete_module" },
+[130] = { 1, 0, SEN(get_kernel_syms), "get_kernel_syms" },
+[131] = { 4, TF, SEN(quotactl), "quotactl" },
+[132] = { 1, 0, SEN(getpgid), "getpgid" },
+[133] = { 1, TD, SEN(fchdir), "fchdir" },
+[134] = { 2, 0, SEN(bdflush), "bdflush" },
+[135] = { 3, 0, SEN(sysfs), "sysfs" },
+[136] = { 1, NF, SEN(personality), "personality" },
+[137] = { 5, 0, SEN(afs_syscall), "afs_syscall" },
+[138] = { 1, TC|NF, SEN(setfsuid), "setfsuid" },
+[139] = { 1, TC|NF, SEN(setfsgid), "setfsgid" },
+[140] = { 5, TD, SEN(llseek), "_llseek" },
+[141] = { 3, TD, SEN(getdents), "getdents" },
+[142] = { 5, TD, SEN(select), "_newselect" },
+[143] = { 2, TD, SEN(flock), "flock" },
+[144] = { 3, TM, SEN(msync), "msync" },
+[145] = { 3, TD, SEN(readv), "readv" },
+[146] = { 3, TD, SEN(writev), "writev" },
+[147] = { 1, 0, SEN(getsid), "getsid" },
+[148] = { 1, TD, SEN(fdatasync), "fdatasync" },
+[149] = { 1, 0, SEN(sysctl), "_sysctl" },
+[150] = { 2, TM, SEN(mlock), "mlock" },
+[151] = { 2, TM, SEN(munlock), "munlock" },
+[152] = { 1, TM, SEN(mlockall), "mlockall" },
+[153] = { 0, TM, SEN(munlockall), "munlockall" },
+[154] = { 2, 0, SEN(sched_setparam), "sched_setparam" },
+[155] = { 2, 0, SEN(sched_getparam), "sched_getparam" },
+[156] = { 3, 0, SEN(sched_setscheduler), "sched_setscheduler" },
+[157] = { 1, 0, SEN(sched_getscheduler), "sched_getscheduler" },
+[158] = { 0, 0, SEN(sched_yield), "sched_yield" },
+[159] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"},
+[160] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"},
+[161] = { 2, 0, SEN(sched_rr_get_interval_time64),"sched_rr_get_interval"},
+[162] = { 2, 0, SEN(nanosleep_time64), "nanosleep" },
+[163] = { 5, TM|SI, SEN(mremap), "mremap" },
+[164] = { 3, TC, SEN(setresuid), "setresuid" },
+[165] = { 3, TC, SEN(getresuid), "getresuid" },
+[166] = { 5, 0, SEN(query_module), "query_module" },
+[167] = { 3, TD, SEN(poll_time64), "poll" },
+[168] = { 3, 0, SEN(nfsservctl), "nfsservctl" },
+[169] = { 3, TC, SEN(setresgid), "setresgid" },
+[170] = { 3, TC, SEN(getresgid), "getresgid" },
+[171] = { 5, TC, SEN(prctl), "prctl" },
+[172] = { 0, TS, SEN(rt_sigreturn), "rt_sigreturn" },
+[173] = { 4, TS, SEN(rt_sigaction), "rt_sigaction" },
+[174] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" },
+[175] = { 2, TS, SEN(rt_sigpending), "rt_sigpending" },
+[176] = { 4, TS, SEN(rt_sigtimedwait_time64), "rt_sigtimedwait" },
+[177] = { 3, TS|TP, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" },
+[178] = { 2, TS, SEN(rt_sigsuspend), "rt_sigsuspend" },
+[179] = { 4, TD, SEN(pread), "pread64" },
+[180] = { 4, TD, SEN(pwrite), "pwrite64" },
+[181] = { 3, TF, SEN(chown), "chown" },
+[182] = { 2, TF, SEN(getcwd), "getcwd" },
+[183] = { 2, TC, SEN(capget), "capget" },
+[184] = { 2, TC, SEN(capset), "capset" },
+[185] = { 2, TS, SEN(sigaltstack), "sigaltstack" },
+[186] = { 4, TD|TN, SEN(sendfile), "sendfile" },
+[187] = { 5, TN, SEN(getpmsg), "getpmsg" },
+[188] = { 5, TN, SEN(putpmsg), "putpmsg" },
+[189] = { 0, TP, SEN(vfork), "vfork" },
+[190] = { 2, 0, SEN(getrlimit), "ugetrlimit" },
+[191] = { 3, TD, SEN(readahead), "readahead" },
+[192 ... 197] = { },
+[198] = { 5, 0, SEN(printargs), "pciconfig_read" },
+[199] = { 5, 0, SEN(printargs), "pciconfig_write" },
+[200] = { 3, 0, SEN(printargs), "pciconfig_iobase" },
+[201] = { 6, 0, SEN(printargs), "multiplexer" },
+[202] = { 3, TD, SEN(getdents64), "getdents64" },
+[203] = { 2, TF, SEN(pivotroot), "pivot_root" },
+[204] = { },
+[205] = { 3, TM, SEN(madvise), "madvise" },
+[206] = { 3, TM, SEN(mincore), "mincore" },
+[207] = { 0, PU|NF, SEN(gettid), "gettid" },
+[208] = { 2, TS|TP, SEN(tkill), "tkill" },
+[209] = { 5, TF, SEN(setxattr), "setxattr" },
+[210] = { 5, TF, SEN(setxattr), "lsetxattr" },
+[211] = { 5, TD, SEN(fsetxattr), "fsetxattr" },
+[212] = { 4, TF, SEN(getxattr), "getxattr" },
+[213] = { 4, TF, SEN(getxattr), "lgetxattr" },
+[214] = { 4, TD, SEN(fgetxattr), "fgetxattr" },
+[215] = { 3, TF, SEN(listxattr), "listxattr" },
+[216] = { 3, TF, SEN(listxattr), "llistxattr" },
+[217] = { 3, TD, SEN(flistxattr), "flistxattr" },
+[218] = { 2, TF, SEN(removexattr), "removexattr" },
+[219] = { 2, TF, SEN(removexattr), "lremovexattr" },
+[220] = { 2, TD, SEN(fremovexattr), "fremovexattr" },
+[221] = { 6, 0, SEN(futex_time64), "futex" },
+[222] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" },
+[223] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" },
+[224] = { },
+[225] = { 5, 0, SEN(printargs), "tuxcall" },
+[226] = { },
+[227] = { 2, TM, SEN(io_setup), "io_setup" },
+[228] = { 1, TM, SEN(io_destroy), "io_destroy" },
+[229] = { 5, 0, SEN(io_getevents_time64), "io_getevents" },
+[230] = { 3, 0, SEN(io_submit), "io_submit" },
+[231] = { 3, 0, SEN(io_cancel), "io_cancel" },
+[232] = { 1, 0, SEN(set_tid_address), "set_tid_address" },
+[233] = { 4, TD, SEN(fadvise64), "fadvise64" },
+[234] = { 1, TP|SE, SEN(exit), "exit_group" },
+[235] = { 3, 0, SEN(lookup_dcookie), "lookup_dcookie" },
+[236] = { 1, TD, SEN(epoll_create), "epoll_create" },
+[237] = { 4, TD, SEN(epoll_ctl), "epoll_ctl" },
+[238] = { 4, TD, SEN(epoll_wait), "epoll_wait" },
+[239] = { 5, TM|SI, SEN(remap_file_pages), "remap_file_pages" },
+[240] = { 3, 0, SEN(timer_create), "timer_create" },
+[241] = { 4, 0, SEN(timer_settime64), "timer_settime" },
+[242] = { 2, 0, SEN(timer_gettime64), "timer_gettime" },
+[243] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" },
+[244] = { 1, 0, SEN(timer_delete), "timer_delete" },
+[245] = { 2, TCL, SEN(clock_settime64), "clock_settime" },
+[246] = { 2, TCL, SEN(clock_gettime64), "clock_gettime" },
+[247] = { 2, TCL, SEN(clock_getres_time64), "clock_getres" },
+[248] = { 4, 0, SEN(clock_nanosleep_time64), "clock_nanosleep" },
+[249] = { 2, 0, SEN(printargs), "swapcontext" },
+[250] = { 3, TS|TP, SEN(tgkill), "tgkill" },
+[251] = { 2, TF, SEN(utimes), "utimes" },
+[252] = { 3, TF|TSF|TSFA, SEN(statfs64), "statfs64" },
+[253] = { 3, TD|TFSF|TSFA, SEN(fstatfs64), "fstatfs64" },
+[254] = { },
+[255] = { 1, 0, SEN(printargs), "rtas" },
+[256] = { 5, 0, SEN(printargs), "sys_debug_setcontext" },
+[257] = { 5, 0, SEN(vserver), "vserver" },
+[258] = { 4, TM, SEN(migrate_pages), "migrate_pages" },
+[259] = { 6, TM, SEN(mbind), "mbind" },
+[260] = { 5, TM, SEN(get_mempolicy), "get_mempolicy" },
+[261] = { 3, TM, SEN(set_mempolicy), "set_mempolicy" },
+[262] = { 4, TD, SEN(mq_open), "mq_open" },
+[263] = { 1, 0, SEN(mq_unlink), "mq_unlink" },
+[264] = { 5, TD, SEN(mq_timedsend_time64), "mq_timedsend" },
+[265] = { 5, TD, SEN(mq_timedreceive_time64), "mq_timedreceive" },
+[266] = { 2, TD, SEN(mq_notify), "mq_notify" },
+[267] = { 3, TD, SEN(mq_getsetattr), "mq_getsetattr" },
+[268] = { 4, 0, SEN(kexec_load), "kexec_load" },
+[269] = { 5, 0, SEN(add_key), "add_key" },
+[270] = { 4, 0, SEN(request_key), "request_key" },
+[271] = { 5, 0, SEN(keyctl), "keyctl" },
+[272] = { 5, TP, SEN(waitid), "waitid" },
+[273] = { 3, 0, SEN(ioprio_set), "ioprio_set" },
+[274] = { 2, 0, SEN(ioprio_get), "ioprio_get" },
+[275] = { 0, TD, SEN(inotify_init), "inotify_init" },
+[276] = { 3, TD|TF, SEN(inotify_add_watch), "inotify_add_watch" },
+[277] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" },
+[278] = { 3, 0, SEN(printargs), "spu_run" },
+[279] = { 4, 0, SEN(printargs), "spu_create" },
+[280] = { 6, TD, SEN(pselect6_time64), "pselect6" },
+[281] = { 5, TD, SEN(ppoll_time64), "ppoll" },
+[282] = { 1, 0, SEN(unshare), "unshare" },
+[283] = { 6, TD, SEN(splice), "splice" },
+[284] = { 4, TD, SEN(tee), "tee" },
+[285] = { 4, TD, SEN(vmsplice), "vmsplice" },
+[286] = { 4, TD|TF, SEN(openat), "openat" },
+[287] = { 3, TD|TF, SEN(mkdirat), "mkdirat" },
+[288] = { 4, TD|TF, SEN(mknodat), "mknodat" },
+[289] = { 5, TD|TF, SEN(fchownat), "fchownat" },
+[290] = { 3, TD|TF, SEN(futimesat), "futimesat" },
+[291] = { 4, TD|TF|TFST|TSTA,SEN(newfstatat), "newfstatat" },
+[292] = { 3, TD|TF, SEN(unlinkat), "unlinkat" },
+[293] = { 4, TD|TF, SEN(renameat), "renameat" },
+[294] = { 5, TD|TF, SEN(linkat), "linkat" },
+[295] = { 3, TD|TF, SEN(symlinkat), "symlinkat" },
+[296] = { 4, TD|TF, SEN(readlinkat), "readlinkat" },
+[297] = { 3, TD|TF, SEN(fchmodat), "fchmodat" },
+[298] = { 3, TD|TF, SEN(faccessat), "faccessat" },
+[299] = { 3, 0, SEN(get_robust_list), "get_robust_list" },
+[300] = { 2, 0, SEN(set_robust_list), "set_robust_list" },
+[301] = { 6, TM, SEN(move_pages), "move_pages" },
+[302] = { 3, 0, SEN(getcpu), "getcpu" },
+[303] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" },
+[304] = { 4, TD|TF, SEN(utimensat_time64), "utimensat" },
+[305] = { 3, TD|TS, SEN(signalfd), "signalfd" },
+[306] = { 2, TD, SEN(timerfd_create), "timerfd_create" },
+[307] = { 1, TD, SEN(eventfd), "eventfd" },
+[308] = { 4, TD, SEN(sync_file_range2), "sync_file_range2" },
+[309] = { 4, TD, SEN(fallocate), "fallocate" },
+[310] = { 3, 0, SEN(subpage_prot), "subpage_prot" },
+[311] = { 4, TD, SEN(timerfd_settime64), "timerfd_settime" },
+[312] = { 2, TD, SEN(timerfd_gettime64), "timerfd_gettime" },
+[313] = { 4, TD|TS, SEN(signalfd4), "signalfd4" },
+[314] = { 2, TD, SEN(eventfd2), "eventfd2" },
+[315] = { 1, TD, SEN(epoll_create1), "epoll_create1" },
+[316] = { 3, TD, SEN(dup3), "dup3" },
+[317] = { 2, TD, SEN(pipe2), "pipe2" },
+[318] = { 1, TD, SEN(inotify_init1), "inotify_init1" },
+[319] = { 5, TD, SEN(perf_event_open), "perf_event_open" },
+[320] = { 4, TD, SEN(preadv), "preadv" },
+[321] = { 4, TD, SEN(pwritev), "pwritev" },
+[322] = { 4, TP|TS, SEN(rt_tgsigqueueinfo), "rt_tgsigqueueinfo" },
+[323] = { 2, TD, SEN(fanotify_init), "fanotify_init" },
+[324] = { 5, TD|TF, SEN(fanotify_mark), "fanotify_mark" },
+[325] = { 4, 0, SEN(prlimit64), "prlimit64" },
+[326] = { 3, TN, SEN(socket), "socket" },
+[327] = { 3, TN, SEN(bind), "bind" },
+[328] = { 3, TN, SEN(connect), "connect" },
+[329] = { 2, TN, SEN(listen), "listen" },
+[330] = { 3, TN, SEN(accept), "accept" },
+[331] = { 3, TN, SEN(getsockname), "getsockname" },
+[332] = { 3, TN, SEN(getpeername), "getpeername" },
+[333] = { 4, TN, SEN(socketpair), "socketpair" },
+[334] = { 4, TN, SEN(send), "send" },
+[335] = { 6, TN, SEN(sendto), "sendto" },
+[336] = { 4, TN, SEN(recv), "recv" },
+[337] = { 6, TN, SEN(recvfrom), "recvfrom" },
+[338] = { 2, TN, SEN(shutdown), "shutdown" },
+[339] = { 5, TN, SEN(setsockopt), "setsockopt" },
+[340] = { 5, TN, SEN(getsockopt), "getsockopt" },
+[341] = { 3, TN, SEN(sendmsg), "sendmsg" },
+[342] = { 3, TN, SEN(recvmsg), "recvmsg" },
+[343] = { 5, TN, SEN(recvmmsg_time64), "recvmmsg" },
+[344] = { 4, TN, SEN(accept4), "accept4" },
+[345] = { 5, TD|TF, SEN(name_to_handle_at), "name_to_handle_at" },
+[346] = { 3, TD, SEN(open_by_handle_at), "open_by_handle_at" },
+[347] = { 2, TCL, SEN(clock_adjtime64), "clock_adjtime" },
+[348] = { 1, TD, SEN(syncfs), "syncfs" },
+[349] = { 4, TN, SEN(sendmmsg), "sendmmsg" },
+[350] = { 2, TD, SEN(setns), "setns" },
+[351] = { 6, 0, SEN(process_vm_readv), "process_vm_readv" },
+[352] = { 6, 0, SEN(process_vm_writev), "process_vm_writev" },
+[353] = { 3, TD, SEN(finit_module), "finit_module" },
+[354] = { 5, 0, SEN(kcmp), "kcmp" },
+[355] = { 3, 0, SEN(sched_setattr), "sched_setattr" },
+[356] = { 4, 0, SEN(sched_getattr), "sched_getattr" },
+[357] = { 5, TD|TF, SEN(renameat2), "renameat2" },
+[358] = { 3, 0, SEN(seccomp), "seccomp" },
+[359] = { 3, 0, SEN(getrandom), "getrandom" },
+[360] = { 2, TD, SEN(memfd_create), "memfd_create" },
+[361] = { 3, TD, SEN(bpf), "bpf" },
+[362] = { 5, TD|TF|TP|TSD|SE|SI, SEN(execveat), "execveat" },
+[363] = { 0, 0, SEN(printargs), "switch_endian" },
+[364] = { 1, TD, SEN(userfaultfd), "userfaultfd" },
+[365] = { 3, 0, SEN(membarrier), "membarrier" },
+/* originally left for IPC, now unused */
+[378] = { 3, TM, SEN(mlock2), "mlock2" },
+[379] = { 6, TD, SEN(copy_file_range), "copy_file_range" },
+[380] = { 6, TD, SEN(preadv2), "preadv2" },
+[381] = { 6, TD, SEN(pwritev2), "pwritev2" },
+[382] = { 5, TD, SEN(kexec_file_load), "kexec_file_load" },
+[383] = { 5, TD|TF|TFST|TSTA,SEN(statx), "statx" },
+[384] = { 2, 0, SEN(pkey_alloc), "pkey_alloc" },
+[385] = { 1, 0, SEN(pkey_free), "pkey_free" },
+[386] = { 4, TM|SI, SEN(pkey_mprotect), "pkey_mprotect" },
+[387] = { 4, 0, SEN(rseq), "rseq" },
+[388] = { 6, 0, SEN(io_pgetevents_time64), "io_pgetevents" },
+/* room for arch specific syscalls */
+[392] = { 4, TI, SEN(semtimedop_time64), "semtimedop" },
+[393] = { 3, TI, SEN(semget), "semget" },
+[394] = { 4, TI, SEN(semctl), "semctl" },
+[395] = { 3, TI, SEN(shmget), "shmget" },
+[396] = { 3, TI, SEN(shmctl), "shmctl" },
+[397] = { 3, TI|TM|SI, SEN(shmat), "shmat" },
+[398] = { 1, TI|TM|SI, SEN(shmdt), "shmdt" },
+[399] = { 2, TI, SEN(msgget), "msgget" },
+[400] = { 4, TI, SEN(msgsnd), "msgsnd" },
+[401] = { 5, TI, SEN(msgrcv), "msgrcv" },
+[402] = { 3, TI, SEN(msgctl), "msgctl" },
+/* [403 ... 423] - reserved to sync up with other architectures */
+#include "syscallent-common.h"
+
+#define SYS_socket_subcall 500
+#include "subcall64.h"
diff --git a/src/linux/powerpc64/syscallent1.h b/src/linux/powerpc64/syscallent1.h
new file mode 100644
index 000000000..64a9f01c7
--- /dev/null
+++ b/src/linux/powerpc64/syscallent1.h
@@ -0,0 +1 @@
+#include "powerpc/syscallent.h"
diff --git a/src/linux/powerpc64/userent.h b/src/linux/powerpc64/userent.h
new file mode 100644
index 000000000..27c240b5b
--- /dev/null
+++ b/src/linux/powerpc64/userent.h
@@ -0,0 +1 @@
+#include "powerpc/userent.h"
diff --git a/src/linux/powerpc64le/arch_defs_.h b/src/linux/powerpc64le/arch_defs_.h
new file mode 100644
index 000000000..494672a02
--- /dev/null
+++ b/src/linux/powerpc64le/arch_defs_.h
@@ -0,0 +1,9 @@
+/*
+ * Copyright (c) 2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#define HAVE_ARCH_OLD_SELECT 1
+#define HAVE_ARCH_DEDICATED_ERR_REG 1
diff --git a/src/linux/powerpc64le/arch_regs.c b/src/linux/powerpc64le/arch_regs.c
new file mode 100644
index 000000000..8c4a45d67
--- /dev/null
+++ b/src/linux/powerpc64le/arch_regs.c
@@ -0,0 +1 @@
+#include "../powerpc/arch_regs.c"
diff --git a/src/linux/powerpc64le/arch_rt_sigframe.c b/src/linux/powerpc64le/arch_rt_sigframe.c
new file mode 100644
index 000000000..176fa8227
--- /dev/null
+++ b/src/linux/powerpc64le/arch_rt_sigframe.c
@@ -0,0 +1,13 @@
+/*
+ * Copyright (c) 2017-2018 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2018-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+FUNC_GET_RT_SIGFRAME_ADDR
+{
+ kernel_ulong_t sp;
+ return get_stack_pointer(tcp, &sp) ? sp : 0;
+}
diff --git a/src/linux/powerpc64le/errnoent.h b/src/linux/powerpc64le/errnoent.h
new file mode 100644
index 000000000..945ce8538
--- /dev/null
+++ b/src/linux/powerpc64le/errnoent.h
@@ -0,0 +1 @@
+#include "../powerpc64/errnoent.h"
diff --git a/src/linux/powerpc64le/get_error.c b/src/linux/powerpc64le/get_error.c
new file mode 100644
index 000000000..c7fc341d9
--- /dev/null
+++ b/src/linux/powerpc64le/get_error.c
@@ -0,0 +1 @@
+#include "../powerpc64/get_error.c"
diff --git a/src/linux/powerpc64le/get_scno.c b/src/linux/powerpc64le/get_scno.c
new file mode 100644
index 000000000..9a0c9e4aa
--- /dev/null
+++ b/src/linux/powerpc64le/get_scno.c
@@ -0,0 +1,14 @@
+/*
+ * Copyright (c) 2015-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+/* Return codes: 1 - ok, 0 - ignore, other - error. */
+static int
+arch_get_scno(struct tcb *tcp)
+{
+ tcp->scno = ppc_regs.gpr[0];
+ return 1;
+}
diff --git a/src/linux/powerpc64le/get_syscall_args.c b/src/linux/powerpc64le/get_syscall_args.c
new file mode 100644
index 000000000..281eb6061
--- /dev/null
+++ b/src/linux/powerpc64le/get_syscall_args.c
@@ -0,0 +1 @@
+#include "../powerpc64/get_syscall_args.c"
diff --git a/src/linux/powerpc64le/ioctls_arch0.h b/src/linux/powerpc64le/ioctls_arch0.h
new file mode 100644
index 000000000..14d0c0b10
--- /dev/null
+++ b/src/linux/powerpc64le/ioctls_arch0.h
@@ -0,0 +1 @@
+#include "../powerpc64/ioctls_arch0.h"
diff --git a/src/linux/powerpc64le/ioctls_inc0.h b/src/linux/powerpc64le/ioctls_inc0.h
new file mode 100644
index 000000000..a89fa3c0a
--- /dev/null
+++ b/src/linux/powerpc64le/ioctls_inc0.h
@@ -0,0 +1 @@
+#include "../powerpc64/ioctls_inc0.h"
diff --git a/src/linux/powerpc64le/raw_syscall.h b/src/linux/powerpc64le/raw_syscall.h
new file mode 100644
index 000000000..f1800fc56
--- /dev/null
+++ b/src/linux/powerpc64le/raw_syscall.h
@@ -0,0 +1 @@
+#include "../powerpc64/raw_syscall.h"
diff --git a/src/linux/powerpc64le/rt_sigframe.h b/src/linux/powerpc64le/rt_sigframe.h
new file mode 100644
index 000000000..cd8902f46
--- /dev/null
+++ b/src/linux/powerpc64le/rt_sigframe.h
@@ -0,0 +1 @@
+#include "../powerpc64/rt_sigframe.h"
diff --git a/src/linux/powerpc64le/set_error.c b/src/linux/powerpc64le/set_error.c
new file mode 100644
index 000000000..207ffe9a5
--- /dev/null
+++ b/src/linux/powerpc64le/set_error.c
@@ -0,0 +1 @@
+#include "../powerpc64/set_error.c"
diff --git a/src/linux/powerpc64le/set_scno.c b/src/linux/powerpc64le/set_scno.c
new file mode 100644
index 000000000..d3f6479ab
--- /dev/null
+++ b/src/linux/powerpc64le/set_scno.c
@@ -0,0 +1 @@
+#include "../powerpc64/set_scno.c"
diff --git a/src/linux/powerpc64le/syscallent.h b/src/linux/powerpc64le/syscallent.h
new file mode 100644
index 000000000..785a81b0d
--- /dev/null
+++ b/src/linux/powerpc64le/syscallent.h
@@ -0,0 +1 @@
+#include "../powerpc64/syscallent.h"
diff --git a/src/linux/powerpc64le/userent.h b/src/linux/powerpc64le/userent.h
new file mode 100644
index 000000000..1f7118117
--- /dev/null
+++ b/src/linux/powerpc64le/userent.h
@@ -0,0 +1 @@
+#include "../powerpc64/userent.h"
diff --git a/src/linux/ptrace_pokeuser.c b/src/linux/ptrace_pokeuser.c
new file mode 100644
index 000000000..4a212a02a
--- /dev/null
+++ b/src/linux/ptrace_pokeuser.c
@@ -0,0 +1,12 @@
+/*
+ * Copyright (c) 2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static long
+ptrace_pokeuser(int pid, unsigned long off, kernel_ulong_t val)
+{
+ return ptrace(PTRACE_POKEUSER, pid, off, val);
+}
diff --git a/src/linux/raw_syscall.h b/src/linux/raw_syscall.h
new file mode 100644
index 000000000..da84fa5f6
--- /dev/null
+++ b/src/linux/raw_syscall.h
@@ -0,0 +1 @@
+/* nothing */
diff --git a/src/linux/riscv64/arch_regs.c b/src/linux/riscv64/arch_regs.c
new file mode 100644
index 000000000..5a2bab905
--- /dev/null
+++ b/src/linux/riscv64/arch_regs.c
@@ -0,0 +1,11 @@
+/*
+ * Copyright (c) 2016-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static struct user_regs_struct riscv_regs;
+#define ARCH_REGS_FOR_GETREGSET riscv_regs
+#define ARCH_PC_REG riscv_regs.pc
+#define ARCH_SP_REG riscv_regs.sp
diff --git a/src/linux/riscv64/get_error.c b/src/linux/riscv64/get_error.c
new file mode 100644
index 000000000..ac20c7690
--- /dev/null
+++ b/src/linux/riscv64/get_error.c
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2016-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "negated_errno.h"
+
+static void
+arch_get_error(struct tcb *tcp, const bool check_errno)
+{
+ if (check_errno && is_negated_errno(riscv_regs.a0)) {
+ tcp->u_rval = -1;
+ tcp->u_error = -riscv_regs.a0;
+ } else {
+ tcp->u_rval = riscv_regs.a0;
+ }
+}
diff --git a/src/linux/riscv64/get_scno.c b/src/linux/riscv64/get_scno.c
new file mode 100644
index 000000000..c77f4f550
--- /dev/null
+++ b/src/linux/riscv64/get_scno.c
@@ -0,0 +1,14 @@
+/*
+ * Copyright (c) 2015-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+/* Return codes: 1 - ok, 0 - ignore, other - error. */
+static int
+arch_get_scno(struct tcb *tcp)
+{
+ tcp->scno = riscv_regs.a7;
+ return 1;
+}
diff --git a/src/linux/riscv64/get_syscall_args.c b/src/linux/riscv64/get_syscall_args.c
new file mode 100644
index 000000000..0167fa520
--- /dev/null
+++ b/src/linux/riscv64/get_syscall_args.c
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2016-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+/* Return -1 on error or 1 on success (never 0!). */
+static int
+arch_get_syscall_args(struct tcb *tcp)
+{
+ tcp->u_arg[0] = riscv_regs.a0;
+ tcp->u_arg[1] = riscv_regs.a1;
+ tcp->u_arg[2] = riscv_regs.a2;
+ tcp->u_arg[3] = riscv_regs.a3;
+ tcp->u_arg[4] = riscv_regs.a4;
+ tcp->u_arg[5] = riscv_regs.a5;
+ return 1;
+}
diff --git a/src/linux/riscv64/ioctls_arch0.h b/src/linux/riscv64/ioctls_arch0.h
new file mode 100644
index 000000000..9c039fc86
--- /dev/null
+++ b/src/linux/riscv64/ioctls_arch0.h
@@ -0,0 +1 @@
+/* Generated by ioctls_gen.sh from definitions found in $linux/arch/riscv/include/ tree. */
diff --git a/src/linux/riscv64/ioctls_inc0.h b/src/linux/riscv64/ioctls_inc0.h
new file mode 100644
index 000000000..f9939faa4
--- /dev/null
+++ b/src/linux/riscv64/ioctls_inc0.h
@@ -0,0 +1 @@
+#include "64/ioctls_inc.h"
diff --git a/src/linux/riscv64/raw_syscall.h b/src/linux/riscv64/raw_syscall.h
new file mode 100644
index 000000000..932975cdb
--- /dev/null
+++ b/src/linux/riscv64/raw_syscall.h
@@ -0,0 +1,29 @@
+/*
+ * Raw syscalls.
+ *
+ * Copyright (c) 2018-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_RAW_SYSCALL_H
+# define STRACE_RAW_SYSCALL_H
+
+# include "kernel_types.h"
+
+static inline kernel_ulong_t
+raw_syscall_0(const kernel_ulong_t nr, kernel_ulong_t *err)
+{
+ *err = 0;
+ register kernel_ulong_t a7 __asm__("a7") = nr;
+ register kernel_ulong_t a0 __asm__("a0");
+ __asm__ __volatile__("scall"
+ : "=r"(a0)
+ : "r"(a7)
+ : "memory");
+ return a0;
+}
+# define raw_syscall_0 raw_syscall_0
+
+#endif /* !STRACE_RAW_SYSCALL_H */
diff --git a/src/linux/riscv64/set_error.c b/src/linux/riscv64/set_error.c
new file mode 100644
index 000000000..b922e102a
--- /dev/null
+++ b/src/linux/riscv64/set_error.c
@@ -0,0 +1,20 @@
+/*
+ * Copyright (c) 2016-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static int
+arch_set_error(struct tcb *tcp)
+{
+ riscv_regs.a0 = -tcp->u_error;
+ return set_regs(tcp->pid);
+}
+
+static int
+arch_set_success(struct tcb *tcp)
+{
+ riscv_regs.a0 = tcp->u_rval;
+ return set_regs(tcp->pid);
+}
diff --git a/src/linux/riscv64/set_scno.c b/src/linux/riscv64/set_scno.c
new file mode 100644
index 000000000..f6d08d4c8
--- /dev/null
+++ b/src/linux/riscv64/set_scno.c
@@ -0,0 +1,15 @@
+/*
+ * Copyright (c) 2016-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static int
+arch_set_scno(struct tcb *tcp, kernel_ulong_t scno)
+{
+ if (ptrace_syscall_info_is_valid() && get_regs(tcp) < 0)
+ return -1;
+ riscv_regs.a7 = scno;
+ return set_regs(tcp->pid);
+}
diff --git a/src/linux/riscv64/syscallent.h b/src/linux/riscv64/syscallent.h
new file mode 100644
index 000000000..60c6ce587
--- /dev/null
+++ b/src/linux/riscv64/syscallent.h
@@ -0,0 +1,11 @@
+/*
+ * Copyright (c) 2016-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "64/syscallent.h"
+
+/* #define __NR_riscv_flush_icache (__NR_arch_specific_syscall + 15) */
+[259] = { 3, TM, SEN(riscv_flush_icache), "riscv_flush_icache" },
diff --git a/src/linux/rt_sigframe.h b/src/linux/rt_sigframe.h
new file mode 100644
index 000000000..bab5bc5f5
--- /dev/null
+++ b/src/linux/rt_sigframe.h
@@ -0,0 +1,21 @@
+/*
+ * Copyright (c) 2017-2018 Dmitry V. Levin <ldv@strace.io>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_RT_SIGFRAME_H
+# define STRACE_RT_SIGFRAME_H
+
+# include <signal.h>
+
+/* This is a generic definition for compatible architectures. */
+
+typedef struct {
+ siginfo_t info;
+ ucontext_t uc;
+ /* more data might follow */
+} struct_rt_sigframe;
+
+#endif /* !STRACE_RT_SIGFRAME_H */
diff --git a/src/linux/s390/arch_defs_.h b/src/linux/s390/arch_defs_.h
new file mode 100644
index 000000000..39b7658df
--- /dev/null
+++ b/src/linux/s390/arch_defs_.h
@@ -0,0 +1,11 @@
+/*
+ * Copyright (c) 2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#define HAVE_ARCH_OLD_MMAP 1
+#define HAVE_ARCH_OLD_MMAP_PGOFF 1
+#define HAVE_ARCH_UID16_SYSCALLS 1
+#define CAN_ARCH_BE_COMPAT_ON_64BIT_KERNEL 1
diff --git a/src/linux/s390/arch_regs.c b/src/linux/s390/arch_regs.c
new file mode 100644
index 000000000..e9bda5c0f
--- /dev/null
+++ b/src/linux/s390/arch_regs.c
@@ -0,0 +1,12 @@
+/*
+ * Copyright (c) 2015-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+/* PTRACE_GETREGSET on S390 is available since linux v2.6.27. */
+static s390_regs s390_regset;
+#define ARCH_REGS_FOR_GETREGSET s390_regset
+#define ARCH_PC_REG s390_regset.psw.addr
+#define ARCH_SP_REG s390_regset.gprs[15]
diff --git a/src/linux/s390/arch_sigreturn.c b/src/linux/s390/arch_sigreturn.c
new file mode 100644
index 000000000..0c9aa4fd5
--- /dev/null
+++ b/src/linux/s390/arch_sigreturn.c
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2015-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef SIGNAL_FRAMESIZE
+# define SIGNAL_FRAMESIZE 96
+#endif
+#ifndef PTR_TYPE
+# define PTR_TYPE unsigned long
+#endif
+
+static void
+arch_sigreturn(struct tcb *tcp)
+{
+ kernel_ulong_t addr;
+
+ if (!get_stack_pointer(tcp, &addr))
+ return;
+ addr += SIGNAL_FRAMESIZE;
+
+ PTR_TYPE mask[NSIG_BYTES / sizeof(PTR_TYPE)];
+ if (!umove_or_printaddr(tcp, addr, &mask)) {
+ tprintsigmask_addr(mask);
+ }
+}
diff --git a/src/linux/s390/check_scno.c b/src/linux/s390/check_scno.c
new file mode 100644
index 000000000..76d0f9cf5
--- /dev/null
+++ b/src/linux/s390/check_scno.c
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+/* Return codes: 1 - ok, 0 - ignore, other - error. */
+static int
+arch_check_scno(struct tcb *tcp)
+{
+ if (ptrace_sci.entry.nr)
+ return 1;
+
+ /*
+ * Apparently, arch/s390/include/asm/syscall.h:syscall_get_nr()
+ * returns 0 for out-of-range syscall numbers.
+ * This kernel bug is exposed via PTRACE_GET_SYSCALL_INFO interface.
+ * Workaround it by falling back to get_regs().
+ */
+
+ if (get_regs(tcp) < 0)
+ return -1;
+
+ arch_get_scno(tcp);
+ if (tcp->scno) {
+ ptrace_sci.entry.nr = tcp->scno;
+ debug_func_msg("fixed scno: 0 -> %#lx", tcp->scno);
+ }
+
+ return 1;
+}
diff --git a/src/linux/s390/get_error.c b/src/linux/s390/get_error.c
new file mode 100644
index 000000000..5b5801305
--- /dev/null
+++ b/src/linux/s390/get_error.c
@@ -0,0 +1,23 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "negated_errno.h"
+
+#ifndef ARCH_REGSET
+# define ARCH_REGSET s390_regset
+#endif
+
+static void
+arch_get_error(struct tcb *tcp, const bool check_errno)
+{
+ if (check_errno && is_negated_errno(ARCH_REGSET.gprs[2])) {
+ tcp->u_rval = -1;
+ tcp->u_error = -ARCH_REGSET.gprs[2];
+ } else {
+ tcp->u_rval = ARCH_REGSET.gprs[2];
+ }
+}
diff --git a/src/linux/s390/get_scno.c b/src/linux/s390/get_scno.c
new file mode 100644
index 000000000..2af6c8e6f
--- /dev/null
+++ b/src/linux/s390/get_scno.c
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef ARCH_REGSET
+# define ARCH_REGSET s390_regset
+#endif
+
+/* Return codes: 1 - ok, 0 - ignore, other - error. */
+static int
+arch_get_scno(struct tcb *tcp)
+{
+ tcp->scno = ARCH_REGSET.gprs[2] ?
+ ARCH_REGSET.gprs[2] : ARCH_REGSET.gprs[1];
+ return 1;
+}
diff --git a/src/linux/s390/get_syscall_args.c b/src/linux/s390/get_syscall_args.c
new file mode 100644
index 000000000..66570ff53
--- /dev/null
+++ b/src/linux/s390/get_syscall_args.c
@@ -0,0 +1,23 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef ARCH_REGSET
+# define ARCH_REGSET s390_regset
+#endif
+
+/* Return -1 on error or 1 on success (never 0!). */
+static int
+arch_get_syscall_args(struct tcb *tcp)
+{
+ tcp->u_arg[0] = ARCH_REGSET.orig_gpr2;
+ tcp->u_arg[1] = ARCH_REGSET.gprs[3];
+ tcp->u_arg[2] = ARCH_REGSET.gprs[4];
+ tcp->u_arg[3] = ARCH_REGSET.gprs[5];
+ tcp->u_arg[4] = ARCH_REGSET.gprs[6];
+ tcp->u_arg[5] = ARCH_REGSET.gprs[7];
+ return 1;
+}
diff --git a/src/linux/s390/ioctls_arch0.h b/src/linux/s390/ioctls_arch0.h
new file mode 100644
index 000000000..3aa7105b1
--- /dev/null
+++ b/src/linux/s390/ioctls_arch0.h
@@ -0,0 +1,170 @@
+/* Generated by ioctls_gen.sh from definitions found in $linux/arch/s390/include/ tree. */
+{ "asm/chsc.h", "CHSC_INFO_CCL", _IOC_READ|_IOC_WRITE, 0x6386, 0x1014 },
+{ "asm/chsc.h", "CHSC_INFO_CHANNEL_PATH", _IOC_READ|_IOC_WRITE, 0x6382, 0x100c },
+{ "asm/chsc.h", "CHSC_INFO_CI", _IOC_READ|_IOC_WRITE, 0x6385, 0x100c },
+{ "asm/chsc.h", "CHSC_INFO_CPD", _IOC_READ|_IOC_WRITE, 0x6387, 0x1014 },
+{ "asm/chsc.h", "CHSC_INFO_CU", _IOC_READ|_IOC_WRITE, 0x6383, 0x100c },
+{ "asm/chsc.h", "CHSC_INFO_DCAL", _IOC_READ|_IOC_WRITE, 0x6388, 0x1010 },
+{ "asm/chsc.h", "CHSC_INFO_SCH_CU", _IOC_READ|_IOC_WRITE, 0x6384, 0x1008 },
+{ "asm/chsc.h", "CHSC_ON_CLOSE_REMOVE", _IOC_NONE, 0x638b, 0x00 },
+{ "asm/chsc.h", "CHSC_ON_CLOSE_SET", _IOC_READ|_IOC_WRITE, 0x638a, 0x1000 },
+{ "asm/chsc.h", "CHSC_START", _IOC_READ|_IOC_WRITE, 0x6381, 0x1000 },
+{ "asm/chsc.h", "CHSC_START_SYNC", _IOC_READ|_IOC_WRITE, 0x6389, 0x1000 },
+{ "asm/clp.h", "CLP_SYNC", _IOC_READ|_IOC_WRITE, 0x63c1, 0x10 },
+{ "asm/cmb.h", "BIODASDCMFDISABLE", _IOC_NONE, 0x4421, 0x00 },
+{ "asm/cmb.h", "BIODASDCMFENABLE", _IOC_NONE, 0x4420, 0x00 },
+{ "asm/cmb.h", "BIODASDREADALLCMB", _IOC_READ|_IOC_WRITE, 0x4421, 0x58 },
+{ "asm/dasd.h", "BIODASDABORTIO", _IOC_NONE, 0x44f0, 0x00 },
+{ "asm/dasd.h", "BIODASDALLOWIO", _IOC_NONE, 0x44f1, 0x00 },
+{ "asm/dasd.h", "BIODASDCHECKFMT", _IOC_READ|_IOC_WRITE, 0x4402, 0x28 },
+{ "asm/dasd.h", "BIODASDDISABLE", _IOC_NONE, 0x4400, 0x00 },
+{ "asm/dasd.h", "BIODASDENABLE", _IOC_NONE, 0x4401, 0x00 },
+{ "asm/dasd.h", "BIODASDFMT", _IOC_WRITE, 0x4401, 0x10 },
+{ "asm/dasd.h", "BIODASDGATTR", _IOC_READ, 0x4405, 0x20 },
+{ "asm/dasd.h", "BIODASDINFO", _IOC_READ, 0x4401, 0x178 },
+{ "asm/dasd.h", "BIODASDINFO2", _IOC_READ, 0x4403, 0x1a0 },
+{ "asm/dasd.h", "BIODASDPRRD", _IOC_READ, 0x4402, 0x408 },
+{ "asm/dasd.h", "BIODASDPRRST", _IOC_NONE, 0x4405, 0x00 },
+{ "asm/dasd.h", "BIODASDPSRD", _IOC_READ, 0x4404, 0xc0 },
+{ "asm/dasd.h", "BIODASDQUIESCE", _IOC_NONE, 0x4406, 0x00 },
+{ "asm/dasd.h", "BIODASDRAS", _IOC_WRITE, 0x4403, 0x10 },
+{ "asm/dasd.h", "BIODASDRESUME", _IOC_NONE, 0x4407, 0x00 },
+{ "asm/dasd.h", "BIODASDRLSE", _IOC_NONE, 0x4403, 0x00 },
+{ "asm/dasd.h", "BIODASDRSRV", _IOC_NONE, 0x4402, 0x00 },
+{ "asm/dasd.h", "BIODASDSATTR", _IOC_WRITE, 0x4402, 0x20 },
+{ "asm/dasd.h", "BIODASDSLCK", _IOC_NONE, 0x4404, 0x00 },
+{ "asm/dasd.h", "BIODASDSNID", _IOC_READ|_IOC_WRITE, 0x4401, 0x0d },
+{ "asm/dasd.h", "BIODASDSYMMIO", _IOC_READ|_IOC_WRITE, 0x44f0, 0x20 },
+{ "asm/dasd.h", "DASDAPIVER", _IOC_READ, 0x4400, 0x04 },
+{ "asm/hypfs.h", "HYPFS_DIAG304", _IOC_READ|_IOC_WRITE, 0x1020, 0x18 },
+{ "asm/ioctls.h", "FIOQSIZE", 0, 0x545E, 0 },
+{ "asm/pkey.h", "PKEY_APQNS4K", _IOC_READ|_IOC_WRITE, 0x701b, 0x14 },
+{ "asm/pkey.h", "PKEY_APQNS4KT", _IOC_READ|_IOC_WRITE, 0x701c, 0x50 },
+{ "asm/pkey.h", "PKEY_CLR2PROTK", _IOC_READ|_IOC_WRITE, 0x7004, 0x6c },
+{ "asm/pkey.h", "PKEY_CLR2SECK", _IOC_READ|_IOC_WRITE, 0x7002, 0x68 },
+{ "asm/pkey.h", "PKEY_CLR2SECK2", _IOC_READ|_IOC_WRITE, 0x7012, 0x3c },
+{ "asm/pkey.h", "PKEY_FINDCARD", _IOC_READ|_IOC_WRITE, 0x7005, 0x44 },
+{ "asm/pkey.h", "PKEY_GENPROTK", _IOC_READ|_IOC_WRITE, 0x7008, 0x4c },
+{ "asm/pkey.h", "PKEY_GENSECK", _IOC_READ|_IOC_WRITE, 0x7001, 0x48 },
+{ "asm/pkey.h", "PKEY_GENSECK2", _IOC_READ|_IOC_WRITE, 0x7011, 0x1c },
+{ "asm/pkey.h", "PKEY_KBLOB2PROTK", _IOC_READ|_IOC_WRITE, 0x700a, 0x50 },
+{ "asm/pkey.h", "PKEY_KBLOB2PROTK2", _IOC_READ|_IOC_WRITE, 0x701a, 0x58 },
+{ "asm/pkey.h", "PKEY_KBLOB2PROTK3", _IOC_READ|_IOC_WRITE, 0x701d, 0x1c },
+{ "asm/pkey.h", "PKEY_SEC2PROTK", _IOC_READ|_IOC_WRITE, 0x7003, 0x8c },
+{ "asm/pkey.h", "PKEY_SKEY2PKEY", _IOC_READ|_IOC_WRITE, 0x7006, 0x88 },
+{ "asm/pkey.h", "PKEY_VERIFYKEY", _IOC_READ|_IOC_WRITE, 0x7007, 0x4c },
+{ "asm/pkey.h", "PKEY_VERIFYKEY2", _IOC_READ|_IOC_WRITE, 0x7017, 0x18 },
+{ "asm/pkey.h", "PKEY_VERIFYPROTK", _IOC_WRITE, 0x7009, 0x48 },
+{ "asm/sclp_ctl.h", "SCLP_CTL_SCCB", _IOC_READ|_IOC_WRITE, 0x1010, 0x0c },
+{ "asm/tape390.h", "TAPE390_CRYPT_QUERY", _IOC_READ, 0x6403, 0x03 },
+{ "asm/tape390.h", "TAPE390_CRYPT_SET", _IOC_WRITE, 0x6402, 0x03 },
+{ "asm/tape390.h", "TAPE390_DISPLAY", _IOC_WRITE, 0x6401, 0x11 },
+{ "asm/tape390.h", "TAPE390_KEKL_QUERY", _IOC_READ, 0x6405, 0x86 },
+{ "asm/tape390.h", "TAPE390_KEKL_SET", _IOC_WRITE, 0x6404, 0x86 },
+{ "asm/vmcp.h", "VMCP_GETCODE", _IOC_READ, 0x1001, 0x04 },
+{ "asm/vmcp.h", "VMCP_GETSIZE", _IOC_READ, 0x1003, 0x04 },
+{ "asm/vmcp.h", "VMCP_SETBUF", _IOC_WRITE, 0x1002, 0x04 },
+{ "asm/zcrypt.h", "ICARSACRT", _IOC_READ|_IOC_WRITE, 0x7a06, 0x00 },
+{ "asm/zcrypt.h", "ICARSAMODEXPO", _IOC_READ|_IOC_WRITE, 0x7a05, 0x00 },
+{ "asm/zcrypt.h", "Z90STAT_DOMAIN_INDEX", _IOC_READ, 0x7a47, 0x04 },
+{ "asm/zcrypt.h", "Z90STAT_PENDINGQ_COUNT", _IOC_READ, 0x7a45, 0x04 },
+{ "asm/zcrypt.h", "Z90STAT_PERDEV_REQCNT", _IOC_READ, 0x7a4a, 0x100 },
+{ "asm/zcrypt.h", "Z90STAT_QDEPTH_MASK", _IOC_READ, 0x7a49, 0x40 },
+{ "asm/zcrypt.h", "Z90STAT_REQUESTQ_COUNT", _IOC_READ, 0x7a44, 0x04 },
+{ "asm/zcrypt.h", "Z90STAT_STATUS_MASK", _IOC_READ, 0x7a48, 0x40 },
+{ "asm/zcrypt.h", "Z90STAT_TOTALOPEN_COUNT", _IOC_READ, 0x7a46, 0x04 },
+{ "asm/zcrypt.h", "ZCRYPT_DEVICE_STATUS", _IOC_READ|_IOC_WRITE, 0x7a5f, 0x00 },
+{ "asm/zcrypt.h", "ZCRYPT_PERDEV_REQCNT", _IOC_READ, 0x7a5a, 0x400 },
+{ "asm/zcrypt.h", "ZCRYPT_QDEPTH_MASK", _IOC_READ, 0x7a59, 0x100 },
+{ "asm/zcrypt.h", "ZCRYPT_STATUS_MASK", _IOC_READ, 0x7a58, 0x100 },
+{ "asm/zcrypt.h", "ZDEVICESTATUS", _IOC_READ|_IOC_WRITE, 0x7a4f, 0x00 },
+{ "asm/zcrypt.h", "ZSECSENDCPRB", _IOC_READ|_IOC_WRITE, 0x7a81, 0x00 },
+{ "asm/zcrypt.h", "ZSENDEP11CPRB", _IOC_READ|_IOC_WRITE, 0x7a04, 0x00 },
+{ "linux/kvm.h", "KVM_ASSIGN_DEV_IRQ", _IOC_WRITE, 0xae70, 0x40 },
+{ "linux/kvm.h", "KVM_ASSIGN_PCI_DEVICE", _IOC_READ, 0xae69, 0x40 },
+{ "linux/kvm.h", "KVM_ASSIGN_SET_INTX_MASK", _IOC_WRITE, 0xaea4, 0x40 },
+{ "linux/kvm.h", "KVM_ASSIGN_SET_MSIX_ENTRY", _IOC_WRITE, 0xae74, 0x10 },
+{ "linux/kvm.h", "KVM_ASSIGN_SET_MSIX_NR", _IOC_WRITE, 0xae73, 0x08 },
+{ "linux/kvm.h", "KVM_CHECK_EXTENSION", _IOC_NONE, 0xae03, 0x00 },
+{ "linux/kvm.h", "KVM_CLEAR_DIRTY_LOG", _IOC_READ|_IOC_WRITE, 0xaec0, 0x18 },
+{ "linux/kvm.h", "KVM_CREATE_DEVICE", _IOC_READ|_IOC_WRITE, 0xaee0, 0x0c },
+{ "linux/kvm.h", "KVM_CREATE_IRQCHIP", _IOC_NONE, 0xae60, 0x00 },
+{ "linux/kvm.h", "KVM_CREATE_PIT", _IOC_NONE, 0xae64, 0x00 },
+{ "linux/kvm.h", "KVM_CREATE_PIT2", _IOC_WRITE, 0xae77, 0x40 },
+{ "linux/kvm.h", "KVM_CREATE_VCPU", _IOC_NONE, 0xae41, 0x00 },
+{ "linux/kvm.h", "KVM_CREATE_VM", _IOC_NONE, 0xae01, 0x00 },
+{ "linux/kvm.h", "KVM_DEASSIGN_DEV_IRQ", _IOC_WRITE, 0xae75, 0x40 },
+{ "linux/kvm.h", "KVM_DEASSIGN_PCI_DEVICE", _IOC_WRITE, 0xae72, 0x40 },
+{ "linux/kvm.h", "KVM_DIRTY_TLB", _IOC_WRITE, 0xaeaa, 0x10 },
+{ "linux/kvm.h", "KVM_ENABLE_CAP", _IOC_WRITE, 0xaea3, 0x68 },
+{ "linux/kvm.h", "KVM_GET_API_VERSION", _IOC_NONE, 0xae00, 0x00 },
+{ "linux/kvm.h", "KVM_GET_CLOCK", _IOC_READ, 0xae7c, 0x30 },
+{ "linux/kvm.h", "KVM_GET_DEVICE_ATTR", _IOC_WRITE, 0xaee2, 0x18 },
+{ "linux/kvm.h", "KVM_GET_DIRTY_LOG", _IOC_WRITE, 0xae42, 0x10 },
+{ "linux/kvm.h", "KVM_GET_FPU", _IOC_READ, 0xae8c, 0x88 },
+{ "linux/kvm.h", "KVM_GET_IRQCHIP", _IOC_READ|_IOC_WRITE, 0xae62, 0x208 },
+{ "linux/kvm.h", "KVM_GET_MP_STATE", _IOC_READ, 0xae98, 0x04 },
+{ "linux/kvm.h", "KVM_GET_NR_MMU_PAGES", _IOC_NONE, 0xae45, 0x00 },
+{ "linux/kvm.h", "KVM_GET_ONE_REG", _IOC_WRITE, 0xaeab, 0x10 },
+{ "linux/kvm.h", "KVM_GET_REGS", _IOC_READ, 0xae81, 0x80 },
+{ "linux/kvm.h", "KVM_GET_REG_LIST", _IOC_READ|_IOC_WRITE, 0xaeb0, 0x08 },
+{ "linux/kvm.h", "KVM_GET_SREGS", _IOC_READ, 0xae83, 0xc0 },
+{ "linux/kvm.h", "KVM_GET_TSC_KHZ", _IOC_NONE, 0xaea3, 0x00 },
+{ "linux/kvm.h", "KVM_GET_VCPU_MMAP_SIZE", _IOC_NONE, 0xae04, 0x00 },
+{ "linux/kvm.h", "KVM_HAS_DEVICE_ATTR", _IOC_WRITE, 0xaee3, 0x18 },
+{ "linux/kvm.h", "KVM_INTERRUPT", _IOC_WRITE, 0xae86, 0x04 },
+{ "linux/kvm.h", "KVM_IOEVENTFD", _IOC_WRITE, 0xae79, 0x40 },
+{ "linux/kvm.h", "KVM_IRQFD", _IOC_WRITE, 0xae76, 0x20 },
+{ "linux/kvm.h", "KVM_IRQ_LINE", _IOC_WRITE, 0xae61, 0x08 },
+{ "linux/kvm.h", "KVM_IRQ_LINE_STATUS", _IOC_READ|_IOC_WRITE, 0xae67, 0x08 },
+{ "linux/kvm.h", "KVM_KVMCLOCK_CTRL", _IOC_NONE, 0xaead, 0x00 },
+{ "linux/kvm.h", "KVM_MEMORY_ENCRYPT_OP", _IOC_READ|_IOC_WRITE, 0xaeba, 0x04 },
+{ "linux/kvm.h", "KVM_MEMORY_ENCRYPT_REG_REGION", _IOC_READ, 0xaebb, 0x10 },
+{ "linux/kvm.h", "KVM_MEMORY_ENCRYPT_UNREG_REGION", _IOC_READ, 0xaebc, 0x10 },
+{ "linux/kvm.h", "KVM_NMI", _IOC_NONE, 0xae9a, 0x00 },
+{ "linux/kvm.h", "KVM_REGISTER_COALESCED_MMIO", _IOC_WRITE, 0xae67, 0x10 },
+{ "linux/kvm.h", "KVM_REINJECT_CONTROL", _IOC_NONE, 0xae71, 0x00 },
+{ "linux/kvm.h", "KVM_RUN", _IOC_NONE, 0xae80, 0x00 },
+{ "linux/kvm.h", "KVM_S390_CLEAR_RESET", _IOC_NONE, 0xaec4, 0x00 },
+{ "linux/kvm.h", "KVM_S390_ENABLE_SIE", _IOC_NONE, 0xae06, 0x00 },
+{ "linux/kvm.h", "KVM_S390_GET_CMMA_BITS", _IOC_READ|_IOC_WRITE, 0xaeb8, 0x20 },
+{ "linux/kvm.h", "KVM_S390_GET_IRQ_STATE", _IOC_WRITE, 0xaeb6, 0x20 },
+{ "linux/kvm.h", "KVM_S390_GET_SKEYS", _IOC_WRITE, 0xaeb2, 0x40 },
+{ "linux/kvm.h", "KVM_S390_INITIAL_RESET", _IOC_NONE, 0xae97, 0x00 },
+{ "linux/kvm.h", "KVM_S390_INTERRUPT", _IOC_WRITE, 0xae94, 0x10 },
+{ "linux/kvm.h", "KVM_S390_IRQ", _IOC_WRITE, 0xaeb4, 0x48 },
+{ "linux/kvm.h", "KVM_S390_MEM_OP", _IOC_WRITE, 0xaeb1, 0x40 },
+{ "linux/kvm.h", "KVM_S390_NORMAL_RESET", _IOC_NONE, 0xaec3, 0x00 },
+{ "linux/kvm.h", "KVM_S390_PV_COMMAND", _IOC_READ|_IOC_WRITE, 0xaec5, 0x20 },
+{ "linux/kvm.h", "KVM_S390_SET_CMMA_BITS", _IOC_WRITE, 0xaeb9, 0x20 },
+{ "linux/kvm.h", "KVM_S390_SET_INITIAL_PSW", _IOC_WRITE, 0xae96, 0x10 },
+{ "linux/kvm.h", "KVM_S390_SET_IRQ_STATE", _IOC_WRITE, 0xaeb5, 0x20 },
+{ "linux/kvm.h", "KVM_S390_SET_SKEYS", _IOC_WRITE, 0xaeb3, 0x40 },
+{ "linux/kvm.h", "KVM_S390_STORE_STATUS", _IOC_WRITE, 0xae95, 0x04 },
+{ "linux/kvm.h", "KVM_S390_UCAS_MAP", _IOC_WRITE, 0xae50, 0x18 },
+{ "linux/kvm.h", "KVM_S390_UCAS_UNMAP", _IOC_WRITE, 0xae51, 0x18 },
+{ "linux/kvm.h", "KVM_S390_VCPU_FAULT", _IOC_WRITE, 0xae52, 0x04 },
+{ "linux/kvm.h", "KVM_SET_BOOT_CPU_ID", _IOC_NONE, 0xae78, 0x00 },
+{ "linux/kvm.h", "KVM_SET_CLOCK", _IOC_WRITE, 0xae7b, 0x30 },
+{ "linux/kvm.h", "KVM_SET_DEVICE_ATTR", _IOC_WRITE, 0xaee1, 0x18 },
+{ "linux/kvm.h", "KVM_SET_FPU", _IOC_WRITE, 0xae8d, 0x88 },
+{ "linux/kvm.h", "KVM_SET_GSI_ROUTING", _IOC_WRITE, 0xae6a, 0x08 },
+{ "linux/kvm.h", "KVM_SET_GUEST_DEBUG", _IOC_WRITE, 0xae9b, 0x14 },
+{ "linux/kvm.h", "KVM_SET_IDENTITY_MAP_ADDR", _IOC_WRITE, 0xae48, 0x08 },
+{ "linux/kvm.h", "KVM_SET_IRQCHIP", _IOC_READ, 0xae63, 0x208 },
+{ "linux/kvm.h", "KVM_SET_MEMORY_REGION", _IOC_WRITE, 0xae40, 0x18 },
+{ "linux/kvm.h", "KVM_SET_MP_STATE", _IOC_WRITE, 0xae99, 0x04 },
+{ "linux/kvm.h", "KVM_SET_NR_MMU_PAGES", _IOC_NONE, 0xae44, 0x00 },
+{ "linux/kvm.h", "KVM_SET_ONE_REG", _IOC_WRITE, 0xaeac, 0x10 },
+{ "linux/kvm.h", "KVM_SET_REGS", _IOC_WRITE, 0xae82, 0x80 },
+{ "linux/kvm.h", "KVM_SET_SIGNAL_MASK", _IOC_WRITE, 0xae8b, 0x04 },
+{ "linux/kvm.h", "KVM_SET_SREGS", _IOC_WRITE, 0xae84, 0xc0 },
+{ "linux/kvm.h", "KVM_SET_TSC_KHZ", _IOC_NONE, 0xaea2, 0x00 },
+{ "linux/kvm.h", "KVM_SET_TSS_ADDR", _IOC_NONE, 0xae47, 0x00 },
+{ "linux/kvm.h", "KVM_SET_USER_MEMORY_REGION", _IOC_WRITE, 0xae46, 0x20 },
+{ "linux/kvm.h", "KVM_SET_VAPIC_ADDR", _IOC_WRITE, 0xae93, 0x08 },
+{ "linux/kvm.h", "KVM_SIGNAL_MSI", _IOC_WRITE, 0xaea5, 0x20 },
+{ "linux/kvm.h", "KVM_SMI", _IOC_NONE, 0xaeb7, 0x00 },
+{ "linux/kvm.h", "KVM_TPR_ACCESS_REPORTING", _IOC_READ|_IOC_WRITE, 0xae92, 0x28 },
+{ "linux/kvm.h", "KVM_TRANSLATE", _IOC_READ|_IOC_WRITE, 0xae85, 0x18 },
+{ "linux/kvm.h", "KVM_UNREGISTER_COALESCED_MMIO", _IOC_WRITE, 0xae68, 0x10 },
diff --git a/src/linux/s390/ioctls_inc0.h b/src/linux/s390/ioctls_inc0.h
new file mode 100644
index 000000000..4aecf983e
--- /dev/null
+++ b/src/linux/s390/ioctls_inc0.h
@@ -0,0 +1 @@
+#include "32/ioctls_inc.h"
diff --git a/src/linux/s390/raw_syscall.h b/src/linux/s390/raw_syscall.h
new file mode 100644
index 000000000..96d6230eb
--- /dev/null
+++ b/src/linux/s390/raw_syscall.h
@@ -0,0 +1,29 @@
+/*
+ * Raw syscalls.
+ *
+ * Copyright (c) 2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_RAW_SYSCALL_H
+# define STRACE_RAW_SYSCALL_H
+
+# include "kernel_types.h"
+
+static inline kernel_ulong_t
+raw_syscall_0(const kernel_ulong_t nr, kernel_ulong_t *err)
+{
+ *err = 0;
+ register kernel_ulong_t r1 __asm__("r1") = nr;
+ register kernel_ulong_t r2 __asm__("r2");
+ __asm__ __volatile__("svc 0"
+ : "=r"(r2)
+ : "r"(r1)
+ : "memory");
+ return r2;
+}
+# define raw_syscall_0 raw_syscall_0
+
+#endif /* !STRACE_RAW_SYSCALL_H */
diff --git a/src/linux/s390/rt_sigframe.h b/src/linux/s390/rt_sigframe.h
new file mode 100644
index 000000000..2feb5a66f
--- /dev/null
+++ b/src/linux/s390/rt_sigframe.h
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2017-2018 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2017-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_RT_SIGFRAME_H
+# define STRACE_RT_SIGFRAME_H
+
+# include <signal.h>
+
+# ifdef __s390x__
+# define SIGNAL_FRAMESIZE 160
+# else /* __s390__ */
+# define SIGNAL_FRAMESIZE 96
+# endif
+
+typedef struct {
+ uint8_t callee_used_stack[SIGNAL_FRAMESIZE];
+ uint16_t svc_insn;
+ siginfo_t info;
+ ucontext_t uc;
+} struct_rt_sigframe;
+
+#endif /* !STRACE_RT_SIGFRAME_H */
diff --git a/src/linux/s390/set_error.c b/src/linux/s390/set_error.c
new file mode 100644
index 000000000..f71865ef1
--- /dev/null
+++ b/src/linux/s390/set_error.c
@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2016-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef ARCH_REGSET
+# define ARCH_REGSET s390_regset
+#endif
+
+static int
+arch_set_error(struct tcb *tcp)
+{
+ ARCH_REGSET.gprs[2] = -tcp->u_error;
+ return set_regs(tcp->pid);
+}
+
+static int
+arch_set_success(struct tcb *tcp)
+{
+ ARCH_REGSET.gprs[2] = tcp->u_rval;
+ return set_regs(tcp->pid);
+}
diff --git a/src/linux/s390/set_scno.c b/src/linux/s390/set_scno.c
new file mode 100644
index 000000000..6ce2c12f3
--- /dev/null
+++ b/src/linux/s390/set_scno.c
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2016-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef ARCH_REGSET
+# define ARCH_REGSET s390_regset
+#endif
+
+static int
+arch_set_scno(struct tcb *tcp, kernel_ulong_t scno)
+{
+ if (ptrace_syscall_info_is_valid() && get_regs(tcp) < 0)
+ return -1;
+ ARCH_REGSET.gprs[2] = scno;
+ return set_regs(tcp->pid);
+}
diff --git a/src/linux/s390/syscallent.h b/src/linux/s390/syscallent.h
new file mode 100644
index 000000000..6b4d930a7
--- /dev/null
+++ b/src/linux/s390/syscallent.h
@@ -0,0 +1,414 @@
+/*
+ * Copyright (c) 2000 IBM Deutschland Entwicklung GmbH, IBM Coporation
+ * Copyright (c) 2000-2020 The strace developers.
+ * Authors: Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
+ * D.J. Barrow <barrow_dj@mail.yahoo.com,djbarrow@de.ibm.com>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ *
+ */
+
+[ 0] = {MA, 0, SEN(setup), "setup" },
+[ 1] = { 1, TP|SE, SEN(exit), "exit" },
+[ 2] = { 0, TP, SEN(fork), "fork" },
+[ 3] = { 3, TD, SEN(read), "read" },
+[ 4] = { 3, TD, SEN(write), "write" },
+[ 5] = { 3, TD|TF, SEN(open), "open" },
+[ 6] = { 1, TD, SEN(close), "close" },
+[ 7] = { 0, 0, SEN(restart_syscall), "restart_syscall" },
+[ 8] = { 2, TD|TF, SEN(creat), "creat" },
+[ 9] = { 2, TF, SEN(link), "link" },
+[ 10] = { 1, TF, SEN(unlink), "unlink" },
+[ 11] = { 3, TF|TP|TSD|SE|SI, SEN(execve), "execve" },
+[ 12] = { 1, TF, SEN(chdir), "chdir" },
+[ 13] = { 1, TCL, SEN(time), "time" },
+[ 14] = { 3, TF, SEN(mknod), "mknod" },
+[ 15] = { 2, TF, SEN(chmod), "chmod" },
+[ 16] = { 3, TF, SEN(chown16), "lchown" },
+[ 17] = { },
+[ 18] = { },
+[ 19] = { 3, TD, SEN(lseek), "lseek" },
+[ 20] = { 0, PU|NF, SEN(getpid), "getpid" },
+[ 21] = { 5, TF, SEN(mount), "mount" },
+[ 22] = { 1, TF, SEN(umount), "umount" },
+[ 23] = { 1, TC, SEN(setuid16), "setuid" },
+[ 24] = { 0, TC|PU|NF, SEN(getuid16), "getuid" },
+[ 25] = { 1, 0, SEN(stime), "stime" },
+[ 26] = { 4, 0, SEN(ptrace), "ptrace" },
+[ 27] = { 1, 0, SEN(alarm), "alarm" },
+[ 28] = { },
+[ 29] = { 0, TS, SEN(pause), "pause" },
+[ 30] = { 2, TF, SEN(utime), "utime" },
+[ 31] = { },
+[ 32] = { },
+[ 33] = { 2, TF, SEN(access), "access" },
+[ 34] = { 1, 0, SEN(nice), "nice" },
+[ 35] = { },
+[ 36] = { 0, 0, SEN(sync), "sync" },
+[ 37] = { 2, TS|TP, SEN(kill), "kill" },
+[ 38] = { 2, TF, SEN(rename), "rename" },
+[ 39] = { 2, TF, SEN(mkdir), "mkdir" },
+[ 40] = { 1, TF, SEN(rmdir), "rmdir" },
+[ 41] = { 1, TD, SEN(dup), "dup" },
+[ 42] = { 1, TD, SEN(pipe), "pipe" },
+[ 43] = { 1, 0, SEN(times), "times" },
+[ 44] = { },
+[ 45] = { 1, TM|SI, SEN(brk), "brk" },
+[ 46] = { 1, TC, SEN(setgid16), "setgid" },
+[ 47] = { 0, TC|PU|NF, SEN(getgid16), "getgid" },
+[ 48] = { 2, TS, SEN(signal), "signal" },
+[ 49] = { 0, TC|PU|NF, SEN(geteuid16), "geteuid" },
+[ 50] = { 0, TC|PU|NF, SEN(getegid16), "getegid" },
+[ 51] = { 1, TF, SEN(acct), "acct" },
+[ 52] = { 2, TF, SEN(umount2), "umount2" },
+[ 53] = { },
+[ 54] = { 3, TD, SEN(ioctl), "ioctl" },
+[ 55] = { 3, TD, SEN(fcntl), "fcntl" },
+[ 56] = { },
+[ 57] = { 2, 0, SEN(setpgid), "setpgid" },
+[ 58] = { },
+[ 59] = { },
+[ 60] = { 1, NF, SEN(umask), "umask" },
+[ 61] = { 1, TF, SEN(chroot), "chroot" },
+[ 62] = { 2, TSFA, SEN(ustat), "ustat" },
+[ 63] = { 2, TD, SEN(dup2), "dup2" },
+[ 64] = { 0, PU|NF, SEN(getppid), "getppid" },
+[ 65] = { 0, PU|NF, SEN(getpgrp), "getpgrp" },
+[ 66] = { 0, 0, SEN(setsid), "setsid" },
+[ 67] = { 3, TS, SEN(sigaction), "sigaction" },
+[ 68] = { },
+[ 69] = { },
+[ 70] = { 2, TC, SEN(setreuid16), "setreuid" },
+[ 71] = { 2, TC, SEN(setregid16), "setregid" },
+[ 72] = { 3, TS, SEN(sigsuspend), "sigsuspend" },
+[ 73] = { 1, TS, SEN(sigpending), "sigpending" },
+[ 74] = { 2, 0, SEN(sethostname), "sethostname" },
+[ 75] = { 2, 0, SEN(setrlimit), "setrlimit" },
+[ 76] = { 2, 0, SEN(getrlimit), "getrlimit" },
+[ 77] = { 2, 0, SEN(getrusage), "getrusage" },
+[ 78] = { 2, TCL, SEN(gettimeofday), "gettimeofday" },
+[ 79] = { 2, TCL, SEN(settimeofday), "settimeofday" },
+[ 80] = { 2, TC, SEN(getgroups16), "getgroups" },
+[ 81] = { 2, TC, SEN(setgroups16), "setgroups" },
+[ 82] = { },
+[ 83] = { 2, TF, SEN(symlink), "symlink" },
+[ 84] = { },
+[ 85] = { 3, TF, SEN(readlink), "readlink" },
+[ 86] = { 1, TF, SEN(uselib), "uselib" },
+[ 87] = { 2, TF, SEN(swapon), "swapon" },
+[ 88] = { 4, 0, SEN(reboot), "reboot" },
+[ 89] = { 3, TD, SEN(readdir), "readdir" },
+[ 90] = { 1, TD|TM|SI, SEN(old_mmap), "mmap" },
+[ 91] = { 2, TM|SI, SEN(munmap), "munmap" },
+[ 92] = { 2, TF, SEN(truncate), "truncate" },
+[ 93] = { 2, TD, SEN(ftruncate), "ftruncate" },
+[ 94] = { 2, TD, SEN(fchmod), "fchmod" },
+[ 95] = { 3, TD, SEN(fchown16), "fchown" },
+[ 96] = { 2, 0, SEN(getpriority), "getpriority" },
+[ 97] = { 3, 0, SEN(setpriority), "setpriority" },
+[ 98] = { },
+[ 99] = { 2, TF|TSF|TSFA, SEN(statfs), "statfs" },
+[100] = { 2, TD|TFSF|TSFA, SEN(fstatfs), "fstatfs" },
+[101] = { 3, 0, SEN(ioperm), "ioperm" },
+[102] = { 2, TD|TSD, SEN(socketcall), "socketcall" },
+[103] = { 3, 0, SEN(syslog), "syslog" },
+[104] = { 3, 0, SEN(setitimer), "setitimer" },
+[105] = { 2, 0, SEN(getitimer), "getitimer" },
+[106] = { 2, TF|TST|TSTA, SEN(stat), "stat" },
+[107] = { 2, TF|TLST|TSTA, SEN(lstat), "lstat" },
+[108] = { 2, TD|TFST|TSTA, SEN(fstat), "fstat" },
+[109] = { },
+[110] = { 4, 0, SEN(lookup_dcookie), "lookup_dcookie" },
+[111] = { 0, 0, SEN(vhangup), "vhangup" },
+[112] = { 0, 0, SEN(idle), "idle" },
+[113] = { },
+[114] = { 4, TP, SEN(wait4), "wait4" },
+[115] = { 1, TF, SEN(swapoff), "swapoff" },
+[116] = { 1, 0, SEN(sysinfo), "sysinfo" },
+[117] = { 5, TI|TSD, SEN(ipc), "ipc" },
+[118] = { 1, TD, SEN(fsync), "fsync" },
+[119] = { 0, TS, SEN(sigreturn), "sigreturn" },
+[120] = { 5, TP, SEN(clone), "clone" },
+[121] = { 2, 0, SEN(setdomainname), "setdomainname" },
+[122] = { 1, 0, SEN(uname), "uname" },
+[123] = { },
+[124] = { 1, TCL, SEN(adjtimex32), "adjtimex" },
+[125] = { 3, TM|SI, SEN(mprotect), "mprotect" },
+[126] = { 3, TS, SEN(sigprocmask), "sigprocmask" },
+[127] = { 2, 0, SEN(create_module), "create_module" },
+[128] = { 3, 0, SEN(init_module), "init_module" },
+[129] = { 2, 0, SEN(delete_module), "delete_module" },
+[130] = { 1, 0, SEN(get_kernel_syms), "get_kernel_syms" },
+[131] = { 4, TF, SEN(quotactl), "quotactl" },
+[132] = { 1, 0, SEN(getpgid), "getpgid" },
+[133] = { 1, TD, SEN(fchdir), "fchdir" },
+[134] = { 2, 0, SEN(bdflush), "bdflush" },
+[135] = { 3, 0, SEN(sysfs), "sysfs" },
+[136] = { 1, NF, SEN(personality), "personality" },
+[137] = { 5, 0, SEN(afs_syscall), "afs_syscall" },
+[138] = { 1, TC|NF, SEN(setfsuid16), "setfsuid" },
+[139] = { 1, TC|NF, SEN(setfsgid16), "setfsgid" },
+[140] = { 5, TD, SEN(llseek), "_llseek" },
+[141] = { 3, TD, SEN(getdents), "getdents" },
+[142] = { 5, TD, SEN(select), "_newselect" },
+[143] = { 2, TD, SEN(flock), "flock" },
+[144] = { 3, TM, SEN(msync), "msync" },
+[145] = { 3, TD, SEN(readv), "readv" },
+[146] = { 3, TD, SEN(writev), "writev" },
+[147] = { 1, 0, SEN(getsid), "getsid" },
+[148] = { 1, TD, SEN(fdatasync), "fdatasync" },
+[149] = { 1, 0, SEN(sysctl), "_sysctl" },
+[150] = { 2, TM, SEN(mlock), "mlock" },
+[151] = { 2, TM, SEN(munlock), "munlock" },
+[152] = { 1, TM, SEN(mlockall), "mlockall" },
+[153] = { 0, TM, SEN(munlockall), "munlockall" },
+[154] = { 2, 0, SEN(sched_setparam), "sched_setparam" },
+[155] = { 2, 0, SEN(sched_getparam), "sched_getparam" },
+[156] = { 3, 0, SEN(sched_setscheduler), "sched_setscheduler" },
+[157] = { 1, 0, SEN(sched_getscheduler), "sched_getscheduler" },
+[158] = { 0, 0, SEN(sched_yield), "sched_yield" },
+[159] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"},
+[160] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"},
+[161] = { 2, 0, SEN(sched_rr_get_interval_time32),"sched_rr_get_interval"},
+[162] = { 2, 0, SEN(nanosleep_time32), "nanosleep" },
+[163] = { 5, TM|SI, SEN(mremap), "mremap" },
+[164] = { 3, TC, SEN(setresuid16), "setresuid" },
+[165] = { 3, TC, SEN(getresuid16), "getresuid" },
+[166] = { },
+[167] = { 5, 0, SEN(query_module), "query_module" },
+[168] = { 3, TD, SEN(poll_time32), "poll" },
+[169] = { 3, 0, SEN(nfsservctl), "nfsservctl" },
+[170] = { 3, TC, SEN(setresgid16), "setresgid" },
+[171] = { 3, TC, SEN(getresgid16), "getresgid" },
+[172] = { 5, TC, SEN(prctl), "prctl" },
+[173] = { 0, TS, SEN(rt_sigreturn), "rt_sigreturn" },
+[174] = { 4, TS, SEN(rt_sigaction), "rt_sigaction" },
+[175] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" },
+[176] = { 2, TS, SEN(rt_sigpending), "rt_sigpending" },
+[177] = { 4, TS, SEN(rt_sigtimedwait_time32), "rt_sigtimedwait" },
+[178] = { 3, TS|TP, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" },
+[179] = { 2, TS, SEN(rt_sigsuspend), "rt_sigsuspend" },
+[180] = { 5, TD, SEN(pread), "pread64" },
+[181] = { 5, TD, SEN(pwrite), "pwrite64" },
+[182] = { 3, TF, SEN(chown16), "chown" },
+[183] = { 2, TF, SEN(getcwd), "getcwd" },
+[184] = { 2, TC, SEN(capget), "capget" },
+[185] = { 2, TC, SEN(capset), "capset" },
+[186] = { 2, TS, SEN(sigaltstack), "sigaltstack" },
+[187] = { 4, TD|TN, SEN(sendfile), "sendfile" },
+[188] = { 5, TN, SEN(getpmsg), "getpmsg" },
+[189] = { 5, TN, SEN(putpmsg), "putpmsg" },
+[190] = { 0, TP, SEN(vfork), "vfork" },
+[191] = { 2, 0, SEN(getrlimit), "ugetrlimit" },
+[192] = { 1, TD|TM|SI, SEN(old_mmap_pgoff), "mmap2" },
+[193] = { 3, TF, SEN(truncate64), "truncate64" },
+[194] = { 3, TD, SEN(ftruncate64), "ftruncate64" },
+[195] = { 2, TF|TST|TSTA, SEN(stat64), "stat64" },
+[196] = { 2, TF|TLST|TSTA, SEN(lstat64), "lstat64" },
+[197] = { 2, TD|TFST|TSTA, SEN(fstat64), "fstat64" },
+[198] = { 3, TF, SEN(chown), "lchown32" },
+[199] = { 0, TC|PU|NF, SEN(getuid), "getuid32" },
+[200] = { 0, TC|PU|NF, SEN(getgid), "getgid32" },
+[201] = { 0, TC|PU|NF, SEN(geteuid), "geteuid32" },
+[202] = { 0, TC|PU|NF, SEN(getegid), "getegid32" },
+[203] = { 2, TC, SEN(setreuid), "setreuid32" },
+[204] = { 2, TC, SEN(setregid), "setregid32" },
+[205] = { 2, TC, SEN(getgroups), "getgroups32" },
+[206] = { 2, TC, SEN(setgroups), "setgroups32" },
+[207] = { 3, TD, SEN(fchown), "fchown32" },
+[208] = { 3, TC, SEN(setresuid), "setresuid32" },
+[209] = { 3, TC, SEN(getresuid), "getresuid32" },
+[210] = { 3, TC, SEN(setresgid), "setresgid32" },
+[211] = { 3, TC, SEN(getresgid), "getresgid32" },
+[212] = { 3, TF, SEN(chown), "chown32" },
+[213] = { 1, TC, SEN(setuid), "setuid32" },
+[214] = { 1, TC, SEN(setgid), "setgid32" },
+[215] = { 1, TC|NF, SEN(setfsuid), "setfsuid32" },
+[216] = { 1, TC|NF, SEN(setfsgid), "setfsgid32" },
+[217] = { 2, TF, SEN(pivotroot), "pivot_root" },
+[218] = { 3, TM, SEN(mincore), "mincore" },
+[219] = { 3, TM, SEN(madvise), "madvise" },
+[220] = { 3, TD, SEN(getdents64), "getdents64" },
+[221] = { 3, TD, SEN(fcntl64), "fcntl64" },
+[222] = { 4, TD, SEN(readahead), "readahead" },
+[223] = { 4, TD|TN, SEN(sendfile64), "sendfile64" },
+[224] = { 5, TF, SEN(setxattr), "setxattr" },
+[225] = { 5, TF, SEN(setxattr), "lsetxattr" },
+[226] = { 5, TD, SEN(fsetxattr), "fsetxattr" },
+[227] = { 4, TF, SEN(getxattr), "getxattr" },
+[228] = { 4, TF, SEN(getxattr), "lgetxattr" },
+[229] = { 4, TD, SEN(fgetxattr), "fgetxattr" },
+[230] = { 3, TF, SEN(listxattr), "listxattr" },
+[231] = { 3, TF, SEN(listxattr), "llistxattr" },
+[232] = { 3, TD, SEN(flistxattr), "flistxattr" },
+[233] = { 2, TF, SEN(removexattr), "removexattr" },
+[234] = { 2, TF, SEN(removexattr), "lremovexattr" },
+[235] = { 2, TD, SEN(fremovexattr), "fremovexattr" },
+[236] = { 0, PU|NF, SEN(gettid), "gettid" },
+[237] = { 2, TS|TP, SEN(tkill), "tkill" },
+[238] = { 6, 0, SEN(futex_time32), "futex" },
+[239] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" },
+[240] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" },
+[241] = { 3, TS|TP, SEN(tgkill), "tgkill" },
+[242] = { },
+[243] = { 2, TM, SEN(io_setup), "io_setup" },
+[244] = { 1, TM, SEN(io_destroy), "io_destroy" },
+[245] = { 5, 0, SEN(io_getevents_time32), "io_getevents" },
+[246] = { 3, 0, SEN(io_submit), "io_submit" },
+[247] = { 3, 0, SEN(io_cancel), "io_cancel" },
+[248] = { 1, TP|SE, SEN(exit), "exit_group" },
+[249] = { 1, TD, SEN(epoll_create), "epoll_create" },
+[250] = { 4, TD, SEN(epoll_ctl), "epoll_ctl" },
+[251] = { 4, TD, SEN(epoll_wait), "epoll_wait" },
+[252] = { 1, 0, SEN(set_tid_address), "set_tid_address" },
+[253] = { 5, TD, SEN(fadvise64), "fadvise64" },
+[254] = { 3, 0, SEN(timer_create), "timer_create" },
+[255] = { 4, 0, SEN(timer_settime32), "timer_settime" },
+[256] = { 2, 0, SEN(timer_gettime32), "timer_gettime" },
+[257] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" },
+[258] = { 1, 0, SEN(timer_delete), "timer_delete" },
+[259] = { 2, TCL, SEN(clock_settime32), "clock_settime" },
+[260] = { 2, TCL, SEN(clock_gettime32), "clock_gettime" },
+[261] = { 2, TCL, SEN(clock_getres_time32), "clock_getres" },
+[262] = { 4, 0, SEN(clock_nanosleep_time32), "clock_nanosleep" },
+[263] = { 5, 0, SEN(vserver), "vserver" },
+[264] = { 6, TD, SEN(fadvise64_64), "fadvise64_64" },
+[265] = { 3, TF|TSF|TSFA, SEN(statfs64), "statfs64" },
+[266] = { 3, TD|TFSF|TSFA, SEN(fstatfs64), "fstatfs64" },
+[267] = { 5, TM|SI, SEN(remap_file_pages), "remap_file_pages" },
+[268] = { 6, TM, SEN(mbind), "mbind" },
+[269] = { 5, TM, SEN(get_mempolicy), "get_mempolicy" },
+[270] = { 3, TM, SEN(set_mempolicy), "set_mempolicy" },
+[271] = { 4, TD, SEN(mq_open), "mq_open" },
+[272] = { 1, 0, SEN(mq_unlink), "mq_unlink" },
+[273] = { 5, TD, SEN(mq_timedsend_time32), "mq_timedsend" },
+[274] = { 5, TD, SEN(mq_timedreceive_time32), "mq_timedreceive" },
+[275] = { 2, TD, SEN(mq_notify), "mq_notify" },
+[276] = { 3, TD, SEN(mq_getsetattr), "mq_getsetattr" },
+[277] = { 4, 0, SEN(kexec_load), "kexec_load" },
+[278] = { 5, 0, SEN(add_key), "add_key" },
+[279] = { 4, 0, SEN(request_key), "request_key" },
+[280] = { 5, 0, SEN(keyctl), "keyctl" },
+[281] = { 5, TP, SEN(waitid), "waitid" },
+[282] = { 3, 0, SEN(ioprio_set), "ioprio_set" },
+[283] = { 2, 0, SEN(ioprio_get), "ioprio_get" },
+[284] = { 0, TD, SEN(inotify_init), "inotify_init" },
+[285] = { 3, TD|TF, SEN(inotify_add_watch), "inotify_add_watch" },
+[286] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" },
+[287] = { 4, TM, SEN(migrate_pages), "migrate_pages" },
+[288] = { 4, TD|TF, SEN(openat), "openat" },
+[289] = { 3, TD|TF, SEN(mkdirat), "mkdirat" },
+[290] = { 4, TD|TF, SEN(mknodat), "mknodat" },
+[291] = { 5, TD|TF, SEN(fchownat), "fchownat" },
+[292] = { 3, TD|TF, SEN(futimesat), "futimesat" },
+[293] = { 4, TD|TF|TFST|TSTA,SEN(fstatat64), "fstatat64" },
+[294] = { 3, TD|TF, SEN(unlinkat), "unlinkat" },
+[295] = { 4, TD|TF, SEN(renameat), "renameat" },
+[296] = { 5, TD|TF, SEN(linkat), "linkat" },
+[297] = { 3, TD|TF, SEN(symlinkat), "symlinkat" },
+[298] = { 4, TD|TF, SEN(readlinkat), "readlinkat" },
+[299] = { 3, TD|TF, SEN(fchmodat), "fchmodat" },
+[300] = { 3, TD|TF, SEN(faccessat), "faccessat" },
+[301] = { 6, TD, SEN(pselect6_time32), "pselect6" },
+[302] = { 5, TD, SEN(ppoll_time32), "ppoll" },
+[303] = { 1, 0, SEN(unshare), "unshare" },
+[304] = { 2, 0, SEN(set_robust_list), "set_robust_list" },
+[305] = { 3, 0, SEN(get_robust_list), "get_robust_list" },
+[306] = { 6, TD, SEN(splice), "splice" },
+[307] = { 6, TD, SEN(sync_file_range), "sync_file_range" },
+[308] = { 4, TD, SEN(tee), "tee" },
+[309] = { 4, TD, SEN(vmsplice), "vmsplice" },
+[310] = { 6, TM, SEN(move_pages), "move_pages" },
+[311] = { 3, 0, SEN(getcpu), "getcpu" },
+[312] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" },
+[313] = { 2, TF, SEN(utimes), "utimes" },
+[314] = { 6, TD, SEN(fallocate), "fallocate" },
+[315] = { 4, TD|TF, SEN(utimensat_time32), "utimensat" },
+[316] = { 3, TD|TS, SEN(signalfd), "signalfd" },
+[317] = { 4, TD, SEN(timerfd), "timerfd" },
+[318] = { 1, TD, SEN(eventfd), "eventfd" },
+[319] = { 2, TD, SEN(timerfd_create), "timerfd_create" },
+[320] = { 4, TD, SEN(timerfd_settime32), "timerfd_settime" },
+[321] = { 2, TD, SEN(timerfd_gettime32), "timerfd_gettime" },
+[322] = { 4, TD|TS, SEN(signalfd4), "signalfd4" },
+[323] = { 2, TD, SEN(eventfd2), "eventfd2" },
+[324] = { 1, TD, SEN(inotify_init1), "inotify_init1" },
+[325] = { 2, TD, SEN(pipe2), "pipe2" },
+[326] = { 3, TD, SEN(dup3), "dup3" },
+[327] = { 1, TD, SEN(epoll_create1), "epoll_create1" },
+[328] = { 5, TD, SEN(preadv), "preadv" },
+[329] = { 5, TD, SEN(pwritev), "pwritev" },
+[330] = { 4, TP|TS, SEN(rt_tgsigqueueinfo), "rt_tgsigqueueinfo" },
+[331] = { 5, TD, SEN(perf_event_open), "perf_event_open" },
+[332] = { 2, TD, SEN(fanotify_init), "fanotify_init" },
+[333] = { 6, TD|TF, SEN(fanotify_mark), "fanotify_mark" },
+[334] = { 4, 0, SEN(prlimit64), "prlimit64" },
+[335] = { 5, TD|TF, SEN(name_to_handle_at), "name_to_handle_at" },
+[336] = { 3, TD, SEN(open_by_handle_at), "open_by_handle_at" },
+[337] = { 2, TCL, SEN(clock_adjtime32), "clock_adjtime" },
+[338] = { 1, TD, SEN(syncfs), "syncfs" },
+[339] = { 2, TD, SEN(setns), "setns" },
+[340] = { 6, 0, SEN(process_vm_readv), "process_vm_readv" },
+[341] = { 6, 0, SEN(process_vm_writev), "process_vm_writev" },
+[342] = { 2, 0, SEN(s390_runtime_instr), "s390_runtime_instr" },
+[343] = { 5, 0, SEN(kcmp), "kcmp" },
+[344] = { 3, TD, SEN(finit_module), "finit_module" },
+[345] = { 3, 0, SEN(sched_setattr), "sched_setattr" },
+[346] = { 4, 0, SEN(sched_getattr), "sched_getattr" },
+[347] = { 5, TD|TF, SEN(renameat2), "renameat2" },
+[348] = { 3, 0, SEN(seccomp), "seccomp" },
+[349] = { 3, 0, SEN(getrandom), "getrandom" },
+[350] = { 2, TD, SEN(memfd_create), "memfd_create" },
+[351] = { 3, TD, SEN(bpf), "bpf" },
+[352] = { 3, 0, SEN(s390_pci_mmio_write), "s390_pci_mmio_write" },
+[353] = { 3, 0, SEN(s390_pci_mmio_read), "s390_pci_mmio_read" },
+[354] = { 5, TD|TF|TP|TSD|SE|SI, SEN(execveat), "execveat" },
+[355] = { 1, TD, SEN(userfaultfd), "userfaultfd" },
+[356] = { 3, 0, SEN(membarrier), "membarrier" },
+[357] = { 5, TN, SEN(recvmmsg_time32), "recvmmsg" },
+[358] = { 4, TN, SEN(sendmmsg), "sendmmsg" },
+[359] = { 3, TN, SEN(socket), "socket" },
+[360] = { 4, TN, SEN(socketpair), "socketpair" },
+[361] = { 3, TN, SEN(bind), "bind" },
+[362] = { 3, TN, SEN(connect), "connect" },
+[363] = { 2, TN, SEN(listen), "listen" },
+[364] = { 4, TN, SEN(accept4), "accept4" },
+[365] = { 5, TN, SEN(getsockopt), "getsockopt" },
+[366] = { 5, TN, SEN(setsockopt), "setsockopt" },
+[367] = { 3, TN, SEN(getsockname), "getsockname" },
+[368] = { 3, TN, SEN(getpeername), "getpeername" },
+[369] = { 6, TN, SEN(sendto), "sendto" },
+[370] = { 3, TN, SEN(sendmsg), "sendmsg" },
+[371] = { 6, TN, SEN(recvfrom), "recvfrom" },
+[372] = { 3, TN, SEN(recvmsg), "recvmsg" },
+[373] = { 2, TN, SEN(shutdown), "shutdown" },
+[374] = { 3, TM, SEN(mlock2), "mlock2" },
+[375] = { 6, TD, SEN(copy_file_range), "copy_file_range" },
+[376] = { 6, TD, SEN(preadv2), "preadv2" },
+[377] = { 6, TD, SEN(pwritev2), "pwritev2" },
+[378] = { 2, 0, SEN(s390_guarded_storage), "s390_guarded_storage" },
+[379] = { 5, TD|TF|TFST|TSTA,SEN(statx), "statx" },
+[380] = { 4, 0, SEN(s390_sthyi), "s390_sthyi" },
+[381] = { 5, TD, SEN(kexec_file_load), "kexec_file_load" },
+[382] = { 6, 0, SEN(io_pgetevents_time32), "io_pgetevents" },
+[383] = { 4, 0, SEN(rseq), "rseq" },
+[384] = { 4, TM|SI, SEN(pkey_mprotect), "pkey_mprotect" },
+[385] = { 2, 0, SEN(pkey_alloc), "pkey_alloc" },
+[386] = { 1, 0, SEN(pkey_free), "pkey_free" },
+/* room for arch specific calls */
+[393] = { 3, TI, SEN(semget), "semget" },
+[394] = { 4, TI, SEN(semctl), "semctl" },
+[395] = { 3, TI, SEN(shmget), "shmget" },
+[396] = { 3, TI, SEN(shmctl), "shmctl" },
+[397] = { 3, TI|TM|SI, SEN(shmat), "shmat" },
+[398] = { 1, TI|TM|SI, SEN(shmdt), "shmdt" },
+[399] = { 2, TI, SEN(msgget), "msgget" },
+[400] = { 4, TI, SEN(msgsnd), "msgsnd" },
+[401] = { 5, TI, SEN(msgrcv), "msgrcv" },
+[402] = { 3, TI, SEN(msgctl), "msgctl" },
+#include "syscallent-common-32.h"
+#include "syscallent-common.h"
+
+#define SYS_socket_subcall 500
+#include "subcall32.h"
diff --git a/src/linux/s390/userent.h b/src/linux/s390/userent.h
new file mode 100644
index 000000000..8ba070b98
--- /dev/null
+++ b/src/linux/s390/userent.h
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2014-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "userent0.h"
+{ PT_FPR0_HI, "fpr0.hi" },
+{ PT_FPR0_LO, "fpr0.lo" },
+{ PT_FPR1_HI, "fpr1.hi" },
+{ PT_FPR1_LO, "fpr1.lo" },
+{ PT_FPR2_HI, "fpr2.hi" },
+{ PT_FPR2_LO, "fpr2.lo" },
+{ PT_FPR3_HI, "fpr3.hi" },
+{ PT_FPR3_LO, "fpr3.lo" },
+{ PT_FPR4_HI, "fpr4.hi" },
+{ PT_FPR4_LO, "fpr4.lo" },
+{ PT_FPR5_HI, "fpr5.hi" },
+{ PT_FPR5_LO, "fpr5.lo" },
+{ PT_FPR6_HI, "fpr6.hi" },
+{ PT_FPR6_LO, "fpr6.lo" },
+{ PT_FPR7_HI, "fpr7.hi" },
+{ PT_FPR7_LO, "fpr7.lo" },
+{ PT_FPR8_HI, "fpr8.hi" },
+{ PT_FPR8_LO, "fpr8.lo" },
+{ PT_FPR9_HI, "fpr9.hi" },
+{ PT_FPR9_LO, "fpr9.lo" },
+{ PT_FPR10_HI, "fpr10.hi" },
+{ PT_FPR10_LO, "fpr10.lo" },
+{ PT_FPR11_HI, "fpr11.hi" },
+{ PT_FPR11_LO, "fpr11.lo" },
+{ PT_FPR12_HI, "fpr12.hi" },
+{ PT_FPR12_LO, "fpr12.lo" },
+{ PT_FPR13_HI, "fpr13.hi" },
+{ PT_FPR13_LO, "fpr13.lo" },
+{ PT_FPR14_HI, "fpr14.hi" },
+{ PT_FPR14_LO, "fpr14.lo" },
+{ PT_FPR15_HI, "fpr15.hi" },
+{ PT_FPR15_LO, "fpr15.lo" },
+/* Other fields in "struct user" */
+#include "userent1.h"
diff --git a/src/linux/s390/userent0.h b/src/linux/s390/userent0.h
new file mode 100644
index 000000000..21a90fb7b
--- /dev/null
+++ b/src/linux/s390/userent0.h
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2014-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+{ PT_PSWMASK, "psw_mask" },
+{ PT_PSWADDR, "psw_addr" },
+{ PT_GPR0, "gpr0" },
+{ PT_GPR1, "gpr1" },
+{ PT_GPR2, "gpr2" },
+{ PT_GPR3, "gpr3" },
+{ PT_GPR4, "gpr4" },
+{ PT_GPR5, "gpr5" },
+{ PT_GPR6, "gpr6" },
+{ PT_GPR7, "gpr7" },
+{ PT_GPR8, "gpr8" },
+{ PT_GPR9, "gpr9" },
+{ PT_GPR10, "gpr10" },
+{ PT_GPR11, "gpr11" },
+{ PT_GPR12, "gpr12" },
+{ PT_GPR13, "gpr13" },
+{ PT_GPR14, "gpr14" },
+{ PT_GPR15, "gpr15" },
+{ PT_ACR0, "acr0" },
+{ PT_ACR1, "acr1" },
+{ PT_ACR2, "acr2" },
+{ PT_ACR3, "acr3" },
+{ PT_ACR4, "acr4" },
+{ PT_ACR5, "acr5" },
+{ PT_ACR6, "acr6" },
+{ PT_ACR7, "acr7" },
+{ PT_ACR8, "acr8" },
+{ PT_ACR9, "acr9" },
+{ PT_ACR10, "acr10" },
+{ PT_ACR11, "acr11" },
+{ PT_ACR12, "acr12" },
+{ PT_ACR13, "acr13" },
+{ PT_ACR14, "acr14" },
+{ PT_ACR15, "acr15" },
+{ PT_ORIGGPR2, "orig_gpr2" },
+{ PT_FPC, "fpc" },
+/* PT_FPR* differ between s390 and s390x */
+{ PT_CR_9, "cr9" },
+{ PT_CR_10, "cr10" },
+{ PT_CR_11, "cr11" },
+{ PT_IEEE_IP, "ieee_exception_ip" },
diff --git a/src/linux/s390/userent1.h b/src/linux/s390/userent1.h
new file mode 100644
index 000000000..6691167cc
--- /dev/null
+++ b/src/linux/s390/userent1.h
@@ -0,0 +1,18 @@
+/*
+ * Copyright (c) 2014-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+XLAT_UOFF(u_tsize),
+XLAT_UOFF(u_dsize),
+XLAT_UOFF(u_ssize),
+XLAT_UOFF(start_code),
+/* S390[X] has no start_data */
+XLAT_UOFF(start_stack),
+XLAT_UOFF(signal),
+XLAT_UOFF(u_ar0),
+XLAT_UOFF(magic),
+XLAT_UOFF(u_comm),
+#include "../userent0.h"
diff --git a/src/linux/s390x/arch_defs_.h b/src/linux/s390x/arch_defs_.h
new file mode 100644
index 000000000..750ab5121
--- /dev/null
+++ b/src/linux/s390x/arch_defs_.h
@@ -0,0 +1,13 @@
+/*
+ * Copyright (c) 2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#define HAVE_ARCH_OLD_MMAP 1
+#define HAVE_ARCH_OLD_MMAP_PGOFF 1
+#define HAVE_ARCH_UID16_SYSCALLS 1
+#define SUPPORTED_PERSONALITIES 2
+#define PERSONALITY0_AUDIT_ARCH { AUDIT_ARCH_S390X, 0 }
+#define PERSONALITY1_AUDIT_ARCH { AUDIT_ARCH_S390, 0 }
diff --git a/src/linux/s390x/arch_get_personality.c b/src/linux/s390x/arch_get_personality.c
new file mode 100644
index 000000000..a87346393
--- /dev/null
+++ b/src/linux/s390x/arch_get_personality.c
@@ -0,0 +1,13 @@
+/*
+ * Copyright (c) 2018 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2018-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+int
+get_personality_from_syscall_info(const struct_ptrace_syscall_info *sci)
+{
+ return sci->arch == AUDIT_ARCH_S390;
+}
diff --git a/src/linux/s390x/arch_regs.c b/src/linux/s390x/arch_regs.c
new file mode 100644
index 000000000..7a2c0a6a4
--- /dev/null
+++ b/src/linux/s390x/arch_regs.c
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef HAVE_S390_COMPAT_REGS
+typedef struct {
+ uint32_t mask;
+ uint32_t addr;
+} ATTRIBUTE_ALIGNED(8) psw_compat_t;
+
+typedef struct {
+ psw_compat_t psw;
+ uint32_t gprs[NUM_GPRS];
+ uint32_t acrs[NUM_ACRS];
+ uint32_t orig_gpr2;
+} s390_compat_regs;
+#endif
+
+static union {
+ s390_compat_regs s390_regs;
+ s390_regs s390x_regs;
+} s390x_regs_union;
+
+#define s390_regset s390x_regs_union.s390_regs
+#define s390x_regset s390x_regs_union.s390x_regs
+
+static struct iovec s390x_io = {
+ .iov_base = &s390x_regs_union,
+};
+
+
+#define ARCH_REGS_FOR_GETREGSET s390x_regs_union
+#define ARCH_IOVEC_FOR_GETREGSET s390x_io
+#define ARCH_PC_REG \
+ (s390x_io.iov_len == sizeof(s390_regset) ? \
+ s390_regset.psw.addr : s390x_regset.psw.addr)
+#define ARCH_SP_REG \
+ (s390x_io.iov_len == sizeof(s390_regset) ? \
+ s390_regset.gprs[15] : s390x_regset.gprs[15])
+
+#define ARCH_PERSONALITY_0_IOV_SIZE sizeof(s390x_regset)
+#define ARCH_PERSONALITY_1_IOV_SIZE sizeof(s390_regset)
diff --git a/src/linux/s390x/arch_sigreturn.c b/src/linux/s390x/arch_sigreturn.c
new file mode 100644
index 000000000..641c00807
--- /dev/null
+++ b/src/linux/s390x/arch_sigreturn.c
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2015-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include <stdint.h>
+
+#define PTR_TYPE uint32_t
+#define arch_sigreturn s390_arch_sigreturn
+#include "s390/arch_sigreturn.c"
+#undef arch_sigreturn
+#undef PTR_TYPE
+#undef SIGNAL_FRAMESIZE
+
+#define SIGNAL_FRAMESIZE 160
+#define arch_sigreturn s390x_arch_sigreturn
+#include "s390/arch_sigreturn.c"
+#undef arch_sigreturn
+
+static void
+arch_sigreturn(struct tcb *tcp)
+{
+ if (tcp->currpers == 1)
+ s390_arch_sigreturn(tcp);
+ else
+ s390x_arch_sigreturn(tcp);
+}
diff --git a/src/linux/s390x/check_scno.c b/src/linux/s390x/check_scno.c
new file mode 100644
index 000000000..c2e9aaa16
--- /dev/null
+++ b/src/linux/s390x/check_scno.c
@@ -0,0 +1 @@
+#include "s390/check_scno.c"
diff --git a/src/linux/s390x/get_error.c b/src/linux/s390x/get_error.c
new file mode 100644
index 000000000..0d3b610c8
--- /dev/null
+++ b/src/linux/s390x/get_error.c
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "negated_errno.h"
+
+#define arch_get_error s390_get_error
+#define ARCH_REGSET s390_regset
+#include "../s390/get_error.c"
+#undef ARCH_REGSET
+#undef arch_get_error
+
+#define arch_get_error s390x_get_error
+#define ARCH_REGSET s390x_regset
+#include "../s390/get_error.c"
+#undef ARCH_REGSET
+#undef arch_get_error
+
+static void
+arch_get_error(struct tcb *tcp, const bool check_errno)
+{
+ if (tcp->currpers == 1)
+ s390_get_error(tcp, check_errno);
+ else
+ s390x_get_error(tcp, check_errno);
+}
diff --git a/src/linux/s390x/get_scno.c b/src/linux/s390x/get_scno.c
new file mode 100644
index 000000000..5f9cf4e7f
--- /dev/null
+++ b/src/linux/s390x/get_scno.c
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#define arch_get_scno s390_get_scno
+#define ARCH_REGSET s390_regset
+#include "../s390/get_scno.c"
+#undef ARCH_REGSET
+#undef arch_get_scno
+
+#define arch_get_scno s390x_get_scno
+#define ARCH_REGSET s390x_regset
+#include "../s390/get_scno.c"
+#undef ARCH_REGSET
+#undef arch_get_scno
+
+static int
+arch_get_scno(struct tcb *tcp)
+{
+ if (s390x_io.iov_len == sizeof(s390_regset))
+ return s390_get_scno(tcp);
+ else
+ return s390x_get_scno(tcp);
+}
diff --git a/src/linux/s390x/get_syscall_args.c b/src/linux/s390x/get_syscall_args.c
new file mode 100644
index 000000000..1a7147c0d
--- /dev/null
+++ b/src/linux/s390x/get_syscall_args.c
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#define arch_get_syscall_args s390_get_syscall_args
+#define ARCH_REGSET s390_regset
+#include "../s390/get_syscall_args.c"
+#undef ARCH_REGSET
+#undef arch_get_syscall_args
+
+#define arch_get_syscall_args s390x_get_syscall_args
+#define ARCH_REGSET s390x_regset
+#include "../s390/get_syscall_args.c"
+#undef ARCH_REGSET
+#undef arch_get_syscall_args
+
+/* Return -1 on error or 1 on success (never 0!). */
+static int
+arch_get_syscall_args(struct tcb *tcp)
+{
+ if (tcp->currpers == 1)
+ return s390_get_syscall_args(tcp);
+ else
+ return s390x_get_syscall_args(tcp);
+}
diff --git a/src/linux/s390x/ioctls_arch0.h b/src/linux/s390x/ioctls_arch0.h
new file mode 100644
index 000000000..d3ddf0361
--- /dev/null
+++ b/src/linux/s390x/ioctls_arch0.h
@@ -0,0 +1,170 @@
+/* Generated by ioctls_gen.sh from definitions found in $linux/arch/s390/include/ tree. */
+{ "asm/chsc.h", "CHSC_INFO_CCL", _IOC_READ|_IOC_WRITE, 0x6386, 0x1014 },
+{ "asm/chsc.h", "CHSC_INFO_CHANNEL_PATH", _IOC_READ|_IOC_WRITE, 0x6382, 0x100c },
+{ "asm/chsc.h", "CHSC_INFO_CI", _IOC_READ|_IOC_WRITE, 0x6385, 0x100c },
+{ "asm/chsc.h", "CHSC_INFO_CPD", _IOC_READ|_IOC_WRITE, 0x6387, 0x1014 },
+{ "asm/chsc.h", "CHSC_INFO_CU", _IOC_READ|_IOC_WRITE, 0x6383, 0x100c },
+{ "asm/chsc.h", "CHSC_INFO_DCAL", _IOC_READ|_IOC_WRITE, 0x6388, 0x1010 },
+{ "asm/chsc.h", "CHSC_INFO_SCH_CU", _IOC_READ|_IOC_WRITE, 0x6384, 0x1008 },
+{ "asm/chsc.h", "CHSC_ON_CLOSE_REMOVE", _IOC_NONE, 0x638b, 0x00 },
+{ "asm/chsc.h", "CHSC_ON_CLOSE_SET", _IOC_READ|_IOC_WRITE, 0x638a, 0x1000 },
+{ "asm/chsc.h", "CHSC_START", _IOC_READ|_IOC_WRITE, 0x6381, 0x1000 },
+{ "asm/chsc.h", "CHSC_START_SYNC", _IOC_READ|_IOC_WRITE, 0x6389, 0x1000 },
+{ "asm/clp.h", "CLP_SYNC", _IOC_READ|_IOC_WRITE, 0x63c1, 0x10 },
+{ "asm/cmb.h", "BIODASDCMFDISABLE", _IOC_NONE, 0x4421, 0x00 },
+{ "asm/cmb.h", "BIODASDCMFENABLE", _IOC_NONE, 0x4420, 0x00 },
+{ "asm/cmb.h", "BIODASDREADALLCMB", _IOC_READ|_IOC_WRITE, 0x4421, 0x58 },
+{ "asm/dasd.h", "BIODASDABORTIO", _IOC_NONE, 0x44f0, 0x00 },
+{ "asm/dasd.h", "BIODASDALLOWIO", _IOC_NONE, 0x44f1, 0x00 },
+{ "asm/dasd.h", "BIODASDCHECKFMT", _IOC_READ|_IOC_WRITE, 0x4402, 0x28 },
+{ "asm/dasd.h", "BIODASDDISABLE", _IOC_NONE, 0x4400, 0x00 },
+{ "asm/dasd.h", "BIODASDENABLE", _IOC_NONE, 0x4401, 0x00 },
+{ "asm/dasd.h", "BIODASDFMT", _IOC_WRITE, 0x4401, 0x10 },
+{ "asm/dasd.h", "BIODASDGATTR", _IOC_READ, 0x4405, 0x20 },
+{ "asm/dasd.h", "BIODASDINFO", _IOC_READ, 0x4401, 0x178 },
+{ "asm/dasd.h", "BIODASDINFO2", _IOC_READ, 0x4403, 0x1a0 },
+{ "asm/dasd.h", "BIODASDPRRD", _IOC_READ, 0x4402, 0x408 },
+{ "asm/dasd.h", "BIODASDPRRST", _IOC_NONE, 0x4405, 0x00 },
+{ "asm/dasd.h", "BIODASDPSRD", _IOC_READ, 0x4404, 0xc0 },
+{ "asm/dasd.h", "BIODASDQUIESCE", _IOC_NONE, 0x4406, 0x00 },
+{ "asm/dasd.h", "BIODASDRAS", _IOC_WRITE, 0x4403, 0x10 },
+{ "asm/dasd.h", "BIODASDRESUME", _IOC_NONE, 0x4407, 0x00 },
+{ "asm/dasd.h", "BIODASDRLSE", _IOC_NONE, 0x4403, 0x00 },
+{ "asm/dasd.h", "BIODASDRSRV", _IOC_NONE, 0x4402, 0x00 },
+{ "asm/dasd.h", "BIODASDSATTR", _IOC_WRITE, 0x4402, 0x20 },
+{ "asm/dasd.h", "BIODASDSLCK", _IOC_NONE, 0x4404, 0x00 },
+{ "asm/dasd.h", "BIODASDSNID", _IOC_READ|_IOC_WRITE, 0x4401, 0x0d },
+{ "asm/dasd.h", "BIODASDSYMMIO", _IOC_READ|_IOC_WRITE, 0x44f0, 0x20 },
+{ "asm/dasd.h", "DASDAPIVER", _IOC_READ, 0x4400, 0x04 },
+{ "asm/hypfs.h", "HYPFS_DIAG304", _IOC_READ|_IOC_WRITE, 0x1020, 0x18 },
+{ "asm/ioctls.h", "FIOQSIZE", 0, 0x545E, 0 },
+{ "asm/pkey.h", "PKEY_APQNS4K", _IOC_READ|_IOC_WRITE, 0x701b, 0x20 },
+{ "asm/pkey.h", "PKEY_APQNS4KT", _IOC_READ|_IOC_WRITE, 0x701c, 0x58 },
+{ "asm/pkey.h", "PKEY_CLR2PROTK", _IOC_READ|_IOC_WRITE, 0x7004, 0x6c },
+{ "asm/pkey.h", "PKEY_CLR2SECK", _IOC_READ|_IOC_WRITE, 0x7002, 0x68 },
+{ "asm/pkey.h", "PKEY_CLR2SECK2", _IOC_READ|_IOC_WRITE, 0x7012, 0x48 },
+{ "asm/pkey.h", "PKEY_FINDCARD", _IOC_READ|_IOC_WRITE, 0x7005, 0x44 },
+{ "asm/pkey.h", "PKEY_GENPROTK", _IOC_READ|_IOC_WRITE, 0x7008, 0x4c },
+{ "asm/pkey.h", "PKEY_GENSECK", _IOC_READ|_IOC_WRITE, 0x7001, 0x48 },
+{ "asm/pkey.h", "PKEY_GENSECK2", _IOC_READ|_IOC_WRITE, 0x7011, 0x28 },
+{ "asm/pkey.h", "PKEY_KBLOB2PROTK", _IOC_READ|_IOC_WRITE, 0x700a, 0x58 },
+{ "asm/pkey.h", "PKEY_KBLOB2PROTK2", _IOC_READ|_IOC_WRITE, 0x701a, 0x68 },
+{ "asm/pkey.h", "PKEY_KBLOB2PROTK3", _IOC_READ|_IOC_WRITE, 0x701d, 0x30 },
+{ "asm/pkey.h", "PKEY_SEC2PROTK", _IOC_READ|_IOC_WRITE, 0x7003, 0x8c },
+{ "asm/pkey.h", "PKEY_SKEY2PKEY", _IOC_READ|_IOC_WRITE, 0x7006, 0x88 },
+{ "asm/pkey.h", "PKEY_VERIFYKEY", _IOC_READ|_IOC_WRITE, 0x7007, 0x4c },
+{ "asm/pkey.h", "PKEY_VERIFYKEY2", _IOC_READ|_IOC_WRITE, 0x7017, 0x20 },
+{ "asm/pkey.h", "PKEY_VERIFYPROTK", _IOC_WRITE, 0x7009, 0x48 },
+{ "asm/sclp_ctl.h", "SCLP_CTL_SCCB", _IOC_READ|_IOC_WRITE, 0x1010, 0x0c },
+{ "asm/tape390.h", "TAPE390_CRYPT_QUERY", _IOC_READ, 0x6403, 0x03 },
+{ "asm/tape390.h", "TAPE390_CRYPT_SET", _IOC_WRITE, 0x6402, 0x03 },
+{ "asm/tape390.h", "TAPE390_DISPLAY", _IOC_WRITE, 0x6401, 0x11 },
+{ "asm/tape390.h", "TAPE390_KEKL_QUERY", _IOC_READ, 0x6405, 0x86 },
+{ "asm/tape390.h", "TAPE390_KEKL_SET", _IOC_WRITE, 0x6404, 0x86 },
+{ "asm/vmcp.h", "VMCP_GETCODE", _IOC_READ, 0x1001, 0x04 },
+{ "asm/vmcp.h", "VMCP_GETSIZE", _IOC_READ, 0x1003, 0x04 },
+{ "asm/vmcp.h", "VMCP_SETBUF", _IOC_WRITE, 0x1002, 0x04 },
+{ "asm/zcrypt.h", "ICARSACRT", _IOC_READ|_IOC_WRITE, 0x7a06, 0x00 },
+{ "asm/zcrypt.h", "ICARSAMODEXPO", _IOC_READ|_IOC_WRITE, 0x7a05, 0x00 },
+{ "asm/zcrypt.h", "Z90STAT_DOMAIN_INDEX", _IOC_READ, 0x7a47, 0x04 },
+{ "asm/zcrypt.h", "Z90STAT_PENDINGQ_COUNT", _IOC_READ, 0x7a45, 0x04 },
+{ "asm/zcrypt.h", "Z90STAT_PERDEV_REQCNT", _IOC_READ, 0x7a4a, 0x100 },
+{ "asm/zcrypt.h", "Z90STAT_QDEPTH_MASK", _IOC_READ, 0x7a49, 0x40 },
+{ "asm/zcrypt.h", "Z90STAT_REQUESTQ_COUNT", _IOC_READ, 0x7a44, 0x04 },
+{ "asm/zcrypt.h", "Z90STAT_STATUS_MASK", _IOC_READ, 0x7a48, 0x40 },
+{ "asm/zcrypt.h", "Z90STAT_TOTALOPEN_COUNT", _IOC_READ, 0x7a46, 0x04 },
+{ "asm/zcrypt.h", "ZCRYPT_DEVICE_STATUS", _IOC_READ|_IOC_WRITE, 0x7a5f, 0x00 },
+{ "asm/zcrypt.h", "ZCRYPT_PERDEV_REQCNT", _IOC_READ, 0x7a5a, 0x400 },
+{ "asm/zcrypt.h", "ZCRYPT_QDEPTH_MASK", _IOC_READ, 0x7a59, 0x100 },
+{ "asm/zcrypt.h", "ZCRYPT_STATUS_MASK", _IOC_READ, 0x7a58, 0x100 },
+{ "asm/zcrypt.h", "ZDEVICESTATUS", _IOC_READ|_IOC_WRITE, 0x7a4f, 0x00 },
+{ "asm/zcrypt.h", "ZSECSENDCPRB", _IOC_READ|_IOC_WRITE, 0x7a81, 0x00 },
+{ "asm/zcrypt.h", "ZSENDEP11CPRB", _IOC_READ|_IOC_WRITE, 0x7a04, 0x00 },
+{ "linux/kvm.h", "KVM_ASSIGN_DEV_IRQ", _IOC_WRITE, 0xae70, 0x40 },
+{ "linux/kvm.h", "KVM_ASSIGN_PCI_DEVICE", _IOC_READ, 0xae69, 0x40 },
+{ "linux/kvm.h", "KVM_ASSIGN_SET_INTX_MASK", _IOC_WRITE, 0xaea4, 0x40 },
+{ "linux/kvm.h", "KVM_ASSIGN_SET_MSIX_ENTRY", _IOC_WRITE, 0xae74, 0x10 },
+{ "linux/kvm.h", "KVM_ASSIGN_SET_MSIX_NR", _IOC_WRITE, 0xae73, 0x08 },
+{ "linux/kvm.h", "KVM_CHECK_EXTENSION", _IOC_NONE, 0xae03, 0x00 },
+{ "linux/kvm.h", "KVM_CLEAR_DIRTY_LOG", _IOC_READ|_IOC_WRITE, 0xaec0, 0x18 },
+{ "linux/kvm.h", "KVM_CREATE_DEVICE", _IOC_READ|_IOC_WRITE, 0xaee0, 0x0c },
+{ "linux/kvm.h", "KVM_CREATE_IRQCHIP", _IOC_NONE, 0xae60, 0x00 },
+{ "linux/kvm.h", "KVM_CREATE_PIT", _IOC_NONE, 0xae64, 0x00 },
+{ "linux/kvm.h", "KVM_CREATE_PIT2", _IOC_WRITE, 0xae77, 0x40 },
+{ "linux/kvm.h", "KVM_CREATE_VCPU", _IOC_NONE, 0xae41, 0x00 },
+{ "linux/kvm.h", "KVM_CREATE_VM", _IOC_NONE, 0xae01, 0x00 },
+{ "linux/kvm.h", "KVM_DEASSIGN_DEV_IRQ", _IOC_WRITE, 0xae75, 0x40 },
+{ "linux/kvm.h", "KVM_DEASSIGN_PCI_DEVICE", _IOC_WRITE, 0xae72, 0x40 },
+{ "linux/kvm.h", "KVM_DIRTY_TLB", _IOC_WRITE, 0xaeaa, 0x10 },
+{ "linux/kvm.h", "KVM_ENABLE_CAP", _IOC_WRITE, 0xaea3, 0x68 },
+{ "linux/kvm.h", "KVM_GET_API_VERSION", _IOC_NONE, 0xae00, 0x00 },
+{ "linux/kvm.h", "KVM_GET_CLOCK", _IOC_READ, 0xae7c, 0x30 },
+{ "linux/kvm.h", "KVM_GET_DEVICE_ATTR", _IOC_WRITE, 0xaee2, 0x18 },
+{ "linux/kvm.h", "KVM_GET_DIRTY_LOG", _IOC_WRITE, 0xae42, 0x10 },
+{ "linux/kvm.h", "KVM_GET_FPU", _IOC_READ, 0xae8c, 0x88 },
+{ "linux/kvm.h", "KVM_GET_IRQCHIP", _IOC_READ|_IOC_WRITE, 0xae62, 0x208 },
+{ "linux/kvm.h", "KVM_GET_MP_STATE", _IOC_READ, 0xae98, 0x04 },
+{ "linux/kvm.h", "KVM_GET_NR_MMU_PAGES", _IOC_NONE, 0xae45, 0x00 },
+{ "linux/kvm.h", "KVM_GET_ONE_REG", _IOC_WRITE, 0xaeab, 0x10 },
+{ "linux/kvm.h", "KVM_GET_REGS", _IOC_READ, 0xae81, 0x80 },
+{ "linux/kvm.h", "KVM_GET_REG_LIST", _IOC_READ|_IOC_WRITE, 0xaeb0, 0x08 },
+{ "linux/kvm.h", "KVM_GET_SREGS", _IOC_READ, 0xae83, 0xc0 },
+{ "linux/kvm.h", "KVM_GET_TSC_KHZ", _IOC_NONE, 0xaea3, 0x00 },
+{ "linux/kvm.h", "KVM_GET_VCPU_MMAP_SIZE", _IOC_NONE, 0xae04, 0x00 },
+{ "linux/kvm.h", "KVM_HAS_DEVICE_ATTR", _IOC_WRITE, 0xaee3, 0x18 },
+{ "linux/kvm.h", "KVM_INTERRUPT", _IOC_WRITE, 0xae86, 0x04 },
+{ "linux/kvm.h", "KVM_IOEVENTFD", _IOC_WRITE, 0xae79, 0x40 },
+{ "linux/kvm.h", "KVM_IRQFD", _IOC_WRITE, 0xae76, 0x20 },
+{ "linux/kvm.h", "KVM_IRQ_LINE", _IOC_WRITE, 0xae61, 0x08 },
+{ "linux/kvm.h", "KVM_IRQ_LINE_STATUS", _IOC_READ|_IOC_WRITE, 0xae67, 0x08 },
+{ "linux/kvm.h", "KVM_KVMCLOCK_CTRL", _IOC_NONE, 0xaead, 0x00 },
+{ "linux/kvm.h", "KVM_MEMORY_ENCRYPT_OP", _IOC_READ|_IOC_WRITE, 0xaeba, 0x08 },
+{ "linux/kvm.h", "KVM_MEMORY_ENCRYPT_REG_REGION", _IOC_READ, 0xaebb, 0x10 },
+{ "linux/kvm.h", "KVM_MEMORY_ENCRYPT_UNREG_REGION", _IOC_READ, 0xaebc, 0x10 },
+{ "linux/kvm.h", "KVM_NMI", _IOC_NONE, 0xae9a, 0x00 },
+{ "linux/kvm.h", "KVM_REGISTER_COALESCED_MMIO", _IOC_WRITE, 0xae67, 0x10 },
+{ "linux/kvm.h", "KVM_REINJECT_CONTROL", _IOC_NONE, 0xae71, 0x00 },
+{ "linux/kvm.h", "KVM_RUN", _IOC_NONE, 0xae80, 0x00 },
+{ "linux/kvm.h", "KVM_S390_CLEAR_RESET", _IOC_NONE, 0xaec4, 0x00 },
+{ "linux/kvm.h", "KVM_S390_ENABLE_SIE", _IOC_NONE, 0xae06, 0x00 },
+{ "linux/kvm.h", "KVM_S390_GET_CMMA_BITS", _IOC_READ|_IOC_WRITE, 0xaeb8, 0x20 },
+{ "linux/kvm.h", "KVM_S390_GET_IRQ_STATE", _IOC_WRITE, 0xaeb6, 0x20 },
+{ "linux/kvm.h", "KVM_S390_GET_SKEYS", _IOC_WRITE, 0xaeb2, 0x40 },
+{ "linux/kvm.h", "KVM_S390_INITIAL_RESET", _IOC_NONE, 0xae97, 0x00 },
+{ "linux/kvm.h", "KVM_S390_INTERRUPT", _IOC_WRITE, 0xae94, 0x10 },
+{ "linux/kvm.h", "KVM_S390_IRQ", _IOC_WRITE, 0xaeb4, 0x48 },
+{ "linux/kvm.h", "KVM_S390_MEM_OP", _IOC_WRITE, 0xaeb1, 0x40 },
+{ "linux/kvm.h", "KVM_S390_NORMAL_RESET", _IOC_NONE, 0xaec3, 0x00 },
+{ "linux/kvm.h", "KVM_S390_PV_COMMAND", _IOC_READ|_IOC_WRITE, 0xaec5, 0x20 },
+{ "linux/kvm.h", "KVM_S390_SET_CMMA_BITS", _IOC_WRITE, 0xaeb9, 0x20 },
+{ "linux/kvm.h", "KVM_S390_SET_INITIAL_PSW", _IOC_WRITE, 0xae96, 0x10 },
+{ "linux/kvm.h", "KVM_S390_SET_IRQ_STATE", _IOC_WRITE, 0xaeb5, 0x20 },
+{ "linux/kvm.h", "KVM_S390_SET_SKEYS", _IOC_WRITE, 0xaeb3, 0x40 },
+{ "linux/kvm.h", "KVM_S390_STORE_STATUS", _IOC_WRITE, 0xae95, 0x08 },
+{ "linux/kvm.h", "KVM_S390_UCAS_MAP", _IOC_WRITE, 0xae50, 0x18 },
+{ "linux/kvm.h", "KVM_S390_UCAS_UNMAP", _IOC_WRITE, 0xae51, 0x18 },
+{ "linux/kvm.h", "KVM_S390_VCPU_FAULT", _IOC_WRITE, 0xae52, 0x08 },
+{ "linux/kvm.h", "KVM_SET_BOOT_CPU_ID", _IOC_NONE, 0xae78, 0x00 },
+{ "linux/kvm.h", "KVM_SET_CLOCK", _IOC_WRITE, 0xae7b, 0x30 },
+{ "linux/kvm.h", "KVM_SET_DEVICE_ATTR", _IOC_WRITE, 0xaee1, 0x18 },
+{ "linux/kvm.h", "KVM_SET_FPU", _IOC_WRITE, 0xae8d, 0x88 },
+{ "linux/kvm.h", "KVM_SET_GSI_ROUTING", _IOC_WRITE, 0xae6a, 0x08 },
+{ "linux/kvm.h", "KVM_SET_GUEST_DEBUG", _IOC_WRITE, 0xae9b, 0x18 },
+{ "linux/kvm.h", "KVM_SET_IDENTITY_MAP_ADDR", _IOC_WRITE, 0xae48, 0x08 },
+{ "linux/kvm.h", "KVM_SET_IRQCHIP", _IOC_READ, 0xae63, 0x208 },
+{ "linux/kvm.h", "KVM_SET_MEMORY_REGION", _IOC_WRITE, 0xae40, 0x18 },
+{ "linux/kvm.h", "KVM_SET_MP_STATE", _IOC_WRITE, 0xae99, 0x04 },
+{ "linux/kvm.h", "KVM_SET_NR_MMU_PAGES", _IOC_NONE, 0xae44, 0x00 },
+{ "linux/kvm.h", "KVM_SET_ONE_REG", _IOC_WRITE, 0xaeac, 0x10 },
+{ "linux/kvm.h", "KVM_SET_REGS", _IOC_WRITE, 0xae82, 0x80 },
+{ "linux/kvm.h", "KVM_SET_SIGNAL_MASK", _IOC_WRITE, 0xae8b, 0x04 },
+{ "linux/kvm.h", "KVM_SET_SREGS", _IOC_WRITE, 0xae84, 0xc0 },
+{ "linux/kvm.h", "KVM_SET_TSC_KHZ", _IOC_NONE, 0xaea2, 0x00 },
+{ "linux/kvm.h", "KVM_SET_TSS_ADDR", _IOC_NONE, 0xae47, 0x00 },
+{ "linux/kvm.h", "KVM_SET_USER_MEMORY_REGION", _IOC_WRITE, 0xae46, 0x20 },
+{ "linux/kvm.h", "KVM_SET_VAPIC_ADDR", _IOC_WRITE, 0xae93, 0x08 },
+{ "linux/kvm.h", "KVM_SIGNAL_MSI", _IOC_WRITE, 0xaea5, 0x20 },
+{ "linux/kvm.h", "KVM_SMI", _IOC_NONE, 0xaeb7, 0x00 },
+{ "linux/kvm.h", "KVM_TPR_ACCESS_REPORTING", _IOC_READ|_IOC_WRITE, 0xae92, 0x28 },
+{ "linux/kvm.h", "KVM_TRANSLATE", _IOC_READ|_IOC_WRITE, 0xae85, 0x18 },
+{ "linux/kvm.h", "KVM_UNREGISTER_COALESCED_MMIO", _IOC_WRITE, 0xae68, 0x10 },
diff --git a/src/linux/s390x/ioctls_arch1.h b/src/linux/s390x/ioctls_arch1.h
new file mode 100644
index 000000000..4a16cb5cc
--- /dev/null
+++ b/src/linux/s390x/ioctls_arch1.h
@@ -0,0 +1 @@
+#include "s390/ioctls_arch0.h"
diff --git a/src/linux/s390x/ioctls_inc0.h b/src/linux/s390x/ioctls_inc0.h
new file mode 100644
index 000000000..f9939faa4
--- /dev/null
+++ b/src/linux/s390x/ioctls_inc0.h
@@ -0,0 +1 @@
+#include "64/ioctls_inc.h"
diff --git a/src/linux/s390x/ioctls_inc1.h b/src/linux/s390x/ioctls_inc1.h
new file mode 100644
index 000000000..e09b6c6d5
--- /dev/null
+++ b/src/linux/s390x/ioctls_inc1.h
@@ -0,0 +1 @@
+#include "s390/ioctls_inc0.h"
diff --git a/src/linux/s390x/raw_syscall.h b/src/linux/s390x/raw_syscall.h
new file mode 100644
index 000000000..05789ce13
--- /dev/null
+++ b/src/linux/s390x/raw_syscall.h
@@ -0,0 +1 @@
+#include "s390/raw_syscall.h"
diff --git a/src/linux/s390x/rt_sigframe.h b/src/linux/s390x/rt_sigframe.h
new file mode 100644
index 000000000..fc9b22473
--- /dev/null
+++ b/src/linux/s390x/rt_sigframe.h
@@ -0,0 +1 @@
+#include "s390/rt_sigframe.h"
diff --git a/src/linux/s390x/set_error.c b/src/linux/s390x/set_error.c
new file mode 100644
index 000000000..2acd00a0f
--- /dev/null
+++ b/src/linux/s390x/set_error.c
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2016-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#define arch_set_error s390_set_error
+#define arch_set_success s390_set_success
+#define ARCH_REGSET s390_regset
+#include "../s390/set_error.c"
+#undef ARCH_REGSET
+#undef arch_set_success
+#undef arch_set_error
+
+#define arch_set_error s390x_set_error
+#define arch_set_success s390x_set_success
+#define ARCH_REGSET s390x_regset
+#include "../s390/set_error.c"
+#undef ARCH_REGSET
+#undef arch_set_success
+#undef arch_set_error
+
+static int
+arch_set_error(struct tcb *tcp)
+{
+ if (tcp->currpers == 1)
+ return s390_set_error(tcp);
+ else
+ return s390x_set_error(tcp);
+}
+
+static int
+arch_set_success(struct tcb *tcp)
+{
+ if (tcp->currpers == 1)
+ return s390_set_success(tcp);
+ else
+ return s390x_set_success(tcp);
+}
diff --git a/src/linux/s390x/set_scno.c b/src/linux/s390x/set_scno.c
new file mode 100644
index 000000000..a8d6f3bfa
--- /dev/null
+++ b/src/linux/s390x/set_scno.c
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2016-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#define arch_set_scno s390_set_scno
+#define ARCH_REGSET s390_regset
+#include "../s390/set_scno.c"
+#undef ARCH_REGSET
+#undef arch_set_scno
+
+#define arch_set_scno s390x_set_scno
+#define ARCH_REGSET s390x_regset
+#include "../s390/set_scno.c"
+#undef ARCH_REGSET
+#undef arch_set_scno
+
+static int
+arch_set_scno(struct tcb *tcp, kernel_ulong_t scno)
+{
+ if (tcp->currpers == 1)
+ return s390_set_scno(tcp, scno);
+ else
+ return s390x_set_scno(tcp, scno);
+}
diff --git a/src/linux/s390x/syscallent.h b/src/linux/s390x/syscallent.h
new file mode 100644
index 000000000..d0723b3ec
--- /dev/null
+++ b/src/linux/s390x/syscallent.h
@@ -0,0 +1,399 @@
+/*
+ * Copyright (c) 2000 IBM Deutschland Entwicklung GmbH, IBM Coporation
+ * Copyright (c) 2000-2020 The strace developers.
+ * Author: Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ *
+ */
+
+[ 0] = {MA, 0, SEN(setup), "setup" },
+[ 1] = { 1, TP|SE, SEN(exit), "exit" },
+[ 2] = { 0, TP, SEN(fork), "fork" },
+[ 3] = { 3, TD, SEN(read), "read" },
+[ 4] = { 3, TD, SEN(write), "write" },
+[ 5] = { 3, TD|TF, SEN(open), "open" },
+[ 6] = { 1, TD, SEN(close), "close" },
+[ 7] = { 0, 0, SEN(restart_syscall), "restart_syscall" },
+[ 8] = { 2, TD|TF, SEN(creat), "creat" },
+[ 9] = { 2, TF, SEN(link), "link" },
+[ 10] = { 1, TF, SEN(unlink), "unlink" },
+[ 11] = { 3, TF|TP|TSD|SE|SI, SEN(execve), "execve" },
+[ 12] = { 1, TF, SEN(chdir), "chdir" },
+[ 13] = { },
+[ 14] = { 3, TF, SEN(mknod), "mknod" },
+[ 15] = { 2, TF, SEN(chmod), "chmod" },
+[ 16] = { },
+[ 17] = { },
+[ 18] = { },
+[ 19] = { 3, TD, SEN(lseek), "lseek" },
+[ 20] = { 0, PU|NF, SEN(getpid), "getpid" },
+[ 21] = { 5, TF, SEN(mount), "mount" },
+[ 22] = { 1, TF, SEN(umount), "umount" },
+[ 23] = { },
+[ 24] = { },
+[ 25] = { },
+[ 26] = { 4, 0, SEN(ptrace), "ptrace" },
+[ 27] = { 1, 0, SEN(alarm), "alarm" },
+[ 28] = { },
+[ 29] = { 0, TS, SEN(pause), "pause" },
+[ 30] = { 2, TF, SEN(utime), "utime" },
+[ 31] = { },
+[ 32] = { },
+[ 33] = { 2, TF, SEN(access), "access" },
+[ 34] = { 1, 0, SEN(nice), "nice" },
+[ 35] = { },
+[ 36] = { 0, 0, SEN(sync), "sync" },
+[ 37] = { 2, TS|TP, SEN(kill), "kill" },
+[ 38] = { 2, TF, SEN(rename), "rename" },
+[ 39] = { 2, TF, SEN(mkdir), "mkdir" },
+[ 40] = { 1, TF, SEN(rmdir), "rmdir" },
+[ 41] = { 1, TD, SEN(dup), "dup" },
+[ 42] = { 1, TD, SEN(pipe), "pipe" },
+[ 43] = { 1, 0, SEN(times), "times" },
+[ 44] = { },
+[ 45] = { 1, TM|SI, SEN(brk), "brk" },
+[ 46] = { },
+[ 47] = { },
+[ 48] = { 2, TS, SEN(signal), "signal" },
+[ 49] = { },
+[ 50] = { },
+[ 51] = { 1, TF, SEN(acct), "acct" },
+[ 52] = { 2, TF, SEN(umount2), "umount2" },
+[ 53] = { },
+[ 54] = { 3, TD, SEN(ioctl), "ioctl" },
+[ 55] = { 3, TD, SEN(fcntl), "fcntl" },
+[ 56] = { },
+[ 57] = { 2, 0, SEN(setpgid), "setpgid" },
+[ 58] = { },
+[ 59] = { },
+[ 60] = { 1, NF, SEN(umask), "umask" },
+[ 61] = { 1, TF, SEN(chroot), "chroot" },
+[ 62] = { 2, TSFA, SEN(ustat), "ustat" },
+[ 63] = { 2, TD, SEN(dup2), "dup2" },
+[ 64] = { 0, PU|NF, SEN(getppid), "getppid" },
+[ 65] = { 0, PU|NF, SEN(getpgrp), "getpgrp" },
+[ 66] = { 0, 0, SEN(setsid), "setsid" },
+[ 67] = { 3, TS, SEN(sigaction), "sigaction" },
+[ 68 ... 71] = { },
+[ 72] = { 3, TS, SEN(sigsuspend), "sigsuspend" },
+[ 73] = { 1, TS, SEN(sigpending), "sigpending" },
+[ 74] = { 2, 0, SEN(sethostname), "sethostname" },
+[ 75] = { 2, 0, SEN(setrlimit), "setrlimit" },
+[ 76] = { },
+[ 77] = { 2, 0, SEN(getrusage), "getrusage" },
+[ 78] = { 2, TCL, SEN(gettimeofday), "gettimeofday" },
+[ 79] = { 2, TCL, SEN(settimeofday), "settimeofday" },
+[ 80 ... 82] = { },
+[ 83] = { 2, TF, SEN(symlink), "symlink" },
+[ 84] = { },
+[ 85] = { 3, TF, SEN(readlink), "readlink" },
+[ 86] = { 1, TF, SEN(uselib), "uselib" },
+[ 87] = { 2, TF, SEN(swapon), "swapon" },
+[ 88] = { 4, 0, SEN(reboot), "reboot" },
+[ 89] = { 3, TD, SEN(readdir), "readdir" },
+[ 90] = { 1, TD|TM|SI, SEN(old_mmap), "mmap" },
+[ 91] = { 2, TM|SI, SEN(munmap), "munmap" },
+[ 92] = { 2, TF, SEN(truncate), "truncate" },
+[ 93] = { 2, TD, SEN(ftruncate), "ftruncate" },
+[ 94] = { 2, TD, SEN(fchmod), "fchmod" },
+[ 95] = { },
+[ 96] = { 2, 0, SEN(getpriority), "getpriority" },
+[ 97] = { 3, 0, SEN(setpriority), "setpriority" },
+[ 98] = { },
+[ 99] = { 2, TF|TSF|TSFA, SEN(statfs), "statfs" },
+[100] = { 2, TD|TFSF|TSFA, SEN(fstatfs), "fstatfs" },
+[101] = { },
+[102] = { 2, TD|TSD, SEN(socketcall), "socketcall" },
+[103] = { 3, 0, SEN(syslog), "syslog" },
+[104] = { 3, 0, SEN(setitimer), "setitimer" },
+[105] = { 2, 0, SEN(getitimer), "getitimer" },
+[106] = { 2, TF|TST|TSTA, SEN(stat), "stat" },
+[107] = { 2, TF|TLST|TSTA, SEN(lstat), "lstat" },
+[108] = { 2, TD|TFST|TSTA, SEN(fstat), "fstat" },
+[109] = { },
+[110] = { 3, 0, SEN(lookup_dcookie), "lookup_dcookie" },
+[111] = { 0, 0, SEN(vhangup), "vhangup" },
+[112] = { 0, 0, SEN(idle), "idle" },
+[113] = { },
+[114] = { 4, TP, SEN(wait4), "wait4" },
+[115] = { 1, TF, SEN(swapoff), "swapoff" },
+[116] = { 1, 0, SEN(sysinfo), "sysinfo" },
+[117] = { 5, TI|TSD, SEN(ipc), "ipc" },
+[118] = { 1, TD, SEN(fsync), "fsync" },
+[119] = { 0, TS, SEN(sigreturn), "sigreturn" },
+[120] = { 5, TP, SEN(clone), "clone" },
+[121] = { 2, 0, SEN(setdomainname), "setdomainname" },
+[122] = { 1, 0, SEN(uname), "uname" },
+[123] = { },
+[124] = { 1, TCL, SEN(adjtimex64), "adjtimex" },
+[125] = { 3, TM|SI, SEN(mprotect), "mprotect" },
+[126] = { 3, TS, SEN(sigprocmask), "sigprocmask" },
+[127] = { 2, 0, SEN(create_module), "create_module" },
+[128] = { 3, 0, SEN(init_module), "init_module" },
+[129] = { 2, 0, SEN(delete_module), "delete_module" },
+[130] = { 1, 0, SEN(get_kernel_syms), "get_kernel_syms" },
+[131] = { 4, TF, SEN(quotactl), "quotactl" },
+[132] = { 1, 0, SEN(getpgid), "getpgid" },
+[133] = { 1, TD, SEN(fchdir), "fchdir" },
+[134] = { 2, 0, SEN(bdflush), "bdflush" },
+[135] = { 3, 0, SEN(sysfs), "sysfs" },
+[136] = { 1, NF, SEN(personality), "personality" },
+[137] = { 5, 0, SEN(afs_syscall), "afs_syscall" },
+[138 ... 140] = { },
+[141] = { 3, TD, SEN(getdents), "getdents" },
+[142] = { 5, TD, SEN(select), "select" },
+[143] = { 2, TD, SEN(flock), "flock" },
+[144] = { 3, TM, SEN(msync), "msync" },
+[145] = { 3, TD, SEN(readv), "readv" },
+[146] = { 3, TD, SEN(writev), "writev" },
+[147] = { 1, 0, SEN(getsid), "getsid" },
+[148] = { 1, TD, SEN(fdatasync), "fdatasync" },
+[149] = { 1, 0, SEN(sysctl), "_sysctl" },
+[150] = { 2, TM, SEN(mlock), "mlock" },
+[151] = { 2, TM, SEN(munlock), "munlock" },
+[152] = { 1, TM, SEN(mlockall), "mlockall" },
+[153] = { 0, TM, SEN(munlockall), "munlockall" },
+[154] = { 2, 0, SEN(sched_setparam), "sched_setparam" },
+[155] = { 2, 0, SEN(sched_getparam), "sched_getparam" },
+[156] = { 3, 0, SEN(sched_setscheduler), "sched_setscheduler" },
+[157] = { 1, 0, SEN(sched_getscheduler), "sched_getscheduler" },
+[158] = { 0, 0, SEN(sched_yield), "sched_yield" },
+[159] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"},
+[160] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"},
+[161] = { 2, 0, SEN(sched_rr_get_interval_time64),"sched_rr_get_interval"},
+[162] = { 2, 0, SEN(nanosleep_time64), "nanosleep" },
+[163] = { 5, TM|SI, SEN(mremap), "mremap" },
+[164 ... 166] = { },
+[167] = { 5, 0, SEN(query_module), "query_module" },
+[168] = { 3, TD, SEN(poll_time64), "poll" },
+[169] = { 3, 0, SEN(nfsservctl), "nfsservctl" },
+[170 ... 171] = { },
+[172] = { 5, TC, SEN(prctl), "prctl" },
+[173] = { 0, TS, SEN(rt_sigreturn), "rt_sigreturn" },
+[174] = { 4, TS, SEN(rt_sigaction), "rt_sigaction" },
+[175] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" },
+[176] = { 2, TS, SEN(rt_sigpending), "rt_sigpending" },
+[177] = { 4, TS, SEN(rt_sigtimedwait_time64), "rt_sigtimedwait" },
+[178] = { 3, TS|TP, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" },
+[179] = { 2, TS, SEN(rt_sigsuspend), "rt_sigsuspend" },
+[180] = { 4, TD, SEN(pread), "pread64" },
+[181] = { 4, TD, SEN(pwrite), "pwrite64" },
+[182] = { },
+[183] = { 2, TF, SEN(getcwd), "getcwd" },
+[184] = { 2, TC, SEN(capget), "capget" },
+[185] = { 2, TC, SEN(capset), "capset" },
+[186] = { 2, TS, SEN(sigaltstack), "sigaltstack" },
+[187] = { 4, TD|TN, SEN(sendfile), "sendfile" },
+[188] = { 5, TN, SEN(getpmsg), "getpmsg" },
+[189] = { 5, TN, SEN(putpmsg), "putpmsg" },
+[190] = { 0, TP, SEN(vfork), "vfork" },
+[191] = { 2, 0, SEN(getrlimit), "getrlimit" },
+[196 ... 197] = { },
+[198] = { 3, TF, SEN(chown), "lchown" },
+[199] = { 0, TC|PU|NF, SEN(getuid), "getuid" },
+[200] = { 0, TC|PU|NF, SEN(getgid), "getgid" },
+[201] = { 0, TC|PU|NF, SEN(geteuid), "geteuid" },
+[202] = { 0, TC|PU|NF, SEN(getegid), "getegid" },
+[203] = { 2, TC, SEN(setreuid), "setreuid" },
+[204] = { 2, TC, SEN(setregid), "setregid" },
+[205] = { 2, TC, SEN(getgroups), "getgroups" },
+[206] = { 2, TC, SEN(setgroups), "setgroups" },
+[207] = { 3, TD, SEN(fchown), "fchown" },
+[208] = { 3, TC, SEN(setresuid), "setresuid" },
+[209] = { 3, TC, SEN(getresuid), "getresuid" },
+[210] = { 3, TC, SEN(setresgid), "setresgid" },
+[211] = { 3, TC, SEN(getresgid), "getresgid" },
+[212] = { 3, TF, SEN(chown), "chown" },
+[213] = { 1, TC, SEN(setuid), "setuid" },
+[214] = { 1, TC, SEN(setgid), "setgid" },
+[215] = { 1, TC|NF, SEN(setfsuid), "setfsuid" },
+[216] = { 1, TC|NF, SEN(setfsgid), "setfsgid" },
+[217] = { 2, TF, SEN(pivotroot), "pivot_root" },
+[218] = { 3, TM, SEN(mincore), "mincore" },
+[219] = { 3, TM, SEN(madvise), "madvise" },
+[220] = { 3, TD, SEN(getdents64), "getdents64" },
+[221] = { },
+[222] = { 3, TD, SEN(readahead), "readahead" },
+[223] = { },
+[224] = { 5, TF, SEN(setxattr), "setxattr" },
+[225] = { 5, TF, SEN(setxattr), "lsetxattr" },
+[226] = { 5, TD, SEN(fsetxattr), "fsetxattr" },
+[227] = { 4, TF, SEN(getxattr), "getxattr" },
+[228] = { 4, TF, SEN(getxattr), "lgetxattr" },
+[229] = { 4, TD, SEN(fgetxattr), "fgetxattr" },
+[230] = { 3, TF, SEN(listxattr), "listxattr" },
+[231] = { 3, TF, SEN(listxattr), "llistxattr" },
+[232] = { 3, TD, SEN(flistxattr), "flistxattr" },
+[233] = { 2, TF, SEN(removexattr), "removexattr" },
+[234] = { 2, TF, SEN(removexattr), "lremovexattr" },
+[235] = { 2, TD, SEN(fremovexattr), "fremovexattr" },
+[236] = { 0, PU|NF, SEN(gettid), "gettid" },
+[237] = { 2, TS|TP, SEN(tkill), "tkill" },
+[238] = { 6, 0, SEN(futex_time64), "futex" },
+[239] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" },
+[240] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" },
+[241] = { 3, TS|TP, SEN(tgkill), "tgkill" },
+[242] = { },
+[243] = { 2, TM, SEN(io_setup), "io_setup" },
+[244] = { 1, TM, SEN(io_destroy), "io_destroy" },
+[245] = { 5, 0, SEN(io_getevents_time64), "io_getevents" },
+[246] = { 3, 0, SEN(io_submit), "io_submit" },
+[247] = { 3, 0, SEN(io_cancel), "io_cancel" },
+[248] = { 1, TP|SE, SEN(exit), "exit_group" },
+[249] = { 1, TD, SEN(epoll_create), "epoll_create" },
+[250] = { 4, TD, SEN(epoll_ctl), "epoll_ctl" },
+[251] = { 4, TD, SEN(epoll_wait), "epoll_wait" },
+[252] = { 1, 0, SEN(set_tid_address), "set_tid_address" },
+[253] = { 4, TD, SEN(fadvise64), "fadvise64" },
+[254] = { 3, 0, SEN(timer_create), "timer_create" },
+[255] = { 4, 0, SEN(timer_settime64), "timer_settime" },
+[256] = { 2, 0, SEN(timer_gettime64), "timer_gettime" },
+[257] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" },
+[258] = { 1, 0, SEN(timer_delete), "timer_delete" },
+[259] = { 2, TCL, SEN(clock_settime64), "clock_settime" },
+[260] = { 2, TCL, SEN(clock_gettime64), "clock_gettime" },
+[261] = { 2, TCL, SEN(clock_getres_time64), "clock_getres" },
+[262] = { 4, 0, SEN(clock_nanosleep_time64), "clock_nanosleep" },
+[263] = { 5, 0, SEN(vserver), "vserver" },
+[264] = { },
+[265] = { 3, TF|TSF|TSFA, SEN(statfs64), "statfs64" },
+[266] = { 3, TD|TFSF|TSFA, SEN(fstatfs64), "fstatfs64" },
+[267] = { 5, TM|SI, SEN(remap_file_pages), "remap_file_pages" },
+[268] = { 6, TM, SEN(mbind), "mbind" },
+[269] = { 5, TM, SEN(get_mempolicy), "get_mempolicy" },
+[270] = { 3, TM, SEN(set_mempolicy), "set_mempolicy" },
+[271] = { 4, TD, SEN(mq_open), "mq_open" },
+[272] = { 1, 0, SEN(mq_unlink), "mq_unlink" },
+[273] = { 5, TD, SEN(mq_timedsend_time64), "mq_timedsend" },
+[274] = { 5, TD, SEN(mq_timedreceive_time64), "mq_timedreceive" },
+[275] = { 2, TD, SEN(mq_notify), "mq_notify" },
+[276] = { 3, TD, SEN(mq_getsetattr), "mq_getsetattr" },
+[277] = { 4, 0, SEN(kexec_load), "kexec_load" },
+[278] = { 5, 0, SEN(add_key), "add_key" },
+[279] = { 4, 0, SEN(request_key), "request_key" },
+[280] = { 5, 0, SEN(keyctl), "keyctl" },
+[281] = { 5, TP, SEN(waitid), "waitid" },
+[282] = { 3, 0, SEN(ioprio_set), "ioprio_set" },
+[283] = { 2, 0, SEN(ioprio_get), "ioprio_get" },
+[284] = { 0, TD, SEN(inotify_init), "inotify_init" },
+[285] = { 3, TD|TF, SEN(inotify_add_watch), "inotify_add_watch" },
+[286] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" },
+[287] = { 4, TM, SEN(migrate_pages), "migrate_pages" },
+[288] = { 4, TD|TF, SEN(openat), "openat" },
+[289] = { 3, TD|TF, SEN(mkdirat), "mkdirat" },
+[290] = { 4, TD|TF, SEN(mknodat), "mknodat" },
+[291] = { 5, TD|TF, SEN(fchownat), "fchownat" },
+[292] = { 3, TD|TF, SEN(futimesat), "futimesat" },
+[293] = { 4, TD|TF|TFST|TSTA,SEN(newfstatat), "newfstatat" },
+[294] = { 3, TD|TF, SEN(unlinkat), "unlinkat" },
+[295] = { 4, TD|TF, SEN(renameat), "renameat" },
+[296] = { 5, TD|TF, SEN(linkat), "linkat" },
+[297] = { 3, TD|TF, SEN(symlinkat), "symlinkat" },
+[298] = { 4, TD|TF, SEN(readlinkat), "readlinkat" },
+[299] = { 3, TD|TF, SEN(fchmodat), "fchmodat" },
+[300] = { 3, TD|TF, SEN(faccessat), "faccessat" },
+[301] = { 6, TD, SEN(pselect6_time64), "pselect6" },
+[302] = { 5, TD, SEN(ppoll_time64), "ppoll" },
+[303] = { 1, 0, SEN(unshare), "unshare" },
+[304] = { 2, 0, SEN(set_robust_list), "set_robust_list" },
+[305] = { 3, 0, SEN(get_robust_list), "get_robust_list" },
+[306] = { 6, TD, SEN(splice), "splice" },
+[307] = { 4, TD, SEN(sync_file_range), "sync_file_range" },
+[308] = { 4, TD, SEN(tee), "tee" },
+[309] = { 4, TD, SEN(vmsplice), "vmsplice" },
+[310] = { 6, TM, SEN(move_pages), "move_pages" },
+[311] = { 3, 0, SEN(getcpu), "getcpu" },
+[312] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" },
+[313] = { 2, TF, SEN(utimes), "utimes" },
+[314] = { 4, TD, SEN(fallocate), "fallocate" },
+[315] = { 4, TD|TF, SEN(utimensat_time64), "utimensat" },
+[316] = { 3, TD|TS, SEN(signalfd), "signalfd" },
+[317] = { 4, TD, SEN(timerfd), "timerfd" },
+[318] = { 1, TD, SEN(eventfd), "eventfd" },
+[319] = { 2, TD, SEN(timerfd_create), "timerfd_create" },
+[320] = { 4, TD, SEN(timerfd_settime64), "timerfd_settime" },
+[321] = { 2, TD, SEN(timerfd_gettime64), "timerfd_gettime" },
+[322] = { 4, TD|TS, SEN(signalfd4), "signalfd4" },
+[323] = { 2, TD, SEN(eventfd2), "eventfd2" },
+[324] = { 1, TD, SEN(inotify_init1), "inotify_init1" },
+[325] = { 2, TD, SEN(pipe2), "pipe2" },
+[326] = { 3, TD, SEN(dup3), "dup3" },
+[327] = { 1, TD, SEN(epoll_create1), "epoll_create1" },
+[328] = { 4, TD, SEN(preadv), "preadv" },
+[329] = { 4, TD, SEN(pwritev), "pwritev" },
+[330] = { 4, TP|TS, SEN(rt_tgsigqueueinfo), "rt_tgsigqueueinfo" },
+[331] = { 5, TD, SEN(perf_event_open), "perf_event_open" },
+[332] = { 2, TD, SEN(fanotify_init), "fanotify_init" },
+[333] = { 5, TD|TF, SEN(fanotify_mark), "fanotify_mark" },
+[334] = { 4, 0, SEN(prlimit64), "prlimit64" },
+[335] = { 5, TD|TF, SEN(name_to_handle_at), "name_to_handle_at" },
+[336] = { 3, TD, SEN(open_by_handle_at), "open_by_handle_at" },
+[337] = { 2, TCL, SEN(clock_adjtime64), "clock_adjtime" },
+[338] = { 1, TD, SEN(syncfs), "syncfs" },
+[339] = { 2, TD, SEN(setns), "setns" },
+[340] = { 6, 0, SEN(process_vm_readv), "process_vm_readv" },
+[341] = { 6, 0, SEN(process_vm_writev), "process_vm_writev" },
+[342] = { 2, 0, SEN(s390_runtime_instr), "s390_runtime_instr" },
+[343] = { 5, 0, SEN(kcmp), "kcmp" },
+[344] = { 3, TD, SEN(finit_module), "finit_module" },
+[345] = { 3, 0, SEN(sched_setattr), "sched_setattr" },
+[346] = { 4, 0, SEN(sched_getattr), "sched_getattr" },
+[347] = { 5, TD|TF, SEN(renameat2), "renameat2" },
+[348] = { 3, 0, SEN(seccomp), "seccomp" },
+[349] = { 3, 0, SEN(getrandom), "getrandom" },
+[350] = { 2, TD, SEN(memfd_create), "memfd_create" },
+[351] = { 3, TD, SEN(bpf), "bpf" },
+[352] = { 3, 0, SEN(s390_pci_mmio_write), "s390_pci_mmio_write" },
+[353] = { 3, 0, SEN(s390_pci_mmio_read), "s390_pci_mmio_read" },
+[354] = { 5, TD|TF|TP|TSD|SE|SI, SEN(execveat), "execveat" },
+[355] = { 1, TD, SEN(userfaultfd), "userfaultfd" },
+[356] = { 3, 0, SEN(membarrier), "membarrier" },
+[357] = { 5, TN, SEN(recvmmsg_time64), "recvmmsg" },
+[358] = { 4, TN, SEN(sendmmsg), "sendmmsg" },
+[359] = { 3, TN, SEN(socket), "socket" },
+[360] = { 4, TN, SEN(socketpair), "socketpair" },
+[361] = { 3, TN, SEN(bind), "bind" },
+[362] = { 3, TN, SEN(connect), "connect" },
+[363] = { 2, TN, SEN(listen), "listen" },
+[364] = { 4, TN, SEN(accept4), "accept4" },
+[365] = { 5, TN, SEN(getsockopt), "getsockopt" },
+[366] = { 5, TN, SEN(setsockopt), "setsockopt" },
+[367] = { 3, TN, SEN(getsockname), "getsockname" },
+[368] = { 3, TN, SEN(getpeername), "getpeername" },
+[369] = { 6, TN, SEN(sendto), "sendto" },
+[370] = { 3, TN, SEN(sendmsg), "sendmsg" },
+[371] = { 6, TN, SEN(recvfrom), "recvfrom" },
+[372] = { 3, TN, SEN(recvmsg), "recvmsg" },
+[373] = { 2, TN, SEN(shutdown), "shutdown" },
+[374] = { 3, TM, SEN(mlock2), "mlock2" },
+[375] = { 6, TD, SEN(copy_file_range), "copy_file_range" },
+[376] = { 6, TD, SEN(preadv2), "preadv2" },
+[377] = { 6, TD, SEN(pwritev2), "pwritev2" },
+[378] = { 2, 0, SEN(s390_guarded_storage), "s390_guarded_storage" },
+[379] = { 5, TD|TF|TFST|TSTA,SEN(statx), "statx" },
+[380] = { 4, 0, SEN(s390_sthyi), "s390_sthyi" },
+[381] = { 5, TD, SEN(kexec_file_load), "kexec_file_load" },
+[382] = { 6, 0, SEN(io_pgetevents_time64), "io_pgetevents" },
+[383] = { 4, 0, SEN(rseq), "rseq" },
+[384] = { 4, TM|SI, SEN(pkey_mprotect), "pkey_mprotect" },
+[385] = { 2, 0, SEN(pkey_alloc), "pkey_alloc" },
+[386] = { 1, 0, SEN(pkey_free), "pkey_free" },
+/* room for arch specific calls */
+[392] = { 4, TI, SEN(semtimedop_time64), "semtimedop" },
+[393] = { 3, TI, SEN(semget), "semget" },
+[394] = { 4, TI, SEN(semctl), "semctl" },
+[395] = { 3, TI, SEN(shmget), "shmget" },
+[396] = { 3, TI, SEN(shmctl), "shmctl" },
+[397] = { 3, TI|TM|SI, SEN(shmat), "shmat" },
+[398] = { 1, TI|TM|SI, SEN(shmdt), "shmdt" },
+[399] = { 2, TI, SEN(msgget), "msgget" },
+[400] = { 4, TI, SEN(msgsnd), "msgsnd" },
+[401] = { 5, TI, SEN(msgrcv), "msgrcv" },
+[402] = { 3, TI, SEN(msgctl), "msgctl" },
+/* [403 ... 423] - reserved to sync up with other architectures */
+#include "syscallent-common.h"
+
+#define SYS_socket_subcall 500
+#include "subcall64.h"
diff --git a/src/linux/s390x/syscallent1.h b/src/linux/s390x/syscallent1.h
new file mode 100644
index 000000000..6b7a4b3c5
--- /dev/null
+++ b/src/linux/s390x/syscallent1.h
@@ -0,0 +1 @@
+#include "s390/syscallent.h"
diff --git a/src/linux/s390x/userent.h b/src/linux/s390x/userent.h
new file mode 100644
index 000000000..8997dd884
--- /dev/null
+++ b/src/linux/s390x/userent.h
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2014-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "../s390/userent0.h"
+{ PT_FPR0, "fpr0" },
+{ PT_FPR1, "fpr1" },
+{ PT_FPR2, "fpr2" },
+{ PT_FPR3, "fpr3" },
+{ PT_FPR4, "fpr4" },
+{ PT_FPR5, "fpr5" },
+{ PT_FPR6, "fpr6" },
+{ PT_FPR7, "fpr7" },
+{ PT_FPR8, "fpr8" },
+{ PT_FPR9, "fpr9" },
+{ PT_FPR10, "fpr10" },
+{ PT_FPR11, "fpr11" },
+{ PT_FPR12, "fpr12" },
+{ PT_FPR13, "fpr13" },
+{ PT_FPR14, "fpr14" },
+{ PT_FPR15, "fpr15" },
+/* Other fields in "struct user" */
+#include "../s390/userent1.h"
diff --git a/src/linux/sh/arch_defs_.h b/src/linux/sh/arch_defs_.h
new file mode 100644
index 000000000..1809580d8
--- /dev/null
+++ b/src/linux/sh/arch_defs_.h
@@ -0,0 +1,10 @@
+/*
+ * Copyright (c) 2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#define HAVE_ARCH_GETRVAL2 1
+#define HAVE_ARCH_OLD_SELECT 1
+#define HAVE_ARCH_UID16_SYSCALLS 1
diff --git a/src/linux/sh/arch_getrval2.c b/src/linux/sh/arch_getrval2.c
new file mode 100644
index 000000000..a01fb20fe
--- /dev/null
+++ b/src/linux/sh/arch_getrval2.c
@@ -0,0 +1,12 @@
+/*
+ * Copyright (c) 2015-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+long
+getrval2(struct tcb *tcp)
+{
+ return sh_regs.regs[1];
+}
diff --git a/src/linux/sh/arch_regs.c b/src/linux/sh/arch_regs.c
new file mode 100644
index 000000000..f318fab89
--- /dev/null
+++ b/src/linux/sh/arch_regs.c
@@ -0,0 +1,11 @@
+/*
+ * Copyright (c) 2015-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static struct pt_regs sh_regs;
+#define ARCH_REGS_FOR_GETREGS sh_regs
+#define ARCH_PC_REG sh_regs.pc
+#define ARCH_SP_REG sh_regs.regs[15]
diff --git a/src/linux/sh/get_error.c b/src/linux/sh/get_error.c
new file mode 100644
index 000000000..010957610
--- /dev/null
+++ b/src/linux/sh/get_error.c
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2015-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "negated_errno.h"
+
+static void
+arch_get_error(struct tcb *tcp, const bool check_errno)
+{
+ if (check_errno && is_negated_errno(sh_regs.regs[0])) {
+ tcp->u_rval = -1;
+ tcp->u_error = -sh_regs.regs[0];
+ } else {
+ tcp->u_rval = sh_regs.regs[0];
+ }
+}
diff --git a/src/linux/sh/get_scno.c b/src/linux/sh/get_scno.c
new file mode 100644
index 000000000..7dd26bf0e
--- /dev/null
+++ b/src/linux/sh/get_scno.c
@@ -0,0 +1,14 @@
+/*
+ * Copyright (c) 2015-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+/* Return codes: 1 - ok, 0 - ignore, other - error. */
+static int
+arch_get_scno(struct tcb *tcp)
+{
+ tcp->scno = sh_regs.regs[3];
+ return 1;
+}
diff --git a/src/linux/sh/get_syscall_args.c b/src/linux/sh/get_syscall_args.c
new file mode 100644
index 000000000..3b9391e85
--- /dev/null
+++ b/src/linux/sh/get_syscall_args.c
@@ -0,0 +1,17 @@
+/*
+ * Copyright (c) 2015-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+/* Return -1 on error or 1 on success (never 0!). */
+static int
+arch_get_syscall_args(struct tcb *tcp)
+{
+ static const unsigned int syscall_regs[MAX_ARGS] = { 4, 5, 6, 7, 0, 1 };
+
+ for (unsigned int i = 0; i < n_args(tcp); ++i)
+ tcp->u_arg[i] = sh_regs.regs[syscall_regs[i]];
+ return 1;
+}
diff --git a/src/linux/sh/ioctls_arch0.h b/src/linux/sh/ioctls_arch0.h
new file mode 100644
index 000000000..96eb59622
--- /dev/null
+++ b/src/linux/sh/ioctls_arch0.h
@@ -0,0 +1,77 @@
+/* Generated by ioctls_gen.sh from definitions found in $linux/arch/sh/include/ tree. */
+{ "asm/ioctls.h", "FIOASYNC", _IOC_WRITE, 0x667d, 0x04 },
+{ "asm/ioctls.h", "FIOCLEX", _IOC_NONE, 0x6601, 0x00 },
+{ "asm/ioctls.h", "FIONBIO", _IOC_WRITE, 0x667e, 0x04 },
+{ "asm/ioctls.h", "FIONCLEX", _IOC_NONE, 0x6602, 0x00 },
+{ "asm/ioctls.h", "FIONREAD", _IOC_READ, 0x667f, 0x04 },
+{ "asm/ioctls.h", "FIOQSIZE", _IOC_READ, 0x6680, 0x08 },
+{ "asm/ioctls.h", "TCFLSH", _IOC_NONE, 0x741f, 0x00 },
+{ "asm/ioctls.h", "TCGETS", 0, 0x5401, 0 },
+{ "asm/ioctls.h", "TCGETS2", _IOC_READ, 0x542a, 0x2c },
+{ "asm/ioctls.h", "TCSBRK", _IOC_NONE, 0x741d, 0x00 },
+{ "asm/ioctls.h", "TCSBRKP", _IOC_WRITE, 0x5425, 0x04 },
+{ "asm/ioctls.h", "TCSETS", 0, 0x5402, 0 },
+{ "asm/ioctls.h", "TCSETS2", _IOC_WRITE, 0x542b, 0x2c },
+{ "asm/ioctls.h", "TCSETSF", 0, 0x5404, 0 },
+{ "asm/ioctls.h", "TCSETSF2", _IOC_WRITE, 0x542d, 0x2c },
+{ "asm/ioctls.h", "TCSETSW", 0, 0x5403, 0 },
+{ "asm/ioctls.h", "TCSETSW2", _IOC_WRITE, 0x542c, 0x2c },
+{ "asm/ioctls.h", "TCXONC", _IOC_NONE, 0x741e, 0x00 },
+{ "asm/ioctls.h", "TIOCCBRK", _IOC_NONE, 0x5428, 0x00 },
+{ "asm/ioctls.h", "TIOCCONS", _IOC_NONE, 0x541d, 0x00 },
+{ "asm/ioctls.h", "TIOCEXCL", _IOC_NONE, 0x540c, 0x00 },
+{ "asm/ioctls.h", "TIOCGDEV", _IOC_READ, 0x5432, 0x04 },
+{ "asm/ioctls.h", "TIOCGETD", _IOC_READ, 0x5424, 0x04 },
+{ "asm/ioctls.h", "TIOCGEXCL", _IOC_READ, 0x5440, 0x04 },
+{ "asm/ioctls.h", "TIOCGICOUNT", 0, 0x545D, 0 },
+{ "asm/ioctls.h", "TIOCGLCKTRMIOS", 0, 0x5456, 0 },
+{ "asm/ioctls.h", "TIOCGPGRP", _IOC_READ, 0x7477, 0x04 },
+{ "asm/ioctls.h", "TIOCGPKT", _IOC_READ, 0x5438, 0x04 },
+{ "asm/ioctls.h", "TIOCGPTLCK", _IOC_READ, 0x5439, 0x04 },
+{ "asm/ioctls.h", "TIOCGPTN", _IOC_READ, 0x5430, 0x04 },
+{ "asm/ioctls.h", "TIOCGRS485", _IOC_READ, 0x542e, 0x20 },
+{ "asm/ioctls.h", "TIOCGSID", _IOC_READ, 0x5429, 0x04 },
+{ "asm/ioctls.h", "TIOCGSOFTCAR", _IOC_READ, 0x5419, 0x04 },
+{ "asm/ioctls.h", "TIOCLINUX", _IOC_WRITE, 0x541c, 0x01 },
+{ "asm/ioctls.h", "TIOCMBIC", _IOC_WRITE, 0x5417, 0x04 },
+{ "asm/ioctls.h", "TIOCMBIS", _IOC_WRITE, 0x5416, 0x04 },
+{ "asm/ioctls.h", "TIOCMGET", _IOC_READ, 0x5415, 0x04 },
+{ "asm/ioctls.h", "TIOCMIWAIT", _IOC_NONE, 0x545c, 0x00 },
+{ "asm/ioctls.h", "TIOCMSET", _IOC_WRITE, 0x5418, 0x04 },
+{ "asm/ioctls.h", "TIOCNOTTY", _IOC_NONE, 0x5422, 0x00 },
+{ "asm/ioctls.h", "TIOCNXCL", _IOC_NONE, 0x540d, 0x00 },
+{ "asm/ioctls.h", "TIOCOUTQ", _IOC_READ, 0x7473, 0x04 },
+{ "asm/ioctls.h", "TIOCPKT", _IOC_WRITE, 0x5420, 0x04 },
+{ "asm/ioctls.h", "TIOCSBRK", _IOC_NONE, 0x5427, 0x00 },
+{ "asm/ioctls.h", "TIOCSCTTY", _IOC_NONE, 0x540e, 0x00 },
+{ "asm/ioctls.h", "TIOCSERCONFIG", _IOC_NONE, 0x5453, 0x00 },
+{ "asm/ioctls.h", "TIOCSERGETLSR", _IOC_READ, 0x5459, 0x04 },
+{ "asm/ioctls.h", "TIOCSERGWILD", _IOC_READ, 0x5454, 0x04 },
+{ "asm/ioctls.h", "TIOCSERSWILD", _IOC_WRITE, 0x5455, 0x04 },
+{ "asm/ioctls.h", "TIOCSETD", _IOC_WRITE, 0x5423, 0x04 },
+{ "asm/ioctls.h", "TIOCSIG", _IOC_WRITE, 0x5436, 0x04 },
+{ "asm/ioctls.h", "TIOCSLCKTRMIOS", 0, 0x5457, 0 },
+{ "asm/ioctls.h", "TIOCSPGRP", _IOC_WRITE, 0x7476, 0x04 },
+{ "asm/ioctls.h", "TIOCSPTLCK", _IOC_WRITE, 0x5431, 0x04 },
+{ "asm/ioctls.h", "TIOCSRS485", _IOC_READ|_IOC_WRITE, 0x542f, 0x20 },
+{ "asm/ioctls.h", "TIOCSSOFTCAR", _IOC_WRITE, 0x541a, 0x04 },
+{ "asm/ioctls.h", "TIOCSTART", _IOC_NONE, 0x746e, 0x00 },
+{ "asm/ioctls.h", "TIOCSTI", _IOC_WRITE, 0x5412, 0x01 },
+{ "asm/ioctls.h", "TIOCSTOP", _IOC_NONE, 0x746f, 0x00 },
+{ "asm/ioctls.h", "TIOCVHANGUP", _IOC_NONE, 0x5437, 0x00 },
+{ "asm/sockios.h", "FIOGETOWN", _IOC_READ, 0x667b, 0x04 },
+{ "asm/sockios.h", "FIOSETOWN", _IOC_WRITE, 0x667c, 0x04 },
+{ "asm/sockios.h", "SIOCATMARK", _IOC_READ, 0x7307, 0x04 },
+{ "asm/sockios.h", "SIOCGPGRP", _IOC_READ, 0x7309, 0x04 },
+{ "asm/sockios.h", "SIOCGSTAMP_OLD", _IOC_READ, 0x7364, 0x08 },
+{ "asm/sockios.h", "SIOCGSTAMPNS_OLD", _IOC_READ, 0x7365, 0x08 },
+{ "asm/sockios.h", "SIOCSPGRP", _IOC_WRITE, 0x7308, 0x04 },
+{ "mach-landisk/mach/gio.h", "GIODRV_IOCGGIODATA1", _IOC_READ, 0x6b02, 0x04 },
+{ "mach-landisk/mach/gio.h", "GIODRV_IOCGGIODATA2", _IOC_READ, 0x6b04, 0x04 },
+{ "mach-landisk/mach/gio.h", "GIODRV_IOCGGIODATA4", _IOC_READ, 0x6b06, 0x04 },
+{ "mach-landisk/mach/gio.h", "GIODRV_IOCHARDRESET", _IOC_NONE, 0x6b08, 0x00 },
+{ "mach-landisk/mach/gio.h", "GIODRV_IOCRESET", _IOC_NONE, 0x6b00, 0x00 },
+{ "mach-landisk/mach/gio.h", "GIODRV_IOCSGIODATA1", _IOC_WRITE, 0x6b01, 0x04 },
+{ "mach-landisk/mach/gio.h", "GIODRV_IOCSGIODATA2", _IOC_WRITE, 0x6b03, 0x04 },
+{ "mach-landisk/mach/gio.h", "GIODRV_IOCSGIODATA4", _IOC_WRITE, 0x6b05, 0x04 },
+{ "mach-landisk/mach/gio.h", "GIODRV_IOCSGIOSETADDR", _IOC_WRITE, 0x6b07, 0x04 },
diff --git a/src/linux/sh/ioctls_inc0.h b/src/linux/sh/ioctls_inc0.h
new file mode 100644
index 000000000..4aecf983e
--- /dev/null
+++ b/src/linux/sh/ioctls_inc0.h
@@ -0,0 +1 @@
+#include "32/ioctls_inc.h"
diff --git a/src/linux/sh/raw_syscall.h b/src/linux/sh/raw_syscall.h
new file mode 100644
index 000000000..1c2f8136b
--- /dev/null
+++ b/src/linux/sh/raw_syscall.h
@@ -0,0 +1,34 @@
+/*
+ * Raw syscalls.
+ *
+ * Copyright (c) 2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_RAW_SYSCALL_H
+# define STRACE_RAW_SYSCALL_H
+
+# include "kernel_types.h"
+
+static inline kernel_ulong_t
+raw_syscall_0(const kernel_ulong_t nr, kernel_ulong_t *err)
+{
+ *err = 0;
+ register kernel_ulong_t r3 __asm__("%r3") = nr;
+ register kernel_ulong_t r0 __asm__("%r0");
+ __asm__ __volatile__("trapa #0x10\n\t"
+ "or r0,r0\n\t"
+ "or r0,r0\n\t"
+ "or r0,r0\n\t"
+ "or r0,r0\n\t"
+ "or r0,r0\n\t"
+ : "=r"(r0)
+ : "r"(r3)
+ : "memory", "t");
+ return r0;
+}
+# define raw_syscall_0 raw_syscall_0
+
+#endif /* !STRACE_RAW_SYSCALL_H */
diff --git a/src/linux/sh/set_error.c b/src/linux/sh/set_error.c
new file mode 100644
index 000000000..28ed085fb
--- /dev/null
+++ b/src/linux/sh/set_error.c
@@ -0,0 +1,20 @@
+/*
+ * Copyright (c) 2016-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static int
+arch_set_error(struct tcb *tcp)
+{
+ sh_regs.regs[0] = -tcp->u_error;
+ return set_regs(tcp->pid);
+}
+
+static int
+arch_set_success(struct tcb *tcp)
+{
+ sh_regs.regs[0] = tcp->u_rval;
+ return set_regs(tcp->pid);
+}
diff --git a/src/linux/sh/set_scno.c b/src/linux/sh/set_scno.c
new file mode 100644
index 000000000..fc2a01d75
--- /dev/null
+++ b/src/linux/sh/set_scno.c
@@ -0,0 +1,15 @@
+/*
+ * Copyright (c) 2016-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static int
+arch_set_scno(struct tcb *tcp, kernel_ulong_t scno)
+{
+ if (ptrace_syscall_info_is_valid() && get_regs(tcp) < 0)
+ return -1;
+ sh_regs.regs[3] = scno;
+ return set_regs(tcp->pid);
+}
diff --git a/src/linux/sh/syscallent.h b/src/linux/sh/syscallent.h
new file mode 100644
index 000000000..aef820d9e
--- /dev/null
+++ b/src/linux/sh/syscallent.h
@@ -0,0 +1,412 @@
+/*
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993, 1994, 1995 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 2000 PocketPenguins Inc. Linux for Hitachi SuperH
+ * port by Greg Banks <gbanks@pocketpenguins.com>
+ * Copyright (c) 2000-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+[ 0] = { 0, 0, SEN(restart_syscall), "restart_syscall" },
+[ 1] = { 1, TP|SE, SEN(exit), "exit" },
+[ 2] = { 0, TP, SEN(fork), "fork" },
+[ 3] = { 3, TD, SEN(read), "read" },
+[ 4] = { 3, TD, SEN(write), "write" },
+[ 5] = { 3, TD|TF, SEN(open), "open" },
+[ 6] = { 1, TD, SEN(close), "close" },
+[ 7] = { 3, TP, SEN(waitpid), "waitpid" },
+[ 8] = { 2, TD|TF, SEN(creat), "creat" },
+[ 9] = { 2, TF, SEN(link), "link" },
+[ 10] = { 1, TF, SEN(unlink), "unlink" },
+[ 11] = { 3, TF|TP|TSD|SE|SI, SEN(execve), "execve" },
+[ 12] = { 1, TF, SEN(chdir), "chdir" },
+[ 13] = { 1, TCL, SEN(time), "time" },
+[ 14] = { 3, TF, SEN(mknod), "mknod" },
+[ 15] = { 2, TF, SEN(chmod), "chmod" },
+[ 16] = { 3, TF, SEN(chown16), "lchown" },
+[ 17] = { 0, TM, SEN(break), "break" },
+[ 18] = { 2, TF|TST|TSTA, SEN(oldstat), "oldstat" },
+[ 19] = { 3, TD, SEN(lseek), "lseek" },
+[ 20] = { 0, PU|NF, SEN(getpid), "getpid" },
+[ 21] = { 5, TF, SEN(mount), "mount" },
+[ 22] = { 1, TF, SEN(umount), "umount" },
+[ 23] = { 1, TC, SEN(setuid16), "setuid" },
+[ 24] = { 0, TC|PU|NF, SEN(getuid16), "getuid" },
+[ 25] = { 1, 0, SEN(stime), "stime" },
+[ 26] = { 4, 0, SEN(ptrace), "ptrace" },
+[ 27] = { 1, 0, SEN(alarm), "alarm" },
+[ 28] = { 2, TD|TFST|TSTA, SEN(oldfstat), "oldfstat" },
+[ 29] = { 0, TS, SEN(pause), "pause" },
+[ 30] = { 2, TF, SEN(utime), "utime" },
+[ 31] = { 2, 0, SEN(stty), "stty" },
+[ 32] = { 2, 0, SEN(gtty), "gtty" },
+[ 33] = { 2, TF, SEN(access), "access" },
+[ 34] = { 1, 0, SEN(nice), "nice" },
+[ 35] = { 0, 0, SEN(ftime), "ftime" },
+[ 36] = { 0, 0, SEN(sync), "sync" },
+[ 37] = { 2, TS|TP, SEN(kill), "kill" },
+[ 38] = { 2, TF, SEN(rename), "rename" },
+[ 39] = { 2, TF, SEN(mkdir), "mkdir" },
+[ 40] = { 1, TF, SEN(rmdir), "rmdir" },
+[ 41] = { 1, TD, SEN(dup), "dup" },
+[ 42] = { 0, TD, SEN(pipe), "pipe" },
+[ 43] = { 1, 0, SEN(times), "times" },
+[ 44] = { 0, 0, SEN(prof), "prof" },
+[ 45] = { 1, TM|SI, SEN(brk), "brk" },
+[ 46] = { 1, TC, SEN(setgid16), "setgid" },
+[ 47] = { 0, TC|PU|NF, SEN(getgid16), "getgid" },
+[ 48] = { 2, TS, SEN(signal), "signal" },
+[ 49] = { 0, TC|PU|NF, SEN(geteuid16), "geteuid" },
+[ 50] = { 0, TC|PU|NF, SEN(getegid16), "getegid" },
+[ 51] = { 1, TF, SEN(acct), "acct" },
+[ 52] = { 2, TF, SEN(umount2), "umount2" },
+[ 53] = { 0, 0, SEN(lock), "lock" },
+[ 54] = { 3, TD, SEN(ioctl), "ioctl" },
+[ 55] = { 3, TD, SEN(fcntl), "fcntl" },
+[ 56] = { 0, 0, SEN(mpx), "mpx" },
+[ 57] = { 2, 0, SEN(setpgid), "setpgid" },
+[ 58] = { 2, 0, SEN(ulimit), "ulimit" },
+[ 59] = { 1, 0, SEN(oldolduname), "oldolduname" },
+[ 60] = { 1, NF, SEN(umask), "umask" },
+[ 61] = { 1, TF, SEN(chroot), "chroot" },
+[ 62] = { 2, TSFA, SEN(ustat), "ustat" },
+[ 63] = { 2, TD, SEN(dup2), "dup2" },
+[ 64] = { 0, PU|NF, SEN(getppid), "getppid" },
+[ 65] = { 0, PU|NF, SEN(getpgrp), "getpgrp" },
+[ 66] = { 0, 0, SEN(setsid), "setsid" },
+[ 67] = { 3, TS, SEN(sigaction), "sigaction" },
+[ 68] = { 0, TS, SEN(sgetmask), "sgetmask" },
+[ 69] = { 1, TS, SEN(ssetmask), "ssetmask" },
+[ 70] = { 2, TC, SEN(setreuid16), "setreuid" },
+[ 71] = { 2, TC, SEN(setregid16), "setregid" },
+[ 72] = { 1, TS, SEN(sigsuspend), "sigsuspend" },
+[ 73] = { 1, TS, SEN(sigpending), "sigpending" },
+[ 74] = { 2, 0, SEN(sethostname), "sethostname" },
+[ 75] = { 2, 0, SEN(setrlimit), "setrlimit" },
+[ 76] = { 2, 0, SEN(getrlimit), "getrlimit" },
+[ 77] = { 2, 0, SEN(getrusage), "getrusage" },
+[ 78] = { 2, TCL, SEN(gettimeofday), "gettimeofday" },
+[ 79] = { 2, TCL, SEN(settimeofday), "settimeofday" },
+[ 80] = { 2, TC, SEN(getgroups16), "getgroups" },
+[ 81] = { 2, TC, SEN(setgroups16), "setgroups" },
+[ 82] = { 1, TD, SEN(oldselect), "select" },
+[ 83] = { 2, TF, SEN(symlink), "symlink" },
+[ 84] = { 2, TF|TLST|TSTA, SEN(oldlstat), "oldlstat" },
+[ 85] = { 3, TF, SEN(readlink), "readlink" },
+[ 86] = { 1, TF, SEN(uselib), "uselib" },
+[ 87] = { 2, TF, SEN(swapon), "swapon" },
+[ 88] = { 4, 0, SEN(reboot), "reboot" },
+[ 89] = { 3, TD, SEN(readdir), "readdir" },
+[ 90] = { 6, TD|TM|SI, SEN(mmap), "mmap" },
+[ 91] = { 2, TM|SI, SEN(munmap), "munmap" },
+[ 92] = { 2, TF, SEN(truncate), "truncate" },
+[ 93] = { 2, TD, SEN(ftruncate), "ftruncate" },
+[ 94] = { 2, TD, SEN(fchmod), "fchmod" },
+[ 95] = { 3, TD, SEN(fchown16), "fchown" },
+[ 96] = { 2, 0, SEN(getpriority), "getpriority" },
+[ 97] = { 3, 0, SEN(setpriority), "setpriority" },
+[ 98] = { 4, 0, SEN(profil), "profil" },
+[ 99] = { 2, TF|TSF|TSFA, SEN(statfs), "statfs" },
+[100] = { 2, TD|TFSF|TSFA, SEN(fstatfs), "fstatfs" },
+[101] = { 3, 0, SEN(ioperm), "ioperm" },
+[102] = { 2, TD|TSD, SEN(socketcall), "socketcall" },
+[103] = { 3, 0, SEN(syslog), "syslog" },
+[104] = { 3, 0, SEN(setitimer), "setitimer" },
+[105] = { 2, 0, SEN(getitimer), "getitimer" },
+[106] = { 2, TF|TST|TSTA, SEN(stat), "stat" },
+[107] = { 2, TF|TLST|TSTA, SEN(lstat), "lstat" },
+[108] = { 2, TD|TFST|TSTA, SEN(fstat), "fstat" },
+[109] = { 1, 0, SEN(olduname), "olduname" },
+[110] = { 1, 0, SEN(iopl), "iopl" },
+[111] = { 0, 0, SEN(vhangup), "vhangup" },
+[112] = { 0, 0, SEN(idle), "idle" },
+[113] = { 1, 0, SEN(vm86old), "vm86old" },
+[114] = { 4, TP, SEN(wait4), "wait4" },
+[115] = { 1, TF, SEN(swapoff), "swapoff" },
+[116] = { 1, 0, SEN(sysinfo), "sysinfo" },
+[117] = { 6, TI|TSD, SEN(ipc), "ipc" },
+[118] = { 1, TD, SEN(fsync), "fsync" },
+[119] = { 0, TS, SEN(sigreturn), "sigreturn" },
+[120] = { 5, TP, SEN(clone), "clone" },
+[121] = { 2, 0, SEN(setdomainname), "setdomainname" },
+[122] = { 1, 0, SEN(uname), "uname" },
+[123] = { 3, 0, SEN(cacheflush), "cacheflush" },
+[124] = { 1, TCL, SEN(adjtimex32), "adjtimex" },
+[125] = { 3, TM|SI, SEN(mprotect), "mprotect" },
+[126] = { 3, TS, SEN(sigprocmask), "sigprocmask" },
+[127] = { 2, 0, SEN(create_module), "create_module" },
+[128] = { 3, 0, SEN(init_module), "init_module" },
+[129] = { 2, 0, SEN(delete_module), "delete_module" },
+[130] = { 1, 0, SEN(get_kernel_syms), "get_kernel_syms" },
+[131] = { 4, TF, SEN(quotactl), "quotactl" },
+[132] = { 1, 0, SEN(getpgid), "getpgid" },
+[133] = { 1, TD, SEN(fchdir), "fchdir" },
+[134] = { 2, 0, SEN(bdflush), "bdflush" },
+[135] = { 3, 0, SEN(sysfs), "sysfs" },
+[136] = { 1, NF, SEN(personality), "personality" },
+[137] = { 5, 0, SEN(afs_syscall), "afs_syscall" },
+[138] = { 1, TC|NF, SEN(setfsuid16), "setfsuid" },
+[139] = { 1, TC|NF, SEN(setfsgid16), "setfsgid" },
+[140] = { 5, TD, SEN(llseek), "_llseek" },
+[141] = { 3, TD, SEN(getdents), "getdents" },
+[142] = { 5, TD, SEN(select), "_newselect" },
+[143] = { 2, TD, SEN(flock), "flock" },
+[144] = { 3, TM, SEN(msync), "msync" },
+[145] = { 3, TD, SEN(readv), "readv" },
+[146] = { 3, TD, SEN(writev), "writev" },
+[147] = { 1, 0, SEN(getsid), "getsid" },
+[148] = { 1, TD, SEN(fdatasync), "fdatasync" },
+[149] = { 1, 0, SEN(sysctl), "_sysctl" },
+[150] = { 2, TM, SEN(mlock), "mlock" },
+[151] = { 2, TM, SEN(munlock), "munlock" },
+[152] = { 1, TM, SEN(mlockall), "mlockall" },
+[153] = { 0, TM, SEN(munlockall), "munlockall" },
+[154] = { 2, 0, SEN(sched_setparam), "sched_setparam" },
+[155] = { 2, 0, SEN(sched_getparam), "sched_getparam" },
+[156] = { 3, 0, SEN(sched_setscheduler), "sched_setscheduler" },
+[157] = { 1, 0, SEN(sched_getscheduler), "sched_getscheduler" },
+[158] = { 0, 0, SEN(sched_yield), "sched_yield" },
+[159] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"},
+[160] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"},
+[161] = { 2, 0, SEN(sched_rr_get_interval_time32),"sched_rr_get_interval"},
+[162] = { 2, 0, SEN(nanosleep_time32), "nanosleep" },
+[163] = { 5, TM|SI, SEN(mremap), "mremap" },
+[164] = { 3, TC, SEN(setresuid16), "setresuid" },
+[165] = { 3, TC, SEN(getresuid16), "getresuid" },
+[166] = { 5, 0, SEN(vm86), "vm86" },
+[167] = { 5, 0, SEN(query_module), "query_module" },
+[168] = { 3, TD, SEN(poll_time32), "poll" },
+[169] = { 3, 0, SEN(nfsservctl), "nfsservctl" },
+[170] = { 3, TC, SEN(setresgid16), "setresgid" },
+[171] = { 3, TC, SEN(getresgid16), "getresgid" },
+[172] = { 5, TC, SEN(prctl), "prctl" },
+[173] = { 0, TS, SEN(rt_sigreturn), "rt_sigreturn" },
+[174] = { 4, TS, SEN(rt_sigaction), "rt_sigaction" },
+[175] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" },
+[176] = { 2, TS, SEN(rt_sigpending), "rt_sigpending" },
+[177] = { 4, TS, SEN(rt_sigtimedwait_time32), "rt_sigtimedwait" },
+[178] = { 3, TS|TP, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" },
+[179] = { 2, TS, SEN(rt_sigsuspend), "rt_sigsuspend" },
+[180] = { 6, TD, SEN(pread), "pread64" },
+[181] = { 6, TD, SEN(pwrite), "pwrite64" },
+[182] = { 3, TF, SEN(chown16), "chown" },
+[183] = { 2, TF, SEN(getcwd), "getcwd" },
+[184] = { 2, TC, SEN(capget), "capget" },
+[185] = { 2, TC, SEN(capset), "capset" },
+[186] = { 2, TS, SEN(sigaltstack), "sigaltstack" },
+[187] = { 4, TD|TN, SEN(sendfile), "sendfile" },
+[188 ... 189] = { },
+[190] = { 0, TP, SEN(vfork), "vfork" },
+[191] = { 2, 0, SEN(getrlimit), "ugetrlimit" },
+[192] = { 6, TD|TM|SI, SEN(mmap_4koff), "mmap2" },
+[193] = { 3, TF, SEN(truncate64), "truncate64" },
+[194] = { 3, TD, SEN(ftruncate64), "ftruncate64" },
+[195] = { 2, TF|TST|TSTA, SEN(stat64), "stat64" },
+[196] = { 2, TF|TLST|TSTA, SEN(lstat64), "lstat64" },
+[197] = { 2, TD|TFST|TSTA, SEN(fstat64), "fstat64" },
+[198] = { 3, TF, SEN(chown), "lchown32" },
+[199] = { 0, TC|PU|NF, SEN(getuid), "getuid32" },
+[200] = { 0, TC|PU|NF, SEN(getgid), "getgid32" },
+[201] = { 0, TC|PU|NF, SEN(geteuid), "geteuid32" },
+[202] = { 0, TC|PU|NF, SEN(getegid), "getegid32" },
+[203] = { 2, TC, SEN(setreuid), "setreuid32" },
+[204] = { 2, TC, SEN(setregid), "setregid32" },
+[205] = { 2, TC, SEN(getgroups), "getgroups32" },
+[206] = { 2, TC, SEN(setgroups), "setgroups32" },
+[207] = { 3, TD, SEN(fchown), "fchown32" },
+[208] = { 3, TC, SEN(setresuid), "setresuid32" },
+[209] = { 3, TC, SEN(getresuid), "getresuid32" },
+[210] = { 3, TC, SEN(setresgid), "setresgid32" },
+[211] = { 3, TC, SEN(getresgid), "getresgid32" },
+[212] = { 3, TF, SEN(chown), "chown32" },
+[213] = { 1, TC, SEN(setuid), "setuid32" },
+[214] = { 1, TC, SEN(setgid), "setgid32" },
+[215] = { 1, TC|NF, SEN(setfsuid), "setfsuid32" },
+[216] = { 1, TC|NF, SEN(setfsgid), "setfsgid32" },
+[217] = { 2, TF, SEN(pivotroot), "pivot_root" },
+[218] = { 3, TM, SEN(mincore), "mincore" },
+[219] = { 3, TM, SEN(madvise), "madvise" },
+[220] = { 3, TD, SEN(getdents64), "getdents64" },
+[221] = { 3, TD, SEN(fcntl64), "fcntl64" },
+[222 ... 223] = { },
+[224] = { 0, PU|NF, SEN(gettid), "gettid" },
+[225] = { 4, TD, SEN(readahead), "readahead" },
+[226] = { 5, TF, SEN(setxattr), "setxattr" },
+[227] = { 5, TF, SEN(setxattr), "lsetxattr" },
+[228] = { 5, TD, SEN(fsetxattr), "fsetxattr" },
+[229] = { 4, TF, SEN(getxattr), "getxattr" },
+[230] = { 4, TF, SEN(getxattr), "lgetxattr" },
+[231] = { 4, TD, SEN(fgetxattr), "fgetxattr" },
+[232] = { 3, TF, SEN(listxattr), "listxattr" },
+[233] = { 3, TF, SEN(listxattr), "llistxattr" },
+[234] = { 3, TD, SEN(flistxattr), "flistxattr" },
+[235] = { 2, TF, SEN(removexattr), "removexattr" },
+[236] = { 2, TF, SEN(removexattr), "lremovexattr" },
+[237] = { 2, TD, SEN(fremovexattr), "fremovexattr" },
+[238] = { 2, TS|TP, SEN(tkill), "tkill" },
+[239] = { 4, TD|TN, SEN(sendfile64), "sendfile64" },
+[240] = { 6, 0, SEN(futex_time32), "futex" },
+[241] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" },
+[242] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" },
+[243 ... 244] = { },
+[245] = { 2, TM, SEN(io_setup), "io_setup" },
+[246] = { 1, TM, SEN(io_destroy), "io_destroy" },
+[247] = { 5, 0, SEN(io_getevents_time32), "io_getevents" },
+[248] = { 3, 0, SEN(io_submit), "io_submit" },
+[249] = { 3, 0, SEN(io_cancel), "io_cancel" },
+[250] = { 5, TD, SEN(fadvise64), "fadvise64" },
+[251] = { },
+[252] = { 1, TP|SE, SEN(exit), "exit_group" },
+[253] = { 4, 0, SEN(lookup_dcookie), "lookup_dcookie" },
+[254] = { 1, TD, SEN(epoll_create), "epoll_create" },
+[255] = { 4, TD, SEN(epoll_ctl), "epoll_ctl" },
+[256] = { 4, TD, SEN(epoll_wait), "epoll_wait" },
+[257] = { 5, TM|SI, SEN(remap_file_pages), "remap_file_pages" },
+[258] = { 1, 0, SEN(set_tid_address), "set_tid_address" },
+[259] = { 3, 0, SEN(timer_create), "timer_create" },
+[260] = { 4, 0, SEN(timer_settime32), "timer_settime" },
+[261] = { 2, 0, SEN(timer_gettime32), "timer_gettime" },
+[262] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" },
+[263] = { 1, 0, SEN(timer_delete), "timer_delete" },
+[264] = { 2, TCL, SEN(clock_settime32), "clock_settime" },
+[265] = { 2, TCL, SEN(clock_gettime32), "clock_gettime" },
+[266] = { 2, TCL, SEN(clock_getres_time32), "clock_getres" },
+[267] = { 4, 0, SEN(clock_nanosleep_time32), "clock_nanosleep" },
+[268] = { 3, TF|TSF|TSFA, SEN(statfs64), "statfs64" },
+[269] = { 3, TD|TFSF|TSFA, SEN(fstatfs64), "fstatfs64" },
+[270] = { 3, TS|TP, SEN(tgkill), "tgkill" },
+[271] = { 2, TF, SEN(utimes), "utimes" },
+[272] = { 6, TD, SEN(fadvise64_64), "fadvise64_64" },
+[273] = { },
+[274] = { 6, TM, SEN(mbind), "mbind" },
+[275] = { 5, TM, SEN(get_mempolicy), "get_mempolicy" },
+[276] = { 3, TM, SEN(set_mempolicy), "set_mempolicy" },
+[277] = { 4, TD, SEN(mq_open), "mq_open" },
+[278] = { 1, 0, SEN(mq_unlink), "mq_unlink" },
+[279] = { 5, TD, SEN(mq_timedsend_time32), "mq_timedsend" },
+[280] = { 5, TD, SEN(mq_timedreceive_time32), "mq_timedreceive" },
+[281] = { 2, TD, SEN(mq_notify), "mq_notify" },
+[282] = { 3, TD, SEN(mq_getsetattr), "mq_getsetattr" },
+[283] = { 4, 0, SEN(kexec_load), "kexec_load" },
+[284] = { 5, TP, SEN(waitid), "waitid" },
+[285] = { 5, 0, SEN(add_key), "add_key" },
+[286] = { 4, 0, SEN(request_key), "request_key" },
+[287] = { 5, 0, SEN(keyctl), "keyctl" },
+[288] = { 3, 0, SEN(ioprio_set), "ioprio_set" },
+[289] = { 2, 0, SEN(ioprio_get), "ioprio_get" },
+[290] = { 0, TD, SEN(inotify_init), "inotify_init" },
+[291] = { 3, TD|TF, SEN(inotify_add_watch), "inotify_add_watch" },
+[292] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" },
+[293] = { },
+[294] = { 4, TM, SEN(migrate_pages), "migrate_pages" },
+[295] = { 4, TD|TF, SEN(openat), "openat" },
+[296] = { 3, TD|TF, SEN(mkdirat), "mkdirat" },
+[297] = { 4, TD|TF, SEN(mknodat), "mknodat" },
+[298] = { 5, TD|TF, SEN(fchownat), "fchownat" },
+[299] = { 3, TD|TF, SEN(futimesat), "futimesat" },
+[300] = { 4, TD|TF|TFST|TSTA,SEN(fstatat64), "fstatat64" },
+[301] = { 3, TD|TF, SEN(unlinkat), "unlinkat" },
+[302] = { 4, TD|TF, SEN(renameat), "renameat" },
+[303] = { 5, TD|TF, SEN(linkat), "linkat" },
+[304] = { 3, TD|TF, SEN(symlinkat), "symlinkat" },
+[305] = { 4, TD|TF, SEN(readlinkat), "readlinkat" },
+[306] = { 3, TD|TF, SEN(fchmodat), "fchmodat" },
+[307] = { 3, TD|TF, SEN(faccessat), "faccessat" },
+[308] = { 6, TD, SEN(pselect6_time32), "pselect6" },
+[309] = { 5, TD, SEN(ppoll_time32), "ppoll" },
+[310] = { 1, 0, SEN(unshare), "unshare" },
+[311] = { 2, 0, SEN(set_robust_list), "set_robust_list" },
+[312] = { 3, 0, SEN(get_robust_list), "get_robust_list" },
+[313] = { 6, TD, SEN(splice), "splice" },
+[314] = { 6, TD, SEN(sync_file_range), "sync_file_range" },
+[315] = { 4, TD, SEN(tee), "tee" },
+[316] = { 4, TD, SEN(vmsplice), "vmsplice" },
+[317] = { 6, TM, SEN(move_pages), "move_pages" },
+[318] = { 3, 0, SEN(getcpu), "getcpu" },
+[319] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" },
+[320] = { 4, TD|TF, SEN(utimensat_time32), "utimensat" },
+[321] = { 3, TD|TS, SEN(signalfd), "signalfd" },
+[322] = { 2, TD, SEN(timerfd_create), "timerfd_create" },
+[323] = { 1, TD, SEN(eventfd), "eventfd" },
+[324] = { 6, TD, SEN(fallocate), "fallocate" },
+[325] = { 4, TD, SEN(timerfd_settime32), "timerfd_settime" },
+[326] = { 2, TD, SEN(timerfd_gettime32), "timerfd_gettime" },
+[327] = { 4, TD|TS, SEN(signalfd4), "signalfd4" },
+[328] = { 2, TD, SEN(eventfd2), "eventfd2" },
+[329] = { 1, TD, SEN(epoll_create1), "epoll_create1" },
+[330] = { 3, TD, SEN(dup3), "dup3" },
+[331] = { 2, TD, SEN(pipe2), "pipe2" },
+[332] = { 1, TD, SEN(inotify_init1), "inotify_init1" },
+[333] = { 5, TD, SEN(preadv), "preadv" },
+[334] = { 5, TD, SEN(pwritev), "pwritev" },
+[335] = { 4, TP|TS, SEN(rt_tgsigqueueinfo), "rt_tgsigqueueinfo" },
+[336] = { 5, TD, SEN(perf_event_open), "perf_event_open" },
+[337] = { 2, TD, SEN(fanotify_init), "fanotify_init" },
+[338] = { 6, TD|TF, SEN(fanotify_mark), "fanotify_mark" },
+[339] = { 4, 0, SEN(prlimit64), "prlimit64" },
+[340] = { 3, TN, SEN(socket), "socket" },
+[341] = { 3, TN, SEN(bind), "bind" },
+[342] = { 3, TN, SEN(connect), "connect" },
+[343] = { 2, TN, SEN(listen), "listen" },
+[344] = { 3, TN, SEN(accept), "accept" },
+[345] = { 3, TN, SEN(getsockname), "getsockname" },
+[346] = { 3, TN, SEN(getpeername), "getpeername" },
+[347] = { 4, TN, SEN(socketpair), "socketpair" },
+[348] = { 4, TN, SEN(send), "send" },
+[349] = { 6, TN, SEN(sendto), "sendto" },
+[350] = { 4, TN, SEN(recv), "recv" },
+[351] = { 6, TN, SEN(recvfrom), "recvfrom" },
+[352] = { 2, TN, SEN(shutdown), "shutdown" },
+[353] = { 5, TN, SEN(setsockopt), "setsockopt" },
+[354] = { 5, TN, SEN(getsockopt), "getsockopt" },
+[355] = { 3, TN, SEN(sendmsg), "sendmsg" },
+[356] = { 3, TN, SEN(recvmsg), "recvmsg" },
+[357] = { 5, TN, SEN(recvmmsg_time32), "recvmmsg" },
+[358] = { 4, TN, SEN(accept4), "accept4" },
+[359] = { 5, TD|TF, SEN(name_to_handle_at), "name_to_handle_at" },
+[360] = { 3, TD, SEN(open_by_handle_at), "open_by_handle_at" },
+[361] = { 2, TCL, SEN(clock_adjtime32), "clock_adjtime" },
+[362] = { 1, TD, SEN(syncfs), "syncfs" },
+[363] = { 4, TN, SEN(sendmmsg), "sendmmsg" },
+[364] = { 2, TD, SEN(setns), "setns" },
+[365] = { 6, 0, SEN(process_vm_readv), "process_vm_readv" },
+[366] = { 6, 0, SEN(process_vm_writev), "process_vm_writev" },
+[367] = { 5, 0, SEN(kcmp), "kcmp" },
+[368] = { 3, TD, SEN(finit_module), "finit_module" },
+[369] = { 3, 0, SEN(sched_setattr), "sched_setattr" },
+[370] = { 4, 0, SEN(sched_getattr), "sched_getattr" },
+[371] = { 5, TD|TF, SEN(renameat2), "renameat2" },
+[372] = { 3, 0, SEN(seccomp), "seccomp" },
+[373] = { 3, 0, SEN(getrandom), "getrandom" },
+[374] = { 2, TD, SEN(memfd_create), "memfd_create" },
+[375] = { 3, TD, SEN(bpf), "bpf" },
+[376] = { 5, TD|TF|TP|TSD|SE|SI, SEN(execveat), "execveat" },
+[377] = { 1, TD, SEN(userfaultfd), "userfaultfd" },
+[378] = { 3, 0, SEN(membarrier), "membarrier" },
+[379] = { 3, TM, SEN(mlock2), "mlock2" },
+[380] = { 6, TD, SEN(copy_file_range), "copy_file_range" },
+[381] = { 6, TD, SEN(preadv2), "preadv2" },
+[382] = { 6, TD, SEN(pwritev2), "pwritev2" },
+[383] = { 5, TD|TF|TFST|TSTA,SEN(statx), "statx" },
+[384] = { 4, TM|SI, SEN(pkey_mprotect), "pkey_mprotect" },
+[385] = { 2, 0, SEN(pkey_alloc), "pkey_alloc" },
+[386] = { 1, 0, SEN(pkey_free), "pkey_free" },
+[387] = { 4, 0, SEN(rseq), "rseq" },
+/* room for arch specific calls */
+[393] = { 3, TI, SEN(semget), "semget" },
+[394] = { 4, TI, SEN(semctl), "semctl" },
+[395] = { 3, TI, SEN(shmget), "shmget" },
+[396] = { 3, TI, SEN(shmctl), "shmctl" },
+[397] = { 3, TI|TM|SI, SEN(shmat), "shmat" },
+[398] = { 1, TI|TM|SI, SEN(shmdt), "shmdt" },
+[399] = { 2, TI, SEN(msgget), "msgget" },
+[400] = { 4, TI, SEN(msgsnd), "msgsnd" },
+[401] = { 5, TI, SEN(msgrcv), "msgrcv" },
+[402] = { 3, TI, SEN(msgctl), "msgctl" },
+#include "syscallent-common-32.h"
+#include "syscallent-common.h"
+
+#define SYS_socket_subcall 500
+#include "subcall32.h"
diff --git a/src/linux/sh/userent.h b/src/linux/sh/userent.h
new file mode 100644
index 000000000..8d769e5f4
--- /dev/null
+++ b/src/linux/sh/userent.h
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2014-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+XLAT(4*REG_REG0),
+{ 4*(REG_REG0+1), "4*REG_REG1" },
+{ 4*(REG_REG0+2), "4*REG_REG2" },
+{ 4*(REG_REG0+3), "4*REG_REG3" },
+{ 4*(REG_REG0+4), "4*REG_REG4" },
+{ 4*(REG_REG0+5), "4*REG_REG5" },
+{ 4*(REG_REG0+6), "4*REG_REG6" },
+{ 4*(REG_REG0+7), "4*REG_REG7" },
+{ 4*(REG_REG0+8), "4*REG_REG8" },
+{ 4*(REG_REG0+9), "4*REG_REG9" },
+{ 4*(REG_REG0+10), "4*REG_REG10" },
+{ 4*(REG_REG0+11), "4*REG_REG11" },
+{ 4*(REG_REG0+12), "4*REG_REG12" },
+{ 4*(REG_REG0+13), "4*REG_REG13" },
+{ 4*(REG_REG0+14), "4*REG_REG14" },
+XLAT(4*REG_REG15),
+XLAT(4*REG_PC),
+XLAT(4*REG_PR),
+XLAT(4*REG_SR),
+XLAT(4*REG_GBR),
+XLAT(4*REG_MACH),
+XLAT(4*REG_MACL),
+XLAT(4*REG_SYSCALL),
+XLAT(4*REG_FPUL),
+XLAT(4*REG_FPREG0),
+{ 4*(REG_FPREG0+1), "4*REG_FPREG1" },
+{ 4*(REG_FPREG0+2), "4*REG_FPREG2" },
+{ 4*(REG_FPREG0+3), "4*REG_FPREG3" },
+{ 4*(REG_FPREG0+4), "4*REG_FPREG4" },
+{ 4*(REG_FPREG0+5), "4*REG_FPREG5" },
+{ 4*(REG_FPREG0+6), "4*REG_FPREG6" },
+{ 4*(REG_FPREG0+7), "4*REG_FPREG7" },
+{ 4*(REG_FPREG0+8), "4*REG_FPREG8" },
+{ 4*(REG_FPREG0+9), "4*REG_FPREG9" },
+{ 4*(REG_FPREG0+10), "4*REG_FPREG10" },
+{ 4*(REG_FPREG0+11), "4*REG_FPREG11" },
+{ 4*(REG_FPREG0+12), "4*REG_FPREG12" },
+{ 4*(REG_FPREG0+13), "4*REG_FPREG13" },
+{ 4*(REG_FPREG0+14), "4*REG_FPREG14" },
+XLAT(4*REG_FPREG15),
+#ifdef REG_XDREG0
+XLAT(4*REG_XDREG0),
+{ 4*(REG_XDREG0+2), "4*REG_XDREG2" },
+{ 4*(REG_XDREG0+4), "4*REG_XDREG4" },
+{ 4*(REG_XDREG0+6), "4*REG_XDREG6" },
+{ 4*(REG_XDREG0+8), "4*REG_XDREG8" },
+{ 4*(REG_XDREG0+10), "4*REG_XDREG10" },
+{ 4*(REG_XDREG0+12), "4*REG_XDREG12" },
+XLAT(4*REG_XDREG14),
+#endif
+XLAT(4*REG_FPSCR),
+/* Other fields in "struct user" */
+#include "userent0.h"
diff --git a/src/linux/sh/userent0.h b/src/linux/sh/userent0.h
new file mode 100644
index 000000000..c1d412242
--- /dev/null
+++ b/src/linux/sh/userent0.h
@@ -0,0 +1,20 @@
+/*
+ * Copyright (c) 2014-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+XLAT_UOFF(u_fpvalid),
+XLAT_UOFF(u_tsize),
+XLAT_UOFF(u_dsize),
+XLAT_UOFF(u_ssize),
+XLAT_UOFF(start_code),
+XLAT_UOFF(start_data),
+XLAT_UOFF(start_stack),
+XLAT_UOFF(signal),
+XLAT_UOFF(u_ar0),
+XLAT_UOFF(u_fpstate),
+XLAT_UOFF(magic),
+XLAT_UOFF(u_comm),
+#include "../userent0.h"
diff --git a/src/linux/sh64/arch_defs_.h b/src/linux/sh64/arch_defs_.h
new file mode 100644
index 000000000..18f4d7387
--- /dev/null
+++ b/src/linux/sh64/arch_defs_.h
@@ -0,0 +1,8 @@
+/*
+ * Copyright (c) 2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#define HAVE_ARCH_UID16_SYSCALLS 1
diff --git a/src/linux/sh64/arch_regs.c b/src/linux/sh64/arch_regs.c
new file mode 100644
index 000000000..4bd08b6d3
--- /dev/null
+++ b/src/linux/sh64/arch_regs.c
@@ -0,0 +1,11 @@
+/*
+ * Copyright (c) 2015-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static struct pt_regs sh64_regs;
+#define ARCH_REGS_FOR_GETREGS sh64_regs
+#define ARCH_PC_REG sh64_regs.pc
+#define ARCH_SP_REG sh64_regs.regs[15]
diff --git a/src/linux/sh64/get_error.c b/src/linux/sh64/get_error.c
new file mode 100644
index 000000000..44242299a
--- /dev/null
+++ b/src/linux/sh64/get_error.c
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2015-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "negated_errno.h"
+
+static void
+arch_get_error(struct tcb *tcp, const bool check_errno)
+{
+ if (check_errno && is_negated_errno(sh64_regs.regs[9])) {
+ tcp->u_rval = -1;
+ tcp->u_error = -sh64_regs.regs[9];
+ } else {
+ tcp->u_rval = sh64_regs.regs[9];
+ }
+}
diff --git a/src/linux/sh64/get_scno.c b/src/linux/sh64/get_scno.c
new file mode 100644
index 000000000..c769dce47
--- /dev/null
+++ b/src/linux/sh64/get_scno.c
@@ -0,0 +1,14 @@
+/*
+ * Copyright (c) 2015-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+/* Return codes: 1 - ok, 0 - ignore, other - error. */
+static int
+arch_get_scno(struct tcb *tcp)
+{
+ tcp->scno = sh64_regs.regs[9];
+ return 1;
+}
diff --git a/src/linux/sh64/get_syscall_args.c b/src/linux/sh64/get_syscall_args.c
new file mode 100644
index 000000000..8dd38b0b4
--- /dev/null
+++ b/src/linux/sh64/get_syscall_args.c
@@ -0,0 +1,15 @@
+/*
+ * Copyright (c) 2015-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+/* Return -1 on error or 1 on success (never 0!). */
+static int
+arch_get_syscall_args(struct tcb *tcp)
+{
+ for (unsigned int i = 0; i < n_args(tcp); ++i)
+ tcp->u_arg[i] = sh64_regs.regs[i + 2];
+ return 1;
+}
diff --git a/src/linux/sh64/ioctls_arch0.h b/src/linux/sh64/ioctls_arch0.h
new file mode 100644
index 000000000..36338dcea
--- /dev/null
+++ b/src/linux/sh64/ioctls_arch0.h
@@ -0,0 +1,77 @@
+/* Generated by ioctls_gen.sh from definitions found in $linux/arch/sh/include/ tree. */
+{ "asm/ioctls.h", "FIOASYNC", _IOC_WRITE, 0x667d, 0x04 },
+{ "asm/ioctls.h", "FIOCLEX", _IOC_NONE, 0x6601, 0x00 },
+{ "asm/ioctls.h", "FIONBIO", _IOC_WRITE, 0x667e, 0x04 },
+{ "asm/ioctls.h", "FIONCLEX", _IOC_NONE, 0x6602, 0x00 },
+{ "asm/ioctls.h", "FIONREAD", _IOC_READ, 0x667f, 0x04 },
+{ "asm/ioctls.h", "FIOQSIZE", _IOC_READ, 0x6680, 0x08 },
+{ "asm/ioctls.h", "TCFLSH", _IOC_NONE, 0x741f, 0x00 },
+{ "asm/ioctls.h", "TCGETS", 0, 0x5401, 0 },
+{ "asm/ioctls.h", "TCGETS2", _IOC_READ, 0x542a, 0x2c },
+{ "asm/ioctls.h", "TCSBRK", _IOC_NONE, 0x741d, 0x00 },
+{ "asm/ioctls.h", "TCSBRKP", _IOC_WRITE, 0x5425, 0x04 },
+{ "asm/ioctls.h", "TCSETS", 0, 0x5402, 0 },
+{ "asm/ioctls.h", "TCSETS2", _IOC_WRITE, 0x542b, 0x2c },
+{ "asm/ioctls.h", "TCSETSF", 0, 0x5404, 0 },
+{ "asm/ioctls.h", "TCSETSF2", _IOC_WRITE, 0x542d, 0x2c },
+{ "asm/ioctls.h", "TCSETSW", 0, 0x5403, 0 },
+{ "asm/ioctls.h", "TCSETSW2", _IOC_WRITE, 0x542c, 0x2c },
+{ "asm/ioctls.h", "TCXONC", _IOC_NONE, 0x741e, 0x00 },
+{ "asm/ioctls.h", "TIOCCBRK", _IOC_NONE, 0x5428, 0x00 },
+{ "asm/ioctls.h", "TIOCCONS", _IOC_NONE, 0x541d, 0x00 },
+{ "asm/ioctls.h", "TIOCEXCL", _IOC_NONE, 0x540c, 0x00 },
+{ "asm/ioctls.h", "TIOCGDEV", _IOC_READ, 0x5432, 0x04 },
+{ "asm/ioctls.h", "TIOCGETD", _IOC_READ, 0x5424, 0x04 },
+{ "asm/ioctls.h", "TIOCGEXCL", _IOC_READ, 0x5440, 0x04 },
+{ "asm/ioctls.h", "TIOCGICOUNT", 0, 0x545D, 0 },
+{ "asm/ioctls.h", "TIOCGLCKTRMIOS", 0, 0x5456, 0 },
+{ "asm/ioctls.h", "TIOCGPGRP", _IOC_READ, 0x7477, 0x04 },
+{ "asm/ioctls.h", "TIOCGPKT", _IOC_READ, 0x5438, 0x04 },
+{ "asm/ioctls.h", "TIOCGPTLCK", _IOC_READ, 0x5439, 0x04 },
+{ "asm/ioctls.h", "TIOCGPTN", _IOC_READ, 0x5430, 0x04 },
+{ "asm/ioctls.h", "TIOCGRS485", _IOC_READ, 0x542e, 0x20 },
+{ "asm/ioctls.h", "TIOCGSID", _IOC_READ, 0x5429, 0x04 },
+{ "asm/ioctls.h", "TIOCGSOFTCAR", _IOC_READ, 0x5419, 0x04 },
+{ "asm/ioctls.h", "TIOCLINUX", _IOC_WRITE, 0x541c, 0x01 },
+{ "asm/ioctls.h", "TIOCMBIC", _IOC_WRITE, 0x5417, 0x04 },
+{ "asm/ioctls.h", "TIOCMBIS", _IOC_WRITE, 0x5416, 0x04 },
+{ "asm/ioctls.h", "TIOCMGET", _IOC_READ, 0x5415, 0x04 },
+{ "asm/ioctls.h", "TIOCMIWAIT", _IOC_NONE, 0x545c, 0x00 },
+{ "asm/ioctls.h", "TIOCMSET", _IOC_WRITE, 0x5418, 0x04 },
+{ "asm/ioctls.h", "TIOCNOTTY", _IOC_NONE, 0x5422, 0x00 },
+{ "asm/ioctls.h", "TIOCNXCL", _IOC_NONE, 0x540d, 0x00 },
+{ "asm/ioctls.h", "TIOCOUTQ", _IOC_READ, 0x7473, 0x04 },
+{ "asm/ioctls.h", "TIOCPKT", _IOC_WRITE, 0x5420, 0x04 },
+{ "asm/ioctls.h", "TIOCSBRK", _IOC_NONE, 0x5427, 0x00 },
+{ "asm/ioctls.h", "TIOCSCTTY", _IOC_NONE, 0x540e, 0x00 },
+{ "asm/ioctls.h", "TIOCSERCONFIG", _IOC_NONE, 0x5453, 0x00 },
+{ "asm/ioctls.h", "TIOCSERGETLSR", _IOC_READ, 0x5459, 0x04 },
+{ "asm/ioctls.h", "TIOCSERGWILD", _IOC_READ, 0x5454, 0x04 },
+{ "asm/ioctls.h", "TIOCSERSWILD", _IOC_WRITE, 0x5455, 0x04 },
+{ "asm/ioctls.h", "TIOCSETD", _IOC_WRITE, 0x5423, 0x04 },
+{ "asm/ioctls.h", "TIOCSIG", _IOC_WRITE, 0x5436, 0x04 },
+{ "asm/ioctls.h", "TIOCSLCKTRMIOS", 0, 0x5457, 0 },
+{ "asm/ioctls.h", "TIOCSPGRP", _IOC_WRITE, 0x7476, 0x04 },
+{ "asm/ioctls.h", "TIOCSPTLCK", _IOC_WRITE, 0x5431, 0x04 },
+{ "asm/ioctls.h", "TIOCSRS485", _IOC_READ|_IOC_WRITE, 0x542f, 0x20 },
+{ "asm/ioctls.h", "TIOCSSOFTCAR", _IOC_WRITE, 0x541a, 0x04 },
+{ "asm/ioctls.h", "TIOCSTART", _IOC_NONE, 0x746e, 0x00 },
+{ "asm/ioctls.h", "TIOCSTI", _IOC_WRITE, 0x5412, 0x01 },
+{ "asm/ioctls.h", "TIOCSTOP", _IOC_NONE, 0x746f, 0x00 },
+{ "asm/ioctls.h", "TIOCVHANGUP", _IOC_NONE, 0x5437, 0x00 },
+{ "asm/sockios.h", "FIOGETOWN", _IOC_READ, 0x667b, 0x04 },
+{ "asm/sockios.h", "FIOSETOWN", _IOC_WRITE, 0x667c, 0x04 },
+{ "asm/sockios.h", "SIOCATMARK", _IOC_READ, 0x7307, 0x04 },
+{ "asm/sockios.h", "SIOCGPGRP", _IOC_READ, 0x7309, 0x04 },
+{ "asm/sockios.h", "SIOCGSTAMP_OLD", _IOC_READ, 0x7364, 0x10 },
+{ "asm/sockios.h", "SIOCGSTAMPNS_OLD", _IOC_READ, 0x7365, 0x10 },
+{ "asm/sockios.h", "SIOCSPGRP", _IOC_WRITE, 0x7308, 0x04 },
+{ "mach-landisk/mach/gio.h", "GIODRV_IOCGGIODATA1", _IOC_READ, 0x6b02, 0x08 },
+{ "mach-landisk/mach/gio.h", "GIODRV_IOCGGIODATA2", _IOC_READ, 0x6b04, 0x08 },
+{ "mach-landisk/mach/gio.h", "GIODRV_IOCGGIODATA4", _IOC_READ, 0x6b06, 0x08 },
+{ "mach-landisk/mach/gio.h", "GIODRV_IOCHARDRESET", _IOC_NONE, 0x6b08, 0x00 },
+{ "mach-landisk/mach/gio.h", "GIODRV_IOCRESET", _IOC_NONE, 0x6b00, 0x00 },
+{ "mach-landisk/mach/gio.h", "GIODRV_IOCSGIODATA1", _IOC_WRITE, 0x6b01, 0x08 },
+{ "mach-landisk/mach/gio.h", "GIODRV_IOCSGIODATA2", _IOC_WRITE, 0x6b03, 0x08 },
+{ "mach-landisk/mach/gio.h", "GIODRV_IOCSGIODATA4", _IOC_WRITE, 0x6b05, 0x08 },
+{ "mach-landisk/mach/gio.h", "GIODRV_IOCSGIOSETADDR", _IOC_WRITE, 0x6b07, 0x08 },
diff --git a/src/linux/sh64/ioctls_inc0.h b/src/linux/sh64/ioctls_inc0.h
new file mode 100644
index 000000000..f9939faa4
--- /dev/null
+++ b/src/linux/sh64/ioctls_inc0.h
@@ -0,0 +1 @@
+#include "64/ioctls_inc.h"
diff --git a/src/linux/sh64/raw_syscall.h b/src/linux/sh64/raw_syscall.h
new file mode 100644
index 000000000..2477b3237
--- /dev/null
+++ b/src/linux/sh64/raw_syscall.h
@@ -0,0 +1 @@
+#include "sh/raw_syscall.h"
diff --git a/src/linux/sh64/rt_sigframe.h b/src/linux/sh64/rt_sigframe.h
new file mode 100644
index 000000000..493948f8c
--- /dev/null
+++ b/src/linux/sh64/rt_sigframe.h
@@ -0,0 +1,21 @@
+/*
+ * Copyright (c) 2017-2018 Dmitry V. Levin <ldv@strace.io>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_RT_SIGFRAME_H
+# define STRACE_RT_SIGFRAME_H
+
+# include <signal.h>
+
+typedef struct {
+ siginfo_t *pinfo;
+ void *puc;
+ siginfo_t info;
+ ucontext_t uc;
+ /* more data follows */
+} struct_rt_sigframe;
+
+#endif /* !STRACE_RT_SIGFRAME_H */
diff --git a/src/linux/sh64/set_error.c b/src/linux/sh64/set_error.c
new file mode 100644
index 000000000..91da77724
--- /dev/null
+++ b/src/linux/sh64/set_error.c
@@ -0,0 +1,20 @@
+/*
+ * Copyright (c) 2016-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static int
+arch_set_error(struct tcb *tcp)
+{
+ sh64_regs.regs[9] = -tcp->u_error;
+ return set_regs(tcp->pid);
+}
+
+static int
+arch_set_success(struct tcb *tcp)
+{
+ sh64_regs.regs[9] = tcp->u_rval;
+ return set_regs(tcp->pid);
+}
diff --git a/src/linux/sh64/set_scno.c b/src/linux/sh64/set_scno.c
new file mode 100644
index 000000000..79d7213b0
--- /dev/null
+++ b/src/linux/sh64/set_scno.c
@@ -0,0 +1,15 @@
+/*
+ * Copyright (c) 2016-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static int
+arch_set_scno(struct tcb *tcp, kernel_ulong_t scno)
+{
+ if (ptrace_syscall_info_is_valid() && get_regs(tcp) < 0)
+ return -1;
+ sh64_regs.regs[9] = scno;
+ return set_regs(tcp->pid);
+}
diff --git a/src/linux/sh64/syscallent.h b/src/linux/sh64/syscallent.h
new file mode 100644
index 000000000..b4041fe8e
--- /dev/null
+++ b/src/linux/sh64/syscallent.h
@@ -0,0 +1,405 @@
+/*
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993, 1994, 1995 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1995-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+[ 0] = { 0, 0, SEN(restart_syscall), "restart_syscall" },
+[ 1] = { 1, TP|SE, SEN(exit), "exit" },
+[ 2] = { 0, TP, SEN(fork), "fork" },
+[ 3] = { 3, TD, SEN(read), "read" },
+[ 4] = { 3, TD, SEN(write), "write" },
+[ 5] = { 3, TD|TF, SEN(open), "open" },
+[ 6] = { 1, TD, SEN(close), "close" },
+[ 7] = { 3, TP, SEN(waitpid), "waitpid" },
+[ 8] = { 2, TD|TF, SEN(creat), "creat" },
+[ 9] = { 2, TF, SEN(link), "link" },
+[ 10] = { 1, TF, SEN(unlink), "unlink" },
+[ 11] = { 3, TF|TP|TSD|SE|SI, SEN(execve), "execve" },
+[ 12] = { 1, TF, SEN(chdir), "chdir" },
+[ 13] = { 1, TCL, SEN(time), "time" },
+[ 14] = { 3, TF, SEN(mknod), "mknod" },
+[ 15] = { 2, TF, SEN(chmod), "chmod" },
+[ 16] = { 3, TF, SEN(chown16), "lchown" },
+[ 17] = { 0, TM, SEN(break), "break" },
+[ 18] = { 2, TF|TST|TSTA, SEN(oldstat), "oldstat" },
+[ 19] = { 3, TD, SEN(lseek), "lseek" },
+[ 20] = { 0, PU|NF, SEN(getpid), "getpid" },
+[ 21] = { 5, TF, SEN(mount), "mount" },
+[ 22] = { 1, TF, SEN(umount), "umount" },
+[ 23] = { 1, TC, SEN(setuid16), "setuid" },
+[ 24] = { 0, TC|PU|NF, SEN(getuid16), "getuid" },
+[ 25] = { 1, 0, SEN(stime), "stime" },
+[ 26] = { 4, 0, SEN(ptrace), "ptrace" },
+[ 27] = { 1, 0, SEN(alarm), "alarm" },
+[ 28] = { 2, TD|TFST|TSTA, SEN(oldfstat), "oldfstat" },
+[ 29] = { 0, TS, SEN(pause), "pause" },
+[ 30] = { 2, TF, SEN(utime), "utime" },
+[ 31] = { 2, 0, SEN(stty), "stty" },
+[ 32] = { 2, 0, SEN(gtty), "gtty" },
+[ 33] = { 2, TF, SEN(access), "access" },
+[ 34] = { 1, 0, SEN(nice), "nice" },
+[ 35] = { 0, 0, SEN(ftime), "ftime" },
+[ 36] = { 0, 0, SEN(sync), "sync" },
+[ 37] = { 2, TS|TP, SEN(kill), "kill" },
+[ 38] = { 2, TF, SEN(rename), "rename" },
+[ 39] = { 2, TF, SEN(mkdir), "mkdir" },
+[ 40] = { 1, TF, SEN(rmdir), "rmdir" },
+[ 41] = { 1, TD, SEN(dup), "dup" },
+[ 42] = { 0, TD, SEN(pipe), "pipe" },
+[ 43] = { 1, 0, SEN(times), "times" },
+[ 44] = { 0, 0, SEN(prof), "prof" },
+[ 45] = { 1, TM|SI, SEN(brk), "brk" },
+[ 46] = { 1, TC, SEN(setgid16), "setgid" },
+[ 47] = { 0, TC|PU|NF, SEN(getgid16), "getgid" },
+[ 48] = { 2, TS, SEN(signal), "signal" },
+[ 49] = { 0, TC|PU|NF, SEN(geteuid16), "geteuid" },
+[ 50] = { 0, TC|PU|NF, SEN(getegid16), "getegid" },
+[ 51] = { 1, TF, SEN(acct), "acct" },
+[ 52] = { 2, TF, SEN(umount2), "umount2" },
+[ 53] = { 0, 0, SEN(lock), "lock" },
+[ 54] = { 3, TD, SEN(ioctl), "ioctl" },
+[ 55] = { 3, TD, SEN(fcntl), "fcntl" },
+[ 56] = { 0, 0, SEN(mpx), "mpx" },
+[ 57] = { 2, 0, SEN(setpgid), "setpgid" },
+[ 58] = { 2, 0, SEN(ulimit), "ulimit" },
+[ 59] = { 1, 0, SEN(oldolduname), "oldolduname" },
+[ 60] = { 1, NF, SEN(umask), "umask" },
+[ 61] = { 1, TF, SEN(chroot), "chroot" },
+[ 62] = { 2, TSFA, SEN(ustat), "ustat" },
+[ 63] = { 2, TD, SEN(dup2), "dup2" },
+[ 64] = { 0, PU|NF, SEN(getppid), "getppid" },
+[ 65] = { 0, PU|NF, SEN(getpgrp), "getpgrp" },
+[ 66] = { 0, 0, SEN(setsid), "setsid" },
+[ 67] = { 3, TS, SEN(sigaction), "sigaction" },
+[ 68] = { 0, TS, SEN(sgetmask), "sgetmask" },
+[ 69] = { 1, TS, SEN(ssetmask), "ssetmask" },
+[ 70] = { 2, TC, SEN(setreuid16), "setreuid" },
+[ 71] = { 2, TC, SEN(setregid16), "setregid" },
+[ 72] = { 1, TS, SEN(sigsuspend), "sigsuspend" },
+[ 73] = { 1, TS, SEN(sigpending), "sigpending" },
+[ 74] = { 2, 0, SEN(sethostname), "sethostname" },
+[ 75] = { 2, 0, SEN(setrlimit), "setrlimit" },
+[ 76] = { 2, 0, SEN(getrlimit), "getrlimit" },
+[ 77] = { 2, 0, SEN(getrusage), "getrusage" },
+[ 78] = { 2, TCL, SEN(gettimeofday), "gettimeofday" },
+[ 79] = { 2, TCL, SEN(settimeofday), "settimeofday" },
+[ 80] = { 2, TC, SEN(getgroups16), "getgroups" },
+[ 81] = { 2, TC, SEN(setgroups16), "setgroups" },
+[ 82] = { },
+[ 83] = { 2, TF, SEN(symlink), "symlink" },
+[ 84] = { 2, TF|TLST|TSTA, SEN(oldlstat), "oldlstat" },
+[ 85] = { 3, TF, SEN(readlink), "readlink" },
+[ 86] = { 1, TF, SEN(uselib), "uselib" },
+[ 87] = { 2, TF, SEN(swapon), "swapon" },
+[ 88] = { 4, 0, SEN(reboot), "reboot" },
+[ 89] = { 3, TD, SEN(readdir), "readdir" },
+[ 90] = { 6, TD|TM|SI, SEN(mmap), "mmap" },
+[ 91] = { 2, TM|SI, SEN(munmap), "munmap" },
+[ 92] = { 2, TF, SEN(truncate), "truncate" },
+[ 93] = { 2, TD, SEN(ftruncate), "ftruncate" },
+[ 94] = { 2, TD, SEN(fchmod), "fchmod" },
+[ 95] = { 3, TD, SEN(fchown16), "fchown" },
+[ 96] = { 2, 0, SEN(getpriority), "getpriority" },
+[ 97] = { 3, 0, SEN(setpriority), "setpriority" },
+[ 98] = { 4, 0, SEN(profil), "profil" },
+[ 99] = { 2, TF|TSF|TSFA, SEN(statfs), "statfs" },
+[100] = { 2, TD|TFSF|TSFA, SEN(fstatfs), "fstatfs" },
+[101] = { 3, 0, SEN(ioperm), "ioperm" },
+[102] = { 2, TD|TSD, SEN(socketcall), "socketcall" },
+[103] = { 3, 0, SEN(syslog), "syslog" },
+[104] = { 3, 0, SEN(setitimer), "setitimer" },
+[105] = { 2, 0, SEN(getitimer), "getitimer" },
+[106] = { 2, TF|TST|TSTA, SEN(stat), "stat" },
+[107] = { 2, TF|TLST|TSTA, SEN(lstat), "lstat" },
+[108] = { 2, TD|TFST|TSTA, SEN(fstat), "fstat" },
+[109] = { 1, 0, SEN(olduname), "olduname" },
+[110] = { 1, 0, SEN(iopl), "iopl" },
+[111] = { 0, 0, SEN(vhangup), "vhangup" },
+[112] = { 0, 0, SEN(idle), "idle" },
+[113] = { },
+[114] = { 4, TP, SEN(wait4), "wait4" },
+[115] = { 1, TF, SEN(swapoff), "swapoff" },
+[116] = { 1, 0, SEN(sysinfo), "sysinfo" },
+[117] = { 6, TI|TSD, SEN(ipc), "ipc" },
+[118] = { 1, TD, SEN(fsync), "fsync" },
+[119] = { 0, TS, SEN(sigreturn), "sigreturn" },
+[120] = { 5, TP, SEN(clone), "clone" },
+[121] = { 2, 0, SEN(setdomainname), "setdomainname" },
+[122] = { 1, 0, SEN(uname), "uname" },
+[123] = { 3, 0, SEN(printargs), "cacheflush" },
+[124] = { 1, TCL, SEN(adjtimex64), "adjtimex" },
+[125] = { 3, TM|SI, SEN(mprotect), "mprotect" },
+[126] = { 3, TS, SEN(sigprocmask), "sigprocmask" },
+[127] = { 2, 0, SEN(create_module), "create_module" },
+[128] = { 3, 0, SEN(init_module), "init_module" },
+[129] = { 2, 0, SEN(delete_module), "delete_module" },
+[130] = { 1, 0, SEN(get_kernel_syms), "get_kernel_syms" },
+[131] = { 4, TF, SEN(quotactl), "quotactl" },
+[132] = { 1, 0, SEN(getpgid), "getpgid" },
+[133] = { 1, TD, SEN(fchdir), "fchdir" },
+[134] = { 2, 0, SEN(bdflush), "bdflush" },
+[135] = { 3, 0, SEN(sysfs), "sysfs" },
+[136] = { 1, NF, SEN(personality), "personality" },
+[137] = { 5, 0, SEN(afs_syscall), "afs_syscall" },
+[138] = { 1, TC|NF, SEN(setfsuid16), "setfsuid" },
+[139] = { 1, TC|NF, SEN(setfsgid16), "setfsgid" },
+[140] = { 5, TD, SEN(llseek), "_llseek" },
+[141] = { 3, TD, SEN(getdents), "getdents" },
+[142] = { 5, TD, SEN(select), "_newselect" },
+[143] = { 2, TD, SEN(flock), "flock" },
+[144] = { 3, TM, SEN(msync), "msync" },
+[145] = { 3, TD, SEN(readv), "readv" },
+[146] = { 3, TD, SEN(writev), "writev" },
+[147] = { 1, 0, SEN(getsid), "getsid" },
+[148] = { 1, TD, SEN(fdatasync), "fdatasync" },
+[149] = { 1, 0, SEN(sysctl), "_sysctl" },
+[150] = { 2, TM, SEN(mlock), "mlock" },
+[151] = { 2, TM, SEN(munlock), "munlock" },
+[152] = { 1, TM, SEN(mlockall), "mlockall" },
+[153] = { 0, TM, SEN(munlockall), "munlockall" },
+[154] = { 2, 0, SEN(sched_setparam), "sched_setparam" },
+[155] = { 2, 0, SEN(sched_getparam), "sched_getparam" },
+[156] = { 3, 0, SEN(sched_setscheduler), "sched_setscheduler" },
+[157] = { 1, 0, SEN(sched_getscheduler), "sched_getscheduler" },
+[158] = { 0, 0, SEN(sched_yield), "sched_yield" },
+[159] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"},
+[160] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"},
+[161] = { 2, 0, SEN(sched_rr_get_interval_time64),"sched_rr_get_interval"},
+[162] = { 2, 0, SEN(nanosleep_time64), "nanosleep" },
+[163] = { 5, TM|SI, SEN(mremap), "mremap" },
+[164] = { 3, TC, SEN(setresuid16), "setresuid" },
+[165] = { 3, TC, SEN(getresuid16), "getresuid" },
+[166] = { },
+[167] = { 5, 0, SEN(query_module), "query_module" },
+[168] = { 3, TD, SEN(poll_time64), "poll" },
+[169] = { 3, 0, SEN(nfsservctl), "nfsservctl" },
+[170] = { 3, TC, SEN(setresgid16), "setresgid" },
+[171] = { 3, TC, SEN(getresgid16), "getresgid" },
+[172] = { 5, TC, SEN(prctl), "prctl" },
+[173] = { 0, TS, SEN(rt_sigreturn), "rt_sigreturn" },
+[174] = { 4, TS, SEN(rt_sigaction), "rt_sigaction" },
+[175] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" },
+[176] = { 2, TS, SEN(rt_sigpending), "rt_sigpending" },
+[177] = { 4, TS, SEN(rt_sigtimedwait_time64), "rt_sigtimedwait" },
+[178] = { 3, TS|TP, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" },
+[179] = { 2, TS, SEN(rt_sigsuspend), "rt_sigsuspend" },
+[180] = { 4, TD, SEN(pread), "pread64" },
+[181] = { 4, TD, SEN(pwrite), "pwrite64" },
+[182] = { 3, TF, SEN(chown16), "chown" },
+[183] = { 2, TF, SEN(getcwd), "getcwd" },
+[184] = { 2, TC, SEN(capget), "capget" },
+[185] = { 2, TC, SEN(capset), "capset" },
+[186] = { 2, TS, SEN(sigaltstack), "sigaltstack" },
+[187] = { 4, TD|TN, SEN(sendfile), "sendfile" },
+[188 ... 189] = { },
+[190] = { 0, TP, SEN(vfork), "vfork" },
+[191] = { 2, 0, SEN(getrlimit), "ugetrlimit" },
+[192] = { 6, TD|TM|SI, SEN(mmap_4koff), "mmap2" },
+[193] = { 2, TF, SEN(truncate), "truncate64" },
+[194] = { 2, TD, SEN(ftruncate), "ftruncate64" },
+[195] = { 2, TF|TST|TSTA, SEN(stat64), "stat64" },
+[196] = { 2, TF|TLST|TSTA, SEN(lstat64), "lstat64" },
+[197] = { 2, TD|TFST|TSTA, SEN(fstat64), "fstat64" },
+[198] = { 3, TF, SEN(chown), "lchown32" },
+[199] = { 0, TC|PU|NF, SEN(getuid), "getuid32" },
+[200] = { 0, TC|PU|NF, SEN(getgid), "getgid32" },
+[201] = { 0, TC|PU|NF, SEN(geteuid), "geteuid32" },
+[202] = { 0, TC|PU|NF, SEN(getegid), "getegid32" },
+[203] = { 2, TC, SEN(setreuid), "setreuid32" },
+[204] = { 2, TC, SEN(setregid), "setregid32" },
+[205] = { 2, TC, SEN(getgroups), "getgroups32" },
+[206] = { 2, TC, SEN(setgroups), "setgroups32" },
+[207] = { 3, TD, SEN(fchown), "fchown32" },
+[208] = { 3, TC, SEN(setresuid), "setresuid32" },
+[209] = { 3, TC, SEN(getresuid), "getresuid32" },
+[210] = { 3, TC, SEN(setresgid), "setresgid32" },
+[211] = { 3, TC, SEN(getresgid), "getresgid32" },
+[212] = { 3, TF, SEN(chown), "chown32" },
+[213] = { 1, TC, SEN(setuid), "setuid32" },
+[214] = { 1, TC, SEN(setgid), "setgid32" },
+[215] = { 1, TC|NF, SEN(setfsuid), "setfsuid32" },
+[216] = { 1, TC|NF, SEN(setfsgid), "setfsgid32" },
+[217] = { 2, TF, SEN(pivotroot), "pivot_root" },
+[218] = { 3, TM, SEN(mincore), "mincore" },
+[219] = { 3, TM, SEN(madvise), "madvise" },
+[220] = { 3, TN, SEN(socket), "socket" },
+[221] = { 3, TN, SEN(bind), "bind" },
+[222] = { 3, TN, SEN(connect), "connect" },
+[223] = { 2, TN, SEN(listen), "listen" },
+[224] = { 3, TN, SEN(accept), "accept" },
+[225] = { 3, TN, SEN(getsockname), "getsockname" },
+[226] = { 3, TN, SEN(getpeername), "getpeername" },
+[227] = { 4, TN, SEN(socketpair), "socketpair" },
+[228] = { 4, TN, SEN(send), "send" },
+[229] = { 6, TN, SEN(sendto), "sendto" },
+[230] = { 4, TN, SEN(recv), "recv" },
+[231] = { 6, TN, SEN(recvfrom), "recvfrom" },
+[232] = { 2, TN, SEN(shutdown), "shutdown" },
+[233] = { 5, TN, SEN(setsockopt), "setsockopt" },
+[234] = { 5, TN, SEN(getsockopt), "getsockopt" },
+[235] = { 3, TN, SEN(sendmsg), "sendmsg" },
+[236] = { 3, TN, SEN(recvmsg), "recvmsg" },
+[237] = { 3, TI, SEN(semop), "semop" },
+[238] = { 3, TI, SEN(semget), "semget" },
+[239] = { 4, TI, SEN(semctl), "semctl" },
+[240] = { 4, TI, SEN(msgsnd), "msgsnd" },
+[241] = { 5, TI, SEN(msgrcv), "msgrcv" },
+[242] = { 2, TI, SEN(msgget), "msgget" },
+[243] = { 3, TI, SEN(msgctl), "msgctl" },
+[244] = { 3, TI|TM|SI, SEN(shmat), "shmat" },
+[245] = { 1, TI|TM|SI, SEN(shmdt), "shmdt" },
+[246] = { 3, TI, SEN(shmget), "shmget" },
+[247] = { 3, TI, SEN(shmctl), "shmctl" },
+[248] = { 3, TD, SEN(getdents64), "getdents64" },
+[249] = { 3, TD, SEN(fcntl64), "fcntl64" },
+[250 ... 251] = { },
+[252] = { 0, PU|NF, SEN(gettid), "gettid" },
+[253] = { 3, TD, SEN(readahead), "readahead" },
+[254] = { 5, TF, SEN(setxattr), "setxattr" },
+[255] = { 5, TF, SEN(setxattr), "lsetxattr" },
+[256] = { 5, TD, SEN(fsetxattr), "fsetxattr" },
+[257] = { 4, TF, SEN(getxattr), "getxattr" },
+[258] = { 4, TF, SEN(getxattr), "lgetxattr" },
+[259] = { 4, TD, SEN(fgetxattr), "fgetxattr" },
+[260] = { 3, TF, SEN(listxattr), "listxattr" },
+[261] = { 3, TF, SEN(listxattr), "llistxattr" },
+[262] = { 3, TD, SEN(flistxattr), "flistxattr" },
+[263] = { 2, TF, SEN(removexattr), "removexattr" },
+[264] = { 2, TF, SEN(removexattr), "lremovexattr" },
+[265] = { 2, TD, SEN(fremovexattr), "fremovexattr" },
+[266] = { 2, TS|TP, SEN(tkill), "tkill" },
+[267] = { 4, TD|TN, SEN(sendfile64), "sendfile64" },
+[268] = { 6, 0, SEN(futex_time64), "futex" },
+[269] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" },
+[270] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" },
+[271 ... 272] = { },
+[273] = { 2, TM, SEN(io_setup), "io_setup" },
+[274] = { 1, TM, SEN(io_destroy), "io_destroy" },
+[275] = { 5, 0, SEN(io_getevents_time64), "io_getevents" },
+[276] = { 3, 0, SEN(io_submit), "io_submit" },
+[277] = { 3, 0, SEN(io_cancel), "io_cancel" },
+[278] = { 4, TD, SEN(fadvise64), "fadvise64" },
+[279] = { },
+[280] = { 1, TP|SE, SEN(exit), "exit_group" },
+[281] = { 3, 0, SEN(lookup_dcookie), "lookup_dcookie" },
+[282] = { 1, TD, SEN(epoll_create), "epoll_create" },
+[283] = { 4, TD, SEN(epoll_ctl), "epoll_ctl" },
+[284] = { 4, TD, SEN(epoll_wait), "epoll_wait" },
+[285] = { 5, TM|SI, SEN(remap_file_pages), "remap_file_pages" },
+[286] = { 1, 0, SEN(set_tid_address), "set_tid_address" },
+[287] = { 3, 0, SEN(timer_create), "timer_create" },
+[288] = { 4, 0, SEN(timer_settime64), "timer_settime" },
+[289] = { 2, 0, SEN(timer_gettime64), "timer_gettime" },
+[290] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" },
+[291] = { 1, 0, SEN(timer_delete), "timer_delete" },
+[292] = { 2, TCL, SEN(clock_settime64), "clock_settime" },
+[293] = { 2, TCL, SEN(clock_gettime64), "clock_gettime" },
+[294] = { 2, TCL, SEN(clock_getres_time64), "clock_getres" },
+[295] = { 4, 0, SEN(clock_nanosleep_time64), "clock_nanosleep" },
+[296] = { 3, TF|TSF|TSFA, SEN(statfs64), "statfs64" },
+[297] = { 3, TD|TFSF|TSFA, SEN(fstatfs64), "fstatfs64" },
+[298] = { 3, TS|TP, SEN(tgkill), "tgkill" },
+[299] = { 2, TF, SEN(utimes), "utimes" },
+[300] = { 4, TD, SEN(fadvise64_64), "fadvise64_64" },
+[301] = { },
+[302] = { 6, TM, SEN(mbind), "mbind" },
+[303] = { 5, TM, SEN(get_mempolicy), "get_mempolicy" },
+[304] = { 3, TM, SEN(set_mempolicy), "set_mempolicy" },
+[305] = { 4, TD, SEN(mq_open), "mq_open" },
+[306] = { 1, 0, SEN(mq_unlink), "mq_unlink" },
+[307] = { 5, TD, SEN(mq_timedsend_time64), "mq_timedsend" },
+[308] = { 5, TD, SEN(mq_timedreceive_time64), "mq_timedreceive" },
+[309] = { 2, TD, SEN(mq_notify), "mq_notify" },
+[310] = { 3, TD, SEN(mq_getsetattr), "mq_getsetattr" },
+[311] = { 4, 0, SEN(kexec_load), "kexec_load" },
+[312] = { 5, TP, SEN(waitid), "waitid" },
+[313] = { 5, 0, SEN(add_key), "add_key" },
+[314] = { 4, 0, SEN(request_key), "request_key" },
+[315] = { 5, 0, SEN(keyctl), "keyctl" },
+[316] = { 3, 0, SEN(ioprio_set), "ioprio_set" },
+[317] = { 2, 0, SEN(ioprio_get), "ioprio_get" },
+[318] = { 0, TD, SEN(inotify_init), "inotify_init" },
+[319] = { 3, TD|TF, SEN(inotify_add_watch), "inotify_add_watch" },
+[320] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" },
+[321] = { },
+[322] = { 4, TM, SEN(migrate_pages), "migrate_pages" },
+[323] = { 4, TD|TF, SEN(openat), "openat" },
+[324] = { 3, TD|TF, SEN(mkdirat), "mkdirat" },
+[325] = { 4, TD|TF, SEN(mknodat), "mknodat" },
+[326] = { 5, TD|TF, SEN(fchownat), "fchownat" },
+[327] = { 3, TD|TF, SEN(futimesat), "futimesat" },
+[328] = { 4, TD|TF|TFST|TSTA,SEN(fstatat64), "fstatat64" },
+[329] = { 3, TD|TF, SEN(unlinkat), "unlinkat" },
+[330] = { 4, TD|TF, SEN(renameat), "renameat" },
+[331] = { 5, TD|TF, SEN(linkat), "linkat" },
+[332] = { 3, TD|TF, SEN(symlinkat), "symlinkat" },
+[333] = { 4, TD|TF, SEN(readlinkat), "readlinkat" },
+[334] = { 3, TD|TF, SEN(fchmodat), "fchmodat" },
+[335] = { 3, TD|TF, SEN(faccessat), "faccessat" },
+[336] = { 6, TD, SEN(pselect6_time64), "pselect6" },
+[337] = { 5, TD, SEN(ppoll_time64), "ppoll" },
+[338] = { 1, 0, SEN(unshare), "unshare" },
+[339] = { 2, 0, SEN(set_robust_list), "set_robust_list" },
+[340] = { 3, 0, SEN(get_robust_list), "get_robust_list" },
+[341] = { 6, TD, SEN(splice), "splice" },
+[342] = { 4, TD, SEN(sync_file_range), "sync_file_range" },
+[343] = { 4, TD, SEN(tee), "tee" },
+[344] = { 4, TD, SEN(vmsplice), "vmsplice" },
+[345] = { 6, TM, SEN(move_pages), "move_pages" },
+[346] = { 3, 0, SEN(getcpu), "getcpu" },
+[347] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" },
+[348] = { 4, TD|TF, SEN(utimensat_time64), "utimensat" },
+[349] = { 3, TD|TS, SEN(signalfd), "signalfd" },
+[350] = { 2, TD, SEN(timerfd_create), "timerfd_create" },
+[351] = { 1, TD, SEN(eventfd), "eventfd" },
+[352] = { 4, TD, SEN(fallocate), "fallocate" },
+[353] = { 4, TD, SEN(timerfd_settime64), "timerfd_settime" },
+[354] = { 2, TD, SEN(timerfd_gettime64), "timerfd_gettime" },
+[355] = { 4, TD|TS, SEN(signalfd4), "signalfd4" },
+[356] = { 2, TD, SEN(eventfd2), "eventfd2" },
+[357] = { 1, TD, SEN(epoll_create1), "epoll_create1" },
+[358] = { 3, TD, SEN(dup3), "dup3" },
+[359] = { 2, TD, SEN(pipe2), "pipe2" },
+[360] = { 1, TD, SEN(inotify_init1), "inotify_init1" },
+[361] = { 4, TD, SEN(preadv), "preadv" },
+[362] = { 4, TD, SEN(pwritev), "pwritev" },
+[363] = { 4, TP|TS, SEN(rt_tgsigqueueinfo), "rt_tgsigqueueinfo" },
+[364] = { 5, TD, SEN(perf_event_open), "perf_event_open" },
+[365] = { 5, TN, SEN(recvmmsg_time64), "recvmmsg" },
+[366] = { 4, TN, SEN(accept4), "accept4" },
+[367] = { 2, TD, SEN(fanotify_init), "fanotify_init" },
+[368] = { 5, TD|TF, SEN(fanotify_mark), "fanotify_mark" },
+[369] = { 4, 0, SEN(prlimit64), "prlimit64" },
+[370] = { 5, TD|TF, SEN(name_to_handle_at), "name_to_handle_at" },
+[371] = { 3, TD, SEN(open_by_handle_at), "open_by_handle_at" },
+[372] = { 2, TCL, SEN(clock_adjtime64), "clock_adjtime" },
+[373] = { 1, TD, SEN(syncfs), "syncfs" },
+[374] = { 4, TN, SEN(sendmmsg), "sendmmsg" },
+[375] = { 2, TD, SEN(setns), "setns" },
+[376] = { 6, 0, SEN(process_vm_readv), "process_vm_readv" },
+[377] = { 6, 0, SEN(process_vm_writev), "process_vm_writev" },
+[378] = { 5, 0, SEN(kcmp), "kcmp" },
+[379] = { 3, TD, SEN(finit_module), "finit_module" },
+[380] = { 3, 0, SEN(sched_setattr), "sched_setattr" },
+[381] = { 4, 0, SEN(sched_getattr), "sched_getattr" },
+[382] = { 5, TD|TF, SEN(renameat2), "renameat2" },
+[383] = { 3, 0, SEN(seccomp), "seccomp" },
+[384] = { 3, 0, SEN(getrandom), "getrandom" },
+[385] = { 2, TD, SEN(memfd_create), "memfd_create" },
+[386] = { 3, TD, SEN(bpf), "bpf" },
+[387] = { 5, TD|TF|TP|TSD|SE|SI, SEN(execveat), "execveat" },
+[388] = { 1, TD, SEN(userfaultfd), "userfaultfd" },
+[389] = { 3, 0, SEN(membarrier), "membarrier" },
+[390] = { 3, TM, SEN(mlock2), "mlock2" },
+[391] = { 6, TD, SEN(copy_file_range), "copy_file_range" },
+[392] = { 6, TD, SEN(preadv2), "preadv2" },
+[393] = { 6, TD, SEN(pwritev2), "pwritev2" },
+/* [403 ... 423] - reserved to sync up with other architectures */
+#include "syscallent-common.h"
+
+#define SYS_socket_subcall 500
+#include "subcall64.h"
diff --git a/src/linux/sh64/userent.h b/src/linux/sh64/userent.h
new file mode 100644
index 000000000..ecff5f63e
--- /dev/null
+++ b/src/linux/sh64/userent.h
@@ -0,0 +1,161 @@
+/*
+ * Copyright (c) 2014-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+{ 0, "PC(L)" },
+{ 4, "PC(U)" },
+{ 8, "SR(L)" },
+{ 12, "SR(U)" },
+{ 16, "syscall no.(L)" },
+{ 20, "syscall_no.(U)" },
+{ 24, "R0(L)" },
+{ 28, "R0(U)" },
+{ 32, "R1(L)" },
+{ 36, "R1(U)" },
+{ 40, "R2(L)" },
+{ 44, "R2(U)" },
+{ 48, "R3(L)" },
+{ 52, "R3(U)" },
+{ 56, "R4(L)" },
+{ 60, "R4(U)" },
+{ 64, "R5(L)" },
+{ 68, "R5(U)" },
+{ 72, "R6(L)" },
+{ 76, "R6(U)" },
+{ 80, "R7(L)" },
+{ 84, "R7(U)" },
+{ 88, "R8(L)" },
+{ 92, "R8(U)" },
+{ 96, "R9(L)" },
+{ 100, "R9(U)" },
+{ 104, "R10(L)" },
+{ 108, "R10(U)" },
+{ 112, "R11(L)" },
+{ 116, "R11(U)" },
+{ 120, "R12(L)" },
+{ 124, "R12(U)" },
+{ 128, "R13(L)" },
+{ 132, "R13(U)" },
+{ 136, "R14(L)" },
+{ 140, "R14(U)" },
+{ 144, "R15(L)" },
+{ 148, "R15(U)" },
+{ 152, "R16(L)" },
+{ 156, "R16(U)" },
+{ 160, "R17(L)" },
+{ 164, "R17(U)" },
+{ 168, "R18(L)" },
+{ 172, "R18(U)" },
+{ 176, "R19(L)" },
+{ 180, "R19(U)" },
+{ 184, "R20(L)" },
+{ 188, "R20(U)" },
+{ 192, "R21(L)" },
+{ 196, "R21(U)" },
+{ 200, "R22(L)" },
+{ 204, "R22(U)" },
+{ 208, "R23(L)" },
+{ 212, "R23(U)" },
+{ 216, "R24(L)" },
+{ 220, "R24(U)" },
+{ 224, "R25(L)" },
+{ 228, "R25(U)" },
+{ 232, "R26(L)" },
+{ 236, "R26(U)" },
+{ 240, "R27(L)" },
+{ 244, "R27(U)" },
+{ 248, "R28(L)" },
+{ 252, "R28(U)" },
+{ 256, "R29(L)" },
+{ 260, "R29(U)" },
+{ 264, "R30(L)" },
+{ 268, "R30(U)" },
+{ 272, "R31(L)" },
+{ 276, "R31(U)" },
+{ 280, "R32(L)" },
+{ 284, "R32(U)" },
+{ 288, "R33(L)" },
+{ 292, "R33(U)" },
+{ 296, "R34(L)" },
+{ 300, "R34(U)" },
+{ 304, "R35(L)" },
+{ 308, "R35(U)" },
+{ 312, "R36(L)" },
+{ 316, "R36(U)" },
+{ 320, "R37(L)" },
+{ 324, "R37(U)" },
+{ 328, "R38(L)" },
+{ 332, "R38(U)" },
+{ 336, "R39(L)" },
+{ 340, "R39(U)" },
+{ 344, "R40(L)" },
+{ 348, "R40(U)" },
+{ 352, "R41(L)" },
+{ 356, "R41(U)" },
+{ 360, "R42(L)" },
+{ 364, "R42(U)" },
+{ 368, "R43(L)" },
+{ 372, "R43(U)" },
+{ 376, "R44(L)" },
+{ 380, "R44(U)" },
+{ 384, "R45(L)" },
+{ 388, "R45(U)" },
+{ 392, "R46(L)" },
+{ 396, "R46(U)" },
+{ 400, "R47(L)" },
+{ 404, "R47(U)" },
+{ 408, "R48(L)" },
+{ 412, "R48(U)" },
+{ 416, "R49(L)" },
+{ 420, "R49(U)" },
+{ 424, "R50(L)" },
+{ 428, "R50(U)" },
+{ 432, "R51(L)" },
+{ 436, "R51(U)" },
+{ 440, "R52(L)" },
+{ 444, "R52(U)" },
+{ 448, "R53(L)" },
+{ 452, "R53(U)" },
+{ 456, "R54(L)" },
+{ 460, "R54(U)" },
+{ 464, "R55(L)" },
+{ 468, "R55(U)" },
+{ 472, "R56(L)" },
+{ 476, "R56(U)" },
+{ 480, "R57(L)" },
+{ 484, "R57(U)" },
+{ 488, "R58(L)" },
+{ 492, "R58(U)" },
+{ 496, "R59(L)" },
+{ 500, "R59(U)" },
+{ 504, "R60(L)" },
+{ 508, "R60(U)" },
+{ 512, "R61(L)" },
+{ 516, "R61(U)" },
+{ 520, "R62(L)" },
+{ 524, "R62(U)" },
+{ 528, "TR0(L)" },
+{ 532, "TR0(U)" },
+{ 536, "TR1(L)" },
+{ 540, "TR1(U)" },
+{ 544, "TR2(L)" },
+{ 548, "TR2(U)" },
+{ 552, "TR3(L)" },
+{ 556, "TR3(U)" },
+{ 560, "TR4(L)" },
+{ 564, "TR4(U)" },
+{ 568, "TR5(L)" },
+{ 572, "TR5(U)" },
+{ 576, "TR6(L)" },
+{ 580, "TR6(U)" },
+{ 584, "TR7(L)" },
+{ 588, "TR7(U)" },
+/* Other fields in "struct user" */
+/* This entry is in case pt_regs contains dregs (depends on
+the kernel build options). */
+XLAT_UOFF(regs),
+XLAT_UOFF(fpu),
+#include "../sh/userent0.h"
diff --git a/src/linux/shuffle_scno.c b/src/linux/shuffle_scno.c
new file mode 100644
index 000000000..dc1633d2f
--- /dev/null
+++ b/src/linux/shuffle_scno.c
@@ -0,0 +1,12 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+kernel_ulong_t
+shuffle_scno(kernel_ulong_t scno)
+{
+ return scno;
+}
diff --git a/src/linux/signal.h.in b/src/linux/signal.h.in
new file mode 100644
index 000000000..44e7ea39e
--- /dev/null
+++ b/src/linux/signal.h.in
@@ -0,0 +1,5 @@
+/*
+ * Workaround the infamous incompatibility between <linux/signal.h>
+ * and many libc headers by overriding <linux/signal.h> with <signal.h>.
+ */
+#include <signal.h>
diff --git a/src/linux/signalent.h b/src/linux/signalent.h
new file mode 100644
index 000000000..b17ea8439
--- /dev/null
+++ b/src/linux/signalent.h
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 1999-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+ "0", /* 0 */
+ "SIGHUP", /* 1 */
+ "SIGINT", /* 2 */
+ "SIGQUIT", /* 3 */
+ "SIGILL", /* 4 */
+ "SIGTRAP", /* 5 */
+ "SIGABRT", /* 6 */
+ "SIGBUS", /* 7 */
+ "SIGFPE", /* 8 */
+ "SIGKILL", /* 9 */
+ "SIGUSR1", /* 10 */
+ "SIGSEGV", /* 11 */
+ "SIGUSR2", /* 12 */
+ "SIGPIPE", /* 13 */
+ "SIGALRM", /* 14 */
+ "SIGTERM", /* 15 */
+ "SIGSTKFLT", /* 16 */
+ "SIGCHLD", /* 17 */
+ "SIGCONT", /* 18 */
+ "SIGSTOP", /* 19 */
+ "SIGTSTP", /* 20 */
+ "SIGTTIN", /* 21 */
+ "SIGTTOU", /* 22 */
+ "SIGURG", /* 23 */
+ "SIGXCPU", /* 24 */
+ "SIGXFSZ", /* 25 */
+ "SIGVTALRM", /* 26 */
+ "SIGPROF", /* 27 */
+ "SIGWINCH", /* 28 */
+ "SIGIO", /* 29 */
+ "SIGPWR", /* 30 */
+ "SIGSYS", /* 31 */
+ "SIGRTMIN", /* 32 */
diff --git a/src/linux/smc_diag.h b/src/linux/smc_diag.h
new file mode 100644
index 000000000..f4bdd7939
--- /dev/null
+++ b/src/linux/smc_diag.h
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 2017-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_LINUX_SMC_DIAG_H
+# define STRACE_LINUX_SMC_DIAG_H
+
+# include <linux/inet_diag.h>
+
+# include "gcc_compat.h"
+
+/* Request structure */
+struct smc_diag_req {
+ uint8_t diag_family;
+ uint8_t pad[2];
+ uint8_t diag_ext; /* Query extended information */
+ struct inet_diag_sockid id;
+};
+
+struct smc_diag_msg {
+ uint8_t diag_family;
+ uint8_t diag_state;
+ union {
+ uint8_t diag_fallback;
+ uint8_t diag_mode;
+ };
+ uint8_t diag_shutdown;
+ struct inet_diag_sockid id;
+
+ uint32_t diag_uid;
+ uint64_t diag_inode;
+};
+
+/* Extensions */
+enum {
+ SMC_DIAG_NONE,
+ SMC_DIAG_CONNINFO,
+ SMC_DIAG_LGRINFO,
+ SMC_DIAG_SHUTDOWN,
+ SMC_DIAG_DMBINFO,
+ SMC_DIAG_FALLBACK,
+};
+
+/* SMC_DIAG_CONNINFO */
+struct smc_diag_cursor {
+ uint16_t reserved;
+ uint16_t wrap;
+ uint32_t count;
+};
+
+struct smc_diag_conninfo {
+ uint32_t token;
+ uint32_t sndbuf_size;
+ uint32_t rmbe_size;
+ uint32_t peer_rmbe_size;
+ struct smc_diag_cursor rx_prod;
+ struct smc_diag_cursor rx_cons;
+ struct smc_diag_cursor tx_prod;
+ struct smc_diag_cursor tx_cons;
+ uint8_t rx_prod_flags;
+ uint8_t rx_conn_state_flags;
+ uint8_t tx_prod_flags;
+ uint8_t tx_conn_state_flags;
+ struct smc_diag_cursor tx_prep;
+ struct smc_diag_cursor tx_sent;
+ struct smc_diag_cursor tx_fin;
+};
+
+/* SMC_DIAG_LINKINFO */
+struct smc_diag_linkinfo {
+ uint8_t link_id;
+ uint8_t ibname[64]; /* IB_DEVICE_NAME_MAX */
+ uint8_t ibport;
+ uint8_t gid[40];
+ uint8_t peer_gid[40];
+};
+
+/* SMC_DIAG_LGRINFO */
+struct smc_diag_lgrinfo {
+ struct smc_diag_linkinfo lnk[1];
+ uint8_t role;
+};
+
+/* SMC_DIAG_DMBINFO */
+struct smcd_diag_dmbinfo {
+ uint32_t linkid;
+ uint64_t ATTRIBUTE_ALIGNED(8) peer_gid;
+ uint64_t ATTRIBUTE_ALIGNED(8) my_gid;
+ uint64_t ATTRIBUTE_ALIGNED(8) token;
+ uint64_t ATTRIBUTE_ALIGNED(8) peer_token;
+};
+
+/* SMC_DIAG_FALLBACK */
+struct smc_diag_fallback {
+ uint32_t reason;
+ uint32_t peer_diagnosis;
+};
+
+#endif /* !STRACE_LINUX_SMC_DIAG_H */
diff --git a/src/linux/sock_diag.h b/src/linux/sock_diag.h
new file mode 100644
index 000000000..50ce15eac
--- /dev/null
+++ b/src/linux/sock_diag.h
@@ -0,0 +1,21 @@
+/*
+ * Copyright (c) 2014-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_LINUX_SOCK_DIAG_H
+# define STRACE_LINUX_SOCK_DIAG_H
+
+# define SOCK_DIAG_BY_FAMILY 20
+# define SOCK_DESTROY 21
+
+# define SK_MEMINFO_VARS 9
+
+struct sock_diag_req {
+ uint8_t sdiag_family;
+ uint8_t sdiag_protocol;
+};
+
+#endif /* !STRACE_LINUX_SOCK_DIAG_H */
diff --git a/src/linux/sparc/arch_defs_.h b/src/linux/sparc/arch_defs_.h
new file mode 100644
index 000000000..184d0010a
--- /dev/null
+++ b/src/linux/sparc/arch_defs_.h
@@ -0,0 +1,13 @@
+/*
+ * Copyright (c) 2018-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#define ARCH_SIZEOF_STRUCT_MSQID64_DS 104
+#define HAVE_ARCH_GETRVAL2 1
+#define HAVE_ARCH_UID16_SYSCALLS 1
+#define HAVE_ARCH_SA_RESTORER 1
+#define HAVE_ARCH_DEDICATED_ERR_REG 1
+#define CAN_ARCH_BE_COMPAT_ON_64BIT_KERNEL 1
diff --git a/src/linux/sparc/arch_getrval2.c b/src/linux/sparc/arch_getrval2.c
new file mode 100644
index 000000000..fd8908bbf
--- /dev/null
+++ b/src/linux/sparc/arch_getrval2.c
@@ -0,0 +1,14 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+long
+getrval2(struct tcb *tcp)
+{
+ if (ptrace_syscall_info_is_valid() && get_regs(tcp) < 0)
+ return -1;
+ return sparc_regs.u_regs[U_REG_O1];
+}
diff --git a/src/linux/sparc/arch_regs.c b/src/linux/sparc/arch_regs.c
new file mode 100644
index 000000000..62d240f71
--- /dev/null
+++ b/src/linux/sparc/arch_regs.c
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static struct pt_regs sparc_regs;
+
+/* Indexes into the pt_regs.u_reg[] array -- UREG_XX from kernel are all off
+ * by 1 and use Ix instead of Ox. These work for both 32 and 64 bit Linux. */
+#define U_REG_G1 0
+#define U_REG_O0 7
+#define U_REG_O1 8
+#define U_REG_FP 13
+
+#define ARCH_REGS_FOR_GETREGS sparc_regs
+#define ARCH_PC_REG sparc_regs.pc
+#define ARCH_SP_REG sparc_regs.u_regs[U_REG_FP]
diff --git a/src/linux/sparc/arch_sigreturn.c b/src/linux/sparc/arch_sigreturn.c
new file mode 100644
index 000000000..11da882d6
--- /dev/null
+++ b/src/linux/sparc/arch_sigreturn.c
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef SIZEOF_STRUCT_SPARC_STACKF
+# define SIZEOF_STRUCT_SPARC_STACKF sizeof(struct sparc_stackf)
+#endif
+#ifndef SIZEOF_STRUCT_PT_REGS
+# define SIZEOF_STRUCT_PT_REGS sizeof(struct pt_regs)
+#endif
+#ifndef PERSONALITY_WORDSIZE
+# define PERSONALITY_WORDSIZE PERSONALITY0_WORDSIZE
+#endif
+
+static void
+arch_sigreturn(struct tcb *tcp)
+{
+ kernel_ulong_t addr;
+ if (!get_stack_pointer(tcp, &addr))
+ return;
+ addr += SIZEOF_STRUCT_SPARC_STACKF + SIZEOF_STRUCT_PT_REGS;
+ struct {
+ unsigned int mask;
+ char fpu_save[PERSONALITY_WORDSIZE];
+ char insns[PERSONALITY_WORDSIZE * 2] ATTRIBUTE_ALIGNED(8);
+ unsigned int extramask[NSIG_BYTES / sizeof(int) - 1];
+ } frame;
+
+ if (!umove_or_printaddr(tcp, addr, &frame)) {
+ unsigned int mask[NSIG_BYTES / sizeof(int)];
+
+ mask[0] = frame.mask;
+ memcpy(mask + 1, frame.extramask, sizeof(frame.extramask));
+ tprintsigmask_addr(mask);
+ }
+}
+
+#undef PERSONALITY_WORDSIZE
+#undef SIZEOF_STRUCT_PT_REGS
+#undef SIZEOF_STRUCT_SPARC_STACKF
diff --git a/src/linux/sparc/errnoent.h b/src/linux/sparc/errnoent.h
new file mode 100644
index 000000000..4e6d471a5
--- /dev/null
+++ b/src/linux/sparc/errnoent.h
@@ -0,0 +1,159 @@
+/*
+ * Copyright (c) 1999-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+[ 1] = "EPERM",
+[ 2] = "ENOENT",
+[ 3] = "ESRCH",
+[ 4] = "EINTR",
+[ 5] = "EIO",
+[ 6] = "ENXIO",
+[ 7] = "E2BIG",
+[ 8] = "ENOEXEC",
+[ 9] = "EBADF",
+[ 10] = "ECHILD",
+[ 11] = "EAGAIN",
+[ 12] = "ENOMEM",
+[ 13] = "EACCES",
+[ 14] = "EFAULT",
+[ 15] = "ENOTBLK",
+[ 16] = "EBUSY",
+[ 17] = "EEXIST",
+[ 18] = "EXDEV",
+[ 19] = "ENODEV",
+[ 20] = "ENOTDIR",
+[ 21] = "EISDIR",
+[ 22] = "EINVAL",
+[ 23] = "ENFILE",
+[ 24] = "EMFILE",
+[ 25] = "ENOTTY",
+[ 26] = "ETXTBSY",
+[ 27] = "EFBIG",
+[ 28] = "ENOSPC",
+[ 29] = "ESPIPE",
+[ 30] = "EROFS",
+[ 31] = "EMLINK",
+[ 32] = "EPIPE",
+[ 33] = "EDOM",
+[ 34] = "ERANGE",
+[ 35] = "EWOULDBLOCK",
+[ 36] = "EINPROGRESS",
+[ 37] = "EALREADY",
+[ 38] = "ENOTSOCK",
+[ 39] = "EDESTADDRREQ",
+[ 40] = "EMSGSIZE",
+[ 41] = "EPROTOTYPE",
+[ 42] = "ENOPROTOOPT",
+[ 43] = "EPROTONOSUPPORT",
+[ 44] = "ESOCKTNOSUPPORT",
+[ 45] = "EOPNOTSUPP",
+[ 46] = "EPFNOSUPPORT",
+[ 47] = "EAFNOSUPPORT",
+[ 48] = "EADDRINUSE",
+[ 49] = "EADDRNOTAVAIL",
+[ 50] = "ENETDOWN",
+[ 51] = "ENETUNREACH",
+[ 52] = "ENETRESET",
+[ 53] = "ECONNABORTED",
+[ 54] = "ECONNRESET",
+[ 55] = "ENOBUFS",
+[ 56] = "EISCONN",
+[ 57] = "ENOTCONN",
+[ 58] = "ESHUTDOWN",
+[ 59] = "ETOOMANYREFS",
+[ 60] = "ETIMEDOUT",
+[ 61] = "ECONNREFUSED",
+[ 62] = "ELOOP",
+[ 63] = "ENAMETOOLONG",
+[ 64] = "EHOSTDOWN",
+[ 65] = "EHOSTUNREACH",
+[ 66] = "ENOTEMPTY",
+[ 67] = "EPROCLIM",
+[ 68] = "EUSERS",
+[ 69] = "EDQUOT",
+[ 70] = "ESTALE",
+[ 71] = "EREMOTE",
+[ 72] = "ENOSTR",
+[ 73] = "ETIME",
+[ 74] = "ENOSR",
+[ 75] = "ENOMSG",
+[ 76] = "EBADMSG",
+[ 77] = "EIDRM",
+[ 78] = "EDEADLK",
+[ 79] = "ENOLCK",
+[ 80] = "ENONET",
+[ 81] = "ERREMOTE",
+[ 82] = "ENOLINK",
+[ 83] = "EADV",
+[ 84] = "ESRMNT",
+[ 85] = "ECOMM",
+[ 86] = "EPROTO",
+[ 87] = "EMULTIHOP",
+[ 88] = "EDOTDOT",
+[ 89] = "EREMCHG",
+[ 90] = "ENOSYS",
+[ 91] = "ESTRPIPE",
+[ 92] = "EOVERFLOW",
+[ 93] = "EBADFD",
+[ 94] = "ECHRNG",
+[ 95] = "EL2NSYNC",
+[ 96] = "EL3HLT",
+[ 97] = "EL3RST",
+[ 98] = "ELNRNG",
+[ 99] = "EUNATCH",
+[100] = "ENOCSI",
+[101] = "EL2HLT",
+[102] = "EBADE",
+[103] = "EBADR",
+[104] = "EXFULL",
+[105] = "ENOANO",
+[106] = "EBADRQC",
+[107] = "EBADSLT",
+[108] = "EDEADLOCK",
+[109] = "EBFONT",
+[110] = "ELIBEXEC",
+[111] = "ENODATA",
+[112] = "ELIBBAD",
+[113] = "ENOPKG",
+[114] = "ELIBACC",
+[115] = "ENOTUNIQ",
+[116] = "ERESTART",
+[117] = "EUCLEAN",
+[118] = "ENOTNAM",
+[119] = "ENAVAIL",
+[120] = "EISNAM",
+[121] = "EREMOTEIO",
+[122] = "EILSEQ",
+[123] = "ELIBMAX",
+[124] = "ELIBSCN",
+[125] = "ENOMEDIUM",
+[126] = "EMEDIUMTYPE",
+[127] = "ECANCELED",
+[128] = "ENOKEY",
+[129] = "EKEYEXPIRED",
+[130] = "EKEYREVOKED",
+[131] = "EKEYREJECTED",
+[132] = "EOWNERDEAD",
+[133] = "ENOTRECOVERABLE",
+[134] = "ERFKILL",
+[135] = "EHWPOISON",
+[512] = "ERESTARTSYS",
+[513] = "ERESTARTNOINTR",
+[514] = "ERESTARTNOHAND",
+[515] = "ENOIOCTLCMD",
+[516] = "ERESTART_RESTARTBLOCK",
+[517] = "EPROBE_DEFER",
+[518] = "EOPENSTALE",
+[521] = "EBADHANDLE",
+[522] = "ENOTSYNC",
+[523] = "EBADCOOKIE",
+[524] = "ENOTSUPP",
+[525] = "ETOOSMALL",
+[526] = "ESERVERFAULT",
+[527] = "EBADTYPE",
+[528] = "EJUKEBOX",
+[529] = "EIOCBQUEUED",
+[530] = "ERECALLCONFLICT",
diff --git a/src/linux/sparc/get_error.c b/src/linux/sparc/get_error.c
new file mode 100644
index 000000000..b3e80c31f
--- /dev/null
+++ b/src/linux/sparc/get_error.c
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include <asm/psr.h>
+
+static void
+arch_get_error(struct tcb *tcp, const bool check_errno)
+{
+ if (sparc_regs.psr & PSR_C) {
+ tcp->u_rval = -1;
+ tcp->u_error = sparc_regs.u_regs[U_REG_O0];
+ } else {
+ tcp->u_rval = sparc_regs.u_regs[U_REG_O0];
+ }
+}
diff --git a/src/linux/sparc/get_scno.c b/src/linux/sparc/get_scno.c
new file mode 100644
index 000000000..b515952a7
--- /dev/null
+++ b/src/linux/sparc/get_scno.c
@@ -0,0 +1,14 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+/* Return codes: 1 - ok, 0 - ignore, other - error. */
+static int
+arch_get_scno(struct tcb *tcp)
+{
+ tcp->scno = sparc_regs.u_regs[U_REG_G1];
+ return 1;
+}
diff --git a/src/linux/sparc/get_syscall_args.c b/src/linux/sparc/get_syscall_args.c
new file mode 100644
index 000000000..96c61c44c
--- /dev/null
+++ b/src/linux/sparc/get_syscall_args.c
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+/* Return -1 on error or 1 on success (never 0!). */
+static int
+arch_get_syscall_args(struct tcb *tcp)
+{
+ tcp->u_arg[0] = sparc_regs.u_regs[U_REG_O0 + 0];
+ tcp->u_arg[1] = sparc_regs.u_regs[U_REG_O0 + 1];
+ tcp->u_arg[2] = sparc_regs.u_regs[U_REG_O0 + 2];
+ tcp->u_arg[3] = sparc_regs.u_regs[U_REG_O0 + 3];
+ tcp->u_arg[4] = sparc_regs.u_regs[U_REG_O0 + 4];
+ tcp->u_arg[5] = sparc_regs.u_regs[U_REG_O0 + 5];
+ return 1;
+}
diff --git a/src/linux/sparc/ioctls_arch0.h b/src/linux/sparc/ioctls_arch0.h
new file mode 100644
index 000000000..5e54ac570
--- /dev/null
+++ b/src/linux/sparc/ioctls_arch0.h
@@ -0,0 +1,122 @@
+/* Generated by ioctls_gen.sh from definitions found in $linux/arch/sparc/include/ tree. */
+{ "asm/apc.h", "APCIOCGBPORT", _IOC_READ, 0x4104, 0x04 },
+{ "asm/apc.h", "APCIOCGCPWR", _IOC_READ, 0x4102, 0x04 },
+{ "asm/apc.h", "APCIOCGFANCTL", _IOC_READ, 0x4100, 0x04 },
+{ "asm/apc.h", "APCIOCSBPORT", _IOC_WRITE, 0x4105, 0x04 },
+{ "asm/apc.h", "APCIOCSCPWR", _IOC_WRITE, 0x4103, 0x04 },
+{ "asm/apc.h", "APCIOCSFANCTL", _IOC_WRITE, 0x4101, 0x04 },
+{ "asm/display7seg.h", "D7SIOCRD", _IOC_READ, 0x7045, 0x04 },
+{ "asm/display7seg.h", "D7SIOCTM", _IOC_NONE, 0x7047, 0x00 },
+{ "asm/display7seg.h", "D7SIOCWR", _IOC_WRITE, 0x7046, 0x04 },
+{ "asm/envctrl.h", "ENVCTRL_RD_CPU_TEMPERATURE", _IOC_READ, 0x7040, 0x04 },
+{ "asm/envctrl.h", "ENVCTRL_RD_CPU_VOLTAGE", _IOC_READ, 0x7041, 0x04 },
+{ "asm/envctrl.h", "ENVCTRL_RD_ETHERNET_TEMPERATURE", _IOC_READ, 0x7047, 0x04 },
+{ "asm/envctrl.h", "ENVCTRL_RD_FAN_STATUS", _IOC_READ, 0x7042, 0x04 },
+{ "asm/envctrl.h", "ENVCTRL_RD_GLOBALADDRESS", _IOC_READ, 0x7049, 0x04 },
+{ "asm/envctrl.h", "ENVCTRL_RD_MTHRBD_TEMPERATURE", _IOC_READ, 0x7048, 0x04 },
+{ "asm/envctrl.h", "ENVCTRL_RD_SCSI_TEMPERATURE", _IOC_READ, 0x7046, 0x04 },
+{ "asm/envctrl.h", "ENVCTRL_RD_SHUTDOWN_TEMPERATURE", _IOC_READ, 0x7044, 0x04 },
+{ "asm/envctrl.h", "ENVCTRL_RD_VOLTAGE_STATUS", _IOC_READ, 0x7045, 0x04 },
+{ "asm/envctrl.h", "ENVCTRL_RD_WARNING_TEMPERATURE", _IOC_READ, 0x7043, 0x04 },
+{ "asm/fbio.h", "FBIOGATTR", _IOC_READ, 0x4606, 0x58 },
+{ "asm/fbio.h", "FBIOGCURMAX", _IOC_READ, 0x461c, 0x04 },
+{ "asm/fbio.h", "FBIOGCURPOS", _IOC_WRITE, 0x461b, 0x04 },
+{ "asm/fbio.h", "FBIOGCURSOR", _IOC_READ|_IOC_WRITE, 0x4619, 0x2c },
+{ "asm/fbio.h", "FBIOGETCMAP", _IOC_WRITE, 0x4604, 0x14 },
+{ "asm/fbio.h", "FBIOGTYPE", _IOC_READ, 0x4600, 0x18 },
+{ "asm/fbio.h", "FBIOGVIDEO", _IOC_READ, 0x4608, 0x04 },
+{ "asm/fbio.h", "FBIOPUTCMAP", _IOC_WRITE, 0x4603, 0x14 },
+{ "asm/fbio.h", "FBIOSATTR", _IOC_WRITE, 0x4605, 0x58 },
+{ "asm/fbio.h", "FBIOSCURPOS", _IOC_WRITE, 0x461a, 0x04 },
+{ "asm/fbio.h", "FBIOSCURSOR", _IOC_WRITE, 0x4618, 0x2c },
+{ "asm/fbio.h", "FBIOSVIDEO", _IOC_WRITE, 0x4607, 0x04 },
+{ "asm/fbio.h", "FBIO_WID_ALLOC", _IOC_READ|_IOC_WRITE, 0x461e, 0x0c },
+{ "asm/fbio.h", "FBIO_WID_FREE", _IOC_WRITE, 0x461f, 0x0c },
+{ "asm/fbio.h", "FBIO_WID_GET", _IOC_READ|_IOC_WRITE, 0x4621, 0x0c },
+{ "asm/fbio.h", "FBIO_WID_PUT", _IOC_WRITE, 0x4620, 0x0c },
+{ "asm/fbio.h", "LEO_CLUTALLOC", _IOC_READ|_IOC_WRITE, 0x4c35, 0x0c },
+{ "asm/fbio.h", "LEO_CLUTFREE", _IOC_WRITE, 0x4c36, 0x0c },
+{ "asm/fbio.h", "LEO_CLUTPOST", _IOC_WRITE, 0x4c38, 0x1c },
+{ "asm/fbio.h", "LEO_CLUTREAD", _IOC_WRITE, 0x4c37, 0x1c },
+{ "asm/fbio.h", "LEO_GETGAMMA", _IOC_READ, 0x4c45, 0x04 },
+{ "asm/fbio.h", "LEO_SETGAMMA", _IOC_WRITE, 0x4c44, 0x04 },
+{ "asm/ioctls.h", "FIOASYNC", _IOC_WRITE, 0x667d, 0x04 },
+{ "asm/ioctls.h", "FIOCLEX", _IOC_NONE, 0x6601, 0x00 },
+{ "asm/ioctls.h", "FIONBIO", _IOC_WRITE, 0x667e, 0x04 },
+{ "asm/ioctls.h", "FIONCLEX", _IOC_NONE, 0x6602, 0x00 },
+{ "asm/ioctls.h", "FIONREAD", _IOC_READ, 0x667f, 0x04 },
+{ "asm/ioctls.h", "FIOQSIZE", _IOC_READ, 0x6680, 0x08 },
+{ "asm/ioctls.h", "TCFLSH", _IOC_NONE, 0x5407, 0x00 },
+{ "asm/ioctls.h", "TCGETA", _IOC_READ, 0x5401, 0x12 },
+{ "asm/ioctls.h", "TCGETS", _IOC_READ, 0x5408, 0x24 },
+{ "asm/ioctls.h", "TCGETS2", _IOC_READ, 0x540c, 0x2c },
+{ "asm/ioctls.h", "TCSBRK", _IOC_NONE, 0x5405, 0x00 },
+{ "asm/ioctls.h", "TCSBRKP", 0, 0x5425, 0 },
+{ "asm/ioctls.h", "TCSETA", _IOC_WRITE, 0x5402, 0x12 },
+{ "asm/ioctls.h", "TCSETAF", _IOC_WRITE, 0x5404, 0x12 },
+{ "asm/ioctls.h", "TCSETAW", _IOC_WRITE, 0x5403, 0x12 },
+{ "asm/ioctls.h", "TCSETS", _IOC_WRITE, 0x5409, 0x24 },
+{ "asm/ioctls.h", "TCSETS2", _IOC_WRITE, 0x540d, 0x2c },
+{ "asm/ioctls.h", "TCSETSF", _IOC_WRITE, 0x540b, 0x24 },
+{ "asm/ioctls.h", "TCSETSF2", _IOC_WRITE, 0x540f, 0x2c },
+{ "asm/ioctls.h", "TCSETSW", _IOC_WRITE, 0x540a, 0x24 },
+{ "asm/ioctls.h", "TCSETSW2", _IOC_WRITE, 0x540e, 0x2c },
+{ "asm/ioctls.h", "TCXONC", _IOC_NONE, 0x5406, 0x00 },
+{ "asm/ioctls.h", "TIOCCBRK", _IOC_NONE, 0x747a, 0x00 },
+{ "asm/ioctls.h", "TIOCCONS", _IOC_NONE, 0x7424, 0x00 },
+{ "asm/ioctls.h", "TIOCEXCL", _IOC_NONE, 0x740d, 0x00 },
+{ "asm/ioctls.h", "TIOCGDEV", _IOC_READ, 0x5432, 0x04 },
+{ "asm/ioctls.h", "TIOCGETD", _IOC_READ, 0x7400, 0x04 },
+{ "asm/ioctls.h", "TIOCGEXCL", _IOC_READ, 0x5440, 0x04 },
+{ "asm/ioctls.h", "TIOCGICOUNT", 0, 0x545D, 0 },
+{ "asm/ioctls.h", "TIOCGLCKTRMIOS", 0, 0x5456, 0 },
+{ "asm/ioctls.h", "TIOCGPGRP", _IOC_READ, 0x7483, 0x04 },
+{ "asm/ioctls.h", "TIOCGPKT", _IOC_READ, 0x5438, 0x04 },
+{ "asm/ioctls.h", "TIOCGPTLCK", _IOC_READ, 0x5439, 0x04 },
+{ "asm/ioctls.h", "TIOCGPTN", _IOC_READ, 0x7486, 0x04 },
+{ "asm/ioctls.h", "TIOCGRS485", _IOC_READ, 0x5441, 0x20 },
+{ "asm/ioctls.h", "TIOCGSERIAL", 0, 0x541E, 0 },
+{ "asm/ioctls.h", "TIOCGSID", _IOC_READ, 0x7485, 0x04 },
+{ "asm/ioctls.h", "TIOCGSOFTCAR", _IOC_READ, 0x7464, 0x04 },
+{ "asm/ioctls.h", "TIOCGWINSZ", _IOC_READ, 0x7468, 0x08 },
+{ "asm/ioctls.h", "TIOCLINUX", 0, 0x541C, 0 },
+{ "asm/ioctls.h", "TIOCMBIC", _IOC_WRITE, 0x746b, 0x04 },
+{ "asm/ioctls.h", "TIOCMBIS", _IOC_WRITE, 0x746c, 0x04 },
+{ "asm/ioctls.h", "TIOCMGET", _IOC_READ, 0x746a, 0x04 },
+{ "asm/ioctls.h", "TIOCMIWAIT", 0, 0x545C, 0 },
+{ "asm/ioctls.h", "TIOCMSET", _IOC_WRITE, 0x746d, 0x04 },
+{ "asm/ioctls.h", "TIOCNOTTY", _IOC_NONE, 0x7471, 0x00 },
+{ "asm/ioctls.h", "TIOCNXCL", _IOC_NONE, 0x740e, 0x00 },
+{ "asm/ioctls.h", "TIOCOUTQ", _IOC_READ, 0x7473, 0x04 },
+{ "asm/ioctls.h", "TIOCPKT", _IOC_WRITE, 0x7470, 0x04 },
+{ "asm/ioctls.h", "TIOCSBRK", _IOC_NONE, 0x747b, 0x00 },
+{ "asm/ioctls.h", "TIOCSCTTY", _IOC_NONE, 0x7484, 0x00 },
+{ "asm/ioctls.h", "TIOCSERCONFIG", 0, 0x5453, 0 },
+{ "asm/ioctls.h", "TIOCSERGETLSR", 0, 0x5459, 0 },
+{ "asm/ioctls.h", "TIOCSERGETMULTI", 0, 0x545A, 0 },
+{ "asm/ioctls.h", "TIOCSERGSTRUCT", 0, 0x5458, 0 },
+{ "asm/ioctls.h", "TIOCSERGWILD", 0, 0x5454, 0 },
+{ "asm/ioctls.h", "TIOCSERSETMULTI", 0, 0x545B, 0 },
+{ "asm/ioctls.h", "TIOCSERSWILD", 0, 0x5455, 0 },
+{ "asm/ioctls.h", "TIOCSETD", _IOC_WRITE, 0x7401, 0x04 },
+{ "asm/ioctls.h", "TIOCSIG", _IOC_WRITE, 0x7488, 0x04 },
+{ "asm/ioctls.h", "TIOCSLCKTRMIOS", 0, 0x5457, 0 },
+{ "asm/ioctls.h", "TIOCSPGRP", _IOC_WRITE, 0x7482, 0x04 },
+{ "asm/ioctls.h", "TIOCSPTLCK", _IOC_WRITE, 0x7487, 0x04 },
+{ "asm/ioctls.h", "TIOCSRS485", _IOC_READ|_IOC_WRITE, 0x5442, 0x20 },
+{ "asm/ioctls.h", "TIOCSSERIAL", 0, 0x541F, 0 },
+{ "asm/ioctls.h", "TIOCSSOFTCAR", _IOC_WRITE, 0x7465, 0x04 },
+{ "asm/ioctls.h", "TIOCSTART", _IOC_NONE, 0x746e, 0x00 },
+{ "asm/ioctls.h", "TIOCSTI", _IOC_WRITE, 0x7472, 0x01 },
+{ "asm/ioctls.h", "TIOCSTOP", _IOC_NONE, 0x746f, 0x00 },
+{ "asm/ioctls.h", "TIOCSWINSZ", _IOC_WRITE, 0x7467, 0x08 },
+{ "asm/ioctls.h", "TIOCVHANGUP", _IOC_NONE, 0x5437, 0x00 },
+{ "asm/openpromio.h", "OPIOCGET", _IOC_READ|_IOC_WRITE, 0x4f01, 0x14 },
+{ "asm/openpromio.h", "OPIOCGETCHILD", _IOC_READ|_IOC_WRITE, 0x4f06, 0x04 },
+{ "asm/openpromio.h", "OPIOCGETNEXT", _IOC_READ|_IOC_WRITE, 0x4f05, 0x04 },
+{ "asm/openpromio.h", "OPIOCGETOPTNODE", _IOC_READ, 0x4f04, 0x04 },
+{ "asm/openpromio.h", "OPIOCNEXTPROP", _IOC_READ|_IOC_WRITE, 0x4f03, 0x14 },
+{ "asm/openpromio.h", "OPIOCSET", _IOC_WRITE, 0x4f02, 0x14 },
+{ "asm/watchdog.h", "WIOCGSTAT", _IOC_READ, 0x570c, 0x04 },
+{ "asm/watchdog.h", "WIOCSTART", _IOC_NONE, 0x570a, 0x00 },
+{ "asm/watchdog.h", "WIOCSTOP", _IOC_NONE, 0x570b, 0x00 },
diff --git a/src/linux/sparc/ioctls_inc0.h b/src/linux/sparc/ioctls_inc0.h
new file mode 100644
index 000000000..4aecf983e
--- /dev/null
+++ b/src/linux/sparc/ioctls_inc0.h
@@ -0,0 +1 @@
+#include "32/ioctls_inc.h"
diff --git a/src/linux/sparc/raw_syscall.h b/src/linux/sparc/raw_syscall.h
new file mode 100644
index 000000000..d4799fde0
--- /dev/null
+++ b/src/linux/sparc/raw_syscall.h
@@ -0,0 +1,38 @@
+/*
+ * Raw syscalls.
+ *
+ * Copyright (c) 2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_RAW_SYSCALL_H
+# define STRACE_RAW_SYSCALL_H
+
+# include "kernel_types.h"
+
+static inline kernel_ulong_t
+raw_syscall_0(const kernel_ulong_t nr, kernel_ulong_t *err)
+{
+ register kernel_ulong_t g1 __asm__("g1") = nr;
+ register kernel_ulong_t rval __asm__("o0");
+ __asm__ __volatile__("ta 0x10\n\t"
+ "bcc 1f\n\t"
+ "mov 0, %0\n\t"
+ "mov 1, %0\n\t"
+ "1:"
+ : "+r"(g1), "=r"(rval)
+ :
+ : "memory", "cc", "f0", "f1", "f2", "f3", "f4",
+ "f5", "f6", "f7", "f8", "f9", "f10", "f11",
+ "f12", "f13", "f14", "f15", "f16", "f17",
+ "f18", "f19", "f20", "f21", "f22", "f23",
+ "f24", "f25", "f26", "f27", "f28", "f29",
+ "f30", "f31");
+ *err = g1;
+ return rval;
+}
+# define raw_syscall_0 raw_syscall_0
+
+#endif /* !STRACE_RAW_SYSCALL_H */
diff --git a/src/linux/sparc/rt_sigframe.h b/src/linux/sparc/rt_sigframe.h
new file mode 100644
index 000000000..5d192b1bc
--- /dev/null
+++ b/src/linux/sparc/rt_sigframe.h
@@ -0,0 +1,25 @@
+/*
+ * Copyright (c) 2017-2018 Dmitry V. Levin <ldv@strace.io>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_RT_SIGFRAME_H
+# define STRACE_RT_SIGFRAME_H
+
+# include "ptrace.h"
+# include <signal.h>
+
+typedef struct {
+ struct sparc_stackf ss;
+ siginfo_t info;
+ struct pt_regs regs;
+ sigset_t mask;
+ /* more data follows */
+} struct_rt_sigframe;
+
+# define OFFSETOF_SIGMASK_IN_RT_SIGFRAME \
+ offsetof(struct_rt_sigframe, mask)
+
+#endif /* !STRACE_RT_SIGFRAME_H */
diff --git a/src/linux/sparc/set_error.c b/src/linux/sparc/set_error.c
new file mode 100644
index 000000000..767be69d3
--- /dev/null
+++ b/src/linux/sparc/set_error.c
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2016-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static int
+sparc_set_o0_psr(struct tcb *tcp, const unsigned long o0,
+ const unsigned long psr_set, const unsigned long psr_clear)
+{
+ sparc_regs.u_regs[U_REG_O0] = o0;
+ sparc_regs.psr |= psr_set;
+ sparc_regs.psr &= ~psr_clear;
+ return set_regs(tcp->pid);
+}
+
+static int
+arch_set_error(struct tcb *tcp)
+{
+ return sparc_set_o0_psr(tcp, tcp->u_error, PSR_C, 0);
+}
+
+static int
+arch_set_success(struct tcb *tcp)
+{
+ return sparc_set_o0_psr(tcp, tcp->u_rval, 0, PSR_C);
+}
diff --git a/src/linux/sparc/set_scno.c b/src/linux/sparc/set_scno.c
new file mode 100644
index 000000000..b5ab93ca9
--- /dev/null
+++ b/src/linux/sparc/set_scno.c
@@ -0,0 +1,20 @@
+/*
+ * Copyright (c) 2016-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+/*
+ * Reloading the syscall number from %g1 register is supported
+ * by linux kernel starting with commit v4.5-rc7~35^2~3.
+ */
+
+static int
+arch_set_scno(struct tcb *tcp, kernel_ulong_t scno)
+{
+ if (ptrace_syscall_info_is_valid() && get_regs(tcp) < 0)
+ return -1;
+ sparc_regs.u_regs[U_REG_G1] = scno;
+ return set_regs(tcp->pid);
+}
diff --git a/src/linux/sparc/signalent.h b/src/linux/sparc/signalent.h
new file mode 100644
index 000000000..7a3a6281a
--- /dev/null
+++ b/src/linux/sparc/signalent.h
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 1999-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+ "0", /* 0 */
+ "SIGHUP", /* 1 */
+ "SIGINT", /* 2 */
+ "SIGQUIT", /* 3 */
+ "SIGILL", /* 4 */
+ "SIGTRAP", /* 5 */
+ "SIGABRT", /* 6 */
+ "SIGEMT", /* 7 */
+ "SIGFPE", /* 8 */
+ "SIGKILL", /* 9 */
+ "SIGBUS", /* 10 */
+ "SIGSEGV", /* 11 */
+ "SIGSYS", /* 12 */
+ "SIGPIPE", /* 13 */
+ "SIGALRM", /* 14 */
+ "SIGTERM", /* 15 */
+ "SIGURG", /* 16 */
+ "SIGSTOP", /* 17 */
+ "SIGTSTP", /* 18 */
+ "SIGCONT", /* 19 */
+ "SIGCHLD", /* 20 */
+ "SIGTTIN", /* 21 */
+ "SIGTTOU", /* 22 */
+ "SIGIO", /* 23 */
+ "SIGXCPU", /* 24 */
+ "SIGXFSZ", /* 25 */
+ "SIGVTALRM", /* 26 */
+ "SIGPROF", /* 27 */
+ "SIGWINCH", /* 28 */
+ "SIGLOST", /* 29 */
+ "SIGUSR1", /* 30 */
+ "SIGUSR2", /* 31 */
+ "SIGRTMIN", /* 32 */
diff --git a/src/linux/sparc/syscallent.h b/src/linux/sparc/syscallent.h
new file mode 100644
index 000000000..e68f48b55
--- /dev/null
+++ b/src/linux/sparc/syscallent.h
@@ -0,0 +1,389 @@
+/*
+ * Copyright (c) 1999-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+[ 0] = { 0, 0, SEN(restart_syscall), "restart_syscall" },
+[ 1] = { 1, TP|SE, SEN(exit), "exit" },
+[ 2] = { 0, TP, SEN(fork), "fork" },
+[ 3] = { 3, TD, SEN(read), "read" },
+[ 4] = { 3, TD, SEN(write), "write" },
+[ 5] = { 3, TD|TF, SEN(open), "open" },
+[ 6] = { 1, TD, SEN(close), "close" },
+[ 7] = { 4, TP, SEN(wait4), "wait4" },
+[ 8] = { 2, TD|TF, SEN(creat), "creat" },
+[ 9] = { 2, TF, SEN(link), "link" },
+[ 10] = { 1, TF, SEN(unlink), "unlink" },
+[ 11] = { 2, TF|TP|TSD|SE|SI, SEN(execv), "execv" },
+[ 12] = { 1, TF, SEN(chdir), "chdir" },
+[ 13] = { 3, TF, SEN(chown16), "chown" },
+[ 14] = { 3, TF, SEN(mknod), "mknod" },
+[ 15] = { 2, TF, SEN(chmod), "chmod" },
+[ 16] = { 3, TF, SEN(chown16), "lchown" },
+[ 17] = { 1, TM|SI, SEN(brk), "brk" },
+[ 18] = { 4, 0, SEN(printargs), "perfctr" },
+[ 19] = { 3, TD, SEN(lseek), "lseek" },
+[ 20] = { 0, PU|NF, SEN(getpid), "getpid" },
+[ 21] = { 2, TC, SEN(capget), "capget" },
+[ 22] = { 2, TC, SEN(capset), "capset" },
+[ 23] = { 1, TC, SEN(setuid16), "setuid" },
+[ 24] = { 0, TC|PU|NF, SEN(getuid16), "getuid" },
+[ 25] = { 4, TD, SEN(vmsplice), "vmsplice" },
+[ 26] = { 4, 0, SEN(ptrace), "ptrace" },
+[ 27] = { 1, 0, SEN(alarm), "alarm" },
+[ 28] = { 2, TS, SEN(sigaltstack), "sigaltstack" },
+[ 29] = { 0, TS, SEN(pause), "pause" },
+[ 30] = { 2, TF, SEN(utime), "utime" },
+[ 31] = { 3, TF, SEN(chown), "lchown32" },
+[ 32] = { 3, TD, SEN(fchown), "fchown32" },
+[ 33] = { 2, TF, SEN(access), "access" },
+[ 34] = { 1, 0, SEN(nice), "nice" },
+[ 35] = { 3, TF, SEN(chown), "chown32" },
+[ 36] = { 0, 0, SEN(sync), "sync" },
+[ 37] = { 2, TS|TP, SEN(kill), "kill" },
+[ 38] = { 2, TF|TST|TSTA, SEN(stat), "stat" },
+[ 39] = { 4, TD|TN, SEN(sendfile), "sendfile" },
+[ 40] = { 2, TF|TLST|TSTA, SEN(lstat), "lstat" },
+[ 41] = { 1, TD, SEN(dup), "dup" },
+[ 42] = { 0, TD, SEN(pipe), "pipe" },
+[ 43] = { 1, 0, SEN(times), "times" },
+[ 44] = { 0, TC|PU|NF, SEN(getuid), "getuid32" },
+[ 45] = { 2, TF, SEN(umount2), "umount2" },
+[ 46] = { 1, TC, SEN(setgid16), "setgid" },
+[ 47] = { 0, TC|PU|NF, SEN(getgid16), "getgid" },
+[ 48] = { 2, TS, SEN(signal), "signal" },
+[ 49] = { 0, TC|PU|NF, SEN(geteuid16), "geteuid" },
+[ 50] = { 0, TC|PU|NF, SEN(getegid16), "getegid" },
+[ 51] = { 1, TF, SEN(acct), "acct" },
+[ 52] = { },
+[ 53] = { 0, TC|PU|NF, SEN(getgid), "getgid32" },
+[ 54] = { 3, TD, SEN(ioctl), "ioctl" },
+[ 55] = { 4, 0, SEN(reboot), "reboot" },
+[ 56] = { 6, TD|TM|SI, SEN(mmap_4koff), "mmap2" },
+[ 57] = { 2, TF, SEN(symlink), "symlink" },
+[ 58] = { 3, TF, SEN(readlink), "readlink" },
+[ 59] = { 3, TF|TP|TSD|SE|SI, SEN(execve), "execve" },
+[ 60] = { 1, NF, SEN(umask), "umask" },
+[ 61] = { 1, TF, SEN(chroot), "chroot" },
+[ 62] = { 2, TD|TFST|TSTA, SEN(fstat), "fstat" },
+[ 63] = { 2, TD|TFST|TSTA, SEN(fstat64), "fstat64" },
+[ 64] = { 0, PU|NF, SEN(getpagesize), "getpagesize" },
+[ 65] = { 3, TM, SEN(msync), "msync" },
+[ 66] = { 0, TP, SEN(vfork), "vfork" },
+[ 67] = { 5, TD, SEN(pread), "pread64" },
+[ 68] = { 5, TD, SEN(pwrite), "pwrite64" },
+[ 69] = { 0, TC|PU|NF, SEN(geteuid), "geteuid32" },
+[ 70] = { 0, TC|PU|NF, SEN(getegid), "getegid32" },
+[ 71] = { 6, TD|TM|SI, SEN(mmap), "mmap" },
+[ 72] = { 2, TC, SEN(setreuid), "setreuid32" },
+[ 73] = { 2, TM|SI, SEN(munmap), "munmap" },
+[ 74] = { 3, TM|SI, SEN(mprotect), "mprotect" },
+[ 75] = { 3, TM, SEN(madvise), "madvise" },
+[ 76] = { 0, 0, SEN(vhangup), "vhangup" },
+[ 77] = { 3, TF, SEN(truncate64), "truncate64" },
+[ 78] = { 3, TM, SEN(mincore), "mincore" },
+[ 79] = { 2, TC, SEN(getgroups16), "getgroups" },
+[ 80] = { 2, TC, SEN(setgroups16), "setgroups" },
+[ 81] = { 0, PU|NF, SEN(getpgrp), "getpgrp" },
+[ 82] = { 2, TC, SEN(setgroups), "setgroups32" },
+[ 83] = { 3, 0, SEN(setitimer), "setitimer" },
+[ 84] = { 3, TD, SEN(ftruncate64), "ftruncate64" },
+[ 85] = { 2, TF, SEN(swapon), "swapon" },
+[ 86] = { 2, 0, SEN(getitimer), "getitimer" },
+[ 87] = { 1, TC, SEN(setuid), "setuid32" },
+[ 88] = { 2, 0, SEN(sethostname), "sethostname" },
+[ 89] = { 1, TC, SEN(setgid), "setgid32" },
+[ 90] = { 2, TD, SEN(dup2), "dup2" },
+[ 91] = { 1, TC|NF, SEN(setfsuid), "setfsuid32" },
+[ 92] = { 3, TD, SEN(fcntl), "fcntl" },
+[ 93] = { 5, TD, SEN(select), "select" },
+[ 94] = { 1, TC|NF, SEN(setfsgid), "setfsgid32" },
+[ 95] = { 1, TD, SEN(fsync), "fsync" },
+[ 96] = { 3, 0, SEN(setpriority), "setpriority" },
+[ 97] = { 3, TN, SEN(socket), "socket" },
+[ 98] = { 3, TN, SEN(connect), "connect" },
+[ 99] = { 3, TN, SEN(accept), "accept" },
+[100] = { 2, 0, SEN(getpriority), "getpriority" },
+[101] = { 0, TS, SEN(rt_sigreturn), "rt_sigreturn" },
+[102] = { 5, TS, SEN(rt_sigaction), "rt_sigaction" },
+[103] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" },
+[104] = { 2, TS, SEN(rt_sigpending), "rt_sigpending" },
+[105] = { 4, TS, SEN(rt_sigtimedwait_time32), "rt_sigtimedwait" },
+[106] = { 3, TS|TP, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" },
+[107] = { 2, TS, SEN(rt_sigsuspend), "rt_sigsuspend" },
+[108] = { 3, TC, SEN(setresuid), "setresuid32" },
+[109] = { 3, TC, SEN(getresuid), "getresuid32" },
+[110] = { 3, TC, SEN(setresgid), "setresgid32" },
+[111] = { 3, TC, SEN(getresgid), "getresgid32" },
+[112] = { 2, TC, SEN(setregid), "setregid32" },
+[113] = { 3, TN, SEN(recvmsg), "recvmsg" },
+[114] = { 3, TN, SEN(sendmsg), "sendmsg" },
+[115] = { 2, TC, SEN(getgroups), "getgroups32" },
+[116] = { 2, TCL, SEN(gettimeofday), "gettimeofday" },
+[117] = { 2, 0, SEN(getrusage), "getrusage" },
+[118] = { 5, TN, SEN(getsockopt), "getsockopt" },
+[119] = { 2, TF, SEN(getcwd), "getcwd" },
+[120] = { 3, TD, SEN(readv), "readv" },
+[121] = { 3, TD, SEN(writev), "writev" },
+[122] = { 2, TCL, SEN(settimeofday), "settimeofday" },
+[123] = { 3, TD, SEN(fchown16), "fchown" },
+[124] = { 2, TD, SEN(fchmod), "fchmod" },
+[125] = { 6, TN, SEN(recvfrom), "recvfrom" },
+[126] = { 2, TC, SEN(setreuid16), "setreuid" },
+[127] = { 2, TC, SEN(setregid16), "setregid" },
+[128] = { 2, TF, SEN(rename), "rename" },
+[129] = { 2, TF, SEN(truncate), "truncate" },
+[130] = { 2, TD, SEN(ftruncate), "ftruncate" },
+[131] = { 2, TD, SEN(flock), "flock" },
+[132] = { 2, TF|TLST|TSTA, SEN(lstat64), "lstat64" },
+[133] = { 6, TN, SEN(sendto), "sendto" },
+[134] = { 2, TN, SEN(shutdown), "shutdown" },
+[135] = { 4, TN, SEN(socketpair), "socketpair" },
+[136] = { 2, TF, SEN(mkdir), "mkdir" },
+[137] = { 1, TF, SEN(rmdir), "rmdir" },
+[138] = { 2, TF, SEN(utimes), "utimes" },
+[139] = { 2, TF|TST|TSTA, SEN(stat64), "stat64" },
+[140] = { 4, TD|TN, SEN(sendfile64), "sendfile64" },
+[141] = { 3, TN, SEN(getpeername), "getpeername" },
+[142] = { 6, 0, SEN(futex_time32), "futex" },
+[143] = { 0, PU|NF, SEN(gettid), "gettid" },
+[144] = { 2, 0, SEN(getrlimit), "getrlimit" },
+[145] = { 2, 0, SEN(setrlimit), "setrlimit" },
+[146] = { 2, TF, SEN(pivotroot), "pivot_root" },
+[147] = { 5, TC, SEN(prctl), "prctl" },
+[148] = { 5, 0, SEN(printargs), "pciconfig_read" },
+[149] = { 5, 0, SEN(printargs), "pciconfig_write" },
+[150] = { 3, TN, SEN(getsockname), "getsockname" },
+[151] = { 0, TD, SEN(inotify_init), "inotify_init" },
+[152] = { 3, TD|TF, SEN(inotify_add_watch), "inotify_add_watch" },
+[153] = { 3, TD, SEN(poll_time32), "poll" },
+[154] = { 3, TD, SEN(getdents64), "getdents64" },
+[155] = { 3, TD, SEN(fcntl64), "fcntl64" },
+[156] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" },
+[157] = { 2, TF|TSF|TSFA, SEN(statfs), "statfs" },
+[158] = { 2, TD|TFSF|TSFA, SEN(fstatfs), "fstatfs" },
+[159] = { 1, TF, SEN(umount), "umount" },
+[160] = { 3, 0, SEN(sched_setaffinity), "sched_set_affinity" },
+[161] = { 3, 0, SEN(sched_getaffinity), "sched_get_affinity" },
+[162] = { 2, 0, SEN(printargs), "getdomainname" },
+[163] = { 2, 0, SEN(setdomainname), "setdomainname" },
+[164] = { },
+[165] = { 4, TF, SEN(quotactl), "quotactl" },
+[166] = { 1, 0, SEN(set_tid_address), "set_tid_address" },
+[167] = { 5, TF, SEN(mount), "mount" },
+[168] = { 2, TSFA, SEN(ustat), "ustat" },
+[169] = { 5, TF, SEN(setxattr), "setxattr" },
+[170] = { 5, TF, SEN(setxattr), "lsetxattr" },
+[171] = { 5, TD, SEN(fsetxattr), "fsetxattr" },
+[172] = { 4, TF, SEN(getxattr), "getxattr" },
+[173] = { 4, TF, SEN(getxattr), "lgetxattr" },
+[174] = { 3, TD, SEN(getdents), "getdents" },
+[175] = { 0, 0, SEN(setsid), "setsid" },
+[176] = { 1, TD, SEN(fchdir), "fchdir" },
+[177] = { 4, TD, SEN(fgetxattr), "fgetxattr" },
+[178] = { 3, TF, SEN(listxattr), "listxattr" },
+[179] = { 3, TF, SEN(listxattr), "llistxattr" },
+[180] = { 3, TD, SEN(flistxattr), "flistxattr" },
+[181] = { 2, TF, SEN(removexattr), "removexattr" },
+[182] = { 2, TF, SEN(removexattr), "lremovexattr" },
+[183] = { 1, TS, SEN(sigpending), "sigpending" },
+[184] = { 5, 0, SEN(query_module), "query_module" },
+[185] = { 2, 0, SEN(setpgid), "setpgid" },
+[186] = { 2, TD, SEN(fremovexattr), "fremovexattr" },
+[187] = { 2, TS|TP, SEN(tkill), "tkill" },
+[188] = { 1, TP|SE, SEN(exit), "exit_group" },
+[189] = { 1, 0, SEN(uname), "uname" },
+[190] = { 3, 0, SEN(init_module), "init_module" },
+[191] = { 1, NF, SEN(personality), "personality" },
+[192] = { 5, TM|SI, SEN(remap_file_pages), "remap_file_pages" },
+[193] = { 1, TD, SEN(epoll_create), "epoll_create" },
+[194] = { 4, TD, SEN(epoll_ctl), "epoll_ctl" },
+[195] = { 4, TD, SEN(epoll_wait), "epoll_wait" },
+[196] = { 3, 0, SEN(ioprio_set), "ioprio_set" },
+[197] = { 0, PU|NF, SEN(getppid), "getppid" },
+[198] = { 3, TS, SEN(sigaction), "sigaction" },
+[199] = { 0, TS, SEN(sgetmask), "sgetmask" },
+[200] = { 1, TS, SEN(ssetmask), "ssetmask" },
+[201] = { 1, TS, SEN(sigsuspend), "sigsuspend" },
+[202] = { 2, TF|TLST|TSTA, SEN(lstat), "oldlstat" },
+[203] = { 1, TF, SEN(uselib), "uselib" },
+[204] = { 3, TD, SEN(readdir), "readdir" },
+[205] = { 4, TD, SEN(readahead), "readahead" },
+[206] = { 2, TD|TSD, SEN(socketcall), "socketcall" },
+[207] = { 3, 0, SEN(syslog), "syslog" },
+[208] = { 4, 0, SEN(lookup_dcookie), "lookup_dcookie" },
+[209] = { 5, TD, SEN(fadvise64), "fadvise64" },
+[210] = { 6, TD, SEN(fadvise64_64), "fadvise64_64" },
+[211] = { 3, TS|TP, SEN(tgkill), "tgkill" },
+[212] = { 3, TP, SEN(waitpid), "waitpid" },
+[213] = { 1, TF, SEN(swapoff), "swapoff" },
+[214] = { 1, 0, SEN(sysinfo), "sysinfo" },
+[215] = { 6, TI|TSD, SEN(ipc), "ipc" },
+[216] = { 0, TS, SEN(sigreturn), "sigreturn" },
+[217] = { 5, TP, SEN(clone), "clone" },
+[218] = { 2, 0, SEN(ioprio_get), "ioprio_get" },
+[219] = { 1, TCL, SEN(adjtimex32), "adjtimex" },
+[220] = { 3, TS, SEN(sigprocmask), "sigprocmask" },
+[221] = { 2, 0, SEN(create_module), "create_module" },
+[222] = { 2, 0, SEN(delete_module), "delete_module" },
+[223] = { 1, 0, SEN(get_kernel_syms), "get_kernel_syms" },
+[224] = { 1, 0, SEN(getpgid), "getpgid" },
+[225] = { 2, 0, SEN(bdflush), "bdflush" },
+[226] = { 3, 0, SEN(sysfs), "sysfs" },
+[227] = { 5, 0, SEN(afs_syscall), "afs_syscall" },
+[228] = { 1, TC|NF, SEN(setfsuid16), "setfsuid" },
+[229] = { 1, TC|NF, SEN(setfsgid16), "setfsgid" },
+[230] = { 5, TD, SEN(select), "_newselect" },
+[231] = { 1, TCL, SEN(time), "time" },
+[232] = { 6, TD, SEN(splice), "splice" },
+[233] = { 1, 0, SEN(stime), "stime" },
+[234] = { 3, TF|TSF|TSFA, SEN(statfs64), "statfs64" },
+[235] = { 3, TD|TFSF|TSFA, SEN(fstatfs64), "fstatfs64" },
+[236] = { 5, TD, SEN(llseek), "_llseek" },
+[237] = { 2, TM, SEN(mlock), "mlock" },
+[238] = { 2, TM, SEN(munlock), "munlock" },
+[239] = { 1, TM, SEN(mlockall), "mlockall" },
+[240] = { 0, TM, SEN(munlockall), "munlockall" },
+[241] = { 2, 0, SEN(sched_setparam), "sched_setparam" },
+[242] = { 2, 0, SEN(sched_getparam), "sched_getparam" },
+[243] = { 3, 0, SEN(sched_setscheduler), "sched_setscheduler" },
+[244] = { 1, 0, SEN(sched_getscheduler), "sched_getscheduler" },
+[245] = { 0, 0, SEN(sched_yield), "sched_yield" },
+[246] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"},
+[247] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"},
+[248] = { 2, 0, SEN(sched_rr_get_interval_time32),"sched_rr_get_interval"},
+[249] = { 2, 0, SEN(nanosleep_time32), "nanosleep" },
+[250] = { 5, TM|SI, SEN(mremap), "mremap" },
+[251] = { 1, 0, SEN(sysctl), "_sysctl" },
+[252] = { 1, 0, SEN(getsid), "getsid" },
+[253] = { 1, TD, SEN(fdatasync), "fdatasync" },
+[254] = { 3, 0, SEN(nfsservctl), "nfsservctl" },
+[255] = { 6, TD, SEN(sync_file_range), "sync_file_range" },
+[256] = { 2, TCL, SEN(clock_settime32), "clock_settime" },
+[257] = { 2, TCL, SEN(clock_gettime32), "clock_gettime" },
+[258] = { 2, TCL, SEN(clock_getres_time32), "clock_getres" },
+[259] = { 4, 0, SEN(clock_nanosleep_time32), "clock_nanosleep" },
+[260] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" },
+[261] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" },
+[262] = { 4, 0, SEN(timer_settime32), "timer_settime" },
+[263] = { 2, 0, SEN(timer_gettime32), "timer_gettime" },
+[264] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" },
+[265] = { 1, 0, SEN(timer_delete), "timer_delete" },
+[266] = { 3, 0, SEN(timer_create), "timer_create" },
+[267] = { 5, 0, SEN(vserver), "vserver" },
+[268] = { 2, TM, SEN(io_setup), "io_setup" },
+[269] = { 1, TM, SEN(io_destroy), "io_destroy" },
+[270] = { 3, 0, SEN(io_submit), "io_submit" },
+[271] = { 3, 0, SEN(io_cancel), "io_cancel" },
+[272] = { 5, 0, SEN(io_getevents_time32), "io_getevents" },
+[273] = { 4, TD, SEN(mq_open), "mq_open" },
+[274] = { 1, 0, SEN(mq_unlink), "mq_unlink" },
+[275] = { 5, TD, SEN(mq_timedsend_time32), "mq_timedsend" },
+[276] = { 5, TD, SEN(mq_timedreceive_time32), "mq_timedreceive" },
+[277] = { 2, TD, SEN(mq_notify), "mq_notify" },
+[278] = { 3, TD, SEN(mq_getsetattr), "mq_getsetattr" },
+[279] = { 5, TP, SEN(waitid), "waitid" },
+[280] = { 4, TD, SEN(tee), "tee" },
+[281] = { 5, 0, SEN(add_key), "add_key" },
+[282] = { 4, 0, SEN(request_key), "request_key" },
+[283] = { 5, 0, SEN(keyctl), "keyctl" },
+[284] = { 4, TD|TF, SEN(openat), "openat" },
+[285] = { 3, TD|TF, SEN(mkdirat), "mkdirat" },
+[286] = { 4, TD|TF, SEN(mknodat), "mknodat" },
+[287] = { 5, TD|TF, SEN(fchownat), "fchownat" },
+[288] = { 3, TD|TF, SEN(futimesat), "futimesat" },
+[289] = { 4, TD|TF|TFST|TSTA,SEN(fstatat64), "fstatat64" },
+[290] = { 3, TD|TF, SEN(unlinkat), "unlinkat" },
+[291] = { 4, TD|TF, SEN(renameat), "renameat" },
+[292] = { 5, TD|TF, SEN(linkat), "linkat" },
+[293] = { 3, TD|TF, SEN(symlinkat), "symlinkat" },
+[294] = { 4, TD|TF, SEN(readlinkat), "readlinkat" },
+[295] = { 3, TD|TF, SEN(fchmodat), "fchmodat" },
+[296] = { 3, TD|TF, SEN(faccessat), "faccessat" },
+[297] = { 6, TD, SEN(pselect6_time32), "pselect6" },
+[298] = { 5, TD, SEN(ppoll_time32), "ppoll" },
+[299] = { 1, 0, SEN(unshare), "unshare" },
+[300] = { 2, 0, SEN(set_robust_list), "set_robust_list" },
+[301] = { 3, 0, SEN(get_robust_list), "get_robust_list" },
+[302] = { 4, TM, SEN(migrate_pages), "migrate_pages" },
+[303] = { 6, TM, SEN(mbind), "mbind" },
+[304] = { 5, TM, SEN(get_mempolicy), "get_mempolicy" },
+[305] = { 3, TM, SEN(set_mempolicy), "set_mempolicy" },
+[306] = { 4, 0, SEN(kexec_load), "kexec_load" },
+[307] = { 6, TM, SEN(move_pages), "move_pages" },
+[308] = { 3, 0, SEN(getcpu), "getcpu" },
+[309] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" },
+[310] = { 4, TD|TF, SEN(utimensat_time32), "utimensat" },
+[311] = { 3, TD|TS, SEN(signalfd), "signalfd" },
+[312] = { 2, TD, SEN(timerfd_create), "timerfd_create" },
+[313] = { 1, TD, SEN(eventfd), "eventfd" },
+[314] = { 6, TD, SEN(fallocate), "fallocate" },
+[315] = { 4, TD, SEN(timerfd_settime32), "timerfd_settime" },
+[316] = { 2, TD, SEN(timerfd_gettime32), "timerfd_gettime" },
+[317] = { 4, TD|TS, SEN(signalfd4), "signalfd4" },
+[318] = { 2, TD, SEN(eventfd2), "eventfd2" },
+[319] = { 1, TD, SEN(epoll_create1), "epoll_create1" },
+[320] = { 3, TD, SEN(dup3), "dup3" },
+[321] = { 2, TD, SEN(pipe2), "pipe2" },
+[322] = { 1, TD, SEN(inotify_init1), "inotify_init1" },
+[323] = { 4, TN, SEN(accept4), "accept4" },
+[324] = { 5, TD, SEN(preadv), "preadv" },
+[325] = { 5, TD, SEN(pwritev), "pwritev" },
+[326] = { 4, TP|TS, SEN(rt_tgsigqueueinfo), "rt_tgsigqueueinfo" },
+[327] = { 5, TD, SEN(perf_event_open), "perf_event_open" },
+[328] = { 5, TN, SEN(recvmmsg_time32), "recvmmsg" },
+[329] = { 2, TD, SEN(fanotify_init), "fanotify_init" },
+[330] = { 6, TD|TF, SEN(fanotify_mark), "fanotify_mark" },
+[331] = { 4, 0, SEN(prlimit64), "prlimit64" },
+[332] = { 5, TD|TF, SEN(name_to_handle_at), "name_to_handle_at" },
+[333] = { 3, TD, SEN(open_by_handle_at), "open_by_handle_at" },
+[334] = { 2, TCL, SEN(clock_adjtime32), "clock_adjtime" },
+[335] = { 1, TD, SEN(syncfs), "syncfs" },
+[336] = { 4, TN, SEN(sendmmsg), "sendmmsg" },
+[337] = { 2, TD, SEN(setns), "setns" },
+[338] = { 6, 0, SEN(process_vm_readv), "process_vm_readv" },
+[339] = { 6, 0, SEN(process_vm_writev), "process_vm_writev" },
+[340] = { 0, PU, SEN(kern_features), "kern_features" },
+[341] = { 5, 0, SEN(kcmp), "kcmp" },
+[342] = { 3, TD, SEN(finit_module), "finit_module" },
+[343] = { 3, 0, SEN(sched_setattr), "sched_setattr" },
+[344] = { 4, 0, SEN(sched_getattr), "sched_getattr" },
+[345] = { 5, TD|TF, SEN(renameat2), "renameat2" },
+[346] = { 3, 0, SEN(seccomp), "seccomp" },
+[347] = { 3, 0, SEN(getrandom), "getrandom" },
+[348] = { 2, TD, SEN(memfd_create), "memfd_create" },
+[349] = { 3, TD, SEN(bpf), "bpf" },
+[350] = { 5, TD|TF|TP|TSD|SE|SI, SEN(execveat), "execveat" },
+[351] = { 3, 0, SEN(membarrier), "membarrier" },
+[352] = { 1, TD, SEN(userfaultfd), "userfaultfd" },
+[353] = { 3, TN, SEN(bind), "bind" },
+[354] = { 2, TN, SEN(listen), "listen" },
+[355] = { 5, TN, SEN(setsockopt), "setsockopt" },
+[356] = { 3, TM, SEN(mlock2), "mlock2" },
+[357] = { 6, TD, SEN(copy_file_range), "copy_file_range" },
+[358] = { 6, TD, SEN(preadv2), "preadv2" },
+[359] = { 6, TD, SEN(pwritev2), "pwritev2" },
+[360] = { 5, TD|TF|TFST|TSTA,SEN(statx), "statx" },
+[361] = { 6, 0, SEN(io_pgetevents_time32), "io_pgetevents" },
+[362] = { 4, TM|SI, SEN(pkey_mprotect), "pkey_mprotect" },
+[363] = { 2, 0, SEN(pkey_alloc), "pkey_alloc" },
+[364] = { 1, 0, SEN(pkey_free), "pkey_free" },
+[365] = { 4, 0, SEN(rseq), "rseq" },
+/* room for arch specific calls */
+[393] = { 3, TI, SEN(semget), "semget" },
+[394] = { 4, TI, SEN(semctl), "semctl" },
+[395] = { 3, TI, SEN(shmget), "shmget" },
+[396] = { 3, TI, SEN(shmctl), "shmctl" },
+[397] = { 3, TI|TM|SI, SEN(shmat), "shmat" },
+[398] = { 1, TI|TM|SI, SEN(shmdt), "shmdt" },
+[399] = { 2, TI, SEN(msgget), "msgget" },
+[400] = { 4, TI, SEN(msgsnd), "msgsnd" },
+[401] = { 5, TI, SEN(msgrcv), "msgrcv" },
+[402] = { 3, TI, SEN(msgctl), "msgctl" },
+#include "syscallent-common-32.h"
+#include "syscallent-common.h"
+
+#define SYS_socket_subcall 500
+#include "subcall32.h"
diff --git a/src/linux/sparc/userent.h b/src/linux/sparc/userent.h
new file mode 100644
index 000000000..f842946b6
--- /dev/null
+++ b/src/linux/sparc/userent.h
@@ -0,0 +1 @@
+#include "../userent0.h"
diff --git a/src/linux/sparc64/arch_defs_.h b/src/linux/sparc64/arch_defs_.h
new file mode 100644
index 000000000..abefb5388
--- /dev/null
+++ b/src/linux/sparc64/arch_defs_.h
@@ -0,0 +1,15 @@
+/*
+ * Copyright (c) 2018-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#define ARCH_M32_SIZEOF_STRUCT_MSQID64_DS 104
+#define HAVE_ARCH_GETRVAL2 1
+#define HAVE_ARCH_UID16_SYSCALLS 1
+#define HAVE_ARCH_SA_RESTORER 1
+#define SUPPORTED_PERSONALITIES 2
+#define PERSONALITY0_AUDIT_ARCH { AUDIT_ARCH_SPARC64, 0 }
+#define PERSONALITY1_AUDIT_ARCH { AUDIT_ARCH_SPARC, 0 }
+#define HAVE_ARCH_DEDICATED_ERR_REG 1
diff --git a/src/linux/sparc64/arch_get_personality.c b/src/linux/sparc64/arch_get_personality.c
new file mode 100644
index 000000000..8366e85de
--- /dev/null
+++ b/src/linux/sparc64/arch_get_personality.c
@@ -0,0 +1,13 @@
+/*
+ * Copyright (c) 2018 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2018-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+int
+get_personality_from_syscall_info(const struct_ptrace_syscall_info *sci)
+{
+ return sci->arch == AUDIT_ARCH_SPARC;
+}
diff --git a/src/linux/sparc64/arch_getrval2.c b/src/linux/sparc64/arch_getrval2.c
new file mode 100644
index 000000000..81f155625
--- /dev/null
+++ b/src/linux/sparc64/arch_getrval2.c
@@ -0,0 +1 @@
+#include "sparc/arch_getrval2.c"
diff --git a/src/linux/sparc64/arch_regs.c b/src/linux/sparc64/arch_regs.c
new file mode 100644
index 000000000..07f0e4055
--- /dev/null
+++ b/src/linux/sparc64/arch_regs.c
@@ -0,0 +1,10 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "sparc/arch_regs.c"
+#undef ARCH_PC_REG
+#define ARCH_PC_REG sparc_regs.tpc
diff --git a/src/linux/sparc64/arch_rt_sigframe.c b/src/linux/sparc64/arch_rt_sigframe.c
new file mode 100644
index 000000000..ef9dc2659
--- /dev/null
+++ b/src/linux/sparc64/arch_rt_sigframe.c
@@ -0,0 +1,17 @@
+/*
+ * Copyright (c) 2017-2018 Dmitry V. Levin <ldv@strace.io>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#define STACK_BIAS 2047
+
+FUNC_GET_RT_SIGFRAME_ADDR
+{
+ kernel_ulong_t sp;
+ if (!get_stack_pointer(tcp, &sp))
+ return 0;
+ return tcp->currpers == 1 ? sp & 0xffffffffUL
+ : sp + STACK_BIAS;
+}
diff --git a/src/linux/sparc64/arch_sigreturn.c b/src/linux/sparc64/arch_sigreturn.c
new file mode 100644
index 000000000..6a9f4c355
--- /dev/null
+++ b/src/linux/sparc64/arch_sigreturn.c
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#define arch_sigreturn sparc64_arch_sigreturn
+#include "sparc/arch_sigreturn.c"
+#undef arch_sigreturn
+
+#define SIZEOF_STRUCT_SPARC_STACKF sizeof(struct sparc_stackf32)
+#define SIZEOF_STRUCT_PT_REGS sizeof(struct pt_regs32)
+#define PERSONALITY_WORDSIZE PERSONALITY1_WORDSIZE
+#define arch_sigreturn sparc32_arch_sigreturn
+#include "sparc/arch_sigreturn.c"
+#undef arch_sigreturn
+
+static void
+arch_sigreturn(struct tcb *tcp)
+{
+ if (current_personality == 1)
+ sparc32_arch_sigreturn(tcp);
+ else
+ sparc64_arch_sigreturn(tcp);
+}
diff --git a/src/linux/sparc64/errnoent.h b/src/linux/sparc64/errnoent.h
new file mode 100644
index 000000000..4ac2b7307
--- /dev/null
+++ b/src/linux/sparc64/errnoent.h
@@ -0,0 +1 @@
+#include "sparc/errnoent.h"
diff --git a/src/linux/sparc64/get_error.c b/src/linux/sparc64/get_error.c
new file mode 100644
index 000000000..f254e2bf1
--- /dev/null
+++ b/src/linux/sparc64/get_error.c
@@ -0,0 +1,17 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static void
+arch_get_error(struct tcb *tcp, const bool check_errno)
+{
+ if (sparc_regs.tstate & 0x1100000000UL) {
+ tcp->u_rval = -1;
+ tcp->u_error = sparc_regs.u_regs[U_REG_O0];
+ } else {
+ tcp->u_rval = sparc_regs.u_regs[U_REG_O0];
+ }
+}
diff --git a/src/linux/sparc64/get_scno.c b/src/linux/sparc64/get_scno.c
new file mode 100644
index 000000000..56ecbce2a
--- /dev/null
+++ b/src/linux/sparc64/get_scno.c
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+/* Return codes: 1 - ok, 0 - ignore, other - error. */
+static int
+arch_get_scno(struct tcb *tcp)
+{
+ /* Retrieve the syscall trap instruction. */
+ unsigned long trap;
+ errno = 0;
+ trap = ptrace(PTRACE_PEEKTEXT, tcp->pid, (void *) sparc_regs.tpc, 0);
+ if (errno == 0) {
+ trap >>= 32;
+ switch (trap) {
+ case 0x91d02010:
+ /* Linux/SPARC syscall trap. */
+ update_personality(tcp, 1);
+ break;
+ case 0x91d0206d:
+ /* Linux/SPARC64 syscall trap. */
+ update_personality(tcp, 0);
+ break;
+ }
+ }
+
+ tcp->scno = sparc_regs.u_regs[U_REG_G1];
+ return 1;
+}
diff --git a/src/linux/sparc64/get_syscall_args.c b/src/linux/sparc64/get_syscall_args.c
new file mode 100644
index 000000000..40a306ce2
--- /dev/null
+++ b/src/linux/sparc64/get_syscall_args.c
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+/* Return -1 on error or 1 on success (never 0!). */
+static int
+arch_get_syscall_args(struct tcb *tcp)
+{
+ if (tcp->currpers == 1) {
+ /*
+ * Zero-extend from 32 bits.
+ * Use truncate_klong_to_current_wordsize(tcp->u_arg[N])
+ * in syscall handlers
+ * if you need to use *sign-extended* parameter.
+ */
+ tcp->u_arg[0] = (uint32_t) sparc_regs.u_regs[U_REG_O0 + 0];
+ tcp->u_arg[1] = (uint32_t) sparc_regs.u_regs[U_REG_O0 + 1];
+ tcp->u_arg[2] = (uint32_t) sparc_regs.u_regs[U_REG_O0 + 2];
+ tcp->u_arg[3] = (uint32_t) sparc_regs.u_regs[U_REG_O0 + 3];
+ tcp->u_arg[4] = (uint32_t) sparc_regs.u_regs[U_REG_O0 + 4];
+ tcp->u_arg[5] = (uint32_t) sparc_regs.u_regs[U_REG_O0 + 5];
+ } else {
+ tcp->u_arg[0] = sparc_regs.u_regs[U_REG_O0 + 0];
+ tcp->u_arg[1] = sparc_regs.u_regs[U_REG_O0 + 1];
+ tcp->u_arg[2] = sparc_regs.u_regs[U_REG_O0 + 2];
+ tcp->u_arg[3] = sparc_regs.u_regs[U_REG_O0 + 3];
+ tcp->u_arg[4] = sparc_regs.u_regs[U_REG_O0 + 4];
+ tcp->u_arg[5] = sparc_regs.u_regs[U_REG_O0 + 5];
+ }
+
+ return 1;
+}
diff --git a/src/linux/sparc64/ioctls_arch0.h b/src/linux/sparc64/ioctls_arch0.h
new file mode 100644
index 000000000..f444ff473
--- /dev/null
+++ b/src/linux/sparc64/ioctls_arch0.h
@@ -0,0 +1,122 @@
+/* Generated by ioctls_gen.sh from definitions found in $linux/arch/sparc/include/ tree. */
+{ "asm/apc.h", "APCIOCGBPORT", _IOC_READ, 0x4104, 0x04 },
+{ "asm/apc.h", "APCIOCGCPWR", _IOC_READ, 0x4102, 0x04 },
+{ "asm/apc.h", "APCIOCGFANCTL", _IOC_READ, 0x4100, 0x04 },
+{ "asm/apc.h", "APCIOCSBPORT", _IOC_WRITE, 0x4105, 0x04 },
+{ "asm/apc.h", "APCIOCSCPWR", _IOC_WRITE, 0x4103, 0x04 },
+{ "asm/apc.h", "APCIOCSFANCTL", _IOC_WRITE, 0x4101, 0x04 },
+{ "asm/display7seg.h", "D7SIOCRD", _IOC_READ, 0x7045, 0x04 },
+{ "asm/display7seg.h", "D7SIOCTM", _IOC_NONE, 0x7047, 0x00 },
+{ "asm/display7seg.h", "D7SIOCWR", _IOC_WRITE, 0x7046, 0x04 },
+{ "asm/envctrl.h", "ENVCTRL_RD_CPU_TEMPERATURE", _IOC_READ, 0x7040, 0x04 },
+{ "asm/envctrl.h", "ENVCTRL_RD_CPU_VOLTAGE", _IOC_READ, 0x7041, 0x04 },
+{ "asm/envctrl.h", "ENVCTRL_RD_ETHERNET_TEMPERATURE", _IOC_READ, 0x7047, 0x04 },
+{ "asm/envctrl.h", "ENVCTRL_RD_FAN_STATUS", _IOC_READ, 0x7042, 0x04 },
+{ "asm/envctrl.h", "ENVCTRL_RD_GLOBALADDRESS", _IOC_READ, 0x7049, 0x04 },
+{ "asm/envctrl.h", "ENVCTRL_RD_MTHRBD_TEMPERATURE", _IOC_READ, 0x7048, 0x04 },
+{ "asm/envctrl.h", "ENVCTRL_RD_SCSI_TEMPERATURE", _IOC_READ, 0x7046, 0x04 },
+{ "asm/envctrl.h", "ENVCTRL_RD_SHUTDOWN_TEMPERATURE", _IOC_READ, 0x7044, 0x04 },
+{ "asm/envctrl.h", "ENVCTRL_RD_VOLTAGE_STATUS", _IOC_READ, 0x7045, 0x04 },
+{ "asm/envctrl.h", "ENVCTRL_RD_WARNING_TEMPERATURE", _IOC_READ, 0x7043, 0x04 },
+{ "asm/fbio.h", "FBIOGATTR", _IOC_READ, 0x4606, 0x58 },
+{ "asm/fbio.h", "FBIOGCURMAX", _IOC_READ, 0x461c, 0x04 },
+{ "asm/fbio.h", "FBIOGCURPOS", _IOC_WRITE, 0x461b, 0x04 },
+{ "asm/fbio.h", "FBIOGCURSOR", _IOC_READ|_IOC_WRITE, 0x4619, 0x48 },
+{ "asm/fbio.h", "FBIOGETCMAP", _IOC_WRITE, 0x4604, 0x20 },
+{ "asm/fbio.h", "FBIOGTYPE", _IOC_READ, 0x4600, 0x18 },
+{ "asm/fbio.h", "FBIOGVIDEO", _IOC_READ, 0x4608, 0x04 },
+{ "asm/fbio.h", "FBIOPUTCMAP", _IOC_WRITE, 0x4603, 0x20 },
+{ "asm/fbio.h", "FBIOSATTR", _IOC_WRITE, 0x4605, 0x58 },
+{ "asm/fbio.h", "FBIOSCURPOS", _IOC_WRITE, 0x461a, 0x04 },
+{ "asm/fbio.h", "FBIOSCURSOR", _IOC_WRITE, 0x4618, 0x48 },
+{ "asm/fbio.h", "FBIOSVIDEO", _IOC_WRITE, 0x4607, 0x04 },
+{ "asm/fbio.h", "FBIO_WID_ALLOC", _IOC_READ|_IOC_WRITE, 0x461e, 0x0c },
+{ "asm/fbio.h", "FBIO_WID_FREE", _IOC_WRITE, 0x461f, 0x0c },
+{ "asm/fbio.h", "FBIO_WID_GET", _IOC_READ|_IOC_WRITE, 0x4621, 0x10 },
+{ "asm/fbio.h", "FBIO_WID_PUT", _IOC_WRITE, 0x4620, 0x10 },
+{ "asm/fbio.h", "LEO_CLUTALLOC", _IOC_READ|_IOC_WRITE, 0x4c35, 0x0c },
+{ "asm/fbio.h", "LEO_CLUTFREE", _IOC_WRITE, 0x4c36, 0x0c },
+{ "asm/fbio.h", "LEO_CLUTPOST", _IOC_WRITE, 0x4c38, 0x28 },
+{ "asm/fbio.h", "LEO_CLUTREAD", _IOC_WRITE, 0x4c37, 0x28 },
+{ "asm/fbio.h", "LEO_GETGAMMA", _IOC_READ, 0x4c45, 0x04 },
+{ "asm/fbio.h", "LEO_SETGAMMA", _IOC_WRITE, 0x4c44, 0x04 },
+{ "asm/ioctls.h", "FIOASYNC", _IOC_WRITE, 0x667d, 0x04 },
+{ "asm/ioctls.h", "FIOCLEX", _IOC_NONE, 0x6601, 0x00 },
+{ "asm/ioctls.h", "FIONBIO", _IOC_WRITE, 0x667e, 0x04 },
+{ "asm/ioctls.h", "FIONCLEX", _IOC_NONE, 0x6602, 0x00 },
+{ "asm/ioctls.h", "FIONREAD", _IOC_READ, 0x667f, 0x04 },
+{ "asm/ioctls.h", "FIOQSIZE", _IOC_READ, 0x6680, 0x08 },
+{ "asm/ioctls.h", "TCFLSH", _IOC_NONE, 0x5407, 0x00 },
+{ "asm/ioctls.h", "TCGETA", _IOC_READ, 0x5401, 0x12 },
+{ "asm/ioctls.h", "TCGETS", _IOC_READ, 0x5408, 0x24 },
+{ "asm/ioctls.h", "TCGETS2", _IOC_READ, 0x540c, 0x2c },
+{ "asm/ioctls.h", "TCSBRK", _IOC_NONE, 0x5405, 0x00 },
+{ "asm/ioctls.h", "TCSBRKP", 0, 0x5425, 0 },
+{ "asm/ioctls.h", "TCSETA", _IOC_WRITE, 0x5402, 0x12 },
+{ "asm/ioctls.h", "TCSETAF", _IOC_WRITE, 0x5404, 0x12 },
+{ "asm/ioctls.h", "TCSETAW", _IOC_WRITE, 0x5403, 0x12 },
+{ "asm/ioctls.h", "TCSETS", _IOC_WRITE, 0x5409, 0x24 },
+{ "asm/ioctls.h", "TCSETS2", _IOC_WRITE, 0x540d, 0x2c },
+{ "asm/ioctls.h", "TCSETSF", _IOC_WRITE, 0x540b, 0x24 },
+{ "asm/ioctls.h", "TCSETSF2", _IOC_WRITE, 0x540f, 0x2c },
+{ "asm/ioctls.h", "TCSETSW", _IOC_WRITE, 0x540a, 0x24 },
+{ "asm/ioctls.h", "TCSETSW2", _IOC_WRITE, 0x540e, 0x2c },
+{ "asm/ioctls.h", "TCXONC", _IOC_NONE, 0x5406, 0x00 },
+{ "asm/ioctls.h", "TIOCCBRK", _IOC_NONE, 0x747a, 0x00 },
+{ "asm/ioctls.h", "TIOCCONS", _IOC_NONE, 0x7424, 0x00 },
+{ "asm/ioctls.h", "TIOCEXCL", _IOC_NONE, 0x740d, 0x00 },
+{ "asm/ioctls.h", "TIOCGDEV", _IOC_READ, 0x5432, 0x04 },
+{ "asm/ioctls.h", "TIOCGETD", _IOC_READ, 0x7400, 0x04 },
+{ "asm/ioctls.h", "TIOCGEXCL", _IOC_READ, 0x5440, 0x04 },
+{ "asm/ioctls.h", "TIOCGICOUNT", 0, 0x545D, 0 },
+{ "asm/ioctls.h", "TIOCGLCKTRMIOS", 0, 0x5456, 0 },
+{ "asm/ioctls.h", "TIOCGPGRP", _IOC_READ, 0x7483, 0x04 },
+{ "asm/ioctls.h", "TIOCGPKT", _IOC_READ, 0x5438, 0x04 },
+{ "asm/ioctls.h", "TIOCGPTLCK", _IOC_READ, 0x5439, 0x04 },
+{ "asm/ioctls.h", "TIOCGPTN", _IOC_READ, 0x7486, 0x04 },
+{ "asm/ioctls.h", "TIOCGRS485", _IOC_READ, 0x5441, 0x20 },
+{ "asm/ioctls.h", "TIOCGSERIAL", 0, 0x541E, 0 },
+{ "asm/ioctls.h", "TIOCGSID", _IOC_READ, 0x7485, 0x04 },
+{ "asm/ioctls.h", "TIOCGSOFTCAR", _IOC_READ, 0x7464, 0x04 },
+{ "asm/ioctls.h", "TIOCGWINSZ", _IOC_READ, 0x7468, 0x08 },
+{ "asm/ioctls.h", "TIOCLINUX", 0, 0x541C, 0 },
+{ "asm/ioctls.h", "TIOCMBIC", _IOC_WRITE, 0x746b, 0x04 },
+{ "asm/ioctls.h", "TIOCMBIS", _IOC_WRITE, 0x746c, 0x04 },
+{ "asm/ioctls.h", "TIOCMGET", _IOC_READ, 0x746a, 0x04 },
+{ "asm/ioctls.h", "TIOCMIWAIT", 0, 0x545C, 0 },
+{ "asm/ioctls.h", "TIOCMSET", _IOC_WRITE, 0x746d, 0x04 },
+{ "asm/ioctls.h", "TIOCNOTTY", _IOC_NONE, 0x7471, 0x00 },
+{ "asm/ioctls.h", "TIOCNXCL", _IOC_NONE, 0x740e, 0x00 },
+{ "asm/ioctls.h", "TIOCOUTQ", _IOC_READ, 0x7473, 0x04 },
+{ "asm/ioctls.h", "TIOCPKT", _IOC_WRITE, 0x7470, 0x04 },
+{ "asm/ioctls.h", "TIOCSBRK", _IOC_NONE, 0x747b, 0x00 },
+{ "asm/ioctls.h", "TIOCSCTTY", _IOC_NONE, 0x7484, 0x00 },
+{ "asm/ioctls.h", "TIOCSERCONFIG", 0, 0x5453, 0 },
+{ "asm/ioctls.h", "TIOCSERGETLSR", 0, 0x5459, 0 },
+{ "asm/ioctls.h", "TIOCSERGETMULTI", 0, 0x545A, 0 },
+{ "asm/ioctls.h", "TIOCSERGSTRUCT", 0, 0x5458, 0 },
+{ "asm/ioctls.h", "TIOCSERGWILD", 0, 0x5454, 0 },
+{ "asm/ioctls.h", "TIOCSERSETMULTI", 0, 0x545B, 0 },
+{ "asm/ioctls.h", "TIOCSERSWILD", 0, 0x5455, 0 },
+{ "asm/ioctls.h", "TIOCSETD", _IOC_WRITE, 0x7401, 0x04 },
+{ "asm/ioctls.h", "TIOCSIG", _IOC_WRITE, 0x7488, 0x04 },
+{ "asm/ioctls.h", "TIOCSLCKTRMIOS", 0, 0x5457, 0 },
+{ "asm/ioctls.h", "TIOCSPGRP", _IOC_WRITE, 0x7482, 0x04 },
+{ "asm/ioctls.h", "TIOCSPTLCK", _IOC_WRITE, 0x7487, 0x04 },
+{ "asm/ioctls.h", "TIOCSRS485", _IOC_READ|_IOC_WRITE, 0x5442, 0x20 },
+{ "asm/ioctls.h", "TIOCSSERIAL", 0, 0x541F, 0 },
+{ "asm/ioctls.h", "TIOCSSOFTCAR", _IOC_WRITE, 0x7465, 0x04 },
+{ "asm/ioctls.h", "TIOCSTART", _IOC_NONE, 0x746e, 0x00 },
+{ "asm/ioctls.h", "TIOCSTI", _IOC_WRITE, 0x7472, 0x01 },
+{ "asm/ioctls.h", "TIOCSTOP", _IOC_NONE, 0x746f, 0x00 },
+{ "asm/ioctls.h", "TIOCSWINSZ", _IOC_WRITE, 0x7467, 0x08 },
+{ "asm/ioctls.h", "TIOCVHANGUP", _IOC_NONE, 0x5437, 0x00 },
+{ "asm/openpromio.h", "OPIOCGET", _IOC_READ|_IOC_WRITE, 0x4f01, 0x20 },
+{ "asm/openpromio.h", "OPIOCGETCHILD", _IOC_READ|_IOC_WRITE, 0x4f06, 0x04 },
+{ "asm/openpromio.h", "OPIOCGETNEXT", _IOC_READ|_IOC_WRITE, 0x4f05, 0x04 },
+{ "asm/openpromio.h", "OPIOCGETOPTNODE", _IOC_READ, 0x4f04, 0x04 },
+{ "asm/openpromio.h", "OPIOCNEXTPROP", _IOC_READ|_IOC_WRITE, 0x4f03, 0x20 },
+{ "asm/openpromio.h", "OPIOCSET", _IOC_WRITE, 0x4f02, 0x20 },
+{ "asm/watchdog.h", "WIOCGSTAT", _IOC_READ, 0x570c, 0x04 },
+{ "asm/watchdog.h", "WIOCSTART", _IOC_NONE, 0x570a, 0x00 },
+{ "asm/watchdog.h", "WIOCSTOP", _IOC_NONE, 0x570b, 0x00 },
diff --git a/src/linux/sparc64/ioctls_arch1.h b/src/linux/sparc64/ioctls_arch1.h
new file mode 100644
index 000000000..96bd895fd
--- /dev/null
+++ b/src/linux/sparc64/ioctls_arch1.h
@@ -0,0 +1 @@
+#include "sparc/ioctls_arch0.h"
diff --git a/src/linux/sparc64/ioctls_inc0.h b/src/linux/sparc64/ioctls_inc0.h
new file mode 100644
index 000000000..f9939faa4
--- /dev/null
+++ b/src/linux/sparc64/ioctls_inc0.h
@@ -0,0 +1 @@
+#include "64/ioctls_inc.h"
diff --git a/src/linux/sparc64/ioctls_inc1.h b/src/linux/sparc64/ioctls_inc1.h
new file mode 100644
index 000000000..63b70e437
--- /dev/null
+++ b/src/linux/sparc64/ioctls_inc1.h
@@ -0,0 +1 @@
+#include "sparc/ioctls_inc0.h"
diff --git a/src/linux/sparc64/raw_syscall.h b/src/linux/sparc64/raw_syscall.h
new file mode 100644
index 000000000..efb732772
--- /dev/null
+++ b/src/linux/sparc64/raw_syscall.h
@@ -0,0 +1,40 @@
+/*
+ * Raw syscalls.
+ *
+ * Copyright (c) 2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_RAW_SYSCALL_H
+# define STRACE_RAW_SYSCALL_H
+
+# include "kernel_types.h"
+
+static inline kernel_ulong_t
+raw_syscall_0(const kernel_ulong_t nr, kernel_ulong_t *err)
+{
+ register kernel_ulong_t g1 __asm__("g1") = nr;
+ register kernel_ulong_t rval __asm__("o0");
+ __asm__ __volatile__("ta 0x6d\n\t"
+ "bcc,pt %%xcc, 1f\n\t"
+ "mov 0, %0\n\t"
+ "mov 1, %0\n\t"
+ "1:"
+ : "+r"(g1), "=r"(rval)
+ :
+ : "memory", "cc", "f0", "f1", "f2", "f3", "f4",
+ "f5", "f6", "f7", "f8", "f9", "f10", "f11",
+ "f12", "f13", "f14", "f15", "f16", "f17",
+ "f18", "f19", "f20", "f21", "f22", "f23",
+ "f24", "f25", "f26", "f27", "f28", "f29",
+ "f30", "f31", "f32", "f34", "f36", "f38",
+ "f40", "f42", "f44", "f46", "f48", "f50",
+ "f52", "f54", "f56", "f58", "f60", "f62");
+ *err = g1;
+ return rval;
+}
+# define raw_syscall_0 raw_syscall_0
+
+#endif /* !STRACE_RAW_SYSCALL_H */
diff --git a/src/linux/sparc64/rt_sigframe.h b/src/linux/sparc64/rt_sigframe.h
new file mode 100644
index 000000000..22418d14d
--- /dev/null
+++ b/src/linux/sparc64/rt_sigframe.h
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2017-2018 Dmitry V. Levin <ldv@strace.io>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef __arch64__
+# include "sparc/rt_sigframe.h"
+#else
+# ifndef STRACE_RT_SIGFRAME_H
+# define STRACE_RT_SIGFRAME_H
+
+# include "ptrace.h"
+# include <signal.h>
+
+typedef struct {
+ struct sparc_stackf ss;
+ siginfo_t info;
+ struct pt_regs regs;
+ void *fpu_save;
+ stack_t stack;
+ sigset_t mask;
+ /* more data follows */
+} struct_rt_sigframe;
+
+# define OFFSETOF_SIGMASK_IN_RT_SIGFRAME \
+ offsetof(struct_rt_sigframe, mask)
+
+# endif /* !STRACE_RT_SIGFRAME_H */
+#endif /* __arch64__ */
diff --git a/src/linux/sparc64/set_error.c b/src/linux/sparc64/set_error.c
new file mode 100644
index 000000000..69778e573
--- /dev/null
+++ b/src/linux/sparc64/set_error.c
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2016-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static int
+sparc64_set_o0_tstate(struct tcb *tcp, const unsigned long o0,
+ const unsigned long tstate_set,
+ const unsigned long tstate_clear)
+{
+ sparc_regs.u_regs[U_REG_O0] = o0;
+ sparc_regs.tstate |= tstate_set;
+ sparc_regs.tstate &= ~tstate_clear;
+ return set_regs(tcp->pid);
+}
+
+static int
+arch_set_error(struct tcb *tcp)
+{
+ return sparc64_set_o0_tstate(tcp, tcp->u_error, 0x1100000000UL, 0);
+}
+
+static int
+arch_set_success(struct tcb *tcp)
+{
+ return sparc64_set_o0_tstate(tcp, tcp->u_rval, 0, 0x1100000000UL);
+}
diff --git a/src/linux/sparc64/set_scno.c b/src/linux/sparc64/set_scno.c
new file mode 100644
index 000000000..ae57cdfbd
--- /dev/null
+++ b/src/linux/sparc64/set_scno.c
@@ -0,0 +1 @@
+#include "sparc/set_scno.c"
diff --git a/src/linux/sparc64/signalent.h b/src/linux/sparc64/signalent.h
new file mode 100644
index 000000000..b4c6c15c1
--- /dev/null
+++ b/src/linux/sparc64/signalent.h
@@ -0,0 +1 @@
+#include "sparc/signalent.h"
diff --git a/src/linux/sparc64/syscallent.h b/src/linux/sparc64/syscallent.h
new file mode 100644
index 000000000..1a85c46ad
--- /dev/null
+++ b/src/linux/sparc64/syscallent.h
@@ -0,0 +1,388 @@
+/*
+ * Copyright (c) 2004-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+[ 0] = { 0, 0, SEN(restart_syscall), "restart_syscall" },
+[ 1] = { 1, TP|SE, SEN(exit), "exit" },
+[ 2] = { 0, TP, SEN(fork), "fork" },
+[ 3] = { 3, TD, SEN(read), "read" },
+[ 4] = { 3, TD, SEN(write), "write" },
+[ 5] = { 3, TD|TF, SEN(open), "open" },
+[ 6] = { 1, TD, SEN(close), "close" },
+[ 7] = { 4, TP, SEN(wait4), "wait4" },
+[ 8] = { 2, TD|TF, SEN(creat), "creat" },
+[ 9] = { 2, TF, SEN(link), "link" },
+[ 10] = { 1, TF, SEN(unlink), "unlink" },
+[ 11] = { 2, TF|TP|TSD|SE|SI, SEN(execv), "execv" },
+[ 12] = { 1, TF, SEN(chdir), "chdir" },
+[ 13] = { 3, TF, SEN(chown), "chown" },
+[ 14] = { 3, TF, SEN(mknod), "mknod" },
+[ 15] = { 2, TF, SEN(chmod), "chmod" },
+[ 16] = { 3, TF, SEN(chown), "lchown" },
+[ 17] = { 1, TM|SI, SEN(brk), "brk" },
+[ 18] = { 4, 0, SEN(printargs), "perfctr" },
+[ 19] = { 3, TD, SEN(lseek), "lseek" },
+[ 20] = { 0, PU|NF, SEN(getpid), "getpid" },
+[ 21] = { 2, TC, SEN(capget), "capget" },
+[ 22] = { 2, TC, SEN(capset), "capset" },
+[ 23] = { 1, TC, SEN(setuid), "setuid" },
+[ 24] = { 0, TC|PU|NF, SEN(getuid), "getuid" },
+[ 25] = { 4, TD, SEN(vmsplice), "vmsplice" },
+[ 26] = { 4, 0, SEN(ptrace), "ptrace" },
+[ 27] = { 1, 0, SEN(alarm), "alarm" },
+[ 28] = { 2, TS, SEN(sigaltstack), "sigaltstack" },
+[ 29] = { 0, TS, SEN(pause), "pause" },
+[ 30] = { 2, TF, SEN(utime), "utime" },
+[ 31 ... 32] = { },
+[ 33] = { 2, TF, SEN(access), "access" },
+[ 34] = { 1, 0, SEN(nice), "nice" },
+[ 35] = { },
+[ 36] = { 0, 0, SEN(sync), "sync" },
+[ 37] = { 2, TS|TP, SEN(kill), "kill" },
+[ 38] = { 2, TF|TST|TSTA, SEN(stat), "stat" },
+[ 39] = { 4, TD|TN, SEN(sendfile), "sendfile" },
+[ 40] = { 2, TF|TLST|TSTA, SEN(lstat), "lstat" },
+[ 41] = { 1, TD, SEN(dup), "dup" },
+[ 42] = { 0, TD, SEN(pipe), "pipe" },
+[ 43] = { 1, 0, SEN(times), "times" },
+[ 44] = { },
+[ 45] = { 2, TF, SEN(umount2), "umount2" },
+[ 46] = { 1, TC, SEN(setgid), "setgid" },
+[ 47] = { 0, TC|PU|NF, SEN(getgid), "getgid" },
+[ 48] = { 2, TS, SEN(signal), "signal" },
+[ 49] = { 0, TC|PU|NF, SEN(geteuid), "geteuid" },
+[ 50] = { 0, TC|PU|NF, SEN(getegid), "getegid" },
+[ 51] = { 1, TF, SEN(acct), "acct" },
+[ 52] = { 2, 0, SEN(printargs), "memory_ordering" },
+[ 53] = { },
+[ 54] = { 3, TD, SEN(ioctl), "ioctl" },
+[ 55] = { 4, 0, SEN(reboot), "reboot" },
+[ 56] = { },
+[ 57] = { 2, TF, SEN(symlink), "symlink" },
+[ 58] = { 3, TF, SEN(readlink), "readlink" },
+[ 59] = { 3, TF|TP|TSD|SE|SI, SEN(execve), "execve" },
+[ 60] = { 1, NF, SEN(umask), "umask" },
+[ 61] = { 1, TF, SEN(chroot), "chroot" },
+[ 62] = { 2, TD|TFST|TSTA, SEN(fstat), "fstat" },
+[ 63] = { 2, TD|TFST|TSTA, SEN(fstat64), "fstat64" },
+[ 64] = { 0, PU|NF, SEN(getpagesize), "getpagesize" },
+[ 65] = { 3, TM, SEN(msync), "msync" },
+[ 66] = { 0, TP, SEN(vfork), "vfork" },
+[ 67] = { 4, TD, SEN(pread), "pread64" },
+[ 68] = { 4, TD, SEN(pwrite), "pwrite64" },
+[ 69 ... 70] = { },
+[ 71] = { 6, TD|TM|SI, SEN(mmap), "mmap" },
+[ 72] = { },
+[ 73] = { 2, TM|SI, SEN(munmap), "munmap" },
+[ 74] = { 3, TM|SI, SEN(mprotect), "mprotect" },
+[ 75] = { 3, TM, SEN(madvise), "madvise" },
+[ 76] = { 0, 0, SEN(vhangup), "vhangup" },
+[ 77] = { },
+[ 78] = { 3, TM, SEN(mincore), "mincore" },
+[ 79] = { 2, TC, SEN(getgroups), "getgroups" },
+[ 80] = { 2, TC, SEN(setgroups), "setgroups" },
+[ 81] = { 0, PU|NF, SEN(getpgrp), "getpgrp" },
+[ 82] = { },
+[ 83] = { 3, 0, SEN(setitimer), "setitimer" },
+[ 84] = { },
+[ 85] = { 2, TF, SEN(swapon), "swapon" },
+[ 86] = { 2, 0, SEN(getitimer), "getitimer" },
+[ 87] = { },
+[ 88] = { 2, 0, SEN(sethostname), "sethostname" },
+[ 89] = { },
+[ 90] = { 2, TD, SEN(dup2), "dup2" },
+[ 91] = { },
+[ 92] = { 3, TD, SEN(fcntl), "fcntl" },
+[ 93] = { 5, TD, SEN(select), "select" },
+[ 94] = { },
+[ 95] = { 1, TD, SEN(fsync), "fsync" },
+[ 96] = { 3, 0, SEN(setpriority), "setpriority" },
+[ 97] = { 3, TN, SEN(socket), "socket" },
+[ 98] = { 3, TN, SEN(connect), "connect" },
+[ 99] = { 3, TN, SEN(accept), "accept" },
+[100] = { 2, 0, SEN(getpriority), "getpriority" },
+[101] = { 0, TS, SEN(rt_sigreturn), "rt_sigreturn" },
+[102] = { 5, TS, SEN(rt_sigaction), "rt_sigaction" },
+[103] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" },
+[104] = { 2, TS, SEN(rt_sigpending), "rt_sigpending" },
+[105] = { 4, TS, SEN(rt_sigtimedwait_time64), "rt_sigtimedwait" },
+[106] = { 3, TS|TP, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" },
+[107] = { 2, TS, SEN(rt_sigsuspend), "rt_sigsuspend" },
+[108] = { 3, TC, SEN(setresuid), "setresuid" },
+[109] = { 3, TC, SEN(getresuid), "getresuid" },
+[110] = { 3, TC, SEN(setresgid), "setresgid" },
+[111] = { 3, TC, SEN(getresgid), "getresgid" },
+[112] = { },
+[113] = { 3, TN, SEN(recvmsg), "recvmsg" },
+[114] = { 3, TN, SEN(sendmsg), "sendmsg" },
+[115] = { },
+[116] = { 2, TCL, SEN(gettimeofday), "gettimeofday" },
+[117] = { 2, 0, SEN(getrusage), "getrusage" },
+[118] = { 5, TN, SEN(getsockopt), "getsockopt" },
+[119] = { 2, TF, SEN(getcwd), "getcwd" },
+[120] = { 3, TD, SEN(readv), "readv" },
+[121] = { 3, TD, SEN(writev), "writev" },
+[122] = { 2, TCL, SEN(settimeofday), "settimeofday" },
+[123] = { 3, TD, SEN(fchown), "fchown" },
+[124] = { 2, TD, SEN(fchmod), "fchmod" },
+[125] = { 6, TN, SEN(recvfrom), "recvfrom" },
+[126] = { 2, TC, SEN(setreuid), "setreuid" },
+[127] = { 2, TC, SEN(setregid), "setregid" },
+[128] = { 2, TF, SEN(rename), "rename" },
+[129] = { 2, TF, SEN(truncate), "truncate" },
+[130] = { 2, TD, SEN(ftruncate), "ftruncate" },
+[131] = { 2, TD, SEN(flock), "flock" },
+[132] = { 2, TF|TLST|TSTA, SEN(lstat64), "lstat64" },
+[133] = { 6, TN, SEN(sendto), "sendto" },
+[134] = { 2, TN, SEN(shutdown), "shutdown" },
+[135] = { 4, TN, SEN(socketpair), "socketpair" },
+[136] = { 2, TF, SEN(mkdir), "mkdir" },
+[137] = { 1, TF, SEN(rmdir), "rmdir" },
+[138] = { 2, TF, SEN(utimes), "utimes" },
+[139] = { 2, TF|TST|TSTA, SEN(stat64), "stat64" },
+[140] = { 4, TD|TN, SEN(sendfile64), "sendfile64" },
+[141] = { 3, TN, SEN(getpeername), "getpeername" },
+[142] = { 6, 0, SEN(futex_time64), "futex" },
+[143] = { 0, PU|NF, SEN(gettid), "gettid" },
+[144] = { 2, 0, SEN(getrlimit), "getrlimit" },
+[145] = { 2, 0, SEN(setrlimit), "setrlimit" },
+[146] = { 2, TF, SEN(pivotroot), "pivot_root" },
+[147] = { 5, TC, SEN(prctl), "prctl" },
+[148] = { 5, 0, SEN(printargs), "pciconfig_read" },
+[149] = { 5, 0, SEN(printargs), "pciconfig_write" },
+[150] = { 3, TN, SEN(getsockname), "getsockname" },
+[151] = { 0, TD, SEN(inotify_init), "inotify_init" },
+[152] = { 3, TD|TF, SEN(inotify_add_watch), "inotify_add_watch" },
+[153] = { 3, TD, SEN(poll_time64), "poll" },
+[154] = { 3, TD, SEN(getdents64), "getdents64" },
+[155] = { },
+[156] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" },
+[157] = { 2, TF|TSF|TSFA, SEN(statfs), "statfs" },
+[158] = { 2, TD|TFSF|TSFA, SEN(fstatfs), "fstatfs" },
+[159] = { 1, TF, SEN(umount), "umount" },
+[160] = { 3, 0, SEN(sched_setaffinity), "sched_set_affinity" },
+[161] = { 3, 0, SEN(sched_getaffinity), "sched_get_affinity" },
+[162] = { 2, 0, SEN(printargs), "getdomainname" },
+[163] = { 2, 0, SEN(setdomainname), "setdomainname" },
+[164] = { 5, 0, SEN(printargs), "utrap_install" },
+[165] = { 4, TF, SEN(quotactl), "quotactl" },
+[166] = { 1, 0, SEN(set_tid_address), "set_tid_address" },
+[167] = { 5, TF, SEN(mount), "mount" },
+[168] = { 2, TSFA, SEN(ustat), "ustat" },
+[169] = { 5, TF, SEN(setxattr), "setxattr" },
+[170] = { 5, TF, SEN(setxattr), "lsetxattr" },
+[171] = { 5, TD, SEN(fsetxattr), "fsetxattr" },
+[172] = { 4, TF, SEN(getxattr), "getxattr" },
+[173] = { 4, TF, SEN(getxattr), "lgetxattr" },
+[174] = { 3, TD, SEN(getdents), "getdents" },
+[175] = { 0, 0, SEN(setsid), "setsid" },
+[176] = { 1, TD, SEN(fchdir), "fchdir" },
+[177] = { 4, TD, SEN(fgetxattr), "fgetxattr" },
+[178] = { 3, TF, SEN(listxattr), "listxattr" },
+[179] = { 3, TF, SEN(listxattr), "llistxattr" },
+[180] = { 3, TD, SEN(flistxattr), "flistxattr" },
+[181] = { 2, TF, SEN(removexattr), "removexattr" },
+[182] = { 2, TF, SEN(removexattr), "lremovexattr" },
+[183] = { 1, TS, SEN(sigpending), "sigpending" },
+[184] = { 5, 0, SEN(query_module), "query_module" },
+[185] = { 2, 0, SEN(setpgid), "setpgid" },
+[186] = { 2, TD, SEN(fremovexattr), "fremovexattr" },
+[187] = { 2, TS|TP, SEN(tkill), "tkill" },
+[188] = { 1, TP|SE, SEN(exit), "exit_group" },
+[189] = { 1, 0, SEN(uname), "uname" },
+[190] = { 3, 0, SEN(init_module), "init_module" },
+[191] = { 1, NF, SEN(personality), "personality" },
+[192] = { 5, TM|SI, SEN(remap_file_pages), "remap_file_pages" },
+[193] = { 1, TD, SEN(epoll_create), "epoll_create" },
+[194] = { 4, TD, SEN(epoll_ctl), "epoll_ctl" },
+[195] = { 4, TD, SEN(epoll_wait), "epoll_wait" },
+[196] = { 3, 0, SEN(ioprio_set), "ioprio_set" },
+[197] = { 0, PU|NF, SEN(getppid), "getppid" },
+[198] = { 3, TS, SEN(sigaction), "sigaction" },
+[199] = { 0, TS, SEN(sgetmask), "sgetmask" },
+[200] = { 1, TS, SEN(ssetmask), "ssetmask" },
+[201] = { 1, TS, SEN(sigsuspend), "sigsuspend" },
+[202] = { 2, TF|TLST|TSTA, SEN(lstat), "oldlstat" },
+[203] = { 1, TF, SEN(uselib), "uselib" },
+[204] = { 3, TD, SEN(readdir), "readdir" },
+[205] = { 3, TD, SEN(readahead), "readahead" },
+[206] = { 2, TD|TSD, SEN(socketcall), "socketcall" },
+[207] = { 3, 0, SEN(syslog), "syslog" },
+[208] = { 3, 0, SEN(lookup_dcookie), "lookup_dcookie" },
+[209] = { 4, TD, SEN(fadvise64), "fadvise64" },
+[210] = { 4, TD, SEN(fadvise64_64), "fadvise64_64" },
+[211] = { 3, TS|TP, SEN(tgkill), "tgkill" },
+[212] = { 3, TP, SEN(waitpid), "waitpid" },
+[213] = { 1, TF, SEN(swapoff), "swapoff" },
+[214] = { 1, 0, SEN(sysinfo), "sysinfo" },
+[215] = { 6, TI|TSD, SEN(ipc), "ipc" },
+[216] = { 0, TS, SEN(sigreturn), "sigreturn" },
+[217] = { 5, TP, SEN(clone), "clone" },
+[218] = { 2, 0, SEN(ioprio_get), "ioprio_get" },
+[219] = { 1, TCL, SEN(adjtimex64), "adjtimex" },
+[220] = { 3, TS, SEN(sigprocmask), "sigprocmask" },
+[221] = { 2, 0, SEN(create_module), "create_module" },
+[222] = { 2, 0, SEN(delete_module), "delete_module" },
+[223] = { 1, 0, SEN(get_kernel_syms), "get_kernel_syms" },
+[224] = { 1, 0, SEN(getpgid), "getpgid" },
+[225] = { 2, 0, SEN(bdflush), "bdflush" },
+[226] = { 3, 0, SEN(sysfs), "sysfs" },
+[227] = { 5, 0, SEN(afs_syscall), "afs_syscall" },
+[228] = { 1, TC|NF, SEN(setfsuid), "setfsuid" },
+[229] = { 1, TC|NF, SEN(setfsgid), "setfsgid" },
+[230] = { 5, TD, SEN(select), "_newselect" },
+[231] = { },
+[232] = { 6, TD, SEN(splice), "splice" },
+[233] = { 1, 0, SEN(stime), "stime" },
+[234] = { 3, TF|TSF|TSFA, SEN(statfs64), "statfs64" },
+[235] = { 3, TD|TFSF|TSFA, SEN(fstatfs64), "fstatfs64" },
+[236] = { 5, TD, SEN(llseek), "_llseek" },
+[237] = { 2, TM, SEN(mlock), "mlock" },
+[238] = { 2, TM, SEN(munlock), "munlock" },
+[239] = { 1, TM, SEN(mlockall), "mlockall" },
+[240] = { 0, TM, SEN(munlockall), "munlockall" },
+[241] = { 2, 0, SEN(sched_setparam), "sched_setparam" },
+[242] = { 2, 0, SEN(sched_getparam), "sched_getparam" },
+[243] = { 3, 0, SEN(sched_setscheduler), "sched_setscheduler" },
+[244] = { 1, 0, SEN(sched_getscheduler), "sched_getscheduler" },
+[245] = { 0, 0, SEN(sched_yield), "sched_yield" },
+[246] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"},
+[247] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"},
+[248] = { 2, 0, SEN(sched_rr_get_interval_time64),"sched_rr_get_interval"},
+[249] = { 2, 0, SEN(nanosleep_time64), "nanosleep" },
+[250] = { 5, TM|SI, SEN(mremap), "mremap" },
+[251] = { 1, 0, SEN(sysctl), "_sysctl" },
+[252] = { 1, 0, SEN(getsid), "getsid" },
+[253] = { 1, TD, SEN(fdatasync), "fdatasync" },
+[254] = { 3, 0, SEN(nfsservctl), "nfsservctl" },
+[255] = { 4, TD, SEN(sync_file_range), "sync_file_range" },
+[256] = { 2, TCL, SEN(clock_settime64), "clock_settime" },
+[257] = { 2, TCL, SEN(clock_gettime64), "clock_gettime" },
+[258] = { 2, TCL, SEN(clock_getres_time64), "clock_getres" },
+[259] = { 4, 0, SEN(clock_nanosleep_time64), "clock_nanosleep" },
+[260] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" },
+[261] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" },
+[262] = { 4, 0, SEN(timer_settime64), "timer_settime" },
+[263] = { 2, 0, SEN(timer_gettime64), "timer_gettime" },
+[264] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" },
+[265] = { 1, 0, SEN(timer_delete), "timer_delete" },
+[266] = { 3, 0, SEN(timer_create), "timer_create" },
+[267] = { 5, 0, SEN(vserver), "vserver" },
+[268] = { 2, TM, SEN(io_setup), "io_setup" },
+[269] = { 1, TM, SEN(io_destroy), "io_destroy" },
+[270] = { 3, 0, SEN(io_submit), "io_submit" },
+[271] = { 3, 0, SEN(io_cancel), "io_cancel" },
+[272] = { 5, 0, SEN(io_getevents_time64), "io_getevents" },
+[273] = { 4, TD, SEN(mq_open), "mq_open" },
+[274] = { 1, 0, SEN(mq_unlink), "mq_unlink" },
+[275] = { 5, TD, SEN(mq_timedsend_time64), "mq_timedsend" },
+[276] = { 5, TD, SEN(mq_timedreceive_time64), "mq_timedreceive" },
+[277] = { 2, TD, SEN(mq_notify), "mq_notify" },
+[278] = { 3, TD, SEN(mq_getsetattr), "mq_getsetattr" },
+[279] = { 5, TP, SEN(waitid), "waitid" },
+[280] = { 4, TD, SEN(tee), "tee" },
+[281] = { 5, 0, SEN(add_key), "add_key" },
+[282] = { 4, 0, SEN(request_key), "request_key" },
+[283] = { 5, 0, SEN(keyctl), "keyctl" },
+[284] = { 4, TD|TF, SEN(openat), "openat" },
+[285] = { 3, TD|TF, SEN(mkdirat), "mkdirat" },
+[286] = { 4, TD|TF, SEN(mknodat), "mknodat" },
+[287] = { 5, TD|TF, SEN(fchownat), "fchownat" },
+[288] = { 3, TD|TF, SEN(futimesat), "futimesat" },
+[289] = { 4, TD|TF|TFST|TSTA,SEN(fstatat64), "fstatat64" },
+[290] = { 3, TD|TF, SEN(unlinkat), "unlinkat" },
+[291] = { 4, TD|TF, SEN(renameat), "renameat" },
+[292] = { 5, TD|TF, SEN(linkat), "linkat" },
+[293] = { 3, TD|TF, SEN(symlinkat), "symlinkat" },
+[294] = { 4, TD|TF, SEN(readlinkat), "readlinkat" },
+[295] = { 3, TD|TF, SEN(fchmodat), "fchmodat" },
+[296] = { 3, TD|TF, SEN(faccessat), "faccessat" },
+[297] = { 6, TD, SEN(pselect6_time64), "pselect6" },
+[298] = { 5, TD, SEN(ppoll_time64), "ppoll" },
+[299] = { 1, 0, SEN(unshare), "unshare" },
+[300] = { 2, 0, SEN(set_robust_list), "set_robust_list" },
+[301] = { 3, 0, SEN(get_robust_list), "get_robust_list" },
+[302] = { 4, TM, SEN(migrate_pages), "migrate_pages" },
+[303] = { 6, TM, SEN(mbind), "mbind" },
+[304] = { 5, TM, SEN(get_mempolicy), "get_mempolicy" },
+[305] = { 3, TM, SEN(set_mempolicy), "set_mempolicy" },
+[306] = { 4, 0, SEN(kexec_load), "kexec_load" },
+[307] = { 6, TM, SEN(move_pages), "move_pages" },
+[308] = { 3, 0, SEN(getcpu), "getcpu" },
+[309] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" },
+[310] = { 4, TD|TF, SEN(utimensat_time64), "utimensat" },
+[311] = { 3, TD|TS, SEN(signalfd), "signalfd" },
+[312] = { 2, TD, SEN(timerfd_create), "timerfd_create" },
+[313] = { 1, TD, SEN(eventfd), "eventfd" },
+[314] = { 4, TD, SEN(fallocate), "fallocate" },
+[315] = { 4, TD, SEN(timerfd_settime64), "timerfd_settime" },
+[316] = { 2, TD, SEN(timerfd_gettime64), "timerfd_gettime" },
+[317] = { 4, TD|TS, SEN(signalfd4), "signalfd4" },
+[318] = { 2, TD, SEN(eventfd2), "eventfd2" },
+[319] = { 1, TD, SEN(epoll_create1), "epoll_create1" },
+[320] = { 3, TD, SEN(dup3), "dup3" },
+[321] = { 2, TD, SEN(pipe2), "pipe2" },
+[322] = { 1, TD, SEN(inotify_init1), "inotify_init1" },
+[323] = { 4, TN, SEN(accept4), "accept4" },
+[324] = { 4, TD, SEN(preadv), "preadv" },
+[325] = { 4, TD, SEN(pwritev), "pwritev" },
+[326] = { 4, TP|TS, SEN(rt_tgsigqueueinfo), "rt_tgsigqueueinfo" },
+[327] = { 5, TD, SEN(perf_event_open), "perf_event_open" },
+[328] = { 5, TN, SEN(recvmmsg_time64), "recvmmsg" },
+[329] = { 2, TD, SEN(fanotify_init), "fanotify_init" },
+[330] = { 5, TD|TF, SEN(fanotify_mark), "fanotify_mark" },
+[331] = { 4, 0, SEN(prlimit64), "prlimit64" },
+[332] = { 5, TD|TF, SEN(name_to_handle_at), "name_to_handle_at" },
+[333] = { 3, TD, SEN(open_by_handle_at), "open_by_handle_at" },
+[334] = { 2, TCL, SEN(clock_sparc64_adjtime), "clock_adjtime" },
+[335] = { 1, TD, SEN(syncfs), "syncfs" },
+[336] = { 4, TN, SEN(sendmmsg), "sendmmsg" },
+[337] = { 2, TD, SEN(setns), "setns" },
+[338] = { 6, 0, SEN(process_vm_readv), "process_vm_readv" },
+[339] = { 6, 0, SEN(process_vm_writev), "process_vm_writev" },
+[340] = { 0, PU, SEN(kern_features), "kern_features" },
+[341] = { 5, 0, SEN(kcmp), "kcmp" },
+[342] = { 3, TD, SEN(finit_module), "finit_module" },
+[343] = { 3, 0, SEN(sched_setattr), "sched_setattr" },
+[344] = { 4, 0, SEN(sched_getattr), "sched_getattr" },
+[345] = { 5, TD|TF, SEN(renameat2), "renameat2" },
+[346] = { 3, 0, SEN(seccomp), "seccomp" },
+[347] = { 3, 0, SEN(getrandom), "getrandom" },
+[348] = { 2, TD, SEN(memfd_create), "memfd_create" },
+[349] = { 3, TD, SEN(bpf), "bpf" },
+[350] = { 5, TD|TF|TP|TSD|SE|SI, SEN(execveat), "execveat" },
+[351] = { 3, 0, SEN(membarrier), "membarrier" },
+[352] = { 1, TD, SEN(userfaultfd), "userfaultfd" },
+[353] = { 3, TN, SEN(bind), "bind" },
+[354] = { 2, TN, SEN(listen), "listen" },
+[355] = { 5, TN, SEN(setsockopt), "setsockopt" },
+[356] = { 3, TM, SEN(mlock2), "mlock2" },
+[357] = { 6, TD, SEN(copy_file_range), "copy_file_range" },
+[358] = { 6, TD, SEN(preadv2), "preadv2" },
+[359] = { 6, TD, SEN(pwritev2), "pwritev2" },
+[360] = { 5, TD|TF|TFST|TSTA,SEN(statx), "statx" },
+[361] = { 6, 0, SEN(io_pgetevents_time64), "io_pgetevents" },
+[362] = { 4, TM|SI, SEN(pkey_mprotect), "pkey_mprotect" },
+[363] = { 2, 0, SEN(pkey_alloc), "pkey_alloc" },
+[364] = { 1, 0, SEN(pkey_free), "pkey_free" },
+[365] = { 4, 0, SEN(rseq), "rseq" },
+/* room for arch specific calls */
+[392] = { 4, TI, SEN(semtimedop_time64), "semtimedop" },
+[393] = { 3, TI, SEN(semget), "semget" },
+[394] = { 4, TI, SEN(semctl), "semctl" },
+[395] = { 3, TI, SEN(shmget), "shmget" },
+[396] = { 3, TI, SEN(shmctl), "shmctl" },
+[397] = { 3, TI|TM|SI, SEN(shmat), "shmat" },
+[398] = { 1, TI|TM|SI, SEN(shmdt), "shmdt" },
+[399] = { 2, TI, SEN(msgget), "msgget" },
+[400] = { 4, TI, SEN(msgsnd), "msgsnd" },
+[401] = { 5, TI, SEN(msgrcv), "msgrcv" },
+[402] = { 3, TI, SEN(msgctl), "msgctl" },
+/* [403 ... 423] - reserved to sync up with other architectures */
+#include "syscallent-common.h"
+
+#define SYS_socket_subcall 500
+#include "subcall64.h"
diff --git a/src/linux/sparc64/syscallent1.h b/src/linux/sparc64/syscallent1.h
new file mode 100644
index 000000000..776b5f110
--- /dev/null
+++ b/src/linux/sparc64/syscallent1.h
@@ -0,0 +1 @@
+#include "../sparc/syscallent.h"
diff --git a/src/linux/sparc64/userent.h b/src/linux/sparc64/userent.h
new file mode 100644
index 000000000..87076bf32
--- /dev/null
+++ b/src/linux/sparc64/userent.h
@@ -0,0 +1,14 @@
+/*
+ * Copyright (c) 2014-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+XLAT_UOFF(u_tsize),
+XLAT_UOFF(u_dsize),
+XLAT_UOFF(u_ssize),
+XLAT_UOFF(signal),
+XLAT_UOFF(magic),
+XLAT_UOFF(u_comm),
+#include "../userent0.h"
diff --git a/src/linux/subcall.h b/src/linux/subcall.h
new file mode 100644
index 000000000..79fc0d0a8
--- /dev/null
+++ b/src/linux/subcall.h
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2013-2015 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2013-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef SYS_socket_subcall
+# error SYS_socket_subcall is not defined
+#endif
+
+#define IS TRACE_INDIRECT_SUBCALL
+
+[SYS_socket_subcall + 1] = { 3, IS|TN, SEN(socket), "socket" },
+[SYS_socket_subcall + 2] = { 3, IS|TN, SEN(bind), "bind" },
+[SYS_socket_subcall + 3] = { 3, IS|TN, SEN(connect), "connect" },
+[SYS_socket_subcall + 4] = { 2, IS|TN, SEN(listen), "listen" },
+[SYS_socket_subcall + 5] = { 3, IS|TN, SEN(accept), "accept" },
+[SYS_socket_subcall + 6] = { 3, IS|TN, SEN(getsockname), "getsockname" },
+[SYS_socket_subcall + 7] = { 3, IS|TN, SEN(getpeername), "getpeername" },
+[SYS_socket_subcall + 8] = { 4, IS|TN, SEN(socketpair), "socketpair" },
+[SYS_socket_subcall + 9] = { 4, IS|TN, SEN(send), "send" },
+[SYS_socket_subcall + 10] = { 4, IS|TN, SEN(recv), "recv" },
+[SYS_socket_subcall + 11] = { 6, IS|TN, SEN(sendto), "sendto" },
+[SYS_socket_subcall + 12] = { 6, IS|TN, SEN(recvfrom), "recvfrom" },
+[SYS_socket_subcall + 13] = { 2, IS|TN, SEN(shutdown), "shutdown" },
+[SYS_socket_subcall + 14] = { 5, IS|TN, SEN(setsockopt), "setsockopt" },
+[SYS_socket_subcall + 15] = { 5, IS|TN, SEN(getsockopt), "getsockopt" },
+[SYS_socket_subcall + 16] = { 3, IS|TN, SEN(sendmsg), "sendmsg" },
+[SYS_socket_subcall + 17] = { 3, IS|TN, SEN(recvmsg), "recvmsg" },
+[SYS_socket_subcall + 18] = { 4, IS|TN, SEN(accept4), "accept4" },
+[SYS_socket_subcall + 19] = { 5, IS|TN, SEN(recvmmsg), "recvmmsg" },
+[SYS_socket_subcall + 20] = { 4, IS|TN, SEN(sendmmsg), "sendmmsg" },
+
+#define SYS_socket_nsubcalls 21
+#define SYS_ipc_subcall ((SYS_socket_subcall) + (SYS_socket_nsubcalls))
+
+[SYS_ipc_subcall + 1] = { 4, IS|TI, SEN(semop), "semop" },
+[SYS_ipc_subcall + 2] = { 3, IS|TI, SEN(semget), "semget" },
+[SYS_ipc_subcall + 3] = { 4, IS|TI, SEN(semctl), "semctl" },
+[SYS_ipc_subcall + 4] = { 5, IS|TI, SEN(semtimedop), "semtimedop" },
+[SYS_ipc_subcall + 11] = { 4, IS|TI, SEN(msgsnd), "msgsnd" },
+[SYS_ipc_subcall + 12] = { 5, IS|TI, SEN(msgrcv), "msgrcv" },
+[SYS_ipc_subcall + 13] = { 2, IS|TI, SEN(msgget), "msgget" },
+[SYS_ipc_subcall + 14] = { 4, IS|TI, SEN(msgctl), "msgctl" },
+[SYS_ipc_subcall + 21] = { 4, IS|TI|TM|SI, SEN(shmat), "shmat" },
+[SYS_ipc_subcall + 22] = { 4, IS|TI|TM|SI, SEN(shmdt), "shmdt" },
+[SYS_ipc_subcall + 23] = { 3, IS|TI, SEN(shmget), "shmget" },
+[SYS_ipc_subcall + 24] = { 4, IS|TI, SEN(shmctl), "shmctl" },
+
+#define SYS_ipc_nsubcalls 25
+
+#undef IS
diff --git a/src/linux/subcall32.h b/src/linux/subcall32.h
new file mode 100644
index 000000000..922d83d40
--- /dev/null
+++ b/src/linux/subcall32.h
@@ -0,0 +1,5 @@
+#define sys_semtimedop sys_semtimedop_time32
+#define sys_recvmmsg sys_recvmmsg_time32
+#include "subcall.h"
+#undef sys_recvmmsg
+#undef sys_semtimedop
diff --git a/src/linux/subcall64.h b/src/linux/subcall64.h
new file mode 100644
index 000000000..95e15bfb2
--- /dev/null
+++ b/src/linux/subcall64.h
@@ -0,0 +1,5 @@
+#define sys_semtimedop sys_semtimedop_time64
+#define sys_recvmmsg sys_recvmmsg_time64
+#include "subcall.h"
+#undef sys_recvmmsg
+#undef sys_semtimedop
diff --git a/src/linux/syscall.h b/src/linux/syscall.h
new file mode 100644
index 000000000..d770eab4e
--- /dev/null
+++ b/src/linux/syscall.h
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993, 1994, 1995 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1995-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_LINUX_SYSCALL_H
+# define STRACE_LINUX_SYSCALL_H
+
+# include "dummy.h"
+# include "sys_func.h"
+# include "sen.h"
+
+# if HAVE_ARCH_UID16_SYSCALLS
+extern SYS_FUNC(chown16);
+extern SYS_FUNC(fchown16);
+extern SYS_FUNC(getgroups16);
+extern SYS_FUNC(getresuid16);
+extern SYS_FUNC(getuid16);
+extern SYS_FUNC(setfsuid16);
+extern SYS_FUNC(setgroups16);
+extern SYS_FUNC(setresuid16);
+extern SYS_FUNC(setreuid16);
+extern SYS_FUNC(setuid16);
+# endif /* HAVE_ARCH_UID16_SYSCALLS */
+
+#endif /* !STRACE_LINUX_SYSCALL_H */
diff --git a/src/linux/syscallent-common-32.h b/src/linux/syscallent-common-32.h
new file mode 100644
index 000000000..99558300c
--- /dev/null
+++ b/src/linux/syscallent-common-32.h
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2019-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef BASE_NR
+# define BASE_NR 0
+#endif
+[BASE_NR + 403] = { 2, TCL, SEN(clock_gettime64), "clock_gettime64" },
+[BASE_NR + 404] = { 2, TCL, SEN(clock_settime64), "clock_settime64" },
+[BASE_NR + 405] = { 2, TCL, SEN(clock_adjtime64), "clock_adjtime64" },
+[BASE_NR + 406] = { 2, TCL, SEN(clock_getres_time64), "clock_getres_time64" },
+[BASE_NR + 407] = { 4, 0, SEN(clock_nanosleep_time64), "clock_nanosleep_time64"},
+[BASE_NR + 408] = { 2, 0, SEN(timer_gettime64), "timer_gettime64" },
+[BASE_NR + 409] = { 4, 0, SEN(timer_settime64), "timer_settime64" },
+[BASE_NR + 410] = { 2, TD, SEN(timerfd_gettime64), "timerfd_gettime64" },
+[BASE_NR + 411] = { 4, TD, SEN(timerfd_settime64), "timerfd_settime64" },
+[BASE_NR + 412] = { 4, TD|TF, SEN(utimensat_time64), "utimensat_time64" },
+[BASE_NR + 413] = { 6, TD, SEN(pselect6_time64), "pselect6_time64" },
+[BASE_NR + 414] = { 5, TD, SEN(ppoll_time64), "ppoll_time64" },
+[BASE_NR + 416] = { 6, 0, SEN(io_pgetevents_time64), "io_pgetevents_time64" },
+[BASE_NR + 417] = { 5, TN, SEN(recvmmsg_time64), "recvmmsg_time64" },
+[BASE_NR + 418] = { 5, TD, SEN(mq_timedsend_time64), "mq_timedsend_time64" },
+[BASE_NR + 419] = { 5, TD, SEN(mq_timedreceive_time64), "mq_timedreceive_time64"},
+[BASE_NR + 420] = { 4, TI, SEN(semtimedop_time64), "semtimedop_time64" },
+[BASE_NR + 421] = { 4, TS, SEN(rt_sigtimedwait_time64), "rt_sigtimedwait_time64"},
+[BASE_NR + 422] = { 6, 0, SEN(futex_time64), "futex_time64" },
+[BASE_NR + 423] = { 2, 0, SEN(sched_rr_get_interval_time64), "sched_rr_get_interval_time64" },
diff --git a/src/linux/syscallent-common.h b/src/linux/syscallent-common.h
new file mode 100644
index 000000000..3062c19f6
--- /dev/null
+++ b/src/linux/syscallent-common.h
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2019-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef BASE_NR
+# define BASE_NR 0
+#endif
+[BASE_NR + 424] = { 4, TD|TS|TP, SEN(pidfd_send_signal), "pidfd_send_signal" },
+[BASE_NR + 425] = { 2, TD, SEN(io_uring_setup), "io_uring_setup" },
+[BASE_NR + 426] = { 6, TD|TS, SEN(io_uring_enter), "io_uring_enter" },
+[BASE_NR + 427] = { 4, TD|TM, SEN(io_uring_register), "io_uring_register" },
+[BASE_NR + 428] = { 3, TD|TF, SEN(open_tree), "open_tree" },
+[BASE_NR + 429] = { 5, TD|TF, SEN(move_mount), "move_mount" },
+[BASE_NR + 430] = { 2, TD, SEN(fsopen), "fsopen" },
+[BASE_NR + 431] = { 5, TD|TF, SEN(fsconfig), "fsconfig" },
+[BASE_NR + 432] = { 3, TD, SEN(fsmount), "fsmount" },
+[BASE_NR + 433] = { 3, TD|TF, SEN(fspick), "fspick" },
+[BASE_NR + 434] = { 2, TD, SEN(pidfd_open), "pidfd_open" },
+[BASE_NR + 435] = { 2, TP, SEN(clone3), "clone3" },
+[BASE_NR + 436] = { 3, TD, SEN(close_range), "close_range" },
+[BASE_NR + 437] = { 4, TD|TF, SEN(openat2), "openat2" },
+[BASE_NR + 438] = { 3, TD, SEN(pidfd_getfd), "pidfd_getfd" },
+[BASE_NR + 439] = { 4, TD|TF, SEN(faccessat2), "faccessat2" },
+[BASE_NR + 440] = { 5, TD, SEN(process_madvise), "process_madvise" },
diff --git a/src/linux/syscallent_base_nr.h b/src/linux/syscallent_base_nr.h
new file mode 100644
index 000000000..da84fa5f6
--- /dev/null
+++ b/src/linux/syscallent_base_nr.h
@@ -0,0 +1 @@
+/* nothing */
diff --git a/src/linux/tile/arch_defs_.h b/src/linux/tile/arch_defs_.h
new file mode 100644
index 000000000..12ba0d8b6
--- /dev/null
+++ b/src/linux/tile/arch_defs_.h
@@ -0,0 +1,15 @@
+/*
+ * Copyright (c) 2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#define SUPPORTED_PERSONALITIES 2
+#define PERSONALITY0_AUDIT_ARCH { AUDIT_ARCH_TILEGX, 0 }
+#define PERSONALITY1_AUDIT_ARCH { AUDIT_ARCH_TILEGX32, 0 }
+#define CAN_ARCH_BE_COMPAT_ON_64BIT_KERNEL 1
+
+#ifdef __tilepro__
+# define DEFAULT_PERSONALITY 1
+#endif
diff --git a/src/linux/tile/arch_get_personality.c b/src/linux/tile/arch_get_personality.c
new file mode 100644
index 000000000..b903f2a25
--- /dev/null
+++ b/src/linux/tile/arch_get_personality.c
@@ -0,0 +1,14 @@
+/*
+ * Copyright (c) 2018 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2018-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+int
+get_personality_from_syscall_info(const struct_ptrace_syscall_info *sci)
+{
+ return sci->arch == AUDIT_ARCH_TILEGX32 ||
+ sci->arch == AUDIT_ARCH_TILEPRO;
+}
diff --git a/src/linux/tile/arch_regs.c b/src/linux/tile/arch_regs.c
new file mode 100644
index 000000000..f792e7734
--- /dev/null
+++ b/src/linux/tile/arch_regs.c
@@ -0,0 +1,11 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static struct pt_regs tile_regs;
+#define ARCH_REGS_FOR_GETREGS tile_regs
+#define ARCH_PC_REG tile_regs.pc
+#define ARCH_SP_REG tile_regs.sp
diff --git a/src/linux/tile/arch_sigreturn.c b/src/linux/tile/arch_sigreturn.c
new file mode 100644
index 000000000..3f0855e2b
--- /dev/null
+++ b/src/linux/tile/arch_sigreturn.c
@@ -0,0 +1,20 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static void
+arch_sigreturn(struct tcb *tcp)
+{
+ kernel_ulong_t addr;
+ if (!get_stack_pointer(tcp, &addr))
+ return;
+
+ /* offset of ucontext in the kernel's sigframe structure */
+#define SIGFRAME_UC_OFFSET C_ABI_SAVE_AREA_SIZE + sizeof(siginfo_t)
+ addr += SIGFRAME_UC_OFFSET + offsetof(ucontext_t, uc_sigmask);
+
+ print_sigset_addr(tcp, addr);
+}
diff --git a/src/linux/tile/get_error.c b/src/linux/tile/get_error.c
new file mode 100644
index 000000000..c6b6c807e
--- /dev/null
+++ b/src/linux/tile/get_error.c
@@ -0,0 +1,25 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "negated_errno.h"
+
+static void
+arch_get_error(struct tcb *tcp, const bool check_errno)
+{
+ /*
+ * The standard tile calling convention returns the value
+ * (or negative errno) in r0, and zero (or positive errno) in r1.
+ * Until at least kernel 3.8, however, the r1 value is not
+ * reflected in ptregs at this point, so we use r0 here.
+ */
+ if (check_errno && is_negated_errno(tile_regs.regs[0])) {
+ tcp->u_rval = -1;
+ tcp->u_error = -tile_regs.regs[0];
+ } else {
+ tcp->u_rval = tile_regs.regs[0];
+ }
+}
diff --git a/src/linux/tile/get_scno.c b/src/linux/tile/get_scno.c
new file mode 100644
index 000000000..9be1ea76a
--- /dev/null
+++ b/src/linux/tile/get_scno.c
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+/* Return codes: 1 - ok, 0 - ignore, other - error. */
+static int
+arch_get_scno(struct tcb *tcp)
+{
+ unsigned int currpers;
+
+#ifdef __tilepro__
+ currpers = 1;
+#else
+# ifndef PT_FLAGS_COMPAT
+# define PT_FLAGS_COMPAT 0x10000 /* from Linux 3.8 on */
+# endif
+ if (tile_regs.flags & PT_FLAGS_COMPAT)
+ currpers = 1;
+ else
+ currpers = 0;
+#endif
+ update_personality(tcp, currpers);
+ tcp->scno = tile_regs.regs[10];
+
+ return 1;
+}
diff --git a/src/linux/tile/get_syscall_args.c b/src/linux/tile/get_syscall_args.c
new file mode 100644
index 000000000..34d596ab5
--- /dev/null
+++ b/src/linux/tile/get_syscall_args.c
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+/* Return -1 on error or 1 on success (never 0!). */
+static int
+arch_get_syscall_args(struct tcb *tcp)
+{
+ tcp->u_arg[0] = tile_regs.regs[0];
+ tcp->u_arg[1] = tile_regs.regs[1];
+ tcp->u_arg[2] = tile_regs.regs[2];
+ tcp->u_arg[3] = tile_regs.regs[3];
+ tcp->u_arg[4] = tile_regs.regs[4];
+ tcp->u_arg[5] = tile_regs.regs[5];
+ return 1;
+}
diff --git a/src/linux/tile/ioctls_arch0.h b/src/linux/tile/ioctls_arch0.h
new file mode 100644
index 000000000..056358521
--- /dev/null
+++ b/src/linux/tile/ioctls_arch0.h
@@ -0,0 +1 @@
+/* Generated by ioctls_gen.sh from definitions found in $linux/arch/tile/include/ tree. */
diff --git a/src/linux/tile/ioctls_arch1.h b/src/linux/tile/ioctls_arch1.h
new file mode 100644
index 000000000..056358521
--- /dev/null
+++ b/src/linux/tile/ioctls_arch1.h
@@ -0,0 +1 @@
+/* Generated by ioctls_gen.sh from definitions found in $linux/arch/tile/include/ tree. */
diff --git a/src/linux/tile/ioctls_inc0.h b/src/linux/tile/ioctls_inc0.h
new file mode 100644
index 000000000..f9939faa4
--- /dev/null
+++ b/src/linux/tile/ioctls_inc0.h
@@ -0,0 +1 @@
+#include "64/ioctls_inc.h"
diff --git a/src/linux/tile/ioctls_inc1.h b/src/linux/tile/ioctls_inc1.h
new file mode 100644
index 000000000..4aecf983e
--- /dev/null
+++ b/src/linux/tile/ioctls_inc1.h
@@ -0,0 +1 @@
+#include "32/ioctls_inc.h"
diff --git a/src/linux/tile/raw_syscall.h b/src/linux/tile/raw_syscall.h
new file mode 100644
index 000000000..c006ad1e3
--- /dev/null
+++ b/src/linux/tile/raw_syscall.h
@@ -0,0 +1,33 @@
+/*
+ * Raw syscalls.
+ *
+ * Copyright (c) 2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_RAW_SYSCALL_H
+# define STRACE_RAW_SYSCALL_H
+
+# include "kernel_types.h"
+
+static inline kernel_ulong_t
+raw_syscall_0(const kernel_ulong_t nr, kernel_ulong_t *err)
+{
+ kernel_ulong_t r, e, c2, c3, c4, c5, c10;
+ __asm__ __volatile__("swint1"
+ : "=R00"(r), "=R01"(e),
+ "=R02"(c2), "=R03"(c3), "=R04"(c4),
+ "=R05"(c5), "=R10"(c10)
+ : "R10"(nr)
+ : "memory", "r6", "r7", "r8", "r9", "r11",
+ "r12", "r13", "r14", "r15", "r16", "r17",
+ "r18", "r19", "r20", "r21", "r22", "r23",
+ "r24", "r25", "r26", "r27", "r28", "r29");
+ *err = e;
+ return r;
+}
+# define raw_syscall_0 raw_syscall_0
+
+#endif /* !STRACE_RAW_SYSCALL_H */
diff --git a/src/linux/tile/rt_sigframe.h b/src/linux/tile/rt_sigframe.h
new file mode 100644
index 000000000..f6c1f1240
--- /dev/null
+++ b/src/linux/tile/rt_sigframe.h
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2017-2018 Dmitry V. Levin <ldv@strace.io>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_RT_SIGFRAME_H
+# define STRACE_RT_SIGFRAME_H
+
+# include <signal.h>
+
+typedef struct {
+ unsigned char save_area[C_ABI_SAVE_AREA_SIZE];
+ siginfo_t info;
+ ucontext_t uc;
+} struct_rt_sigframe;
+
+#endif /* !STRACE_RT_SIGFRAME_H */
diff --git a/src/linux/tile/set_error.c b/src/linux/tile/set_error.c
new file mode 100644
index 000000000..78e476cfe
--- /dev/null
+++ b/src/linux/tile/set_error.c
@@ -0,0 +1,20 @@
+/*
+ * Copyright (c) 2016-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static int
+arch_set_error(struct tcb *tcp)
+{
+ tile_regs.regs[0] = -tcp->u_error;
+ return set_regs(tcp->pid);
+}
+
+static int
+arch_set_success(struct tcb *tcp)
+{
+ tile_regs.regs[0] = tcp->u_rval;
+ return set_regs(tcp->pid);
+}
diff --git a/src/linux/tile/set_scno.c b/src/linux/tile/set_scno.c
new file mode 100644
index 000000000..d96ebc23e
--- /dev/null
+++ b/src/linux/tile/set_scno.c
@@ -0,0 +1,15 @@
+/*
+ * Copyright (c) 2016-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static int
+arch_set_scno(struct tcb *tcp, kernel_ulong_t scno)
+{
+ if (ptrace_syscall_info_is_valid() && get_regs(tcp) < 0)
+ return -1;
+ tile_regs.regs[10] = scno;
+ return set_regs(tcp->pid);
+}
diff --git a/src/linux/tile/syscallent.h b/src/linux/tile/syscallent.h
new file mode 100644
index 000000000..50b60a4ff
--- /dev/null
+++ b/src/linux/tile/syscallent.h
@@ -0,0 +1,11 @@
+/*
+ * Copyright (c) 2009-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "64/syscallent.h"
+/* [244 ... 259] are arch specific */
+[244] = { 1, 0, SEN(printargs), "cmpxchg_badaddr" },
+[245] = { 3, 0, SEN(printargs), "cacheflush" },
diff --git a/src/linux/tile/syscallent1.h b/src/linux/tile/syscallent1.h
new file mode 100644
index 000000000..19941c294
--- /dev/null
+++ b/src/linux/tile/syscallent1.h
@@ -0,0 +1,13 @@
+/*
+ * Copyright (c) 2013-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#define sys_ARCH_mmap sys_mmap_4koff
+#define ARCH_WANT_SYNC_FILE_RANGE2 1
+#include "32/syscallent.h"
+/* [244 ... 259] are arch specific */
+[244] = { 1, 0, SEN(printargs), "cmpxchg_badaddr" },
+[245] = { 3, 0, SEN(printargs), "cacheflush" },
diff --git a/src/linux/tile/userent.h b/src/linux/tile/userent.h
new file mode 100644
index 000000000..167e97296
--- /dev/null
+++ b/src/linux/tile/userent.h
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2014-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+{ PTREGS_OFFSET_REG(0), "r0" },
+{ PTREGS_OFFSET_REG(1), "r1" },
+{ PTREGS_OFFSET_REG(2), "r2" },
+{ PTREGS_OFFSET_REG(3), "r3" },
+{ PTREGS_OFFSET_REG(4), "r4" },
+{ PTREGS_OFFSET_REG(5), "r5" },
+{ PTREGS_OFFSET_REG(6), "r6" },
+{ PTREGS_OFFSET_REG(7), "r7" },
+{ PTREGS_OFFSET_REG(8), "r8" },
+{ PTREGS_OFFSET_REG(9), "r9" },
+{ PTREGS_OFFSET_REG(10), "r10" },
+{ PTREGS_OFFSET_REG(11), "r11" },
+{ PTREGS_OFFSET_REG(12), "r12" },
+{ PTREGS_OFFSET_REG(13), "r13" },
+{ PTREGS_OFFSET_REG(14), "r14" },
+{ PTREGS_OFFSET_REG(15), "r15" },
+{ PTREGS_OFFSET_REG(16), "r16" },
+{ PTREGS_OFFSET_REG(17), "r17" },
+{ PTREGS_OFFSET_REG(18), "r18" },
+{ PTREGS_OFFSET_REG(19), "r19" },
+{ PTREGS_OFFSET_REG(20), "r20" },
+{ PTREGS_OFFSET_REG(21), "r21" },
+{ PTREGS_OFFSET_REG(22), "r22" },
+{ PTREGS_OFFSET_REG(23), "r23" },
+{ PTREGS_OFFSET_REG(24), "r24" },
+{ PTREGS_OFFSET_REG(25), "r25" },
+{ PTREGS_OFFSET_REG(26), "r26" },
+{ PTREGS_OFFSET_REG(27), "r27" },
+{ PTREGS_OFFSET_REG(28), "r28" },
+{ PTREGS_OFFSET_REG(29), "r29" },
+{ PTREGS_OFFSET_REG(30), "r30" },
+{ PTREGS_OFFSET_REG(31), "r31" },
+{ PTREGS_OFFSET_REG(32), "r32" },
+{ PTREGS_OFFSET_REG(33), "r33" },
+{ PTREGS_OFFSET_REG(34), "r34" },
+{ PTREGS_OFFSET_REG(35), "r35" },
+{ PTREGS_OFFSET_REG(36), "r36" },
+{ PTREGS_OFFSET_REG(37), "r37" },
+{ PTREGS_OFFSET_REG(38), "r38" },
+{ PTREGS_OFFSET_REG(39), "r39" },
+{ PTREGS_OFFSET_REG(40), "r40" },
+{ PTREGS_OFFSET_REG(41), "r41" },
+{ PTREGS_OFFSET_REG(42), "r42" },
+{ PTREGS_OFFSET_REG(43), "r43" },
+{ PTREGS_OFFSET_REG(44), "r44" },
+{ PTREGS_OFFSET_REG(45), "r45" },
+{ PTREGS_OFFSET_REG(46), "r46" },
+{ PTREGS_OFFSET_REG(47), "r47" },
+{ PTREGS_OFFSET_REG(48), "r48" },
+{ PTREGS_OFFSET_REG(49), "r49" },
+{ PTREGS_OFFSET_REG(50), "r50" },
+{ PTREGS_OFFSET_REG(51), "r51" },
+{ PTREGS_OFFSET_REG(52), "r52" },
+{ PTREGS_OFFSET_TP, "tp" },
+{ PTREGS_OFFSET_SP, "sp" },
+{ PTREGS_OFFSET_LR, "lr" },
+{ PTREGS_OFFSET_PC, "pc" },
+{ PTREGS_OFFSET_EX1, "ex1" },
+{ PTREGS_OFFSET_FAULTNUM, "faultnum" },
+{ PTREGS_OFFSET_ORIG_R0, "orig_r0" },
+{ PTREGS_OFFSET_FLAGS, "flags" },
diff --git a/src/linux/unix_diag.h b/src/linux/unix_diag.h
new file mode 100644
index 000000000..ffabdce58
--- /dev/null
+++ b/src/linux/unix_diag.h
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2014-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_LINUX_UNIX_DIAG_H
+# define STRACE_LINUX_UNIX_DIAG_H
+
+struct unix_diag_req {
+ uint8_t sdiag_family;
+ uint8_t sdiag_protocol;
+ uint16_t pad;
+ uint32_t udiag_states;
+ uint32_t udiag_ino;
+ uint32_t udiag_show;
+ uint32_t udiag_cookie[2];
+};
+
+# define UDIAG_SHOW_NAME 0x01
+# define UDIAG_SHOW_VFS 0x02
+# define UDIAG_SHOW_PEER 0x04
+# define UDIAG_SHOW_ICONS 0x08
+# define UDIAG_SHOW_RQLEN 0x10
+# define UDIAG_SHOW_MEMINFO 0x20
+# define UDIAG_SHOW_UID 0x40
+
+struct unix_diag_msg {
+ uint8_t udiag_family;
+ uint8_t udiag_type;
+ uint8_t udiag_state;
+ uint8_t pad;
+ uint32_t udiag_ino;
+ uint32_t udiag_cookie[2];
+};
+
+enum {
+ UNIX_DIAG_NAME,
+ UNIX_DIAG_VFS,
+ UNIX_DIAG_PEER,
+ UNIX_DIAG_ICONS,
+ UNIX_DIAG_RQLEN,
+ UNIX_DIAG_MEMINFO,
+ UNIX_DIAG_SHUTDOWN,
+ UNIX_DIAG_UID,
+ UNIX_DIAG_FIRST_UNUSED
+};
+
+struct unix_diag_vfs {
+ uint32_t udiag_vfs_ino;
+ uint32_t udiag_vfs_dev;
+};
+
+struct unix_diag_rqlen {
+ uint32_t udiag_rqueue;
+ uint32_t udiag_wqueue;
+};
+
+#endif /* !STRACE_LINUX_UNIX_DIAG_H */
diff --git a/src/linux/userent.h b/src/linux/userent.h
new file mode 100644
index 000000000..da84fa5f6
--- /dev/null
+++ b/src/linux/userent.h
@@ -0,0 +1 @@
+/* nothing */
diff --git a/src/linux/userent0.h b/src/linux/userent0.h
new file mode 100644
index 000000000..c9e24cd1f
--- /dev/null
+++ b/src/linux/userent0.h
@@ -0,0 +1,8 @@
+/*
+ * Copyright (c) 2014-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+{ sizeof(struct user), "sizeof(struct user)" },
diff --git a/src/linux/x32/arch_defs_.h b/src/linux/x32/arch_defs_.h
new file mode 100644
index 000000000..dfdd440ec
--- /dev/null
+++ b/src/linux/x32/arch_defs_.h
@@ -0,0 +1,15 @@
+/*
+ * Copyright (c) 2018-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#define ARCH_SIZEOF_STRUCT_MSQID64_DS 120
+#define HAVE_ARCH_OLD_MMAP 1
+#define HAVE_ARCH_OLD_SELECT 1
+#define HAVE_ARCH_UID16_SYSCALLS 1
+#define HAVE_ARCH_OLD_TIME64_SYSCALLS 1
+#define SUPPORTED_PERSONALITIES 2
+#define PERSONALITY0_AUDIT_ARCH { AUDIT_ARCH_X86_64, __X32_SYSCALL_BIT }
+#define PERSONALITY1_AUDIT_ARCH { AUDIT_ARCH_I386, 0 }
diff --git a/src/linux/x32/arch_get_personality.c b/src/linux/x32/arch_get_personality.c
new file mode 100644
index 000000000..a8ede47ea
--- /dev/null
+++ b/src/linux/x32/arch_get_personality.c
@@ -0,0 +1 @@
+#include "x86_64/arch_get_personality.c"
diff --git a/src/linux/x32/arch_kvm.c b/src/linux/x32/arch_kvm.c
new file mode 100644
index 000000000..e8e982ee9
--- /dev/null
+++ b/src/linux/x32/arch_kvm.c
@@ -0,0 +1 @@
+#include "x86_64/arch_kvm.c"
diff --git a/src/linux/x32/arch_regs.c b/src/linux/x32/arch_regs.c
new file mode 100644
index 000000000..62c70be82
--- /dev/null
+++ b/src/linux/x32/arch_regs.c
@@ -0,0 +1 @@
+#include "x86_64/arch_regs.c"
diff --git a/src/linux/x32/arch_regs.h b/src/linux/x32/arch_regs.h
new file mode 100644
index 000000000..9064ca693
--- /dev/null
+++ b/src/linux/x32/arch_regs.h
@@ -0,0 +1 @@
+#include "x86_64/arch_regs.h"
diff --git a/src/linux/x32/arch_rt_sigframe.c b/src/linux/x32/arch_rt_sigframe.c
new file mode 100644
index 000000000..1cc45e5f0
--- /dev/null
+++ b/src/linux/x32/arch_rt_sigframe.c
@@ -0,0 +1 @@
+#include "x86_64/arch_rt_sigframe.c"
diff --git a/src/linux/x32/arch_sigreturn.c b/src/linux/x32/arch_sigreturn.c
new file mode 100644
index 000000000..9a778fc76
--- /dev/null
+++ b/src/linux/x32/arch_sigreturn.c
@@ -0,0 +1 @@
+#include "x86_64/arch_sigreturn.c"
diff --git a/src/linux/x32/asm_stat.h b/src/linux/x32/asm_stat.h
new file mode 100644
index 000000000..865aa4a09
--- /dev/null
+++ b/src/linux/x32/asm_stat.h
@@ -0,0 +1 @@
+#include "x86_64/asm_stat.h"
diff --git a/src/linux/x32/check_scno.c b/src/linux/x32/check_scno.c
new file mode 100644
index 000000000..423870128
--- /dev/null
+++ b/src/linux/x32/check_scno.c
@@ -0,0 +1,22 @@
+/*
+ * Copyright (c) 2010-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+/* Return codes: 1 - ok, 0 - ignore, other - error. */
+static int
+arch_check_scno(struct tcb *tcp)
+{
+
+ const kernel_ulong_t scno = ptrace_sci.entry.nr;
+
+ if (tcp->currpers == 0 && !(scno & __X32_SYSCALL_BIT)) {
+ error_msg("syscall_%" PRI_klu "(...) in unsupported "
+ "64-bit mode of process PID=%d", scno, tcp->pid);
+ return 0;
+ }
+
+ return 1;
+}
diff --git a/src/linux/x32/get_error.c b/src/linux/x32/get_error.c
new file mode 100644
index 000000000..6c6fbaf37
--- /dev/null
+++ b/src/linux/x32/get_error.c
@@ -0,0 +1 @@
+#include "x86_64/get_error.c"
diff --git a/src/linux/x32/get_scno.c b/src/linux/x32/get_scno.c
new file mode 100644
index 000000000..492863fa6
--- /dev/null
+++ b/src/linux/x32/get_scno.c
@@ -0,0 +1 @@
+#include "x86_64/get_scno.c"
diff --git a/src/linux/x32/get_syscall_args.c b/src/linux/x32/get_syscall_args.c
new file mode 100644
index 000000000..6cdb465b1
--- /dev/null
+++ b/src/linux/x32/get_syscall_args.c
@@ -0,0 +1 @@
+#include "x86_64/get_syscall_args.c"
diff --git a/src/linux/x32/ioctls_arch0.h b/src/linux/x32/ioctls_arch0.h
new file mode 100644
index 000000000..7070560b7
--- /dev/null
+++ b/src/linux/x32/ioctls_arch0.h
@@ -0,0 +1 @@
+#include "x86_64/ioctls_arch0.h"
diff --git a/src/linux/x32/ioctls_arch1.h b/src/linux/x32/ioctls_arch1.h
new file mode 100644
index 000000000..58a57064d
--- /dev/null
+++ b/src/linux/x32/ioctls_arch1.h
@@ -0,0 +1 @@
+#include "i386/ioctls_arch0.h"
diff --git a/src/linux/x32/ioctls_inc0.h b/src/linux/x32/ioctls_inc0.h
new file mode 100644
index 000000000..e1b94fa71
--- /dev/null
+++ b/src/linux/x32/ioctls_inc0.h
@@ -0,0 +1,2915 @@
+/* Generated by ioctls_gen.sh from definitions found in $linux/include/ tree. */
+{ "acpi/apei.h", "APEI_ERST_CLEAR_RECORD", _IOC_WRITE, 0x4501, 0x08 },
+{ "acpi/apei.h", "APEI_ERST_GET_RECORD_COUNT", _IOC_READ, 0x4502, 0x04 },
+{ "asm-generic/ioctls.h", "FIOASYNC", 0, 0x5452, 0 },
+{ "asm-generic/ioctls.h", "FIOCLEX", 0, 0x5451, 0 },
+{ "asm-generic/ioctls.h", "FIONBIO", 0, 0x5421, 0 },
+{ "asm-generic/ioctls.h", "FIONCLEX", 0, 0x5450, 0 },
+{ "asm-generic/ioctls.h", "FIONREAD", 0, 0x541B, 0 },
+{ "asm-generic/ioctls.h", "FIOQSIZE", 0, 0x5460, 0 },
+{ "asm-generic/ioctls.h", "TCFLSH", 0, 0x540B, 0 },
+{ "asm-generic/ioctls.h", "TCGETA", 0, 0x5405, 0 },
+{ "asm-generic/ioctls.h", "TCGETS", 0, 0x5401, 0 },
+{ "asm-generic/ioctls.h", "TCGETS2", _IOC_READ, 0x542a, 0x2c },
+{ "asm-generic/ioctls.h", "TCGETX", 0, 0x5432, 0 },
+{ "asm-generic/ioctls.h", "TCSBRK", 0, 0x5409, 0 },
+{ "asm-generic/ioctls.h", "TCSBRKP", 0, 0x5425, 0 },
+{ "asm-generic/ioctls.h", "TCSETA", 0, 0x5406, 0 },
+{ "asm-generic/ioctls.h", "TCSETAF", 0, 0x5408, 0 },
+{ "asm-generic/ioctls.h", "TCSETAW", 0, 0x5407, 0 },
+{ "asm-generic/ioctls.h", "TCSETS", 0, 0x5402, 0 },
+{ "asm-generic/ioctls.h", "TCSETS2", _IOC_WRITE, 0x542b, 0x2c },
+{ "asm-generic/ioctls.h", "TCSETSF", 0, 0x5404, 0 },
+{ "asm-generic/ioctls.h", "TCSETSF2", _IOC_WRITE, 0x542d, 0x2c },
+{ "asm-generic/ioctls.h", "TCSETSW", 0, 0x5403, 0 },
+{ "asm-generic/ioctls.h", "TCSETSW2", _IOC_WRITE, 0x542c, 0x2c },
+{ "asm-generic/ioctls.h", "TCSETX", 0, 0x5433, 0 },
+{ "asm-generic/ioctls.h", "TCSETXF", 0, 0x5434, 0 },
+{ "asm-generic/ioctls.h", "TCSETXW", 0, 0x5435, 0 },
+{ "asm-generic/ioctls.h", "TCXONC", 0, 0x540A, 0 },
+{ "asm-generic/ioctls.h", "TIOCCBRK", 0, 0x5428, 0 },
+{ "asm-generic/ioctls.h", "TIOCCONS", 0, 0x541D, 0 },
+{ "asm-generic/ioctls.h", "TIOCEXCL", 0, 0x540C, 0 },
+{ "asm-generic/ioctls.h", "TIOCGDEV", _IOC_READ, 0x5432, 0x04 },
+{ "asm-generic/ioctls.h", "TIOCGETD", 0, 0x5424, 0 },
+{ "asm-generic/ioctls.h", "TIOCGEXCL", _IOC_READ, 0x5440, 0x04 },
+{ "asm-generic/ioctls.h", "TIOCGICOUNT", 0, 0x545D, 0 },
+{ "asm-generic/ioctls.h", "TIOCGISO7816", _IOC_READ, 0x5442, 0x28 },
+{ "asm-generic/ioctls.h", "TIOCGLCKTRMIOS", 0, 0x5456, 0 },
+{ "asm-generic/ioctls.h", "TIOCGPGRP", 0, 0x540F, 0 },
+{ "asm-generic/ioctls.h", "TIOCGPKT", _IOC_READ, 0x5438, 0x04 },
+{ "asm-generic/ioctls.h", "TIOCGPTLCK", _IOC_READ, 0x5439, 0x04 },
+{ "asm-generic/ioctls.h", "TIOCGPTN", _IOC_READ, 0x5430, 0x04 },
+{ "asm-generic/ioctls.h", "TIOCGPTPEER", _IOC_NONE, 0x5441, 0x00 },
+{ "asm-generic/ioctls.h", "TIOCGRS485", 0, 0x542E, 0 },
+{ "asm-generic/ioctls.h", "TIOCGSERIAL", 0, 0x541E, 0 },
+{ "asm-generic/ioctls.h", "TIOCGSID", 0, 0x5429, 0 },
+{ "asm-generic/ioctls.h", "TIOCGSOFTCAR", 0, 0x5419, 0 },
+{ "asm-generic/ioctls.h", "TIOCGWINSZ", 0, 0x5413, 0 },
+{ "asm-generic/ioctls.h", "TIOCLINUX", 0, 0x541C, 0 },
+{ "asm-generic/ioctls.h", "TIOCMBIC", 0, 0x5417, 0 },
+{ "asm-generic/ioctls.h", "TIOCMBIS", 0, 0x5416, 0 },
+{ "asm-generic/ioctls.h", "TIOCMGET", 0, 0x5415, 0 },
+{ "asm-generic/ioctls.h", "TIOCMIWAIT", 0, 0x545C, 0 },
+{ "asm-generic/ioctls.h", "TIOCMSET", 0, 0x5418, 0 },
+{ "asm-generic/ioctls.h", "TIOCNOTTY", 0, 0x5422, 0 },
+{ "asm-generic/ioctls.h", "TIOCNXCL", 0, 0x540D, 0 },
+{ "asm-generic/ioctls.h", "TIOCOUTQ", 0, 0x5411, 0 },
+{ "asm-generic/ioctls.h", "TIOCPKT", 0, 0x5420, 0 },
+{ "asm-generic/ioctls.h", "TIOCSBRK", 0, 0x5427, 0 },
+{ "asm-generic/ioctls.h", "TIOCSCTTY", 0, 0x540E, 0 },
+{ "asm-generic/ioctls.h", "TIOCSERCONFIG", 0, 0x5453, 0 },
+{ "asm-generic/ioctls.h", "TIOCSERGETLSR", 0, 0x5459, 0 },
+{ "asm-generic/ioctls.h", "TIOCSERGETMULTI", 0, 0x545A, 0 },
+{ "asm-generic/ioctls.h", "TIOCSERGSTRUCT", 0, 0x5458, 0 },
+{ "asm-generic/ioctls.h", "TIOCSERGWILD", 0, 0x5454, 0 },
+{ "asm-generic/ioctls.h", "TIOCSERSETMULTI", 0, 0x545B, 0 },
+{ "asm-generic/ioctls.h", "TIOCSERSWILD", 0, 0x5455, 0 },
+{ "asm-generic/ioctls.h", "TIOCSETD", 0, 0x5423, 0 },
+{ "asm-generic/ioctls.h", "TIOCSIG", _IOC_WRITE, 0x5436, 0x04 },
+{ "asm-generic/ioctls.h", "TIOCSISO7816", _IOC_READ|_IOC_WRITE, 0x5443, 0x28 },
+{ "asm-generic/ioctls.h", "TIOCSLCKTRMIOS", 0, 0x5457, 0 },
+{ "asm-generic/ioctls.h", "TIOCSPGRP", 0, 0x5410, 0 },
+{ "asm-generic/ioctls.h", "TIOCSPTLCK", _IOC_WRITE, 0x5431, 0x04 },
+{ "asm-generic/ioctls.h", "TIOCSRS485", 0, 0x542F, 0 },
+{ "asm-generic/ioctls.h", "TIOCSSERIAL", 0, 0x541F, 0 },
+{ "asm-generic/ioctls.h", "TIOCSSOFTCAR", 0, 0x541A, 0 },
+{ "asm-generic/ioctls.h", "TIOCSTI", 0, 0x5412, 0 },
+{ "asm-generic/ioctls.h", "TIOCSWINSZ", 0, 0x5414, 0 },
+{ "asm-generic/ioctls.h", "TIOCVHANGUP", 0, 0x5437, 0 },
+{ "asm-generic/sockios.h", "FIOGETOWN", 0, 0x8903, 0 },
+{ "asm-generic/sockios.h", "FIOSETOWN", 0, 0x8901, 0 },
+{ "asm-generic/sockios.h", "SIOCATMARK", 0, 0x8905, 0 },
+{ "asm-generic/sockios.h", "SIOCGPGRP", 0, 0x8904, 0 },
+{ "asm-generic/sockios.h", "SIOCGSTAMPNS_OLD", 0, 0x8907, 0 },
+{ "asm-generic/sockios.h", "SIOCGSTAMP_OLD", 0, 0x8906, 0 },
+{ "asm-generic/sockios.h", "SIOCSPGRP", 0, 0x8902, 0 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_BO_LIST", _IOC_READ|_IOC_WRITE, 0x6443, 0x18 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_CS", _IOC_READ|_IOC_WRITE, 0x6444, 0x18 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_CTX", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_FENCE_TO_HANDLE", _IOC_READ|_IOC_WRITE, 0x6454, 0x20 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_CREATE", _IOC_READ|_IOC_WRITE, 0x6440, 0x20 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_METADATA", _IOC_READ|_IOC_WRITE, 0x6446, 0x120 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_MMAP", _IOC_READ|_IOC_WRITE, 0x6441, 0x08 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_OP", _IOC_READ|_IOC_WRITE, 0x6450, 0x10 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_USERPTR", _IOC_READ|_IOC_WRITE, 0x6451, 0x18 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_VA", _IOC_WRITE, 0x6448, 0x28 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_WAIT_IDLE", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_INFO", _IOC_WRITE, 0x6445, 0x20 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_SCHED", _IOC_WRITE, 0x6455, 0x10 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_VM", _IOC_READ|_IOC_WRITE, 0x6453, 0x08 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_WAIT_CS", _IOC_READ|_IOC_WRITE, 0x6449, 0x20 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_WAIT_FENCES", _IOC_READ|_IOC_WRITE, 0x6452, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_ADD_BUFS", _IOC_READ|_IOC_WRITE, 0x6416, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_ADD_CTX", _IOC_READ|_IOC_WRITE, 0x6420, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_ADD_DRAW", _IOC_READ|_IOC_WRITE, 0x6427, 0x04 },
+{ "drm/drm.h", "DRM_IOCTL_ADD_MAP", _IOC_READ|_IOC_WRITE, 0x6415, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_AGP_ACQUIRE", _IOC_NONE, 0x6430, 0x00 },
+{ "drm/drm.h", "DRM_IOCTL_AGP_ALLOC", _IOC_READ|_IOC_WRITE, 0x6434, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_AGP_BIND", _IOC_WRITE, 0x6436, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_AGP_ENABLE", _IOC_WRITE, 0x6432, 0x04 },
+{ "drm/drm.h", "DRM_IOCTL_AGP_FREE", _IOC_WRITE, 0x6435, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_AGP_INFO", _IOC_READ, 0x6433, 0x20 },
+{ "drm/drm.h", "DRM_IOCTL_AGP_RELEASE", _IOC_NONE, 0x6431, 0x00 },
+{ "drm/drm.h", "DRM_IOCTL_AGP_UNBIND", _IOC_WRITE, 0x6437, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_AUTH_MAGIC", _IOC_WRITE, 0x6411, 0x04 },
+{ "drm/drm.h", "DRM_IOCTL_BLOCK", _IOC_READ|_IOC_WRITE, 0x6412, 0x04 },
+{ "drm/drm.h", "DRM_IOCTL_CONTROL", _IOC_WRITE, 0x6414, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_CRTC_GET_SEQUENCE", _IOC_READ|_IOC_WRITE, 0x643b, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_CRTC_QUEUE_SEQUENCE", _IOC_READ|_IOC_WRITE, 0x643c, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_DMA", _IOC_READ|_IOC_WRITE, 0x6429, 0x28 },
+{ "drm/drm.h", "DRM_IOCTL_DROP_MASTER", _IOC_NONE, 0x641f, 0x00 },
+{ "drm/drm.h", "DRM_IOCTL_FINISH", _IOC_WRITE, 0x642c, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_FREE_BUFS", _IOC_WRITE, 0x641a, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_GEM_CLOSE", _IOC_WRITE, 0x6409, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_GEM_FLINK", _IOC_READ|_IOC_WRITE, 0x640a, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_GEM_OPEN", _IOC_READ|_IOC_WRITE, 0x640b, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_GET_CAP", _IOC_READ|_IOC_WRITE, 0x640c, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_GET_CLIENT", _IOC_READ|_IOC_WRITE, 0x6405, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_GET_CTX", _IOC_READ|_IOC_WRITE, 0x6423, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_GET_MAGIC", _IOC_READ, 0x6402, 0x04 },
+{ "drm/drm.h", "DRM_IOCTL_GET_MAP", _IOC_READ|_IOC_WRITE, 0x6404, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_GET_SAREA_CTX", _IOC_READ|_IOC_WRITE, 0x641d, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_GET_STATS", _IOC_READ, 0x6406, 0x7c },
+{ "drm/drm.h", "DRM_IOCTL_GET_UNIQUE", _IOC_READ|_IOC_WRITE, 0x6401, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_INFO_BUFS", _IOC_READ|_IOC_WRITE, 0x6418, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_IRQ_BUSID", _IOC_READ|_IOC_WRITE, 0x6403, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_LOCK", _IOC_WRITE, 0x642a, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_MAP_BUFS", _IOC_READ|_IOC_WRITE, 0x6419, 0x0c },
+{ "drm/drm.h", "DRM_IOCTL_MARK_BUFS", _IOC_WRITE, 0x6417, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_MODESET_CTL", _IOC_WRITE, 0x6408, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_ADDFB", _IOC_READ|_IOC_WRITE, 0x64ae, 0x1c },
+{ "drm/drm.h", "DRM_IOCTL_MODE_ADDFB2", _IOC_READ|_IOC_WRITE, 0x64b8, 0x68 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_ATOMIC", _IOC_READ|_IOC_WRITE, 0x64bc, 0x38 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_ATTACHMODE", _IOC_READ|_IOC_WRITE, 0x64a8, 0x48 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_CREATEPROPBLOB", _IOC_READ|_IOC_WRITE, 0x64bd, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_CREATE_DUMB", _IOC_READ|_IOC_WRITE, 0x64b2, 0x20 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_CREATE_LEASE", _IOC_READ|_IOC_WRITE, 0x64c6, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_CURSOR", _IOC_READ|_IOC_WRITE, 0x64a3, 0x1c },
+{ "drm/drm.h", "DRM_IOCTL_MODE_CURSOR2", _IOC_READ|_IOC_WRITE, 0x64bb, 0x24 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_DESTROYPROPBLOB", _IOC_READ|_IOC_WRITE, 0x64be, 0x04 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_DESTROY_DUMB", _IOC_READ|_IOC_WRITE, 0x64b4, 0x04 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_DETACHMODE", _IOC_READ|_IOC_WRITE, 0x64a9, 0x48 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_DIRTYFB", _IOC_READ|_IOC_WRITE, 0x64b1, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_GETCONNECTOR", _IOC_READ|_IOC_WRITE, 0x64a7, 0x50 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_GETCRTC", _IOC_READ|_IOC_WRITE, 0x64a1, 0x68 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_GETENCODER", _IOC_READ|_IOC_WRITE, 0x64a6, 0x14 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_GETFB", _IOC_READ|_IOC_WRITE, 0x64ad, 0x1c },
+{ "drm/drm.h", "DRM_IOCTL_MODE_GETFB2", _IOC_READ|_IOC_WRITE, 0x64ce, 0x68 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_GETGAMMA", _IOC_READ|_IOC_WRITE, 0x64a4, 0x20 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_GETPLANE", _IOC_READ|_IOC_WRITE, 0x64b6, 0x20 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_GETPLANERESOURCES", _IOC_READ|_IOC_WRITE, 0x64b5, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_GETPROPBLOB", _IOC_READ|_IOC_WRITE, 0x64ac, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_GETPROPERTY", _IOC_READ|_IOC_WRITE, 0x64aa, 0x40 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_GETRESOURCES", _IOC_READ|_IOC_WRITE, 0x64a0, 0x40 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_GET_LEASE", _IOC_READ|_IOC_WRITE, 0x64c8, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_LIST_LESSEES", _IOC_READ|_IOC_WRITE, 0x64c7, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_MAP_DUMB", _IOC_READ|_IOC_WRITE, 0x64b3, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_OBJ_GETPROPERTIES", _IOC_READ|_IOC_WRITE, 0x64b9, 0x20 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_OBJ_SETPROPERTY", _IOC_READ|_IOC_WRITE, 0x64ba, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_PAGE_FLIP", _IOC_READ|_IOC_WRITE, 0x64b0, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_REVOKE_LEASE", _IOC_READ|_IOC_WRITE, 0x64c9, 0x04 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_RMFB", _IOC_READ|_IOC_WRITE, 0x64af, 0x04 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_SETCRTC", _IOC_READ|_IOC_WRITE, 0x64a2, 0x68 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_SETGAMMA", _IOC_READ|_IOC_WRITE, 0x64a5, 0x20 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_SETPLANE", _IOC_READ|_IOC_WRITE, 0x64b7, 0x30 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_SETPROPERTY", _IOC_READ|_IOC_WRITE, 0x64ab, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_MOD_CTX", _IOC_WRITE, 0x6422, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_NEW_CTX", _IOC_WRITE, 0x6425, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_PRIME_FD_TO_HANDLE", _IOC_READ|_IOC_WRITE, 0x642e, 0x0c },
+{ "drm/drm.h", "DRM_IOCTL_PRIME_HANDLE_TO_FD", _IOC_READ|_IOC_WRITE, 0x642d, 0x0c },
+{ "drm/drm.h", "DRM_IOCTL_RES_CTX", _IOC_READ|_IOC_WRITE, 0x6426, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_RM_CTX", _IOC_READ|_IOC_WRITE, 0x6421, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_RM_DRAW", _IOC_READ|_IOC_WRITE, 0x6428, 0x04 },
+{ "drm/drm.h", "DRM_IOCTL_RM_MAP", _IOC_WRITE, 0x641b, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_SET_CLIENT_CAP", _IOC_WRITE, 0x640d, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_SET_MASTER", _IOC_NONE, 0x641e, 0x00 },
+{ "drm/drm.h", "DRM_IOCTL_SET_SAREA_CTX", _IOC_WRITE, 0x641c, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_SET_UNIQUE", _IOC_WRITE, 0x6410, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_SET_VERSION", _IOC_READ|_IOC_WRITE, 0x6407, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_SG_ALLOC", _IOC_READ|_IOC_WRITE, 0x6438, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_SG_FREE", _IOC_WRITE, 0x6439, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_SWITCH_CTX", _IOC_WRITE, 0x6424, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_CREATE", _IOC_READ|_IOC_WRITE, 0x64bf, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_DESTROY", _IOC_READ|_IOC_WRITE, 0x64c0, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_FD_TO_HANDLE", _IOC_READ|_IOC_WRITE, 0x64c2, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_HANDLE_TO_FD", _IOC_READ|_IOC_WRITE, 0x64c1, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_QUERY", _IOC_READ|_IOC_WRITE, 0x64cb, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_RESET", _IOC_READ|_IOC_WRITE, 0x64c4, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_SIGNAL", _IOC_READ|_IOC_WRITE, 0x64c5, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_TIMELINE_SIGNAL", _IOC_READ|_IOC_WRITE, 0x64cd, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_TIMELINE_WAIT", _IOC_READ|_IOC_WRITE, 0x64ca, 0x28 },
+{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_TRANSFER", _IOC_READ|_IOC_WRITE, 0x64cc, 0x20 },
+{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_WAIT", _IOC_READ|_IOC_WRITE, 0x64c3, 0x20 },
+{ "drm/drm.h", "DRM_IOCTL_UNBLOCK", _IOC_READ|_IOC_WRITE, 0x6413, 0x04 },
+{ "drm/drm.h", "DRM_IOCTL_UNLOCK", _IOC_WRITE, 0x642b, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_UPDATE_DRAW", _IOC_WRITE, 0x643f, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_VERSION", _IOC_READ|_IOC_WRITE, 0x6400, 0x24 },
+{ "drm/drm.h", "DRM_IOCTL_WAIT_VBLANK", _IOC_READ|_IOC_WRITE, 0x643a, 0x10 },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_CPU_FINI", _IOC_WRITE, 0x6445, 0x08 },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_CPU_PREP", _IOC_WRITE, 0x6444, 0x18 },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_NEW", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_SUBMIT", _IOC_READ|_IOC_WRITE, 0x6446, 0x48 },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_USERPTR", _IOC_READ|_IOC_WRITE, 0x6448, 0x18 },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_WAIT", _IOC_WRITE, 0x6449, 0x20 },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_PM_QUERY_DOM", _IOC_READ|_IOC_WRITE, 0x644a, 0x48 },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_PM_QUERY_SIG", _IOC_READ|_IOC_WRITE, 0x644b, 0x4c },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_WAIT_FENCE", _IOC_WRITE, 0x6447, 0x20 },
+{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_G2D_EXEC", _IOC_READ|_IOC_WRITE, 0x6462, 0x08 },
+{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_G2D_GET_VER", _IOC_READ|_IOC_WRITE, 0x6460, 0x08 },
+{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_G2D_SET_CMDLIST", _IOC_READ|_IOC_WRITE, 0x6461, 0x28 },
+{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_GEM_CREATE", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 },
+{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_GEM_GET", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 },
+{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_GEM_MAP", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 },
+{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_IPP_COMMIT", _IOC_READ|_IOC_WRITE, 0x6483, 0x20 },
+{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_IPP_GET_CAPS", _IOC_READ|_IOC_WRITE, 0x6481, 0x18 },
+{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_IPP_GET_LIMITS", _IOC_READ|_IOC_WRITE, 0x6482, 0x20 },
+{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_IPP_GET_RESOURCES", _IOC_READ|_IOC_WRITE, 0x6480, 0x10 },
+{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_VIDI_CONNECTION", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 },
+{ "drm/i810_drm.h", "DRM_IOCTL_I810_CLEAR", _IOC_WRITE, 0x6442, 0x0c },
+{ "drm/i810_drm.h", "DRM_IOCTL_I810_COPY", _IOC_WRITE, 0x6447, 0x0c },
+{ "drm/i810_drm.h", "DRM_IOCTL_I810_DOCOPY", _IOC_NONE, 0x6448, 0x00 },
+{ "drm/i810_drm.h", "DRM_IOCTL_I810_FLIP", _IOC_NONE, 0x644e, 0x00 },
+{ "drm/i810_drm.h", "DRM_IOCTL_I810_FLUSH", _IOC_NONE, 0x6443, 0x00 },
+{ "drm/i810_drm.h", "DRM_IOCTL_I810_FSTATUS", _IOC_NONE, 0x644a, 0x00 },
+{ "drm/i810_drm.h", "DRM_IOCTL_I810_GETAGE", _IOC_NONE, 0x6444, 0x00 },
+{ "drm/i810_drm.h", "DRM_IOCTL_I810_GETBUF", _IOC_READ|_IOC_WRITE, 0x6445, 0x10 },
+{ "drm/i810_drm.h", "DRM_IOCTL_I810_INIT", _IOC_WRITE, 0x6440, 0x40 },
+{ "drm/i810_drm.h", "DRM_IOCTL_I810_MC", _IOC_WRITE, 0x644c, 0x14 },
+{ "drm/i810_drm.h", "DRM_IOCTL_I810_OV0FLIP", _IOC_NONE, 0x644b, 0x00 },
+{ "drm/i810_drm.h", "DRM_IOCTL_I810_OV0INFO", _IOC_READ, 0x6449, 0x08 },
+{ "drm/i810_drm.h", "DRM_IOCTL_I810_RSTATUS", _IOC_NONE, 0x644d, 0x00 },
+{ "drm/i810_drm.h", "DRM_IOCTL_I810_SWAP", _IOC_NONE, 0x6446, 0x00 },
+{ "drm/i810_drm.h", "DRM_IOCTL_I810_VERTEX", _IOC_WRITE, 0x6441, 0x0c },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_ALLOC", _IOC_READ|_IOC_WRITE, 0x6448, 0x10 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_BATCHBUFFER", _IOC_WRITE, 0x6443, 0x18 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_CMDBUFFER", _IOC_WRITE, 0x644b, 0x18 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_DESTROY_HEAP", _IOC_WRITE, 0x644c, 0x04 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_FLIP", _IOC_NONE, 0x6442, 0x00 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_FLUSH", _IOC_NONE, 0x6441, 0x00 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_FREE", _IOC_WRITE, 0x6449, 0x08 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_BUSY", _IOC_READ|_IOC_WRITE, 0x6457, 0x08 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_CONTEXT_CREATE", _IOC_READ|_IOC_WRITE, 0x646d, 0x08 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_CONTEXT_CREATE_EXT", _IOC_READ|_IOC_WRITE, 0x646d, 0x10 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_CONTEXT_DESTROY", _IOC_WRITE, 0x646e, 0x08 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_CONTEXT_GETPARAM", _IOC_READ|_IOC_WRITE, 0x6474, 0x18 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_CONTEXT_SETPARAM", _IOC_READ|_IOC_WRITE, 0x6475, 0x18 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_CREATE", _IOC_READ|_IOC_WRITE, 0x645b, 0x10 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_ENTERVT", _IOC_NONE, 0x6459, 0x00 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_EXECBUFFER", _IOC_WRITE, 0x6454, 0x28 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_EXECBUFFER2", _IOC_WRITE, 0x6469, 0x40 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_EXECBUFFER2_WR", _IOC_READ|_IOC_WRITE, 0x6469, 0x40 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_GET_APERTURE", _IOC_READ, 0x6463, 0x10 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_GET_CACHING", _IOC_READ|_IOC_WRITE, 0x6470, 0x08 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_GET_TILING", _IOC_READ|_IOC_WRITE, 0x6462, 0x10 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_INIT", _IOC_WRITE, 0x6453, 0x10 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_LEAVEVT", _IOC_NONE, 0x645a, 0x00 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_MADVISE", _IOC_READ|_IOC_WRITE, 0x6466, 0x0c },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_MMAP", _IOC_READ|_IOC_WRITE, 0x645e, 0x28 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_MMAP_GTT", _IOC_READ|_IOC_WRITE, 0x6464, 0x10 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_MMAP_OFFSET", _IOC_READ|_IOC_WRITE, 0x6464, 0x20 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_PIN", _IOC_READ|_IOC_WRITE, 0x6455, 0x18 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_PREAD", _IOC_WRITE, 0x645c, 0x20 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_PWRITE", _IOC_WRITE, 0x645d, 0x20 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_SET_CACHING", _IOC_WRITE, 0x646f, 0x08 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_SET_DOMAIN", _IOC_WRITE, 0x645f, 0x0c },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_SET_TILING", _IOC_READ|_IOC_WRITE, 0x6461, 0x10 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_SW_FINISH", _IOC_WRITE, 0x6460, 0x04 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_THROTTLE", _IOC_NONE, 0x6458, 0x00 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_UNPIN", _IOC_WRITE, 0x6456, 0x08 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_USERPTR", _IOC_READ|_IOC_WRITE, 0x6473, 0x18 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_VM_CREATE", _IOC_READ|_IOC_WRITE, 0x647a, 0x10 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_VM_DESTROY", _IOC_WRITE, 0x647b, 0x10 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_WAIT", _IOC_READ|_IOC_WRITE, 0x646c, 0x10 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GETPARAM", _IOC_READ|_IOC_WRITE, 0x6446, 0x08 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GET_PIPE_FROM_CRTC_ID", _IOC_READ|_IOC_WRITE, 0x6465, 0x08 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GET_RESET_STATS", _IOC_READ|_IOC_WRITE, 0x6472, 0x18 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GET_SPRITE_COLORKEY", _IOC_READ|_IOC_WRITE, 0x646a, 0x14 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_GET_VBLANK_PIPE", _IOC_READ, 0x644e, 0x04 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_HWS_ADDR", _IOC_WRITE, 0x6451, 0x10 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_INIT", _IOC_WRITE, 0x6440, 0x44 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_INIT_HEAP", _IOC_WRITE, 0x644a, 0x0c },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_IRQ_EMIT", _IOC_READ|_IOC_WRITE, 0x6444, 0x04 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_IRQ_WAIT", _IOC_WRITE, 0x6445, 0x04 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_OVERLAY_ATTRS", _IOC_READ|_IOC_WRITE, 0x6468, 0x2c },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_OVERLAY_PUT_IMAGE", _IOC_WRITE, 0x6467, 0x2c },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_PERF_ADD_CONFIG", _IOC_WRITE, 0x6477, 0x48 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_PERF_OPEN", _IOC_WRITE, 0x6476, 0x10 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_PERF_REMOVE_CONFIG", _IOC_WRITE, 0x6478, 0x08 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_QUERY", _IOC_READ|_IOC_WRITE, 0x6479, 0x10 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_REG_READ", _IOC_READ|_IOC_WRITE, 0x6471, 0x10 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_SETPARAM", _IOC_WRITE, 0x6447, 0x08 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_SET_SPRITE_COLORKEY", _IOC_READ|_IOC_WRITE, 0x646b, 0x14 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_SET_VBLANK_PIPE", _IOC_WRITE, 0x644d, 0x04 },
+{ "drm/i915_drm.h", "DRM_IOCTL_I915_VBLANK_SWAP", _IOC_READ|_IOC_WRITE, 0x644f, 0x0c },
+{ "drm/i915_drm.h", "I915_PERF_IOCTL_CONFIG", _IOC_NONE, 0x6902, 0x00 },
+{ "drm/i915_drm.h", "I915_PERF_IOCTL_DISABLE", _IOC_NONE, 0x6901, 0x00 },
+{ "drm/i915_drm.h", "I915_PERF_IOCTL_ENABLE", _IOC_NONE, 0x6900, 0x00 },
+{ "drm/lima_drm.h", "DRM_IOCTL_LIMA_CTX_CREATE", _IOC_READ, 0x6445, 0x08 },
+{ "drm/lima_drm.h", "DRM_IOCTL_LIMA_CTX_FREE", _IOC_WRITE, 0x6446, 0x08 },
+{ "drm/lima_drm.h", "DRM_IOCTL_LIMA_GEM_CREATE", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 },
+{ "drm/lima_drm.h", "DRM_IOCTL_LIMA_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 },
+{ "drm/lima_drm.h", "DRM_IOCTL_LIMA_GEM_SUBMIT", _IOC_WRITE, 0x6443, 0x30 },
+{ "drm/lima_drm.h", "DRM_IOCTL_LIMA_GEM_WAIT", _IOC_WRITE, 0x6444, 0x10 },
+{ "drm/lima_drm.h", "DRM_IOCTL_LIMA_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 },
+{ "drm/mga_drm.h", "DRM_IOCTL_MGA_BLIT", _IOC_WRITE, 0x6448, 0x34 },
+{ "drm/mga_drm.h", "DRM_IOCTL_MGA_CLEAR", _IOC_WRITE, 0x6444, 0x14 },
+{ "drm/mga_drm.h", "DRM_IOCTL_MGA_DMA_BOOTSTRAP", _IOC_READ|_IOC_WRITE, 0x644c, 0x1c },
+{ "drm/mga_drm.h", "DRM_IOCTL_MGA_FLUSH", _IOC_WRITE, 0x6441, 0x08 },
+{ "drm/mga_drm.h", "DRM_IOCTL_MGA_GETPARAM", _IOC_READ|_IOC_WRITE, 0x6449, 0x08 },
+{ "drm/mga_drm.h", "DRM_IOCTL_MGA_ILOAD", _IOC_WRITE, 0x6447, 0x0c },
+{ "drm/mga_drm.h", "DRM_IOCTL_MGA_INDICES", _IOC_WRITE, 0x6446, 0x10 },
+{ "drm/mga_drm.h", "DRM_IOCTL_MGA_INIT", _IOC_WRITE, 0x6440, 0x5c },
+{ "drm/mga_drm.h", "DRM_IOCTL_MGA_RESET", _IOC_NONE, 0x6442, 0x00 },
+{ "drm/mga_drm.h", "DRM_IOCTL_MGA_SET_FENCE", _IOC_WRITE, 0x644a, 0x04 },
+{ "drm/mga_drm.h", "DRM_IOCTL_MGA_SWAP", _IOC_NONE, 0x6443, 0x00 },
+{ "drm/mga_drm.h", "DRM_IOCTL_MGA_VERTEX", _IOC_WRITE, 0x6445, 0x0c },
+{ "drm/mga_drm.h", "DRM_IOCTL_MGA_WAIT_FENCE", _IOC_READ|_IOC_WRITE, 0x644b, 0x04 },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_CPU_FINI", _IOC_WRITE, 0x6445, 0x04 },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_CPU_PREP", _IOC_WRITE, 0x6444, 0x18 },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6443, 0x18 },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_MADVISE", _IOC_READ|_IOC_WRITE, 0x6448, 0x0c },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_NEW", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_SUBMIT", _IOC_READ|_IOC_WRITE, 0x6446, 0x48 },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_SUBMITQUEUE_CLOSE", _IOC_WRITE, 0x644b, 0x04 },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_SUBMITQUEUE_NEW", _IOC_READ|_IOC_WRITE, 0x644a, 0x0c },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_SUBMITQUEUE_QUERY", _IOC_WRITE, 0x644c, 0x18 },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_WAIT_FENCE", _IOC_WRITE, 0x6447, 0x20 },
+{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_CPU_FINI", _IOC_WRITE, 0x6483, 0x04 },
+{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_CPU_PREP", _IOC_WRITE, 0x6482, 0x08 },
+{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6484, 0x28 },
+{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_NEW", _IOC_READ|_IOC_WRITE, 0x6480, 0x30 },
+{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_PUSHBUF", _IOC_READ|_IOC_WRITE, 0x6481, 0x40 },
+{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_SVM_BIND", _IOC_READ|_IOC_WRITE, 0x6449, 0x40 },
+{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_SVM_INIT", _IOC_READ|_IOC_WRITE, 0x6448, 0x10 },
+{ "drm/omap_drm.h", "DRM_IOCTL_OMAP_GEM_CPU_FINI", _IOC_WRITE, 0x6445, 0x10 },
+{ "drm/omap_drm.h", "DRM_IOCTL_OMAP_GEM_CPU_PREP", _IOC_WRITE, 0x6444, 0x08 },
+{ "drm/omap_drm.h", "DRM_IOCTL_OMAP_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6446, 0x18 },
+{ "drm/omap_drm.h", "DRM_IOCTL_OMAP_GEM_NEW", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 },
+{ "drm/omap_drm.h", "DRM_IOCTL_OMAP_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 },
+{ "drm/omap_drm.h", "DRM_IOCTL_OMAP_SET_PARAM", _IOC_WRITE, 0x6441, 0x10 },
+{ "drm/panfrost_drm.h", "DRM_IOCTL_PANFROST_CREATE_BO", _IOC_READ|_IOC_WRITE, 0x6442, 0x18 },
+{ "drm/panfrost_drm.h", "DRM_IOCTL_PANFROST_GET_BO_OFFSET", _IOC_READ|_IOC_WRITE, 0x6445, 0x10 },
+{ "drm/panfrost_drm.h", "DRM_IOCTL_PANFROST_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 },
+{ "drm/panfrost_drm.h", "DRM_IOCTL_PANFROST_MADVISE", _IOC_READ|_IOC_WRITE, 0x6448, 0x0c },
+{ "drm/panfrost_drm.h", "DRM_IOCTL_PANFROST_MMAP_BO", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 },
+{ "drm/panfrost_drm.h", "DRM_IOCTL_PANFROST_PERFCNT_DUMP", _IOC_WRITE, 0x6447, 0x08 },
+{ "drm/panfrost_drm.h", "DRM_IOCTL_PANFROST_PERFCNT_ENABLE", _IOC_WRITE, 0x6446, 0x08 },
+{ "drm/panfrost_drm.h", "DRM_IOCTL_PANFROST_SUBMIT", _IOC_WRITE, 0x6440, 0x28 },
+{ "drm/panfrost_drm.h", "DRM_IOCTL_PANFROST_WAIT_BO", _IOC_WRITE, 0x6441, 0x10 },
+{ "drm/qxl_drm.h", "DRM_IOCTL_QXL_ALLOC", _IOC_READ|_IOC_WRITE, 0x6440, 0x08 },
+{ "drm/qxl_drm.h", "DRM_IOCTL_QXL_ALLOC_SURF", _IOC_READ|_IOC_WRITE, 0x6446, 0x18 },
+{ "drm/qxl_drm.h", "DRM_IOCTL_QXL_CLIENTCAP", _IOC_WRITE, 0x6445, 0x08 },
+{ "drm/qxl_drm.h", "DRM_IOCTL_QXL_EXECBUFFER", _IOC_WRITE, 0x6442, 0x10 },
+{ "drm/qxl_drm.h", "DRM_IOCTL_QXL_GETPARAM", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 },
+{ "drm/qxl_drm.h", "DRM_IOCTL_QXL_MAP", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 },
+{ "drm/qxl_drm.h", "DRM_IOCTL_QXL_UPDATE_AREA", _IOC_WRITE, 0x6443, 0x18 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_BLIT", _IOC_WRITE, 0x644b, 0x18 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_CCE_IDLE", _IOC_NONE, 0x6444, 0x00 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_CCE_RESET", _IOC_NONE, 0x6443, 0x00 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_CCE_START", _IOC_NONE, 0x6441, 0x00 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_CCE_STOP", _IOC_WRITE, 0x6442, 0x08 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_CLEAR", _IOC_WRITE, 0x6448, 0x14 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_DEPTH", _IOC_WRITE, 0x644c, 0x18 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_FLIP", _IOC_NONE, 0x6453, 0x00 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_FULLSCREEN", _IOC_WRITE, 0x6450, 0x04 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_GETPARAM", _IOC_READ|_IOC_WRITE, 0x6452, 0x08 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_INDICES", _IOC_WRITE, 0x644a, 0x14 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_INDIRECT", _IOC_READ|_IOC_WRITE, 0x644f, 0x10 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_INIT", _IOC_WRITE, 0x6440, 0x58 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_RESET", _IOC_NONE, 0x6446, 0x00 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_STIPPLE", _IOC_WRITE, 0x644d, 0x04 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_SWAP", _IOC_NONE, 0x6447, 0x00 },
+{ "drm/r128_drm.h", "DRM_IOCTL_R128_VERTEX", _IOC_WRITE, 0x6449, 0x10 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_ALLOC", _IOC_READ|_IOC_WRITE, 0x6453, 0x10 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CLEAR", _IOC_WRITE, 0x6448, 0x18 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CMDBUF", _IOC_WRITE, 0x6450, 0x10 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CP_IDLE", _IOC_NONE, 0x6444, 0x00 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CP_INIT", _IOC_WRITE, 0x6440, 0x54 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CP_RESET", _IOC_NONE, 0x6443, 0x00 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CP_RESUME", _IOC_NONE, 0x6458, 0x00 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CP_START", _IOC_NONE, 0x6441, 0x00 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CP_STOP", _IOC_WRITE, 0x6442, 0x08 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_CS", _IOC_READ|_IOC_WRITE, 0x6466, 0x20 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_FLIP", _IOC_NONE, 0x6452, 0x00 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_FREE", _IOC_WRITE, 0x6454, 0x08 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_FULLSCREEN", _IOC_WRITE, 0x6446, 0x04 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_BUSY", _IOC_READ|_IOC_WRITE, 0x646a, 0x08 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_CREATE", _IOC_READ|_IOC_WRITE, 0x645d, 0x20 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_GET_TILING", _IOC_READ|_IOC_WRITE, 0x6469, 0x0c },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x645c, 0x18 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_MMAP", _IOC_READ|_IOC_WRITE, 0x645e, 0x20 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_OP", _IOC_READ|_IOC_WRITE, 0x646c, 0x10 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_PREAD", _IOC_READ|_IOC_WRITE, 0x6461, 0x20 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_PWRITE", _IOC_READ|_IOC_WRITE, 0x6462, 0x20 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_SET_DOMAIN", _IOC_READ|_IOC_WRITE, 0x6463, 0x0c },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_SET_TILING", _IOC_READ|_IOC_WRITE, 0x6468, 0x0c },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_USERPTR", _IOC_READ|_IOC_WRITE, 0x646d, 0x18 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_VA", _IOC_READ|_IOC_WRITE, 0x646b, 0x18 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GEM_WAIT_IDLE", _IOC_WRITE, 0x6464, 0x08 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_GETPARAM", _IOC_READ|_IOC_WRITE, 0x6451, 0x08 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_INDICES", _IOC_WRITE, 0x644a, 0x14 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_INDIRECT", _IOC_READ|_IOC_WRITE, 0x644d, 0x10 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_INFO", _IOC_READ|_IOC_WRITE, 0x6467, 0x10 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_INIT_HEAP", _IOC_WRITE, 0x6455, 0x0c },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_IRQ_EMIT", _IOC_READ|_IOC_WRITE, 0x6456, 0x04 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_IRQ_WAIT", _IOC_WRITE, 0x6457, 0x04 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_RESET", _IOC_NONE, 0x6445, 0x00 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_SETPARAM", _IOC_WRITE, 0x6459, 0x10 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_STIPPLE", _IOC_WRITE, 0x644c, 0x04 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_SURF_ALLOC", _IOC_WRITE, 0x645a, 0x0c },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_SURF_FREE", _IOC_WRITE, 0x645b, 0x04 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_SWAP", _IOC_NONE, 0x6447, 0x00 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_TEXTURE", _IOC_READ|_IOC_WRITE, 0x644e, 0x18 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_VERTEX", _IOC_WRITE, 0x6449, 0x10 },
+{ "drm/radeon_drm.h", "DRM_IOCTL_RADEON_VERTEX2", _IOC_WRITE, 0x644f, 0x18 },
+{ "drm/savage_drm.h", "DRM_IOCTL_SAVAGE_BCI_CMDBUF", _IOC_WRITE, 0x6441, 0x24 },
+{ "drm/savage_drm.h", "DRM_IOCTL_SAVAGE_BCI_EVENT_EMIT", _IOC_READ|_IOC_WRITE, 0x6442, 0x08 },
+{ "drm/savage_drm.h", "DRM_IOCTL_SAVAGE_BCI_EVENT_WAIT", _IOC_WRITE, 0x6443, 0x08 },
+{ "drm/savage_drm.h", "DRM_IOCTL_SAVAGE_BCI_INIT", _IOC_WRITE, 0x6440, 0x50 },
+{ "drm/sis_drm.h", "DRM_IOCTL_SIS_AGP_ALLOC", _IOC_READ|_IOC_WRITE, 0x6454, 0x10 },
+{ "drm/sis_drm.h", "DRM_IOCTL_SIS_AGP_FREE", _IOC_WRITE, 0x6455, 0x10 },
+{ "drm/sis_drm.h", "DRM_IOCTL_SIS_AGP_INIT", _IOC_READ|_IOC_WRITE, 0x6453, 0x08 },
+{ "drm/sis_drm.h", "DRM_IOCTL_SIS_FB_ALLOC", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 },
+{ "drm/sis_drm.h", "DRM_IOCTL_SIS_FB_FREE", _IOC_WRITE, 0x6445, 0x10 },
+{ "drm/sis_drm.h", "DRM_IOCTL_SIS_FB_INIT", _IOC_WRITE, 0x6456, 0x08 },
+{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_CLOSE_CHANNEL", _IOC_READ|_IOC_WRITE, 0x6446, 0x08 },
+{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GEM_CREATE", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 },
+{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GEM_GET_FLAGS", _IOC_READ|_IOC_WRITE, 0x644d, 0x08 },
+{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GEM_GET_TILING", _IOC_READ|_IOC_WRITE, 0x644b, 0x10 },
+{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GEM_MMAP", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 },
+{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GEM_SET_FLAGS", _IOC_READ|_IOC_WRITE, 0x644c, 0x08 },
+{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GEM_SET_TILING", _IOC_READ|_IOC_WRITE, 0x644a, 0x10 },
+{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GET_SYNCPT", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 },
+{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GET_SYNCPT_BASE", _IOC_READ|_IOC_WRITE, 0x6449, 0x10 },
+{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_OPEN_CHANNEL", _IOC_READ|_IOC_WRITE, 0x6445, 0x10 },
+{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_SUBMIT", _IOC_READ|_IOC_WRITE, 0x6448, 0x58 },
+{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_SYNCPT_INCR", _IOC_READ|_IOC_WRITE, 0x6443, 0x08 },
+{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_SYNCPT_READ", _IOC_READ|_IOC_WRITE, 0x6442, 0x08 },
+{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_SYNCPT_WAIT", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 },
+{ "drm/v3d_drm.h", "DRM_IOCTL_V3D_CREATE_BO", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 },
+{ "drm/v3d_drm.h", "DRM_IOCTL_V3D_GET_BO_OFFSET", _IOC_READ|_IOC_WRITE, 0x6445, 0x08 },
+{ "drm/v3d_drm.h", "DRM_IOCTL_V3D_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 },
+{ "drm/v3d_drm.h", "DRM_IOCTL_V3D_MMAP_BO", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 },
+{ "drm/v3d_drm.h", "DRM_IOCTL_V3D_SUBMIT_CL", _IOC_READ|_IOC_WRITE, 0x6440, 0x38 },
+{ "drm/v3d_drm.h", "DRM_IOCTL_V3D_SUBMIT_CSD", _IOC_WRITE, 0x6447, 0x48 },
+{ "drm/v3d_drm.h", "DRM_IOCTL_V3D_SUBMIT_TFU", _IOC_WRITE, 0x6446, 0x44 },
+{ "drm/v3d_drm.h", "DRM_IOCTL_V3D_WAIT_BO", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_CREATE_BO", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_CREATE_SHADER_BO", _IOC_READ|_IOC_WRITE, 0x6445, 0x18 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_GEM_MADVISE", _IOC_READ|_IOC_WRITE, 0x644b, 0x10 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_GET_HANG_STATE", _IOC_READ|_IOC_WRITE, 0x6446, 0xa0 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_GET_TILING", _IOC_READ|_IOC_WRITE, 0x6449, 0x10 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_LABEL_BO", _IOC_READ|_IOC_WRITE, 0x644a, 0x10 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_MMAP_BO", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_PERFMON_CREATE", _IOC_READ|_IOC_WRITE, 0x644c, 0x18 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_PERFMON_DESTROY", _IOC_READ|_IOC_WRITE, 0x644d, 0x04 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_PERFMON_GET_VALUES", _IOC_READ|_IOC_WRITE, 0x644e, 0x10 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_SET_TILING", _IOC_READ|_IOC_WRITE, 0x6448, 0x10 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_SUBMIT_CL", _IOC_READ|_IOC_WRITE, 0x6440, 0xb0 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_WAIT_BO", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_WAIT_SEQNO", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 },
+{ "drm/vgem_drm.h", "DRM_IOCTL_VGEM_FENCE_ATTACH", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 },
+{ "drm/vgem_drm.h", "DRM_IOCTL_VGEM_FENCE_SIGNAL", _IOC_WRITE, 0x6442, 0x08 },
+{ "drm/via_drm.h", "DRM_IOCTL_VIA_AGP_INIT", _IOC_READ|_IOC_WRITE, 0x6442, 0x08 },
+{ "drm/via_drm.h", "DRM_IOCTL_VIA_ALLOCMEM", _IOC_READ|_IOC_WRITE, 0x6440, 0x14 },
+{ "drm/via_drm.h", "DRM_IOCTL_VIA_BLIT_SYNC", _IOC_WRITE, 0x644f, 0x08 },
+{ "drm/via_drm.h", "DRM_IOCTL_VIA_CMDBUFFER", _IOC_WRITE, 0x6448, 0x08 },
+{ "drm/via_drm.h", "DRM_IOCTL_VIA_CMDBUF_SIZE", _IOC_READ|_IOC_WRITE, 0x644b, 0x0c },
+{ "drm/via_drm.h", "DRM_IOCTL_VIA_DEC_FUTEX", _IOC_WRITE, 0x6445, 0x10 },
+{ "drm/via_drm.h", "DRM_IOCTL_VIA_DMA_BLIT", _IOC_WRITE, 0x644e, 0x28 },
+{ "drm/via_drm.h", "DRM_IOCTL_VIA_DMA_INIT", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 },
+{ "drm/via_drm.h", "DRM_IOCTL_VIA_FB_INIT", _IOC_READ|_IOC_WRITE, 0x6443, 0x08 },
+{ "drm/via_drm.h", "DRM_IOCTL_VIA_FLUSH", _IOC_NONE, 0x6449, 0x00 },
+{ "drm/via_drm.h", "DRM_IOCTL_VIA_FREEMEM", _IOC_WRITE, 0x6441, 0x14 },
+{ "drm/via_drm.h", "DRM_IOCTL_VIA_MAP_INIT", _IOC_READ|_IOC_WRITE, 0x6444, 0x14 },
+{ "drm/via_drm.h", "DRM_IOCTL_VIA_PCICMD", _IOC_WRITE, 0x644a, 0x08 },
+{ "drm/via_drm.h", "DRM_IOCTL_VIA_WAIT_IRQ", _IOC_READ|_IOC_WRITE, 0x644d, 0x10 },
+{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_EXECBUFFER", _IOC_READ|_IOC_WRITE, 0x6442, 0x20 },
+{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_GETPARAM", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 },
+{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_GET_CAPS", _IOC_READ|_IOC_WRITE, 0x6449, 0x18 },
+{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_MAP", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 },
+{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_RESOURCE_CREATE", _IOC_READ|_IOC_WRITE, 0x6444, 0x38 },
+{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_RESOURCE_INFO", _IOC_READ|_IOC_WRITE, 0x6445, 0x10 },
+{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_TRANSFER_FROM_HOST", _IOC_READ|_IOC_WRITE, 0x6446, 0x24 },
+{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_TRANSFER_TO_HOST", _IOC_READ|_IOC_WRITE, 0x6447, 0x24 },
+{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_WAIT", _IOC_READ|_IOC_WRITE, 0x6448, 0x08 },
+{ "linux/agpgart.h", "AGPIOC_ACQUIRE", _IOC_NONE, 0x4101, 0x00 },
+{ "linux/agpgart.h", "AGPIOC_ALLOCATE", _IOC_READ|_IOC_WRITE, 0x4106, 0x04 },
+{ "linux/agpgart.h", "AGPIOC_BIND", _IOC_WRITE, 0x4108, 0x04 },
+{ "linux/agpgart.h", "AGPIOC_CHIPSET_FLUSH", _IOC_NONE, 0x410a, 0x00 },
+{ "linux/agpgart.h", "AGPIOC_DEALLOCATE", _IOC_WRITE, 0x4107, 0x04 },
+{ "linux/agpgart.h", "AGPIOC_INFO", _IOC_READ, 0x4100, 0x04 },
+{ "linux/agpgart.h", "AGPIOC_PROTECT", _IOC_WRITE, 0x4105, 0x04 },
+{ "linux/agpgart.h", "AGPIOC_RELEASE", _IOC_NONE, 0x4102, 0x00 },
+{ "linux/agpgart.h", "AGPIOC_RESERVE", _IOC_WRITE, 0x4104, 0x04 },
+{ "linux/agpgart.h", "AGPIOC_SETUP", _IOC_WRITE, 0x4103, 0x04 },
+{ "linux/agpgart.h", "AGPIOC_UNBIND", _IOC_WRITE, 0x4109, 0x04 },
+{ "linux/am437x-vpfe.h", "VIDIOC_AM437X_CCDC_CFG", _IOC_WRITE, 0x56c1, 0x04 },
+{ "linux/android/binder.h", "BC_ACQUIRE", _IOC_WRITE, 0x6305, 0x04 },
+{ "linux/android/binder.h", "BC_ACQUIRE_DONE", _IOC_WRITE, 0x6309, 0x10 },
+{ "linux/android/binder.h", "BC_ACQUIRE_RESULT", _IOC_WRITE, 0x6302, 0x04 },
+{ "linux/android/binder.h", "BC_ATTEMPT_ACQUIRE", _IOC_WRITE, 0x630a, 0x08 },
+{ "linux/android/binder.h", "BC_CLEAR_DEATH_NOTIFICATION", _IOC_WRITE, 0x630f, 0x0c },
+{ "linux/android/binder.h", "BC_DEAD_BINDER_DONE", _IOC_WRITE, 0x6310, 0x08 },
+{ "linux/android/binder.h", "BC_DECREFS", _IOC_WRITE, 0x6307, 0x04 },
+{ "linux/android/binder.h", "BC_ENTER_LOOPER", _IOC_NONE, 0x630c, 0x00 },
+{ "linux/android/binder.h", "BC_EXIT_LOOPER", _IOC_NONE, 0x630d, 0x00 },
+{ "linux/android/binder.h", "BC_FREE_BUFFER", _IOC_WRITE, 0x6303, 0x08 },
+{ "linux/android/binder.h", "BC_INCREFS", _IOC_WRITE, 0x6304, 0x04 },
+{ "linux/android/binder.h", "BC_INCREFS_DONE", _IOC_WRITE, 0x6308, 0x10 },
+{ "linux/android/binder.h", "BC_REGISTER_LOOPER", _IOC_NONE, 0x630b, 0x00 },
+{ "linux/android/binder.h", "BC_RELEASE", _IOC_WRITE, 0x6306, 0x04 },
+{ "linux/android/binder.h", "BC_REPLY", _IOC_WRITE, 0x6301, 0x40 },
+{ "linux/android/binder.h", "BC_REPLY_SG", _IOC_WRITE, 0x6312, 0x48 },
+{ "linux/android/binder.h", "BC_REQUEST_DEATH_NOTIFICATION", _IOC_WRITE, 0x630e, 0x0c },
+{ "linux/android/binder.h", "BC_TRANSACTION", _IOC_WRITE, 0x6300, 0x40 },
+{ "linux/android/binder.h", "BC_TRANSACTION_SG", _IOC_WRITE, 0x6311, 0x48 },
+{ "linux/android/binder.h", "BINDER_GET_NODE_DEBUG_INFO", _IOC_READ|_IOC_WRITE, 0x620b, 0x18 },
+{ "linux/android/binder.h", "BINDER_GET_NODE_INFO_FOR_REF", _IOC_READ|_IOC_WRITE, 0x620c, 0x18 },
+{ "linux/android/binder.h", "BINDER_SET_CONTEXT_MGR", _IOC_WRITE, 0x6207, 0x04 },
+{ "linux/android/binder.h", "BINDER_SET_CONTEXT_MGR_EXT", _IOC_WRITE, 0x620d, 0x18 },
+{ "linux/android/binder.h", "BINDER_SET_IDLE_PRIORITY", _IOC_WRITE, 0x6206, 0x04 },
+{ "linux/android/binder.h", "BINDER_SET_IDLE_TIMEOUT", _IOC_WRITE, 0x6203, 0x08 },
+{ "linux/android/binder.h", "BINDER_SET_MAX_THREADS", _IOC_WRITE, 0x6205, 0x04 },
+{ "linux/android/binder.h", "BINDER_THREAD_EXIT", _IOC_WRITE, 0x6208, 0x04 },
+{ "linux/android/binder.h", "BINDER_VERSION", _IOC_READ|_IOC_WRITE, 0x6209, 0x04 },
+{ "linux/android/binder.h", "BINDER_WRITE_READ", _IOC_READ|_IOC_WRITE, 0x6201, 0x30 },
+{ "linux/android/binder.h", "BR_ACQUIRE", _IOC_READ, 0x7208, 0x10 },
+{ "linux/android/binder.h", "BR_ACQUIRE_RESULT", _IOC_READ, 0x7204, 0x04 },
+{ "linux/android/binder.h", "BR_ATTEMPT_ACQUIRE", _IOC_READ, 0x720b, 0x18 },
+{ "linux/android/binder.h", "BR_CLEAR_DEATH_NOTIFICATION_DONE", _IOC_READ, 0x7210, 0x08 },
+{ "linux/android/binder.h", "BR_DEAD_BINDER", _IOC_READ, 0x720f, 0x08 },
+{ "linux/android/binder.h", "BR_DEAD_REPLY", _IOC_NONE, 0x7205, 0x00 },
+{ "linux/android/binder.h", "BR_DECREFS", _IOC_READ, 0x720a, 0x10 },
+{ "linux/android/binder.h", "BR_ERROR", _IOC_READ, 0x7200, 0x04 },
+{ "linux/android/binder.h", "BR_FAILED_REPLY", _IOC_NONE, 0x7211, 0x00 },
+{ "linux/android/binder.h", "BR_FINISHED", _IOC_NONE, 0x720e, 0x00 },
+{ "linux/android/binder.h", "BR_INCREFS", _IOC_READ, 0x7207, 0x10 },
+{ "linux/android/binder.h", "BR_NOOP", _IOC_NONE, 0x720c, 0x00 },
+{ "linux/android/binder.h", "BR_OK", _IOC_NONE, 0x7201, 0x00 },
+{ "linux/android/binder.h", "BR_RELEASE", _IOC_READ, 0x7209, 0x10 },
+{ "linux/android/binder.h", "BR_REPLY", _IOC_READ, 0x7203, 0x40 },
+{ "linux/android/binder.h", "BR_SPAWN_LOOPER", _IOC_NONE, 0x720d, 0x00 },
+{ "linux/android/binder.h", "BR_TRANSACTION", _IOC_READ, 0x7202, 0x40 },
+{ "linux/android/binder.h", "BR_TRANSACTION_COMPLETE", _IOC_NONE, 0x7206, 0x00 },
+{ "linux/android/binder.h", "BR_TRANSACTION_SEC_CTX", _IOC_READ, 0x7202, 0x48 },
+{ "linux/android/binderfs.h", "BINDER_CTL_ADD", _IOC_READ|_IOC_WRITE, 0x6201, 0x108 },
+{ "linux/apm_bios.h", "APM_IOC_STANDBY", _IOC_NONE, 0x4101, 0x00 },
+{ "linux/apm_bios.h", "APM_IOC_SUSPEND", _IOC_NONE, 0x4102, 0x00 },
+{ "linux/arcfb.h", "FBIO_GETCONTROL2", _IOC_READ, 0x4689, 0x04 },
+{ "linux/arcfb.h", "FBIO_WAITEVENT", _IOC_NONE, 0x4688, 0x00 },
+{ "linux/aspeed-lpc-ctrl.h", "ASPEED_LPC_CTRL_IOCTL_GET_SIZE", _IOC_READ|_IOC_WRITE, 0xb200, 0x10 },
+{ "linux/aspeed-lpc-ctrl.h", "ASPEED_LPC_CTRL_IOCTL_MAP", _IOC_WRITE, 0xb201, 0x10 },
+{ "linux/aspeed-p2a-ctrl.h", "ASPEED_P2A_CTRL_IOCTL_GET_MEMORY_CONFIG", _IOC_READ|_IOC_WRITE, 0xb301, 0x10 },
+{ "linux/aspeed-p2a-ctrl.h", "ASPEED_P2A_CTRL_IOCTL_SET_WINDOW", _IOC_WRITE, 0xb300, 0x10 },
+{ "linux/atm_eni.h", "ENI_MEMDUMP", _IOC_WRITE, 0x6160, 0x0c },
+{ "linux/atm_eni.h", "ENI_SETMULT", _IOC_WRITE, 0x6167, 0x0c },
+{ "linux/atm_he.h", "HE_GET_REG", _IOC_WRITE, 0x6160, 0x0c },
+{ "linux/atm_idt77105.h", "IDT77105_GETSTAT", _IOC_WRITE, 0x6132, 0x0c },
+{ "linux/atm_idt77105.h", "IDT77105_GETSTATZ", _IOC_WRITE, 0x6133, 0x0c },
+{ "linux/atm_nicstar.h", "NS_ADJBUFLEV", _IOC_NONE, 0x6163, 0x00 },
+{ "linux/atm_nicstar.h", "NS_GETPSTAT", _IOC_READ|_IOC_WRITE, 0x6161, 0x0c },
+{ "linux/atm_nicstar.h", "NS_SETBUFLEV", _IOC_WRITE, 0x6162, 0x0c },
+{ "linux/atm_tcp.h", "ATMTCP_CREATE", _IOC_NONE, 0x618e, 0x00 },
+{ "linux/atm_tcp.h", "ATMTCP_REMOVE", _IOC_NONE, 0x618f, 0x00 },
+{ "linux/atm_tcp.h", "SIOCSIFATMTCP", _IOC_NONE, 0x6180, 0x00 },
+{ "linux/atm_zatm.h", "ZATM_GETPOOL", _IOC_WRITE, 0x6161, 0x0c },
+{ "linux/atm_zatm.h", "ZATM_GETPOOLZ", _IOC_WRITE, 0x6162, 0x0c },
+{ "linux/atm_zatm.h", "ZATM_SETPOOL", _IOC_WRITE, 0x6163, 0x0c },
+{ "linux/atmarp.h", "ATMARPD_CTRL", _IOC_NONE, 0x61e1, 0x00 },
+{ "linux/atmarp.h", "ATMARP_ENCAP", _IOC_NONE, 0x61e5, 0x00 },
+{ "linux/atmarp.h", "ATMARP_MKIP", _IOC_NONE, 0x61e2, 0x00 },
+{ "linux/atmarp.h", "ATMARP_SETENTRY", _IOC_NONE, 0x61e3, 0x00 },
+{ "linux/atmbr2684.h", "BR2684_SETFILT", _IOC_WRITE, 0x6190, 0x1c },
+{ "linux/atmclip.h", "SIOCMKCLIP", _IOC_NONE, 0x61e0, 0x00 },
+{ "linux/atmdev.h", "ATM_ADDADDR", _IOC_WRITE, 0x6188, 0x0c },
+{ "linux/atmdev.h", "ATM_ADDLECSADDR", _IOC_WRITE, 0x618e, 0x0c },
+{ "linux/atmdev.h", "ATM_ADDPARTY", _IOC_WRITE, 0x61f4, 0x08 },
+{ "linux/atmdev.h", "ATM_DELADDR", _IOC_WRITE, 0x6189, 0x0c },
+{ "linux/atmdev.h", "ATM_DELLECSADDR", _IOC_WRITE, 0x618f, 0x0c },
+{ "linux/atmdev.h", "ATM_DROPPARTY", _IOC_WRITE, 0x61f5, 0x04 },
+{ "linux/atmdev.h", "ATM_GETADDR", _IOC_WRITE, 0x6186, 0x0c },
+{ "linux/atmdev.h", "ATM_GETCIRANGE", _IOC_WRITE, 0x618a, 0x0c },
+{ "linux/atmdev.h", "ATM_GETESI", _IOC_WRITE, 0x6185, 0x0c },
+{ "linux/atmdev.h", "ATM_GETLECSADDR", _IOC_WRITE, 0x6190, 0x0c },
+{ "linux/atmdev.h", "ATM_GETLINKRATE", _IOC_WRITE, 0x6181, 0x0c },
+{ "linux/atmdev.h", "ATM_GETLOOP", _IOC_WRITE, 0x6152, 0x0c },
+{ "linux/atmdev.h", "ATM_GETNAMES", _IOC_WRITE, 0x6183, 0x08 },
+{ "linux/atmdev.h", "ATM_GETSTAT", _IOC_WRITE, 0x6150, 0x0c },
+{ "linux/atmdev.h", "ATM_GETSTATZ", _IOC_WRITE, 0x6151, 0x0c },
+{ "linux/atmdev.h", "ATM_GETTYPE", _IOC_WRITE, 0x6184, 0x0c },
+{ "linux/atmdev.h", "ATM_NEWBACKENDIF", _IOC_WRITE, 0x61f3, 0x02 },
+{ "linux/atmdev.h", "ATM_QUERYLOOP", _IOC_WRITE, 0x6154, 0x0c },
+{ "linux/atmdev.h", "ATM_RSTADDR", _IOC_WRITE, 0x6187, 0x0c },
+{ "linux/atmdev.h", "ATM_SETBACKEND", _IOC_WRITE, 0x61f2, 0x02 },
+{ "linux/atmdev.h", "ATM_SETCIRANGE", _IOC_WRITE, 0x618b, 0x0c },
+{ "linux/atmdev.h", "ATM_SETESI", _IOC_WRITE, 0x618c, 0x0c },
+{ "linux/atmdev.h", "ATM_SETESIF", _IOC_WRITE, 0x618d, 0x0c },
+{ "linux/atmdev.h", "ATM_SETLOOP", _IOC_WRITE, 0x6153, 0x0c },
+{ "linux/atmdev.h", "ATM_SETSC", _IOC_WRITE, 0x61f1, 0x04 },
+{ "linux/atmlec.h", "ATMLEC_CTRL", _IOC_NONE, 0x61d0, 0x00 },
+{ "linux/atmlec.h", "ATMLEC_DATA", _IOC_NONE, 0x61d1, 0x00 },
+{ "linux/atmlec.h", "ATMLEC_MCAST", _IOC_NONE, 0x61d2, 0x00 },
+{ "linux/atmmpc.h", "ATMMPC_CTRL", _IOC_NONE, 0x61d8, 0x00 },
+{ "linux/atmmpc.h", "ATMMPC_DATA", _IOC_NONE, 0x61d9, 0x00 },
+{ "linux/atmsvc.h", "ATMSIGD_CTRL", _IOC_NONE, 0x61f0, 0x00 },
+{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_ASKUMOUNT", _IOC_READ|_IOC_WRITE, 0x937d, 0x18 },
+{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_CATATONIC", _IOC_READ|_IOC_WRITE, 0x9379, 0x18 },
+{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_CLOSEMOUNT", _IOC_READ|_IOC_WRITE, 0x9375, 0x18 },
+{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_EXPIRE", _IOC_READ|_IOC_WRITE, 0x937c, 0x18 },
+{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_FAIL", _IOC_READ|_IOC_WRITE, 0x9377, 0x18 },
+{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_ISMOUNTPOINT", _IOC_READ|_IOC_WRITE, 0x937e, 0x18 },
+{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_OPENMOUNT", _IOC_READ|_IOC_WRITE, 0x9374, 0x18 },
+{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_PROTOSUBVER", _IOC_READ|_IOC_WRITE, 0x9373, 0x18 },
+{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_PROTOVER", _IOC_READ|_IOC_WRITE, 0x9372, 0x18 },
+{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_READY", _IOC_READ|_IOC_WRITE, 0x9376, 0x18 },
+{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_REQUESTER", _IOC_READ|_IOC_WRITE, 0x937b, 0x18 },
+{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_SETPIPEFD", _IOC_READ|_IOC_WRITE, 0x9378, 0x18 },
+{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_TIMEOUT", _IOC_READ|_IOC_WRITE, 0x937a, 0x18 },
+{ "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_VERSION", _IOC_READ|_IOC_WRITE, 0x9371, 0x18 },
+{ "linux/auto_fs.h", "AUTOFS_IOC_ASKUMOUNT", _IOC_READ, 0x9370, 0x04 },
+{ "linux/auto_fs.h", "AUTOFS_IOC_CATATONIC", _IOC_NONE, 0x9362, 0x00 },
+{ "linux/auto_fs.h", "AUTOFS_IOC_EXPIRE", _IOC_READ, 0x9365, 0x10c },
+{ "linux/auto_fs.h", "AUTOFS_IOC_EXPIRE_MULTI", _IOC_WRITE, 0x9366, 0x04 },
+{ "linux/auto_fs.h", "AUTOFS_IOC_FAIL", _IOC_NONE, 0x9361, 0x00 },
+{ "linux/auto_fs.h", "AUTOFS_IOC_PROTOSUBVER", _IOC_READ, 0x9367, 0x04 },
+{ "linux/auto_fs.h", "AUTOFS_IOC_PROTOVER", _IOC_READ, 0x9363, 0x04 },
+{ "linux/auto_fs.h", "AUTOFS_IOC_READY", _IOC_NONE, 0x9360, 0x00 },
+{ "linux/auto_fs.h", "AUTOFS_IOC_SETTIMEOUT32", _IOC_READ|_IOC_WRITE, 0x9364, 0x04 },
+{ "linux/blkpg.h", "BLKPG", _IOC_NONE, 0x1269, 0x00 },
+{ "linux/blkzoned.h", "BLKCLOSEZONE", _IOC_WRITE, 0x1287, 0x10 },
+{ "linux/blkzoned.h", "BLKFINISHZONE", _IOC_WRITE, 0x1288, 0x10 },
+{ "linux/blkzoned.h", "BLKGETNRZONES", _IOC_READ, 0x1285, 0x04 },
+{ "linux/blkzoned.h", "BLKGETZONESZ", _IOC_READ, 0x1284, 0x04 },
+{ "linux/blkzoned.h", "BLKOPENZONE", _IOC_WRITE, 0x1286, 0x10 },
+{ "linux/blkzoned.h", "BLKREPORTZONE", _IOC_READ|_IOC_WRITE, 0x1282, 0x10 },
+{ "linux/blkzoned.h", "BLKRESETZONE", _IOC_WRITE, 0x1283, 0x10 },
+{ "linux/bt-bmc.h", "BT_BMC_IOCTL_SMS_ATN", _IOC_NONE, 0xb100, 0x00 },
+{ "linux/btrfs.h", "BTRFS_IOC_ADD_DEV", _IOC_WRITE, 0x940a, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_BALANCE", _IOC_WRITE, 0x940c, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_BALANCE_CTL", _IOC_WRITE, 0x9421, 0x04 },
+{ "linux/btrfs.h", "BTRFS_IOC_BALANCE_PROGRESS", _IOC_READ, 0x9422, 0x400 },
+{ "linux/btrfs.h", "BTRFS_IOC_BALANCE_V2", _IOC_READ|_IOC_WRITE, 0x9420, 0x400 },
+{ "linux/btrfs.h", "BTRFS_IOC_CLONE", _IOC_WRITE, 0x9409, 0x04 },
+{ "linux/btrfs.h", "BTRFS_IOC_CLONE_RANGE", _IOC_WRITE, 0x940d, 0x20 },
+{ "linux/btrfs.h", "BTRFS_IOC_DEFAULT_SUBVOL", _IOC_WRITE, 0x9413, 0x08 },
+{ "linux/btrfs.h", "BTRFS_IOC_DEFRAG", _IOC_WRITE, 0x9402, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_DEFRAG_RANGE", _IOC_WRITE, 0x9410, 0x30 },
+{ "linux/btrfs.h", "BTRFS_IOC_DEVICES_READY", _IOC_READ, 0x9427, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_DEV_INFO", _IOC_READ|_IOC_WRITE, 0x941e, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_DEV_REPLACE", _IOC_READ|_IOC_WRITE, 0x9435, 0xa28 },
+{ "linux/btrfs.h", "BTRFS_IOC_FILE_EXTENT_SAME", _IOC_READ|_IOC_WRITE, 0x9436, 0x18 },
+{ "linux/btrfs.h", "BTRFS_IOC_FORGET_DEV", _IOC_WRITE, 0x9405, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_FS_INFO", _IOC_READ, 0x941f, 0x400 },
+{ "linux/btrfs.h", "BTRFS_IOC_GET_DEV_STATS", _IOC_READ|_IOC_WRITE, 0x9434, 0x408 },
+{ "linux/btrfs.h", "BTRFS_IOC_GET_FEATURES", _IOC_READ, 0x9439, 0x18 },
+{ "linux/btrfs.h", "BTRFS_IOC_GET_SUBVOL_INFO", _IOC_READ, 0x943c, 0x1f8 },
+{ "linux/btrfs.h", "BTRFS_IOC_GET_SUBVOL_ROOTREF", _IOC_READ|_IOC_WRITE, 0x943d, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_GET_SUPPORTED_FEATURES", _IOC_READ, 0x9439, 0x48 },
+{ "linux/btrfs.h", "BTRFS_IOC_INO_LOOKUP", _IOC_READ|_IOC_WRITE, 0x9412, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_INO_LOOKUP_USER", _IOC_READ|_IOC_WRITE, 0x943e, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_INO_PATHS", _IOC_READ|_IOC_WRITE, 0x9423, 0x38 },
+{ "linux/btrfs.h", "BTRFS_IOC_LOGICAL_INO", _IOC_READ|_IOC_WRITE, 0x9424, 0x38 },
+{ "linux/btrfs.h", "BTRFS_IOC_LOGICAL_INO_V2", _IOC_READ|_IOC_WRITE, 0x943b, 0x38 },
+{ "linux/btrfs.h", "BTRFS_IOC_QGROUP_ASSIGN", _IOC_WRITE, 0x9429, 0x18 },
+{ "linux/btrfs.h", "BTRFS_IOC_QGROUP_CREATE", _IOC_WRITE, 0x942a, 0x10 },
+{ "linux/btrfs.h", "BTRFS_IOC_QGROUP_LIMIT", _IOC_READ, 0x942b, 0x30 },
+{ "linux/btrfs.h", "BTRFS_IOC_QUOTA_CTL", _IOC_READ|_IOC_WRITE, 0x9428, 0x10 },
+{ "linux/btrfs.h", "BTRFS_IOC_QUOTA_RESCAN", _IOC_WRITE, 0x942c, 0x40 },
+{ "linux/btrfs.h", "BTRFS_IOC_QUOTA_RESCAN_STATUS", _IOC_READ, 0x942d, 0x40 },
+{ "linux/btrfs.h", "BTRFS_IOC_QUOTA_RESCAN_WAIT", _IOC_NONE, 0x942e, 0x00 },
+{ "linux/btrfs.h", "BTRFS_IOC_RESIZE", _IOC_WRITE, 0x9403, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_RM_DEV", _IOC_WRITE, 0x940b, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_RM_DEV_V2", _IOC_WRITE, 0x943a, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_SCAN_DEV", _IOC_WRITE, 0x9404, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_SCRUB", _IOC_READ|_IOC_WRITE, 0x941b, 0x400 },
+{ "linux/btrfs.h", "BTRFS_IOC_SCRUB_CANCEL", _IOC_NONE, 0x941c, 0x00 },
+{ "linux/btrfs.h", "BTRFS_IOC_SCRUB_PROGRESS", _IOC_READ|_IOC_WRITE, 0x941d, 0x400 },
+{ "linux/btrfs.h", "BTRFS_IOC_SEND", _IOC_WRITE, 0x9426, 0x48 },
+{ "linux/btrfs.h", "BTRFS_IOC_SET_FEATURES", _IOC_WRITE, 0x9439, 0x30 },
+{ "linux/btrfs.h", "BTRFS_IOC_SET_RECEIVED_SUBVOL", _IOC_READ|_IOC_WRITE, 0x9425, 0xc8 },
+{ "linux/btrfs.h", "BTRFS_IOC_SNAP_CREATE", _IOC_WRITE, 0x9401, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_SNAP_CREATE_V2", _IOC_WRITE, 0x9417, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_SNAP_DESTROY", _IOC_WRITE, 0x940f, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_SNAP_DESTROY_V2", _IOC_WRITE, 0x943f, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_SPACE_INFO", _IOC_READ|_IOC_WRITE, 0x9414, 0x10 },
+{ "linux/btrfs.h", "BTRFS_IOC_START_SYNC", _IOC_READ, 0x9418, 0x08 },
+{ "linux/btrfs.h", "BTRFS_IOC_SUBVOL_CREATE", _IOC_WRITE, 0x940e, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_SUBVOL_CREATE_V2", _IOC_WRITE, 0x9418, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_SUBVOL_GETFLAGS", _IOC_READ, 0x9419, 0x08 },
+{ "linux/btrfs.h", "BTRFS_IOC_SUBVOL_SETFLAGS", _IOC_WRITE, 0x941a, 0x08 },
+{ "linux/btrfs.h", "BTRFS_IOC_SYNC", _IOC_NONE, 0x9408, 0x00 },
+{ "linux/btrfs.h", "BTRFS_IOC_TRANS_END", _IOC_NONE, 0x9407, 0x00 },
+{ "linux/btrfs.h", "BTRFS_IOC_TRANS_START", _IOC_NONE, 0x9406, 0x00 },
+{ "linux/btrfs.h", "BTRFS_IOC_TREE_SEARCH", _IOC_READ|_IOC_WRITE, 0x9411, 0x1000 },
+{ "linux/btrfs.h", "BTRFS_IOC_TREE_SEARCH_V2", _IOC_READ|_IOC_WRITE, 0x9411, 0x70 },
+{ "linux/btrfs.h", "BTRFS_IOC_WAIT_SYNC", _IOC_WRITE, 0x9416, 0x08 },
+{ "linux/capi.h", "CAPI_CLR_FLAGS", _IOC_READ, 0x4325, 0x04 },
+{ "linux/capi.h", "CAPI_GET_ERRCODE", _IOC_READ, 0x4321, 0x02 },
+{ "linux/capi.h", "CAPI_GET_FLAGS", _IOC_READ, 0x4323, 0x04 },
+{ "linux/capi.h", "CAPI_GET_MANUFACTURER", _IOC_READ|_IOC_WRITE, 0x4306, 0x04 },
+{ "linux/capi.h", "CAPI_GET_PROFILE", _IOC_READ|_IOC_WRITE, 0x4309, 0x40 },
+{ "linux/capi.h", "CAPI_GET_SERIAL", _IOC_READ|_IOC_WRITE, 0x4308, 0x04 },
+{ "linux/capi.h", "CAPI_GET_VERSION", _IOC_READ|_IOC_WRITE, 0x4307, 0x10 },
+{ "linux/capi.h", "CAPI_INSTALLED", _IOC_READ, 0x4322, 0x02 },
+{ "linux/capi.h", "CAPI_MANUFACTURER_CMD", _IOC_READ|_IOC_WRITE, 0x4320, 0x08 },
+{ "linux/capi.h", "CAPI_NCCI_GETUNIT", _IOC_READ, 0x4327, 0x04 },
+{ "linux/capi.h", "CAPI_NCCI_OPENCOUNT", _IOC_READ, 0x4326, 0x04 },
+{ "linux/capi.h", "CAPI_REGISTER", _IOC_WRITE, 0x4301, 0x0c },
+{ "linux/capi.h", "CAPI_SET_FLAGS", _IOC_READ, 0x4324, 0x04 },
+{ "linux/cciss_ioctl.h", "CCISS_BIG_PASSTHRU", _IOC_READ|_IOC_WRITE, 0x4212, 0x58 },
+{ "linux/cciss_ioctl.h", "CCISS_DEREGDISK", _IOC_NONE, 0x420c, 0x00 },
+{ "linux/cciss_ioctl.h", "CCISS_GETBUSTYPES", _IOC_READ, 0x4207, 0x04 },
+{ "linux/cciss_ioctl.h", "CCISS_GETDRIVVER", _IOC_READ, 0x4209, 0x04 },
+{ "linux/cciss_ioctl.h", "CCISS_GETFIRMVER", _IOC_READ, 0x4208, 0x04 },
+{ "linux/cciss_ioctl.h", "CCISS_GETHEARTBEAT", _IOC_READ, 0x4206, 0x04 },
+{ "linux/cciss_ioctl.h", "CCISS_GETINTINFO", _IOC_READ, 0x4202, 0x08 },
+{ "linux/cciss_ioctl.h", "CCISS_GETLUNINFO", _IOC_READ, 0x4211, 0x0c },
+{ "linux/cciss_ioctl.h", "CCISS_GETNODENAME", _IOC_READ, 0x4204, 0x10 },
+{ "linux/cciss_ioctl.h", "CCISS_GETPCIINFO", _IOC_READ, 0x4201, 0x08 },
+{ "linux/cciss_ioctl.h", "CCISS_PASSTHRU", _IOC_READ|_IOC_WRITE, 0x420b, 0x54 },
+{ "linux/cciss_ioctl.h", "CCISS_REGNEWD", _IOC_NONE, 0x420e, 0x00 },
+{ "linux/cciss_ioctl.h", "CCISS_REGNEWDISK", _IOC_WRITE, 0x420d, 0x04 },
+{ "linux/cciss_ioctl.h", "CCISS_RESCANDISK", _IOC_NONE, 0x4210, 0x00 },
+{ "linux/cciss_ioctl.h", "CCISS_REVALIDVOLS", _IOC_NONE, 0x420a, 0x00 },
+{ "linux/cciss_ioctl.h", "CCISS_SETINTINFO", _IOC_WRITE, 0x4203, 0x08 },
+{ "linux/cciss_ioctl.h", "CCISS_SETNODENAME", _IOC_WRITE, 0x4205, 0x10 },
+{ "linux/cdrom.h", "CDROMAUDIOBUFSIZ", 0, 0x5382, 0 },
+{ "linux/cdrom.h", "CDROMCLOSETRAY", 0, 0x5319, 0 },
+{ "linux/cdrom.h", "CDROMEJECT", 0, 0x5309, 0 },
+{ "linux/cdrom.h", "CDROMEJECT_SW", 0, 0x530f, 0 },
+{ "linux/cdrom.h", "CDROMGETSPINDOWN", 0, 0x531d, 0 },
+{ "linux/cdrom.h", "CDROMMULTISESSION", 0, 0x5310, 0 },
+{ "linux/cdrom.h", "CDROMPAUSE", 0, 0x5301, 0 },
+{ "linux/cdrom.h", "CDROMPLAYBLK", 0, 0x5317, 0 },
+{ "linux/cdrom.h", "CDROMPLAYMSF", 0, 0x5303, 0 },
+{ "linux/cdrom.h", "CDROMPLAYTRKIND", 0, 0x5304, 0 },
+{ "linux/cdrom.h", "CDROMREADALL", 0, 0x5318, 0 },
+{ "linux/cdrom.h", "CDROMREADAUDIO", 0, 0x530e, 0 },
+{ "linux/cdrom.h", "CDROMREADCOOKED", 0, 0x5315, 0 },
+{ "linux/cdrom.h", "CDROMREADMODE1", 0, 0x530d, 0 },
+{ "linux/cdrom.h", "CDROMREADMODE2", 0, 0x530c, 0 },
+{ "linux/cdrom.h", "CDROMREADRAW", 0, 0x5314, 0 },
+{ "linux/cdrom.h", "CDROMREADTOCENTRY", 0, 0x5306, 0 },
+{ "linux/cdrom.h", "CDROMREADTOCHDR", 0, 0x5305, 0 },
+{ "linux/cdrom.h", "CDROMRESET", 0, 0x5312, 0 },
+{ "linux/cdrom.h", "CDROMRESUME", 0, 0x5302, 0 },
+{ "linux/cdrom.h", "CDROMSEEK", 0, 0x5316, 0 },
+{ "linux/cdrom.h", "CDROMSETSPINDOWN", 0, 0x531e, 0 },
+{ "linux/cdrom.h", "CDROMSTART", 0, 0x5308, 0 },
+{ "linux/cdrom.h", "CDROMSTOP", 0, 0x5307, 0 },
+{ "linux/cdrom.h", "CDROMSUBCHNL", 0, 0x530b, 0 },
+{ "linux/cdrom.h", "CDROMVOLCTRL", 0, 0x530a, 0 },
+{ "linux/cdrom.h", "CDROMVOLREAD", 0, 0x5313, 0 },
+{ "linux/cdrom.h", "CDROM_CHANGER_NSLOTS", 0, 0x5328, 0 },
+{ "linux/cdrom.h", "CDROM_CLEAR_OPTIONS", 0, 0x5321, 0 },
+{ "linux/cdrom.h", "CDROM_DEBUG", 0, 0x5330, 0 },
+{ "linux/cdrom.h", "CDROM_DISC_STATUS", 0, 0x5327, 0 },
+{ "linux/cdrom.h", "CDROM_DRIVE_STATUS", 0, 0x5326, 0 },
+{ "linux/cdrom.h", "CDROM_GET_CAPABILITY", 0, 0x5331, 0 },
+{ "linux/cdrom.h", "CDROM_GET_MCN", 0, 0x5311, 0 },
+{ "linux/cdrom.h", "CDROM_LAST_WRITTEN", 0, 0x5395, 0 },
+{ "linux/cdrom.h", "CDROM_LOCKDOOR", 0, 0x5329, 0 },
+{ "linux/cdrom.h", "CDROM_MEDIA_CHANGED", 0, 0x5325, 0 },
+{ "linux/cdrom.h", "CDROM_NEXT_WRITABLE", 0, 0x5394, 0 },
+{ "linux/cdrom.h", "CDROM_SELECT_DISC", 0, 0x5323, 0 },
+{ "linux/cdrom.h", "CDROM_SELECT_SPEED", 0, 0x5322, 0 },
+{ "linux/cdrom.h", "CDROM_SEND_PACKET", 0, 0x5393, 0 },
+{ "linux/cdrom.h", "CDROM_SET_OPTIONS", 0, 0x5320, 0 },
+{ "linux/cdrom.h", "DVD_AUTH", 0, 0x5392, 0 },
+{ "linux/cdrom.h", "DVD_READ_STRUCT", 0, 0x5390, 0 },
+{ "linux/cdrom.h", "DVD_WRITE_STRUCT", 0, 0x5391, 0 },
+{ "linux/cec.h", "CEC_ADAP_G_CAPS", _IOC_READ|_IOC_WRITE, 0x6100, 0x4c },
+{ "linux/cec.h", "CEC_ADAP_G_CONNECTOR_INFO", _IOC_READ, 0x610a, 0x44 },
+{ "linux/cec.h", "CEC_ADAP_G_LOG_ADDRS", _IOC_READ, 0x6103, 0x5c },
+{ "linux/cec.h", "CEC_ADAP_G_PHYS_ADDR", _IOC_READ, 0x6101, 0x02 },
+{ "linux/cec.h", "CEC_ADAP_S_LOG_ADDRS", _IOC_READ|_IOC_WRITE, 0x6104, 0x5c },
+{ "linux/cec.h", "CEC_ADAP_S_PHYS_ADDR", _IOC_WRITE, 0x6102, 0x02 },
+{ "linux/cec.h", "CEC_DQEVENT", _IOC_READ|_IOC_WRITE, 0x6107, 0x50 },
+{ "linux/cec.h", "CEC_G_MODE", _IOC_READ, 0x6108, 0x04 },
+{ "linux/cec.h", "CEC_RECEIVE", _IOC_READ|_IOC_WRITE, 0x6106, 0x38 },
+{ "linux/cec.h", "CEC_S_MODE", _IOC_WRITE, 0x6109, 0x04 },
+{ "linux/cec.h", "CEC_TRANSMIT", _IOC_READ|_IOC_WRITE, 0x6105, 0x38 },
+{ "linux/chio.h", "CHIOEXCHANGE", _IOC_WRITE, 0x6302, 0x1c },
+{ "linux/chio.h", "CHIOGELEM", _IOC_WRITE, 0x6310, 0x6c },
+{ "linux/chio.h", "CHIOGPARAMS", _IOC_READ, 0x6306, 0x14 },
+{ "linux/chio.h", "CHIOGPICKER", _IOC_READ, 0x6304, 0x04 },
+{ "linux/chio.h", "CHIOGSTATUS", _IOC_WRITE, 0x6308, 0x08 },
+{ "linux/chio.h", "CHIOGVPARAMS", _IOC_READ, 0x6313, 0x70 },
+{ "linux/chio.h", "CHIOINITELEM", _IOC_NONE, 0x6311, 0x00 },
+{ "linux/chio.h", "CHIOMOVE", _IOC_WRITE, 0x6301, 0x14 },
+{ "linux/chio.h", "CHIOPOSITION", _IOC_WRITE, 0x6303, 0x0c },
+{ "linux/chio.h", "CHIOSPICKER", _IOC_WRITE, 0x6305, 0x04 },
+{ "linux/chio.h", "CHIOSVOLTAG", _IOC_WRITE, 0x6312, 0x30 },
+{ "linux/cm4000_cs.h", "CM_IOCARDOFF", _IOC_NONE, 0x6304, 0x00 },
+{ "linux/cm4000_cs.h", "CM_IOCGATR", _IOC_READ|_IOC_WRITE, 0x6301, 0x04 },
+{ "linux/cm4000_cs.h", "CM_IOCGSTATUS", _IOC_READ, 0x6300, 0x04 },
+{ "linux/cm4000_cs.h", "CM_IOCSPTS", _IOC_WRITE, 0x6302, 0x04 },
+{ "linux/cm4000_cs.h", "CM_IOCSRDR", _IOC_NONE, 0x6303, 0x00 },
+{ "linux/cm4000_cs.h", "CM_IOSDBGLVL", _IOC_WRITE, 0x63fa, 0x04 },
+{ "linux/coda.h", "CIOC_KERNEL_VERSION", _IOC_READ|_IOC_WRITE, 0x630a, 0x04 },
+{ "linux/dm-ioctl.h", "DM_DEV_ARM_POLL", _IOC_READ|_IOC_WRITE, 0xfd10, 0x138 },
+{ "linux/dm-ioctl.h", "DM_DEV_CREATE", _IOC_READ|_IOC_WRITE, 0xfd03, 0x138 },
+{ "linux/dm-ioctl.h", "DM_DEV_REMOVE", _IOC_READ|_IOC_WRITE, 0xfd04, 0x138 },
+{ "linux/dm-ioctl.h", "DM_DEV_RENAME", _IOC_READ|_IOC_WRITE, 0xfd05, 0x138 },
+{ "linux/dm-ioctl.h", "DM_DEV_SET_GEOMETRY", _IOC_READ|_IOC_WRITE, 0xfd0f, 0x138 },
+{ "linux/dm-ioctl.h", "DM_DEV_STATUS", _IOC_READ|_IOC_WRITE, 0xfd07, 0x138 },
+{ "linux/dm-ioctl.h", "DM_DEV_SUSPEND", _IOC_READ|_IOC_WRITE, 0xfd06, 0x138 },
+{ "linux/dm-ioctl.h", "DM_DEV_WAIT", _IOC_READ|_IOC_WRITE, 0xfd08, 0x138 },
+{ "linux/dm-ioctl.h", "DM_GET_TARGET_VERSION", _IOC_READ|_IOC_WRITE, 0xfd11, 0x138 },
+{ "linux/dm-ioctl.h", "DM_LIST_DEVICES", _IOC_READ|_IOC_WRITE, 0xfd02, 0x138 },
+{ "linux/dm-ioctl.h", "DM_LIST_VERSIONS", _IOC_READ|_IOC_WRITE, 0xfd0d, 0x138 },
+{ "linux/dm-ioctl.h", "DM_REMOVE_ALL", _IOC_READ|_IOC_WRITE, 0xfd01, 0x138 },
+{ "linux/dm-ioctl.h", "DM_TABLE_CLEAR", _IOC_READ|_IOC_WRITE, 0xfd0a, 0x138 },
+{ "linux/dm-ioctl.h", "DM_TABLE_DEPS", _IOC_READ|_IOC_WRITE, 0xfd0b, 0x138 },
+{ "linux/dm-ioctl.h", "DM_TABLE_LOAD", _IOC_READ|_IOC_WRITE, 0xfd09, 0x138 },
+{ "linux/dm-ioctl.h", "DM_TABLE_STATUS", _IOC_READ|_IOC_WRITE, 0xfd0c, 0x138 },
+{ "linux/dm-ioctl.h", "DM_TARGET_MSG", _IOC_READ|_IOC_WRITE, 0xfd0e, 0x138 },
+{ "linux/dm-ioctl.h", "DM_VERSION", _IOC_READ|_IOC_WRITE, 0xfd00, 0x138 },
+{ "linux/dma-buf.h", "DMA_BUF_IOCTL_SYNC", _IOC_WRITE, 0x6200, 0x08 },
+{ "linux/dma-buf.h", "DMA_BUF_SET_NAME_A", _IOC_WRITE, 0x6201, 0x04 },
+{ "linux/dma-buf.h", "DMA_BUF_SET_NAME_B", _IOC_WRITE, 0x6201, 0x08 },
+{ "linux/dma-heap.h", "DMA_HEAP_IOCTL_ALLOC", _IOC_READ|_IOC_WRITE, 0x4800, 0x18 },
+{ "linux/dn.h", "OSIOCGNETADDR", _IOC_READ, 0x89e1, 0x04 },
+{ "linux/dn.h", "OSIOCSNETADDR", _IOC_WRITE, 0x89e0, 0x04 },
+{ "linux/dvb/audio.h", "AUDIO_BILINGUAL_CHANNEL_SELECT", _IOC_NONE, 0x6f14, 0x00 },
+{ "linux/dvb/audio.h", "AUDIO_CHANNEL_SELECT", _IOC_NONE, 0x6f09, 0x00 },
+{ "linux/dvb/audio.h", "AUDIO_CLEAR_BUFFER", _IOC_NONE, 0x6f0c, 0x00 },
+{ "linux/dvb/audio.h", "AUDIO_CONTINUE", _IOC_NONE, 0x6f04, 0x00 },
+{ "linux/dvb/audio.h", "AUDIO_GET_CAPABILITIES", _IOC_READ, 0x6f0b, 0x04 },
+{ "linux/dvb/audio.h", "AUDIO_GET_STATUS", _IOC_READ, 0x6f0a, 0x20 },
+{ "linux/dvb/audio.h", "AUDIO_PAUSE", _IOC_NONE, 0x6f03, 0x00 },
+{ "linux/dvb/audio.h", "AUDIO_PLAY", _IOC_NONE, 0x6f02, 0x00 },
+{ "linux/dvb/audio.h", "AUDIO_SELECT_SOURCE", _IOC_NONE, 0x6f05, 0x00 },
+{ "linux/dvb/audio.h", "AUDIO_SET_AV_SYNC", _IOC_NONE, 0x6f07, 0x00 },
+{ "linux/dvb/audio.h", "AUDIO_SET_BYPASS_MODE", _IOC_NONE, 0x6f08, 0x00 },
+{ "linux/dvb/audio.h", "AUDIO_SET_ID", _IOC_NONE, 0x6f0d, 0x00 },
+{ "linux/dvb/audio.h", "AUDIO_SET_MIXER", _IOC_WRITE, 0x6f0e, 0x08 },
+{ "linux/dvb/audio.h", "AUDIO_SET_MUTE", _IOC_NONE, 0x6f06, 0x00 },
+{ "linux/dvb/audio.h", "AUDIO_SET_STREAMTYPE", _IOC_NONE, 0x6f0f, 0x00 },
+{ "linux/dvb/audio.h", "AUDIO_STOP", _IOC_NONE, 0x6f01, 0x00 },
+{ "linux/dvb/ca.h", "CA_GET_CAP", _IOC_READ, 0x6f81, 0x10 },
+{ "linux/dvb/ca.h", "CA_GET_DESCR_INFO", _IOC_READ, 0x6f83, 0x08 },
+{ "linux/dvb/ca.h", "CA_GET_MSG", _IOC_READ, 0x6f84, 0x10c },
+{ "linux/dvb/ca.h", "CA_GET_SLOT_INFO", _IOC_READ, 0x6f82, 0x0c },
+{ "linux/dvb/ca.h", "CA_RESET", _IOC_NONE, 0x6f80, 0x00 },
+{ "linux/dvb/ca.h", "CA_SEND_MSG", _IOC_WRITE, 0x6f85, 0x10c },
+{ "linux/dvb/ca.h", "CA_SET_DESCR", _IOC_WRITE, 0x6f86, 0x10 },
+{ "linux/dvb/dmx.h", "DMX_ADD_PID", _IOC_WRITE, 0x6f33, 0x02 },
+{ "linux/dvb/dmx.h", "DMX_DQBUF", _IOC_READ|_IOC_WRITE, 0x6f40, 0x18 },
+{ "linux/dvb/dmx.h", "DMX_EXPBUF", _IOC_READ|_IOC_WRITE, 0x6f3e, 0x0c },
+{ "linux/dvb/dmx.h", "DMX_GET_PES_PIDS", _IOC_READ, 0x6f2f, 0x0a },
+{ "linux/dvb/dmx.h", "DMX_GET_STC", _IOC_READ|_IOC_WRITE, 0x6f32, 0x10 },
+{ "linux/dvb/dmx.h", "DMX_QBUF", _IOC_READ|_IOC_WRITE, 0x6f3f, 0x18 },
+{ "linux/dvb/dmx.h", "DMX_QUERYBUF", _IOC_READ|_IOC_WRITE, 0x6f3d, 0x18 },
+{ "linux/dvb/dmx.h", "DMX_REMOVE_PID", _IOC_WRITE, 0x6f34, 0x02 },
+{ "linux/dvb/dmx.h", "DMX_REQBUFS", _IOC_READ|_IOC_WRITE, 0x6f3c, 0x08 },
+{ "linux/dvb/dmx.h", "DMX_SET_BUFFER_SIZE", _IOC_NONE, 0x6f2d, 0x00 },
+{ "linux/dvb/dmx.h", "DMX_SET_FILTER", _IOC_WRITE, 0x6f2b, 0x3c },
+{ "linux/dvb/dmx.h", "DMX_SET_PES_FILTER", _IOC_WRITE, 0x6f2c, 0x14 },
+{ "linux/dvb/dmx.h", "DMX_START", _IOC_NONE, 0x6f29, 0x00 },
+{ "linux/dvb/dmx.h", "DMX_STOP", _IOC_NONE, 0x6f2a, 0x00 },
+{ "linux/dvb/frontend.h", "FE_DISEQC_RECV_SLAVE_REPLY", _IOC_READ, 0x6f40, 0x0c },
+{ "linux/dvb/frontend.h", "FE_DISEQC_RESET_OVERLOAD", _IOC_NONE, 0x6f3e, 0x00 },
+{ "linux/dvb/frontend.h", "FE_DISEQC_SEND_BURST", _IOC_NONE, 0x6f41, 0x00 },
+{ "linux/dvb/frontend.h", "FE_DISEQC_SEND_MASTER_CMD", _IOC_WRITE, 0x6f3f, 0x07 },
+{ "linux/dvb/frontend.h", "FE_DISHNETWORK_SEND_LEGACY_CMD", _IOC_NONE, 0x6f50, 0x00 },
+{ "linux/dvb/frontend.h", "FE_ENABLE_HIGH_LNB_VOLTAGE", _IOC_NONE, 0x6f44, 0x00 },
+{ "linux/dvb/frontend.h", "FE_GET_EVENT", _IOC_READ, 0x6f4e, 0x28 },
+{ "linux/dvb/frontend.h", "FE_GET_FRONTEND", _IOC_READ, 0x6f4d, 0x24 },
+{ "linux/dvb/frontend.h", "FE_GET_INFO", _IOC_READ, 0x6f3d, 0xa8 },
+{ "linux/dvb/frontend.h", "FE_GET_PROPERTY", _IOC_READ, 0x6f53, 0x08 },
+{ "linux/dvb/frontend.h", "FE_READ_BER", _IOC_READ, 0x6f46, 0x04 },
+{ "linux/dvb/frontend.h", "FE_READ_SIGNAL_STRENGTH", _IOC_READ, 0x6f47, 0x02 },
+{ "linux/dvb/frontend.h", "FE_READ_SNR", _IOC_READ, 0x6f48, 0x02 },
+{ "linux/dvb/frontend.h", "FE_READ_STATUS", _IOC_READ, 0x6f45, 0x04 },
+{ "linux/dvb/frontend.h", "FE_READ_UNCORRECTED_BLOCKS", _IOC_READ, 0x6f49, 0x04 },
+{ "linux/dvb/frontend.h", "FE_SET_FRONTEND", _IOC_WRITE, 0x6f4c, 0x24 },
+{ "linux/dvb/frontend.h", "FE_SET_FRONTEND_TUNE_MODE", _IOC_NONE, 0x6f51, 0x00 },
+{ "linux/dvb/frontend.h", "FE_SET_PROPERTY", _IOC_WRITE, 0x6f52, 0x08 },
+{ "linux/dvb/frontend.h", "FE_SET_TONE", _IOC_NONE, 0x6f42, 0x00 },
+{ "linux/dvb/frontend.h", "FE_SET_VOLTAGE", _IOC_NONE, 0x6f43, 0x00 },
+{ "linux/dvb/net.h", "NET_ADD_IF", _IOC_READ|_IOC_WRITE, 0x6f34, 0x06 },
+{ "linux/dvb/net.h", "NET_GET_IF", _IOC_READ|_IOC_WRITE, 0x6f36, 0x06 },
+{ "linux/dvb/net.h", "NET_REMOVE_IF", _IOC_NONE, 0x6f35, 0x00 },
+{ "linux/dvb/osd.h", "OSD_GET_CAPABILITY", _IOC_READ, 0x6fa1, 0x08 },
+{ "linux/dvb/osd.h", "OSD_SEND_CMD", _IOC_WRITE, 0x6fa0, 0x1c },
+{ "linux/dvb/video.h", "VIDEO_CLEAR_BUFFER", _IOC_NONE, 0x6f22, 0x00 },
+{ "linux/dvb/video.h", "VIDEO_COMMAND", _IOC_READ|_IOC_WRITE, 0x6f3b, 0x48 },
+{ "linux/dvb/video.h", "VIDEO_CONTINUE", _IOC_NONE, 0x6f18, 0x00 },
+{ "linux/dvb/video.h", "VIDEO_FAST_FORWARD", _IOC_NONE, 0x6f1f, 0x00 },
+{ "linux/dvb/video.h", "VIDEO_FREEZE", _IOC_NONE, 0x6f17, 0x00 },
+{ "linux/dvb/video.h", "VIDEO_GET_CAPABILITIES", _IOC_READ, 0x6f21, 0x04 },
+{ "linux/dvb/video.h", "VIDEO_GET_EVENT", _IOC_READ, 0x6f1c, 0x14 },
+{ "linux/dvb/video.h", "VIDEO_GET_FRAME_COUNT", _IOC_READ, 0x6f3a, 0x08 },
+{ "linux/dvb/video.h", "VIDEO_GET_PTS", _IOC_READ, 0x6f39, 0x08 },
+{ "linux/dvb/video.h", "VIDEO_GET_SIZE", _IOC_READ, 0x6f37, 0x0c },
+{ "linux/dvb/video.h", "VIDEO_GET_STATUS", _IOC_READ, 0x6f1b, 0x14 },
+{ "linux/dvb/video.h", "VIDEO_PLAY", _IOC_NONE, 0x6f16, 0x00 },
+{ "linux/dvb/video.h", "VIDEO_SELECT_SOURCE", _IOC_NONE, 0x6f19, 0x00 },
+{ "linux/dvb/video.h", "VIDEO_SET_BLANK", _IOC_NONE, 0x6f1a, 0x00 },
+{ "linux/dvb/video.h", "VIDEO_SET_DISPLAY_FORMAT", _IOC_NONE, 0x6f1d, 0x00 },
+{ "linux/dvb/video.h", "VIDEO_SET_FORMAT", _IOC_NONE, 0x6f25, 0x00 },
+{ "linux/dvb/video.h", "VIDEO_SET_STREAMTYPE", _IOC_NONE, 0x6f24, 0x00 },
+{ "linux/dvb/video.h", "VIDEO_SLOWMOTION", _IOC_NONE, 0x6f20, 0x00 },
+{ "linux/dvb/video.h", "VIDEO_STILLPICTURE", _IOC_WRITE, 0x6f1e, 0x08 },
+{ "linux/dvb/video.h", "VIDEO_STOP", _IOC_NONE, 0x6f15, 0x00 },
+{ "linux/dvb/video.h", "VIDEO_TRY_COMMAND", _IOC_READ|_IOC_WRITE, 0x6f3c, 0x48 },
+{ "linux/fb.h", "FBIOBLANK", 0, 0x4611, 0 },
+{ "linux/fb.h", "FBIOGETCMAP", 0, 0x4604, 0 },
+{ "linux/fb.h", "FBIOGET_CON2FBMAP", 0, 0x460F, 0 },
+{ "linux/fb.h", "FBIOGET_DISPINFO", 0, 0x4618, 0 },
+{ "linux/fb.h", "FBIOGET_FSCREENINFO", 0, 0x4602, 0 },
+{ "linux/fb.h", "FBIOGET_GLYPH", 0, 0x4615, 0 },
+{ "linux/fb.h", "FBIOGET_HWCINFO", 0, 0x4616, 0 },
+{ "linux/fb.h", "FBIOGET_VBLANK", _IOC_READ, 0x4612, 0x20 },
+{ "linux/fb.h", "FBIOGET_VSCREENINFO", 0, 0x4600, 0 },
+{ "linux/fb.h", "FBIOPAN_DISPLAY", 0, 0x4606, 0 },
+{ "linux/fb.h", "FBIOPUTCMAP", 0, 0x4605, 0 },
+{ "linux/fb.h", "FBIOPUT_CON2FBMAP", 0, 0x4610, 0 },
+{ "linux/fb.h", "FBIOPUT_MODEINFO", 0, 0x4617, 0 },
+{ "linux/fb.h", "FBIOPUT_VSCREENINFO", 0, 0x4601, 0 },
+{ "linux/fb.h", "FBIO_ALLOC", 0, 0x4613, 0 },
+{ "linux/fb.h", "FBIO_CURSOR", _IOC_READ|_IOC_WRITE, 0x4608, 0x48 },
+{ "linux/fb.h", "FBIO_FREE", 0, 0x4614, 0 },
+{ "linux/fb.h", "FBIO_WAITFORVSYNC", _IOC_WRITE, 0x4620, 0x04 },
+{ "linux/fd.h", "FDCLRPRM", _IOC_NONE, 0x0241, 0x00 },
+{ "linux/fd.h", "FDDEFPRM", _IOC_WRITE, 0x0243, 0x1c },
+{ "linux/fd.h", "FDEJECT", _IOC_NONE, 0x025a, 0x00 },
+{ "linux/fd.h", "FDFLUSH", _IOC_NONE, 0x024b, 0x00 },
+{ "linux/fd.h", "FDFMTBEG", _IOC_NONE, 0x0247, 0x00 },
+{ "linux/fd.h", "FDFMTEND", _IOC_NONE, 0x0249, 0x00 },
+{ "linux/fd.h", "FDFMTTRK", _IOC_WRITE, 0x0248, 0x0c },
+{ "linux/fd.h", "FDGETDRVPRM", _IOC_READ, 0x0211, 0x58 },
+{ "linux/fd.h", "FDGETDRVSTAT", _IOC_READ, 0x0212, 0x34 },
+{ "linux/fd.h", "FDGETDRVTYP", _IOC_READ, 0x020f, 0x10 },
+{ "linux/fd.h", "FDGETFDCSTAT", _IOC_READ, 0x0215, 0x20 },
+{ "linux/fd.h", "FDGETMAXERRS", _IOC_READ, 0x020e, 0x14 },
+{ "linux/fd.h", "FDGETPRM", _IOC_READ, 0x0204, 0x1c },
+{ "linux/fd.h", "FDMSGOFF", _IOC_NONE, 0x0246, 0x00 },
+{ "linux/fd.h", "FDMSGON", _IOC_NONE, 0x0245, 0x00 },
+{ "linux/fd.h", "FDPOLLDRVSTAT", _IOC_READ, 0x0213, 0x34 },
+{ "linux/fd.h", "FDRAWCMD", _IOC_NONE, 0x0258, 0x00 },
+{ "linux/fd.h", "FDRESET", _IOC_NONE, 0x0254, 0x00 },
+{ "linux/fd.h", "FDSETDRVPRM", _IOC_WRITE, 0x0290, 0x58 },
+{ "linux/fd.h", "FDSETEMSGTRESH", _IOC_NONE, 0x024a, 0x00 },
+{ "linux/fd.h", "FDSETMAXERRS", _IOC_WRITE, 0x024c, 0x14 },
+{ "linux/fd.h", "FDSETPRM", _IOC_WRITE, 0x0242, 0x1c },
+{ "linux/fd.h", "FDTWADDLE", _IOC_NONE, 0x0259, 0x00 },
+{ "linux/fd.h", "FDWERRORCLR", _IOC_NONE, 0x0256, 0x00 },
+{ "linux/fd.h", "FDWERRORGET", _IOC_READ, 0x0217, 0x18 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_ADD_DESCRIPTOR", _IOC_READ|_IOC_WRITE, 0x2306, 0x18 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_ALLOCATE", _IOC_READ|_IOC_WRITE, 0x2302, 0x20 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_ALLOCATE_ISO_RESOURCE", _IOC_READ|_IOC_WRITE, 0x230d, 0x18 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_ALLOCATE_ISO_RESOURCE_ONCE", _IOC_WRITE, 0x230f, 0x18 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_CREATE_ISO_CONTEXT", _IOC_READ|_IOC_WRITE, 0x2308, 0x20 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_DEALLOCATE", _IOC_WRITE, 0x2303, 0x04 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_DEALLOCATE_ISO_RESOURCE", _IOC_WRITE, 0x230e, 0x04 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_DEALLOCATE_ISO_RESOURCE_ONCE", _IOC_WRITE, 0x2310, 0x18 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_FLUSH_ISO", _IOC_WRITE, 0x2318, 0x04 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_GET_CYCLE_TIMER", _IOC_READ, 0x230c, 0x10 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_GET_CYCLE_TIMER2", _IOC_READ|_IOC_WRITE, 0x2314, 0x18 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_GET_INFO", _IOC_READ|_IOC_WRITE, 0x2300, 0x28 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_GET_SPEED", _IOC_NONE, 0x2311, 0x00 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_INITIATE_BUS_RESET", _IOC_WRITE, 0x2305, 0x04 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_QUEUE_ISO", _IOC_READ|_IOC_WRITE, 0x2309, 0x18 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_RECEIVE_PHY_PACKETS", _IOC_WRITE, 0x2316, 0x08 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_REMOVE_DESCRIPTOR", _IOC_WRITE, 0x2307, 0x04 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_SEND_BROADCAST_REQUEST", _IOC_WRITE, 0x2312, 0x28 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_SEND_PHY_PACKET", _IOC_READ|_IOC_WRITE, 0x2315, 0x18 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_SEND_REQUEST", _IOC_WRITE, 0x2301, 0x28 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_SEND_RESPONSE", _IOC_WRITE, 0x2304, 0x18 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_SEND_STREAM_PACKET", _IOC_WRITE, 0x2313, 0x28 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_SET_ISO_CHANNELS", _IOC_WRITE, 0x2317, 0x10 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_START_ISO", _IOC_WRITE, 0x230a, 0x10 },
+{ "linux/firewire-cdev.h", "FW_CDEV_IOC_STOP_ISO", _IOC_WRITE, 0x230b, 0x04 },
+{ "linux/fpga-dfl.h", "DFL_FPGA_CHECK_EXTENSION", _IOC_NONE, 0xb601, 0x00 },
+{ "linux/fpga-dfl.h", "DFL_FPGA_FME_ERR_GET_IRQ_NUM", _IOC_READ, 0xb683, 0x04 },
+{ "linux/fpga-dfl.h", "DFL_FPGA_FME_ERR_SET_IRQ", _IOC_WRITE, 0xb684, 0x08 },
+{ "linux/fpga-dfl.h", "DFL_FPGA_FME_PORT_ASSIGN", _IOC_WRITE, 0xb682, 0x04 },
+{ "linux/fpga-dfl.h", "DFL_FPGA_FME_PORT_PR", _IOC_NONE, 0xb680, 0x00 },
+{ "linux/fpga-dfl.h", "DFL_FPGA_FME_PORT_RELEASE", _IOC_WRITE, 0xb681, 0x04 },
+{ "linux/fpga-dfl.h", "DFL_FPGA_GET_API_VERSION", _IOC_NONE, 0xb600, 0x00 },
+{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_DMA_MAP", _IOC_NONE, 0xb643, 0x00 },
+{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_DMA_UNMAP", _IOC_NONE, 0xb644, 0x00 },
+{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_ERR_GET_IRQ_NUM", _IOC_READ, 0xb645, 0x04 },
+{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_ERR_SET_IRQ", _IOC_WRITE, 0xb646, 0x08 },
+{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_GET_INFO", _IOC_NONE, 0xb641, 0x00 },
+{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_GET_REGION_INFO", _IOC_NONE, 0xb642, 0x00 },
+{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_RESET", _IOC_NONE, 0xb640, 0x00 },
+{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_UINT_GET_IRQ_NUM", _IOC_READ, 0xb647, 0x04 },
+{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_UINT_SET_IRQ", _IOC_WRITE, 0xb648, 0x08 },
+{ "linux/fs.h", "BLKALIGNOFF", _IOC_NONE, 0x127a, 0x00 },
+{ "linux/fs.h", "BLKBSZGET", _IOC_READ, 0x1270, 0x04 },
+{ "linux/fs.h", "BLKBSZSET", _IOC_WRITE, 0x1271, 0x04 },
+{ "linux/fs.h", "BLKDISCARD", _IOC_NONE, 0x1277, 0x00 },
+{ "linux/fs.h", "BLKDISCARDZEROES", _IOC_NONE, 0x127c, 0x00 },
+{ "linux/fs.h", "BLKFLSBUF", _IOC_NONE, 0x1261, 0x00 },
+{ "linux/fs.h", "BLKFRAGET", _IOC_NONE, 0x1265, 0x00 },
+{ "linux/fs.h", "BLKFRASET", _IOC_NONE, 0x1264, 0x00 },
+{ "linux/fs.h", "BLKGETSIZE", _IOC_NONE, 0x1260, 0x00 },
+{ "linux/fs.h", "BLKGETSIZE64", _IOC_READ, 0x1272, 0x04 },
+{ "linux/fs.h", "BLKIOMIN", _IOC_NONE, 0x1278, 0x00 },
+{ "linux/fs.h", "BLKIOOPT", _IOC_NONE, 0x1279, 0x00 },
+{ "linux/fs.h", "BLKPBSZGET", _IOC_NONE, 0x127b, 0x00 },
+{ "linux/fs.h", "BLKRAGET", _IOC_NONE, 0x1263, 0x00 },
+{ "linux/fs.h", "BLKRASET", _IOC_NONE, 0x1262, 0x00 },
+{ "linux/fs.h", "BLKROGET", _IOC_NONE, 0x125e, 0x00 },
+{ "linux/fs.h", "BLKROSET", _IOC_NONE, 0x125d, 0x00 },
+{ "linux/fs.h", "BLKROTATIONAL", _IOC_NONE, 0x127e, 0x00 },
+{ "linux/fs.h", "BLKRRPART", _IOC_NONE, 0x125f, 0x00 },
+{ "linux/fs.h", "BLKSECDISCARD", _IOC_NONE, 0x127d, 0x00 },
+{ "linux/fs.h", "BLKSECTGET", _IOC_NONE, 0x1267, 0x00 },
+{ "linux/fs.h", "BLKSECTSET", _IOC_NONE, 0x1266, 0x00 },
+{ "linux/fs.h", "BLKSSZGET", _IOC_NONE, 0x1268, 0x00 },
+{ "linux/fs.h", "BLKTRACESETUP", _IOC_READ|_IOC_WRITE, 0x1273, 0x48 },
+{ "linux/fs.h", "BLKTRACESTART", _IOC_NONE, 0x1274, 0x00 },
+{ "linux/fs.h", "BLKTRACESTOP", _IOC_NONE, 0x1275, 0x00 },
+{ "linux/fs.h", "BLKTRACETEARDOWN", _IOC_NONE, 0x1276, 0x00 },
+{ "linux/fs.h", "BLKZEROOUT", _IOC_NONE, 0x127f, 0x00 },
+{ "linux/fs.h", "FIBMAP", _IOC_NONE, 0x0001, 0x00 },
+{ "linux/fs.h", "FICLONE", _IOC_WRITE, 0x9409, 0x04 },
+{ "linux/fs.h", "FICLONERANGE", _IOC_WRITE, 0x940d, 0x20 },
+{ "linux/fs.h", "FIDEDUPERANGE", _IOC_READ|_IOC_WRITE, 0x9436, 0x18 },
+{ "linux/fs.h", "FIFREEZE", _IOC_READ|_IOC_WRITE, 0x5877, 0x04 },
+{ "linux/fs.h", "FIGETBSZ", _IOC_NONE, 0x0002, 0x00 },
+{ "linux/fs.h", "FITHAW", _IOC_READ|_IOC_WRITE, 0x5878, 0x04 },
+{ "linux/fs.h", "FITRIM", _IOC_READ|_IOC_WRITE, 0x5879, 0x18 },
+{ "linux/fs.h", "FS_IOC32_GETFLAGS", _IOC_READ, 0x6601, 0x04 },
+{ "linux/fs.h", "FS_IOC32_GETVERSION", _IOC_READ, 0x7601, 0x04 },
+{ "linux/fs.h", "FS_IOC32_SETFLAGS", _IOC_WRITE, 0x6602, 0x04 },
+{ "linux/fs.h", "FS_IOC32_SETVERSION", _IOC_WRITE, 0x7602, 0x04 },
+{ "linux/fs.h", "FS_IOC_FIEMAP", _IOC_READ|_IOC_WRITE, 0x660b, 0x20 },
+{ "linux/fs.h", "FS_IOC_FSGETXATTR", _IOC_READ, 0x581f, 0x1c },
+{ "linux/fs.h", "FS_IOC_FSSETXATTR", _IOC_WRITE, 0x5820, 0x1c },
+{ "linux/fs.h", "FS_IOC_GETFSLABEL", _IOC_READ, 0x9431, 0x100 },
+{ "linux/fs.h", "FS_IOC_SETFSLABEL", _IOC_WRITE, 0x9432, 0x100 },
+{ "linux/fscrypt.h", "FS_IOC_ADD_ENCRYPTION_KEY", _IOC_READ|_IOC_WRITE, 0x6617, 0x50 },
+{ "linux/fscrypt.h", "FS_IOC_GET_ENCRYPTION_KEY_STATUS", _IOC_READ|_IOC_WRITE, 0x661a, 0x80 },
+{ "linux/fscrypt.h", "FS_IOC_GET_ENCRYPTION_NONCE", _IOC_READ, 0x661b, 0x10 },
+{ "linux/fscrypt.h", "FS_IOC_GET_ENCRYPTION_POLICY", _IOC_WRITE, 0x6615, 0x0c },
+{ "linux/fscrypt.h", "FS_IOC_GET_ENCRYPTION_POLICY_EX", _IOC_READ|_IOC_WRITE, 0x6616, 0x09 },
+{ "linux/fscrypt.h", "FS_IOC_GET_ENCRYPTION_PWSALT", _IOC_WRITE, 0x6614, 0x10 },
+{ "linux/fscrypt.h", "FS_IOC_REMOVE_ENCRYPTION_KEY", _IOC_READ|_IOC_WRITE, 0x6618, 0x40 },
+{ "linux/fscrypt.h", "FS_IOC_REMOVE_ENCRYPTION_KEY_ALL_USERS", _IOC_READ|_IOC_WRITE, 0x6619, 0x40 },
+{ "linux/fscrypt.h", "FS_IOC_SET_ENCRYPTION_POLICY", _IOC_READ, 0x6613, 0x0c },
+{ "linux/fsi.h", "FSI_SCOM_CHECK", _IOC_READ, 0x7300, 0x04 },
+{ "linux/fsi.h", "FSI_SCOM_READ", _IOC_READ|_IOC_WRITE, 0x7301, 0x20 },
+{ "linux/fsi.h", "FSI_SCOM_RESET", _IOC_WRITE, 0x7303, 0x04 },
+{ "linux/fsi.h", "FSI_SCOM_WRITE", _IOC_READ|_IOC_WRITE, 0x7302, 0x20 },
+{ "linux/fsl-diu-fb.h", "MFB_GET_ALPHA", _IOC_READ, 0x4d00, 0x01 },
+{ "linux/fsl-diu-fb.h", "MFB_GET_AOID", _IOC_READ, 0x4d04, 0x08 },
+{ "linux/fsl-diu-fb.h", "MFB_GET_GAMMA", _IOC_READ, 0x4d01, 0x01 },
+{ "linux/fsl-diu-fb.h", "MFB_GET_PIXFMT", _IOC_READ, 0x4d08, 0x04 },
+{ "linux/fsl-diu-fb.h", "MFB_SET_ALPHA", _IOC_WRITE, 0x4d00, 0x01 },
+{ "linux/fsl-diu-fb.h", "MFB_SET_AOID", _IOC_WRITE, 0x4d04, 0x08 },
+{ "linux/fsl-diu-fb.h", "MFB_SET_BRIGHTNESS", _IOC_WRITE, 0x4d03, 0x01 },
+{ "linux/fsl-diu-fb.h", "MFB_SET_CHROMA_KEY", _IOC_WRITE, 0x4d01, 0x0c },
+{ "linux/fsl-diu-fb.h", "MFB_SET_GAMMA", _IOC_WRITE, 0x4d01, 0x01 },
+{ "linux/fsl-diu-fb.h", "MFB_SET_PIXFMT", _IOC_WRITE, 0x4d08, 0x04 },
+{ "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_DOORBELL", _IOC_READ|_IOC_WRITE, 0xaf06, 0x08 },
+{ "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_GETPROP", _IOC_READ|_IOC_WRITE, 0xaf07, 0x28 },
+{ "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_MEMCPY", _IOC_READ|_IOC_WRITE, 0xaf05, 0x28 },
+{ "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_PARTITION_GET_STATUS", _IOC_READ|_IOC_WRITE, 0xaf02, 0x0c },
+{ "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_PARTITION_RESTART", _IOC_READ|_IOC_WRITE, 0xaf01, 0x08 },
+{ "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_PARTITION_START", _IOC_READ|_IOC_WRITE, 0xaf03, 0x10 },
+{ "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_PARTITION_STOP", _IOC_READ|_IOC_WRITE, 0xaf04, 0x08 },
+{ "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_SETPROP", _IOC_READ|_IOC_WRITE, 0xaf08, 0x28 },
+{ "linux/fsmap.h", "FS_IOC_GETFSMAP", _IOC_READ|_IOC_WRITE, 0x583b, 0xc0 },
+{ "linux/fsverity.h", "FS_IOC_ENABLE_VERITY", _IOC_WRITE, 0x6685, 0x80 },
+{ "linux/fsverity.h", "FS_IOC_MEASURE_VERITY", _IOC_READ|_IOC_WRITE, 0x6686, 0x04 },
+{ "linux/fuse.h", "FUSE_DEV_IOC_CLONE", _IOC_READ, 0xe500, 0x04 },
+{ "linux/genwqe/genwqe_card.h", "GENWQE_EXECUTE_DDCB", _IOC_READ|_IOC_WRITE, 0xa532, 0xe8 },
+{ "linux/genwqe/genwqe_card.h", "GENWQE_EXECUTE_RAW_DDCB", _IOC_READ|_IOC_WRITE, 0xa533, 0xe8 },
+{ "linux/genwqe/genwqe_card.h", "GENWQE_GET_CARD_STATE", _IOC_READ, 0xa524, 0x04 },
+{ "linux/genwqe/genwqe_card.h", "GENWQE_PIN_MEM", _IOC_READ|_IOC_WRITE, 0xa528, 0x20 },
+{ "linux/genwqe/genwqe_card.h", "GENWQE_READ_REG16", _IOC_READ, 0xa522, 0x10 },
+{ "linux/genwqe/genwqe_card.h", "GENWQE_READ_REG32", _IOC_READ, 0xa520, 0x10 },
+{ "linux/genwqe/genwqe_card.h", "GENWQE_READ_REG64", _IOC_READ, 0xa51e, 0x10 },
+{ "linux/genwqe/genwqe_card.h", "GENWQE_SLU_READ", _IOC_READ|_IOC_WRITE, 0xa551, 0x38 },
+{ "linux/genwqe/genwqe_card.h", "GENWQE_SLU_UPDATE", _IOC_READ|_IOC_WRITE, 0xa550, 0x38 },
+{ "linux/genwqe/genwqe_card.h", "GENWQE_UNPIN_MEM", _IOC_READ|_IOC_WRITE, 0xa529, 0x20 },
+{ "linux/genwqe/genwqe_card.h", "GENWQE_WRITE_REG16", _IOC_WRITE, 0xa523, 0x10 },
+{ "linux/genwqe/genwqe_card.h", "GENWQE_WRITE_REG32", _IOC_WRITE, 0xa521, 0x10 },
+{ "linux/genwqe/genwqe_card.h", "GENWQE_WRITE_REG64", _IOC_WRITE, 0xa51f, 0x10 },
+{ "linux/gpio.h", "GPIOHANDLE_GET_LINE_VALUES_IOCTL", _IOC_READ|_IOC_WRITE, 0xb408, 0x40 },
+{ "linux/gpio.h", "GPIOHANDLE_SET_CONFIG_IOCTL", _IOC_READ|_IOC_WRITE, 0xb40a, 0x54 },
+{ "linux/gpio.h", "GPIOHANDLE_SET_LINE_VALUES_IOCTL", _IOC_READ|_IOC_WRITE, 0xb409, 0x40 },
+{ "linux/gpio.h", "GPIO_GET_CHIPINFO_IOCTL", _IOC_READ, 0xb401, 0x44 },
+{ "linux/gpio.h", "GPIO_GET_LINEEVENT_IOCTL", _IOC_READ|_IOC_WRITE, 0xb404, 0x30 },
+{ "linux/gpio.h", "GPIO_GET_LINEHANDLE_IOCTL", _IOC_READ|_IOC_WRITE, 0xb403, 0x16c },
+{ "linux/gpio.h", "GPIO_GET_LINEINFO_IOCTL", _IOC_READ|_IOC_WRITE, 0xb402, 0x48 },
+{ "linux/gpio.h", "GPIO_GET_LINEINFO_UNWATCH_IOCTL", _IOC_READ|_IOC_WRITE, 0xb40c, 0x04 },
+{ "linux/gpio.h", "GPIO_GET_LINEINFO_WATCH_IOCTL", _IOC_READ|_IOC_WRITE, 0xb40b, 0x48 },
+{ "linux/gpio.h", "GPIO_V2_GET_LINEINFO_IOCTL", _IOC_READ|_IOC_WRITE, 0xb405, 0x100 },
+{ "linux/gpio.h", "GPIO_V2_GET_LINEINFO_WATCH_IOCTL", _IOC_READ|_IOC_WRITE, 0xb406, 0x100 },
+{ "linux/gpio.h", "GPIO_V2_GET_LINE_IOCTL", _IOC_READ|_IOC_WRITE, 0xb407, 0x250 },
+{ "linux/gpio.h", "GPIO_V2_LINE_GET_VALUES_IOCTL", _IOC_READ|_IOC_WRITE, 0xb40e, 0x10 },
+{ "linux/gpio.h", "GPIO_V2_LINE_SET_CONFIG_IOCTL", _IOC_READ|_IOC_WRITE, 0xb40d, 0x110 },
+{ "linux/gpio.h", "GPIO_V2_LINE_SET_VALUES_IOCTL", _IOC_READ|_IOC_WRITE, 0xb40f, 0x10 },
+{ "linux/gsmmux.h", "GSMIOC_DISABLE_NET", _IOC_NONE, 0x4703, 0x00 },
+{ "linux/gsmmux.h", "GSMIOC_ENABLE_NET", _IOC_WRITE, 0x4702, 0x34 },
+{ "linux/gsmmux.h", "GSMIOC_GETCONF", _IOC_READ, 0x4700, 0x4c },
+{ "linux/gsmmux.h", "GSMIOC_GETFIRST", _IOC_READ, 0x4704, 0x04 },
+{ "linux/gsmmux.h", "GSMIOC_SETCONF", _IOC_WRITE, 0x4701, 0x4c },
+{ "linux/hdreg.h", "HDIO_DRIVE_CMD", 0, 0x031f, 0 },
+{ "linux/hdreg.h", "HDIO_DRIVE_RESET", 0, 0x031c, 0 },
+{ "linux/hdreg.h", "HDIO_DRIVE_TASK", 0, 0x031e, 0 },
+{ "linux/hdreg.h", "HDIO_DRIVE_TASKFILE", 0, 0x031d, 0 },
+{ "linux/hdreg.h", "HDIO_GETGEO", 0, 0x0301, 0 },
+{ "linux/hdreg.h", "HDIO_GET_32BIT", 0, 0x0309, 0 },
+{ "linux/hdreg.h", "HDIO_GET_ACOUSTIC", 0, 0x030f, 0 },
+{ "linux/hdreg.h", "HDIO_GET_ADDRESS", 0, 0x0310, 0 },
+{ "linux/hdreg.h", "HDIO_GET_BUSSTATE", 0, 0x031a, 0 },
+{ "linux/hdreg.h", "HDIO_GET_DMA", 0, 0x030b, 0 },
+{ "linux/hdreg.h", "HDIO_GET_IDENTITY", 0, 0x030d, 0 },
+{ "linux/hdreg.h", "HDIO_GET_KEEPSETTINGS", 0, 0x0308, 0 },
+{ "linux/hdreg.h", "HDIO_GET_MULTCOUNT", 0, 0x0304, 0 },
+{ "linux/hdreg.h", "HDIO_GET_NICE", 0, 0x030c, 0 },
+{ "linux/hdreg.h", "HDIO_GET_NOWERR", 0, 0x030a, 0 },
+{ "linux/hdreg.h", "HDIO_GET_QDMA", 0, 0x0305, 0 },
+{ "linux/hdreg.h", "HDIO_GET_UNMASKINTR", 0, 0x0302, 0 },
+{ "linux/hdreg.h", "HDIO_GET_WCACHE", 0, 0x030e, 0 },
+{ "linux/hdreg.h", "HDIO_OBSOLETE_IDENTITY", 0, 0x0307, 0 },
+{ "linux/hdreg.h", "HDIO_SCAN_HWIF", 0, 0x0328, 0 },
+{ "linux/hdreg.h", "HDIO_SET_32BIT", 0, 0x0324, 0 },
+{ "linux/hdreg.h", "HDIO_SET_ACOUSTIC", 0, 0x032c, 0 },
+{ "linux/hdreg.h", "HDIO_SET_ADDRESS", 0, 0x032f, 0 },
+{ "linux/hdreg.h", "HDIO_SET_BUSSTATE", 0, 0x032d, 0 },
+{ "linux/hdreg.h", "HDIO_SET_DMA", 0, 0x0326, 0 },
+{ "linux/hdreg.h", "HDIO_SET_KEEPSETTINGS", 0, 0x0323, 0 },
+{ "linux/hdreg.h", "HDIO_SET_MULTCOUNT", 0, 0x0321, 0 },
+{ "linux/hdreg.h", "HDIO_SET_NICE", 0, 0x0329, 0 },
+{ "linux/hdreg.h", "HDIO_SET_NOWERR", 0, 0x0325, 0 },
+{ "linux/hdreg.h", "HDIO_SET_PIO_MODE", 0, 0x0327, 0 },
+{ "linux/hdreg.h", "HDIO_SET_QDMA", 0, 0x032e, 0 },
+{ "linux/hdreg.h", "HDIO_SET_UNMASKINTR", 0, 0x0322, 0 },
+{ "linux/hdreg.h", "HDIO_SET_WCACHE", 0, 0x032b, 0 },
+{ "linux/hdreg.h", "HDIO_SET_XFER", 0, 0x0306, 0 },
+{ "linux/hdreg.h", "HDIO_TRISTATE_HWIF", 0, 0x031b, 0 },
+{ "linux/hdreg.h", "HDIO_UNREGISTER_HWIF", 0, 0x032a, 0 },
+{ "linux/hid-roccat.h", "ROCCATIOCGREPSIZE", _IOC_READ, 0x48f1, 0x04 },
+{ "linux/hiddev.h", "HIDIOCAPPLICATION", _IOC_NONE, 0x4802, 0x00 },
+{ "linux/hiddev.h", "HIDIOCGCOLLECTIONINDEX", _IOC_WRITE, 0x4810, 0x18 },
+{ "linux/hiddev.h", "HIDIOCGCOLLECTIONINFO", _IOC_READ|_IOC_WRITE, 0x4811, 0x10 },
+{ "linux/hiddev.h", "HIDIOCGDEVINFO", _IOC_READ, 0x4803, 0x1c },
+{ "linux/hiddev.h", "HIDIOCGFIELDINFO", _IOC_READ|_IOC_WRITE, 0x480a, 0x38 },
+{ "linux/hiddev.h", "HIDIOCGFLAG", _IOC_READ, 0x480e, 0x04 },
+{ "linux/hiddev.h", "HIDIOCGREPORT", _IOC_WRITE, 0x4807, 0x0c },
+{ "linux/hiddev.h", "HIDIOCGREPORTINFO", _IOC_READ|_IOC_WRITE, 0x4809, 0x0c },
+{ "linux/hiddev.h", "HIDIOCGSTRING", _IOC_READ, 0x4804, 0x104 },
+{ "linux/hiddev.h", "HIDIOCGUCODE", _IOC_READ|_IOC_WRITE, 0x480d, 0x18 },
+{ "linux/hiddev.h", "HIDIOCGUSAGE", _IOC_READ|_IOC_WRITE, 0x480b, 0x18 },
+{ "linux/hiddev.h", "HIDIOCGUSAGES", _IOC_READ|_IOC_WRITE, 0x4813, 0x101c },
+{ "linux/hiddev.h", "HIDIOCGVERSION", _IOC_READ, 0x4801, 0x04 },
+{ "linux/hiddev.h", "HIDIOCINITREPORT", _IOC_NONE, 0x4805, 0x00 },
+{ "linux/hiddev.h", "HIDIOCSFLAG", _IOC_WRITE, 0x480f, 0x04 },
+{ "linux/hiddev.h", "HIDIOCSREPORT", _IOC_WRITE, 0x4808, 0x0c },
+{ "linux/hiddev.h", "HIDIOCSUSAGE", _IOC_WRITE, 0x480c, 0x18 },
+{ "linux/hiddev.h", "HIDIOCSUSAGES", _IOC_WRITE, 0x4814, 0x101c },
+{ "linux/hidraw.h", "HIDIOCGRAWINFO", _IOC_READ, 0x4803, 0x08 },
+{ "linux/hidraw.h", "HIDIOCGRDESC", _IOC_READ, 0x4802, 0x1004 },
+{ "linux/hidraw.h", "HIDIOCGRDESCSIZE", _IOC_READ, 0x4801, 0x04 },
+{ "linux/hpet.h", "HPET_DPI", _IOC_NONE, 0x6805, 0x00 },
+{ "linux/hpet.h", "HPET_EPI", _IOC_NONE, 0x6804, 0x00 },
+{ "linux/hpet.h", "HPET_IE_OFF", _IOC_NONE, 0x6802, 0x00 },
+{ "linux/hpet.h", "HPET_IE_ON", _IOC_NONE, 0x6801, 0x00 },
+{ "linux/hpet.h", "HPET_INFO", _IOC_READ, 0x6803, 0x0c },
+{ "linux/hpet.h", "HPET_IRQFREQ", _IOC_WRITE, 0x6806, 0x04 },
+{ "linux/hsi/cs-protocol.h", "CS_CONFIG_BUFS", _IOC_WRITE, 0x431f, 0x20 },
+{ "linux/hsi/cs-protocol.h", "CS_GET_IF_VERSION", _IOC_READ, 0x431e, 0x04 },
+{ "linux/hsi/cs-protocol.h", "CS_GET_STATE", _IOC_READ, 0x4315, 0x04 },
+{ "linux/hsi/cs-protocol.h", "CS_SET_WAKELINE", _IOC_WRITE, 0x4317, 0x04 },
+{ "linux/hsi/hsi_char.h", "HSC_GET_RX", _IOC_WRITE, 0x6b14, 0x0c },
+{ "linux/hsi/hsi_char.h", "HSC_GET_TX", _IOC_WRITE, 0x6b16, 0x10 },
+{ "linux/hsi/hsi_char.h", "HSC_RESET", _IOC_NONE, 0x6b10, 0x00 },
+{ "linux/hsi/hsi_char.h", "HSC_SEND_BREAK", _IOC_NONE, 0x6b12, 0x00 },
+{ "linux/hsi/hsi_char.h", "HSC_SET_PM", _IOC_NONE, 0x6b11, 0x00 },
+{ "linux/hsi/hsi_char.h", "HSC_SET_RX", _IOC_WRITE, 0x6b13, 0x0c },
+{ "linux/hsi/hsi_char.h", "HSC_SET_TX", _IOC_WRITE, 0x6b15, 0x10 },
+{ "linux/i2o-dev.h", "I2OEVTGET", _IOC_READ, 0x690b, 0x68 },
+{ "linux/i2o-dev.h", "I2OEVTREG", _IOC_WRITE, 0x690a, 0x0c },
+{ "linux/i2o-dev.h", "I2OGETIOPS", _IOC_READ, 0x6900, 0x20 },
+{ "linux/i2o-dev.h", "I2OHRTGET", _IOC_READ|_IOC_WRITE, 0x6901, 0x0c },
+{ "linux/i2o-dev.h", "I2OHTML", _IOC_READ|_IOC_WRITE, 0x6909, 0x1c },
+{ "linux/i2o-dev.h", "I2OLCTGET", _IOC_READ|_IOC_WRITE, 0x6902, 0x0c },
+{ "linux/i2o-dev.h", "I2OPARMGET", _IOC_READ|_IOC_WRITE, 0x6904, 0x18 },
+{ "linux/i2o-dev.h", "I2OPARMSET", _IOC_READ|_IOC_WRITE, 0x6903, 0x18 },
+{ "linux/i2o-dev.h", "I2OPASSTHRU32", _IOC_READ, 0x690c, 0x08 },
+{ "linux/i2o-dev.h", "I2OSWDEL", _IOC_READ|_IOC_WRITE, 0x6907, 0x1c },
+{ "linux/i2o-dev.h", "I2OSWDL", _IOC_READ|_IOC_WRITE, 0x6905, 0x1c },
+{ "linux/i2o-dev.h", "I2OSWUL", _IOC_READ|_IOC_WRITE, 0x6906, 0x1c },
+{ "linux/i2o-dev.h", "I2OVALIDATE", _IOC_READ, 0x6908, 0x04 },
+{ "linux/i8k.h", "I8K_BIOS_VERSION", _IOC_READ, 0x6980, 0x04 },
+{ "linux/i8k.h", "I8K_FN_STATUS", _IOC_READ, 0x6983, 0x04 },
+{ "linux/i8k.h", "I8K_GET_FAN", _IOC_READ|_IOC_WRITE, 0x6986, 0x04 },
+{ "linux/i8k.h", "I8K_GET_SPEED", _IOC_READ|_IOC_WRITE, 0x6985, 0x04 },
+{ "linux/i8k.h", "I8K_GET_TEMP", _IOC_READ, 0x6984, 0x04 },
+{ "linux/i8k.h", "I8K_MACHINE_ID", _IOC_READ, 0x6981, 0x04 },
+{ "linux/i8k.h", "I8K_POWER_STATUS", _IOC_READ, 0x6982, 0x04 },
+{ "linux/i8k.h", "I8K_SET_FAN", _IOC_READ|_IOC_WRITE, 0x6987, 0x04 },
+{ "linux/if_pppox.h", "PPPOEIOCDFWD", _IOC_NONE, 0xb101, 0x00 },
+{ "linux/if_pppox.h", "PPPOEIOCSFWD", _IOC_WRITE, 0xb100, 0x04 },
+{ "linux/if_tun.h", "TUNATTACHFILTER", _IOC_WRITE, 0x54d5, 0x08 },
+{ "linux/if_tun.h", "TUNDETACHFILTER", _IOC_WRITE, 0x54d6, 0x08 },
+{ "linux/if_tun.h", "TUNGETDEVNETNS", _IOC_NONE, 0x54e3, 0x00 },
+{ "linux/if_tun.h", "TUNGETFEATURES", _IOC_READ, 0x54cf, 0x04 },
+{ "linux/if_tun.h", "TUNGETFILTER", _IOC_READ, 0x54db, 0x08 },
+{ "linux/if_tun.h", "TUNGETIFF", _IOC_READ, 0x54d2, 0x04 },
+{ "linux/if_tun.h", "TUNGETSNDBUF", _IOC_READ, 0x54d3, 0x04 },
+{ "linux/if_tun.h", "TUNGETVNETBE", _IOC_READ, 0x54df, 0x04 },
+{ "linux/if_tun.h", "TUNGETVNETHDRSZ", _IOC_READ, 0x54d7, 0x04 },
+{ "linux/if_tun.h", "TUNGETVNETLE", _IOC_READ, 0x54dd, 0x04 },
+{ "linux/if_tun.h", "TUNSETCARRIER", _IOC_WRITE, 0x54e2, 0x04 },
+{ "linux/if_tun.h", "TUNSETDEBUG", _IOC_WRITE, 0x54c9, 0x04 },
+{ "linux/if_tun.h", "TUNSETFILTEREBPF", _IOC_READ, 0x54e1, 0x04 },
+{ "linux/if_tun.h", "TUNSETGROUP", _IOC_WRITE, 0x54ce, 0x04 },
+{ "linux/if_tun.h", "TUNSETIFF", _IOC_WRITE, 0x54ca, 0x04 },
+{ "linux/if_tun.h", "TUNSETIFINDEX", _IOC_WRITE, 0x54da, 0x04 },
+{ "linux/if_tun.h", "TUNSETLINK", _IOC_WRITE, 0x54cd, 0x04 },
+{ "linux/if_tun.h", "TUNSETNOCSUM", _IOC_WRITE, 0x54c8, 0x04 },
+{ "linux/if_tun.h", "TUNSETOFFLOAD", _IOC_WRITE, 0x54d0, 0x04 },
+{ "linux/if_tun.h", "TUNSETOWNER", _IOC_WRITE, 0x54cc, 0x04 },
+{ "linux/if_tun.h", "TUNSETPERSIST", _IOC_WRITE, 0x54cb, 0x04 },
+{ "linux/if_tun.h", "TUNSETQUEUE", _IOC_WRITE, 0x54d9, 0x04 },
+{ "linux/if_tun.h", "TUNSETSNDBUF", _IOC_WRITE, 0x54d4, 0x04 },
+{ "linux/if_tun.h", "TUNSETSTEERINGEBPF", _IOC_READ, 0x54e0, 0x04 },
+{ "linux/if_tun.h", "TUNSETTXFILTER", _IOC_WRITE, 0x54d1, 0x04 },
+{ "linux/if_tun.h", "TUNSETVNETBE", _IOC_WRITE, 0x54de, 0x04 },
+{ "linux/if_tun.h", "TUNSETVNETHDRSZ", _IOC_WRITE, 0x54d8, 0x04 },
+{ "linux/if_tun.h", "TUNSETVNETLE", _IOC_WRITE, 0x54dc, 0x04 },
+{ "linux/iio/events.h", "IIO_GET_EVENT_FD_IOCTL", _IOC_READ, 0x6990, 0x04 },
+{ "linux/inotify.h", "INOTIFY_IOC_SETNEXTWD", _IOC_WRITE, 0x4900, 0x04 },
+{ "linux/input.h", "EVIOCGEFFECTS", _IOC_READ, 0x4584, 0x04 },
+{ "linux/input.h", "EVIOCGID", _IOC_READ, 0x4502, 0x08 },
+{ "linux/input.h", "EVIOCGKEYCODE", _IOC_READ, 0x4504, 0x08 },
+{ "linux/input.h", "EVIOCGKEYCODE_V2", _IOC_READ, 0x4504, 0x28 },
+{ "linux/input.h", "EVIOCGMASK", _IOC_READ, 0x4592, 0x10 },
+{ "linux/input.h", "EVIOCGRAB", _IOC_WRITE, 0x4590, 0x04 },
+{ "linux/input.h", "EVIOCGREP", _IOC_READ, 0x4503, 0x08 },
+{ "linux/input.h", "EVIOCGVERSION", _IOC_READ, 0x4501, 0x04 },
+{ "linux/input.h", "EVIOCREVOKE", _IOC_WRITE, 0x4591, 0x04 },
+{ "linux/input.h", "EVIOCRMFF", _IOC_WRITE, 0x4581, 0x04 },
+{ "linux/input.h", "EVIOCSCLOCKID", _IOC_WRITE, 0x45a0, 0x04 },
+{ "linux/input.h", "EVIOCSFF", _IOC_WRITE, 0x4580, 0x2c },
+{ "linux/input.h", "EVIOCSKEYCODE", _IOC_WRITE, 0x4504, 0x08 },
+{ "linux/input.h", "EVIOCSKEYCODE_V2", _IOC_WRITE, 0x4504, 0x28 },
+{ "linux/input.h", "EVIOCSMASK", _IOC_WRITE, 0x4593, 0x10 },
+{ "linux/input.h", "EVIOCSREP", _IOC_WRITE, 0x4503, 0x08 },
+{ "linux/ipmi.h", "IPMICTL_GET_MAINTENANCE_MODE_CMD", _IOC_READ, 0x691e, 0x04 },
+{ "linux/ipmi.h", "IPMICTL_GET_MY_ADDRESS_CMD", _IOC_READ, 0x6912, 0x04 },
+{ "linux/ipmi.h", "IPMICTL_GET_MY_CHANNEL_ADDRESS_CMD", _IOC_READ, 0x6919, 0x04 },
+{ "linux/ipmi.h", "IPMICTL_GET_MY_CHANNEL_LUN_CMD", _IOC_READ, 0x691b, 0x04 },
+{ "linux/ipmi.h", "IPMICTL_GET_MY_LUN_CMD", _IOC_READ, 0x6914, 0x04 },
+{ "linux/ipmi.h", "IPMICTL_GET_TIMING_PARMS_CMD", _IOC_READ, 0x6917, 0x08 },
+{ "linux/ipmi.h", "IPMICTL_RECEIVE_MSG", _IOC_READ|_IOC_WRITE, 0x690c, 0x18 },
+{ "linux/ipmi.h", "IPMICTL_RECEIVE_MSG_TRUNC", _IOC_READ|_IOC_WRITE, 0x690b, 0x18 },
+{ "linux/ipmi.h", "IPMICTL_REGISTER_FOR_CMD", _IOC_READ, 0x690e, 0x02 },
+{ "linux/ipmi.h", "IPMICTL_REGISTER_FOR_CMD_CHANS", _IOC_READ, 0x691c, 0x0c },
+{ "linux/ipmi.h", "IPMICTL_SEND_COMMAND", _IOC_READ, 0x690d, 0x14 },
+{ "linux/ipmi.h", "IPMICTL_SEND_COMMAND_SETTIME", _IOC_READ, 0x6915, 0x1c },
+{ "linux/ipmi.h", "IPMICTL_SET_GETS_EVENTS_CMD", _IOC_READ, 0x6910, 0x04 },
+{ "linux/ipmi.h", "IPMICTL_SET_MAINTENANCE_MODE_CMD", _IOC_WRITE, 0x691f, 0x04 },
+{ "linux/ipmi.h", "IPMICTL_SET_MY_ADDRESS_CMD", _IOC_READ, 0x6911, 0x04 },
+{ "linux/ipmi.h", "IPMICTL_SET_MY_CHANNEL_ADDRESS_CMD", _IOC_READ, 0x6918, 0x04 },
+{ "linux/ipmi.h", "IPMICTL_SET_MY_CHANNEL_LUN_CMD", _IOC_READ, 0x691a, 0x04 },
+{ "linux/ipmi.h", "IPMICTL_SET_MY_LUN_CMD", _IOC_READ, 0x6913, 0x04 },
+{ "linux/ipmi.h", "IPMICTL_SET_TIMING_PARMS_CMD", _IOC_READ, 0x6916, 0x08 },
+{ "linux/ipmi.h", "IPMICTL_UNREGISTER_FOR_CMD", _IOC_READ, 0x690f, 0x02 },
+{ "linux/ipmi.h", "IPMICTL_UNREGISTER_FOR_CMD_CHANS", _IOC_READ, 0x691d, 0x0c },
+{ "linux/ipmi_bmc.h", "IPMI_BMC_IOCTL_CLEAR_SMS_ATN", _IOC_NONE, 0xb101, 0x00 },
+{ "linux/ipmi_bmc.h", "IPMI_BMC_IOCTL_FORCE_ABORT", _IOC_NONE, 0xb102, 0x00 },
+{ "linux/ipmi_bmc.h", "IPMI_BMC_IOCTL_SET_SMS_ATN", _IOC_NONE, 0xb100, 0x00 },
+{ "linux/isst_if.h", "ISST_IF_GET_PHY_ID", _IOC_READ|_IOC_WRITE, 0xfe01, 0x04 },
+{ "linux/isst_if.h", "ISST_IF_GET_PLATFORM_INFO", _IOC_READ, 0xfe00, 0x04 },
+{ "linux/isst_if.h", "ISST_IF_IO_CMD", _IOC_WRITE, 0xfe02, 0x04 },
+{ "linux/isst_if.h", "ISST_IF_MBOX_COMMAND", _IOC_READ|_IOC_WRITE, 0xfe03, 0x04 },
+{ "linux/isst_if.h", "ISST_IF_MSR_COMMAND", _IOC_READ|_IOC_WRITE, 0xfe04, 0x04 },
+{ "linux/ivtv.h", "IVTV_IOC_DMA_FRAME", _IOC_WRITE, 0x56c0, 0x38 },
+{ "linux/ivtv.h", "IVTV_IOC_PASSTHROUGH_MODE", _IOC_WRITE, 0x56c1, 0x04 },
+{ "linux/ivtvfb.h", "IVTVFB_IOC_DMA_FRAME", _IOC_WRITE, 0x56c0, 0x0c },
+{ "linux/joystick.h", "JSIOCGAXES", _IOC_READ, 0x6a11, 0x01 },
+{ "linux/joystick.h", "JSIOCGAXMAP", _IOC_READ, 0x6a32, 0x40 },
+{ "linux/joystick.h", "JSIOCGBTNMAP", _IOC_READ, 0x6a34, 0x400 },
+{ "linux/joystick.h", "JSIOCGBUTTONS", _IOC_READ, 0x6a12, 0x01 },
+{ "linux/joystick.h", "JSIOCGCORR", _IOC_READ, 0x6a22, 0x24 },
+{ "linux/joystick.h", "JSIOCGVERSION", _IOC_READ, 0x6a01, 0x04 },
+{ "linux/joystick.h", "JSIOCSAXMAP", _IOC_WRITE, 0x6a31, 0x40 },
+{ "linux/joystick.h", "JSIOCSBTNMAP", _IOC_WRITE, 0x6a33, 0x400 },
+{ "linux/joystick.h", "JSIOCSCORR", _IOC_WRITE, 0x6a21, 0x24 },
+{ "linux/kcov.h", "KCOV_DISABLE", _IOC_NONE, 0x6365, 0x00 },
+{ "linux/kcov.h", "KCOV_ENABLE", _IOC_NONE, 0x6364, 0x00 },
+{ "linux/kcov.h", "KCOV_INIT_TRACE", _IOC_READ, 0x6301, 0x04 },
+{ "linux/kcov.h", "KCOV_REMOTE_ENABLE", _IOC_WRITE, 0x6366, 0x18 },
+{ "linux/kd.h", "GIO_CMAP", 0, 0x4B70, 0 },
+{ "linux/kd.h", "GIO_FONT", 0, 0x4B60, 0 },
+{ "linux/kd.h", "GIO_FONTX", 0, 0x4B6B, 0 },
+{ "linux/kd.h", "GIO_SCRNMAP", 0, 0x4B40, 0 },
+{ "linux/kd.h", "GIO_UNIMAP", 0, 0x4B66, 0 },
+{ "linux/kd.h", "GIO_UNISCRNMAP", 0, 0x4B69, 0 },
+{ "linux/kd.h", "KDADDIO", 0, 0x4B34, 0 },
+{ "linux/kd.h", "KDDELIO", 0, 0x4B35, 0 },
+{ "linux/kd.h", "KDDISABIO", 0, 0x4B37, 0 },
+{ "linux/kd.h", "KDENABIO", 0, 0x4B36, 0 },
+{ "linux/kd.h", "KDFONTOP", 0, 0x4B72, 0 },
+{ "linux/kd.h", "KDGETKEYCODE", 0, 0x4B4C, 0 },
+{ "linux/kd.h", "KDGETLED", 0, 0x4B31, 0 },
+{ "linux/kd.h", "KDGETMODE", 0, 0x4B3B, 0 },
+{ "linux/kd.h", "KDGKBDIACR", 0, 0x4B4A, 0 },
+{ "linux/kd.h", "KDGKBDIACRUC", 0, 0x4BFA, 0 },
+{ "linux/kd.h", "KDGKBENT", 0, 0x4B46, 0 },
+{ "linux/kd.h", "KDGKBLED", 0, 0x4B64, 0 },
+{ "linux/kd.h", "KDGKBMETA", 0, 0x4B62, 0 },
+{ "linux/kd.h", "KDGKBMODE", 0, 0x4B44, 0 },
+{ "linux/kd.h", "KDGKBSENT", 0, 0x4B48, 0 },
+{ "linux/kd.h", "KDGKBTYPE", 0, 0x4B33, 0 },
+{ "linux/kd.h", "KDKBDREP", 0, 0x4B52, 0 },
+{ "linux/kd.h", "KDMAPDISP", 0, 0x4B3C, 0 },
+{ "linux/kd.h", "KDMKTONE", 0, 0x4B30, 0 },
+{ "linux/kd.h", "KDSETKEYCODE", 0, 0x4B4D, 0 },
+{ "linux/kd.h", "KDSETLED", 0, 0x4B32, 0 },
+{ "linux/kd.h", "KDSETMODE", 0, 0x4B3A, 0 },
+{ "linux/kd.h", "KDSIGACCEPT", 0, 0x4B4E, 0 },
+{ "linux/kd.h", "KDSKBDIACR", 0, 0x4B4B, 0 },
+{ "linux/kd.h", "KDSKBDIACRUC", 0, 0x4BFB, 0 },
+{ "linux/kd.h", "KDSKBENT", 0, 0x4B47, 0 },
+{ "linux/kd.h", "KDSKBLED", 0, 0x4B65, 0 },
+{ "linux/kd.h", "KDSKBMETA", 0, 0x4B63, 0 },
+{ "linux/kd.h", "KDSKBMODE", 0, 0x4B45, 0 },
+{ "linux/kd.h", "KDSKBSENT", 0, 0x4B49, 0 },
+{ "linux/kd.h", "KDUNMAPDISP", 0, 0x4B3D, 0 },
+{ "linux/kd.h", "KIOCSOUND", 0, 0x4B2F, 0 },
+{ "linux/kd.h", "PIO_CMAP", 0, 0x4B71, 0 },
+{ "linux/kd.h", "PIO_FONT", 0, 0x4B61, 0 },
+{ "linux/kd.h", "PIO_FONTRESET", 0, 0x4B6D, 0 },
+{ "linux/kd.h", "PIO_FONTX", 0, 0x4B6C, 0 },
+{ "linux/kd.h", "PIO_SCRNMAP", 0, 0x4B41, 0 },
+{ "linux/kd.h", "PIO_UNIMAP", 0, 0x4B67, 0 },
+{ "linux/kd.h", "PIO_UNIMAPCLR", 0, 0x4B68, 0 },
+{ "linux/kd.h", "PIO_UNISCRNMAP", 0, 0x4B6A, 0 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_ACQUIRE_VM", _IOC_WRITE, 0x4b15, 0x08 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_ALLOC_MEMORY_OF_GPU", _IOC_READ|_IOC_WRITE, 0x4b16, 0x28 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_ALLOC_QUEUE_GWS", _IOC_READ|_IOC_WRITE, 0x4b1e, 0x10 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_CREATE_EVENT", _IOC_READ|_IOC_WRITE, 0x4b08, 0x20 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_CREATE_QUEUE", _IOC_READ|_IOC_WRITE, 0x4b02, 0x58 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_DBG_ADDRESS_WATCH", _IOC_WRITE, 0x4b0f, 0x10 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_DBG_REGISTER", _IOC_WRITE, 0x4b0d, 0x08 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_DBG_UNREGISTER", _IOC_WRITE, 0x4b0e, 0x08 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_DBG_WAVE_CONTROL", _IOC_WRITE, 0x4b10, 0x10 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_DESTROY_EVENT", _IOC_WRITE, 0x4b09, 0x08 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_DESTROY_QUEUE", _IOC_READ|_IOC_WRITE, 0x4b03, 0x08 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_FREE_MEMORY_OF_GPU", _IOC_WRITE, 0x4b17, 0x08 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_CLOCK_COUNTERS", _IOC_READ|_IOC_WRITE, 0x4b05, 0x28 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_DMABUF_INFO", _IOC_READ|_IOC_WRITE, 0x4b1c, 0x20 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_PROCESS_APERTURES", _IOC_READ, 0x4b06, 0x190 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_PROCESS_APERTURES_NEW", _IOC_READ|_IOC_WRITE, 0x4b14, 0x10 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_QUEUE_WAVE_STATE", _IOC_READ|_IOC_WRITE, 0x4b1b, 0x18 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_TILE_CONFIG", _IOC_READ|_IOC_WRITE, 0x4b12, 0x28 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_VERSION", _IOC_READ, 0x4b01, 0x08 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_IMPORT_DMABUF", _IOC_READ|_IOC_WRITE, 0x4b1d, 0x18 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_MAP_MEMORY_TO_GPU", _IOC_READ|_IOC_WRITE, 0x4b18, 0x18 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_RESET_EVENT", _IOC_WRITE, 0x4b0b, 0x08 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_SET_CU_MASK", _IOC_WRITE, 0x4b1a, 0x10 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_SET_EVENT", _IOC_WRITE, 0x4b0a, 0x08 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_SET_MEMORY_POLICY", _IOC_WRITE, 0x4b04, 0x20 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_SET_SCRATCH_BACKING_VA", _IOC_READ|_IOC_WRITE, 0x4b11, 0x10 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_SET_TRAP_HANDLER", _IOC_WRITE, 0x4b13, 0x18 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_SMI_EVENTS", _IOC_READ|_IOC_WRITE, 0x4b1f, 0x08 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_UNMAP_MEMORY_FROM_GPU", _IOC_READ|_IOC_WRITE, 0x4b19, 0x18 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_UPDATE_QUEUE", _IOC_WRITE, 0x4b07, 0x18 },
+{ "linux/kfd_ioctl.h", "AMDKFD_IOC_WAIT_EVENTS", _IOC_READ|_IOC_WRITE, 0x4b0c, 0x18 },
+{ "linux/lightnvm.h", "NVME_NVM_IOCTL_ADMIN_VIO", _IOC_READ|_IOC_WRITE, 0x4c41, 0x50 },
+{ "linux/lightnvm.h", "NVME_NVM_IOCTL_IO_VIO", _IOC_READ|_IOC_WRITE, 0x4c43, 0x50 },
+{ "linux/lightnvm.h", "NVME_NVM_IOCTL_SUBMIT_VIO", _IOC_READ|_IOC_WRITE, 0x4c42, 0x40 },
+{ "linux/lightnvm.h", "NVM_DEV_CREATE", _IOC_WRITE, 0x4c22, 0x80 },
+{ "linux/lightnvm.h", "NVM_DEV_FACTORY", _IOC_WRITE, 0x4c25, 0x24 },
+{ "linux/lightnvm.h", "NVM_DEV_INIT", _IOC_WRITE, 0x4c24, 0x2c },
+{ "linux/lightnvm.h", "NVM_DEV_REMOVE", _IOC_WRITE, 0x4c23, 0x24 },
+{ "linux/lightnvm.h", "NVM_GET_DEVICES", _IOC_READ, 0x4c21, 0x1000 },
+{ "linux/lightnvm.h", "NVM_INFO", _IOC_READ|_IOC_WRITE, 0x4c20, 0x1000 },
+{ "linux/lirc.h", "LIRC_GET_FEATURES", _IOC_READ, 0x6900, 0x04 },
+{ "linux/lirc.h", "LIRC_GET_LENGTH", _IOC_READ, 0x690f, 0x04 },
+{ "linux/lirc.h", "LIRC_GET_MAX_TIMEOUT", _IOC_READ, 0x6909, 0x04 },
+{ "linux/lirc.h", "LIRC_GET_MIN_TIMEOUT", _IOC_READ, 0x6908, 0x04 },
+{ "linux/lirc.h", "LIRC_GET_REC_MODE", _IOC_READ, 0x6902, 0x04 },
+{ "linux/lirc.h", "LIRC_GET_REC_RESOLUTION", _IOC_READ, 0x6907, 0x04 },
+{ "linux/lirc.h", "LIRC_GET_REC_TIMEOUT", _IOC_READ, 0x6924, 0x04 },
+{ "linux/lirc.h", "LIRC_GET_SEND_MODE", _IOC_READ, 0x6901, 0x04 },
+{ "linux/lirc.h", "LIRC_SET_MEASURE_CARRIER_MODE", _IOC_WRITE, 0x691d, 0x04 },
+{ "linux/lirc.h", "LIRC_SET_REC_CARRIER", _IOC_WRITE, 0x6914, 0x04 },
+{ "linux/lirc.h", "LIRC_SET_REC_CARRIER_RANGE", _IOC_WRITE, 0x691f, 0x04 },
+{ "linux/lirc.h", "LIRC_SET_REC_MODE", _IOC_WRITE, 0x6912, 0x04 },
+{ "linux/lirc.h", "LIRC_SET_REC_TIMEOUT", _IOC_WRITE, 0x6918, 0x04 },
+{ "linux/lirc.h", "LIRC_SET_REC_TIMEOUT_REPORTS", _IOC_WRITE, 0x6919, 0x04 },
+{ "linux/lirc.h", "LIRC_SET_SEND_CARRIER", _IOC_WRITE, 0x6913, 0x04 },
+{ "linux/lirc.h", "LIRC_SET_SEND_DUTY_CYCLE", _IOC_WRITE, 0x6915, 0x04 },
+{ "linux/lirc.h", "LIRC_SET_SEND_MODE", _IOC_WRITE, 0x6911, 0x04 },
+{ "linux/lirc.h", "LIRC_SET_TRANSMITTER_MASK", _IOC_WRITE, 0x6917, 0x04 },
+{ "linux/lirc.h", "LIRC_SET_WIDEBAND_RECEIVER", _IOC_WRITE, 0x6923, 0x04 },
+{ "linux/loop.h", "LOOP_CHANGE_FD", 0, 0x4C06, 0 },
+{ "linux/loop.h", "LOOP_CLR_FD", 0, 0x4C01, 0 },
+{ "linux/loop.h", "LOOP_CONFIGURE", 0, 0x4C0A, 0 },
+{ "linux/loop.h", "LOOP_CTL_ADD", 0, 0x4C80, 0 },
+{ "linux/loop.h", "LOOP_CTL_GET_FREE", 0, 0x4C82, 0 },
+{ "linux/loop.h", "LOOP_CTL_REMOVE", 0, 0x4C81, 0 },
+{ "linux/loop.h", "LOOP_GET_STATUS", 0, 0x4C03, 0 },
+{ "linux/loop.h", "LOOP_GET_STATUS64", 0, 0x4C05, 0 },
+{ "linux/loop.h", "LOOP_SET_BLOCK_SIZE", 0, 0x4C09, 0 },
+{ "linux/loop.h", "LOOP_SET_CAPACITY", 0, 0x4C07, 0 },
+{ "linux/loop.h", "LOOP_SET_DIRECT_IO", 0, 0x4C08, 0 },
+{ "linux/loop.h", "LOOP_SET_FD", 0, 0x4C00, 0 },
+{ "linux/loop.h", "LOOP_SET_STATUS", 0, 0x4C02, 0 },
+{ "linux/loop.h", "LOOP_SET_STATUS64", 0, 0x4C04, 0 },
+{ "linux/lp.h", "LPSETTIMEOUT_NEW", _IOC_WRITE, 0x060f, 0x10 },
+{ "linux/mISDNif.h", "IMADDTIMER", _IOC_READ, 0x4940, 0x04 },
+{ "linux/mISDNif.h", "IMCLEAR_L2", _IOC_READ, 0x4946, 0x04 },
+{ "linux/mISDNif.h", "IMCTRLREQ", _IOC_READ, 0x4945, 0x04 },
+{ "linux/mISDNif.h", "IMDELTIMER", _IOC_READ, 0x4941, 0x04 },
+{ "linux/mISDNif.h", "IMGETCOUNT", _IOC_READ, 0x4943, 0x04 },
+{ "linux/mISDNif.h", "IMGETDEVINFO", _IOC_READ, 0x4944, 0x04 },
+{ "linux/mISDNif.h", "IMGETVERSION", _IOC_READ, 0x4942, 0x04 },
+{ "linux/mISDNif.h", "IMHOLD_L1", _IOC_READ, 0x4948, 0x04 },
+{ "linux/mISDNif.h", "IMSETDEVNAME", _IOC_READ, 0x4947, 0x18 },
+{ "linux/matroxfb.h", "MATROXFB_GET_ALL_OUTPUTS", _IOC_READ, 0x6efb, 0x04 },
+{ "linux/matroxfb.h", "MATROXFB_GET_AVAILABLE_OUTPUTS", _IOC_READ, 0x6ef9, 0x04 },
+{ "linux/matroxfb.h", "MATROXFB_GET_OUTPUT_CONNECTION", _IOC_READ, 0x6ef8, 0x04 },
+{ "linux/matroxfb.h", "MATROXFB_GET_OUTPUT_MODE", _IOC_READ|_IOC_WRITE, 0x6efa, 0x04 },
+{ "linux/matroxfb.h", "MATROXFB_SET_OUTPUT_CONNECTION", _IOC_WRITE, 0x6ef8, 0x04 },
+{ "linux/matroxfb.h", "MATROXFB_SET_OUTPUT_MODE", _IOC_WRITE, 0x6efa, 0x04 },
+{ "linux/media.h", "MEDIA_IOC_DEVICE_INFO", _IOC_READ|_IOC_WRITE, 0x7c00, 0x100 },
+{ "linux/media.h", "MEDIA_IOC_ENUM_ENTITIES", _IOC_READ|_IOC_WRITE, 0x7c01, 0x100 },
+{ "linux/media.h", "MEDIA_IOC_ENUM_LINKS", _IOC_READ|_IOC_WRITE, 0x7c02, 0x1c },
+{ "linux/media.h", "MEDIA_IOC_G_TOPOLOGY", _IOC_READ|_IOC_WRITE, 0x7c04, 0x48 },
+{ "linux/media.h", "MEDIA_IOC_REQUEST_ALLOC", _IOC_READ, 0x7c05, 0x04 },
+{ "linux/media.h", "MEDIA_IOC_SETUP_LINK", _IOC_READ|_IOC_WRITE, 0x7c03, 0x34 },
+{ "linux/media.h", "MEDIA_REQUEST_IOC_QUEUE", _IOC_NONE, 0x7c80, 0x00 },
+{ "linux/media.h", "MEDIA_REQUEST_IOC_REINIT", _IOC_NONE, 0x7c81, 0x00 },
+{ "linux/mei.h", "IOCTL_MEI_CONNECT_CLIENT", _IOC_READ|_IOC_WRITE, 0x4801, 0x10 },
+{ "linux/mei.h", "IOCTL_MEI_CONNECT_CLIENT_VTAG", _IOC_READ|_IOC_WRITE, 0x4804, 0x14 },
+{ "linux/mei.h", "IOCTL_MEI_NOTIFY_GET", _IOC_READ, 0x4803, 0x04 },
+{ "linux/mei.h", "IOCTL_MEI_NOTIFY_SET", _IOC_WRITE, 0x4802, 0x04 },
+{ "linux/meye.h", "MEYEIOC_G_PARAMS", _IOC_READ, 0x76c0, 0x06 },
+{ "linux/meye.h", "MEYEIOC_QBUF_CAPT", _IOC_WRITE, 0x76c2, 0x04 },
+{ "linux/meye.h", "MEYEIOC_STILLCAPT", _IOC_NONE, 0x76c4, 0x00 },
+{ "linux/meye.h", "MEYEIOC_STILLJCAPT", _IOC_READ, 0x76c5, 0x04 },
+{ "linux/meye.h", "MEYEIOC_SYNC", _IOC_READ|_IOC_WRITE, 0x76c3, 0x04 },
+{ "linux/meye.h", "MEYEIOC_S_PARAMS", _IOC_WRITE, 0x76c1, 0x06 },
+{ "linux/mmc/ioctl.h", "MMC_IOC_CMD", _IOC_READ|_IOC_WRITE, 0xb300, 0x48 },
+{ "linux/mmc/ioctl.h", "MMC_IOC_MULTI_CMD", _IOC_READ|_IOC_WRITE, 0xb301, 0x08 },
+{ "linux/mmtimer.h", "MMTIMER_GETBITS", _IOC_NONE, 0x6d04, 0x00 },
+{ "linux/mmtimer.h", "MMTIMER_GETCOUNTER", _IOC_READ, 0x6d09, 0x04 },
+{ "linux/mmtimer.h", "MMTIMER_GETFREQ", _IOC_READ, 0x6d02, 0x04 },
+{ "linux/mmtimer.h", "MMTIMER_GETOFFSET", _IOC_NONE, 0x6d00, 0x00 },
+{ "linux/mmtimer.h", "MMTIMER_GETRES", _IOC_READ, 0x6d01, 0x04 },
+{ "linux/mmtimer.h", "MMTIMER_MMAPAVAIL", _IOC_NONE, 0x6d06, 0x00 },
+{ "linux/msdos_fs.h", "FAT_IOCTL_GET_ATTRIBUTES", _IOC_READ, 0x7210, 0x04 },
+{ "linux/msdos_fs.h", "FAT_IOCTL_GET_VOLUME_ID", _IOC_READ, 0x7213, 0x04 },
+{ "linux/msdos_fs.h", "FAT_IOCTL_SET_ATTRIBUTES", _IOC_WRITE, 0x7211, 0x04 },
+{ "linux/msdos_fs.h", "VFAT_IOCTL_READDIR_BOTH", _IOC_READ, 0x7201, 0x230 },
+{ "linux/msdos_fs.h", "VFAT_IOCTL_READDIR_SHORT", _IOC_READ, 0x7202, 0x230 },
+{ "linux/mtio.h", "MTIOCGET", _IOC_READ, 0x6d02, 0x1c },
+{ "linux/mtio.h", "MTIOCPOS", _IOC_READ, 0x6d03, 0x04 },
+{ "linux/mtio.h", "MTIOCTOP", _IOC_WRITE, 0x6d01, 0x08 },
+{ "linux/nbd.h", "NBD_CLEAR_QUE", _IOC_NONE, 0xab05, 0x00 },
+{ "linux/nbd.h", "NBD_CLEAR_SOCK", _IOC_NONE, 0xab04, 0x00 },
+{ "linux/nbd.h", "NBD_DISCONNECT", _IOC_NONE, 0xab08, 0x00 },
+{ "linux/nbd.h", "NBD_DO_IT", _IOC_NONE, 0xab03, 0x00 },
+{ "linux/nbd.h", "NBD_PRINT_DEBUG", _IOC_NONE, 0xab06, 0x00 },
+{ "linux/nbd.h", "NBD_SET_BLKSIZE", _IOC_NONE, 0xab01, 0x00 },
+{ "linux/nbd.h", "NBD_SET_FLAGS", _IOC_NONE, 0xab0a, 0x00 },
+{ "linux/nbd.h", "NBD_SET_SIZE", _IOC_NONE, 0xab02, 0x00 },
+{ "linux/nbd.h", "NBD_SET_SIZE_BLOCKS", _IOC_NONE, 0xab07, 0x00 },
+{ "linux/nbd.h", "NBD_SET_SOCK", _IOC_NONE, 0xab00, 0x00 },
+{ "linux/nbd.h", "NBD_SET_TIMEOUT", _IOC_NONE, 0xab09, 0x00 },
+{ "linux/ndctl.h", "ND_IOCTL_ARS_CAP", _IOC_READ|_IOC_WRITE, 0x4e01, 0x20 },
+{ "linux/ndctl.h", "ND_IOCTL_ARS_START", _IOC_READ|_IOC_WRITE, 0x4e02, 0x20 },
+{ "linux/ndctl.h", "ND_IOCTL_ARS_STATUS", _IOC_READ|_IOC_WRITE, 0x4e03, 0x30 },
+{ "linux/ndctl.h", "ND_IOCTL_CALL", _IOC_READ|_IOC_WRITE, 0x4e0a, 0x40 },
+{ "linux/ndctl.h", "ND_IOCTL_CLEAR_ERROR", _IOC_READ|_IOC_WRITE, 0x4e04, 0x20 },
+{ "linux/ndctl.h", "ND_IOCTL_DIMM_FLAGS", _IOC_READ|_IOC_WRITE, 0x4e03, 0x08 },
+{ "linux/ndctl.h", "ND_IOCTL_GET_CONFIG_DATA", _IOC_READ|_IOC_WRITE, 0x4e05, 0x0c },
+{ "linux/ndctl.h", "ND_IOCTL_GET_CONFIG_SIZE", _IOC_READ|_IOC_WRITE, 0x4e04, 0x0c },
+{ "linux/ndctl.h", "ND_IOCTL_SET_CONFIG_DATA", _IOC_READ|_IOC_WRITE, 0x4e06, 0x08 },
+{ "linux/ndctl.h", "ND_IOCTL_VENDOR", _IOC_READ|_IOC_WRITE, 0x4e09, 0x08 },
+{ "linux/nilfs2_api.h", "NILFS_IOCTL_CHANGE_CPMODE", _IOC_WRITE, 0x6e80, 0x10 },
+{ "linux/nilfs2_api.h", "NILFS_IOCTL_CLEAN_SEGMENTS", _IOC_WRITE, 0x6e88, 0x78 },
+{ "linux/nilfs2_api.h", "NILFS_IOCTL_DELETE_CHECKPOINT", _IOC_WRITE, 0x6e81, 0x08 },
+{ "linux/nilfs2_api.h", "NILFS_IOCTL_GET_BDESCS", _IOC_READ|_IOC_WRITE, 0x6e87, 0x18 },
+{ "linux/nilfs2_api.h", "NILFS_IOCTL_GET_CPINFO", _IOC_READ, 0x6e82, 0x18 },
+{ "linux/nilfs2_api.h", "NILFS_IOCTL_GET_CPSTAT", _IOC_READ, 0x6e83, 0x18 },
+{ "linux/nilfs2_api.h", "NILFS_IOCTL_GET_SUINFO", _IOC_READ, 0x6e84, 0x18 },
+{ "linux/nilfs2_api.h", "NILFS_IOCTL_GET_SUSTAT", _IOC_READ, 0x6e85, 0x30 },
+{ "linux/nilfs2_api.h", "NILFS_IOCTL_GET_VINFO", _IOC_READ|_IOC_WRITE, 0x6e86, 0x18 },
+{ "linux/nilfs2_api.h", "NILFS_IOCTL_RESIZE", _IOC_WRITE, 0x6e8b, 0x08 },
+{ "linux/nilfs2_api.h", "NILFS_IOCTL_SET_ALLOC_RANGE", _IOC_WRITE, 0x6e8c, 0x10 },
+{ "linux/nilfs2_api.h", "NILFS_IOCTL_SET_SUINFO", _IOC_WRITE, 0x6e8d, 0x18 },
+{ "linux/nilfs2_api.h", "NILFS_IOCTL_SYNC", _IOC_READ, 0x6e8a, 0x08 },
+{ "linux/nitro_enclaves.h", "NE_ADD_VCPU", _IOC_READ|_IOC_WRITE, 0xae21, 0x04 },
+{ "linux/nitro_enclaves.h", "NE_CREATE_VM", _IOC_READ, 0xae20, 0x08 },
+{ "linux/nitro_enclaves.h", "NE_GET_IMAGE_LOAD_INFO", _IOC_READ|_IOC_WRITE, 0xae22, 0x10 },
+{ "linux/nitro_enclaves.h", "NE_SET_USER_MEMORY_REGION", _IOC_WRITE, 0xae23, 0x18 },
+{ "linux/nitro_enclaves.h", "NE_START_ENCLAVE", _IOC_READ|_IOC_WRITE, 0xae24, 0x10 },
+{ "linux/nsfs.h", "NS_GET_NSTYPE", _IOC_NONE, 0xb703, 0x00 },
+{ "linux/nsfs.h", "NS_GET_OWNER_UID", _IOC_NONE, 0xb704, 0x00 },
+{ "linux/nsfs.h", "NS_GET_PARENT", _IOC_NONE, 0xb702, 0x00 },
+{ "linux/nsfs.h", "NS_GET_USERNS", _IOC_NONE, 0xb701, 0x00 },
+{ "linux/nvme_ioctl.h", "NVME_IOCTL_ADMIN64_CMD", _IOC_READ|_IOC_WRITE, 0x4e47, 0x50 },
+{ "linux/nvme_ioctl.h", "NVME_IOCTL_ADMIN_CMD", _IOC_READ|_IOC_WRITE, 0x4e41, 0x48 },
+{ "linux/nvme_ioctl.h", "NVME_IOCTL_ID", _IOC_NONE, 0x4e40, 0x00 },
+{ "linux/nvme_ioctl.h", "NVME_IOCTL_IO64_CMD", _IOC_READ|_IOC_WRITE, 0x4e48, 0x50 },
+{ "linux/nvme_ioctl.h", "NVME_IOCTL_IO_CMD", _IOC_READ|_IOC_WRITE, 0x4e43, 0x48 },
+{ "linux/nvme_ioctl.h", "NVME_IOCTL_RESCAN", _IOC_NONE, 0x4e46, 0x00 },
+{ "linux/nvme_ioctl.h", "NVME_IOCTL_RESET", _IOC_NONE, 0x4e44, 0x00 },
+{ "linux/nvme_ioctl.h", "NVME_IOCTL_SUBMIT_IO", _IOC_WRITE, 0x4e42, 0x30 },
+{ "linux/nvme_ioctl.h", "NVME_IOCTL_SUBSYS_RESET", _IOC_NONE, 0x4e45, 0x00 },
+{ "linux/nvram.h", "NVRAM_INIT", _IOC_NONE, 0x7040, 0x00 },
+{ "linux/nvram.h", "NVRAM_SETCKS", _IOC_NONE, 0x7041, 0x00 },
+{ "linux/omap3isp.h", "VIDIOC_OMAP3ISP_AEWB_CFG", _IOC_READ|_IOC_WRITE, 0x56c3, 0x20 },
+{ "linux/omap3isp.h", "VIDIOC_OMAP3ISP_AF_CFG", _IOC_READ|_IOC_WRITE, 0x56c5, 0x4c },
+{ "linux/omap3isp.h", "VIDIOC_OMAP3ISP_CCDC_CFG", _IOC_READ|_IOC_WRITE, 0x56c1, 0x20 },
+{ "linux/omap3isp.h", "VIDIOC_OMAP3ISP_HIST_CFG", _IOC_READ|_IOC_WRITE, 0x56c4, 0x30 },
+{ "linux/omap3isp.h", "VIDIOC_OMAP3ISP_PRV_CFG", _IOC_READ|_IOC_WRITE, 0x56c2, 0x3c },
+{ "linux/omap3isp.h", "VIDIOC_OMAP3ISP_STAT_EN", _IOC_READ|_IOC_WRITE, 0x56c7, 0x04 },
+{ "linux/omap3isp.h", "VIDIOC_OMAP3ISP_STAT_REQ", _IOC_READ|_IOC_WRITE, 0x56c6, 0x20 },
+{ "linux/omap3isp.h", "VIDIOC_OMAP3ISP_STAT_REQ_TIME32", _IOC_READ|_IOC_WRITE, 0x56c6, 0x18 },
+{ "linux/omapfb.h", "OMAPFB_CTRL_TEST", _IOC_WRITE, 0x4f2e, 0x04 },
+{ "linux/omapfb.h", "OMAPFB_GET_CAPS", _IOC_READ, 0x4f2a, 0x0c },
+{ "linux/omapfb.h", "OMAPFB_GET_COLOR_KEY", _IOC_WRITE, 0x4f33, 0x10 },
+{ "linux/omapfb.h", "OMAPFB_GET_DISPLAY_INFO", _IOC_READ, 0x4f3f, 0x20 },
+{ "linux/omapfb.h", "OMAPFB_GET_OVERLAY_COLORMODE", _IOC_READ, 0x4f3b, 0x3c },
+{ "linux/omapfb.h", "OMAPFB_GET_UPDATE_MODE", _IOC_WRITE, 0x4f2b, 0x04 },
+{ "linux/omapfb.h", "OMAPFB_GET_VRAM_INFO", _IOC_READ, 0x4f3d, 0x20 },
+{ "linux/omapfb.h", "OMAPFB_LCD_TEST", _IOC_WRITE, 0x4f2d, 0x04 },
+{ "linux/omapfb.h", "OMAPFB_MEMORY_READ", _IOC_READ, 0x4f3a, 0x10 },
+{ "linux/omapfb.h", "OMAPFB_MIRROR", _IOC_WRITE, 0x4f1f, 0x04 },
+{ "linux/omapfb.h", "OMAPFB_QUERY_MEM", _IOC_WRITE, 0x4f38, 0x08 },
+{ "linux/omapfb.h", "OMAPFB_QUERY_PLANE", _IOC_WRITE, 0x4f35, 0x44 },
+{ "linux/omapfb.h", "OMAPFB_SETUP_MEM", _IOC_WRITE, 0x4f37, 0x08 },
+{ "linux/omapfb.h", "OMAPFB_SETUP_PLANE", _IOC_WRITE, 0x4f34, 0x44 },
+{ "linux/omapfb.h", "OMAPFB_SET_COLOR_KEY", _IOC_WRITE, 0x4f32, 0x10 },
+{ "linux/omapfb.h", "OMAPFB_SET_TEARSYNC", _IOC_WRITE, 0x4f3e, 0x08 },
+{ "linux/omapfb.h", "OMAPFB_SET_UPDATE_MODE", _IOC_WRITE, 0x4f28, 0x04 },
+{ "linux/omapfb.h", "OMAPFB_SYNC_GFX", _IOC_NONE, 0x4f25, 0x00 },
+{ "linux/omapfb.h", "OMAPFB_UPDATE_WINDOW", _IOC_WRITE, 0x4f36, 0x44 },
+{ "linux/omapfb.h", "OMAPFB_UPDATE_WINDOW_OLD", _IOC_WRITE, 0x4f2f, 0x14 },
+{ "linux/omapfb.h", "OMAPFB_VSYNC", _IOC_NONE, 0x4f26, 0x00 },
+{ "linux/omapfb.h", "OMAPFB_WAITFORGO", _IOC_NONE, 0x4f3c, 0x00 },
+{ "linux/omapfb.h", "OMAPFB_WAITFORVSYNC", _IOC_NONE, 0x4f39, 0x00 },
+{ "linux/pcitest.h", "PCITEST_BAR", _IOC_NONE, 0x5001, 0x00 },
+{ "linux/pcitest.h", "PCITEST_CLEAR_IRQ", _IOC_NONE, 0x5010, 0x00 },
+{ "linux/pcitest.h", "PCITEST_COPY", _IOC_WRITE, 0x5006, 0x04 },
+{ "linux/pcitest.h", "PCITEST_GET_IRQTYPE", _IOC_NONE, 0x5009, 0x00 },
+{ "linux/pcitest.h", "PCITEST_LEGACY_IRQ", _IOC_NONE, 0x5002, 0x00 },
+{ "linux/pcitest.h", "PCITEST_MSI", _IOC_WRITE, 0x5003, 0x04 },
+{ "linux/pcitest.h", "PCITEST_MSIX", _IOC_WRITE, 0x5007, 0x04 },
+{ "linux/pcitest.h", "PCITEST_READ", _IOC_WRITE, 0x5005, 0x04 },
+{ "linux/pcitest.h", "PCITEST_SET_IRQTYPE", _IOC_WRITE, 0x5008, 0x04 },
+{ "linux/pcitest.h", "PCITEST_WRITE", _IOC_WRITE, 0x5004, 0x04 },
+{ "linux/perf_event.h", "PERF_EVENT_IOC_DISABLE", _IOC_NONE, 0x2401, 0x00 },
+{ "linux/perf_event.h", "PERF_EVENT_IOC_ENABLE", _IOC_NONE, 0x2400, 0x00 },
+{ "linux/perf_event.h", "PERF_EVENT_IOC_ID", _IOC_READ, 0x2407, 0x04 },
+{ "linux/perf_event.h", "PERF_EVENT_IOC_MODIFY_ATTRIBUTES", _IOC_WRITE, 0x240b, 0x04 },
+{ "linux/perf_event.h", "PERF_EVENT_IOC_PAUSE_OUTPUT", _IOC_WRITE, 0x2409, 0x04 },
+{ "linux/perf_event.h", "PERF_EVENT_IOC_PERIOD", _IOC_WRITE, 0x2404, 0x08 },
+{ "linux/perf_event.h", "PERF_EVENT_IOC_QUERY_BPF", _IOC_READ|_IOC_WRITE, 0x240a, 0x04 },
+{ "linux/perf_event.h", "PERF_EVENT_IOC_REFRESH", _IOC_NONE, 0x2402, 0x00 },
+{ "linux/perf_event.h", "PERF_EVENT_IOC_RESET", _IOC_NONE, 0x2403, 0x00 },
+{ "linux/perf_event.h", "PERF_EVENT_IOC_SET_BPF", _IOC_WRITE, 0x2408, 0x04 },
+{ "linux/perf_event.h", "PERF_EVENT_IOC_SET_FILTER", _IOC_WRITE, 0x2406, 0x04 },
+{ "linux/perf_event.h", "PERF_EVENT_IOC_SET_OUTPUT", _IOC_NONE, 0x2405, 0x00 },
+{ "linux/phantom.h", "PHN_GETREG", _IOC_READ|_IOC_WRITE, 0x7005, 0x08 },
+{ "linux/phantom.h", "PHN_GETREGS", _IOC_READ|_IOC_WRITE, 0x7007, 0x28 },
+{ "linux/phantom.h", "PHN_GET_REG", _IOC_READ|_IOC_WRITE, 0x7000, 0x04 },
+{ "linux/phantom.h", "PHN_GET_REGS", _IOC_READ|_IOC_WRITE, 0x7002, 0x04 },
+{ "linux/phantom.h", "PHN_NOT_OH", _IOC_NONE, 0x7004, 0x00 },
+{ "linux/phantom.h", "PHN_SETREG", _IOC_WRITE, 0x7006, 0x08 },
+{ "linux/phantom.h", "PHN_SETREGS", _IOC_WRITE, 0x7008, 0x28 },
+{ "linux/phantom.h", "PHN_SET_REG", _IOC_WRITE, 0x7001, 0x04 },
+{ "linux/phantom.h", "PHN_SET_REGS", _IOC_WRITE, 0x7003, 0x04 },
+{ "linux/pktcdvd.h", "PACKET_CTRL_CMD", _IOC_READ|_IOC_WRITE, 0x5801, 0x18 },
+{ "linux/platform_data/cros_ec_chardev.h", "CROS_EC_DEV_IOCEVENTMASK", _IOC_NONE, 0xec02, 0x00 },
+{ "linux/platform_data/cros_ec_chardev.h", "CROS_EC_DEV_IOCRDMEM", _IOC_READ|_IOC_WRITE, 0xec01, 0x108 },
+{ "linux/platform_data/cros_ec_chardev.h", "CROS_EC_DEV_IOCXCMD", _IOC_READ|_IOC_WRITE, 0xec00, 0x14 },
+{ "linux/platform_data/media/si4713.h", "SI4713_IOC_MEASURE_RNL", _IOC_READ|_IOC_WRITE, 0x56c0, 0x1c },
+{ "linux/pmu.h", "PMU_IOC_CAN_SLEEP", _IOC_READ, 0x4205, 0x04 },
+{ "linux/pmu.h", "PMU_IOC_GET_BACKLIGHT", _IOC_READ, 0x4201, 0x04 },
+{ "linux/pmu.h", "PMU_IOC_GET_MODEL", _IOC_READ, 0x4203, 0x04 },
+{ "linux/pmu.h", "PMU_IOC_GRAB_BACKLIGHT", _IOC_READ, 0x4206, 0x04 },
+{ "linux/pmu.h", "PMU_IOC_HAS_ADB", _IOC_READ, 0x4204, 0x04 },
+{ "linux/pmu.h", "PMU_IOC_SET_BACKLIGHT", _IOC_WRITE, 0x4202, 0x04 },
+{ "linux/pmu.h", "PMU_IOC_SLEEP", _IOC_NONE, 0x4200, 0x00 },
+{ "linux/ppdev.h", "PPCLAIM", _IOC_NONE, 0x708b, 0x00 },
+{ "linux/ppdev.h", "PPCLRIRQ", _IOC_READ, 0x7093, 0x04 },
+{ "linux/ppdev.h", "PPDATADIR", _IOC_WRITE, 0x7090, 0x04 },
+{ "linux/ppdev.h", "PPEXCL", _IOC_NONE, 0x708f, 0x00 },
+{ "linux/ppdev.h", "PPFCONTROL", _IOC_WRITE, 0x708e, 0x02 },
+{ "linux/ppdev.h", "PPGETFLAGS", _IOC_READ, 0x709a, 0x04 },
+{ "linux/ppdev.h", "PPGETMODE", _IOC_READ, 0x7098, 0x04 },
+{ "linux/ppdev.h", "PPGETMODES", _IOC_READ, 0x7097, 0x04 },
+{ "linux/ppdev.h", "PPGETPHASE", _IOC_READ, 0x7099, 0x04 },
+{ "linux/ppdev.h", "PPGETTIME", _IOC_READ, 0x7095, 0x10 },
+{ "linux/ppdev.h", "PPNEGOT", _IOC_WRITE, 0x7091, 0x04 },
+{ "linux/ppdev.h", "PPRCONTROL", _IOC_READ, 0x7083, 0x01 },
+{ "linux/ppdev.h", "PPRDATA", _IOC_READ, 0x7085, 0x01 },
+{ "linux/ppdev.h", "PPRELEASE", _IOC_NONE, 0x708c, 0x00 },
+{ "linux/ppdev.h", "PPRSTATUS", _IOC_READ, 0x7081, 0x01 },
+{ "linux/ppdev.h", "PPSETFLAGS", _IOC_WRITE, 0x709b, 0x04 },
+{ "linux/ppdev.h", "PPSETMODE", _IOC_WRITE, 0x7080, 0x04 },
+{ "linux/ppdev.h", "PPSETPHASE", _IOC_WRITE, 0x7094, 0x04 },
+{ "linux/ppdev.h", "PPSETTIME", _IOC_WRITE, 0x7096, 0x10 },
+{ "linux/ppdev.h", "PPWCONTROL", _IOC_WRITE, 0x7084, 0x01 },
+{ "linux/ppdev.h", "PPWCTLONIRQ", _IOC_WRITE, 0x7092, 0x01 },
+{ "linux/ppdev.h", "PPWDATA", _IOC_WRITE, 0x7086, 0x01 },
+{ "linux/ppdev.h", "PPYIELD", _IOC_NONE, 0x708d, 0x00 },
+{ "linux/ppp-ioctl.h", "PPPIOCATTACH", _IOC_WRITE, 0x743d, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCATTCHAN", _IOC_WRITE, 0x7438, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCCONNECT", _IOC_WRITE, 0x743a, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCDETACH", _IOC_WRITE, 0x743c, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCDISCONN", _IOC_NONE, 0x7439, 0x00 },
+{ "linux/ppp-ioctl.h", "PPPIOCGASYNCMAP", _IOC_READ, 0x7458, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCGCHAN", _IOC_READ, 0x7437, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCGDEBUG", _IOC_READ, 0x7441, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCGFLAGS", _IOC_READ, 0x745a, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCGIDLE32", _IOC_READ, 0x743f, 0x08 },
+{ "linux/ppp-ioctl.h", "PPPIOCGIDLE64", _IOC_READ, 0x743f, 0x10 },
+{ "linux/ppp-ioctl.h", "PPPIOCGL2TPSTATS", _IOC_READ, 0x7436, 0x48 },
+{ "linux/ppp-ioctl.h", "PPPIOCGMRU", _IOC_READ, 0x7453, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCGNPMODE", _IOC_READ|_IOC_WRITE, 0x744c, 0x08 },
+{ "linux/ppp-ioctl.h", "PPPIOCGRASYNCMAP", _IOC_READ, 0x7455, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCGUNIT", _IOC_READ, 0x7456, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCGXASYNCMAP", _IOC_READ, 0x7450, 0x20 },
+{ "linux/ppp-ioctl.h", "PPPIOCNEWUNIT", _IOC_READ|_IOC_WRITE, 0x743e, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCSACTIVE", _IOC_WRITE, 0x7446, 0x08 },
+{ "linux/ppp-ioctl.h", "PPPIOCSASYNCMAP", _IOC_WRITE, 0x7457, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCSCOMPRESS", _IOC_WRITE, 0x744d, 0x0c },
+{ "linux/ppp-ioctl.h", "PPPIOCSDEBUG", _IOC_WRITE, 0x7440, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCSFLAGS", _IOC_WRITE, 0x7459, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCSMAXCID", _IOC_WRITE, 0x7451, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCSMRRU", _IOC_WRITE, 0x743b, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCSMRU", _IOC_WRITE, 0x7452, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCSNPMODE", _IOC_WRITE, 0x744b, 0x08 },
+{ "linux/ppp-ioctl.h", "PPPIOCSPASS", _IOC_WRITE, 0x7447, 0x08 },
+{ "linux/ppp-ioctl.h", "PPPIOCSRASYNCMAP", _IOC_WRITE, 0x7454, 0x04 },
+{ "linux/ppp-ioctl.h", "PPPIOCSXASYNCMAP", _IOC_WRITE, 0x744f, 0x20 },
+{ "linux/ppp-ioctl.h", "PPPIOCXFERUNIT", _IOC_NONE, 0x744e, 0x00 },
+{ "linux/pps.h", "PPS_FETCH", _IOC_READ|_IOC_WRITE, 0x70a4, 0x04 },
+{ "linux/pps.h", "PPS_GETCAP", _IOC_READ, 0x70a3, 0x04 },
+{ "linux/pps.h", "PPS_GETPARAMS", _IOC_READ, 0x70a1, 0x04 },
+{ "linux/pps.h", "PPS_KC_BIND", _IOC_WRITE, 0x70a5, 0x04 },
+{ "linux/pps.h", "PPS_SETPARAMS", _IOC_WRITE, 0x70a2, 0x04 },
+{ "linux/pr.h", "IOC_PR_CLEAR", _IOC_WRITE, 0x70cd, 0x10 },
+{ "linux/pr.h", "IOC_PR_PREEMPT", _IOC_WRITE, 0x70cb, 0x18 },
+{ "linux/pr.h", "IOC_PR_PREEMPT_ABORT", _IOC_WRITE, 0x70cc, 0x18 },
+{ "linux/pr.h", "IOC_PR_REGISTER", _IOC_WRITE, 0x70c8, 0x18 },
+{ "linux/pr.h", "IOC_PR_RELEASE", _IOC_WRITE, 0x70ca, 0x10 },
+{ "linux/pr.h", "IOC_PR_RESERVE", _IOC_WRITE, 0x70c9, 0x10 },
+{ "linux/psp-sev.h", "SEV_ISSUE_CMD", _IOC_READ|_IOC_WRITE, 0x5300, 0x10 },
+{ "linux/ptp_clock.h", "PTP_CLOCK_GETCAPS", _IOC_READ, 0x3d01, 0x50 },
+{ "linux/ptp_clock.h", "PTP_CLOCK_GETCAPS2", _IOC_READ, 0x3d0a, 0x50 },
+{ "linux/ptp_clock.h", "PTP_ENABLE_PPS", _IOC_WRITE, 0x3d04, 0x04 },
+{ "linux/ptp_clock.h", "PTP_ENABLE_PPS2", _IOC_WRITE, 0x3d0d, 0x04 },
+{ "linux/ptp_clock.h", "PTP_EXTTS_REQUEST", _IOC_WRITE, 0x3d02, 0x10 },
+{ "linux/ptp_clock.h", "PTP_EXTTS_REQUEST2", _IOC_WRITE, 0x3d0b, 0x10 },
+{ "linux/ptp_clock.h", "PTP_PEROUT_REQUEST", _IOC_WRITE, 0x3d03, 0x38 },
+{ "linux/ptp_clock.h", "PTP_PEROUT_REQUEST2", _IOC_WRITE, 0x3d0c, 0x38 },
+{ "linux/ptp_clock.h", "PTP_PIN_GETFUNC", _IOC_READ|_IOC_WRITE, 0x3d06, 0x60 },
+{ "linux/ptp_clock.h", "PTP_PIN_GETFUNC2", _IOC_READ|_IOC_WRITE, 0x3d0f, 0x60 },
+{ "linux/ptp_clock.h", "PTP_PIN_SETFUNC", _IOC_WRITE, 0x3d07, 0x60 },
+{ "linux/ptp_clock.h", "PTP_PIN_SETFUNC2", _IOC_WRITE, 0x3d10, 0x60 },
+{ "linux/ptp_clock.h", "PTP_SYS_OFFSET", _IOC_WRITE, 0x3d05, 0x340 },
+{ "linux/ptp_clock.h", "PTP_SYS_OFFSET2", _IOC_WRITE, 0x3d0e, 0x340 },
+{ "linux/ptp_clock.h", "PTP_SYS_OFFSET_EXTENDED", _IOC_READ|_IOC_WRITE, 0x3d09, 0x4c0 },
+{ "linux/ptp_clock.h", "PTP_SYS_OFFSET_EXTENDED2", _IOC_READ|_IOC_WRITE, 0x3d12, 0x4c0 },
+{ "linux/ptp_clock.h", "PTP_SYS_OFFSET_PRECISE", _IOC_READ|_IOC_WRITE, 0x3d08, 0x40 },
+{ "linux/ptp_clock.h", "PTP_SYS_OFFSET_PRECISE2", _IOC_READ|_IOC_WRITE, 0x3d11, 0x40 },
+{ "linux/radeonfb.h", "FBIO_RADEON_GET_MIRROR", _IOC_READ, 0x4003, 0x04 },
+{ "linux/radeonfb.h", "FBIO_RADEON_SET_MIRROR", _IOC_WRITE, 0x4004, 0x04 },
+{ "linux/raid/md_u.h", "ADD_NEW_DISK", _IOC_WRITE, 0x0921, 0x14 },
+{ "linux/raid/md_u.h", "CLEAR_ARRAY", _IOC_NONE, 0x0920, 0x00 },
+{ "linux/raid/md_u.h", "CLUSTERED_DISK_NACK", _IOC_NONE, 0x0935, 0x00 },
+{ "linux/raid/md_u.h", "GET_ARRAY_INFO", _IOC_READ, 0x0911, 0x48 },
+{ "linux/raid/md_u.h", "GET_BITMAP_FILE", _IOC_READ, 0x0915, 0x1000 },
+{ "linux/raid/md_u.h", "GET_DISK_INFO", _IOC_READ, 0x0912, 0x14 },
+{ "linux/raid/md_u.h", "HOT_ADD_DISK", _IOC_NONE, 0x0928, 0x00 },
+{ "linux/raid/md_u.h", "HOT_GENERATE_ERROR", _IOC_NONE, 0x092a, 0x00 },
+{ "linux/raid/md_u.h", "HOT_REMOVE_DISK", _IOC_NONE, 0x0922, 0x00 },
+{ "linux/raid/md_u.h", "PROTECT_ARRAY", _IOC_NONE, 0x0927, 0x00 },
+{ "linux/raid/md_u.h", "RAID_AUTORUN", _IOC_NONE, 0x0914, 0x00 },
+{ "linux/raid/md_u.h", "RAID_VERSION", _IOC_READ, 0x0910, 0x0c },
+{ "linux/raid/md_u.h", "RESTART_ARRAY_RW", _IOC_NONE, 0x0934, 0x00 },
+{ "linux/raid/md_u.h", "RUN_ARRAY", _IOC_WRITE, 0x0930, 0x0c },
+{ "linux/raid/md_u.h", "SET_ARRAY_INFO", _IOC_WRITE, 0x0923, 0x48 },
+{ "linux/raid/md_u.h", "SET_BITMAP_FILE", _IOC_WRITE, 0x092b, 0x04 },
+{ "linux/raid/md_u.h", "SET_DISK_FAULTY", _IOC_NONE, 0x0929, 0x00 },
+{ "linux/raid/md_u.h", "SET_DISK_INFO", _IOC_NONE, 0x0924, 0x00 },
+{ "linux/raid/md_u.h", "STOP_ARRAY", _IOC_NONE, 0x0932, 0x00 },
+{ "linux/raid/md_u.h", "STOP_ARRAY_RO", _IOC_NONE, 0x0933, 0x00 },
+{ "linux/raid/md_u.h", "UNPROTECT_ARRAY", _IOC_NONE, 0x0926, 0x00 },
+{ "linux/raid/md_u.h", "WRITE_RAID_INFO", _IOC_NONE, 0x0925, 0x00 },
+{ "linux/random.h", "RNDADDENTROPY", _IOC_WRITE, 0x5203, 0x08 },
+{ "linux/random.h", "RNDADDTOENTCNT", _IOC_WRITE, 0x5201, 0x04 },
+{ "linux/random.h", "RNDCLEARPOOL", _IOC_NONE, 0x5206, 0x00 },
+{ "linux/random.h", "RNDGETENTCNT", _IOC_READ, 0x5200, 0x04 },
+{ "linux/random.h", "RNDGETPOOL", _IOC_READ, 0x5202, 0x08 },
+{ "linux/random.h", "RNDRESEEDCRNG", _IOC_NONE, 0x5207, 0x00 },
+{ "linux/random.h", "RNDZAPENTCNT", _IOC_NONE, 0x5204, 0x00 },
+{ "linux/raw.h", "RAW_GETBIND", _IOC_NONE, 0xac01, 0x00 },
+{ "linux/raw.h", "RAW_SETBIND", _IOC_NONE, 0xac00, 0x00 },
+{ "linux/reiserfs_fs.h", "REISERFS_IOC_UNPACK", _IOC_WRITE, 0xcd01, 0x04 },
+{ "linux/remoteproc_cdev.h", "RPROC_GET_SHUTDOWN_ON_RELEASE", _IOC_READ, 0xb702, 0x04 },
+{ "linux/remoteproc_cdev.h", "RPROC_SET_SHUTDOWN_ON_RELEASE", _IOC_WRITE, 0xb701, 0x04 },
+{ "linux/rfkill.h", "RFKILL_IOCTL_NOINPUT", _IOC_NONE, 0x5201, 0x00 },
+{ "linux/rio_cm_cdev.h", "RIO_CM_CHAN_ACCEPT", _IOC_READ|_IOC_WRITE, 0x6307, 0x08 },
+{ "linux/rio_cm_cdev.h", "RIO_CM_CHAN_BIND", _IOC_WRITE, 0x6305, 0x08 },
+{ "linux/rio_cm_cdev.h", "RIO_CM_CHAN_CLOSE", _IOC_WRITE, 0x6304, 0x02 },
+{ "linux/rio_cm_cdev.h", "RIO_CM_CHAN_CONNECT", _IOC_WRITE, 0x6308, 0x08 },
+{ "linux/rio_cm_cdev.h", "RIO_CM_CHAN_CREATE", _IOC_READ|_IOC_WRITE, 0x6303, 0x02 },
+{ "linux/rio_cm_cdev.h", "RIO_CM_CHAN_LISTEN", _IOC_WRITE, 0x6306, 0x02 },
+{ "linux/rio_cm_cdev.h", "RIO_CM_CHAN_RECEIVE", _IOC_READ|_IOC_WRITE, 0x630a, 0x10 },
+{ "linux/rio_cm_cdev.h", "RIO_CM_CHAN_SEND", _IOC_WRITE, 0x6309, 0x10 },
+{ "linux/rio_cm_cdev.h", "RIO_CM_EP_GET_LIST", _IOC_READ|_IOC_WRITE, 0x6302, 0x04 },
+{ "linux/rio_cm_cdev.h", "RIO_CM_EP_GET_LIST_SIZE", _IOC_READ|_IOC_WRITE, 0x6301, 0x04 },
+{ "linux/rio_cm_cdev.h", "RIO_CM_MPORT_GET_LIST", _IOC_READ|_IOC_WRITE, 0x630b, 0x04 },
+{ "linux/rio_mport_cdev.h", "RIO_ALLOC_DMA", _IOC_READ|_IOC_WRITE, 0x6d13, 0x18 },
+{ "linux/rio_mport_cdev.h", "RIO_DEV_ADD", _IOC_WRITE, 0x6d17, 0x20 },
+{ "linux/rio_mport_cdev.h", "RIO_DEV_DEL", _IOC_WRITE, 0x6d18, 0x20 },
+{ "linux/rio_mport_cdev.h", "RIO_DISABLE_DOORBELL_RANGE", _IOC_WRITE, 0x6d0a, 0x08 },
+{ "linux/rio_mport_cdev.h", "RIO_DISABLE_PORTWRITE_RANGE", _IOC_WRITE, 0x6d0c, 0x10 },
+{ "linux/rio_mport_cdev.h", "RIO_ENABLE_DOORBELL_RANGE", _IOC_WRITE, 0x6d09, 0x08 },
+{ "linux/rio_mport_cdev.h", "RIO_ENABLE_PORTWRITE_RANGE", _IOC_WRITE, 0x6d0b, 0x10 },
+{ "linux/rio_mport_cdev.h", "RIO_FREE_DMA", _IOC_WRITE, 0x6d14, 0x08 },
+{ "linux/rio_mport_cdev.h", "RIO_GET_EVENT_MASK", _IOC_READ, 0x6d0e, 0x04 },
+{ "linux/rio_mport_cdev.h", "RIO_MAP_INBOUND", _IOC_READ|_IOC_WRITE, 0x6d11, 0x28 },
+{ "linux/rio_mport_cdev.h", "RIO_MAP_OUTBOUND", _IOC_READ|_IOC_WRITE, 0x6d0f, 0x28 },
+{ "linux/rio_mport_cdev.h", "RIO_MPORT_GET_PROPERTIES", _IOC_READ, 0x6d04, 0x30 },
+{ "linux/rio_mport_cdev.h", "RIO_MPORT_MAINT_COMPTAG_SET", _IOC_WRITE, 0x6d02, 0x04 },
+{ "linux/rio_mport_cdev.h", "RIO_MPORT_MAINT_HDID_SET", _IOC_WRITE, 0x6d01, 0x02 },
+{ "linux/rio_mport_cdev.h", "RIO_MPORT_MAINT_PORT_IDX_GET", _IOC_READ, 0x6d03, 0x04 },
+{ "linux/rio_mport_cdev.h", "RIO_MPORT_MAINT_READ_LOCAL", _IOC_READ, 0x6d05, 0x18 },
+{ "linux/rio_mport_cdev.h", "RIO_MPORT_MAINT_READ_REMOTE", _IOC_READ, 0x6d07, 0x18 },
+{ "linux/rio_mport_cdev.h", "RIO_MPORT_MAINT_WRITE_LOCAL", _IOC_WRITE, 0x6d06, 0x18 },
+{ "linux/rio_mport_cdev.h", "RIO_MPORT_MAINT_WRITE_REMOTE", _IOC_WRITE, 0x6d08, 0x18 },
+{ "linux/rio_mport_cdev.h", "RIO_SET_EVENT_MASK", _IOC_WRITE, 0x6d0d, 0x04 },
+{ "linux/rio_mport_cdev.h", "RIO_TRANSFER", _IOC_READ|_IOC_WRITE, 0x6d15, 0x18 },
+{ "linux/rio_mport_cdev.h", "RIO_UNMAP_INBOUND", _IOC_WRITE, 0x6d12, 0x08 },
+{ "linux/rio_mport_cdev.h", "RIO_UNMAP_OUTBOUND", _IOC_WRITE, 0x6d10, 0x28 },
+{ "linux/rio_mport_cdev.h", "RIO_WAIT_FOR_ASYNC", _IOC_WRITE, 0x6d16, 0x08 },
+{ "linux/rpmsg.h", "RPMSG_CREATE_EPT_IOCTL", _IOC_WRITE, 0xb501, 0x28 },
+{ "linux/rpmsg.h", "RPMSG_DESTROY_EPT_IOCTL", _IOC_NONE, 0xb502, 0x00 },
+{ "linux/rtc.h", "RTC_AIE_OFF", _IOC_NONE, 0x7002, 0x00 },
+{ "linux/rtc.h", "RTC_AIE_ON", _IOC_NONE, 0x7001, 0x00 },
+{ "linux/rtc.h", "RTC_ALM_READ", _IOC_READ, 0x7008, 0x24 },
+{ "linux/rtc.h", "RTC_ALM_SET", _IOC_WRITE, 0x7007, 0x24 },
+{ "linux/rtc.h", "RTC_EPOCH_READ", _IOC_READ, 0x700d, 0x04 },
+{ "linux/rtc.h", "RTC_EPOCH_SET", _IOC_WRITE, 0x700e, 0x04 },
+{ "linux/rtc.h", "RTC_IRQP_READ", _IOC_READ, 0x700b, 0x04 },
+{ "linux/rtc.h", "RTC_IRQP_SET", _IOC_WRITE, 0x700c, 0x04 },
+{ "linux/rtc.h", "RTC_PIE_OFF", _IOC_NONE, 0x7006, 0x00 },
+{ "linux/rtc.h", "RTC_PIE_ON", _IOC_NONE, 0x7005, 0x00 },
+{ "linux/rtc.h", "RTC_PLL_GET", _IOC_READ, 0x7011, 0x1c },
+{ "linux/rtc.h", "RTC_PLL_SET", _IOC_WRITE, 0x7012, 0x1c },
+{ "linux/rtc.h", "RTC_RD_TIME", _IOC_READ, 0x7009, 0x24 },
+{ "linux/rtc.h", "RTC_SET_TIME", _IOC_WRITE, 0x700a, 0x24 },
+{ "linux/rtc.h", "RTC_UIE_OFF", _IOC_NONE, 0x7004, 0x00 },
+{ "linux/rtc.h", "RTC_UIE_ON", _IOC_NONE, 0x7003, 0x00 },
+{ "linux/rtc.h", "RTC_VL_CLR", _IOC_NONE, 0x7014, 0x00 },
+{ "linux/rtc.h", "RTC_VL_READ", _IOC_READ, 0x7013, 0x04 },
+{ "linux/rtc.h", "RTC_WIE_OFF", _IOC_NONE, 0x7010, 0x00 },
+{ "linux/rtc.h", "RTC_WIE_ON", _IOC_NONE, 0x700f, 0x00 },
+{ "linux/rtc.h", "RTC_WKALM_RD", _IOC_READ, 0x7010, 0x28 },
+{ "linux/rtc.h", "RTC_WKALM_SET", _IOC_WRITE, 0x700f, 0x28 },
+{ "linux/scif_ioctl.h", "SCIF_ACCEPTREG", _IOC_READ|_IOC_WRITE, 0x7305, 0x08 },
+{ "linux/scif_ioctl.h", "SCIF_ACCEPTREQ", _IOC_READ|_IOC_WRITE, 0x7304, 0x10 },
+{ "linux/scif_ioctl.h", "SCIF_BIND", _IOC_READ|_IOC_WRITE, 0x7301, 0x08 },
+{ "linux/scif_ioctl.h", "SCIF_CONNECT", _IOC_READ|_IOC_WRITE, 0x7303, 0x08 },
+{ "linux/scif_ioctl.h", "SCIF_FENCE_MARK", _IOC_READ|_IOC_WRITE, 0x730f, 0x10 },
+{ "linux/scif_ioctl.h", "SCIF_FENCE_SIGNAL", _IOC_READ|_IOC_WRITE, 0x7311, 0x28 },
+{ "linux/scif_ioctl.h", "SCIF_FENCE_WAIT", _IOC_READ|_IOC_WRITE, 0x7310, 0x04 },
+{ "linux/scif_ioctl.h", "SCIF_GET_NODEIDS", _IOC_READ|_IOC_WRITE, 0x730e, 0x18 },
+{ "linux/scif_ioctl.h", "SCIF_LISTEN", _IOC_WRITE, 0x7302, 0x04 },
+{ "linux/scif_ioctl.h", "SCIF_READFROM", _IOC_READ|_IOC_WRITE, 0x730a, 0x28 },
+{ "linux/scif_ioctl.h", "SCIF_RECV", _IOC_READ|_IOC_WRITE, 0x7307, 0x18 },
+{ "linux/scif_ioctl.h", "SCIF_REG", _IOC_READ|_IOC_WRITE, 0x7308, 0x28 },
+{ "linux/scif_ioctl.h", "SCIF_SEND", _IOC_READ|_IOC_WRITE, 0x7306, 0x18 },
+{ "linux/scif_ioctl.h", "SCIF_UNREG", _IOC_READ|_IOC_WRITE, 0x7309, 0x10 },
+{ "linux/scif_ioctl.h", "SCIF_VREADFROM", _IOC_READ|_IOC_WRITE, 0x730c, 0x28 },
+{ "linux/scif_ioctl.h", "SCIF_VWRITETO", _IOC_READ|_IOC_WRITE, 0x730d, 0x28 },
+{ "linux/scif_ioctl.h", "SCIF_WRITETO", _IOC_READ|_IOC_WRITE, 0x730b, 0x28 },
+{ "linux/seccomp.h", "SECCOMP_IOCTL_NOTIF_ADDFD", _IOC_WRITE, 0x2103, 0x18 },
+{ "linux/seccomp.h", "SECCOMP_IOCTL_NOTIF_ID_VALID", _IOC_WRITE, 0x2102, 0x08 },
+{ "linux/seccomp.h", "SECCOMP_IOCTL_NOTIF_RECV", _IOC_READ|_IOC_WRITE, 0x2100, 0x50 },
+{ "linux/seccomp.h", "SECCOMP_IOCTL_NOTIF_SEND", _IOC_READ|_IOC_WRITE, 0x2101, 0x18 },
+{ "linux/sed-opal.h", "IOC_OPAL_ACTIVATE_LSP", _IOC_WRITE, 0x70df, 0x118 },
+{ "linux/sed-opal.h", "IOC_OPAL_ACTIVATE_USR", _IOC_WRITE, 0x70e1, 0x110 },
+{ "linux/sed-opal.h", "IOC_OPAL_ADD_USR_TO_LR", _IOC_WRITE, 0x70e4, 0x118 },
+{ "linux/sed-opal.h", "IOC_OPAL_ENABLE_DISABLE_MBR", _IOC_WRITE, 0x70e5, 0x110 },
+{ "linux/sed-opal.h", "IOC_OPAL_ERASE_LR", _IOC_WRITE, 0x70e6, 0x110 },
+{ "linux/sed-opal.h", "IOC_OPAL_GENERIC_TABLE_RW", _IOC_WRITE, 0x70eb, 0x138 },
+{ "linux/sed-opal.h", "IOC_OPAL_LOCK_UNLOCK", _IOC_WRITE, 0x70dd, 0x118 },
+{ "linux/sed-opal.h", "IOC_OPAL_LR_SETUP", _IOC_WRITE, 0x70e3, 0x128 },
+{ "linux/sed-opal.h", "IOC_OPAL_MBR_DONE", _IOC_WRITE, 0x70e9, 0x110 },
+{ "linux/sed-opal.h", "IOC_OPAL_PSID_REVERT_TPR", _IOC_WRITE, 0x70e8, 0x108 },
+{ "linux/sed-opal.h", "IOC_OPAL_REVERT_TPR", _IOC_WRITE, 0x70e2, 0x108 },
+{ "linux/sed-opal.h", "IOC_OPAL_SAVE", _IOC_WRITE, 0x70dc, 0x118 },
+{ "linux/sed-opal.h", "IOC_OPAL_SECURE_ERASE_LR", _IOC_WRITE, 0x70e7, 0x110 },
+{ "linux/sed-opal.h", "IOC_OPAL_SET_PW", _IOC_WRITE, 0x70e0, 0x220 },
+{ "linux/sed-opal.h", "IOC_OPAL_TAKE_OWNERSHIP", _IOC_WRITE, 0x70de, 0x108 },
+{ "linux/sed-opal.h", "IOC_OPAL_WRITE_SHADOW_MBR", _IOC_WRITE, 0x70ea, 0x120 },
+{ "linux/serio.h", "SPIOCSTYPE", _IOC_WRITE, 0x7101, 0x04 },
+{ "linux/sockios.h", "SIOCADDDLCI", 0, 0x8980, 0 },
+{ "linux/sockios.h", "SIOCADDMULTI", 0, 0x8931, 0 },
+{ "linux/sockios.h", "SIOCADDRT", 0, 0x890B, 0 },
+{ "linux/sockios.h", "SIOCBONDCHANGEACTIVE", 0, 0x8995, 0 },
+{ "linux/sockios.h", "SIOCBONDENSLAVE", 0, 0x8990, 0 },
+{ "linux/sockios.h", "SIOCBONDINFOQUERY", 0, 0x8994, 0 },
+{ "linux/sockios.h", "SIOCBONDRELEASE", 0, 0x8991, 0 },
+{ "linux/sockios.h", "SIOCBONDSETHWADDR", 0, 0x8992, 0 },
+{ "linux/sockios.h", "SIOCBONDSLAVEINFOQUERY", 0, 0x8993, 0 },
+{ "linux/sockios.h", "SIOCBRADDBR", 0, 0x89a0, 0 },
+{ "linux/sockios.h", "SIOCBRADDIF", 0, 0x89a2, 0 },
+{ "linux/sockios.h", "SIOCBRDELBR", 0, 0x89a1, 0 },
+{ "linux/sockios.h", "SIOCBRDELIF", 0, 0x89a3, 0 },
+{ "linux/sockios.h", "SIOCDARP", 0, 0x8953, 0 },
+{ "linux/sockios.h", "SIOCDELDLCI", 0, 0x8981, 0 },
+{ "linux/sockios.h", "SIOCDELMULTI", 0, 0x8932, 0 },
+{ "linux/sockios.h", "SIOCDELRT", 0, 0x890C, 0 },
+{ "linux/sockios.h", "SIOCDEVPRIVATE", 0, 0x89F0, 0 },
+{ "linux/sockios.h", "SIOCDIFADDR", 0, 0x8936, 0 },
+{ "linux/sockios.h", "SIOCDRARP", 0, 0x8960, 0 },
+{ "linux/sockios.h", "SIOCETHTOOL", 0, 0x8946, 0 },
+{ "linux/sockios.h", "SIOCGARP", 0, 0x8954, 0 },
+{ "linux/sockios.h", "SIOCGHWTSTAMP", 0, 0x89b1, 0 },
+{ "linux/sockios.h", "SIOCGIFADDR", 0, 0x8915, 0 },
+{ "linux/sockios.h", "SIOCGIFBR", 0, 0x8940, 0 },
+{ "linux/sockios.h", "SIOCGIFBRDADDR", 0, 0x8919, 0 },
+{ "linux/sockios.h", "SIOCGIFCONF", 0, 0x8912, 0 },
+{ "linux/sockios.h", "SIOCGIFCOUNT", 0, 0x8938, 0 },
+{ "linux/sockios.h", "SIOCGIFDSTADDR", 0, 0x8917, 0 },
+{ "linux/sockios.h", "SIOCGIFENCAP", 0, 0x8925, 0 },
+{ "linux/sockios.h", "SIOCGIFFLAGS", 0, 0x8913, 0 },
+{ "linux/sockios.h", "SIOCGIFHWADDR", 0, 0x8927, 0 },
+{ "linux/sockios.h", "SIOCGIFINDEX", 0, 0x8933, 0 },
+{ "linux/sockios.h", "SIOCGIFMAP", 0, 0x8970, 0 },
+{ "linux/sockios.h", "SIOCGIFMEM", 0, 0x891f, 0 },
+{ "linux/sockios.h", "SIOCGIFMETRIC", 0, 0x891d, 0 },
+{ "linux/sockios.h", "SIOCGIFMTU", 0, 0x8921, 0 },
+{ "linux/sockios.h", "SIOCGIFNAME", 0, 0x8910, 0 },
+{ "linux/sockios.h", "SIOCGIFNETMASK", 0, 0x891b, 0 },
+{ "linux/sockios.h", "SIOCGIFPFLAGS", 0, 0x8935, 0 },
+{ "linux/sockios.h", "SIOCGIFSLAVE", 0, 0x8929, 0 },
+{ "linux/sockios.h", "SIOCGIFTXQLEN", 0, 0x8942, 0 },
+{ "linux/sockios.h", "SIOCGIFVLAN", 0, 0x8982, 0 },
+{ "linux/sockios.h", "SIOCGMIIPHY", 0, 0x8947, 0 },
+{ "linux/sockios.h", "SIOCGMIIREG", 0, 0x8948, 0 },
+{ "linux/sockios.h", "SIOCGRARP", 0, 0x8961, 0 },
+{ "linux/sockios.h", "SIOCGSKNS", 0, 0x894C, 0 },
+{ "linux/sockios.h", "SIOCGSTAMPNS_NEW", _IOC_READ, 0x8907, 0x10 },
+{ "linux/sockios.h", "SIOCGSTAMP_NEW", _IOC_READ, 0x8906, 0x10 },
+{ "linux/sockios.h", "SIOCOUTQNSD", 0, 0x894B, 0 },
+{ "linux/sockios.h", "SIOCPROTOPRIVATE", 0, 0x89E0, 0 },
+{ "linux/sockios.h", "SIOCRTMSG", 0, 0x890D, 0 },
+{ "linux/sockios.h", "SIOCSARP", 0, 0x8955, 0 },
+{ "linux/sockios.h", "SIOCSHWTSTAMP", 0, 0x89b0, 0 },
+{ "linux/sockios.h", "SIOCSIFADDR", 0, 0x8916, 0 },
+{ "linux/sockios.h", "SIOCSIFBR", 0, 0x8941, 0 },
+{ "linux/sockios.h", "SIOCSIFBRDADDR", 0, 0x891a, 0 },
+{ "linux/sockios.h", "SIOCSIFDSTADDR", 0, 0x8918, 0 },
+{ "linux/sockios.h", "SIOCSIFENCAP", 0, 0x8926, 0 },
+{ "linux/sockios.h", "SIOCSIFFLAGS", 0, 0x8914, 0 },
+{ "linux/sockios.h", "SIOCSIFHWADDR", 0, 0x8924, 0 },
+{ "linux/sockios.h", "SIOCSIFHWBROADCAST", 0, 0x8937, 0 },
+{ "linux/sockios.h", "SIOCSIFLINK", 0, 0x8911, 0 },
+{ "linux/sockios.h", "SIOCSIFMAP", 0, 0x8971, 0 },
+{ "linux/sockios.h", "SIOCSIFMEM", 0, 0x8920, 0 },
+{ "linux/sockios.h", "SIOCSIFMETRIC", 0, 0x891e, 0 },
+{ "linux/sockios.h", "SIOCSIFMTU", 0, 0x8922, 0 },
+{ "linux/sockios.h", "SIOCSIFNAME", 0, 0x8923, 0 },
+{ "linux/sockios.h", "SIOCSIFNETMASK", 0, 0x891c, 0 },
+{ "linux/sockios.h", "SIOCSIFPFLAGS", 0, 0x8934, 0 },
+{ "linux/sockios.h", "SIOCSIFSLAVE", 0, 0x8930, 0 },
+{ "linux/sockios.h", "SIOCSIFTXQLEN", 0, 0x8943, 0 },
+{ "linux/sockios.h", "SIOCSIFVLAN", 0, 0x8983, 0 },
+{ "linux/sockios.h", "SIOCSMIIREG", 0, 0x8949, 0 },
+{ "linux/sockios.h", "SIOCSRARP", 0, 0x8962, 0 },
+{ "linux/sockios.h", "SIOCWANDEV", 0, 0x894A, 0 },
+{ "linux/sonet.h", "SONET_CLRDIAG", _IOC_READ|_IOC_WRITE, 0x6113, 0x04 },
+{ "linux/sonet.h", "SONET_GETDIAG", _IOC_READ, 0x6114, 0x04 },
+{ "linux/sonet.h", "SONET_GETFRAMING", _IOC_READ, 0x6116, 0x04 },
+{ "linux/sonet.h", "SONET_GETFRSENSE", _IOC_READ, 0x6117, 0x06 },
+{ "linux/sonet.h", "SONET_GETSTAT", _IOC_READ, 0x6110, 0x24 },
+{ "linux/sonet.h", "SONET_GETSTATZ", _IOC_READ, 0x6111, 0x24 },
+{ "linux/sonet.h", "SONET_SETDIAG", _IOC_READ|_IOC_WRITE, 0x6112, 0x04 },
+{ "linux/sonet.h", "SONET_SETFRAMING", _IOC_WRITE, 0x6115, 0x04 },
+{ "linux/sonypi.h", "SONYPI_IOCGBAT1CAP", _IOC_READ, 0x7602, 0x02 },
+{ "linux/sonypi.h", "SONYPI_IOCGBAT1REM", _IOC_READ, 0x7603, 0x02 },
+{ "linux/sonypi.h", "SONYPI_IOCGBAT2CAP", _IOC_READ, 0x7604, 0x02 },
+{ "linux/sonypi.h", "SONYPI_IOCGBAT2REM", _IOC_READ, 0x7605, 0x02 },
+{ "linux/sonypi.h", "SONYPI_IOCGBATFLAGS", _IOC_READ, 0x7607, 0x01 },
+{ "linux/sonypi.h", "SONYPI_IOCGBLUE", _IOC_READ, 0x7608, 0x01 },
+{ "linux/sonypi.h", "SONYPI_IOCGBRT", _IOC_READ, 0x7600, 0x01 },
+{ "linux/sonypi.h", "SONYPI_IOCGFAN", _IOC_READ, 0x760a, 0x01 },
+{ "linux/sonypi.h", "SONYPI_IOCGTEMP", _IOC_READ, 0x760c, 0x01 },
+{ "linux/sonypi.h", "SONYPI_IOCSBLUE", _IOC_WRITE, 0x7609, 0x01 },
+{ "linux/sonypi.h", "SONYPI_IOCSBRT", _IOC_WRITE, 0x7600, 0x01 },
+{ "linux/sonypi.h", "SONYPI_IOCSFAN", _IOC_WRITE, 0x760b, 0x01 },
+{ "linux/soundcard.h", "OSS_GETVERSION", _IOC_READ, 0x4d76, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_COPR_HALT", _IOC_READ|_IOC_WRITE, 0x4307, 0x14 },
+{ "linux/soundcard.h", "SNDCTL_COPR_LOAD", _IOC_READ|_IOC_WRITE, 0x4301, 0xfb0 },
+{ "linux/soundcard.h", "SNDCTL_COPR_RCODE", _IOC_READ|_IOC_WRITE, 0x4303, 0x14 },
+{ "linux/soundcard.h", "SNDCTL_COPR_RCVMSG", _IOC_READ, 0x4309, 0xfa4 },
+{ "linux/soundcard.h", "SNDCTL_COPR_RDATA", _IOC_READ|_IOC_WRITE, 0x4302, 0x14 },
+{ "linux/soundcard.h", "SNDCTL_COPR_RESET", _IOC_NONE, 0x4300, 0x00 },
+{ "linux/soundcard.h", "SNDCTL_COPR_RUN", _IOC_READ|_IOC_WRITE, 0x4306, 0x14 },
+{ "linux/soundcard.h", "SNDCTL_COPR_SENDMSG", _IOC_READ|_IOC_WRITE, 0x4308, 0xfa4 },
+{ "linux/soundcard.h", "SNDCTL_COPR_WCODE", _IOC_WRITE, 0x4305, 0x14 },
+{ "linux/soundcard.h", "SNDCTL_COPR_WDATA", _IOC_WRITE, 0x4304, 0x14 },
+{ "linux/soundcard.h", "SNDCTL_DSP_BIND_CHANNEL", _IOC_READ|_IOC_WRITE, 0x5041, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_CHANNELS", _IOC_READ|_IOC_WRITE, 0x5006, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_GETBLKSIZE", _IOC_READ|_IOC_WRITE, 0x5004, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_GETCAPS", _IOC_READ, 0x500f, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_GETCHANNELMASK", _IOC_READ|_IOC_WRITE, 0x5040, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_GETFMTS", _IOC_READ, 0x500b, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_GETIPTR", _IOC_READ, 0x5011, 0x0c },
+{ "linux/soundcard.h", "SNDCTL_DSP_GETISPACE", _IOC_READ, 0x500d, 0x10 },
+{ "linux/soundcard.h", "SNDCTL_DSP_GETODELAY", _IOC_READ, 0x5017, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_GETOPTR", _IOC_READ, 0x5012, 0x0c },
+{ "linux/soundcard.h", "SNDCTL_DSP_GETOSPACE", _IOC_READ, 0x500c, 0x10 },
+{ "linux/soundcard.h", "SNDCTL_DSP_GETSPDIF", _IOC_READ, 0x5043, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_GETTRIGGER", _IOC_READ, 0x5010, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_MAPINBUF", _IOC_READ, 0x5013, 0x08 },
+{ "linux/soundcard.h", "SNDCTL_DSP_MAPOUTBUF", _IOC_READ, 0x5014, 0x08 },
+{ "linux/soundcard.h", "SNDCTL_DSP_NONBLOCK", _IOC_NONE, 0x500e, 0x00 },
+{ "linux/soundcard.h", "SNDCTL_DSP_POST", _IOC_NONE, 0x5008, 0x00 },
+{ "linux/soundcard.h", "SNDCTL_DSP_PROFILE", _IOC_WRITE, 0x5017, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_RESET", _IOC_NONE, 0x5000, 0x00 },
+{ "linux/soundcard.h", "SNDCTL_DSP_SETDUPLEX", _IOC_NONE, 0x5016, 0x00 },
+{ "linux/soundcard.h", "SNDCTL_DSP_SETFMT", _IOC_READ|_IOC_WRITE, 0x5005, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_SETFRAGMENT", _IOC_READ|_IOC_WRITE, 0x500a, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_SETSPDIF", _IOC_WRITE, 0x5042, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_SETSYNCRO", _IOC_NONE, 0x5015, 0x00 },
+{ "linux/soundcard.h", "SNDCTL_DSP_SETTRIGGER", _IOC_WRITE, 0x5010, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_SPEED", _IOC_READ|_IOC_WRITE, 0x5002, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_STEREO", _IOC_READ|_IOC_WRITE, 0x5003, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_SUBDIVIDE", _IOC_READ|_IOC_WRITE, 0x5009, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_DSP_SYNC", _IOC_NONE, 0x5001, 0x00 },
+{ "linux/soundcard.h", "SNDCTL_FM_4OP_ENABLE", _IOC_WRITE, 0x510f, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_FM_LOAD_INSTR", _IOC_WRITE, 0x5107, 0x28 },
+{ "linux/soundcard.h", "SNDCTL_MIDI_INFO", _IOC_READ|_IOC_WRITE, 0x510c, 0x74 },
+{ "linux/soundcard.h", "SNDCTL_MIDI_MPUCMD", _IOC_READ|_IOC_WRITE, 0x6d02, 0x21 },
+{ "linux/soundcard.h", "SNDCTL_MIDI_MPUMODE", _IOC_READ|_IOC_WRITE, 0x6d01, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_MIDI_PRETIME", _IOC_READ|_IOC_WRITE, 0x6d00, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_SEQ_CTRLRATE", _IOC_READ|_IOC_WRITE, 0x5103, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_SEQ_GETINCOUNT", _IOC_READ, 0x5105, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_SEQ_GETOUTCOUNT", _IOC_READ, 0x5104, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_SEQ_GETTIME", _IOC_READ, 0x5113, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_SEQ_NRMIDIS", _IOC_READ, 0x510b, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_SEQ_NRSYNTHS", _IOC_READ, 0x510a, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_SEQ_OUTOFBAND", _IOC_WRITE, 0x5112, 0x08 },
+{ "linux/soundcard.h", "SNDCTL_SEQ_PANIC", _IOC_NONE, 0x5111, 0x00 },
+{ "linux/soundcard.h", "SNDCTL_SEQ_PERCMODE", _IOC_WRITE, 0x5106, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_SEQ_RESET", _IOC_NONE, 0x5100, 0x00 },
+{ "linux/soundcard.h", "SNDCTL_SEQ_RESETSAMPLES", _IOC_WRITE, 0x5109, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_SEQ_SYNC", _IOC_NONE, 0x5101, 0x00 },
+{ "linux/soundcard.h", "SNDCTL_SEQ_TESTMIDI", _IOC_WRITE, 0x5108, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_SEQ_THRESHOLD", _IOC_WRITE, 0x510d, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_SYNTH_CONTROL", _IOC_READ|_IOC_WRITE, 0x5115, 0xfa4 },
+{ "linux/soundcard.h", "SNDCTL_SYNTH_ID", _IOC_READ|_IOC_WRITE, 0x5114, 0x8c },
+{ "linux/soundcard.h", "SNDCTL_SYNTH_INFO", _IOC_READ|_IOC_WRITE, 0x5102, 0x8c },
+{ "linux/soundcard.h", "SNDCTL_SYNTH_MEMAVL", _IOC_READ|_IOC_WRITE, 0x510e, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_SYNTH_REMOVESAMPLE", _IOC_READ|_IOC_WRITE, 0x5116, 0x0c },
+{ "linux/soundcard.h", "SNDCTL_TMR_CONTINUE", _IOC_NONE, 0x5404, 0x00 },
+{ "linux/soundcard.h", "SNDCTL_TMR_METRONOME", _IOC_WRITE, 0x5407, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_TMR_SELECT", _IOC_WRITE, 0x5408, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_TMR_SOURCE", _IOC_READ|_IOC_WRITE, 0x5406, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_TMR_START", _IOC_NONE, 0x5402, 0x00 },
+{ "linux/soundcard.h", "SNDCTL_TMR_STOP", _IOC_NONE, 0x5403, 0x00 },
+{ "linux/soundcard.h", "SNDCTL_TMR_TEMPO", _IOC_READ|_IOC_WRITE, 0x5405, 0x04 },
+{ "linux/soundcard.h", "SNDCTL_TMR_TIMEBASE", _IOC_READ|_IOC_WRITE, 0x5401, 0x04 },
+{ "linux/soundcard.h", "SOUND_MIXER_3DSE", _IOC_READ|_IOC_WRITE, 0x4d68, 0x04 },
+{ "linux/soundcard.h", "SOUND_MIXER_ACCESS", _IOC_READ|_IOC_WRITE, 0x4d66, 0x80 },
+{ "linux/soundcard.h", "SOUND_MIXER_AGC", _IOC_READ|_IOC_WRITE, 0x4d67, 0x04 },
+{ "linux/soundcard.h", "SOUND_MIXER_GETLEVELS", _IOC_READ|_IOC_WRITE, 0x4d74, 0xa4 },
+{ "linux/soundcard.h", "SOUND_MIXER_INFO", _IOC_READ, 0x4d65, 0x5c },
+{ "linux/soundcard.h", "SOUND_MIXER_PRIVATE1", _IOC_READ|_IOC_WRITE, 0x4d6f, 0x04 },
+{ "linux/soundcard.h", "SOUND_MIXER_PRIVATE2", _IOC_READ|_IOC_WRITE, 0x4d70, 0x04 },
+{ "linux/soundcard.h", "SOUND_MIXER_PRIVATE3", _IOC_READ|_IOC_WRITE, 0x4d71, 0x04 },
+{ "linux/soundcard.h", "SOUND_MIXER_PRIVATE4", _IOC_READ|_IOC_WRITE, 0x4d72, 0x04 },
+{ "linux/soundcard.h", "SOUND_MIXER_PRIVATE5", _IOC_READ|_IOC_WRITE, 0x4d73, 0x04 },
+{ "linux/soundcard.h", "SOUND_MIXER_SETLEVELS", _IOC_READ|_IOC_WRITE, 0x4d75, 0xa4 },
+{ "linux/soundcard.h", "SOUND_OLD_MIXER_INFO", _IOC_READ, 0x4d65, 0x30 },
+{ "linux/soundcard.h", "SOUND_PCM_READ_BITS", _IOC_READ, 0x5005, 0x04 },
+{ "linux/soundcard.h", "SOUND_PCM_READ_CHANNELS", _IOC_READ, 0x5006, 0x04 },
+{ "linux/soundcard.h", "SOUND_PCM_READ_FILTER", _IOC_READ, 0x5007, 0x04 },
+{ "linux/soundcard.h", "SOUND_PCM_READ_RATE", _IOC_READ, 0x5002, 0x04 },
+{ "linux/soundcard.h", "SOUND_PCM_WRITE_FILTER", _IOC_READ|_IOC_WRITE, 0x5007, 0x04 },
+{ "linux/spi/spidev.h", "SPI_IOC_RD_BITS_PER_WORD", _IOC_READ, 0x6b03, 0x01 },
+{ "linux/spi/spidev.h", "SPI_IOC_RD_LSB_FIRST", _IOC_READ, 0x6b02, 0x01 },
+{ "linux/spi/spidev.h", "SPI_IOC_RD_MAX_SPEED_HZ", _IOC_READ, 0x6b04, 0x04 },
+{ "linux/spi/spidev.h", "SPI_IOC_RD_MODE", _IOC_READ, 0x6b01, 0x01 },
+{ "linux/spi/spidev.h", "SPI_IOC_RD_MODE32", _IOC_READ, 0x6b05, 0x04 },
+{ "linux/spi/spidev.h", "SPI_IOC_WR_BITS_PER_WORD", _IOC_WRITE, 0x6b03, 0x01 },
+{ "linux/spi/spidev.h", "SPI_IOC_WR_LSB_FIRST", _IOC_WRITE, 0x6b02, 0x01 },
+{ "linux/spi/spidev.h", "SPI_IOC_WR_MAX_SPEED_HZ", _IOC_WRITE, 0x6b04, 0x04 },
+{ "linux/spi/spidev.h", "SPI_IOC_WR_MODE", _IOC_WRITE, 0x6b01, 0x01 },
+{ "linux/spi/spidev.h", "SPI_IOC_WR_MODE32", _IOC_WRITE, 0x6b05, 0x04 },
+{ "linux/stm.h", "STP_POLICY_ID_GET", _IOC_READ, 0x2501, 0x10 },
+{ "linux/stm.h", "STP_POLICY_ID_SET", _IOC_READ|_IOC_WRITE, 0x2500, 0x10 },
+{ "linux/stm.h", "STP_SET_OPTIONS", _IOC_WRITE, 0x2502, 0x08 },
+{ "linux/suspend_ioctls.h", "SNAPSHOT_ALLOC_SWAP_PAGE", _IOC_READ, 0x3314, 0x08 },
+{ "linux/suspend_ioctls.h", "SNAPSHOT_ATOMIC_RESTORE", _IOC_NONE, 0x3304, 0x00 },
+{ "linux/suspend_ioctls.h", "SNAPSHOT_AVAIL_SWAP_SIZE", _IOC_READ, 0x3313, 0x08 },
+{ "linux/suspend_ioctls.h", "SNAPSHOT_CREATE_IMAGE", _IOC_WRITE, 0x3311, 0x04 },
+{ "linux/suspend_ioctls.h", "SNAPSHOT_FREE", _IOC_NONE, 0x3305, 0x00 },
+{ "linux/suspend_ioctls.h", "SNAPSHOT_FREEZE", _IOC_NONE, 0x3301, 0x00 },
+{ "linux/suspend_ioctls.h", "SNAPSHOT_FREE_SWAP_PAGES", _IOC_NONE, 0x3309, 0x00 },
+{ "linux/suspend_ioctls.h", "SNAPSHOT_GET_IMAGE_SIZE", _IOC_READ, 0x330e, 0x08 },
+{ "linux/suspend_ioctls.h", "SNAPSHOT_PLATFORM_SUPPORT", _IOC_NONE, 0x330f, 0x00 },
+{ "linux/suspend_ioctls.h", "SNAPSHOT_POWER_OFF", _IOC_NONE, 0x3310, 0x00 },
+{ "linux/suspend_ioctls.h", "SNAPSHOT_PREF_IMAGE_SIZE", _IOC_NONE, 0x3312, 0x00 },
+{ "linux/suspend_ioctls.h", "SNAPSHOT_S2RAM", _IOC_NONE, 0x330b, 0x00 },
+{ "linux/suspend_ioctls.h", "SNAPSHOT_SET_SWAP_AREA", _IOC_WRITE, 0x330d, 0x0c },
+{ "linux/suspend_ioctls.h", "SNAPSHOT_UNFREEZE", _IOC_NONE, 0x3302, 0x00 },
+{ "linux/switchtec_ioctl.h", "SWITCHTEC_IOCTL_EVENT_CTL", _IOC_READ|_IOC_WRITE, 0x5743, 0x28 },
+{ "linux/switchtec_ioctl.h", "SWITCHTEC_IOCTL_EVENT_SUMMARY", _IOC_READ, 0x5742, 0x4d8 },
+{ "linux/switchtec_ioctl.h", "SWITCHTEC_IOCTL_EVENT_SUMMARY_LEGACY", _IOC_READ, 0x5742, 0x198 },
+{ "linux/switchtec_ioctl.h", "SWITCHTEC_IOCTL_FLASH_INFO", _IOC_READ, 0x5740, 0x10 },
+{ "linux/switchtec_ioctl.h", "SWITCHTEC_IOCTL_FLASH_PART_INFO", _IOC_READ|_IOC_WRITE, 0x5741, 0x10 },
+{ "linux/switchtec_ioctl.h", "SWITCHTEC_IOCTL_PFF_TO_PORT", _IOC_READ|_IOC_WRITE, 0x5744, 0x0c },
+{ "linux/switchtec_ioctl.h", "SWITCHTEC_IOCTL_PORT_TO_PFF", _IOC_READ|_IOC_WRITE, 0x5745, 0x0c },
+{ "linux/sync_file.h", "SYNC_IOC_FILE_INFO", _IOC_READ|_IOC_WRITE, 0x3e04, 0x38 },
+{ "linux/sync_file.h", "SYNC_IOC_MERGE", _IOC_READ|_IOC_WRITE, 0x3e03, 0x30 },
+{ "linux/synclink.h", "MGSL_IOCCLRMODCOUNT", _IOC_NONE, 0x6d0f, 0x00 },
+{ "linux/synclink.h", "MGSL_IOCGGPIO", _IOC_READ, 0x6d11, 0x10 },
+{ "linux/synclink.h", "MGSL_IOCGIF", _IOC_NONE, 0x6d0b, 0x00 },
+{ "linux/synclink.h", "MGSL_IOCGPARAMS", _IOC_READ, 0x6d01, 0x20 },
+{ "linux/synclink.h", "MGSL_IOCGSTATS", _IOC_NONE, 0x6d07, 0x00 },
+{ "linux/synclink.h", "MGSL_IOCGTXIDLE", _IOC_NONE, 0x6d03, 0x00 },
+{ "linux/synclink.h", "MGSL_IOCGXCTRL", _IOC_NONE, 0x6d16, 0x00 },
+{ "linux/synclink.h", "MGSL_IOCGXSYNC", _IOC_NONE, 0x6d14, 0x00 },
+{ "linux/synclink.h", "MGSL_IOCLOOPTXDONE", _IOC_NONE, 0x6d09, 0x00 },
+{ "linux/synclink.h", "MGSL_IOCRXENABLE", _IOC_NONE, 0x6d05, 0x00 },
+{ "linux/synclink.h", "MGSL_IOCSGPIO", _IOC_WRITE, 0x6d10, 0x10 },
+{ "linux/synclink.h", "MGSL_IOCSIF", _IOC_NONE, 0x6d0a, 0x00 },
+{ "linux/synclink.h", "MGSL_IOCSPARAMS", _IOC_WRITE, 0x6d00, 0x20 },
+{ "linux/synclink.h", "MGSL_IOCSTXIDLE", _IOC_NONE, 0x6d02, 0x00 },
+{ "linux/synclink.h", "MGSL_IOCSXCTRL", _IOC_NONE, 0x6d15, 0x00 },
+{ "linux/synclink.h", "MGSL_IOCSXSYNC", _IOC_NONE, 0x6d13, 0x00 },
+{ "linux/synclink.h", "MGSL_IOCTXABORT", _IOC_NONE, 0x6d06, 0x00 },
+{ "linux/synclink.h", "MGSL_IOCTXENABLE", _IOC_NONE, 0x6d04, 0x00 },
+{ "linux/synclink.h", "MGSL_IOCWAITEVENT", _IOC_READ|_IOC_WRITE, 0x6d08, 0x04 },
+{ "linux/synclink.h", "MGSL_IOCWAITGPIO", _IOC_READ|_IOC_WRITE, 0x6d12, 0x10 },
+{ "linux/tee.h", "TEE_IOC_CANCEL", _IOC_READ, 0xa404, 0x08 },
+{ "linux/tee.h", "TEE_IOC_CLOSE_SESSION", _IOC_READ, 0xa405, 0x04 },
+{ "linux/tee.h", "TEE_IOC_INVOKE", _IOC_READ, 0xa403, 0x10 },
+{ "linux/tee.h", "TEE_IOC_OPEN_SESSION", _IOC_READ, 0xa402, 0x10 },
+{ "linux/tee.h", "TEE_IOC_SHM_ALLOC", _IOC_READ|_IOC_WRITE, 0xa401, 0x10 },
+{ "linux/tee.h", "TEE_IOC_SHM_REGISTER", _IOC_READ|_IOC_WRITE, 0xa409, 0x18 },
+{ "linux/tee.h", "TEE_IOC_SUPPL_RECV", _IOC_READ, 0xa406, 0x10 },
+{ "linux/tee.h", "TEE_IOC_SUPPL_SEND", _IOC_READ, 0xa407, 0x10 },
+{ "linux/tee.h", "TEE_IOC_VERSION", _IOC_READ, 0xa400, 0x0c },
+{ "linux/timerfd.h", "TFD_IOC_SET_TICKS", _IOC_WRITE, 0x5400, 0x08 },
+{ "linux/toshiba.h", "TOSHIBA_ACPI_SCI", _IOC_READ|_IOC_WRITE, 0x7491, 0x18 },
+{ "linux/toshiba.h", "TOSH_SMM", _IOC_READ|_IOC_WRITE, 0x7490, 0x18 },
+{ "linux/udf_fs_i.h", "UDF_GETEABLOCK", _IOC_READ, 0x6c41, 0x04 },
+{ "linux/udf_fs_i.h", "UDF_GETEASIZE", _IOC_READ, 0x6c40, 0x04 },
+{ "linux/udf_fs_i.h", "UDF_GETVOLIDENT", _IOC_READ, 0x6c42, 0x04 },
+{ "linux/udf_fs_i.h", "UDF_RELOCATE_BLOCKS", _IOC_READ|_IOC_WRITE, 0x6c43, 0x04 },
+{ "linux/udmabuf.h", "UDMABUF_CREATE", _IOC_WRITE, 0x7542, 0x18 },
+{ "linux/udmabuf.h", "UDMABUF_CREATE_LIST", _IOC_WRITE, 0x7543, 0x08 },
+{ "linux/uinput.h", "UI_ABS_SETUP", _IOC_WRITE, 0x5504, 0x1c },
+{ "linux/uinput.h", "UI_BEGIN_FF_ERASE", _IOC_READ|_IOC_WRITE, 0x55ca, 0x0c },
+{ "linux/uinput.h", "UI_BEGIN_FF_UPLOAD", _IOC_READ|_IOC_WRITE, 0x55c8, 0x60 },
+{ "linux/uinput.h", "UI_DEV_CREATE", _IOC_NONE, 0x5501, 0x00 },
+{ "linux/uinput.h", "UI_DEV_DESTROY", _IOC_NONE, 0x5502, 0x00 },
+{ "linux/uinput.h", "UI_DEV_SETUP", _IOC_WRITE, 0x5503, 0x5c },
+{ "linux/uinput.h", "UI_END_FF_ERASE", _IOC_WRITE, 0x55cb, 0x0c },
+{ "linux/uinput.h", "UI_END_FF_UPLOAD", _IOC_WRITE, 0x55c9, 0x60 },
+{ "linux/uinput.h", "UI_GET_VERSION", _IOC_READ, 0x552d, 0x04 },
+{ "linux/uinput.h", "UI_SET_ABSBIT", _IOC_WRITE, 0x5567, 0x04 },
+{ "linux/uinput.h", "UI_SET_EVBIT", _IOC_WRITE, 0x5564, 0x04 },
+{ "linux/uinput.h", "UI_SET_FFBIT", _IOC_WRITE, 0x556b, 0x04 },
+{ "linux/uinput.h", "UI_SET_KEYBIT", _IOC_WRITE, 0x5565, 0x04 },
+{ "linux/uinput.h", "UI_SET_LEDBIT", _IOC_WRITE, 0x5569, 0x04 },
+{ "linux/uinput.h", "UI_SET_MSCBIT", _IOC_WRITE, 0x5568, 0x04 },
+{ "linux/uinput.h", "UI_SET_PHYS", _IOC_WRITE, 0x556c, 0x04 },
+{ "linux/uinput.h", "UI_SET_PROPBIT", _IOC_WRITE, 0x556e, 0x04 },
+{ "linux/uinput.h", "UI_SET_RELBIT", _IOC_WRITE, 0x5566, 0x04 },
+{ "linux/uinput.h", "UI_SET_SNDBIT", _IOC_WRITE, 0x556a, 0x04 },
+{ "linux/uinput.h", "UI_SET_SWBIT", _IOC_WRITE, 0x556d, 0x04 },
+{ "linux/usb/cdc-wdm.h", "IOCTL_WDM_MAX_COMMAND", _IOC_READ, 0x48a0, 0x02 },
+{ "linux/usb/functionfs.h", "FUNCTIONFS_CLEAR_HALT", _IOC_NONE, 0x6703, 0x00 },
+{ "linux/usb/functionfs.h", "FUNCTIONFS_ENDPOINT_DESC", _IOC_READ, 0x6782, 0x09 },
+{ "linux/usb/functionfs.h", "FUNCTIONFS_ENDPOINT_REVMAP", _IOC_NONE, 0x6781, 0x00 },
+{ "linux/usb/functionfs.h", "FUNCTIONFS_FIFO_FLUSH", _IOC_NONE, 0x6702, 0x00 },
+{ "linux/usb/functionfs.h", "FUNCTIONFS_FIFO_STATUS", _IOC_NONE, 0x6701, 0x00 },
+{ "linux/usb/functionfs.h", "FUNCTIONFS_INTERFACE_REVMAP", _IOC_NONE, 0x6780, 0x00 },
+{ "linux/usb/g_printer.h", "GADGET_GET_PRINTER_STATUS", _IOC_READ, 0x6721, 0x01 },
+{ "linux/usb/g_printer.h", "GADGET_SET_PRINTER_STATUS", _IOC_READ|_IOC_WRITE, 0x6722, 0x01 },
+{ "linux/usb/g_uvc.h", "UVCIOC_SEND_RESPONSE", _IOC_WRITE, 0x5501, 0x40 },
+{ "linux/usb/gadgetfs.h", "GADGETFS_CLEAR_HALT", _IOC_NONE, 0x6703, 0x00 },
+{ "linux/usb/gadgetfs.h", "GADGETFS_FIFO_FLUSH", _IOC_NONE, 0x6702, 0x00 },
+{ "linux/usb/gadgetfs.h", "GADGETFS_FIFO_STATUS", _IOC_NONE, 0x6701, 0x00 },
+{ "linux/usb/iowarrior.h", "IOW_GETINFO", _IOC_READ, 0xc003, 0x28 },
+{ "linux/usb/iowarrior.h", "IOW_READ", _IOC_WRITE, 0xc002, 0x04 },
+{ "linux/usb/iowarrior.h", "IOW_WRITE", _IOC_WRITE, 0xc001, 0x04 },
+{ "linux/usb/raw_gadget.h", "USB_RAW_IOCTL_CONFIGURE", _IOC_NONE, 0x5509, 0x00 },
+{ "linux/usb/raw_gadget.h", "USB_RAW_IOCTL_EP0_READ", _IOC_READ|_IOC_WRITE, 0x5504, 0x08 },
+{ "linux/usb/raw_gadget.h", "USB_RAW_IOCTL_EP0_STALL", _IOC_NONE, 0x550c, 0x00 },
+{ "linux/usb/raw_gadget.h", "USB_RAW_IOCTL_EP0_WRITE", _IOC_WRITE, 0x5503, 0x08 },
+{ "linux/usb/raw_gadget.h", "USB_RAW_IOCTL_EPS_INFO", _IOC_READ, 0x550b, 0x3c0 },
+{ "linux/usb/raw_gadget.h", "USB_RAW_IOCTL_EP_CLEAR_HALT", _IOC_WRITE, 0x550e, 0x04 },
+{ "linux/usb/raw_gadget.h", "USB_RAW_IOCTL_EP_DISABLE", _IOC_WRITE, 0x5506, 0x04 },
+{ "linux/usb/raw_gadget.h", "USB_RAW_IOCTL_EP_ENABLE", _IOC_WRITE, 0x5505, 0x09 },
+{ "linux/usb/raw_gadget.h", "USB_RAW_IOCTL_EP_READ", _IOC_READ|_IOC_WRITE, 0x5508, 0x08 },
+{ "linux/usb/raw_gadget.h", "USB_RAW_IOCTL_EP_SET_HALT", _IOC_WRITE, 0x550d, 0x04 },
+{ "linux/usb/raw_gadget.h", "USB_RAW_IOCTL_EP_SET_WEDGE", _IOC_WRITE, 0x550f, 0x04 },
+{ "linux/usb/raw_gadget.h", "USB_RAW_IOCTL_EP_WRITE", _IOC_WRITE, 0x5507, 0x08 },
+{ "linux/usb/raw_gadget.h", "USB_RAW_IOCTL_EVENT_FETCH", _IOC_READ, 0x5502, 0x08 },
+{ "linux/usb/raw_gadget.h", "USB_RAW_IOCTL_INIT", _IOC_WRITE, 0x5500, 0x101 },
+{ "linux/usb/raw_gadget.h", "USB_RAW_IOCTL_RUN", _IOC_NONE, 0x5501, 0x00 },
+{ "linux/usb/raw_gadget.h", "USB_RAW_IOCTL_VBUS_DRAW", _IOC_WRITE, 0x550a, 0x04 },
+{ "linux/usb/tmc.h", "USBTMC488_IOCTL_GET_CAPS", _IOC_READ, 0x5b11, 0x01 },
+{ "linux/usb/tmc.h", "USBTMC488_IOCTL_GOTO_LOCAL", _IOC_NONE, 0x5b14, 0x00 },
+{ "linux/usb/tmc.h", "USBTMC488_IOCTL_LOCAL_LOCKOUT", _IOC_NONE, 0x5b15, 0x00 },
+{ "linux/usb/tmc.h", "USBTMC488_IOCTL_READ_STB", _IOC_READ, 0x5b12, 0x01 },
+{ "linux/usb/tmc.h", "USBTMC488_IOCTL_REN_CONTROL", _IOC_WRITE, 0x5b13, 0x01 },
+{ "linux/usb/tmc.h", "USBTMC488_IOCTL_TRIGGER", _IOC_NONE, 0x5b16, 0x00 },
+{ "linux/usb/tmc.h", "USBTMC488_IOCTL_WAIT_SRQ", _IOC_WRITE, 0x5b17, 0x04 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_ABORT_BULK_IN", _IOC_NONE, 0x5b04, 0x00 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_ABORT_BULK_OUT", _IOC_NONE, 0x5b03, 0x00 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_API_VERSION", _IOC_READ, 0x5b10, 0x04 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_AUTO_ABORT", _IOC_WRITE, 0x5b19, 0x01 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_CANCEL_IO", _IOC_NONE, 0x5b23, 0x00 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_CLEANUP_IO", _IOC_NONE, 0x5b24, 0x00 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_CLEAR", _IOC_NONE, 0x5b02, 0x00 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_CLEAR_IN_HALT", _IOC_NONE, 0x5b07, 0x00 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_CLEAR_OUT_HALT", _IOC_NONE, 0x5b06, 0x00 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_CONFIG_TERMCHAR", _IOC_WRITE, 0x5b0c, 0x02 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_CTRL_REQUEST", _IOC_READ|_IOC_WRITE, 0x5b08, 0x0c },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_EOM_ENABLE", _IOC_WRITE, 0x5b0b, 0x01 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_GET_TIMEOUT", _IOC_READ, 0x5b09, 0x04 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_INDICATOR_PULSE", _IOC_NONE, 0x5b01, 0x00 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_MSG_IN_ATTR", _IOC_READ, 0x5b18, 0x01 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_READ", _IOC_READ|_IOC_WRITE, 0x5b0e, 0x10 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_SET_TIMEOUT", _IOC_WRITE, 0x5b0a, 0x04 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_WRITE", _IOC_READ|_IOC_WRITE, 0x5b0d, 0x10 },
+{ "linux/usb/tmc.h", "USBTMC_IOCTL_WRITE_RESULT", _IOC_READ|_IOC_WRITE, 0x5b0f, 0x04 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_ALLOC_STREAMS", _IOC_READ, 0x551c, 0x08 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_ALLOW_SUSPEND", _IOC_NONE, 0x5522, 0x00 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_BULK32", _IOC_READ|_IOC_WRITE, 0x5502, 0x10 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_CLAIMINTERFACE", _IOC_READ, 0x550f, 0x04 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_CLAIM_PORT", _IOC_READ, 0x5518, 0x04 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_CLEAR_HALT", _IOC_READ, 0x5515, 0x04 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_CONNECT", _IOC_NONE, 0x5517, 0x00 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_CONNECTINFO", _IOC_WRITE, 0x5511, 0x08 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_CONTROL32", _IOC_READ|_IOC_WRITE, 0x5500, 0x10 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_DISCARDURB", _IOC_NONE, 0x550b, 0x00 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_DISCONNECT", _IOC_NONE, 0x5516, 0x00 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_DISCONNECT_CLAIM", _IOC_READ, 0x551b, 0x108 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_DISCSIGNAL32", _IOC_READ, 0x550e, 0x08 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_DROP_PRIVILEGES", _IOC_WRITE, 0x551e, 0x04 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_FORBID_SUSPEND", _IOC_NONE, 0x5521, 0x00 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_FREE_STREAMS", _IOC_READ, 0x551d, 0x08 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_GETDRIVER", _IOC_WRITE, 0x5508, 0x104 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_GET_CAPABILITIES", _IOC_READ, 0x551a, 0x04 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_GET_SPEED", _IOC_NONE, 0x551f, 0x00 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_HUB_PORTINFO", _IOC_READ, 0x5513, 0x80 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_IOCTL32", _IOC_READ|_IOC_WRITE, 0x5512, 0x0c },
+{ "linux/usbdevice_fs.h", "USBDEVFS_REAPURB32", _IOC_WRITE, 0x550c, 0x04 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_REAPURBNDELAY32", _IOC_WRITE, 0x550d, 0x04 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_RELEASEINTERFACE", _IOC_READ, 0x5510, 0x04 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_RELEASE_PORT", _IOC_READ, 0x5519, 0x04 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_RESET", _IOC_NONE, 0x5514, 0x00 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_RESETEP", _IOC_READ, 0x5503, 0x04 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_SETCONFIGURATION", _IOC_READ, 0x5505, 0x04 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_SETINTERFACE", _IOC_READ, 0x5504, 0x08 },
+{ "linux/usbdevice_fs.h", "USBDEVFS_SUBMITURB", _IOC_READ, 0x550a, 0x2c },
+{ "linux/usbdevice_fs.h", "USBDEVFS_SUBMITURB32", _IOC_READ, 0x550a, 0x2a },
+{ "linux/usbdevice_fs.h", "USBDEVFS_WAIT_FOR_RESUME", _IOC_NONE, 0x5523, 0x00 },
+{ "linux/userfaultfd.h", "UFFDIO_API", _IOC_READ|_IOC_WRITE, 0xaa3f, 0x18 },
+{ "linux/userfaultfd.h", "UFFDIO_COPY", _IOC_READ|_IOC_WRITE, 0xaa03, 0x28 },
+{ "linux/userfaultfd.h", "UFFDIO_REGISTER", _IOC_READ|_IOC_WRITE, 0xaa00, 0x20 },
+{ "linux/userfaultfd.h", "UFFDIO_UNREGISTER", _IOC_READ, 0xaa01, 0x10 },
+{ "linux/userfaultfd.h", "UFFDIO_WAKE", _IOC_READ, 0xaa02, 0x10 },
+{ "linux/userfaultfd.h", "UFFDIO_WRITEPROTECT", _IOC_READ|_IOC_WRITE, 0xaa06, 0x18 },
+{ "linux/userfaultfd.h", "UFFDIO_ZEROPAGE", _IOC_READ|_IOC_WRITE, 0xaa04, 0x20 },
+{ "linux/uvcvideo.h", "UVCIOC_CTRL_MAP", _IOC_READ|_IOC_WRITE, 0x7520, 0x58 },
+{ "linux/uvcvideo.h", "UVCIOC_CTRL_QUERY", _IOC_READ|_IOC_WRITE, 0x7521, 0x0c },
+{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL", _IOC_READ|_IOC_WRITE, 0x564b, 0x40 },
+{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_ENUM_FRAME_SIZE", _IOC_READ|_IOC_WRITE, 0x564a, 0x40 },
+{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_ENUM_MBUS_CODE", _IOC_READ|_IOC_WRITE, 0x5602, 0x30 },
+{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_CROP", _IOC_READ|_IOC_WRITE, 0x563b, 0x38 },
+{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_FMT", _IOC_READ|_IOC_WRITE, 0x5604, 0x58 },
+{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_FRAME_INTERVAL", _IOC_READ|_IOC_WRITE, 0x5615, 0x30 },
+{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_SELECTION", _IOC_READ|_IOC_WRITE, 0x563d, 0x40 },
+{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_QUERYCAP", _IOC_READ, 0x5600, 0x40 },
+{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_CROP", _IOC_READ|_IOC_WRITE, 0x563c, 0x38 },
+{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_FMT", _IOC_READ|_IOC_WRITE, 0x5605, 0x58 },
+{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_FRAME_INTERVAL", _IOC_READ|_IOC_WRITE, 0x5616, 0x30 },
+{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_SELECTION", _IOC_READ|_IOC_WRITE, 0x563e, 0x40 },
+{ "linux/vboxguest.h", "VBG_IOCTL_ACQUIRE_GUEST_CAPABILITIES", _IOC_READ|_IOC_WRITE, 0x560d, 0x24 },
+{ "linux/vboxguest.h", "VBG_IOCTL_CHANGE_FILTER_MASK", _IOC_READ|_IOC_WRITE, 0x560c, 0x20 },
+{ "linux/vboxguest.h", "VBG_IOCTL_CHANGE_GUEST_CAPABILITIES", _IOC_READ|_IOC_WRITE, 0x560e, 0x20 },
+{ "linux/vboxguest.h", "VBG_IOCTL_CHECK_BALLOON", _IOC_READ|_IOC_WRITE, 0x5611, 0x20 },
+{ "linux/vboxguest.h", "VBG_IOCTL_DRIVER_VERSION_INFO", _IOC_READ|_IOC_WRITE, 0x5600, 0x2c },
+{ "linux/vboxguest.h", "VBG_IOCTL_HGCM_CONNECT", _IOC_READ|_IOC_WRITE, 0x5604, 0x9c },
+{ "linux/vboxguest.h", "VBG_IOCTL_HGCM_DISCONNECT", _IOC_READ|_IOC_WRITE, 0x5605, 0x1c },
+{ "linux/vboxguest.h", "VBG_IOCTL_INTERRUPT_ALL_WAIT_FOR_EVENTS", _IOC_READ|_IOC_WRITE, 0x560b, 0x18 },
+{ "linux/vboxguest.h", "VBG_IOCTL_VMMDEV_REQUEST_BIG", _IOC_NONE, 0x5603, 0x00 },
+{ "linux/vboxguest.h", "VBG_IOCTL_WAIT_FOR_EVENTS", _IOC_READ|_IOC_WRITE, 0x560a, 0x20 },
+{ "linux/vboxguest.h", "VBG_IOCTL_WRITE_CORE_DUMP", _IOC_READ|_IOC_WRITE, 0x5613, 0x1c },
+{ "linux/vfio.h", "VFIO_CHECK_EXTENSION", _IOC_NONE, 0x3b65, 0x00 },
+{ "linux/vfio.h", "VFIO_DEVICE_FEATURE", _IOC_NONE, 0x3b75, 0x00 },
+{ "linux/vfio.h", "VFIO_DEVICE_GET_GFX_DMABUF", _IOC_NONE, 0x3b73, 0x00 },
+{ "linux/vfio.h", "VFIO_DEVICE_GET_INFO", _IOC_NONE, 0x3b6b, 0x00 },
+{ "linux/vfio.h", "VFIO_DEVICE_GET_IRQ_INFO", _IOC_NONE, 0x3b6d, 0x00 },
+{ "linux/vfio.h", "VFIO_DEVICE_GET_PCI_HOT_RESET_INFO", _IOC_NONE, 0x3b70, 0x00 },
+{ "linux/vfio.h", "VFIO_DEVICE_GET_REGION_INFO", _IOC_NONE, 0x3b6c, 0x00 },
+{ "linux/vfio.h", "VFIO_DEVICE_IOEVENTFD", _IOC_NONE, 0x3b74, 0x00 },
+{ "linux/vfio.h", "VFIO_DEVICE_PCI_HOT_RESET", _IOC_NONE, 0x3b71, 0x00 },
+{ "linux/vfio.h", "VFIO_DEVICE_QUERY_GFX_PLANE", _IOC_NONE, 0x3b72, 0x00 },
+{ "linux/vfio.h", "VFIO_DEVICE_RESET", _IOC_NONE, 0x3b6f, 0x00 },
+{ "linux/vfio.h", "VFIO_DEVICE_SET_IRQS", _IOC_NONE, 0x3b6e, 0x00 },
+{ "linux/vfio.h", "VFIO_EEH_PE_OP", _IOC_NONE, 0x3b79, 0x00 },
+{ "linux/vfio.h", "VFIO_GET_API_VERSION", _IOC_NONE, 0x3b64, 0x00 },
+{ "linux/vfio.h", "VFIO_GROUP_GET_DEVICE_FD", _IOC_NONE, 0x3b6a, 0x00 },
+{ "linux/vfio.h", "VFIO_GROUP_GET_STATUS", _IOC_NONE, 0x3b67, 0x00 },
+{ "linux/vfio.h", "VFIO_GROUP_SET_CONTAINER", _IOC_NONE, 0x3b68, 0x00 },
+{ "linux/vfio.h", "VFIO_GROUP_UNSET_CONTAINER", _IOC_NONE, 0x3b69, 0x00 },
+{ "linux/vfio.h", "VFIO_IOMMU_DIRTY_PAGES", _IOC_NONE, 0x3b75, 0x00 },
+{ "linux/vfio.h", "VFIO_IOMMU_DISABLE", _IOC_NONE, 0x3b74, 0x00 },
+{ "linux/vfio.h", "VFIO_IOMMU_ENABLE", _IOC_NONE, 0x3b73, 0x00 },
+{ "linux/vfio.h", "VFIO_IOMMU_GET_INFO", _IOC_NONE, 0x3b70, 0x00 },
+{ "linux/vfio.h", "VFIO_IOMMU_MAP_DMA", _IOC_NONE, 0x3b71, 0x00 },
+{ "linux/vfio.h", "VFIO_IOMMU_SPAPR_REGISTER_MEMORY", _IOC_NONE, 0x3b75, 0x00 },
+{ "linux/vfio.h", "VFIO_IOMMU_SPAPR_TCE_CREATE", _IOC_NONE, 0x3b77, 0x00 },
+{ "linux/vfio.h", "VFIO_IOMMU_SPAPR_TCE_GET_INFO", _IOC_NONE, 0x3b70, 0x00 },
+{ "linux/vfio.h", "VFIO_IOMMU_SPAPR_TCE_REMOVE", _IOC_NONE, 0x3b78, 0x00 },
+{ "linux/vfio.h", "VFIO_IOMMU_SPAPR_UNREGISTER_MEMORY", _IOC_NONE, 0x3b76, 0x00 },
+{ "linux/vfio.h", "VFIO_IOMMU_UNMAP_DMA", _IOC_NONE, 0x3b72, 0x00 },
+{ "linux/vfio.h", "VFIO_SET_IOMMU", _IOC_NONE, 0x3b66, 0x00 },
+{ "linux/vhost.h", "VHOST_GET_BACKEND_FEATURES", _IOC_READ, 0xaf26, 0x08 },
+{ "linux/vhost.h", "VHOST_GET_FEATURES", _IOC_READ, 0xaf00, 0x08 },
+{ "linux/vhost.h", "VHOST_GET_VRING_BASE", _IOC_READ|_IOC_WRITE, 0xaf12, 0x08 },
+{ "linux/vhost.h", "VHOST_GET_VRING_BUSYLOOP_TIMEOUT", _IOC_WRITE, 0xaf24, 0x08 },
+{ "linux/vhost.h", "VHOST_GET_VRING_ENDIAN", _IOC_WRITE, 0xaf14, 0x08 },
+{ "linux/vhost.h", "VHOST_NET_SET_BACKEND", _IOC_WRITE, 0xaf30, 0x08 },
+{ "linux/vhost.h", "VHOST_RESET_OWNER", _IOC_NONE, 0xaf02, 0x00 },
+{ "linux/vhost.h", "VHOST_SCSI_CLEAR_ENDPOINT", _IOC_WRITE, 0xaf41, 0xe8 },
+{ "linux/vhost.h", "VHOST_SCSI_GET_ABI_VERSION", _IOC_WRITE, 0xaf42, 0x04 },
+{ "linux/vhost.h", "VHOST_SCSI_GET_EVENTS_MISSED", _IOC_WRITE, 0xaf44, 0x04 },
+{ "linux/vhost.h", "VHOST_SCSI_SET_ENDPOINT", _IOC_WRITE, 0xaf40, 0xe8 },
+{ "linux/vhost.h", "VHOST_SCSI_SET_EVENTS_MISSED", _IOC_WRITE, 0xaf43, 0x04 },
+{ "linux/vhost.h", "VHOST_SET_BACKEND_FEATURES", _IOC_WRITE, 0xaf25, 0x08 },
+{ "linux/vhost.h", "VHOST_SET_FEATURES", _IOC_WRITE, 0xaf00, 0x08 },
+{ "linux/vhost.h", "VHOST_SET_LOG_BASE", _IOC_WRITE, 0xaf04, 0x08 },
+{ "linux/vhost.h", "VHOST_SET_LOG_FD", _IOC_WRITE, 0xaf07, 0x04 },
+{ "linux/vhost.h", "VHOST_SET_MEM_TABLE", _IOC_WRITE, 0xaf03, 0x08 },
+{ "linux/vhost.h", "VHOST_SET_OWNER", _IOC_NONE, 0xaf01, 0x00 },
+{ "linux/vhost.h", "VHOST_SET_VRING_ADDR", _IOC_WRITE, 0xaf11, 0x28 },
+{ "linux/vhost.h", "VHOST_SET_VRING_BASE", _IOC_WRITE, 0xaf12, 0x08 },
+{ "linux/vhost.h", "VHOST_SET_VRING_BUSYLOOP_TIMEOUT", _IOC_WRITE, 0xaf23, 0x08 },
+{ "linux/vhost.h", "VHOST_SET_VRING_CALL", _IOC_WRITE, 0xaf21, 0x08 },
+{ "linux/vhost.h", "VHOST_SET_VRING_ENDIAN", _IOC_WRITE, 0xaf13, 0x08 },
+{ "linux/vhost.h", "VHOST_SET_VRING_ERR", _IOC_WRITE, 0xaf22, 0x08 },
+{ "linux/vhost.h", "VHOST_SET_VRING_KICK", _IOC_WRITE, 0xaf20, 0x08 },
+{ "linux/vhost.h", "VHOST_SET_VRING_NUM", _IOC_WRITE, 0xaf10, 0x08 },
+{ "linux/vhost.h", "VHOST_VDPA_GET_CONFIG", _IOC_READ, 0xaf73, 0x08 },
+{ "linux/vhost.h", "VHOST_VDPA_GET_DEVICE_ID", _IOC_READ, 0xaf70, 0x04 },
+{ "linux/vhost.h", "VHOST_VDPA_GET_IOVA_RANGE", _IOC_READ, 0xaf78, 0x10 },
+{ "linux/vhost.h", "VHOST_VDPA_GET_STATUS", _IOC_READ, 0xaf71, 0x01 },
+{ "linux/vhost.h", "VHOST_VDPA_GET_VRING_NUM", _IOC_READ, 0xaf76, 0x02 },
+{ "linux/vhost.h", "VHOST_VDPA_SET_CONFIG", _IOC_WRITE, 0xaf74, 0x08 },
+{ "linux/vhost.h", "VHOST_VDPA_SET_CONFIG_CALL", _IOC_WRITE, 0xaf77, 0x04 },
+{ "linux/vhost.h", "VHOST_VDPA_SET_STATUS", _IOC_WRITE, 0xaf72, 0x01 },
+{ "linux/vhost.h", "VHOST_VDPA_SET_VRING_ENABLE", _IOC_WRITE, 0xaf75, 0x08 },
+{ "linux/vhost.h", "VHOST_VSOCK_SET_GUEST_CID", _IOC_WRITE, 0xaf60, 0x08 },
+{ "linux/vhost.h", "VHOST_VSOCK_SET_RUNNING", _IOC_WRITE, 0xaf61, 0x04 },
+{ "linux/videodev2.h", "VIDIOC_CREATE_BUFS", _IOC_READ|_IOC_WRITE, 0x565c, 0xf8 },
+{ "linux/videodev2.h", "VIDIOC_CROPCAP", _IOC_READ|_IOC_WRITE, 0x563a, 0x2c },
+{ "linux/videodev2.h", "VIDIOC_DBG_G_CHIP_INFO", _IOC_READ|_IOC_WRITE, 0x5666, 0xc8 },
+{ "linux/videodev2.h", "VIDIOC_DBG_G_REGISTER", _IOC_READ|_IOC_WRITE, 0x5650, 0x38 },
+{ "linux/videodev2.h", "VIDIOC_DBG_S_REGISTER", _IOC_WRITE, 0x564f, 0x38 },
+{ "linux/videodev2.h", "VIDIOC_DECODER_CMD", _IOC_READ|_IOC_WRITE, 0x5660, 0x48 },
+{ "linux/videodev2.h", "VIDIOC_DQBUF", _IOC_READ|_IOC_WRITE, 0x5611, 0x50 },
+{ "linux/videodev2.h", "VIDIOC_DQEVENT", _IOC_READ, 0x5659, 0x88 },
+{ "linux/videodev2.h", "VIDIOC_DV_TIMINGS_CAP", _IOC_READ|_IOC_WRITE, 0x5664, 0x90 },
+{ "linux/videodev2.h", "VIDIOC_ENCODER_CMD", _IOC_READ|_IOC_WRITE, 0x564d, 0x28 },
+{ "linux/videodev2.h", "VIDIOC_ENUMAUDIO", _IOC_READ|_IOC_WRITE, 0x5641, 0x34 },
+{ "linux/videodev2.h", "VIDIOC_ENUMAUDOUT", _IOC_READ|_IOC_WRITE, 0x5642, 0x34 },
+{ "linux/videodev2.h", "VIDIOC_ENUMINPUT", _IOC_READ|_IOC_WRITE, 0x561a, 0x50 },
+{ "linux/videodev2.h", "VIDIOC_ENUMOUTPUT", _IOC_READ|_IOC_WRITE, 0x5630, 0x48 },
+{ "linux/videodev2.h", "VIDIOC_ENUMSTD", _IOC_READ|_IOC_WRITE, 0x5619, 0x48 },
+{ "linux/videodev2.h", "VIDIOC_ENUM_DV_TIMINGS", _IOC_READ|_IOC_WRITE, 0x5662, 0x94 },
+{ "linux/videodev2.h", "VIDIOC_ENUM_FMT", _IOC_READ|_IOC_WRITE, 0x5602, 0x40 },
+{ "linux/videodev2.h", "VIDIOC_ENUM_FRAMEINTERVALS", _IOC_READ|_IOC_WRITE, 0x564b, 0x34 },
+{ "linux/videodev2.h", "VIDIOC_ENUM_FRAMESIZES", _IOC_READ|_IOC_WRITE, 0x564a, 0x2c },
+{ "linux/videodev2.h", "VIDIOC_ENUM_FREQ_BANDS", _IOC_READ|_IOC_WRITE, 0x5665, 0x40 },
+{ "linux/videodev2.h", "VIDIOC_EXPBUF", _IOC_READ|_IOC_WRITE, 0x5610, 0x40 },
+{ "linux/videodev2.h", "VIDIOC_G_AUDIO", _IOC_READ, 0x5621, 0x34 },
+{ "linux/videodev2.h", "VIDIOC_G_AUDOUT", _IOC_READ, 0x5631, 0x34 },
+{ "linux/videodev2.h", "VIDIOC_G_CROP", _IOC_READ|_IOC_WRITE, 0x563b, 0x14 },
+{ "linux/videodev2.h", "VIDIOC_G_CTRL", _IOC_READ|_IOC_WRITE, 0x561b, 0x08 },
+{ "linux/videodev2.h", "VIDIOC_G_DV_TIMINGS", _IOC_READ|_IOC_WRITE, 0x5658, 0x84 },
+{ "linux/videodev2.h", "VIDIOC_G_EDID", _IOC_READ|_IOC_WRITE, 0x5628, 0x24 },
+{ "linux/videodev2.h", "VIDIOC_G_ENC_INDEX", _IOC_READ, 0x564c, 0x818 },
+{ "linux/videodev2.h", "VIDIOC_G_EXT_CTRLS", _IOC_READ|_IOC_WRITE, 0x5647, 0x18 },
+{ "linux/videodev2.h", "VIDIOC_G_FBUF", _IOC_READ, 0x560a, 0x2c },
+{ "linux/videodev2.h", "VIDIOC_G_FMT", _IOC_READ|_IOC_WRITE, 0x5604, 0xcc },
+{ "linux/videodev2.h", "VIDIOC_G_FREQUENCY", _IOC_READ|_IOC_WRITE, 0x5638, 0x2c },
+{ "linux/videodev2.h", "VIDIOC_G_INPUT", _IOC_READ, 0x5626, 0x04 },
+{ "linux/videodev2.h", "VIDIOC_G_JPEGCOMP", _IOC_READ, 0x563d, 0x8c },
+{ "linux/videodev2.h", "VIDIOC_G_MODULATOR", _IOC_READ|_IOC_WRITE, 0x5636, 0x44 },
+{ "linux/videodev2.h", "VIDIOC_G_OUTPUT", _IOC_READ, 0x562e, 0x04 },
+{ "linux/videodev2.h", "VIDIOC_G_PARM", _IOC_READ|_IOC_WRITE, 0x5615, 0xcc },
+{ "linux/videodev2.h", "VIDIOC_G_PRIORITY", _IOC_READ, 0x5643, 0x04 },
+{ "linux/videodev2.h", "VIDIOC_G_SELECTION", _IOC_READ|_IOC_WRITE, 0x565e, 0x40 },
+{ "linux/videodev2.h", "VIDIOC_G_SLICED_VBI_CAP", _IOC_READ|_IOC_WRITE, 0x5645, 0x74 },
+{ "linux/videodev2.h", "VIDIOC_G_STD", _IOC_READ, 0x5617, 0x08 },
+{ "linux/videodev2.h", "VIDIOC_G_TUNER", _IOC_READ|_IOC_WRITE, 0x561d, 0x54 },
+{ "linux/videodev2.h", "VIDIOC_LOG_STATUS", _IOC_NONE, 0x5646, 0x00 },
+{ "linux/videodev2.h", "VIDIOC_OVERLAY", _IOC_WRITE, 0x560e, 0x04 },
+{ "linux/videodev2.h", "VIDIOC_PREPARE_BUF", _IOC_READ|_IOC_WRITE, 0x565d, 0x50 },
+{ "linux/videodev2.h", "VIDIOC_QBUF", _IOC_READ|_IOC_WRITE, 0x560f, 0x50 },
+{ "linux/videodev2.h", "VIDIOC_QUERYBUF", _IOC_READ|_IOC_WRITE, 0x5609, 0x50 },
+{ "linux/videodev2.h", "VIDIOC_QUERYCAP", _IOC_READ, 0x5600, 0x68 },
+{ "linux/videodev2.h", "VIDIOC_QUERYCTRL", _IOC_READ|_IOC_WRITE, 0x5624, 0x44 },
+{ "linux/videodev2.h", "VIDIOC_QUERYMENU", _IOC_READ|_IOC_WRITE, 0x5625, 0x2c },
+{ "linux/videodev2.h", "VIDIOC_QUERYSTD", _IOC_READ, 0x563f, 0x08 },
+{ "linux/videodev2.h", "VIDIOC_QUERY_DV_TIMINGS", _IOC_READ, 0x5663, 0x84 },
+{ "linux/videodev2.h", "VIDIOC_QUERY_EXT_CTRL", _IOC_READ|_IOC_WRITE, 0x5667, 0xe8 },
+{ "linux/videodev2.h", "VIDIOC_REQBUFS", _IOC_READ|_IOC_WRITE, 0x5608, 0x14 },
+{ "linux/videodev2.h", "VIDIOC_STREAMOFF", _IOC_WRITE, 0x5613, 0x04 },
+{ "linux/videodev2.h", "VIDIOC_STREAMON", _IOC_WRITE, 0x5612, 0x04 },
+{ "linux/videodev2.h", "VIDIOC_SUBSCRIBE_EVENT", _IOC_WRITE, 0x565a, 0x20 },
+{ "linux/videodev2.h", "VIDIOC_S_AUDIO", _IOC_WRITE, 0x5622, 0x34 },
+{ "linux/videodev2.h", "VIDIOC_S_AUDOUT", _IOC_WRITE, 0x5632, 0x34 },
+{ "linux/videodev2.h", "VIDIOC_S_CROP", _IOC_WRITE, 0x563c, 0x14 },
+{ "linux/videodev2.h", "VIDIOC_S_CTRL", _IOC_READ|_IOC_WRITE, 0x561c, 0x08 },
+{ "linux/videodev2.h", "VIDIOC_S_DV_TIMINGS", _IOC_READ|_IOC_WRITE, 0x5657, 0x84 },
+{ "linux/videodev2.h", "VIDIOC_S_EDID", _IOC_READ|_IOC_WRITE, 0x5629, 0x24 },
+{ "linux/videodev2.h", "VIDIOC_S_EXT_CTRLS", _IOC_READ|_IOC_WRITE, 0x5648, 0x18 },
+{ "linux/videodev2.h", "VIDIOC_S_FBUF", _IOC_WRITE, 0x560b, 0x2c },
+{ "linux/videodev2.h", "VIDIOC_S_FMT", _IOC_READ|_IOC_WRITE, 0x5605, 0xcc },
+{ "linux/videodev2.h", "VIDIOC_S_FREQUENCY", _IOC_WRITE, 0x5639, 0x2c },
+{ "linux/videodev2.h", "VIDIOC_S_HW_FREQ_SEEK", _IOC_WRITE, 0x5652, 0x30 },
+{ "linux/videodev2.h", "VIDIOC_S_INPUT", _IOC_READ|_IOC_WRITE, 0x5627, 0x04 },
+{ "linux/videodev2.h", "VIDIOC_S_JPEGCOMP", _IOC_WRITE, 0x563e, 0x8c },
+{ "linux/videodev2.h", "VIDIOC_S_MODULATOR", _IOC_WRITE, 0x5637, 0x44 },
+{ "linux/videodev2.h", "VIDIOC_S_OUTPUT", _IOC_READ|_IOC_WRITE, 0x562f, 0x04 },
+{ "linux/videodev2.h", "VIDIOC_S_PARM", _IOC_READ|_IOC_WRITE, 0x5616, 0xcc },
+{ "linux/videodev2.h", "VIDIOC_S_PRIORITY", _IOC_WRITE, 0x5644, 0x04 },
+{ "linux/videodev2.h", "VIDIOC_S_SELECTION", _IOC_READ|_IOC_WRITE, 0x565f, 0x40 },
+{ "linux/videodev2.h", "VIDIOC_S_STD", _IOC_WRITE, 0x5618, 0x08 },
+{ "linux/videodev2.h", "VIDIOC_S_TUNER", _IOC_WRITE, 0x561e, 0x54 },
+{ "linux/videodev2.h", "VIDIOC_TRY_DECODER_CMD", _IOC_READ|_IOC_WRITE, 0x5661, 0x48 },
+{ "linux/videodev2.h", "VIDIOC_TRY_ENCODER_CMD", _IOC_READ|_IOC_WRITE, 0x564e, 0x28 },
+{ "linux/videodev2.h", "VIDIOC_TRY_EXT_CTRLS", _IOC_READ|_IOC_WRITE, 0x5649, 0x18 },
+{ "linux/videodev2.h", "VIDIOC_TRY_FMT", _IOC_READ|_IOC_WRITE, 0x5640, 0xcc },
+{ "linux/videodev2.h", "VIDIOC_UNSUBSCRIBE_EVENT", _IOC_WRITE, 0x565b, 0x20 },
+{ "linux/vm_sockets.h", "IOCTL_VM_SOCKETS_GET_LOCAL_CID", _IOC_NONE, 0x07b9, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_CTX_ADD_NOTIFICATION", _IOC_NONE, 0x07af, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_CTX_GET_CPT_STATE", _IOC_NONE, 0x07b1, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_CTX_REMOVE_NOTIFICATION", _IOC_NONE, 0x07b0, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_CTX_SET_CPT_STATE", _IOC_NONE, 0x07b2, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_DATAGRAM_RECEIVE", _IOC_NONE, 0x07ac, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_DATAGRAM_SEND", _IOC_NONE, 0x07ab, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_GET_CONTEXT_ID", _IOC_NONE, 0x07b3, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_INIT_CONTEXT", _IOC_NONE, 0x07a0, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_NOTIFICATIONS_RECEIVE", _IOC_NONE, 0x07a6, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_NOTIFY_RESOURCE", _IOC_NONE, 0x07a5, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_QUEUEPAIR_ALLOC", _IOC_NONE, 0x07a8, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_QUEUEPAIR_DETACH", _IOC_NONE, 0x07aa, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_QUEUEPAIR_SETPAGEFILE", _IOC_NONE, 0x07a9, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_QUEUEPAIR_SETVA", _IOC_NONE, 0x07a4, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_SET_NOTIFY", _IOC_NONE, 0x07cb, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_SOCKETS_GET_AF_VALUE", _IOC_NONE, 0x07b8, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_SOCKETS_GET_LOCAL_CID", _IOC_NONE, 0x07b9, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_SOCKETS_VERSION", _IOC_NONE, 0x07b4, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_VERSION", _IOC_NONE, 0x079f, 0x00 },
+{ "linux/vmw_vmci_defs.h", "IOCTL_VMCI_VERSION2", _IOC_NONE, 0x07a7, 0x00 },
+{ "linux/vt.h", "VT_ACTIVATE", 0, 0x5606, 0 },
+{ "linux/vt.h", "VT_DISALLOCATE", 0, 0x5608, 0 },
+{ "linux/vt.h", "VT_GETHIFONTMASK", 0, 0x560D, 0 },
+{ "linux/vt.h", "VT_GETMODE", 0, 0x5601, 0 },
+{ "linux/vt.h", "VT_GETSTATE", 0, 0x5603, 0 },
+{ "linux/vt.h", "VT_LOCKSWITCH", 0, 0x560B, 0 },
+{ "linux/vt.h", "VT_OPENQRY", 0, 0x5600, 0 },
+{ "linux/vt.h", "VT_RELDISP", 0, 0x5605, 0 },
+{ "linux/vt.h", "VT_RESIZE", 0, 0x5609, 0 },
+{ "linux/vt.h", "VT_RESIZEX", 0, 0x560A, 0 },
+{ "linux/vt.h", "VT_SENDSIG", 0, 0x5604, 0 },
+{ "linux/vt.h", "VT_SETACTIVATE", 0, 0x560F, 0 },
+{ "linux/vt.h", "VT_SETMODE", 0, 0x5602, 0 },
+{ "linux/vt.h", "VT_UNLOCKSWITCH", 0, 0x560C, 0 },
+{ "linux/vt.h", "VT_WAITACTIVE", 0, 0x5607, 0 },
+{ "linux/vt.h", "VT_WAITEVENT", 0, 0x560E, 0 },
+{ "linux/vtpm_proxy.h", "VTPM_PROXY_IOC_NEW_DEV", _IOC_READ|_IOC_WRITE, 0xa100, 0x14 },
+{ "linux/watch_queue.h", "IOC_WATCH_QUEUE_SET_FILTER", _IOC_NONE, 0x5761, 0x00 },
+{ "linux/watch_queue.h", "IOC_WATCH_QUEUE_SET_SIZE", _IOC_NONE, 0x5760, 0x00 },
+{ "linux/watchdog.h", "WDIOC_GETBOOTSTATUS", _IOC_READ, 0x5702, 0x04 },
+{ "linux/watchdog.h", "WDIOC_GETPRETIMEOUT", _IOC_READ, 0x5709, 0x04 },
+{ "linux/watchdog.h", "WDIOC_GETSTATUS", _IOC_READ, 0x5701, 0x04 },
+{ "linux/watchdog.h", "WDIOC_GETSUPPORT", _IOC_READ, 0x5700, 0x28 },
+{ "linux/watchdog.h", "WDIOC_GETTEMP", _IOC_READ, 0x5703, 0x04 },
+{ "linux/watchdog.h", "WDIOC_GETTIMELEFT", _IOC_READ, 0x570a, 0x04 },
+{ "linux/watchdog.h", "WDIOC_GETTIMEOUT", _IOC_READ, 0x5707, 0x04 },
+{ "linux/watchdog.h", "WDIOC_KEEPALIVE", _IOC_READ, 0x5705, 0x04 },
+{ "linux/watchdog.h", "WDIOC_SETOPTIONS", _IOC_READ, 0x5704, 0x04 },
+{ "linux/watchdog.h", "WDIOC_SETPRETIMEOUT", _IOC_READ|_IOC_WRITE, 0x5708, 0x04 },
+{ "linux/watchdog.h", "WDIOC_SETTIMEOUT", _IOC_READ|_IOC_WRITE, 0x5706, 0x04 },
+{ "linux/wireless.h", "SIOCGIWAP", 0, 0x8B15, 0 },
+{ "linux/wireless.h", "SIOCGIWAPLIST", 0, 0x8B17, 0 },
+{ "linux/wireless.h", "SIOCGIWAUTH", 0, 0x8B33, 0 },
+{ "linux/wireless.h", "SIOCGIWENCODE", 0, 0x8B2B, 0 },
+{ "linux/wireless.h", "SIOCGIWENCODEEXT", 0, 0x8B35, 0 },
+{ "linux/wireless.h", "SIOCGIWESSID", 0, 0x8B1B, 0 },
+{ "linux/wireless.h", "SIOCGIWFRAG", 0, 0x8B25, 0 },
+{ "linux/wireless.h", "SIOCGIWFREQ", 0, 0x8B05, 0 },
+{ "linux/wireless.h", "SIOCGIWGENIE", 0, 0x8B31, 0 },
+{ "linux/wireless.h", "SIOCGIWMODE", 0, 0x8B07, 0 },
+{ "linux/wireless.h", "SIOCGIWNAME", 0, 0x8B01, 0 },
+{ "linux/wireless.h", "SIOCGIWNICKN", 0, 0x8B1D, 0 },
+{ "linux/wireless.h", "SIOCGIWNWID", 0, 0x8B03, 0 },
+{ "linux/wireless.h", "SIOCGIWPOWER", 0, 0x8B2D, 0 },
+{ "linux/wireless.h", "SIOCGIWPRIV", 0, 0x8B0D, 0 },
+{ "linux/wireless.h", "SIOCGIWRANGE", 0, 0x8B0B, 0 },
+{ "linux/wireless.h", "SIOCGIWRATE", 0, 0x8B21, 0 },
+{ "linux/wireless.h", "SIOCGIWRETRY", 0, 0x8B29, 0 },
+{ "linux/wireless.h", "SIOCGIWRTS", 0, 0x8B23, 0 },
+{ "linux/wireless.h", "SIOCGIWSCAN", 0, 0x8B19, 0 },
+{ "linux/wireless.h", "SIOCGIWSENS", 0, 0x8B09, 0 },
+{ "linux/wireless.h", "SIOCGIWSPY", 0, 0x8B11, 0 },
+{ "linux/wireless.h", "SIOCGIWSTATS", 0, 0x8B0F, 0 },
+{ "linux/wireless.h", "SIOCGIWTHRSPY", 0, 0x8B13, 0 },
+{ "linux/wireless.h", "SIOCGIWTXPOW", 0, 0x8B27, 0 },
+{ "linux/wireless.h", "SIOCIWFIRST", 0, 0x8B00, 0 },
+{ "linux/wireless.h", "SIOCIWFIRSTPRIV", 0, 0x8BE0, 0 },
+{ "linux/wireless.h", "SIOCIWLASTPRIV", 0, 0x8BFF, 0 },
+{ "linux/wireless.h", "SIOCSIWAP", 0, 0x8B14, 0 },
+{ "linux/wireless.h", "SIOCSIWAUTH", 0, 0x8B32, 0 },
+{ "linux/wireless.h", "SIOCSIWCOMMIT", 0, 0x8B00, 0 },
+{ "linux/wireless.h", "SIOCSIWENCODE", 0, 0x8B2A, 0 },
+{ "linux/wireless.h", "SIOCSIWENCODEEXT", 0, 0x8B34, 0 },
+{ "linux/wireless.h", "SIOCSIWESSID", 0, 0x8B1A, 0 },
+{ "linux/wireless.h", "SIOCSIWFRAG", 0, 0x8B24, 0 },
+{ "linux/wireless.h", "SIOCSIWFREQ", 0, 0x8B04, 0 },
+{ "linux/wireless.h", "SIOCSIWGENIE", 0, 0x8B30, 0 },
+{ "linux/wireless.h", "SIOCSIWMLME", 0, 0x8B16, 0 },
+{ "linux/wireless.h", "SIOCSIWMODE", 0, 0x8B06, 0 },
+{ "linux/wireless.h", "SIOCSIWNICKN", 0, 0x8B1C, 0 },
+{ "linux/wireless.h", "SIOCSIWNWID", 0, 0x8B02, 0 },
+{ "linux/wireless.h", "SIOCSIWPMKSA", 0, 0x8B36, 0 },
+{ "linux/wireless.h", "SIOCSIWPOWER", 0, 0x8B2C, 0 },
+{ "linux/wireless.h", "SIOCSIWPRIV", 0, 0x8B0C, 0 },
+{ "linux/wireless.h", "SIOCSIWRANGE", 0, 0x8B0A, 0 },
+{ "linux/wireless.h", "SIOCSIWRATE", 0, 0x8B20, 0 },
+{ "linux/wireless.h", "SIOCSIWRETRY", 0, 0x8B28, 0 },
+{ "linux/wireless.h", "SIOCSIWRTS", 0, 0x8B22, 0 },
+{ "linux/wireless.h", "SIOCSIWSCAN", 0, 0x8B18, 0 },
+{ "linux/wireless.h", "SIOCSIWSENS", 0, 0x8B08, 0 },
+{ "linux/wireless.h", "SIOCSIWSPY", 0, 0x8B10, 0 },
+{ "linux/wireless.h", "SIOCSIWSTATS", 0, 0x8B0E, 0 },
+{ "linux/wireless.h", "SIOCSIWTHRSPY", 0, 0x8B12, 0 },
+{ "linux/wireless.h", "SIOCSIWTXPOW", 0, 0x8B26, 0 },
+{ "linux/wmi.h", "DELL_WMI_SMBIOS_CMD", _IOC_READ|_IOC_WRITE, 0x5700, 0x34 },
+{ "media/drv-intf/exynos-fimc.h", "S5P_FIMC_TX_END_NOTIFY", _IOC_NONE, 0x6500, 0x00 },
+{ "media/i2c/adv7842.h", "ADV7842_CMD_RAM_TEST", _IOC_NONE, 0x56c0, 0x00 },
+{ "media/i2c/bt819.h", "BT819_FIFO_RESET_HIGH", _IOC_NONE, 0x6201, 0x00 },
+{ "media/i2c/bt819.h", "BT819_FIFO_RESET_LOW", _IOC_NONE, 0x6200, 0x00 },
+{ "media/i2c/saa6588.h", "SAA6588_CMD_CLOSE", _IOC_WRITE, 0x5202, 0x04 },
+{ "media/i2c/saa6588.h", "SAA6588_CMD_POLL", _IOC_READ, 0x5204, 0x04 },
+{ "media/i2c/saa6588.h", "SAA6588_CMD_READ", _IOC_READ, 0x5203, 0x04 },
+{ "media/v4l2-common.h", "TUNER_SET_CONFIG", _IOC_WRITE, 0x645c, 0x08 },
+{ "media/v4l2-common.h", "VIDIOC_INT_RESET", _IOC_WRITE, 0x6466, 0x04 },
+{ "media/v4l2-ioctl.h", "VIDIOC_DQBUF_TIME32", _IOC_READ|_IOC_WRITE, 0x5611, 0x44 },
+{ "media/v4l2-ioctl.h", "VIDIOC_DQEVENT_TIME32", _IOC_READ, 0x5659, 0x80 },
+{ "media/v4l2-ioctl.h", "VIDIOC_PREPARE_BUF_TIME32", _IOC_READ|_IOC_WRITE, 0x565d, 0x44 },
+{ "media/v4l2-ioctl.h", "VIDIOC_QBUF_TIME32", _IOC_READ|_IOC_WRITE, 0x560f, 0x44 },
+{ "media/v4l2-ioctl.h", "VIDIOC_QUERYBUF_TIME32", _IOC_READ|_IOC_WRITE, 0x5609, 0x44 },
+{ "media/v4l2-subdev.h", "V4L2_DEVICE_NOTIFY_EVENT", _IOC_WRITE, 0x7602, 0x88 },
+{ "media/v4l2-subdev.h", "V4L2_SUBDEV_IR_RX_NOTIFY", _IOC_WRITE, 0x7600, 0x04 },
+{ "media/v4l2-subdev.h", "V4L2_SUBDEV_IR_TX_NOTIFY", _IOC_WRITE, 0x7601, 0x04 },
+{ "misc/cxl.h", "CXL_IOCTL_DOWNLOAD_IMAGE", _IOC_WRITE, 0xca0a, 0x40 },
+{ "misc/cxl.h", "CXL_IOCTL_GET_AFU_ID", _IOC_READ, 0xca02, 0x40 },
+{ "misc/cxl.h", "CXL_IOCTL_GET_PROCESS_ELEMENT", _IOC_READ, 0xca01, 0x04 },
+{ "misc/cxl.h", "CXL_IOCTL_START_WORK", _IOC_WRITE, 0xca00, 0x40 },
+{ "misc/cxl.h", "CXL_IOCTL_VALIDATE_IMAGE", _IOC_WRITE, 0xca0b, 0x40 },
+{ "misc/fastrpc.h", "FASTRPC_IOCTL_ALLOC_DMA_BUFF", _IOC_READ|_IOC_WRITE, 0x5201, 0x10 },
+{ "misc/fastrpc.h", "FASTRPC_IOCTL_FREE_DMA_BUFF", _IOC_READ|_IOC_WRITE, 0x5202, 0x04 },
+{ "misc/fastrpc.h", "FASTRPC_IOCTL_INIT_ATTACH", _IOC_NONE, 0x5204, 0x00 },
+{ "misc/fastrpc.h", "FASTRPC_IOCTL_INIT_ATTACH_SNS", _IOC_NONE, 0x5208, 0x00 },
+{ "misc/fastrpc.h", "FASTRPC_IOCTL_INIT_CREATE", _IOC_READ|_IOC_WRITE, 0x5205, 0x18 },
+{ "misc/fastrpc.h", "FASTRPC_IOCTL_INVOKE", _IOC_READ|_IOC_WRITE, 0x5203, 0x10 },
+{ "misc/fastrpc.h", "FASTRPC_IOCTL_MMAP", _IOC_READ|_IOC_WRITE, 0x5206, 0x20 },
+{ "misc/fastrpc.h", "FASTRPC_IOCTL_MUNMAP", _IOC_READ|_IOC_WRITE, 0x5207, 0x10 },
+{ "misc/habanalabs.h", "HL_IOCTL_CB", _IOC_READ|_IOC_WRITE, 0x4802, 0x18 },
+{ "misc/habanalabs.h", "HL_IOCTL_CS", _IOC_READ|_IOC_WRITE, 0x4803, 0x30 },
+{ "misc/habanalabs.h", "HL_IOCTL_DEBUG", _IOC_READ|_IOC_WRITE, 0x4806, 0x28 },
+{ "misc/habanalabs.h", "HL_IOCTL_INFO", _IOC_READ|_IOC_WRITE, 0x4801, 0x18 },
+{ "misc/habanalabs.h", "HL_IOCTL_MEMORY", _IOC_READ|_IOC_WRITE, 0x4805, 0x28 },
+{ "misc/habanalabs.h", "HL_IOCTL_WAIT_CS", _IOC_READ|_IOC_WRITE, 0x4804, 0x18 },
+{ "misc/ocxl.h", "OCXL_IOCTL_ATTACH", _IOC_WRITE, 0xca10, 0x20 },
+{ "misc/ocxl.h", "OCXL_IOCTL_ENABLE_P9_WAIT", _IOC_READ, 0xca15, 0x20 },
+{ "misc/ocxl.h", "OCXL_IOCTL_GET_FEATURES", _IOC_READ, 0xca16, 0x20 },
+{ "misc/ocxl.h", "OCXL_IOCTL_GET_METADATA", _IOC_READ, 0xca14, 0x80 },
+{ "misc/ocxl.h", "OCXL_IOCTL_IRQ_ALLOC", _IOC_READ, 0xca11, 0x08 },
+{ "misc/ocxl.h", "OCXL_IOCTL_IRQ_FREE", _IOC_WRITE, 0xca12, 0x08 },
+{ "misc/ocxl.h", "OCXL_IOCTL_IRQ_SET_FD", _IOC_WRITE, 0xca13, 0x10 },
+{ "misc/uacce/hisi_qm.h", "UACCE_CMD_QM_SET_QP_CTX", _IOC_READ|_IOC_WRITE, 0x480a, 0x04 },
+{ "misc/uacce/uacce.h", "UACCE_CMD_PUT_Q", _IOC_NONE, 0x5701, 0x00 },
+{ "misc/uacce/uacce.h", "UACCE_CMD_START_Q", _IOC_NONE, 0x5700, 0x00 },
+{ "misc/xilinx_sdfec.h", "XSDFEC_ADD_LDPC_CODE_PARAMS", _IOC_WRITE, 0x6605, 0x4c },
+{ "misc/xilinx_sdfec.h", "XSDFEC_CLEAR_STATS", _IOC_NONE, 0x660b, 0x00 },
+{ "misc/xilinx_sdfec.h", "XSDFEC_GET_CONFIG", _IOC_READ, 0x6606, 0x1c },
+{ "misc/xilinx_sdfec.h", "XSDFEC_GET_STATS", _IOC_READ, 0x660c, 0x0c },
+{ "misc/xilinx_sdfec.h", "XSDFEC_GET_STATUS", _IOC_READ, 0x6602, 0x08 },
+{ "misc/xilinx_sdfec.h", "XSDFEC_GET_TURBO", _IOC_READ, 0x6607, 0x08 },
+{ "misc/xilinx_sdfec.h", "XSDFEC_IS_ACTIVE", _IOC_READ, 0x660a, 0x01 },
+{ "misc/xilinx_sdfec.h", "XSDFEC_SET_BYPASS", _IOC_WRITE, 0x6609, 0x01 },
+{ "misc/xilinx_sdfec.h", "XSDFEC_SET_DEFAULT_CONFIG", _IOC_NONE, 0x660d, 0x00 },
+{ "misc/xilinx_sdfec.h", "XSDFEC_SET_IRQ", _IOC_WRITE, 0x6603, 0x02 },
+{ "misc/xilinx_sdfec.h", "XSDFEC_SET_ORDER", _IOC_WRITE, 0x6608, 0x04 },
+{ "misc/xilinx_sdfec.h", "XSDFEC_SET_TURBO", _IOC_WRITE, 0x6604, 0x08 },
+{ "misc/xilinx_sdfec.h", "XSDFEC_START_DEV", _IOC_NONE, 0x6600, 0x00 },
+{ "misc/xilinx_sdfec.h", "XSDFEC_STOP_DEV", _IOC_NONE, 0x6601, 0x00 },
+{ "mtd/mtd-abi.h", "ECCGETLAYOUT", _IOC_READ, 0x4d11, 0x148 },
+{ "mtd/mtd-abi.h", "ECCGETSTATS", _IOC_READ, 0x4d12, 0x10 },
+{ "mtd/mtd-abi.h", "MEMERASE", _IOC_WRITE, 0x4d02, 0x08 },
+{ "mtd/mtd-abi.h", "MEMERASE64", _IOC_WRITE, 0x4d14, 0x10 },
+{ "mtd/mtd-abi.h", "MEMGETBADBLOCK", _IOC_WRITE, 0x4d0b, 0x08 },
+{ "mtd/mtd-abi.h", "MEMGETINFO", _IOC_READ, 0x4d01, 0x20 },
+{ "mtd/mtd-abi.h", "MEMGETOOBSEL", _IOC_READ, 0x4d0a, 0xc8 },
+{ "mtd/mtd-abi.h", "MEMGETREGIONCOUNT", _IOC_READ, 0x4d07, 0x04 },
+{ "mtd/mtd-abi.h", "MEMGETREGIONINFO", _IOC_READ|_IOC_WRITE, 0x4d08, 0x10 },
+{ "mtd/mtd-abi.h", "MEMISLOCKED", _IOC_READ, 0x4d17, 0x08 },
+{ "mtd/mtd-abi.h", "MEMLOCK", _IOC_WRITE, 0x4d05, 0x08 },
+{ "mtd/mtd-abi.h", "MEMREADOOB", _IOC_READ|_IOC_WRITE, 0x4d04, 0x0c },
+{ "mtd/mtd-abi.h", "MEMREADOOB64", _IOC_READ|_IOC_WRITE, 0x4d16, 0x18 },
+{ "mtd/mtd-abi.h", "MEMSETBADBLOCK", _IOC_WRITE, 0x4d0c, 0x08 },
+{ "mtd/mtd-abi.h", "MEMUNLOCK", _IOC_WRITE, 0x4d06, 0x08 },
+{ "mtd/mtd-abi.h", "MEMWRITE", _IOC_READ|_IOC_WRITE, 0x4d18, 0x30 },
+{ "mtd/mtd-abi.h", "MEMWRITEOOB", _IOC_READ|_IOC_WRITE, 0x4d03, 0x0c },
+{ "mtd/mtd-abi.h", "MEMWRITEOOB64", _IOC_READ|_IOC_WRITE, 0x4d15, 0x18 },
+{ "mtd/mtd-abi.h", "MTDFILEMODE", _IOC_NONE, 0x4d13, 0x00 },
+{ "mtd/mtd-abi.h", "OTPGETREGIONCOUNT", _IOC_WRITE, 0x4d0e, 0x04 },
+{ "mtd/mtd-abi.h", "OTPGETREGIONINFO", _IOC_WRITE, 0x4d0f, 0x0c },
+{ "mtd/mtd-abi.h", "OTPLOCK", _IOC_READ, 0x4d10, 0x0c },
+{ "mtd/mtd-abi.h", "OTPSELECT", _IOC_READ, 0x4d0d, 0x04 },
+{ "mtd/ubi-user.h", "UBI_IOCATT", _IOC_WRITE, 0x6f40, 0x18 },
+{ "mtd/ubi-user.h", "UBI_IOCDET", _IOC_WRITE, 0x6f41, 0x04 },
+{ "mtd/ubi-user.h", "UBI_IOCEBCH", _IOC_WRITE, 0x4f02, 0x04 },
+{ "mtd/ubi-user.h", "UBI_IOCEBER", _IOC_WRITE, 0x4f01, 0x04 },
+{ "mtd/ubi-user.h", "UBI_IOCEBISMAP", _IOC_READ, 0x4f05, 0x04 },
+{ "mtd/ubi-user.h", "UBI_IOCEBMAP", _IOC_WRITE, 0x4f03, 0x08 },
+{ "mtd/ubi-user.h", "UBI_IOCEBUNMAP", _IOC_WRITE, 0x4f04, 0x04 },
+{ "mtd/ubi-user.h", "UBI_IOCMKVOL", _IOC_WRITE, 0x6f00, 0x98 },
+{ "mtd/ubi-user.h", "UBI_IOCRMVOL", _IOC_WRITE, 0x6f01, 0x04 },
+{ "mtd/ubi-user.h", "UBI_IOCRNVOL", _IOC_WRITE, 0x6f03, 0x1110 },
+{ "mtd/ubi-user.h", "UBI_IOCRPEB", _IOC_WRITE, 0x6f04, 0x04 },
+{ "mtd/ubi-user.h", "UBI_IOCRSVOL", _IOC_WRITE, 0x6f02, 0x0c },
+{ "mtd/ubi-user.h", "UBI_IOCSETVOLPROP", _IOC_WRITE, 0x4f06, 0x10 },
+{ "mtd/ubi-user.h", "UBI_IOCSPEB", _IOC_WRITE, 0x6f05, 0x04 },
+{ "mtd/ubi-user.h", "UBI_IOCVOLCRBLK", _IOC_WRITE, 0x4f07, 0x80 },
+{ "mtd/ubi-user.h", "UBI_IOCVOLRMBLK", _IOC_NONE, 0x4f08, 0x00 },
+{ "mtd/ubi-user.h", "UBI_IOCVOLUP", _IOC_WRITE, 0x4f00, 0x08 },
+{ "net/bluetooth/hci_sock.h", "HCIBLOCKADDR", _IOC_WRITE, 0x48e6, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCIDEVDOWN", _IOC_WRITE, 0x48ca, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCIDEVRESET", _IOC_WRITE, 0x48cb, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCIDEVRESTAT", _IOC_WRITE, 0x48cc, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCIDEVUP", _IOC_WRITE, 0x48c9, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCIGETAUTHINFO", _IOC_READ, 0x48d7, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCIGETCONNINFO", _IOC_READ, 0x48d5, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCIGETCONNLIST", _IOC_READ, 0x48d4, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCIGETDEVINFO", _IOC_READ, 0x48d3, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCIGETDEVLIST", _IOC_READ, 0x48d2, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCIINQUIRY", _IOC_READ, 0x48f0, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCISETACLMTU", _IOC_WRITE, 0x48e3, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCISETAUTH", _IOC_WRITE, 0x48de, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCISETENCRYPT", _IOC_WRITE, 0x48df, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCISETLINKMODE", _IOC_WRITE, 0x48e2, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCISETLINKPOL", _IOC_WRITE, 0x48e1, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCISETPTYPE", _IOC_WRITE, 0x48e0, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCISETRAW", _IOC_WRITE, 0x48dc, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCISETSCAN", _IOC_WRITE, 0x48dd, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCISETSCOMTU", _IOC_WRITE, 0x48e4, 0x04 },
+{ "net/bluetooth/hci_sock.h", "HCIUNBLOCKADDR", _IOC_WRITE, 0x48e7, 0x04 },
+{ "net/bluetooth/rfcomm.h", "RFCOMMCREATEDEV", _IOC_WRITE, 0x52c8, 0x04 },
+{ "net/bluetooth/rfcomm.h", "RFCOMMGETDEVINFO", _IOC_READ, 0x52d3, 0x04 },
+{ "net/bluetooth/rfcomm.h", "RFCOMMGETDEVLIST", _IOC_READ, 0x52d2, 0x04 },
+{ "net/bluetooth/rfcomm.h", "RFCOMMRELEASEDEV", _IOC_WRITE, 0x52c9, 0x04 },
+{ "net/bluetooth/rfcomm.h", "RFCOMMSTEALDLC", _IOC_WRITE, 0x52dc, 0x04 },
+{ "net/nfc/nci_core.h", "NCIUARTSETDRIVER", _IOC_WRITE, 0x5500, 0x04 },
+{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_ACK_EVENT", _IOC_WRITE, 0x1bea, 0x04 },
+{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_ASSIGN_CTXT", _IOC_READ|_IOC_WRITE, 0x1be1, 0x1c },
+{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_CREDIT_UPD", _IOC_NONE, 0x1be6, 0x00 },
+{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_CTXT_INFO", _IOC_WRITE, 0x1be2, 0x28 },
+{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_CTXT_RESET", _IOC_NONE, 0x1bec, 0x00 },
+{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_GET_VERS", _IOC_READ, 0x1bee, 0x04 },
+{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_POLL_TYPE", _IOC_WRITE, 0x1be9, 0x04 },
+{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_RECV_CTRL", _IOC_WRITE, 0x1be8, 0x04 },
+{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_SET_PKEY", _IOC_WRITE, 0x1beb, 0x02 },
+{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_TID_FREE", _IOC_READ|_IOC_WRITE, 0x1be5, 0x18 },
+{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_TID_INVAL_READ", _IOC_READ|_IOC_WRITE, 0x1bed, 0x18 },
+{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_TID_UPDATE", _IOC_READ|_IOC_WRITE, 0x1be4, 0x18 },
+{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_USER_INFO", _IOC_WRITE, 0x1be3, 0x78 },
+{ "rdma/rdma_user_ioctl.h", "IB_USER_MAD_ENABLE_PKEY", _IOC_NONE, 0x1b03, 0x00 },
+{ "rdma/rdma_user_ioctl.h", "IB_USER_MAD_REGISTER_AGENT", _IOC_READ|_IOC_WRITE, 0x1b01, 0x1c },
+{ "rdma/rdma_user_ioctl.h", "IB_USER_MAD_REGISTER_AGENT2", _IOC_READ|_IOC_WRITE, 0x1b04, 0x28 },
+{ "rdma/rdma_user_ioctl.h", "IB_USER_MAD_UNREGISTER_AGENT", _IOC_WRITE, 0x1b02, 0x04 },
+{ "rdma/rdma_user_ioctl_cmds.h", "RDMA_VERBS_IOCTL", _IOC_READ|_IOC_WRITE, 0x1b01, 0x18 },
+{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_ATTACH", _IOC_READ|_IOC_WRITE, 0xca80, 0x90 },
+{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_DETACH", _IOC_READ|_IOC_WRITE, 0xca83, 0x60 },
+{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_MANAGE_LUN", _IOC_READ|_IOC_WRITE, 0xca86, 0x68 },
+{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_RECOVER_AFU", _IOC_READ|_IOC_WRITE, 0xca85, 0x78 },
+{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_RELEASE", _IOC_READ|_IOC_WRITE, 0xca82, 0x68 },
+{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_USER_DIRECT", _IOC_READ|_IOC_WRITE, 0xca81, 0x70 },
+{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_USER_VIRTUAL", _IOC_READ|_IOC_WRITE, 0xca87, 0x78 },
+{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_VERIFY", _IOC_READ|_IOC_WRITE, 0xca84, 0x90 },
+{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_VLUN_CLONE", _IOC_READ|_IOC_WRITE, 0xca89, 0x70 },
+{ "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_VLUN_RESIZE", _IOC_READ|_IOC_WRITE, 0xca88, 0x78 },
+{ "scsi/cxlflash_ioctl.h", "HT_CXLFLASH_AFU_DEBUG", _IOC_READ|_IOC_WRITE, 0xcabe, 0x78 },
+{ "scsi/cxlflash_ioctl.h", "HT_CXLFLASH_LUN_PROVISION", _IOC_READ|_IOC_WRITE, 0xcabf, 0xa0 },
+{ "scsi/scsi.h", "SCSI_IOCTL_GET_BUS_NUMBER", 0, 0x5386, 0 },
+{ "scsi/scsi.h", "SCSI_IOCTL_GET_IDLUN", 0, 0x5382, 0 },
+{ "scsi/scsi.h", "SCSI_IOCTL_GET_PCI", 0, 0x5387, 0 },
+{ "scsi/scsi.h", "SCSI_IOCTL_PROBE_HOST", 0, 0x5385, 0 },
+{ "scsi/scsi_ioctl.h", "SCSI_IOCTL_DOORLOCK", 0, 0x5380, 0 },
+{ "scsi/scsi_ioctl.h", "SCSI_IOCTL_DOORUNLOCK", 0, 0x5381, 0 },
+{ "scsi/sg.h", "SG_EMULATED_HOST", 0, 0x2203, 0 },
+{ "scsi/sg.h", "SG_GET_ACCESS_COUNT", 0, 0x2289, 0 },
+{ "scsi/sg.h", "SG_GET_COMMAND_Q", 0, 0x2270, 0 },
+{ "scsi/sg.h", "SG_GET_KEEP_ORPHAN", 0, 0x2288, 0 },
+{ "scsi/sg.h", "SG_GET_LOW_DMA", 0, 0x227a, 0 },
+{ "scsi/sg.h", "SG_GET_NUM_WAITING", 0, 0x227d, 0 },
+{ "scsi/sg.h", "SG_GET_PACK_ID", 0, 0x227c, 0 },
+{ "scsi/sg.h", "SG_GET_REQUEST_TABLE", 0, 0x2286, 0 },
+{ "scsi/sg.h", "SG_GET_RESERVED_SIZE", 0, 0x2272, 0 },
+{ "scsi/sg.h", "SG_GET_SCSI_ID", 0, 0x2276, 0 },
+{ "scsi/sg.h", "SG_GET_SG_TABLESIZE", 0, 0x227F, 0 },
+{ "scsi/sg.h", "SG_GET_TIMEOUT", 0, 0x2202, 0 },
+{ "scsi/sg.h", "SG_GET_TRANSFORM", 0, 0x2205, 0 },
+{ "scsi/sg.h", "SG_GET_VERSION_NUM", 0, 0x2282, 0 },
+{ "scsi/sg.h", "SG_IO", 0, 0x2285, 0 },
+{ "scsi/sg.h", "SG_NEXT_CMD_LEN", 0, 0x2283, 0 },
+{ "scsi/sg.h", "SG_SCSI_RESET", 0, 0x2284, 0 },
+{ "scsi/sg.h", "SG_SET_COMMAND_Q", 0, 0x2271, 0 },
+{ "scsi/sg.h", "SG_SET_DEBUG", 0, 0x227e, 0 },
+{ "scsi/sg.h", "SG_SET_FORCE_LOW_DMA", 0, 0x2279, 0 },
+{ "scsi/sg.h", "SG_SET_FORCE_PACK_ID", 0, 0x227b, 0 },
+{ "scsi/sg.h", "SG_SET_KEEP_ORPHAN", 0, 0x2287, 0 },
+{ "scsi/sg.h", "SG_SET_RESERVED_SIZE", 0, 0x2275, 0 },
+{ "scsi/sg.h", "SG_SET_TIMEOUT", 0, 0x2201, 0 },
+{ "scsi/sg.h", "SG_SET_TRANSFORM", 0, 0x2204, 0 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_CLIENT_ID", _IOC_READ, 0x5301, 0x04 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_CREATE_PORT", _IOC_READ|_IOC_WRITE, 0x5320, 0xa4 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_CREATE_QUEUE", _IOC_READ|_IOC_WRITE, 0x5332, 0x8c },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_DELETE_PORT", _IOC_WRITE, 0x5321, 0xa4 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_DELETE_QUEUE", _IOC_WRITE, 0x5333, 0x8c },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_CLIENT_INFO", _IOC_READ|_IOC_WRITE, 0x5310, 0xbc },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_CLIENT_POOL", _IOC_READ|_IOC_WRITE, 0x534b, 0x58 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_NAMED_QUEUE", _IOC_READ|_IOC_WRITE, 0x5336, 0x8c },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_PORT_INFO", _IOC_READ|_IOC_WRITE, 0x5322, 0xa4 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_QUEUE_CLIENT", _IOC_READ|_IOC_WRITE, 0x5349, 0x4c },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_QUEUE_INFO", _IOC_READ|_IOC_WRITE, 0x5334, 0x8c },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_QUEUE_STATUS", _IOC_READ|_IOC_WRITE, 0x5340, 0x5c },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_QUEUE_TEMPO", _IOC_READ|_IOC_WRITE, 0x5341, 0x2c },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_QUEUE_TIMER", _IOC_READ|_IOC_WRITE, 0x5345, 0x60 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_GET_SUBSCRIPTION", _IOC_READ|_IOC_WRITE, 0x5350, 0x50 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_PVERSION", _IOC_READ, 0x5300, 0x04 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_QUERY_NEXT_CLIENT", _IOC_READ|_IOC_WRITE, 0x5351, 0xbc },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_QUERY_NEXT_PORT", _IOC_READ|_IOC_WRITE, 0x5352, 0xa4 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_QUERY_SUBS", _IOC_READ|_IOC_WRITE, 0x534f, 0x58 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_REMOVE_EVENTS", _IOC_WRITE, 0x534e, 0x40 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_RUNNING_MODE", _IOC_READ|_IOC_WRITE, 0x5303, 0x10 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SET_CLIENT_INFO", _IOC_WRITE, 0x5311, 0xbc },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SET_CLIENT_POOL", _IOC_WRITE, 0x534c, 0x58 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SET_PORT_INFO", _IOC_WRITE, 0x5323, 0xa4 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SET_QUEUE_CLIENT", _IOC_WRITE, 0x534a, 0x4c },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SET_QUEUE_INFO", _IOC_READ|_IOC_WRITE, 0x5335, 0x8c },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SET_QUEUE_TEMPO", _IOC_WRITE, 0x5342, 0x2c },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SET_QUEUE_TIMER", _IOC_WRITE, 0x5346, 0x60 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SUBSCRIBE_PORT", _IOC_WRITE, 0x5330, 0x50 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_SYSTEM_INFO", _IOC_READ|_IOC_WRITE, 0x5302, 0x30 },
+{ "sound/asequencer.h", "SNDRV_SEQ_IOCTL_UNSUBSCRIBE_PORT", _IOC_WRITE, 0x5331, 0x50 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_CARD_INFO", _IOC_READ, 0x5501, 0x178 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_ADD", _IOC_READ|_IOC_WRITE, 0x5517, 0x110 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_INFO", _IOC_READ|_IOC_WRITE, 0x5511, 0x110 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_LIST", _IOC_READ|_IOC_WRITE, 0x5510, 0x48 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_LOCK", _IOC_WRITE, 0x5514, 0x40 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_READ", _IOC_READ|_IOC_WRITE, 0x5512, 0x2c8 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_REMOVE", _IOC_READ|_IOC_WRITE, 0x5519, 0x40 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_REPLACE", _IOC_READ|_IOC_WRITE, 0x5518, 0x110 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_UNLOCK", _IOC_WRITE, 0x5515, 0x40 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_ELEM_WRITE", _IOC_READ|_IOC_WRITE, 0x5513, 0x2c8 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_HWDEP_INFO", _IOC_READ, 0x5521, 0xdc },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_HWDEP_NEXT_DEVICE", _IOC_READ|_IOC_WRITE, 0x5520, 0x04 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_PCM_INFO", _IOC_READ|_IOC_WRITE, 0x5531, 0x120 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_PCM_NEXT_DEVICE", _IOC_READ, 0x5530, 0x04 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_PCM_PREFER_SUBDEVICE", _IOC_WRITE, 0x5532, 0x04 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_POWER", _IOC_READ|_IOC_WRITE, 0x55d0, 0x04 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_POWER_STATE", _IOC_READ, 0x55d1, 0x04 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_PVERSION", _IOC_READ, 0x5500, 0x04 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_RAWMIDI_INFO", _IOC_READ|_IOC_WRITE, 0x5541, 0x10c },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_RAWMIDI_NEXT_DEVICE", _IOC_READ|_IOC_WRITE, 0x5540, 0x04 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_RAWMIDI_PREFER_SUBDEVICE", _IOC_WRITE, 0x5542, 0x04 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_SUBSCRIBE_EVENTS", _IOC_READ|_IOC_WRITE, 0x5516, 0x04 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_TLV_COMMAND", _IOC_READ|_IOC_WRITE, 0x551c, 0x08 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_TLV_READ", _IOC_READ|_IOC_WRITE, 0x551a, 0x08 },
+{ "sound/asound.h", "SNDRV_CTL_IOCTL_TLV_WRITE", _IOC_READ|_IOC_WRITE, 0x551b, 0x08 },
+{ "sound/asound.h", "SNDRV_HWDEP_IOCTL_DSP_LOAD", _IOC_WRITE, 0x4803, 0x50 },
+{ "sound/asound.h", "SNDRV_HWDEP_IOCTL_DSP_STATUS", _IOC_READ, 0x4802, 0x40 },
+{ "sound/asound.h", "SNDRV_HWDEP_IOCTL_INFO", _IOC_READ, 0x4801, 0xdc },
+{ "sound/asound.h", "SNDRV_HWDEP_IOCTL_PVERSION", _IOC_READ, 0x4800, 0x04 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_CHANNEL_INFO", _IOC_READ, 0x4132, 0x18 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_DELAY", _IOC_READ, 0x4121, 0x04 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_DRAIN", _IOC_NONE, 0x4144, 0x00 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_DROP", _IOC_NONE, 0x4143, 0x00 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_FORWARD", _IOC_WRITE, 0x4149, 0x04 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_HWSYNC", _IOC_NONE, 0x4122, 0x00 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_HW_FREE", _IOC_NONE, 0x4112, 0x00 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_HW_PARAMS", _IOC_READ|_IOC_WRITE, 0x4111, 0x25c },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_HW_REFINE", _IOC_READ|_IOC_WRITE, 0x4110, 0x25c },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_INFO", _IOC_READ, 0x4101, 0x120 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_LINK", _IOC_WRITE, 0x4160, 0x04 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_PAUSE", _IOC_WRITE, 0x4145, 0x04 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_PREPARE", _IOC_NONE, 0x4140, 0x00 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_PVERSION", _IOC_READ, 0x4100, 0x04 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_READI_FRAMES", _IOC_READ, 0x4151, 0x0c },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_READN_FRAMES", _IOC_READ, 0x4153, 0x0c },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_RESET", _IOC_NONE, 0x4141, 0x00 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_RESUME", _IOC_NONE, 0x4147, 0x00 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_REWIND", _IOC_WRITE, 0x4146, 0x04 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_START", _IOC_NONE, 0x4142, 0x00 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_STATUS", _IOC_READ, 0x4120, 0x80 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_STATUS_EXT", _IOC_READ|_IOC_WRITE, 0x4124, 0x80 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_SW_PARAMS", _IOC_READ|_IOC_WRITE, 0x4113, 0x68 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_SYNC_PTR", _IOC_READ|_IOC_WRITE, 0x4123, 0x88 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_TSTAMP", _IOC_WRITE, 0x4102, 0x04 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_TTSTAMP", _IOC_WRITE, 0x4103, 0x04 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_UNLINK", _IOC_NONE, 0x4161, 0x00 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_USER_PVERSION", _IOC_WRITE, 0x4104, 0x04 },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_WRITEI_FRAMES", _IOC_WRITE, 0x4150, 0x0c },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_WRITEN_FRAMES", _IOC_WRITE, 0x4152, 0x0c },
+{ "sound/asound.h", "SNDRV_PCM_IOCTL_XRUN", _IOC_NONE, 0x4148, 0x00 },
+{ "sound/asound.h", "SNDRV_RAWMIDI_IOCTL_DRAIN", _IOC_WRITE, 0x5731, 0x04 },
+{ "sound/asound.h", "SNDRV_RAWMIDI_IOCTL_DROP", _IOC_WRITE, 0x5730, 0x04 },
+{ "sound/asound.h", "SNDRV_RAWMIDI_IOCTL_INFO", _IOC_READ, 0x5701, 0x10c },
+{ "sound/asound.h", "SNDRV_RAWMIDI_IOCTL_PARAMS", _IOC_READ|_IOC_WRITE, 0x5710, 0x20 },
+{ "sound/asound.h", "SNDRV_RAWMIDI_IOCTL_PVERSION", _IOC_READ, 0x5700, 0x04 },
+{ "sound/asound.h", "SNDRV_RAWMIDI_IOCTL_STATUS", _IOC_READ|_IOC_WRITE, 0x5720, 0x30 },
+{ "sound/asound.h", "SNDRV_TIMER_IOCTL_CONTINUE", _IOC_NONE, 0x54a2, 0x00 },
+{ "sound/asound.h", "SNDRV_TIMER_IOCTL_GINFO", _IOC_READ|_IOC_WRITE, 0x5403, 0xe0 },
+{ "sound/asound.h", "SNDRV_TIMER_IOCTL_GPARAMS", _IOC_WRITE, 0x5404, 0x3c },
+{ "sound/asound.h", "SNDRV_TIMER_IOCTL_GSTATUS", _IOC_READ|_IOC_WRITE, 0x5405, 0x40 },
+{ "sound/asound.h", "SNDRV_TIMER_IOCTL_INFO", _IOC_READ, 0x5411, 0xe0 },
+{ "sound/asound.h", "SNDRV_TIMER_IOCTL_NEXT_DEVICE", _IOC_READ|_IOC_WRITE, 0x5401, 0x14 },
+{ "sound/asound.h", "SNDRV_TIMER_IOCTL_PARAMS", _IOC_WRITE, 0x5412, 0x50 },
+{ "sound/asound.h", "SNDRV_TIMER_IOCTL_PAUSE", _IOC_NONE, 0x54a3, 0x00 },
+{ "sound/asound.h", "SNDRV_TIMER_IOCTL_PVERSION", _IOC_READ, 0x5400, 0x04 },
+{ "sound/asound.h", "SNDRV_TIMER_IOCTL_SELECT", _IOC_WRITE, 0x5410, 0x34 },
+{ "sound/asound.h", "SNDRV_TIMER_IOCTL_START", _IOC_NONE, 0x54a0, 0x00 },
+{ "sound/asound.h", "SNDRV_TIMER_IOCTL_STATUS", _IOC_READ, 0x5414, 0x60 },
+{ "sound/asound.h", "SNDRV_TIMER_IOCTL_STOP", _IOC_NONE, 0x54a1, 0x00 },
+{ "sound/asound.h", "SNDRV_TIMER_IOCTL_TREAD64", _IOC_WRITE, 0x54a4, 0x04 },
+{ "sound/asound.h", "SNDRV_TIMER_IOCTL_TREAD_OLD", _IOC_WRITE, 0x5402, 0x04 },
+{ "sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_CLEAR_PATCHES", _IOC_NONE, 0x4840, 0x00 },
+{ "sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_INFO", _IOC_READ, 0x4820, 0x02 },
+{ "sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_PLAY_NOTE", _IOC_WRITE, 0x4822, 0x0c },
+{ "sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_RESET", _IOC_NONE, 0x4821, 0x00 },
+{ "sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_SET_CONNECTION", _IOC_WRITE, 0x4826, 0x04 },
+{ "sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_SET_MODE", _IOC_WRITE, 0x4825, 0x04 },
+{ "sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_SET_PARAMS", _IOC_WRITE, 0x4824, 0x09 },
+{ "sound/asound_fm.h", "SNDRV_DM_FM_IOCTL_SET_VOICE", _IOC_WRITE, 0x4823, 0x12 },
+{ "sound/compress_offload.h", "SNDRV_COMPRESS_AVAIL", _IOC_READ, 0x4321, 0x1c },
+{ "sound/compress_offload.h", "SNDRV_COMPRESS_DRAIN", _IOC_NONE, 0x4334, 0x00 },
+{ "sound/compress_offload.h", "SNDRV_COMPRESS_GET_CAPS", _IOC_READ|_IOC_WRITE, 0x4310, 0xc4 },
+{ "sound/compress_offload.h", "SNDRV_COMPRESS_GET_CODEC_CAPS", _IOC_READ|_IOC_WRITE, 0x4311, 0x2b88 },
+{ "sound/compress_offload.h", "SNDRV_COMPRESS_GET_METADATA", _IOC_READ|_IOC_WRITE, 0x4315, 0x24 },
+{ "sound/compress_offload.h", "SNDRV_COMPRESS_GET_PARAMS", _IOC_READ, 0x4313, 0x78 },
+{ "sound/compress_offload.h", "SNDRV_COMPRESS_IOCTL_VERSION", _IOC_READ, 0x4300, 0x04 },
+{ "sound/compress_offload.h", "SNDRV_COMPRESS_NEXT_TRACK", _IOC_NONE, 0x4335, 0x00 },
+{ "sound/compress_offload.h", "SNDRV_COMPRESS_PARTIAL_DRAIN", _IOC_NONE, 0x4336, 0x00 },
+{ "sound/compress_offload.h", "SNDRV_COMPRESS_PAUSE", _IOC_NONE, 0x4330, 0x00 },
+{ "sound/compress_offload.h", "SNDRV_COMPRESS_RESUME", _IOC_NONE, 0x4331, 0x00 },
+{ "sound/compress_offload.h", "SNDRV_COMPRESS_SET_METADATA", _IOC_WRITE, 0x4314, 0x24 },
+{ "sound/compress_offload.h", "SNDRV_COMPRESS_SET_PARAMS", _IOC_WRITE, 0x4312, 0x84 },
+{ "sound/compress_offload.h", "SNDRV_COMPRESS_START", _IOC_NONE, 0x4332, 0x00 },
+{ "sound/compress_offload.h", "SNDRV_COMPRESS_STOP", _IOC_NONE, 0x4333, 0x00 },
+{ "sound/compress_offload.h", "SNDRV_COMPRESS_TSTAMP", _IOC_READ, 0x4320, 0x14 },
+{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_CODE_PEEK", _IOC_READ|_IOC_WRITE, 0x4812, 0x18c },
+{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_CODE_POKE", _IOC_WRITE, 0x4811, 0x18c },
+{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_CONTINUE", _IOC_NONE, 0x4881, 0x00 },
+{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_DBG_READ", _IOC_READ, 0x4884, 0x04 },
+{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_INFO", _IOC_READ, 0x4810, 0x80c },
+{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_PCM_PEEK", _IOC_READ|_IOC_WRITE, 0x4831, 0x48 },
+{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_PCM_POKE", _IOC_WRITE, 0x4830, 0x48 },
+{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_PVERSION", _IOC_READ, 0x4840, 0x04 },
+{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_SINGLE_STEP", _IOC_WRITE, 0x4883, 0x04 },
+{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_STOP", _IOC_NONE, 0x4880, 0x00 },
+{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_TRAM_PEEK", _IOC_READ|_IOC_WRITE, 0x4822, 0x0c },
+{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_TRAM_POKE", _IOC_WRITE, 0x4821, 0x0c },
+{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_TRAM_SETUP", _IOC_WRITE, 0x4820, 0x04 },
+{ "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_ZERO_TRAM_COUNTER", _IOC_NONE, 0x4882, 0x00 },
+{ "sound/firewire.h", "SNDRV_FIREWIRE_IOCTL_GET_INFO", _IOC_READ, 0x48f8, 0x20 },
+{ "sound/firewire.h", "SNDRV_FIREWIRE_IOCTL_LOCK", _IOC_NONE, 0x48f9, 0x00 },
+{ "sound/firewire.h", "SNDRV_FIREWIRE_IOCTL_TASCAM_STATE", _IOC_READ, 0x48fb, 0x100 },
+{ "sound/firewire.h", "SNDRV_FIREWIRE_IOCTL_UNLOCK", _IOC_NONE, 0x48fa, 0x00 },
+{ "sound/hda_hwdep.h", "HDA_IOCTL_GET_WCAP", _IOC_READ|_IOC_WRITE, 0x4812, 0x08 },
+{ "sound/hda_hwdep.h", "HDA_IOCTL_PVERSION", _IOC_READ, 0x4810, 0x04 },
+{ "sound/hda_hwdep.h", "HDA_IOCTL_VERB_WRITE", _IOC_READ|_IOC_WRITE, 0x4811, 0x08 },
+{ "sound/hdsp.h", "SNDRV_HDSP_IOCTL_GET_9632_AEB", _IOC_READ, 0x4845, 0x08 },
+{ "sound/hdsp.h", "SNDRV_HDSP_IOCTL_GET_CONFIG_INFO", _IOC_READ, 0x4841, 0x24 },
+{ "sound/hdsp.h", "SNDRV_HDSP_IOCTL_GET_MIXER", _IOC_READ, 0x4844, 0x1000 },
+{ "sound/hdsp.h", "SNDRV_HDSP_IOCTL_GET_PEAK_RMS", _IOC_READ, 0x4840, 0x3b0 },
+{ "sound/hdsp.h", "SNDRV_HDSP_IOCTL_GET_VERSION", _IOC_READ, 0x4843, 0x08 },
+{ "sound/hdsp.h", "SNDRV_HDSP_IOCTL_UPLOAD_FIRMWARE", _IOC_WRITE, 0x4842, 0x04 },
+{ "sound/hdspm.h", "SNDRV_HDSPM_IOCTL_GET_CONFIG", _IOC_READ, 0x4841, 0x18 },
+{ "sound/hdspm.h", "SNDRV_HDSPM_IOCTL_GET_LTC", _IOC_READ, 0x4846, 0x10 },
+{ "sound/hdspm.h", "SNDRV_HDSPM_IOCTL_GET_MIXER", _IOC_READ, 0x4844, 0x04 },
+{ "sound/hdspm.h", "SNDRV_HDSPM_IOCTL_GET_PEAK_RMS", _IOC_READ, 0x4842, 0x908 },
+{ "sound/hdspm.h", "SNDRV_HDSPM_IOCTL_GET_STATUS", _IOC_READ, 0x4847, 0x20 },
+{ "sound/hdspm.h", "SNDRV_HDSPM_IOCTL_GET_VERSION", _IOC_READ, 0x4848, 0x24 },
+{ "sound/pcm.h", "SNDRV_PCM_IOCTL_STATUS32", _IOC_READ, 0x4120, 0x6c },
+{ "sound/pcm.h", "SNDRV_PCM_IOCTL_STATUS64", _IOC_READ, 0x4120, 0x80 },
+{ "sound/pcm.h", "SNDRV_PCM_IOCTL_STATUS_EXT32", _IOC_READ|_IOC_WRITE, 0x4124, 0x6c },
+{ "sound/pcm.h", "SNDRV_PCM_IOCTL_STATUS_EXT64", _IOC_READ|_IOC_WRITE, 0x4124, 0x80 },
+{ "sound/sb16_csp.h", "SNDRV_SB_CSP_IOCTL_INFO", _IOC_READ, 0x4810, 0x28 },
+{ "sound/sb16_csp.h", "SNDRV_SB_CSP_IOCTL_LOAD_CODE", _IOC_WRITE, 0x4811, 0x3012 },
+{ "sound/sb16_csp.h", "SNDRV_SB_CSP_IOCTL_PAUSE", _IOC_NONE, 0x4815, 0x00 },
+{ "sound/sb16_csp.h", "SNDRV_SB_CSP_IOCTL_RESTART", _IOC_NONE, 0x4816, 0x00 },
+{ "sound/sb16_csp.h", "SNDRV_SB_CSP_IOCTL_START", _IOC_WRITE, 0x4813, 0x08 },
+{ "sound/sb16_csp.h", "SNDRV_SB_CSP_IOCTL_STOP", _IOC_NONE, 0x4814, 0x00 },
+{ "sound/sb16_csp.h", "SNDRV_SB_CSP_IOCTL_UNLOAD_CODE", _IOC_NONE, 0x4812, 0x00 },
+{ "sound/sfnt_info.h", "SNDRV_EMUX_IOCTL_LOAD_PATCH", _IOC_READ|_IOC_WRITE, 0x4881, 0x10 },
+{ "sound/sfnt_info.h", "SNDRV_EMUX_IOCTL_MEM_AVAIL", _IOC_WRITE, 0x4884, 0x04 },
+{ "sound/sfnt_info.h", "SNDRV_EMUX_IOCTL_MISC_MODE", _IOC_READ|_IOC_WRITE, 0x4884, 0x10 },
+{ "sound/sfnt_info.h", "SNDRV_EMUX_IOCTL_REMOVE_LAST_SAMPLES", _IOC_NONE, 0x4883, 0x00 },
+{ "sound/sfnt_info.h", "SNDRV_EMUX_IOCTL_RESET_SAMPLES", _IOC_NONE, 0x4882, 0x00 },
+{ "sound/sfnt_info.h", "SNDRV_EMUX_IOCTL_VERSION", _IOC_READ, 0x4880, 0x04 },
+{ "sound/usb_stream.h", "SNDRV_USB_STREAM_IOCTL_SET_PARAMS", _IOC_WRITE, 0x4890, 0x10 },
+{ "staging/android/ashmem.h", "ASHMEM_GET_NAME", _IOC_READ, 0x7702, 0x100 },
+{ "staging/android/ashmem.h", "ASHMEM_GET_PIN_STATUS", _IOC_NONE, 0x7709, 0x00 },
+{ "staging/android/ashmem.h", "ASHMEM_GET_PROT_MASK", _IOC_NONE, 0x7706, 0x00 },
+{ "staging/android/ashmem.h", "ASHMEM_GET_SIZE", _IOC_NONE, 0x7704, 0x00 },
+{ "staging/android/ashmem.h", "ASHMEM_PIN", _IOC_WRITE, 0x7707, 0x08 },
+{ "staging/android/ashmem.h", "ASHMEM_PURGE_ALL_CACHES", _IOC_NONE, 0x770a, 0x00 },
+{ "staging/android/ashmem.h", "ASHMEM_SET_NAME", _IOC_WRITE, 0x7701, 0x100 },
+{ "staging/android/ashmem.h", "ASHMEM_SET_PROT_MASK", _IOC_WRITE, 0x7705, 0x04 },
+{ "staging/android/ashmem.h", "ASHMEM_SET_SIZE", _IOC_WRITE, 0x7703, 0x04 },
+{ "staging/android/ashmem.h", "ASHMEM_UNPIN", _IOC_WRITE, 0x7708, 0x08 },
+{ "staging/android/ion.h", "ION_IOC_ALLOC", _IOC_READ|_IOC_WRITE, 0x4900, 0x18 },
+{ "staging/android/ion.h", "ION_IOC_HEAP_QUERY", _IOC_READ|_IOC_WRITE, 0x4908, 0x18 },
+{ "video/da8xx-fb.h", "FBIGET_BRIGHTNESS", _IOC_READ, 0x4603, 0x04 },
+{ "video/da8xx-fb.h", "FBIGET_COLOR", _IOC_READ, 0x4605, 0x04 },
+{ "video/da8xx-fb.h", "FBIOGET_CONTRAST", _IOC_READ, 0x4601, 0x04 },
+{ "video/da8xx-fb.h", "FBIOPUT_CONTRAST", _IOC_WRITE, 0x4602, 0x04 },
+{ "video/da8xx-fb.h", "FBIPUT_BRIGHTNESS", _IOC_WRITE, 0x4603, 0x04 },
+{ "video/da8xx-fb.h", "FBIPUT_COLOR", _IOC_WRITE, 0x4606, 0x04 },
+{ "video/da8xx-fb.h", "FBIPUT_HSYNC", _IOC_WRITE, 0x4609, 0x04 },
+{ "video/da8xx-fb.h", "FBIPUT_VSYNC", _IOC_WRITE, 0x460a, 0x04 },
+{ "video/kyro.h", "KYRO_IOCTL_OVERLAY_CREATE", _IOC_NONE, 0x6b00, 0x00 },
+{ "video/kyro.h", "KYRO_IOCTL_OVERLAY_OFFSET", _IOC_NONE, 0x6b04, 0x00 },
+{ "video/kyro.h", "KYRO_IOCTL_OVERLAY_VIEWPORT_SET", _IOC_NONE, 0x6b01, 0x00 },
+{ "video/kyro.h", "KYRO_IOCTL_SET_VIDEO_MODE", _IOC_NONE, 0x6b02, 0x00 },
+{ "video/kyro.h", "KYRO_IOCTL_STRIDE", _IOC_NONE, 0x6b05, 0x00 },
+{ "video/kyro.h", "KYRO_IOCTL_UVSTRIDE", _IOC_NONE, 0x6b03, 0x00 },
+{ "video/sisfb.h", "SISFB_COMMAND", _IOC_READ|_IOC_WRITE, 0xf305, 0x54 },
+{ "video/sisfb.h", "SISFB_GET_AUTOMAXIMIZE", _IOC_READ, 0xf303, 0x04 },
+{ "video/sisfb.h", "SISFB_GET_AUTOMAXIMIZE_OLD", _IOC_READ, 0x6efa, 0x04 },
+{ "video/sisfb.h", "SISFB_GET_INFO", _IOC_READ, 0xf301, 0x11c },
+{ "video/sisfb.h", "SISFB_GET_INFO_OLD", _IOC_READ, 0x6ef8, 0x04 },
+{ "video/sisfb.h", "SISFB_GET_INFO_SIZE", _IOC_READ, 0xf300, 0x04 },
+{ "video/sisfb.h", "SISFB_GET_TVPOSOFFSET", _IOC_READ, 0xf304, 0x04 },
+{ "video/sisfb.h", "SISFB_GET_VBRSTATUS", _IOC_READ, 0xf302, 0x04 },
+{ "video/sisfb.h", "SISFB_GET_VBRSTATUS_OLD", _IOC_READ, 0x6ef9, 0x04 },
+{ "video/sisfb.h", "SISFB_SET_AUTOMAXIMIZE", _IOC_WRITE, 0xf303, 0x04 },
+{ "video/sisfb.h", "SISFB_SET_AUTOMAXIMIZE_OLD", _IOC_WRITE, 0x6efa, 0x04 },
+{ "video/sisfb.h", "SISFB_SET_LOCK", _IOC_WRITE, 0xf306, 0x04 },
+{ "video/sisfb.h", "SISFB_SET_TVPOSOFFSET", _IOC_WRITE, 0xf304, 0x04 },
+{ "video/sstfb.h", "SSTFB_GET_VGAPASS", _IOC_READ, 0x46dd, 0x04 },
+{ "video/sstfb.h", "SSTFB_SET_VGAPASS", _IOC_WRITE, 0x46dd, 0x04 },
+{ "xen/evtchn.h", "IOCTL_EVTCHN_BIND_INTERDOMAIN", _IOC_NONE, 0x4501, 0x08 },
+{ "xen/evtchn.h", "IOCTL_EVTCHN_BIND_UNBOUND_PORT", _IOC_NONE, 0x4502, 0x04 },
+{ "xen/evtchn.h", "IOCTL_EVTCHN_BIND_VIRQ", _IOC_NONE, 0x4500, 0x04 },
+{ "xen/evtchn.h", "IOCTL_EVTCHN_NOTIFY", _IOC_NONE, 0x4504, 0x04 },
+{ "xen/evtchn.h", "IOCTL_EVTCHN_RESET", _IOC_NONE, 0x4505, 0x00 },
+{ "xen/evtchn.h", "IOCTL_EVTCHN_RESTRICT_DOMID", _IOC_NONE, 0x4506, 0x02 },
+{ "xen/evtchn.h", "IOCTL_EVTCHN_UNBIND", _IOC_NONE, 0x4503, 0x04 },
+{ "xen/gntdev.h", "IOCTL_GNTDEV_DMABUF_EXP_FROM_REFS", _IOC_NONE, 0x4709, 0x14 },
+{ "xen/gntdev.h", "IOCTL_GNTDEV_DMABUF_EXP_WAIT_RELEASED", _IOC_NONE, 0x470a, 0x08 },
+{ "xen/gntdev.h", "IOCTL_GNTDEV_DMABUF_IMP_RELEASE", _IOC_NONE, 0x470c, 0x08 },
+{ "xen/gntdev.h", "IOCTL_GNTDEV_DMABUF_IMP_TO_REFS", _IOC_NONE, 0x470b, 0x14 },
+{ "xen/gntdev.h", "IOCTL_GNTDEV_GET_OFFSET_FOR_VADDR", _IOC_NONE, 0x4702, 0x18 },
+{ "xen/gntdev.h", "IOCTL_GNTDEV_GRANT_COPY", _IOC_NONE, 0x4708, 0x08 },
+{ "xen/gntdev.h", "IOCTL_GNTDEV_MAP_GRANT_REF", _IOC_NONE, 0x4700, 0x18 },
+{ "xen/gntdev.h", "IOCTL_GNTDEV_SET_MAX_GRANTS", _IOC_NONE, 0x4703, 0x04 },
+{ "xen/gntdev.h", "IOCTL_GNTDEV_SET_UNMAP_NOTIFY", _IOC_NONE, 0x4707, 0x10 },
+{ "xen/gntdev.h", "IOCTL_GNTDEV_UNMAP_GRANT_REF", _IOC_NONE, 0x4701, 0x10 },
+{ "xen/xenbus_dev.h", "IOCTL_XENBUS_BACKEND_EVTCHN", _IOC_NONE, 0x4200, 0x00 },
+{ "xen/xenbus_dev.h", "IOCTL_XENBUS_BACKEND_SETUP", _IOC_NONE, 0x4201, 0x00 },
diff --git a/src/linux/x32/ioctls_inc1.h b/src/linux/x32/ioctls_inc1.h
new file mode 100644
index 000000000..c9fcdf8fa
--- /dev/null
+++ b/src/linux/x32/ioctls_inc1.h
@@ -0,0 +1 @@
+#include "i386/ioctls_inc0.h"
diff --git a/src/linux/x32/ptrace_pokeuser.c b/src/linux/x32/ptrace_pokeuser.c
new file mode 100644
index 000000000..a4e70ffbe
--- /dev/null
+++ b/src/linux/x32/ptrace_pokeuser.c
@@ -0,0 +1,17 @@
+/*
+ * Copyright (c) 2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static long
+ptrace_pokeuser(int pid, unsigned long off, kernel_ulong_t val)
+{
+ /*
+ * As PTRACE_POKEUSER is crippled on x32 by design from the very first
+ * linux kernel commit v3.4-rc1~33^2~2 when it was introduced,
+ * workaround this by using the raw x86_64 syscall instead.
+ */
+ return syscall(101, PTRACE_POKEUSER, pid, off, val);
+}
diff --git a/src/linux/x32/raw_syscall.h b/src/linux/x32/raw_syscall.h
new file mode 100644
index 000000000..6582aa8f1
--- /dev/null
+++ b/src/linux/x32/raw_syscall.h
@@ -0,0 +1 @@
+#include "x86_64/raw_syscall.h"
diff --git a/src/linux/x32/rt_sigframe.h b/src/linux/x32/rt_sigframe.h
new file mode 100644
index 000000000..8452e890f
--- /dev/null
+++ b/src/linux/x32/rt_sigframe.h
@@ -0,0 +1 @@
+#include "x86_64/rt_sigframe.h"
diff --git a/src/linux/x32/set_error.c b/src/linux/x32/set_error.c
new file mode 100644
index 000000000..66a732718
--- /dev/null
+++ b/src/linux/x32/set_error.c
@@ -0,0 +1 @@
+#include "x86_64/set_error.c"
diff --git a/src/linux/x32/set_scno.c b/src/linux/x32/set_scno.c
new file mode 100644
index 000000000..5f7cdb4bc
--- /dev/null
+++ b/src/linux/x32/set_scno.c
@@ -0,0 +1 @@
+#include "x86_64/set_scno.c"
diff --git a/src/linux/x32/shuffle_scno.c b/src/linux/x32/shuffle_scno.c
new file mode 100644
index 000000000..0e1abb303
--- /dev/null
+++ b/src/linux/x32/shuffle_scno.c
@@ -0,0 +1,15 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+kernel_ulong_t
+shuffle_scno(kernel_ulong_t scno)
+{
+ if (current_personality == 0 && scno != (kernel_ulong_t) -1)
+ scno ^= __X32_SYSCALL_BIT;
+
+ return scno;
+}
diff --git a/src/linux/x32/syscallent.h b/src/linux/x32/syscallent.h
new file mode 100644
index 000000000..3c7fa0b52
--- /dev/null
+++ b/src/linux/x32/syscallent.h
@@ -0,0 +1,384 @@
+/*
+ * Copyright (c) 2012-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+[ 0] = { 3, TD, SEN(read), "read" },
+[ 1] = { 3, TD, SEN(write), "write" },
+[ 2] = { 3, TD|TF, SEN(open), "open" },
+[ 3] = { 1, TD, SEN(close), "close" },
+[ 4] = { 2, TF|TST|TSTA, SEN(stat), "stat" },
+[ 5] = { 2, TD|TFST|TSTA, SEN(fstat), "fstat" },
+[ 6] = { 2, TF|TLST|TSTA, SEN(lstat), "lstat" },
+[ 7] = { 3, TD, SEN(poll_time64), "poll" },
+[ 8] = { 3, TD, SEN(lseek), "lseek" },
+[ 9] = { 6, TD|TM|SI, SEN(mmap), "mmap" },
+[ 10] = { 3, TM|SI, SEN(mprotect), "mprotect" },
+[ 11] = { 2, TM|SI, SEN(munmap), "munmap" },
+[ 12] = { 1, TM|SI, SEN(brk), "brk" },
+[ 13] = { 4, TS, SEN(printargs), "rt_sigaction#64" },
+[ 14] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" },
+[ 15] = { 0, TS, SEN(rt_sigreturn), "rt_sigreturn#64" },
+[ 16] = { 3, TD, SEN(printargs), "ioctl#64" },
+[ 17] = { 4, TD, SEN(pread), "pread64" },
+[ 18] = { 4, TD, SEN(pwrite), "pwrite64" },
+[ 19] = { 3, TD, SEN(printargs), "readv#64" },
+[ 20] = { 3, TD, SEN(printargs), "writev#64" },
+[ 21] = { 2, TF, SEN(access), "access" },
+[ 22] = { 1, TD, SEN(pipe), "pipe" },
+[ 23] = { 5, TD, SEN(select), "select" },
+[ 24] = { 0, 0, SEN(sched_yield), "sched_yield" },
+[ 25] = { 5, TM|SI, SEN(mremap), "mremap" },
+[ 26] = { 3, TM, SEN(msync), "msync" },
+[ 27] = { 3, TM, SEN(mincore), "mincore" },
+[ 28] = { 3, TM, SEN(madvise), "madvise" },
+[ 29] = { 3, TI, SEN(shmget), "shmget" },
+[ 30] = { 3, TI|TM|SI, SEN(shmat), "shmat" },
+[ 31] = { 3, TI, SEN(shmctl), "shmctl" },
+[ 32] = { 1, TD, SEN(dup), "dup" },
+[ 33] = { 2, TD, SEN(dup2), "dup2" },
+[ 34] = { 0, TS, SEN(pause), "pause" },
+[ 35] = { 2, 0, SEN(nanosleep_time64), "nanosleep" },
+[ 36] = { 2, 0, SEN(getitimer), "getitimer" },
+[ 37] = { 1, 0, SEN(alarm), "alarm" },
+[ 38] = { 3, 0, SEN(setitimer), "setitimer" },
+[ 39] = { 0, PU|NF, SEN(getpid), "getpid" },
+[ 40] = { 4, TD|TN, SEN(sendfile64), "sendfile" },
+[ 41] = { 3, TN, SEN(socket), "socket" },
+[ 42] = { 3, TN, SEN(connect), "connect" },
+[ 43] = { 3, TN, SEN(accept), "accept" },
+[ 44] = { 6, TN, SEN(sendto), "sendto" },
+[ 45] = { 6, TN, SEN(printargs), "recvfrom#64" },
+[ 46] = { 3, TN, SEN(printargs), "sendmsg#64" },
+[ 47] = { 3, TN, SEN(printargs), "recvmsg#64" },
+[ 48] = { 2, TN, SEN(shutdown), "shutdown" },
+[ 49] = { 3, TN, SEN(bind), "bind" },
+[ 50] = { 2, TN, SEN(listen), "listen" },
+[ 51] = { 3, TN, SEN(getsockname), "getsockname" },
+[ 52] = { 3, TN, SEN(getpeername), "getpeername" },
+[ 53] = { 4, TN, SEN(socketpair), "socketpair" },
+[ 54] = { 5, TN, SEN(printargs), "setsockopt#64" },
+[ 55] = { 5, TN, SEN(printargs), "getsockopt#64" },
+[ 56] = { 5, TP, SEN(clone), "clone" },
+[ 57] = { 0, TP, SEN(fork), "fork" },
+[ 58] = { 0, TP, SEN(vfork), "vfork" },
+[ 59] = { 3, TF|TP|SE|SI, SEN(printargs), "execve#64" },
+[ 60] = { 1, TP|SE, SEN(exit), "exit" },
+[ 61] = { 4, TP, SEN(wait4), "wait4" },
+[ 62] = { 2, TS|TP, SEN(kill), "kill" },
+[ 63] = { 1, 0, SEN(uname), "uname" },
+[ 64] = { 3, TI, SEN(semget), "semget" },
+[ 65] = { 3, TI, SEN(semop), "semop" },
+[ 66] = { 4, TI, SEN(semctl), "semctl" },
+[ 67] = { 1, TI|TM|SI, SEN(shmdt), "shmdt" },
+[ 68] = { 2, TI, SEN(msgget), "msgget" },
+[ 69] = { 4, TI, SEN(msgsnd), "msgsnd" },
+[ 70] = { 5, TI, SEN(msgrcv), "msgrcv" },
+[ 71] = { 3, TI, SEN(msgctl), "msgctl" },
+[ 72] = { 3, TD, SEN(fcntl), "fcntl" },
+[ 73] = { 2, TD, SEN(flock), "flock" },
+[ 74] = { 1, TD, SEN(fsync), "fsync" },
+[ 75] = { 1, TD, SEN(fdatasync), "fdatasync" },
+[ 76] = { 2, TF, SEN(truncate64), "truncate" },
+[ 77] = { 2, TD, SEN(ftruncate64), "ftruncate" },
+[ 78] = { 3, TD, SEN(getdents), "getdents" },
+[ 79] = { 2, TF, SEN(getcwd), "getcwd" },
+[ 80] = { 1, TF, SEN(chdir), "chdir" },
+[ 81] = { 1, TD, SEN(fchdir), "fchdir" },
+[ 82] = { 2, TF, SEN(rename), "rename" },
+[ 83] = { 2, TF, SEN(mkdir), "mkdir" },
+[ 84] = { 1, TF, SEN(rmdir), "rmdir" },
+[ 85] = { 2, TD|TF, SEN(creat), "creat" },
+[ 86] = { 2, TF, SEN(link), "link" },
+[ 87] = { 1, TF, SEN(unlink), "unlink" },
+[ 88] = { 2, TF, SEN(symlink), "symlink" },
+[ 89] = { 3, TF, SEN(readlink), "readlink" },
+[ 90] = { 2, TF, SEN(chmod), "chmod" },
+[ 91] = { 2, TD, SEN(fchmod), "fchmod" },
+[ 92] = { 3, TF, SEN(chown), "chown" },
+[ 93] = { 3, TD, SEN(fchown), "fchown" },
+[ 94] = { 3, TF, SEN(chown), "lchown" },
+[ 95] = { 1, NF, SEN(umask), "umask" },
+[ 96] = { 2, TCL, SEN(gettimeofday), "gettimeofday" },
+[ 97] = { 2, 0, SEN(getrlimit), "getrlimit" },
+[ 98] = { 2, 0, SEN(getrusage), "getrusage" },
+[ 99] = { 1, 0, SEN(sysinfo), "sysinfo" },
+[100] = { 1, 0, SEN(times), "times" },
+[101] = { 4, 0, SEN(printargs), "ptrace#64" },
+[102] = { 0, TC|PU|NF, SEN(getuid), "getuid" },
+[103] = { 3, 0, SEN(syslog), "syslog" },
+[104] = { 0, TC|PU|NF, SEN(getgid), "getgid" },
+[105] = { 1, TC, SEN(setuid), "setuid" },
+[106] = { 1, TC, SEN(setgid), "setgid" },
+[107] = { 0, TC|PU|NF, SEN(geteuid), "geteuid" },
+[108] = { 0, TC|PU|NF, SEN(getegid), "getegid" },
+[109] = { 2, 0, SEN(setpgid), "setpgid" },
+[110] = { 0, PU|NF, SEN(getppid), "getppid" },
+[111] = { 0, PU|NF, SEN(getpgrp), "getpgrp" },
+[112] = { 0, 0, SEN(setsid), "setsid" },
+[113] = { 2, TC, SEN(setreuid), "setreuid" },
+[114] = { 2, TC, SEN(setregid), "setregid" },
+[115] = { 2, TC, SEN(getgroups), "getgroups" },
+[116] = { 2, TC, SEN(setgroups), "setgroups" },
+[117] = { 3, TC, SEN(setresuid), "setresuid" },
+[118] = { 3, TC, SEN(getresuid), "getresuid" },
+[119] = { 3, TC, SEN(setresgid), "setresgid" },
+[120] = { 3, TC, SEN(getresgid), "getresgid" },
+[121] = { 1, 0, SEN(getpgid), "getpgid" },
+[122] = { 1, TC|NF, SEN(setfsuid), "setfsuid" },
+[123] = { 1, TC|NF, SEN(setfsgid), "setfsgid" },
+[124] = { 1, 0, SEN(getsid), "getsid" },
+[125] = { 2, TC, SEN(capget), "capget" },
+[126] = { 2, TC, SEN(capset), "capset" },
+[127] = { 2, TS, SEN(printargs), "rt_sigpending#64" },
+[128] = { 4, TS, SEN(printargs), "rt_sigtimedwait#64" },
+[129] = { 3, TS|TP, SEN(printargs), "rt_sigqueueinfo#64" },
+[130] = { 2, TS, SEN(rt_sigsuspend), "rt_sigsuspend" },
+[131] = { 2, TS, SEN(printargs), "sigaltstack#64" },
+[132] = { 2, TF, SEN(utime), "utime" },
+[133] = { 3, TF, SEN(mknod), "mknod" },
+[134] = { 1, TF, SEN(printargs), "uselib#64" },
+[135] = { 1, NF, SEN(personality), "personality" },
+[136] = { 2, TSFA, SEN(ustat), "ustat" },
+[137] = { 2, TF|TSF|TSFA, SEN(statfs), "statfs" },
+[138] = { 2, TD|TFSF|TSFA, SEN(fstatfs), "fstatfs" },
+[139] = { 3, 0, SEN(sysfs), "sysfs" },
+[140] = { 2, 0, SEN(getpriority), "getpriority" },
+[141] = { 3, 0, SEN(setpriority), "setpriority" },
+[142] = { 2, 0, SEN(sched_setparam), "sched_setparam" },
+[143] = { 2, 0, SEN(sched_getparam), "sched_getparam" },
+[144] = { 3, 0, SEN(sched_setscheduler), "sched_setscheduler" },
+[145] = { 1, 0, SEN(sched_getscheduler), "sched_getscheduler" },
+[146] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"},
+[147] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"},
+[148] = { 2, 0, SEN(sched_rr_get_interval_time64),"sched_rr_get_interval"},
+[149] = { 2, TM, SEN(mlock), "mlock" },
+[150] = { 2, TM, SEN(munlock), "munlock" },
+[151] = { 1, TM, SEN(mlockall), "mlockall" },
+[152] = { 0, TM, SEN(munlockall), "munlockall" },
+[153] = { 0, 0, SEN(vhangup), "vhangup" },
+[154] = { 3, 0, SEN(modify_ldt), "modify_ldt" },
+[155] = { 2, TF, SEN(pivotroot), "pivot_root" },
+[156] = { 1, 0, SEN(printargs), "_sysctl#64" },
+[157] = { 5, TC, SEN(prctl), "prctl" },
+[158] = { 2, 0, SEN(arch_prctl), "arch_prctl" },
+[159] = { 1, TCL, SEN(adjtimex64), "adjtimex" },
+[160] = { 2, 0, SEN(setrlimit), "setrlimit" },
+[161] = { 1, TF, SEN(chroot), "chroot" },
+[162] = { 0, 0, SEN(sync), "sync" },
+[163] = { 1, TF, SEN(acct), "acct" },
+[164] = { 2, TCL, SEN(settimeofday), "settimeofday" },
+[165] = { 5, TF, SEN(mount), "mount" },
+[166] = { 2, TF, SEN(umount2), "umount2" },
+[167] = { 2, TF, SEN(swapon), "swapon" },
+[168] = { 1, TF, SEN(swapoff), "swapoff" },
+[169] = { 4, 0, SEN(reboot), "reboot" },
+[170] = { 2, 0, SEN(sethostname), "sethostname" },
+[171] = { 2, 0, SEN(setdomainname), "setdomainname" },
+[172] = { 1, 0, SEN(iopl), "iopl" },
+[173] = { 3, 0, SEN(ioperm), "ioperm" },
+[174] = { 2, 0, SEN(printargs), "create_module#64" },
+[175] = { 3, 0, SEN(init_module), "init_module" },
+[176] = { 2, 0, SEN(delete_module), "delete_module" },
+[177] = { 1, 0, SEN(printargs), "get_kernel_syms#64" },
+[178] = { 5, 0, SEN(printargs), "query_module#64" },
+[179] = { 4, TF, SEN(quotactl), "quotactl" },
+[180] = { 3, 0, SEN(printargs), "nfsservctl#64" },
+[181] = { 5, TN, SEN(getpmsg), "getpmsg" },
+[182] = { 5, TN, SEN(putpmsg), "putpmsg" },
+[183] = { 5, 0, SEN(afs_syscall), "afs_syscall" },
+[184] = { 3, 0, SEN(tuxcall), "tuxcall" },
+[185] = { 3, 0, SEN(security), "security" },
+[186] = { 0, PU|NF, SEN(gettid), "gettid" },
+[187] = { 3, TD, SEN(readahead), "readahead" },
+[188] = { 5, TF, SEN(setxattr), "setxattr" },
+[189] = { 5, TF, SEN(setxattr), "lsetxattr" },
+[190] = { 5, TD, SEN(fsetxattr), "fsetxattr" },
+[191] = { 4, TF, SEN(getxattr), "getxattr" },
+[192] = { 4, TF, SEN(getxattr), "lgetxattr" },
+[193] = { 4, TD, SEN(fgetxattr), "fgetxattr" },
+[194] = { 3, TF, SEN(listxattr), "listxattr" },
+[195] = { 3, TF, SEN(listxattr), "llistxattr" },
+[196] = { 3, TD, SEN(flistxattr), "flistxattr" },
+[197] = { 2, TF, SEN(removexattr), "removexattr" },
+[198] = { 2, TF, SEN(removexattr), "lremovexattr" },
+[199] = { 2, TD, SEN(fremovexattr), "fremovexattr" },
+[200] = { 2, TS|TP, SEN(tkill), "tkill" },
+[201] = { 1, TCL, SEN(time), "time" },
+[202] = { 6, 0, SEN(futex_time64), "futex" },
+[203] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" },
+[204] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" },
+[205] = { 1, 0, SEN(printargs), "set_thread_area#64" },
+[206] = { 2, TM, SEN(printargs), "io_setup#64" },
+[207] = { 1, TM, SEN(io_destroy), "io_destroy" },
+[208] = { 5, 0, SEN(io_getevents_time64), "io_getevents" },
+[209] = { 3, 0, SEN(printargs), "io_submit#64" },
+[210] = { 3, 0, SEN(io_cancel), "io_cancel" },
+[211] = { 1, 0, SEN(printargs), "get_thread_area#64" },
+[212] = { 3, 0, SEN(lookup_dcookie), "lookup_dcookie" },
+[213] = { 1, TD, SEN(epoll_create), "epoll_create" },
+[214] = { 4, 0, SEN(printargs), "epoll_ctl_old#64" },
+[215] = { 4, 0, SEN(printargs), "epoll_wait_old#64" },
+[216] = { 5, TM|SI, SEN(remap_file_pages), "remap_file_pages" },
+[217] = { 3, TD, SEN(getdents64), "getdents64" },
+[218] = { 1, 0, SEN(set_tid_address), "set_tid_address" },
+[219] = { 0, 0, SEN(restart_syscall), "restart_syscall" },
+[220] = { 4, TI, SEN(semtimedop_time64), "semtimedop" },
+[221] = { 4, TD, SEN(fadvise64), "fadvise64" },
+[222] = { 3, 0, SEN(printargs), "timer_create#64" },
+[223] = { 4, 0, SEN(timer_settime64), "timer_settime" },
+[224] = { 2, 0, SEN(timer_gettime64), "timer_gettime" },
+[225] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" },
+[226] = { 1, 0, SEN(timer_delete), "timer_delete" },
+[227] = { 2, TCL, SEN(clock_settime64), "clock_settime" },
+[228] = { 2, TCL, SEN(clock_gettime64), "clock_gettime" },
+[229] = { 2, TCL, SEN(clock_getres_time64), "clock_getres" },
+[230] = { 4, 0, SEN(clock_nanosleep_time64), "clock_nanosleep" },
+[231] = { 1, TP|SE, SEN(exit), "exit_group" },
+[232] = { 4, TD, SEN(epoll_wait), "epoll_wait" },
+[233] = { 4, TD, SEN(epoll_ctl), "epoll_ctl" },
+[234] = { 3, TS|TP, SEN(tgkill), "tgkill" },
+[235] = { 2, TF, SEN(utimes), "utimes" },
+[236] = { 5, 0, SEN(printargs), "vserver#64" },
+[237] = { 6, TM, SEN(mbind), "mbind" },
+[238] = { 3, TM, SEN(set_mempolicy), "set_mempolicy" },
+[239] = { 5, TM, SEN(get_mempolicy), "get_mempolicy" },
+[240] = { 4, TD, SEN(mq_open), "mq_open" },
+[241] = { 1, 0, SEN(mq_unlink), "mq_unlink" },
+[242] = { 5, TD, SEN(mq_timedsend_time64), "mq_timedsend" },
+[243] = { 5, TD, SEN(mq_timedreceive_time64), "mq_timedreceive" },
+[244] = { 2, 0, SEN(printargs), "mq_notify#64" },
+[245] = { 3, TD, SEN(mq_getsetattr), "mq_getsetattr" },
+[246] = { 4, 0, SEN(printargs), "kexec_load#64" },
+[247] = { 5, TP, SEN(printargs), "waitid#64" },
+[248] = { 5, 0, SEN(add_key), "add_key" },
+[249] = { 4, 0, SEN(request_key), "request_key" },
+[250] = { 5, 0, SEN(keyctl), "keyctl" },
+[251] = { 3, 0, SEN(ioprio_set), "ioprio_set" },
+[252] = { 2, 0, SEN(ioprio_get), "ioprio_get" },
+[253] = { 0, TD, SEN(inotify_init), "inotify_init" },
+[254] = { 3, TD|TF, SEN(inotify_add_watch), "inotify_add_watch" },
+[255] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" },
+[256] = { 4, TM, SEN(migrate_pages), "migrate_pages" },
+[257] = { 4, TD|TF, SEN(openat), "openat" },
+[258] = { 3, TD|TF, SEN(mkdirat), "mkdirat" },
+[259] = { 4, TD|TF, SEN(mknodat), "mknodat" },
+[260] = { 5, TD|TF, SEN(fchownat), "fchownat" },
+[261] = { 3, TD|TF, SEN(futimesat), "futimesat" },
+[262] = { 4, TD|TF|TFST|TSTA,SEN(newfstatat), "newfstatat" },
+[263] = { 3, TD|TF, SEN(unlinkat), "unlinkat" },
+[264] = { 4, TD|TF, SEN(renameat), "renameat" },
+[265] = { 5, TD|TF, SEN(linkat), "linkat" },
+[266] = { 3, TD|TF, SEN(symlinkat), "symlinkat" },
+[267] = { 4, TD|TF, SEN(readlinkat), "readlinkat" },
+[268] = { 3, TD|TF, SEN(fchmodat), "fchmodat" },
+[269] = { 3, TD|TF, SEN(faccessat), "faccessat" },
+[270] = { 6, TD, SEN(pselect6_time64), "pselect6" },
+[271] = { 5, TD, SEN(ppoll_time64), "ppoll" },
+[272] = { 1, 0, SEN(unshare), "unshare" },
+[273] = { 2, 0, SEN(printargs), "set_robust_list#64" },
+[274] = { 3, 0, SEN(printargs), "get_robust_list#64" },
+[275] = { 6, TD, SEN(splice), "splice" },
+[276] = { 4, TD, SEN(tee), "tee" },
+[277] = { 4, TD, SEN(sync_file_range), "sync_file_range" },
+[278] = { 4, TD, SEN(printargs), "vmsplice#64" },
+[279] = { 6, TM, SEN(printargs), "move_pages#64" },
+[280] = { 4, TD|TF, SEN(utimensat_time64), "utimensat" },
+[281] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" },
+[282] = { 3, TD|TS, SEN(signalfd), "signalfd" },
+[283] = { 2, TD, SEN(timerfd_create), "timerfd_create" },
+[284] = { 1, TD, SEN(eventfd), "eventfd" },
+[285] = { 4, TD, SEN(fallocate), "fallocate" },
+[286] = { 4, TD, SEN(timerfd_settime64), "timerfd_settime" },
+[287] = { 2, TD, SEN(timerfd_gettime64), "timerfd_gettime" },
+[288] = { 4, TN, SEN(accept4), "accept4" },
+[289] = { 4, TD|TS, SEN(signalfd4), "signalfd4" },
+[290] = { 2, TD, SEN(eventfd2), "eventfd2" },
+[291] = { 1, TD, SEN(epoll_create1), "epoll_create1" },
+[292] = { 3, TD, SEN(dup3), "dup3" },
+[293] = { 2, TD, SEN(pipe2), "pipe2" },
+[294] = { 1, TD, SEN(inotify_init1), "inotify_init1" },
+[295] = { 4, TD, SEN(printargs), "preadv#64" },
+[296] = { 4, TD, SEN(printargs), "pwritev#64" },
+[297] = { 4, TP|TS, SEN(printargs), "rt_tgsigqueueinfo#64" },
+[298] = { 5, TD, SEN(perf_event_open), "perf_event_open" },
+[299] = { 5, TN, SEN(printargs), "recvmmsg#64" },
+[300] = { 2, TD, SEN(fanotify_init), "fanotify_init" },
+[301] = { 5, TD|TF, SEN(fanotify_mark), "fanotify_mark" },
+[302] = { 4, 0, SEN(prlimit64), "prlimit64" },
+[303] = { 5, TD|TF, SEN(name_to_handle_at), "name_to_handle_at" },
+[304] = { 3, TD, SEN(open_by_handle_at), "open_by_handle_at" },
+[305] = { 2, TCL, SEN(clock_adjtime64), "clock_adjtime" },
+[306] = { 1, TD, SEN(syncfs), "syncfs" },
+[307] = { 4, TN, SEN(printargs), "sendmmsg#64" },
+[308] = { 2, TD, SEN(setns), "setns" },
+[309] = { 3, 0, SEN(getcpu), "getcpu" },
+[310] = { 6, 0, SEN(printargs), "process_vm_readv#64" },
+[311] = { 6, 0, SEN(printargs), "process_vm_writev#64" },
+[312] = { 5, 0, SEN(kcmp), "kcmp" },
+[313] = { 3, TD, SEN(finit_module), "finit_module" },
+[314] = { 3, 0, SEN(sched_setattr), "sched_setattr" },
+[315] = { 4, 0, SEN(sched_getattr), "sched_getattr" },
+[316] = { 5, TD|TF, SEN(renameat2), "renameat2" },
+[317] = { 3, 0, SEN(seccomp), "seccomp" },
+[318] = { 3, 0, SEN(getrandom), "getrandom" },
+[319] = { 2, TD, SEN(memfd_create), "memfd_create" },
+[320] = { 5, TD, SEN(kexec_file_load), "kexec_file_load" },
+[321] = { 3, TD, SEN(bpf), "bpf" },
+[322] = { 5, TD|TF|TP|SE|SI, SEN(printargs), "execveat#64" },
+[323] = { 1, TD, SEN(userfaultfd), "userfaultfd" },
+[324] = { 3, 0, SEN(membarrier), "membarrier" },
+[325] = { 3, TM, SEN(mlock2), "mlock2" },
+[326] = { 6, TD, SEN(copy_file_range), "copy_file_range" },
+[327] = { 6, TD, SEN(printargs), "preadv2#64" },
+[328] = { 6, TD, SEN(printargs), "pwritev2#64" },
+[329] = { 4, TM|SI, SEN(pkey_mprotect), "pkey_mprotect" },
+[330] = { 2, 0, SEN(pkey_alloc), "pkey_alloc" },
+[331] = { 1, 0, SEN(pkey_free), "pkey_free" },
+[332] = { 5, TD|TF|TFST|TSTA,SEN(statx), "statx" },
+[333] = { 6, 0, SEN(io_pgetevents_time64), "io_pgetevents" },
+[334] = { 4, 0, SEN(rseq), "rseq" },
+/* [335 ... 423] - reserved to sync up with other architectures */
+#include "syscallent-common.h"
+/*
+ * x32-specific system call numbers start at 512 to avoid cache impact
+ * for native 64-bit operation.
+ */
+[512] = { 4, CST|TS, SEN(rt_sigaction), "rt_sigaction" },
+[513] = { 0, CST|TS, SEN(rt_sigreturn), "rt_sigreturn" },
+[514] = { 3, CST|TD, SEN(ioctl), "ioctl" },
+[515] = { 3, CST|TD, SEN(readv), "readv" },
+[516] = { 3, CST|TD, SEN(writev), "writev" },
+[517] = { 6, CST|TN, SEN(recvfrom), "recvfrom" },
+[518] = { 3, CST|TN, SEN(sendmsg), "sendmsg" },
+[519] = { 3, CST|TN, SEN(recvmsg), "recvmsg" },
+[520] = { 3, CST|TF|TP|TSD|SE|SI,SEN(execve), "execve" },
+[521] = { 4, CST, SEN(ptrace), "ptrace" },
+[522] = { 2, CST|TS, SEN(rt_sigpending), "rt_sigpending" },
+[523] = { 4, CST|TS, SEN(rt_sigtimedwait_time64), "rt_sigtimedwait" },
+[524] = { 3, CST|TS|TP, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" },
+[525] = { 2, CST|TS, SEN(sigaltstack), "sigaltstack" },
+[526] = { 3, CST, SEN(timer_create), "timer_create" },
+[527] = { 2, CST|TD, SEN(mq_notify), "mq_notify" },
+[528] = { 4, CST, SEN(kexec_load), "kexec_load" },
+[529] = { 5, CST|TP, SEN(waitid), "waitid" },
+[530] = { 2, CST, SEN(set_robust_list), "set_robust_list" },
+[531] = { 3, CST, SEN(get_robust_list), "get_robust_list" },
+[532] = { 4, CST|TD, SEN(vmsplice), "vmsplice" },
+[533] = { 6, CST|TM, SEN(move_pages), "move_pages" },
+[534] = { 4, TD, SEN(preadv), "preadv" },
+[535] = { 4, TD, SEN(pwritev), "pwritev" },
+[536] = { 4, CST|TP|TS, SEN(rt_tgsigqueueinfo), "rt_tgsigqueueinfo" },
+[537] = { 5, CST|TN, SEN(recvmmsg_time64), "recvmmsg" },
+[538] = { 4, CST|TN, SEN(sendmmsg), "sendmmsg" },
+[539] = { 6, CST, SEN(process_vm_readv), "process_vm_readv" },
+[540] = { 6, CST, SEN(process_vm_writev), "process_vm_writev" },
+[541] = { 5, CST|TN, SEN(setsockopt), "setsockopt" },
+[542] = { 5, CST|TN, SEN(getsockopt), "getsockopt" },
+[543] = { 2, CST|TM, SEN(io_setup), "io_setup" },
+[544] = { 3, CST, SEN(io_submit), "io_submit" },
+[545] = { 5, CST|TD|TF|TP|TSD|SE|SI, SEN(execveat), "execveat" },
+[546] = { 5, TD, SEN(preadv2), "preadv2" },
+[547] = { 5, TD, SEN(pwritev2), "pwritev2" },
diff --git a/src/linux/x32/syscallent1.h b/src/linux/x32/syscallent1.h
new file mode 100644
index 000000000..c9100de8a
--- /dev/null
+++ b/src/linux/x32/syscallent1.h
@@ -0,0 +1,3 @@
+/* Our second set comes from the i386 files. */
+
+#include "../i386/syscallent.h"
diff --git a/src/linux/x32/userent.h b/src/linux/x32/userent.h
new file mode 100644
index 000000000..ae69a3f7b
--- /dev/null
+++ b/src/linux/x32/userent.h
@@ -0,0 +1 @@
+#include "../x86_64/userent.h"
diff --git a/src/linux/x86_64/arch_defs_.h b/src/linux/x86_64/arch_defs_.h
new file mode 100644
index 000000000..a4daf8727
--- /dev/null
+++ b/src/linux/x86_64/arch_defs_.h
@@ -0,0 +1,18 @@
+/*
+ * Copyright (c) 2018-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#define ARCH_MX32_SIZEOF_STRUCT_MSQID64_DS 120
+#define HAVE_ARCH_OLD_MMAP 1
+#define HAVE_ARCH_OLD_SELECT 1
+#define HAVE_ARCH_UID16_SYSCALLS 1
+#define SUPPORTED_PERSONALITIES 3
+#define PERSONALITY0_AUDIT_ARCH { AUDIT_ARCH_X86_64, 0 }
+#define PERSONALITY1_AUDIT_ARCH { AUDIT_ARCH_I386, 0 }
+#define PERSONALITY2_AUDIT_ARCH { AUDIT_ARCH_X86_64, __X32_SYSCALL_BIT }
+#ifndef __X32_SYSCALL_BIT
+# define __X32_SYSCALL_BIT 0x40000000UL
+#endif
diff --git a/src/linux/x86_64/arch_get_personality.c b/src/linux/x86_64/arch_get_personality.c
new file mode 100644
index 000000000..0e5a3b4b7
--- /dev/null
+++ b/src/linux/x86_64/arch_get_personality.c
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2010-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+int
+get_personality_from_syscall_info(const struct_ptrace_syscall_info *sci)
+{
+ unsigned int pers = sci->arch == AUDIT_ARCH_I386;
+
+#ifndef X32
+ switch(sci->op) {
+ case PTRACE_SYSCALL_INFO_ENTRY:
+ case PTRACE_SYSCALL_INFO_SECCOMP:
+ break;
+ default:
+ return -1;
+ }
+
+ kernel_ulong_t scno = sci->entry.nr;
+
+ if (pers == 0 && (scno & __X32_SYSCALL_BIT)) {
+ /*
+ * Syscall number -1 requires special treatment:
+ * it might be a side effect of SECCOMP_RET_ERRNO
+ * filtering that sets orig_rax to -1
+ * in some versions of linux kernel.
+ * If that is the case, then
+ * __X32_SYSCALL_BIT logic does not apply.
+ */
+ if (scno != (kernel_ulong_t) -1)
+ pers = 2;
+ }
+#endif /* !X32 */
+
+ return pers;
+}
diff --git a/src/linux/x86_64/arch_kvm.c b/src/linux/x86_64/arch_kvm.c
new file mode 100644
index 000000000..cbc0cab87
--- /dev/null
+++ b/src/linux/x86_64/arch_kvm.c
@@ -0,0 +1,158 @@
+/*
+ * Copyright (c) 2017-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifdef HAVE_STRUCT_KVM_REGS
+static void
+arch_print_kvm_regs(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const struct kvm_regs *const regs)
+{
+ tprint_struct_begin();
+ PRINT_FIELD_X(*regs, rax);
+ tprint_struct_next();
+ if (abbrev(tcp)) {
+ tprint_more_data_follows();
+ } else {
+ PRINT_FIELD_X(*regs, rbx);
+ tprint_struct_next();
+ PRINT_FIELD_X(*regs, rcx);
+ tprint_struct_next();
+ PRINT_FIELD_X(*regs, rdx);
+ tprint_struct_next();
+ PRINT_FIELD_X(*regs, rsi);
+ tprint_struct_next();
+ PRINT_FIELD_X(*regs, rdi);
+ }
+ tprint_struct_next();
+ PRINT_FIELD_X(*regs, rsp);
+ tprint_struct_next();
+ PRINT_FIELD_X(*regs, rbp);
+ tprint_struct_next();
+ if (abbrev(tcp)) {
+ tprint_more_data_follows();
+ } else {
+ PRINT_FIELD_X(*regs, r8);
+ tprint_struct_next();
+ PRINT_FIELD_X(*regs, r9);
+ tprint_struct_next();
+ PRINT_FIELD_X(*regs, r10);
+ tprint_struct_next();
+ PRINT_FIELD_X(*regs, r11);
+ tprint_struct_next();
+ PRINT_FIELD_X(*regs, r12);
+ tprint_struct_next();
+ PRINT_FIELD_X(*regs, r13);
+ tprint_struct_next();
+ PRINT_FIELD_X(*regs, r14);
+ tprint_struct_next();
+ PRINT_FIELD_X(*regs, r15);
+ }
+ tprint_struct_next();
+ PRINT_FIELD_X(*regs, rip);
+
+ /* TODO: we can decode this more */
+ tprint_struct_next();
+ PRINT_FIELD_X(*regs, rflags);
+
+ tprint_struct_end();
+}
+#endif /* HAVE_STRUCT_KVM_REGS */
+
+#ifdef HAVE_STRUCT_KVM_SREGS
+static void
+kvm_ioctl_decode_regs_segment(const struct kvm_segment *const segment)
+{
+ tprint_struct_begin();
+ PRINT_FIELD_X(*segment, base);
+ tprint_struct_next();
+ PRINT_FIELD_U(*segment, limit);
+ tprint_struct_next();
+ PRINT_FIELD_U(*segment, selector);
+ tprint_struct_next();
+ PRINT_FIELD_U(*segment, type);
+ tprint_struct_next();
+ PRINT_FIELD_U(*segment, present);
+ tprint_struct_next();
+ PRINT_FIELD_U(*segment, dpl);
+ tprint_struct_next();
+ PRINT_FIELD_U(*segment, db);
+ tprint_struct_next();
+ PRINT_FIELD_U(*segment, s);
+ tprint_struct_next();
+ PRINT_FIELD_U(*segment, l);
+ tprint_struct_next();
+ PRINT_FIELD_U(*segment, g);
+ tprint_struct_next();
+ PRINT_FIELD_U(*segment, avl);
+ tprint_struct_end();
+}
+
+static void
+kvm_ioctl_decode_regs_dtable(const struct kvm_dtable *const dtable)
+{
+ tprint_struct_begin();
+ PRINT_FIELD_X(*dtable, base);
+ tprint_struct_next();
+ PRINT_FIELD_U(*dtable, limit);
+ tprint_struct_end();
+}
+
+# define PRINT_FIELD_KVM_SREGS_STRUCT(where_, field_, type_) \
+ PRINT_FIELD_OBJ_PTR(where_, field_, \
+ kvm_ioctl_decode_regs_ ## type_)
+
+static void
+arch_print_kvm_sregs(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const struct kvm_sregs *const sregs)
+{
+ tprint_struct_begin();
+ PRINT_FIELD_KVM_SREGS_STRUCT(*sregs, cs, segment);
+ if (abbrev(tcp)) {
+ tprint_struct_next();
+ tprint_more_data_follows();
+ tprint_struct_end();
+ return;
+ }
+
+ tprint_struct_next();
+ PRINT_FIELD_KVM_SREGS_STRUCT(*sregs, ds, segment);
+ tprint_struct_next();
+ PRINT_FIELD_KVM_SREGS_STRUCT(*sregs, es, segment);
+ tprint_struct_next();
+ PRINT_FIELD_KVM_SREGS_STRUCT(*sregs, fs, segment);
+ tprint_struct_next();
+ PRINT_FIELD_KVM_SREGS_STRUCT(*sregs, gs, segment);
+ tprint_struct_next();
+ PRINT_FIELD_KVM_SREGS_STRUCT(*sregs, ss, segment);
+ tprint_struct_next();
+ PRINT_FIELD_KVM_SREGS_STRUCT(*sregs, tr, segment);
+ tprint_struct_next();
+ PRINT_FIELD_KVM_SREGS_STRUCT(*sregs, ldt, segment);
+ tprint_struct_next();
+ PRINT_FIELD_KVM_SREGS_STRUCT(*sregs, gdt, dtable);
+ tprint_struct_next();
+ PRINT_FIELD_KVM_SREGS_STRUCT(*sregs, idt, dtable);
+ tprint_struct_next();
+ PRINT_FIELD_U(*sregs, cr0);
+ tprint_struct_next();
+ PRINT_FIELD_U(*sregs, cr2);
+ tprint_struct_next();
+ PRINT_FIELD_U(*sregs, cr3);
+ tprint_struct_next();
+ PRINT_FIELD_U(*sregs, cr4);
+ tprint_struct_next();
+ PRINT_FIELD_U(*sregs, cr8);
+ tprint_struct_next();
+ PRINT_FIELD_U(*sregs, efer);
+ tprint_struct_next();
+ PRINT_FIELD_X(*sregs, apic_base);
+ tprint_struct_next();
+ PRINT_FIELD_X_ARRAY(*sregs, interrupt_bitmap);
+ tprint_struct_end();
+}
+#endif /* HAVE_STRUCT_KVM_SREGS */
diff --git a/src/linux/x86_64/arch_regs.c b/src/linux/x86_64/arch_regs.c
new file mode 100644
index 000000000..8878569e4
--- /dev/null
+++ b/src/linux/x86_64/arch_regs.c
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+/*
+ * On i386, pt_regs and user_regs_struct are the same,
+ * but on 64 bit x86, user_regs_struct has six more fields:
+ * fs_base, gs_base, ds, es, fs, gs.
+ * PTRACE_GETREGS fills them too, so struct pt_regs would overflow.
+ */
+struct i386_user_regs_struct {
+ uint32_t ebx;
+ uint32_t ecx;
+ uint32_t edx;
+ uint32_t esi;
+ uint32_t edi;
+ uint32_t ebp;
+ uint32_t eax;
+ uint32_t xds;
+ uint32_t xes;
+ uint32_t xfs;
+ uint32_t xgs;
+ uint32_t orig_eax;
+ uint32_t eip;
+ uint32_t xcs;
+ uint32_t eflags;
+ uint32_t esp;
+ uint32_t xss;
+};
+static union {
+ struct user_regs_struct x86_64_r;
+ struct i386_user_regs_struct i386_r;
+} x86_regs_union;
+#define x86_64_regs x86_regs_union.x86_64_r
+#define i386_regs x86_regs_union.i386_r
+
+static struct iovec x86_io = {
+ .iov_base = &x86_regs_union
+};
+
+#define ARCH_REGS_FOR_GETREGSET x86_regs_union
+#define ARCH_IOVEC_FOR_GETREGSET x86_io
+#define ARCH_PC_REG \
+ (x86_io.iov_len == sizeof(i386_regs) ? i386_regs.eip : x86_64_regs.rip)
+#define ARCH_SP_REG \
+ (x86_io.iov_len == sizeof(i386_regs) ? i386_regs.esp : x86_64_regs.rsp)
+
+#undef ARCH_MIGHT_USE_SET_REGS
+#define ARCH_MIGHT_USE_SET_REGS 0
diff --git a/src/linux/x86_64/arch_regs.h b/src/linux/x86_64/arch_regs.h
new file mode 100644
index 000000000..08824f220
--- /dev/null
+++ b/src/linux/x86_64/arch_regs.h
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+/* <asm/ptrace.h> does not provide these definitions. */
+#define R15 0
+#define R14 1
+#define R13 2
+#define R12 3
+#define RBP 4
+#define RBX 5
+#define R11 6
+#define R10 7
+#define R9 8
+#define R8 9
+#define RAX 10
+#define RCX 11
+#define RDX 12
+#define RSI 13
+#define RDI 14
+#define ORIG_RAX 15
+#define RIP 16
+#define CS 17
+#define EFLAGS 18
+#define RSP 19
+#define SS 20
+#define FS_BASE 21
+#define GS_BASE 22
+#define DS 23
+#define ES 24
+#define FS 25
+#define GS 26
diff --git a/src/linux/x86_64/arch_rt_sigframe.c b/src/linux/x86_64/arch_rt_sigframe.c
new file mode 100644
index 000000000..bb60b44d4
--- /dev/null
+++ b/src/linux/x86_64/arch_rt_sigframe.c
@@ -0,0 +1 @@
+#include "i386/arch_rt_sigframe.c"
diff --git a/src/linux/x86_64/arch_sigreturn.c b/src/linux/x86_64/arch_sigreturn.c
new file mode 100644
index 000000000..9f4f0d879
--- /dev/null
+++ b/src/linux/x86_64/arch_sigreturn.c
@@ -0,0 +1,2 @@
+/* Only x86 personality has old sigreturn syscall. */
+#include "i386/arch_sigreturn.c"
diff --git a/src/linux/x86_64/asm_stat.h b/src/linux/x86_64/asm_stat.h
new file mode 100644
index 000000000..91dd1aafc
--- /dev/null
+++ b/src/linux/x86_64/asm_stat.h
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_X86_64_ASM_STAT_H
+# define STRACE_X86_64_ASM_STAT_H
+
+# if defined __x86_64__ && defined __ILP32__
+# define stat redirect_kernel_stat
+# endif
+
+# include "linux/asm_stat.h"
+
+# if defined __x86_64__ && defined __ILP32__
+# undef stat
+/*
+ * This is a replacement for x32 <asm/stat.h> which
+ * appears to be wrong in older kernel headers.
+ */
+struct stat {
+ kernel_ulong_t st_dev;
+ kernel_ulong_t st_ino;
+ kernel_ulong_t st_nlink;
+ unsigned int st_mode;
+ unsigned int st_uid;
+ unsigned int st_gid;
+ unsigned int pad0__;
+ kernel_ulong_t st_rdev;
+ kernel_long_t st_size;
+ kernel_long_t st_blksize;
+ kernel_long_t st_blocks;
+ kernel_ulong_t st_atime;
+ kernel_ulong_t st_atime_nsec;
+ kernel_ulong_t st_mtime;
+ kernel_ulong_t st_mtime_nsec;
+ kernel_ulong_t st_ctime;
+ kernel_ulong_t st_ctime_nsec;
+ kernel_long_t pad1__[3];
+};
+
+# endif /* __x86_64__ && __ILP32__ */
+
+#endif /* !STRACE_X86_64_ASM_STAT_H */
diff --git a/src/linux/x86_64/get_error.c b/src/linux/x86_64/get_error.c
new file mode 100644
index 000000000..92b1a8446
--- /dev/null
+++ b/src/linux/x86_64/get_error.c
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "negated_errno.h"
+
+static void
+arch_get_error(struct tcb *tcp, const bool check_errno)
+{
+ /*
+ * In X32, return value is 64-bit (llseek uses one).
+ * Using merely "long rax" would not work.
+ */
+ long long rax;
+
+ if (x86_io.iov_len == sizeof(i386_regs)) {
+ /* Sign extend from 32 bits */
+ rax = (int32_t) i386_regs.eax;
+ } else {
+ rax = x86_64_regs.rax;
+ }
+
+ if (check_errno && is_negated_errno(rax)) {
+ tcp->u_rval = -1;
+ tcp->u_error = -rax;
+ } else {
+ if (x86_io.iov_len == sizeof(i386_regs))
+ tcp->u_rval = (uint32_t) rax;
+ else
+ tcp->u_rval = rax;
+ }
+}
diff --git a/src/linux/x86_64/get_scno.c b/src/linux/x86_64/get_scno.c
new file mode 100644
index 000000000..aab27ace3
--- /dev/null
+++ b/src/linux/x86_64/get_scno.c
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2002 Andi Kleen <ak@suse.de>
+ * Copyright (c) 2002 Michal Ludvig <mludvig@suse.cz>
+ * Copyright (c) 2002 Roland McGrath <roland@redhat.com>
+ * Copyright (c) 2008-2013 Denys Vlasenko <vda.linux@googlemail.com>
+ * Copyright (c) 2012 H.J. Lu <hongjiu.lu@intel.com>
+ * Copyright (c) 2010-2015 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2015-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+/* Return codes: 1 - ok, 0 - ignore, other - error. */
+static int
+arch_get_scno(struct tcb *tcp)
+{
+ kernel_ulong_t scno = 0;
+ unsigned int currpers;
+
+ /*
+ * GETREGSET of NT_PRSTATUS tells us regset size,
+ * which unambiguously detects i386.
+ *
+ * Linux kernel distinguishes x86-64 and x32 processes
+ * solely by looking at __X32_SYSCALL_BIT:
+ * arch/x86/include/asm/compat.h::is_x32_task():
+ * if (task_pt_regs(current)->orig_ax & __X32_SYSCALL_BIT)
+ * return true;
+ */
+ if (x86_io.iov_len == sizeof(i386_regs)) {
+ scno = i386_regs.orig_eax;
+ currpers = 1;
+ } else {
+ scno = x86_64_regs.orig_rax;
+ currpers = 0;
+ if (scno & __X32_SYSCALL_BIT) {
+ /*
+ * Syscall number -1 requires special treatment:
+ * it might be a side effect of SECCOMP_RET_ERRNO
+ * filtering that sets orig_rax to -1
+ * in some versions of linux kernel.
+ * If that is the case, then
+ * __X32_SYSCALL_BIT logic does not apply.
+ */
+ if ((long long) x86_64_regs.orig_rax != -1) {
+ currpers = 2;
+ } else {
+#ifdef X32
+ currpers = 2;
+#endif
+ }
+ }
+ }
+
+#ifdef X32
+ /*
+ * If we are built for a x32 system, then personality 0 is x32
+ * (not x86_64), and stracing of x86_64 apps is not supported.
+ * Stracing of i386 apps is still supported.
+ */
+ if (currpers == 0) {
+ error_msg("syscall_%" PRI_klu "(...) in unsupported "
+ "64-bit mode of process PID=%d", scno, tcp->pid);
+ return 0;
+ }
+ currpers &= ~2; /* map 2,1 to 0,1 */
+#endif /* X32 */
+
+ update_personality(tcp, currpers);
+ tcp->scno = scno;
+ return 1;
+}
diff --git a/src/linux/x86_64/get_syscall_args.c b/src/linux/x86_64/get_syscall_args.c
new file mode 100644
index 000000000..60c6344b6
--- /dev/null
+++ b/src/linux/x86_64/get_syscall_args.c
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2015-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+/* Return -1 on error or 1 on success (never 0!). */
+static int
+arch_get_syscall_args(struct tcb *tcp)
+{
+ if (x86_io.iov_len != sizeof(i386_regs)) {
+ /* x86-64 or x32 ABI */
+ if (tcp_sysent(tcp)->sys_flags & COMPAT_SYSCALL_TYPES) {
+ /*
+ * X32 compat syscall: zero-extend from 32 bits.
+ * Use truncate_klong_to_current_wordsize(tcp->u_arg[N])
+ * in syscall handlers
+ * if you need to use *sign-extended* parameter.
+ */
+ tcp->u_arg[0] = (uint32_t) x86_64_regs.rdi;
+ tcp->u_arg[1] = (uint32_t) x86_64_regs.rsi;
+ tcp->u_arg[2] = (uint32_t) x86_64_regs.rdx;
+ tcp->u_arg[3] = (uint32_t) x86_64_regs.r10;
+ tcp->u_arg[4] = (uint32_t) x86_64_regs.r8;
+ tcp->u_arg[5] = (uint32_t) x86_64_regs.r9;
+ } else {
+ tcp->u_arg[0] = x86_64_regs.rdi;
+ tcp->u_arg[1] = x86_64_regs.rsi;
+ tcp->u_arg[2] = x86_64_regs.rdx;
+ tcp->u_arg[3] = x86_64_regs.r10;
+ tcp->u_arg[4] = x86_64_regs.r8;
+ tcp->u_arg[5] = x86_64_regs.r9;
+ }
+ } else {
+ /*
+ * i386 ABI: zero-extend from 32 bits.
+ * Use truncate_klong_to_current_wordsize(tcp->u_arg[N])
+ * in syscall handlers
+ * if you need to use *sign-extended* parameter.
+ */
+ tcp->u_arg[0] = (uint32_t) i386_regs.ebx;
+ tcp->u_arg[1] = (uint32_t) i386_regs.ecx;
+ tcp->u_arg[2] = (uint32_t) i386_regs.edx;
+ tcp->u_arg[3] = (uint32_t) i386_regs.esi;
+ tcp->u_arg[4] = (uint32_t) i386_regs.edi;
+ tcp->u_arg[5] = (uint32_t) i386_regs.ebp;
+ }
+ return 1;
+}
diff --git a/src/linux/x86_64/getregs_old.c b/src/linux/x86_64/getregs_old.c
new file mode 100644
index 000000000..50e6a46bf
--- /dev/null
+++ b/src/linux/x86_64/getregs_old.c
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2013 Denys Vlasenko <vda.linux@googlemail.com>
+ * Copyright (c) 2013-2015 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+/*
+ * PTRACE_GETREGSET was added to the kernel in v2.6.25,
+ * a PTRACE_GETREGS based fallback is provided for old kernels.
+ */
+static int
+getregs_old(struct tcb *tcp)
+{
+ /* Use old method, with unreliable heuristical detection of 32-bitness. */
+ long r = ptrace(PTRACE_GETREGS, tcp->pid, NULL, &x86_64_regs);
+ if (r)
+ return r;
+
+ if (x86_64_regs.cs == 0x23) {
+ x86_io.iov_len = sizeof(i386_regs);
+ /*
+ * The order is important: i386_regs and x86_64_regs
+ * are overlaid in memory!
+ */
+ i386_regs.ebx = x86_64_regs.rbx;
+ i386_regs.ecx = x86_64_regs.rcx;
+ i386_regs.edx = x86_64_regs.rdx;
+ i386_regs.esi = x86_64_regs.rsi;
+ i386_regs.edi = x86_64_regs.rdi;
+ i386_regs.ebp = x86_64_regs.rbp;
+ i386_regs.eax = x86_64_regs.rax;
+ /* i386_regs.xds = x86_64_regs.ds; unused by strace */
+ /* i386_regs.xes = x86_64_regs.es; ditto... */
+ /* i386_regs.xfs = x86_64_regs.fs; */
+ /* i386_regs.xgs = x86_64_regs.gs; */
+ i386_regs.orig_eax = x86_64_regs.orig_rax;
+ i386_regs.eip = x86_64_regs.rip;
+ /* i386_regs.xcs = x86_64_regs.cs; */
+ /* i386_regs.eflags = x86_64_regs.eflags; */
+ i386_regs.esp = x86_64_regs.rsp;
+ /* i386_regs.xss = x86_64_regs.ss; */
+ } else {
+ x86_io.iov_len = sizeof(x86_64_regs);
+ }
+ return 0;
+}
diff --git a/src/linux/x86_64/getregs_old.h b/src/linux/x86_64/getregs_old.h
new file mode 100644
index 000000000..de4958231
--- /dev/null
+++ b/src/linux/x86_64/getregs_old.h
@@ -0,0 +1,9 @@
+/*
+ * Copyright (c) 2016-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#define HAVE_GETREGS_OLD
+static int getregs_old(struct tcb *);
diff --git a/src/linux/x86_64/ioctls_arch0.h b/src/linux/x86_64/ioctls_arch0.h
new file mode 100644
index 000000000..5bcf9a806
--- /dev/null
+++ b/src/linux/x86_64/ioctls_arch0.h
@@ -0,0 +1,119 @@
+/* Generated by ioctls_gen.sh from definitions found in $linux/arch/x86/include/ tree. */
+{ "asm/mce.h", "MCE_GETCLEAR_FLAGS", _IOC_READ, 0x4d03, 0x04 },
+{ "asm/mce.h", "MCE_GET_LOG_LEN", _IOC_READ, 0x4d02, 0x04 },
+{ "asm/mce.h", "MCE_GET_RECORD_LEN", _IOC_READ, 0x4d01, 0x04 },
+{ "asm/msr.h", "X86_IOC_RDMSR_REGS", _IOC_READ|_IOC_WRITE, 0x63a0, 0x20 },
+{ "asm/msr.h", "X86_IOC_WRMSR_REGS", _IOC_READ|_IOC_WRITE, 0x63a1, 0x20 },
+{ "asm/mtrr.h", "MTRRIOC_ADD_ENTRY", _IOC_WRITE, 0x4d00, 0x10 },
+{ "asm/mtrr.h", "MTRRIOC_ADD_PAGE_ENTRY", _IOC_WRITE, 0x4d05, 0x10 },
+{ "asm/mtrr.h", "MTRRIOC_DEL_ENTRY", _IOC_WRITE, 0x4d02, 0x10 },
+{ "asm/mtrr.h", "MTRRIOC_DEL_PAGE_ENTRY", _IOC_WRITE, 0x4d07, 0x10 },
+{ "asm/mtrr.h", "MTRRIOC_GET_ENTRY", _IOC_READ|_IOC_WRITE, 0x4d03, 0x18 },
+{ "asm/mtrr.h", "MTRRIOC_GET_PAGE_ENTRY", _IOC_READ|_IOC_WRITE, 0x4d08, 0x18 },
+{ "asm/mtrr.h", "MTRRIOC_KILL_ENTRY", _IOC_WRITE, 0x4d04, 0x10 },
+{ "asm/mtrr.h", "MTRRIOC_KILL_PAGE_ENTRY", _IOC_WRITE, 0x4d09, 0x10 },
+{ "asm/mtrr.h", "MTRRIOC_SET_ENTRY", _IOC_WRITE, 0x4d01, 0x10 },
+{ "asm/mtrr.h", "MTRRIOC_SET_PAGE_ENTRY", _IOC_WRITE, 0x4d06, 0x10 },
+{ "linux/kvm.h", "KVM_ASSIGN_DEV_IRQ", _IOC_WRITE, 0xae70, 0x40 },
+{ "linux/kvm.h", "KVM_ASSIGN_PCI_DEVICE", _IOC_READ, 0xae69, 0x40 },
+{ "linux/kvm.h", "KVM_ASSIGN_SET_INTX_MASK", _IOC_WRITE, 0xaea4, 0x40 },
+{ "linux/kvm.h", "KVM_ASSIGN_SET_MSIX_ENTRY", _IOC_WRITE, 0xae74, 0x10 },
+{ "linux/kvm.h", "KVM_ASSIGN_SET_MSIX_NR", _IOC_WRITE, 0xae73, 0x08 },
+{ "linux/kvm.h", "KVM_CHECK_EXTENSION", _IOC_NONE, 0xae03, 0x00 },
+{ "linux/kvm.h", "KVM_CLEAR_DIRTY_LOG", _IOC_READ|_IOC_WRITE, 0xaec0, 0x18 },
+{ "linux/kvm.h", "KVM_CREATE_DEVICE", _IOC_READ|_IOC_WRITE, 0xaee0, 0x0c },
+{ "linux/kvm.h", "KVM_CREATE_IRQCHIP", _IOC_NONE, 0xae60, 0x00 },
+{ "linux/kvm.h", "KVM_CREATE_PIT", _IOC_NONE, 0xae64, 0x00 },
+{ "linux/kvm.h", "KVM_CREATE_PIT2", _IOC_WRITE, 0xae77, 0x40 },
+{ "linux/kvm.h", "KVM_CREATE_VCPU", _IOC_NONE, 0xae41, 0x00 },
+{ "linux/kvm.h", "KVM_CREATE_VM", _IOC_NONE, 0xae01, 0x00 },
+{ "linux/kvm.h", "KVM_DEASSIGN_DEV_IRQ", _IOC_WRITE, 0xae75, 0x40 },
+{ "linux/kvm.h", "KVM_DEASSIGN_PCI_DEVICE", _IOC_WRITE, 0xae72, 0x40 },
+{ "linux/kvm.h", "KVM_DIRTY_TLB", _IOC_WRITE, 0xaeaa, 0x10 },
+{ "linux/kvm.h", "KVM_ENABLE_CAP", _IOC_WRITE, 0xaea3, 0x68 },
+{ "linux/kvm.h", "KVM_GET_API_VERSION", _IOC_NONE, 0xae00, 0x00 },
+{ "linux/kvm.h", "KVM_GET_CLOCK", _IOC_READ, 0xae7c, 0x30 },
+{ "linux/kvm.h", "KVM_GET_CPUID2", _IOC_READ|_IOC_WRITE, 0xae91, 0x08 },
+{ "linux/kvm.h", "KVM_GET_DEBUGREGS", _IOC_READ, 0xaea1, 0x80 },
+{ "linux/kvm.h", "KVM_GET_DEVICE_ATTR", _IOC_WRITE, 0xaee2, 0x18 },
+{ "linux/kvm.h", "KVM_GET_DIRTY_LOG", _IOC_WRITE, 0xae42, 0x10 },
+{ "linux/kvm.h", "KVM_GET_EMULATED_CPUID", _IOC_READ|_IOC_WRITE, 0xae09, 0x08 },
+{ "linux/kvm.h", "KVM_GET_FPU", _IOC_READ, 0xae8c, 0x1a0 },
+{ "linux/kvm.h", "KVM_GET_IRQCHIP", _IOC_READ|_IOC_WRITE, 0xae62, 0x208 },
+{ "linux/kvm.h", "KVM_GET_LAPIC", _IOC_READ, 0xae8e, 0x400 },
+{ "linux/kvm.h", "KVM_GET_MP_STATE", _IOC_READ, 0xae98, 0x04 },
+{ "linux/kvm.h", "KVM_GET_MSRS", _IOC_READ|_IOC_WRITE, 0xae88, 0x08 },
+{ "linux/kvm.h", "KVM_GET_MSR_FEATURE_INDEX_LIST", _IOC_READ|_IOC_WRITE, 0xae0a, 0x04 },
+{ "linux/kvm.h", "KVM_GET_MSR_INDEX_LIST", _IOC_READ|_IOC_WRITE, 0xae02, 0x04 },
+{ "linux/kvm.h", "KVM_GET_NESTED_STATE", _IOC_READ|_IOC_WRITE, 0xaebe, 0x80 },
+{ "linux/kvm.h", "KVM_GET_NR_MMU_PAGES", _IOC_NONE, 0xae45, 0x00 },
+{ "linux/kvm.h", "KVM_GET_ONE_REG", _IOC_WRITE, 0xaeab, 0x10 },
+{ "linux/kvm.h", "KVM_GET_PIT", _IOC_READ|_IOC_WRITE, 0xae65, 0x48 },
+{ "linux/kvm.h", "KVM_GET_PIT2", _IOC_READ, 0xae9f, 0x70 },
+{ "linux/kvm.h", "KVM_GET_REGS", _IOC_READ, 0xae81, 0x90 },
+{ "linux/kvm.h", "KVM_GET_REG_LIST", _IOC_READ|_IOC_WRITE, 0xaeb0, 0x08 },
+{ "linux/kvm.h", "KVM_GET_SREGS", _IOC_READ, 0xae83, 0x138 },
+{ "linux/kvm.h", "KVM_GET_SUPPORTED_CPUID", _IOC_READ|_IOC_WRITE, 0xae05, 0x08 },
+{ "linux/kvm.h", "KVM_GET_SUPPORTED_HV_CPUID", _IOC_READ|_IOC_WRITE, 0xaec1, 0x08 },
+{ "linux/kvm.h", "KVM_GET_TSC_KHZ", _IOC_NONE, 0xaea3, 0x00 },
+{ "linux/kvm.h", "KVM_GET_VCPU_EVENTS", _IOC_READ, 0xae9f, 0x40 },
+{ "linux/kvm.h", "KVM_GET_VCPU_MMAP_SIZE", _IOC_NONE, 0xae04, 0x00 },
+{ "linux/kvm.h", "KVM_GET_XCRS", _IOC_READ, 0xaea6, 0x188 },
+{ "linux/kvm.h", "KVM_GET_XSAVE", _IOC_READ, 0xaea4, 0x1000 },
+{ "linux/kvm.h", "KVM_HAS_DEVICE_ATTR", _IOC_WRITE, 0xaee3, 0x18 },
+{ "linux/kvm.h", "KVM_HYPERV_EVENTFD", _IOC_WRITE, 0xaebd, 0x18 },
+{ "linux/kvm.h", "KVM_INTERRUPT", _IOC_WRITE, 0xae86, 0x04 },
+{ "linux/kvm.h", "KVM_IOEVENTFD", _IOC_WRITE, 0xae79, 0x40 },
+{ "linux/kvm.h", "KVM_IRQFD", _IOC_WRITE, 0xae76, 0x20 },
+{ "linux/kvm.h", "KVM_IRQ_LINE", _IOC_WRITE, 0xae61, 0x08 },
+{ "linux/kvm.h", "KVM_IRQ_LINE_STATUS", _IOC_READ|_IOC_WRITE, 0xae67, 0x08 },
+{ "linux/kvm.h", "KVM_KVMCLOCK_CTRL", _IOC_NONE, 0xaead, 0x00 },
+{ "linux/kvm.h", "KVM_MEMORY_ENCRYPT_OP", _IOC_READ|_IOC_WRITE, 0xaeba, 0x08 },
+{ "linux/kvm.h", "KVM_MEMORY_ENCRYPT_REG_REGION", _IOC_READ, 0xaebb, 0x10 },
+{ "linux/kvm.h", "KVM_MEMORY_ENCRYPT_UNREG_REGION", _IOC_READ, 0xaebc, 0x10 },
+{ "linux/kvm.h", "KVM_NMI", _IOC_NONE, 0xae9a, 0x00 },
+{ "linux/kvm.h", "KVM_REGISTER_COALESCED_MMIO", _IOC_WRITE, 0xae67, 0x10 },
+{ "linux/kvm.h", "KVM_REINJECT_CONTROL", _IOC_NONE, 0xae71, 0x00 },
+{ "linux/kvm.h", "KVM_RUN", _IOC_NONE, 0xae80, 0x00 },
+{ "linux/kvm.h", "KVM_SET_BOOT_CPU_ID", _IOC_NONE, 0xae78, 0x00 },
+{ "linux/kvm.h", "KVM_SET_CLOCK", _IOC_WRITE, 0xae7b, 0x30 },
+{ "linux/kvm.h", "KVM_SET_CPUID", _IOC_WRITE, 0xae8a, 0x08 },
+{ "linux/kvm.h", "KVM_SET_CPUID2", _IOC_WRITE, 0xae90, 0x08 },
+{ "linux/kvm.h", "KVM_SET_DEBUGREGS", _IOC_WRITE, 0xaea2, 0x80 },
+{ "linux/kvm.h", "KVM_SET_DEVICE_ATTR", _IOC_WRITE, 0xaee1, 0x18 },
+{ "linux/kvm.h", "KVM_SET_FPU", _IOC_WRITE, 0xae8d, 0x1a0 },
+{ "linux/kvm.h", "KVM_SET_GSI_ROUTING", _IOC_WRITE, 0xae6a, 0x08 },
+{ "linux/kvm.h", "KVM_SET_GUEST_DEBUG", _IOC_WRITE, 0xae9b, 0x48 },
+{ "linux/kvm.h", "KVM_SET_IDENTITY_MAP_ADDR", _IOC_WRITE, 0xae48, 0x08 },
+{ "linux/kvm.h", "KVM_SET_IRQCHIP", _IOC_READ, 0xae63, 0x208 },
+{ "linux/kvm.h", "KVM_SET_LAPIC", _IOC_WRITE, 0xae8f, 0x400 },
+{ "linux/kvm.h", "KVM_SET_MEMORY_ALIAS", _IOC_WRITE, 0xae43, 0x20 },
+{ "linux/kvm.h", "KVM_SET_MEMORY_REGION", _IOC_WRITE, 0xae40, 0x18 },
+{ "linux/kvm.h", "KVM_SET_MP_STATE", _IOC_WRITE, 0xae99, 0x04 },
+{ "linux/kvm.h", "KVM_SET_MSRS", _IOC_WRITE, 0xae89, 0x08 },
+{ "linux/kvm.h", "KVM_SET_NESTED_STATE", _IOC_WRITE, 0xaebf, 0x80 },
+{ "linux/kvm.h", "KVM_SET_NR_MMU_PAGES", _IOC_NONE, 0xae44, 0x00 },
+{ "linux/kvm.h", "KVM_SET_ONE_REG", _IOC_WRITE, 0xaeac, 0x10 },
+{ "linux/kvm.h", "KVM_SET_PIT", _IOC_READ, 0xae66, 0x48 },
+{ "linux/kvm.h", "KVM_SET_PIT2", _IOC_WRITE, 0xaea0, 0x70 },
+{ "linux/kvm.h", "KVM_SET_PMU_EVENT_FILTER", _IOC_WRITE, 0xaeb2, 0x20 },
+{ "linux/kvm.h", "KVM_SET_REGS", _IOC_WRITE, 0xae82, 0x90 },
+{ "linux/kvm.h", "KVM_SET_SIGNAL_MASK", _IOC_WRITE, 0xae8b, 0x04 },
+{ "linux/kvm.h", "KVM_SET_SREGS", _IOC_WRITE, 0xae84, 0x138 },
+{ "linux/kvm.h", "KVM_SET_TSC_KHZ", _IOC_NONE, 0xaea2, 0x00 },
+{ "linux/kvm.h", "KVM_SET_TSS_ADDR", _IOC_NONE, 0xae47, 0x00 },
+{ "linux/kvm.h", "KVM_SET_USER_MEMORY_REGION", _IOC_WRITE, 0xae46, 0x20 },
+{ "linux/kvm.h", "KVM_SET_VAPIC_ADDR", _IOC_WRITE, 0xae93, 0x08 },
+{ "linux/kvm.h", "KVM_SET_VCPU_EVENTS", _IOC_WRITE, 0xaea0, 0x40 },
+{ "linux/kvm.h", "KVM_SET_XCRS", _IOC_WRITE, 0xaea7, 0x188 },
+{ "linux/kvm.h", "KVM_SET_XSAVE", _IOC_WRITE, 0xaea5, 0x1000 },
+{ "linux/kvm.h", "KVM_SIGNAL_MSI", _IOC_WRITE, 0xaea5, 0x20 },
+{ "linux/kvm.h", "KVM_SMI", _IOC_NONE, 0xaeb7, 0x00 },
+{ "linux/kvm.h", "KVM_TPR_ACCESS_REPORTING", _IOC_READ|_IOC_WRITE, 0xae92, 0x28 },
+{ "linux/kvm.h", "KVM_TRANSLATE", _IOC_READ|_IOC_WRITE, 0xae85, 0x18 },
+{ "linux/kvm.h", "KVM_UNREGISTER_COALESCED_MMIO", _IOC_WRITE, 0xae68, 0x10 },
+{ "linux/kvm.h", "KVM_X86_GET_MCE_CAP_SUPPORTED", _IOC_READ, 0xae9d, 0x08 },
+{ "linux/kvm.h", "KVM_X86_SETUP_MCE", _IOC_WRITE, 0xae9c, 0x08 },
+{ "linux/kvm.h", "KVM_X86_SET_MCE", _IOC_WRITE, 0xae9e, 0x40 },
+{ "linux/kvm.h", "KVM_X86_SET_MSR_FILTER", _IOC_WRITE, 0xaec6, 0x188 },
+{ "linux/kvm.h", "KVM_XEN_HVM_CONFIG", _IOC_WRITE, 0xae7a, 0x38 },
diff --git a/src/linux/x86_64/ioctls_arch1.h b/src/linux/x86_64/ioctls_arch1.h
new file mode 100644
index 000000000..58a57064d
--- /dev/null
+++ b/src/linux/x86_64/ioctls_arch1.h
@@ -0,0 +1 @@
+#include "i386/ioctls_arch0.h"
diff --git a/src/linux/x86_64/ioctls_arch2.h b/src/linux/x86_64/ioctls_arch2.h
new file mode 100644
index 000000000..41d00f92a
--- /dev/null
+++ b/src/linux/x86_64/ioctls_arch2.h
@@ -0,0 +1 @@
+#include "ioctls_arch0.h"
diff --git a/src/linux/x86_64/ioctls_inc0.h b/src/linux/x86_64/ioctls_inc0.h
new file mode 100644
index 000000000..f9939faa4
--- /dev/null
+++ b/src/linux/x86_64/ioctls_inc0.h
@@ -0,0 +1 @@
+#include "64/ioctls_inc.h"
diff --git a/src/linux/x86_64/ioctls_inc1.h b/src/linux/x86_64/ioctls_inc1.h
new file mode 100644
index 000000000..c9fcdf8fa
--- /dev/null
+++ b/src/linux/x86_64/ioctls_inc1.h
@@ -0,0 +1 @@
+#include "i386/ioctls_inc0.h"
diff --git a/src/linux/x86_64/ioctls_inc2.h b/src/linux/x86_64/ioctls_inc2.h
new file mode 100644
index 000000000..974966444
--- /dev/null
+++ b/src/linux/x86_64/ioctls_inc2.h
@@ -0,0 +1 @@
+#include "x32/ioctls_inc0.h"
diff --git a/src/linux/x86_64/raw_syscall.h b/src/linux/x86_64/raw_syscall.h
new file mode 100644
index 000000000..66c3eaf97
--- /dev/null
+++ b/src/linux/x86_64/raw_syscall.h
@@ -0,0 +1,28 @@
+/*
+ * Raw syscalls.
+ *
+ * Copyright (c) 2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_RAW_SYSCALL_H
+# define STRACE_RAW_SYSCALL_H
+
+# include "kernel_types.h"
+
+static inline kernel_ulong_t
+raw_syscall_0(const kernel_ulong_t nr, kernel_ulong_t *err)
+{
+ *err = 0;
+ kernel_ulong_t ret;
+ __asm__ __volatile__("syscall"
+ : "=a"(ret)
+ : "a"(nr)
+ : "memory", "cc", "rcx", "r11");
+ return ret;
+}
+# define raw_syscall_0 raw_syscall_0
+
+#endif /* !STRACE_RAW_SYSCALL_H */
diff --git a/src/linux/x86_64/rt_sigframe.h b/src/linux/x86_64/rt_sigframe.h
new file mode 100644
index 000000000..afb0221ba
--- /dev/null
+++ b/src/linux/x86_64/rt_sigframe.h
@@ -0,0 +1,23 @@
+/*
+ * Copyright (c) 2017-2018 Dmitry V. Levin <ldv@strace.io>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifdef __i386__
+# include "i386/rt_sigframe.h"
+#else
+# ifndef STRACE_RT_SIGFRAME_H
+# define STRACE_RT_SIGFRAME_H
+
+# include <signal.h>
+
+typedef struct {
+ kernel_ulong_t pretcode;
+ ucontext_t uc;
+ /* more data follows */
+} struct_rt_sigframe;
+
+# endif /* !STRACE_RT_SIGFRAME_H */
+#endif /* !__i386__ */
diff --git a/src/linux/x86_64/set_error.c b/src/linux/x86_64/set_error.c
new file mode 100644
index 000000000..2c781b1d3
--- /dev/null
+++ b/src/linux/x86_64/set_error.c
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2016-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static int
+arch_set_error(struct tcb *tcp)
+{
+ kernel_ulong_t rval = -(long) tcp->u_error;
+
+ if (tcp->currpers == 1)
+ i386_regs.eax = rval;
+ else
+ x86_64_regs.rax = rval;
+
+ return upoke(tcp, 8 * RAX, rval);
+}
+
+static int
+arch_set_success(struct tcb *tcp)
+{
+ kernel_ulong_t rval = (kernel_ulong_t) tcp->u_rval;
+
+ if (tcp->currpers == 1)
+ i386_regs.eax = rval;
+ else
+ x86_64_regs.rax = rval;
+
+ return upoke(tcp, 8 * RAX, rval);
+}
diff --git a/src/linux/x86_64/set_scno.c b/src/linux/x86_64/set_scno.c
new file mode 100644
index 000000000..51242c481
--- /dev/null
+++ b/src/linux/x86_64/set_scno.c
@@ -0,0 +1,12 @@
+/*
+ * Copyright (c) 2016-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static int
+arch_set_scno(struct tcb *tcp, kernel_ulong_t scno)
+{
+ return upoke(tcp, 8 * ORIG_RAX, scno);
+}
diff --git a/src/linux/x86_64/shuffle_scno.c b/src/linux/x86_64/shuffle_scno.c
new file mode 100644
index 000000000..6b688345f
--- /dev/null
+++ b/src/linux/x86_64/shuffle_scno.c
@@ -0,0 +1,15 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+kernel_ulong_t
+shuffle_scno(kernel_ulong_t scno)
+{
+ if (current_personality == 2)
+ scno ^= __X32_SYSCALL_BIT;
+
+ return scno;
+}
diff --git a/src/linux/x86_64/syscallent.h b/src/linux/x86_64/syscallent.h
new file mode 100644
index 000000000..2f01fab55
--- /dev/null
+++ b/src/linux/x86_64/syscallent.h
@@ -0,0 +1,344 @@
+/*
+ * Copyright (c) 2002-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+[ 0] = { 3, TD, SEN(read), "read" },
+[ 1] = { 3, TD, SEN(write), "write" },
+[ 2] = { 3, TD|TF, SEN(open), "open" },
+[ 3] = { 1, TD, SEN(close), "close" },
+[ 4] = { 2, TF|TST|TSTA, SEN(stat), "stat" },
+[ 5] = { 2, TD|TFST|TSTA, SEN(fstat), "fstat" },
+[ 6] = { 2, TF|TLST|TSTA, SEN(lstat), "lstat" },
+[ 7] = { 3, TD, SEN(poll_time64), "poll" },
+[ 8] = { 3, TD, SEN(lseek), "lseek" },
+[ 9] = { 6, TD|TM|SI, SEN(mmap), "mmap" },
+[ 10] = { 3, TM|SI, SEN(mprotect), "mprotect" },
+[ 11] = { 2, TM|SI, SEN(munmap), "munmap" },
+[ 12] = { 1, TM|SI, SEN(brk), "brk" },
+[ 13] = { 4, TS, SEN(rt_sigaction), "rt_sigaction" },
+[ 14] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" },
+[ 15] = { 0, TS, SEN(rt_sigreturn), "rt_sigreturn" },
+[ 16] = { 3, TD, SEN(ioctl), "ioctl" },
+[ 17] = { 4, TD, SEN(pread), "pread64" },
+[ 18] = { 4, TD, SEN(pwrite), "pwrite64" },
+[ 19] = { 3, TD, SEN(readv), "readv" },
+[ 20] = { 3, TD, SEN(writev), "writev" },
+[ 21] = { 2, TF, SEN(access), "access" },
+[ 22] = { 1, TD, SEN(pipe), "pipe" },
+[ 23] = { 5, TD, SEN(select), "select" },
+[ 24] = { 0, 0, SEN(sched_yield), "sched_yield" },
+[ 25] = { 5, TM|SI, SEN(mremap), "mremap" },
+[ 26] = { 3, TM, SEN(msync), "msync" },
+[ 27] = { 3, TM, SEN(mincore), "mincore" },
+[ 28] = { 3, TM, SEN(madvise), "madvise" },
+[ 29] = { 3, TI, SEN(shmget), "shmget" },
+[ 30] = { 3, TI|TM|SI, SEN(shmat), "shmat" },
+[ 31] = { 3, TI, SEN(shmctl), "shmctl" },
+[ 32] = { 1, TD, SEN(dup), "dup" },
+[ 33] = { 2, TD, SEN(dup2), "dup2" },
+[ 34] = { 0, TS, SEN(pause), "pause" },
+[ 35] = { 2, 0, SEN(nanosleep_time64), "nanosleep" },
+[ 36] = { 2, 0, SEN(getitimer), "getitimer" },
+[ 37] = { 1, 0, SEN(alarm), "alarm" },
+[ 38] = { 3, 0, SEN(setitimer), "setitimer" },
+[ 39] = { 0, PU|NF, SEN(getpid), "getpid" },
+[ 40] = { 4, TD|TN, SEN(sendfile64), "sendfile" },
+[ 41] = { 3, TN, SEN(socket), "socket" },
+[ 42] = { 3, TN, SEN(connect), "connect" },
+[ 43] = { 3, TN, SEN(accept), "accept" },
+[ 44] = { 6, TN, SEN(sendto), "sendto" },
+[ 45] = { 6, TN, SEN(recvfrom), "recvfrom" },
+[ 46] = { 3, TN, SEN(sendmsg), "sendmsg" },
+[ 47] = { 3, TN, SEN(recvmsg), "recvmsg" },
+[ 48] = { 2, TN, SEN(shutdown), "shutdown" },
+[ 49] = { 3, TN, SEN(bind), "bind" },
+[ 50] = { 2, TN, SEN(listen), "listen" },
+[ 51] = { 3, TN, SEN(getsockname), "getsockname" },
+[ 52] = { 3, TN, SEN(getpeername), "getpeername" },
+[ 53] = { 4, TN, SEN(socketpair), "socketpair" },
+[ 54] = { 5, TN, SEN(setsockopt), "setsockopt" },
+[ 55] = { 5, TN, SEN(getsockopt), "getsockopt" },
+[ 56] = { 5, TP, SEN(clone), "clone" },
+[ 57] = { 0, TP, SEN(fork), "fork" },
+[ 58] = { 0, TP, SEN(vfork), "vfork" },
+[ 59] = { 3, TF|TP|TSD|SE|SI, SEN(execve), "execve" },
+[ 60] = { 1, TP|SE, SEN(exit), "exit" },
+[ 61] = { 4, TP, SEN(wait4), "wait4" },
+[ 62] = { 2, TS|TP, SEN(kill), "kill" },
+[ 63] = { 1, 0, SEN(uname), "uname" },
+[ 64] = { 3, TI, SEN(semget), "semget" },
+[ 65] = { 3, TI, SEN(semop), "semop" },
+[ 66] = { 4, TI, SEN(semctl), "semctl" },
+[ 67] = { 1, TI|TM|SI, SEN(shmdt), "shmdt" },
+[ 68] = { 2, TI, SEN(msgget), "msgget" },
+[ 69] = { 4, TI, SEN(msgsnd), "msgsnd" },
+[ 70] = { 5, TI, SEN(msgrcv), "msgrcv" },
+[ 71] = { 3, TI, SEN(msgctl), "msgctl" },
+[ 72] = { 3, TD, SEN(fcntl), "fcntl" },
+[ 73] = { 2, TD, SEN(flock), "flock" },
+[ 74] = { 1, TD, SEN(fsync), "fsync" },
+[ 75] = { 1, TD, SEN(fdatasync), "fdatasync" },
+[ 76] = { 2, TF, SEN(truncate), "truncate" },
+[ 77] = { 2, TD, SEN(ftruncate), "ftruncate" },
+[ 78] = { 3, TD, SEN(getdents), "getdents" },
+[ 79] = { 2, TF, SEN(getcwd), "getcwd" },
+[ 80] = { 1, TF, SEN(chdir), "chdir" },
+[ 81] = { 1, TD, SEN(fchdir), "fchdir" },
+[ 82] = { 2, TF, SEN(rename), "rename" },
+[ 83] = { 2, TF, SEN(mkdir), "mkdir" },
+[ 84] = { 1, TF, SEN(rmdir), "rmdir" },
+[ 85] = { 2, TD|TF, SEN(creat), "creat" },
+[ 86] = { 2, TF, SEN(link), "link" },
+[ 87] = { 1, TF, SEN(unlink), "unlink" },
+[ 88] = { 2, TF, SEN(symlink), "symlink" },
+[ 89] = { 3, TF, SEN(readlink), "readlink" },
+[ 90] = { 2, TF, SEN(chmod), "chmod" },
+[ 91] = { 2, TD, SEN(fchmod), "fchmod" },
+[ 92] = { 3, TF, SEN(chown), "chown" },
+[ 93] = { 3, TD, SEN(fchown), "fchown" },
+[ 94] = { 3, TF, SEN(chown), "lchown" },
+[ 95] = { 1, NF, SEN(umask), "umask" },
+[ 96] = { 2, TCL, SEN(gettimeofday), "gettimeofday" },
+[ 97] = { 2, 0, SEN(getrlimit), "getrlimit" },
+[ 98] = { 2, 0, SEN(getrusage), "getrusage" },
+[ 99] = { 1, 0, SEN(sysinfo), "sysinfo" },
+[100] = { 1, 0, SEN(times), "times" },
+[101] = { 4, 0, SEN(ptrace), "ptrace" },
+[102] = { 0, TC|PU|NF, SEN(getuid), "getuid" },
+[103] = { 3, 0, SEN(syslog), "syslog" },
+[104] = { 0, TC|PU|NF, SEN(getgid), "getgid" },
+[105] = { 1, TC, SEN(setuid), "setuid" },
+[106] = { 1, TC, SEN(setgid), "setgid" },
+[107] = { 0, TC|PU|NF, SEN(geteuid), "geteuid" },
+[108] = { 0, TC|PU|NF, SEN(getegid), "getegid" },
+[109] = { 2, 0, SEN(setpgid), "setpgid" },
+[110] = { 0, PU|NF, SEN(getppid), "getppid" },
+[111] = { 0, PU|NF, SEN(getpgrp), "getpgrp" },
+[112] = { 0, 0, SEN(setsid), "setsid" },
+[113] = { 2, TC, SEN(setreuid), "setreuid" },
+[114] = { 2, TC, SEN(setregid), "setregid" },
+[115] = { 2, TC, SEN(getgroups), "getgroups" },
+[116] = { 2, TC, SEN(setgroups), "setgroups" },
+[117] = { 3, TC, SEN(setresuid), "setresuid" },
+[118] = { 3, TC, SEN(getresuid), "getresuid" },
+[119] = { 3, TC, SEN(setresgid), "setresgid" },
+[120] = { 3, TC, SEN(getresgid), "getresgid" },
+[121] = { 1, 0, SEN(getpgid), "getpgid" },
+[122] = { 1, TC|NF, SEN(setfsuid), "setfsuid" },
+[123] = { 1, TC|NF, SEN(setfsgid), "setfsgid" },
+[124] = { 1, 0, SEN(getsid), "getsid" },
+[125] = { 2, TC, SEN(capget), "capget" },
+[126] = { 2, TC, SEN(capset), "capset" },
+[127] = { 2, TS, SEN(rt_sigpending), "rt_sigpending" },
+[128] = { 4, TS, SEN(rt_sigtimedwait_time64), "rt_sigtimedwait" },
+[129] = { 3, TS|TP, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" },
+[130] = { 2, TS, SEN(rt_sigsuspend), "rt_sigsuspend" },
+[131] = { 2, TS, SEN(sigaltstack), "sigaltstack" },
+[132] = { 2, TF, SEN(utime), "utime" },
+[133] = { 3, TF, SEN(mknod), "mknod" },
+[134] = { 1, TF, SEN(uselib), "uselib" },
+[135] = { 1, NF, SEN(personality), "personality" },
+[136] = { 2, TSFA, SEN(ustat), "ustat" },
+[137] = { 2, TF|TSF|TSFA, SEN(statfs), "statfs" },
+[138] = { 2, TD|TFSF|TSFA, SEN(fstatfs), "fstatfs" },
+[139] = { 3, 0, SEN(sysfs), "sysfs" },
+[140] = { 2, 0, SEN(getpriority), "getpriority" },
+[141] = { 3, 0, SEN(setpriority), "setpriority" },
+[142] = { 2, 0, SEN(sched_setparam), "sched_setparam" },
+[143] = { 2, 0, SEN(sched_getparam), "sched_getparam" },
+[144] = { 3, 0, SEN(sched_setscheduler), "sched_setscheduler" },
+[145] = { 1, 0, SEN(sched_getscheduler), "sched_getscheduler" },
+[146] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"},
+[147] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"},
+[148] = { 2, 0, SEN(sched_rr_get_interval_time64),"sched_rr_get_interval"},
+[149] = { 2, TM, SEN(mlock), "mlock" },
+[150] = { 2, TM, SEN(munlock), "munlock" },
+[151] = { 1, TM, SEN(mlockall), "mlockall" },
+[152] = { 0, TM, SEN(munlockall), "munlockall" },
+[153] = { 0, 0, SEN(vhangup), "vhangup" },
+[154] = { 3, 0, SEN(modify_ldt), "modify_ldt" },
+[155] = { 2, TF, SEN(pivotroot), "pivot_root" },
+[156] = { 1, 0, SEN(sysctl), "_sysctl" },
+[157] = { 5, TC, SEN(prctl), "prctl" },
+[158] = { 2, 0, SEN(arch_prctl), "arch_prctl" },
+[159] = { 1, TCL, SEN(adjtimex64), "adjtimex" },
+[160] = { 2, 0, SEN(setrlimit), "setrlimit" },
+[161] = { 1, TF, SEN(chroot), "chroot" },
+[162] = { 0, 0, SEN(sync), "sync" },
+[163] = { 1, TF, SEN(acct), "acct" },
+[164] = { 2, TCL, SEN(settimeofday), "settimeofday" },
+[165] = { 5, TF, SEN(mount), "mount" },
+[166] = { 2, TF, SEN(umount2), "umount2" },
+[167] = { 2, TF, SEN(swapon), "swapon" },
+[168] = { 1, TF, SEN(swapoff), "swapoff" },
+[169] = { 4, 0, SEN(reboot), "reboot" },
+[170] = { 2, 0, SEN(sethostname), "sethostname" },
+[171] = { 2, 0, SEN(setdomainname), "setdomainname" },
+[172] = { 1, 0, SEN(iopl), "iopl" },
+[173] = { 3, 0, SEN(ioperm), "ioperm" },
+[174] = { 2, 0, SEN(create_module), "create_module" },
+[175] = { 3, 0, SEN(init_module), "init_module" },
+[176] = { 2, 0, SEN(delete_module), "delete_module" },
+[177] = { 1, 0, SEN(get_kernel_syms), "get_kernel_syms" },
+[178] = { 5, 0, SEN(query_module), "query_module" },
+[179] = { 4, TF, SEN(quotactl), "quotactl" },
+[180] = { 3, 0, SEN(nfsservctl), "nfsservctl" },
+[181] = { 5, TN, SEN(getpmsg), "getpmsg" },
+[182] = { 5, TN, SEN(putpmsg), "putpmsg" },
+[183] = { 5, 0, SEN(afs_syscall), "afs_syscall" },
+[184] = { 3, 0, SEN(tuxcall), "tuxcall" },
+[185] = { 3, 0, SEN(security), "security" },
+[186] = { 0, PU|NF, SEN(gettid), "gettid" },
+[187] = { 3, TD, SEN(readahead), "readahead" },
+[188] = { 5, TF, SEN(setxattr), "setxattr" },
+[189] = { 5, TF, SEN(setxattr), "lsetxattr" },
+[190] = { 5, TD, SEN(fsetxattr), "fsetxattr" },
+[191] = { 4, TF, SEN(getxattr), "getxattr" },
+[192] = { 4, TF, SEN(getxattr), "lgetxattr" },
+[193] = { 4, TD, SEN(fgetxattr), "fgetxattr" },
+[194] = { 3, TF, SEN(listxattr), "listxattr" },
+[195] = { 3, TF, SEN(listxattr), "llistxattr" },
+[196] = { 3, TD, SEN(flistxattr), "flistxattr" },
+[197] = { 2, TF, SEN(removexattr), "removexattr" },
+[198] = { 2, TF, SEN(removexattr), "lremovexattr" },
+[199] = { 2, TD, SEN(fremovexattr), "fremovexattr" },
+[200] = { 2, TS|TP, SEN(tkill), "tkill" },
+[201] = { 1, TCL, SEN(time), "time" },
+[202] = { 6, 0, SEN(futex_time64), "futex" },
+[203] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" },
+[204] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" },
+[205] = { 1, 0, SEN(set_thread_area), "set_thread_area" },
+[206] = { 2, TM, SEN(io_setup), "io_setup" },
+[207] = { 1, TM, SEN(io_destroy), "io_destroy" },
+[208] = { 5, 0, SEN(io_getevents_time64), "io_getevents" },
+[209] = { 3, 0, SEN(io_submit), "io_submit" },
+[210] = { 3, 0, SEN(io_cancel), "io_cancel" },
+[211] = { 1, 0, SEN(get_thread_area), "get_thread_area" },
+[212] = { 3, 0, SEN(lookup_dcookie), "lookup_dcookie" },
+[213] = { 1, TD, SEN(epoll_create), "epoll_create" },
+[214] = { 4, 0, SEN(printargs), "epoll_ctl_old" },
+[215] = { 4, 0, SEN(printargs), "epoll_wait_old" },
+[216] = { 5, TM|SI, SEN(remap_file_pages), "remap_file_pages" },
+[217] = { 3, TD, SEN(getdents64), "getdents64" },
+[218] = { 1, 0, SEN(set_tid_address), "set_tid_address" },
+[219] = { 0, 0, SEN(restart_syscall), "restart_syscall" },
+[220] = { 4, TI, SEN(semtimedop_time64), "semtimedop" },
+[221] = { 4, TD, SEN(fadvise64), "fadvise64" },
+[222] = { 3, 0, SEN(timer_create), "timer_create" },
+[223] = { 4, 0, SEN(timer_settime64), "timer_settime" },
+[224] = { 2, 0, SEN(timer_gettime64), "timer_gettime" },
+[225] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" },
+[226] = { 1, 0, SEN(timer_delete), "timer_delete" },
+[227] = { 2, TCL, SEN(clock_settime64), "clock_settime" },
+[228] = { 2, TCL, SEN(clock_gettime64), "clock_gettime" },
+[229] = { 2, TCL, SEN(clock_getres_time64), "clock_getres" },
+[230] = { 4, 0, SEN(clock_nanosleep_time64), "clock_nanosleep" },
+[231] = { 1, TP|SE, SEN(exit), "exit_group" },
+[232] = { 4, TD, SEN(epoll_wait), "epoll_wait" },
+[233] = { 4, TD, SEN(epoll_ctl), "epoll_ctl" },
+[234] = { 3, TS|TP, SEN(tgkill), "tgkill" },
+[235] = { 2, TF, SEN(utimes), "utimes" },
+[236] = { 5, 0, SEN(vserver), "vserver" },
+[237] = { 6, TM, SEN(mbind), "mbind" },
+[238] = { 3, TM, SEN(set_mempolicy), "set_mempolicy" },
+[239] = { 5, TM, SEN(get_mempolicy), "get_mempolicy" },
+[240] = { 4, TD, SEN(mq_open), "mq_open" },
+[241] = { 1, 0, SEN(mq_unlink), "mq_unlink" },
+[242] = { 5, TD, SEN(mq_timedsend_time64), "mq_timedsend" },
+[243] = { 5, TD, SEN(mq_timedreceive_time64), "mq_timedreceive" },
+[244] = { 2, TD, SEN(mq_notify), "mq_notify" },
+[245] = { 3, TD, SEN(mq_getsetattr), "mq_getsetattr" },
+[246] = { 4, 0, SEN(kexec_load), "kexec_load" },
+[247] = { 5, TP, SEN(waitid), "waitid" },
+[248] = { 5, 0, SEN(add_key), "add_key" },
+[249] = { 4, 0, SEN(request_key), "request_key" },
+[250] = { 5, 0, SEN(keyctl), "keyctl" },
+[251] = { 3, 0, SEN(ioprio_set), "ioprio_set" },
+[252] = { 2, 0, SEN(ioprio_get), "ioprio_get" },
+[253] = { 0, TD, SEN(inotify_init), "inotify_init" },
+[254] = { 3, TD|TF, SEN(inotify_add_watch), "inotify_add_watch" },
+[255] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" },
+[256] = { 4, TM, SEN(migrate_pages), "migrate_pages" },
+[257] = { 4, TD|TF, SEN(openat), "openat" },
+[258] = { 3, TD|TF, SEN(mkdirat), "mkdirat" },
+[259] = { 4, TD|TF, SEN(mknodat), "mknodat" },
+[260] = { 5, TD|TF, SEN(fchownat), "fchownat" },
+[261] = { 3, TD|TF, SEN(futimesat), "futimesat" },
+[262] = { 4, TD|TF|TFST|TSTA,SEN(newfstatat), "newfstatat" },
+[263] = { 3, TD|TF, SEN(unlinkat), "unlinkat" },
+[264] = { 4, TD|TF, SEN(renameat), "renameat" },
+[265] = { 5, TD|TF, SEN(linkat), "linkat" },
+[266] = { 3, TD|TF, SEN(symlinkat), "symlinkat" },
+[267] = { 4, TD|TF, SEN(readlinkat), "readlinkat" },
+[268] = { 3, TD|TF, SEN(fchmodat), "fchmodat" },
+[269] = { 3, TD|TF, SEN(faccessat), "faccessat" },
+[270] = { 6, TD, SEN(pselect6_time64), "pselect6" },
+[271] = { 5, TD, SEN(ppoll_time64), "ppoll" },
+[272] = { 1, 0, SEN(unshare), "unshare" },
+[273] = { 2, 0, SEN(set_robust_list), "set_robust_list" },
+[274] = { 3, 0, SEN(get_robust_list), "get_robust_list" },
+[275] = { 6, TD, SEN(splice), "splice" },
+[276] = { 4, TD, SEN(tee), "tee" },
+[277] = { 4, TD, SEN(sync_file_range), "sync_file_range" },
+[278] = { 4, TD, SEN(vmsplice), "vmsplice" },
+[279] = { 6, TM, SEN(move_pages), "move_pages" },
+[280] = { 4, TD|TF, SEN(utimensat_time64), "utimensat" },
+[281] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" },
+[282] = { 3, TD|TS, SEN(signalfd), "signalfd" },
+[283] = { 2, TD, SEN(timerfd_create), "timerfd_create" },
+[284] = { 1, TD, SEN(eventfd), "eventfd" },
+[285] = { 4, TD, SEN(fallocate), "fallocate" },
+[286] = { 4, TD, SEN(timerfd_settime64), "timerfd_settime" },
+[287] = { 2, TD, SEN(timerfd_gettime64), "timerfd_gettime" },
+[288] = { 4, TN, SEN(accept4), "accept4" },
+[289] = { 4, TD|TS, SEN(signalfd4), "signalfd4" },
+[290] = { 2, TD, SEN(eventfd2), "eventfd2" },
+[291] = { 1, TD, SEN(epoll_create1), "epoll_create1" },
+[292] = { 3, TD, SEN(dup3), "dup3" },
+[293] = { 2, TD, SEN(pipe2), "pipe2" },
+[294] = { 1, TD, SEN(inotify_init1), "inotify_init1" },
+[295] = { 4, TD, SEN(preadv), "preadv" },
+[296] = { 4, TD, SEN(pwritev), "pwritev" },
+[297] = { 4, TP|TS, SEN(rt_tgsigqueueinfo), "rt_tgsigqueueinfo" },
+[298] = { 5, TD, SEN(perf_event_open), "perf_event_open" },
+[299] = { 5, TN, SEN(recvmmsg_time64), "recvmmsg" },
+[300] = { 2, TD, SEN(fanotify_init), "fanotify_init" },
+[301] = { 5, TD|TF, SEN(fanotify_mark), "fanotify_mark" },
+[302] = { 4, 0, SEN(prlimit64), "prlimit64" },
+[303] = { 5, TD|TF, SEN(name_to_handle_at), "name_to_handle_at" },
+[304] = { 3, TD, SEN(open_by_handle_at), "open_by_handle_at" },
+[305] = { 2, TCL, SEN(clock_adjtime64), "clock_adjtime" },
+[306] = { 1, TD, SEN(syncfs), "syncfs" },
+[307] = { 4, TN, SEN(sendmmsg), "sendmmsg" },
+[308] = { 2, TD, SEN(setns), "setns" },
+[309] = { 3, 0, SEN(getcpu), "getcpu" },
+[310] = { 6, 0, SEN(process_vm_readv), "process_vm_readv" },
+[311] = { 6, 0, SEN(process_vm_writev), "process_vm_writev" },
+[312] = { 5, 0, SEN(kcmp), "kcmp" },
+[313] = { 3, TD, SEN(finit_module), "finit_module" },
+[314] = { 3, 0, SEN(sched_setattr), "sched_setattr" },
+[315] = { 4, 0, SEN(sched_getattr), "sched_getattr" },
+[316] = { 5, TD|TF, SEN(renameat2), "renameat2" },
+[317] = { 3, 0, SEN(seccomp), "seccomp" },
+[318] = { 3, 0, SEN(getrandom), "getrandom" },
+[319] = { 2, TD, SEN(memfd_create), "memfd_create" },
+[320] = { 5, TD, SEN(kexec_file_load), "kexec_file_load" },
+[321] = { 3, TD, SEN(bpf), "bpf" },
+[322] = { 5, TD|TF|TP|TSD|SE|SI, SEN(execveat), "execveat" },
+[323] = { 1, TD, SEN(userfaultfd), "userfaultfd" },
+[324] = { 3, 0, SEN(membarrier), "membarrier" },
+[325] = { 3, TM, SEN(mlock2), "mlock2" },
+[326] = { 6, TD, SEN(copy_file_range), "copy_file_range" },
+[327] = { 6, TD, SEN(preadv2), "preadv2" },
+[328] = { 6, TD, SEN(pwritev2), "pwritev2" },
+[329] = { 4, TM|SI, SEN(pkey_mprotect), "pkey_mprotect" },
+[330] = { 2, 0, SEN(pkey_alloc), "pkey_alloc" },
+[331] = { 1, 0, SEN(pkey_free), "pkey_free" },
+[332] = { 5, TD|TF|TFST|TSTA,SEN(statx), "statx" },
+[333] = { 6, 0, SEN(io_pgetevents_time64), "io_pgetevents" },
+[334] = { 4, 0, SEN(rseq), "rseq" },
+/* [335 ... 423] - reserved to sync up with other architectures */
+#include "syscallent-common.h"
diff --git a/src/linux/x86_64/syscallent1.h b/src/linux/x86_64/syscallent1.h
new file mode 100644
index 000000000..c9100de8a
--- /dev/null
+++ b/src/linux/x86_64/syscallent1.h
@@ -0,0 +1,3 @@
+/* Our second set comes from the i386 files. */
+
+#include "../i386/syscallent.h"
diff --git a/src/linux/x86_64/syscallent2.h b/src/linux/x86_64/syscallent2.h
new file mode 100644
index 000000000..5e0df5328
--- /dev/null
+++ b/src/linux/x86_64/syscallent2.h
@@ -0,0 +1,2 @@
+/* x32 personality */
+#include "../x32/syscallent.h"
diff --git a/src/linux/x86_64/userent.h b/src/linux/x86_64/userent.h
new file mode 100644
index 000000000..a8eab7d57
--- /dev/null
+++ b/src/linux/x86_64/userent.h
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2014-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+XLAT(8*R15),
+XLAT(8*R14),
+XLAT(8*R13),
+XLAT(8*R12),
+XLAT(8*RBP),
+XLAT(8*RBX),
+XLAT(8*R11),
+XLAT(8*R10),
+XLAT(8*R9),
+XLAT(8*R8),
+XLAT(8*RAX),
+XLAT(8*RCX),
+XLAT(8*RDX),
+XLAT(8*RSI),
+XLAT(8*RDI),
+XLAT(8*ORIG_RAX),
+XLAT(8*RIP),
+XLAT(8*CS),
+{ 8*EFLAGS, "8*EFL" },
+XLAT(8*RSP),
+XLAT(8*SS),
+/* Other fields in "struct user" */
+#include "../i386/userent0.h"
diff --git a/src/linux/xtensa/arch_regs.c b/src/linux/xtensa/arch_regs.c
new file mode 100644
index 000000000..dfcc31507
--- /dev/null
+++ b/src/linux/xtensa/arch_regs.c
@@ -0,0 +1,11 @@
+/*
+ * Copyright (c) 2015-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static struct user_pt_regs xtensa_regs;
+#define ARCH_REGS_FOR_GETREGS xtensa_regs
+#define ARCH_PC_REG xtensa_regs.pc
+#define ARCH_SP_REG xtensa_regs.a[1]
diff --git a/src/linux/xtensa/get_error.c b/src/linux/xtensa/get_error.c
new file mode 100644
index 000000000..70e6fa19a
--- /dev/null
+++ b/src/linux/xtensa/get_error.c
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2015-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "negated_errno.h"
+
+static void
+arch_get_error(struct tcb *tcp, const bool check_errno)
+{
+ if (check_errno && is_negated_errno(xtensa_regs.a[2])) {
+ tcp->u_rval = -1;
+ tcp->u_error = -xtensa_regs.a[2];
+ } else {
+ tcp->u_rval = xtensa_regs.a[2];
+ }
+}
diff --git a/src/linux/xtensa/get_scno.c b/src/linux/xtensa/get_scno.c
new file mode 100644
index 000000000..f8edf9f2b
--- /dev/null
+++ b/src/linux/xtensa/get_scno.c
@@ -0,0 +1,13 @@
+/*
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+/* Return codes: 1 - ok, 0 - ignore, other - error. */
+static int
+arch_get_scno(struct tcb *tcp)
+{
+ return upeek(tcp, SYSCALL_NR, &tcp->scno) < 0 ? -1 : 1;
+}
diff --git a/src/linux/xtensa/get_syscall_args.c b/src/linux/xtensa/get_syscall_args.c
new file mode 100644
index 000000000..7bdc19850
--- /dev/null
+++ b/src/linux/xtensa/get_syscall_args.c
@@ -0,0 +1,17 @@
+/*
+ * Copyright (c) 2015-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+/* Return -1 on error or 1 on success (never 0!). */
+static int
+arch_get_syscall_args(struct tcb *tcp)
+{
+ static const unsigned int syscall_regs[MAX_ARGS] = { 6, 3, 4, 5, 8, 9 };
+
+ for (unsigned int i = 0; i < n_args(tcp); ++i)
+ tcp->u_arg[i] = xtensa_regs.a[syscall_regs[i]];
+ return 1;
+}
diff --git a/src/linux/xtensa/ioctls_arch0.h b/src/linux/xtensa/ioctls_arch0.h
new file mode 100644
index 000000000..2b8e30aaa
--- /dev/null
+++ b/src/linux/xtensa/ioctls_arch0.h
@@ -0,0 +1,67 @@
+/* Generated by ioctls_gen.sh from definitions found in $linux/arch/xtensa/include/ tree. */
+{ "asm/ioctls.h", "FIOASYNC", _IOC_WRITE, 0x667d, 0x04 },
+{ "asm/ioctls.h", "FIOCLEX", _IOC_NONE, 0x6601, 0x00 },
+{ "asm/ioctls.h", "FIONBIO", _IOC_WRITE, 0x667e, 0x04 },
+{ "asm/ioctls.h", "FIONCLEX", _IOC_NONE, 0x6602, 0x00 },
+{ "asm/ioctls.h", "FIONREAD", _IOC_READ, 0x667f, 0x04 },
+{ "asm/ioctls.h", "FIOQSIZE", _IOC_READ, 0x6680, 0x08 },
+{ "asm/ioctls.h", "TCFLSH", _IOC_NONE, 0x741f, 0x00 },
+{ "asm/ioctls.h", "TCGETS", 0, 0x5401, 0 },
+{ "asm/ioctls.h", "TCGETS2", _IOC_READ, 0x542a, 0x2c },
+{ "asm/ioctls.h", "TCSBRK", _IOC_NONE, 0x741d, 0x00 },
+{ "asm/ioctls.h", "TCSBRKP", _IOC_WRITE, 0x5425, 0x04 },
+{ "asm/ioctls.h", "TCSETS", 0, 0x5402, 0 },
+{ "asm/ioctls.h", "TCSETS2", _IOC_WRITE, 0x542b, 0x2c },
+{ "asm/ioctls.h", "TCSETSF", 0, 0x5404, 0 },
+{ "asm/ioctls.h", "TCSETSF2", _IOC_WRITE, 0x542d, 0x2c },
+{ "asm/ioctls.h", "TCSETSW", 0, 0x5403, 0 },
+{ "asm/ioctls.h", "TCSETSW2", _IOC_WRITE, 0x542c, 0x2c },
+{ "asm/ioctls.h", "TCXONC", _IOC_NONE, 0x741e, 0x00 },
+{ "asm/ioctls.h", "TIOCCBRK", _IOC_NONE, 0x5428, 0x00 },
+{ "asm/ioctls.h", "TIOCCONS", _IOC_NONE, 0x541d, 0x00 },
+{ "asm/ioctls.h", "TIOCEXCL", _IOC_NONE, 0x540c, 0x00 },
+{ "asm/ioctls.h", "TIOCGDEV", _IOC_READ, 0x5432, 0x04 },
+{ "asm/ioctls.h", "TIOCGETD", _IOC_READ, 0x5424, 0x04 },
+{ "asm/ioctls.h", "TIOCGEXCL", _IOC_READ, 0x5440, 0x04 },
+{ "asm/ioctls.h", "TIOCGICOUNT", 0, 0x545D, 0 },
+{ "asm/ioctls.h", "TIOCGLCKTRMIOS", 0, 0x5456, 0 },
+{ "asm/ioctls.h", "TIOCGPGRP", _IOC_READ, 0x7477, 0x04 },
+{ "asm/ioctls.h", "TIOCGPKT", _IOC_READ, 0x5438, 0x04 },
+{ "asm/ioctls.h", "TIOCGPTLCK", _IOC_READ, 0x5439, 0x04 },
+{ "asm/ioctls.h", "TIOCGPTN", _IOC_READ, 0x5430, 0x04 },
+{ "asm/ioctls.h", "TIOCGRS485", _IOC_READ, 0x542e, 0x20 },
+{ "asm/ioctls.h", "TIOCGSID", _IOC_READ, 0x5429, 0x04 },
+{ "asm/ioctls.h", "TIOCGSOFTCAR", _IOC_READ, 0x5419, 0x04 },
+{ "asm/ioctls.h", "TIOCLINUX", _IOC_WRITE, 0x541c, 0x01 },
+{ "asm/ioctls.h", "TIOCMBIC", _IOC_WRITE, 0x5417, 0x04 },
+{ "asm/ioctls.h", "TIOCMBIS", _IOC_WRITE, 0x5416, 0x04 },
+{ "asm/ioctls.h", "TIOCMGET", _IOC_READ, 0x5415, 0x04 },
+{ "asm/ioctls.h", "TIOCMIWAIT", _IOC_NONE, 0x545c, 0x00 },
+{ "asm/ioctls.h", "TIOCMSET", _IOC_WRITE, 0x5418, 0x04 },
+{ "asm/ioctls.h", "TIOCNOTTY", _IOC_NONE, 0x5422, 0x00 },
+{ "asm/ioctls.h", "TIOCNXCL", _IOC_NONE, 0x540d, 0x00 },
+{ "asm/ioctls.h", "TIOCOUTQ", _IOC_READ, 0x7473, 0x04 },
+{ "asm/ioctls.h", "TIOCPKT", _IOC_WRITE, 0x5420, 0x04 },
+{ "asm/ioctls.h", "TIOCSBRK", _IOC_NONE, 0x5427, 0x00 },
+{ "asm/ioctls.h", "TIOCSCTTY", _IOC_NONE, 0x540e, 0x00 },
+{ "asm/ioctls.h", "TIOCSERCONFIG", _IOC_NONE, 0x5453, 0x00 },
+{ "asm/ioctls.h", "TIOCSERGETLSR", _IOC_READ, 0x5459, 0x04 },
+{ "asm/ioctls.h", "TIOCSERGSTRUCT", 0, 0x5458, 0 },
+{ "asm/ioctls.h", "TIOCSERGWILD", _IOC_READ, 0x5454, 0x04 },
+{ "asm/ioctls.h", "TIOCSERSWILD", _IOC_WRITE, 0x5455, 0x04 },
+{ "asm/ioctls.h", "TIOCSETD", _IOC_WRITE, 0x5423, 0x04 },
+{ "asm/ioctls.h", "TIOCSIG", _IOC_WRITE, 0x5436, 0x04 },
+{ "asm/ioctls.h", "TIOCSLCKTRMIOS", 0, 0x5457, 0 },
+{ "asm/ioctls.h", "TIOCSPGRP", _IOC_WRITE, 0x7476, 0x04 },
+{ "asm/ioctls.h", "TIOCSPTLCK", _IOC_WRITE, 0x5431, 0x04 },
+{ "asm/ioctls.h", "TIOCSRS485", _IOC_READ|_IOC_WRITE, 0x542f, 0x20 },
+{ "asm/ioctls.h", "TIOCSSOFTCAR", _IOC_WRITE, 0x541a, 0x04 },
+{ "asm/ioctls.h", "TIOCSTART", _IOC_NONE, 0x746e, 0x00 },
+{ "asm/ioctls.h", "TIOCSTI", _IOC_WRITE, 0x5412, 0x01 },
+{ "asm/ioctls.h", "TIOCSTOP", _IOC_NONE, 0x746f, 0x00 },
+{ "asm/ioctls.h", "TIOCVHANGUP", _IOC_NONE, 0x5437, 0x00 },
+{ "asm/sockios.h", "FIOGETOWN", _IOC_READ, 0x667b, 0x04 },
+{ "asm/sockios.h", "FIOSETOWN", _IOC_WRITE, 0x667c, 0x04 },
+{ "asm/sockios.h", "SIOCATMARK", _IOC_READ, 0x7307, 0x04 },
+{ "asm/sockios.h", "SIOCGPGRP", _IOC_READ, 0x7309, 0x04 },
+{ "asm/sockios.h", "SIOCSPGRP", _IOC_WRITE, 0x7308, 0x04 },
diff --git a/src/linux/xtensa/ioctls_inc0.h b/src/linux/xtensa/ioctls_inc0.h
new file mode 100644
index 000000000..4aecf983e
--- /dev/null
+++ b/src/linux/xtensa/ioctls_inc0.h
@@ -0,0 +1 @@
+#include "32/ioctls_inc.h"
diff --git a/src/linux/xtensa/raw_syscall.h b/src/linux/xtensa/raw_syscall.h
new file mode 100644
index 000000000..883860ed8
--- /dev/null
+++ b/src/linux/xtensa/raw_syscall.h
@@ -0,0 +1,28 @@
+/*
+ * Raw syscalls.
+ *
+ * Copyright (c) 2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_RAW_SYSCALL_H
+# define STRACE_RAW_SYSCALL_H
+
+# include "kernel_types.h"
+
+static inline kernel_ulong_t
+raw_syscall_0(const kernel_ulong_t nr, kernel_ulong_t *err)
+{
+ *err = 0;
+ register kernel_ulong_t a2 __asm__("a2") = nr;
+ __asm__ __volatile__("syscall"
+ : "=a"(a2)
+ : "r"(a2)
+ : "memory");
+ return a2;
+}
+# define raw_syscall_0 raw_syscall_0
+
+#endif /* !STRACE_RAW_SYSCALL_H */
diff --git a/src/linux/xtensa/set_error.c b/src/linux/xtensa/set_error.c
new file mode 100644
index 000000000..8fcc658ac
--- /dev/null
+++ b/src/linux/xtensa/set_error.c
@@ -0,0 +1,20 @@
+/*
+ * Copyright (c) 2016-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static int
+arch_set_error(struct tcb *tcp)
+{
+ xtensa_regs.a[2] = -tcp->u_error;
+ return set_regs(tcp->pid);
+}
+
+static int
+arch_set_success(struct tcb *tcp)
+{
+ xtensa_regs.a[2] = tcp->u_rval;
+ return set_regs(tcp->pid);
+}
diff --git a/src/linux/xtensa/set_scno.c b/src/linux/xtensa/set_scno.c
new file mode 100644
index 000000000..8d38c13bc
--- /dev/null
+++ b/src/linux/xtensa/set_scno.c
@@ -0,0 +1,12 @@
+/*
+ * Copyright (c) 2016-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static int
+arch_set_scno(struct tcb *tcp, kernel_ulong_t scno)
+{
+ return upoke(tcp, SYSCALL_NR, scno);
+}
diff --git a/src/linux/xtensa/syscallent.h b/src/linux/xtensa/syscallent.h
new file mode 100644
index 000000000..4ff2ad88f
--- /dev/null
+++ b/src/linux/xtensa/syscallent.h
@@ -0,0 +1,353 @@
+/*
+ * Copyright (c) 2013-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+[ 0] = { 0, 0, SEN(printargs), "spill" },
+[ 1] = { 0, 0, SEN(printargs), "xtensa" },
+[ 2 ... 7] = { },
+[ 8] = { 3, TD|TF, SEN(open), "open" },
+[ 9] = { 1, TD, SEN(close), "close" },
+[ 10] = { 1, TD, SEN(dup), "dup" },
+[ 11] = { 2, TD, SEN(dup2), "dup2" },
+[ 12] = { 3, TD, SEN(read), "read" },
+[ 13] = { 3, TD, SEN(write), "write" },
+[ 14] = { 5, TD, SEN(select), "select" },
+[ 15] = { 3, TD, SEN(lseek), "lseek" },
+[ 16] = { 3, TD, SEN(poll_time32), "poll" },
+[ 17] = { 5, TD, SEN(llseek), "_llseek" },
+[ 18] = { 4, TD, SEN(epoll_wait), "epoll_wait" },
+[ 19] = { 4, TD, SEN(epoll_ctl), "epoll_ctl" },
+[ 20] = { 1, TD, SEN(epoll_create), "epoll_create" },
+[ 21] = { 2, TD|TF, SEN(creat), "creat" },
+[ 22] = { 2, TF, SEN(truncate), "truncate" },
+[ 23] = { 2, TD, SEN(ftruncate), "ftruncate" },
+[ 24] = { 3, TD, SEN(readv), "readv" },
+[ 25] = { 3, TD, SEN(writev), "writev" },
+[ 26] = { 1, TD, SEN(fsync), "fsync" },
+[ 27] = { 1, TD, SEN(fdatasync), "fdatasync" },
+[ 28] = { 4, TF, SEN(truncate64), "truncate64" },
+[ 29] = { 4, TD, SEN(ftruncate64), "ftruncate64" },
+[ 30] = { 6, TD, SEN(pread), "pread64" },
+[ 31] = { 6, TD, SEN(pwrite), "pwrite64" },
+[ 32] = { 2, TF, SEN(link), "link" },
+[ 33] = { 2, TF, SEN(rename), "rename" },
+[ 34] = { 2, TF, SEN(symlink), "symlink" },
+[ 35] = { 3, TF, SEN(readlink), "readlink" },
+[ 36] = { 3, TF, SEN(mknod), "mknod" },
+[ 37] = { 1, TD, SEN(pipe), "pipe" },
+[ 38] = { 1, TF, SEN(unlink), "unlink" },
+[ 39] = { 1, TF, SEN(rmdir), "rmdir" },
+[ 40] = { 2, TF, SEN(mkdir), "mkdir" },
+[ 41] = { 1, TF, SEN(chdir), "chdir" },
+[ 42] = { 1, TD, SEN(fchdir), "fchdir" },
+[ 43] = { 2, TF, SEN(getcwd), "getcwd" },
+[ 44] = { 2, TF, SEN(chmod), "chmod" },
+[ 45] = { 3, TF, SEN(chown), "chown" },
+[ 46] = { 2, TF|TST|TSTA, SEN(stat), "stat" },
+[ 47] = { 2, TF|TST|TSTA, SEN(stat64), "stat64" },
+[ 48] = { 3, TF, SEN(chown), "lchown" },
+[ 49] = { 2, TF|TLST|TSTA, SEN(lstat), "lstat" },
+[ 50] = { 2, TF|TLST|TSTA, SEN(lstat64), "lstat64" },
+[ 51] = { },
+[ 52] = { 2, TD, SEN(fchmod), "fchmod" },
+[ 53] = { 3, TD, SEN(fchown), "fchown" },
+[ 54] = { 2, TD|TFST|TSTA, SEN(fstat), "fstat" },
+[ 55] = { 2, TD|TFST|TSTA, SEN(fstat64), "fstat64" },
+[ 56] = { 2, TD, SEN(flock), "flock" },
+[ 57] = { 2, TF, SEN(access), "access" },
+[ 58] = { 1, NF, SEN(umask), "umask" },
+[ 59] = { 3, TD, SEN(getdents), "getdents" },
+[ 60] = { 3, TD, SEN(getdents64), "getdents64" },
+[ 61] = { 3, TD, SEN(fcntl64), "fcntl64" },
+[ 62] = { 6, TD, SEN(fallocate), "fallocate" },
+[ 63] = { 6, TD, SEN(fadvise64_64), "fadvise64_64" },
+[ 64] = { 2, TF, SEN(utime), "utime" },
+[ 65] = { 2, TF, SEN(utimes), "utimes" },
+[ 66] = { 3, TD, SEN(ioctl), "ioctl" },
+[ 67] = { 3, TD, SEN(fcntl), "fcntl" },
+[ 68] = { 5, TF, SEN(setxattr), "setxattr" },
+[ 69] = { 4, TF, SEN(getxattr), "getxattr" },
+[ 70] = { 3, TF, SEN(listxattr), "listxattr" },
+[ 71] = { 2, TF, SEN(removexattr), "removexattr" },
+[ 72] = { 5, TF, SEN(setxattr), "lsetxattr" },
+[ 73] = { 4, TF, SEN(getxattr), "lgetxattr" },
+[ 74] = { 3, TF, SEN(listxattr), "llistxattr" },
+[ 75] = { 2, TF, SEN(removexattr), "lremovexattr" },
+[ 76] = { 5, TD, SEN(fsetxattr), "fsetxattr" },
+[ 77] = { 4, TD, SEN(fgetxattr), "fgetxattr" },
+[ 78] = { 3, TD, SEN(flistxattr), "flistxattr" },
+[ 79] = { 2, TD, SEN(fremovexattr), "fremovexattr" },
+[ 80] = { 6, TD|TM|SI, SEN(mmap_pgoff), "mmap2" },
+[ 81] = { 2, TM|SI, SEN(munmap), "munmap" },
+[ 82] = { 3, TM|SI, SEN(mprotect), "mprotect" },
+[ 83] = { 1, TM|SI, SEN(brk), "brk" },
+[ 84] = { 2, TM, SEN(mlock), "mlock" },
+[ 85] = { 2, TM, SEN(munlock), "munlock" },
+[ 86] = { 1, TM, SEN(mlockall), "mlockall" },
+[ 87] = { 0, TM, SEN(munlockall), "munlockall" },
+[ 88] = { 5, TM|SI, SEN(mremap), "mremap" },
+[ 89] = { 3, TM, SEN(msync), "msync" },
+[ 90] = { 3, TM, SEN(mincore), "mincore" },
+[ 91] = { 3, TM, SEN(madvise), "madvise" },
+[ 92] = { 3, TI, SEN(shmget), "shmget" },
+[ 93] = { 3, TI|TM|SI, SEN(shmat), "shmat" },
+[ 94] = { 3, TI, SEN(shmctl), "shmctl" },
+[ 95] = { 1, TI|TM|SI, SEN(shmdt), "shmdt" },
+[ 96] = { 3, TN, SEN(socket), "socket" },
+[ 97] = { 5, TN, SEN(setsockopt), "setsockopt" },
+[ 98] = { 5, TN, SEN(getsockopt), "getsockopt" },
+[ 99] = { 2, TN, SEN(shutdown), "shutdown" },
+[100] = { 3, TN, SEN(bind), "bind" },
+[101] = { 3, TN, SEN(connect), "connect" },
+[102] = { 2, TN, SEN(listen), "listen" },
+[103] = { 3, TN, SEN(accept), "accept" },
+[104] = { 3, TN, SEN(getsockname), "getsockname" },
+[105] = { 3, TN, SEN(getpeername), "getpeername" },
+[106] = { 3, TN, SEN(sendmsg), "sendmsg" },
+[107] = { 3, TN, SEN(recvmsg), "recvmsg" },
+[108] = { 4, TN, SEN(send), "send" },
+[109] = { 4, TN, SEN(recv), "recv" },
+[110] = { 6, TN, SEN(sendto), "sendto" },
+[111] = { 6, TN, SEN(recvfrom), "recvfrom" },
+[112] = { 4, TN, SEN(socketpair), "socketpair" },
+[113] = { 4, TD|TN, SEN(sendfile), "sendfile" },
+[114] = { 4, TD|TN, SEN(sendfile64), "sendfile64" },
+[115] = { 4, TN, SEN(sendmmsg), "sendmmsg" },
+[116] = { 5, TP, SEN(clone), "clone" },
+[117] = { 3, TF|TP|TSD|SE|SI, SEN(execve), "execve" },
+[118] = { 1, TP|SE, SEN(exit), "exit" },
+[119] = { 1, TP|SE, SEN(exit), "exit_group" },
+[120] = { 0, PU|NF, SEN(getpid), "getpid" },
+[121] = { 4, TP, SEN(wait4), "wait4" },
+[122] = { 5, TP, SEN(waitid), "waitid" },
+[123] = { 2, TS|TP, SEN(kill), "kill" },
+[124] = { 2, TS|TP, SEN(tkill), "tkill" },
+[125] = { 3, TS|TP, SEN(tgkill), "tgkill" },
+[126] = { 1, 0, SEN(set_tid_address), "set_tid_address" },
+[127] = { 0, PU|NF, SEN(gettid), "gettid" },
+[128] = { 0, 0, SEN(setsid), "setsid" },
+[129] = { 1, 0, SEN(getsid), "getsid" },
+[130] = { 5, TC, SEN(prctl), "prctl" },
+[131] = { 1, NF, SEN(personality), "personality" },
+[132] = { 2, 0, SEN(getpriority), "getpriority" },
+[133] = { 3, 0, SEN(setpriority), "setpriority" },
+[134] = { 3, 0, SEN(setitimer), "setitimer" },
+[135] = { 2, 0, SEN(getitimer), "getitimer" },
+[136] = { 1, TC, SEN(setuid), "setuid" },
+[137] = { 0, TC|PU|NF, SEN(getuid), "getuid" },
+[138] = { 1, TC, SEN(setgid), "setgid" },
+[139] = { 0, TC|PU|NF, SEN(getgid), "getgid" },
+[140] = { 0, TC|PU|NF, SEN(geteuid), "geteuid" },
+[141] = { 0, TC|PU|NF, SEN(getegid), "getegid" },
+[142] = { 2, TC, SEN(setreuid), "setreuid" },
+[143] = { 2, TC, SEN(setregid), "setregid" },
+[144] = { 3, TC, SEN(setresuid), "setresuid" },
+[145] = { 3, TC, SEN(getresuid), "getresuid" },
+[146] = { 3, TC, SEN(setresgid), "setresgid" },
+[147] = { 3, TC, SEN(getresgid), "getresgid" },
+[148] = { 2, 0, SEN(setpgid), "setpgid" },
+[149] = { 1, 0, SEN(getpgid), "getpgid" },
+[150] = { 0, PU|NF, SEN(getppid), "getppid" },
+[151] = { 0, PU|NF, SEN(getpgrp), "getpgrp" },
+[152 ... 153] = { },
+[154] = { 1, 0, SEN(times), "times" },
+[155] = { 1, TF, SEN(acct), "acct" },
+[156] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" },
+[157] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" },
+[158] = { 2, TC, SEN(capget), "capget" },
+[159] = { 2, TC, SEN(capset), "capset" },
+[160] = { 4, 0, SEN(ptrace), "ptrace" },
+[161] = { 4, TI, SEN(semtimedop_time32), "semtimedop" },
+[162] = { 3, TI, SEN(semget), "semget" },
+[163] = { 3, TI, SEN(semop), "semop" },
+[164] = { 4, TI, SEN(semctl), "semctl" },
+[165] = { },
+[166] = { 2, TI, SEN(msgget), "msgget" },
+[167] = { 4, TI, SEN(msgsnd), "msgsnd" },
+[168] = { 5, TI, SEN(msgrcv), "msgrcv" },
+[169] = { 3, TI, SEN(msgctl), "msgctl" },
+[170] = { },
+[171] = { 2, TF, SEN(umount2), "umount2" },
+[172] = { 5, TF, SEN(mount), "mount" },
+[173] = { 2, TF, SEN(swapon), "swapon" },
+[174] = { 1, TF, SEN(chroot), "chroot" },
+[175] = { 2, TF, SEN(pivotroot), "pivot_root" },
+[176] = { 1, TF, SEN(umount), "umount" },
+[177] = { 1, TF, SEN(swapoff), "swapoff" },
+[178] = { 0, 0, SEN(sync), "sync" },
+[179] = { 1, TD, SEN(syncfs), "syncfs" },
+[180] = { 1, TC|NF, SEN(setfsuid), "setfsuid" },
+[181] = { 1, TC|NF, SEN(setfsgid), "setfsgid" },
+[182] = { 3, 0, SEN(sysfs), "sysfs" },
+[183] = { 2, TSFA, SEN(ustat), "ustat" },
+[184] = { 2, TF|TSF|TSFA, SEN(statfs), "statfs" },
+[185] = { 2, TD|TFSF|TSFA, SEN(fstatfs), "fstatfs" },
+[186] = { 3, TF|TSF|TSFA, SEN(statfs64), "statfs64" },
+[187] = { 3, TD|TFSF|TSFA, SEN(fstatfs64), "fstatfs64" },
+[188] = { 2, 0, SEN(setrlimit), "setrlimit" },
+[189] = { 2, 0, SEN(getrlimit), "getrlimit" },
+[190] = { 2, 0, SEN(getrusage), "getrusage" },
+[191] = { 6, 0, SEN(futex_time32), "futex" },
+[192] = { 2, TCL, SEN(gettimeofday), "gettimeofday" },
+[193] = { 2, TCL, SEN(settimeofday), "settimeofday" },
+[194] = { 1, TCL, SEN(adjtimex32), "adjtimex" },
+[195] = { 2, 0, SEN(nanosleep_time32), "nanosleep" },
+[196] = { 2, TC, SEN(getgroups), "getgroups" },
+[197] = { 2, TC, SEN(setgroups), "setgroups" },
+[198] = { 2, 0, SEN(sethostname), "sethostname" },
+[199] = { 2, 0, SEN(setdomainname), "setdomainname" },
+[200] = { 3, 0, SEN(syslog), "syslog" },
+[201] = { 0, 0, SEN(vhangup), "vhangup" },
+[202] = { 1, TF, SEN(uselib), "uselib" },
+[203] = { 4, 0, SEN(reboot), "reboot" },
+[204] = { 4, TF, SEN(quotactl), "quotactl" },
+[205] = { 3, 0, SEN(nfsservctl), "nfsservctl" },
+[206] = { 1, 0, SEN(sysctl), "_sysctl" },
+[207] = { 2, 0, SEN(bdflush), "bdflush" },
+[208] = { 1, 0, SEN(uname), "uname" },
+[209] = { 1, 0, SEN(sysinfo), "sysinfo" },
+[210] = { 3, 0, SEN(init_module), "init_module" },
+[211] = { 2, 0, SEN(delete_module), "delete_module" },
+[212] = { 2, 0, SEN(sched_setparam), "sched_setparam" },
+[213] = { 2, 0, SEN(sched_getparam), "sched_getparam" },
+[214] = { 3, 0, SEN(sched_setscheduler), "sched_setscheduler" },
+[215] = { 1, 0, SEN(sched_getscheduler), "sched_getscheduler" },
+[216] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"},
+[217] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"},
+[218] = { 2, 0, SEN(sched_rr_get_interval_time32),"sched_rr_get_interval"},
+[219] = { 0, 0, SEN(sched_yield), "sched_yield" },
+[220 ... 222] = { },
+[223] = { 0, 0, SEN(restart_syscall), "restart_syscall" },
+[224] = { 2, TS, SEN(sigaltstack), "sigaltstack" },
+[225] = { 0, TS, SEN(rt_sigreturn), "rt_sigreturn" },
+[226] = { 4, TS, SEN(rt_sigaction), "rt_sigaction" },
+[227] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" },
+[228] = { 2, TS, SEN(rt_sigpending), "rt_sigpending" },
+[229] = { 4, TS, SEN(rt_sigtimedwait_time32), "rt_sigtimedwait" },
+[230] = { 3, TS|TP, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" },
+[231] = { 2, TS, SEN(rt_sigsuspend), "rt_sigsuspend" },
+[232] = { 4, TD, SEN(mq_open), "mq_open" },
+[233] = { 1, 0, SEN(mq_unlink), "mq_unlink" },
+[234] = { 5, TD, SEN(mq_timedsend_time32), "mq_timedsend" },
+[235] = { 5, TD, SEN(mq_timedreceive_time32), "mq_timedreceive" },
+[236] = { 2, TD, SEN(mq_notify), "mq_notify" },
+[237] = { 3, TD, SEN(mq_getsetattr), "mq_getsetattr" },
+[238] = { },
+[239] = { 2, TM, SEN(io_setup), "io_setup" },
+[240] = { 1, TM, SEN(io_destroy), "io_destroy" },
+[241] = { 3, 0, SEN(io_submit), "io_submit" },
+[242] = { 5, 0, SEN(io_getevents_time32), "io_getevents" },
+[243] = { 3, 0, SEN(io_cancel), "io_cancel" },
+[244] = { 2, TCL, SEN(clock_settime32), "clock_settime" },
+[245] = { 2, TCL, SEN(clock_gettime32), "clock_gettime" },
+[246] = { 2, TCL, SEN(clock_getres_time32), "clock_getres" },
+[247] = { 4, 0, SEN(clock_nanosleep_time32), "clock_nanosleep" },
+[248] = { 3, 0, SEN(timer_create), "timer_create" },
+[249] = { 1, 0, SEN(timer_delete), "timer_delete" },
+[250] = { 4, 0, SEN(timer_settime32), "timer_settime" },
+[251] = { 2, 0, SEN(timer_gettime32), "timer_gettime" },
+[252] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" },
+[253] = { },
+[254] = { 4, 0, SEN(lookup_dcookie), "lookup_dcookie" },
+[255] = { },
+[256] = { 5, 0, SEN(add_key), "add_key" },
+[257] = { 4, 0, SEN(request_key), "request_key" },
+[258] = { 5, 0, SEN(keyctl), "keyctl" },
+[259] = { },
+[260] = { 5, TD, SEN(readahead), "readahead" },
+[261] = { 5, TM|SI, SEN(remap_file_pages), "remap_file_pages" },
+[262] = { 4, TM, SEN(migrate_pages), "migrate_pages" },
+[263] = { 6, TM, SEN(mbind), "mbind" },
+[264] = { 5, TM, SEN(get_mempolicy), "get_mempolicy" },
+[265] = { 3, TM, SEN(set_mempolicy), "set_mempolicy" },
+[266] = { 1, 0, SEN(unshare), "unshare" },
+[267] = { 6, TM, SEN(move_pages), "move_pages" },
+[268] = { 6, TD, SEN(splice), "splice" },
+[269] = { 4, TD, SEN(tee), "tee" },
+[270] = { 4, TD, SEN(vmsplice), "vmsplice" },
+[271] = { },
+[272] = { 6, TD, SEN(pselect6_time32), "pselect6" },
+[273] = { 5, TD, SEN(ppoll_time32), "ppoll" },
+[274] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" },
+[275] = { 1, TD, SEN(epoll_create1), "epoll_create1" },
+[276] = { 0, TD, SEN(inotify_init), "inotify_init" },
+[277] = { 3, TD|TF, SEN(inotify_add_watch), "inotify_add_watch" },
+[278] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" },
+[279] = { 1, TD, SEN(inotify_init1), "inotify_init1" },
+[280] = { 3, 0, SEN(getcpu), "getcpu" },
+[281] = { 4, 0, SEN(kexec_load), "kexec_load" },
+[282] = { 3, 0, SEN(ioprio_set), "ioprio_set" },
+[283] = { 2, 0, SEN(ioprio_get), "ioprio_get" },
+[284] = { 2, 0, SEN(set_robust_list), "set_robust_list" },
+[285] = { 3, 0, SEN(get_robust_list), "get_robust_list" },
+[286 ... 287] = { },
+[288] = { 4, TD|TF, SEN(openat), "openat" },
+[289] = { 3, TD|TF, SEN(mkdirat), "mkdirat" },
+[290] = { 4, TD|TF, SEN(mknodat), "mknodat" },
+[291] = { 3, TD|TF, SEN(unlinkat), "unlinkat" },
+[292] = { 4, TD|TF, SEN(renameat), "renameat" },
+[293] = { 5, TD|TF, SEN(linkat), "linkat" },
+[294] = { 3, TD|TF, SEN(symlinkat), "symlinkat" },
+[295] = { 4, TD|TF, SEN(readlinkat), "readlinkat" },
+[296] = { 4, TD|TF, SEN(utimensat_time32), "utimensat" },
+[297] = { 5, TD|TF, SEN(fchownat), "fchownat" },
+[298] = { 3, TD|TF, SEN(futimesat), "futimesat" },
+[299] = { 4, TD|TF|TFST|TSTA,SEN(fstatat64), "fstatat64" },
+[300] = { 3, TD|TF, SEN(fchmodat), "fchmodat" },
+[301] = { 3, TD|TF, SEN(faccessat), "faccessat" },
+[302 ... 303] = { },
+[304] = { 3, TD|TS, SEN(signalfd), "signalfd" },
+[305] = { },
+[306] = { 1, TD, SEN(eventfd), "eventfd" },
+[307] = { 5, TN, SEN(recvmmsg_time32), "recvmmsg" },
+[308] = { 2, TD, SEN(setns), "setns" },
+[309] = { 4, TD|TS, SEN(signalfd4), "signalfd4" },
+[310] = { 3, TD, SEN(dup3), "dup3" },
+[311] = { 2, TD, SEN(pipe2), "pipe2" },
+[312] = { 2, TD, SEN(timerfd_create), "timerfd_create" },
+[313] = { 4, TD, SEN(timerfd_settime32), "timerfd_settime" },
+[314] = { 2, TD, SEN(timerfd_gettime32), "timerfd_gettime" },
+[315] = { },
+[316] = { 2, TD, SEN(eventfd2), "eventfd2" },
+[317] = { 5, TD, SEN(preadv), "preadv" },
+[318] = { 5, TD, SEN(pwritev), "pwritev" },
+[319] = { },
+[320] = { 2, TD, SEN(fanotify_init), "fanotify_init" },
+[321] = { 6, TD|TF, SEN(fanotify_mark), "fanotify_mark" },
+[322] = { 6, 0, SEN(process_vm_readv), "process_vm_readv" },
+[323] = { 6, 0, SEN(process_vm_writev), "process_vm_writev" },
+[324] = { 5, TD|TF, SEN(name_to_handle_at), "name_to_handle_at" },
+[325] = { 3, TD, SEN(open_by_handle_at), "open_by_handle_at" },
+[326] = { 6, TD, SEN(sync_file_range2), "sync_file_range2" },
+[327] = { 5, TD, SEN(perf_event_open), "perf_event_open" },
+[328] = { 4, TP|TS, SEN(rt_tgsigqueueinfo), "rt_tgsigqueueinfo" },
+[329] = { 2, TCL, SEN(clock_adjtime32), "clock_adjtime" },
+[330] = { 4, 0, SEN(prlimit64), "prlimit64" },
+[331] = { 5, 0, SEN(kcmp), "kcmp" },
+[332] = { 3, TD, SEN(finit_module), "finit_module" },
+[333] = { 4, TN, SEN(accept4), "accept4" },
+[334] = { 3, 0, SEN(sched_setattr), "sched_setattr" },
+[335] = { 4, 0, SEN(sched_getattr), "sched_getattr" },
+[336] = { 5, TD|TF, SEN(renameat2), "renameat2" },
+[337] = { 3, 0, SEN(seccomp), "seccomp" },
+[338] = { 3, 0, SEN(getrandom), "getrandom" },
+[339] = { 2, TD, SEN(memfd_create), "memfd_create" },
+[340] = { 3, TD, SEN(bpf), "bpf" },
+[341] = { 5, TD|TF|TP|TSD|SE|SI, SEN(execveat), "execveat" },
+[342] = { 1, TD, SEN(userfaultfd), "userfaultfd" },
+[343] = { 3, 0, SEN(membarrier), "membarrier" },
+[344] = { 3, TM, SEN(mlock2), "mlock2" },
+[345] = { 6, TD, SEN(copy_file_range), "copy_file_range" },
+[346] = { 6, TD, SEN(preadv2), "preadv2" },
+[347] = { 6, TD, SEN(pwritev2), "pwritev2" },
+[348] = { 4, TM|SI, SEN(pkey_mprotect), "pkey_mprotect" },
+[349] = { 2, 0, SEN(pkey_alloc), "pkey_alloc" },
+[350] = { 1, 0, SEN(pkey_free), "pkey_free" },
+[351] = { 5, TD|TF|TFST|TSTA,SEN(statx), "statx" },
+[352] = { 4, 0, SEN(rseq), "rseq" },
+/* [353 ... 402] - reserved to sync up with other architectures */
+#include "syscallent-common-32.h"
+#include "syscallent-common.h"
diff --git a/src/linux/xtensa/userent.h b/src/linux/xtensa/userent.h
new file mode 100644
index 000000000..71fa7d576
--- /dev/null
+++ b/src/linux/xtensa/userent.h
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2014-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+{ REG_A_BASE, "a0" },
+{ REG_A_BASE+1, "a1" },
+{ REG_A_BASE+2, "a2" },
+{ REG_A_BASE+3, "a3" },
+{ REG_A_BASE+4, "a4" },
+{ REG_A_BASE+5, "a5" },
+{ REG_A_BASE+6, "a6" },
+{ REG_A_BASE+7, "a7" },
+{ REG_A_BASE+8, "a8" },
+{ REG_A_BASE+9, "a9" },
+{ REG_A_BASE+10, "a10" },
+{ REG_A_BASE+11, "a11" },
+{ REG_A_BASE+12, "a12" },
+{ REG_A_BASE+13, "a13" },
+{ REG_A_BASE+14, "a14" },
+{ REG_A_BASE+15, "a15" },
+{ REG_PC, "pc" },
+{ SYSCALL_NR, "syscall_nr" },
+{ REG_AR_BASE, "ar0" },
+{ REG_AR_BASE+1, "ar1" },
+{ REG_AR_BASE+2, "ar2" },
+{ REG_AR_BASE+3, "ar3" },
+{ REG_AR_BASE+4, "ar4" },
+{ REG_AR_BASE+5, "ar5" },
+{ REG_AR_BASE+6, "ar6" },
+{ REG_AR_BASE+7, "ar7" },
+{ REG_AR_BASE+8, "ar8" },
+{ REG_AR_BASE+9, "ar9" },
+{ REG_AR_BASE+10, "ar10" },
+{ REG_AR_BASE+11, "ar11" },
+{ REG_AR_BASE+12, "ar12" },
+{ REG_AR_BASE+13, "ar13" },
+{ REG_AR_BASE+14, "ar14" },
+{ REG_AR_BASE+15, "ar15" },
+{ REG_AR_BASE+16, "ar16" },
+{ REG_AR_BASE+17, "ar17" },
+{ REG_AR_BASE+18, "ar18" },
+{ REG_AR_BASE+19, "ar19" },
+{ REG_AR_BASE+20, "ar20" },
+{ REG_AR_BASE+21, "ar21" },
+{ REG_AR_BASE+22, "ar22" },
+{ REG_AR_BASE+23, "ar23" },
+{ REG_AR_BASE+24, "ar24" },
+{ REG_AR_BASE+25, "ar25" },
+{ REG_AR_BASE+26, "ar26" },
+{ REG_AR_BASE+27, "ar27" },
+{ REG_AR_BASE+28, "ar28" },
+{ REG_AR_BASE+29, "ar29" },
+{ REG_AR_BASE+30, "ar30" },
+{ REG_AR_BASE+31, "ar31" },
+{ REG_AR_BASE+32, "ar32" },
+{ REG_AR_BASE+33, "ar33" },
+{ REG_AR_BASE+34, "ar34" },
+{ REG_AR_BASE+35, "ar35" },
+{ REG_AR_BASE+36, "ar36" },
+{ REG_AR_BASE+37, "ar37" },
+{ REG_AR_BASE+38, "ar38" },
+{ REG_AR_BASE+39, "ar39" },
+{ REG_AR_BASE+40, "ar40" },
+{ REG_AR_BASE+41, "ar41" },
+{ REG_AR_BASE+42, "ar42" },
+{ REG_AR_BASE+43, "ar43" },
+{ REG_AR_BASE+44, "ar44" },
+{ REG_AR_BASE+45, "ar45" },
+{ REG_AR_BASE+46, "ar46" },
+{ REG_AR_BASE+47, "ar47" },
+{ REG_AR_BASE+48, "ar48" },
+{ REG_AR_BASE+49, "ar49" },
+{ REG_AR_BASE+50, "ar50" },
+{ REG_AR_BASE+51, "ar51" },
+{ REG_AR_BASE+52, "ar52" },
+{ REG_AR_BASE+53, "ar53" },
+{ REG_AR_BASE+54, "ar54" },
+{ REG_AR_BASE+55, "ar55" },
+{ REG_AR_BASE+56, "ar56" },
+{ REG_AR_BASE+57, "ar57" },
+{ REG_AR_BASE+58, "ar58" },
+{ REG_AR_BASE+59, "ar59" },
+{ REG_AR_BASE+60, "ar60" },
+{ REG_AR_BASE+61, "ar61" },
+{ REG_AR_BASE+62, "ar62" },
+{ REG_AR_BASE+63, "ar63" },
+{ REG_LBEG, "lbeg" },
+{ REG_LEND, "lend" },
+{ REG_LCOUNT, "lcount" },
+{ REG_SAR, "sar" },
+{ REG_WB, "wb" },
+{ REG_WS, "ws" },
+{ REG_PS, "ps" },
diff --git a/src/list.h b/src/list.h
new file mode 100644
index 000000000..ddaf33ca1
--- /dev/null
+++ b/src/list.h
@@ -0,0 +1,300 @@
+/*
+ * Some simple implementation of lists similar to the one used in the kernel.
+ *
+ * Copyright (c) 2016-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_LIST_H
+# define STRACE_LIST_H
+
+/*
+ * struct list_item and related macros and functions provide an interface
+ * for manipulating and iterating linked lists. In order to have list
+ * associated with its payload, struct list_item has to be embedded into
+ * a structure type representing payload, and (optionally) an additional
+ * struct list_item should be added somewhere as a starting point for list
+ * iteration (creating a list with a designated head). A situation where
+ * no designated head exists, and each embedded struct list_head is considered
+ * a head (i.e. starting point for list iteration), is also possible.
+ *
+ * List head has to be initialised with list_init() call. Statically allocated
+ * list heads can also be defined with an EMPTY_LIST() macro.
+ *
+ * In order to get a pointer to list item from a struct list_item, list_elem
+ * macro is used.
+ *
+ * When a designated head is used, list_head() and list_tail() can be used
+ * for getting pointer to the first and the last list item, respectively.
+ *
+ * list_next() and list_prev() macros can be used for obtaining pointers
+ * to the next and the previous items in the list, respectively. Note that
+ * they do not perform additional checks for the validity of these pointers,
+ * so they have to be guarded with respective list_head/list_tail checks in case
+ * of lists with designated heads (where the list's head is not embedded within
+ * a list item.
+ *
+ * list_{insert,append,remove,remove_tail,remove_head,replace} provide some
+ * basic means of list manipulation.
+ *
+ * list_foreach() and list_foreach_safe() are wrapper macros for simplifying
+ * iteration over a list, with the latter having an additional argument
+ * for storing temporary pointer, thus allowing list manipulations during
+ * its iteration.
+ *
+ * A simple example:
+ *
+ * struct my_struct {
+ * int a;
+ * struct list_item l1;
+ * struct list_item l2;
+ * };
+ *
+ * EMPTY_LIST(list_1); <--- Defining a designated head for list
+ *
+ * struct my_struct *item =
+ * calloc(1, sizeof(*item));
+ * list_init(&item->l2); <--- Initialising structure field that
+ * is used for lists without designated
+ * head.
+ * list_insert(&list_1, &item->l1); <--- Inserting an item into the list
+ *
+ * item = calloc(1, sizeof(*item));
+ * list_init(&item->l2);
+ *
+ * list_append(&(list_head(list_1, struct my_struct, l1)->l2), &item->l2);
+ *
+ * struct my_struct *cur = item; <--- Iteration over a headless list
+ * do {
+ * printf("%d\n", cur->a);
+ * } while ((cur = list_next(&cur, l2)) != item);
+ *
+ * struct my_struct *i;
+ * list_foreach(i, list_1, l1) { <--- Iteration over list_1 without list
+ * printf("%d\n", i->a); modification
+ * }
+ *
+ * struct my_struct *tmp; <--- Iteration with modification
+ * list_foreach_safe(i, list_1, l1, tmp) {
+ * list_remove(&i->l1);
+ * free(i);
+ * }
+ *
+ * See also:
+ * "Linux kernel design patterns - part 2", section "Linked Lists"
+ * https://lwn.net/Articles/336255/
+ */
+
+# include "macros.h"
+
+struct list_item {
+ struct list_item *prev;
+ struct list_item *next;
+};
+
+/**
+ * Define an empty list head.
+ *
+ * @param l_ List head variable name.
+ */
+# define EMPTY_LIST(l_) struct list_item l_ = { &l_, &l_ }
+
+/** Initialise an empty list. */
+static inline void
+list_init(struct list_item *l)
+{
+ l->prev = l;
+ l->next = l;
+}
+
+/** Check whether list is empty. */
+static inline bool
+list_is_empty(const struct list_item *l)
+{
+ return ((l->next == l) && (l->prev == l))
+ /*
+ * XXX This could be the case when struct list_item hasn't been
+ * initialised at all; we should probably also call some
+ * errror_func_msg() in that case, as it looks like sloppy
+ * programming.
+ */
+ || (!l->next && !l->prev);
+}
+
+/**
+ * Convert a pointer to a struct list_item to a pointer to a list item.
+ *
+ * @param var Pointer to struct list_item.
+ * @param type Type of the list's item.
+ * @param field Name of the field that holds the respective struct list_item.
+ */
+# define list_elem(var, type, field) containerof((var), type, field)
+
+/**
+ * Get the first element in a list.
+ *
+ * @param head Pointer to the list's head.
+ * @param type Type of the list's item.
+ * @param field Name of the field that holds the respective struct list_item.
+ */
+# define list_head(head, type, field) \
+ (list_is_empty(head) ? NULL : list_elem((head)->next, type, field))
+/**
+ * Get the last element in a list.
+ *
+ * @param head Pointer to the list's head.
+ * @param type Type of the list's item.
+ * @param field Name of the field that holds the respective struct list_item.
+ */
+# define list_tail(head, type, field) \
+ (list_is_empty(head) ? NULL : list_elem((head)->prev, type, field))
+
+/**
+ * Get the next element in a list.
+ *
+ * @param var Pointer to a list item.
+ * @param field Name of the field that holds the respective struct list_item.
+ */
+# define list_next(var, field) \
+ list_elem((var)->field.next, typeof(*(var)), field)
+/**
+ * Get the previous element in a list.
+ *
+ * @param var Pointer to a list item.
+ * @param field Name of the field that holds the respective struct list_item.
+ */
+# define list_prev(var, field) \
+ list_elem((var)->field.prev, typeof(*(var)), field)
+
+/**
+ * Insert an item into a list. The item is placed as the next list item
+ * to the head.
+ */
+static inline void
+list_insert(struct list_item *head, struct list_item *item)
+{
+ item->next = head->next;
+ item->prev = head;
+ head->next->prev = item;
+ head->next = item;
+}
+
+/**
+ * Insert an item into a list. The item is placed as the previous list item
+ * to the head.
+ */
+static inline void
+list_append(struct list_item *head, struct list_item *item)
+{
+ item->next = head;
+ item->prev = head->prev;
+ head->prev->next = item;
+ head->prev = item;
+}
+
+/**
+ * Remove an item from a list.
+ *
+ * @param item Pointer to struct list_item of the item to be removed.
+ * @return Whether the action has been performed.
+ */
+static inline bool
+list_remove(struct list_item *item)
+{
+ if (!item->next || !item->prev || list_is_empty(item))
+ return false;
+
+ item->prev->next = item->next;
+ item->next->prev = item->prev;
+ item->next = item->prev = item;
+
+ return true;
+}
+
+/**
+ * Remove the last element of a list.
+ *
+ * @param head Pointer to the list's head.
+ * @return Pointer to struct list_item removed from the list;
+ * or NULL, if the list is empty.
+ */
+static inline struct list_item *
+list_remove_tail(struct list_item *head)
+{
+ struct list_item *t = list_is_empty(head) ? NULL : head->prev;
+
+ if (t)
+ list_remove(t);
+
+ return t;
+}
+
+/**
+ * Remove the first element of a list.
+ *
+ * @param head Pointer to the list's head.
+ * @return Pointer to struct list_item removed from the list;
+ * or NULL, if the list is empty.
+ */
+static inline struct list_item *
+list_remove_head(struct list_item *head)
+{
+ struct list_item *h = list_is_empty(head) ? NULL : head->next;
+
+ if (h)
+ list_remove(h);
+
+ return h;
+}
+
+/**
+ * Replace an old struct list_item in a list with the new one.
+ *
+ * @param old Pointer to struct list_item of the item to be replaced.
+ * @param new Pointer to struct list_item of the item to be replaced with.
+ * @return Whether the replacement has been performed.
+ */
+static inline bool
+list_replace(struct list_item *old, struct list_item *new)
+{
+ if (!old->next || !old->prev || list_is_empty(old))
+ return false;
+
+ new->next = old->next;
+ new->prev = old->prev;
+ old->prev->next = new;
+ old->next->prev = new;
+ old->next = old->prev = old;
+
+ return true;
+}
+
+/**
+ * List iteration wrapper for non-destructive operations.
+ *
+ * @param var_ Variable holding pointer to a current list item.
+ * @param head_ Pointer to the list's head.
+ * @param field_ Name of the field containing the respective struct list_item
+ * inside list items.
+ */
+# define list_foreach(var_, head_, field_) \
+ for (var_ = list_elem((head_)->next, typeof(*var_), field_); \
+ &(var_->field_) != (head_); var_ = list_next(var_, field_))
+
+/**
+ * List iteration wrapper for destructive operations.
+ *
+ * @param var_ Variable holding pointer to a current list item.
+ * @param head_ Pointer to the list's head.
+ * @param field_ Name of the field containing the respective struct list_item
+ * inside list items.
+ * @param _tmp Temporary variable for storing pointer to the next item.
+ */
+# define list_foreach_safe(var_, head_, field_, _tmp) \
+ for (var_ = list_elem((head_)->next, typeof(*var_), field_), \
+ _tmp = list_elem((var_)->field_.next, typeof(*var_), field_); \
+ &var_->field_ != head_; var_ = _tmp, _tmp = list_next(_tmp, field_))
+
+#endif /* !STRACE_LIST_H */
diff --git a/src/listen.c b/src/listen.c
new file mode 100644
index 000000000..b8ec00c3b
--- /dev/null
+++ b/src/listen.c
@@ -0,0 +1,21 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1996-2000 Wichert Akkerman <wichert@cistron.nl>
+ * Copyright (c) 1999-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+SYS_FUNC(listen)
+{
+ printfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ tprintf("%" PRI_klu, tcp->u_arg[1]);
+
+ return RVAL_DECODED;
+}
diff --git a/src/lookup_dcookie.c b/src/lookup_dcookie.c
new file mode 100644
index 000000000..3e5fcb5ad
--- /dev/null
+++ b/src/lookup_dcookie.c
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2015 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+SYS_FUNC(lookup_dcookie)
+{
+ if (entering(tcp))
+ return 0;
+
+ /* cookie */
+ int argn = printllval(tcp, "%llu", 0);
+ tprints(", ");
+
+ /* buffer */
+ if (syserror(tcp))
+ printaddr(tcp->u_arg[argn]);
+ else
+ printstrn(tcp, tcp->u_arg[argn], tcp->u_rval);
+
+ /* len */
+ tprintf(", %" PRI_klu, tcp->u_arg[argn + 1]);
+
+ return 0;
+}
diff --git a/src/loop.c b/src/loop.c
new file mode 100644
index 000000000..e45e094aa
--- /dev/null
+++ b/src/loop.c
@@ -0,0 +1,236 @@
+/*
+ * Copyright (c) 2012 The Chromium OS Authors.
+ * Copyright (c) 2012-2020 The strace developers.
+ * Written by Mike Frysinger <vapier@gentoo.org>.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include "types/loop.h"
+
+typedef struct loop_info struct_loop_info;
+
+#include DEF_MPERS_TYPE(struct_loop_info)
+
+#include MPERS_DEFS
+
+#define XLAT_MACROS_ONLY
+#include "xlat/loop_cmds.h"
+#undef XLAT_MACROS_ONLY
+
+#include "xlat/loop_flags_options.h"
+#include "xlat/loop_crypt_type_options.h"
+
+static void
+decode_loop_info(struct tcb *const tcp, const kernel_ulong_t addr)
+{
+ struct_loop_info info;
+
+ tprints(", ");
+ if (umove_or_printaddr(tcp, addr, &info))
+ return;
+
+ tprint_struct_begin();
+ PRINT_FIELD_D(info, lo_number);
+
+ if (!abbrev(tcp)) {
+ tprint_struct_next();
+ PRINT_FIELD_DEV(info, lo_device);
+ tprint_struct_next();
+ PRINT_FIELD_U(info, lo_inode);
+ tprint_struct_next();
+ PRINT_FIELD_DEV(info, lo_rdevice);
+ }
+
+ tprint_struct_next();
+ PRINT_FIELD_X(info, lo_offset);
+
+ if (!abbrev(tcp) || info.lo_encrypt_type != LO_CRYPT_NONE) {
+ tprint_struct_next();
+ PRINT_FIELD_XVAL(info, lo_encrypt_type,
+ loop_crypt_type_options, "LO_CRYPT_???");
+ /*
+ * It is converted to unsigned before use in the kernel,
+ * see loop_info64_from_old in drivers/block/loop.c
+ */
+ tprint_struct_next();
+ PRINT_FIELD_U(info, lo_encrypt_key_size);
+ }
+
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(info, lo_flags, loop_flags_options, "LO_FLAGS_???");
+
+ tprint_struct_next();
+ PRINT_FIELD_CSTRING(info, lo_name);
+
+ if (!abbrev(tcp) || info.lo_encrypt_type != LO_CRYPT_NONE) {
+ const unsigned int lo_encrypt_key_size =
+ MIN((unsigned) info.lo_encrypt_key_size, LO_KEY_SIZE);
+ tprint_struct_next();
+ PRINT_FIELD_STRING(info, lo_encrypt_key,
+ lo_encrypt_key_size, 0);
+ }
+
+ if (!abbrev(tcp)) {
+ tprint_struct_next();
+ PRINT_FIELD_X_ARRAY(info, lo_init);
+ tprint_struct_next();
+ PRINT_FIELD_X_ARRAY(info, reserved);
+ } else {
+ tprint_struct_next();
+ tprint_more_data_follows();
+ }
+
+ tprint_struct_end();
+}
+
+static void
+print_loop_info64(struct tcb *const tcp, const struct loop_info64 *const info64)
+{
+ if (!abbrev(tcp)) {
+ tprint_struct_begin();
+ PRINT_FIELD_DEV(*info64, lo_device);
+ tprint_struct_next();
+ PRINT_FIELD_U(*info64, lo_inode);
+ tprint_struct_next();
+ PRINT_FIELD_DEV(*info64, lo_rdevice);
+ tprint_struct_next();
+ PRINT_FIELD_X(*info64, lo_offset);
+ tprint_struct_next();
+ PRINT_FIELD_U(*info64, lo_sizelimit);
+ tprint_struct_next();
+ PRINT_FIELD_U(*info64, lo_number);
+ } else {
+ tprint_struct_begin();
+ PRINT_FIELD_X(*info64, lo_offset);
+ tprint_struct_next();
+ PRINT_FIELD_U(*info64, lo_number);
+ }
+
+ if (!abbrev(tcp) || info64->lo_encrypt_type != LO_CRYPT_NONE) {
+ tprint_struct_next();
+ PRINT_FIELD_XVAL(*info64, lo_encrypt_type,
+ loop_crypt_type_options, "LO_CRYPT_???");
+ tprint_struct_next();
+ PRINT_FIELD_U(*info64, lo_encrypt_key_size);
+ }
+
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(*info64, lo_flags, loop_flags_options, "LO_FLAGS_???");
+
+ tprint_struct_next();
+ PRINT_FIELD_CSTRING(*info64, lo_file_name);
+
+ if (!abbrev(tcp) || info64->lo_encrypt_type != LO_CRYPT_NONE) {
+ tprint_struct_next();
+ PRINT_FIELD_CSTRING(*info64, lo_crypt_name);
+ const unsigned int lo_encrypt_key_size =
+ MIN((unsigned) info64->lo_encrypt_key_size, LO_KEY_SIZE);
+ tprint_struct_next();
+ PRINT_FIELD_STRING(*info64, lo_encrypt_key,
+ lo_encrypt_key_size, 0);
+ }
+
+ if (!abbrev(tcp)) {
+ tprint_struct_next();
+ PRINT_FIELD_X_ARRAY(*info64, lo_init);
+ } else {
+ tprint_struct_next();
+ tprint_more_data_follows();
+ }
+
+ tprint_struct_end();
+}
+
+static void
+decode_loop_info64(struct tcb *const tcp, const kernel_ulong_t addr)
+{
+ struct loop_info64 info64;
+
+ tprints(", ");
+ if (!umove_or_printaddr(tcp, addr, &info64))
+ print_loop_info64(tcp, &info64);
+}
+
+static void
+decode_loop_config(struct tcb *const tcp, const kernel_ulong_t addr)
+{
+ struct_loop_config config;
+
+ tprints(", ");
+ if (umove_or_printaddr(tcp, addr, &config))
+ return;
+
+ tprint_struct_begin();
+ PRINT_FIELD_FD(config, fd, tcp);
+
+ tprint_struct_next();
+ PRINT_FIELD_U(config, block_size);
+
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_TCB_PTR(config, info, tcp, print_loop_info64);
+
+ if (!IS_ARRAY_ZERO(config.__reserved)) {
+ tprint_struct_next();
+ PRINT_FIELD_X_ARRAY(config, __reserved);
+ }
+
+ tprint_struct_end();
+}
+
+MPERS_PRINTER_DECL(int, loop_ioctl,
+ struct tcb *tcp, const unsigned int code,
+ const kernel_ulong_t arg)
+{
+ switch (code) {
+ case LOOP_GET_STATUS:
+ if (entering(tcp))
+ return 0;
+ ATTRIBUTE_FALLTHROUGH;
+ case LOOP_SET_STATUS:
+ decode_loop_info(tcp, arg);
+ break;
+
+ case LOOP_GET_STATUS64:
+ if (entering(tcp))
+ return 0;
+ ATTRIBUTE_FALLTHROUGH;
+ case LOOP_SET_STATUS64:
+ decode_loop_info64(tcp, arg);
+ break;
+
+ case LOOP_CONFIGURE:
+ decode_loop_config(tcp, arg);
+ break;
+
+ case LOOP_CLR_FD:
+ case LOOP_SET_CAPACITY:
+ /* newer loop-control stuff */
+ case LOOP_CTL_GET_FREE:
+ /* Takes no arguments */
+ break;
+
+ case LOOP_SET_FD:
+ case LOOP_CHANGE_FD:
+ tprints(", ");
+ printfd(tcp, arg);
+ break;
+
+ /* newer loop-control stuff */
+ case LOOP_CTL_ADD:
+ case LOOP_CTL_REMOVE:
+ tprintf(", %d", (int) arg);
+ break;
+
+ case LOOP_SET_DIRECT_IO:
+ case LOOP_SET_BLOCK_SIZE:
+ tprintf(", %" PRI_klu, arg);
+ break;
+
+ default:
+ return RVAL_DECODED;
+ }
+
+ return RVAL_IOCTL_DECODED;
+}
diff --git a/src/lseek.c b/src/lseek.c
new file mode 100644
index 000000000..8faa5c8d0
--- /dev/null
+++ b/src/lseek.c
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
+ * Copyright (c) 2002-2005 Roland McGrath <roland@redhat.com>
+ * Copyright (c) 2009 Andreas Schwab <schwab@redhat.com>
+ * Copyright (c) 2012 H.J. Lu <hongjiu.lu@intel.com>
+ * Copyright (c) 2013 Denys Vlasenko <vda.linux@googlemail.com>
+ * Copyright (c) 2014-2016 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2014-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#include "xlat/whence_codes.h"
+
+/* Linux kernel has exactly one version of lseek:
+ * fs/read_write.c::SYSCALL_DEFINE3(lseek, unsigned, fd, off_t, offset, unsigned, origin)
+ * In kernel, off_t is always the same as (kernel's) long
+ * (see include/uapi/asm-generic/posix_types.h).
+ * Use test/x32_lseek.c to test lseek decoding.
+ */
+SYS_FUNC(lseek)
+{
+ printfd(tcp, tcp->u_arg[0]);
+
+ kernel_long_t offset;
+
+#ifndef current_klongsize
+ if (current_klongsize < sizeof(kernel_long_t)) {
+ offset = (int) tcp->u_arg[1];
+ } else
+#endif /* !current_klongsize */
+ {
+ offset = tcp->u_arg[1];
+ }
+
+ tprintf(", %" PRI_kld ", ", offset);
+
+ printxval(whence_codes, tcp->u_arg[2], "SEEK_???");
+
+ return RVAL_DECODED;
+}
+
+/* llseek syscall takes explicitly two ulong arguments hi, lo,
+ * rather than one 64-bit argument for which ULONG_LONG works
+ * appropriate for the native byte order.
+ *
+ * See kernel's fs/read_write.c::SYSCALL_DEFINE5(llseek, ...)
+ *
+ * hi,lo are "unsigned longs" and combined exactly this way in kernel:
+ * ((loff_t) hi << 32) | lo
+ * Note that for architectures with kernel's long wider than userspace long
+ * (such as x32), combining code will use *kernel's*, i.e. *wide* longs
+ * for hi and lo.
+ */
+SYS_FUNC(llseek)
+{
+ if (entering(tcp)) {
+ printfd(tcp, tcp->u_arg[0]);
+ tprintf(", %lld, ",
+ ((long long) tcp->u_arg[1] << 32)
+ | ((long long) tcp->u_arg[2]));
+ } else {
+ printnum_int64(tcp, tcp->u_arg[3], "%" PRIu64);
+ tprints(", ");
+ printxval(whence_codes, tcp->u_arg[4], "SEEK_???");
+ }
+ return 0;
+}
diff --git a/src/macros.h b/src/macros.h
new file mode 100644
index 000000000..edfa1ff5c
--- /dev/null
+++ b/src/macros.h
@@ -0,0 +1,87 @@
+/*
+ * Copyright (c) 2001-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_MACROS_H
+# define STRACE_MACROS_H
+
+# include <stdbool.h>
+# include <stddef.h>
+# include <sys/types.h>
+
+# include "gcc_compat.h"
+
+# define ARRAY_SIZE(a_) (sizeof(a_) / sizeof((a_)[0]) + MUST_BE_ARRAY(a_))
+
+# define ARRSZ_PAIR(a_) a_, ARRAY_SIZE(a_)
+
+# define STRINGIFY(...) #__VA_ARGS__
+# define STRINGIFY_VAL(...) STRINGIFY(__VA_ARGS__)
+
+# ifndef MAX
+# define MAX(a, b) (((a) > (b)) ? (a) : (b))
+# endif
+# ifndef MIN
+# define MIN(a, b) (((a) < (b)) ? (a) : (b))
+# endif
+# define CLAMP(val, min, max) MIN(MAX(val, min), max)
+
+# ifndef ROUNDUP_DIV
+# define ROUNDUP_DIV(val_, div_) (((val_) + (div_) - 1) / (div_))
+# endif
+
+# ifndef ROUNDUP
+# define ROUNDUP(val_, div_) (ROUNDUP_DIV((val_), (div_)) * (div_))
+# endif
+
+# define sizeof_field(type_, member_) (sizeof(((type_ *)0)->member_))
+
+# define typeof_field(type_, member_) typeof(((type_ *)0)->member_)
+
+# ifndef offsetofend
+# define offsetofend(type_, member_) \
+ (offsetof(type_, member_) + sizeof_field(type_, member_))
+# endif
+
+# ifndef cast_ptr
+# define cast_ptr(type_, var_) \
+ ((type_) (uintptr_t) (const volatile void *) (var_))
+# endif
+
+# ifndef containerof
+/**
+ * Return a pointer to a structure that contains the provided variable.
+ *
+ * @param ptr_ Pointer to data that is a field of the container structure.
+ * @param struct_ Type of the container structure.
+ * @param member_ Name of the member field.
+ * @return Pointer to the container structure.
+ */
+# define containerof(ptr_, struct_, member_) \
+ cast_ptr(struct_ *, \
+ (const volatile char *) (ptr_) - offsetof(struct_, member_))
+# endif
+
+static inline bool
+is_filled(const char *ptr, char fill, size_t size)
+{
+ while (size--)
+ if (*ptr++ != fill)
+ return false;
+
+ return true;
+}
+
+# define IS_ARRAY_ZERO(arr_) \
+ is_filled((const char *) (arr_), 0, sizeof(arr_) + MUST_BE_ARRAY(arr_))
+
+# ifndef BIT
+# define BIT(x_) (1U << (x_))
+# endif
+
+# define FLAG(name_) name_ = BIT(name_##_BIT)
+
+#endif /* !STRACE_MACROS_H */
diff --git a/src/mem.c b/src/mem.c
new file mode 100644
index 000000000..3f69aeb74
--- /dev/null
+++ b/src/mem.c
@@ -0,0 +1,383 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
+ * Copyright (c) 2000 PocketPenguins Inc. Linux for Hitachi SuperH
+ * port by Greg Banks <gbanks@pocketpenguins.com>
+ * Copyright (c) 1999-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include <linux/mman.h>
+#include <sys/mman.h>
+
+unsigned long
+get_pagesize(void)
+{
+ static unsigned long pagesize;
+
+ if (!pagesize) {
+ long ret = sysconf(_SC_PAGESIZE);
+
+ if (ret < 0)
+ perror_func_msg_and_die("sysconf(_SC_PAGESIZE)");
+ if (ret == 0)
+ error_func_msg_and_die("sysconf(_SC_PAGESIZE) "
+ "returned 0");
+
+ pagesize = (unsigned long) ret;
+ }
+
+ return pagesize;
+}
+
+SYS_FUNC(brk)
+{
+ printaddr(tcp->u_arg[0]);
+
+ return RVAL_DECODED | RVAL_HEX;
+}
+
+#include "xlat/mmap_prot.h"
+#include "xlat/mmap_flags.h"
+
+#ifndef MAP_HUGE_SHIFT
+# define MAP_HUGE_SHIFT 26
+#endif
+
+#ifndef MAP_HUGE_MASK
+# define MAP_HUGE_MASK 0x3f
+#endif
+
+static void
+print_mmap_flags(kernel_ulong_t flags)
+{
+ if (xlat_verbose(xlat_verbosity) != XLAT_STYLE_ABBREV)
+ tprintf("%#" PRI_klx, flags);
+
+ if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_RAW)
+ return;
+
+ if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE)
+ tprints(" /* ");
+
+ printxvals_ex(flags & MAP_TYPE, "MAP_???", XLAT_STYLE_ABBREV,
+ mmap_flags, NULL);
+ flags &= ~MAP_TYPE;
+
+ const unsigned int mask = MAP_HUGE_MASK << MAP_HUGE_SHIFT;
+ const unsigned int hugetlb_value = flags & mask;
+
+ flags &= ~mask;
+ if (flags) {
+ tprints("|");
+ printflags_ex(flags, NULL, XLAT_STYLE_ABBREV,
+ mmap_flags, NULL);
+ }
+
+ if (hugetlb_value)
+ tprintf("|%u<<MAP_HUGE_SHIFT",
+ hugetlb_value >> MAP_HUGE_SHIFT);
+
+ if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE)
+ tprints(" */");
+}
+
+static void
+print_mmap(struct tcb *tcp, kernel_ulong_t *u_arg, unsigned long long offset)
+{
+ const kernel_ulong_t addr = u_arg[0];
+ const kernel_ulong_t len = u_arg[1];
+ const kernel_ulong_t prot = u_arg[2];
+ const kernel_ulong_t flags = u_arg[3];
+ const int fd = u_arg[4];
+
+ printaddr(addr);
+ tprintf(", %" PRI_klu ", ", len);
+ printflags64(mmap_prot, prot, "PROT_???");
+ tprints(", ");
+ print_mmap_flags(flags);
+ tprints(", ");
+ printfd(tcp, fd);
+ tprintf(", %#llx", offset);
+}
+
+/* Syscall name<->function correspondence is messed up on many arches.
+ * For example:
+ * i386 has __NR_mmap == 90, and it is "old mmap", and
+ * also it has __NR_mmap2 == 192, which is a "new mmap with page offsets".
+ * But x86_64 has just one __NR_mmap == 9, a "new mmap with byte offsets".
+ * Confused? Me too!
+ */
+
+#if HAVE_ARCH_OLD_MMAP
+/* Params are pointed to by u_arg[0], offset is in bytes */
+SYS_FUNC(old_mmap)
+{
+ kernel_ulong_t *args =
+ fetch_indirect_syscall_args(tcp, tcp->u_arg[0], 6);
+
+ if (args)
+ print_mmap(tcp, args, args[5]);
+ else
+ printaddr(tcp->u_arg[0]);
+
+ return RVAL_DECODED | RVAL_HEX;
+}
+
+# if HAVE_ARCH_OLD_MMAP_PGOFF
+/* Params are pointed to by u_arg[0], offset is in pages */
+SYS_FUNC(old_mmap_pgoff)
+{
+ kernel_ulong_t *args =
+ fetch_indirect_syscall_args(tcp, tcp->u_arg[0], 6);
+
+ if (args) {
+ unsigned long long offset;
+
+ offset = args[5];
+ offset *= get_pagesize();
+
+ print_mmap(tcp, args, offset);
+ } else {
+ printaddr(tcp->u_arg[0]);
+ }
+
+ return RVAL_DECODED | RVAL_HEX;
+}
+# endif /* HAVE_ARCH_OLD_MMAP_PGOFF */
+#endif /* HAVE_ARCH_OLD_MMAP */
+
+/* Params are passed directly, offset is in bytes */
+SYS_FUNC(mmap)
+{
+ /* Example of kernel-side handling of this variety of mmap:
+ * arch/x86/kernel/sys_x86_64.c::SYSCALL_DEFINE6(mmap, ...) calls
+ * sys_mmap_pgoff(..., off >> PAGE_SHIFT); i.e. off is in bytes,
+ * since the above code converts off to pages.
+ */
+ print_mmap(tcp, tcp->u_arg, tcp->u_arg[5]);
+
+ return RVAL_DECODED | RVAL_HEX;
+}
+
+/* Params are passed directly, offset is in pages */
+SYS_FUNC(mmap_pgoff)
+{
+ /* Try test/mmap_offset_decode.c */
+ unsigned long long offset;
+ offset = tcp->u_arg[5];
+ offset *= get_pagesize();
+ print_mmap(tcp, tcp->u_arg, offset);
+
+ return RVAL_DECODED | RVAL_HEX;
+}
+
+/* Params are passed directly, offset is in 4k units */
+SYS_FUNC(mmap_4koff)
+{
+ unsigned long long offset;
+ offset = tcp->u_arg[5];
+ offset <<= 12;
+ print_mmap(tcp, tcp->u_arg, offset);
+
+ return RVAL_DECODED | RVAL_HEX;
+}
+
+SYS_FUNC(munmap)
+{
+ printaddr(tcp->u_arg[0]);
+ tprintf(", %" PRI_klu, tcp->u_arg[1]);
+
+ return RVAL_DECODED;
+}
+
+static int
+do_mprotect(struct tcb *tcp, bool has_pkey)
+{
+ printaddr(tcp->u_arg[0]);
+ tprintf(", %" PRI_klu ", ", tcp->u_arg[1]);
+ printflags64(mmap_prot, tcp->u_arg[2], "PROT_???");
+
+ if (has_pkey)
+ tprintf(", %d", (int) tcp->u_arg[3]);
+
+ return RVAL_DECODED;
+}
+
+SYS_FUNC(mprotect)
+{
+ return do_mprotect(tcp, false);
+}
+
+SYS_FUNC(pkey_mprotect)
+{
+ return do_mprotect(tcp, true);
+}
+
+#include "xlat/mremap_flags.h"
+
+SYS_FUNC(mremap)
+{
+ printaddr(tcp->u_arg[0]);
+ tprintf(", %" PRI_klu ", %" PRI_klu ", ", tcp->u_arg[1], tcp->u_arg[2]);
+ printflags64(mremap_flags, tcp->u_arg[3], "MREMAP_???");
+#ifdef MREMAP_FIXED
+ if ((tcp->u_arg[3] & (MREMAP_MAYMOVE | MREMAP_FIXED)) ==
+ (MREMAP_MAYMOVE | MREMAP_FIXED)) {
+ tprints(", ");
+ printaddr(tcp->u_arg[4]);
+ }
+#endif
+ return RVAL_DECODED | RVAL_HEX;
+}
+
+#include "xlat/madvise_cmds.h"
+
+SYS_FUNC(madvise)
+{
+ printaddr(tcp->u_arg[0]);
+ tprintf(", %" PRI_klu ", ", tcp->u_arg[1]);
+ printxval(madvise_cmds, tcp->u_arg[2], "MADV_???");
+
+ return RVAL_DECODED;
+}
+
+SYS_FUNC(process_madvise)
+{
+ const int pidfd = tcp->u_arg[0];
+ const kernel_ulong_t addr = tcp->u_arg[1];
+ const kernel_ulong_t len = tcp->u_arg[2];
+ const unsigned int behavior = tcp->u_arg[3];
+ const unsigned int flags = tcp->u_arg[4];
+
+ printfd(tcp, pidfd);
+
+ tprints(", ");
+ tprint_iov(tcp, len, addr, IOV_DECODE_ADDR);
+
+ tprintf(", %" PRI_klu ", ", len);
+
+ printxval(madvise_cmds, behavior, "MADV_???");
+
+ tprintf(", %#x", flags);
+
+ return RVAL_DECODED;
+}
+
+#include "xlat/mlockall_flags.h"
+
+SYS_FUNC(mlockall)
+{
+ printflags(mlockall_flags, tcp->u_arg[0], "MCL_???");
+
+ return RVAL_DECODED;
+}
+
+#include "xlat/mctl_sync.h"
+
+SYS_FUNC(msync)
+{
+ /* addr */
+ printaddr(tcp->u_arg[0]);
+ /* len */
+ tprintf(", %" PRI_klu ", ", tcp->u_arg[1]);
+ /* flags */
+ printflags(mctl_sync, tcp->u_arg[2], "MS_???");
+
+ return RVAL_DECODED;
+}
+
+#include "xlat/mlock_flags.h"
+
+SYS_FUNC(mlock2)
+{
+ printaddr(tcp->u_arg[0]);
+ tprintf(", %" PRI_klu ", ", tcp->u_arg[1]);
+ printflags(mlock_flags, tcp->u_arg[2], "MLOCK_???");
+
+ return RVAL_DECODED;
+}
+
+SYS_FUNC(mincore)
+{
+ if (entering(tcp)) {
+ printaddr(tcp->u_arg[0]);
+ tprintf(", %" PRI_klu ", ", tcp->u_arg[1]);
+ } else {
+ const unsigned long page_size = get_pagesize();
+ const unsigned long page_mask = page_size - 1;
+ unsigned long len = tcp->u_arg[1];
+ unsigned char *vec = NULL;
+
+ len = len / page_size + (len & page_mask ? 1 : 0);
+ if (syserror(tcp) || !verbose(tcp) ||
+ !tcp->u_arg[2] || !(vec = malloc(len)) ||
+ umoven(tcp, tcp->u_arg[2], len, vec) < 0)
+ printaddr(tcp->u_arg[2]);
+ else {
+ unsigned long i;
+ tprints("[");
+ for (i = 0; i < len; i++) {
+ if (i)
+ tprints(", ");
+ if (abbrev(tcp) && i >= max_strlen) {
+ tprints("...");
+ break;
+ }
+ tprints((vec[i] & 1) ? "1" : "0");
+ }
+ tprints("]");
+ }
+ free(vec);
+ }
+ return 0;
+}
+
+SYS_FUNC(remap_file_pages)
+{
+ const kernel_ulong_t addr = tcp->u_arg[0];
+ const kernel_ulong_t size = tcp->u_arg[1];
+ const kernel_ulong_t prot = tcp->u_arg[2];
+ const kernel_ulong_t pgoff = tcp->u_arg[3];
+ const kernel_ulong_t flags = tcp->u_arg[4];
+
+ printaddr(addr);
+ tprintf(", %" PRI_klu ", ", size);
+ printflags64(mmap_prot, prot, "PROT_???");
+ tprintf(", %" PRI_klu ", ", pgoff);
+ print_mmap_flags(flags);
+
+ return RVAL_DECODED;
+}
+
+#if defined(POWERPC)
+static bool
+print_protmap_entry(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data)
+{
+ tprintf("%#08x", *(unsigned int *) elem_buf);
+
+ return true;
+}
+
+SYS_FUNC(subpage_prot)
+{
+ kernel_ulong_t addr = tcp->u_arg[0];
+ kernel_ulong_t len = tcp->u_arg[1];
+ kernel_ulong_t nmemb = len >> 16;
+ kernel_ulong_t map = tcp->u_arg[2];
+
+ printaddr(addr);
+ tprintf(", %" PRI_klu ", ", len);
+
+ unsigned int entry;
+ print_array(tcp, map, nmemb, &entry, sizeof(entry),
+ tfetch_mem, print_protmap_entry, 0);
+
+ return RVAL_DECODED;
+}
+#endif
diff --git a/src/membarrier.c b/src/membarrier.c
new file mode 100644
index 000000000..4f933b5c9
--- /dev/null
+++ b/src/membarrier.c
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2015 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2015-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#include "xlat/membarrier_cmds.h"
+#include "xlat/membarrier_flags.h"
+
+SYS_FUNC(membarrier)
+{
+ if (entering(tcp)) {
+ int cmd = tcp->u_arg[0];
+ unsigned flags = tcp->u_arg[1];
+ int cpu_id = tcp->u_arg[2];
+
+ printxval(membarrier_cmds, cmd, "MEMBARRIER_CMD_???");
+ tprints(", ");
+ printflags(membarrier_flags, flags, "MEMBARRIER_CMD_FLAG_???");
+
+ if (flags & MEMBARRIER_CMD_FLAG_CPU) {
+ tprintf(", %d", cpu_id);
+ }
+
+ return cmd ? RVAL_DECODED : 0;
+ }
+
+ if (syserror(tcp) || !tcp->u_rval)
+ return 0;
+
+ tcp->auxstr = sprintflags("", membarrier_cmds,
+ (kernel_ulong_t) tcp->u_rval);
+ return RVAL_HEX | RVAL_STR;
+}
diff --git a/src/memfd_create.c b/src/memfd_create.c
new file mode 100644
index 000000000..f45b86fe6
--- /dev/null
+++ b/src/memfd_create.c
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2015 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#ifdef HAVE_LINUX_MEMFD_H
+# include <linux/memfd.h>
+#endif
+
+#include "xlat/memfd_create_flags.h"
+
+#ifndef MFD_HUGE_SHIFT
+# define MFD_HUGE_SHIFT 26
+#endif
+
+#ifndef MFD_HUGE_MASK
+# define MFD_HUGE_MASK 0x3f
+#endif
+
+SYS_FUNC(memfd_create)
+{
+ printpathn(tcp, tcp->u_arg[0], 255 - (sizeof("memfd:") - 1));
+ tprints(", ");
+
+ unsigned int flags = tcp->u_arg[1];
+
+ if (!flags || xlat_verbose(xlat_verbosity) != XLAT_STYLE_ABBREV)
+ tprintf("%#x", flags);
+
+ if (!flags || xlat_verbose(xlat_verbosity) == XLAT_STYLE_RAW)
+ return RVAL_DECODED | RVAL_FD;
+
+ if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE)
+ tprints(" /* ");
+
+ const unsigned int mask = MFD_HUGE_MASK << MFD_HUGE_SHIFT;
+ const unsigned int hugetlb_value = flags & mask;
+ flags &= ~mask;
+
+ if (flags || !hugetlb_value)
+ printflags_ex(flags, "MFD_???", XLAT_STYLE_ABBREV,
+ memfd_create_flags, NULL);
+
+ if (hugetlb_value)
+ tprintf("%s%u<<MFD_HUGE_SHIFT",
+ flags ? "|" : "",
+ hugetlb_value >> MFD_HUGE_SHIFT);
+
+ if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE)
+ tprints(" */");
+
+ return RVAL_DECODED | RVAL_FD;
+}
diff --git a/src/mknod.c b/src/mknod.c
new file mode 100644
index 000000000..962e53877
--- /dev/null
+++ b/src/mknod.c
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993-1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
+ * Copyright (c) 2006 Ulrich Drepper <drepper@redhat.com>
+ * Copyright (c) 2006 Bernhard Kaindl <bk@suse.de>
+ * Copyright (c) 2006-2015 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2014-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#include <fcntl.h>
+#include <sys/stat.h>
+
+static void
+decode_mknod(struct tcb *tcp, int offset)
+{
+ unsigned short mode = tcp->u_arg[offset + 1];
+ unsigned int dev;
+
+ printpath(tcp, tcp->u_arg[offset]);
+ tprints(", ");
+ print_symbolic_mode_t(mode);
+ switch (mode & S_IFMT) {
+ case S_IFCHR:
+ case S_IFBLK:
+ dev = tcp->u_arg[offset + 2];
+ tprints(", ");
+ print_dev_t(dev);
+ break;
+ }
+}
+
+SYS_FUNC(mknod)
+{
+ decode_mknod(tcp, 0);
+
+ return RVAL_DECODED;
+}
+
+SYS_FUNC(mknodat)
+{
+ print_dirfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ decode_mknod(tcp, 1);
+
+ return RVAL_DECODED;
+}
diff --git a/src/mmap_cache.c b/src/mmap_cache.c
new file mode 100644
index 000000000..25f15a2b1
--- /dev/null
+++ b/src/mmap_cache.c
@@ -0,0 +1,221 @@
+/*
+ * Copyright (c) 2013 Luca Clementi <luca.clementi@gmail.com>
+ * Copyright (c) 2013-2020 The strace developers.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include <limits.h>
+
+#include "largefile_wrappers.h"
+#include "mmap_cache.h"
+#include "mmap_notify.h"
+#include "xstring.h"
+
+static unsigned int mmap_cache_generation;
+
+static void
+mmap_cache_invalidate(struct tcb *tcp, void *unused)
+{
+ mmap_cache_generation++;
+ debug_func_msg("tgen=%u, ggen=%u, tcp=%p, cache=%p",
+ tcp->mmap_cache ? tcp->mmap_cache->generation : 0,
+ mmap_cache_generation, tcp,
+ tcp->mmap_cache ? tcp->mmap_cache->entry : 0);
+}
+
+void
+mmap_cache_enable(void)
+{
+ static bool use_mmap_cache;
+
+ if (!use_mmap_cache) {
+ mmap_notify_register_client(mmap_cache_invalidate, NULL);
+ use_mmap_cache = true;
+ }
+}
+
+/* deleting the cache */
+static void
+delete_mmap_cache(struct tcb *tcp, const char *caller)
+{
+ debug_func_msg("tgen=%u, ggen=%u, tcp=%p, cache=%p, caller=%s",
+ tcp->mmap_cache ? tcp->mmap_cache->generation : 0,
+ mmap_cache_generation, tcp,
+ tcp->mmap_cache ? tcp->mmap_cache->entry : 0, caller);
+
+ if (!tcp->mmap_cache)
+ return;
+
+ while (tcp->mmap_cache->size) {
+ unsigned int i = --tcp->mmap_cache->size;
+ free(tcp->mmap_cache->entry[i].binary_filename);
+ tcp->mmap_cache->entry[i].binary_filename = NULL;
+ }
+
+ free(tcp->mmap_cache->entry);
+ tcp->mmap_cache->entry = NULL;
+
+ free(tcp->mmap_cache);
+ tcp->mmap_cache = NULL;
+}
+
+/*
+ * caching of /proc/ID/maps for each process to speed up stack tracing
+ *
+ * The cache must be refreshed after syscalls that affect memory mappings,
+ * e.g. mmap, mprotect, munmap, execve.
+ */
+extern enum mmap_cache_rebuild_result
+mmap_cache_rebuild_if_invalid(struct tcb *tcp, const char *caller)
+{
+ if (tcp->mmap_cache
+ && tcp->mmap_cache->generation != mmap_cache_generation)
+ delete_mmap_cache(tcp, caller);
+
+ if (tcp->mmap_cache)
+ return MMAP_CACHE_REBUILD_READY;
+
+ char filename[sizeof("/proc/4294967296/maps")];
+ xsprintf(filename, "/proc/%u/maps", get_proc_pid(tcp));
+
+ FILE *fp = fopen_stream(filename, "r");
+ if (!fp) {
+ perror_msg("fopen: %s", filename);
+ return MMAP_CACHE_REBUILD_NOCACHE;
+ }
+
+ struct mmap_cache_t cache = {
+ .free_fn = delete_mmap_cache,
+ .generation = mmap_cache_generation
+ };
+
+ /* start with a small dynamically-allocated array and then expand it */
+ size_t allocated = 0;
+ char buffer[PATH_MAX + 80];
+
+ while (fgets(buffer, sizeof(buffer), fp) != NULL) {
+ unsigned long start_addr, end_addr, mmap_offset;
+ char read_bit;
+ char write_bit;
+ char exec_bit;
+ char shared_bit;
+ unsigned long major, minor;
+ char binary_path[sizeof(buffer)];
+
+ if (sscanf(buffer, "%lx-%lx %c%c%c%c %lx %lx:%lx %*d %[^\n]",
+ &start_addr, &end_addr,
+ &read_bit, &write_bit, &exec_bit, &shared_bit,
+ &mmap_offset,
+ &major, &minor,
+ binary_path) != 10)
+ continue;
+
+ /* skip mappings that have unknown protection */
+ if (!(read_bit == '-' || read_bit == 'r'))
+ continue;
+ if (!(write_bit == '-' || write_bit == 'w'))
+ continue;
+ if (!(exec_bit == '-' || exec_bit == 'x'))
+ continue;
+ if (!(shared_bit == 'p' || shared_bit == 's'))
+ continue;
+
+ if (end_addr < start_addr) {
+ error_msg("%s: unrecognized file format", filename);
+ break;
+ }
+
+ struct mmap_cache_entry_t *entry;
+ /*
+ * sanity check to make sure that we're storing
+ * non-overlapping regions in ascending order
+ */
+ if (cache.size > 0) {
+ entry = &cache.entry[cache.size - 1];
+ if (entry->start_addr == start_addr &&
+ entry->end_addr == end_addr) {
+ /* duplicate entry, e.g. [vsyscall] */
+ continue;
+ }
+ if (start_addr <= entry->start_addr ||
+ start_addr < entry->end_addr) {
+ debug_msg("%s: overlapping memory region: "
+ "\"%s\" [%08lx-%08lx] overlaps with "
+ "\"%s\" [%08lx-%08lx]",
+ filename, binary_path, start_addr,
+ end_addr, entry->binary_filename,
+ entry->start_addr, entry->end_addr);
+ continue;
+ }
+ }
+
+ if (cache.size >= allocated)
+ cache.entry = xgrowarray(cache.entry, &allocated,
+ sizeof(*cache.entry));
+
+ entry = &cache.entry[cache.size];
+ entry->start_addr = start_addr;
+ entry->end_addr = end_addr;
+ entry->mmap_offset = mmap_offset;
+ entry->protections = (
+ 0
+ | ((read_bit == 'r')? MMAP_CACHE_PROT_READABLE : 0)
+ | ((write_bit == 'w')? MMAP_CACHE_PROT_WRITABLE : 0)
+ | ((exec_bit == 'x')? MMAP_CACHE_PROT_EXECUTABLE: 0)
+ | ((shared_bit == 's')? MMAP_CACHE_PROT_SHARED : 0)
+ );
+ entry->major = major;
+ entry->minor = minor;
+ entry->binary_filename = xstrdup(binary_path);
+ cache.size++;
+ }
+ fclose(fp);
+
+ if (!cache.size)
+ return MMAP_CACHE_REBUILD_NOCACHE;
+
+ tcp->mmap_cache = xmalloc(sizeof(*tcp->mmap_cache));
+ memcpy(tcp->mmap_cache, &cache, sizeof(cache));
+
+ debug_func_msg("tgen=%u, ggen=%u, tcp=%p, cache=%p, caller=%s",
+ tcp->mmap_cache->generation, mmap_cache_generation,
+ tcp, tcp->mmap_cache->entry, caller);
+
+ return MMAP_CACHE_REBUILD_RENEWED;
+}
+
+struct mmap_cache_entry_t *
+mmap_cache_search(struct tcb *tcp, unsigned long ip)
+{
+ if (!tcp->mmap_cache)
+ return NULL;
+
+ int lower = 0;
+ int upper = (int) tcp->mmap_cache->size - 1;
+
+ while (lower <= upper) {
+ int mid = (upper + lower) / 2;
+ struct mmap_cache_entry_t *entry = &tcp->mmap_cache->entry[mid];
+
+ if (ip >= entry->start_addr &&
+ ip < entry->end_addr)
+ return entry;
+ else if (ip < entry->start_addr)
+ upper = mid - 1;
+ else
+ lower = mid + 1;
+ }
+ return NULL;
+}
+
+struct mmap_cache_entry_t *
+mmap_cache_search_custom(struct tcb *tcp, mmap_cache_search_fn fn, void *data)
+{
+ for (unsigned int i = 0; i < tcp->mmap_cache->size; i++) {
+ if (fn(tcp->mmap_cache->entry + i, data))
+ return tcp->mmap_cache->entry + i;
+ }
+ return NULL;
+}
diff --git a/src/mmap_cache.h b/src/mmap_cache.h
new file mode 100644
index 000000000..aec62bf18
--- /dev/null
+++ b/src/mmap_cache.h
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2013-2018 The strace developers.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_MMAP_CACHE_H
+# define STRACE_MMAP_CACHE_H
+
+/*
+ * Keep a sorted array of cache entries,
+ * so that we can binary search through it.
+ */
+
+struct mmap_cache_t {
+ struct mmap_cache_entry_t *entry;
+ void (*free_fn)(struct tcb *, const char *caller);
+ unsigned int size;
+ unsigned int generation;
+};
+
+struct mmap_cache_entry_t {
+ /**
+ * example entry:
+ * 7fabbb09b000-7fabbb09f000 r-xp 00179000 fc:00 1180246 /lib/libc-2.11.1.so
+ *
+ * start_addr is 0x7fabbb09b000
+ * end_addr is 0x7fabbb09f000
+ * mmap_offset is 0x179000
+ * protections is MMAP_CACHE_PROT_READABLE|MMAP_CACHE_PROT_EXECUTABLE
+ * major is 0xfc
+ * minor is 0x00
+ * binary_filename is "/lib/libc-2.11.1.so"
+ */
+ unsigned long start_addr;
+ unsigned long end_addr;
+ unsigned long mmap_offset;
+ unsigned char protections;
+ unsigned long major, minor;
+ char *binary_filename;
+};
+
+enum mmap_cache_protection {
+ MMAP_CACHE_PROT_READABLE = 1 << 0,
+ MMAP_CACHE_PROT_WRITABLE = 1 << 1,
+ MMAP_CACHE_PROT_EXECUTABLE = 1 << 2,
+ MMAP_CACHE_PROT_SHARED = 1 << 3,
+};
+
+enum mmap_cache_rebuild_result {
+ MMAP_CACHE_REBUILD_NOCACHE,
+ MMAP_CACHE_REBUILD_READY,
+ MMAP_CACHE_REBUILD_RENEWED,
+};
+
+typedef bool (*mmap_cache_search_fn)(struct mmap_cache_entry_t *, void *);
+
+extern void
+mmap_cache_enable(void);
+
+extern enum mmap_cache_rebuild_result
+mmap_cache_rebuild_if_invalid(struct tcb *, const char *caller);
+
+extern struct mmap_cache_entry_t *
+mmap_cache_search(struct tcb *, unsigned long ip);
+
+extern struct mmap_cache_entry_t *
+mmap_cache_search_custom(struct tcb *, mmap_cache_search_fn, void *);
+
+#endif /* !STRACE_MMAP_CACHE_H */
diff --git a/src/mmap_notify.c b/src/mmap_notify.c
new file mode 100644
index 000000000..5fb71cedf
--- /dev/null
+++ b/src/mmap_notify.c
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2018 The strace developers.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "mmap_notify.h"
+
+struct mmap_notify_client {
+ mmap_notify_fn fn;
+ void *data;
+ struct mmap_notify_client *next;
+};
+
+static struct mmap_notify_client *clients;
+
+void
+mmap_notify_register_client(mmap_notify_fn fn, void *data)
+{
+ struct mmap_notify_client *client = xmalloc(sizeof(*client));
+ client->fn = fn;
+ client->data = data;
+ client->next = clients;
+ clients = client;
+}
+
+void
+mmap_notify_report(struct tcb *tcp)
+{
+ struct mmap_notify_client *client;
+
+ for (client = clients; client; client = client->next)
+ client->fn(tcp, client->data);
+}
diff --git a/src/mmap_notify.h b/src/mmap_notify.h
new file mode 100644
index 000000000..e0272ce70
--- /dev/null
+++ b/src/mmap_notify.h
@@ -0,0 +1,20 @@
+/*
+ * Copyright (c) 2018 The strace developers.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_MMAP_NOTIFY_H
+# define STRACE_MMAP_NOTIFY_H
+
+# include "defs.h"
+
+typedef void (*mmap_notify_fn)(struct tcb *, void *);
+
+extern void
+mmap_notify_register_client(mmap_notify_fn, void *);
+
+extern void
+mmap_notify_report (struct tcb *);
+
+#endif /* !STRACE_MMAP_NOTIFY_H */
diff --git a/src/mmsghdr.c b/src/mmsghdr.c
new file mode 100644
index 000000000..cc8917ba6
--- /dev/null
+++ b/src/mmsghdr.c
@@ -0,0 +1,240 @@
+/*
+ * Copyright (c) 2010 Andreas Schwab <schwab@linux-m68k.org>
+ * Copyright (c) 2012-2013 Denys Vlasenko <vda.linux@googlemail.com>
+ * Copyright (c) 2014 Masatake YAMATO <yamato@redhat.com>
+ * Copyright (c) 2010-2016 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2016-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include "msghdr.h"
+#include "xstring.h"
+#include <limits.h>
+
+static bool
+fetch_struct_mmsghdr_for_print(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len, void *const mh)
+{
+ return (entering(tcp) || !syserror(tcp)) &&
+ fetch_struct_mmsghdr(tcp, addr, mh);
+}
+
+struct print_struct_mmsghdr_config {
+ const int *p_user_msg_namelen;
+ unsigned int msg_len_vlen;
+ unsigned int count;
+ bool use_msg_len;
+};
+
+static bool
+print_struct_mmsghdr(struct tcb *tcp, void *elem_buf,
+ size_t elem_size, void *data)
+{
+ const struct mmsghdr *const mmsg = elem_buf;
+ struct print_struct_mmsghdr_config *const c = data;
+
+ if (!c->count) {
+ tprint_more_data_follows();
+ return false;
+ }
+ --c->count;
+
+ tprint_struct_begin();
+ PRINT_FIELD_OBJ_TCB_PTR(*mmsg, msg_hdr, tcp, print_struct_msghdr,
+ c->p_user_msg_namelen,
+ c->use_msg_len ? mmsg->msg_len : (kernel_ulong_t) -1);
+ if (c->msg_len_vlen) {
+ tprint_struct_next();
+ PRINT_FIELD_U(*mmsg, msg_len);
+ --c->msg_len_vlen;
+ }
+ tprint_struct_end();
+
+ if (c->p_user_msg_namelen)
+ ++c->p_user_msg_namelen;
+
+ return true;
+}
+
+static void
+free_mmsgvec_data(void *ptr)
+{
+ char **pstr = ptr;
+ free(*pstr);
+ *pstr = 0;
+
+ free(ptr);
+}
+
+struct mmsgvec_data {
+ char *timeout;
+ unsigned int count;
+ int namelen[0];
+};
+
+static void
+save_mmsgvec_namelen(struct tcb *const tcp, kernel_ulong_t addr,
+ unsigned int len, const char *const timeout)
+{
+ if (len > IOV_MAX)
+ len = IOV_MAX;
+
+ const size_t data_size = offsetof(struct mmsgvec_data, namelen)
+ + sizeof(int) * len;
+ struct mmsgvec_data *const data = xmalloc(data_size);
+ data->timeout = xstrdup(timeout);
+
+ unsigned int i, fetched;
+
+ for (i = 0; i < len; ++i, addr += fetched) {
+ struct mmsghdr mh;
+
+ fetched = fetch_struct_mmsghdr(tcp, addr, &mh);
+ if (!fetched)
+ break;
+ data->namelen[i] = mh.msg_hdr.msg_namelen;
+ }
+ data->count = i;
+
+ set_tcb_priv_data(tcp, data, free_mmsgvec_data);
+}
+
+static void
+decode_mmsgvec(struct tcb *const tcp, const kernel_ulong_t addr,
+ const unsigned int vlen, const unsigned int msg_len_vlen,
+ const bool use_msg_len)
+{
+ struct mmsghdr mmsg;
+ struct print_struct_mmsghdr_config c = {
+ .msg_len_vlen = msg_len_vlen,
+ .count = IOV_MAX,
+ .use_msg_len = use_msg_len
+ };
+ const struct mmsgvec_data *const data = get_tcb_priv_data(tcp);
+
+ if (data) {
+ if (data->count < c.count)
+ c.count = data->count;
+ c.p_user_msg_namelen = data->namelen;
+ }
+
+ print_array(tcp, addr, vlen, &mmsg, sizeof_struct_mmsghdr(),
+ fetch_struct_mmsghdr_for_print,
+ print_struct_mmsghdr, &c);
+}
+
+void
+dumpiov_in_mmsghdr(struct tcb *const tcp, kernel_ulong_t addr)
+{
+ unsigned int len = tcp->u_rval;
+ unsigned int i, fetched;
+ struct mmsghdr mmsg;
+
+ for (i = 0; i < len; ++i, addr += fetched) {
+ fetched = fetch_struct_mmsghdr(tcp, addr, &mmsg);
+ if (!fetched)
+ break;
+ tprintf(" = %" PRI_klu " buffers in vector %u\n",
+ (kernel_ulong_t) mmsg.msg_hdr.msg_iovlen, i);
+ dumpiov_upto(tcp, mmsg.msg_hdr.msg_iovlen,
+ ptr_to_kulong(mmsg.msg_hdr.msg_iov),
+ mmsg.msg_len);
+ }
+}
+
+SYS_FUNC(sendmmsg)
+{
+ if (entering(tcp)) {
+ /* sockfd */
+ printfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ if (!verbose(tcp)) {
+ /* msgvec */
+ printaddr(tcp->u_arg[1]);
+ /* vlen */
+ tprintf(", %u, ", (unsigned int) tcp->u_arg[2]);
+ /* flags */
+ printflags(msg_flags, tcp->u_arg[3], "MSG_???");
+ return RVAL_DECODED;
+ }
+ } else {
+ const unsigned int msg_len_vlen =
+ syserror(tcp) ? 0 : tcp->u_rval;
+ /* msgvec */
+ temporarily_clear_syserror(tcp);
+ decode_mmsgvec(tcp, tcp->u_arg[1], tcp->u_arg[2],
+ msg_len_vlen, false);
+ restore_cleared_syserror(tcp);
+ /* vlen */
+ tprintf(", %u, ", (unsigned int) tcp->u_arg[2]);
+ /* flags */
+ printflags(msg_flags, tcp->u_arg[3], "MSG_???");
+ }
+ return 0;
+}
+
+static int
+do_recvmmsg(struct tcb *const tcp, const print_obj_by_addr_fn print_ts,
+ const sprint_obj_by_addr_fn sprint_ts)
+{
+ if (entering(tcp)) {
+ printfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ if (verbose(tcp)) {
+ save_mmsgvec_namelen(tcp, tcp->u_arg[1], tcp->u_arg[2],
+ sprint_ts(tcp, tcp->u_arg[4]));
+ } else {
+ /* msgvec */
+ printaddr(tcp->u_arg[1]);
+ /* vlen */
+ tprintf(", %u, ", (unsigned int) tcp->u_arg[2]);
+ /* flags */
+ printflags(msg_flags, tcp->u_arg[3], "MSG_???");
+ tprints(", ");
+ print_ts(tcp, tcp->u_arg[4]);
+ }
+ return 0;
+ } else {
+ if (verbose(tcp)) {
+ /* msgvec */
+ decode_mmsgvec(tcp, tcp->u_arg[1], tcp->u_rval,
+ tcp->u_rval, true);
+ /* vlen */
+ tprintf(", %u, ", (unsigned int) tcp->u_arg[2]);
+ /* flags */
+ printflags(msg_flags, tcp->u_arg[3], "MSG_???");
+ tprints(", ");
+ /* timeout on entrance */
+ tprints(*(const char **) get_tcb_priv_data(tcp));
+ }
+ if (syserror(tcp))
+ return 0;
+ if (tcp->u_rval == 0) {
+ tcp->auxstr = "Timeout";
+ return RVAL_STR;
+ }
+ if (!verbose(tcp) || !tcp->u_arg[4])
+ return 0;
+ /* timeout on exit */
+ static char str[sizeof("left") + TIMESPEC_TEXT_BUFSIZE];
+ xsprintf(str, "left %s", sprint_ts(tcp, tcp->u_arg[4]));
+ tcp->auxstr = str;
+ return RVAL_STR;
+ }
+}
+
+#if HAVE_ARCH_TIME32_SYSCALLS
+SYS_FUNC(recvmmsg_time32)
+{
+ return do_recvmmsg(tcp, print_timespec32, sprint_timespec32);
+}
+#endif
+
+SYS_FUNC(recvmmsg_time64)
+{
+ return do_recvmmsg(tcp, print_timespec64, sprint_timespec64);
+}
diff --git a/src/mount.c b/src/mount.c
new file mode 100644
index 000000000..9ccb714dc
--- /dev/null
+++ b/src/mount.c
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993-1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
+ * Copyright (c) 2005 Roland McGrath <roland@redhat.com>
+ * Copyright (c) 2007-2015 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2014-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#define MS_MGC_VAL 0xc0ed0000 /* old magic mount flag number */
+#define MS_MGC_MSK 0xffff0000 /* old magic mount flag mask */
+
+#include "xlat/mount_flags.h"
+
+SYS_FUNC(mount)
+{
+ bool ignore_type = false;
+ bool ignore_data = false;
+ bool old_magic = false;
+ kernel_ulong_t flags = tcp->u_arg[3];
+
+ /* Discard magic */
+ if ((flags & MS_MGC_MSK) == MS_MGC_VAL) {
+ flags &= ~MS_MGC_MSK;
+ old_magic = true;
+ }
+
+ if (flags & MS_REMOUNT)
+ ignore_type = true;
+ else if (flags & (MS_BIND | MS_MOVE | MS_SHARED
+ | MS_PRIVATE | MS_SLAVE | MS_UNBINDABLE))
+ ignore_type = ignore_data = true;
+
+ printpath(tcp, tcp->u_arg[0]);
+ tprints(", ");
+
+ printpath(tcp, tcp->u_arg[1]);
+ tprints(", ");
+
+ if (ignore_type)
+ printaddr(tcp->u_arg[2]);
+ else
+ printstr(tcp, tcp->u_arg[2]);
+ tprints(", ");
+
+ if (old_magic) {
+ print_xlat(MS_MGC_VAL);
+ if (flags)
+ tprints("|");
+ }
+ if (flags || !old_magic)
+ printflags64(mount_flags, flags, "MS_???");
+ tprints(", ");
+
+ if (ignore_data)
+ printaddr(tcp->u_arg[4]);
+ else
+ printstr(tcp, tcp->u_arg[4]);
+
+ return RVAL_DECODED;
+}
diff --git a/src/move_mount.c b/src/move_mount.c
new file mode 100644
index 000000000..dd67b3f42
--- /dev/null
+++ b/src/move_mount.c
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2019 Dmitry V. Levin <ldv@strace.io>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#ifdef HAVE_LINUX_MOUNT_H
+# include <linux/mount.h>
+#endif
+#include "xlat/move_mount_flags.h"
+
+SYS_FUNC(move_mount)
+{
+ print_dirfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ printpath(tcp, tcp->u_arg[1]);
+ tprints(", ");
+ print_dirfd(tcp, tcp->u_arg[2]);
+ tprints(", ");
+ printpath(tcp, tcp->u_arg[3]);
+ tprints(", ");
+ printflags(move_mount_flags, tcp->u_arg[4], "MOVE_MOUNT_???");
+ return RVAL_DECODED;
+}
diff --git a/src/mpers.awk b/src/mpers.awk
new file mode 100644
index 000000000..f5414af6f
--- /dev/null
+++ b/src/mpers.awk
@@ -0,0 +1,222 @@
+#!/bin/gawk
+#
+# Copyright (c) 2015 Elvira Khabirova <lineprinter0@gmail.com>
+# Copyright (c) 2015-2016 Dmitry V. Levin <ldv@strace.io>
+# Copyright (c) 2015-2020 The strace developers.
+# All rights reserved.
+#
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+function array_get(array_idx, array_member, \
+ array_return)
+{
+ array_return = array[array_idx, array_member]
+ if ("" == array_return) {
+ printf("%s: index [%s] without %s\n",
+ FILENAME, array_idx, array_member) > "/dev/stderr"
+ exit 1
+ }
+ return array_return
+}
+function norm_idx(idx)
+{
+ return sprintf("%016s", idx)
+}
+function array_seq(array_idx)
+{
+ if ((array_idx, "seq") in array)
+ return array[array_idx, "seq"]
+ index_seq++
+ array[array_idx, "seq"] = index_seq
+ return index_seq
+}
+function enter(array_idx,
+ item)
+{
+ if (array_idx in called) {
+ printf("%s: index loop detected:", FILENAME) > "/dev/stderr"
+ for (item in called)
+ printf(" %s", item) > "/dev/stderr"
+ print "" > "/dev/stderr"
+ exit 1
+ }
+ called[array_idx] = 1
+}
+function leave(array_idx, to_return)
+{
+ delete called[array_idx]
+ return to_return
+}
+function update_upper_bound(idx, val, \
+ count)
+{
+ count = array[idx, "count"]
+ if (count == "")
+ count = 1
+ array[idx, "count"] = count * val
+ array[idx, "upper_bound"] = array[idx, "upper_bound"] "[" val "]"
+}
+function what_is(what_idx, \
+ item, loc_diff, location, prev_location, prev_returned_size, \
+ special, to_return, type_idx, enc, i)
+{
+ enter(what_idx)
+ special = array_get(what_idx, "special")
+ if (special == "base_type") {
+ enc = array_get(what_idx, "encoding")
+ if (enc == 5) { # signed
+ printf("int%s_t ",
+ 8 * array_get(what_idx, "byte_size"))
+ } else if (enc == 7) { # unsigned
+ printf("uint%s_t ",
+ 8 * array_get(what_idx, "byte_size"))
+ } else { # float, signed/unsigned char
+ printf("%s ", array_get(what_idx, "name"))
+ }
+ returned_size = array_get(what_idx, "byte_size")
+ } else if (special == "enumeration_type") {
+ returned_size = array_get(what_idx, "byte_size")
+ printf("uint%s_t ", 8 * returned_size)
+ } else if (special == "pointer_type") {
+ printf("mpers_ptr_t ")
+ returned_size = array_get(what_idx, "byte_size")
+ } else if (special == "array_type") {
+ type_idx = array_get(what_idx, "type")
+ what_is(type_idx)
+ to_return = array[what_idx, "upper_bound"]
+ if ("" == to_return)
+ to_return = "[0]"
+ returned_size = array[what_idx, "count"] * returned_size
+ return leave(what_idx, to_return)
+ } else if (special == "structure_type") {
+ print "struct {"
+ prev_location = 0
+ location = 0
+ returned_size = 0
+ prev_returned_size = 0
+ for (i = 1; i <= parents_cnt; i += 1) {
+ if (array_parents[aparents_keys[i]] == what_idx) {
+ location = array_get(aparents_keys[i], "location")
+ loc_diff = location - prev_location - \
+ prev_returned_size
+ if (loc_diff != 0) {
+ printf("unsigned char mpers_%s_%s[%s];\n",
+ "filler", array_seq(aparents_keys[i]), loc_diff)
+ }
+ prev_location = location
+ returned = what_is(aparents_keys[i])
+ prev_returned_size = returned_size
+ printf("%s%s;\n", array[aparents_keys[i], "name"], returned)
+ }
+ }
+ returned_size = array_get(what_idx, "byte_size")
+ loc_diff = returned_size - prev_location - prev_returned_size
+ if (loc_diff != 0) {
+ printf("unsigned char mpers_%s_%s[%s];\n",
+ "end_filler", array_seq(item), loc_diff)
+ }
+ printf("} ATTRIBUTE_PACKED ")
+ } else if (special == "union_type") {
+ print "union {"
+ for (i = 1; i <= parents_cnt; i += 1) {
+ if (array_parents[aparents_keys[i]] == what_idx) {
+ returned = what_is(aparents_keys[i])
+ printf("%s%s;\n", array[aparents_keys[i], "name"], returned)
+ }
+ }
+ printf("} ")
+ returned_size = array_get(what_idx, "byte_size")
+ } else if (special == "typedef") {
+ type_idx = array_get(what_idx, "type")
+ return leave(what_idx, what_is(type_idx))
+ } else if (special == "member") {
+ type_idx = array_get(what_idx, "type")
+ return leave(what_idx, what_is(type_idx))
+ } else {
+ type_idx = array_get(what_idx, "type")
+ what_is(type_idx)
+ }
+ return leave(what_idx, "")
+}
+BEGIN {
+ match(ARCH_FLAG, /[[:digit:]]+/, temparray)
+ default_pointer_size = temparray[0] / 8
+ print "#include <stdint.h>"
+}
+/^<[[:xdigit:]]+>/ {
+ match($0, /([[:alnum:]]+)><([[:alnum:]]+)/, matches)
+ level = matches[1]
+ idx = norm_idx(matches[2])
+ array[idx, "idx"] = idx
+ parent[level] = idx
+}
+/^DW_AT_data_member_location/ {
+ if (!match($0, /\(DW_OP_plus_uconst:[[:space:]]+([[:digit:]]+)\)/, temparray))
+ match($0, /([[:digit:]]+)/, temparray)
+ array[idx, "location"] = temparray[1]
+}
+/^DW_AT_name/ {
+ match($0, /:[[:space:]]+([[:alpha:]_][[:alnum:]_[:space:]]*)/, \
+ temparray)
+ array_names[idx] = 1
+ array[idx, "name"] = temparray[1]
+}
+/^DW_AT_byte_size/ {
+ match($0, /[[:digit:]]+/, temparray)
+ array[idx, "byte_size"] = temparray[0]
+}
+/^DW_AT_encoding/ {
+ match($0, /[[:digit:]]+/, temparray)
+ array[idx, "encoding"] = temparray[0]
+}
+/^DW_AT_type/ {
+ match($0, /:[[:space:]]+<0x([[:xdigit:]]*)>(, .*)?$/, temparray)
+ array[idx, "type"] = norm_idx(temparray[1])
+}
+/^DW_AT_upper_bound/ {
+ match($0, /[[:digit:]]+/, temparray)
+ update_upper_bound(parent[level - 1], temparray[0] + 1)
+}
+/^DW_AT_count/ {
+ match($0, /[[:digit:]]+/, temparray)
+ update_upper_bound(parent[level - 1], temparray[0])
+}
+/^Abbrev Number:[^(]+\(DW_TAG_/ {
+ if (match($0, /typedef|union_type|structure_type|pointer_type\
+|enumeration_type|array_type|base_type|member/, temparray)) {
+ array_special[idx] = temparray[0]
+ array[idx, "special"] = temparray[0]
+ if ("pointer_type" == temparray[0])
+ array[idx, "byte_size"] = default_pointer_size
+ if (level > 1 && "member" == temparray[0])
+ array_parents[idx] = parent[level-1]
+ }
+}
+END {
+ parents_cnt = asorti(array_parents, aparents_keys)
+
+ for (item in array_special) {
+ if (array[item, "special"] == "pointer_type") {
+ mpers_ptr_t = \
+ "uint" 8 * array_get(item, "byte_size") "_t"
+ print "#ifndef mpers_ptr_t_is_" mpers_ptr_t
+ print "typedef " mpers_ptr_t " mpers_ptr_t;"
+ print "#define mpers_ptr_t_is_" mpers_ptr_t
+ print "#endif"
+ break
+ }
+ }
+ for (item in array_names) {
+ if (array[item, "name"] == VAR_NAME) {
+ type = array_get(item, "type")
+ print "typedef"
+ what_is(type)
+ name = array_get(type, "name")
+ print ARCH_FLAG "_" name ";"
+ print "#define MPERS_" \
+ ARCH_FLAG "_" name " " \
+ ARCH_FLAG "_" name
+ break
+ }
+ }
+}
diff --git a/src/mpers.sh b/src/mpers.sh
new file mode 100755
index 000000000..b28ef703b
--- /dev/null
+++ b/src/mpers.sh
@@ -0,0 +1,59 @@
+#!/bin/sh -e
+#
+# Copyright (c) 2015 Elvira Khabirova <lineprinter0@gmail.com>
+# Copyright (c) 2015-2020 The strace developers.
+# All rights reserved.
+#
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[ "x${D:-0}" != x1 ] || set -x
+
+export LC_ALL=C
+
+MPERS_AWK="${0%/*}/mpers.awk"
+ARCH_FLAG=$1
+CC_ARCH_FLAG=$2
+PARSER_FILE=$3
+
+READELF="${READELF:-readelf}"
+CC="${CC-gcc}"
+CFLAGS="$CFLAGS -gdwarf-2 -c"
+CPP="${CPP-$CC -E}"
+CPPFLAGS="$CPPFLAGS -MM -MG"
+
+VAR_NAME='mpers_target_var'
+BITS_DIR="mpers-${ARCH_FLAG}"
+
+mkdir -p ${BITS_DIR}
+set -- $(sed -r -n \
+ 's/^#[[:space:]]*include[[:space:]]+DEF_MPERS_TYPE\(([^)[:space:]]*)\)$/\1/p' \
+ "${PARSER_FILE}")
+for m_type; do
+ f_h="${BITS_DIR}/${m_type}.h"
+ f_c="${BITS_DIR}/${m_type}.c"
+ f_i="${BITS_DIR}/${m_type}.i"
+ f_o="${BITS_DIR}/${m_type}.o"
+ f_d1="${BITS_DIR}/${m_type}.d1"
+ f_d2="${BITS_DIR}/${m_type}.d2"
+ sed -e '
+ /DEF_MPERS_TYPE('"${m_type}"')$/n
+ /DEF_MPERS_TYPE/d
+ /^[[:space:]]*#[[:space:]]*include[[:space:]]*"xlat\//d
+ /^#[[:space:]]*include[[:space:]][[:space:]]*MPERS_DEFS$/ {s//'"${m_type} ${VAR_NAME}"';/;q}
+ ' "${PARSER_FILE}" > "${f_c}"
+ $CPP $CPPFLAGS "${f_c}" > "${f_i}"
+ grep -F -q "${m_type}.h" "${f_i}" ||
+ continue
+ sed -i -e '/DEF_MPERS_TYPE/d' "${f_c}"
+ $CC $CFLAGS $CC_ARCH_FLAG "${f_c}" -o "${f_o}"
+ $READELF --wide --debug-dump=info "${f_o}" > "${f_d1}"
+ sed -r -n '
+ /^[[:space:]]*<1>/,/^[[:space:]]*<1><[^>]+>: Abbrev Number: 0/!d
+ /^[[:space:]]*<[^>]*><[^>]*>: Abbrev Number: 0/d
+ s/^[[:space:]]*<[[:xdigit:]]+>[[:space:]]+//
+ s/^[[:space:]]*((<[[:xdigit:]]+>){2}):[[:space:]]+/\1\n/
+ s/[[:space:]]+$//
+ p' "${f_d1}" > "${f_d2}"
+ gawk -v VAR_NAME="$VAR_NAME" -v ARCH_FLAG="${ARCH_FLAG}" \
+ -f "$MPERS_AWK" "${f_d2}" > "${f_h}"
+done
diff --git a/src/mpers_test.sh b/src/mpers_test.sh
new file mode 100755
index 000000000..f469702e1
--- /dev/null
+++ b/src/mpers_test.sh
@@ -0,0 +1,132 @@
+#!/bin/sh -efu
+#
+# Copyright (c) 2015 Elvira Khabirova <lineprinter0@gmail.com>
+# Copyright (c) 2015 Dmitry V. Levin <ldv@strace.io>
+# Copyright (c) 2015-2020 The strace developers.
+# All rights reserved.
+#
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[ "x${D:-0}" != x1 ] || set -x
+
+mpers_name="$1"; shift
+mpers_cc_flags="$1"; shift
+size="$(printf %s "$mpers_name" |tr -cd '[0-9]')"
+[ "$size" -gt 0 ]
+
+srcdir=${0%/*}
+mpers_sh="${srcdir}/mpers.sh"
+
+mpers_dir="mpers-$mpers_name"
+mkdir -p "$mpers_dir"
+
+sample="$mpers_dir/sample.c"
+cat > "$sample" <<EOF
+#include <stdint.h>
+#include "mpers_type.h"
+#include DEF_MPERS_TYPE(sample_struct)
+typedef struct {
+ struct {
+ void *p;
+ char sc;
+ /* unsigned char mpers_filler_1[1]; */
+ short ss;
+ unsigned char uc;
+ /* unsigned char mpers_filler_2[3]; */
+ int si;
+ unsigned ui;
+ long sl;
+ unsigned short us;
+ /* unsigned char mpers_filler_3[6]; */
+ long long sll __attribute__((__aligned__(8)));
+ unsigned long long ull;
+ unsigned long ul;
+ long asl[3][5][7];
+ char f;
+ /* unsigned char mpers_end_filler_4[7]; */
+ } s;
+ union {
+ long long sll;
+ unsigned long long ull;
+ void *p;
+ long sl;
+ unsigned long ul;
+ int si;
+ unsigned ui;
+ short ss[7][9];
+ unsigned short us[4];
+ char sc;
+ unsigned char uc;
+ int8_t i8;
+ int16_t i16;
+ int32_t i32;
+ int64_t i64;
+ uint8_t u8;
+ uint16_t u16;
+ uint32_t u32;
+ uint64_t u64;
+ } u[3][2];
+ short f[0];
+} sample_struct;
+#include MPERS_DEFS
+EOF
+
+expected="$mpers_dir/sample.expected"
+mpers_ptr_t="uint${size}_t"
+cat > "$expected" <<EOF
+#include <stdint.h>
+#ifndef mpers_ptr_t_is_${mpers_ptr_t}
+typedef ${mpers_ptr_t} mpers_ptr_t;
+#define mpers_ptr_t_is_${mpers_ptr_t}
+#endif
+typedef
+struct {
+struct {
+mpers_ptr_t p;
+char sc;
+unsigned char mpers_filler_1[1];
+int16_t ss;
+unsigned char uc;
+unsigned char mpers_filler_2[3];
+int32_t si;
+uint32_t ui;
+int${size}_t sl;
+uint16_t us;
+unsigned char mpers_filler_3[6];
+int64_t sll;
+uint64_t ull;
+uint${size}_t ul;
+int${size}_t asl[3][5][7];
+char f;
+unsigned char mpers_end_filler_4[7];
+} ATTRIBUTE_PACKED s;
+union {
+int64_t sll;
+uint64_t ull;
+mpers_ptr_t p;
+int${size}_t sl;
+uint${size}_t ul;
+int32_t si;
+uint32_t ui;
+int16_t ss[7][9];
+uint16_t us[4];
+char sc;
+unsigned char uc;
+signed char i8;
+int16_t i16;
+int32_t i32;
+int64_t i64;
+unsigned char u8;
+uint16_t u16;
+uint32_t u32;
+uint64_t u64;
+} u[3][2];
+int16_t f[0];
+} ATTRIBUTE_PACKED ${mpers_name}_sample_struct;
+#define MPERS_${mpers_name}_sample_struct ${mpers_name}_sample_struct
+EOF
+
+CFLAGS="$CPPFLAGS -I${srcdir} -DMPERS_IS_${mpers_name}" \
+CPPFLAGS="$CPPFLAGS -I${srcdir} -DIN_MPERS -DMPERS_IS_${mpers_name}" \
+"$mpers_sh" "$mpers_name" "$mpers_cc_flags" "$sample"
+cmp "$expected" "$mpers_dir"/sample_struct.h > /dev/null
diff --git a/src/mpers_type.h b/src/mpers_type.h
new file mode 100644
index 000000000..322cfa904
--- /dev/null
+++ b/src/mpers_type.h
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2015 Elvira Khabirova <lineprinter0@gmail.com>
+ * Copyright (c) 2015 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_MPERS_TYPE_H
+# define STRACE_MPERS_TYPE_H
+
+# include "macros.h"
+
+# ifdef IN_MPERS
+# define DEF_MPERS_TYPE(args) STRINGIFY(args.h)
+# ifdef MPERS_IS_m32
+# define MPERS_PREFIX m32_
+# define MPERS_DEFS "m32_type_defs.h"
+# elif defined MPERS_IS_mx32
+# define MPERS_PREFIX mx32_
+# define MPERS_DEFS "mx32_type_defs.h"
+# endif
+# else
+# define MPERS_PREFIX
+# define DEF_MPERS_TYPE(args) "empty.h"
+# if IN_MPERS_BOOTSTRAP
+# define MPERS_DEFS "empty.h"
+# else
+# define MPERS_DEFS "native_defs.h"
+# endif
+typedef unsigned long mpers_ptr_t;
+# endif
+
+#endif /* !STRACE_MPERS_TYPE_H */
diff --git a/src/mq.c b/src/mq.c
new file mode 100644
index 000000000..555e92651
--- /dev/null
+++ b/src/mq.c
@@ -0,0 +1,110 @@
+/*
+ * Copyright (c) 2004 Ulrich Drepper <drepper@redhat.com>
+ * Copyright (c) 2005-2015 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2015-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include <fcntl.h>
+
+SYS_FUNC(mq_open)
+{
+ printpath(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ /* flags */
+ tprint_open_modes(tcp->u_arg[1]);
+ if (tcp->u_arg[1] & O_CREAT) {
+ /* mode */
+ tprints(", ");
+ print_numeric_umode_t(tcp->u_arg[2]);
+ tprints(", ");
+ printmqattr(tcp, tcp->u_arg[3], false);
+ }
+ return RVAL_DECODED | RVAL_FD;
+}
+
+static int
+do_mq_timedsend(struct tcb *const tcp, const print_obj_by_addr_fn print_ts)
+{
+ printfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ printstrn(tcp, tcp->u_arg[1], tcp->u_arg[2]);
+ tprintf(", %" PRI_klu ", %u, ", tcp->u_arg[2],
+ (unsigned int) tcp->u_arg[3]);
+ print_ts(tcp, tcp->u_arg[4]);
+ return RVAL_DECODED;
+}
+
+#if HAVE_ARCH_TIME32_SYSCALLS
+SYS_FUNC(mq_timedsend_time32)
+{
+ return do_mq_timedsend(tcp, print_timespec32);
+}
+#endif
+
+SYS_FUNC(mq_timedsend_time64)
+{
+ return do_mq_timedsend(tcp, print_timespec64);
+}
+
+static int
+do_mq_timedreceive(struct tcb *const tcp, const print_obj_by_addr_fn print_ts)
+{
+ if (entering(tcp)) {
+ printfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ } else {
+ if (syserror(tcp))
+ printaddr(tcp->u_arg[1]);
+ else
+ printstrn(tcp, tcp->u_arg[1], tcp->u_rval);
+ tprintf(", %" PRI_klu ", ", tcp->u_arg[2]);
+ printnum_int(tcp, tcp->u_arg[3], "%u");
+ tprints(", ");
+ /*
+ * Since the timeout parameter is read by the kernel
+ * on entering syscall, it has to be decoded the same way
+ * whether the syscall has failed or not.
+ */
+ temporarily_clear_syserror(tcp);
+ print_ts(tcp, tcp->u_arg[4]);
+ restore_cleared_syserror(tcp);
+ }
+ return 0;
+}
+
+#if HAVE_ARCH_TIME32_SYSCALLS
+SYS_FUNC(mq_timedreceive_time32)
+{
+ return do_mq_timedreceive(tcp, print_timespec32);
+}
+#endif
+
+SYS_FUNC(mq_timedreceive_time64)
+{
+ return do_mq_timedreceive(tcp, print_timespec64);
+}
+
+SYS_FUNC(mq_notify)
+{
+ printfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ print_sigevent(tcp, tcp->u_arg[1]);
+ return RVAL_DECODED;
+}
+
+SYS_FUNC(mq_getsetattr)
+{
+ if (entering(tcp)) {
+ printfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ printmqattr(tcp, tcp->u_arg[1], true);
+ tprints(", ");
+ } else {
+ printmqattr(tcp, tcp->u_arg[2], true);
+ }
+ return 0;
+}
diff --git a/src/msghdr.c b/src/msghdr.c
new file mode 100644
index 000000000..1174e1653
--- /dev/null
+++ b/src/msghdr.c
@@ -0,0 +1,530 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1996-2000 Wichert Akkerman <wichert@cistron.nl>
+ * Copyright (c) 2005-2016 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2016-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include "msghdr.h"
+#include <limits.h>
+#include <arpa/inet.h>
+#include <netinet/in.h>
+
+#define XLAT_MACROS_ONLY
+#include "xlat/sock_options.h"
+#undef XLAT_MACROS_ONLY
+#include "xlat/msg_flags.h"
+#include "xlat/scmvals.h"
+#include "xlat/ip_cmsg_types.h"
+
+#ifndef current_wordsize
+struct cmsghdr32 {
+ uint32_t cmsg_len;
+ int cmsg_level;
+ int cmsg_type;
+};
+#endif
+
+typedef union {
+ char *ptr;
+ struct cmsghdr *cmsg;
+#ifndef current_wordsize
+ struct cmsghdr32 *cmsg32;
+#endif
+} union_cmsghdr;
+
+static void
+print_scm_rights(struct tcb *tcp, const void *cmsg_data,
+ const unsigned int data_len)
+{
+ const int *fds = cmsg_data;
+ const unsigned int nfds = data_len / sizeof(*fds);
+ unsigned int i;
+
+ tprints("[");
+
+ for (i = 0; i < nfds; ++i) {
+ if (i)
+ tprints(", ");
+ if (abbrev(tcp) && i >= max_strlen) {
+ tprint_more_data_follows();
+ break;
+ }
+ printfd(tcp, fds[i]);
+ }
+
+ tprints("]");
+}
+
+static void
+print_scm_creds(struct tcb *tcp, const void *cmsg_data,
+ const unsigned int data_len)
+{
+ const struct ucred *uc = cmsg_data;
+
+ tprint_struct_begin();
+ PRINT_FIELD_TGID(*uc, pid, tcp);
+ tprint_struct_next();
+ PRINT_FIELD_ID(*uc, uid);
+ tprint_struct_next();
+ PRINT_FIELD_ID(*uc, gid);
+ tprint_struct_end();
+}
+
+static void
+print_scm_security(struct tcb *tcp, const void *cmsg_data,
+ const unsigned int data_len)
+{
+ print_quoted_string(cmsg_data, data_len, 0);
+}
+
+static void
+print_scm_timestamp_old(struct tcb *tcp, const void *cmsg_data,
+ const unsigned int data_len)
+{
+ print_struct_timeval_data_size(cmsg_data, data_len);
+}
+
+#ifdef current_klongsize
+# if current_klongsize == 4
+# define PRINT_TIMESPEC_DATA_SIZE print_timespec32_data_size
+# define PRINT_TIMESPEC_ARRAY_DATA_SIZE print_timespec32_array_data_size
+# else
+# define PRINT_TIMESPEC_DATA_SIZE print_timespec64_data_size
+# define PRINT_TIMESPEC_ARRAY_DATA_SIZE print_timespec64_array_data_size
+# endif
+#else
+# define PRINT_TIMESPEC_DATA_SIZE \
+ ((current_klongsize == 4) ? \
+ print_timespec32_data_size : \
+ print_timespec64_data_size)
+# define PRINT_TIMESPEC_ARRAY_DATA_SIZE \
+ ((current_klongsize == 4) ? \
+ print_timespec32_array_data_size : \
+ print_timespec64_array_data_size)
+#endif
+
+static void
+print_scm_timestampns_old(struct tcb *tcp, const void *cmsg_data,
+ const unsigned int data_len)
+{
+ PRINT_TIMESPEC_DATA_SIZE(cmsg_data, data_len);
+}
+
+static void
+print_scm_timestamping_old(struct tcb *tcp, const void *cmsg_data,
+ const unsigned int data_len)
+{
+ PRINT_TIMESPEC_ARRAY_DATA_SIZE(cmsg_data, 3, data_len);
+}
+
+static void
+print_scm_timestamp_new(struct tcb *tcp, const void *cmsg_data,
+ const unsigned int data_len)
+{
+ print_timeval64_data_size(cmsg_data, data_len);
+}
+
+static void
+print_scm_timestampns_new(struct tcb *tcp, const void *cmsg_data,
+ const unsigned int data_len)
+{
+ print_timespec64_data_size(cmsg_data, data_len);
+}
+
+static void
+print_scm_timestamping_new(struct tcb *tcp, const void *cmsg_data,
+ const unsigned int data_len)
+{
+ print_timespec64_array_data_size(cmsg_data, 3, data_len);
+}
+
+static void
+print_cmsg_ip_pktinfo(struct tcb *tcp, const void *cmsg_data,
+ const unsigned int data_len)
+{
+ const struct in_pktinfo *info = cmsg_data;
+
+ tprint_struct_begin();
+ PRINT_FIELD_IFINDEX(*info, ipi_ifindex);
+ tprint_struct_next();
+ PRINT_FIELD_INET_ADDR(*info, ipi_spec_dst, AF_INET);
+ tprint_struct_next();
+ PRINT_FIELD_INET_ADDR(*info, ipi_addr, AF_INET);
+ tprint_struct_end();
+}
+
+static void
+print_cmsg_uint(struct tcb *tcp, const void *cmsg_data,
+ const unsigned int data_len)
+{
+ const unsigned int *p = cmsg_data;
+
+ tprintf("[%u]", *p);
+}
+
+static void
+print_cmsg_uint8_t(struct tcb *tcp, const void *cmsg_data,
+ const unsigned int data_len)
+{
+ const uint8_t *p = cmsg_data;
+
+ tprintf("[%#x]", *p);
+}
+
+static void
+print_cmsg_ip_opts(struct tcb *tcp, const void *cmsg_data,
+ const unsigned int data_len)
+{
+ const unsigned char *opts = cmsg_data;
+ unsigned int i;
+
+ tprints("[");
+ for (i = 0; i < data_len; ++i) {
+ if (i)
+ tprints(", ");
+ if (abbrev(tcp) && i >= max_strlen) {
+ tprint_more_data_follows();
+ break;
+ }
+ tprintf("0x%02x", opts[i]);
+ }
+ tprints("]");
+}
+
+struct sock_ee {
+ uint32_t ee_errno;
+ uint8_t ee_origin;
+ uint8_t ee_type;
+ uint8_t ee_code;
+ uint8_t ee_pad;
+ uint32_t ee_info;
+ uint32_t ee_data;
+ struct sockaddr_in offender;
+};
+
+static void
+print_cmsg_ip_recverr(struct tcb *tcp, const void *cmsg_data,
+ const unsigned int data_len)
+{
+ const struct sock_ee *const err = cmsg_data;
+
+ tprint_struct_begin();
+ PRINT_FIELD_U(*err, ee_errno);
+ tprint_struct_next();
+ PRINT_FIELD_U(*err, ee_origin);
+ tprint_struct_next();
+ PRINT_FIELD_U(*err, ee_type);
+ tprint_struct_next();
+ PRINT_FIELD_U(*err, ee_code);
+ tprint_struct_next();
+ PRINT_FIELD_U(*err, ee_info);
+ tprint_struct_next();
+ PRINT_FIELD_U(*err, ee_data);
+ tprint_struct_next();
+ PRINT_FIELD_SOCKADDR(*err, offender, tcp);
+ tprint_struct_end();
+}
+
+static void
+print_cmsg_ip_origdstaddr(struct tcb *tcp, const void *cmsg_data,
+ const unsigned int data_len)
+{
+ const unsigned int addr_len =
+ data_len > sizeof(struct sockaddr_storage)
+ ? sizeof(struct sockaddr_storage) : data_len;
+
+ print_sockaddr(tcp, cmsg_data, addr_len);
+}
+
+typedef void (* const cmsg_printer)(struct tcb *, const void *, unsigned int);
+
+static const struct {
+ const cmsg_printer printer;
+ const unsigned int min_len;
+} cmsg_socket_printers[] = {
+ [SCM_RIGHTS] = { print_scm_rights, sizeof(int) },
+ [SCM_CREDENTIALS] = { print_scm_creds, sizeof(struct ucred) },
+ [SCM_SECURITY] = { print_scm_security, 1 },
+ [SO_TIMESTAMP_OLD] = { print_scm_timestamp_old, 1 },
+ [SO_TIMESTAMPNS_OLD] = { print_scm_timestampns_old, 1 },
+ [SO_TIMESTAMPING_OLD] = { print_scm_timestamping_old, 1 },
+ [SO_TIMESTAMP_NEW] = { print_scm_timestamp_new, 1 },
+ [SO_TIMESTAMPNS_NEW] = { print_scm_timestampns_new, 1 },
+ [SO_TIMESTAMPING_NEW] = { print_scm_timestamping_new, 1 }
+}, cmsg_ip_printers[] = {
+ [IP_PKTINFO] = { print_cmsg_ip_pktinfo, sizeof(struct in_pktinfo) },
+ [IP_TTL] = { print_cmsg_uint, sizeof(unsigned int) },
+ [IP_TOS] = { print_cmsg_uint8_t, 1 },
+ [IP_RECVOPTS] = { print_cmsg_ip_opts, 1 },
+ [IP_RETOPTS] = { print_cmsg_ip_opts, 1 },
+ [IP_RECVERR] = { print_cmsg_ip_recverr, sizeof(struct sock_ee) },
+ [IP_ORIGDSTADDR] = { print_cmsg_ip_origdstaddr, sizeof(struct sockaddr_in) },
+ [IP_CHECKSUM] = { print_cmsg_uint, sizeof(unsigned int) },
+ [SCM_SECURITY] = { print_scm_security, 1 }
+};
+
+static void
+print_cmsg_type_data(struct tcb *tcp, const int cmsg_level, const int cmsg_type,
+ const void *cmsg_data, const unsigned int data_len)
+{
+ const unsigned int utype = cmsg_type;
+ switch (cmsg_level) {
+ case SOL_SOCKET:
+ printxval(scmvals, cmsg_type, "SCM_???");
+ if (utype < ARRAY_SIZE(cmsg_socket_printers)
+ && cmsg_socket_printers[utype].printer
+ && data_len >= cmsg_socket_printers[utype].min_len) {
+ tprint_struct_next();
+ tprints_field_name("cmsg_data");
+ cmsg_socket_printers[utype].printer(tcp, cmsg_data, data_len);
+ }
+ break;
+ case SOL_IP:
+ printxval(ip_cmsg_types, cmsg_type, "IP_???");
+ if (utype < ARRAY_SIZE(cmsg_ip_printers)
+ && cmsg_ip_printers[utype].printer
+ && data_len >= cmsg_ip_printers[utype].min_len) {
+ tprint_struct_next();
+ tprints_field_name("cmsg_data");
+ cmsg_ip_printers[utype].printer(tcp, cmsg_data, data_len);
+ }
+ break;
+ default:
+ tprintf("%#x", cmsg_type);
+ }
+}
+
+static unsigned int
+get_optmem_max(struct tcb *tcp)
+{
+ static int optmem_max;
+
+ if (!optmem_max) {
+ if (read_int_from_file("/proc/sys/net/core/optmem_max",
+ &optmem_max) || optmem_max <= 0) {
+ optmem_max = sizeof(long long) * (2 * IOV_MAX + 512);
+ } else {
+ optmem_max = (optmem_max + sizeof(long long) - 1)
+ & ~(sizeof(long long) - 1);
+ }
+ }
+
+ return optmem_max;
+}
+
+static void
+decode_msg_control(struct tcb *const tcp, const kernel_ulong_t addr,
+ const kernel_ulong_t in_control_len)
+{
+ if (!in_control_len)
+ return;
+ tprint_struct_next();
+ tprints_field_name("msg_control");
+
+ const unsigned int cmsg_size =
+#ifndef current_wordsize
+ (current_wordsize < sizeof(long)) ? sizeof(struct cmsghdr32) :
+#endif
+ sizeof(struct cmsghdr);
+
+ unsigned int control_len = in_control_len > get_optmem_max(tcp)
+ ? get_optmem_max(tcp) : in_control_len;
+ unsigned int buf_len = control_len;
+ char *buf = buf_len < cmsg_size ? NULL : malloc(buf_len);
+ if (!buf || umoven(tcp, addr, buf_len, buf) < 0) {
+ printaddr(addr);
+ free(buf);
+ return;
+ }
+
+ union_cmsghdr u = { .ptr = buf };
+
+ tprints("[");
+ while (buf_len >= cmsg_size) {
+ const kernel_ulong_t cmsg_len =
+#ifndef current_wordsize
+ (current_wordsize < sizeof(long)) ? u.cmsg32->cmsg_len :
+#endif
+ u.cmsg->cmsg_len;
+ const int cmsg_level =
+#ifndef current_wordsize
+ (current_wordsize < sizeof(long)) ? u.cmsg32->cmsg_level :
+#endif
+ u.cmsg->cmsg_level;
+ const int cmsg_type =
+#ifndef current_wordsize
+ (current_wordsize < sizeof(long)) ? u.cmsg32->cmsg_type :
+#endif
+ u.cmsg->cmsg_type;
+
+ if (u.ptr != buf)
+ tprints(", ");
+ tprint_struct_begin();
+ tprints_field_name("cmsg_len");
+ tprintf("%" PRI_klu, cmsg_len);
+ tprint_struct_next();
+ tprints_field_name("cmsg_level");
+ printxval(socketlayers, cmsg_level, "SOL_???");
+ tprint_struct_next();
+ tprints_field_name("cmsg_type");
+
+ kernel_ulong_t len = cmsg_len > buf_len ? buf_len : cmsg_len;
+
+ print_cmsg_type_data(tcp, cmsg_level, cmsg_type,
+ (const void *) (u.ptr + cmsg_size),
+ len > cmsg_size ? len - cmsg_size : 0);
+ tprint_struct_end();
+
+ if (len < cmsg_size) {
+ buf_len -= cmsg_size;
+ break;
+ }
+ len = (cmsg_len + current_wordsize - 1) &
+ ~((kernel_ulong_t) current_wordsize - 1);
+ if (len >= buf_len) {
+ buf_len = 0;
+ break;
+ }
+ u.ptr += len;
+ buf_len -= len;
+ }
+ if (buf_len) {
+ tprint_array_next();
+ tprint_more_data_follows();
+ printaddr_comment(addr + (control_len - buf_len));
+ } else if (control_len < in_control_len) {
+ tprint_array_next();
+ tprint_more_data_follows();
+ }
+ tprints("]");
+ free(buf);
+}
+
+void
+print_struct_msghdr(struct tcb *tcp, const struct msghdr *msg,
+ const int *const p_user_msg_namelen,
+ const kernel_ulong_t data_size)
+{
+ const int msg_namelen =
+ p_user_msg_namelen && (int) msg->msg_namelen > *p_user_msg_namelen
+ ? *p_user_msg_namelen : (int) msg->msg_namelen;
+
+ tprint_struct_begin();
+ tprints_field_name("msg_name");
+ const int family =
+ decode_sockaddr(tcp, ptr_to_kulong(msg->msg_name), msg_namelen);
+ const enum iov_decode decode =
+ (family == AF_NETLINK) ? IOV_DECODE_NETLINK : IOV_DECODE_STR;
+
+ tprint_struct_next();
+ tprints_field_name("msg_namelen");
+ if (p_user_msg_namelen && *p_user_msg_namelen != (int) msg->msg_namelen)
+ tprintf("%d->", *p_user_msg_namelen);
+ tprintf("%d", msg->msg_namelen);
+
+ tprint_struct_next();
+ tprints_field_name("msg_iov");
+ tprint_iov_upto(tcp, msg->msg_iovlen,
+ ptr_to_kulong(msg->msg_iov), decode, data_size);
+ tprint_struct_next();
+ PRINT_FIELD_U(*msg, msg_iovlen);
+
+ decode_msg_control(tcp, ptr_to_kulong(msg->msg_control),
+ msg->msg_controllen);
+ tprint_struct_next();
+ PRINT_FIELD_U(*msg, msg_controllen);
+
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(*msg, msg_flags, msg_flags, "MSG_???");
+ tprint_struct_end();
+}
+
+static bool
+fetch_msghdr_namelen(struct tcb *const tcp, const kernel_ulong_t addr,
+ int *const p_msg_namelen)
+{
+ struct msghdr msg;
+
+ if (addr && verbose(tcp) && fetch_struct_msghdr(tcp, addr, &msg)) {
+ *p_msg_namelen = msg.msg_namelen;
+ return true;
+ } else {
+ return false;
+ }
+}
+
+static void
+decode_msghdr(struct tcb *const tcp, const int *const p_user_msg_namelen,
+ const kernel_ulong_t addr, const kernel_ulong_t data_size)
+{
+ struct msghdr msg;
+
+ if (addr && verbose(tcp) && fetch_struct_msghdr(tcp, addr, &msg))
+ print_struct_msghdr(tcp, &msg, p_user_msg_namelen, data_size);
+ else
+ printaddr(addr);
+}
+
+void
+dumpiov_in_msghdr(struct tcb *const tcp, const kernel_ulong_t addr,
+ const kernel_ulong_t data_size)
+{
+ struct msghdr msg;
+
+ if (fetch_struct_msghdr(tcp, addr, &msg)) {
+ dumpiov_upto(tcp, msg.msg_iovlen,
+ ptr_to_kulong(msg.msg_iov), data_size);
+ }
+}
+
+SYS_FUNC(sendmsg)
+{
+ printfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ decode_msghdr(tcp, 0, tcp->u_arg[1], -1);
+ /* flags */
+ tprints(", ");
+ printflags(msg_flags, tcp->u_arg[2], "MSG_???");
+
+ return RVAL_DECODED;
+}
+
+SYS_FUNC(recvmsg)
+{
+ int msg_namelen;
+
+ if (entering(tcp)) {
+ printfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ if (fetch_msghdr_namelen(tcp, tcp->u_arg[1], &msg_namelen)) {
+ set_tcb_priv_ulong(tcp, msg_namelen);
+ return 0;
+ }
+ printaddr(tcp->u_arg[1]);
+ } else {
+ msg_namelen = get_tcb_priv_ulong(tcp);
+
+ if (syserror(tcp)) {
+ tprint_struct_begin();
+ tprints_field_name("msg_namelen");
+ tprintf("%d", msg_namelen);
+ tprint_struct_end();
+ } else {
+ decode_msghdr(tcp, &msg_namelen, tcp->u_arg[1],
+ tcp->u_rval);
+ }
+ }
+
+ /* flags */
+ tprints(", ");
+ printflags(msg_flags, tcp->u_arg[2], "MSG_???");
+
+ return RVAL_DECODED;
+}
diff --git a/src/msghdr.h b/src/msghdr.h
new file mode 100644
index 000000000..7e56aa197
--- /dev/null
+++ b/src/msghdr.h
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2016-2018 Dmitry V. Levin <ldv@strace.io>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_MSGHDR_H
+# define STRACE_MSGHDR_H
+
+/* For definitions of struct msghdr and struct mmsghdr. */
+# include <sys/socket.h>
+
+# ifndef HAVE_STRUCT_MMSGHDR
+struct mmsghdr {
+ struct msghdr msg_hdr;
+ unsigned msg_len;
+};
+# endif
+
+struct tcb;
+
+extern void
+print_struct_msghdr(struct tcb *, const struct msghdr *,
+ const int *p_user_msg_namelen, kernel_ulong_t data_size);
+
+#endif /* !STRACE_MSGHDR_H */
diff --git a/src/mtd.c b/src/mtd.c
new file mode 100644
index 000000000..532f9fe5d
--- /dev/null
+++ b/src/mtd.c
@@ -0,0 +1,385 @@
+/*
+ * Copyright (c) 2012 Mike Frysinger <vapier@gentoo.org>
+ * Copyright (c) 2012-2018 The strace developers.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#ifdef HAVE_STRUCT_MTD_WRITE_REQ
+
+# include DEF_MPERS_TYPE(struct_mtd_oob_buf)
+
+# include <linux/ioctl.h>
+# include <mtd/mtd-abi.h>
+
+typedef struct mtd_oob_buf struct_mtd_oob_buf;
+
+#endif /* HAVE_STRUCT_MTD_WRITE_REQ */
+
+#include MPERS_DEFS
+
+#ifdef HAVE_STRUCT_MTD_WRITE_REQ
+
+# include "xlat/mtd_mode_options.h"
+# include "xlat/mtd_file_mode_options.h"
+# include "xlat/mtd_type_options.h"
+# include "xlat/mtd_flags_options.h"
+# include "xlat/mtd_otp_options.h"
+# include "xlat/mtd_nandecc_options.h"
+
+static void
+decode_erase_info_user(struct tcb *const tcp, const kernel_ulong_t addr)
+{
+ struct erase_info_user einfo;
+
+ tprints(", ");
+ if (umove_or_printaddr(tcp, addr, &einfo))
+ return;
+
+ tprint_struct_begin();
+ PRINT_FIELD_X(einfo, start);
+ tprint_struct_next();
+ PRINT_FIELD_X(einfo, length);
+ tprint_struct_end();
+}
+
+static void
+decode_erase_info_user64(struct tcb *const tcp, const kernel_ulong_t addr)
+{
+ struct erase_info_user64 einfo64;
+
+ tprints(", ");
+ if (umove_or_printaddr(tcp, addr, &einfo64))
+ return;
+
+ tprint_struct_begin();
+ PRINT_FIELD_X(einfo64, start);
+ tprint_struct_next();
+ PRINT_FIELD_X(einfo64, length);
+ tprint_struct_end();
+}
+
+static void
+decode_mtd_oob_buf(struct tcb *const tcp, const kernel_ulong_t addr)
+{
+ struct_mtd_oob_buf mbuf;
+
+ tprints(", ");
+ if (umove_or_printaddr(tcp, addr, &mbuf))
+ return;
+ tprint_struct_begin();
+ PRINT_FIELD_X(mbuf, start);
+ tprint_struct_next();
+ PRINT_FIELD_X(mbuf, length);
+ tprint_struct_next();
+ PRINT_FIELD_PTR(mbuf, ptr);
+ tprint_struct_end();
+}
+
+static void
+decode_mtd_oob_buf64(struct tcb *const tcp, const kernel_ulong_t addr)
+{
+ struct mtd_oob_buf64 mbuf64;
+
+ tprints(", ");
+ if (umove_or_printaddr(tcp, addr, &mbuf64))
+ return;
+
+ tprint_struct_begin();
+ PRINT_FIELD_X(mbuf64, start);
+ tprint_struct_next();
+ PRINT_FIELD_X(mbuf64, length);
+ tprint_struct_next();
+ PRINT_FIELD_ADDR64(mbuf64, usr_ptr);
+ tprint_struct_end();
+}
+
+static void
+decode_otp_info(struct tcb *const tcp, const kernel_ulong_t addr)
+{
+ struct otp_info oinfo;
+
+ tprints(", ");
+ if (umove_or_printaddr(tcp, addr, &oinfo))
+ return;
+
+ tprint_struct_begin();
+ PRINT_FIELD_X(oinfo, start);
+ tprint_struct_next();
+ PRINT_FIELD_X(oinfo, length);
+ tprint_struct_next();
+ PRINT_FIELD_U(oinfo, locked);
+ tprint_struct_end();
+}
+
+static void
+decode_otp_select(struct tcb *const tcp, const kernel_ulong_t addr)
+{
+ unsigned int i;
+
+ tprints(", ");
+ if (umove_or_printaddr(tcp, addr, &i))
+ return;
+
+ tprints("[");
+ printxval(mtd_otp_options, i, "MTD_OTP_???");
+ tprints("]");
+}
+
+static void
+decode_mtd_write_req(struct tcb *const tcp, const kernel_ulong_t addr)
+{
+ struct mtd_write_req mreq;
+
+ tprints(", ");
+ if (umove_or_printaddr(tcp, addr, &mreq))
+ return;
+
+ tprint_struct_begin();
+ PRINT_FIELD_X(mreq, start);
+ tprint_struct_next();
+ PRINT_FIELD_X(mreq, len);
+ tprint_struct_next();
+ PRINT_FIELD_X(mreq, ooblen);
+ tprint_struct_next();
+ PRINT_FIELD_ADDR64(mreq, usr_data);
+ tprint_struct_next();
+ PRINT_FIELD_ADDR64(mreq, usr_oob);
+ tprint_struct_next();
+ PRINT_FIELD_XVAL(mreq, mode, mtd_mode_options, "MTD_OPS_???");
+ tprint_struct_end();
+}
+
+static void
+decode_mtd_info_user(struct tcb *const tcp, const kernel_ulong_t addr)
+{
+ struct mtd_info_user minfo;
+
+ tprints(", ");
+ if (umove_or_printaddr(tcp, addr, &minfo))
+ return;
+
+ tprint_struct_begin();
+ PRINT_FIELD_XVAL(minfo, type, mtd_type_options, "MTD_???");
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(minfo, flags, mtd_flags_options, "MTD_???");
+ tprint_struct_next();
+ PRINT_FIELD_X(minfo, size);
+ tprint_struct_next();
+ PRINT_FIELD_X(minfo, erasesize);
+ tprint_struct_next();
+ PRINT_FIELD_X(minfo, writesize);
+ tprint_struct_next();
+ PRINT_FIELD_X(minfo, oobsize);
+ tprint_struct_next();
+ PRINT_FIELD_X(minfo, padding);
+ tprint_struct_end();
+}
+
+static bool
+print_xint32x2_array_member(struct tcb *tcp, void *elem_buf, size_t elem_size,
+ void *data)
+{
+ print_local_array_ex(tcp, elem_buf, 2, sizeof(int),
+ print_xint32_array_member, NULL, 0, NULL, NULL);
+ return true;
+}
+
+static void
+decode_nand_oobinfo(struct tcb *const tcp, const kernel_ulong_t addr)
+{
+ struct nand_oobinfo ninfo;
+
+ tprints(", ");
+ if (umove_or_printaddr(tcp, addr, &ninfo))
+ return;
+
+ tprint_struct_begin();
+ PRINT_FIELD_XVAL(ninfo, useecc, mtd_nandecc_options, "MTD_NANDECC_???");
+ tprint_struct_next();
+ PRINT_FIELD_X(ninfo, eccbytes);
+ tprint_struct_next();
+ PRINT_FIELD_ARRAY(ninfo, oobfree, tcp, print_xint32x2_array_member);
+ tprint_struct_next();
+ PRINT_FIELD_ARRAY(ninfo, eccpos, tcp, print_xint32_array_member);
+ tprint_struct_end();
+}
+
+static bool
+print_nand_oobfree_array_member(struct tcb *tcp, void *elem_buf,
+ size_t elem_size, void *data)
+{
+ const struct nand_oobfree *p = elem_buf;
+ tprint_struct_begin();
+ PRINT_FIELD_X(*p, offset);
+ tprint_struct_next();
+ PRINT_FIELD_X(*p, length);
+ tprint_struct_end();
+ return true;
+}
+
+static void
+decode_nand_ecclayout_user(struct tcb *const tcp, const kernel_ulong_t addr)
+{
+ struct nand_ecclayout_user nlay;
+
+ tprints(", ");
+ if (umove_or_printaddr(tcp, addr, &nlay))
+ return;
+
+ tprint_struct_begin();
+ PRINT_FIELD_X(nlay, eccbytes);
+ tprint_struct_next();
+ PRINT_FIELD_ARRAY(nlay, eccpos, tcp, print_xint32_array_member);
+ tprint_struct_next();
+ PRINT_FIELD_X(nlay, oobavail);
+ tprint_struct_next();
+ PRINT_FIELD_ARRAY(nlay, oobfree, tcp, print_nand_oobfree_array_member);
+ tprint_struct_end();
+}
+
+static void
+decode_mtd_ecc_stats(struct tcb *const tcp, const kernel_ulong_t addr)
+{
+ struct mtd_ecc_stats es;
+
+ tprints(", ");
+ if (umove_or_printaddr(tcp, addr, &es))
+ return;
+
+ tprint_struct_begin();
+ PRINT_FIELD_X(es, corrected);
+ tprint_struct_next();
+ PRINT_FIELD_X(es, failed);
+ tprint_struct_next();
+ PRINT_FIELD_X(es, badblocks);
+ tprint_struct_next();
+ PRINT_FIELD_X(es, bbtblocks);
+ tprint_struct_end();
+}
+
+MPERS_PRINTER_DECL(int, mtd_ioctl, struct tcb *const tcp,
+ const unsigned int code, const kernel_ulong_t arg)
+{
+ switch (code) {
+ case MEMERASE:
+ case MEMLOCK:
+ case MEMUNLOCK:
+ case MEMISLOCKED:
+ decode_erase_info_user(tcp, arg);
+ break;
+
+ case MEMERASE64:
+ decode_erase_info_user64(tcp, arg);
+ break;
+
+ case MEMWRITEOOB:
+ case MEMREADOOB:
+ decode_mtd_oob_buf(tcp, arg);
+ break;
+
+ case MEMWRITEOOB64:
+ case MEMREADOOB64:
+ decode_mtd_oob_buf64(tcp, arg);
+ break;
+
+ case MEMWRITE:
+ decode_mtd_write_req(tcp, arg);
+ break;
+
+ case OTPGETREGIONINFO:
+ if (entering(tcp))
+ return 0;
+ ATTRIBUTE_FALLTHROUGH;
+ case OTPLOCK:
+ decode_otp_info(tcp, arg);
+ break;
+
+ case OTPSELECT:
+ decode_otp_select(tcp, arg);
+ break;
+
+ case MTDFILEMODE:
+ tprints(", ");
+ printxval64(mtd_file_mode_options, arg, "MTD_FILE_MODE_???");
+ break;
+
+ case MEMGETBADBLOCK:
+ case MEMSETBADBLOCK:
+ tprints(", ");
+ printnum_int64(tcp, arg, "%" PRIu64);
+ break;
+
+ case MEMGETINFO:
+ if (entering(tcp))
+ return 0;
+ decode_mtd_info_user(tcp, arg);
+ break;
+
+ case MEMGETOOBSEL:
+ if (entering(tcp))
+ return 0;
+ decode_nand_oobinfo(tcp, arg);
+ break;
+
+ case ECCGETLAYOUT:
+ if (entering(tcp))
+ return 0;
+ decode_nand_ecclayout_user(tcp, arg);
+ break;
+
+ case ECCGETSTATS:
+ if (entering(tcp))
+ return 0;
+ decode_mtd_ecc_stats(tcp, arg);
+ break;
+
+ case OTPGETREGIONCOUNT:
+ if (entering(tcp))
+ return 0;
+ tprints(", ");
+ printnum_int(tcp, arg, "%u");
+ break;
+
+ case MEMGETREGIONCOUNT:
+ if (entering(tcp))
+ return 0;
+ tprints(", ");
+ printnum_int(tcp, arg, "%d");
+ break;
+
+ case MEMGETREGIONINFO:
+ if (entering(tcp)) {
+ struct region_info_user rinfo;
+
+ tprints(", ");
+ if (umove_or_printaddr(tcp, arg, &rinfo))
+ break;
+ tprint_struct_begin();
+ PRINT_FIELD_X(rinfo, regionindex);
+ return 0;
+ } else {
+ struct region_info_user rinfo;
+
+ if (!syserror(tcp) && !umove(tcp, arg, &rinfo)) {
+ tprint_struct_next();
+ PRINT_FIELD_X(rinfo, offset);
+ tprint_struct_next();
+ PRINT_FIELD_X(rinfo, erasesize);
+ tprint_struct_next();
+ PRINT_FIELD_X(rinfo, numblocks);
+ }
+ tprint_struct_end();
+ break;
+ }
+
+ default:
+ return RVAL_DECODED;
+ }
+
+ return RVAL_IOCTL_DECODED;
+}
+
+#endif /* HAVE_STRUCT_MTD_WRITE_REQ */
diff --git a/src/native_defs.h b/src/native_defs.h
new file mode 100644
index 000000000..fca3b43b1
--- /dev/null
+++ b/src/native_defs.h
@@ -0,0 +1,11 @@
+/*
+ * Copyright (c) 2015-2018 Dmitry V. Levin <ldv@strace.io>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#undef MPERS_PRINTER_NAME
+#define MPERS_PRINTER_NAME(printer_name) printer_name
+
+#include "native_printer_decls.h"
diff --git a/src/nbd_ioctl.c b/src/nbd_ioctl.c
new file mode 100644
index 000000000..a43fdd96b
--- /dev/null
+++ b/src/nbd_ioctl.c
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include <linux/ioctl.h>
+#include <linux/types.h>
+#include <linux/nbd.h>
+
+#define XLAT_MACROS_ONLY
+#include "xlat/nbd_ioctl_cmds.h"
+#undef XLAT_MACROS_ONLY
+
+#include "xlat/nbd_ioctl_flags.h"
+
+int
+nbd_ioctl(struct tcb *const tcp, const unsigned int code,
+ const kernel_ulong_t arg)
+{
+ switch (code) {
+ case NBD_DISCONNECT:
+ case NBD_CLEAR_SOCK:
+ case NBD_DO_IT:
+ case NBD_CLEAR_QUE:
+ case NBD_PRINT_DEBUG:
+ return RVAL_IOCTL_DECODED;
+
+ case NBD_SET_SOCK:
+ tprints(", ");
+ printfd(tcp, arg);
+ return RVAL_IOCTL_DECODED;
+
+ case NBD_SET_BLKSIZE:
+ case NBD_SET_SIZE:
+ case NBD_SET_SIZE_BLOCKS:
+ case NBD_SET_TIMEOUT:
+ tprints(", ");
+ tprintf("%" PRI_klu, arg);
+ return RVAL_IOCTL_DECODED;
+
+ case NBD_SET_FLAGS:
+ tprints(", ");
+ printflags(nbd_ioctl_flags, arg, "NBD_IOC_FLAG_???");
+ return RVAL_IOCTL_DECODED;
+
+ default:
+ return RVAL_DECODED;
+ }
+}
diff --git a/src/negated_errno.h b/src/negated_errno.h
new file mode 100644
index 000000000..06ae4d6e3
--- /dev/null
+++ b/src/negated_errno.h
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2015-2017 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2017-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_NEGATED_ERRNO_H
+# define STRACE_NEGATED_ERRNO_H
+
+/*
+ * Check the syscall return value register value for whether it is
+ * a negated errno code indicating an error, or a success return value.
+ */
+static inline bool
+is_negated_errno(kernel_ulong_t val)
+{
+ kernel_ulong_t max = -(kernel_long_t) MAX_ERRNO_VALUE;
+
+# ifndef current_klongsize
+ if (current_klongsize < sizeof(val)) {
+ val = (uint32_t) val;
+ max = (uint32_t) max;
+ }
+# endif /* !current_klongsize */
+
+ return val >= max;
+}
+
+#endif /* !STRACE_NEGATED_ERRNO_H */
diff --git a/src/net.c b/src/net.c
new file mode 100644
index 000000000..85bf04c6e
--- /dev/null
+++ b/src/net.c
@@ -0,0 +1,1051 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1996-2000 Wichert Akkerman <wichert@cistron.nl>
+ * Copyright (c) 1999-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#include <sys/stat.h>
+#include <sys/socket.h>
+#include <sys/uio.h>
+#include <sys/un.h>
+#include <netinet/in.h>
+#ifdef HAVE_NETINET_TCP_H
+# include <netinet/tcp.h>
+#endif
+#ifdef HAVE_NETINET_UDP_H
+# include <netinet/udp.h>
+#endif
+#ifdef HAVE_NETINET_SCTP_H
+# include <netinet/sctp.h>
+#endif
+#include <arpa/inet.h>
+#include <net/if.h>
+#include <asm/types.h>
+#ifdef HAVE_NETIPX_IPX_H
+# include <netipx/ipx.h>
+#else
+# include <linux/ipx.h>
+#endif
+
+#if defined(HAVE_LINUX_IP_VS_H)
+# include <linux/ip_vs.h>
+#endif
+#include "netlink.h"
+#if defined(HAVE_LINUX_NETFILTER_ARP_ARP_TABLES_H)
+# include <linux/netfilter_arp/arp_tables.h>
+#endif
+#if defined(HAVE_LINUX_NETFILTER_BRIDGE_EBTABLES_H)
+# include <linux/netfilter_bridge/ebtables.h>
+#endif
+#if defined(HAVE_LINUX_NETFILTER_IPV4_IP_TABLES_H)
+# include <linux/netfilter_ipv4/ip_tables.h>
+#endif
+#if defined(HAVE_LINUX_NETFILTER_IPV6_IP6_TABLES_H)
+# include <linux/netfilter_ipv6/ip6_tables.h>
+#endif
+#include <linux/if_packet.h>
+#include <linux/icmp.h>
+
+#include "xlat/socktypes.h"
+#include "xlat/sock_type_flags.h"
+#ifndef SOCK_TYPE_MASK
+# define SOCK_TYPE_MASK 0xf
+#endif
+
+#include "xlat/socketlayers.h"
+
+#include "xlat/inet_protocols.h"
+
+#define XLAT_MACROS_ONLY
+#include "xlat/addrfams.h"
+#include "xlat/ethernet_protocols.h"
+#undef XLAT_MACROS_ONLY
+#include "xlat/ax25_protocols.h"
+#include "xlat/irda_protocols.h"
+#include "xlat/can_protocols.h"
+#include "xlat/bt_protocols.h"
+#include "xlat/isdn_protocols.h"
+#include "xlat/phonet_protocols.h"
+#include "xlat/caif_protocols.h"
+#include "xlat/nfc_protocols.h"
+#include "xlat/kcm_protocols.h"
+#include "xlat/smc_protocols.h"
+
+const size_t inet_protocols_size = ARRAY_SIZE(inet_protocols) - 1;
+
+static void
+decode_sockbuf(struct tcb *const tcp, const int fd, const kernel_ulong_t addr,
+ const kernel_ulong_t addrlen)
+{
+
+ switch (verbose(tcp) ? getfdproto(tcp, fd) : SOCK_PROTO_UNKNOWN) {
+ case SOCK_PROTO_NETLINK:
+ decode_netlink(tcp, fd, addr, addrlen);
+ break;
+ default:
+ printstrn(tcp, addr, addrlen);
+ }
+}
+
+/*
+ * low bits of the socket type define real socket type,
+ * other bits are socket type flags.
+ */
+static void
+tprint_sock_type(unsigned int flags)
+{
+ const char *str = xlookup(socktypes, flags & SOCK_TYPE_MASK);
+
+ if (str) {
+ print_xlat_ex(flags & SOCK_TYPE_MASK, str, XLAT_STYLE_DEFAULT);
+ flags &= ~SOCK_TYPE_MASK;
+ if (!flags)
+ return;
+ tprints("|");
+ }
+ printflags(sock_type_flags, flags, "SOCK_???");
+}
+
+SYS_FUNC(socket)
+{
+ printxval(addrfams, tcp->u_arg[0], "AF_???");
+ tprints(", ");
+ tprint_sock_type(tcp->u_arg[1]);
+ tprints(", ");
+ switch (tcp->u_arg[0]) {
+ case AF_INET:
+ case AF_INET6:
+ printxval(inet_protocols, tcp->u_arg[2], "IPPROTO_???");
+ break;
+
+ case AF_AX25:
+ /* Those are not available in public headers. */
+ printxval_ex(ax25_protocols, tcp->u_arg[2], "AX25_P_???",
+ XLAT_STYLE_VERBOSE);
+ break;
+
+ case AF_NETLINK:
+ printxval(netlink_protocols, tcp->u_arg[2], "NETLINK_???");
+ break;
+
+ case AF_PACKET:
+ tprints("htons(");
+ printxval(ethernet_protocols, ntohs(tcp->u_arg[2]),
+ "ETH_P_???");
+ tprints(")");
+ break;
+
+ case AF_IRDA:
+ printxval(can_protocols, tcp->u_arg[2], "IRDAPROTO_???");
+ break;
+
+ case AF_CAN:
+ printxval(can_protocols, tcp->u_arg[2], "CAN_???");
+ break;
+
+ case AF_BLUETOOTH:
+ printxval(bt_protocols, tcp->u_arg[2], "BTPROTO_???");
+ break;
+
+ case AF_RXRPC:
+ printxval(addrfams, tcp->u_arg[2], "AF_???");
+ break;
+
+ case AF_ISDN:
+ printxval(isdn_protocols, tcp->u_arg[2], "ISDN_P_???");
+ break;
+
+ case AF_PHONET:
+ printxval(phonet_protocols, tcp->u_arg[2], "PN_PROTO_???");
+ break;
+
+ case AF_CAIF:
+ printxval(caif_protocols, tcp->u_arg[2], "CAIFPROTO_???");
+ break;
+
+ case AF_NFC:
+ printxval(nfc_protocols, tcp->u_arg[2], "NFC_SOCKPROTO_???");
+ break;
+
+ case AF_KCM:
+ printxval(kcm_protocols, tcp->u_arg[2], "KCMPROTO_???");
+ break;
+
+ case AF_SMC:
+ printxval(smc_protocols, tcp->u_arg[2], "SMCPROTO_???");
+ break;
+
+ default:
+ tprintf("%" PRI_klu, tcp->u_arg[2]);
+ break;
+ }
+
+ return RVAL_DECODED | RVAL_FD;
+}
+
+static bool
+fetch_socklen(struct tcb *const tcp, int *const plen,
+ const kernel_ulong_t sockaddr, const kernel_ulong_t socklen)
+{
+ return verbose(tcp) && sockaddr && socklen
+ && umove(tcp, socklen, plen) == 0;
+}
+
+static int
+decode_sockname(struct tcb *tcp)
+{
+ int ulen, rlen;
+
+ if (entering(tcp)) {
+ printfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ if (fetch_socklen(tcp, &ulen, tcp->u_arg[1], tcp->u_arg[2])) {
+ set_tcb_priv_ulong(tcp, ulen);
+ return 0;
+ } else {
+ printaddr(tcp->u_arg[1]);
+ tprints(", ");
+ printaddr(tcp->u_arg[2]);
+ return RVAL_DECODED;
+ }
+ }
+
+ ulen = get_tcb_priv_ulong(tcp);
+
+ if (syserror(tcp) || umove(tcp, tcp->u_arg[2], &rlen) < 0) {
+ printaddr(tcp->u_arg[1]);
+ tprintf(", [%d]", ulen);
+ } else {
+ decode_sockaddr(tcp, tcp->u_arg[1], ulen > rlen ? rlen : ulen);
+ if (ulen != rlen)
+ tprintf(", [%d->%d]", ulen, rlen);
+ else
+ tprintf(", [%d]", rlen);
+ }
+
+ return RVAL_DECODED;
+}
+
+SYS_FUNC(accept)
+{
+ return decode_sockname(tcp) | RVAL_FD;
+}
+
+SYS_FUNC(accept4)
+{
+ int rc = decode_sockname(tcp);
+
+ if (rc & RVAL_DECODED) {
+ tprints(", ");
+ printflags(sock_type_flags, tcp->u_arg[3], "SOCK_???");
+ }
+
+ return rc | RVAL_FD;
+}
+
+SYS_FUNC(send)
+{
+ printfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ decode_sockbuf(tcp, tcp->u_arg[0], tcp->u_arg[1], tcp->u_arg[2]);
+ tprintf(", %" PRI_klu ", ", tcp->u_arg[2]);
+ /* flags */
+ printflags(msg_flags, tcp->u_arg[3], "MSG_???");
+
+ return RVAL_DECODED;
+}
+
+SYS_FUNC(sendto)
+{
+ printfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ decode_sockbuf(tcp, tcp->u_arg[0], tcp->u_arg[1], tcp->u_arg[2]);
+ tprintf(", %" PRI_klu ", ", tcp->u_arg[2]);
+ /* flags */
+ printflags(msg_flags, tcp->u_arg[3], "MSG_???");
+ /* to address */
+ const int addrlen = tcp->u_arg[5];
+ tprints(", ");
+ decode_sockaddr(tcp, tcp->u_arg[4], addrlen);
+ /* to length */
+ tprintf(", %d", addrlen);
+
+ return RVAL_DECODED;
+}
+
+SYS_FUNC(recv)
+{
+ if (entering(tcp)) {
+ printfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ } else {
+ if (syserror(tcp)) {
+ printaddr(tcp->u_arg[1]);
+ } else {
+ decode_sockbuf(tcp, tcp->u_arg[0], tcp->u_arg[1],
+ MIN((kernel_ulong_t) tcp->u_rval,
+ tcp->u_arg[2]));
+ }
+
+ tprintf(", %" PRI_klu ", ", tcp->u_arg[2]);
+ printflags(msg_flags, tcp->u_arg[3], "MSG_???");
+ }
+ return 0;
+}
+
+SYS_FUNC(recvfrom)
+{
+ int ulen, rlen;
+
+ if (entering(tcp)) {
+ printfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ if (fetch_socklen(tcp, &ulen, tcp->u_arg[4], tcp->u_arg[5])) {
+ set_tcb_priv_ulong(tcp, ulen);
+ }
+ } else {
+ /* buf */
+ if (syserror(tcp)) {
+ printaddr(tcp->u_arg[1]);
+ } else {
+ decode_sockbuf(tcp, tcp->u_arg[0], tcp->u_arg[1],
+ MIN((kernel_ulong_t) tcp->u_rval,
+ tcp->u_arg[2]));
+ }
+ /* size */
+ tprintf(", %" PRI_klu ", ", tcp->u_arg[2]);
+ /* flags */
+ printflags(msg_flags, tcp->u_arg[3], "MSG_???");
+ tprints(", ");
+
+ ulen = get_tcb_priv_ulong(tcp);
+
+ if (!fetch_socklen(tcp, &rlen, tcp->u_arg[4], tcp->u_arg[5])) {
+ /* from address */
+ printaddr(tcp->u_arg[4]);
+ tprints(", ");
+ /* from length */
+ printaddr(tcp->u_arg[5]);
+ return 0;
+ }
+ if (syserror(tcp)) {
+ /* from address */
+ printaddr(tcp->u_arg[4]);
+ /* from length */
+ tprintf(", [%d]", ulen);
+ return 0;
+ }
+ /* from address */
+ decode_sockaddr(tcp, tcp->u_arg[4], ulen > rlen ? rlen : ulen);
+ /* from length */
+ if (ulen != rlen)
+ tprintf(", [%d->%d]", ulen, rlen);
+ else
+ tprintf(", [%d]", rlen);
+ }
+ return 0;
+}
+
+SYS_FUNC(getsockname)
+{
+ return decode_sockname(tcp);
+}
+
+static void
+printpair_fd(struct tcb *tcp, const int i0, const int i1)
+{
+ tprints("[");
+ printfd(tcp, i0);
+ tprints(", ");
+ printfd(tcp, i1);
+ tprints("]");
+}
+
+static void
+decode_pair_fd(struct tcb *const tcp, const kernel_ulong_t addr)
+{
+ int pair[2];
+
+ if (umove_or_printaddr(tcp, addr, &pair))
+ return;
+
+ printpair_fd(tcp, pair[0], pair[1]);
+}
+
+static int
+do_pipe(struct tcb *tcp, int flags_arg)
+{
+ if (exiting(tcp)) {
+ decode_pair_fd(tcp, tcp->u_arg[0]);
+ if (flags_arg >= 0) {
+ tprints(", ");
+ printflags(open_mode_flags, tcp->u_arg[flags_arg], "O_???");
+ }
+ }
+ return 0;
+}
+
+SYS_FUNC(pipe)
+{
+#if HAVE_ARCH_GETRVAL2
+ if (exiting(tcp) && !syserror(tcp))
+ printpair_fd(tcp, tcp->u_rval, getrval2(tcp));
+ return 0;
+#else
+ return do_pipe(tcp, -1);
+#endif
+}
+
+SYS_FUNC(pipe2)
+{
+ return do_pipe(tcp, 1);
+}
+
+SYS_FUNC(socketpair)
+{
+ if (entering(tcp)) {
+ printxval(addrfams, tcp->u_arg[0], "AF_???");
+ tprints(", ");
+ tprint_sock_type(tcp->u_arg[1]);
+ tprintf(", %" PRI_klu, tcp->u_arg[2]);
+ } else {
+ tprints(", ");
+ decode_pair_fd(tcp, tcp->u_arg[3]);
+ }
+ return 0;
+}
+
+#include "xlat/sock_options.h"
+#include "xlat/getsock_options.h"
+#include "xlat/setsock_options.h"
+#include "xlat/sock_ip_options.h"
+#include "xlat/getsock_ip_options.h"
+#include "xlat/setsock_ip_options.h"
+#include "xlat/sock_ipv6_options.h"
+#include "xlat/getsock_ipv6_options.h"
+#include "xlat/setsock_ipv6_options.h"
+#include "xlat/sock_ipx_options.h"
+#include "xlat/sock_ax25_options.h"
+#include "xlat/sock_netlink_options.h"
+#include "xlat/sock_packet_options.h"
+#include "xlat/sock_raw_options.h"
+#include "xlat/sock_sctp_options.h"
+#include "xlat/sock_tcp_options.h"
+#include "xlat/sock_udp_options.h"
+#include "xlat/sock_irda_options.h"
+#include "xlat/sock_llc_options.h"
+#include "xlat/sock_dccp_options.h"
+#include "xlat/sock_tipc_options.h"
+#include "xlat/sock_rxrpc_options.h"
+#include "xlat/sock_pppol2tp_options.h"
+#include "xlat/sock_bluetooth_options.h"
+#include "xlat/sock_pnp_options.h"
+#include "xlat/sock_rds_options.h"
+#include "xlat/sock_iucv_options.h"
+#include "xlat/sock_caif_options.h"
+#include "xlat/sock_alg_options.h"
+#include "xlat/sock_nfcllcp_options.h"
+#include "xlat/sock_kcm_options.h"
+#include "xlat/sock_tls_options.h"
+#include "xlat/sock_xdp_options.h"
+
+#define MAYBE_PRINT_FIELD_LEN(print_prefix_, where_, field_, \
+ len_, print_func_, ...) \
+ do { \
+ unsigned int start = offsetof(typeof(where_), field_); \
+ unsigned int end = start + sizeof(where_.field_); \
+ if (len_ > start) { \
+ print_prefix_; \
+ if (len_ >= end) { \
+ print_func_(where_, field_, \
+ ##__VA_ARGS__); \
+ } else { \
+ tprints_field_name(#field_); \
+ print_quoted_string( \
+ (void *)&where_.field_, \
+ len_ - start, QUOTE_FORCE_HEX); \
+ } \
+ } \
+ } while (0)
+
+static void
+print_sockopt_fd_level_name(struct tcb *tcp, int fd, unsigned int level,
+ unsigned int name, bool is_getsockopt)
+{
+ printfd(tcp, fd);
+ tprints(", ");
+ printxval(socketlayers, level, "SOL_??");
+ tprints(", ");
+
+ switch (level) {
+ case SOL_SOCKET:
+ printxvals(name, "SO_???", sock_options,
+ is_getsockopt ? getsock_options :
+ setsock_options, NULL);
+ break;
+ case SOL_IP:
+ printxvals(name, "IP_???", sock_ip_options,
+ is_getsockopt ? getsock_ip_options :
+ setsock_ip_options, NULL);
+ break;
+ case SOL_IPV6:
+ printxvals(name, "IPV6_???", sock_ipv6_options,
+ is_getsockopt ? getsock_ipv6_options :
+ setsock_ipv6_options, NULL);
+ break;
+ case SOL_IPX:
+ printxval(sock_ipx_options, name, "IPX_???");
+ break;
+ case SOL_AX25:
+ printxval(sock_ax25_options, name, "AX25_???");
+ break;
+ case SOL_PACKET:
+ printxval(sock_packet_options, name, "PACKET_???");
+ break;
+ case SOL_TCP:
+ printxval(sock_tcp_options, name, "TCP_???");
+ break;
+ case SOL_SCTP:
+ printxval(sock_sctp_options, name, "SCTP_???");
+ break;
+ case SOL_RAW:
+ printxval(sock_raw_options, name, "RAW_???");
+ break;
+ case SOL_NETLINK:
+ printxval(sock_netlink_options, name, "NETLINK_???");
+ break;
+ case SOL_UDP:
+ printxval(sock_udp_options, name, "UDP_???");
+ break;
+ case SOL_IRDA:
+ printxval(sock_irda_options, name, "IRLMP_???");
+ break;
+ case SOL_LLC:
+ printxval(sock_llc_options, name, "LLC_OPT_???");
+ break;
+ case SOL_DCCP:
+ printxval(sock_dccp_options, name, "DCCP_SOCKOPT_???");
+ break;
+ case SOL_TIPC:
+ printxval(sock_tipc_options, name, "TIPC_???");
+ break;
+ case SOL_RXRPC:
+ printxval(sock_rxrpc_options, name, "RXRPC_???");
+ break;
+ case SOL_PPPOL2TP:
+ printxval(sock_pppol2tp_options, name, "PPPOL2TP_SO_???");
+ break;
+ case SOL_BLUETOOTH:
+ printxval(sock_bluetooth_options, name, "BT_???");
+ break;
+ case SOL_PNPIPE:
+ printxval(sock_pnp_options, name, "PNPIPE_???");
+ break;
+ case SOL_RDS:
+ printxval(sock_rds_options, name, "RDS_???");
+ break;
+ case SOL_IUCV:
+ printxval(sock_iucv_options, name, "SO_???");
+ break;
+ case SOL_CAIF:
+ printxval(sock_caif_options, name, "CAIFSO_???");
+ break;
+ case SOL_ALG:
+ printxval(sock_alg_options, name, "ALG_???");
+ break;
+ case SOL_NFC:
+ printxval(sock_nfcllcp_options, name, "NFC_LLCP_???");
+ break;
+ case SOL_KCM:
+ printxval(sock_kcm_options, name, "KCM_???");
+ break;
+ case SOL_TLS:
+ printxval(sock_tls_options, name, "TLS_???");
+ break;
+ case SOL_XDP:
+ printxval(sock_xdp_options, name, "XDP_???");
+ break;
+
+ /* Other SOL_* protocol levels still need work. */
+
+ default:
+ tprintf("%u", name);
+ }
+
+ tprints(", ");
+}
+
+static void
+print_get_linger(struct tcb *const tcp, const kernel_ulong_t addr,
+ unsigned int len)
+{
+ struct linger linger;
+
+ /*
+ * The kernel cannot return len > sizeof(linger) because struct linger
+ * cannot change, but extra safety won't harm either.
+ */
+ if (len > sizeof(linger))
+ len = sizeof(linger);
+ if (umoven_or_printaddr(tcp, addr, len, &linger))
+ return;
+
+ MAYBE_PRINT_FIELD_LEN(tprint_struct_begin(),
+ linger, l_onoff, len, PRINT_FIELD_D);
+ MAYBE_PRINT_FIELD_LEN(tprint_struct_next(),
+ linger, l_linger, len, PRINT_FIELD_D);
+ tprint_struct_end();
+}
+
+static void
+print_get_ucred(struct tcb *const tcp, const kernel_ulong_t addr,
+ unsigned int len)
+{
+ struct ucred uc;
+
+ /*
+ * The kernel is very unlikely to return len > sizeof(uc)
+ * because struct ucred is very unlikely to change,
+ * but extra safety won't harm either.
+ */
+ if (len > sizeof(uc))
+ len = sizeof(uc);
+
+ if (umoven_or_printaddr(tcp, addr, len, &uc))
+ return;
+
+ MAYBE_PRINT_FIELD_LEN(tprint_struct_begin(),
+ uc, pid, len, PRINT_FIELD_TGID, tcp);
+ MAYBE_PRINT_FIELD_LEN(tprint_struct_next(),
+ uc, uid, len, PRINT_FIELD_ID);
+ MAYBE_PRINT_FIELD_LEN(tprint_struct_next(),
+ uc, gid, len, PRINT_FIELD_ID);
+ tprint_struct_end();
+}
+
+static void
+print_get_error(struct tcb *const tcp, const kernel_ulong_t addr,
+ unsigned int len)
+{
+ unsigned int err;
+
+ if (len > sizeof(err))
+ err = sizeof(err);
+
+ if (umoven_or_printaddr(tcp, addr, len, &err))
+ return;
+
+ tprints("[");
+ print_err(err, false);
+ tprints("]");
+}
+
+#ifdef PACKET_STATISTICS
+static void
+print_tpacket_stats(struct tcb *const tcp, const kernel_ulong_t addr,
+ unsigned int len)
+{
+ struct tp_stats {
+ unsigned int tp_packets, tp_drops, tp_freeze_q_cnt;
+ } stats;
+
+ /*
+ * The kernel may return len > sizeof(stats) if the kernel structure
+ * grew as it happened when tpacket_stats_v3 was introduced.
+ */
+ if (len > sizeof(stats))
+ len = sizeof(stats);
+
+ if (umoven_or_printaddr(tcp, addr, len, &stats))
+ return;
+
+ MAYBE_PRINT_FIELD_LEN(tprint_struct_begin(),
+ stats, tp_packets, len, PRINT_FIELD_U);
+ MAYBE_PRINT_FIELD_LEN(tprint_struct_next(),
+ stats, tp_drops, len, PRINT_FIELD_U);
+ MAYBE_PRINT_FIELD_LEN(tprint_struct_next(),
+ stats, tp_freeze_q_cnt, len, PRINT_FIELD_U);
+ tprint_struct_end();
+}
+#endif /* PACKET_STATISTICS */
+
+#include "xlat/icmpfilterflags.h"
+
+static void
+print_icmp_filter(struct tcb *const tcp, const kernel_ulong_t addr, int len)
+{
+ struct icmp_filter filter = {};
+
+ if (len > (int) sizeof(filter))
+ len = sizeof(filter);
+ else if (len <= 0) {
+ printaddr(addr);
+ return;
+ }
+
+ if (umoven_or_printaddr(tcp, addr, len, &filter))
+ return;
+
+ tprints("~(");
+ printflags(icmpfilterflags, ~filter.data, "ICMP_???");
+ tprints(")");
+}
+
+static void
+print_getsockopt(struct tcb *const tcp, const unsigned int level,
+ const unsigned int name, const kernel_ulong_t addr,
+ const int ulen, const int rlen)
+{
+ if (ulen <= 0 || rlen <= 0) {
+ /*
+ * As the kernel neither accepts nor returns a negative
+ * length in case of successful getsockopt syscall
+ * invocation, negative values must have been forged
+ * by userspace.
+ */
+ printaddr(addr);
+ return;
+ }
+
+ if (addr && verbose(tcp))
+ switch (level) {
+ case SOL_SOCKET:
+ switch (name) {
+ case SO_LINGER:
+ print_get_linger(tcp, addr, rlen);
+ return;
+ case SO_PEERCRED:
+ print_get_ucred(tcp, addr, rlen);
+ return;
+ case SO_ATTACH_FILTER:
+ /*
+ * The length returned by the kernel in case of
+ * successful getsockopt syscall invocation is struct
+ * sock_fprog.len that has type unsigned short,
+ * anything else must have been forged by userspace.
+ */
+ if ((unsigned short) rlen == (unsigned int) rlen)
+ print_sock_fprog(tcp, addr, rlen);
+ else
+ printaddr(addr);
+ return;
+ case SO_ERROR:
+ print_get_error(tcp, addr, rlen);
+ return;
+ }
+ break;
+
+ case SOL_PACKET:
+ switch (name) {
+#ifdef PACKET_STATISTICS
+ case PACKET_STATISTICS:
+ print_tpacket_stats(tcp, addr, rlen);
+ return;
+#endif
+ }
+ break;
+
+ case SOL_RAW:
+ switch (name) {
+ case ICMP_FILTER:
+ print_icmp_filter(tcp, addr, rlen);
+ return;
+ }
+ break;
+
+ case SOL_NETLINK:
+ switch (name) {
+ case NETLINK_LIST_MEMBERSHIPS: {
+ uint32_t buf;
+ print_array(tcp, addr, MIN(ulen, rlen) / sizeof(buf),
+ &buf, sizeof(buf),
+ tfetch_mem, print_uint32_array_member, 0);
+ break;
+ }
+ default:
+ printnum_int(tcp, addr, "%d");
+ break;
+ }
+ return;
+ }
+
+ /* default arg printing */
+
+ if (verbose(tcp)) {
+ if (rlen == sizeof(int)) {
+ printnum_int(tcp, addr, "%d");
+ } else {
+ printstrn(tcp, addr, rlen);
+ }
+ } else {
+ printaddr(addr);
+ }
+}
+
+SYS_FUNC(getsockopt)
+{
+ int ulen, rlen;
+
+ if (entering(tcp)) {
+ print_sockopt_fd_level_name(tcp, tcp->u_arg[0],
+ tcp->u_arg[1], tcp->u_arg[2], true);
+
+ if (verbose(tcp) && tcp->u_arg[4]
+ && umove(tcp, tcp->u_arg[4], &ulen) == 0) {
+ set_tcb_priv_ulong(tcp, ulen);
+ return 0;
+ } else {
+ printaddr(tcp->u_arg[3]);
+ tprints(", ");
+ printaddr(tcp->u_arg[4]);
+ return RVAL_DECODED;
+ }
+ } else {
+ ulen = get_tcb_priv_ulong(tcp);
+
+ if (syserror(tcp) || umove(tcp, tcp->u_arg[4], &rlen) < 0) {
+ printaddr(tcp->u_arg[3]);
+ tprintf(", [%d]", ulen);
+ } else {
+ print_getsockopt(tcp, tcp->u_arg[1], tcp->u_arg[2],
+ tcp->u_arg[3], ulen, rlen);
+ if (ulen != rlen)
+ tprintf(", [%d->%d]", ulen, rlen);
+ else
+ tprintf(", [%d]", rlen);
+ }
+ }
+ return 0;
+}
+
+static void
+print_set_linger(struct tcb *const tcp, const kernel_ulong_t addr,
+ const int len)
+{
+ struct linger linger;
+
+ if (len < (int) sizeof(linger)) {
+ printaddr(addr);
+ } else if (!umove_or_printaddr(tcp, addr, &linger)) {
+ tprint_struct_begin();
+ PRINT_FIELD_D(linger, l_onoff);
+ tprint_struct_next();
+ PRINT_FIELD_D(linger, l_linger);
+ tprint_struct_end();
+ }
+}
+
+#ifdef IP_ADD_MEMBERSHIP
+static void
+print_mreq(struct tcb *const tcp, const kernel_ulong_t addr,
+ const int len)
+{
+ struct ip_mreq mreq;
+
+ if (len < (int) sizeof(mreq)) {
+ printaddr(addr);
+ } else if (!umove_or_printaddr(tcp, addr, &mreq)) {
+ tprint_struct_begin();
+ PRINT_FIELD_INET_ADDR(mreq, imr_multiaddr, AF_INET);
+ tprint_struct_next();
+ PRINT_FIELD_INET_ADDR(mreq, imr_interface, AF_INET);
+ tprint_struct_end();
+ }
+}
+#endif /* IP_ADD_MEMBERSHIP */
+
+#ifdef IPV6_ADD_MEMBERSHIP
+static void
+print_mreq6(struct tcb *const tcp, const kernel_ulong_t addr,
+ const int len)
+{
+ struct ipv6_mreq mreq;
+
+ if (len < (int) sizeof(mreq)) {
+ printaddr(addr);
+ } else if (!umove_or_printaddr(tcp, addr, &mreq)) {
+ tprint_struct_begin();
+ PRINT_FIELD_INET_ADDR(mreq, ipv6mr_multiaddr, AF_INET6);
+ tprint_struct_next();
+ PRINT_FIELD_IFINDEX(mreq, ipv6mr_interface);
+ tprint_struct_end();
+ }
+}
+#endif /* IPV6_ADD_MEMBERSHIP */
+
+#ifdef PACKET_RX_RING
+static void
+print_tpacket_req(struct tcb *const tcp, const kernel_ulong_t addr, const int len)
+{
+ struct tpacket_req req;
+
+ if (len != sizeof(req) ||
+ umove(tcp, addr, &req) < 0) {
+ printaddr(addr);
+ } else {
+ tprint_struct_begin();
+ PRINT_FIELD_U(req, tp_block_size);
+ tprint_struct_next();
+ PRINT_FIELD_U(req, tp_block_nr);
+ tprint_struct_next();
+ PRINT_FIELD_U(req, tp_frame_size);
+ tprint_struct_next();
+ PRINT_FIELD_U(req, tp_frame_nr);
+ tprint_struct_end();
+ }
+}
+#endif /* PACKET_RX_RING */
+
+#ifdef PACKET_ADD_MEMBERSHIP
+# include "xlat/packet_mreq_type.h"
+
+static void
+print_packet_mreq(struct tcb *const tcp, const kernel_ulong_t addr, const int len)
+{
+ struct packet_mreq mreq;
+
+ if (len != sizeof(mreq) ||
+ umove(tcp, addr, &mreq) < 0) {
+ printaddr(addr);
+ } else {
+ tprint_struct_begin();
+ PRINT_FIELD_IFINDEX(mreq, mr_ifindex);
+ tprint_struct_next();
+ PRINT_FIELD_XVAL(mreq, mr_type, packet_mreq_type,
+ "PACKET_MR_???");
+ tprint_struct_next();
+ PRINT_FIELD_U(mreq, mr_alen);
+ tprint_struct_next();
+ PRINT_FIELD_MAC_SZ(mreq, mr_address, mreq.mr_alen);
+ tprint_struct_end();
+ }
+}
+#endif /* PACKET_ADD_MEMBERSHIP */
+
+static void
+print_setsockopt(struct tcb *const tcp, const unsigned int level,
+ const unsigned int name, const kernel_ulong_t addr,
+ const int len)
+{
+ if (addr && verbose(tcp))
+ switch (level) {
+ case SOL_SOCKET:
+ switch (name) {
+ case SO_LINGER:
+ print_set_linger(tcp, addr, len);
+ return;
+ case SO_ATTACH_FILTER:
+ case SO_ATTACH_REUSEPORT_CBPF:
+ if ((unsigned int) len == get_sock_fprog_size())
+ decode_sock_fprog(tcp, addr);
+ else
+ printaddr(addr);
+ return;
+ }
+ break;
+
+ case SOL_IP:
+ switch (name) {
+#ifdef IP_ADD_MEMBERSHIP
+ case IP_ADD_MEMBERSHIP:
+ case IP_DROP_MEMBERSHIP:
+ print_mreq(tcp, addr, len);
+ return;
+#endif /* IP_ADD_MEMBERSHIP */
+#ifdef MCAST_JOIN_GROUP
+ case MCAST_JOIN_GROUP:
+ case MCAST_LEAVE_GROUP:
+ print_group_req(tcp, addr, len);
+ return;
+#endif /* MCAST_JOIN_GROUP */
+ }
+ break;
+
+ case SOL_IPV6:
+ switch (name) {
+#ifdef IPV6_ADD_MEMBERSHIP
+ case IPV6_ADD_MEMBERSHIP:
+ case IPV6_DROP_MEMBERSHIP:
+# ifdef IPV6_JOIN_ANYCAST
+ case IPV6_JOIN_ANYCAST:
+# endif
+# ifdef IPV6_LEAVE_ANYCAST
+ case IPV6_LEAVE_ANYCAST:
+# endif
+ print_mreq6(tcp, addr, len);
+ return;
+#endif /* IPV6_ADD_MEMBERSHIP */
+#ifdef MCAST_JOIN_GROUP
+ case MCAST_JOIN_GROUP:
+ case MCAST_LEAVE_GROUP:
+ print_group_req(tcp, addr, len);
+ return;
+#endif /* MCAST_JOIN_GROUP */
+ }
+ break;
+
+ case SOL_PACKET:
+ switch (name) {
+#ifdef PACKET_RX_RING
+ case PACKET_RX_RING:
+# ifdef PACKET_TX_RING
+ case PACKET_TX_RING:
+# endif
+ print_tpacket_req(tcp, addr, len);
+ return;
+#endif /* PACKET_RX_RING */
+#ifdef PACKET_ADD_MEMBERSHIP
+ case PACKET_ADD_MEMBERSHIP:
+ case PACKET_DROP_MEMBERSHIP:
+ print_packet_mreq(tcp, addr, len);
+ return;
+#endif /* PACKET_ADD_MEMBERSHIP */
+ }
+ break;
+
+ case SOL_RAW:
+ switch (name) {
+ case ICMP_FILTER:
+ print_icmp_filter(tcp, addr, len);
+ return;
+ }
+ break;
+
+ case SOL_NETLINK:
+ if (len < (int) sizeof(int))
+ printaddr(addr);
+ else
+ printnum_int(tcp, addr, "%d");
+ return;
+ }
+
+ /* default arg printing */
+
+ if (verbose(tcp)) {
+ if (len == sizeof(int)) {
+ printnum_int(tcp, addr, "%d");
+ } else {
+ printstrn(tcp, addr, len);
+ }
+ } else {
+ printaddr(addr);
+ }
+}
+
+SYS_FUNC(setsockopt)
+{
+ print_sockopt_fd_level_name(tcp, tcp->u_arg[0],
+ tcp->u_arg[1], tcp->u_arg[2], false);
+ print_setsockopt(tcp, tcp->u_arg[1], tcp->u_arg[2],
+ tcp->u_arg[3], tcp->u_arg[4]);
+ tprintf(", %d", (int) tcp->u_arg[4]);
+
+ return RVAL_DECODED;
+}
diff --git a/src/netlink.c b/src/netlink.c
new file mode 100644
index 000000000..74c1029d4
--- /dev/null
+++ b/src/netlink.c
@@ -0,0 +1,676 @@
+/*
+ * Copyright (c) 2016 Fabien Siron <fabien.siron@epita.fr>
+ * Copyright (c) 2016 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2016-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include "netlink.h"
+#include "nlattr.h"
+#include <linux/audit.h>
+#include <linux/rtnetlink.h>
+#include <linux/xfrm.h>
+#include "xlat/netlink_ack_flags.h"
+#include "xlat/netlink_delete_flags.h"
+#include "xlat/netlink_flags.h"
+#include "xlat/netlink_get_flags.h"
+#include "xlat/netlink_new_flags.h"
+#include "xlat/netlink_protocols.h"
+#include "xlat/netlink_types.h"
+#include "xlat/nf_acct_msg_types.h"
+#include "xlat/nf_cthelper_msg_types.h"
+#include "xlat/nf_ctnetlink_exp_msg_types.h"
+#include "xlat/nf_ctnetlink_msg_types.h"
+#include "xlat/nf_cttimeout_msg_types.h"
+#include "xlat/nf_ipset_msg_types.h"
+#include "xlat/nf_nft_compat_msg_types.h"
+#include "xlat/nf_nftables_msg_types.h"
+#include "xlat/nf_osf_msg_types.h"
+#include "xlat/nf_queue_msg_types.h"
+#include "xlat/nf_ulog_msg_types.h"
+#include "xlat/nl_audit_types.h"
+#include "xlat/nl_crypto_types.h"
+#include "xlat/nl_netfilter_subsys_ids.h"
+#include "xlat/nl_selinux_types.h"
+#include "xlat/nl_sock_diag_types.h"
+#include "xlat/nl_xfrm_types.h"
+#include "xlat/nlmsgerr_attrs.h"
+
+#define XLAT_MACROS_ONLY
+# include "xlat/crypto_msgs.h"
+#undef XLAT_MACROS_ONLY
+
+/*
+ * Fetch a struct nlmsghdr from the given address.
+ */
+static bool
+fetch_nlmsghdr(struct tcb *const tcp, struct nlmsghdr *const nlmsghdr,
+ const kernel_ulong_t addr, const kernel_ulong_t len,
+ const bool in_array)
+{
+ if (len < sizeof(struct nlmsghdr)) {
+ printstr_ex(tcp, addr, len, QUOTE_FORCE_HEX);
+ return false;
+ }
+
+ if (tfetch_obj(tcp, addr, nlmsghdr))
+ return true;
+
+ if (in_array) {
+ tprint_more_data_follows();
+ printaddr_comment(addr);
+ } else {
+ printaddr(addr);
+ }
+
+ return false;
+}
+
+static int
+get_fd_nl_family(struct tcb *const tcp, const int fd)
+{
+ const unsigned long inode = getfdinode(tcp, fd);
+ if (!inode)
+ return -1;
+
+ const char *const details = get_sockaddr_by_inode(tcp, fd, inode);
+ if (!details)
+ return -1;
+
+ const char *const nl_details = STR_STRIP_PREFIX(details, "NETLINK:[");
+ if (nl_details == details)
+ return -1;
+
+ const struct xlat_data *xlats = netlink_protocols->data;
+ for (uint32_t idx = 0; idx < netlink_protocols->size; idx++) {
+ if (!netlink_protocols->data[idx].str)
+ continue;
+
+ const char *name = STR_STRIP_PREFIX(xlats[idx].str, "NETLINK_");
+ if (!strncmp(nl_details, name, strlen(name)))
+ return xlats[idx].val;
+ }
+
+ if (*nl_details >= '0' && *nl_details <= '9')
+ return atoi(nl_details);
+
+ return -1;
+}
+
+static void
+decode_nlmsg_type_default(struct tcb *tcp, const struct xlat *const xlat,
+ const uint16_t type,
+ const char *const dflt)
+{
+ printxval(xlat, type, dflt);
+}
+
+static void
+decode_nlmsg_type_generic(struct tcb *tcp, const struct xlat *const xlat,
+ const uint16_t type,
+ const char *const dflt)
+{
+ printxval(genl_families_xlat(tcp), type, dflt);
+}
+
+static const struct {
+ const struct xlat *const xlat;
+ const char *const dflt;
+} nf_nlmsg_types[] = {
+ [NFNL_SUBSYS_CTNETLINK] = {
+ nf_ctnetlink_msg_types,
+ "IPCTNL_MSG_CT_???"
+ },
+ [NFNL_SUBSYS_CTNETLINK_EXP] = {
+ nf_ctnetlink_exp_msg_types,
+ "IPCTNL_MSG_EXP_???"
+ },
+ [NFNL_SUBSYS_QUEUE] = { nf_queue_msg_types, "NFQNL_MSG_???" },
+ [NFNL_SUBSYS_ULOG] = { nf_ulog_msg_types, "NFULNL_MSG_???" },
+ [NFNL_SUBSYS_OSF] = { nf_osf_msg_types, "OSF_MSG_???" },
+ [NFNL_SUBSYS_IPSET] = { nf_ipset_msg_types, "IPSET_CMD_???" },
+ [NFNL_SUBSYS_ACCT] = { nf_acct_msg_types, "NFNL_MSG_ACCT_???" },
+ [NFNL_SUBSYS_CTNETLINK_TIMEOUT] = {
+ nf_cttimeout_msg_types,
+ "IPCTNL_MSG_TIMEOUT_???"
+ },
+ [NFNL_SUBSYS_CTHELPER] = {
+ nf_cthelper_msg_types,
+ "NFNL_MSG_CTHELPER_???"
+ },
+ [NFNL_SUBSYS_NFTABLES] = { nf_nftables_msg_types, "NFT_MSG_???" },
+ [NFNL_SUBSYS_NFT_COMPAT] = {
+ nf_nft_compat_msg_types,
+ "NFNL_MSG_COMPAT_???"
+ }
+};
+
+static void
+decode_nlmsg_type_netfilter(struct tcb *tcp, const struct xlat *const xlat,
+ const uint16_t type,
+ const char *const dflt)
+{
+ /* Reserved control nfnetlink messages first. */
+ const char *const text = xlookup(nl_netfilter_msg_types, type);
+ if (text) {
+ print_xlat_ex(type, text, XLAT_STYLE_DEFAULT);
+ return;
+ }
+
+ /*
+ * Other netfilter message types are split
+ * in two pieces: 8 bits subsystem and 8 bits type.
+ */
+ const uint8_t subsys_id = (uint8_t) (type >> 8);
+ const uint8_t msg_type = (uint8_t) type;
+
+ printxval(xlat, subsys_id, dflt);
+
+ tprints("<<8|");
+ if (subsys_id < ARRAY_SIZE(nf_nlmsg_types))
+ printxval(nf_nlmsg_types[subsys_id].xlat,
+ msg_type, nf_nlmsg_types[subsys_id].dflt);
+ else
+ tprintf("%#x", msg_type);
+}
+
+typedef void (*nlmsg_types_decoder_t)(struct tcb *, const struct xlat *,
+ uint16_t type,
+ const char *dflt);
+
+static const struct {
+ const nlmsg_types_decoder_t decoder;
+ const struct xlat *const xlat;
+ const char *const dflt;
+} nlmsg_types[] = {
+ [NETLINK_AUDIT] = { NULL, nl_audit_types, "AUDIT_???" },
+ [NETLINK_CRYPTO] = { NULL, nl_crypto_types, "CRYPTO_MSG_???" },
+ [NETLINK_GENERIC] = {
+ decode_nlmsg_type_generic,
+ NULL,
+ "GENERIC_FAMILY_???"
+ },
+ [NETLINK_NETFILTER] = {
+ decode_nlmsg_type_netfilter,
+ nl_netfilter_subsys_ids,
+ "NFNL_SUBSYS_???"
+ },
+ [NETLINK_ROUTE] = { NULL, nl_route_types, "RTM_???" },
+ [NETLINK_SELINUX] = { NULL, nl_selinux_types, "SELNL_MSG_???" },
+ [NETLINK_SOCK_DIAG] = { NULL, nl_sock_diag_types, "SOCK_DIAG_???" },
+ [NETLINK_XFRM] = { NULL, nl_xfrm_types, "XFRM_MSG_???" }
+};
+
+/*
+ * As all valid netlink families are positive integers, use unsigned int
+ * for family here to filter out -1.
+ */
+static void
+decode_nlmsg_type(struct tcb *tcp, const uint16_t type,
+ const unsigned int family)
+{
+ nlmsg_types_decoder_t decoder = decode_nlmsg_type_default;
+ const struct xlat *xlat = netlink_types;
+ const char *dflt = "NLMSG_???";
+
+ /*
+ * type < NLMSG_MIN_TYPE are reserved control messages
+ * that need no family-specific decoding.
+ */
+ if (type >= NLMSG_MIN_TYPE && family < ARRAY_SIZE(nlmsg_types)) {
+ if (nlmsg_types[family].decoder)
+ decoder = nlmsg_types[family].decoder;
+ if (nlmsg_types[family].xlat)
+ xlat = nlmsg_types[family].xlat;
+ if (nlmsg_types[family].dflt)
+ dflt = nlmsg_types[family].dflt;
+ }
+
+ decoder(tcp, xlat, type, dflt);
+}
+
+static const struct xlat *
+decode_nlmsg_flags_crypto(const uint16_t type)
+{
+ switch (type) {
+ case CRYPTO_MSG_NEWALG:
+ return netlink_new_flags;
+ case CRYPTO_MSG_DELALG:
+ case CRYPTO_MSG_DELRNG:
+ return netlink_delete_flags;
+ case CRYPTO_MSG_GETALG:
+ return netlink_get_flags;
+ }
+
+ return NULL;
+}
+
+static const struct xlat *
+decode_nlmsg_flags_netfilter(const uint16_t type)
+{
+ const uint8_t subsys_id = (uint8_t) (type >> 8);
+ const uint8_t msg_type = (uint8_t) type;
+
+ switch (subsys_id) {
+ case NFNL_SUBSYS_CTNETLINK:
+ switch (msg_type) {
+ case IPCTNL_MSG_CT_NEW:
+ return netlink_new_flags;
+ case IPCTNL_MSG_CT_GET:
+ case IPCTNL_MSG_CT_GET_CTRZERO:
+ case IPCTNL_MSG_CT_GET_STATS_CPU:
+ case IPCTNL_MSG_CT_GET_STATS:
+ case IPCTNL_MSG_CT_GET_DYING:
+ case IPCTNL_MSG_CT_GET_UNCONFIRMED:
+ return netlink_get_flags;
+ case IPCTNL_MSG_CT_DELETE:
+ return netlink_delete_flags;
+ }
+ break;
+ case NFNL_SUBSYS_CTNETLINK_EXP:
+ switch (msg_type) {
+ case IPCTNL_MSG_EXP_NEW:
+ return netlink_new_flags;
+ case IPCTNL_MSG_EXP_GET:
+ case IPCTNL_MSG_EXP_GET_STATS_CPU:
+ return netlink_get_flags;
+ case IPCTNL_MSG_EXP_DELETE:
+ return netlink_delete_flags;
+ }
+ break;
+ case NFNL_SUBSYS_ACCT:
+ switch (msg_type) {
+ case NFNL_MSG_ACCT_NEW:
+ return netlink_new_flags;
+ case NFNL_MSG_ACCT_GET:
+ case NFNL_MSG_ACCT_GET_CTRZERO:
+ return netlink_get_flags;
+ case NFNL_MSG_ACCT_DEL:
+ return netlink_delete_flags;
+ }
+ break;
+ case NFNL_SUBSYS_CTNETLINK_TIMEOUT:
+ switch (msg_type) {
+ case IPCTNL_MSG_TIMEOUT_NEW:
+ return netlink_new_flags;
+ case IPCTNL_MSG_TIMEOUT_GET:
+ return netlink_get_flags;
+ case IPCTNL_MSG_TIMEOUT_DELETE:
+ return netlink_delete_flags;
+ }
+ break;
+ case NFNL_SUBSYS_CTHELPER:
+ switch (msg_type) {
+ case NFNL_MSG_CTHELPER_NEW:
+ return netlink_new_flags;
+ case NFNL_MSG_CTHELPER_GET:
+ return netlink_get_flags;
+ case NFNL_MSG_CTHELPER_DEL:
+ return netlink_delete_flags;
+ }
+ break;
+ case NFNL_SUBSYS_NFTABLES:
+ switch (msg_type) {
+ case NFT_MSG_NEWTABLE:
+ case NFT_MSG_NEWCHAIN:
+ case NFT_MSG_NEWRULE:
+ case NFT_MSG_NEWSET:
+ case NFT_MSG_NEWSETELEM:
+ case NFT_MSG_NEWGEN:
+ case NFT_MSG_NEWOBJ:
+ return netlink_new_flags;
+ case NFT_MSG_GETTABLE:
+ case NFT_MSG_GETCHAIN:
+ case NFT_MSG_GETRULE:
+ case NFT_MSG_GETSET:
+ case NFT_MSG_GETSETELEM:
+ case NFT_MSG_GETGEN:
+ case NFT_MSG_GETOBJ:
+ case NFT_MSG_GETOBJ_RESET:
+ return netlink_get_flags;
+ case NFT_MSG_DELTABLE:
+ case NFT_MSG_DELCHAIN:
+ case NFT_MSG_DELRULE:
+ case NFT_MSG_DELSET:
+ case NFT_MSG_DELSETELEM:
+ case NFT_MSG_DELOBJ:
+ return netlink_delete_flags;
+ }
+ break;
+ case NFNL_SUBSYS_NFT_COMPAT:
+ switch (msg_type) {
+ case NFNL_MSG_COMPAT_GET:
+ return netlink_get_flags;
+ }
+ break;
+ }
+
+ return NULL;
+}
+
+static const struct xlat *
+decode_nlmsg_flags_route(const uint16_t type)
+{
+ /* RTM_DELACTION uses NLM_F_ROOT flags */
+ if (type == RTM_DELACTION)
+ return netlink_get_flags;
+ switch (type & 3) {
+ case 0:
+ return netlink_new_flags;
+ case 1:
+ return netlink_delete_flags;
+ case 2:
+ return netlink_get_flags;
+ }
+
+ return NULL;
+}
+
+static const struct xlat *
+decode_nlmsg_flags_sock_diag(const uint16_t type)
+{
+ return netlink_get_flags;
+}
+
+static const struct xlat *
+decode_nlmsg_flags_xfrm(const uint16_t type)
+{
+ switch (type) {
+ case XFRM_MSG_NEWSA:
+ case XFRM_MSG_NEWPOLICY:
+ case XFRM_MSG_NEWAE:
+ case XFRM_MSG_NEWSADINFO:
+ case XFRM_MSG_NEWSPDINFO:
+ return netlink_new_flags;
+ case XFRM_MSG_DELSA:
+ case XFRM_MSG_DELPOLICY:
+ return netlink_delete_flags;
+ case XFRM_MSG_GETSA:
+ case XFRM_MSG_GETPOLICY:
+ case XFRM_MSG_GETAE:
+ case XFRM_MSG_GETSADINFO:
+ case XFRM_MSG_GETSPDINFO:
+ return netlink_get_flags;
+ }
+
+ return NULL;
+}
+
+typedef const struct xlat *(*nlmsg_flags_decoder_t)(const uint16_t type);
+
+static const nlmsg_flags_decoder_t nlmsg_flags[] = {
+ [NETLINK_CRYPTO] = decode_nlmsg_flags_crypto,
+ [NETLINK_NETFILTER] = decode_nlmsg_flags_netfilter,
+ [NETLINK_ROUTE] = decode_nlmsg_flags_route,
+ [NETLINK_SOCK_DIAG] = decode_nlmsg_flags_sock_diag,
+ [NETLINK_XFRM] = decode_nlmsg_flags_xfrm
+};
+
+/*
+ * As all valid netlink families are positive integers, use unsigned int
+ * for family here to filter out -1.
+ */
+static void
+decode_nlmsg_flags(const uint16_t flags, const uint16_t type,
+ const unsigned int family)
+{
+ const struct xlat *table = NULL;
+
+ if (type < NLMSG_MIN_TYPE) {
+ if (type == NLMSG_ERROR)
+ table = netlink_ack_flags;
+ } else if (family < ARRAY_SIZE(nlmsg_flags) && nlmsg_flags[family])
+ table = nlmsg_flags[family](type);
+
+ printflags_ex(flags, "NLM_F_???", XLAT_STYLE_DEFAULT,
+ netlink_flags, table, NULL);
+}
+
+static void
+print_nlmsghdr(struct tcb *tcp,
+ const int fd,
+ const int family,
+ const struct nlmsghdr *const nlmsghdr)
+{
+ /* print the whole structure regardless of its nlmsg_len */
+
+ tprint_struct_begin();
+ PRINT_FIELD_U(*nlmsghdr, nlmsg_len);
+
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_TCB_VAL(*nlmsghdr, nlmsg_type, tcp,
+ decode_nlmsg_type, family);
+
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_VAL(*nlmsghdr, nlmsg_flags, decode_nlmsg_flags,
+ nlmsghdr->nlmsg_type, family);
+
+ tprint_struct_next();
+ PRINT_FIELD_U(*nlmsghdr, nlmsg_seq);
+
+ tprint_struct_next();
+ PRINT_FIELD_TGID(*nlmsghdr, nlmsg_pid, tcp);
+ tprint_struct_end();
+}
+
+static bool
+print_cookie(struct tcb *const tcp, void *const elem_buf,
+ const size_t elem_size, void *const opaque_data)
+{
+ tprintf("%" PRIu8, *(uint8_t *) elem_buf);
+
+ return true;
+}
+
+static bool
+decode_nlmsgerr_attr_cookie(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ uint8_t cookie;
+ const size_t nmemb = len / sizeof(cookie);
+
+ print_array(tcp, addr, nmemb, &cookie, sizeof(cookie),
+ tfetch_mem, print_cookie, 0);
+
+ return true;
+}
+
+static const nla_decoder_t nlmsgerr_nla_decoders[] = {
+ [NLMSGERR_ATTR_MSG] = decode_nla_str,
+ [NLMSGERR_ATTR_OFFS] = decode_nla_u32,
+ [NLMSGERR_ATTR_COOKIE] = decode_nlmsgerr_attr_cookie
+};
+
+static void
+decode_nlmsghdr_with_payload(struct tcb *const tcp,
+ const int fd,
+ const int family,
+ const struct nlmsghdr *const nlmsghdr,
+ const kernel_ulong_t addr,
+ const kernel_ulong_t len);
+
+static void
+decode_nlmsgerr(struct tcb *const tcp,
+ const int fd,
+ const int family,
+ kernel_ulong_t addr,
+ unsigned int len,
+ const bool capped)
+{
+ struct nlmsgerr err;
+
+ if (len < sizeof(err.error)) {
+ printstr_ex(tcp, addr, len, QUOTE_FORCE_HEX);
+ return;
+ }
+
+ if (umove_or_printaddr(tcp, addr, &err.error))
+ return;
+
+ tprint_struct_begin();
+ PRINT_FIELD_ERR_D(err, error);
+
+ addr += offsetof(struct nlmsgerr, msg);
+ len -= offsetof(struct nlmsgerr, msg);
+
+ if (len) {
+ tprint_struct_next();
+ tprints_field_name("msg");
+ if (fetch_nlmsghdr(tcp, &err.msg, addr, len, false)) {
+ unsigned int payload =
+ capped ? sizeof(err.msg) : err.msg.nlmsg_len;
+ if (payload > len)
+ payload = len;
+
+ decode_nlmsghdr_with_payload(tcp, fd, family,
+ &err.msg, addr, payload);
+ if (len > payload) {
+ tprints(", ");
+ decode_nlattr(tcp, addr + payload,
+ len - payload, nlmsgerr_attrs,
+ "NLMSGERR_ATTR_???",
+ nlmsgerr_nla_decoders,
+ ARRAY_SIZE(nlmsgerr_nla_decoders),
+ NULL);
+ }
+ }
+ }
+
+ tprint_struct_end();
+}
+
+static const netlink_decoder_t netlink_decoders[] = {
+ [NETLINK_CRYPTO] = decode_netlink_crypto,
+#ifdef HAVE_LINUX_NETFILTER_NFNETLINK_H
+ [NETLINK_NETFILTER] = decode_netlink_netfilter,
+#endif
+ [NETLINK_ROUTE] = decode_netlink_route,
+ [NETLINK_SELINUX] = decode_netlink_selinux,
+ [NETLINK_SOCK_DIAG] = decode_netlink_sock_diag
+};
+
+static void
+decode_payload(struct tcb *const tcp,
+ const int fd,
+ const int family,
+ const struct nlmsghdr *const nlmsghdr,
+ const kernel_ulong_t addr,
+ const unsigned int len)
+{
+ if (nlmsghdr->nlmsg_type == NLMSG_ERROR) {
+ decode_nlmsgerr(tcp, fd, family, addr, len,
+ nlmsghdr->nlmsg_flags & NLM_F_CAPPED);
+ return;
+ }
+
+ /*
+ * While most of NLMSG_DONE messages indeed have payloads
+ * containing just a single integer, there are few exceptions,
+ * so pass payloads of NLMSG_DONE messages to family-specific
+ * netlink payload decoders.
+ *
+ * Other types of reserved control messages need no family-specific
+ * netlink payload decoding.
+ */
+ if ((nlmsghdr->nlmsg_type >= NLMSG_MIN_TYPE
+ || nlmsghdr->nlmsg_type == NLMSG_DONE)
+ && (unsigned int) family < ARRAY_SIZE(netlink_decoders)
+ && netlink_decoders[family]
+ && netlink_decoders[family](tcp, nlmsghdr, addr, len)) {
+ return;
+ }
+
+ if (nlmsghdr->nlmsg_type == NLMSG_DONE && len == sizeof(int)) {
+ int num;
+
+ if (!umove_or_printaddr(tcp, addr, &num))
+ tprintf("%d", num);
+ return;
+ }
+
+ printstr_ex(tcp, addr, len, QUOTE_FORCE_HEX);
+}
+
+static void
+decode_nlmsghdr_with_payload(struct tcb *const tcp,
+ const int fd,
+ const int family,
+ const struct nlmsghdr *const nlmsghdr,
+ const kernel_ulong_t addr,
+ const kernel_ulong_t len)
+{
+ const unsigned int nlmsg_len = MIN(nlmsghdr->nlmsg_len, len);
+
+ if (nlmsg_len > NLMSG_HDRLEN)
+ tprint_struct_begin();
+
+ print_nlmsghdr(tcp, fd, family, nlmsghdr);
+
+ if (nlmsg_len > NLMSG_HDRLEN) {
+ tprints(", ");
+ decode_payload(tcp, fd, family, nlmsghdr, addr + NLMSG_HDRLEN,
+ nlmsg_len - NLMSG_HDRLEN);
+ tprint_struct_end();
+ }
+}
+
+void
+decode_netlink(struct tcb *const tcp,
+ const int fd,
+ kernel_ulong_t addr,
+ kernel_ulong_t len)
+{
+ const int family = get_fd_nl_family(tcp, fd);
+
+ if (family == NETLINK_KOBJECT_UEVENT) {
+ decode_netlink_kobject_uevent(tcp, addr, len);
+ return;
+ }
+
+ struct nlmsghdr nlmsghdr;
+ bool is_array = false;
+ unsigned int elt;
+
+ for (elt = 0; fetch_nlmsghdr(tcp, &nlmsghdr, addr, len, is_array);
+ elt++) {
+ if (abbrev(tcp) && elt == max_strlen) {
+ tprint_more_data_follows();
+ break;
+ }
+
+ unsigned int nlmsg_len = NLMSG_ALIGN(nlmsghdr.nlmsg_len);
+ kernel_ulong_t next_addr = 0;
+ kernel_ulong_t next_len = 0;
+
+ if (nlmsghdr.nlmsg_len >= NLMSG_HDRLEN) {
+ next_len = (len >= nlmsg_len) ? len - nlmsg_len : 0;
+
+ if (next_len && addr + nlmsg_len > addr)
+ next_addr = addr + nlmsg_len;
+ }
+
+ if (!is_array && next_addr) {
+ tprints("[");
+ is_array = true;
+ }
+
+ decode_nlmsghdr_with_payload(tcp, fd, family,
+ &nlmsghdr, addr, len);
+
+ if (!next_addr)
+ break;
+
+ tprints(", ");
+ addr = next_addr;
+ len = next_len;
+ }
+
+ if (is_array) {
+ tprints("]");
+ }
+}
diff --git a/src/netlink.h b/src/netlink.h
new file mode 100644
index 000000000..a079362e8
--- /dev/null
+++ b/src/netlink.h
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2017 JingPiao Chen <chenjingpiao@gmail.com>
+ * Copyright (c) 2017-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_NETLINK_H
+# define STRACE_NETLINK_H
+
+# include <stdbool.h>
+# include <sys/socket.h>
+# include <linux/netlink.h>
+
+# ifndef NETLINK_SOCK_DIAG
+# define NETLINK_SOCK_DIAG 4
+# endif
+
+# ifndef NLM_F_NONREC
+# define NLM_F_NONREC 0x100
+# endif
+# ifndef NLM_F_CAPPED
+# define NLM_F_CAPPED 0x100
+# endif
+
+# undef NLMSG_HDRLEN
+# define NLMSG_HDRLEN ((unsigned int) NLMSG_ALIGN(sizeof(struct nlmsghdr)))
+
+# ifndef NLMSG_MIN_TYPE
+# define NLMSG_MIN_TYPE 0x10
+# endif
+
+# ifndef NLA_ALIGN
+# define NLA_ALIGN(len) (((len) + 3) & ~3)
+# endif
+
+# undef NLA_HDRLEN
+# define NLA_HDRLEN ((unsigned int) NLA_ALIGN(sizeof(struct nlattr)))
+
+# ifndef NLA_TYPE_MASK
+# define NLA_F_NESTED (1 << 15)
+# define NLA_F_NET_BYTEORDER (1 << 14)
+# define NLA_TYPE_MASK ~(NLA_F_NESTED | NLA_F_NET_BYTEORDER)
+# endif
+
+static inline bool
+is_nlmsg_ok(const struct nlmsghdr *const nlh, const ssize_t len)
+{
+ return len >= (ssize_t) sizeof(*nlh)
+ && nlh->nlmsg_len >= sizeof(*nlh)
+ && (size_t) len >= nlh->nlmsg_len;
+}
+
+#endif /* !STRACE_NETLINK_H */
diff --git a/src/netlink_crypto.c b/src/netlink_crypto.c
new file mode 100644
index 000000000..4cc5c4bee
--- /dev/null
+++ b/src/netlink_crypto.c
@@ -0,0 +1,232 @@
+/*
+ * Copyright (c) 2017 JingPiao Chen <chenjingpiao@gmail.com>
+ * Copyright (c) 2017-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#include "netlink.h"
+#include "nlattr.h"
+
+#include "types/cryptouser.h"
+
+#include "xlat/crypto_nl_attrs.h"
+
+#define XLAT_MACROS_ONLY
+# include "xlat/crypto_msgs.h"
+#undef XLAT_MACROS_ONLY
+
+
+static bool
+decode_crypto_report_generic(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ tprint_struct_begin();
+ tprints_field_name("type");
+ printstr_ex(tcp, addr, len, QUOTE_0_TERMINATED);
+ tprint_struct_end();
+
+ return true;
+}
+
+static bool
+decode_crypto_report_hash(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ struct_crypto_report_hash rhash;
+
+ if (len < sizeof(rhash))
+ printstrn(tcp, addr, len);
+ else if (!umove_or_printaddr(tcp, addr, &rhash)) {
+ tprint_struct_begin();
+ PRINT_FIELD_CSTRING(rhash, type);
+ tprint_struct_next();
+ PRINT_FIELD_U(rhash, blocksize);
+ tprint_struct_next();
+ PRINT_FIELD_U(rhash, digestsize);
+ tprint_struct_end();
+ }
+
+ return true;
+}
+
+static bool
+decode_crypto_report_blkcipher(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ struct_crypto_report_blkcipher rblkcipher;
+
+ if (len < sizeof(rblkcipher))
+ printstrn(tcp, addr, len);
+ else if (!umove_or_printaddr(tcp, addr, &rblkcipher)) {
+ tprint_struct_begin();
+ PRINT_FIELD_CSTRING(rblkcipher, type);
+ tprint_struct_next();
+ PRINT_FIELD_CSTRING(rblkcipher, geniv);
+ tprint_struct_next();
+ PRINT_FIELD_U(rblkcipher, blocksize);
+ tprint_struct_next();
+ PRINT_FIELD_U(rblkcipher, min_keysize);
+ tprint_struct_next();
+ PRINT_FIELD_U(rblkcipher, max_keysize);
+ tprint_struct_next();
+ PRINT_FIELD_U(rblkcipher, ivsize);
+ tprint_struct_end();
+ }
+
+ return true;
+}
+
+static bool
+decode_crypto_report_aead(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ struct_crypto_report_aead raead;
+
+ if (len < sizeof(raead))
+ printstrn(tcp, addr, len);
+ else if (!umove_or_printaddr(tcp, addr, &raead)) {
+ tprint_struct_begin();
+ PRINT_FIELD_CSTRING(raead, type);
+ tprint_struct_next();
+ PRINT_FIELD_CSTRING(raead, geniv);
+ tprint_struct_next();
+ PRINT_FIELD_U(raead, blocksize);
+ tprint_struct_next();
+ PRINT_FIELD_U(raead, maxauthsize);
+ tprint_struct_next();
+ PRINT_FIELD_U(raead, ivsize);
+ tprint_struct_end();
+ }
+
+ return true;
+}
+
+static bool
+decode_crypto_report_rng(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ struct_crypto_report_rng rrng;
+
+ if (len < sizeof(rrng))
+ printstrn(tcp, addr, len);
+ else if (!umove_or_printaddr(tcp, addr, &rrng)) {
+ tprint_struct_begin();
+ PRINT_FIELD_CSTRING(rrng, type);
+ tprint_struct_next();
+ PRINT_FIELD_U(rrng, seedsize);
+ tprint_struct_end();
+ }
+
+ return true;
+}
+
+static bool
+decode_crypto_report_cipher(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ struct_crypto_report_cipher rcipher;
+
+ if (len < sizeof(rcipher))
+ printstrn(tcp, addr, len);
+ else if (!umove_or_printaddr(tcp, addr, &rcipher)) {
+ tprint_struct_begin();
+ PRINT_FIELD_CSTRING(rcipher, type);
+ tprint_struct_next();
+ PRINT_FIELD_U(rcipher, blocksize);
+ tprint_struct_next();
+ PRINT_FIELD_U(rcipher, min_keysize);
+ tprint_struct_next();
+ PRINT_FIELD_U(rcipher, max_keysize);
+ tprint_struct_end();
+ }
+
+ return true;
+}
+
+static const nla_decoder_t crypto_user_alg_nla_decoders[] = {
+ [CRYPTOCFGA_PRIORITY_VAL] = decode_nla_u32,
+ [CRYPTOCFGA_REPORT_LARVAL] = decode_crypto_report_generic,
+ [CRYPTOCFGA_REPORT_HASH] = decode_crypto_report_hash,
+ [CRYPTOCFGA_REPORT_BLKCIPHER] = decode_crypto_report_blkcipher,
+ [CRYPTOCFGA_REPORT_AEAD] = decode_crypto_report_aead,
+ [CRYPTOCFGA_REPORT_COMPRESS] = decode_crypto_report_generic,
+ [CRYPTOCFGA_REPORT_RNG] = decode_crypto_report_rng,
+ [CRYPTOCFGA_REPORT_CIPHER] = decode_crypto_report_cipher,
+ [CRYPTOCFGA_REPORT_AKCIPHER] = decode_crypto_report_generic,
+ [CRYPTOCFGA_REPORT_KPP] = decode_crypto_report_generic,
+ [CRYPTOCFGA_REPORT_ACOMP] = decode_crypto_report_generic
+};
+
+static void
+decode_crypto_user_alg(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len)
+{
+ struct_crypto_user_alg alg;
+
+ if (len < sizeof(alg))
+ printstrn(tcp, addr, len);
+ else if (!umove_or_printaddr(tcp, addr, &alg)) {
+ tprint_struct_begin();
+ PRINT_FIELD_CSTRING(alg, cru_name);
+ tprint_struct_next();
+ PRINT_FIELD_CSTRING(alg, cru_driver_name);
+ tprint_struct_next();
+ PRINT_FIELD_CSTRING(alg, cru_module_name);
+ tprint_struct_next();
+ PRINT_FIELD_X(alg, cru_type);
+ tprint_struct_next();
+ PRINT_FIELD_X(alg, cru_mask);
+ tprint_struct_next();
+ PRINT_FIELD_U(alg, cru_refcnt);
+ tprint_struct_next();
+ PRINT_FIELD_X(alg, cru_flags);
+ tprint_struct_end();
+
+ const size_t offset = NLMSG_ALIGN(sizeof(alg));
+ if (len > offset) {
+ tprints(", ");
+ decode_nlattr(tcp, addr + offset, len - offset,
+ crypto_nl_attrs, "CRYPTOCFGA_???",
+ crypto_user_alg_nla_decoders,
+ ARRAY_SIZE(crypto_user_alg_nla_decoders),
+ NULL);
+ }
+ }
+}
+
+bool
+decode_netlink_crypto(struct tcb *const tcp,
+ const struct nlmsghdr *const nlmsghdr,
+ const kernel_ulong_t addr,
+ const unsigned int len)
+{
+ switch (nlmsghdr->nlmsg_type) {
+ case CRYPTO_MSG_NEWALG:
+ case CRYPTO_MSG_DELALG:
+ case CRYPTO_MSG_UPDATEALG:
+ case CRYPTO_MSG_GETALG:
+ decode_crypto_user_alg(tcp, addr, len);
+ break;
+ default:
+ return false;
+ }
+
+ return true;
+}
diff --git a/src/netlink_inet_diag.c b/src/netlink_inet_diag.c
new file mode 100644
index 000000000..2267c5be8
--- /dev/null
+++ b/src/netlink_inet_diag.c
@@ -0,0 +1,459 @@
+/*
+ * Copyright (c) 2016 Fabien Siron <fabien.siron@epita.fr>
+ * Copyright (c) 2017 JingPiao Chen <chenjingpiao@gmail.com>
+ * Copyright (c) 2017-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include "netlink.h"
+#include "netlink_sock_diag.h"
+#include "nlattr.h"
+
+#include <arpa/inet.h>
+
+#include <linux/sock_diag.h>
+#include <linux/inet_diag.h>
+
+#include "xlat/inet_diag_attrs.h"
+#include "xlat/inet_diag_bytecodes.h"
+#include "xlat/inet_diag_extended_flags.h"
+#include "xlat/inet_diag_req_attrs.h"
+
+#include "xlat/tcp_states.h"
+#include "xlat/tcp_state_flags.h"
+
+void
+print_inet_diag_sockid(const struct inet_diag_sockid *id, const uint8_t family)
+{
+ tprint_struct_begin();
+ PRINT_FIELD_NET_PORT(*id, idiag_sport);
+ tprint_struct_next();
+ PRINT_FIELD_NET_PORT(*id, idiag_dport);
+ tprint_struct_next();
+ PRINT_FIELD_INET_ADDR(*id, idiag_src, family);
+ tprint_struct_next();
+ PRINT_FIELD_INET_ADDR(*id, idiag_dst, family);
+ tprint_struct_next();
+ PRINT_FIELD_IFINDEX(*id, idiag_if);
+ tprint_struct_next();
+ PRINT_FIELD_COOKIE(*id, idiag_cookie);
+ tprint_struct_end();
+}
+
+static void
+decode_inet_diag_hostcond(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len)
+{
+ struct inet_diag_hostcond cond;
+
+ if (len < sizeof(cond)) {
+ printstr_ex(tcp, addr, len, QUOTE_FORCE_HEX);
+ return;
+ }
+ if (umove_or_printaddr(tcp, addr, &cond))
+ return;
+
+ tprint_struct_begin();
+ PRINT_FIELD_XVAL(cond, family, addrfams, "AF_???");
+ tprint_struct_next();
+ PRINT_FIELD_U(cond, prefix_len);
+ tprint_struct_next();
+ PRINT_FIELD_U(cond, port);
+
+ if (len > sizeof(cond)) {
+ tprints(", ");
+ decode_inet_addr(tcp, addr + sizeof(cond),
+ len - sizeof(cond), cond.family, "addr");
+ }
+ tprint_struct_end();
+}
+
+static void
+print_inet_diag_bc_op(const struct inet_diag_bc_op *const op)
+{
+ tprint_struct_begin();
+ PRINT_FIELD_XVAL(*op, code, inet_diag_bytecodes, "INET_DIAG_BC_???");
+ tprint_struct_next();
+ PRINT_FIELD_U(*op, yes);
+ tprint_struct_next();
+ PRINT_FIELD_U(*op, no);
+ tprint_struct_end();
+}
+
+static void
+decode_inet_diag_markcond(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len)
+{
+ struct inet_diag_markcond markcond;
+
+ if (len < sizeof(markcond))
+ printstr_ex(tcp, addr, len, QUOTE_FORCE_HEX);
+ else if (!umove_or_printaddr(tcp, addr, &markcond)) {
+ tprint_struct_begin();
+ PRINT_FIELD_U(markcond, mark);
+ tprint_struct_next();
+ PRINT_FIELD_U(markcond, mask);
+ tprint_struct_end();
+ }
+}
+
+static void
+decode_bytecode_data(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const unsigned char code)
+{
+ switch (code) {
+ case INET_DIAG_BC_S_COND:
+ case INET_DIAG_BC_D_COND:
+ decode_inet_diag_hostcond(tcp, addr, len);
+ break;
+ case INET_DIAG_BC_DEV_COND: {
+ uint32_t ifindex;
+
+ if (len < sizeof(ifindex))
+ printstr_ex(tcp, addr, len, QUOTE_FORCE_HEX);
+ else if (!umove_or_printaddr(tcp, addr, &ifindex))
+ print_ifindex(ifindex);
+ break;
+ }
+ case INET_DIAG_BC_S_GE:
+ case INET_DIAG_BC_S_LE:
+ case INET_DIAG_BC_D_GE:
+ case INET_DIAG_BC_D_LE: {
+ struct inet_diag_bc_op op;
+
+ if (len < sizeof(op))
+ printstr_ex(tcp, addr, len, QUOTE_FORCE_HEX);
+ else if (!umove_or_printaddr(tcp, addr, &op))
+ print_inet_diag_bc_op(&op);
+ break;
+ }
+ case INET_DIAG_BC_MARK_COND:
+ decode_inet_diag_markcond(tcp, addr, len);
+ break;
+ case INET_DIAG_BC_AUTO:
+ case INET_DIAG_BC_JMP:
+ case INET_DIAG_BC_NOP:
+ default:
+ printstr_ex(tcp, addr, len, QUOTE_FORCE_HEX);
+ break;
+ }
+}
+
+static bool
+decode_inet_diag_bc_op(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ struct inet_diag_bc_op op;
+
+ if (len < sizeof(op))
+ return false;
+ if (umove_or_printaddr(tcp, addr, &op))
+ return true;
+
+ if (len > sizeof(op))
+ tprint_struct_begin();
+
+ print_inet_diag_bc_op(&op);
+
+ if (len > sizeof(op)) {
+ tprints(", ");
+ decode_bytecode_data(tcp, addr + sizeof(op),
+ len - sizeof(op), op.code);
+ tprint_struct_end();
+ }
+
+ return true;
+}
+
+static const nla_decoder_t inet_diag_req_nla_decoders[] = {
+ [INET_DIAG_REQ_BYTECODE] = decode_inet_diag_bc_op
+};
+
+static void
+decode_inet_diag_req_compat(struct tcb *const tcp,
+ const struct nlmsghdr *const nlmsghdr,
+ const uint8_t family,
+ const kernel_ulong_t addr,
+ const unsigned int len)
+{
+ struct inet_diag_req req = { .idiag_family = family };
+ size_t offset = sizeof(req.idiag_family);
+ bool decode_nla = false;
+
+ tprint_struct_begin();
+ PRINT_FIELD_XVAL(req, idiag_family, addrfams, "AF_???");
+ tprints(", ");
+ if (len >= sizeof(req)) {
+ if (!umoven_or_printaddr(tcp, addr + offset,
+ sizeof(req) - offset,
+ (char *) &req + offset)) {
+ PRINT_FIELD_U(req, idiag_src_len);
+ tprint_struct_next();
+ PRINT_FIELD_U(req, idiag_dst_len);
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(req, idiag_ext,
+ inet_diag_extended_flags,
+ "1<<INET_DIAG_\?\?\?-1");
+ tprint_struct_next();
+ PRINT_FIELD_INET_DIAG_SOCKID(req, id,
+ req.idiag_family);
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(req, idiag_states,
+ tcp_state_flags, "1<<TCP_???");
+ tprint_struct_next();
+ PRINT_FIELD_U(req, idiag_dbs);
+ decode_nla = true;
+ }
+ } else
+ tprint_more_data_follows();
+ tprint_struct_end();
+
+ offset = NLMSG_ALIGN(sizeof(req));
+ if (decode_nla && len > offset) {
+ tprints(", ");
+ decode_nlattr(tcp, addr + offset, len - offset,
+ inet_diag_req_attrs, "INET_DIAG_REQ_???",
+ inet_diag_req_nla_decoders,
+ ARRAY_SIZE(inet_diag_req_nla_decoders), NULL);
+ }
+}
+
+static void
+decode_inet_diag_req_v2(struct tcb *const tcp,
+ const struct nlmsghdr *const nlmsghdr,
+ const uint8_t family,
+ const kernel_ulong_t addr,
+ const unsigned int len)
+{
+ struct inet_diag_req_v2 req = { .sdiag_family = family };
+ size_t offset = sizeof(req.sdiag_family);
+ bool decode_nla = false;
+
+ tprint_struct_begin();
+ PRINT_FIELD_XVAL(req, sdiag_family, addrfams, "AF_???");
+ tprints(", ");
+ if (len >= sizeof(req)) {
+ if (!umoven_or_printaddr(tcp, addr + offset,
+ sizeof(req) - offset,
+ (char *) &req + offset)) {
+ PRINT_FIELD_XVAL(req, sdiag_protocol,
+ inet_protocols, "IPPROTO_???");
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(req, idiag_ext,
+ inet_diag_extended_flags,
+ "1<<INET_DIAG_\?\?\?-1");
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(req, idiag_states,
+ tcp_state_flags, "1<<TCP_???");
+ tprint_struct_next();
+ PRINT_FIELD_INET_DIAG_SOCKID(req, id,
+ req.sdiag_family);
+ decode_nla = true;
+ }
+ } else
+ tprint_more_data_follows();
+ tprint_struct_end();
+
+ offset = NLMSG_ALIGN(sizeof(req));
+ if (decode_nla && len > offset) {
+ tprints(", ");
+ decode_nlattr(tcp, addr + offset, len - offset,
+ inet_diag_req_attrs, "INET_DIAG_REQ_???",
+ inet_diag_req_nla_decoders,
+ ARRAY_SIZE(inet_diag_req_nla_decoders), NULL);
+ }
+}
+
+DECL_NETLINK_DIAG_DECODER(decode_inet_diag_req)
+{
+ if (nlmsghdr->nlmsg_type == TCPDIAG_GETSOCK
+ || nlmsghdr->nlmsg_type == DCCPDIAG_GETSOCK)
+ decode_inet_diag_req_compat(tcp, nlmsghdr, family, addr, len);
+ else
+ decode_inet_diag_req_v2(tcp, nlmsghdr, family, addr, len);
+}
+
+static bool
+decode_inet_diag_meminfo(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ struct inet_diag_meminfo minfo;
+
+ if (len < sizeof(minfo))
+ return false;
+ if (umove_or_printaddr(tcp, addr, &minfo))
+ return true;
+
+ tprint_struct_begin();
+ PRINT_FIELD_U(minfo, idiag_rmem);
+ tprint_struct_next();
+ PRINT_FIELD_U(minfo, idiag_wmem);
+ tprint_struct_next();
+ PRINT_FIELD_U(minfo, idiag_fmem);
+ tprint_struct_next();
+ PRINT_FIELD_U(minfo, idiag_tmem);
+ tprint_struct_end();
+
+ return true;
+}
+
+static bool
+decode_tcpvegas_info(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ struct tcpvegas_info vegas;
+
+ if (len < sizeof(vegas))
+ return false;
+ if (umove_or_printaddr(tcp, addr, &vegas))
+ return true;
+
+ tprint_struct_begin();
+ PRINT_FIELD_U(vegas, tcpv_enabled);
+ tprint_struct_next();
+ PRINT_FIELD_U(vegas, tcpv_rttcnt);
+ tprint_struct_next();
+ PRINT_FIELD_U(vegas, tcpv_rtt);
+ tprint_struct_next();
+ PRINT_FIELD_U(vegas, tcpv_minrtt);
+ tprint_struct_end();
+
+ return true;
+}
+
+static bool
+decode_tcp_dctcp_info(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ struct tcp_dctcp_info dctcp;
+
+ if (len < sizeof(dctcp))
+ return false;
+ if (umove_or_printaddr(tcp, addr, &dctcp))
+ return true;
+
+ tprint_struct_begin();
+ PRINT_FIELD_U(dctcp, dctcp_enabled);
+ tprint_struct_next();
+ PRINT_FIELD_U(dctcp, dctcp_ce_state);
+ tprint_struct_next();
+ PRINT_FIELD_U(dctcp, dctcp_alpha);
+ tprint_struct_next();
+ PRINT_FIELD_U(dctcp, dctcp_ab_ecn);
+ tprint_struct_next();
+ PRINT_FIELD_U(dctcp, dctcp_ab_tot);
+ tprint_struct_end();
+
+ return true;
+}
+
+static bool
+decode_tcp_bbr_info(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ struct tcp_bbr_info bbr;
+
+ if (len < sizeof(bbr))
+ return false;
+ if (umove_or_printaddr(tcp, addr, &bbr))
+ return true;
+
+ tprint_struct_begin();
+ PRINT_FIELD_X(bbr, bbr_bw_lo);
+ tprint_struct_next();
+ PRINT_FIELD_X(bbr, bbr_bw_hi);
+ tprint_struct_next();
+ PRINT_FIELD_U(bbr, bbr_min_rtt);
+ tprint_struct_next();
+ PRINT_FIELD_U(bbr, bbr_pacing_gain);
+ tprint_struct_next();
+ PRINT_FIELD_U(bbr, bbr_cwnd_gain);
+ tprint_struct_end();
+
+ return true;
+}
+
+static const nla_decoder_t inet_diag_msg_nla_decoders[] = {
+ [INET_DIAG_MEMINFO] = decode_inet_diag_meminfo,
+ [INET_DIAG_INFO] = NULL, /* unimplemented */
+ [INET_DIAG_VEGASINFO] = decode_tcpvegas_info,
+ [INET_DIAG_CONG] = decode_nla_str,
+ [INET_DIAG_TOS] = decode_nla_u8,
+ [INET_DIAG_TCLASS] = decode_nla_u8,
+ [INET_DIAG_SKMEMINFO] = decode_nla_meminfo,
+ [INET_DIAG_SHUTDOWN] = decode_nla_u8,
+ [INET_DIAG_DCTCPINFO] = decode_tcp_dctcp_info,
+ [INET_DIAG_PROTOCOL] = decode_nla_u8,
+ [INET_DIAG_SKV6ONLY] = decode_nla_u8,
+ [INET_DIAG_LOCALS] = NULL, /* unimplemented */
+ [INET_DIAG_PEERS] = NULL, /* unimplemented */
+ [INET_DIAG_PAD] = NULL,
+ [INET_DIAG_MARK] = decode_nla_u32,
+ [INET_DIAG_BBRINFO] = decode_tcp_bbr_info,
+ [INET_DIAG_CLASS_ID] = decode_nla_u32
+};
+
+DECL_NETLINK_DIAG_DECODER(decode_inet_diag_msg)
+{
+ struct inet_diag_msg msg = { .idiag_family = family };
+ size_t offset = sizeof(msg.idiag_family);
+ bool decode_nla = false;
+
+ tprint_struct_begin();
+ PRINT_FIELD_XVAL(msg, idiag_family, addrfams, "AF_???");
+ tprints(", ");
+ if (len >= sizeof(msg)) {
+ if (!umoven_or_printaddr(tcp, addr + offset,
+ sizeof(msg) - offset,
+ (char *) &msg + offset)) {
+ PRINT_FIELD_XVAL(msg, idiag_state,
+ tcp_states, "TCP_???");
+ tprint_struct_next();
+ PRINT_FIELD_U(msg, idiag_timer);
+ tprint_struct_next();
+ PRINT_FIELD_U(msg, idiag_retrans);
+ tprint_struct_next();
+ PRINT_FIELD_INET_DIAG_SOCKID(msg, id,
+ msg.idiag_family);
+ tprint_struct_next();
+ PRINT_FIELD_U(msg, idiag_expires);
+ tprint_struct_next();
+ PRINT_FIELD_U(msg, idiag_rqueue);
+ tprint_struct_next();
+ PRINT_FIELD_U(msg, idiag_wqueue);
+ tprint_struct_next();
+ PRINT_FIELD_U(msg, idiag_uid);
+ tprint_struct_next();
+ PRINT_FIELD_U(msg, idiag_inode);
+ decode_nla = true;
+ }
+ } else
+ tprint_more_data_follows();
+ tprint_struct_end();
+
+ offset = NLMSG_ALIGN(sizeof(msg));
+ if (decode_nla && len > offset) {
+ tprints(", ");
+ decode_nlattr(tcp, addr + offset, len - offset,
+ inet_diag_attrs, "INET_DIAG_???",
+ inet_diag_msg_nla_decoders,
+ ARRAY_SIZE(inet_diag_msg_nla_decoders), NULL);
+ }
+}
diff --git a/src/netlink_kobject_uevent.c b/src/netlink_kobject_uevent.c
new file mode 100644
index 000000000..272537ced
--- /dev/null
+++ b/src/netlink_kobject_uevent.c
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2018 Harsha Sharma <harshasharmaiitr@gmail.com>
+ * Copyright (c) 2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include "netlink_kobject_uevent.h"
+
+#include <arpa/inet.h>
+
+void
+decode_netlink_kobject_uevent(struct tcb *tcp, kernel_ulong_t addr,
+ kernel_ulong_t len)
+{
+ struct udev_monitor_netlink_header uh;
+ const char *prefix = "libudev";
+ unsigned int offset = sizeof(uh);
+
+ if (!verbose(tcp) || (exiting(tcp) && syserror(tcp)) ||
+ !addr || len < offset || umove(tcp, addr, &uh) ||
+ strcmp(uh.prefix, prefix) != 0) {
+ printstrn(tcp, addr, len);
+ return;
+ }
+
+ tprint_struct_begin();
+ tprint_struct_begin();
+ PRINT_FIELD_CSTRING(uh, prefix);
+ tprint_struct_next();
+ tprints_field_name("magic");
+ tprintf("htonl(%#x)", ntohl(uh.magic));
+ tprint_struct_next();
+ PRINT_FIELD_U(uh, header_size);
+ tprint_struct_next();
+ PRINT_FIELD_U(uh, properties_off);
+ tprint_struct_next();
+ PRINT_FIELD_U(uh, properties_len);
+ tprint_struct_next();
+ tprints_field_name("filter_subsystem_hash");
+ tprintf("htonl(%#x)", ntohl(uh.filter_subsystem_hash));
+ tprint_struct_next();
+ tprints_field_name("filter_devtype_hash");
+ tprintf("htonl(%#x)", ntohl(uh.filter_devtype_hash));
+ tprint_struct_next();
+ tprints_field_name("filter_tag_bloom_hi");
+ tprintf("htonl(%#x)", ntohl(uh.filter_tag_bloom_hi));
+ tprint_struct_next();
+ tprints_field_name("filter_tag_bloom_lo");
+ tprintf("htonl(%#x)", ntohl(uh.filter_tag_bloom_lo));
+ tprint_struct_end();
+ if (len > offset) {
+ tprints(", ");
+ printstrn(tcp, addr + offset, len - offset);
+ }
+ tprint_struct_end();
+}
diff --git a/src/netlink_kobject_uevent.h b/src/netlink_kobject_uevent.h
new file mode 100644
index 000000000..3aea2532a
--- /dev/null
+++ b/src/netlink_kobject_uevent.h
@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_NETLINK_KOBJECT_UEVENT_H
+# define STRACE_NETLINK_KOBJECT_UEVENT_H
+
+struct udev_monitor_netlink_header {
+ /* "libudev" prefix to distinguish libudev and kernel messages */
+ char prefix[8];
+ unsigned int magic;
+ unsigned int header_size;
+ unsigned int properties_off;
+ unsigned int properties_len;
+ unsigned int filter_subsystem_hash;
+ unsigned int filter_devtype_hash;
+ unsigned int filter_tag_bloom_hi;
+ unsigned int filter_tag_bloom_lo;
+};
+
+#endif /* !STRACE_NETLINK_KOBJECT_UEVENT_H */
diff --git a/src/netlink_netfilter.c b/src/netlink_netfilter.c
new file mode 100644
index 000000000..d2d6e2f50
--- /dev/null
+++ b/src/netlink_netfilter.c
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 2018 Chen Jingpiao <chenjingpiao@gmail.com>
+ * Copyright (c) 2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#ifdef HAVE_LINUX_NETFILTER_NFNETLINK_H
+
+# include "nlattr.h"
+
+# include <netinet/in.h>
+# include <arpa/inet.h>
+# include "netlink.h"
+# include <linux/netfilter/nfnetlink.h>
+
+# include "xlat/netfilter_versions.h"
+# include "xlat/nl_netfilter_msg_types.h"
+# include "xlat/nl_netfilter_subsys_ids.h"
+
+bool
+decode_netlink_netfilter(struct tcb *const tcp,
+ const struct nlmsghdr *const nlmsghdr,
+ const kernel_ulong_t addr,
+ const unsigned int len)
+{
+ if (nlmsghdr->nlmsg_type == NLMSG_DONE)
+ return false;
+
+ struct nfgenmsg nfmsg;
+
+ if (len < sizeof(nfmsg))
+ printstr_ex(tcp, addr, len, QUOTE_FORCE_HEX);
+ else if (!umove_or_printaddr(tcp, addr, &nfmsg)) {
+ const uint8_t subsys_id = (uint8_t) (nlmsghdr->nlmsg_type >> 8);
+ uint16_t res_id = ntohs(nfmsg.res_id);
+
+ tprint_struct_begin();
+ PRINT_FIELD_XVAL(nfmsg, nfgen_family, addrfams, "AF_???");
+ tprint_struct_next();
+ PRINT_FIELD_XVAL(nfmsg, version, netfilter_versions,
+ "NFNETLINK_???");
+
+ /*
+ * Work around wrong endianness in res_id field,
+ * see linux commit v4.3-rc1~28^2~47^2~1
+ */
+ tprint_struct_next();
+ tprints_field_name("res_id");
+ if (subsys_id == NFNL_SUBSYS_NFTABLES
+ && res_id == NFNL_SUBSYS_NFTABLES) {
+ print_xlat_ex(nfmsg.res_id,
+ "htons(NFNL_SUBSYS_NFTABLES)",
+ XLAT_STYLE_DEFAULT);
+ } else if (subsys_id == NFNL_SUBSYS_NFTABLES
+ && nfmsg.res_id == NFNL_SUBSYS_NFTABLES) {
+ print_xlat_ex(nfmsg.res_id, "NFNL_SUBSYS_NFTABLES",
+ XLAT_STYLE_DEFAULT);
+ } else {
+ tprintf("htons(%d)", res_id);
+ }
+
+ const size_t offset = NLMSG_ALIGN(sizeof(nfmsg));
+ if (len > offset) {
+ tprints(", ");
+ if ((nlmsghdr->nlmsg_type >= NFNL_MSG_BATCH_BEGIN
+ && nlmsghdr->nlmsg_type <= NFNL_MSG_BATCH_END)
+ || nlmsghdr->nlmsg_type < NLMSG_MIN_TYPE)
+ printstr_ex(tcp, addr + offset,
+ len - offset, QUOTE_FORCE_HEX);
+ else
+ decode_nlattr(tcp, addr + offset, len - offset,
+ NULL, NULL, NULL, 0, NULL);
+ }
+ }
+
+ return true;
+}
+
+#endif /* HAVE_LINUX_NETFILTER_NFNETLINK_H */
diff --git a/src/netlink_netlink_diag.c b/src/netlink_netlink_diag.c
new file mode 100644
index 000000000..eaba05393
--- /dev/null
+++ b/src/netlink_netlink_diag.c
@@ -0,0 +1,187 @@
+/*
+ * Copyright (c) 2016 Fabien Siron <fabien.siron@epita.fr>
+ * Copyright (c) 2017 JingPiao Chen <chenjingpiao@gmail.com>
+ * Copyright (c) 2017-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include "netlink.h"
+#include "netlink_sock_diag.h"
+#include "nlattr.h"
+
+#include <linux/sock_diag.h>
+#include <linux/netlink_diag.h>
+
+#include "xlat/netlink_diag_attrs.h"
+#include "xlat/netlink_diag_show.h"
+#include "xlat/netlink_socket_flags.h"
+#include "xlat/netlink_states.h"
+
+DECL_NETLINK_DIAG_DECODER(decode_netlink_diag_req)
+{
+ struct netlink_diag_req req = { .sdiag_family = family };
+ const size_t offset = sizeof(req.sdiag_family);
+
+ tprint_struct_begin();
+ PRINT_FIELD_XVAL(req, sdiag_family, addrfams, "AF_???");
+ tprints(", ");
+ if (len >= sizeof(req)) {
+ if (!umoven_or_printaddr(tcp, addr + offset,
+ sizeof(req) - offset,
+ (char *) &req + offset)) {
+ if (NDIAG_PROTO_ALL == req.sdiag_protocol) {
+ tprints_field_name("sdiag_protocol");
+ tprints("NDIAG_PROTO_ALL");
+ } else {
+ PRINT_FIELD_XVAL(req, sdiag_protocol,
+ netlink_protocols,
+ "NETLINK_???");
+ }
+ tprint_struct_next();
+ PRINT_FIELD_U(req, ndiag_ino);
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(req, ndiag_show,
+ netlink_diag_show, "NDIAG_SHOW_???");
+ tprint_struct_next();
+ PRINT_FIELD_COOKIE(req, ndiag_cookie);
+ }
+ } else
+ tprint_more_data_follows();
+ tprint_struct_end();
+}
+
+static bool
+print_group(struct tcb *const tcp,
+ void *const elem_buf,
+ const size_t elem_size,
+ void *const opaque_data)
+{
+ if (elem_size < sizeof(kernel_ulong_t))
+ tprintf("%#0*x", (int) elem_size * 2 + 2,
+ *(unsigned int *) elem_buf);
+ else
+ tprintf("%#0*" PRI_klx, (int) elem_size * 2 + 2,
+ *(kernel_ulong_t *) elem_buf);
+
+ return true;
+}
+
+static bool
+decode_netlink_diag_groups(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ kernel_ulong_t buf;
+ const size_t nmemb = len / current_wordsize;
+
+ if (!nmemb)
+ return false;
+
+ print_array(tcp, addr, nmemb, &buf, current_wordsize,
+ tfetch_mem, print_group, 0);
+
+ return true;
+}
+
+static bool
+decode_netlink_diag_ring(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ struct netlink_diag_ring ndr;
+
+ if (len < sizeof(ndr))
+ return false;
+ if (umove_or_printaddr(tcp, addr, &ndr))
+ return true;
+
+ tprint_struct_begin();
+ PRINT_FIELD_U(ndr, ndr_block_size);
+ tprint_struct_next();
+ PRINT_FIELD_U(ndr, ndr_block_nr);
+ tprint_struct_next();
+ PRINT_FIELD_U(ndr, ndr_frame_size);
+ tprint_struct_next();
+ PRINT_FIELD_U(ndr, ndr_frame_nr);
+ tprint_struct_end();
+
+ return true;
+}
+
+static bool
+decode_netlink_diag_flags(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ uint32_t flags;
+
+ if (len < sizeof(flags))
+ return false;
+ if (umove_or_printaddr(tcp, addr, &flags))
+ return true;
+
+ printflags(netlink_socket_flags, flags, "NDIAG_FLAG_???");
+
+ return true;
+}
+
+static const nla_decoder_t netlink_diag_msg_nla_decoders[] = {
+ [NETLINK_DIAG_MEMINFO] = decode_nla_meminfo,
+ [NETLINK_DIAG_GROUPS] = decode_netlink_diag_groups,
+ [NETLINK_DIAG_RX_RING] = decode_netlink_diag_ring,
+ [NETLINK_DIAG_TX_RING] = decode_netlink_diag_ring,
+ [NETLINK_DIAG_FLAGS] = decode_netlink_diag_flags
+};
+
+DECL_NETLINK_DIAG_DECODER(decode_netlink_diag_msg)
+{
+ struct netlink_diag_msg msg = { .ndiag_family = family };
+ size_t offset = sizeof(msg.ndiag_family);
+ bool decode_nla = false;
+
+ tprint_struct_begin();
+ PRINT_FIELD_XVAL(msg, ndiag_family, addrfams, "AF_???");
+ tprints(", ");
+ if (len >= sizeof(msg)) {
+ if (!umoven_or_printaddr(tcp, addr + offset,
+ sizeof(msg) - offset,
+ (char *) &msg + offset)) {
+ PRINT_FIELD_XVAL(msg, ndiag_type,
+ socktypes, "SOCK_???");
+ tprint_struct_next();
+ PRINT_FIELD_XVAL(msg, ndiag_protocol,
+ netlink_protocols, "NETLINK_???");
+ tprint_struct_next();
+ PRINT_FIELD_XVAL(msg, ndiag_state,
+ netlink_states, "NETLINK_???");
+ tprint_struct_next();
+ PRINT_FIELD_U(msg, ndiag_portid);
+ tprint_struct_next();
+ PRINT_FIELD_U(msg, ndiag_dst_portid);
+ tprint_struct_next();
+ PRINT_FIELD_U(msg, ndiag_dst_group);
+ tprint_struct_next();
+ PRINT_FIELD_U(msg, ndiag_ino);
+ tprint_struct_next();
+ PRINT_FIELD_COOKIE(msg, ndiag_cookie);
+ decode_nla = true;
+ }
+ } else
+ tprint_more_data_follows();
+ tprint_struct_end();
+
+ offset = NLMSG_ALIGN(sizeof(msg));
+ if (decode_nla && len > offset) {
+ tprints(", ");
+ decode_nlattr(tcp, addr + offset, len - offset,
+ netlink_diag_attrs, "NETLINK_DIAG_???",
+ netlink_diag_msg_nla_decoders,
+ ARRAY_SIZE(netlink_diag_msg_nla_decoders), NULL);
+ }
+}
diff --git a/src/netlink_packet_diag.c b/src/netlink_packet_diag.c
new file mode 100644
index 000000000..d66a2ad09
--- /dev/null
+++ b/src/netlink_packet_diag.c
@@ -0,0 +1,218 @@
+/*
+ * Copyright (c) 2016 Fabien Siron <fabien.siron@epita.fr>
+ * Copyright (c) 2017 JingPiao Chen <chenjingpiao@gmail.com>
+ * Copyright (c) 2017-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include "netlink.h"
+#include "netlink_sock_diag.h"
+#include "nlattr.h"
+
+#include <linux/filter.h>
+#include <linux/sock_diag.h>
+#include <linux/packet_diag.h>
+
+#include "xlat/af_packet_versions.h"
+#include "xlat/packet_diag_attrs.h"
+#include "xlat/packet_diag_info_flags.h"
+#include "xlat/packet_diag_show.h"
+
+DECL_NETLINK_DIAG_DECODER(decode_packet_diag_req)
+{
+ struct packet_diag_req req = { .sdiag_family = family };
+ const size_t offset = sizeof(req.sdiag_family);
+
+ tprint_struct_begin();
+ PRINT_FIELD_XVAL(req, sdiag_family, addrfams, "AF_???");
+ tprints(", ");
+ if (len >= sizeof(req)) {
+ if (!umoven_or_printaddr(tcp, addr + offset,
+ sizeof(req) - offset,
+ (char *) &req + offset)) {
+ /*
+ * AF_PACKET currently doesn't support protocol values
+ * other than 0.
+ */
+ PRINT_FIELD_X(req, sdiag_protocol);
+ tprint_struct_next();
+ PRINT_FIELD_U(req, pdiag_ino);
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(req, pdiag_show,
+ packet_diag_show, "PACKET_SHOW_???");
+ tprint_struct_next();
+ PRINT_FIELD_COOKIE(req, pdiag_cookie);
+ }
+ } else
+ tprint_more_data_follows();
+ tprint_struct_end();
+}
+
+static bool
+decode_packet_diag_info(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ struct packet_diag_info pinfo;
+
+ if (len < sizeof(pinfo))
+ return false;
+ if (umove_or_printaddr(tcp, addr, &pinfo))
+ return true;
+
+ tprint_struct_begin();
+ PRINT_FIELD_IFINDEX(pinfo, pdi_index);
+ tprint_struct_next();
+ PRINT_FIELD_XVAL(pinfo, pdi_version, af_packet_versions, "TPACKET_???");
+ tprint_struct_next();
+ PRINT_FIELD_U(pinfo, pdi_reserve);
+ tprint_struct_next();
+ PRINT_FIELD_U(pinfo, pdi_copy_thresh);
+ tprint_struct_next();
+ PRINT_FIELD_U(pinfo, pdi_tstamp);
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(pinfo, pdi_flags, packet_diag_info_flags, "PDI_???");
+ tprint_struct_end();
+
+ return true;
+}
+
+static bool
+print_packet_diag_mclist(struct tcb *const tcp, void *const elem_buf,
+ const size_t elem_size, void *const opaque_data)
+{
+ struct packet_diag_mclist *dml = elem_buf;
+ uint16_t alen = MIN(dml->pdmc_alen, sizeof(dml->pdmc_addr));
+
+ tprint_struct_begin();
+ PRINT_FIELD_IFINDEX(*dml, pdmc_index);
+ tprint_struct_next();
+ PRINT_FIELD_U(*dml, pdmc_count);
+ tprint_struct_next();
+ PRINT_FIELD_U(*dml, pdmc_type);
+ tprint_struct_next();
+ PRINT_FIELD_U(*dml, pdmc_alen);
+ tprint_struct_next();
+ PRINT_FIELD_STRING(*dml, pdmc_addr, alen, QUOTE_FORCE_HEX);
+ tprint_struct_end();
+
+ return true;
+}
+
+static bool
+decode_packet_diag_mclist(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ struct packet_diag_mclist dml;
+ const size_t nmemb = len / sizeof(dml);
+
+ if (!nmemb)
+ return false;
+
+ print_array(tcp, addr, nmemb, &dml, sizeof(dml),
+ tfetch_mem, print_packet_diag_mclist, 0);
+
+ return true;
+}
+
+static bool
+decode_packet_diag_ring(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ struct packet_diag_ring pdr;
+
+ if (len < sizeof(pdr))
+ return false;
+ if (umove_or_printaddr(tcp, addr, &pdr))
+ return true;
+
+ tprint_struct_begin();
+ PRINT_FIELD_U(pdr, pdr_block_size);
+ tprint_struct_next();
+ PRINT_FIELD_U(pdr, pdr_block_nr);
+ tprint_struct_next();
+ PRINT_FIELD_U(pdr, pdr_frame_size);
+ tprint_struct_next();
+ PRINT_FIELD_U(pdr, pdr_frame_nr);
+ tprint_struct_next();
+ PRINT_FIELD_U(pdr, pdr_retire_tmo);
+ tprint_struct_next();
+ PRINT_FIELD_U(pdr, pdr_sizeof_priv);
+ tprint_struct_next();
+ PRINT_FIELD_U(pdr, pdr_features);
+ tprint_struct_end();
+
+ return true;
+}
+
+static bool
+decode_packet_diag_filter(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ const unsigned int nmemb = len / sizeof(struct sock_filter);
+ if (!nmemb || (unsigned short) nmemb != nmemb)
+ return false;
+
+ print_sock_fprog(tcp, addr, nmemb);
+
+ return true;
+}
+
+static const nla_decoder_t packet_diag_msg_nla_decoders[] = {
+ [PACKET_DIAG_INFO] = decode_packet_diag_info,
+ [PACKET_DIAG_MCLIST] = decode_packet_diag_mclist,
+ [PACKET_DIAG_RX_RING] = decode_packet_diag_ring,
+ [PACKET_DIAG_TX_RING] = decode_packet_diag_ring,
+ [PACKET_DIAG_FANOUT] = decode_nla_u32,
+ [PACKET_DIAG_UID] = decode_nla_uid,
+ [PACKET_DIAG_MEMINFO] = decode_nla_meminfo,
+ [PACKET_DIAG_FILTER] = decode_packet_diag_filter
+};
+
+DECL_NETLINK_DIAG_DECODER(decode_packet_diag_msg)
+{
+ struct packet_diag_msg msg = { .pdiag_family = family };
+ size_t offset = sizeof(msg.pdiag_family);
+ bool decode_nla = false;
+
+ tprint_struct_begin();
+ PRINT_FIELD_XVAL(msg, pdiag_family, addrfams, "AF_???");
+ tprints(", ");
+ if (len >= sizeof(msg)) {
+ if (!umoven_or_printaddr(tcp, addr + offset,
+ sizeof(msg) - offset,
+ (char *) &msg + offset)) {
+ PRINT_FIELD_XVAL(msg, pdiag_type,
+ socktypes, "SOCK_???");
+ tprint_struct_next();
+ PRINT_FIELD_XVAL(msg, pdiag_num,
+ ethernet_protocols, "ETH_P_???");
+ tprint_struct_next();
+ PRINT_FIELD_U(msg, pdiag_ino);
+ tprint_struct_next();
+ PRINT_FIELD_COOKIE(msg, pdiag_cookie);
+ decode_nla = true;
+ }
+ } else
+ tprint_more_data_follows();
+ tprint_struct_end();
+
+ offset = NLMSG_ALIGN(sizeof(msg));
+ if (decode_nla && len > offset) {
+ tprints(", ");
+ decode_nlattr(tcp, addr + offset, len - offset,
+ packet_diag_attrs, "PACKET_DIAG_???",
+ packet_diag_msg_nla_decoders,
+ ARRAY_SIZE(packet_diag_msg_nla_decoders), NULL);
+ }
+}
diff --git a/src/netlink_route.c b/src/netlink_route.c
new file mode 100644
index 000000000..52f5da4ae
--- /dev/null
+++ b/src/netlink_route.c
@@ -0,0 +1,130 @@
+/*
+ * Copyright (c) 2016 Fabien Siron <fabien.siron@epita.fr>
+ * Copyright (c) 2017 JingPiao Chen <chenjingpiao@gmail.com>
+ * Copyright (c) 2016-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include "netlink.h"
+#include "netlink_route.h"
+
+#include <linux/rtnetlink.h>
+
+#include "xlat/nl_route_types.h"
+
+static void
+decode_family(struct tcb *const tcp, const uint8_t family,
+ const kernel_ulong_t addr, const unsigned int len)
+{
+ tprint_struct_begin();
+ tprints_field_name("family");
+ printxval(addrfams, family, "AF_???");
+ if (len > sizeof(family)) {
+ tprints(", ");
+ printstr_ex(tcp, addr + sizeof(family),
+ len - sizeof(family), QUOTE_FORCE_HEX);
+ }
+ tprint_struct_end();
+}
+
+typedef DECL_NETLINK_ROUTE_DECODER((*netlink_route_decoder_t));
+
+static const netlink_route_decoder_t route_decoders[] = {
+ [RTM_DELLINK - RTM_BASE] = decode_ifinfomsg,
+ [RTM_GETLINK - RTM_BASE] = decode_ifinfomsg,
+ [RTM_NEWLINK - RTM_BASE] = decode_ifinfomsg,
+ [RTM_SETLINK - RTM_BASE] = decode_ifinfomsg,
+
+ [RTM_DELADDR - RTM_BASE] = decode_ifaddrmsg,
+ [RTM_GETADDR - RTM_BASE] = decode_ifaddrmsg,
+ [RTM_GETANYCAST - RTM_BASE] = decode_ifaddrmsg,
+ [RTM_GETMULTICAST - RTM_BASE] = decode_ifaddrmsg,
+ [RTM_NEWADDR - RTM_BASE] = decode_ifaddrmsg,
+
+ [RTM_DELROUTE - RTM_BASE] = decode_rtmsg,
+ [RTM_GETROUTE - RTM_BASE] = decode_rtmsg,
+ [RTM_NEWROUTE - RTM_BASE] = decode_rtmsg,
+
+ [RTM_DELRULE - RTM_BASE] = decode_fib_rule_hdr,
+ [RTM_GETRULE - RTM_BASE] = decode_fib_rule_hdr,
+ [RTM_NEWRULE - RTM_BASE] = decode_fib_rule_hdr,
+
+ [RTM_DELNEIGH - RTM_BASE] = decode_ndmsg,
+ [RTM_GETNEIGH - RTM_BASE] = decode_rtm_getneigh,
+ [RTM_NEWNEIGH - RTM_BASE] = decode_ndmsg,
+
+ [RTM_GETNEIGHTBL - RTM_BASE] = decode_ndtmsg,
+ [RTM_NEWNEIGHTBL - RTM_BASE] = decode_ndtmsg,
+ [RTM_SETNEIGHTBL - RTM_BASE] = decode_ndtmsg,
+
+ [RTM_DELQDISC - RTM_BASE] = decode_tcmsg,
+ [RTM_GETQDISC - RTM_BASE] = decode_tcmsg,
+ [RTM_NEWQDISC - RTM_BASE] = decode_tcmsg,
+ [RTM_DELTCLASS - RTM_BASE] = decode_tcmsg,
+ [RTM_GETTCLASS - RTM_BASE] = decode_tcmsg,
+ [RTM_NEWTCLASS - RTM_BASE] = decode_tcmsg,
+ [RTM_DELTFILTER - RTM_BASE] = decode_tcmsg,
+ [RTM_GETTFILTER - RTM_BASE] = decode_tcmsg,
+ [RTM_NEWTFILTER - RTM_BASE] = decode_tcmsg,
+
+ [RTM_DELACTION - RTM_BASE] = decode_tcamsg,
+ [RTM_GETACTION - RTM_BASE] = decode_tcamsg,
+ [RTM_NEWACTION - RTM_BASE] = decode_tcamsg,
+
+#ifdef HAVE_STRUCT_IFADDRLBLMSG
+ [RTM_DELADDRLABEL - RTM_BASE] = decode_ifaddrlblmsg,
+ [RTM_GETADDRLABEL - RTM_BASE] = decode_ifaddrlblmsg,
+ [RTM_NEWADDRLABEL - RTM_BASE] = decode_ifaddrlblmsg,
+#endif
+
+#ifdef HAVE_STRUCT_DCBMSG
+ [RTM_GETDCB - RTM_BASE] = decode_dcbmsg,
+ [RTM_SETDCB - RTM_BASE] = decode_dcbmsg,
+#endif
+
+#ifdef HAVE_STRUCT_NETCONFMSG
+ [RTM_DELNETCONF - RTM_BASE] = decode_netconfmsg,
+ [RTM_GETNETCONF - RTM_BASE] = decode_netconfmsg,
+ [RTM_NEWNETCONF - RTM_BASE] = decode_netconfmsg,
+#endif
+
+ [RTM_DELMDB - RTM_BASE] = decode_br_port_msg,
+ [RTM_GETMDB - RTM_BASE] = decode_br_port_msg,
+ [RTM_NEWMDB - RTM_BASE] = decode_br_port_msg,
+
+ [RTM_DELNSID - RTM_BASE] = decode_rtgenmsg,
+ [RTM_GETNSID - RTM_BASE] = decode_rtgenmsg,
+ [RTM_NEWNSID - RTM_BASE] = decode_rtgenmsg,
+
+ [RTM_NEWCHAIN - RTM_BASE] = decode_tcmsg,
+ [RTM_DELCHAIN - RTM_BASE] = decode_tcmsg,
+ [RTM_GETCHAIN - RTM_BASE] = decode_tcmsg,
+};
+
+bool
+decode_netlink_route(struct tcb *const tcp,
+ const struct nlmsghdr *const nlmsghdr,
+ const kernel_ulong_t addr,
+ const unsigned int len)
+{
+ uint8_t family;
+
+ if (nlmsghdr->nlmsg_type == NLMSG_DONE)
+ return false;
+
+ if (!umove_or_printaddr(tcp, addr, &family)) {
+ const unsigned int index = nlmsghdr->nlmsg_type - RTM_BASE;
+
+ if (index < ARRAY_SIZE(route_decoders)
+ && route_decoders[index]) {
+ route_decoders[index](tcp, nlmsghdr, family, addr, len);
+ } else {
+ decode_family(tcp, family, addr, len);
+ }
+ }
+
+ return true;
+}
diff --git a/src/netlink_route.h b/src/netlink_route.h
new file mode 100644
index 000000000..62aecf7f8
--- /dev/null
+++ b/src/netlink_route.h
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2016 Fabien Siron <fabien.siron@epita.fr>
+ * Copyright (c) 2017 JingPiao Chen <chenjingpiao@gmail.com>
+ * Copyright (c) 2016-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_NETLINK_ROUTE_H
+# define STRACE_NETLINK_ROUTE_H
+
+# define DECL_NETLINK_ROUTE_DECODER(route_decode_name) \
+void \
+route_decode_name(struct tcb *tcp, \
+ const struct nlmsghdr *nlmsghdr, \
+ uint8_t family, \
+ kernel_ulong_t addr, \
+ unsigned int len) \
+/* End of DECL_NETLINK_ROUTE_DECODER definition. */
+
+extern DECL_NETLINK_ROUTE_DECODER(decode_br_port_msg);
+extern DECL_NETLINK_ROUTE_DECODER(decode_dcbmsg);
+extern DECL_NETLINK_ROUTE_DECODER(decode_fib_rule_hdr);
+extern DECL_NETLINK_ROUTE_DECODER(decode_ifaddrlblmsg);
+extern DECL_NETLINK_ROUTE_DECODER(decode_ifaddrmsg);
+extern DECL_NETLINK_ROUTE_DECODER(decode_ifinfomsg);
+extern DECL_NETLINK_ROUTE_DECODER(decode_ndmsg);
+extern DECL_NETLINK_ROUTE_DECODER(decode_ndtmsg);
+extern DECL_NETLINK_ROUTE_DECODER(decode_netconfmsg);
+extern DECL_NETLINK_ROUTE_DECODER(decode_rtgenmsg);
+extern DECL_NETLINK_ROUTE_DECODER(decode_rtm_getneigh);
+extern DECL_NETLINK_ROUTE_DECODER(decode_rtmsg);
+extern DECL_NETLINK_ROUTE_DECODER(decode_tcamsg);
+extern DECL_NETLINK_ROUTE_DECODER(decode_tcmsg);
+
+#endif /* !STRACE_NETLINK_ROUTE_H */
diff --git a/src/netlink_selinux.c b/src/netlink_selinux.c
new file mode 100644
index 000000000..39e1f40ad
--- /dev/null
+++ b/src/netlink_selinux.c
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2017 JingPiao Chen <chenjingpiao@gmail.com>
+ * Copyright (c) 2017-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include "netlink.h"
+
+#include <linux/selinux_netlink.h>
+
+bool
+decode_netlink_selinux(struct tcb *const tcp,
+ const struct nlmsghdr *const nlmsghdr,
+ const kernel_ulong_t addr,
+ const unsigned int len)
+{
+ switch (nlmsghdr->nlmsg_type) {
+ case SELNL_MSG_SETENFORCE: {
+ struct selnl_msg_setenforce msg;
+
+ if (len < sizeof(msg))
+ printstr_ex(tcp, addr, len, QUOTE_FORCE_HEX);
+ else if (!umove_or_printaddr(tcp, addr, &msg)) {
+ tprint_struct_begin();
+ PRINT_FIELD_D(msg, val);
+ tprint_struct_end();
+ }
+ break;
+ }
+ case SELNL_MSG_POLICYLOAD: {
+ struct selnl_msg_policyload msg;
+
+ if (len < sizeof(msg))
+ printstr_ex(tcp, addr, len, QUOTE_FORCE_HEX);
+ else if (!umove_or_printaddr(tcp, addr, &msg)) {
+ tprint_struct_begin();
+ PRINT_FIELD_U(msg, seqno);
+ tprint_struct_end();
+ }
+ break;
+ }
+ default:
+ return false;
+ }
+
+ return true;
+}
diff --git a/src/netlink_smc_diag.c b/src/netlink_smc_diag.c
new file mode 100644
index 000000000..e2243a76a
--- /dev/null
+++ b/src/netlink_smc_diag.c
@@ -0,0 +1,285 @@
+/*
+ * Copyright (c) 2017 JingPiao Chen <chenjingpiao@gmail.com>
+ * Copyright (c) 2017-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include <sys/socket.h>
+
+#ifndef AF_SMC
+# define XLAT_MACROS_ONLY
+# include "xlat/addrfams.h"
+# undef XLAT_MACROS_ONLY
+#endif
+
+#include "netlink.h"
+#include "netlink_sock_diag.h"
+#include "nlattr.h"
+
+#include <arpa/inet.h>
+#include <linux/smc_diag.h>
+
+#include "xlat/smc_decl_codes.h"
+#include "xlat/smc_diag_attrs.h"
+#include "xlat/smc_diag_extended_flags.h"
+#include "xlat/smc_diag_mode.h"
+#include "xlat/smc_link_group_roles.h"
+#include "xlat/smc_states.h"
+#include "xlat/sock_shutdown_flags.h"
+
+DECL_NETLINK_DIAG_DECODER(decode_smc_diag_req)
+{
+ struct smc_diag_req req = { .diag_family = family };
+ const size_t offset = sizeof(req.diag_family);
+
+ tprint_struct_begin();
+ PRINT_FIELD_XVAL(req, diag_family, addrfams, "AF_???");
+ tprints(", ");
+ if (len >= sizeof(req)) {
+ if (!umoven_or_printaddr(tcp, addr + offset,
+ sizeof(req) - offset,
+ (void *) &req + offset)) {
+ PRINT_FIELD_FLAGS(req, diag_ext,
+ smc_diag_extended_flags,
+ "1<<SMC_DIAG_\?\?\?-1");
+ /*
+ * AF_SMC protocol family socket handler
+ * keeping the AF_INET sock address.
+ */
+ tprint_struct_next();
+ PRINT_FIELD_INET_DIAG_SOCKID(req, id, AF_INET);
+ }
+ } else
+ tprint_more_data_follows();
+ tprint_struct_end();
+}
+
+static void
+print_smc_diag_cursor(const struct smc_diag_cursor *const cursor)
+{
+ tprint_struct_begin();
+ PRINT_FIELD_U(*cursor, reserved);
+ tprint_struct_next();
+ PRINT_FIELD_U(*cursor, wrap);
+ tprint_struct_next();
+ PRINT_FIELD_U(*cursor, count);
+ tprint_struct_end();
+}
+
+static bool
+decode_smc_diag_conninfo(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ struct smc_diag_conninfo cinfo;
+
+ if (len < sizeof(cinfo))
+ return false;
+ if (umove_or_printaddr(tcp, addr, &cinfo))
+ return true;
+
+ tprint_struct_begin();
+ PRINT_FIELD_U(cinfo, token);
+ tprint_struct_next();
+ PRINT_FIELD_U(cinfo, sndbuf_size);
+ tprint_struct_next();
+ PRINT_FIELD_U(cinfo, rmbe_size);
+ tprint_struct_next();
+ PRINT_FIELD_U(cinfo, peer_rmbe_size);
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_PTR(cinfo, rx_prod, print_smc_diag_cursor);
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_PTR(cinfo, rx_cons, print_smc_diag_cursor);
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_PTR(cinfo, tx_prod, print_smc_diag_cursor);
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_PTR(cinfo, tx_cons, print_smc_diag_cursor);
+ tprint_struct_next();
+ PRINT_FIELD_0X(cinfo, rx_prod_flags);
+ tprint_struct_next();
+ PRINT_FIELD_0X(cinfo, rx_conn_state_flags);
+ tprint_struct_next();
+ PRINT_FIELD_0X(cinfo, tx_prod_flags);
+ tprint_struct_next();
+ PRINT_FIELD_0X(cinfo, tx_conn_state_flags);
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_PTR(cinfo, tx_prep, print_smc_diag_cursor);
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_PTR(cinfo, tx_sent, print_smc_diag_cursor);
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_PTR(cinfo, tx_fin, print_smc_diag_cursor);
+ tprint_struct_end();
+
+ return true;
+}
+
+static bool
+print_smc_diag_linkinfo_array_member(struct tcb *tcp, void *elem_buf,
+ size_t elem_size, void *data)
+{
+ const struct smc_diag_linkinfo *const p = elem_buf;
+ tprint_struct_begin();
+ PRINT_FIELD_U(*p, link_id);
+ tprint_struct_next();
+ PRINT_FIELD_CSTRING(*p, ibname);
+ tprint_struct_next();
+ PRINT_FIELD_U(*p, ibport);
+ tprint_struct_next();
+ PRINT_FIELD_CSTRING(*p, gid);
+ tprint_struct_next();
+ PRINT_FIELD_CSTRING(*p, peer_gid);
+ tprint_struct_end();
+ return true;
+}
+
+static bool
+decode_smc_diag_lgrinfo(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ struct smc_diag_lgrinfo linfo;
+
+ if (len < sizeof(linfo))
+ return false;
+ if (umove_or_printaddr(tcp, addr, &linfo))
+ return true;
+
+ tprint_struct_begin();
+ PRINT_FIELD_ARRAY(linfo, lnk, tcp,
+ print_smc_diag_linkinfo_array_member);
+ tprint_struct_next();
+ PRINT_FIELD_XVAL(linfo, role, smc_link_group_roles, "SMC_???");
+ tprint_struct_end();
+
+ return true;
+}
+
+static bool
+decode_smc_diag_shutdown(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ const struct decode_nla_xlat_opts opts = {
+ sock_shutdown_flags, "???_SHUTDOWN",
+ .size = 1,
+ };
+
+ return decode_nla_flags(tcp, addr, len, &opts);
+}
+
+static bool
+decode_smc_diag_dmbinfo(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ struct smcd_diag_dmbinfo dinfo;
+
+ if (len < sizeof(dinfo))
+ return false;
+ if (umove_or_printaddr(tcp, addr, &dinfo))
+ return true;
+
+ tprint_struct_begin();
+ PRINT_FIELD_U(dinfo, linkid);
+ tprint_struct_next();
+ PRINT_FIELD_X(dinfo, peer_gid);
+ tprint_struct_next();
+ PRINT_FIELD_X(dinfo, my_gid);
+ tprint_struct_next();
+ PRINT_FIELD_X(dinfo, token);
+ tprint_struct_next();
+ PRINT_FIELD_X(dinfo, peer_token);
+ tprint_struct_end();
+
+ return true;
+}
+static bool
+decode_smc_diag_fallback(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ struct smc_diag_fallback fb;
+
+ if (len < sizeof(fb))
+ return false;
+ if (umove_or_printaddr(tcp, addr, &fb))
+ return true;
+
+ /*
+ * We print them verbose since they are defined in a non-UAPI header,
+ * net/smc/smc_clc.h
+ */
+ tprint_struct_begin();
+ tprints_field_name("reason");
+ printxval_ex(smc_decl_codes, fb.reason, "SMC_CLC_DECL_???",
+ XLAT_STYLE_VERBOSE);
+ tprint_struct_next();
+ tprints_field_name("peer_diagnosis");
+ printxval_ex(smc_decl_codes, fb.peer_diagnosis, "SMC_CLC_DECL_???",
+ XLAT_STYLE_VERBOSE);
+ tprint_struct_end();
+
+ return true;
+}
+
+static const nla_decoder_t smc_diag_msg_nla_decoders[] = {
+ [SMC_DIAG_CONNINFO] = decode_smc_diag_conninfo,
+ [SMC_DIAG_LGRINFO] = decode_smc_diag_lgrinfo,
+ [SMC_DIAG_SHUTDOWN] = decode_smc_diag_shutdown,
+ [SMC_DIAG_DMBINFO] = decode_smc_diag_dmbinfo,
+ [SMC_DIAG_FALLBACK] = decode_smc_diag_fallback,
+};
+
+DECL_NETLINK_DIAG_DECODER(decode_smc_diag_msg)
+{
+ struct smc_diag_msg msg = { .diag_family = family };
+ size_t offset = sizeof(msg.diag_family);
+ bool decode_nla = false;
+
+ tprint_struct_begin();
+ PRINT_FIELD_XVAL(msg, diag_family, addrfams, "AF_???");
+ tprints(", ");
+ if (len >= sizeof(msg)) {
+ if (!umoven_or_printaddr(tcp, addr + offset,
+ sizeof(msg) - offset,
+ (void *) &msg + offset)) {
+ PRINT_FIELD_XVAL(msg, diag_state,
+ smc_states, "SMC_???");
+ tprint_struct_next();
+ PRINT_FIELD_XVAL(msg, diag_fallback,
+ smc_diag_mode, "SMC_DIAG_MODE_???");
+ tprint_struct_next();
+ PRINT_FIELD_U(msg, diag_shutdown);
+ /*
+ * AF_SMC protocol family socket handler
+ * keeping the AF_INET sock address.
+ */
+ tprint_struct_next();
+ PRINT_FIELD_INET_DIAG_SOCKID(msg, id, AF_INET);
+ tprint_struct_next();
+ PRINT_FIELD_U(msg, diag_uid);
+ tprint_struct_next();
+ PRINT_FIELD_U(msg, diag_inode);
+ decode_nla = true;
+ }
+ } else
+ tprint_more_data_follows();
+ tprint_struct_end();
+
+ offset = NLMSG_ALIGN(sizeof(msg));
+ if (decode_nla && len > offset) {
+ tprints(", ");
+ decode_nlattr(tcp, addr + offset, len - offset,
+ smc_diag_attrs, "SMC_DIAG_???",
+ smc_diag_msg_nla_decoders,
+ ARRAY_SIZE(smc_diag_msg_nla_decoders), NULL);
+ }
+}
diff --git a/src/netlink_sock_diag.c b/src/netlink_sock_diag.c
new file mode 100644
index 000000000..519ce2d81
--- /dev/null
+++ b/src/netlink_sock_diag.c
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2016 Fabien Siron <fabien.siron@epita.fr>
+ * Copyright (c) 2017 JingPiao Chen <chenjingpiao@gmail.com>
+ * Copyright (c) 2017-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include "netlink.h"
+#include "netlink_sock_diag.h"
+
+#define XLAT_MACROS_ONLY
+#include "xlat/addrfams.h"
+#undef XLAT_MACROS_ONLY
+
+static void
+decode_family(struct tcb *const tcp, const uint8_t family,
+ const kernel_ulong_t addr, const unsigned int len)
+{
+ tprint_struct_begin();
+ tprints_field_name("family");
+ printxval(addrfams, family, "AF_???");
+ if (len > sizeof(family)) {
+ tprints(", ");
+ printstr_ex(tcp, addr + sizeof(family),
+ len - sizeof(family), QUOTE_FORCE_HEX);
+ }
+ tprint_struct_end();
+}
+
+typedef DECL_NETLINK_DIAG_DECODER((*netlink_diag_decoder_t));
+
+static const struct {
+ const netlink_diag_decoder_t request, response;
+} diag_decoders[] = {
+ [AF_UNIX] = { decode_unix_diag_req, decode_unix_diag_msg },
+ [AF_INET] = { decode_inet_diag_req, decode_inet_diag_msg },
+ [AF_INET6] = { decode_inet_diag_req, decode_inet_diag_msg },
+ [AF_NETLINK] = { decode_netlink_diag_req, decode_netlink_diag_msg },
+ [AF_PACKET] = { decode_packet_diag_req, decode_packet_diag_msg },
+ [AF_SMC] = { decode_smc_diag_req, decode_smc_diag_msg },
+};
+
+bool
+decode_netlink_sock_diag(struct tcb *const tcp,
+ const struct nlmsghdr *const nlmsghdr,
+ const kernel_ulong_t addr,
+ const unsigned int len)
+{
+ uint8_t family;
+
+ if (nlmsghdr->nlmsg_type == NLMSG_DONE)
+ return false;
+
+ if (!umove_or_printaddr(tcp, addr, &family)) {
+ if (family < ARRAY_SIZE(diag_decoders)
+ && len > sizeof(family)) {
+ const netlink_diag_decoder_t decoder =
+ (nlmsghdr->nlmsg_flags & NLM_F_REQUEST)
+ ? diag_decoders[family].request
+ : diag_decoders[family].response;
+
+ if (decoder) {
+ decoder(tcp, nlmsghdr, family, addr, len);
+ return true;
+ }
+ }
+
+ decode_family(tcp, family, addr, len);
+ }
+
+ return true;
+}
diff --git a/src/netlink_sock_diag.h b/src/netlink_sock_diag.h
new file mode 100644
index 000000000..8eb5af210
--- /dev/null
+++ b/src/netlink_sock_diag.h
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2017 JingPiao Chen <chenjingpiao@gmail.com>
+ * Copyright (c) 2016-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_NETLINK_SOCK_DIAG_H
+# define STRACE_NETLINK_SOCK_DIAG_H
+
+# define DECL_NETLINK_DIAG_DECODER(diag_decode_name) \
+void \
+diag_decode_name(struct tcb *tcp, \
+ const struct nlmsghdr *nlmsghdr, \
+ uint8_t family, \
+ kernel_ulong_t addr, \
+ unsigned int len) \
+/* End of DECL_NETLINK_DIAG_DECODER definition. */
+
+extern DECL_NETLINK_DIAG_DECODER(decode_inet_diag_msg);
+extern DECL_NETLINK_DIAG_DECODER(decode_inet_diag_req);
+extern DECL_NETLINK_DIAG_DECODER(decode_netlink_diag_msg);
+extern DECL_NETLINK_DIAG_DECODER(decode_netlink_diag_req);
+extern DECL_NETLINK_DIAG_DECODER(decode_packet_diag_msg);
+extern DECL_NETLINK_DIAG_DECODER(decode_packet_diag_req);
+extern DECL_NETLINK_DIAG_DECODER(decode_smc_diag_msg);
+extern DECL_NETLINK_DIAG_DECODER(decode_smc_diag_req);
+extern DECL_NETLINK_DIAG_DECODER(decode_unix_diag_msg);
+extern DECL_NETLINK_DIAG_DECODER(decode_unix_diag_req);
+
+struct inet_diag_sockid;
+
+extern void
+print_inet_diag_sockid(const struct inet_diag_sockid *, const uint8_t family);
+
+# define PRINT_FIELD_INET_DIAG_SOCKID(where_, field_, af_) \
+ do { \
+ tprints_field_name(#field_); \
+ print_inet_diag_sockid(&(where_).field_, (af_)); \
+ } while (0)
+
+
+#endif /* !STRACE_NETLINK_SOCK_DIAG_H */
diff --git a/src/netlink_unix_diag.c b/src/netlink_unix_diag.c
new file mode 100644
index 000000000..ad00f6e99
--- /dev/null
+++ b/src/netlink_unix_diag.c
@@ -0,0 +1,170 @@
+/*
+ * Copyright (c) 2016 Fabien Siron <fabien.siron@epita.fr>
+ * Copyright (c) 2017 JingPiao Chen <chenjingpiao@gmail.com>
+ * Copyright (c) 2017-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include "netlink.h"
+#include "netlink_sock_diag.h"
+#include "nlattr.h"
+
+#include <linux/sock_diag.h>
+#include <linux/unix_diag.h>
+
+#include "xlat/unix_diag_attrs.h"
+#include "xlat/unix_diag_show.h"
+
+DECL_NETLINK_DIAG_DECODER(decode_unix_diag_req)
+{
+ struct unix_diag_req req = { .sdiag_family = family };
+ const size_t offset = sizeof(req.sdiag_family);
+
+ tprint_struct_begin();
+ PRINT_FIELD_XVAL(req, sdiag_family, addrfams, "AF_???");
+ tprints(", ");
+ if (len >= sizeof(req)) {
+ if (!umoven_or_printaddr(tcp, addr + offset,
+ sizeof(req) - offset,
+ (char *) &req + offset)) {
+ PRINT_FIELD_U(req, sdiag_protocol);
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(req, udiag_states,
+ tcp_state_flags, "1<<TCP_???");
+ tprint_struct_next();
+ PRINT_FIELD_U(req, udiag_ino);
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(req, udiag_show,
+ unix_diag_show, "UDIAG_SHOW_???");
+ tprint_struct_next();
+ PRINT_FIELD_COOKIE(req, udiag_cookie);
+ }
+ } else
+ tprint_more_data_follows();
+ tprint_struct_end();
+}
+
+static bool
+decode_unix_diag_vfs(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ struct unix_diag_vfs uv;
+
+ if (len < sizeof(uv))
+ return false;
+ if (umove_or_printaddr(tcp, addr, &uv))
+ return true;
+
+ tprint_struct_begin();
+ PRINT_FIELD_DEV(uv, udiag_vfs_dev);
+ tprint_struct_next();
+ PRINT_FIELD_U(uv, udiag_vfs_ino);
+ tprint_struct_end();
+
+ return true;
+}
+
+static bool
+print_inode(struct tcb *const tcp,
+ void *const elem_buf,
+ const size_t elem_size,
+ void *const opaque_data)
+{
+ tprintf("%" PRIu32, *(uint32_t *) elem_buf);
+
+ return true;
+}
+
+static bool
+decode_unix_diag_inode(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ uint32_t inode;
+ const size_t nmemb = len / sizeof(inode);
+
+ if (!nmemb)
+ return false;
+
+ print_array(tcp, addr, nmemb, &inode, sizeof(inode),
+ tfetch_mem, print_inode, 0);
+
+ return true;
+}
+
+static bool
+decode_unix_diag_rqlen(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ struct unix_diag_rqlen rql;
+
+ if (len < sizeof(rql))
+ return false;
+ if (umove_or_printaddr(tcp, addr, &rql))
+ return true;
+
+ tprint_struct_begin();
+ PRINT_FIELD_U(rql, udiag_rqueue);
+ tprint_struct_next();
+ PRINT_FIELD_U(rql, udiag_wqueue);
+ tprint_struct_end();
+
+ return true;
+}
+
+static const nla_decoder_t unix_diag_msg_nla_decoders[] = {
+ [UNIX_DIAG_NAME] = decode_nla_str,
+ [UNIX_DIAG_VFS] = decode_unix_diag_vfs,
+ [UNIX_DIAG_PEER] = decode_nla_u32,
+ [UNIX_DIAG_ICONS] = decode_unix_diag_inode,
+ [UNIX_DIAG_RQLEN] = decode_unix_diag_rqlen,
+ [UNIX_DIAG_MEMINFO] = decode_nla_meminfo,
+ [UNIX_DIAG_SHUTDOWN] = decode_nla_u8,
+ [UNIX_DIAG_UID] = decode_nla_uid
+};
+
+DECL_NETLINK_DIAG_DECODER(decode_unix_diag_msg)
+{
+ struct unix_diag_msg msg = { .udiag_family = family };
+ size_t offset = sizeof(msg.udiag_family);
+ bool decode_nla = false;
+
+ tprint_struct_begin();
+ PRINT_FIELD_XVAL(msg, udiag_family, addrfams, "AF_???");
+ tprints(", ");
+ if (len >= sizeof(msg)) {
+ if (!umoven_or_printaddr(tcp, addr + offset,
+ sizeof(msg) - offset,
+ (char *) &msg + offset)) {
+ PRINT_FIELD_XVAL(msg, udiag_type,
+ socktypes, "SOCK_???");
+ tprint_struct_next();
+ PRINT_FIELD_XVAL(msg, udiag_state,
+ tcp_states, "TCP_???");
+ tprint_struct_next();
+ PRINT_FIELD_U(msg, udiag_ino);
+ tprint_struct_next();
+ PRINT_FIELD_COOKIE(msg, udiag_cookie);
+ decode_nla = true;
+ }
+ } else
+ tprint_more_data_follows();
+ tprint_struct_end();
+
+ offset = NLMSG_ALIGN(sizeof(msg));
+ if (decode_nla && len > offset) {
+ tprints(", ");
+ decode_nlattr(tcp, addr + offset, len - offset,
+ unix_diag_attrs, "UNIX_DIAG_???",
+ unix_diag_msg_nla_decoders,
+ ARRAY_SIZE(unix_diag_msg_nla_decoders), NULL);
+ }
+}
diff --git a/src/nlattr.c b/src/nlattr.c
new file mode 100644
index 000000000..9fba18cb4
--- /dev/null
+++ b/src/nlattr.c
@@ -0,0 +1,487 @@
+/*
+ * Copyright (c) 2016 Fabien Siron <fabien.siron@epita.fr>
+ * Copyright (c) 2017 JingPiao Chen <chenjingpiao@gmail.com>
+ * Copyright (c) 2016-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include <endian.h>
+#include "netlink.h"
+#include "nlattr.h"
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <linux/sock_diag.h>
+#include "static_assert.h"
+
+#include "xlat/netlink_sk_meminfo_indices.h"
+
+static bool
+fetch_nlattr(struct tcb *const tcp, struct nlattr *const nlattr,
+ const kernel_ulong_t addr, const unsigned int len,
+ const bool in_array)
+{
+ if (len < sizeof(struct nlattr)) {
+ printstr_ex(tcp, addr, len, QUOTE_FORCE_HEX);
+ return false;
+ }
+
+ if (tfetch_obj(tcp, addr, nlattr))
+ return true;
+
+ if (in_array) {
+ tprint_more_data_follows();
+ printaddr_comment(addr);
+ } else {
+ printaddr(addr);
+ }
+
+ return false;
+}
+
+static void
+print_nlattr(const struct nlattr *const nla,
+ const struct xlat *const table,
+ const char *const dflt)
+{
+ static_assert(NLA_TYPE_MASK == ~(NLA_F_NESTED | NLA_F_NET_BYTEORDER),
+ "wrong NLA_TYPE_MASK");
+
+ tprint_struct_begin();
+ PRINT_FIELD_U(*nla, nla_len);
+ tprint_struct_next();
+ tprints_field_name("nla_type");
+ if (nla->nla_type & NLA_F_NESTED) {
+ print_xlat(NLA_F_NESTED);
+ tprints("|");
+ }
+ if (nla->nla_type & NLA_F_NET_BYTEORDER) {
+ print_xlat(NLA_F_NET_BYTEORDER);
+ tprints("|");
+ }
+ printxval(table, nla->nla_type & NLA_TYPE_MASK, dflt);
+ tprint_struct_end();
+}
+
+static void
+decode_nlattr_with_data(struct tcb *const tcp,
+ const struct nlattr *const nla,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const struct xlat *const table,
+ const char *const dflt,
+ const nla_decoder_t *const decoders,
+ const unsigned int size,
+ const void *const opaque_data)
+{
+ const unsigned int nla_len = MIN(nla->nla_len, len);
+
+ if (nla_len > NLA_HDRLEN)
+ tprint_struct_begin();
+
+ print_nlattr(nla, table, dflt);
+
+ if (nla_len > NLA_HDRLEN) {
+ const unsigned int idx =
+ size ? nla->nla_type & NLA_TYPE_MASK : 0;
+
+ tprints(", ");
+ if (!decoders
+ || (size && idx >= size)
+ || !decoders[idx]
+ || !decoders[idx](
+ tcp, addr + NLA_HDRLEN,
+ nla_len - NLA_HDRLEN,
+ size ? opaque_data
+ : (const void *) (uintptr_t) nla->nla_type)
+ )
+ printstr_ex(tcp, addr + NLA_HDRLEN,
+ nla_len - NLA_HDRLEN, QUOTE_FORCE_HEX);
+ tprint_struct_end();
+ }
+}
+
+void
+decode_nlattr(struct tcb *const tcp,
+ kernel_ulong_t addr,
+ unsigned int len,
+ const struct xlat *const table,
+ const char *const dflt,
+ const nla_decoder_t *const decoders,
+ const unsigned int size,
+ const void *const opaque_data)
+{
+ struct nlattr nla;
+ bool is_array = false;
+ unsigned int elt;
+
+ if (decoders && !size && opaque_data)
+ error_func_msg("[xlat %p, dflt \"%s\", decoders %p] "
+ "size is zero (going to pass nla_type as "
+ "decoder argument), but opaque data (%p) is not "
+ "- will be ignored",
+ table, dflt, decoders, opaque_data);
+
+ for (elt = 0; fetch_nlattr(tcp, &nla, addr, len, is_array); elt++) {
+ if (abbrev(tcp) && elt == max_strlen) {
+ tprint_more_data_follows();
+ break;
+ }
+
+ const unsigned int nla_len = NLA_ALIGN(nla.nla_len);
+ kernel_ulong_t next_addr = 0;
+ unsigned int next_len = 0;
+
+ if (nla.nla_len >= NLA_HDRLEN) {
+ next_len = (len >= nla_len) ? len - nla_len : 0;
+
+ if (next_len && addr + nla_len > addr)
+ next_addr = addr + nla_len;
+ }
+
+ if (!is_array && next_addr) {
+ tprints("[");
+ is_array = true;
+ }
+
+ decode_nlattr_with_data(tcp, &nla, addr, len, table, dflt,
+ decoders, size, opaque_data);
+
+ if (!next_addr)
+ break;
+
+ tprints(", ");
+ addr = next_addr;
+ len = next_len;
+ }
+
+ if (is_array) {
+ tprints("]");
+ }
+}
+
+bool
+decode_nla_str(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ printstr_ex(tcp, addr, len,
+ QUOTE_OMIT_TRAILING_0 | QUOTE_EXPECT_TRAILING_0);
+
+ return true;
+}
+
+bool
+decode_nla_strn(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ printstrn(tcp, addr, len);
+
+ return true;
+}
+
+bool
+decode_nla_meminfo(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ uint32_t mem;
+ const size_t nmemb = len / sizeof(mem);
+
+ if (!nmemb)
+ return false;
+
+ unsigned int count = 0;
+ print_array_ex(tcp, addr, nmemb, &mem, sizeof(mem),
+ tfetch_mem, print_uint32_array_member, &count,
+ PAF_PRINT_INDICES | XLAT_STYLE_FMT_U,
+ netlink_sk_meminfo_indices, "SK_MEMINFO_???");
+
+ return true;
+}
+
+bool
+decode_nla_fd(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ int fd;
+
+ if (len < sizeof(fd))
+ return false;
+ else if (!umove_or_printaddr(tcp, addr, &fd))
+ printfd(tcp, fd);
+
+ return true;
+}
+
+bool
+decode_nla_uid(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ uint32_t uid;
+
+ if (len < sizeof(uid))
+ return false;
+ else if (!umove_or_printaddr(tcp, addr, &uid))
+ printuid("", uid);
+
+ return true;
+}
+
+bool
+decode_nla_gid(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ return decode_nla_uid(tcp, addr, len, opaque_data);
+}
+
+bool
+decode_nla_ifindex(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ uint32_t ifindex;
+
+ if (len < sizeof(ifindex))
+ return false;
+ else if (!umove_or_printaddr(tcp, addr, &ifindex))
+ print_ifindex(ifindex);
+
+ return true;
+}
+
+bool
+decode_nla_xval(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ unsigned int len,
+ const void *const opaque_data)
+{
+ const struct decode_nla_xlat_opts * const opts = opaque_data;
+ union {
+ uint64_t val;
+ uint8_t bytes[sizeof(uint64_t)];
+ } data = { .val = 0 };
+
+ if (len > sizeof(data) || len < opts->size)
+ return false;
+
+ if (opts->size)
+ len = MIN(len, opts->size);
+
+ const size_t bytes_offs = is_bigendian ? sizeof(data) - len : 0;
+
+ if (!umoven_or_printaddr(tcp, addr, len, data.bytes + bytes_offs)) {
+ if (opts->process_fn)
+ data.val = opts->process_fn(data.val);
+ if (opts->prefix)
+ tprints(opts->prefix);
+ printxval_ex(opts->xlat, data.val, opts->dflt, opts->style);
+ if (opts->suffix)
+ tprints(opts->suffix);
+ }
+
+ return true;
+}
+
+static uint64_t
+process_host_order(uint64_t val)
+{
+ return ntohs(val);
+}
+
+bool
+decode_nla_ether_proto(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ static const struct decode_nla_xlat_opts opts = {
+ .xlat = ethernet_protocols,
+ .dflt = "ETHER_P_???",
+ .prefix = "htons(",
+ .suffix = ")",
+ .size = 2,
+ .process_fn = process_host_order,
+ };
+
+ return decode_nla_xval(tcp, addr, len, &opts);
+}
+
+bool
+decode_nla_ip_proto(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ static const struct decode_nla_xlat_opts opts = {
+ .xlat = inet_protocols,
+ .dflt = "IPPROTO_???",
+ .size = 1,
+ };
+
+ return decode_nla_xval(tcp, addr, len, &opts);
+}
+
+bool
+decode_nla_hwaddr(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ if (len > MAX_ADDR_LEN)
+ return false;
+
+ uint8_t buf[len];
+ const uintptr_t arphrd = (uintptr_t) opaque_data;
+
+ if (!umoven_or_printaddr(tcp, addr, len, buf)) {
+ print_hwaddr("", buf, len, arphrd & NLA_HWADDR_FAMILY_OFFSET
+ ? arphrd & ~NLA_HWADDR_FAMILY_OFFSET : -1U);
+ }
+
+ return true;
+}
+
+bool
+decode_nla_in_addr(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ struct in_addr in;
+
+ if (len < sizeof(in))
+ return false;
+ else if (!umove_or_printaddr(tcp, addr, &in))
+ print_inet_addr(AF_INET, &in, sizeof(in), NULL);
+
+ return true;
+}
+
+bool
+decode_nla_in6_addr(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ struct in6_addr in6;
+
+ if (len < sizeof(in6))
+ return false;
+ else if (!umove_or_printaddr(tcp, addr, &in6))
+ print_inet_addr(AF_INET6, &in6, sizeof(in6), NULL);
+
+ return true;
+}
+
+bool
+decode_nla_flags(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ unsigned int len,
+ const void *const opaque_data)
+{
+ const struct decode_nla_xlat_opts * const opts = opaque_data;
+ union {
+ uint64_t flags;
+ uint8_t bytes[sizeof(uint64_t)];
+ } data = { .flags = 0 };
+
+ if (len > sizeof(data) || len < opts->size)
+ return false;
+
+ if (opts->size)
+ len = MIN(len, opts->size);
+
+ const size_t bytes_offs = is_bigendian ? sizeof(data) - len : 0;
+
+ if (!umoven_or_printaddr(tcp, addr, len, data.bytes + bytes_offs)) {
+ if (opts->process_fn)
+ data.flags = opts->process_fn(data.flags);
+ if (opts->prefix)
+ tprints(opts->prefix);
+ printflags_ex(data.flags, opts->dflt, opts->style, opts->xlat,
+ NULL);
+ if (opts->suffix)
+ tprints(opts->suffix);
+ }
+
+ return true;
+}
+
+bool
+decode_nla_be16(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ uint16_t num;
+
+ if (len < sizeof(num))
+ return false;
+ else if (!umove_or_printaddr(tcp, addr, &num))
+ tprintf("htons(%u)", ntohs(num));
+
+ return true;
+}
+
+bool
+decode_nla_be64(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+#if defined HAVE_BE64TOH || defined be64toh
+ uint64_t num;
+
+ if (len < sizeof(num))
+ return false;
+ else if (!umove_or_printaddr(tcp, addr, &num))
+ tprintf("htobe64(%" PRIu64 ")", be64toh(num));
+
+ return true;
+#else
+ return false;
+#endif
+}
+
+#define DECODE_NLA_INTEGER(name, type, fmt) \
+bool \
+decode_nla_ ## name(struct tcb *const tcp, \
+ const kernel_ulong_t addr, \
+ const unsigned int len, \
+ const void *const opaque_data) \
+{ \
+ type num; \
+ \
+ if (len < sizeof(num)) \
+ return false; \
+ if (!umove_or_printaddr(tcp, addr, &num)) \
+ tprintf(fmt, num); \
+ return true; \
+}
+
+DECODE_NLA_INTEGER(x8, uint8_t, "%#" PRIx8)
+DECODE_NLA_INTEGER(x16, uint16_t, "%#" PRIx16)
+DECODE_NLA_INTEGER(x32, uint32_t, "%#" PRIx32)
+DECODE_NLA_INTEGER(x64, uint64_t, "%#" PRIx64)
+DECODE_NLA_INTEGER(u8, uint8_t, "%" PRIu8)
+DECODE_NLA_INTEGER(u16, uint16_t, "%" PRIu16)
+DECODE_NLA_INTEGER(u32, uint32_t, "%" PRIu32)
+DECODE_NLA_INTEGER(u64, uint64_t, "%" PRIu64)
+DECODE_NLA_INTEGER(s8, int8_t, "%" PRId8)
+DECODE_NLA_INTEGER(s16, int16_t, "%" PRId16)
+DECODE_NLA_INTEGER(s32, int32_t, "%" PRId32)
+DECODE_NLA_INTEGER(s64, int64_t, "%" PRId64)
diff --git a/src/nlattr.h b/src/nlattr.h
new file mode 100644
index 000000000..8b9b841fb
--- /dev/null
+++ b/src/nlattr.h
@@ -0,0 +1,120 @@
+/*
+ * Copyright (c) 2016 Fabien Siron <fabien.siron@epita.fr>
+ * Copyright (c) 2017 JingPiao Chen <chenjingpiao@gmail.com>
+ * Copyright (c) 2016-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_NLATTR_H
+# define STRACE_NLATTR_H
+
+# include "xlat.h"
+
+struct decode_nla_xlat_opts {
+ const struct xlat *xlat;
+ const char *dflt;
+ enum xlat_style style;
+ const char *prefix;
+ const char *suffix;
+ uint64_t (*process_fn)(uint64_t val);
+ size_t size;
+};
+
+/*
+ * Used for IFLA_LINKINFO decoding. Since there are no other indicators
+ * regarding the nature of data except for previously provided string
+ * in an IFLA_LINKINFO_KIND attribute, we have to store it in order to pass
+ * between calls as an opaque data.
+ */
+struct ifla_linkinfo_ctx {
+ char kind[16];
+};
+
+typedef bool (*nla_decoder_t)(struct tcb *, kernel_ulong_t addr,
+ unsigned int len, const void *opaque_data);
+
+/**
+ * The case of non-NULL decoders and zero size is handled in a special way:
+ * the zeroth decoder is always called with nla_type being passed as opaque
+ * data.
+ */
+extern void
+decode_nlattr(struct tcb *,
+ kernel_ulong_t addr,
+ unsigned int len,
+ const struct xlat *,
+ const char *dflt,
+ const nla_decoder_t *decoders,
+ unsigned int size,
+ const void *opaque_data);
+
+# define DECL_NLA(name) \
+extern bool \
+decode_nla_ ## name(struct tcb *, kernel_ulong_t addr, \
+ unsigned int len, const void *) \
+/* End of DECL_NLA definition. */
+
+DECL_NLA(x8);
+DECL_NLA(x16);
+DECL_NLA(x32);
+DECL_NLA(x64);
+DECL_NLA(u8);
+DECL_NLA(u16);
+DECL_NLA(u32);
+DECL_NLA(u64);
+DECL_NLA(s8);
+DECL_NLA(s16);
+DECL_NLA(s32);
+DECL_NLA(s64);
+DECL_NLA(be16);
+DECL_NLA(be64);
+DECL_NLA(xval);
+DECL_NLA(flags);
+DECL_NLA(str);
+DECL_NLA(strn);
+DECL_NLA(fd);
+DECL_NLA(uid);
+DECL_NLA(gid);
+DECL_NLA(ifindex);
+DECL_NLA(ether_proto);
+DECL_NLA(ip_proto);
+DECL_NLA(in_addr);
+DECL_NLA(in6_addr);
+DECL_NLA(meminfo);
+DECL_NLA(rt_class);
+DECL_NLA(rt_proto);
+DECL_NLA(tc_stats);
+
+# define NLA_HWADDR_FAMILY_OFFSET 1024
+
+/**
+ * Print hardware (low-level, L2) address.
+ * @param opaque_data Interpreted as integer value, not pointer
+ */
+DECL_NLA(hwaddr);
+
+/** Non-standard decoder that accepts ARPHRD_* value as an argument */
+static inline bool
+decode_nla_hwaddr_family(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const unsigned int arphrd)
+{
+ return decode_nla_hwaddr(tcp, addr, len, (void *) (uintptr_t) (
+ arphrd > NLA_HWADDR_FAMILY_OFFSET ? 0
+ : NLA_HWADDR_FAMILY_OFFSET | arphrd));
+}
+
+/** decode_nla_hwaddr wrapper that ignores opaque_data */
+static inline bool
+decode_nla_hwaddr_nofamily(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ return decode_nla_hwaddr(tcp, addr, len, NULL);
+}
+
+#endif /* !STRACE_NLATTR_H */
diff --git a/src/nsfs.c b/src/nsfs.c
new file mode 100644
index 000000000..7b804fb31
--- /dev/null
+++ b/src/nsfs.c
@@ -0,0 +1,40 @@
+/*
+ * Support for decoding of NS_* ioctl commands.
+ *
+ * Copyright (c) 2017 Nikolay Marchuk <marchuk.nikolay.a@gmail.com>
+ * Copyright (c) 2017-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include "nsfs.h"
+
+int
+nsfs_ioctl(struct tcb *tcp, unsigned int code, kernel_ulong_t arg)
+{
+ unsigned int uid;
+ switch (code) {
+ case NS_GET_USERNS:
+ case NS_GET_PARENT:
+ return RVAL_IOCTL_DECODED | RVAL_FD;
+ case NS_GET_NSTYPE:
+ if (entering(tcp))
+ return 0;
+ if (!syserror(tcp))
+ tcp->auxstr = xlookup(setns_types, tcp->u_rval);
+ return RVAL_IOCTL_DECODED | RVAL_STR;
+ case NS_GET_OWNER_UID:
+ if (entering(tcp))
+ return 0;
+ tprints(", ");
+ if (!umove_or_printaddr(tcp, arg, &uid)) {
+ printuid("[", uid);
+ tprints("]");
+ }
+ return RVAL_IOCTL_DECODED;
+ default:
+ return RVAL_DECODED;
+ }
+}
diff --git a/src/nsfs.h b/src/nsfs.h
new file mode 100644
index 000000000..0f8106a9e
--- /dev/null
+++ b/src/nsfs.h
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2017-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_NSFS_H
+# define STRACE_NSFS_H
+
+# include <linux/ioctl.h>
+
+# ifdef HAVE_LINUX_NSFS_H
+# include <linux/nsfs.h>
+# else
+# define NSIO 0xb7
+# define NS_GET_USERNS _IO(NSIO, 0x1)
+# define NS_GET_PARENT _IO(NSIO, 0x2)
+# endif
+
+# ifndef NS_GET_NSTYPE
+# define NS_GET_NSTYPE _IO(NSIO, 0x3)
+# endif
+# ifndef NS_GET_OWNER_UID
+# define NS_GET_OWNER_UID _IO(NSIO, 0x4)
+# endif
+
+#endif /* !STRACE_NSFS_H */
diff --git a/src/nsig.h b/src/nsig.h
new file mode 100644
index 000000000..efedfe9e2
--- /dev/null
+++ b/src/nsig.h
@@ -0,0 +1,22 @@
+/*
+ * Copyright (c) 2016-2018 Dmitry V. Levin <ldv@strace.io>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_NSIG_H
+# define STRACE_NSIG_H
+
+# include <signal.h>
+
+# ifndef NSIG
+# warning NSIG is not defined, using 32
+# define NSIG 32
+# elif NSIG < 32
+# error NSIG < 32
+# endif
+
+# define NSIG_BYTES (NSIG / 8)
+
+#endif /* !STRACE_NSIG_H */
diff --git a/src/numa.c b/src/numa.c
new file mode 100644
index 000000000..a4f177347
--- /dev/null
+++ b/src/numa.c
@@ -0,0 +1,189 @@
+/*
+ * Copyright (c) 2003-2007 Ulrich Drepper <drepper@redhat.com>
+ * Copyright (c) 2005-2016 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2016-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+static bool
+print_node(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data)
+{
+ if (elem_size < sizeof(kernel_ulong_t)) {
+ tprintf("%#0*x", (int) elem_size * 2 + 2,
+ *(unsigned int *) elem_buf);
+ } else {
+ tprintf("%#0*" PRI_klx, (int) elem_size * 2 + 2,
+ *(kernel_ulong_t *) elem_buf);
+ }
+
+ return true;
+}
+
+static void
+print_nodemask(struct tcb *const tcp, const kernel_ulong_t addr,
+ const kernel_ulong_t maxnodes)
+{
+ const unsigned int bits_per_long = 8 * current_wordsize;
+ const kernel_ulong_t nmemb =
+ (maxnodes + bits_per_long - 2) / bits_per_long;
+
+ if (nmemb < maxnodes / bits_per_long ||
+ (maxnodes && !nmemb)) {
+ printaddr(addr);
+ return;
+ }
+
+ kernel_ulong_t buf;
+ print_array(tcp, addr, nmemb, &buf, current_wordsize,
+ tfetch_mem, print_node, 0);
+}
+
+SYS_FUNC(migrate_pages)
+{
+ printpid(tcp, tcp->u_arg[0], PT_TGID);
+ tprintf(", %" PRI_klu ", ", tcp->u_arg[1]);
+ print_nodemask(tcp, tcp->u_arg[2], tcp->u_arg[1]);
+ tprints(", ");
+ print_nodemask(tcp, tcp->u_arg[3], tcp->u_arg[1]);
+
+ return RVAL_DECODED;
+}
+
+#include "xlat/mpol_modes.h"
+#include "xlat/mpol_mode_flags.h"
+#include "xlat/mbind_flags.h"
+
+static void
+print_mode(struct tcb *const tcp, const kernel_ulong_t mode_arg)
+{
+ const kernel_ulong_t flags_mask =
+ MPOL_F_STATIC_NODES | MPOL_F_RELATIVE_NODES;
+ const kernel_ulong_t mode = mode_arg & ~flags_mask;
+ const unsigned int flags = mode_arg & flags_mask;
+
+ if (!flags) {
+ printxval64(mpol_modes, mode, "MPOL_???");
+ return;
+ }
+
+ const char *mode_str = xlookup(mpol_modes, mode);
+ if (!mode_str) {
+ printflags64(mpol_mode_flags, mode_arg, "MPOL_???");
+ return;
+ }
+
+ if (xlat_verbose(xlat_verbosity) != XLAT_STYLE_ABBREV)
+ tprintf("%#" PRI_klx, mode_arg);
+
+ if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_RAW)
+ return;
+
+ if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE)
+ tprints(" /* ");
+
+ tprints(mode_str);
+ tprints("|");
+ printflags_ex(flags, NULL, XLAT_STYLE_ABBREV, mpol_mode_flags, NULL);
+
+ if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE)
+ tprints(" */");
+}
+
+SYS_FUNC(mbind)
+{
+ printaddr(tcp->u_arg[0]);
+ tprintf(", %" PRI_klu ", ", tcp->u_arg[1]);
+ print_mode(tcp, tcp->u_arg[2]);
+ tprints(", ");
+ print_nodemask(tcp, tcp->u_arg[3], tcp->u_arg[4]);
+ tprintf(", %" PRI_klu ", ", tcp->u_arg[4]);
+ printflags(mbind_flags, tcp->u_arg[5], "MPOL_???");
+
+ return RVAL_DECODED;
+}
+
+SYS_FUNC(set_mempolicy)
+{
+ print_mode(tcp, (unsigned int) tcp->u_arg[0]);
+ tprints(", ");
+ print_nodemask(tcp, tcp->u_arg[1], tcp->u_arg[2]);
+ tprintf(", %" PRI_klu, tcp->u_arg[2]);
+
+ return RVAL_DECODED;
+}
+
+#include "xlat/get_mempolicy_flags.h"
+
+SYS_FUNC(get_mempolicy)
+{
+ if (exiting(tcp)) {
+ int pol;
+ if (!umove_or_printaddr(tcp, tcp->u_arg[0], &pol)) {
+ tprints("[");
+ printxval(mpol_modes, pol, "MPOL_???");
+ tprints("]");
+ }
+ tprints(", ");
+ print_nodemask(tcp, tcp->u_arg[1], tcp->u_arg[2]);
+ tprintf(", %" PRI_klu ", ", tcp->u_arg[2]);
+ printaddr(tcp->u_arg[3]);
+ tprints(", ");
+ printflags64(get_mempolicy_flags, tcp->u_arg[4], "MPOL_???");
+ }
+ return 0;
+}
+
+#include "xlat/move_pages_flags.h"
+
+static bool
+print_addr(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data)
+{
+ kernel_ulong_t addr;
+
+ if (elem_size < sizeof(addr)) {
+ addr = *(unsigned int *) elem_buf;
+ } else {
+ addr = *(kernel_ulong_t *) elem_buf;
+ }
+
+ printaddr(addr);
+
+ return true;
+}
+
+static bool
+print_status(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data)
+{
+ const int status = *(int *) elem_buf;
+
+ print_err(status, true);
+
+ return true;
+}
+
+SYS_FUNC(move_pages)
+{
+ const kernel_ulong_t npages = tcp->u_arg[1];
+ kernel_ulong_t buf;
+
+ if (entering(tcp)) {
+ printpid(tcp, tcp->u_arg[0], PT_TGID);
+ tprintf(", %" PRI_klu ", ", npages);
+ print_array(tcp, tcp->u_arg[2], npages, &buf, current_wordsize,
+ tfetch_mem, print_addr, 0);
+ tprints(", ");
+ print_array(tcp, tcp->u_arg[3], npages, &buf, sizeof(int),
+ tfetch_mem, print_int32_array_member, 0);
+ tprints(", ");
+ } else {
+ print_array(tcp, tcp->u_arg[4], npages, &buf, sizeof(int),
+ tfetch_mem, print_status, 0);
+ tprints(", ");
+ printflags(move_pages_flags, tcp->u_arg[5], "MPOL_???");
+ }
+ return 0;
+}
diff --git a/src/number_set.c b/src/number_set.c
new file mode 100644
index 000000000..ee7cacc1d
--- /dev/null
+++ b/src/number_set.c
@@ -0,0 +1,153 @@
+/*
+ * Copyright (c) 2016-2018 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2017-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <stdbool.h>
+#include <stdlib.h>
+#include <string.h>
+#include "defs.h"
+#include "number_set.h"
+#include "static_assert.h"
+#include "xmalloc.h"
+
+typedef unsigned int number_slot_t;
+#define BITS_PER_SLOT (sizeof(number_slot_t) * 8)
+
+struct number_set {
+ number_slot_t *vec;
+ unsigned int nslots;
+ bool not;
+};
+
+static void
+number_setbit(const unsigned int i, number_slot_t *const vec)
+{
+ vec[i / BITS_PER_SLOT] |= (number_slot_t) 1 << (i % BITS_PER_SLOT);
+}
+
+static bool
+number_isset(const unsigned int i, const number_slot_t *const vec)
+{
+ return vec[i / BITS_PER_SLOT] & ((number_slot_t) 1 << (i % BITS_PER_SLOT));
+}
+
+static void
+reallocate_number_set(struct number_set *const set, const unsigned int new_nslots)
+{
+ if (new_nslots <= set->nslots)
+ return;
+ set->vec = xreallocarray(set->vec, new_nslots, sizeof(*set->vec));
+ memset(set->vec + set->nslots, 0,
+ sizeof(*set->vec) * (new_nslots - set->nslots));
+ set->nslots = new_nslots;
+}
+
+static unsigned int
+get_number_setbit(const struct number_set *const set)
+{
+ static_assert(sizeof(number_slot_t) == sizeof(uint32_t),
+ "number_slot_t is not 32-bit long");
+ return popcount32(set->vec, set->nslots);
+}
+
+bool
+number_set_array_is_empty(const struct number_set *const set,
+ const unsigned int idx)
+{
+ return !(set && (set[idx].nslots || set[idx].not));
+}
+
+bool
+is_number_in_set(const unsigned int number, const struct number_set *const set)
+{
+ return set && ((number / BITS_PER_SLOT < set->nslots)
+ && number_isset(number, set->vec)) ^ set->not;
+}
+
+bool
+is_number_in_set_array(const unsigned int number, const struct number_set *const set,
+ const unsigned int idx)
+{
+ return set && ((number / BITS_PER_SLOT < set[idx].nslots)
+ && number_isset(number, set[idx].vec)) ^ set[idx].not;
+}
+
+bool
+is_complete_set(const struct number_set *const set, const unsigned int max_numbers)
+{
+ return set && ((set->not && !set->nslots) ||
+ (get_number_setbit(set) == max_numbers));
+}
+
+bool
+is_complete_set_array(const struct number_set *const set,
+ const unsigned int *const max_numbers,
+ const unsigned int nmemb)
+{
+ for (unsigned int i = 0; i < nmemb; ++i) {
+ if (!is_complete_set(&set[i], max_numbers[i]))
+ return false;
+ }
+ return true;
+}
+
+void
+add_number_to_set(const unsigned int number, struct number_set *const set)
+{
+ reallocate_number_set(set, number / BITS_PER_SLOT + 1);
+ number_setbit(number, set->vec);
+}
+
+void
+add_number_to_set_array(const unsigned int number, struct number_set *const set,
+ const unsigned int idx)
+{
+ add_number_to_set(number, &set[idx]);
+}
+
+void
+clear_number_set_array(struct number_set *const set, const unsigned int nmemb)
+{
+ unsigned int i;
+
+ for (i = 0; i < nmemb; ++i) {
+ if (set[i].nslots)
+ memset(set[i].vec, 0,
+ sizeof(*set[i].vec) * set[i].nslots);
+ set[i].not = false;
+ }
+}
+
+void
+invert_number_set_array(struct number_set *const set, const unsigned int nmemb)
+{
+ unsigned int i;
+
+ for (i = 0; i < nmemb; ++i)
+ set[i].not = !set[i].not;
+}
+
+struct number_set *
+alloc_number_set_array(const unsigned int nmemb)
+{
+ return xcalloc(nmemb, sizeof(struct number_set));
+}
+
+void
+free_number_set_array(struct number_set *const set, unsigned int nmemb)
+{
+ while (nmemb) {
+ --nmemb;
+ free(set[nmemb].vec);
+ set[nmemb].vec = NULL;
+ }
+ free(set);
+}
diff --git a/src/number_set.h b/src/number_set.h
new file mode 100644
index 000000000..f1119154f
--- /dev/null
+++ b/src/number_set.h
@@ -0,0 +1,94 @@
+/*
+ * Copyright (c) 2016-2018 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2017-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_NUMBER_SET_H
+# define STRACE_NUMBER_SET_H
+
+# include "gcc_compat.h"
+
+struct number_set;
+
+extern bool
+number_set_array_is_empty(const struct number_set *, unsigned int idx);
+
+extern bool
+is_number_in_set(unsigned int number, const struct number_set *);
+
+extern bool
+is_number_in_set_array(unsigned int number, const struct number_set *, unsigned int idx);
+
+extern bool
+is_complete_set(const struct number_set *, unsigned int max_numbers);
+
+extern bool
+is_complete_set_array(const struct number_set *, const unsigned int *,
+ const unsigned int nmemb);
+
+extern void
+add_number_to_set(unsigned int number, struct number_set *);
+
+extern void
+add_number_to_set_array(unsigned int number, struct number_set *, unsigned int idx);
+
+extern void
+clear_number_set_array(struct number_set *, unsigned int nmemb);
+
+extern void
+invert_number_set_array(struct number_set *, unsigned int nmemb);
+
+extern struct number_set *
+alloc_number_set_array(unsigned int nmemb) ATTRIBUTE_MALLOC;
+
+extern void
+free_number_set_array(struct number_set *, unsigned int nmemb);
+
+enum status_t {
+ STATUS_SUCCESSFUL,
+ STATUS_FAILED,
+ STATUS_UNFINISHED,
+ STATUS_UNAVAILABLE,
+ STATUS_DETACHED,
+ NUMBER_OF_STATUSES
+};
+
+enum quiet_bits {
+ /** Do not print messages on tracee attach/detach. */
+ QUIET_ATTACH,
+ /** Do not print messages on tracee exits. */
+ QUIET_EXIT,
+ /** Do not print messages about path tracing path resolution. */
+ QUIET_PATH_RESOLVE,
+ /** Do not print messages on personality change. */
+ QUIET_PERSONALITY,
+ /** Do not print messages on superseding execve. */
+ QUIET_THREAD_EXECVE,
+
+ NUM_QUIET_BITS
+};
+
+enum decode_fd_bits {
+ DECODE_FD_PATH,
+ DECODE_FD_SOCKET,
+ DECODE_FD_DEV,
+ DECODE_FD_PIDFD,
+
+ NUM_DECODE_FD_BITS
+};
+
+extern bool quiet_set_updated;
+extern bool decode_fd_set_updated;
+
+extern struct number_set *read_set;
+extern struct number_set *write_set;
+extern struct number_set *signal_set;
+extern struct number_set *status_set;
+extern struct number_set *quiet_set;
+extern struct number_set *decode_fd_set;
+extern struct number_set *trace_set;
+
+#endif /* !STRACE_NUMBER_SET_H */
diff --git a/src/oldstat.c b/src/oldstat.c
new file mode 100644
index 000000000..196e5c0ca
--- /dev/null
+++ b/src/oldstat.c
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
+ * Copyright (c) 2005-2015 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include "asm_stat.h"
+#include "stat.h"
+
+#ifdef HAVE_STRUCT___OLD_KERNEL_STAT
+
+static void
+print_old_kernel_stat(struct tcb *const tcp, const kernel_ulong_t addr)
+{
+ struct __old_kernel_stat buf;
+ if (umove_or_printaddr(tcp, addr, &buf))
+ return;
+
+ struct strace_stat st = {
+ .dev = zero_extend_signed_to_ull(buf.st_dev),
+ .ino = zero_extend_signed_to_ull(buf.st_ino),
+ .rdev = zero_extend_signed_to_ull(buf.st_rdev),
+ .size = zero_extend_signed_to_ull(buf.st_size),
+ .mode = zero_extend_signed_to_ull(buf.st_mode),
+ .nlink = zero_extend_signed_to_ull(buf.st_nlink),
+ .uid = zero_extend_signed_to_ull(buf.st_uid),
+ .gid = zero_extend_signed_to_ull(buf.st_gid),
+ .atime = sign_extend_unsigned_to_ll(buf.st_atime),
+ .ctime = sign_extend_unsigned_to_ll(buf.st_ctime),
+ .mtime = sign_extend_unsigned_to_ll(buf.st_mtime)
+ };
+
+ print_struct_stat(tcp, &st);
+}
+
+SYS_FUNC(oldstat)
+{
+ if (entering(tcp)) {
+ printpath(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ } else {
+ print_old_kernel_stat(tcp, tcp->u_arg[1]);
+ }
+ return 0;
+}
+
+SYS_FUNC(oldfstat)
+{
+ if (entering(tcp)) {
+ printfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ } else {
+ print_old_kernel_stat(tcp, tcp->u_arg[1]);
+ }
+ return 0;
+}
+
+#endif /* HAVE_STRUCT___OLD_KERNEL_STAT */
diff --git a/src/open.c b/src/open.c
new file mode 100644
index 000000000..f14a66d25
--- /dev/null
+++ b/src/open.c
@@ -0,0 +1,178 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
+ * Copyright (c) 2005-2007 Roland McGrath <roland@redhat.com>
+ * Copyright (c) 2006-2007 Ulrich Drepper <drepper@redhat.com>
+ * Copyright (c) 2009-2013 Denys Vlasenko <dvlasenk@redhat.com>
+ * Copyright (c) 2005-2015 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2014-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include "xstring.h"
+
+#include <asm/fcntl.h>
+
+#include "types/openat2.h"
+
+/* some libcs are guilty of messing up with O_ACCMODE */
+#undef O_ACCMODE
+#define O_ACCMODE 03
+
+#ifdef O_LARGEFILE
+# if O_LARGEFILE == 0 /* biarch platforms in 64-bit mode */
+# undef O_LARGEFILE
+# endif
+#endif
+
+#include "xlat/open_access_modes.h"
+#include "xlat/open_mode_flags.h"
+#include "xlat/open_resolve_flags.h"
+
+#ifndef AT_FDCWD
+# define AT_FDCWD -100
+#endif
+
+/* The fd is an "int", so when decoding x86 on x86_64, we need to force sign
+ * extension to get the right value. We do this by declaring fd as int here.
+ */
+void
+print_dirfd(struct tcb *tcp, int fd)
+{
+ if (fd == AT_FDCWD)
+ print_xlat_d(AT_FDCWD);
+ else
+ printfd(tcp, fd);
+}
+
+/*
+ * low bits of the open(2) flags define access mode,
+ * other bits are real flags.
+ */
+static const char *
+sprint_open_modes64(uint64_t flags)
+{
+ static char outstr[sizeof("flags O_ACCMODE")];
+ char *p;
+ char sep;
+ const char *str;
+
+ sep = ' ';
+ p = stpcpy(outstr, "flags");
+ str = xlookup(open_access_modes, flags & 3);
+ if (str) {
+ *p++ = sep;
+ p = stpcpy(p, str);
+ flags &= ~3;
+ if (!flags)
+ return outstr;
+ sep = '|';
+ }
+ *p = '\0';
+
+ return sprintflags_ex(outstr, open_mode_flags, flags, sep,
+ XLAT_STYLE_ABBREV) ?: outstr;
+}
+
+const char *
+sprint_open_modes(unsigned int flags)
+{
+ return sprint_open_modes64(flags);
+}
+
+static void
+tprint_open_modes64(uint64_t flags)
+{
+ print_xlat_ex(flags, sprint_open_modes64(flags) + sizeof("flags"),
+ XLAT_STYLE_DEFAULT);
+}
+void
+tprint_open_modes(unsigned int flags)
+{
+ tprint_open_modes64(flags);
+}
+
+static int
+decode_open(struct tcb *tcp, int offset)
+{
+ printpath(tcp, tcp->u_arg[offset]);
+ tprints(", ");
+ /* flags */
+ tprint_open_modes(tcp->u_arg[offset + 1]);
+ if (tcp->u_arg[offset + 1] & (O_CREAT | __O_TMPFILE)) {
+ /* mode */
+ tprints(", ");
+ print_numeric_umode_t(tcp->u_arg[offset + 2]);
+ }
+
+ return RVAL_DECODED | RVAL_FD;
+}
+
+SYS_FUNC(open)
+{
+ return decode_open(tcp, 0);
+}
+
+static void
+print_open_how(struct tcb *tcp, kernel_ulong_t addr, kernel_ulong_t size)
+{
+ enum { OPEN_HOW_MIN_SIZE = 24 };
+
+ struct_open_how how;
+
+ if (size < OPEN_HOW_MIN_SIZE) {
+ printaddr(addr);
+ return;
+ }
+ if (umoven_or_printaddr(tcp, addr, MIN(size, sizeof(how)), &how))
+ return;
+
+ tprint_struct_begin();
+ PRINT_FIELD_OBJ_VAL(how, flags, tprint_open_modes64);
+ if ((how.flags & (O_CREAT | __O_TMPFILE)) || how.mode) {
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_U(how, mode, print_numeric_ll_umode_t);
+ }
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(how, resolve, open_resolve_flags, "RESOLVE_???");
+
+ if (size > sizeof(how)) {
+ print_nonzero_bytes(tcp, tprint_struct_next, addr, sizeof(how),
+ MIN(size, get_pagesize()), QUOTE_FORCE_HEX);
+ }
+
+ tprint_struct_end();
+}
+
+SYS_FUNC(openat)
+{
+ print_dirfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ return decode_open(tcp, 1);
+}
+
+SYS_FUNC(openat2)
+{
+ print_dirfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ printpath(tcp, tcp->u_arg[1]);
+ tprints(", ");
+ print_open_how(tcp, tcp->u_arg[2], tcp->u_arg[3]);
+ tprintf(", %" PRI_klu, tcp->u_arg[3]);
+
+ return RVAL_DECODED | RVAL_FD;
+}
+
+SYS_FUNC(creat)
+{
+ printpath(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ print_numeric_umode_t(tcp->u_arg[1]);
+
+ return RVAL_DECODED | RVAL_FD;
+}
diff --git a/src/open_tree.c b/src/open_tree.c
new file mode 100644
index 000000000..8f16fc95e
--- /dev/null
+++ b/src/open_tree.c
@@ -0,0 +1,23 @@
+/*
+ * Copyright (c) 2019 Dmitry V. Levin <ldv@strace.io>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include <fcntl.h>
+#ifdef HAVE_LINUX_MOUNT_H
+# include <linux/mount.h>
+#endif
+#include "xlat/open_tree_flags.h"
+
+SYS_FUNC(open_tree)
+{
+ print_dirfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ printpath(tcp, tcp->u_arg[1]);
+ tprints(", ");
+ printflags(open_tree_flags, tcp->u_arg[2], "OPEN_TREE_???");
+ return RVAL_DECODED | RVAL_FD;
+}
diff --git a/src/or1k_atomic.c b/src/or1k_atomic.c
new file mode 100644
index 000000000..1cfa1f2f2
--- /dev/null
+++ b/src/or1k_atomic.c
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2013 Christian Svensson <blue@cmd.nu>
+ * Copyright (c) 2014-2015 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2014-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#ifdef OR1K
+
+# define OR1K_ATOMIC_SWAP 1
+# define OR1K_ATOMIC_CMPXCHG 2
+# define OR1K_ATOMIC_XCHG 3
+# define OR1K_ATOMIC_ADD 4
+# define OR1K_ATOMIC_DECPOS 5
+# define OR1K_ATOMIC_AND 6
+# define OR1K_ATOMIC_OR 7
+# define OR1K_ATOMIC_UMAX 8
+# define OR1K_ATOMIC_UMIN 9
+
+# include "xlat/atomic_ops.h"
+
+SYS_FUNC(or1k_atomic)
+{
+ printxval64(atomic_ops, tcp->u_arg[0], "???");
+ switch (tcp->u_arg[0]) {
+ case OR1K_ATOMIC_SWAP:
+ tprintf(", 0x%lx, 0x%lx", tcp->u_arg[1], tcp->u_arg[2]);
+ break;
+ case OR1K_ATOMIC_CMPXCHG:
+ tprintf(", 0x%lx, %#lx, %#lx", tcp->u_arg[1], tcp->u_arg[2],
+ tcp->u_arg[3]);
+ break;
+
+ case OR1K_ATOMIC_XCHG:
+ case OR1K_ATOMIC_ADD:
+ case OR1K_ATOMIC_AND:
+ case OR1K_ATOMIC_OR:
+ case OR1K_ATOMIC_UMAX:
+ case OR1K_ATOMIC_UMIN:
+ tprintf(", 0x%lx, %#lx", tcp->u_arg[1], tcp->u_arg[2]);
+ break;
+
+ case OR1K_ATOMIC_DECPOS:
+ tprintf(", 0x%lx", tcp->u_arg[1]);
+ break;
+
+ default:
+ break;
+ }
+
+ return RVAL_DECODED | RVAL_HEX;
+}
+
+#endif /* OR1K */
diff --git a/src/pathtrace.c b/src/pathtrace.c
new file mode 100644
index 000000000..7c1841517
--- /dev/null
+++ b/src/pathtrace.c
@@ -0,0 +1,417 @@
+/*
+ * Copyright (c) 2011 Comtrol Corp.
+ * Copyright (c) 2011-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ *
+ */
+
+#include "defs.h"
+#include <limits.h>
+#include <poll.h>
+
+#include "number_set.h"
+#include "syscall.h"
+#include "xstring.h"
+
+struct path_set global_path_set;
+
+/*
+ * Return true if specified path matches one that we're tracing.
+ */
+static bool
+pathmatch(const char *path, struct path_set *set)
+{
+ unsigned i;
+
+ for (i = 0; i < set->num_selected; ++i) {
+ if (strcmp(path, set->paths_selected[i]) == 0)
+ return true;
+ }
+ return false;
+}
+
+/*
+ * Return true if specified path (in user-space) matches.
+ */
+static bool
+upathmatch(struct tcb *const tcp, const kernel_ulong_t upath,
+ struct path_set *set)
+{
+ char path[PATH_MAX + 1];
+
+ return umovestr(tcp, upath, sizeof(path), path) > 0 &&
+ pathmatch(path, set);
+}
+
+/*
+ * Return true if specified fd maps to a path we're tracing.
+ */
+static bool
+fdmatch(struct tcb *tcp, int fd, struct path_set *set)
+{
+ char path[PATH_MAX + 1];
+ int n = getfdpath(tcp, fd, path, sizeof(path));
+
+ return n >= 0 && pathmatch(path, set);
+}
+
+/*
+ * Add a path to the set we're tracing.
+ * Specifying NULL will delete all paths.
+ */
+static void
+storepath(const char *path, struct path_set *set)
+{
+ if (pathmatch(path, set))
+ return; /* already in table */
+
+ if (set->num_selected >= set->size)
+ set->paths_selected =
+ xgrowarray(set->paths_selected, &set->size,
+ sizeof(set->paths_selected[0]));
+
+ set->paths_selected[set->num_selected++] = path;
+}
+
+/*
+ * Get path associated with fd of a process with pid.
+ */
+int
+getfdpath_pid(pid_t pid, int fd, char *buf, unsigned bufsize)
+{
+ char linkpath[sizeof("/proc/%u/fd/%u") + 2 * sizeof(int)*3];
+ ssize_t n;
+
+ if (fd < 0)
+ return -1;
+
+ int proc_pid = 0;
+ translate_pid(NULL, pid, PT_TID, &proc_pid);
+ if (!proc_pid)
+ return -1;
+
+ xsprintf(linkpath, "/proc/%u/fd/%u", proc_pid, fd);
+ n = readlink(linkpath, buf, bufsize - 1);
+ /*
+ * NB: if buf is too small, readlink doesn't fail,
+ * it returns truncated result (IOW: n == bufsize - 1).
+ */
+ if (n >= 0)
+ buf[n] = '\0';
+ return n;
+}
+
+/*
+ * Add a path to the set we're tracing. Also add the canonicalized
+ * version of the path. Specifying NULL will delete all paths.
+ */
+void
+pathtrace_select_set(const char *path, struct path_set *set)
+{
+ char *rpath;
+
+ storepath(path, set);
+
+ rpath = realpath(path, NULL);
+
+ if (rpath == NULL)
+ return;
+
+ /* if realpath and specified path are same, we're done */
+ if (strcmp(path, rpath) == 0) {
+ free(rpath);
+ return;
+ }
+
+ if (!is_number_in_set(QUIET_PATH_RESOLVE, quiet_set)) {
+ char *path_quoted = xmalloc(strlen(path) * 4 + 4);
+ char *rpath_quoted = xmalloc(strlen(rpath) * 4 + 4);
+
+ string_quote(path, path_quoted, strlen(path) + 1,
+ QUOTE_0_TERMINATED, NULL);
+ string_quote(rpath, rpath_quoted, strlen(rpath) + 1,
+ QUOTE_0_TERMINATED, NULL);
+
+ error_msg("Requested path %s resolved into %s",
+ path_quoted, rpath_quoted);
+
+ free(path_quoted);
+ free(rpath_quoted);
+ }
+ storepath(rpath, set);
+}
+
+static bool
+match_xselect_args(struct tcb *tcp, const kernel_ulong_t *args,
+ struct path_set *set)
+{
+ /* Kernel truncates arg[0] to int, we do the same. */
+ int nfds = (int) args[0];
+ /* Kernel rejects negative nfds, so we don't parse it either. */
+ if (nfds <= 0)
+ return false;
+ /* Beware of select(2^31-1, NULL, NULL, NULL) and similar... */
+ if (nfds > 1024*1024)
+ nfds = 1024*1024;
+ unsigned int fdsize = (((nfds + 7) / 8) + current_wordsize-1) & -current_wordsize;
+ fd_set *fds = xmalloc(fdsize);
+
+ for (unsigned int i = 1; i <= 3; ++i) {
+ if (args[i] == 0)
+ continue;
+ if (umoven(tcp, args[i], fdsize, fds) < 0)
+ continue;
+ for (int j = 0;; ++j) {
+ j = next_set_bit(fds, j, nfds);
+ if (j < 0)
+ break;
+ if (fdmatch(tcp, j, set)) {
+ free(fds);
+ return true;
+ }
+ }
+ }
+
+ free(fds);
+ return false;
+}
+
+/*
+ * Return true if syscall accesses a selected path
+ * (or if no paths have been specified for tracing).
+ */
+bool
+pathtrace_match_set(struct tcb *tcp, struct path_set *set)
+{
+ const struct_sysent *s;
+
+ s = tcp_sysent(tcp);
+
+ if (!(s->sys_flags & (TRACE_FILE | TRACE_DESC | TRACE_NETWORK)))
+ return false;
+
+ /*
+ * Check for special cases where we need to do something
+ * other than test arg[0].
+ */
+
+ switch (s->sen) {
+ case SEN_close_range:
+ case SEN_dup2:
+ case SEN_dup3:
+ case SEN_kexec_file_load:
+ case SEN_sendfile:
+ case SEN_sendfile64:
+ case SEN_tee:
+ /* fd, fd */
+ return fdmatch(tcp, tcp->u_arg[0], set) ||
+ fdmatch(tcp, tcp->u_arg[1], set);
+
+ case SEN_execveat:
+ case SEN_faccessat:
+ case SEN_faccessat2:
+ case SEN_fchmodat:
+ case SEN_fchownat:
+ case SEN_fspick:
+ case SEN_fstatat64:
+ case SEN_futimesat:
+ case SEN_inotify_add_watch:
+ case SEN_mkdirat:
+ case SEN_mknodat:
+ case SEN_name_to_handle_at:
+ case SEN_newfstatat:
+ case SEN_open_tree:
+ case SEN_openat:
+ case SEN_openat2:
+ case SEN_readlinkat:
+ case SEN_statx:
+ case SEN_unlinkat:
+ case SEN_utimensat_time32:
+ case SEN_utimensat_time64:
+ /* fd, path */
+ return fdmatch(tcp, tcp->u_arg[0], set) ||
+ upathmatch(tcp, tcp->u_arg[1], set);
+
+ case SEN_link:
+ case SEN_mount:
+ case SEN_pivotroot:
+ /* path, path */
+ return upathmatch(tcp, tcp->u_arg[0], set) ||
+ upathmatch(tcp, tcp->u_arg[1], set);
+
+ case SEN_quotactl:
+ case SEN_symlink:
+ /* x, path */
+ return upathmatch(tcp, tcp->u_arg[1], set);
+
+ case SEN_linkat:
+ case SEN_move_mount:
+ case SEN_renameat2:
+ case SEN_renameat:
+ /* fd, path, fd, path */
+ return fdmatch(tcp, tcp->u_arg[0], set) ||
+ fdmatch(tcp, tcp->u_arg[2], set) ||
+ upathmatch(tcp, tcp->u_arg[1], set) ||
+ upathmatch(tcp, tcp->u_arg[3], set);
+
+#if HAVE_ARCH_OLD_MMAP
+ case SEN_old_mmap:
+# if HAVE_ARCH_OLD_MMAP_PGOFF
+ case SEN_old_mmap_pgoff:
+# endif
+ {
+ kernel_ulong_t *args =
+ fetch_indirect_syscall_args(tcp, tcp->u_arg[0], 6);
+
+ return args && fdmatch(tcp, args[4], set);
+ }
+#endif /* HAVE_ARCH_OLD_MMAP */
+
+ case SEN_mmap:
+ case SEN_mmap_4koff:
+ case SEN_mmap_pgoff:
+ case SEN_ARCH_mmap:
+ /* x, x, x, x, fd */
+ return fdmatch(tcp, tcp->u_arg[4], set);
+
+ case SEN_symlinkat:
+ /* x, fd, path */
+ return fdmatch(tcp, tcp->u_arg[1], set) ||
+ upathmatch(tcp, tcp->u_arg[2], set);
+
+ case SEN_copy_file_range:
+ case SEN_splice:
+ /* fd, x, fd, x, x, x */
+ return fdmatch(tcp, tcp->u_arg[0], set) ||
+ fdmatch(tcp, tcp->u_arg[2], set);
+
+ case SEN_epoll_ctl:
+ /* x, x, fd, x */
+ return fdmatch(tcp, tcp->u_arg[2], set);
+
+
+ case SEN_fanotify_mark:
+ {
+ /* x, x, mask (64 bit), fd, path */
+ unsigned long long mask = 0;
+ int argn = getllval(tcp, &mask, 2);
+ return fdmatch(tcp, tcp->u_arg[argn], set) ||
+ upathmatch(tcp, tcp->u_arg[argn + 1], set);
+ }
+#if HAVE_ARCH_OLD_SELECT
+ case SEN_oldselect:
+ {
+ kernel_ulong_t *args =
+ fetch_indirect_syscall_args(tcp, tcp->u_arg[0], 5);
+
+ return args && match_xselect_args(tcp, args, set);
+ }
+#endif
+ case SEN_pselect6_time32:
+ case SEN_pselect6_time64:
+ case SEN_select:
+ return match_xselect_args(tcp, tcp->u_arg, set);
+ case SEN_poll_time32:
+ case SEN_poll_time64:
+ case SEN_ppoll_time32:
+ case SEN_ppoll_time64:
+ {
+ struct pollfd fds;
+ unsigned nfds;
+ kernel_ulong_t start, cur, end;
+
+ start = tcp->u_arg[0];
+ nfds = tcp->u_arg[1];
+
+ if (nfds > 1024 * 1024)
+ nfds = 1024 * 1024;
+ end = start + sizeof(fds) * nfds;
+
+ if (nfds == 0 || end < start)
+ return false;
+
+ for (cur = start; cur < end; cur += sizeof(fds)) {
+ if (umove(tcp, cur, &fds))
+ break;
+ if (fdmatch(tcp, fds.fd, set))
+ return true;
+ }
+
+ return false;
+ }
+
+ case SEN_fsconfig: {
+ /* x, x, x, maybe path, maybe fd */
+ const unsigned int cmd = tcp->u_arg[1];
+ switch (cmd) {
+ case 3 /* FSCONFIG_SET_PATH */:
+ case 4 /* FSCONFIG_SET_PATH_EMPTY */:
+ return fdmatch(tcp, tcp->u_arg[4], set) ||
+ upathmatch(tcp, tcp->u_arg[3], set);
+ case 5 /* FSCONFIG_SET_FD */:
+ return fdmatch(tcp, tcp->u_arg[4], set);
+ }
+
+ return false;
+ }
+
+ case SEN_accept4:
+ case SEN_accept:
+ case SEN_bpf:
+ case SEN_epoll_create:
+ case SEN_epoll_create1:
+ case SEN_eventfd2:
+ case SEN_eventfd:
+ case SEN_fanotify_init:
+ case SEN_fsmount:
+ case SEN_fsopen:
+ case SEN_inotify_init:
+ case SEN_inotify_init1:
+ case SEN_io_uring_enter:
+ case SEN_io_uring_register:
+ case SEN_io_uring_setup:
+ case SEN_memfd_create:
+ case SEN_mq_getsetattr:
+ case SEN_mq_notify:
+ case SEN_mq_open:
+ case SEN_mq_timedreceive_time32:
+ case SEN_mq_timedreceive_time64:
+ case SEN_mq_timedsend_time32:
+ case SEN_mq_timedsend_time64:
+ case SEN_perf_event_open:
+ case SEN_pidfd_open:
+ case SEN_pipe:
+ case SEN_pipe2:
+ case SEN_printargs:
+ case SEN_signalfd4:
+ case SEN_signalfd:
+ case SEN_socket:
+ case SEN_socketpair:
+ case SEN_timerfd_create:
+ case SEN_timerfd_gettime32:
+ case SEN_timerfd_gettime64:
+ case SEN_timerfd_settime32:
+ case SEN_timerfd_settime64:
+ case SEN_userfaultfd:
+ /*
+ * These have TRACE_FILE or TRACE_DESCRIPTOR or TRACE_NETWORK set,
+ * but they don't have any file descriptor or path args to test.
+ */
+ return false;
+ }
+
+ /*
+ * Our fallback position for calls that haven't already
+ * been handled is to just check arg[0].
+ */
+
+ if (s->sys_flags & TRACE_FILE)
+ return upathmatch(tcp, tcp->u_arg[0], set);
+
+ if (s->sys_flags & (TRACE_DESC | TRACE_NETWORK))
+ return fdmatch(tcp, tcp->u_arg[0], set);
+
+ return false;
+}
diff --git a/src/perf.c b/src/perf.c
new file mode 100644
index 000000000..a1dbd9536
--- /dev/null
+++ b/src/perf.c
@@ -0,0 +1,452 @@
+/*
+ * Copyright (c) 2013 Ben Noordhuis <info@bnoordhuis.nl>
+ * Copyright (c) 2013-2015 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2016 Eugene Syromyatnikov <evgsyr@gmail.com>
+ * Copyright (c) 2015-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#include "perf_event_struct.h"
+
+#include "xlat/hw_breakpoint_len.h"
+#include "xlat/hw_breakpoint_type.h"
+#include "xlat/perf_attr_size.h"
+#include "xlat/perf_branch_sample_type.h"
+#include "xlat/perf_event_open_flags.h"
+#include "xlat/perf_event_read_format.h"
+#include "xlat/perf_event_sample_format.h"
+#include "xlat/perf_hw_cache_id.h"
+#include "xlat/perf_hw_cache_op_id.h"
+#include "xlat/perf_hw_cache_op_result_id.h"
+#include "xlat/perf_hw_id.h"
+#include "xlat/perf_sw_ids.h"
+#include "xlat/perf_type_id.h"
+
+struct pea_desc {
+ struct perf_event_attr *attr;
+ uint32_t size;
+};
+
+static void
+free_pea_desc(void *pea_desc_ptr)
+{
+ struct pea_desc *desc = pea_desc_ptr;
+
+ free(desc->attr);
+ free(desc);
+}
+
+int
+fetch_perf_event_attr(struct tcb *const tcp, const kernel_ulong_t addr)
+{
+ struct pea_desc *desc;
+ struct perf_event_attr *attr;
+ uint32_t size;
+
+ if (umove(tcp, addr + offsetof(struct perf_event_attr, size), &size)) {
+ printaddr(addr);
+ return 1;
+ }
+
+ if (size > sizeof(*attr))
+ size = sizeof(*attr);
+
+ if (!size)
+ size = PERF_ATTR_SIZE_VER0;
+
+ /*
+ * Kernel (rightfully) deems invalid attribute structures with size less
+ * than first published format size, and we do the same.
+ */
+ if (size < PERF_ATTR_SIZE_VER0) {
+ printaddr(addr);
+ return 1;
+ }
+
+ if (abbrev(tcp))
+ size = offsetofend(struct perf_event_attr, config);
+
+ /* Size should be multiple of 8, but kernel doesn't check for it */
+ /* size &= ~7; */
+
+ attr = xzalloc(sizeof(*attr));
+
+ if (umoven_or_printaddr(tcp, addr, size, attr)) {
+ free(attr);
+
+ return 1;
+ }
+
+ desc = xmalloc(sizeof(*desc));
+
+ desc->attr = attr;
+ desc->size = size;
+
+ set_tcb_priv_data(tcp, desc, free_pea_desc);
+
+ return 0;
+}
+
+void
+print_perf_event_attr(struct tcb *const tcp, const kernel_ulong_t addr)
+{
+ static const char *precise_ip_desc[] = {
+ "arbitrary skid",
+ "constant skid",
+ "requested to have 0 skid",
+ "must have 0 skid",
+ };
+
+ struct pea_desc *desc;
+ struct perf_event_attr *attr;
+ uint32_t size;
+ uint32_t new_size;
+ int use_new_size = 0;
+
+ /*
+ * Amusingly, kernel accepts structures with only part of the field
+ * present, so we making check like this (instead of checking
+ * offsetofend against size) in order to print fields as kernel sees
+ * them. This also should work great on big endian architectures.
+ */
+#define _PERF_CHECK_FIELD(_field) \
+ do { \
+ if (offsetof(struct perf_event_attr, _field) >= size) \
+ goto print_perf_event_attr_out; \
+ } while (0)
+
+ desc = get_tcb_priv_data(tcp);
+
+ attr = desc->attr;
+ size = desc->size;
+
+ /* The only error which expected to change size field currently */
+ if (tcp->u_error == E2BIG) {
+ if (umove(tcp, addr + offsetof(struct perf_event_attr, size),
+ &new_size))
+ use_new_size = -1;
+ else
+ use_new_size = 1;
+ }
+
+ tprint_struct_begin();
+ PRINT_FIELD_XVAL(*attr, type, perf_type_id, "PERF_TYPE_???");
+ tprint_struct_next();
+ PRINT_FIELD_XVAL(*attr, size, perf_attr_size, "PERF_ATTR_SIZE_???");
+
+ if (use_new_size) {
+ tprint_value_changed();
+
+ if (use_new_size > 0)
+ printxval(perf_attr_size, new_size,
+ "PERF_ATTR_SIZE_???");
+ else
+ tprints("???");
+ }
+
+ switch (attr->type) {
+ case PERF_TYPE_HARDWARE:
+ tprint_struct_next();
+ PRINT_FIELD_XVAL(*attr, config, perf_hw_id,
+ "PERF_COUNT_HW_???");
+ break;
+ case PERF_TYPE_SOFTWARE:
+ tprint_struct_next();
+ PRINT_FIELD_XVAL(*attr, config, perf_sw_ids,
+ "PERF_COUNT_SW_???");
+ break;
+ case PERF_TYPE_TRACEPOINT:
+ /*
+ * "The value to use in config can be obtained from under
+ * debugfs tracing/events/../../id if ftrace is enabled
+ * in the kernel."
+ */
+ tprint_struct_next();
+ PRINT_FIELD_U(*attr, config);
+ break;
+ case PERF_TYPE_HW_CACHE:
+ /*
+ * (perf_hw_cache_id) | (perf_hw_cache_op_id << 8) |
+ * (perf_hw_cache_op_result_id << 16)
+ */
+ tprint_struct_next();
+ tprints_field_name("config");
+ printxval(perf_hw_cache_id, attr->config & 0xFF,
+ "PERF_COUNT_HW_CACHE_???");
+ tprints("|");
+ printxval(perf_hw_cache_op_id, (attr->config >> 8) & 0xFF,
+ "PERF_COUNT_HW_CACHE_OP_???");
+ tprints("<<8|");
+ /*
+ * Current code (see set_ext_hw_attr in arch/x86/events/core.c,
+ * tile_map_cache_event in arch/tile/kernel/perf_event.c,
+ * arc_pmu_cache_event in arch/arc/kernel/perf_event.c,
+ * hw_perf_cache_event in arch/blackfin/kernel/perf_event.c,
+ * _hw_perf_cache_event in arch/metag/kernel/perf/perf_event.c,
+ * mipspmu_map_cache_event in arch/mips/kernel/perf_event_mipsxx.c,
+ * hw_perf_cache_event in arch/powerpc/perf/core-book3s.c,
+ * hw_perf_cache_event in arch/powerpc/perf/core-fsl-emb.c,
+ * hw_perf_cache_event in arch/sh/kernel/perf_event.c,
+ * sparc_map_cache_event in arch/sparc/kernel/perf_event.c,
+ * xtensa_pmu_cache_event in arch/xtensa/kernel/perf_event.c,
+ * armpmu_map_cache_event in drivers/perf/arm_pmu.c) assumes
+ * that cache result is 8 bits in size.
+ */
+ printxval(perf_hw_cache_op_result_id,
+ (attr->config >> 16) & 0xFF,
+ "PERF_COUNT_HW_CACHE_RESULT_???");
+ tprints("<<16");
+ if (attr->config >> 24) {
+ tprintf("|%#" PRIx64 "<<24", attr->config >> 24);
+ tprints_comment("PERF_COUNT_HW_CACHE_???");
+ }
+ break;
+ case PERF_TYPE_RAW:
+ /*
+ * "If type is PERF_TYPE_RAW, then a custom "raw" config
+ * value is needed. Most CPUs support events that are not
+ * covered by the "generalized" events. These are
+ * implementation defined; see your CPU manual (for example the
+ * Intel Volume 3B documentation or the AMD BIOS and Kernel
+ * Developer Guide). The libpfm4 library can be used to
+ * translate from the name in the architectural manuals
+ * to the raw hex value perf_event_open() expects in this
+ * field."
+ */
+ case PERF_TYPE_BREAKPOINT:
+ /*
+ * "If type is PERF_TYPE_BREAKPOINT, then leave config set
+ * to zero. Its parameters are set in other places."
+ */
+ default:
+ tprint_struct_next();
+ PRINT_FIELD_X(*attr, config);
+ break;
+ }
+
+ if (abbrev(tcp))
+ goto print_perf_event_attr_out;
+
+ if (attr->freq) {
+ tprint_struct_next();
+ PRINT_FIELD_U(*attr, sample_freq);
+ } else {
+ tprint_struct_next();
+ PRINT_FIELD_U(*attr, sample_period);
+ }
+
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(*attr, sample_type, perf_event_sample_format,
+ "PERF_SAMPLE_???");
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(*attr, read_format, perf_event_read_format,
+ "PERF_FORMAT_???");
+
+ tprint_struct_next();
+ PRINT_FIELD_U_CAST(*attr, disabled, unsigned int);
+ tprint_struct_next();
+ PRINT_FIELD_U_CAST(*attr, inherit, unsigned int);
+ tprint_struct_next();
+ PRINT_FIELD_U_CAST(*attr, pinned, unsigned int);
+ tprint_struct_next();
+ PRINT_FIELD_U_CAST(*attr, exclusive, unsigned int);
+ tprint_struct_next();
+ PRINT_FIELD_U_CAST(*attr, exclude_user, unsigned int);
+ tprint_struct_next();
+ PRINT_FIELD_U_CAST(*attr, exclude_kernel, unsigned int);
+ tprint_struct_next();
+ PRINT_FIELD_U_CAST(*attr, exclude_hv, unsigned int);
+ tprint_struct_next();
+ PRINT_FIELD_U_CAST(*attr, exclude_idle, unsigned int);
+ tprint_struct_next();
+ PRINT_FIELD_U_CAST(*attr, mmap, unsigned int);
+ tprint_struct_next();
+ PRINT_FIELD_U_CAST(*attr, comm, unsigned int);
+ tprint_struct_next();
+ PRINT_FIELD_U_CAST(*attr, freq, unsigned int);
+ tprint_struct_next();
+ PRINT_FIELD_U_CAST(*attr, inherit_stat, unsigned int);
+ tprint_struct_next();
+ PRINT_FIELD_U_CAST(*attr, enable_on_exec, unsigned int);
+ tprint_struct_next();
+ PRINT_FIELD_U_CAST(*attr, task, unsigned int);
+ tprint_struct_next();
+ PRINT_FIELD_U_CAST(*attr, watermark, unsigned int);
+ tprint_struct_next();
+ PRINT_FIELD_U_CAST(*attr, precise_ip, unsigned int);
+ tprints_comment(precise_ip_desc[attr->precise_ip]);
+ tprint_struct_next();
+ PRINT_FIELD_U_CAST(*attr, mmap_data, unsigned int);
+ tprint_struct_next();
+ PRINT_FIELD_U_CAST(*attr, sample_id_all, unsigned int);
+ tprint_struct_next();
+ PRINT_FIELD_U_CAST(*attr, exclude_host, unsigned int);
+ tprint_struct_next();
+ PRINT_FIELD_U_CAST(*attr, exclude_guest, unsigned int);
+ tprint_struct_next();
+ PRINT_FIELD_U_CAST(*attr, exclude_callchain_kernel, unsigned int);
+ tprint_struct_next();
+ PRINT_FIELD_U_CAST(*attr, exclude_callchain_user, unsigned int);
+ tprint_struct_next();
+ PRINT_FIELD_U_CAST(*attr, mmap2, unsigned int);
+ tprint_struct_next();
+ PRINT_FIELD_U_CAST(*attr, comm_exec, unsigned int);
+ tprint_struct_next();
+ PRINT_FIELD_U_CAST(*attr, use_clockid, unsigned int);
+ tprint_struct_next();
+ PRINT_FIELD_U_CAST(*attr, context_switch, unsigned int);
+ tprint_struct_next();
+ PRINT_FIELD_U_CAST(*attr, write_backward, unsigned int);
+ tprint_struct_next();
+ PRINT_FIELD_U_CAST(*attr, namespaces, unsigned int);
+
+ /*
+ * Print it only in case it is non-zero, since it may contain flags we
+ * are not aware about.
+ */
+ if (attr->__reserved_1) {
+ tprint_struct_next();
+ PRINT_FIELD_X_CAST(*attr, __reserved_1, uint64_t);
+ tprints_comment("Bits 63..29");
+ }
+
+ if (attr->watermark) {
+ tprint_struct_next();
+ PRINT_FIELD_U(*attr, wakeup_watermark);
+ } else {
+ tprint_struct_next();
+ PRINT_FIELD_U(*attr, wakeup_events);
+ }
+
+ if (attr->type == PERF_TYPE_BREAKPOINT) {
+ /* Any combination of R/W with X is deemed invalid */
+ tprint_struct_next();
+ PRINT_FIELD_XVAL(*attr, bp_type, hw_breakpoint_type,
+ (attr->bp_type <=
+ (HW_BREAKPOINT_X | HW_BREAKPOINT_RW))
+ ? "HW_BREAKPOINT_INVALID"
+ : "HW_BREAKPOINT_???");
+ }
+
+ if (attr->type == PERF_TYPE_BREAKPOINT) {
+ tprint_struct_next();
+ PRINT_FIELD_X(*attr, bp_addr);
+ } else {
+ tprint_struct_next();
+ PRINT_FIELD_X(*attr, config1);
+ }
+
+ /*
+ * Fields after bp_addr/config1 are optional and may not present; check
+ * against size is needed.
+ */
+
+ _PERF_CHECK_FIELD(bp_len);
+ if (attr->type == PERF_TYPE_BREAKPOINT) {
+ tprint_struct_next();
+ PRINT_FIELD_U(*attr, bp_len);
+ } else {
+ tprint_struct_next();
+ PRINT_FIELD_X(*attr, config2);
+ }
+
+ _PERF_CHECK_FIELD(branch_sample_type);
+ if (attr->sample_type & PERF_SAMPLE_BRANCH_STACK) {
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(*attr, branch_sample_type,
+ perf_branch_sample_type,
+ "PERF_SAMPLE_BRANCH_???");
+ }
+
+ _PERF_CHECK_FIELD(sample_regs_user);
+ /*
+ * "This bit mask defines the set of user CPU registers to dump on
+ * samples. The layout of the register mask is architecture-specific and
+ * described in the kernel header
+ * arch/ARCH/include/uapi/asm/perf_regs.h."
+ */
+ tprint_struct_next();
+ PRINT_FIELD_X(*attr, sample_regs_user);
+
+ _PERF_CHECK_FIELD(sample_stack_user);
+ /*
+ * "size of the user stack to dump if PERF_SAMPLE_STACK_USER is
+ * specified."
+ */
+ if (attr->sample_type & PERF_SAMPLE_STACK_USER) {
+ tprint_struct_next();
+ PRINT_FIELD_X(*attr, sample_stack_user);
+ }
+
+ if (attr->use_clockid) {
+ _PERF_CHECK_FIELD(clockid);
+ tprint_struct_next();
+ PRINT_FIELD_XVAL(*attr, clockid, clocknames, "CLOCK_???");
+ }
+
+ _PERF_CHECK_FIELD(sample_regs_intr);
+ tprint_struct_next();
+ PRINT_FIELD_X(*attr, sample_regs_intr);
+
+ _PERF_CHECK_FIELD(aux_watermark);
+ tprint_struct_next();
+ PRINT_FIELD_U(*attr, aux_watermark);
+
+ _PERF_CHECK_FIELD(sample_max_stack);
+ tprint_struct_next();
+ PRINT_FIELD_U(*attr, sample_max_stack);
+
+ _PERF_CHECK_FIELD(__reserved_2);
+ if (attr->__reserved_2)
+ tprintf(" /* bytes 110..111: %#hx */", attr->__reserved_2);
+
+ _PERF_CHECK_FIELD(aux_sample_size);
+ tprint_struct_next();
+ PRINT_FIELD_U(*attr, aux_sample_size);
+
+#if 0
+ _PERF_CHECK_FIELD(__reserved_3);
+ if (attr->__reserved_3) {
+ tprint_struct_next();
+ PRINT_FIELD_X(*attr, __reserved_3);
+ }
+#endif
+
+print_perf_event_attr_out:
+ if ((attr->size && (attr->size > size)) ||
+ (!attr->size && (size < PERF_ATTR_SIZE_VER0))) {
+ tprint_struct_next();
+ tprint_more_data_follows();
+ }
+
+ tprint_struct_end();
+}
+
+SYS_FUNC(perf_event_open)
+{
+ /*
+ * We try to copy out the whole structure on entering in order to check
+ * size value on exiting. We do not check the rest of the fields because
+ * they shouldn't be changed, but copy the whole structure instead
+ * of just size field because they could.
+ */
+ if (entering(tcp)) {
+ if (!fetch_perf_event_attr(tcp, tcp->u_arg[0]))
+ return 0;
+ } else {
+ print_perf_event_attr(tcp, tcp->u_arg[0]);
+ }
+
+ tprintf(", %d, %d, ",
+ (int) tcp->u_arg[1],
+ (int) tcp->u_arg[2]);
+ printfd(tcp, tcp->u_arg[3]);
+ tprints(", ");
+ printflags64(perf_event_open_flags, tcp->u_arg[4], "PERF_FLAG_???");
+
+ return RVAL_DECODED | RVAL_FD;
+}
diff --git a/src/perf_event_struct.h b/src/perf_event_struct.h
new file mode 100644
index 000000000..69f53b89d
--- /dev/null
+++ b/src/perf_event_struct.h
@@ -0,0 +1,91 @@
+/*
+ * Copyright (c) 2016-2018 Eugene Syromyatnikov <evgsyr@gmail.com>
+ * Copyright (c) 2016-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_LINUX_PERF_EVENT_STRUCT_H
+# define STRACE_LINUX_PERF_EVENT_STRUCT_H
+
+# include <stdint.h>
+
+struct perf_event_attr {
+ uint32_t type;
+ uint32_t size;
+ uint64_t config;
+ union {
+ uint64_t sample_period;
+ uint64_t sample_freq;
+ };
+ uint64_t sample_type;
+ uint64_t read_format;
+ uint64_t disabled :1,
+ inherit :1,
+ pinned :1,
+ exclusive :1,
+ exclude_user :1,
+ exclude_kernel :1,
+ exclude_hv :1,
+ exclude_idle :1,
+ mmap :1,
+ comm :1,
+ freq :1,
+ inherit_stat :1,
+ enable_on_exec :1,
+ task :1,
+ watermark :1,
+ precise_ip :2,
+ mmap_data :1,
+ sample_id_all :1,
+ exclude_host :1,
+ exclude_guest :1,
+ exclude_callchain_kernel :1,
+ exclude_callchain_user :1,
+ mmap2 :1,
+ comm_exec :1,
+ use_clockid :1,
+ context_switch :1,
+ write_backward :1,
+ namespaces :1,
+ __reserved_1 :35;
+ union {
+ uint32_t wakeup_events;
+ uint32_t wakeup_watermark;
+ };
+ uint32_t bp_type;
+ union {
+ uint64_t bp_addr;
+ uint64_t config1;
+ };
+ /* End of ver 0 - 64 bytes */
+ union {
+ uint64_t bp_len;
+ uint64_t config2;
+ };
+ /* End of ver 1 - 72 bytes */
+ uint64_t branch_sample_type;
+ /* End of ver 2 - 80 bytes */
+ uint64_t sample_regs_user;
+ uint32_t sample_stack_user;
+ int32_t clockid;
+ /* End of ver 3 - 96 bytes */
+ uint64_t sample_regs_intr;
+ /* End of ver 4 - 104 bytes */
+ uint32_t aux_watermark;
+ uint16_t sample_max_stack;
+ uint16_t __reserved_2;
+ /* End of ver 5 - 112 bytes */
+ uint32_t aux_sample_size;
+ uint32_t __reserved_3;
+ /* End of ver 6 - 120 bytes */
+};
+
+struct perf_event_query_bpf {
+ uint32_t ids_len;
+ uint32_t prog_cnt;
+ uint32_t ids[0];
+};
+
+#endif /* !STRACE_LINUX_PERF_EVENT_STRUCT_H */
diff --git a/src/perf_ioctl.c b/src/perf_ioctl.c
new file mode 100644
index 000000000..1fe522439
--- /dev/null
+++ b/src/perf_ioctl.c
@@ -0,0 +1,140 @@
+/*
+ * Copyright (c) 2018-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#include <linux/ioctl.h>
+
+#include "perf_event_struct.h"
+
+#define XLAT_MACROS_ONLY
+#include "xlat/perf_ioctl_cmds.h"
+#undef XLAT_MACROS_ONLY
+
+#include "xlat/perf_ioctl_flags.h"
+
+#include MPERS_DEFS
+
+static int
+perf_ioctl_query_bpf(struct tcb *const tcp, const kernel_ulong_t arg)
+{
+ uint32_t info;
+
+ if (entering(tcp)) {
+ tprints(", ");
+
+ if (umove_or_printaddr(tcp, arg, &info))
+ return RVAL_IOCTL_DECODED;
+
+ tprint_struct_begin();
+ tprints_field_name("ids_len");
+ tprintf("%u", info);
+ tprint_struct_next();
+
+ return 0;
+ }
+
+ if (syserror(tcp) ||
+ umove(tcp, arg + offsetof(struct perf_event_query_bpf, prog_cnt),
+ &info)) {
+ tprint_more_data_follows();
+ tprint_struct_end();
+
+ return RVAL_IOCTL_DECODED;
+ }
+
+ tprints_field_name("prog_cnt");
+ tprintf("%u", info);
+
+ tprint_struct_next();
+ tprints_field_name("ids");
+ print_array(tcp, arg + offsetof(struct perf_event_query_bpf, ids), info,
+ &info, sizeof(info),
+ tfetch_mem, print_uint32_array_member, NULL);
+
+ tprint_struct_end();
+
+ return RVAL_IOCTL_DECODED;
+}
+
+static int
+perf_ioctl_modify_attributes(struct tcb *const tcp, const kernel_ulong_t arg)
+{
+ tprints(", ");
+ if (!fetch_perf_event_attr(tcp, arg))
+ print_perf_event_attr(tcp, arg);
+
+ return RVAL_IOCTL_DECODED;
+}
+
+MPERS_PRINTER_DECL(int, perf_ioctl,
+ struct tcb *const tcp, const unsigned int code,
+ const kernel_ulong_t arg)
+{
+ switch (code) {
+ case PERF_EVENT_IOC_ENABLE:
+ case PERF_EVENT_IOC_DISABLE:
+ case PERF_EVENT_IOC_RESET:
+ tprints(", ");
+ printflags(perf_ioctl_flags, arg, "PERF_IOC_FLAG_???");
+
+ return RVAL_IOCTL_DECODED;
+
+ case PERF_EVENT_IOC_REFRESH:
+ tprintf(", %d", (int) arg);
+
+ return RVAL_IOCTL_DECODED;
+
+ case PERF_EVENT_IOC_PERIOD:
+ tprints(", ");
+ printnum_int64(tcp, arg, "%" PRIu64);
+
+ return RVAL_IOCTL_DECODED;
+
+ case PERF_EVENT_IOC_SET_OUTPUT:
+ case PERF_EVENT_IOC_SET_BPF:
+ tprints(", ");
+ printfd(tcp, (int) arg);
+
+ return RVAL_IOCTL_DECODED;
+
+ case PERF_EVENT_IOC_PAUSE_OUTPUT:
+ tprintf(", %" PRI_klu, arg);
+
+ return RVAL_IOCTL_DECODED;
+
+ /*
+ * The following ioctl requests are personality-specific
+ * due to the pointer size.
+ */
+ case PERF_EVENT_IOC_SET_FILTER:
+ tprints(", ");
+ printstr_ex(tcp, arg, get_pagesize(), QUOTE_0_TERMINATED);
+
+ return RVAL_IOCTL_DECODED;
+
+ case PERF_EVENT_IOC_ID:
+ if (entering(tcp)) {
+ tprints(", ");
+
+ return 0;
+ }
+
+ printnum_int64(tcp, arg, "%" PRIu64);
+
+ return RVAL_IOCTL_DECODED;
+
+ case PERF_EVENT_IOC_QUERY_BPF:
+ return perf_ioctl_query_bpf(tcp, arg);
+
+ case PERF_EVENT_IOC_MODIFY_ATTRIBUTES:
+ return perf_ioctl_modify_attributes(tcp, arg);
+
+ default:
+ return RVAL_DECODED;
+ }
+}
diff --git a/src/personality.c b/src/personality.c
new file mode 100644
index 000000000..47682aea6
--- /dev/null
+++ b/src/personality.c
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2015 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2014-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include "xlat/personality_flags.h"
+#include "xlat/personality_types.h"
+
+
+SYS_FUNC(personality)
+{
+ unsigned int pers;
+
+ if (entering(tcp)) {
+ pers = tcp->u_arg[0];
+ if (0xffffffff == pers) {
+ tprints("0xffffffff");
+ } else {
+ printxval(personality_types, pers & PER_MASK, "PER_???");
+ pers &= ~PER_MASK;
+ if (pers) {
+ tprints("|");
+ printflags(personality_flags, pers, NULL);
+ }
+ }
+ return 0;
+ }
+
+ if (syserror(tcp))
+ return 0;
+
+ pers = tcp->u_rval;
+ static char outstr[1024];
+ char *p = outstr + sprintxval(outstr, sizeof(outstr), personality_types,
+ pers & PER_MASK, "PER_???");
+ pers &= ~PER_MASK;
+ if (pers)
+ strcpy(p, sprintflags("|", personality_flags, pers));
+ tcp->auxstr = outstr;
+ return RVAL_HEX | RVAL_STR;
+}
diff --git a/src/pidfd_getfd.c b/src/pidfd_getfd.c
new file mode 100644
index 000000000..dc263e27b
--- /dev/null
+++ b/src/pidfd_getfd.c
@@ -0,0 +1,31 @@
+/*
+ * pidfd_getfd() syscall decoder.
+ *
+ * Copyright (c) 2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include "number_set.h"
+
+SYS_FUNC(pidfd_getfd)
+{
+ int pidfd = (int) tcp->u_arg[0];
+ int targetfd = (int) tcp->u_arg[1];
+ unsigned int flags = (unsigned int) tcp->u_arg[2];
+
+ printfd(tcp, pidfd);
+ tprints(", ");
+
+ pid_t target_pid = pidfd_get_pid(tcp->pid, pidfd);
+ if (target_pid > 0)
+ printfd_pid(tcp, target_pid, targetfd);
+ else
+ tprintf("%d", targetfd);
+
+ tprintf(", %#x", flags);
+
+ return RVAL_DECODED | RVAL_FD;
+}
diff --git a/src/pidfd_open.c b/src/pidfd_open.c
new file mode 100644
index 000000000..57cdd4573
--- /dev/null
+++ b/src/pidfd_open.c
@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2019 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2019-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include <fcntl.h>
+
+#include "xlat/pidfd_open_flags.h"
+
+SYS_FUNC(pidfd_open)
+{
+ /* pid_t pid */
+ printpid(tcp, tcp->u_arg[0], PT_TGID);
+
+ /* unsigned int flags */
+ tprints(", ");
+ printflags(pidfd_open_flags, tcp->u_arg[1], "PIDFD_???");
+
+ return RVAL_DECODED | RVAL_FD;
+}
diff --git a/src/pidns.c b/src/pidns.c
new file mode 100644
index 000000000..20f5184be
--- /dev/null
+++ b/src/pidns.c
@@ -0,0 +1,608 @@
+/*
+ * Copyright (c) 2020 Ákos Uzonyi <uzonyi.akos@gmail.com>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+
+#include <dirent.h>
+#include <fcntl.h>
+#include <stdint.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <asm/unistd.h>
+
+#include <sys/ioctl.h>
+#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#include "largefile_wrappers.h"
+#include "trie.h"
+#include "nsfs.h"
+#include "xmalloc.h"
+#include "xstring.h"
+
+/**
+ * Key: PID NS ID
+ * Value: a btree:
+ * Key: a process PID in NS
+ * Value: the process's PID as present in /proc
+ */
+static struct trie *ns_pid_to_proc_pid[PT_COUNT];
+
+/**
+ * Key: Proc PID
+ * Value: struct proc_data
+ */
+static struct trie *proc_data_cache;
+
+static bool ns_get_parent_enotty = false;
+
+static const char tid_str[] = "NSpid:\t";
+static const char tgid_str[] = "NStgid:\t";
+static const char pgid_str[] = "NSpgid:\t";
+static const char sid_str[] = "NSsid:\t";
+
+static const struct {
+ const char *str;
+ size_t size;
+} id_strs[PT_COUNT] = {
+ [PT_TID] = { tid_str, sizeof(tid_str) - 1 },
+ [PT_TGID] = { tgid_str, sizeof(tgid_str) - 1 },
+ [PT_PGID] = { pgid_str, sizeof(pgid_str) - 1 },
+ [PT_SID] = { sid_str, sizeof(sid_str) - 1 },
+};
+
+
+/**
+ * Limit on PID NS hierarchy depth, imposed since Linux 3.7. NS traversal
+ * is not possible before Linux 4.9, so we consider this limit pretty universal.
+ */
+#define MAX_NS_DEPTH 32
+
+static const size_t ns_id_size = sizeof(unsigned int) * 8;
+static const uint8_t ptr_sz_lg = (sizeof(void *) == 8 ? 6 : 5);
+
+static int pid_max;
+static uint8_t pid_max_size, pid_max_size_lg;
+
+struct proc_data {
+ int proc_pid;
+ int ns_count;
+ unsigned int ns_hierarchy[MAX_NS_DEPTH];
+ int id_count[PT_COUNT];
+ int id_hierarchy[PT_COUNT][MAX_NS_DEPTH];
+};
+
+/**
+ * Helper function for creating a trie.
+ *
+ * For node_key_bits and data_block_key_bits 4 is used (so trie height is 32 / 4
+ * = 8, and node sizes are 8 byte * 2^4 = 128 bytes), which seems to be a good
+ * tradeoff between memory usage and lookup time. It should not be too large,
+ * since there can be large holes between PIDs, and it would be just a waste of
+ * memory having large nodes with lot of NULL pointers in them.
+ */
+static struct trie *
+create_trie_4(uint8_t key_size, uint8_t item_size_lg, uint64_t empty_value)
+{
+ struct trie *t = trie_create(key_size, item_size_lg, 4, 4, empty_value);
+ if (!t)
+ error_msg_and_die("creating trie failed");
+
+ return t;
+}
+
+void
+pidns_init(void)
+{
+ if (proc_data_cache)
+ return;
+
+ pid_max = INT_MAX;
+ if (read_int_from_file("/proc/sys/kernel/pid_max", &pid_max) < 0)
+ debug_func_perror_msg("reading /proc/sys/kernel/pid_max");
+ pid_max_size = ilog2_32(pid_max - 1) + 1;
+ pid_max_size_lg = ilog2_32(pid_max_size - 1) + 1;
+
+ for (int i = 0; i < PT_COUNT; i++)
+ ns_pid_to_proc_pid[i] = create_trie_4(ns_id_size, ptr_sz_lg, 0);
+
+ proc_data_cache = create_trie_4(pid_max_size, ptr_sz_lg, 0);
+}
+
+static void
+put_proc_pid(unsigned int ns, int ns_pid, enum pid_type type, int proc_pid)
+{
+ struct trie *b = (struct trie *) (uintptr_t) trie_get(ns_pid_to_proc_pid[type], ns);
+ if (!b) {
+ b = create_trie_4(pid_max_size, pid_max_size_lg, 0);
+ trie_set(ns_pid_to_proc_pid[type], ns, (uint64_t) (uintptr_t) b);
+ }
+ trie_set(b, ns_pid, proc_pid);
+}
+
+static int
+get_cached_proc_pid(unsigned int ns, int ns_pid, enum pid_type type)
+{
+ struct trie *b = (struct trie *) (uintptr_t)
+ trie_get(ns_pid_to_proc_pid[type], ns);
+ if (!b)
+ return 0;
+
+ return trie_get(b, ns_pid);
+}
+
+/**
+ * Helper function, converts pid to string, or to "self" for pid == 0.
+ * Uses static buffer for operation.
+ */
+static const char *
+pid_to_str(pid_t pid)
+{
+ if (!pid)
+ return "self";
+
+ static char buf[sizeof("-2147483648")];
+ xsprintf(buf, "%d", pid);
+ return buf;
+}
+
+/**
+ * Returns a list of PID NS IDs for the specified PID.
+ *
+ * @param proc_pid PID (as present in /proc) to get information for.
+ * @param ns_buf Pointer to buffer that is able to contain at least
+ * ns_buf_size items.
+ * @return Amount of NS in list. 0 indicates error.
+ */
+static size_t
+get_ns_hierarchy(int proc_pid, unsigned int *ns_buf, size_t ns_buf_size)
+{
+ char path[PATH_MAX + 1];
+ xsprintf(path, "/proc/%s/ns/pid", pid_to_str(proc_pid));
+
+ int fd = open_file(path, O_RDONLY);
+ if (fd < 0)
+ return 0;
+
+ size_t n = 0;
+ while (n < ns_buf_size) {
+ strace_stat_t st;
+ if (fstat_fd(fd, &st))
+ break;
+
+ ns_buf[n++] = st.st_ino;
+ if (n >= ns_buf_size)
+ break;
+
+ if (ns_get_parent_enotty)
+ break;
+
+ int parent_fd = ioctl(fd, NS_GET_PARENT);
+ if (parent_fd < 0) {
+ switch (errno) {
+ case EPERM:
+ break;
+
+ case ENOTTY:
+ ns_get_parent_enotty = true;
+ error_msg("NS_* ioctl commands are not "
+ "supported by the kernel");
+ break;
+
+ default:
+ perror_func_msg("ioctl(NS_GET_PARENT)");
+ break;
+ }
+
+ break;
+ }
+
+ close(fd);
+ fd = parent_fd;
+ }
+
+ close(fd);
+
+ return n;
+}
+
+/**
+ * Get list of IDs present in NS* proc status record. IDs are placed as they are
+ * stored in /proc (from top to bottom of NS hierarchy).
+ *
+ * @param proc_pid PID (as present in /proc) to get information for.
+ * @param id_buf Pointer to buffer that is able to contain at least
+ * MAX_NS_DEPTH items. Can be NULL.
+ * @param type Type of ID requested.
+ * @return Number of items stored in id_list. 0 indicates error.
+ */
+static size_t
+get_id_list(int proc_pid, int *id_buf, enum pid_type type)
+{
+ const char *ns_str = id_strs[type].str;
+ size_t ns_str_size = id_strs[type].size;
+
+ size_t n = 0;
+
+ char status_path[PATH_MAX + 1];
+ xsprintf(status_path, "/proc/%s/status", pid_to_str(proc_pid));
+ FILE *f = fopen_stream(status_path, "r");
+ if (!f)
+ return 0;
+
+ char *line = NULL;
+ size_t linesize = 0;
+ char *p = NULL;
+
+ while (getline(&line, &linesize, f) > 0) {
+ if (strncmp(line, ns_str, ns_str_size) == 0) {
+ p = line + ns_str_size;
+ break;
+ }
+ }
+
+ while (p) {
+ errno = 0;
+ long id = strtol(p, NULL, 10);
+
+ if (id < 0 || id > INT_MAX || errno) {
+ perror_func_msg("converting pid (%ld) to int", id);
+ break;
+ }
+
+ if (id_buf)
+ id_buf[n] = (int) id;
+
+ n++;
+ strsep(&p, "\t");
+ }
+
+ free(line);
+ fclose(f);
+
+ return n;
+}
+
+/**
+ * Returns whether the /proc filesystem's PID namespace is the same as strace's.
+ */
+static bool
+is_proc_ours(void)
+{
+ static int cached_val = -1;
+
+ if (cached_val < 0)
+ cached_val = get_id_list(0, NULL, PT_TID) <= 1;
+
+ return cached_val;
+}
+
+/**
+ * Returns the PID namespace of the tracee
+ */
+static unsigned int
+get_ns(struct tcb *tcp)
+{
+ if (!tcp->pid_ns) {
+ int proc_pid = 0;
+ translate_pid(NULL, tcp->pid, PT_TID, &proc_pid);
+
+ if (proc_pid)
+ get_ns_hierarchy(proc_pid, &tcp->pid_ns, 1);
+ }
+
+ return tcp->pid_ns;
+}
+
+/**
+ * Returns the PID namespace of strace
+ */
+static unsigned int
+get_our_ns(void)
+{
+ static unsigned int our_ns = 0;
+ static bool our_ns_initialised = false;
+
+ if (!our_ns_initialised) {
+ get_ns_hierarchy(0, &our_ns, 1);
+ our_ns_initialised = true;
+ }
+
+ return our_ns;
+}
+
+/**
+ * Returns the cached proc_data struct associated with proc_pid.
+ * If none found, allocates a new proc_data.
+ */
+static struct proc_data *
+get_or_create_proc_data(int proc_pid)
+{
+ struct proc_data *pd = (struct proc_data *) (uintptr_t)
+ trie_get(proc_data_cache, proc_pid);
+
+ if (!pd) {
+ pd = calloc(1, sizeof(*pd));
+ if (!pd)
+ return NULL;
+
+ pd->proc_pid = proc_pid;
+ trie_set(proc_data_cache, proc_pid, (uint64_t) (uintptr_t) pd);
+ }
+
+ return pd;
+}
+
+/**
+ * Updates the proc_data from /proc
+ * If the process does not exists, returns false, and frees the proc_data
+ */
+static bool
+update_proc_data(struct proc_data *pd, enum pid_type type)
+{
+ pd->ns_count = get_ns_hierarchy(pd->proc_pid,
+ pd->ns_hierarchy, MAX_NS_DEPTH);
+ if (!pd->ns_count)
+ goto fail;
+
+ pd->id_count[type] = get_id_list(pd->proc_pid,
+ pd->id_hierarchy[type], type);
+ if (!pd->id_count[type])
+ goto fail;
+
+ return true;
+
+fail:
+ trie_set(proc_data_cache, pd->proc_pid, (uint64_t) (uintptr_t) NULL);
+ free(pd);
+ return false;
+}
+
+/**
+ * Parameters for id translation
+ */
+struct translate_id_params {
+ /* The result (output) */
+ int result_id;
+ /* The proc data of the process (output) */
+ struct proc_data *pd;
+
+ /* The namespace to be translated from */
+ unsigned int from_ns;
+ /* The id to be translated */
+ int from_id;
+ /* The type of the id */
+ enum pid_type type;
+};
+
+/**
+ * Translates an id to our namespace, given the proc_pid of the process,
+ * by reading files in /proc.
+ *
+ * @param tip The parameters
+ * @param proc_pid The proc pid of the process.
+ * If 0, use the cached values in tip->pd.
+ */
+static void
+translate_id_proc_pid(struct translate_id_params *tip, int proc_pid)
+{
+ struct proc_data *pd = proc_pid ?
+ get_or_create_proc_data(proc_pid) :
+ tip->pd;
+
+ tip->result_id = 0;
+ tip->pd = NULL;
+
+ if (!pd)
+ return;
+
+ if (proc_pid && !update_proc_data(pd, tip->type))
+ return;
+
+ if (!pd->ns_count || pd->id_count[tip->type] < pd->ns_count)
+ return;
+
+ int *id_hierarchy = pd->id_hierarchy[tip->type];
+ int id_count = pd->id_count[tip->type];
+
+ for (int i = 0; i < pd->ns_count; i++) {
+ unsigned int ns = pd->ns_hierarchy[i];
+ int ns_id = id_hierarchy[id_count - i - 1];
+ int our_id = id_hierarchy[id_count - pd->ns_count];
+
+ if (ns != tip->from_ns)
+ continue;
+
+ if (ns_id != tip->from_id)
+ return;
+
+ tip->result_id = our_id;
+ tip->pd = pd;
+ return;
+ }
+}
+
+/**
+ * Translates an id to our namespace by reading all proc entries in a directory.
+ * The directory is either /proc or /proc/<pid>/task.
+ *
+ *
+ * @param tip The parameters
+ * @param path The path of the directory to be read.
+ * @param read_task_dir Whether recurse to "task" subdirectory.
+ */
+static void
+translate_id_dir(struct translate_id_params *tip, const char *path,
+ bool read_task_dir)
+{
+ DIR *dir = opendir(path);
+ if (!dir) {
+ debug_func_perror_msg("opening dir: %s", path);
+ return;
+ }
+
+ while (!tip->result_id) {
+ errno = 0;
+ struct_dirent *entry = read_dir(dir);
+ if (!entry) {
+ if (errno)
+ perror_func_msg("readdir");
+
+ break;
+ }
+
+ if (entry->d_type != DT_DIR)
+ continue;
+
+ errno = 0;
+ long proc_pid = strtol(entry->d_name, NULL, 10);
+ if (proc_pid < 1 || proc_pid > INT_MAX || errno)
+ continue;
+
+ if (read_task_dir) {
+ char task_dir_path[PATH_MAX + 1];
+ xsprintf(task_dir_path, "/proc/%ld/task", proc_pid);
+ translate_id_dir(tip, task_dir_path, false);
+ }
+
+ if (tip->result_id)
+ break;
+
+ translate_id_proc_pid(tip, proc_pid);
+ }
+
+ closedir(dir);
+}
+
+/**
+ * Iterator function of the proc_data_cache for id translation.
+ * If the cache contains the id we are looking for, reads the corresponding
+ * directory in /proc, and if cache is valid, saves the result.
+ */
+static void
+proc_data_cache_iterator_fn(void* fn_data, uint64_t key, uint64_t val)
+{
+ struct translate_id_params *tip = (struct translate_id_params *)fn_data;
+ struct proc_data *pd = (struct proc_data *) (uintptr_t) val;
+
+ if (!pd)
+ return;
+
+ /* Result already found in an earlier iteration */
+ if (tip->result_id)
+ return;
+
+ /* Translate from cache */
+ tip->pd = pd;
+ translate_id_proc_pid(tip, 0);
+ if (!tip->result_id)
+ return;
+
+ /* Now translate from actual data in /proc, to check cache validity */
+ translate_id_proc_pid(tip, pd->proc_pid);
+}
+
+int
+translate_pid(struct tcb *tcp, int from_id, enum pid_type type,
+ int *proc_pid_ptr)
+{
+ if (from_id <= 0 || type < 0 || type >= PT_COUNT)
+ return 0;
+
+ /* If translation is trivial */
+ if ((!tcp || get_ns(tcp) == get_our_ns()) &&
+ (!proc_pid_ptr || is_proc_ours())) {
+ if (proc_pid_ptr)
+ *proc_pid_ptr = from_id;
+
+ return from_id;
+ }
+
+ struct translate_id_params tip = {
+ .result_id = 0,
+ .pd = NULL,
+ .from_ns = tcp ? get_ns(tcp) : get_our_ns(),
+ .from_id = from_id,
+ .type = type,
+ };
+
+ if (!tip.from_ns)
+ return 0;
+
+ if (ns_get_parent_enotty)
+ return 0;
+
+ /* Look for a cached proc_pid for this (from_ns, from_id) pair */
+ int cached_proc_pid = get_cached_proc_pid(tip.from_ns, tip.from_id,
+ tip.type);
+ if (cached_proc_pid) {
+ translate_id_proc_pid(&tip, cached_proc_pid);
+ if (tip.result_id)
+ goto exit;
+ }
+
+ /* Iterate through the cache, find potential proc_data */
+ trie_iterate_keys(proc_data_cache, 0, pid_max - 1,
+ proc_data_cache_iterator_fn, &tip);
+ /* (proc_data_cache_iterator_fn takes care about updating proc_data) */
+ if (tip.result_id)
+ goto exit;
+
+ /* No cache helped, read all entries in /proc */
+ translate_id_dir(&tip, "/proc", true);
+
+exit:
+ if (tip.pd) {
+ if (tip.pd->proc_pid)
+ put_proc_pid(tip.from_ns, tip.from_id, tip.type,
+ tip.pd->proc_pid);
+
+ if (proc_pid_ptr)
+ *proc_pid_ptr = tip.pd->proc_pid;
+ }
+
+ return tip.result_id;
+}
+
+int
+get_proc_pid(struct tcb *tcp)
+{
+ int proc_pid = 0;
+ translate_pid(NULL, tcp->pid, PT_TID, &proc_pid);
+ return proc_pid;
+}
+
+static void
+printpid_translation(struct tcb *tcp, int pid, enum pid_type type)
+{
+ if (!pidns_translation)
+ return;
+
+ int strace_pid = translate_pid(tcp, pid, type, NULL);
+ if (strace_pid && strace_pid != pid)
+ tprintf_comment("%d in strace's PID NS", strace_pid);
+}
+
+void
+printpid(struct tcb *tcp, int pid, enum pid_type type)
+{
+ tprintf("%d", pid);
+ printpid_translation(tcp, pid, type);
+}
+
+void
+printpid_tgid_pgid(struct tcb *tcp, int pid)
+{
+ tprintf("%d", pid);
+ if (pid > 0)
+ printpid_translation(tcp, pid, PT_TGID);
+ else if (pid < -1)
+ printpid_translation(tcp, -pid, PT_PGID);
+}
diff --git a/src/pkeys.c b/src/pkeys.c
new file mode 100644
index 000000000..50dbd5796
--- /dev/null
+++ b/src/pkeys.c
@@ -0,0 +1,25 @@
+/*
+ * Copyright (c) 2016-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#include "xlat/pkey_access.h"
+
+SYS_FUNC(pkey_alloc)
+{
+ tprintf("%#" PRI_klx ", ", tcp->u_arg[0]);
+ printflags64(pkey_access, tcp->u_arg[1], "PKEY_???");
+
+ return RVAL_DECODED;
+}
+
+SYS_FUNC(pkey_free)
+{
+ tprintf("%d", (int) tcp->u_arg[0]);
+
+ return RVAL_DECODED;
+}
diff --git a/src/poll.c b/src/poll.c
new file mode 100644
index 000000000..b59b8c304
--- /dev/null
+++ b/src/poll.c
@@ -0,0 +1,194 @@
+/*
+ * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
+ * Copyright (c) 1999-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include <poll.h>
+#include "xstring.h"
+
+#include "xlat/pollflags.h"
+
+static bool
+print_pollfd(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data)
+{
+ const struct pollfd *fds = elem_buf;
+
+ tprint_struct_begin();
+ PRINT_FIELD_FD(*fds, fd, tcp);
+ if (fds->fd >= 0) {
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(*fds, events, pollflags, "POLL???");
+ }
+ tprint_struct_end();
+
+ return true;
+}
+
+static void
+decode_poll_entering(struct tcb *tcp)
+{
+ const kernel_ulong_t addr = tcp->u_arg[0];
+ const unsigned int nfds = tcp->u_arg[1];
+ struct pollfd fds;
+
+ print_array(tcp, addr, nfds, &fds, sizeof(fds),
+ tfetch_mem, print_pollfd, 0);
+ tprintf(", %u, ", nfds);
+}
+
+static int
+decode_poll_exiting(struct tcb *const tcp, const sprint_obj_by_addr_fn sprint_ts,
+ const kernel_ulong_t pts)
+{
+ struct pollfd fds;
+ const unsigned int nfds = tcp->u_arg[1];
+ const unsigned long size = sizeof(fds) * nfds;
+ const kernel_ulong_t start = tcp->u_arg[0];
+ const kernel_ulong_t end = start + size;
+ kernel_ulong_t cur;
+ const unsigned int max_printed =
+ abbrev(tcp) ? max_strlen : -1U;
+ unsigned int printed;
+
+ static char outstr[1024];
+ char *outptr;
+#define end_outstr (outstr + sizeof(outstr))
+
+ if (syserror(tcp))
+ return 0;
+ if (tcp->u_rval == 0) {
+ tcp->auxstr = "Timeout";
+ return RVAL_STR;
+ }
+
+ if (!verbose(tcp) || !start || !nfds ||
+ size / sizeof(fds) != nfds || end < start)
+ return 0;
+
+ outptr = outstr;
+
+ for (printed = 0, cur = start; cur < end; cur += sizeof(fds)) {
+ if (umove(tcp, cur, &fds) < 0) {
+ if (outptr == outstr)
+ *outptr++ = '[';
+ else
+ outptr = stpcpy(outptr, ", ");
+ outptr = xappendstr(outstr, outptr, "%#" PRI_klx, cur);
+ break;
+ }
+ if (!fds.revents)
+ continue;
+ if (outptr == outstr)
+ *outptr++ = '[';
+ else
+ outptr = stpcpy(outptr, ", ");
+ if (printed >= max_printed) {
+ outptr = stpcpy(outptr, "...");
+ break;
+ }
+
+ static const char fmt[] = "{fd=%d, revents=";
+ char fdstr[sizeof(fmt) + sizeof(int) * 3];
+ xsprintf(fdstr, fmt, fds.fd);
+
+ const char *flagstr = sprintflags("", pollflags,
+ (unsigned short) fds.revents);
+
+ if (outptr + strlen(fdstr) + strlen(flagstr) + 1 >=
+ end_outstr - (2 + 2 * sizeof(long) + sizeof(", ], ..."))) {
+ outptr = stpcpy(outptr, "...");
+ break;
+ }
+ outptr = stpcpy(outptr, fdstr);
+ outptr = stpcpy(outptr, flagstr);
+ *outptr++ = '}';
+ ++printed;
+ }
+
+ if (outptr != outstr)
+ *outptr++ = ']';
+
+ *outptr = '\0';
+ if (pts) {
+ const char *str = sprint_ts(tcp, pts);
+
+ if (outptr + sizeof(", left ") + strlen(str) < end_outstr) {
+ outptr = stpcpy(outptr, outptr == outstr ? "left " : ", left ");
+ outptr = stpcpy(outptr, str);
+ } else {
+ outptr = stpcpy(outptr, ", ...");
+ }
+ }
+
+ if (outptr == outstr)
+ return 0;
+
+ tcp->auxstr = outstr;
+ return RVAL_STR;
+#undef end_outstr
+}
+
+#if HAVE_ARCH_TIME32_SYSCALLS || HAVE_ARCH_OLD_TIME64_SYSCALLS
+static int
+do_poll(struct tcb *const tcp, const sprint_obj_by_addr_fn sprint_ts)
+{
+ if (entering(tcp)) {
+ decode_poll_entering(tcp);
+ tprintf("%d", (int) tcp->u_arg[2]);
+
+ return 0;
+ } else {
+ return decode_poll_exiting(tcp, sprint_ts, 0);
+ }
+}
+#endif /* HAVE_ARCH_TIME32_SYSCALLS || HAVE_ARCH_OLD_TIME64_SYSCALLS */
+
+#if HAVE_ARCH_TIME32_SYSCALLS
+SYS_FUNC(poll_time32)
+{
+ return do_poll(tcp, sprint_timespec32);
+}
+#endif
+
+#if HAVE_ARCH_OLD_TIME64_SYSCALLS
+SYS_FUNC(poll_time64)
+{
+ return do_poll(tcp, sprint_timespec64);
+}
+#endif
+
+static int
+do_ppoll(struct tcb *const tcp, const print_obj_by_addr_fn print_ts,
+ const sprint_obj_by_addr_fn sprint_ts)
+{
+ if (entering(tcp)) {
+ decode_poll_entering(tcp);
+
+ print_ts(tcp, tcp->u_arg[2]);
+ tprints(", ");
+ /* NB: kernel requires arg[4] == NSIG_BYTES */
+ print_sigset_addr_len(tcp, tcp->u_arg[3], tcp->u_arg[4]);
+ tprintf(", %" PRI_klu, tcp->u_arg[4]);
+
+ return 0;
+ } else {
+ return decode_poll_exiting(tcp, sprint_ts, tcp->u_arg[2]);
+ }
+}
+
+#if HAVE_ARCH_TIME32_SYSCALLS
+SYS_FUNC(ppoll_time32)
+{
+ return do_ppoll(tcp, print_timespec32, sprint_timespec32);
+}
+#endif
+
+SYS_FUNC(ppoll_time64)
+{
+ return do_ppoll(tcp, print_timespec64, sprint_timespec64);
+}
diff --git a/src/prctl.c b/src/prctl.c
new file mode 100644
index 000000000..19b0f5930
--- /dev/null
+++ b/src/prctl.c
@@ -0,0 +1,450 @@
+/*
+ * Copyright (c) 1994-1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1996-2000 Wichert Akkerman <wichert@cistron.nl>
+ * Copyright (c) 2005-2007 Roland McGrath <roland@redhat.com>
+ * Copyright (c) 2008-2015 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2014-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#include <linux/prctl.h>
+
+#include "xstring.h"
+
+#include "xlat/prctl_options.h"
+#include "xlat/pr_cap_ambient.h"
+#include "xlat/pr_dumpable.h"
+#include "xlat/pr_fp_mode.h"
+#include "xlat/pr_mce_kill.h"
+#include "xlat/pr_mce_kill_policy.h"
+#include "xlat/pr_set_mm.h"
+#include "xlat/pr_spec_cmds.h"
+#include "xlat/pr_spec_get_store_bypass_flags.h"
+#include "xlat/pr_spec_set_store_bypass_flags.h"
+#include "xlat/pr_sve_vl_flags.h"
+#include "xlat/pr_tsc.h"
+#include "xlat/pr_unalign_flags.h"
+
+#ifndef TASK_COMM_LEN
+# define TASK_COMM_LEN 16
+#endif
+
+#ifdef HAVE_LINUX_SECCOMP_H
+# include <linux/seccomp.h>
+#endif
+#include "xlat/seccomp_mode.h"
+
+#ifdef HAVE_LINUX_SECUREBITS_H
+# include <linux/securebits.h>
+#endif
+#include "xlat/secbits.h"
+
+/* these constants are the same as in <linux/capability.h> */
+enum {
+#include "caps0.h"
+#include "caps1.h"
+};
+
+#include "xlat/cap.h"
+
+#ifndef PR_SVE_VL_LEN_MASK
+# define PR_SVE_VL_LEN_MASK 0xffff
+#endif
+
+
+static void
+print_prctl_args(struct tcb *tcp, const unsigned int first)
+{
+ unsigned int i;
+
+ for (i = first; i < n_args(tcp); ++i)
+ tprintf(", %#" PRI_klx, tcp->u_arg[i]);
+}
+
+static char *
+sprint_sve_val(kernel_ulong_t arg)
+{
+ static char out[sizeof("PR_SVE_SET_VL_ONEXEC|PR_SVE_VL_INHERIT|0x") +
+ sizeof(kernel_ulong_t) * 2];
+
+ kernel_ulong_t vl = arg & PR_SVE_VL_LEN_MASK;
+ kernel_ulong_t flags = arg & ~PR_SVE_VL_LEN_MASK;
+ const char *flags_str = sprintflags("", pr_sve_vl_flags, flags);
+
+ xsprintf(out, "%s%s%#" PRI_klx,
+ flags_str ?: "", flags_str ? "|" : "", vl);
+
+ return out;
+}
+
+SYS_FUNC(prctl)
+{
+ const unsigned int option = tcp->u_arg[0];
+ const kernel_ulong_t arg2 = tcp->u_arg[1];
+ const kernel_ulong_t arg3 = tcp->u_arg[2];
+ /*
+ * PR_SET_VMA is the only command which actually uses these arguments
+ * currently, and it is available only on Android for now.
+ */
+#ifdef __ANDROID__
+ const kernel_ulong_t arg4 = tcp->u_arg[3];
+ const kernel_ulong_t arg5 = tcp->u_arg[4];
+#endif
+ unsigned int i;
+
+ if (entering(tcp))
+ printxval(prctl_options, option, "PR_???");
+
+ switch (option) {
+ case PR_GET_KEEPCAPS:
+ case PR_GET_SECCOMP:
+ case PR_GET_TIMERSLACK:
+ case PR_GET_TIMING:
+ case PR_GET_TAGGED_ADDR_CTRL:
+ return RVAL_DECODED;
+
+ case PR_GET_CHILD_SUBREAPER:
+ case PR_GET_ENDIAN:
+ case PR_GET_FPEMU:
+ case PR_GET_FPEXC:
+ if (entering(tcp))
+ tprints(", ");
+ else
+ printnum_int(tcp, arg2, "%u");
+ break;
+
+ case PR_GET_DUMPABLE:
+ if (entering(tcp))
+ break;
+ if (syserror(tcp))
+ return 0;
+ tcp->auxstr = xlookup(pr_dumpable, (kernel_ulong_t) tcp->u_rval);
+ return RVAL_STR;
+
+ case PR_GET_NAME:
+ if (entering(tcp)) {
+ tprints(", ");
+ } else {
+ if (syserror(tcp))
+ printaddr(arg2);
+ else
+ printstr_ex(tcp, arg2, TASK_COMM_LEN,
+ QUOTE_0_TERMINATED);
+ }
+ break;
+
+ case PR_GET_PDEATHSIG:
+ if (entering(tcp)) {
+ tprints(", ");
+ } else if (!umove_or_printaddr(tcp, arg2, &i)) {
+ tprints("[");
+ printsignal(i);
+ tprints("]");
+ }
+ break;
+
+ case PR_GET_SECUREBITS:
+ if (entering(tcp))
+ break;
+ if (syserror(tcp) || tcp->u_rval == 0)
+ return 0;
+ tcp->auxstr = sprintflags("", secbits,
+ (kernel_ulong_t) tcp->u_rval);
+ return RVAL_STR;
+
+ case PR_GET_TID_ADDRESS:
+ if (entering(tcp))
+ tprints(", ");
+ else
+ printnum_kptr(tcp, arg2);
+ break;
+
+ case PR_GET_TSC:
+ if (entering(tcp)) {
+ tprints(", ");
+ } else if (!umove_or_printaddr(tcp, arg2, &i)) {
+ tprints("[");
+ printxval(pr_tsc, i, "PR_TSC_???");
+ tprints("]");
+ }
+ break;
+
+ case PR_GET_UNALIGN:
+ if (entering(tcp)) {
+ tprints(", ");
+ } else if (!umove_or_printaddr(tcp, arg2, &i)) {
+ tprints("[");
+ printflags(pr_unalign_flags, i, "PR_UNALIGN_???");
+ tprints("]");
+ }
+ break;
+
+ case PR_GET_FP_MODE:
+ if (entering(tcp))
+ break;
+ if (syserror(tcp) || tcp->u_rval == 0)
+ return 0;
+ tcp->auxstr = sprintflags("", pr_fp_mode,
+ (kernel_ulong_t) tcp->u_rval);
+ return RVAL_STR;
+
+ case PR_SVE_SET_VL:
+ if (entering(tcp)) {
+ tprintf(", %s", sprint_sve_val(arg2));
+ return 0;
+ }
+ ATTRIBUTE_FALLTHROUGH;
+
+ case PR_SVE_GET_VL:
+ if (entering(tcp))
+ break;
+ if (syserror(tcp) || tcp->u_rval == 0)
+ return 0;
+
+ tcp->auxstr = sprint_sve_val(tcp->u_rval);
+
+ return RVAL_STR;
+
+ case PR_GET_SPECULATION_CTRL:
+ if (entering(tcp)) {
+ tprints(", ");
+ printxval64(pr_spec_cmds, arg2, "PR_SPEC_???");
+
+ break;
+ }
+
+ if (syserror(tcp))
+ return 0;
+
+ switch (arg2) {
+ case PR_SPEC_STORE_BYPASS:
+ case PR_SPEC_INDIRECT_BRANCH:
+ tcp->auxstr = sprintflags("",
+ pr_spec_get_store_bypass_flags,
+ (kernel_ulong_t) tcp->u_rval);
+ break;
+ }
+
+ return RVAL_STR;
+
+ /* PR_TASK_PERF_EVENTS_* take no arguments. */
+ case PR_TASK_PERF_EVENTS_DISABLE:
+ case PR_TASK_PERF_EVENTS_ENABLE:
+ return RVAL_DECODED;
+
+ case PR_SET_CHILD_SUBREAPER:
+ case PR_SET_ENDIAN:
+ case PR_SET_FPEMU:
+ case PR_SET_FPEXC:
+ case PR_SET_KEEPCAPS:
+ case PR_SET_TIMING:
+ case PR_SET_TAGGED_ADDR_CTRL:
+ tprintf(", %" PRI_klu, arg2);
+ return RVAL_DECODED;
+
+ case PR_SET_DUMPABLE:
+ tprints(", ");
+ printxval64(pr_dumpable, arg2, "SUID_DUMP_???");
+ return RVAL_DECODED;
+
+ case PR_CAPBSET_DROP:
+ case PR_CAPBSET_READ:
+ tprints(", ");
+ printxval64(cap, arg2, "CAP_???");
+ return RVAL_DECODED;
+
+ case PR_CAP_AMBIENT:
+ tprints(", ");
+ printxval64(pr_cap_ambient, arg2,
+ "PR_CAP_AMBIENT_???");
+ switch (arg2) {
+ case PR_CAP_AMBIENT_RAISE:
+ case PR_CAP_AMBIENT_LOWER:
+ case PR_CAP_AMBIENT_IS_SET:
+ tprints(", ");
+ printxval64(cap, arg3, "CAP_???");
+ print_prctl_args(tcp, 3);
+ break;
+ default:
+ print_prctl_args(tcp, 2);
+ break;
+ }
+ return RVAL_DECODED;
+
+ case PR_MCE_KILL:
+ tprints(", ");
+ printxval64(pr_mce_kill, arg2, "PR_MCE_KILL_???");
+ tprints(", ");
+ if (PR_MCE_KILL_SET == arg2)
+ printxval64(pr_mce_kill_policy, arg3,
+ "PR_MCE_KILL_???");
+ else
+ tprintf("%#" PRI_klx, arg3);
+ print_prctl_args(tcp, 3);
+ return RVAL_DECODED;
+
+ case PR_SET_NAME:
+ tprints(", ");
+ printstr_ex(tcp, arg2, TASK_COMM_LEN - 1,
+ QUOTE_0_TERMINATED);
+ return RVAL_DECODED;
+
+#ifdef __ANDROID__
+# ifndef PR_SET_VMA_ANON_NAME
+# define PR_SET_VMA_ANON_NAME 0
+# endif
+ case PR_SET_VMA:
+ if (arg2 == PR_SET_VMA_ANON_NAME) {
+ tprintf(", PR_SET_VMA_ANON_NAME, %#" PRI_klx, arg3);
+ tprintf(", %" PRI_klu ", ", arg4);
+ printstr(tcp, arg5);
+ } else {
+ /* There are no other sub-options now, but there
+ * might be in future... */
+ print_prctl_args(tcp, 1);
+ }
+ return RVAL_DECODED;
+#endif
+
+ case PR_SET_MM:
+ tprints(", ");
+ printxval(pr_set_mm, arg2, "PR_SET_MM_???");
+ print_prctl_args(tcp, 2);
+ return RVAL_DECODED;
+
+ case PR_SET_PDEATHSIG:
+ tprints(", ");
+ if (arg2 > 128)
+ tprintf("%" PRI_klu, arg2);
+ else
+ printsignal(arg2);
+ return RVAL_DECODED;
+
+ case PR_SET_PTRACER:
+ tprints(", ");
+ if ((int) arg2 == -1) {
+ print_xlat_ex(arg2, "PR_SET_PTRACER_ANY",
+ XLAT_STYLE_DEFAULT);
+ } else {
+ tprintf("%" PRI_klu, arg2);
+ }
+ return RVAL_DECODED;
+
+ case PR_SET_SECCOMP:
+ tprints(", ");
+ printxval64(seccomp_mode, arg2,
+ "SECCOMP_MODE_???");
+ if (SECCOMP_MODE_STRICT == arg2)
+ return RVAL_DECODED;
+ if (SECCOMP_MODE_FILTER == arg2) {
+ tprints(", ");
+ decode_seccomp_fprog(tcp, arg3);
+ return RVAL_DECODED;
+ }
+ print_prctl_args(tcp, 2);
+ return RVAL_DECODED;
+
+ case PR_SET_SECUREBITS:
+ tprints(", ");
+ printflags64(secbits, arg2, "SECBIT_???");
+ return RVAL_DECODED;
+
+ case PR_SET_TIMERSLACK:
+ tprintf(", %" PRI_kld, arg2);
+ return RVAL_DECODED;
+
+ case PR_SET_TSC:
+ tprints(", ");
+ printxval(pr_tsc, arg2, "PR_TSC_???");
+ return RVAL_DECODED;
+
+ case PR_SET_UNALIGN:
+ tprints(", ");
+ printflags(pr_unalign_flags, arg2, "PR_UNALIGN_???");
+ return RVAL_DECODED;
+
+ case PR_SET_NO_NEW_PRIVS:
+ case PR_SET_THP_DISABLE:
+ case PR_SET_IO_FLUSHER:
+ tprintf(", %" PRI_klu, arg2);
+ print_prctl_args(tcp, 2);
+ return RVAL_DECODED;
+
+ case PR_MCE_KILL_GET:
+ if (entering(tcp)) {
+ print_prctl_args(tcp, 1);
+ return 0;
+ }
+ if (syserror(tcp))
+ return 0;
+ tcp->auxstr = xlookup(pr_mce_kill_policy,
+ (kernel_ulong_t) tcp->u_rval);
+ return RVAL_STR;
+
+ case PR_SET_FP_MODE:
+ tprints(", ");
+ printflags(pr_fp_mode, arg2, "PR_FP_MODE_???");
+ return RVAL_DECODED;
+
+ case PR_SET_SPECULATION_CTRL:
+ tprints(", ");
+ printxval64(pr_spec_cmds, arg2, "PR_SPEC_???");
+ tprints(", ");
+
+ switch (arg2) {
+ case PR_SPEC_STORE_BYPASS:
+ case PR_SPEC_INDIRECT_BRANCH:
+ printxval64(pr_spec_set_store_bypass_flags, arg3,
+ "PR_SPEC_???");
+ break;
+
+ default:
+ tprintf("%#" PRI_klx, arg3);
+ }
+
+ return RVAL_DECODED;
+
+ case PR_GET_NO_NEW_PRIVS:
+ case PR_GET_THP_DISABLE:
+ case PR_MPX_DISABLE_MANAGEMENT:
+ case PR_MPX_ENABLE_MANAGEMENT:
+ case PR_GET_IO_FLUSHER:
+ default:
+ print_prctl_args(tcp, 1);
+ return RVAL_DECODED;
+ }
+ return 0;
+}
+
+#if defined X86_64 || defined X32 || defined I386
+# include "xlat/archvals.h"
+
+SYS_FUNC(arch_prctl)
+{
+ const unsigned int option = tcp->u_arg[0];
+ const kernel_ulong_t addr = tcp->u_arg[1];
+
+ if (entering(tcp))
+ printxval(archvals, option, "ARCH_???");
+
+ switch (option) {
+ case ARCH_GET_GS:
+ case ARCH_GET_FS:
+ if (entering(tcp))
+ tprints(", ");
+ else
+ printnum_kptr(tcp, addr);
+ return 0;
+
+ case ARCH_GET_CPUID: /* has no arguments */
+ return RVAL_DECODED;
+ }
+
+ tprintf(", %#" PRI_klx, addr);
+ return RVAL_DECODED;
+}
+#endif /* X86_64 || X32 || I386 */
diff --git a/src/print_dev_t.c b/src/print_dev_t.c
new file mode 100644
index 000000000..043ca8aa0
--- /dev/null
+++ b/src/print_dev_t.c
@@ -0,0 +1,29 @@
+/*
+ * Device number printing routine.
+ *
+ * Copyright (c) 2016-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include <sys/sysmacros.h>
+
+void
+print_dev_t(const unsigned long long dev)
+{
+ if (xlat_verbose(xlat_verbosity) != XLAT_STYLE_ABBREV)
+ tprintf("%#llx", dev);
+
+ if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_RAW)
+ return;
+
+ if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE)
+ tprints(" /* ");
+
+ tprintf("makedev(%#x, %#x)", major(dev), minor(dev));
+
+ if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE)
+ tprints(" */");
+}
diff --git a/src/print_fields.h b/src/print_fields.h
new file mode 100644
index 000000000..bce41e24c
--- /dev/null
+++ b/src/print_fields.h
@@ -0,0 +1,472 @@
+/*
+ * Copyright (c) 2016-2017 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2017-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_PRINT_FIELDS_H
+# define STRACE_PRINT_FIELDS_H
+
+# include "static_assert.h"
+
+# ifdef IN_STRACE
+
+static inline void
+tprint_struct_begin(void)
+{
+ tprints("{");
+}
+
+static inline void
+tprint_struct_next(void)
+{
+ tprints(", ");
+}
+
+static inline void
+tprint_struct_end(void)
+{
+ tprints("}");
+}
+
+static inline void
+tprint_array_begin(void)
+{
+ tprints("[");
+}
+
+static inline void
+tprint_array_next(void)
+{
+ tprints(", ");
+}
+
+static inline void
+tprint_array_end(void)
+{
+ tprints("]");
+}
+
+static inline void
+tprint_more_data_follows(void)
+{
+ tprints("...");
+}
+
+static inline void
+tprint_value_changed(void)
+{
+ tprints(" => ");
+}
+
+/*
+ * The printf-like function to use in header files
+ * shared between strace and its tests.
+ */
+# define STRACE_PRINTF tprintf
+
+# else /* !IN_STRACE */
+
+# include <stdio.h>
+
+static inline void
+tprint_struct_begin(void)
+{
+ fputs("{", stdout);
+}
+
+static inline void
+tprint_struct_next(void)
+{
+ fputs(", ", stdout);
+}
+
+static inline void
+tprint_struct_end(void)
+{
+ fputs("}", stdout);
+}
+
+static inline void
+tprint_array_begin(void)
+{
+ fputs("[", stdout);
+}
+
+static inline void
+tprint_array_next(void)
+{
+ fputs(", ", stdout);
+}
+
+static inline void
+tprint_array_end(void)
+{
+ fputs("]", stdout);
+}
+
+static inline void
+tprint_more_data_follows(void)
+{
+ fputs("...", stdout);
+}
+
+static inline void
+tprint_value_changed(void)
+{
+ fputs(" => ", stdout);
+}
+
+/*
+ * The printf-like function to use in header files
+ * shared between strace and its tests.
+ */
+# define STRACE_PRINTF printf
+
+# endif /* !IN_STRACE */
+
+static inline void
+tprints_field_name(const char *name)
+{
+ STRACE_PRINTF("%s=", name);
+}
+
+# define PRINT_FIELD_D(where_, field_) \
+ do { \
+ tprints_field_name(#field_); \
+ STRACE_PRINTF("%lld", \
+ sign_extend_unsigned_to_ll((where_).field_)); \
+ } while (0)
+
+# define PRINT_FIELD_U(where_, field_) \
+ do { \
+ tprints_field_name(#field_); \
+ STRACE_PRINTF("%llu", \
+ zero_extend_signed_to_ull((where_).field_)); \
+ } while (0)
+
+# define PRINT_FIELD_U_CAST(where_, field_, type_) \
+ do { \
+ tprints_field_name(#field_); \
+ STRACE_PRINTF("%llu", \
+ zero_extend_signed_to_ull((type_)(where_).field_)); \
+ } while (0)
+
+# define PRINT_FIELD_X(where_, field_) \
+ do { \
+ tprints_field_name(#field_); \
+ STRACE_PRINTF("%#llx", \
+ zero_extend_signed_to_ull((where_).field_)); \
+ } while (0)
+
+# define PRINT_FIELD_X_CAST(where_, field_, type_) \
+ do { \
+ tprints_field_name(#field_); \
+ STRACE_PRINTF("%#llx", \
+ zero_extend_signed_to_ull((type_)(where_).field_)); \
+ } while (0)
+
+# define PRINT_FIELD_ADDR64(where_, field_) \
+ do { \
+ tprints_field_name(#field_); \
+ printaddr64((where_).field_); \
+ } while (0)
+
+# define PRINT_FIELD_0X(where_, field_) \
+ do { \
+ tprints_field_name(#field_); \
+ STRACE_PRINTF("%#0*llx", (int) sizeof((where_).field_) * 2, \
+ zero_extend_signed_to_ull((where_).field_)); \
+ } while (0)
+
+# define PRINT_FIELD_UINT_ARRAY(where_, field_, fmt_) \
+ do { \
+ tprints_field_name(#field_); \
+ for (size_t i_ = 0; i_ < ARRAY_SIZE((where_).field_); ++i_) \
+ STRACE_PRINTF("%s" fmt_, (i_ ? ", " : "["), \
+ zero_extend_signed_to_ull((where_).field_[i_]));\
+ STRACE_PRINTF("]"); \
+ } while (0)
+
+# define PRINT_FIELD_SINT_ARRAY(where_, field_, fmt_) \
+ do { \
+ tprints_field_name(#field_); \
+ for (size_t i_ = 0; i_ < ARRAY_SIZE((where_).field_); ++i_) \
+ STRACE_PRINTF("%s" fmt_, (i_ ? ", " : "["), \
+ sign_extend_unsigned_to_ll((where_).field_[i_]));\
+ STRACE_PRINTF("]"); \
+ } while (0)
+
+# define PRINT_FIELD_D_ARRAY(where_, field_) \
+ PRINT_FIELD_SINT_ARRAY((where_), field_, "%lld")
+
+# define PRINT_FIELD_U_ARRAY(where_, field_) \
+ PRINT_FIELD_UINT_ARRAY((where_), field_, "%llu")
+
+# define PRINT_FIELD_X_ARRAY(where_, field_) \
+ PRINT_FIELD_UINT_ARRAY((where_), field_, "%#llx")
+
+# define PRINT_FIELD_UINT_ARRAY2D(where_, field_, fmt_) \
+ do { \
+ tprints_field_name(#field_); \
+ for (size_t i_ = 0; i_ < ARRAY_SIZE((where_).field_); ++i_) { \
+ STRACE_PRINTF("%s", i_ ? ", " : "["); \
+ for (size_t j_ = 0; \
+ j_ < ARRAY_SIZE((where_).field_[i_]); \
+ ++j_) { \
+ STRACE_PRINTF("%s" fmt_, (j_ ? ", " : "["), \
+ zero_extend_signed_to_ull \
+ ((where_).field_[i_][j_])); \
+ } \
+ STRACE_PRINTF("]"); \
+ } \
+ STRACE_PRINTF("]"); \
+ } while (0)
+
+# define PRINT_FIELD_X_ARRAY2D(where_, field_) \
+ PRINT_FIELD_UINT_ARRAY2D((where_), field_, "%#llx")
+
+# define PRINT_FIELD_COOKIE(where_, field_) \
+ do { \
+ static_assert(ARRAY_SIZE((where_).field_) == 2, \
+ "unexpected array size"); \
+ PRINT_FIELD_U_ARRAY((where_), field_); \
+ } while (0)
+
+# define PRINT_FIELD_FLAGS(where_, field_, xlat_, dflt_) \
+ do { \
+ tprints_field_name(#field_); \
+ printflags64((xlat_), \
+ zero_extend_signed_to_ull((where_).field_),\
+ (dflt_)); \
+ } while (0)
+
+# define PRINT_FIELD_XVAL(where_, field_, xlat_, dflt_) \
+ do { \
+ tprints_field_name(#field_); \
+ printxval64((xlat_), \
+ zero_extend_signed_to_ull((where_).field_), \
+ (dflt_)); \
+ } while (0)
+
+# define PRINT_FIELD_XVAL_U(where_, field_, xlat_, dflt_) \
+ do { \
+ tprints_field_name(#field_); \
+ printxval64_u((xlat_), \
+ zero_extend_signed_to_ull((where_).field_), \
+ (dflt_)); \
+ } while (0)
+
+# define PRINT_FIELD_ERR_D(where_, field_) \
+ do { \
+ tprints_field_name(#field_); \
+ print_err(sign_extend_unsigned_to_ll((where_).field_), \
+ true); \
+ } while (0)
+
+# define PRINT_FIELD_ERR_U(where_, field_) \
+ do { \
+ tprints_field_name(#field_); \
+ print_err(zero_extend_signed_to_ull((where_).field_), \
+ false); \
+ } while (0)
+
+/*
+ * Generic "ID" printing. ID is considered unsigned except for the special value
+ * of -1.
+ */
+# define PRINT_FIELD_ID(where_, field_) \
+ do { \
+ tprints_field_name(#field_); \
+ if (sign_extend_unsigned_to_ll((where_).field_) == -1LL) \
+ STRACE_PRINTF("-1"); \
+ else \
+ STRACE_PRINTF("%llu", \
+ zero_extend_signed_to_ull((where_).field_)); \
+ } while (0)
+
+# define PRINT_FIELD_UUID(where_, field_) \
+ do { \
+ tprints_field_name(#field_); \
+ print_uuid((const unsigned char *) ((where_).field_)); \
+ } while (0)
+
+# define PRINT_FIELD_U64(where_, field_) \
+ do { \
+ tprints_field_name(#field_); \
+ if (zero_extend_signed_to_ull((where_).field_) == UINT64_MAX) \
+ print_xlat_u(UINT64_MAX); \
+ else \
+ STRACE_PRINTF("%llu", \
+ zero_extend_signed_to_ull((where_).field_)); \
+ } while (0)
+
+# define PRINT_FIELD_STRING(where_, field_, len_, style_) \
+ do { \
+ tprints_field_name(#field_); \
+ print_quoted_string((const char *)(where_).field_, \
+ (len_), (style_)); \
+ } while (0)
+
+# define PRINT_FIELD_CSTRING(where_, field_) \
+ do { \
+ tprints_field_name(#field_); \
+ print_quoted_cstring((const char *) (where_).field_, \
+ sizeof((where_).field_) + \
+ MUST_BE_ARRAY((where_).field_)); \
+ } while (0)
+
+# define PRINT_FIELD_CSTRING_SZ(where_, field_, size_) \
+ do { \
+ tprints_field_name(#field_); \
+ print_quoted_cstring((const char *) (where_).field_, \
+ (size_)); \
+ } while (0)
+
+# define PRINT_FIELD_ARRAY(where_, field_, tcp_, print_func_) \
+ do { \
+ tprints_field_name(#field_); \
+ print_local_array((tcp_), (where_).field_, \
+ (print_func_)); \
+ } while (0)
+
+# define PRINT_FIELD_ARRAY_UPTO(where_, field_, \
+ upto_, tcp_, print_func_) \
+ do { \
+ tprints_field_name(#field_); \
+ print_local_array_upto((tcp_), (where_).field_, \
+ (upto_), (print_func_)); \
+ } while (0)
+
+# define PRINT_FIELD_HEX_ARRAY(where_, field_) \
+ do { \
+ tprints_field_name(#field_); \
+ print_quoted_string((const char *)(where_).field_, \
+ sizeof((where_).field_) + \
+ MUST_BE_ARRAY((where_).field_), \
+ QUOTE_FORCE_HEX); \
+ } while (0)
+
+# define PRINT_FIELD_INET_ADDR(where_, field_, af_) \
+ print_inet_addr((af_), &(where_).field_, \
+ sizeof((where_).field_), #field_)
+
+# define PRINT_FIELD_NET_PORT(where_, field_) \
+ do { \
+ tprints_field_name(#field_); \
+ \
+ if (xlat_verbose(xlat_verbosity) != XLAT_STYLE_ABBREV) \
+ print_quoted_string((const char *) \
+ &(where_).field_, \
+ sizeof((where_).field_), \
+ QUOTE_FORCE_HEX); \
+ \
+ if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_RAW) \
+ break; \
+ \
+ if (xlat_verbose(xlat_verbosity) \
+ == XLAT_STYLE_VERBOSE) \
+ STRACE_PRINTF(" /* "); \
+ \
+ STRACE_PRINTF("htons(%u)", ntohs((where_).field_)); \
+ \
+ if (xlat_verbose(xlat_verbosity) \
+ == XLAT_STYLE_VERBOSE) \
+ STRACE_PRINTF(" */"); \
+ } while (0)
+
+# define PRINT_FIELD_IFINDEX(where_, field_) \
+ do { \
+ tprints_field_name(#field_); \
+ print_ifindex((where_).field_); \
+ } while (0)
+
+# define PRINT_FIELD_SOCKADDR(where_, field_, tcp_) \
+ do { \
+ tprints_field_name(#field_); \
+ print_sockaddr(tcp_, &(where_).field_, \
+ sizeof((where_).field_)); \
+ } while (0)
+
+# define PRINT_FIELD_DEV(where_, field_) \
+ do { \
+ tprints_field_name(#field_); \
+ print_dev_t((where_).field_); \
+ } while (0)
+
+# define PRINT_FIELD_PTR(where_, field_) \
+ do { \
+ tprints_field_name(#field_); \
+ printaddr((mpers_ptr_t) (where_).field_); \
+ } while (0)
+
+# define PRINT_FIELD_FD(where_, field_, tcp_) \
+ do { \
+ tprints_field_name(#field_); \
+ printfd((tcp_), (where_).field_); \
+ } while (0)
+
+# define PRINT_FIELD_TGID(where_, field_, tcp_) \
+ do { \
+ tprints_field_name(#field_); \
+ printpid((tcp_), (where_).field_, PT_TGID); \
+ } while (0)
+
+# define PRINT_FIELD_MAC(where_, field_) \
+ PRINT_FIELD_MAC_SZ((where_), field_, ARRAY_SIZE((where_).field_))
+
+# define PRINT_FIELD_MAC_SZ(where_, field_, size_) \
+ do { \
+ static_assert(sizeof(((where_).field_)[0]) == 1, \
+ "MAC address is not a byte array"); \
+ tprints_field_name(#field_); \
+ print_mac_addr("", (const uint8_t *) ((where_).field_), \
+ MIN((size_), ARRAY_SIZE((where_).field_))); \
+ } while (0)
+
+# define PRINT_FIELD_HWADDR_SZ(where_, field_, size_, hwtype_) \
+ do { \
+ static_assert(sizeof(((where_).field_)[0]) == 1, \
+ "hwaddress is not a byte array"); \
+ tprints_field_name(#field_); \
+ print_hwaddr("", (const uint8_t *) ((where_).field_), \
+ (size_), (hwtype_)); \
+ } while (0)
+
+# define PRINT_FIELD_OBJ_PTR(where_, field_, print_func_, ...) \
+ do { \
+ tprints_field_name(#field_); \
+ (print_func_)(&((where_).field_), ##__VA_ARGS__); \
+ } while (0)
+
+# define PRINT_FIELD_OBJ_TCB_PTR(where_, field_, \
+ tcp_, print_func_, ...) \
+ do { \
+ tprints_field_name(#field_); \
+ (print_func_)((tcp_), &((where_).field_), \
+ ##__VA_ARGS__); \
+ } while (0)
+
+# define PRINT_FIELD_OBJ_VAL(where_, field_, print_func_, ...) \
+ do { \
+ tprints_field_name(#field_); \
+ (print_func_)((where_).field_, ##__VA_ARGS__); \
+ } while (0)
+
+# define PRINT_FIELD_OBJ_U(where_, field_, print_func_, ...) \
+ do { \
+ tprints_field_name(#field_); \
+ (print_func_)(zero_extend_signed_to_ull((where_).field_),\
+ ##__VA_ARGS__); \
+ } while (0)
+
+# define PRINT_FIELD_OBJ_TCB_VAL(where_, field_, \
+ tcp_, print_func_, ...) \
+ do { \
+ tprints_field_name(#field_); \
+ (print_func_)((tcp_), (where_).field_, ##__VA_ARGS__); \
+ } while (0)
+
+#endif /* !STRACE_PRINT_FIELDS_H */
diff --git a/src/print_group_req.c b/src/print_group_req.c
new file mode 100644
index 000000000..f7602f2a4
--- /dev/null
+++ b/src/print_group_req.c
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2015-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include <netinet/in.h>
+
+#ifdef MCAST_JOIN_GROUP
+
+# include DEF_MPERS_TYPE(struct_group_req)
+typedef struct group_req struct_group_req;
+
+#endif /* MCAST_JOIN_GROUP */
+
+#include MPERS_DEFS
+
+#ifdef MCAST_JOIN_GROUP
+
+MPERS_PRINTER_DECL(void, print_group_req, struct tcb *const tcp,
+ const kernel_ulong_t addr, const int len)
+{
+ struct_group_req greq;
+
+ if (len < (int) sizeof(greq)) {
+ printaddr(addr);
+ } else if (!umove_or_printaddr(tcp, addr, &greq)) {
+ tprint_struct_begin();
+ PRINT_FIELD_IFINDEX(greq, gr_interface);
+ tprint_struct_next();
+ PRINT_FIELD_SOCKADDR(greq, gr_group, tcp);
+ tprint_struct_end();
+ }
+}
+
+#endif /* MCAST_JOIN_GROUP */
diff --git a/src/print_ifindex.c b/src/print_ifindex.c
new file mode 100644
index 000000000..b6e5470b3
--- /dev/null
+++ b/src/print_ifindex.c
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2001-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include <net/if.h>
+
+#ifdef HAVE_IF_INDEXTONAME
+# include "xstring.h"
+
+# define INI_PFX "if_nametoindex(\""
+# define INI_SFX "\")"
+# define IFNAME_QUOTED_SZ (sizeof(IFNAMSIZ) * 4 + 3)
+
+const char *
+get_ifname(const unsigned int ifindex)
+{
+ static char name_quoted_buf[IFNAME_QUOTED_SZ];
+ char name_buf[IFNAMSIZ];
+
+ if (!if_indextoname(ifindex, name_buf))
+ return NULL;
+
+ if (string_quote(name_buf, name_quoted_buf, sizeof(name_buf),
+ QUOTE_0_TERMINATED | QUOTE_OMIT_LEADING_TRAILING_QUOTES,
+ NULL))
+ return NULL;
+
+ return name_quoted_buf;
+}
+
+static const char *
+sprint_ifname(const unsigned int ifindex)
+{
+ static char res[IFNAME_QUOTED_SZ + sizeof(INI_PFX INI_SFX)];
+
+ const char *name_quoted = get_ifname(ifindex);
+
+ if (!name_quoted)
+ return NULL;
+
+ xsprintf(res, INI_PFX "%s" INI_SFX, name_quoted);
+
+ return res;
+}
+
+#else /* !HAVE_IF_INDEXTONAME */
+
+const char *get_ifname(const unsigned int ifindex) { return NULL; }
+
+#endif /* HAVE_IF_INDEXTONAME */
+
+void
+print_ifindex(const unsigned int ifindex)
+{
+#ifdef HAVE_IF_INDEXTONAME
+ print_xlat_ex(ifindex, sprint_ifname(ifindex), XLAT_STYLE_FMT_U);
+#else
+ tprintf("%u", ifindex);
+#endif
+}
diff --git a/src/print_instruction_pointer.c b/src/print_instruction_pointer.c
new file mode 100644
index 000000000..a25dc8f36
--- /dev/null
+++ b/src/print_instruction_pointer.c
@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 1999-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+void
+print_instruction_pointer(struct tcb *tcp)
+{
+ kernel_ulong_t ip;
+
+ if (get_instruction_pointer(tcp, &ip)) {
+ tprintf(current_wordsize == 4
+ ? "[%08" PRI_klx "] "
+ : "[%016" PRI_klx "] ", ip);
+ } else {
+ tprints(current_wordsize == 4
+ ? "[????????] "
+ : "[????????????????] ");
+ }
+}
diff --git a/src/print_kernel_sigset.c b/src/print_kernel_sigset.c
new file mode 100644
index 000000000..ee754dbea
--- /dev/null
+++ b/src/print_kernel_sigset.c
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#include DEF_MPERS_TYPE(struct_sigset_addr_size)
+
+typedef struct {
+ sigset_t *sigmask;
+ size_t sigsetsize;
+} struct_sigset_addr_size;
+
+#include MPERS_DEFS
+
+MPERS_PRINTER_DECL(void, print_kernel_sigset, struct tcb *tcp,
+ const kernel_ulong_t addr)
+{
+ struct_sigset_addr_size sas;
+
+ if (!umove_or_printaddr(tcp, addr, &sas)) {
+ tprint_struct_begin();
+ tprints_field_name("sigmask");
+ print_sigset_addr_len(tcp, (uintptr_t) sas.sigmask,
+ sas.sigsetsize);
+ tprint_struct_next();
+ PRINT_FIELD_U(sas, sigsetsize);
+ tprint_struct_end();
+ }
+}
diff --git a/src/print_kernel_version.c b/src/print_kernel_version.c
new file mode 100644
index 000000000..3c32d27b2
--- /dev/null
+++ b/src/print_kernel_version.c
@@ -0,0 +1,31 @@
+/*
+ * Kernel version printing routine.
+ *
+ * Copyright (c) 2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+void
+print_kernel_version(const unsigned long version)
+{
+ if (xlat_verbose(xlat_verbosity) != XLAT_STYLE_ABBREV)
+ tprintf("%#lx", version);
+
+ if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_RAW)
+ return;
+
+ if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE)
+ tprints(" /* ");
+
+ tprintf("KERNEL_VERSION(%lu, %lu, %lu)",
+ version >> 16,
+ (version >> 8) & 0xFF,
+ version & 0xFF);
+
+ if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE)
+ tprints(" */");
+}
diff --git a/src/print_mac.c b/src/print_mac.c
new file mode 100644
index 000000000..c5d5f5c44
--- /dev/null
+++ b/src/print_mac.c
@@ -0,0 +1,152 @@
+/*
+ * Copyright (c) 2018-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#include "error_prints.h"
+#include "xstring.h"
+
+#define XLAT_MACROS_ONLY
+# include "xlat/arp_hardware_types.h"
+#undef XLAT_MACROS_ONLY
+
+DIAG_PUSH_IGNORE_OVERRIDE_INIT
+
+static uint8_t hwaddr_sizes[] = {
+ [0 ... ARPHRD_VSOCKMON] = 255,
+
+ [ARPHRD_NETROM] = 7 /* AX25_ADDR_LEN */,
+ [ARPHRD_ETHER] = 6 /* ETH_ALEN */,
+ /* ARPHRD_EETHER - no actual devices in Linux */
+ [ARPHRD_AX25] = 7 /* AX25_ADDR_LEN */,
+ /* ARPHRD_PRONET - no actual devices in Linux */
+ /* ARPHRD_CHAOS - no actual devices in Linux */
+ [ARPHRD_IEEE802] = 6 /* FC_ALEN */,
+ [ARPHRD_ARCNET] = 1 /* ARCNET_ALEN */,
+ /* ARPHRD_APPLETLK - no actual devices in Linux */
+ [ARPHRD_DLCI] = sizeof(short),
+ /* ARPHRD_ATM - no explicit setting */
+ /* ARPHRD_METRICOM - no actual devices in Linux */
+ [ARPHRD_IEEE1394] = 16 /* FWNET_ALEN */,
+ [ARPHRD_EUI64] = 8 /* EUI64_ADDR_LEN */,
+ [ARPHRD_INFINIBAND] = 20 /* INFINIBAND_ALEN */,
+ [ARPHRD_SLIP] = 0,
+ /* ARPHRD_CSLIP - no actual devices in Linux */
+ /* ARPHRD_SLIP6 - no actual devices in Linux */
+ /* ARPHRD_CSLIP6 - no actual devices in Linux */
+ /* ARPHRD_RSRVD - no actual devices in Linux */
+ /* ARPHRD_ADAPT - no actual devices in Linux */
+ [ARPHRD_ROSE] = 5 /* ROSE_ADDR_LEN */,
+ [ARPHRD_X25] = 0,
+ /* ARPHRD_HWX25 - no actual devices in Linux */
+ [ARPHRD_CAN] = 0,
+ [ARPHRD_PPP] = 0,
+ /* ARPHRD_CISCO - no actual devices in Linux */
+ /* ARPHRD_LAPB - no actual devices in Linux */
+ /* ARPHRD_DDCMP - no actual devices in Linux */
+ [ARPHRD_RAWHDLC] = 0,
+ [ARPHRD_RAWIP] = 0,
+ [ARPHRD_TUNNEL] = 4 /* IPIP */,
+ [ARPHRD_TUNNEL6] = 16 /* sizeof(struct in6_addr) */,
+ /* ARPHRD_FRAD - no actual devices in Linux */
+ /* ARPHRD_SKIP - no actual devices in Linux */
+ [ARPHRD_LOOPBACK] = 6 /* ETH_ALEN */,
+ [ARPHRD_LOCALTLK] = 1 /* LTALK_ALEN */,
+ [ARPHRD_FDDI] = 6 /* FDDI_K_ALEN */,
+ /* ARPHRD_BIF - no actual devices in Linux */
+ [ARPHRD_SIT] = 4,
+ [ARPHRD_IPDDP] = 0,
+ [ARPHRD_IPGRE] = 4,
+ [ARPHRD_PIMREG] = 0,
+ [ARPHRD_HIPPI] = 6 /* HIPPI_ALEN */,
+ /* ARPHRD_ASH - no actual devices in Linux */
+ /* ARPHRD_ECONET - no actual devices in Linux */
+ [ARPHRD_IRDA] = 4 /* LAP_ALEN */,
+ /* ARPHRD_FCPP - no actual devices in Linux */
+ /* ARPHRD_FCAL - no actual devices in Linux */
+ /* ARPHRD_FCPL - no actual devices in Linux */
+ /* ARPHRD_FCFABRIC - no actual devices in Linux */
+ /* ARPHRD_IEEE802_TR - no actual devices in Linux */
+ [ARPHRD_IEEE80211] = 6 /* ETH_ALEN */,
+ [ARPHRD_IEEE80211_PRISM] = 6 /* ETH_ALEN */,
+ [ARPHRD_IEEE80211_RADIOTAP] = 6 /* ETH_ALEN */,
+ [ARPHRD_IEEE802154]
+ = 8 /* IEEE802154_EXTENDED_ADDR_LEN */,
+ [ARPHRD_IEEE802154_MONITOR]
+ = 8 /* IEEE802154_EXTENDED_ADDR_LEN */,
+ [ARPHRD_PHONET] = 1,
+ [ARPHRD_PHONET_PIPE] = 1,
+ [ARPHRD_CAIF] = 0,
+ [ARPHRD_IP6GRE] = 16 /* sizeof(struct in6_addr) */,
+ [ARPHRD_NETLINK] = 0,
+ [ARPHRD_6LOWPAN] = 8 /* EUI64_ADDR_LEN */
+ /* ^ or ETH_ALEN, depending on lltype */,
+ [ARPHRD_VSOCKMON] = 0,
+};
+
+DIAG_POP_IGNORE_OVERRIDE_INIT
+
+const char *
+sprint_mac_addr(const uint8_t addr[], size_t size)
+{
+ static char res[MAX_ADDR_LEN * 3];
+
+ if (size > MAX_ADDR_LEN) {
+ error_func_msg("Address size (%zu) is more than maximum "
+ "supported (%u)", size, MAX_ADDR_LEN);
+
+ return NULL;
+ }
+
+ char *ptr = res;
+
+ for (size_t i = 0; i < size; i++)
+ ptr = xappendstr(res, ptr, "%s%02x", i ? ":" : "", addr[i]);
+
+ return res;
+}
+
+void
+print_mac_addr(const char *prefix, const uint8_t addr[], size_t size)
+{
+ tprints(prefix);
+ if (xlat_verbose(xlat_verbosity) != XLAT_STYLE_ABBREV
+ || size > MAX_ADDR_LEN)
+ print_quoted_string((const char *) addr, size,
+ QUOTE_FORCE_HEX);
+ if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_RAW
+ || size > MAX_ADDR_LEN)
+ return;
+ (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE
+ ? tprints_comment : tprints)(sprint_mac_addr(addr, size));
+}
+
+const char *
+sprint_hwaddr(const uint8_t hwaddr[], size_t size, uint32_t devtype)
+{
+ uint8_t sz = (devtype < ARRAY_SIZE(hwaddr_sizes))
+ ? hwaddr_sizes[devtype] : 255;
+
+ return sprint_mac_addr(hwaddr, MIN(size, sz));
+}
+
+void
+print_hwaddr(const char *prefix, const uint8_t addr[], size_t size,
+ uint32_t devtype)
+{
+ tprints(prefix);
+ if (xlat_verbose(xlat_verbosity) != XLAT_STYLE_ABBREV
+ || size > MAX_ADDR_LEN)
+ print_quoted_string((const char *) addr, size,
+ QUOTE_FORCE_HEX);
+ if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_RAW
+ || size > MAX_ADDR_LEN)
+ return;
+ (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE
+ ? tprints_comment : tprints)(sprint_hwaddr(addr, size,
+ devtype));
+}
diff --git a/src/print_mq_attr.c b/src/print_mq_attr.c
new file mode 100644
index 000000000..6a0da15f7
--- /dev/null
+++ b/src/print_mq_attr.c
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2004 Ulrich Drepper <drepper@redhat.com>
+ * Copyright (c) 2005-2015 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#include DEF_MPERS_TYPE(mq_attr_t)
+
+#ifdef HAVE_MQUEUE_H
+# include <mqueue.h>
+typedef struct mq_attr mq_attr_t;
+#elif defined HAVE_LINUX_MQUEUE_H
+# include <linux/types.h>
+# include <linux/mqueue.h>
+typedef struct mq_attr mq_attr_t;
+#endif
+
+#include MPERS_DEFS
+
+#include "xlat/mq_attr_flags.h"
+
+MPERS_PRINTER_DECL(void, printmqattr, struct tcb *const tcp,
+ const kernel_ulong_t addr, const bool decode_flags)
+{
+#if defined HAVE_MQUEUE_H || defined HAVE_LINUX_MQUEUE_H
+ mq_attr_t attr;
+ if (umove_or_printaddr(tcp, addr, &attr))
+ return;
+ if (decode_flags) {
+ tprint_struct_begin();
+ PRINT_FIELD_FLAGS(attr, mq_flags, mq_attr_flags, "O_???");
+ } else {
+ tprint_struct_begin();
+ PRINT_FIELD_X(attr, mq_flags);
+ }
+ tprint_struct_next();
+ PRINT_FIELD_D(attr, mq_maxmsg);
+ tprint_struct_next();
+ PRINT_FIELD_D(attr, mq_msgsize);
+ tprint_struct_next();
+ PRINT_FIELD_D(attr, mq_curmsgs);
+ tprint_struct_end();
+#else
+ printaddr(addr);
+#endif
+}
diff --git a/src/print_msgbuf.c b/src/print_msgbuf.c
new file mode 100644
index 000000000..108fddff7
--- /dev/null
+++ b/src/print_msgbuf.c
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 1993 Ulrich Pegelow <pegelow@moorea.uni-muenster.de>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
+ * Copyright (c) 2003-2006 Roland McGrath <roland@redhat.com>
+ * Copyright (c) 2006-2015 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2015-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include "ipc_defs.h"
+
+#include MSG_H_PROVIDER
+
+#include DEF_MPERS_TYPE(msgbuf_t)
+typedef struct msgbuf msgbuf_t;
+#include MPERS_DEFS
+
+MPERS_PRINTER_DECL(void, tprint_msgbuf, struct tcb *const tcp,
+ const kernel_ulong_t addr, const kernel_ulong_t count)
+{
+ msgbuf_t msg;
+
+ if (!umove_or_printaddr(tcp, addr, &msg)) {
+ tprint_struct_begin();
+ PRINT_FIELD_D(msg, mtype);
+ tprint_struct_next();
+ tprints_field_name("mtext");
+ printstrn(tcp, addr + sizeof(msg.mtype), count);
+ tprint_struct_end();
+ }
+ tprintf(", %" PRI_klu ", ", count);
+}
diff --git a/src/print_sg_req_info.c b/src/print_sg_req_info.c
new file mode 100644
index 000000000..d4d61be57
--- /dev/null
+++ b/src/print_sg_req_info.c
@@ -0,0 +1,56 @@
+/*
+ * Decode struct sg_req_info.
+ *
+ * Copyright (c) 2017-2018 Dmitry V. Levin <ldv@strace.io>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#ifdef HAVE_SCSI_SG_H
+
+# include DEF_MPERS_TYPE(struct_sg_req_info)
+
+# include <scsi/sg.h>
+
+typedef struct sg_req_info struct_sg_req_info;
+
+#endif /* HAVE_SCSI_SG_H */
+
+#include MPERS_DEFS
+
+#ifdef HAVE_SCSI_SG_H
+
+MPERS_PRINTER_DECL(int, decode_sg_req_info,
+ struct tcb *const tcp, const kernel_ulong_t arg)
+{
+ struct_sg_req_info info;
+
+ if (entering(tcp))
+ return 0;
+
+ tprints(", ");
+ if (!umove_or_printaddr(tcp, arg, &info)) {
+ tprint_struct_begin();
+ PRINT_FIELD_D(info, req_state);
+ tprint_struct_next();
+ PRINT_FIELD_D(info, orphan);
+ tprint_struct_next();
+ PRINT_FIELD_D(info, sg_io_owned);
+ tprint_struct_next();
+ PRINT_FIELD_D(info, problem);
+ tprint_struct_next();
+ PRINT_FIELD_D(info, pack_id);
+ tprint_struct_next();
+ PRINT_FIELD_PTR(info, usr_ptr);
+ tprint_struct_next();
+ PRINT_FIELD_U(info, duration);
+ tprint_struct_end();
+ }
+
+ return RVAL_IOCTL_DECODED;
+}
+
+#endif /* HAVE_SCSI_SG_H */
diff --git a/src/print_sigevent.c b/src/print_sigevent.c
new file mode 100644
index 000000000..8ebb29b19
--- /dev/null
+++ b/src/print_sigevent.c
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2003, 2004 Ulrich Drepper <drepper@redhat.com>
+ * Copyright (c) 2005-2018 Dmitry V. Levin <ldv@strace.io>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#include DEF_MPERS_TYPE(struct_sigevent)
+#include "sigevent.h"
+#include MPERS_DEFS
+
+#include <signal.h>
+#include "xlat/sigev_value.h"
+
+static void
+print_sigev_value(const typeof_field(struct_sigevent, sigev_value) v)
+{
+ tprint_struct_begin();
+ PRINT_FIELD_D(v, sival_int);
+ tprint_struct_next();
+ PRINT_FIELD_PTR(v, sival_ptr);
+ tprint_struct_end();
+}
+
+MPERS_PRINTER_DECL(void, print_sigevent,
+ struct tcb *const tcp, const kernel_ulong_t addr)
+{
+ struct_sigevent sev;
+
+ if (umove_or_printaddr(tcp, addr, &sev))
+ return;
+
+ tprint_struct_begin();
+ if (sev.sigev_value.sival_ptr) {
+ PRINT_FIELD_OBJ_VAL(sev, sigev_value, print_sigev_value);
+ tprints(", ");
+ }
+
+ switch (sev.sigev_notify) {
+ case SIGEV_SIGNAL:
+ case SIGEV_THREAD:
+ case SIGEV_THREAD_ID:
+ PRINT_FIELD_OBJ_VAL(sev, sigev_signo, printsignal);
+ break;
+ default:
+ PRINT_FIELD_U(sev, sigev_signo);
+ }
+
+ tprint_struct_next();
+ PRINT_FIELD_XVAL(sev, sigev_notify, sigev_value, "SIGEV_???");
+
+ switch (sev.sigev_notify) {
+ case SIGEV_THREAD_ID:
+#undef sigev_notify_thread_id
+#define sigev_notify_thread_id sigev_un.tid
+ tprint_struct_next();
+ PRINT_FIELD_D(sev, sigev_notify_thread_id);
+ break;
+ case SIGEV_THREAD:
+#undef sigev_notify_function
+#define sigev_notify_function sigev_un.sigev_thread.function
+ tprint_struct_next();
+ PRINT_FIELD_PTR(sev, sigev_notify_function);
+#undef sigev_notify_attributes
+#define sigev_notify_attributes sigev_un.sigev_thread.attribute
+ tprint_struct_next();
+ PRINT_FIELD_PTR(sev, sigev_notify_attributes);
+ break;
+ }
+ tprint_struct_end();
+}
diff --git a/src/print_statfs.c b/src/print_statfs.c
new file mode 100644
index 000000000..4474df246
--- /dev/null
+++ b/src/print_statfs.c
@@ -0,0 +1,118 @@
+/*
+ * Copyright (c) 2014-2018 Dmitry V. Levin <ldv@strace.io>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include "statfs.h"
+#include "xlat/fsmagic.h"
+#include "xlat/statfs_flags.h"
+
+#if defined HAVE_STRUCT_STATFS_F_FSID_VAL \
+ || defined HAVE_STRUCT_STATFS_F_FSID___VAL \
+ || defined HAVE_STRUCT_STATFS64_F_FSID_VAL \
+ || defined HAVE_STRUCT_STATFS64_F_FSID___VAL
+static void
+print_f_fsid(const typeof_field(struct strace_statfs, f_fsid) *const p,
+ struct tcb *const tcp)
+{
+ tprint_struct_begin();
+ PRINT_FIELD_ARRAY(*p, val, tcp, print_xint64_array_member);
+ tprint_struct_end();
+}
+#endif
+
+void
+print_struct_statfs(struct tcb *const tcp, const kernel_ulong_t addr)
+{
+#ifdef HAVE_STRUCT_STATFS
+ struct strace_statfs b;
+
+ if (!fetch_struct_statfs(tcp, addr, &b))
+ return;
+
+ tprint_struct_begin();
+ PRINT_FIELD_XVAL(b, f_type, fsmagic, NULL);
+ tprint_struct_next();
+ PRINT_FIELD_U(b, f_bsize);
+ tprint_struct_next();
+ PRINT_FIELD_U(b, f_blocks);
+ tprint_struct_next();
+ PRINT_FIELD_U(b, f_bfree);
+ tprint_struct_next();
+ PRINT_FIELD_U(b, f_bavail);
+ tprint_struct_next();
+ PRINT_FIELD_U(b, f_files);
+ tprint_struct_next();
+ PRINT_FIELD_U(b, f_ffree);
+# if defined HAVE_STRUCT_STATFS_F_FSID_VAL \
+ || defined HAVE_STRUCT_STATFS_F_FSID___VAL
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_PTR(b, f_fsid, print_f_fsid, tcp);
+# endif
+ tprint_struct_next();
+ PRINT_FIELD_U(b, f_namelen);
+# ifdef HAVE_STRUCT_STATFS_F_FRSIZE
+ tprint_struct_next();
+ PRINT_FIELD_U(b, f_frsize);
+# endif
+# ifdef HAVE_STRUCT_STATFS_F_FLAGS
+ if (b.f_flags & ST_VALID) {
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(b, f_flags, statfs_flags, "ST_???");
+ }
+# endif
+ tprint_struct_end();
+#else
+ printaddr(addr);
+#endif
+}
+
+void
+print_struct_statfs64(struct tcb *const tcp, const kernel_ulong_t addr,
+ const kernel_ulong_t size)
+{
+#ifdef HAVE_STRUCT_STATFS64
+ struct strace_statfs b;
+
+ if (!fetch_struct_statfs64(tcp, addr, size, &b))
+ return;
+
+ tprint_struct_begin();
+ PRINT_FIELD_XVAL(b, f_type, fsmagic, NULL);
+ tprint_struct_next();
+ PRINT_FIELD_U(b, f_bsize);
+ tprint_struct_next();
+ PRINT_FIELD_U(b, f_blocks);
+ tprint_struct_next();
+ PRINT_FIELD_U(b, f_bfree);
+ tprint_struct_next();
+ PRINT_FIELD_U(b, f_bavail);
+ tprint_struct_next();
+ PRINT_FIELD_U(b, f_files);
+ tprint_struct_next();
+ PRINT_FIELD_U(b, f_ffree);
+# if defined HAVE_STRUCT_STATFS64_F_FSID_VAL \
+ || defined HAVE_STRUCT_STATFS64_F_FSID___VAL
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_PTR(b, f_fsid, print_f_fsid, tcp);
+# endif
+ tprint_struct_next();
+ PRINT_FIELD_U(b, f_namelen);
+# ifdef HAVE_STRUCT_STATFS64_F_FRSIZE
+ tprint_struct_next();
+ PRINT_FIELD_U(b, f_frsize);
+# endif
+# ifdef HAVE_STRUCT_STATFS64_F_FLAGS
+ if (b.f_flags & ST_VALID) {
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(b, f_flags, statfs_flags, "ST_???");
+ }
+# endif
+ tprint_struct_end();
+#else
+ printaddr(addr);
+#endif
+}
diff --git a/src/print_struct_stat.c b/src/print_struct_stat.c
new file mode 100644
index 000000000..2abb0621e
--- /dev/null
+++ b/src/print_struct_stat.c
@@ -0,0 +1,143 @@
+/*
+ * Copyright (c) 1999-2003 Ulrich Drepper <drepper@redhat.com>
+ * Copyright (c) 2004 David S. Miller <davem@nuts.davemloft.net>
+ * Copyright (c) 2003-2005 Roland McGrath <roland@redhat.com>
+ * Copyright (c) 2007 Jan Kratochvil <jan.kratochvil@redhat.com>
+ * Copyright (c) 2009 Denys Vlasenko <dvlasenk@redhat.com>
+ * Copyright (c) 2009-2010 Andreas Schwab <schwab@linux-m68k.org>
+ * Copyright (c) 2012 H.J. Lu <hongjiu.lu@intel.com>
+ * Copyright (c) 2005-2016 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2016-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include <sys/stat.h>
+#include "stat.h"
+
+/*
+ * This series of #undef/#define was produced by the following script:
+ * sed -n 's/.*[[:space:]]\([[:alpha:]_]\+\);$/\1/p' stat.h |
+ * while read n; do
+ * printf '#undef st_%s\n#define st_%s %s\n\n' "$n" "$n" "$n"
+ * done
+ */
+
+#undef st_dev
+#define st_dev dev
+
+#undef st_ino
+#define st_ino ino
+
+#undef st_rdev
+#define st_rdev rdev
+
+#undef st_size
+#define st_size size
+
+#undef st_blocks
+#define st_blocks blocks
+
+#undef st_blksize
+#define st_blksize blksize
+
+#undef st_mode
+#define st_mode mode
+
+#undef st_nlink
+#define st_nlink nlink
+
+#undef st_uid
+#define st_uid uid
+
+#undef st_gid
+#define st_gid gid
+
+#undef st_atime
+#define st_atime atime
+
+#undef st_ctime
+#define st_ctime ctime
+
+#undef st_mtime
+#define st_mtime mtime
+
+#undef st_atime_nsec
+#define st_atime_nsec atime_nsec
+
+#undef st_ctime_nsec
+#define st_ctime_nsec ctime_nsec
+
+#undef st_mtime_nsec
+#define st_mtime_nsec mtime_nsec
+
+void
+print_struct_stat(struct tcb *tcp, const struct strace_stat *const st)
+{
+ tprint_struct_begin();
+ if (!abbrev(tcp)) {
+ PRINT_FIELD_DEV(*st, st_dev);
+ tprint_struct_next();
+ PRINT_FIELD_U(*st, st_ino);
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_VAL(*st, st_mode, print_symbolic_mode_t);
+ tprint_struct_next();
+ PRINT_FIELD_U(*st, st_nlink);
+ tprint_struct_next();
+ PRINT_FIELD_U(*st, st_uid);
+ tprint_struct_next();
+ PRINT_FIELD_U(*st, st_gid);
+ tprint_struct_next();
+ PRINT_FIELD_U(*st, st_blksize);
+ tprint_struct_next();
+ PRINT_FIELD_U(*st, st_blocks);
+ } else {
+ PRINT_FIELD_OBJ_VAL(*st, st_mode, print_symbolic_mode_t);
+ }
+
+ switch (st->st_mode & S_IFMT) {
+ case S_IFCHR: case S_IFBLK:
+ tprint_struct_next();
+ PRINT_FIELD_DEV(*st, st_rdev);
+ break;
+ default:
+ tprint_struct_next();
+ PRINT_FIELD_U(*st, st_size);
+ break;
+ }
+
+ if (!abbrev(tcp)) {
+ tprint_struct_next();
+ PRINT_FIELD_D(*st, st_atime);
+ tprints_comment(sprinttime_nsec(st->st_atime,
+ st->st_atime_nsec));
+ if (st->has_nsec) {
+ tprint_struct_next();
+ PRINT_FIELD_U(*st, st_atime_nsec);
+ }
+
+ tprint_struct_next();
+ PRINT_FIELD_D(*st, st_mtime);
+ tprints_comment(sprinttime_nsec(st->st_mtime,
+ st->st_mtime_nsec));
+ if (st->has_nsec) {
+ tprint_struct_next();
+ PRINT_FIELD_U(*st, st_mtime_nsec);
+ }
+
+ tprint_struct_next();
+ PRINT_FIELD_D(*st, st_ctime);
+ tprints_comment(sprinttime_nsec(st->st_ctime,
+ st->st_ctime_nsec));
+ if (st->has_nsec) {
+ tprint_struct_next();
+ PRINT_FIELD_U(*st, st_ctime_nsec);
+ }
+ } else {
+ tprint_struct_next();
+ tprint_more_data_follows();
+ }
+ tprint_struct_end();
+}
diff --git a/src/print_syscall_number.c b/src/print_syscall_number.c
new file mode 100644
index 000000000..5eaef4937
--- /dev/null
+++ b/src/print_syscall_number.c
@@ -0,0 +1,18 @@
+/*
+ * Copyright (c) 2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+void
+print_syscall_number(struct tcb *tcp)
+{
+ if (tcp->true_scno != (kernel_ulong_t) -1) {
+ tprintf("[%4" PRI_klu "] ", tcp->true_scno);
+ } else {
+ tprints("[????] ");
+ }
+}
diff --git a/src/print_time.c b/src/print_time.c
new file mode 100644
index 000000000..061fa6b56
--- /dev/null
+++ b/src/print_time.c
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2015-2016 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#include DEF_MPERS_TYPE(time_t)
+
+#include MPERS_DEFS
+
+SYS_FUNC(time)
+{
+ if (exiting(tcp)) {
+ time_t t;
+
+ if (!umove_or_printaddr(tcp, tcp->u_arg[0], &t)) {
+ tprintf("[%lld", (long long) t);
+ tprints_comment(sprinttime(t));
+ tprints("]");
+ }
+
+ if (!syserror(tcp)) {
+ tcp->auxstr = sprinttime((time_t) tcp->u_rval);
+
+ return RVAL_STR;
+ }
+ }
+
+ return 0;
+}
diff --git a/src/print_timespec.h b/src/print_timespec.h
new file mode 100644
index 000000000..806b06884
--- /dev/null
+++ b/src/print_timespec.h
@@ -0,0 +1,177 @@
+/*
+ * Copyright (c) 2015-2016 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2016-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "xstring.h"
+
+#ifndef TIMESPEC_NSEC
+# define TIMESPEC_NSEC tv_nsec
+#endif
+
+#ifndef UTIME_NOW
+# define UTIME_NOW ((1l << 30) - 1l)
+#endif
+#ifndef UTIME_OMIT
+# define UTIME_OMIT ((1l << 30) - 2l)
+#endif
+
+#define TIMESPEC_TO_SEC_NSEC(t_) \
+ ((long long) (t_)->tv_sec), \
+ zero_extend_signed_to_ull((t_)->TIMESPEC_NSEC)
+
+static const char timespec_fmt[] =
+ "{tv_sec=%lld, " STRINGIFY_VAL(TIMESPEC_NSEC) "=%llu}";
+
+static void
+print_sec_nsec(long long sec, unsigned long long nsec)
+{
+ tprintf(timespec_fmt, sec, nsec);
+}
+
+static void
+print_timespec_t(const TIMESPEC_T *t)
+{
+ print_sec_nsec(TIMESPEC_TO_SEC_NSEC(t));
+}
+
+#if defined PRINT_TIMESPEC_DATA_SIZE || defined PRINT_TIMESPEC_ARRAY_DATA_SIZE
+static void
+print_unaligned_timespec_t(const void *arg)
+{
+ TIMESPEC_T t;
+ memcpy(&t, arg, sizeof(t));
+ print_timespec_t(&t);
+}
+#endif /* PRINT_TIMESPEC_DATA_SIZE || PRINT_TIMESPEC_ARRAY_DATA_SIZE */
+
+#ifdef PRINT_TIMESPEC_DATA_SIZE
+bool
+PRINT_TIMESPEC_DATA_SIZE(const void *arg, const size_t size)
+{
+ if (size < sizeof(TIMESPEC_T)) {
+ tprints("?");
+ return false;
+ }
+
+ print_unaligned_timespec_t(arg);
+ return true;
+}
+#endif /* PRINT_TIMESPEC_DATA_SIZE */
+
+#ifdef PRINT_TIMESPEC_ARRAY_DATA_SIZE
+bool
+PRINT_TIMESPEC_ARRAY_DATA_SIZE(const void *arg, const unsigned int nmemb,
+ const size_t size)
+{
+ if (nmemb > size / sizeof(TIMESPEC_T)) {
+ tprints("?");
+ return false;
+ }
+
+ tprints("[");
+
+ for (unsigned int i = 0; i < nmemb; i++, arg += sizeof(TIMESPEC_T)) {
+ if (i)
+ tprints(", ");
+ print_unaligned_timespec_t(arg);
+ }
+
+ tprints("]");
+ return true;
+}
+#endif /* PRINT_TIMESPEC_ARRAY_DATA_SIZE */
+
+#ifdef PRINT_TIMESPEC
+int
+PRINT_TIMESPEC(struct tcb *const tcp, const kernel_ulong_t addr)
+{
+ TIMESPEC_T t;
+
+ if (umove_or_printaddr(tcp, addr, &t))
+ return -1;
+
+ print_timespec_t(&t);
+ return 0;
+}
+#endif /* PRINT_TIMESPEC */
+
+#ifdef SPRINT_TIMESPEC
+const char *
+SPRINT_TIMESPEC(struct tcb *const tcp, const kernel_ulong_t addr)
+{
+ TIMESPEC_T t;
+ static char buf[sizeof(timespec_fmt) + 3 * sizeof(t)];
+
+ if (!addr) {
+ strcpy(buf, "NULL");
+ } else if (!verbose(tcp) || (exiting(tcp) && syserror(tcp)) ||
+ umove(tcp, addr, &t)) {
+ xsprintf(buf, "%#" PRI_klx, addr);
+ } else {
+ xsprintf(buf, timespec_fmt, TIMESPEC_TO_SEC_NSEC(&t));
+ }
+
+ return buf;
+}
+#endif /* SPRINT_TIMESPEC */
+
+#ifdef PRINT_TIMESPEC_UTIME_PAIR
+static bool
+print_timespec_t_utime(struct tcb *tcp, void *elem_buf, size_t elem_size,
+ void *data)
+{
+ const TIMESPEC_T *const t = elem_buf;
+ switch (t->TIMESPEC_NSEC) {
+ case UTIME_NOW:
+ case UTIME_OMIT:
+ if (xlat_verbose(xlat_verbosity) != XLAT_STYLE_ABBREV)
+ print_timespec_t(t);
+ if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_RAW)
+ break;
+
+ (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE
+ ? tprints_comment : tprints)(t->TIMESPEC_NSEC == UTIME_NOW
+ ? "UTIME_NOW" : "UTIME_OMIT");
+ break;
+ default:
+ print_timespec_t(t);
+ tprints_comment(sprinttime_nsec(TIMESPEC_TO_SEC_NSEC(t)));
+ break;
+ }
+ return true;
+}
+
+int
+PRINT_TIMESPEC_UTIME_PAIR(struct tcb *const tcp, const kernel_ulong_t addr)
+{
+ TIMESPEC_T t[2];
+
+ if (umove_or_printaddr(tcp, addr, &t))
+ return -1;
+
+ print_local_array(tcp, t, print_timespec_t_utime);
+ return 0;
+}
+#endif /* PRINT_TIMESPEC_UTIME_PAIR */
+
+#ifdef PRINT_ITIMERSPEC
+int
+PRINT_ITIMERSPEC(struct tcb *const tcp, const kernel_ulong_t addr)
+{
+ struct { TIMESPEC_T it_interval, it_value; } t;
+
+ if (umove_or_printaddr(tcp, addr, &t))
+ return -1;
+
+ tprint_struct_begin();
+ PRINT_FIELD_OBJ_PTR(t, it_interval, print_timespec_t);
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_PTR(t, it_value, print_timespec_t);
+ tprint_struct_end();
+ return 0;
+}
+#endif /* PRINT_ITIMERSPEC */
diff --git a/src/print_timespec32.c b/src/print_timespec32.c
new file mode 100644
index 000000000..ef74fa296
--- /dev/null
+++ b/src/print_timespec32.c
@@ -0,0 +1,25 @@
+/*
+ * Copyright (c) 2019-2020 Dmitry V. Levin <ldv@strace.io>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#if HAVE_ARCH_TIME32_SYSCALLS || HAVE_ARCH_TIMESPEC32
+
+# define TIMESPEC_T kernel_timespec32_t
+# define PRINT_TIMESPEC_DATA_SIZE print_timespec32_data_size
+# define PRINT_TIMESPEC_ARRAY_DATA_SIZE print_timespec32_array_data_size
+# if HAVE_ARCH_TIME32_SYSCALLS
+# define PRINT_TIMESPEC print_timespec32
+# define SPRINT_TIMESPEC sprint_timespec32
+# define PRINT_TIMESPEC_UTIME_PAIR print_timespec32_utime_pair
+# define PRINT_ITIMERSPEC print_itimerspec32
+# endif /* HAVE_ARCH_TIME32_SYSCALLS */
+
+# include "kernel_timespec.h"
+# include "print_timespec.h"
+
+#endif /* HAVE_ARCH_TIME32_SYSCALLS || HAVE_ARCH_TIMESPEC32 */
diff --git a/src/print_timespec64.c b/src/print_timespec64.c
new file mode 100644
index 000000000..04fa7eeb5
--- /dev/null
+++ b/src/print_timespec64.c
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2019 Dmitry V. Levin <ldv@strace.io>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#define TIMESPEC_T kernel_timespec64_t
+#define PRINT_TIMESPEC_DATA_SIZE print_timespec64_data_size
+#define PRINT_TIMESPEC_ARRAY_DATA_SIZE print_timespec64_array_data_size
+#define PRINT_TIMESPEC print_timespec64
+#define SPRINT_TIMESPEC sprint_timespec64
+#define PRINT_TIMESPEC_UTIME_PAIR print_timespec64_utime_pair
+#define PRINT_ITIMERSPEC print_itimerspec64
+
+#include "kernel_timespec.h"
+#include "print_timespec.h"
diff --git a/src/print_timeval.c b/src/print_timeval.c
new file mode 100644
index 000000000..380aed6a7
--- /dev/null
+++ b/src/print_timeval.c
@@ -0,0 +1,198 @@
+/*
+ * Copyright (c) 2015-2017 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2016-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#include DEF_MPERS_TYPE(timeval_t)
+
+#include "kernel_timeval.h"
+
+typedef kernel_old_timeval_t timeval_t;
+
+#include MPERS_DEFS
+
+#include "xstring.h"
+
+static const char timeval_fmt[] = "{tv_sec=%lld, tv_usec=%llu}";
+
+static void
+print_timeval_t(const timeval_t *t)
+{
+ tprintf(timeval_fmt, (long long) t->tv_sec,
+ zero_extend_signed_to_ull(t->tv_usec));
+}
+
+static bool
+print_timeval_t_utime(struct tcb *tcp, void *elem_buf, size_t elem_size,
+ void *data)
+{
+ const timeval_t *const t = elem_buf;
+ print_timeval_t(t);
+ tprints_comment(sprinttime_usec(t->tv_sec,
+ zero_extend_signed_to_ull(t->tv_usec)));
+ return true;
+}
+
+MPERS_PRINTER_DECL(void, print_struct_timeval, const void *arg)
+{
+ print_timeval_t(arg);
+}
+
+MPERS_PRINTER_DECL(bool, print_struct_timeval_data_size,
+ const void *arg, const size_t size)
+{
+ if (size < sizeof(timeval_t)) {
+ tprints("?");
+ return false;
+ }
+
+ print_timeval_t(arg);
+ return true;
+}
+
+MPERS_PRINTER_DECL(int, print_timeval,
+ struct tcb *const tcp, const kernel_ulong_t addr)
+{
+ timeval_t t;
+
+ if (umove_or_printaddr(tcp, addr, &t))
+ return -1;
+
+ print_timeval_t(&t);
+ return 0;
+}
+
+MPERS_PRINTER_DECL(int, print_timeval_utimes,
+ struct tcb *const tcp, const kernel_ulong_t addr)
+{
+ timeval_t t[2];
+
+ if (umove_or_printaddr(tcp, addr, &t))
+ return -1;
+
+ print_local_array(tcp, t, print_timeval_t_utime);
+ return 0;
+}
+
+MPERS_PRINTER_DECL(const char *, sprint_timeval,
+ struct tcb *const tcp, const kernel_ulong_t addr)
+{
+ timeval_t t;
+ static char buf[sizeof(timeval_fmt) + 3 * sizeof(t)];
+
+ if (!addr) {
+ strcpy(buf, "NULL");
+ } else if (!verbose(tcp) || (exiting(tcp) && syserror(tcp)) ||
+ umove(tcp, addr, &t)) {
+ xsprintf(buf, "%#" PRI_klx, addr);
+ } else {
+ xsprintf(buf, timeval_fmt,
+ (long long) t.tv_sec,
+ zero_extend_signed_to_ull(t.tv_usec));
+ }
+
+ return buf;
+}
+
+MPERS_PRINTER_DECL(int, print_itimerval,
+ struct tcb *const tcp, const kernel_ulong_t addr)
+{
+ struct { timeval_t it_interval, it_value; } t;
+
+ if (umove_or_printaddr(tcp, addr, &t))
+ return -1;
+
+ tprint_struct_begin();
+ PRINT_FIELD_OBJ_PTR(t, it_interval, print_timeval_t);
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_PTR(t, it_value, print_timeval_t);
+ tprint_struct_end();
+ return 0;
+}
+
+#ifdef ALPHA
+
+void
+print_timeval32_t(const timeval32_t *t)
+{
+ tprintf(timeval_fmt, (long long) t->tv_sec,
+ zero_extend_signed_to_ull(t->tv_usec));
+}
+
+static bool
+print_timeval32_t_utime(struct tcb *tcp, void *elem_buf, size_t elem_size,
+ void *data)
+{
+ const timeval32_t *const t = elem_buf;
+ print_timeval32_t(t);
+ tprints_comment(sprinttime_usec(t->tv_sec,
+ zero_extend_signed_to_ull(t->tv_usec)));
+ return true;
+}
+
+int
+print_timeval32(struct tcb *const tcp, const kernel_ulong_t addr)
+{
+ timeval32_t t;
+
+ if (umove_or_printaddr(tcp, addr, &t))
+ return -1;
+
+ print_timeval32_t(&t);
+ return 0;
+}
+
+int
+print_timeval32_utimes(struct tcb *const tcp, const kernel_ulong_t addr)
+{
+ timeval32_t t[2];
+
+ if (umove_or_printaddr(tcp, addr, &t))
+ return -1;
+
+ print_local_array(tcp, t, print_timeval32_t_utime);
+ return 0;
+}
+
+int
+print_itimerval32(struct tcb *const tcp, const kernel_ulong_t addr)
+{
+ struct { timeval32_t it_interval, it_value; } t;
+
+ if (umove_or_printaddr(tcp, addr, &t))
+ return -1;
+
+ tprint_struct_begin();
+ PRINT_FIELD_OBJ_PTR(t, it_interval, print_timeval32_t);
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_PTR(t, it_value, print_timeval32_t);
+ tprint_struct_end();
+ return 0;
+}
+
+const char *
+sprint_timeval32(struct tcb *const tcp, const kernel_ulong_t addr)
+{
+ timeval32_t t;
+ static char buf[sizeof(timeval_fmt) + 3 * sizeof(t)];
+
+ if (!addr) {
+ strcpy(buf, "NULL");
+ } else if (!verbose(tcp) || (exiting(tcp) && syserror(tcp)) ||
+ umove(tcp, addr, &t)) {
+ xsprintf(buf, "%#" PRI_klx, addr);
+ } else {
+ xsprintf(buf, timeval_fmt,
+ (long long) t.tv_sec,
+ zero_extend_signed_to_ull(t.tv_usec));
+ }
+
+ return buf;
+}
+
+#endif /* ALPHA */
diff --git a/src/print_timeval64.c b/src/print_timeval64.c
new file mode 100644
index 000000000..faa8dd7bd
--- /dev/null
+++ b/src/print_timeval64.c
@@ -0,0 +1,15 @@
+/*
+ * Copyright (c) 2019 Dmitry V. Levin <ldv@strace.io>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#define TIMESPEC_T kernel_timeval64_t
+#define TIMESPEC_NSEC tv_usec
+#define PRINT_TIMESPEC_DATA_SIZE print_timeval64_data_size
+
+#include "kernel_timeval.h"
+#include "print_timespec.h"
diff --git a/src/print_timex.c b/src/print_timex.c
new file mode 100644
index 000000000..63fba4e2e
--- /dev/null
+++ b/src/print_timex.c
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 2006-2015 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2015-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include "kernel_timex.h"
+#include <sys/timex.h>
+
+#include "xlat/adjtimex_modes.h"
+#include "xlat/adjtimex_status.h"
+
+
+#define PRINT_TIMEX print_timex64
+#define PRINT_TIMEX_TIME print_timex64_time
+#define TIMEX_T kernel_timex64_t
+#include "print_timex.h"
+#undef TIMEX_T
+#undef PRINT_TIMEX_TIME
+#undef PRINT_TIMEX
+
+#if HAVE_ARCH_TIME32_SYSCALLS
+
+# define PRINT_TIMEX print_timex32
+# define PRINT_TIMEX_TIME print_timex32_time
+# define TIMEX_T kernel_timex32_t
+# include "print_timex.h"
+# undef TIMEX_T
+#undef PRINT_TIMEX_TIME
+# undef PRINT_TIMEX
+
+#endif /* HAVE_ARCH_TIME32_SYSCALLS */
+
+#ifdef SPARC64
+
+# define PRINT_TIMEX print_sparc64_timex
+# define PRINT_TIMEX_TIME print_sparc64_timex_time
+# define TIMEX_T kernel_sparc64_timex_t
+# include "print_timex.h"
+# undef TIMEX_T
+#undef PRINT_TIMEX_TIME
+# undef PRINT_TIMEX
+
+#endif /* SPARC64 */
diff --git a/src/print_timex.h b/src/print_timex.h
new file mode 100644
index 000000000..5af06f917
--- /dev/null
+++ b/src/print_timex.h
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 2006-2015 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2015-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+static void
+PRINT_TIMEX_TIME(const typeof_field(TIMEX_T, time) *const p)
+{
+ tprint_struct_begin();
+ PRINT_FIELD_D(*p, tv_sec);
+ tprint_struct_next();
+ PRINT_FIELD_U(*p, tv_usec);
+ tprint_struct_end();
+}
+
+int
+PRINT_TIMEX(struct tcb *const tcp, const kernel_ulong_t addr)
+{
+ TIMEX_T tx;
+
+ if (umove_or_printaddr(tcp, addr, &tx))
+ return -1;
+
+ tprint_struct_begin();
+ PRINT_FIELD_FLAGS(tx, modes, adjtimex_modes, "ADJ_???");
+ tprint_struct_next();
+ PRINT_FIELD_D(tx, offset);
+ tprint_struct_next();
+ PRINT_FIELD_D(tx, freq);
+ tprint_struct_next();
+ PRINT_FIELD_D(tx, maxerror);
+ tprint_struct_next();
+ PRINT_FIELD_D(tx, esterror);
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(tx, status, adjtimex_status, "STA_???");
+ tprint_struct_next();
+ PRINT_FIELD_D(tx, constant);
+ tprint_struct_next();
+ PRINT_FIELD_D(tx, precision);
+ tprint_struct_next();
+ PRINT_FIELD_D(tx, tolerance);
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_PTR(tx, time, PRINT_TIMEX_TIME);
+ tprint_struct_next();
+ PRINT_FIELD_D(tx, tick);
+ tprint_struct_next();
+ PRINT_FIELD_D(tx, ppsfreq);
+ tprint_struct_next();
+ PRINT_FIELD_D(tx, jitter);
+ tprint_struct_next();
+ PRINT_FIELD_D(tx, shift);
+ tprint_struct_next();
+ PRINT_FIELD_D(tx, stabil);
+ tprint_struct_next();
+ PRINT_FIELD_D(tx, jitcnt);
+ tprint_struct_next();
+ PRINT_FIELD_D(tx, calcnt);
+ tprint_struct_next();
+ PRINT_FIELD_D(tx, errcnt);
+ tprint_struct_next();
+ PRINT_FIELD_D(tx, stbcnt);
+ tprint_struct_next();
+ PRINT_FIELD_D(tx, tai);
+ tprint_struct_end();
+ return 0;
+}
diff --git a/src/print_utils.h b/src/print_utils.h
new file mode 100644
index 000000000..519cd4017
--- /dev/null
+++ b/src/print_utils.h
@@ -0,0 +1,39 @@
+#ifndef STRACE_PRINT_UTILS_H
+# define STRACE_PRINT_UTILS_H
+
+# include <inttypes.h>
+
+/* Hexadecimal output utils */
+
+static const char hex_chars[16] = "0123456789abcdef";
+
+/**
+ * Character array representing hexadecimal encoding of a character value.
+ *
+ * @param b_ Byte to provide representation for.
+ */
+# define BYTE_HEX_CHARS(b_) \
+ hex_chars[((uint8_t) (b_)) >> 4], hex_chars[((uint8_t) (b_)) & 0xf]
+# define BYTE_HEX_CHARS_PRINTF(b_) \
+ '\\', 'x', BYTE_HEX_CHARS(b_)
+# define BYTE_HEX_CHARS_PRINTF_QUOTED(b_) \
+ '\'', BYTE_HEX_CHARS_PRINTF(b_), '\''
+
+static inline char *
+sprint_byte_hex(char *buf, uint8_t val)
+{
+ *buf++ = hex_chars[val >> 4];
+ *buf++ = hex_chars[val & 0xf];
+
+ return buf;
+}
+
+/* Character classification utils */
+
+static inline bool
+is_print(uint8_t c)
+{
+ return (c >= ' ') && (c < 0x7f);
+}
+
+#endif /* STRACE_PRINT_UTILS_H */
diff --git a/src/printmode.c b/src/printmode.c
new file mode 100644
index 000000000..a53a6ce44
--- /dev/null
+++ b/src/printmode.c
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993-1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
+ * Copyright (c) 2012 Denys Vlasenko <vda.linux@googlemail.com>
+ * Copyright (c) 2012-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#include <fcntl.h>
+#include <sys/stat.h>
+
+#include "xlat/modetypes.h"
+
+void
+print_symbolic_mode_t(const unsigned int mode)
+{
+ const char *ifmt = "";
+
+ if (mode & S_IFMT)
+ ifmt = xlookup(modetypes, mode & S_IFMT);
+
+ if (!ifmt || xlat_verbose(xlat_verbosity) != XLAT_STYLE_ABBREV)
+ tprintf("%#03o", mode);
+
+ if (!ifmt || xlat_verbose(xlat_verbosity) == XLAT_STYLE_RAW)
+ return;
+
+ (xlat_verbose(xlat_verbosity) == XLAT_STYLE_ABBREV
+ ? tprintf : tprintf_comment)("%s%s%s%s%s%#03o",
+ ifmt, ifmt[0] ? "|" : "",
+ (mode & S_ISUID) ? "S_ISUID|" : "",
+ (mode & S_ISGID) ? "S_ISGID|" : "",
+ (mode & S_ISVTX) ? "S_ISVTX|" : "",
+ mode & ~(S_IFMT|S_ISUID|S_ISGID|S_ISVTX));
+}
+
+void
+print_numeric_umode_t(const unsigned short mode)
+{
+ tprintf("%#03ho", mode);
+}
+
+void
+print_numeric_ll_umode_t(const unsigned long long mode)
+{
+ tprintf("%#03llo", mode);
+}
diff --git a/src/printrusage.c b/src/printrusage.c
new file mode 100644
index 000000000..fe877445f
--- /dev/null
+++ b/src/printrusage.c
@@ -0,0 +1,137 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
+ * Copyright (c) 1999-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#include DEF_MPERS_TYPE(kernel_rusage_t)
+
+#include "kernel_rusage.h"
+
+#include MPERS_DEFS
+
+#include <sys/resource.h>
+
+MPERS_PRINTER_DECL(void, printrusage,
+ struct tcb *const tcp, const kernel_ulong_t addr)
+{
+ kernel_rusage_t ru;
+
+ if (umove_or_printaddr(tcp, addr, &ru))
+ return;
+
+ tprint_struct_begin();
+ PRINT_FIELD_OBJ_PTR(ru, ru_utime,
+ MPERS_FUNC_NAME(print_struct_timeval));
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_PTR(ru, ru_stime,
+ MPERS_FUNC_NAME(print_struct_timeval));
+ if (abbrev(tcp)) {
+ tprint_struct_next();
+ tprint_more_data_follows();
+ } else {
+ tprint_struct_next();
+ PRINT_FIELD_U(ru, ru_maxrss);
+ tprint_struct_next();
+ PRINT_FIELD_U(ru, ru_ixrss);
+ tprint_struct_next();
+ PRINT_FIELD_U(ru, ru_idrss);
+ tprint_struct_next();
+ PRINT_FIELD_U(ru, ru_isrss);
+ tprint_struct_next();
+ PRINT_FIELD_U(ru, ru_minflt);
+ tprint_struct_next();
+ PRINT_FIELD_U(ru, ru_majflt);
+ tprint_struct_next();
+ PRINT_FIELD_U(ru, ru_nswap);
+ tprint_struct_next();
+ PRINT_FIELD_U(ru, ru_inblock);
+ tprint_struct_next();
+ PRINT_FIELD_U(ru, ru_oublock);
+ tprint_struct_next();
+ PRINT_FIELD_U(ru, ru_msgsnd);
+ tprint_struct_next();
+ PRINT_FIELD_U(ru, ru_msgrcv);
+ tprint_struct_next();
+ PRINT_FIELD_U(ru, ru_nsignals);
+ tprint_struct_next();
+ PRINT_FIELD_U(ru, ru_nvcsw);
+ tprint_struct_next();
+ PRINT_FIELD_U(ru, ru_nivcsw);
+ }
+ tprint_struct_end();
+}
+
+#ifdef ALPHA
+void
+printrusage32(struct tcb *const tcp, const kernel_ulong_t addr)
+{
+ struct rusage32 {
+ timeval32_t ru_utime; /* user time used */
+ timeval32_t ru_stime; /* system time used */
+ long ru_maxrss; /* maximum resident set size */
+ long ru_ixrss; /* integral shared memory size */
+ long ru_idrss; /* integral unshared data size */
+ long ru_isrss; /* integral unshared stack size */
+ long ru_minflt; /* page reclaims */
+ long ru_majflt; /* page faults */
+ long ru_nswap; /* swaps */
+ long ru_inblock; /* block input operations */
+ long ru_oublock; /* block output operations */
+ long ru_msgsnd; /* messages sent */
+ long ru_msgrcv; /* messages received */
+ long ru_nsignals; /* signals received */
+ long ru_nvcsw; /* voluntary context switches */
+ long ru_nivcsw; /* involuntary " */
+ } ru;
+
+ if (umove_or_printaddr(tcp, addr, &ru))
+ return;
+
+ tprint_struct_begin();
+ PRINT_FIELD_OBJ_PTR(ru, ru_utime, print_timeval32_t);
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_PTR(ru, ru_stime, print_timeval32_t);
+ if (abbrev(tcp)) {
+ tprint_struct_next();
+ tprint_more_data_follows();
+ } else {
+ tprint_struct_next();
+ PRINT_FIELD_U(ru, ru_maxrss);
+ tprint_struct_next();
+ PRINT_FIELD_U(ru, ru_ixrss);
+ tprint_struct_next();
+ PRINT_FIELD_U(ru, ru_idrss);
+ tprint_struct_next();
+ PRINT_FIELD_U(ru, ru_isrss);
+ tprint_struct_next();
+ PRINT_FIELD_U(ru, ru_minflt);
+ tprint_struct_next();
+ PRINT_FIELD_U(ru, ru_majflt);
+ tprint_struct_next();
+ PRINT_FIELD_U(ru, ru_nswap);
+ tprint_struct_next();
+ PRINT_FIELD_U(ru, ru_inblock);
+ tprint_struct_next();
+ PRINT_FIELD_U(ru, ru_oublock);
+ tprint_struct_next();
+ PRINT_FIELD_U(ru, ru_msgsnd);
+ tprint_struct_next();
+ PRINT_FIELD_U(ru, ru_msgrcv);
+ tprint_struct_next();
+ PRINT_FIELD_U(ru, ru_nsignals);
+ tprint_struct_next();
+ PRINT_FIELD_U(ru, ru_nvcsw);
+ tprint_struct_next();
+ PRINT_FIELD_U(ru, ru_nivcsw);
+ }
+ tprint_struct_end();
+}
+#endif
diff --git a/src/printsiginfo.c b/src/printsiginfo.c
new file mode 100644
index 000000000..3cae37657
--- /dev/null
+++ b/src/printsiginfo.c
@@ -0,0 +1,274 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993-1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
+ * Copyright (c) 2001 John Hughes <john@Calva.COM>
+ * Copyright (c) 2013 Denys Vlasenko <vda.linux@googlemail.com>
+ * Copyright (c) 2011-2015 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2015 Elvira Khabirova <lineprinter0@gmail.com>
+ * Copyright (c) 2015-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#include DEF_MPERS_TYPE(siginfo_t)
+
+#include <signal.h>
+#include <linux/audit.h>
+
+#include MPERS_DEFS
+
+#include "nr_prefix.c"
+
+#ifndef IN_MPERS
+# include "printsiginfo.h"
+#endif
+
+#define XLAT_MACROS_ONLY
+/* For xlat/audit_arch.h */
+# include "xlat/elf_em.h"
+#undef XLAT_MACROS_ONLY
+
+#include "xlat/audit_arch.h"
+#include "xlat/sigbus_codes.h"
+#include "xlat/sigchld_codes.h"
+#include "xlat/sigfpe_codes.h"
+#include "xlat/sigill_codes.h"
+#include "xlat/siginfo_codes.h"
+#include "xlat/sigpoll_codes.h"
+#include "xlat/sigprof_codes.h"
+#include "xlat/sigsegv_codes.h"
+#include "xlat/sigsys_codes.h"
+#include "xlat/sigtrap_codes.h"
+
+#ifdef SIGEMT
+# include "xlat/sigemt_codes.h"
+#endif
+
+#ifndef SI_FROMUSER
+# define SI_FROMUSER(sip) ((sip)->si_code <= 0)
+#endif
+
+static void
+printsigsource(struct tcb *tcp, const siginfo_t *sip)
+{
+ tprint_struct_next();
+ PRINT_FIELD_TGID(*sip, si_pid, tcp);
+ tprint_struct_next();
+ PRINT_FIELD_ID(*sip, si_uid);
+}
+
+static void
+printsigval(const siginfo_t *sip)
+{
+ tprint_struct_next();
+ PRINT_FIELD_D(*sip, si_int);
+ tprint_struct_next();
+ PRINT_FIELD_PTR(*sip, si_ptr);
+}
+
+static void
+print_si_code(const unsigned int si_code, const int si_signo)
+{
+ const char *code = xlookup(siginfo_codes, si_code);
+
+ if (!code) {
+ switch (si_signo) {
+ case SIGTRAP:
+ code = xlookup(sigtrap_codes, si_code);
+ break;
+ case SIGCHLD:
+ code = xlookup(sigchld_codes, si_code);
+ break;
+ case SIGPOLL:
+ code = xlookup(sigpoll_codes, si_code);
+ break;
+ case SIGPROF:
+ code = xlookup(sigprof_codes, si_code);
+ break;
+ case SIGILL:
+ code = xlookup(sigill_codes, si_code);
+ break;
+#ifdef SIGEMT
+ case SIGEMT:
+ code = xlookup(sigemt_codes, si_code);
+ break;
+#endif
+ case SIGFPE:
+ code = xlookup(sigfpe_codes, si_code);
+ break;
+ case SIGSEGV:
+ code = xlookup(sigsegv_codes, si_code);
+ break;
+ case SIGBUS:
+ code = xlookup(sigbus_codes, si_code);
+ break;
+ case SIGSYS:
+ code = xlookup(sigsys_codes, si_code);
+ break;
+ }
+ }
+
+ print_xlat_ex(si_code, code, XLAT_STYLE_DEFAULT);
+}
+
+#ifdef HAVE_SIGINFO_T_SI_SYSCALL
+static void
+print_si_syscall(const unsigned int scno)
+{
+ /*
+ * Note that we can safely use the personality set in
+ * current_personality here (and don't have to guess it
+ * based on X32_SYSCALL_BIT and si_arch, for example):
+ * - The signal is delivered as a result of seccomp
+ * filtering to the process executing forbidden
+ * syscall.
+ * - We have set the personality for the tracee during
+ * the syscall entering.
+ * - The current_personality is reliably switched in
+ * the next_event routine, it is set to the
+ * personality of the last call made (the one that
+ * triggered the signal delivery).
+ * - Looks like there are no other cases where SIGSYS
+ * is delivered from the kernel so far.
+ */
+ const char *scname = syscall_name(shuffle_scno(scno));
+ if (scname)
+ tprintf("%s%s", nr_prefix(scno), scname);
+ else
+ tprintf("%u", scno);
+}
+#endif
+
+static void
+print_si_info(struct tcb *tcp, const siginfo_t *sip)
+{
+ if (sip->si_errno) {
+ tprint_struct_next();
+ PRINT_FIELD_ERR_U(*sip, si_errno);
+ }
+
+ if (SI_FROMUSER(sip)) {
+ switch (sip->si_code) {
+ case SI_USER:
+ printsigsource(tcp, sip);
+ break;
+ case SI_TKILL:
+ printsigsource(tcp, sip);
+ break;
+#if defined HAVE_SIGINFO_T_SI_TIMERID && defined HAVE_SIGINFO_T_SI_OVERRUN
+ case SI_TIMER:
+ tprint_struct_next();
+ PRINT_FIELD_X(*sip, si_timerid);
+ tprint_struct_next();
+ PRINT_FIELD_D(*sip, si_overrun);
+ printsigval(sip);
+ break;
+#endif
+ default:
+ printsigsource(tcp, sip);
+ if (sip->si_ptr)
+ printsigval(sip);
+ break;
+ }
+ } else {
+ switch (sip->si_signo) {
+ case SIGCHLD:
+ printsigsource(tcp, sip);
+ if (sip->si_code == CLD_EXITED) {
+ tprint_struct_next();
+ PRINT_FIELD_D(*sip, si_status);
+ } else {
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_VAL(*sip, si_status, printsignal);
+ }
+ tprint_struct_next();
+ PRINT_FIELD_U(*sip, si_utime);
+ tprint_struct_next();
+ PRINT_FIELD_U(*sip, si_stime);
+ break;
+ case SIGILL: case SIGFPE:
+ case SIGSEGV: case SIGBUS:
+ tprint_struct_next();
+ PRINT_FIELD_PTR(*sip, si_addr);
+ break;
+ case SIGPOLL:
+ switch (sip->si_code) {
+ case POLL_IN: case POLL_OUT: case POLL_MSG:
+ tprint_struct_next();
+ PRINT_FIELD_D(*sip, si_band);
+ break;
+ }
+ break;
+#ifdef HAVE_SIGINFO_T_SI_SYSCALL
+ case SIGSYS:
+ tprint_struct_next();
+ PRINT_FIELD_PTR(*sip, si_call_addr);
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_VAL(*sip, si_syscall,
+ print_si_syscall);
+ tprint_struct_next();
+ PRINT_FIELD_XVAL(*sip, si_arch, audit_arch,
+ "AUDIT_ARCH_???");
+ break;
+#endif
+ default:
+ if (sip->si_pid || sip->si_uid)
+ printsigsource(tcp, sip);
+ if (sip->si_ptr)
+ printsigval(sip);
+ }
+ }
+}
+
+#ifdef IN_MPERS
+static
+#endif
+void
+printsiginfo(struct tcb *tcp, const siginfo_t *sip)
+{
+ tprint_struct_begin();
+
+ if (sip->si_signo) {
+ PRINT_FIELD_OBJ_VAL(*sip, si_signo, printsignal);
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_VAL(*sip, si_code, print_si_code,
+ sip->si_signo);
+
+#ifdef SI_NOINFO
+ if (sip->si_code != SI_NOINFO)
+#endif
+ print_si_info(tcp, sip);
+ }
+
+ tprint_struct_end();
+}
+
+MPERS_PRINTER_DECL(void, printsiginfo_at,
+ struct tcb *const tcp, const kernel_ulong_t addr)
+{
+ siginfo_t si;
+
+ if (!umove_or_printaddr(tcp, addr, &si))
+ printsiginfo(tcp, &si);
+}
+
+static bool
+print_siginfo_t(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data)
+{
+ printsiginfo(tcp, (const siginfo_t *) elem_buf);
+ return true;
+}
+
+MPERS_PRINTER_DECL(void, print_siginfo_array, struct tcb *const tcp,
+ const kernel_ulong_t addr, const kernel_ulong_t len)
+{
+ siginfo_t si;
+
+ print_array(tcp, addr, len, &si, sizeof(si),
+ tfetch_mem, print_siginfo_t, 0);
+}
diff --git a/src/printsiginfo.h b/src/printsiginfo.h
new file mode 100644
index 000000000..ee5ecc8eb
--- /dev/null
+++ b/src/printsiginfo.h
@@ -0,0 +1,13 @@
+/*
+ * Copyright (c) 2015-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_PRINTSIGINFO_H
+# define STRACE_PRINTSIGINFO_H
+
+extern void printsiginfo(struct tcb *, const siginfo_t *);
+
+#endif /* !STRACE_PRINTSIGINFO_H */
diff --git a/src/process.c b/src/process.c
new file mode 100644
index 000000000..a65492a50
--- /dev/null
+++ b/src/process.c
@@ -0,0 +1,313 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
+ * Copyright (c) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation
+ * Linux for s390 port by D.J. Barrow
+ * <barrow_dj@mail.yahoo.com,djbarrow@de.ibm.com>
+ * Copyright (c) 2000 PocketPenguins Inc. Linux for Hitachi SuperH
+ * port by Greg Banks <gbanks@pocketpenguins.com>
+ * Copyright (c) 1999-2020 The strace developers.
+ *
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#ifdef HAVE_ELF_H
+# include <elf.h>
+#endif
+
+#include "ptrace.h"
+#include "ptrace_syscall_info.h"
+#include "regs.h"
+
+#include "xlat/nt_descriptor_types.h"
+#include "xlat/ptrace_cmds.h"
+#include "xlat/ptrace_setoptions_flags.h"
+#include "xlat/ptrace_peeksiginfo_flags.h"
+
+#define uoff(member) offsetof(struct user, member)
+#define XLAT_UOFF(member) { uoff(member), "offsetof(struct user, " #member ")" }
+
+static const struct xlat_data struct_user_offsets_data[] = {
+#include "userent.h"
+ { 0, 0 }
+};
+
+static const struct xlat struct_user_offsets = {
+ .type = XT_SORTED,
+ .size = ARRAY_SIZE(struct_user_offsets_data) - 1,
+ .data = struct_user_offsets_data,
+};
+
+static void
+print_user_offset_addr(const kernel_ulong_t addr)
+{
+ const uint64_t last_user_offset = struct_user_offsets.size ?
+ struct_user_offsets.data[struct_user_offsets.size - 1].val : 0;
+
+ uint64_t base_addr = addr;
+ const char *str = xlookup_le(&struct_user_offsets, &base_addr);
+
+ /* We don't want to pretty print addresses beyond struct user */
+ if (addr > base_addr && base_addr == last_user_offset)
+ str = NULL;
+
+ if (!str || xlat_verbose(xlat_verbosity) != XLAT_STYLE_ABBREV)
+ printaddr(addr);
+ if (!str || xlat_verbose(xlat_verbosity) == XLAT_STYLE_RAW)
+ return;
+
+ if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE)
+ tprints(" /* ");
+
+ if (base_addr == addr)
+ tprints(str);
+ else
+ tprintf("%s + %" PRI_klu,
+ str, addr - (kernel_ulong_t) base_addr);
+
+ if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE)
+ tprints(" */");
+}
+
+SYS_FUNC(ptrace)
+{
+ const kernel_ulong_t request = tcp->u_arg[0];
+ const int pid = tcp->u_arg[1];
+ const kernel_ulong_t addr = tcp->u_arg[2];
+ const kernel_ulong_t data = tcp->u_arg[3];
+
+ if (entering(tcp)) {
+ /* request */
+ printxval64(ptrace_cmds, request, "PTRACE_???");
+
+ if (request == PTRACE_TRACEME) {
+ /* pid, addr, and data are ignored. */
+ return RVAL_DECODED;
+ }
+
+ /* pid */
+ tprints(", ");
+ printpid(tcp, pid, PT_TGID);
+
+ /* addr */
+ switch (request) {
+ case PTRACE_ATTACH:
+ case PTRACE_INTERRUPT:
+ case PTRACE_KILL:
+ case PTRACE_LISTEN:
+ /* addr and data are ignored */
+ return RVAL_DECODED;
+ case PTRACE_PEEKUSER:
+ case PTRACE_POKEUSER:
+ tprints(", ");
+ print_user_offset_addr(addr);
+ break;
+ case PTRACE_GETREGSET:
+ case PTRACE_SETREGSET:
+ tprints(", ");
+ printxval(nt_descriptor_types, addr, "NT_???");
+ break;
+ case PTRACE_GETSIGMASK:
+ case PTRACE_SETSIGMASK:
+ case PTRACE_SECCOMP_GET_FILTER:
+ case PTRACE_SECCOMP_GET_METADATA:
+ case PTRACE_GET_SYSCALL_INFO:
+ tprintf(", %" PRI_klu, addr);
+ break;
+ case PTRACE_PEEKSIGINFO: {
+ tprints(", ");
+ struct {
+ uint64_t off;
+ uint32_t flags;
+ uint32_t nr;
+ } psi;
+ if (umove_or_printaddr(tcp, addr, &psi)) {
+ tprints(", ");
+ printaddr(data);
+ return RVAL_DECODED;
+ }
+ tprint_struct_begin();
+ PRINT_FIELD_U(psi, off);
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(psi, flags,
+ ptrace_peeksiginfo_flags,
+ "PTRACE_PEEKSIGINFO_???");
+ tprint_struct_next();
+ PRINT_FIELD_U(psi, nr);
+ tprint_struct_end();
+ break;
+ }
+ default:
+ tprints(", ");
+ printaddr(addr);
+ }
+
+#if defined IA64 || defined SPARC || defined SPARC64
+ switch (request) {
+# ifdef IA64
+ case PTRACE_PEEKDATA:
+ case PTRACE_PEEKTEXT:
+ case PTRACE_PEEKUSER:
+ /* data is ignored */
+ return RVAL_DECODED | RVAL_HEX;
+# endif /* IA64 */
+# if defined SPARC || defined SPARC64
+ case PTRACE_GETREGS:
+ case PTRACE_SETREGS:
+ case PTRACE_GETFPREGS:
+ case PTRACE_SETFPREGS:
+ /* data is ignored */
+ return RVAL_DECODED;
+# endif /* SPARC || SPARC64 */
+ }
+#endif /* IA64 || SPARC || SPARC64 */
+
+ tprints(", ");
+
+ /* data */
+ switch (request) {
+ case PTRACE_CONT:
+ case PTRACE_DETACH:
+ case PTRACE_SYSCALL:
+#ifdef PTRACE_SINGLESTEP
+ case PTRACE_SINGLESTEP:
+#endif
+#ifdef PTRACE_SINGLEBLOCK
+ case PTRACE_SINGLEBLOCK:
+#endif
+#ifdef PTRACE_SYSEMU
+ case PTRACE_SYSEMU:
+#endif
+#ifdef PTRACE_SYSEMU_SINGLESTEP
+ case PTRACE_SYSEMU_SINGLESTEP:
+#endif
+ printsignal(data);
+ break;
+ case PTRACE_SEIZE:
+ case PTRACE_SETOPTIONS:
+#ifdef PTRACE_OLDSETOPTIONS
+ case PTRACE_OLDSETOPTIONS:
+#endif
+ printflags64(ptrace_setoptions_flags, data, "PTRACE_O_???");
+ break;
+ case PTRACE_SETSIGINFO:
+ printsiginfo_at(tcp, data);
+ break;
+ case PTRACE_SETSIGMASK:
+ print_sigset_addr_len(tcp, data, addr);
+ break;
+ case PTRACE_SETREGSET:
+ tprint_iov(tcp, /*len:*/ 1, data, IOV_DECODE_ADDR);
+ break;
+ case PTRACE_SECCOMP_GET_METADATA:
+ if (verbose(tcp)) {
+ uint64_t filter_off;
+ if (addr < sizeof(filter_off) ||
+ umove(tcp, data, &filter_off)) {
+ printaddr(data);
+ return RVAL_DECODED;
+ }
+
+ tprint_struct_begin();
+ tprints_field_name("filter_off");
+ tprintf("%" PRIu64, filter_off);
+ return 0;
+ }
+
+ printaddr(data);
+ break;
+#ifndef IA64
+ case PTRACE_PEEKDATA:
+ case PTRACE_PEEKTEXT:
+ case PTRACE_PEEKUSER:
+#endif
+ case PTRACE_GETEVENTMSG:
+ case PTRACE_GETREGSET:
+ case PTRACE_GETSIGINFO:
+ case PTRACE_GETSIGMASK:
+ case PTRACE_PEEKSIGINFO:
+ case PTRACE_SECCOMP_GET_FILTER:
+ case PTRACE_GET_SYSCALL_INFO:
+ if (verbose(tcp)) {
+ /* print data on exiting syscall */
+ return 0;
+ }
+ ATTRIBUTE_FALLTHROUGH;
+ default:
+ printaddr(data);
+ break;
+ }
+
+ return RVAL_DECODED;
+ } else {
+ switch (request) {
+#ifndef IA64
+ case PTRACE_PEEKDATA:
+ case PTRACE_PEEKTEXT:
+ case PTRACE_PEEKUSER:
+ printnum_ptr(tcp, data);
+ break;
+#endif
+ case PTRACE_GETEVENTMSG:
+ printnum_ulong(tcp, data);
+ break;
+ case PTRACE_GETREGSET:
+ tprint_iov(tcp, /*len:*/ 1, data, IOV_DECODE_ADDR);
+ break;
+ case PTRACE_GETSIGINFO:
+ printsiginfo_at(tcp, data);
+ break;
+ case PTRACE_GETSIGMASK:
+ print_sigset_addr_len(tcp, data, addr);
+ break;
+ case PTRACE_PEEKSIGINFO:
+ print_siginfo_array(tcp, data, tcp->u_rval);
+ break;
+ case PTRACE_SECCOMP_GET_FILTER:
+ print_seccomp_fprog(tcp, data, tcp->u_rval);
+ break;
+ case PTRACE_SECCOMP_GET_METADATA: {
+ const size_t offset = sizeof(uint64_t);
+ uint64_t flags = 0;
+ size_t ret_size = MIN((kernel_ulong_t) tcp->u_rval,
+ offset + sizeof(flags));
+
+ if (syserror(tcp) || ret_size <= offset) {
+ tprint_struct_end();
+ return 0;
+ }
+
+ if (umoven(tcp, data + offset, ret_size - offset,
+ &flags)) {
+ tprint_struct_next();
+ tprint_more_data_follows();
+ tprint_struct_end();
+ return 0;
+ }
+
+ tprint_struct_next();
+ tprints_field_name("flags");
+ printflags64(seccomp_filter_flags, flags,
+ "SECCOMP_FILTER_FLAG_???");
+
+ if ((kernel_ulong_t) tcp->u_rval > ret_size) {
+ tprint_struct_next();
+ tprint_more_data_follows();
+ }
+
+ tprint_struct_end();
+ break;
+ }
+ case PTRACE_GET_SYSCALL_INFO:
+ print_ptrace_syscall_info(tcp, data, addr);
+ break;
+ }
+ }
+ return 0;
+}
diff --git a/src/process_vm.c b/src/process_vm.c
new file mode 100644
index 000000000..73f63015b
--- /dev/null
+++ b/src/process_vm.c
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2012 Denys Vlasenko <vda.linux@googlemail.com>
+ * Copyright (c) 2012-2015 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2014-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+SYS_FUNC(process_vm_readv)
+{
+ if (entering(tcp)) {
+ /* arg 1: pid */
+ printpid(tcp, tcp->u_arg[0], PT_TGID);
+ tprints(", ");
+ } else {
+ kernel_ulong_t local_iovcnt = tcp->u_arg[2];
+ kernel_ulong_t remote_iovcnt = tcp->u_arg[4];
+ kernel_ulong_t flags = tcp->u_arg[5];
+
+ /* arg 2: local iov */
+ tprint_iov_upto(tcp, local_iovcnt, tcp->u_arg[1],
+ syserror(tcp) ? IOV_DECODE_ADDR : IOV_DECODE_STR,
+ tcp->u_rval);
+ /* arg 3: local iovcnt */
+ tprintf(", %" PRI_klu ", ", local_iovcnt);
+ /* arg 4: remote iov */
+ tprint_iov(tcp, remote_iovcnt, tcp->u_arg[3],
+ IOV_DECODE_ADDR);
+ /* arg 5: remote iovcnt */
+ /* arg 6: flags */
+ tprintf(", %" PRI_klu ", %" PRI_klu, remote_iovcnt, flags);
+ }
+ return 0;
+}
+
+SYS_FUNC(process_vm_writev)
+{
+ kernel_ulong_t local_iovcnt = tcp->u_arg[2];
+ kernel_ulong_t remote_iovcnt = tcp->u_arg[4];
+ kernel_ulong_t flags = tcp->u_arg[5];
+
+ /* arg 1: pid */
+ printpid(tcp, tcp->u_arg[0], PT_TGID);
+ tprints(", ");
+ /* arg 2: local iov */
+ tprint_iov(tcp, local_iovcnt, tcp->u_arg[1], IOV_DECODE_STR);
+ /* arg 3: local iovcnt */
+ tprintf(", %" PRI_klu ", ", local_iovcnt);
+ /* arg 4: remote iov */
+ tprint_iov(tcp, remote_iovcnt, tcp->u_arg[3], IOV_DECODE_ADDR);
+ /* arg 5: remote iovcnt */
+ /* arg 6: flags */
+ tprintf(", %" PRI_klu ", %" PRI_klu, remote_iovcnt, flags);
+
+ return RVAL_DECODED;
+}
diff --git a/src/ptp.c b/src/ptp.c
new file mode 100644
index 000000000..44a360878
--- /dev/null
+++ b/src/ptp.c
@@ -0,0 +1,164 @@
+/*
+ * Copyright (c) 2014 Stefan Sørensen <stefan.sorensen@spectralink.com>
+ * Copyright (c) 2014-2015 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2014-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#ifdef HAVE_STRUCT_PTP_SYS_OFFSET
+
+# include <linux/ioctl.h>
+# include <linux/ptp_clock.h>
+
+# ifndef PTP_CLOCK_GETCAPS2
+# define PTP_CLOCK_GETCAPS2 _IOR(PTP_CLK_MAGIC, 10, struct ptp_clock_caps)
+# endif
+# ifndef PTP_EXTTS_REQUEST2
+# define PTP_EXTTS_REQUEST2 _IOW(PTP_CLK_MAGIC, 11, struct ptp_extts_request)
+# endif
+# ifndef PTP_PEROUT_REQUEST2
+# define PTP_PEROUT_REQUEST2 _IOW(PTP_CLK_MAGIC, 12, struct ptp_perout_request)
+# endif
+# ifndef PTP_ENABLE_PPS2
+# define PTP_ENABLE_PPS2 _IOW(PTP_CLK_MAGIC, 13, int)
+# endif
+# ifndef PTP_SYS_OFFSET2
+# define PTP_SYS_OFFSET2 _IOW(PTP_CLK_MAGIC, 14, struct ptp_sys_offset)
+# endif
+
+# include "xlat/ptp_extts_flags.h"
+# include "xlat/ptp_perout_flags.h"
+
+static void
+print_ptp_clock_time(const struct ptp_clock_time *const p)
+{
+ tprint_struct_begin();
+ PRINT_FIELD_D(*p, sec);
+ tprint_struct_next();
+ PRINT_FIELD_U(*p, nsec);
+ tprint_struct_end();
+ tprints_comment(sprinttime_nsec(p->sec, p->nsec));
+}
+
+static bool
+print_ptp_clock_time_am(struct tcb *tcp, void *elem_buf, size_t elem_size,
+ void *data)
+{
+ print_ptp_clock_time(elem_buf);
+ return true;
+}
+
+int
+ptp_ioctl(struct tcb *const tcp, const unsigned int code,
+ const kernel_ulong_t arg)
+{
+ if (!verbose(tcp))
+ return RVAL_DECODED;
+
+ switch (code) {
+ case PTP_EXTTS_REQUEST:
+ case PTP_EXTTS_REQUEST2: {
+ struct ptp_extts_request extts;
+
+ tprints(", ");
+ if (umove_or_printaddr(tcp, arg, &extts))
+ break;
+
+ tprint_struct_begin();
+ PRINT_FIELD_D(extts, index);
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(extts, flags, ptp_extts_flags, "PTP_???");
+ tprint_struct_end();
+ break;
+ }
+
+ case PTP_PEROUT_REQUEST:
+ case PTP_PEROUT_REQUEST2: {
+ struct ptp_perout_request perout;
+
+ tprints(", ");
+ if (umove_or_printaddr(tcp, arg, &perout))
+ break;
+
+ tprint_struct_begin();
+ PRINT_FIELD_OBJ_PTR(perout, start, print_ptp_clock_time);
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_PTR(perout, period, print_ptp_clock_time);
+ tprint_struct_next();
+ PRINT_FIELD_D(perout, index);
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(perout, flags, ptp_perout_flags,
+ "PTP_???");
+ tprint_struct_end();
+ break;
+ }
+
+ case PTP_ENABLE_PPS:
+ case PTP_ENABLE_PPS2:
+ tprintf(", %" PRI_kld, arg);
+ break;
+
+ case PTP_SYS_OFFSET:
+ case PTP_SYS_OFFSET2: {
+ struct ptp_sys_offset sysoff;
+
+ if (entering(tcp)) {
+ tprints(", ");
+ if (umove_or_printaddr(tcp, arg, &sysoff))
+ break;
+
+ tprint_struct_begin();
+ PRINT_FIELD_U(sysoff, n_samples);
+ return 0;
+ } else {
+ if (tfetch_mem(tcp, arg, sizeof(sysoff), &sysoff)) {
+ unsigned int n_samples =
+ sysoff.n_samples > PTP_MAX_SAMPLES
+ ? PTP_MAX_SAMPLES : sysoff.n_samples;
+ tprints(", ");
+ tprint_struct_next();
+ PRINT_FIELD_ARRAY_UPTO(sysoff, ts,
+ 2 * n_samples + 1, tcp,
+ print_ptp_clock_time_am);
+ }
+ tprint_struct_end();
+ break;
+ }
+ }
+ case PTP_CLOCK_GETCAPS:
+ case PTP_CLOCK_GETCAPS2: {
+ struct ptp_clock_caps caps;
+
+ if (entering(tcp))
+ return 0;
+
+ tprints(", ");
+ if (umove_or_printaddr(tcp, arg, &caps))
+ break;
+
+ tprint_struct_begin();
+ PRINT_FIELD_D(caps, max_adj);
+ tprint_struct_next();
+ PRINT_FIELD_D(caps, n_alarm);
+ tprint_struct_next();
+ PRINT_FIELD_D(caps, n_ext_ts);
+ tprint_struct_next();
+ PRINT_FIELD_D(caps, n_per_out);
+ tprint_struct_next();
+ PRINT_FIELD_D(caps, pps);
+ tprint_struct_end();
+ break;
+ }
+
+ default:
+ return RVAL_DECODED;
+ }
+
+ return RVAL_IOCTL_DECODED;
+}
+
+#endif /* HAVE_STRUCT_PTP_SYS_OFFSET */
diff --git a/src/ptrace.h b/src/ptrace.h
new file mode 100644
index 000000000..525d68e3c
--- /dev/null
+++ b/src/ptrace.h
@@ -0,0 +1,204 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993-1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 2004 Roland McGrath <roland@redhat.com>
+ * Copyright (c) 2010 Wang Chao <wang.chao@cn.fujitsu.com>
+ * Copyright (c) 2011-2013 Denys Vlasenko <vda.linux@googlemail.com>
+ * Copyright (c) 2011-2016 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2013 Ali Polatel <alip@exherbo.org>
+ * Copyright (c) 2015 Mike Frysinger <vapier@gentoo.org>
+ * Copyright (c) 2015-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_PTRACE_H
+# define STRACE_PTRACE_H
+
+# include <stdint.h>
+# include <sys/ptrace.h>
+
+# ifdef HAVE_STRUCT_IA64_FPREG
+# define ia64_fpreg XXX_ia64_fpreg
+# endif
+# ifdef HAVE_STRUCT_PT_ALL_USER_REGS
+# define pt_all_user_regs XXX_pt_all_user_regs
+# endif
+# ifdef HAVE_STRUCT_PTRACE_PEEKSIGINFO_ARGS
+# define ptrace_peeksiginfo_args XXX_ptrace_peeksiginfo_args
+# endif
+
+# include <linux/ptrace.h>
+
+# ifdef HAVE_STRUCT_IA64_FPREG
+# undef ia64_fpreg
+# endif
+# ifdef HAVE_STRUCT_PT_ALL_USER_REGS
+# undef pt_all_user_regs
+# endif
+# ifdef HAVE_STRUCT_PTRACE_PEEKSIGINFO_ARGS
+# undef ptrace_peeksiginfo_args
+# endif
+
+# if defined(SPARC) || defined(SPARC64)
+/*
+ * SPARC has a different PTRACE_DETACH value correctly defined in sys/ptrace.h,
+ * but linux/ptrace.h clobbers it with the standard one. PTRACE_SUNDETACH is
+ * also defined to the correct value by sys/ptrace.h, so use that instead.
+ */
+# undef PTRACE_DETACH
+# define PTRACE_DETACH PTRACE_SUNDETACH
+# endif
+
+# ifndef PTRACE_EVENT_FORK
+# define PTRACE_EVENT_FORK 1
+# endif
+# ifndef PTRACE_EVENT_VFORK
+# define PTRACE_EVENT_VFORK 2
+# endif
+# ifndef PTRACE_EVENT_CLONE
+# define PTRACE_EVENT_CLONE 3
+# endif
+# ifndef PTRACE_EVENT_EXEC
+# define PTRACE_EVENT_EXEC 4
+# endif
+# ifndef PTRACE_EVENT_VFORK_DONE
+# define PTRACE_EVENT_VFORK_DONE 5
+# endif
+# ifndef PTRACE_EVENT_EXIT
+# define PTRACE_EVENT_EXIT 6
+# endif
+# ifndef PTRACE_EVENT_SECCOMP
+# define PTRACE_EVENT_SECCOMP 7
+# endif
+# ifdef PTRACE_EVENT_STOP
+/* Linux 3.1 - 3.3 releases had a broken value. It was fixed in 3.4. */
+# if PTRACE_EVENT_STOP == 7
+# undef PTRACE_EVENT_STOP
+# endif
+# endif
+# ifndef PTRACE_EVENT_STOP
+# define PTRACE_EVENT_STOP 128
+# endif
+
+# ifndef PTRACE_O_TRACESYSGOOD
+# define PTRACE_O_TRACESYSGOOD 1
+# endif
+# ifndef PTRACE_O_TRACEFORK
+# define PTRACE_O_TRACEFORK (1 << PTRACE_EVENT_FORK)
+# endif
+# ifndef PTRACE_O_TRACEVFORK
+# define PTRACE_O_TRACEVFORK (1 << PTRACE_EVENT_VFORK)
+# endif
+# ifndef PTRACE_O_TRACECLONE
+# define PTRACE_O_TRACECLONE (1 << PTRACE_EVENT_CLONE)
+# endif
+# ifndef PTRACE_O_TRACEEXEC
+# define PTRACE_O_TRACEEXEC (1 << PTRACE_EVENT_EXEC)
+# endif
+# ifndef PTRACE_O_TRACEVFORKDONE
+# define PTRACE_O_TRACEVFORKDONE (1 << PTRACE_EVENT_VFORK_DONE)
+# endif
+# ifndef PTRACE_O_TRACEEXIT
+# define PTRACE_O_TRACEEXIT (1 << PTRACE_EVENT_EXIT)
+# endif
+# ifndef PTRACE_O_TRACESECCOMP
+# define PTRACE_O_TRACESECCOMP (1 << PTRACE_EVENT_SECCOMP)
+# endif
+# ifndef PTRACE_O_EXITKILL
+# define PTRACE_O_EXITKILL (1 << 20)
+# endif
+# ifndef PTRACE_O_SUSPEND_SECCOMP
+# define PTRACE_O_SUSPEND_SECCOMP (1 << 21)
+# endif
+
+# ifndef PTRACE_SETOPTIONS
+# define PTRACE_SETOPTIONS 0x4200
+# endif
+# ifndef PTRACE_GETEVENTMSG
+# define PTRACE_GETEVENTMSG 0x4201
+# endif
+# ifndef PTRACE_GETSIGINFO
+# define PTRACE_GETSIGINFO 0x4202
+# endif
+# ifndef PTRACE_SETSIGINFO
+# define PTRACE_SETSIGINFO 0x4203
+# endif
+# ifndef PTRACE_GETREGSET
+# define PTRACE_GETREGSET 0x4204
+# endif
+# ifndef PTRACE_SETREGSET
+# define PTRACE_SETREGSET 0x4205
+# endif
+# ifndef PTRACE_SEIZE
+# define PTRACE_SEIZE 0x4206
+# endif
+# ifndef PTRACE_INTERRUPT
+# define PTRACE_INTERRUPT 0x4207
+# endif
+# ifndef PTRACE_LISTEN
+# define PTRACE_LISTEN 0x4208
+# endif
+# ifndef PTRACE_PEEKSIGINFO
+# define PTRACE_PEEKSIGINFO 0x4209
+# endif
+# ifndef PTRACE_GETSIGMASK
+# define PTRACE_GETSIGMASK 0x420a
+# endif
+# ifndef PTRACE_SETSIGMASK
+# define PTRACE_SETSIGMASK 0x420b
+# endif
+# ifndef PTRACE_SECCOMP_GET_FILTER
+# define PTRACE_SECCOMP_GET_FILTER 0x420c
+# endif
+# ifndef PTRACE_SECCOMP_GET_METADATA
+# define PTRACE_SECCOMP_GET_METADATA 0x420d
+# endif
+# ifndef PTRACE_GET_SYSCALL_INFO
+# define PTRACE_GET_SYSCALL_INFO 0x420e
+# define PTRACE_SYSCALL_INFO_NONE 0
+# define PTRACE_SYSCALL_INFO_ENTRY 1
+# define PTRACE_SYSCALL_INFO_EXIT 2
+# define PTRACE_SYSCALL_INFO_SECCOMP 3
+# endif
+
+# if defined HAVE_STRUCT_PTRACE_SYSCALL_INFO
+typedef struct ptrace_syscall_info struct_ptrace_syscall_info;
+# elif defined HAVE_STRUCT___PTRACE_SYSCALL_INFO
+typedef struct __ptrace_syscall_info struct_ptrace_syscall_info;
+# else
+struct ptrace_syscall_info {
+ uint8_t op;
+ uint8_t pad[3];
+ uint32_t arch;
+ uint64_t instruction_pointer;
+ uint64_t stack_pointer;
+ union {
+ struct {
+ uint64_t nr;
+ uint64_t args[6];
+ } entry;
+ struct {
+ int64_t rval;
+ uint8_t is_error;
+ } exit;
+ struct {
+ uint64_t nr;
+ uint64_t args[6];
+ uint32_t ret_data;
+ } seccomp;
+ };
+};
+typedef struct ptrace_syscall_info struct_ptrace_syscall_info;
+# endif
+
+# if !HAVE_DECL_PTRACE_PEEKUSER
+# define PTRACE_PEEKUSER PTRACE_PEEKUSR
+# endif
+# if !HAVE_DECL_PTRACE_POKEUSER
+# define PTRACE_POKEUSER PTRACE_POKEUSR
+# endif
+
+#endif /* !STRACE_PTRACE_H */
diff --git a/src/ptrace_syscall_info.c b/src/ptrace_syscall_info.c
new file mode 100644
index 000000000..e4085a9cf
--- /dev/null
+++ b/src/ptrace_syscall_info.c
@@ -0,0 +1,384 @@
+/*
+ * Copyright (c) 2018 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2018-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include "kill_save_errno.h"
+#include "ptrace.h"
+#include "ptrace_syscall_info.h"
+#include "scno.h"
+
+#include <signal.h>
+#include <sys/wait.h>
+
+#include "xlat/ptrace_syscall_info_op.h"
+
+bool ptrace_get_syscall_info_supported;
+
+#define FAIL do { ptrace_stop = -1U; goto done; } while (0)
+
+#ifdef HAVE_FORK
+static int
+kill_tracee(pid_t pid)
+{
+ return kill_save_errno(pid, SIGKILL);
+}
+
+static const unsigned int expected_none_size =
+ offsetof(struct_ptrace_syscall_info, entry);
+static const unsigned int expected_entry_size =
+ offsetofend(struct_ptrace_syscall_info, entry.args);
+#endif /* HAVE_FORK */
+static const unsigned int expected_exit_size =
+ offsetofend(struct_ptrace_syscall_info, exit.is_error);
+static const unsigned int expected_seccomp_size =
+ offsetofend(struct_ptrace_syscall_info, seccomp.ret_data);
+
+/*
+ * Test that PTRACE_GET_SYSCALL_INFO API is supported by the kernel, and
+ * that the semantics implemented in the kernel matches our expectations.
+ */
+bool
+test_ptrace_get_syscall_info(void)
+{
+ /*
+ * NOMMU provides no forks necessary for PTRACE_GET_SYSCALL_INFO test,
+ * leave the default unchanged.
+ */
+#ifdef HAVE_FORK
+ static const unsigned long args[][7] = {
+ /* a sequence of architecture-agnostic syscalls */
+ {
+ __NR_chdir,
+ (unsigned long) "",
+ 0xbad1fed1,
+ 0xbad2fed2,
+ 0xbad3fed3,
+ 0xbad4fed4,
+ 0xbad5fed5
+ },
+ {
+ __NR_gettid,
+ 0xcaf0bea0,
+ 0xcaf1bea1,
+ 0xcaf2bea2,
+ 0xcaf3bea3,
+ 0xcaf4bea4,
+ 0xcaf5bea5
+ },
+ {
+ __NR_exit_group,
+ 0,
+ 0xfac1c0d1,
+ 0xfac2c0d2,
+ 0xfac3c0d3,
+ 0xfac4c0d4,
+ 0xfac5c0d5
+ }
+ };
+ const unsigned long *exp_args;
+
+# if SIZEOF_KERNEL_LONG_T > SIZEOF_LONG
+# define CAST (unsigned long)
+# else
+# define CAST
+# endif
+
+ int pid = fork();
+ if (pid < 0)
+ perror_func_msg_and_die("fork");
+
+ if (pid == 0) {
+ /* get the pid before PTRACE_TRACEME */
+ pid = getpid();
+ if (ptrace(PTRACE_TRACEME, 0L, 0L, 0L) < 0) {
+ /* exit with a nonzero exit status */
+ perror_func_msg_and_die("PTRACE_TRACEME");
+ }
+ kill(pid, SIGSTOP);
+ for (unsigned int i = 0; i < ARRAY_SIZE(args); ++i) {
+ syscall(args[i][0],
+ args[i][1], args[i][2], args[i][3],
+ args[i][4], args[i][5], args[i][6]);
+ }
+ /* unreachable */
+ _exit(1);
+ }
+
+ const struct {
+ unsigned int is_error;
+ int rval;
+ } *exp_param, exit_param[] = {
+ { 1, -ENOENT }, /* chdir */
+ { 0, pid } /* gettid */
+ };
+
+ unsigned int ptrace_stop;
+
+ for (ptrace_stop = 0; ; ++ptrace_stop) {
+ struct_ptrace_syscall_info info = {
+ .op = 0xff /* invalid PTRACE_SYSCALL_INFO_* op */
+ };
+ const size_t size = sizeof(info);
+ int status;
+ long rc = waitpid(pid, &status, 0);
+ if (rc != pid) {
+ /* cannot happen */
+ kill_tracee(pid);
+ perror_func_msg_and_die("#%d: unexpected wait result"
+ " %ld", ptrace_stop, rc);
+ }
+ if (WIFEXITED(status)) {
+ /* tracee is no more */
+ pid = 0;
+ if (WEXITSTATUS(status) == 0)
+ break;
+ debug_func_msg("#%d: unexpected exit status %u",
+ ptrace_stop, WEXITSTATUS(status));
+ FAIL;
+ }
+ if (WIFSIGNALED(status)) {
+ /* tracee is no more */
+ pid = 0;
+ debug_func_msg("#%d: unexpected signal %u",
+ ptrace_stop, WTERMSIG(status));
+ FAIL;
+ }
+ if (!WIFSTOPPED(status)) {
+ /* cannot happen */
+ kill_tracee(pid);
+ error_func_msg_and_die("#%d: unexpected wait status"
+ " %#x", ptrace_stop, status);
+ }
+
+ switch (WSTOPSIG(status)) {
+ case SIGSTOP:
+ if (ptrace_stop) {
+ debug_func_msg("#%d: unexpected signal stop",
+ ptrace_stop);
+ FAIL;
+ }
+ if (ptrace(PTRACE_SETOPTIONS, pid, 0L,
+ PTRACE_O_TRACESYSGOOD) < 0) {
+ /* cannot happen */
+ kill_tracee(pid);
+ perror_func_msg_and_die("PTRACE_SETOPTIONS");
+ }
+ rc = ptrace(PTRACE_GET_SYSCALL_INFO, pid,
+ (void *) size, &info);
+ if (rc < 0) {
+ debug_perror_msg("PTRACE_GET_SYSCALL_INFO");
+ FAIL;
+ }
+ if (rc < (long) expected_none_size
+ || info.op != PTRACE_SYSCALL_INFO_NONE
+ || !info.arch
+ || !info.instruction_pointer
+ || !info.stack_pointer) {
+ debug_func_msg("signal stop mismatch");
+ FAIL;
+ }
+ break;
+
+ case SIGTRAP | 0x80:
+ rc = ptrace(PTRACE_GET_SYSCALL_INFO, pid,
+ (void *) size, &info);
+ if (rc < 0) {
+ debug_perror_msg("#%d: PTRACE_GET_SYSCALL_INFO",
+ ptrace_stop);
+ FAIL;
+ }
+ switch (ptrace_stop) {
+ case 1: /* entering chdir */
+ case 3: /* entering gettid */
+ case 5: /* entering exit_group */
+ exp_args = args[ptrace_stop / 2];
+ if (rc < (long) expected_entry_size
+ || info.op != PTRACE_SYSCALL_INFO_ENTRY
+ || !info.arch
+ || !info.instruction_pointer
+ || !info.stack_pointer
+ || (info.entry.nr != exp_args[0])
+ || (CAST info.entry.args[0] != exp_args[1])
+ || (CAST info.entry.args[1] != exp_args[2])
+ || (CAST info.entry.args[2] != exp_args[3])
+ || (CAST info.entry.args[3] != exp_args[4])
+ || (CAST info.entry.args[4] != exp_args[5])
+ || (CAST info.entry.args[5] != exp_args[6])) {
+ debug_func_msg("#%d: entry stop"
+ " mismatch",
+ ptrace_stop);
+ FAIL;
+ }
+ break;
+ case 2: /* exiting chdir */
+ case 4: /* exiting gettid */
+ exp_param = &exit_param[ptrace_stop / 2 - 1];
+ if (rc < (long) expected_exit_size
+ || info.op != PTRACE_SYSCALL_INFO_EXIT
+ || !info.arch
+ || !info.instruction_pointer
+ || !info.stack_pointer
+ || info.exit.is_error != exp_param->is_error
+ || info.exit.rval != exp_param->rval) {
+ debug_func_msg("#%d: exit stop"
+ " mismatch",
+ ptrace_stop);
+ FAIL;
+ }
+ break;
+ default:
+ debug_func_msg("#%d: unexpected syscall stop",
+ ptrace_stop);
+ FAIL;
+ }
+ break;
+
+ default:
+ debug_func_msg("#%d: unexpected stop signal %#x",
+ ptrace_stop, WSTOPSIG(status));
+ FAIL;
+ }
+
+ if (ptrace(PTRACE_SYSCALL, pid, 0L, 0L) < 0) {
+ /* cannot happen */
+ kill_tracee(pid);
+ perror_func_msg_and_die("PTRACE_SYSCALL");
+ }
+ }
+
+done:
+ if (pid) {
+ kill_tracee(pid);
+ waitpid(pid, NULL, 0);
+ ptrace_stop = -1U;
+ }
+
+ ptrace_get_syscall_info_supported =
+ ptrace_stop == ARRAY_SIZE(args) * 2;
+
+ if (ptrace_get_syscall_info_supported)
+ debug_msg("PTRACE_GET_SYSCALL_INFO works");
+ else
+ debug_msg("PTRACE_GET_SYSCALL_INFO does not work");
+#endif /* HAVE_FORK */
+
+ return ptrace_get_syscall_info_supported;
+}
+
+static void
+print_psi_entry(const typeof_field(struct_ptrace_syscall_info, entry) *const p,
+ const kernel_ulong_t fetch_size, struct tcb *const tcp)
+{
+ tprint_struct_begin();
+ PRINT_FIELD_U(*p, nr);
+ const kernel_ulong_t nargs =
+ (fetch_size - offsetof(struct_ptrace_syscall_info, entry.args))
+ / sizeof(p->args[0]);
+ if (nargs) {
+ tprint_struct_next();
+ PRINT_FIELD_ARRAY_UPTO(*p, args, nargs, tcp,
+ print_xint64_array_member);
+ }
+ tprint_struct_end();
+}
+
+static void
+print_psi_seccomp(const typeof_field(struct_ptrace_syscall_info, seccomp) *const p,
+ const kernel_ulong_t fetch_size, struct tcb *const tcp)
+{
+ tprint_struct_begin();
+ PRINT_FIELD_U(*p, nr);
+ const kernel_ulong_t nargs =
+ (fetch_size - offsetof(struct_ptrace_syscall_info, seccomp.args))
+ / sizeof(p->args[0]);
+ if (nargs) {
+ tprint_struct_next();
+ PRINT_FIELD_ARRAY_UPTO(*p, args, nargs, tcp,
+ print_xint64_array_member);
+ }
+ if (fetch_size >= expected_seccomp_size) {
+ tprint_struct_next();
+ PRINT_FIELD_U(*p, ret_data);
+ }
+ tprint_struct_end();
+}
+
+static void
+print_psi_exit(const typeof_field(struct_ptrace_syscall_info, exit) *const p,
+ const kernel_ulong_t fetch_size, struct tcb *const tcp)
+{
+ tprint_struct_begin();
+ if (fetch_size >= expected_exit_size && p->is_error) {
+ PRINT_FIELD_ERR_D(*p, rval);
+ } else {
+ PRINT_FIELD_D(*p, rval);
+ }
+ if (fetch_size >= expected_exit_size) {
+ tprint_struct_next();
+ PRINT_FIELD_U(*p, is_error);
+ }
+ tprint_struct_end();
+}
+
+void
+print_ptrace_syscall_info(struct tcb *tcp, kernel_ulong_t addr,
+ kernel_ulong_t user_len)
+{
+ struct_ptrace_syscall_info info;
+ kernel_ulong_t kernel_len = tcp->u_rval;
+ kernel_ulong_t ret_len = MIN(user_len, kernel_len);
+ kernel_ulong_t fetch_size = MIN(ret_len, expected_seccomp_size);
+
+ if (!fetch_size || !tfetch_mem(tcp, addr, fetch_size, &info)) {
+ printaddr(addr);
+ return;
+ }
+
+ tprint_struct_begin();
+ PRINT_FIELD_XVAL(info, op, ptrace_syscall_info_op,
+ "PTRACE_SYSCALL_INFO_???");
+ if (fetch_size < offsetofend(struct_ptrace_syscall_info, arch))
+ goto printed;
+ tprint_struct_next();
+ PRINT_FIELD_XVAL(info, arch, audit_arch, "AUDIT_ARCH_???");
+
+ if (fetch_size < offsetofend(struct_ptrace_syscall_info,
+ instruction_pointer))
+ goto printed;
+ tprint_struct_next();
+ PRINT_FIELD_ADDR64(info, instruction_pointer);
+
+ if (fetch_size < offsetofend(struct_ptrace_syscall_info, stack_pointer))
+ goto printed;
+ tprint_struct_next();
+ PRINT_FIELD_ADDR64(info, stack_pointer);
+
+ if (fetch_size < offsetofend(struct_ptrace_syscall_info, entry.nr))
+ goto printed;
+
+ switch(info.op) {
+ case PTRACE_SYSCALL_INFO_ENTRY:
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_PTR(info, entry,
+ print_psi_entry, fetch_size, tcp);
+ break;
+ case PTRACE_SYSCALL_INFO_SECCOMP:
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_PTR(info, seccomp,
+ print_psi_seccomp, fetch_size, tcp);
+ break;
+ case PTRACE_SYSCALL_INFO_EXIT:
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_PTR(info, exit,
+ print_psi_exit, fetch_size, tcp);
+ break;
+ }
+
+printed:
+ tprint_struct_end();
+}
diff --git a/src/ptrace_syscall_info.h b/src/ptrace_syscall_info.h
new file mode 100644
index 000000000..e3b598d8f
--- /dev/null
+++ b/src/ptrace_syscall_info.h
@@ -0,0 +1,16 @@
+/*
+ * Copyright (c) 2018 Dmitry V. Levin <ldv@strace.io>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_PTRACE_SYSCALL_INFO_H
+# define STRACE_PTRACE_SYSCALL_INFO_H
+
+extern bool ptrace_get_syscall_info_supported;
+extern bool test_ptrace_get_syscall_info(void);
+extern void print_ptrace_syscall_info(struct tcb *, kernel_ulong_t addr,
+ kernel_ulong_t len);
+
+#endif /* !STRACE_PTRACE_SYSCALL_INFO_H */
diff --git a/src/quota.c b/src/quota.c
new file mode 100644
index 000000000..5168b3dac
--- /dev/null
+++ b/src/quota.c
@@ -0,0 +1,527 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
+ * Copyright (c) 2005-2016 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2006-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include "xfs_quota_stat.h"
+
+#define SUBCMDMASK 0x00ff
+#define SUBCMDSHIFT 8
+#define QCMD_CMD(cmd) ((uint32_t)(cmd) >> SUBCMDSHIFT)
+#define QCMD_TYPE(cmd) ((uint32_t)(cmd) & SUBCMDMASK)
+
+#define OLD_CMD(cmd) ((uint32_t)(cmd) << SUBCMDSHIFT)
+#define NEW_CMD(cmd) ((uint32_t)(cmd) | 0x800000)
+#define XQM_CMD(cmd) ((uint32_t)(cmd) | ('X' << SUBCMDSHIFT))
+
+#include "xlat/quotacmds.h"
+#include "xlat/quotatypes.h"
+#include "xlat/quota_formats.h"
+#include "xlat/xfs_quota_flags.h"
+#include "xlat/xfs_dqblk_flags.h"
+#include "xlat/if_dqblk_valid.h"
+#include "xlat/if_dqinfo_flags.h"
+#include "xlat/if_dqinfo_valid.h"
+
+/*
+ * We add attribute packed due to the fact that the structure is 8-byte aligned
+ * on 64-bit systems and therefore has additional 4 bytes of padding, which
+ * leads to problems when it is used on 32-bit tracee which does not have such
+ * padding.
+ */
+struct if_dqblk {
+ uint64_t dqb_bhardlimit;
+ uint64_t dqb_bsoftlimit;
+ uint64_t dqb_curspace;
+ uint64_t dqb_ihardlimit;
+ uint64_t dqb_isoftlimit;
+ uint64_t dqb_curinodes;
+ uint64_t dqb_btime;
+ uint64_t dqb_itime;
+ uint32_t dqb_valid;
+} ATTRIBUTE_PACKED;
+
+struct if_nextdqblk {
+ uint64_t dqb_bhardlimit;
+ uint64_t dqb_bsoftlimit;
+ uint64_t dqb_curspace;
+ uint64_t dqb_ihardlimit;
+ uint64_t dqb_isoftlimit;
+ uint64_t dqb_curinodes;
+ uint64_t dqb_btime;
+ uint64_t dqb_itime;
+ uint32_t dqb_valid;
+ uint32_t dqb_id;
+};
+
+struct xfs_dqblk {
+ int8_t d_version; /* version of this structure */
+ uint8_t d_flags; /* XFS_{USER,PROJ,GROUP}_QUOTA */
+ uint16_t d_fieldmask; /* field specifier */
+ uint32_t d_id; /* user, project, or group ID */
+ uint64_t d_blk_hardlimit; /* absolute limit on disk blks */
+ uint64_t d_blk_softlimit; /* preferred limit on disk blks */
+ uint64_t d_ino_hardlimit; /* maximum # allocated inodes */
+ uint64_t d_ino_softlimit; /* preferred inode limit */
+ uint64_t d_bcount; /* # disk blocks owned by the user */
+ uint64_t d_icount; /* # inodes owned by the user */
+ int32_t d_itimer; /* zero if within inode limits */
+ int32_t d_btimer; /* similar to above; for disk blocks */
+ uint16_t d_iwarns; /* # warnings issued wrt num inodes */
+ uint16_t d_bwarns; /* # warnings issued wrt disk blocks */
+ int32_t d_padding2; /* padding2 - for future use */
+ uint64_t d_rtb_hardlimit; /* absolute limit on realtime blks */
+ uint64_t d_rtb_softlimit; /* preferred limit on RT disk blks */
+ uint64_t d_rtbcount; /* # realtime blocks owned */
+ int32_t d_rtbtimer; /* similar to above; for RT disk blks */
+ uint16_t d_rtbwarns; /* # warnings issued wrt RT disk blks */
+ int16_t d_padding3; /* padding3 - for future use */
+ char d_padding4[8]; /* yet more padding */
+};
+
+struct if_dqinfo {
+ uint64_t dqi_bgrace;
+ uint64_t dqi_igrace;
+ uint32_t dqi_flags;
+ uint32_t dqi_valid;
+};
+
+struct fs_qfilestatv {
+ uint64_t qfs_ino, qfs_nblks;
+ uint32_t qfs_nextents, qfs_pad;
+};
+
+struct fs_quota_statv {
+ int8_t qs_version;
+ uint8_t qs_pad1;
+ uint16_t qs_flags;
+ uint32_t qs_incoredqs;
+ struct fs_qfilestatv qs_uquota;
+ struct fs_qfilestatv qs_gquota;
+ struct fs_qfilestatv qs_pquota;
+ int32_t qs_btimelimit;
+ int32_t qs_itimelimit;
+ int32_t qs_rtbtimelimit;
+ uint16_t qs_bwarnlimit;
+ uint16_t qs_iwarnlimit;
+ uint64_t qs_pad2[8];
+};
+
+static void
+print_fs_qfilestat(const struct fs_qfilestat *const p)
+{
+ tprint_struct_begin();
+ PRINT_FIELD_U(*p, qfs_ino);
+ tprint_struct_next();
+ PRINT_FIELD_U(*p, qfs_nblks);
+ tprint_struct_next();
+ PRINT_FIELD_U(*p, qfs_nextents);
+ tprint_struct_end();
+}
+
+static void
+print_fs_qfilestatv(const struct fs_qfilestatv *const p)
+{
+ tprint_struct_begin();
+ PRINT_FIELD_U(*p, qfs_ino);
+ tprint_struct_next();
+ PRINT_FIELD_U(*p, qfs_nblks);
+ tprint_struct_next();
+ PRINT_FIELD_U(*p, qfs_nextents);
+ tprint_struct_end();
+}
+
+static int
+decode_cmd_data(struct tcb *tcp, uint32_t id, uint32_t cmd, kernel_ulong_t data)
+{
+ switch (cmd) {
+ case Q_QUOTAOFF:
+ case Q_SYNC:
+ case Q_XQUOTASYNC:
+ break;
+ case Q_QUOTAON:
+ tprints(", ");
+ printxval(quota_formats, id, "QFMT_VFS_???");
+ tprints(", ");
+ printpath(tcp, data);
+ break;
+ case Q_GETQUOTA:
+ if (entering(tcp)) {
+ printuid(", ", id);
+ tprints(", ");
+
+ return 0;
+ }
+
+ ATTRIBUTE_FALLTHROUGH;
+ case Q_SETQUOTA:
+ {
+ struct if_dqblk dq;
+
+ if (entering(tcp)) {
+ printuid(", ", id);
+ tprints(", ");
+ }
+
+ if (umove_or_printaddr(tcp, data, &dq))
+ break;
+ tprint_struct_begin();
+ PRINT_FIELD_U(dq, dqb_bhardlimit);
+ tprint_struct_next();
+ PRINT_FIELD_U(dq, dqb_bsoftlimit);
+ tprint_struct_next();
+ PRINT_FIELD_U(dq, dqb_curspace);
+ tprint_struct_next();
+ PRINT_FIELD_U(dq, dqb_ihardlimit);
+ tprint_struct_next();
+ PRINT_FIELD_U(dq, dqb_isoftlimit);
+ tprint_struct_next();
+ PRINT_FIELD_U(dq, dqb_curinodes);
+ if (!abbrev(tcp)) {
+ tprint_struct_next();
+ PRINT_FIELD_U(dq, dqb_btime);
+ tprint_struct_next();
+ PRINT_FIELD_U(dq, dqb_itime);
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(dq, dqb_valid,
+ if_dqblk_valid, "QIF_???");
+ } else {
+ tprint_struct_next();
+ tprint_more_data_follows();
+ }
+ tprint_struct_end();
+ break;
+ }
+ case Q_GETNEXTQUOTA:
+ {
+ struct if_nextdqblk dq;
+
+ if (entering(tcp)) {
+ printuid(", ", id);
+ tprints(", ");
+
+ return 0;
+ }
+
+ if (umove_or_printaddr(tcp, data, &dq))
+ break;
+ tprint_struct_begin();
+ PRINT_FIELD_U(dq, dqb_bhardlimit);
+ tprint_struct_next();
+ PRINT_FIELD_U(dq, dqb_bsoftlimit);
+ tprint_struct_next();
+ PRINT_FIELD_U(dq, dqb_curspace);
+ tprint_struct_next();
+ PRINT_FIELD_U(dq, dqb_ihardlimit);
+ tprint_struct_next();
+ PRINT_FIELD_U(dq, dqb_isoftlimit);
+ tprint_struct_next();
+ PRINT_FIELD_U(dq, dqb_curinodes);
+ if (!abbrev(tcp)) {
+ tprint_struct_next();
+ PRINT_FIELD_U(dq, dqb_btime);
+ tprint_struct_next();
+ PRINT_FIELD_U(dq, dqb_itime);
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(dq, dqb_valid,
+ if_dqblk_valid, "QIF_???");
+ tprint_struct_next();
+ PRINT_FIELD_U(dq, dqb_id);
+ } else {
+ tprint_struct_next();
+ PRINT_FIELD_U(dq, dqb_id);
+ tprint_struct_next();
+ tprint_more_data_follows();
+ }
+ tprint_struct_end();
+ break;
+ }
+ case Q_XGETQUOTA:
+ case Q_XGETNEXTQUOTA:
+ if (entering(tcp)) {
+ printuid(", ", id);
+ tprints(", ");
+
+ return 0;
+ }
+
+ ATTRIBUTE_FALLTHROUGH;
+ case Q_XSETQLIM:
+ {
+ struct xfs_dqblk dq;
+
+ if (entering(tcp)) {
+ printuid(", ", id);
+ tprints(", ");
+ }
+
+ if (umove_or_printaddr(tcp, data, &dq))
+ break;
+ tprint_struct_begin();
+ PRINT_FIELD_D(dq, d_version);
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(dq, d_flags,
+ xfs_dqblk_flags, "XFS_???_QUOTA");
+ tprint_struct_next();
+ PRINT_FIELD_X(dq, d_fieldmask);
+ tprint_struct_next();
+ PRINT_FIELD_U(dq, d_id);
+ tprint_struct_next();
+ PRINT_FIELD_U(dq, d_blk_hardlimit);
+ tprint_struct_next();
+ PRINT_FIELD_U(dq, d_blk_softlimit);
+ tprint_struct_next();
+ PRINT_FIELD_U(dq, d_ino_hardlimit);
+ tprint_struct_next();
+ PRINT_FIELD_U(dq, d_ino_softlimit);
+ tprint_struct_next();
+ PRINT_FIELD_U(dq, d_bcount);
+ tprint_struct_next();
+ PRINT_FIELD_U(dq, d_icount);
+ if (!abbrev(tcp)) {
+ tprint_struct_next();
+ PRINT_FIELD_D(dq, d_itimer);
+ tprint_struct_next();
+ PRINT_FIELD_D(dq, d_btimer);
+ tprint_struct_next();
+ PRINT_FIELD_U(dq, d_iwarns);
+ tprint_struct_next();
+ PRINT_FIELD_U(dq, d_bwarns);
+ tprint_struct_next();
+ PRINT_FIELD_U(dq, d_rtb_hardlimit);
+ tprint_struct_next();
+ PRINT_FIELD_U(dq, d_rtb_softlimit);
+ tprint_struct_next();
+ PRINT_FIELD_U(dq, d_rtbcount);
+ tprint_struct_next();
+ PRINT_FIELD_D(dq, d_rtbtimer);
+ tprint_struct_next();
+ PRINT_FIELD_U(dq, d_rtbwarns);
+ } else {
+ tprint_struct_next();
+ tprint_more_data_follows();
+ }
+ tprint_struct_end();
+ break;
+ }
+ case Q_GETFMT:
+ {
+ uint32_t fmt;
+
+ if (entering(tcp)) {
+ tprints(", ");
+
+ return 0;
+ }
+
+ if (umove_or_printaddr(tcp, data, &fmt))
+ break;
+ tprints("[");
+ printxval(quota_formats, fmt, "QFMT_VFS_???");
+ tprints("]");
+ break;
+ }
+ case Q_GETINFO:
+ if (entering(tcp)) {
+ tprints(", ");
+
+ return 0;
+ }
+
+ ATTRIBUTE_FALLTHROUGH;
+ case Q_SETINFO:
+ {
+ struct if_dqinfo dq;
+
+ if (entering(tcp))
+ tprints(", ");
+
+ if (umove_or_printaddr(tcp, data, &dq))
+ break;
+ tprint_struct_begin();
+ PRINT_FIELD_U(dq, dqi_bgrace);
+ tprint_struct_next();
+ PRINT_FIELD_U(dq, dqi_igrace);
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(dq, dqi_flags, if_dqinfo_flags, "DQF_???");
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(dq, dqi_valid, if_dqinfo_valid, "IIF_???");
+ tprint_struct_end();
+ break;
+ }
+ case Q_XGETQSTAT:
+ {
+ struct xfs_dqstats dq;
+
+ if (entering(tcp)) {
+ tprints(", ");
+
+ return 0;
+ }
+ if (fetch_struct_quotastat(tcp, data, &dq)) {
+ tprint_struct_begin();
+ PRINT_FIELD_D(dq, qs_version);
+ if (!abbrev(tcp)) {
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(dq, qs_flags,
+ xfs_quota_flags, "XFS_QUOTA_???");
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_PTR(dq, qs_uquota,
+ print_fs_qfilestat);
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_PTR(dq, qs_gquota,
+ print_fs_qfilestat);
+ tprint_struct_next();
+ PRINT_FIELD_U(dq, qs_incoredqs);
+ tprint_struct_next();
+ PRINT_FIELD_D(dq, qs_btimelimit);
+ tprint_struct_next();
+ PRINT_FIELD_D(dq, qs_itimelimit);
+ tprint_struct_next();
+ PRINT_FIELD_D(dq, qs_rtbtimelimit);
+ tprint_struct_next();
+ PRINT_FIELD_U(dq, qs_bwarnlimit);
+ tprint_struct_next();
+ PRINT_FIELD_U(dq, qs_iwarnlimit);
+ } else {
+ tprint_struct_next();
+ tprint_more_data_follows();
+ }
+ tprint_struct_end();
+ }
+ break;
+ }
+ case Q_XGETQSTATV:
+ {
+ struct fs_quota_statv dq;
+
+ if (entering(tcp)) {
+ tprints(", ");
+
+ return 0;
+ }
+
+ if (umove_or_printaddr(tcp, data, &dq))
+ break;
+ tprint_struct_begin();
+ PRINT_FIELD_D(dq, qs_version);
+ if (!abbrev(tcp)) {
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(dq, qs_flags,
+ xfs_quota_flags, "XFS_QUOTA_???");
+ tprint_struct_next();
+ PRINT_FIELD_U(dq, qs_incoredqs);
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_PTR(dq, qs_uquota,
+ print_fs_qfilestatv);
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_PTR(dq, qs_gquota,
+ print_fs_qfilestatv);
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_PTR(dq, qs_pquota,
+ print_fs_qfilestatv);
+ tprint_struct_next();
+ PRINT_FIELD_D(dq, qs_btimelimit);
+ tprint_struct_next();
+ PRINT_FIELD_D(dq, qs_itimelimit);
+ tprint_struct_next();
+ PRINT_FIELD_D(dq, qs_rtbtimelimit);
+ tprint_struct_next();
+ PRINT_FIELD_U(dq, qs_bwarnlimit);
+ tprint_struct_next();
+ PRINT_FIELD_U(dq, qs_iwarnlimit);
+ } else {
+ tprint_struct_next();
+ tprint_more_data_follows();
+ }
+ tprint_struct_end();
+ break;
+ }
+ case Q_XQUOTAON:
+ case Q_XQUOTAOFF:
+ {
+ uint32_t flag;
+
+ tprints(", ");
+
+ if (umove_or_printaddr(tcp, data, &flag))
+ break;
+ tprints("[");
+ printflags(xfs_quota_flags, flag, "XFS_QUOTA_???");
+ tprints("]");
+ break;
+ }
+ case Q_XQUOTARM:
+ {
+ uint32_t flag;
+
+ tprints(", ");
+
+ if (umove_or_printaddr(tcp, data, &flag))
+ break;
+ tprints("[");
+ printflags(xfs_dqblk_flags, flag, "XFS_???_QUOTA");
+ tprints("]");
+ break;
+ }
+ default:
+ printuid(", ", id);
+ tprints(", ");
+ printaddr(data);
+ break;
+ }
+ return RVAL_DECODED;
+}
+
+static void
+print_qcmd(const uint32_t qcmd)
+{
+ const uint32_t cmd = QCMD_CMD(qcmd);
+ const uint32_t type = QCMD_TYPE(qcmd);
+
+ if (xlat_verbose(xlat_verbosity) != XLAT_STYLE_ABBREV)
+ tprintf("%u", qcmd);
+
+ if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_RAW)
+ return;
+
+ if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE)
+ tprints(" /* ");
+
+ tprints("QCMD(");
+ printxvals_ex(cmd, "Q_???", XLAT_STYLE_ABBREV, quotacmds, NULL);
+ tprints(", ");
+ printxvals_ex(type, "???QUOTA", XLAT_STYLE_ABBREV, quotatypes, NULL);
+ tprints(")");
+
+ if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE)
+ tprints(" */");
+}
+
+SYS_FUNC(quotactl)
+{
+ /*
+ * The Linux kernel only looks at the low 32 bits of command and id
+ * arguments, but on some 64-bit architectures (s390x) this word
+ * will have been sign-extended when we see it. The high 1 bits
+ * don't mean anything, so don't confuse the output with them.
+ */
+ uint32_t qcmd = tcp->u_arg[0];
+ uint32_t cmd = QCMD_CMD(qcmd);
+ uint32_t id = tcp->u_arg[2];
+
+ if (entering(tcp)) {
+ print_qcmd(qcmd);
+ tprints(", ");
+ printpath(tcp, tcp->u_arg[1]);
+ }
+ return decode_cmd_data(tcp, id, cmd, tcp->u_arg[3]);
+}
diff --git a/src/random_ioctl.c b/src/random_ioctl.c
new file mode 100644
index 000000000..b70b47aee
--- /dev/null
+++ b/src/random_ioctl.c
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#include <linux/types.h>
+#include <linux/random.h>
+
+#define XLAT_MACROS_ONLY
+#include "xlat/random_ioctl_cmds.h"
+#undef XLAT_MACROS_ONLY
+
+/*
+ * RNDGETPOOL was removed in 2.6.9, so non-ancient kernels always
+ * return -EINVAL for that.
+ */
+
+int
+random_ioctl(struct tcb *const tcp, const unsigned int code,
+ const kernel_ulong_t arg)
+{
+ struct rand_pool_info info;
+ kernel_ulong_t buf;
+
+ switch (code) {
+ case RNDGETENTCNT:
+ if (entering(tcp))
+ return 0;
+ ATTRIBUTE_FALLTHROUGH;
+ case RNDADDTOENTCNT:
+ tprints(", ");
+ printnum_int(tcp, arg, "%d");
+ break;
+
+ case RNDADDENTROPY:
+ tprints(", ");
+ if (!umove_or_printaddr(tcp, arg, &info)) {
+ tprint_struct_begin();
+ PRINT_FIELD_D(info, entropy_count);
+ tprint_struct_next();
+ PRINT_FIELD_D(info, buf_size);
+ tprint_struct_next();
+ tprints_field_name("buf");
+ buf = arg + offsetof(struct rand_pool_info, buf);
+ printstrn(tcp, buf, info.buf_size);
+ tprint_struct_end();
+ }
+ break;
+
+ /* ioctls with no parameters */
+ case RNDZAPENTCNT:
+ case RNDCLEARPOOL:
+ case RNDRESEEDCRNG:
+ break;
+ default:
+ return RVAL_DECODED;
+ }
+ return RVAL_IOCTL_DECODED;
+}
diff --git a/src/readahead.c b/src/readahead.c
new file mode 100644
index 000000000..92d170aef
--- /dev/null
+++ b/src/readahead.c
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2014-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+SYS_FUNC(readahead)
+{
+ int argn;
+
+ printfd(tcp, tcp->u_arg[0]);
+ argn = printllval(tcp, ", %lld", 1);
+ tprintf(", %" PRI_klu, tcp->u_arg[argn]);
+
+ return RVAL_DECODED;
+}
diff --git a/src/readlink.c b/src/readlink.c
new file mode 100644
index 000000000..1da019df2
--- /dev/null
+++ b/src/readlink.c
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993-1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
+ * Copyright (c) 2006 Ulrich Drepper <drepper@redhat.com>
+ * Copyright (c) 2006 Bernhard Kaindl <bk@suse.de>
+ * Copyright (c) 2006-2015 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2014-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+static int
+decode_readlink(struct tcb *tcp, int offset)
+{
+ if (entering(tcp)) {
+ printpath(tcp, tcp->u_arg[offset]);
+ tprints(", ");
+ } else {
+ if (syserror(tcp))
+ printaddr(tcp->u_arg[offset + 1]);
+ else
+ /* Used to use printpathn(), but readlink
+ * neither includes NUL in the returned count,
+ * nor actually writes it into memory.
+ * printpathn() would decide on printing
+ * "..." continuation based on garbage
+ * past return buffer's end.
+ */
+ printstrn(tcp, tcp->u_arg[offset + 1], tcp->u_rval);
+ tprintf(", %" PRI_klu, tcp->u_arg[offset + 2]);
+ }
+ return 0;
+}
+
+SYS_FUNC(readlink)
+{
+ return decode_readlink(tcp, 0);
+}
+
+SYS_FUNC(readlinkat)
+{
+ if (entering(tcp)) {
+ print_dirfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ }
+ return decode_readlink(tcp, 1);
+}
diff --git a/src/reboot.c b/src/reboot.c
new file mode 100644
index 000000000..e0fe65b1c
--- /dev/null
+++ b/src/reboot.c
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2014-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#include "xlat/bootflags1.h"
+#include "xlat/bootflags2.h"
+#include "xlat/bootflags3.h"
+
+SYS_FUNC(reboot)
+{
+ const unsigned int magic1 = tcp->u_arg[0];
+ const unsigned int magic2 = tcp->u_arg[1];
+ const unsigned int cmd = tcp->u_arg[2];
+
+ printxval(bootflags1, magic1, "LINUX_REBOOT_MAGIC_???");
+ tprints(", ");
+ printxval(bootflags2, magic2, "LINUX_REBOOT_MAGIC_???");
+ tprints(", ");
+ printxval(bootflags3, cmd, "LINUX_REBOOT_CMD_???");
+ if (cmd == LINUX_REBOOT_CMD_RESTART2) {
+ tprints(", ");
+ /*
+ * The size of kernel buffer is 256 bytes and
+ * the last byte is always zero, at most 255 bytes
+ * are copied from the user space.
+ */
+ printstr_ex(tcp, tcp->u_arg[3], 255, QUOTE_0_TERMINATED);
+ }
+ return RVAL_DECODED;
+}
diff --git a/src/regs.h b/src/regs.h
new file mode 100644
index 000000000..f0f359ca5
--- /dev/null
+++ b/src/regs.h
@@ -0,0 +1,14 @@
+/*
+ * Copyright (c) 2015-2018 Dmitry V. Levin <ldv@strace.io>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_REGS_H
+# define STRACE_REGS_H
+
+# include <sys/user.h>
+# include "arch_regs.h"
+
+#endif /* !STRACE_REGS_H */
diff --git a/src/renameat.c b/src/renameat.c
new file mode 100644
index 000000000..584ea0206
--- /dev/null
+++ b/src/renameat.c
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2014-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+static void
+decode_renameat(struct tcb *tcp)
+{
+ print_dirfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ printpath(tcp, tcp->u_arg[1]);
+ tprints(", ");
+ print_dirfd(tcp, tcp->u_arg[2]);
+ tprints(", ");
+ printpath(tcp, tcp->u_arg[3]);
+}
+
+SYS_FUNC(renameat)
+{
+ decode_renameat(tcp);
+
+ return RVAL_DECODED;
+}
+
+#include <linux/fs.h>
+#include "xlat/rename_flags.h"
+
+SYS_FUNC(renameat2)
+{
+ decode_renameat(tcp);
+ tprints(", ");
+ printflags(rename_flags, tcp->u_arg[4], "RENAME_??");
+
+ return RVAL_DECODED;
+}
diff --git a/src/resource.c b/src/resource.c
new file mode 100644
index 000000000..26c172058
--- /dev/null
+++ b/src/resource.c
@@ -0,0 +1,217 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
+ * Copyright (c) 1999-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include <sys/resource.h>
+
+#include "xstring.h"
+
+#include "xlat/resources.h"
+
+static void
+print_rlim64_t(uint64_t lim) {
+ const char *str = NULL;
+
+ if (lim == UINT64_MAX)
+ str = "RLIM64_INFINITY";
+ else if (lim > 1024 && lim % 1024 == 0) {
+ static char buf[sizeof(lim) * 3 + sizeof("*1024")];
+
+ xsprintf(buf, "%" PRIu64 "*1024", lim / 1024);
+ str = buf;
+ }
+
+ if (!str || xlat_verbose(xlat_verbosity) != XLAT_STYLE_ABBREV)
+ tprintf("%" PRIu64, lim);
+
+ if (!str || xlat_verbose(xlat_verbosity) == XLAT_STYLE_RAW)
+ return;
+
+ (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE
+ ? tprints_comment : tprints)(str);
+}
+
+static void
+print_rlimit64(struct tcb *const tcp, const kernel_ulong_t addr)
+{
+ struct rlimit_64 {
+ uint64_t rlim_cur;
+ uint64_t rlim_max;
+ } rlim;
+
+ if (!umove_or_printaddr(tcp, addr, &rlim)) {
+ tprint_struct_begin();
+ PRINT_FIELD_OBJ_VAL(rlim, rlim_cur, print_rlim64_t);
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_VAL(rlim, rlim_max, print_rlim64_t);
+ tprint_struct_end();
+ }
+}
+
+#if !defined(current_wordsize) || current_wordsize == 4
+
+static void
+print_rlim32_t(uint32_t lim) {
+ const char *str = NULL;
+
+ if (lim == UINT32_MAX)
+ str = "RLIM_INFINITY";
+ else if (lim > 1024 && lim % 1024 == 0) {
+ static char buf[sizeof(lim) * 3 + sizeof("*1024")];
+
+ xsprintf(buf, "%" PRIu32 "*1024", lim / 1024);
+ str = buf;
+ }
+
+ if (!str || xlat_verbose(xlat_verbosity) != XLAT_STYLE_ABBREV)
+ tprintf("%" PRIu32, lim);
+
+ if (!str || xlat_verbose(xlat_verbosity) == XLAT_STYLE_RAW)
+ return;
+
+ (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE
+ ? tprints_comment : tprints)(str);
+}
+
+static void
+print_rlimit32(struct tcb *const tcp, const kernel_ulong_t addr)
+{
+ struct rlimit_32 {
+ uint32_t rlim_cur;
+ uint32_t rlim_max;
+ } rlim;
+
+ if (!umove_or_printaddr(tcp, addr, &rlim)) {
+ tprint_struct_begin();
+ PRINT_FIELD_OBJ_VAL(rlim, rlim_cur, print_rlim32_t);
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_VAL(rlim, rlim_max, print_rlim32_t);
+ tprint_struct_end();
+ }
+}
+
+static void
+decode_rlimit(struct tcb *const tcp, const kernel_ulong_t addr)
+{
+ /*
+ * i386 is the only personality on X86_64 and X32
+ * with 32-bit rlim_t.
+ * When current_personality is X32, current_wordsize
+ * equals to 4 but rlim_t is 64-bit.
+ */
+ if (current_klongsize == 4)
+ print_rlimit32(tcp, addr);
+ else
+ print_rlimit64(tcp, addr);
+}
+
+#else /* defined(current_wordsize) && current_wordsize != 4 */
+
+# define decode_rlimit print_rlimit64
+
+#endif
+
+SYS_FUNC(getrlimit)
+{
+ if (entering(tcp)) {
+ printxval(resources, tcp->u_arg[0], "RLIMIT_???");
+ tprints(", ");
+ } else {
+ decode_rlimit(tcp, tcp->u_arg[1]);
+ }
+ return 0;
+}
+
+SYS_FUNC(setrlimit)
+{
+ printxval(resources, tcp->u_arg[0], "RLIMIT_???");
+ tprints(", ");
+ decode_rlimit(tcp, tcp->u_arg[1]);
+
+ return RVAL_DECODED;
+}
+
+SYS_FUNC(prlimit64)
+{
+ if (entering(tcp)) {
+ printpid(tcp, tcp->u_arg[0], PT_TGID);
+ tprints(", ");
+ printxval(resources, tcp->u_arg[1], "RLIMIT_???");
+ tprints(", ");
+ print_rlimit64(tcp, tcp->u_arg[2]);
+ tprints(", ");
+ } else {
+ print_rlimit64(tcp, tcp->u_arg[3]);
+ }
+ return 0;
+}
+
+#include "xlat/usagewho.h"
+
+SYS_FUNC(getrusage)
+{
+ if (entering(tcp)) {
+ printxval(usagewho, tcp->u_arg[0], "RUSAGE_???");
+ tprints(", ");
+ } else
+ printrusage(tcp, tcp->u_arg[1]);
+ return 0;
+}
+
+#ifdef ALPHA
+SYS_FUNC(osf_getrusage)
+{
+ if (entering(tcp)) {
+ printxval(usagewho, tcp->u_arg[0], "RUSAGE_???");
+ tprints(", ");
+ } else
+ printrusage32(tcp, tcp->u_arg[1]);
+ return 0;
+}
+#endif /* ALPHA */
+
+#include "xlat/priorities.h"
+
+static void
+priority_print_who(struct tcb *tcp, int which, int who)
+{
+ switch (which)
+ {
+ case PRIO_PROCESS:
+ printpid(tcp, who, PT_TGID);
+ break;
+ case PRIO_PGRP:
+ printpid(tcp, who, PT_PGID);
+ break;
+ default:
+ tprintf("%d", who);
+ break;
+ }
+}
+
+SYS_FUNC(getpriority)
+{
+ printxval(priorities, tcp->u_arg[0], "PRIO_???");
+ tprints(", ");
+ priority_print_who(tcp, tcp->u_arg[0], tcp->u_arg[1]);
+
+ return RVAL_DECODED;
+}
+
+SYS_FUNC(setpriority)
+{
+ printxval(priorities, tcp->u_arg[0], "PRIO_???");
+ tprints(", ");
+ priority_print_who(tcp, tcp->u_arg[0], tcp->u_arg[1]);
+ tprintf(", %d", (int) tcp->u_arg[2]);
+
+ return RVAL_DECODED;
+}
diff --git a/src/retval.c b/src/retval.c
new file mode 100644
index 000000000..4d5721c80
--- /dev/null
+++ b/src/retval.c
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include "retval.h"
+
+static kernel_long_t *retval_vec;
+static size_t retval_vec_capacity; /* size of the arena */
+static size_t retval_vec_size; /* size of the used arena */
+
+static void
+expand_retval_vec(void)
+{
+ const size_t old_capacity = retval_vec_capacity;
+ retval_vec = xgrowarray(retval_vec, &retval_vec_capacity,
+ sizeof(*retval_vec));
+ memset(retval_vec + old_capacity, 0,
+ (retval_vec_capacity - old_capacity)
+ * sizeof(*retval_vec));
+}
+
+uint16_t
+retval_new(const kernel_long_t rval)
+{
+ const uint16_t idx = retval_vec_size;
+
+ if (idx < retval_vec_size)
+ error_func_msg_and_die("retval index overflow");
+
+ if (retval_vec_size == retval_vec_capacity)
+ expand_retval_vec();
+
+ retval_vec[idx] = rval;
+ ++retval_vec_size;
+
+ return idx;
+}
+
+kernel_long_t
+retval_get(const uint16_t rval_idx)
+{
+ if (rval_idx >= retval_vec_size)
+ error_func_msg_and_die("rval_idx >= retval_vec_size");
+
+ return retval_vec[rval_idx];
+}
diff --git a/src/retval.h b/src/retval.h
new file mode 100644
index 000000000..b8a5ee925
--- /dev/null
+++ b/src/retval.h
@@ -0,0 +1,15 @@
+/*
+ * Copyright (c) 2018 Dmitry V. Levin <ldv@strace.io>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+/* retval to index and visa versa. */
+#ifndef STRACE_RETVAL_H
+# define STRACE_RETVAL_H
+
+uint16_t retval_new(kernel_long_t rval);
+kernel_long_t retval_get(uint16_t rval_idx);
+
+#endif /* !STRACE_RETVAL_H */
diff --git a/src/riscv.c b/src/riscv.c
new file mode 100644
index 000000000..825eb2936
--- /dev/null
+++ b/src/riscv.c
@@ -0,0 +1,33 @@
+/*
+ * RISC-V-specific syscall decoders.
+ *
+ * Copyright (c) 2018-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#ifdef RISCV64
+
+# include "xlat/riscv_flush_icache_flags.h"
+
+SYS_FUNC(riscv_flush_icache)
+{
+ /* uintptr_t start */
+ printaddr(tcp->u_arg[0]);
+
+ /* uintptr_t end */
+ tprints(", ");
+ printaddr(tcp->u_arg[1]);
+
+ /* uintptr_t flags */
+ tprints(", ");
+ printflags64(riscv_flush_icache_flags, tcp->u_arg[2],
+ "SYS_RISCV_FLUSH_ICACHE_???");
+
+ return RVAL_DECODED;
+}
+
+#endif /* RISCV64 */
diff --git a/src/rt_sigframe.c b/src/rt_sigframe.c
new file mode 100644
index 000000000..ce21f3a35
--- /dev/null
+++ b/src/rt_sigframe.c
@@ -0,0 +1,17 @@
+/*
+ * Copyright (c) 2017 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2017-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include "ptrace.h"
+#include "regs.h"
+
+#define DEF_FUNC_GET_RT_SIGFRAME_ADDR \
+ kernel_ulong_t get_rt_sigframe_addr(struct tcb *tcp)
+#define FUNC_GET_RT_SIGFRAME_ADDR DEF_FUNC_GET_RT_SIGFRAME_ADDR
+
+#include "arch_rt_sigframe.c"
diff --git a/src/rt_sigreturn.c b/src/rt_sigreturn.c
new file mode 100644
index 000000000..cdbe7e927
--- /dev/null
+++ b/src/rt_sigreturn.c
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2017-2018 Dmitry V. Levin <ldv@strace.io>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#include DEF_MPERS_TYPE(struct_rt_sigframe)
+
+#include "rt_sigframe.h"
+
+#include MPERS_DEFS
+
+#ifndef OFFSETOF_SIGMASK_IN_RT_SIGFRAME
+# define OFFSETOF_SIGMASK_IN_RT_SIGFRAME \
+ offsetof(struct_rt_sigframe, uc.uc_sigmask)
+#endif
+
+SYS_FUNC(rt_sigreturn)
+{
+ const kernel_ulong_t sf_addr = get_rt_sigframe_addr(tcp);
+
+ if (sf_addr) {
+ const kernel_ulong_t sm_addr =
+ sf_addr + OFFSETOF_SIGMASK_IN_RT_SIGFRAME;
+ print_sigset_addr(tcp, sm_addr);
+ }
+
+ return RVAL_DECODED;
+}
diff --git a/src/rtc.c b/src/rtc.c
new file mode 100644
index 000000000..2217b5055
--- /dev/null
+++ b/src/rtc.c
@@ -0,0 +1,183 @@
+/*
+ * Copyright (c) 2004 Ulrich Drepper <drepper@redhat.com>
+ * Copyright (c) 2004-2016 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2015-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#include DEF_MPERS_TYPE(struct_rtc_pll_info)
+
+#include <linux/ioctl.h>
+#include <linux/rtc.h>
+
+typedef struct rtc_pll_info struct_rtc_pll_info;
+
+#include MPERS_DEFS
+
+#include "xlat/rtc_vl_flags.h"
+
+#define XLAT_MACROS_ONLY
+# include "xlat/rtc_ioctl_cmds.h"
+#undef XLAT_MACROS_ONLY
+
+static void
+print_rtc_time(struct tcb *tcp, const struct rtc_time *rt)
+{
+ tprint_struct_begin();
+ PRINT_FIELD_D(*rt, tm_sec);
+ tprint_struct_next();
+ PRINT_FIELD_D(*rt, tm_min);
+ tprint_struct_next();
+ PRINT_FIELD_D(*rt, tm_hour);
+ tprint_struct_next();
+ PRINT_FIELD_D(*rt, tm_mday);
+ tprint_struct_next();
+ PRINT_FIELD_D(*rt, tm_mon);
+ tprint_struct_next();
+ PRINT_FIELD_D(*rt, tm_year);
+ if (abbrev(tcp)) {
+ tprint_struct_next();
+ tprint_more_data_follows();
+ } else {
+ tprint_struct_next();
+ PRINT_FIELD_D(*rt, tm_wday);
+ tprint_struct_next();
+ PRINT_FIELD_D(*rt, tm_yday);
+ tprint_struct_next();
+ PRINT_FIELD_D(*rt, tm_isdst);
+ }
+ tprint_struct_end();
+}
+
+static void
+decode_rtc_time(struct tcb *const tcp, const kernel_ulong_t addr)
+{
+ struct rtc_time rt;
+
+ if (!umove_or_printaddr(tcp, addr, &rt))
+ print_rtc_time(tcp, &rt);
+}
+
+static void
+decode_rtc_wkalrm(struct tcb *const tcp, const kernel_ulong_t addr)
+{
+ struct rtc_wkalrm wk;
+
+ if (umove_or_printaddr(tcp, addr, &wk))
+ return;
+
+ tprint_struct_begin();
+ PRINT_FIELD_U(wk, enabled);
+ tprint_struct_next();
+ PRINT_FIELD_U(wk, pending);
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_TCB_PTR(wk, time, tcp, print_rtc_time);
+ tprint_struct_end();
+}
+
+static void
+decode_rtc_pll_info(struct tcb *const tcp, const kernel_ulong_t addr)
+{
+ struct_rtc_pll_info pll;
+
+ if (umove_or_printaddr(tcp, addr, &pll))
+ return;
+
+ tprint_struct_begin();
+ PRINT_FIELD_D(pll, pll_ctrl);
+ tprint_struct_next();
+ PRINT_FIELD_D(pll, pll_value);
+ tprint_struct_next();
+ PRINT_FIELD_D(pll, pll_max);
+ tprint_struct_next();
+ PRINT_FIELD_D(pll, pll_min);
+ tprint_struct_next();
+ PRINT_FIELD_D(pll, pll_posmult);
+ tprint_struct_next();
+ PRINT_FIELD_D(pll, pll_negmult);
+ tprint_struct_next();
+ PRINT_FIELD_D(pll, pll_clock);
+ tprint_struct_end();
+}
+
+static void
+decode_rtc_vl(struct tcb *const tcp, const kernel_ulong_t addr)
+{
+ unsigned int val;
+
+ if (umove_or_printaddr(tcp, addr, &val))
+ return;
+
+ tprints("[");
+ printflags(rtc_vl_flags, val, "RTC_VL_???");
+ tprints("]");
+}
+
+MPERS_PRINTER_DECL(int, rtc_ioctl, struct tcb *const tcp,
+ const unsigned int code, const kernel_ulong_t arg)
+{
+ switch (code) {
+ case RTC_ALM_READ:
+ case RTC_RD_TIME:
+ if (entering(tcp))
+ return 0;
+ ATTRIBUTE_FALLTHROUGH;
+ case RTC_ALM_SET:
+ case RTC_SET_TIME:
+ tprints(", ");
+ decode_rtc_time(tcp, arg);
+ break;
+ case RTC_IRQP_SET:
+ case RTC_EPOCH_SET:
+ tprintf(", %" PRI_klu, arg);
+ break;
+ case RTC_IRQP_READ:
+ case RTC_EPOCH_READ:
+ if (entering(tcp))
+ return 0;
+ tprints(", ");
+ printnum_ulong(tcp, arg);
+ break;
+ case RTC_WKALM_RD:
+ if (entering(tcp))
+ return 0;
+ ATTRIBUTE_FALLTHROUGH;
+ case RTC_WKALM_SET:
+ tprints(", ");
+ decode_rtc_wkalrm(tcp, arg);
+ break;
+ case RTC_PLL_GET:
+ if (entering(tcp))
+ return 0;
+ ATTRIBUTE_FALLTHROUGH;
+ case RTC_PLL_SET:
+ tprints(", ");
+ decode_rtc_pll_info(tcp, arg);
+ break;
+ case RTC_VL_READ:
+ if (entering(tcp))
+ return 0;
+ tprints(", ");
+ decode_rtc_vl(tcp, arg);
+ break;
+ case RTC_AIE_ON:
+ case RTC_AIE_OFF:
+ case RTC_UIE_ON:
+ case RTC_UIE_OFF:
+ case RTC_PIE_ON:
+ case RTC_PIE_OFF:
+ case RTC_WIE_ON:
+ case RTC_WIE_OFF:
+ case RTC_VL_CLR:
+ /* no args */
+ break;
+ default:
+ return RVAL_DECODED;
+ }
+
+ return RVAL_IOCTL_DECODED;
+}
diff --git a/src/rtnl_addr.c b/src/rtnl_addr.c
new file mode 100644
index 000000000..8d43db750
--- /dev/null
+++ b/src/rtnl_addr.c
@@ -0,0 +1,128 @@
+/*
+ * Copyright (c) 2016 Fabien Siron <fabien.siron@epita.fr>
+ * Copyright (c) 2017 JingPiao Chen <chenjingpiao@gmail.com>
+ * Copyright (c) 2016-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include "netlink_route.h"
+#include "nlattr.h"
+
+#include "netlink.h"
+#include <linux/rtnetlink.h>
+#ifdef HAVE_LINUX_IF_ADDR_H
+# include <linux/if_addr.h>
+#endif
+
+#include "xlat/ifaddrflags.h"
+#include "xlat/routing_scopes.h"
+#include "xlat/rtnl_addr_attrs.h"
+
+static bool
+decode_ifa_address(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ const struct ifaddrmsg *const ifaddr = opaque_data;
+
+ decode_inet_addr(tcp, addr, len, ifaddr->ifa_family, NULL);
+
+ return true;
+}
+
+static bool
+decode_ifa_cacheinfo(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ struct ifa_cacheinfo ci;
+
+ if (len < sizeof(ci))
+ return false;
+ else if (!umove_or_printaddr(tcp, addr, &ci)) {
+ tprint_struct_begin();
+ PRINT_FIELD_U(ci, ifa_prefered);
+ tprint_struct_next();
+ PRINT_FIELD_U(ci, ifa_valid);
+ tprint_struct_next();
+ PRINT_FIELD_U(ci, cstamp);
+ tprint_struct_next();
+ PRINT_FIELD_U(ci, tstamp);
+ tprint_struct_end();
+ }
+
+ return true;
+}
+
+static bool
+decode_ifa_flags(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ uint32_t ifa_flags;
+
+ if (len < sizeof(ifa_flags))
+ return false;
+ else if (!umove_or_printaddr(tcp, addr, &ifa_flags))
+ printflags(ifaddrflags, ifa_flags, "IFA_F_???");
+
+ return true;
+}
+
+static const nla_decoder_t ifaddrmsg_nla_decoders[] = {
+ [IFA_ADDRESS] = decode_ifa_address,
+ [IFA_LOCAL] = decode_ifa_address,
+ [IFA_LABEL] = decode_nla_str,
+ [IFA_BROADCAST] = decode_ifa_address,
+ [IFA_ANYCAST] = decode_ifa_address,
+ [IFA_CACHEINFO] = decode_ifa_cacheinfo,
+ [IFA_MULTICAST] = decode_ifa_address,
+ [IFA_FLAGS] = decode_ifa_flags,
+ [IFA_RT_PRIORITY] = decode_nla_u32,
+ [IFA_TARGET_NETNSID] = decode_nla_s32,
+};
+
+DECL_NETLINK_ROUTE_DECODER(decode_ifaddrmsg)
+{
+ struct ifaddrmsg ifaddr = { .ifa_family = family };
+ size_t offset = sizeof(ifaddr.ifa_family);
+ bool decode_nla = false;
+
+ tprint_struct_begin();
+ PRINT_FIELD_XVAL(ifaddr, ifa_family, addrfams, "AF_???");
+
+ tprints(", ");
+ if (len >= sizeof(ifaddr)) {
+ if (!umoven_or_printaddr(tcp, addr + offset,
+ sizeof(ifaddr) - offset,
+ (char *) &ifaddr + offset)) {
+ PRINT_FIELD_U(ifaddr, ifa_prefixlen);
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(ifaddr, ifa_flags,
+ ifaddrflags, "IFA_F_???");
+ tprint_struct_next();
+ PRINT_FIELD_XVAL(ifaddr, ifa_scope,
+ routing_scopes, NULL);
+ tprint_struct_next();
+ PRINT_FIELD_IFINDEX(ifaddr, ifa_index);
+ decode_nla = true;
+ }
+ } else
+ tprint_more_data_follows();
+ tprint_struct_end();
+
+ offset = NLMSG_ALIGN(sizeof(ifaddr));
+ if (decode_nla && len > offset) {
+ tprints(", ");
+ decode_nlattr(tcp, addr + offset, len - offset,
+ rtnl_addr_attrs, "IFA_???",
+ ifaddrmsg_nla_decoders,
+ ARRAY_SIZE(ifaddrmsg_nla_decoders), &ifaddr);
+ }
+}
diff --git a/src/rtnl_addrlabel.c b/src/rtnl_addrlabel.c
new file mode 100644
index 000000000..c4b22f012
--- /dev/null
+++ b/src/rtnl_addrlabel.c
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2016 Fabien Siron <fabien.siron@epita.fr>
+ * Copyright (c) 2017 JingPiao Chen <chenjingpiao@gmail.com>
+ * Copyright (c) 2016-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#ifdef HAVE_STRUCT_IFADDRLBLMSG
+
+# include "netlink_route.h"
+# include "nlattr.h"
+
+# include <linux/if_addrlabel.h>
+# include "netlink.h"
+
+# include "xlat/rtnl_addrlabel_attrs.h"
+
+static bool
+decode_ifal_address(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ const struct ifaddrlblmsg *const ifal = opaque_data;
+
+ decode_inet_addr(tcp, addr, len, ifal->ifal_family, NULL);
+
+ return true;
+}
+
+static const nla_decoder_t ifaddrlblmsg_nla_decoders[] = {
+ [IFAL_ADDRESS] = decode_ifal_address,
+ [IFAL_LABEL] = decode_nla_u32
+};
+
+DECL_NETLINK_ROUTE_DECODER(decode_ifaddrlblmsg)
+{
+ struct ifaddrlblmsg ifal = { .ifal_family = family };
+ size_t offset = sizeof(ifal.ifal_family);
+ bool decode_nla = false;
+
+ tprint_struct_begin();
+ PRINT_FIELD_XVAL(ifal, ifal_family, addrfams, "AF_???");
+
+ tprints(", ");
+ if (len >= sizeof(ifal)) {
+ if (!umoven_or_printaddr(tcp, addr + offset,
+ sizeof(ifal) - offset,
+ (char *) &ifal + offset)) {
+ PRINT_FIELD_U(ifal, ifal_prefixlen);
+ tprint_struct_next();
+ PRINT_FIELD_U(ifal, ifal_flags);
+ tprint_struct_next();
+ PRINT_FIELD_IFINDEX(ifal, ifal_index);
+ tprint_struct_next();
+ PRINT_FIELD_U(ifal, ifal_seq);
+ decode_nla = true;
+ }
+ } else
+ tprint_more_data_follows();
+ tprint_struct_end();
+
+ offset = NLMSG_ALIGN(sizeof(ifal));
+ if (decode_nla && len > offset) {
+ tprints(", ");
+ decode_nlattr(tcp, addr + offset, len - offset,
+ rtnl_addrlabel_attrs, "IFAL_???",
+ ifaddrlblmsg_nla_decoders,
+ ARRAY_SIZE(ifaddrlblmsg_nla_decoders), &ifal);
+ }
+}
+
+#endif
diff --git a/src/rtnl_dcb.c b/src/rtnl_dcb.c
new file mode 100644
index 000000000..f2c1b8077
--- /dev/null
+++ b/src/rtnl_dcb.c
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2016 Fabien Siron <fabien.siron@epita.fr>
+ * Copyright (c) 2017 JingPiao Chen <chenjingpiao@gmail.com>
+ * Copyright (c) 2016-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#ifdef HAVE_STRUCT_DCBMSG
+
+# include "netlink_route.h"
+# include "nlattr.h"
+
+# include <linux/dcbnl.h>
+# include "netlink.h"
+
+# include "xlat/dcb_commands.h"
+# include "xlat/rtnl_dcb_attrs.h"
+
+DECL_NETLINK_ROUTE_DECODER(decode_dcbmsg)
+{
+ struct dcbmsg dcb = { .dcb_family = family };
+ size_t offset = sizeof(dcb.dcb_family);
+ bool decode_nla = false;
+
+ tprint_struct_begin();
+ PRINT_FIELD_XVAL(dcb, dcb_family, addrfams, "AF_???");
+
+ tprints(", ");
+ if (len >= sizeof(dcb)) {
+ if (!umoven_or_printaddr(tcp, addr + offset,
+ sizeof(dcb) - offset,
+ (char *) &dcb + offset)) {
+ PRINT_FIELD_XVAL(dcb, cmd,
+ dcb_commands, "DCB_CMD_???");
+ decode_nla = true;
+ }
+ } else
+ tprint_more_data_follows();
+ tprint_struct_end();
+
+ offset = NLMSG_ALIGN(sizeof(dcb));
+ if (decode_nla && len > offset) {
+ tprints(", ");
+ decode_nlattr(tcp, addr + offset, len - offset,
+ rtnl_dcb_attrs, "DCB_ATTR_???", NULL, 0, NULL);
+ }
+}
+
+#endif
diff --git a/src/rtnl_link.c b/src/rtnl_link.c
new file mode 100644
index 000000000..93507c290
--- /dev/null
+++ b/src/rtnl_link.c
@@ -0,0 +1,1023 @@
+/*
+ * Copyright (c) 2016 Fabien Siron <fabien.siron@epita.fr>
+ * Copyright (c) 2017 JingPiao Chen <chenjingpiao@gmail.com>
+ * Copyright (c) 2016-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include "netlink_route.h"
+#include "nlattr.h"
+
+#include "netlink.h"
+
+#include <netinet/in.h>
+
+#include <linux/rtnetlink.h>
+
+#include "types/rtnl_link.h"
+
+#include "xlat/in6_addr_gen_mode.h"
+#include "xlat/inet_devconf_indices.h"
+#include "xlat/inet6_devconf_indices.h"
+#include "xlat/inet6_if_flags.h"
+#include "xlat/rtnl_ifla_af_spec_inet_attrs.h"
+#include "xlat/rtnl_ifla_af_spec_inet6_attrs.h"
+#include "xlat/rtnl_ifla_brport_attrs.h"
+#include "xlat/rtnl_ifla_events.h"
+#include "xlat/rtnl_ifla_info_attrs.h"
+#include "xlat/rtnl_ifla_info_data_bridge_attrs.h"
+#include "xlat/rtnl_ifla_info_data_tun_attrs.h"
+#include "xlat/rtnl_ifla_port_attrs.h"
+#include "xlat/rtnl_ifla_vf_port_attrs.h"
+#include "xlat/rtnl_ifla_xdp_attached_mode.h"
+#include "xlat/rtnl_ifla_xdp_attrs.h"
+#include "xlat/rtnl_link_attrs.h"
+#include "xlat/snmp_icmp6_stats.h"
+#include "xlat/snmp_ip_stats.h"
+#include "xlat/tun_device_types.h"
+#include "xlat/xdp_flags.h"
+
+static bool
+decode_ifla_hwaddr(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ const struct ifinfomsg *ifinfo = (const struct ifinfomsg *) opaque_data;
+
+ return decode_nla_hwaddr_family(tcp, addr, len, ifinfo->ifi_family);
+}
+
+static bool
+decode_rtnl_link_stats(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ struct_rtnl_link_stats st;
+ const unsigned int min_size =
+ offsetofend(struct_rtnl_link_stats, tx_compressed);
+ const unsigned int def_size = sizeof(st);
+ const unsigned int size =
+ (len >= def_size) ? def_size :
+ ((len == min_size) ? min_size : 0);
+
+ if (!size)
+ return false;
+
+ if (!umoven_or_printaddr(tcp, addr, size, &st)) {
+ tprint_struct_begin();
+ PRINT_FIELD_U(st, rx_packets);
+ tprint_struct_next();
+ PRINT_FIELD_U(st, tx_packets);
+ tprint_struct_next();
+ PRINT_FIELD_U(st, rx_bytes);
+ tprint_struct_next();
+ PRINT_FIELD_U(st, tx_bytes);
+ tprint_struct_next();
+ PRINT_FIELD_U(st, rx_errors);
+ tprint_struct_next();
+ PRINT_FIELD_U(st, tx_errors);
+ tprint_struct_next();
+ PRINT_FIELD_U(st, rx_dropped);
+ tprint_struct_next();
+ PRINT_FIELD_U(st, tx_dropped);
+ tprint_struct_next();
+ PRINT_FIELD_U(st, multicast);
+ tprint_struct_next();
+ PRINT_FIELD_U(st, collisions);
+
+ tprint_struct_next();
+ PRINT_FIELD_U(st, rx_length_errors);
+ tprint_struct_next();
+ PRINT_FIELD_U(st, rx_over_errors);
+ tprint_struct_next();
+ PRINT_FIELD_U(st, rx_crc_errors);
+ tprint_struct_next();
+ PRINT_FIELD_U(st, rx_frame_errors);
+ tprint_struct_next();
+ PRINT_FIELD_U(st, rx_fifo_errors);
+ tprint_struct_next();
+ PRINT_FIELD_U(st, rx_missed_errors);
+
+ tprint_struct_next();
+ PRINT_FIELD_U(st, tx_aborted_errors);
+ tprint_struct_next();
+ PRINT_FIELD_U(st, tx_carrier_errors);
+ tprint_struct_next();
+ PRINT_FIELD_U(st, tx_fifo_errors);
+ tprint_struct_next();
+ PRINT_FIELD_U(st, tx_heartbeat_errors);
+ tprint_struct_next();
+ PRINT_FIELD_U(st, tx_window_errors);
+
+ tprint_struct_next();
+ PRINT_FIELD_U(st, rx_compressed);
+ tprint_struct_next();
+ PRINT_FIELD_U(st, tx_compressed);
+
+ if (len >= def_size) {
+ tprint_struct_next();
+ PRINT_FIELD_U(st, rx_nohandler);
+ }
+ tprint_struct_end();
+ }
+
+ return true;
+}
+
+static bool
+decode_ifla_bridge_id(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ struct {
+ uint8_t prio[2];
+ uint8_t addr[6];
+ } id;
+
+ if (len < sizeof(id))
+ return false;
+ else if (!umove_or_printaddr(tcp, addr, &id)) {
+ tprint_struct_begin();
+ PRINT_FIELD_ARRAY(id, prio, tcp,
+ print_uint8_array_member);
+ tprint_struct_next();
+ PRINT_FIELD_MAC(id, addr);
+ tprint_struct_end();
+ }
+
+ return true;
+}
+
+static const nla_decoder_t ifla_brport_nla_decoders[] = {
+ [IFLA_BRPORT_STATE] = decode_nla_u8,
+ [IFLA_BRPORT_PRIORITY] = decode_nla_u16,
+ [IFLA_BRPORT_COST] = decode_nla_u32,
+ [IFLA_BRPORT_MODE] = decode_nla_u8,
+ [IFLA_BRPORT_GUARD] = decode_nla_u8,
+ [IFLA_BRPORT_PROTECT] = decode_nla_u8,
+ [IFLA_BRPORT_FAST_LEAVE] = decode_nla_u8,
+ [IFLA_BRPORT_LEARNING] = decode_nla_u8,
+ [IFLA_BRPORT_UNICAST_FLOOD] = decode_nla_u8,
+ [IFLA_BRPORT_PROXYARP] = decode_nla_u8,
+ [IFLA_BRPORT_LEARNING_SYNC] = decode_nla_u8,
+ [IFLA_BRPORT_PROXYARP_WIFI] = decode_nla_u8,
+ [IFLA_BRPORT_ROOT_ID] = decode_ifla_bridge_id,
+ [IFLA_BRPORT_BRIDGE_ID] = decode_ifla_bridge_id,
+ [IFLA_BRPORT_DESIGNATED_PORT] = decode_nla_u16,
+ [IFLA_BRPORT_DESIGNATED_COST] = decode_nla_u16,
+ [IFLA_BRPORT_ID] = decode_nla_u16,
+ [IFLA_BRPORT_NO] = decode_nla_u16,
+ [IFLA_BRPORT_TOPOLOGY_CHANGE_ACK] = decode_nla_u8,
+ [IFLA_BRPORT_CONFIG_PENDING] = decode_nla_u8,
+ [IFLA_BRPORT_MESSAGE_AGE_TIMER] = decode_nla_u64,
+ [IFLA_BRPORT_FORWARD_DELAY_TIMER] = decode_nla_u64,
+ [IFLA_BRPORT_HOLD_TIMER] = decode_nla_u64,
+ [IFLA_BRPORT_FLUSH] = NULL,
+ [IFLA_BRPORT_MULTICAST_ROUTER] = decode_nla_u8,
+ [IFLA_BRPORT_PAD] = NULL,
+ [IFLA_BRPORT_MCAST_FLOOD] = decode_nla_u8,
+ [IFLA_BRPORT_MCAST_TO_UCAST] = decode_nla_u8,
+ [IFLA_BRPORT_VLAN_TUNNEL] = decode_nla_u8,
+ [IFLA_BRPORT_BCAST_FLOOD] = decode_nla_u8,
+ [IFLA_BRPORT_GROUP_FWD_MASK] = decode_nla_u16,
+ [IFLA_BRPORT_NEIGH_SUPPRESS] = decode_nla_u8,
+ [IFLA_BRPORT_ISOLATED] = decode_nla_u8,
+ [IFLA_BRPORT_BACKUP_PORT] = decode_nla_ifindex,
+};
+
+static bool
+decode_ifla_protinfo(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ decode_nlattr(tcp, addr, len, rtnl_ifla_brport_attrs,
+ "IFLA_BRPORT_???",
+ ARRSZ_PAIR(ifla_brport_nla_decoders), opaque_data);
+
+ return true;
+}
+
+static bool
+decode_rtnl_link_ifmap(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ struct rtnl_link_ifmap map;
+ const unsigned int sizeof_ifmap =
+ offsetofend(struct rtnl_link_ifmap, port);
+
+ if (len < sizeof_ifmap)
+ return false;
+ else if (!umoven_or_printaddr(tcp, addr, sizeof_ifmap, &map)) {
+ tprint_struct_begin();
+ PRINT_FIELD_X(map, mem_start);
+ tprint_struct_next();
+ PRINT_FIELD_X(map, mem_end);
+ tprint_struct_next();
+ PRINT_FIELD_X(map, base_addr);
+ tprint_struct_next();
+ PRINT_FIELD_U(map, irq);
+ tprint_struct_next();
+ PRINT_FIELD_U(map, dma);
+ tprint_struct_next();
+ PRINT_FIELD_U(map, port);
+ tprint_struct_end();
+ }
+
+ return true;
+}
+
+bool
+decode_nla_linkinfo_kind(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ struct ifla_linkinfo_ctx *ctx = (void *) opaque_data;
+
+ memset(ctx->kind, '\0', sizeof(ctx->kind));
+
+ if (umovestr(tcp, addr, sizeof(ctx->kind), ctx->kind) <= 0) {
+ /*
+ * If we haven't seen NUL or an error occurred, set kind to
+ * an empty string.
+ */
+ ctx->kind[0] = '\0';
+ }
+
+ printstr_ex(tcp, addr, len, QUOTE_0_TERMINATED);
+
+ return true;
+}
+
+bool
+decode_nla_linkinfo_xstats_can(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ struct strace_can_device_stats {
+ uint32_t bus_error;
+ uint32_t error_warning;
+ uint32_t error_passive;
+ uint32_t bus_off;
+ uint32_t arbitration_lost;
+ uint32_t restarts;
+ } st;
+ const unsigned int def_size = sizeof(st);
+ const unsigned int size = (len >= def_size) ? def_size : 0;
+
+ if (!size)
+ return false;
+
+ if (umoven_or_printaddr(tcp, addr, size, &st))
+ return true;
+
+ tprint_struct_begin();
+ PRINT_FIELD_U(st, bus_error);
+ tprint_struct_next();
+ PRINT_FIELD_U(st, error_warning);
+ tprint_struct_next();
+ PRINT_FIELD_U(st, error_passive);
+ tprint_struct_next();
+ PRINT_FIELD_U(st, bus_off);
+ tprint_struct_next();
+ PRINT_FIELD_U(st, arbitration_lost);
+ tprint_struct_next();
+ PRINT_FIELD_U(st, restarts);
+ tprint_struct_end();
+
+ return true;
+}
+
+bool
+decode_nla_linkinfo_xstats(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ struct ifla_linkinfo_ctx *ctx = (void *) opaque_data;
+ nla_decoder_t func = NULL;
+
+ if (!strcmp(ctx->kind, "can"))
+ func = decode_nla_linkinfo_xstats_can;
+
+ if (func)
+ return func(tcp, addr, len, opaque_data);
+
+ return false;
+}
+
+static const nla_decoder_t ifla_info_data_bridge_nla_decoders[] = {
+ [IFLA_BR_UNSPEC] = NULL,
+ [IFLA_BR_FORWARD_DELAY] = decode_nla_u32,
+ [IFLA_BR_HELLO_TIME] = decode_nla_u32,
+ [IFLA_BR_MAX_AGE] = decode_nla_u32,
+ [IFLA_BR_AGEING_TIME] = decode_nla_u32,
+ [IFLA_BR_STP_STATE] = decode_nla_u32,
+ [IFLA_BR_PRIORITY] = decode_nla_u16,
+ [IFLA_BR_VLAN_FILTERING] = decode_nla_u8,
+ [IFLA_BR_VLAN_PROTOCOL] = decode_nla_ether_proto,
+ [IFLA_BR_GROUP_FWD_MASK] = decode_nla_x16,
+ [IFLA_BR_ROOT_ID] = decode_ifla_bridge_id,
+ [IFLA_BR_BRIDGE_ID] = decode_ifla_bridge_id,
+ [IFLA_BR_ROOT_PORT] = decode_nla_u16,
+ [IFLA_BR_ROOT_PATH_COST] = decode_nla_u32,
+ [IFLA_BR_TOPOLOGY_CHANGE] = decode_nla_u8,
+ [IFLA_BR_TOPOLOGY_CHANGE_DETECTED] = decode_nla_u8,
+ [IFLA_BR_HELLO_TIMER] = decode_nla_u64,
+ [IFLA_BR_TCN_TIMER] = decode_nla_u64,
+ [IFLA_BR_TOPOLOGY_CHANGE_TIMER] = decode_nla_u64,
+ [IFLA_BR_GC_TIMER] = decode_nla_u64,
+ [IFLA_BR_GROUP_ADDR] = decode_nla_hwaddr_nofamily,
+ [IFLA_BR_FDB_FLUSH] = NULL, /* unspecified */
+ [IFLA_BR_MCAST_ROUTER] = decode_nla_u8,
+ [IFLA_BR_MCAST_SNOOPING] = decode_nla_u8,
+ [IFLA_BR_MCAST_QUERY_USE_IFADDR] = decode_nla_u8,
+ [IFLA_BR_MCAST_QUERIER] = decode_nla_u8,
+ [IFLA_BR_MCAST_HASH_ELASTICITY] = decode_nla_u32,
+ [IFLA_BR_MCAST_HASH_MAX] = decode_nla_u32,
+ [IFLA_BR_MCAST_LAST_MEMBER_CNT] = decode_nla_u32,
+ [IFLA_BR_MCAST_STARTUP_QUERY_CNT] = decode_nla_u32,
+ [IFLA_BR_MCAST_LAST_MEMBER_INTVL] = decode_nla_u64,
+ [IFLA_BR_MCAST_MEMBERSHIP_INTVL] = decode_nla_u64,
+ [IFLA_BR_MCAST_QUERIER_INTVL] = decode_nla_u64,
+ [IFLA_BR_MCAST_QUERY_INTVL] = decode_nla_u64,
+ [IFLA_BR_MCAST_QUERY_RESPONSE_INTVL] = decode_nla_u64,
+ [IFLA_BR_MCAST_STARTUP_QUERY_INTVL] = decode_nla_u64,
+ [IFLA_BR_NF_CALL_IPTABLES] = decode_nla_u8,
+ [IFLA_BR_NF_CALL_IP6TABLES] = decode_nla_u8,
+ [IFLA_BR_NF_CALL_ARPTABLES] = decode_nla_u8,
+ [IFLA_BR_VLAN_DEFAULT_PVID] = decode_nla_u16,
+ [IFLA_BR_PAD] = NULL,
+ [IFLA_BR_VLAN_STATS_ENABLED] = decode_nla_u8,
+ [IFLA_BR_MCAST_STATS_ENABLED] = decode_nla_u8,
+ [IFLA_BR_MCAST_IGMP_VERSION] = decode_nla_u8,
+ [IFLA_BR_MCAST_MLD_VERSION] = decode_nla_u8,
+ [IFLA_BR_VLAN_STATS_PER_PORT] = decode_nla_u8,
+};
+
+bool
+decode_nla_linkinfo_data_bridge(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ decode_nlattr(tcp, addr, len, rtnl_ifla_info_data_bridge_attrs,
+ "IFLA_BR_???",
+ ARRSZ_PAIR(ifla_info_data_bridge_nla_decoders),
+ opaque_data);
+
+ return true;
+}
+
+static bool
+decode_nla_tun_type(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ static const struct decode_nla_xlat_opts opts = {
+ .xlat = tun_device_types,
+ .dflt = "IFF_???",
+ .size = 1,
+ };
+
+ return decode_nla_xval(tcp, addr, len, &opts);
+}
+
+static const nla_decoder_t ifla_info_data_tun_nla_decoders[] = {
+ [IFLA_TUN_UNSPEC] = NULL,
+ [IFLA_TUN_OWNER] = decode_nla_uid,
+ [IFLA_TUN_GROUP] = decode_nla_gid,
+ [IFLA_TUN_TYPE] = decode_nla_tun_type,
+ [IFLA_TUN_PI] = decode_nla_u8,
+ [IFLA_TUN_VNET_HDR] = decode_nla_u8,
+ [IFLA_TUN_PERSIST] = decode_nla_u8,
+ [IFLA_TUN_MULTI_QUEUE] = decode_nla_u8,
+ [IFLA_TUN_NUM_QUEUES] = decode_nla_u32,
+ [IFLA_TUN_NUM_DISABLED_QUEUES] = decode_nla_u32,
+};
+
+bool
+decode_nla_linkinfo_data_tun(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ decode_nlattr(tcp, addr, len, rtnl_ifla_info_data_tun_attrs,
+ "IFLA_TUN_???",
+ ARRSZ_PAIR(ifla_info_data_tun_nla_decoders),
+ opaque_data);
+
+ return true;
+}
+
+bool
+decode_nla_linkinfo_data(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ struct ifla_linkinfo_ctx *ctx = (void *) opaque_data;
+ nla_decoder_t func = NULL;
+
+ if (!strcmp(ctx->kind, "bridge"))
+ func = decode_nla_linkinfo_data_bridge;
+ else if (!strcmp(ctx->kind, "tun"))
+ func = decode_nla_linkinfo_data_tun;
+
+ if (func)
+ return func(tcp, addr, len, opaque_data);
+
+ return false;
+}
+
+static const nla_decoder_t ifla_linkinfo_nla_decoders[] = {
+ [IFLA_INFO_KIND] = decode_nla_linkinfo_kind,
+ [IFLA_INFO_DATA] = decode_nla_linkinfo_data,
+ [IFLA_INFO_XSTATS] = decode_nla_linkinfo_xstats,
+ [IFLA_INFO_SLAVE_KIND] = decode_nla_str,
+ [IFLA_INFO_SLAVE_DATA] = NULL, /* unimplemented */
+};
+
+static bool
+decode_ifla_linkinfo(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ struct ifla_linkinfo_ctx ctx = { .kind = "", };
+
+ decode_nlattr(tcp, addr, len, rtnl_ifla_info_attrs,
+ "IFLA_INFO_???", ARRSZ_PAIR(ifla_linkinfo_nla_decoders),
+ &ctx);
+
+ return true;
+}
+
+static bool
+decode_rtnl_link_stats64(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ struct_rtnl_link_stats64 st;
+ const unsigned int min_size =
+ offsetofend(struct_rtnl_link_stats64, tx_compressed);
+ const unsigned int def_size = sizeof(st);
+ const unsigned int size =
+ (len >= def_size) ? def_size :
+ ((len == min_size) ? min_size : 0);
+
+ if (!size)
+ return false;
+
+ if (!umoven_or_printaddr(tcp, addr, size, &st)) {
+ tprint_struct_begin();
+ PRINT_FIELD_U(st, rx_packets);
+ tprint_struct_next();
+ PRINT_FIELD_U(st, tx_packets);
+ tprint_struct_next();
+ PRINT_FIELD_U(st, rx_bytes);
+ tprint_struct_next();
+ PRINT_FIELD_U(st, tx_bytes);
+ tprint_struct_next();
+ PRINT_FIELD_U(st, rx_errors);
+ tprint_struct_next();
+ PRINT_FIELD_U(st, tx_errors);
+ tprint_struct_next();
+ PRINT_FIELD_U(st, rx_dropped);
+ tprint_struct_next();
+ PRINT_FIELD_U(st, tx_dropped);
+ tprint_struct_next();
+ PRINT_FIELD_U(st, multicast);
+ tprint_struct_next();
+ PRINT_FIELD_U(st, collisions);
+
+ tprint_struct_next();
+ PRINT_FIELD_U(st, rx_length_errors);
+ tprint_struct_next();
+ PRINT_FIELD_U(st, rx_over_errors);
+ tprint_struct_next();
+ PRINT_FIELD_U(st, rx_crc_errors);
+ tprint_struct_next();
+ PRINT_FIELD_U(st, rx_frame_errors);
+ tprint_struct_next();
+ PRINT_FIELD_U(st, rx_fifo_errors);
+ tprint_struct_next();
+ PRINT_FIELD_U(st, rx_missed_errors);
+
+ tprint_struct_next();
+ PRINT_FIELD_U(st, tx_aborted_errors);
+ tprint_struct_next();
+ PRINT_FIELD_U(st, tx_carrier_errors);
+ tprint_struct_next();
+ PRINT_FIELD_U(st, tx_fifo_errors);
+ tprint_struct_next();
+ PRINT_FIELD_U(st, tx_heartbeat_errors);
+ tprint_struct_next();
+ PRINT_FIELD_U(st, tx_window_errors);
+
+ tprint_struct_next();
+ PRINT_FIELD_U(st, rx_compressed);
+ tprint_struct_next();
+ PRINT_FIELD_U(st, tx_compressed);
+
+ if (len >= def_size) {
+ tprint_struct_next();
+ PRINT_FIELD_U(st, rx_nohandler);
+ }
+ tprint_struct_end();
+ }
+
+ return true;
+}
+
+static bool
+decode_ifla_port_vsi(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ struct_ifla_port_vsi vsi;
+
+ if (len < sizeof(vsi))
+ return false;
+ if (umove_or_printaddr(tcp, addr, &vsi))
+ return true;
+
+ tprint_struct_begin();
+ PRINT_FIELD_U(vsi, vsi_mgr_id);
+ tprint_struct_next();
+ PRINT_FIELD_STRING(vsi, vsi_type_id, sizeof(vsi.vsi_type_id),
+ QUOTE_FORCE_HEX);
+ tprint_struct_next();
+ PRINT_FIELD_U(vsi, vsi_type_version);
+
+ if (!IS_ARRAY_ZERO(vsi.pad)) {
+ tprint_struct_next();
+ PRINT_FIELD_HEX_ARRAY(vsi, pad);
+ }
+
+ tprint_struct_end();
+
+ return true;
+}
+
+static const nla_decoder_t ifla_port_nla_decoders[] = {
+ [IFLA_PORT_VF] = decode_nla_u32,
+ [IFLA_PORT_PROFILE] = decode_nla_str,
+ [IFLA_PORT_VSI_TYPE] = decode_ifla_port_vsi,
+ [IFLA_PORT_INSTANCE_UUID] = NULL, /* default parser */
+ [IFLA_PORT_HOST_UUID] = NULL, /* default parser */
+ [IFLA_PORT_REQUEST] = decode_nla_u8,
+ [IFLA_PORT_RESPONSE] = decode_nla_u16
+};
+
+static bool
+decode_ifla_port(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ decode_nlattr(tcp, addr, len, rtnl_ifla_port_attrs,
+ "IFLA_VF_PORT_???", ARRSZ_PAIR(ifla_port_nla_decoders),
+ opaque_data);
+
+ return true;
+}
+
+static const nla_decoder_t ifla_vf_port_nla_decoders[] = {
+ [IFLA_VF_PORT] = decode_ifla_port
+};
+
+static bool
+decode_ifla_vf_ports(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ decode_nlattr(tcp, addr, len, rtnl_ifla_vf_port_attrs,
+ "IFLA_VF_PORT_???", ARRSZ_PAIR(ifla_vf_port_nla_decoders),
+ opaque_data);
+
+ return true;
+}
+
+static bool
+decode_ifla_xdp_flags(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ uint32_t flags;
+
+ if (len < sizeof(flags))
+ return false;
+ else if (!umove_or_printaddr(tcp, addr, &flags))
+ printflags(xdp_flags, flags, "XDP_FLAGS_???");
+
+ return true;
+}
+
+bool
+decode_ifla_xdp_attached(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ static const struct decode_nla_xlat_opts opts = {
+ .xlat = rtnl_ifla_xdp_attached_mode,
+ .dflt = "XDP_ATTACHED_???",
+ .size = 1,
+ };
+
+ return decode_nla_xval(tcp, addr, len, &opts);
+}
+
+static const nla_decoder_t ifla_xdp_nla_decoders[] = {
+ [IFLA_XDP_FD] = decode_nla_fd,
+ [IFLA_XDP_ATTACHED] = decode_ifla_xdp_attached,
+ [IFLA_XDP_FLAGS] = decode_ifla_xdp_flags,
+ [IFLA_XDP_PROG_ID] = decode_nla_u32,
+ [IFLA_XDP_DRV_PROG_ID] = decode_nla_u32,
+ [IFLA_XDP_SKB_PROG_ID] = decode_nla_u32,
+ [IFLA_XDP_HW_PROG_ID] = decode_nla_u32,
+ [IFLA_XDP_EXPECTED_FD] = decode_nla_fd,
+};
+
+static bool
+decode_ifla_xdp(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ decode_nlattr(tcp, addr, len, rtnl_ifla_xdp_attrs,
+ "IFLA_XDP_???", ARRSZ_PAIR(ifla_xdp_nla_decoders),
+ opaque_data);
+
+ return true;
+}
+
+static bool
+decode_ifla_event(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ uint32_t ev;
+
+ if (len < sizeof(ev))
+ return false;
+ else if (!umove_or_printaddr(tcp, addr, &ev))
+ printxval(rtnl_ifla_events, ev, "IFLA_EVENT_???");
+
+ return true;
+}
+
+
+static bool
+decode_ifla_inet_conf(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ int elem;
+ size_t cnt = len / sizeof(elem);
+
+ if (!cnt)
+ return false;
+
+ print_array_ex(tcp, addr, cnt, &elem, sizeof(elem),
+ tfetch_mem, print_int32_array_member, NULL,
+ PAF_PRINT_INDICES | XLAT_STYLE_FMT_D,
+ inet_devconf_indices, "IPV4_DEVCONF_???");
+
+ return true;
+}
+
+static const nla_decoder_t ifla_inet_nla_decoders[] = {
+ [IFLA_INET_CONF] = decode_ifla_inet_conf,
+};
+
+static bool
+decode_ifla_inet6_flags(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ static const struct decode_nla_xlat_opts opts = {
+ inet6_if_flags, "IF_???",
+ .size = 4,
+ };
+
+ return decode_nla_flags(tcp, addr, len, &opts);
+}
+
+static bool
+decode_ifla_inet6_conf(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ int elem;
+ size_t cnt = len / sizeof(elem);
+
+ if (!cnt)
+ return false;
+
+ print_array_ex(tcp, addr, cnt, &elem, sizeof(elem),
+ tfetch_mem, print_int32_array_member, NULL,
+ PAF_PRINT_INDICES | XLAT_STYLE_FMT_D,
+ inet6_devconf_indices, "DEVCONF_???");
+
+ return true;
+}
+
+static bool
+decode_ifla_inet6_stats(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ uint64_t elem;
+ size_t cnt = len / sizeof(elem);
+
+ if (!cnt)
+ return false;
+
+ print_array_ex(tcp, addr, cnt, &elem, sizeof(elem),
+ tfetch_mem, print_uint64_array_member, NULL,
+ PAF_PRINT_INDICES | XLAT_STYLE_FMT_U,
+ snmp_ip_stats, "IPSTATS_MIB_???");
+
+ return true;
+}
+
+static bool
+decode_ifla_inet6_cacheinfo(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ struct {
+ uint32_t max_reasm_len;
+ uint32_t tstamp;
+ uint32_t reachable_time;
+ uint32_t retrans_time;
+ } ci;
+
+ if (len < sizeof(ci))
+ return false;
+ else if (!umove_or_printaddr(tcp, addr, &ci)) {
+ tprint_struct_begin();
+ PRINT_FIELD_U(ci, max_reasm_len);
+ tprint_struct_next();
+ PRINT_FIELD_U(ci, tstamp);
+ tprint_struct_next();
+ PRINT_FIELD_U(ci, reachable_time);
+ tprint_struct_next();
+ PRINT_FIELD_U(ci, retrans_time);
+ tprint_struct_end();
+ }
+
+ return true;
+}
+
+static bool
+decode_ifla_inet6_icmp6_stats(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ uint64_t elem;
+ size_t cnt = len / sizeof(elem);
+
+ if (!cnt)
+ return false;
+
+ print_array_ex(tcp, addr, cnt, &elem, sizeof(elem),
+ tfetch_mem, print_uint64_array_member, NULL,
+ PAF_PRINT_INDICES | XLAT_STYLE_FMT_U,
+ snmp_icmp6_stats, "ICMP6_MIB_???");
+
+ return true;
+}
+
+static bool
+decode_ifla_inet6_agm(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ static const struct decode_nla_xlat_opts opts = {
+ in6_addr_gen_mode, "IN6_ADDR_GEN_MODE_???",
+ .size = 1,
+ };
+
+ return decode_nla_xval(tcp, addr, len, &opts);
+}
+
+static const nla_decoder_t ifla_inet6_nla_decoders[] = {
+ [IFLA_INET6_FLAGS] = decode_ifla_inet6_flags,
+ [IFLA_INET6_CONF] = decode_ifla_inet6_conf,
+ [IFLA_INET6_STATS] = decode_ifla_inet6_stats,
+ [IFLA_INET6_MCAST] = NULL, /* unused */
+ [IFLA_INET6_CACHEINFO] = decode_ifla_inet6_cacheinfo,
+ [IFLA_INET6_ICMP6STATS] = decode_ifla_inet6_icmp6_stats,
+ [IFLA_INET6_TOKEN] = decode_nla_in6_addr,
+ [IFLA_INET6_ADDR_GEN_MODE] = decode_ifla_inet6_agm,
+};
+
+static const struct nla_decoder_table_desc {
+ const struct xlat *xlat;
+ const char *dflt;
+ const nla_decoder_t *table;
+ size_t size;
+} ifla_af_spec_protos[] = {
+ [AF_INET] = {
+ rtnl_ifla_af_spec_inet_attrs, "IFLA_INET_???",
+ ARRSZ_PAIR(ifla_inet_nla_decoders),
+ },
+ [AF_INET6] = {
+ rtnl_ifla_af_spec_inet6_attrs, "IFLA_INET6_???",
+ ARRSZ_PAIR(ifla_inet6_nla_decoders),
+ },
+};
+
+static bool
+decode_ifla_af(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ uintptr_t proto = (uintptr_t) opaque_data;
+ const struct nla_decoder_table_desc *desc
+ = proto < ARRAY_SIZE(ifla_af_spec_protos)
+ ? ifla_af_spec_protos + proto : NULL;
+
+ if (!desc || !desc->table)
+ return false;
+
+ decode_nlattr(tcp, addr, len,
+ desc->xlat, desc->dflt, desc->table, desc->size, NULL);
+
+ return true;
+}
+
+static bool
+decode_ifla_af_spec(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ nla_decoder_t af_spec_decoder = &decode_ifla_af;
+
+ decode_nlattr(tcp, addr, len, addrfams, "AF_???",
+ &af_spec_decoder, 0, opaque_data);
+
+ return true;
+}
+
+static bool
+decode_ifla_prop_list_attr(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ const uintptr_t type = (uintptr_t) opaque_data;
+
+ switch (type) {
+ case IFLA_ALT_IFNAME:
+ return decode_nla_str(tcp, addr, len, NULL);
+ default:
+ return false;
+ }
+
+ return true;
+}
+
+static bool
+decode_ifla_prop_list(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ nla_decoder_t ifla_prop_list_decoder = &decode_ifla_prop_list_attr;
+
+ /*
+ * We're using the zero-size decoder list in order to avoid large table,
+ * as IFLA_ALT_IFNAME is the only attribute type we need to decode
+ * inside the IFLA_PROP_LIST attribute so far, and it has rather large
+ * value of 53.
+ */
+ decode_nlattr(tcp, addr, len, rtnl_link_attrs, "IFLA_???",
+ &ifla_prop_list_decoder, 0, NULL);
+
+ return true;
+}
+
+
+static const nla_decoder_t ifinfomsg_nla_decoders[] = {
+ [IFLA_ADDRESS] = decode_ifla_hwaddr,
+ [IFLA_BROADCAST] = decode_ifla_hwaddr,
+ [IFLA_IFNAME] = decode_nla_str,
+ [IFLA_MTU] = decode_nla_u32,
+ [IFLA_LINK] = decode_nla_u32,
+ [IFLA_QDISC] = decode_nla_str,
+ [IFLA_STATS] = decode_rtnl_link_stats,
+ [IFLA_COST] = NULL, /* unused */
+ [IFLA_PRIORITY] = NULL, /* unused */
+ [IFLA_MASTER] = decode_nla_u32,
+ [IFLA_WIRELESS] = NULL, /* unimplemented */
+ [IFLA_PROTINFO] = decode_ifla_protinfo,
+ [IFLA_TXQLEN] = decode_nla_u32,
+ [IFLA_MAP] = decode_rtnl_link_ifmap,
+ [IFLA_WEIGHT] = decode_nla_u32,
+ [IFLA_OPERSTATE] = decode_nla_u8,
+ [IFLA_LINKMODE] = decode_nla_u8,
+ [IFLA_LINKINFO] = decode_ifla_linkinfo,
+ [IFLA_NET_NS_PID] = decode_nla_u32,
+ [IFLA_IFALIAS] = decode_nla_str,
+ [IFLA_NUM_VF] = decode_nla_u32,
+ [IFLA_VFINFO_LIST] = NULL, /* unimplemented */
+ [IFLA_STATS64] = decode_rtnl_link_stats64,
+ [IFLA_VF_PORTS] = decode_ifla_vf_ports,
+ [IFLA_PORT_SELF] = decode_ifla_port,
+ [IFLA_AF_SPEC] = decode_ifla_af_spec,
+ [IFLA_GROUP] = decode_nla_u32,
+ [IFLA_NET_NS_FD] = decode_nla_fd,
+ [IFLA_EXT_MASK] = decode_nla_u32,
+ [IFLA_PROMISCUITY] = decode_nla_u32,
+ [IFLA_NUM_TX_QUEUES] = decode_nla_u32,
+ [IFLA_NUM_RX_QUEUES] = decode_nla_u32,
+ [IFLA_CARRIER] = decode_nla_u8,
+ [IFLA_PHYS_PORT_ID] = NULL, /* default parser */
+ [IFLA_CARRIER_CHANGES] = decode_nla_u32,
+ [IFLA_PHYS_SWITCH_ID] = NULL, /* default parser */
+ [IFLA_LINK_NETNSID] = decode_nla_s32,
+ [IFLA_PHYS_PORT_NAME] = decode_nla_str,
+ [IFLA_PROTO_DOWN] = decode_nla_u8,
+ [IFLA_GSO_MAX_SEGS] = decode_nla_u32,
+ [IFLA_GSO_MAX_SIZE] = decode_nla_u32,
+ [IFLA_PAD] = NULL,
+ [IFLA_XDP] = decode_ifla_xdp,
+ [IFLA_EVENT] = decode_ifla_event,
+ [IFLA_NEW_NETNSID] = decode_nla_s32,
+ [IFLA_IF_NETNSID] = decode_nla_s32,
+ [IFLA_CARRIER_UP_COUNT] = decode_nla_u32,
+ [IFLA_CARRIER_DOWN_COUNT] = decode_nla_u32,
+ [IFLA_NEW_IFINDEX] = decode_nla_ifindex,
+ [IFLA_MIN_MTU] = decode_nla_u32,
+ [IFLA_MAX_MTU] = decode_nla_u32,
+ [IFLA_PROP_LIST] = decode_ifla_prop_list,
+ [IFLA_ALT_IFNAME] = decode_nla_str,
+ [IFLA_PERM_ADDRESS] = decode_ifla_hwaddr,
+};
+
+DECL_NETLINK_ROUTE_DECODER(decode_ifinfomsg)
+{
+ struct ifinfomsg ifinfo = { .ifi_family = family };
+ size_t offset = sizeof(ifinfo.ifi_family);
+ bool decode_nla = false;
+
+ tprint_struct_begin();
+ PRINT_FIELD_XVAL(ifinfo, ifi_family, addrfams, "AF_???");
+
+ tprints(", ");
+ if (len >= sizeof(ifinfo)) {
+ if (!umoven_or_printaddr(tcp, addr + offset,
+ sizeof(ifinfo) - offset,
+ (char *) &ifinfo + offset)) {
+ PRINT_FIELD_XVAL(ifinfo, ifi_type,
+ arp_hardware_types, "ARPHRD_???");
+ tprint_struct_next();
+ PRINT_FIELD_IFINDEX(ifinfo, ifi_index);
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(ifinfo, ifi_flags,
+ iffflags, "IFF_???");
+ tprint_struct_next();
+ PRINT_FIELD_X(ifinfo, ifi_change);
+ decode_nla = true;
+ }
+ } else
+ tprint_more_data_follows();
+ tprint_struct_end();
+
+ offset = NLMSG_ALIGN(sizeof(ifinfo));
+ if (decode_nla && len > offset) {
+ tprints(", ");
+ decode_nlattr(tcp, addr + offset, len - offset,
+ rtnl_link_attrs, "IFLA_???",
+ ARRSZ_PAIR(ifinfomsg_nla_decoders), &ifinfo);
+ }
+}
diff --git a/src/rtnl_mdb.c b/src/rtnl_mdb.c
new file mode 100644
index 000000000..f34ec04aa
--- /dev/null
+++ b/src/rtnl_mdb.c
@@ -0,0 +1,217 @@
+/*
+ * Copyright (c) 2016 Fabien Siron <fabien.siron@epita.fr>
+ * Copyright (c) 2017 JingPiao Chen <chenjingpiao@gmail.com>
+ * Copyright (c) 2016-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#include "netlink_route.h"
+#include "nlattr.h"
+
+#include "types/rtnl_mdb.h"
+#include "netlink.h"
+
+#include "xlat/mdb_flags.h"
+#include "xlat/mdb_states.h"
+#include "xlat/multicast_router_types.h"
+#include "xlat/rtnl_mdb_attrs.h"
+#include "xlat/rtnl_mdba_mdb_attrs.h"
+#include "xlat/rtnl_mdba_mdb_eattr_attrs.h"
+#include "xlat/rtnl_mdba_mdb_entry_attrs.h"
+#include "xlat/rtnl_mdba_router_attrs.h"
+#include "xlat/rtnl_mdba_router_pattr_attrs.h"
+
+static const nla_decoder_t mdba_mdb_eattr_nla_decoders[] = {
+ [MDBA_MDB_EATTR_TIMER] = decode_nla_u32
+};
+
+static bool
+decode_mdba_mdb_entry_info(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ struct_br_mdb_entry entry;
+
+ if (len < sizeof(entry))
+ return false;
+ else if (!umove_or_printaddr(tcp, addr, &entry)) {
+ tprint_struct_begin();
+ PRINT_FIELD_IFINDEX(entry, ifindex);
+ tprint_struct_next();
+ PRINT_FIELD_XVAL(entry, state, mdb_states, "MDB_???");
+
+ /*
+ * Note that it's impossible to derive if flags/vid fields
+ * are present on all architectures except m68k; as a side note,
+ * v4.3-rc1~96^2~365 has introduced an ABI breakage on m68k.
+ */
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(entry, flags,
+ mdb_flags, "MDB_FLAGS_???");
+ tprint_struct_next();
+ PRINT_FIELD_U(entry, vid);
+
+ const int proto = ntohs(entry.addr.proto);
+
+ tprint_struct_next();
+ tprints_field_name("addr");
+ tprint_struct_begin();
+ print_inet_addr(proto, &entry.addr.u,
+ sizeof(entry.addr.u), "u");
+ tprint_struct_next();
+ tprints_field_name("proto");
+ tprints("htons(");
+ printxval(addrfams, proto, "AF_???");
+ tprints(")");
+ tprint_struct_end();
+ tprint_struct_end();
+ }
+
+ const size_t offset = NLMSG_ALIGN(sizeof(entry));
+ if (len > offset) {
+ tprints(", ");
+ decode_nlattr(tcp, addr + offset, len - offset,
+ rtnl_mdba_mdb_eattr_attrs, "MDBA_MDB_EATTR_???",
+ mdba_mdb_eattr_nla_decoders,
+ ARRAY_SIZE(mdba_mdb_eattr_nla_decoders), NULL);
+ }
+
+ return true;
+}
+
+static const nla_decoder_t mdba_mdb_entry_nla_decoders[] = {
+ [MDBA_MDB_ENTRY_INFO] = decode_mdba_mdb_entry_info
+};
+
+static bool
+decode_mdba_mdb_entry(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ decode_nlattr(tcp, addr, len, rtnl_mdba_mdb_entry_attrs,
+ "MDBA_MDB_ENTRY_???", mdba_mdb_entry_nla_decoders,
+ ARRAY_SIZE(mdba_mdb_entry_nla_decoders), NULL);
+
+ return true;
+}
+
+static const nla_decoder_t mdba_mdb_nla_decoders[] = {
+ [MDBA_MDB_ENTRY] = decode_mdba_mdb_entry
+};
+
+static bool
+decode_mdba_mdb(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ decode_nlattr(tcp, addr, len, rtnl_mdba_mdb_attrs, "MDBA_MDB_???",
+ mdba_mdb_nla_decoders,
+ ARRAY_SIZE(mdba_mdb_nla_decoders), NULL);
+
+ return true;
+}
+
+static bool
+decode_multicast_router_type(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ uint8_t type;
+
+ if (!umove_or_printaddr(tcp, addr, &type))
+ printxval(multicast_router_types, type, "MDB_RTR_TYPE_???");
+
+ return true;
+}
+
+static const nla_decoder_t mdba_router_pattr_nla_decoders[] = {
+ [MDBA_ROUTER_PATTR_TIMER] = decode_nla_u32,
+ [MDBA_ROUTER_PATTR_TYPE] = decode_multicast_router_type
+};
+
+static bool
+decode_mdba_router_port(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ uint32_t ifindex;
+
+ if (len < sizeof(ifindex))
+ return false;
+ else if (!umove_or_printaddr(tcp, addr, &ifindex))
+ print_ifindex(ifindex);
+
+ const size_t offset = NLMSG_ALIGN(sizeof(ifindex));
+ if (len > offset) {
+ tprints(", ");
+ decode_nlattr(tcp, addr + offset, len - offset,
+ rtnl_mdba_router_pattr_attrs,
+ "MDBA_ROUTER_PATTR_???",
+ mdba_router_pattr_nla_decoders,
+ ARRAY_SIZE(mdba_router_pattr_nla_decoders), NULL);
+ }
+
+ return true;
+}
+
+static const nla_decoder_t mdba_router_nla_decoders[] = {
+ [MDBA_ROUTER_PORT] = decode_mdba_router_port
+};
+
+static bool
+decode_mdba_router(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ decode_nlattr(tcp, addr, len, rtnl_mdba_router_attrs, "MDBA_ROUTER_???",
+ mdba_router_nla_decoders,
+ ARRAY_SIZE(mdba_router_nla_decoders), NULL);
+
+ return true;
+}
+
+static const nla_decoder_t br_port_msg_nla_decoders[] = {
+ [MDBA_MDB] = decode_mdba_mdb,
+ [MDBA_ROUTER] = decode_mdba_router
+};
+
+DECL_NETLINK_ROUTE_DECODER(decode_br_port_msg)
+{
+ struct_br_port_msg bpm = { .family = family };
+ size_t offset = sizeof(bpm.family);
+ bool decode_nla = false;
+
+ tprint_struct_begin();
+ PRINT_FIELD_XVAL(bpm, family, addrfams, "AF_???");
+
+ tprints(", ");
+ if (len >= sizeof(bpm)) {
+ if (!umoven_or_printaddr(tcp, addr + offset,
+ sizeof(bpm) - offset,
+ (char *) &bpm + offset)) {
+ PRINT_FIELD_IFINDEX(bpm, ifindex);
+ decode_nla = true;
+ }
+ } else
+ tprint_more_data_follows();
+ tprint_struct_end();
+
+ offset = NLMSG_ALIGN(sizeof(bpm));
+ if (decode_nla && len > offset) {
+ tprints(", ");
+ decode_nlattr(tcp, addr + offset, len - offset,
+ rtnl_mdb_attrs, "MDBA_???",
+ br_port_msg_nla_decoders,
+ ARRAY_SIZE(br_port_msg_nla_decoders), NULL);
+ }
+}
diff --git a/src/rtnl_neigh.c b/src/rtnl_neigh.c
new file mode 100644
index 000000000..118b4bb43
--- /dev/null
+++ b/src/rtnl_neigh.c
@@ -0,0 +1,126 @@
+/*
+ * Copyright (c) 2016 Fabien Siron <fabien.siron@epita.fr>
+ * Copyright (c) 2017 JingPiao Chen <chenjingpiao@gmail.com>
+ * Copyright (c) 2016-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include "netlink_route.h"
+#include "nlattr.h"
+
+#include "netlink.h"
+#include <linux/rtnetlink.h>
+#ifdef HAVE_LINUX_NEIGHBOUR_H
+# include <linux/neighbour.h>
+#endif
+
+#include "xlat/neighbor_cache_entry_flags.h"
+#include "xlat/neighbor_cache_entry_states.h"
+#include "xlat/rtnl_neigh_attrs.h"
+
+static bool
+decode_neigh_addr(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ const struct ndmsg *const ndmsg = opaque_data;
+
+ decode_inet_addr(tcp, addr, len, ndmsg->ndm_family, NULL);
+
+ return true;
+}
+
+static bool
+decode_nda_cacheinfo(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ struct nda_cacheinfo ci;
+
+ if (len < sizeof(ci))
+ return false;
+ else if (!umove_or_printaddr(tcp, addr, &ci)) {
+ tprint_struct_begin();
+ PRINT_FIELD_U(ci, ndm_confirmed);
+ tprint_struct_next();
+ PRINT_FIELD_U(ci, ndm_used);
+ tprint_struct_next();
+ PRINT_FIELD_U(ci, ndm_updated);
+ tprint_struct_next();
+ PRINT_FIELD_U(ci, ndm_refcnt);
+ tprint_struct_end();
+ }
+
+ return true;
+}
+
+static const nla_decoder_t ndmsg_nla_decoders[] = {
+ [NDA_DST] = decode_neigh_addr,
+ [NDA_LLADDR] = decode_nla_hwaddr_nofamily,
+ [NDA_CACHEINFO] = decode_nda_cacheinfo,
+ [NDA_PROBES] = decode_nla_u32,
+ [NDA_VLAN] = decode_nla_u16,
+ [NDA_PORT] = decode_nla_be16,
+ [NDA_VNI] = decode_nla_u32,
+ [NDA_IFINDEX] = decode_nla_ifindex,
+ [NDA_MASTER] = decode_nla_ifindex,
+ [NDA_LINK_NETNSID] = decode_nla_u32,
+ [NDA_SRC_VNI] = NULL,
+ [NDA_PROTOCOL] = decode_nla_u8,
+ [NDA_NH_ID] = decode_nla_u32,
+};
+
+DECL_NETLINK_ROUTE_DECODER(decode_ndmsg)
+{
+ struct ndmsg ndmsg = { .ndm_family = family };
+ size_t offset = sizeof(ndmsg.ndm_family);
+ bool decode_nla = false;
+
+ tprint_struct_begin();
+ PRINT_FIELD_XVAL(ndmsg, ndm_family, addrfams, "AF_???");
+
+ tprints(", ");
+ if (len >= sizeof(ndmsg)) {
+ if (!umoven_or_printaddr(tcp, addr + offset,
+ sizeof(ndmsg) - offset,
+ (char *) &ndmsg + offset)) {
+ PRINT_FIELD_IFINDEX(ndmsg, ndm_ifindex);
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(ndmsg, ndm_state,
+ neighbor_cache_entry_states,
+ "NUD_???");
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(ndmsg, ndm_flags,
+ neighbor_cache_entry_flags,
+ "NTF_???");
+ tprint_struct_next();
+ PRINT_FIELD_XVAL(ndmsg, ndm_type,
+ routing_types, "RTN_???");
+ decode_nla = true;
+ }
+ } else
+ tprint_more_data_follows();
+ tprint_struct_end();
+
+ offset = NLMSG_ALIGN(sizeof(ndmsg));
+ if (decode_nla && len > offset) {
+ tprints(", ");
+ decode_nlattr(tcp, addr + offset, len - offset,
+ rtnl_neigh_attrs, "NDA_???",
+ ndmsg_nla_decoders,
+ ARRAY_SIZE(ndmsg_nla_decoders), &ndmsg);
+ }
+}
+
+DECL_NETLINK_ROUTE_DECODER(decode_rtm_getneigh)
+{
+ if (family == AF_BRIDGE)
+ decode_ifinfomsg(tcp, nlmsghdr, family, addr, len);
+ else
+ decode_ndmsg(tcp, nlmsghdr, family, addr, len);
+}
diff --git a/src/rtnl_neightbl.c b/src/rtnl_neightbl.c
new file mode 100644
index 000000000..46a279f58
--- /dev/null
+++ b/src/rtnl_neightbl.c
@@ -0,0 +1,164 @@
+/*
+ * Copyright (c) 2016 Fabien Siron <fabien.siron@epita.fr>
+ * Copyright (c) 2017 JingPiao Chen <chenjingpiao@gmail.com>
+ * Copyright (c) 2016-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include "netlink_route.h"
+#include "nlattr.h"
+
+#include "types/rtnl_neightbl.h"
+
+#include "xlat/rtnl_neightbl_attrs.h"
+#include "xlat/rtnl_neightbl_parms_attrs.h"
+
+static bool
+decode_ndt_config(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ struct_ndt_config ndtc;
+
+ if (len < sizeof(ndtc))
+ return false;
+ else if (!umove_or_printaddr(tcp, addr, &ndtc)) {
+ tprint_struct_begin();
+ PRINT_FIELD_U(ndtc, ndtc_key_len);
+ tprint_struct_next();
+ PRINT_FIELD_U(ndtc, ndtc_entry_size);
+ tprint_struct_next();
+ PRINT_FIELD_U(ndtc, ndtc_entries);
+ tprint_struct_next();
+ PRINT_FIELD_U(ndtc, ndtc_last_flush);
+ tprint_struct_next();
+ PRINT_FIELD_U(ndtc, ndtc_last_rand);
+ tprint_struct_next();
+ PRINT_FIELD_U(ndtc, ndtc_hash_rnd);
+ tprint_struct_next();
+ PRINT_FIELD_0X(ndtc, ndtc_hash_mask);
+ tprint_struct_next();
+ PRINT_FIELD_U(ndtc, ndtc_hash_chain_gc);
+ tprint_struct_next();
+ PRINT_FIELD_U(ndtc, ndtc_proxy_qlen);
+ tprint_struct_end();
+ }
+
+ return true;
+}
+
+static const nla_decoder_t ndt_parms_nla_decoders[] = {
+ [NDTPA_IFINDEX] = decode_nla_ifindex,
+ [NDTPA_REFCNT] = decode_nla_u32,
+ [NDTPA_REACHABLE_TIME] = decode_nla_u64,
+ [NDTPA_BASE_REACHABLE_TIME] = decode_nla_u64,
+ [NDTPA_RETRANS_TIME] = decode_nla_u64,
+ [NDTPA_GC_STALETIME] = decode_nla_u64,
+ [NDTPA_DELAY_PROBE_TIME] = decode_nla_u64,
+ [NDTPA_QUEUE_LEN] = decode_nla_u32,
+ [NDTPA_APP_PROBES] = decode_nla_u32,
+ [NDTPA_UCAST_PROBES] = decode_nla_u32,
+ [NDTPA_MCAST_PROBES] = decode_nla_u32,
+ [NDTPA_ANYCAST_DELAY] = decode_nla_u64,
+ [NDTPA_PROXY_DELAY] = decode_nla_u64,
+ [NDTPA_PROXY_QLEN] = decode_nla_u32,
+ [NDTPA_LOCKTIME] = decode_nla_u64,
+ [NDTPA_QUEUE_LENBYTES] = decode_nla_u32,
+ [NDTPA_MCAST_REPROBES] = decode_nla_u32,
+ [NDTPA_PAD] = NULL
+};
+
+static bool
+decode_ndta_parms(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ decode_nlattr(tcp, addr, len, rtnl_neightbl_parms_attrs, "NDTPA_???",
+ ndt_parms_nla_decoders,
+ ARRAY_SIZE(ndt_parms_nla_decoders), opaque_data);
+
+ return true;
+}
+
+static bool
+decode_ndt_stats(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ struct_ndt_stats ndtst;
+ const unsigned int min_size =
+ offsetofend(struct ndt_stats, ndts_forced_gc_runs);
+ const unsigned int def_size = sizeof(ndtst);
+ const unsigned int size =
+ (len >= def_size) ? def_size :
+ ((len == min_size) ? min_size : 0);
+
+ if (!size)
+ return false;
+
+ if (!umoven_or_printaddr(tcp, addr, size, &ndtst)) {
+ tprint_struct_begin();
+ PRINT_FIELD_U(ndtst, ndts_allocs);
+ tprint_struct_next();
+ PRINT_FIELD_U(ndtst, ndts_destroys);
+ tprint_struct_next();
+ PRINT_FIELD_U(ndtst, ndts_hash_grows);
+ tprint_struct_next();
+ PRINT_FIELD_U(ndtst, ndts_res_failed);
+ tprint_struct_next();
+ PRINT_FIELD_U(ndtst, ndts_lookups);
+ tprint_struct_next();
+ PRINT_FIELD_U(ndtst, ndts_hits);
+ tprint_struct_next();
+ PRINT_FIELD_U(ndtst, ndts_rcv_probes_mcast);
+ tprint_struct_next();
+ PRINT_FIELD_U(ndtst, ndts_rcv_probes_ucast);
+ tprint_struct_next();
+ PRINT_FIELD_U(ndtst, ndts_periodic_gc_runs);
+ tprint_struct_next();
+ PRINT_FIELD_U(ndtst, ndts_forced_gc_runs);
+ if (len >= def_size) {
+ tprint_struct_next();
+ PRINT_FIELD_U(ndtst, ndts_table_fulls);
+ }
+ tprint_struct_end();
+ }
+
+ return true;
+}
+
+static const nla_decoder_t ndtmsg_nla_decoders[] = {
+ [NDTA_NAME] = decode_nla_str,
+ [NDTA_THRESH1] = decode_nla_u32,
+ [NDTA_THRESH2] = decode_nla_u32,
+ [NDTA_THRESH3] = decode_nla_u32,
+ [NDTA_CONFIG] = decode_ndt_config,
+ [NDTA_PARMS] = decode_ndta_parms,
+ [NDTA_STATS] = decode_ndt_stats,
+ [NDTA_GC_INTERVAL] = decode_nla_u64,
+ [NDTA_PAD] = NULL,
+};
+
+DECL_NETLINK_ROUTE_DECODER(decode_ndtmsg)
+{
+ struct ndtmsg ndtmsg = { .ndtm_family = family };
+
+ tprint_struct_begin();
+ PRINT_FIELD_XVAL(ndtmsg, ndtm_family, addrfams, "AF_???");
+ tprint_struct_end();
+
+ const size_t offset = NLMSG_ALIGN(sizeof(ndtmsg));
+ if (len > offset) {
+ tprints(", ");
+ decode_nlattr(tcp, addr + offset, len - offset,
+ rtnl_neightbl_attrs, "NDTA_???",
+ ndtmsg_nla_decoders,
+ ARRAY_SIZE(ndtmsg_nla_decoders), NULL);
+ }
+}
diff --git a/src/rtnl_netconf.c b/src/rtnl_netconf.c
new file mode 100644
index 000000000..c567e2005
--- /dev/null
+++ b/src/rtnl_netconf.c
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2016 Fabien Siron <fabien.siron@epita.fr>
+ * Copyright (c) 2017 JingPiao Chen <chenjingpiao@gmail.com>
+ * Copyright (c) 2016-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#ifdef HAVE_STRUCT_NETCONFMSG
+
+# include "netlink_route.h"
+# include "nlattr.h"
+
+# include <linux/netconf.h>
+# include "netlink.h"
+
+# include "xlat/rtnl_netconf_attrs.h"
+
+static const nla_decoder_t netconfmsg_nla_decoders[] = {
+ [NETCONFA_IFINDEX] = decode_nla_ifindex,
+ [NETCONFA_FORWARDING] = decode_nla_s32,
+ [NETCONFA_RP_FILTER] = decode_nla_s32,
+ [NETCONFA_MC_FORWARDING] = decode_nla_s32,
+ [NETCONFA_PROXY_NEIGH] = decode_nla_s32,
+ [NETCONFA_IGNORE_ROUTES_WITH_LINKDOWN] = decode_nla_s32,
+ [NETCONFA_INPUT] = decode_nla_s32,
+ [NETCONFA_BC_FORWARDING] = decode_nla_s32,
+};
+
+DECL_NETLINK_ROUTE_DECODER(decode_netconfmsg)
+{
+ struct netconfmsg ncm = { .ncm_family = family };
+
+ tprint_struct_begin();
+ PRINT_FIELD_XVAL(ncm, ncm_family, addrfams, "AF_???");
+ tprint_struct_end();
+
+ const size_t offset = NLMSG_ALIGN(sizeof(ncm));
+ if (len > offset) {
+ tprints(", ");
+ decode_nlattr(tcp, addr + offset, len - offset,
+ rtnl_netconf_attrs, "NETCONFA_???",
+ netconfmsg_nla_decoders,
+ ARRAY_SIZE(netconfmsg_nla_decoders), NULL);
+ }
+}
+
+#endif
diff --git a/src/rtnl_nsid.c b/src/rtnl_nsid.c
new file mode 100644
index 000000000..5b7bab86b
--- /dev/null
+++ b/src/rtnl_nsid.c
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2016 Fabien Siron <fabien.siron@epita.fr>
+ * Copyright (c) 2017 JingPiao Chen <chenjingpiao@gmail.com>
+ * Copyright (c) 2016-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include "netlink_route.h"
+#include "nlattr.h"
+
+#include "netlink.h"
+#include <linux/rtnetlink.h>
+
+#include "xlat/rtnl_nsid_attrs.h"
+
+static const nla_decoder_t rtgenmsg_nla_decoders[] = {
+ [NETNSA_NSID] = decode_nla_s32,
+ [NETNSA_PID] = decode_nla_u32,
+ [NETNSA_FD] = decode_nla_fd,
+ [NETNSA_TARGET_NSID] = decode_nla_s32,
+ [NETNSA_CURRENT_NSID] = decode_nla_s32
+};
+
+DECL_NETLINK_ROUTE_DECODER(decode_rtgenmsg)
+{
+ struct rtgenmsg rtgenmsg = { .rtgen_family = family };
+
+ tprint_struct_begin();
+ PRINT_FIELD_XVAL(rtgenmsg, rtgen_family, addrfams, "AF_???");
+ tprint_struct_end();
+
+ const size_t offset = NLMSG_ALIGN(sizeof(rtgenmsg));
+ if (len > offset) {
+ tprints(", ");
+ decode_nlattr(tcp, addr + offset, len - offset,
+ rtnl_nsid_attrs, "NETNSA_???",
+ rtgenmsg_nla_decoders,
+ ARRAY_SIZE(rtgenmsg_nla_decoders), NULL);
+ }
+}
diff --git a/src/rtnl_route.c b/src/rtnl_route.c
new file mode 100644
index 000000000..729b2c11d
--- /dev/null
+++ b/src/rtnl_route.c
@@ -0,0 +1,326 @@
+/*
+ * Copyright (c) 2016 Fabien Siron <fabien.siron@epita.fr>
+ * Copyright (c) 2017 JingPiao Chen <chenjingpiao@gmail.com>
+ * Copyright (c) 2016-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include "netlink_route.h"
+#include "nlattr.h"
+
+#include <linux/ip.h>
+#include "types/rtnl_route.h"
+
+#include "xlat/ip_type_of_services.h"
+#include "xlat/lwtunnel_encap_types.h"
+#include "xlat/route_nexthop_flags.h"
+#include "xlat/routing_flags.h"
+#include "xlat/routing_protocols.h"
+#include "xlat/routing_table_ids.h"
+#include "xlat/routing_types.h"
+#include "xlat/rtnl_route_attrs.h"
+#include "xlat/rtnl_rta_metrics_attrs.h"
+
+bool
+decode_nla_rt_class(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ uint32_t num;
+
+ if (len < sizeof(num))
+ return false;
+ if (!umove_or_printaddr(tcp, addr, &num))
+ printxval(routing_table_ids, num, NULL);
+ return true;
+}
+
+bool
+decode_nla_rt_proto(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ uint8_t num;
+
+ if (len < sizeof(num))
+ return false;
+ if (!umove_or_printaddr(tcp, addr, &num))
+ printxval(routing_protocols, num, "RTPROT_???");
+ return true;
+}
+
+static bool
+decode_route_addr(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ const struct rtmsg *const rtmsg = opaque_data;
+
+ decode_inet_addr(tcp, addr, len, rtmsg->rtm_family, NULL);
+
+ return true;
+}
+
+static const nla_decoder_t rta_metrics_nla_decoders[] = {
+ [RTAX_LOCK] = decode_nla_u32,
+ [RTAX_MTU] = decode_nla_u32,
+ [RTAX_WINDOW] = decode_nla_u32,
+ [RTAX_RTT] = decode_nla_u32,
+ [RTAX_RTTVAR] = decode_nla_u32,
+ [RTAX_SSTHRESH] = decode_nla_u32,
+ [RTAX_CWND] = decode_nla_u32,
+ [RTAX_ADVMSS] = decode_nla_u32,
+ [RTAX_REORDERING] = decode_nla_u32,
+ [RTAX_HOPLIMIT] = decode_nla_u32,
+ [RTAX_INITCWND] = decode_nla_u32,
+ [RTAX_FEATURES] = decode_nla_u32,
+ [RTAX_RTO_MIN] = decode_nla_u32,
+ [RTAX_INITRWND] = decode_nla_u32,
+ [RTAX_QUICKACK] = decode_nla_u32,
+ [RTAX_CC_ALGO] = decode_nla_str
+};
+
+static bool
+decode_rta_metrics(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ decode_nlattr(tcp, addr, len, rtnl_rta_metrics_attrs,
+ "RTAX_???", rta_metrics_nla_decoders,
+ ARRAY_SIZE(rta_metrics_nla_decoders), opaque_data);
+
+ return true;
+}
+
+static bool
+decode_rta_multipath(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data);
+
+static bool
+decode_rta_cacheinfo(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ struct rta_cacheinfo ci;
+
+ if (len < sizeof(ci))
+ return false;
+ else if (!umove_or_printaddr(tcp, addr, &ci)) {
+ tprint_struct_begin();
+ PRINT_FIELD_U(ci, rta_clntref);
+ tprint_struct_next();
+ PRINT_FIELD_U(ci, rta_lastuse);
+ tprint_struct_next();
+ PRINT_FIELD_U(ci, rta_expires);
+ tprint_struct_next();
+ PRINT_FIELD_U(ci, rta_error);
+ tprint_struct_next();
+ PRINT_FIELD_U(ci, rta_used);
+ tprint_struct_next();
+ PRINT_FIELD_X(ci, rta_id);
+ tprint_struct_next();
+ PRINT_FIELD_U(ci, rta_ts);
+ tprint_struct_next();
+ PRINT_FIELD_U(ci, rta_tsage);
+ tprint_struct_end();
+ }
+
+ return true;
+}
+
+static bool
+decode_rta_mfc_stats(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ struct_rta_mfc_stats mfcs;
+
+ if (len < sizeof(mfcs))
+ return false;
+ else if (!umove_or_printaddr(tcp, addr, &mfcs)) {
+ tprint_struct_begin();
+ PRINT_FIELD_U(mfcs, mfcs_packets);
+ tprint_struct_next();
+ PRINT_FIELD_U(mfcs, mfcs_bytes);
+ tprint_struct_next();
+ PRINT_FIELD_U(mfcs, mfcs_wrong_if);
+ tprint_struct_end();
+ }
+
+ return true;
+}
+
+static bool
+decode_rtvia(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ struct_rtvia via;
+
+ if (len < sizeof(via))
+ return false;
+ else if (!umove_or_printaddr(tcp, addr, &via)) {
+ tprint_struct_begin();
+ PRINT_FIELD_XVAL(via, rtvia_family, addrfams, "AF_???");
+
+ const unsigned int offset = offsetof(struct_rtvia, rtvia_addr);
+
+ if (len > offset) {
+ tprints(", ");
+ decode_inet_addr(tcp, addr + offset, len - offset,
+ via.rtvia_family, "rtvia_addr");
+ }
+ tprint_struct_end();
+ }
+
+ return true;
+}
+
+static bool
+decode_rta_encap_type(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ uint16_t type;
+
+ if (len < sizeof(type))
+ return false;
+ else if (!umove_or_printaddr(tcp, addr, &type))
+ printxval(lwtunnel_encap_types, type, "LWTUNNEL_ENCAP_???");
+
+ return true;
+}
+
+static const nla_decoder_t rtmsg_nla_decoders[] = {
+ [RTA_DST] = decode_route_addr,
+ [RTA_SRC] = decode_route_addr,
+ [RTA_IIF] = decode_nla_ifindex,
+ [RTA_OIF] = decode_nla_ifindex,
+ [RTA_GATEWAY] = decode_route_addr,
+ [RTA_PRIORITY] = decode_nla_u32,
+ [RTA_PREFSRC] = decode_route_addr,
+ [RTA_METRICS] = decode_rta_metrics,
+ [RTA_MULTIPATH] = decode_rta_multipath,
+ [RTA_PROTOINFO] = decode_nla_u32,
+ [RTA_FLOW] = decode_nla_u32,
+ [RTA_CACHEINFO] = decode_rta_cacheinfo,
+ [RTA_SESSION] = NULL, /* unused */
+ [RTA_MP_ALGO] = decode_nla_u32,
+ [RTA_TABLE] = decode_nla_rt_class,
+ [RTA_MARK] = decode_nla_u32,
+ [RTA_MFC_STATS] = decode_rta_mfc_stats,
+ [RTA_VIA] = decode_rtvia,
+ [RTA_NEWDST] = decode_route_addr,
+ [RTA_PREF] = decode_nla_u8,
+ [RTA_ENCAP_TYPE] = decode_rta_encap_type,
+ [RTA_ENCAP] = NULL, /* unimplemented */
+ [RTA_EXPIRES] = decode_nla_u64,
+ [RTA_PAD] = NULL,
+ [RTA_UID] = decode_nla_u32,
+ [RTA_TTL_PROPAGATE] = decode_nla_u8,
+ [RTA_IP_PROTO] = decode_nla_u8,
+ [RTA_SPORT] = decode_nla_u16,
+ [RTA_DPORT] = decode_nla_u16
+};
+
+static bool
+decode_rta_multipath(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ struct rtnexthop nh;
+
+ if (len < sizeof(nh))
+ return false;
+ else if (!umove_or_printaddr(tcp, addr, &nh)) {
+ /* print the whole structure regardless of its rtnh_len */
+ tprint_struct_begin();
+ PRINT_FIELD_U(nh, rtnh_len);
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(nh, rtnh_flags,
+ route_nexthop_flags, "RTNH_F_???");
+ tprint_struct_next();
+ PRINT_FIELD_U(nh, rtnh_hops);
+ tprint_struct_next();
+ PRINT_FIELD_IFINDEX(nh, rtnh_ifindex);
+ tprint_struct_end();
+
+ const unsigned short rtnh_len = MIN(len, nh.rtnh_len);
+ const size_t offset = RTNH_ALIGN(sizeof(nh));
+ if (rtnh_len > offset) {
+ tprints(", ");
+ decode_nlattr(tcp, addr + offset, rtnh_len - offset,
+ rtnl_route_attrs, "RTA_???",
+ rtmsg_nla_decoders,
+ ARRAY_SIZE(rtmsg_nla_decoders),
+ opaque_data);
+ }
+ }
+
+ return true;
+}
+
+DECL_NETLINK_ROUTE_DECODER(decode_rtmsg)
+{
+ struct rtmsg rtmsg = { .rtm_family = family };
+ size_t offset = sizeof(rtmsg.rtm_family);
+ bool decode_nla = false;
+
+ tprint_struct_begin();
+ PRINT_FIELD_XVAL(rtmsg, rtm_family, addrfams, "AF_???");
+
+ tprints(", ");
+ if (len >= sizeof(rtmsg)) {
+ if (!umoven_or_printaddr(tcp, addr + offset,
+ sizeof(rtmsg) - offset,
+ (char *) &rtmsg + offset)) {
+ PRINT_FIELD_U(rtmsg, rtm_dst_len);
+ tprint_struct_next();
+ PRINT_FIELD_U(rtmsg, rtm_src_len);
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(rtmsg, rtm_tos,
+ ip_type_of_services, "IPTOS_TOS_???");
+ tprint_struct_next();
+ PRINT_FIELD_XVAL(rtmsg, rtm_table,
+ routing_table_ids, NULL);
+ tprint_struct_next();
+ PRINT_FIELD_XVAL(rtmsg, rtm_protocol,
+ routing_protocols, "RTPROT_???");
+ tprint_struct_next();
+ PRINT_FIELD_XVAL(rtmsg, rtm_scope,
+ routing_scopes, NULL);
+ tprint_struct_next();
+ PRINT_FIELD_XVAL(rtmsg, rtm_type,
+ routing_types, "RTN_???");
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(rtmsg, rtm_flags,
+ routing_flags, "RTM_F_???");
+ decode_nla = true;
+ }
+ } else
+ tprint_more_data_follows();
+ tprint_struct_end();
+
+ offset = NLMSG_ALIGN(sizeof(rtmsg));
+ if (decode_nla && len > offset) {
+ tprints(", ");
+ decode_nlattr(tcp, addr + offset, len - offset,
+ rtnl_route_attrs, "RTA_???",
+ rtmsg_nla_decoders,
+ ARRAY_SIZE(rtmsg_nla_decoders), &rtmsg);
+ }
+}
diff --git a/src/rtnl_rule.c b/src/rtnl_rule.c
new file mode 100644
index 000000000..93492b800
--- /dev/null
+++ b/src/rtnl_rule.c
@@ -0,0 +1,143 @@
+/*
+ * Copyright (c) 2016 Fabien Siron <fabien.siron@epita.fr>
+ * Copyright (c) 2017 JingPiao Chen <chenjingpiao@gmail.com>
+ * Copyright (c) 2016-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#include "netlink_route.h"
+#include "nlattr.h"
+
+#include "netlink.h"
+#include "types/fib_rules.h"
+
+#include "xlat/fib_rule_actions.h"
+#include "xlat/fib_rule_flags.h"
+#include "xlat/rtnl_rule_attrs.h"
+
+static bool
+decode_rule_addr(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ const struct_fib_rule_hdr *const msg = opaque_data;
+
+ decode_inet_addr(tcp, addr, len, msg->family, NULL);
+
+ return true;
+}
+
+static bool
+decode_fib_rule_uid_range(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ struct_fib_rule_uid_range range;
+
+ if (len < sizeof(range))
+ return false;
+ else if (!umove_or_printaddr(tcp, addr, &range)) {
+ tprint_struct_begin();
+ PRINT_FIELD_U(range, start);
+ tprint_struct_next();
+ PRINT_FIELD_U(range, end);
+ tprint_struct_end();
+ }
+
+ return true;
+}
+
+static bool
+decode_rule_port_range(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ struct_fib_rule_port_range range;
+
+ if (len < sizeof(range))
+ return false;
+ else if (!umove_or_printaddr(tcp, addr, &range)) {
+ tprint_struct_begin();
+ PRINT_FIELD_U(range, start);
+ tprint_struct_next();
+ PRINT_FIELD_U(range, end);
+ tprint_struct_end();
+ }
+
+ return true;
+}
+
+static const nla_decoder_t fib_rule_hdr_nla_decoders[] = {
+ [FRA_DST] = decode_rule_addr,
+ [FRA_SRC] = decode_rule_addr,
+ [FRA_IIFNAME] = decode_nla_str,
+ [FRA_GOTO] = decode_nla_u32,
+ [FRA_PRIORITY] = decode_nla_u32,
+ [FRA_FWMARK] = decode_nla_u32,
+ [FRA_FLOW] = decode_nla_u32,
+ [FRA_TUN_ID] = decode_nla_be64,
+ [FRA_SUPPRESS_IFGROUP] = decode_nla_u32,
+ [FRA_SUPPRESS_PREFIXLEN] = decode_nla_u32,
+ [FRA_TABLE] = decode_nla_rt_class,
+ [FRA_FWMASK] = decode_nla_u32,
+ [FRA_OIFNAME] = decode_nla_str,
+ [FRA_PAD] = NULL,
+ [FRA_L3MDEV] = decode_nla_u8,
+ [FRA_UID_RANGE] = decode_fib_rule_uid_range,
+ [FRA_PROTOCOL] = decode_nla_rt_proto,
+ [FRA_IP_PROTO] = decode_nla_ip_proto,
+ [FRA_SPORT_RANGE] = decode_rule_port_range,
+ [FRA_DPORT_RANGE] = decode_rule_port_range,
+};
+
+DECL_NETLINK_ROUTE_DECODER(decode_fib_rule_hdr)
+{
+ struct_fib_rule_hdr msg = { .family = family };
+ size_t offset = sizeof(msg.family);
+ bool decode_nla = false;
+
+ tprint_struct_begin();
+ PRINT_FIELD_XVAL(msg, family, addrfams, "AF_???");
+
+ tprints(", ");
+ if (len >= sizeof(msg)) {
+ if (!umoven_or_printaddr(tcp, addr + offset,
+ sizeof(msg) - offset,
+ (char *) &msg + offset)) {
+ PRINT_FIELD_U(msg, dst_len);
+ tprint_struct_next();
+ PRINT_FIELD_U(msg, src_len);
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(msg, tos,
+ ip_type_of_services, "IPTOS_TOS_???");
+ tprint_struct_next();
+ PRINT_FIELD_XVAL(msg, table,
+ routing_table_ids, "RT_TABLE_???");
+ tprint_struct_next();
+ PRINT_FIELD_XVAL(msg, action,
+ fib_rule_actions, "FR_ACT_???");
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(msg, flags,
+ fib_rule_flags, "FIB_RULE_???");
+ decode_nla = true;
+ }
+ } else
+ tprint_more_data_follows();
+ tprint_struct_end();
+
+ offset = NLMSG_ALIGN(sizeof(msg));
+ if (decode_nla && len > offset) {
+ tprints(", ");
+ decode_nlattr(tcp, addr + offset, len - offset,
+ rtnl_rule_attrs, "FRA_???",
+ fib_rule_hdr_nla_decoders,
+ ARRAY_SIZE(fib_rule_hdr_nla_decoders), &msg);
+ }
+}
diff --git a/src/rtnl_tc.c b/src/rtnl_tc.c
new file mode 100644
index 000000000..2d9ea205e
--- /dev/null
+++ b/src/rtnl_tc.c
@@ -0,0 +1,347 @@
+/*
+ * Copyright (c) 2016 Fabien Siron <fabien.siron@epita.fr>
+ * Copyright (c) 2017 JingPiao Chen <chenjingpiao@gmail.com>
+ * Copyright (c) 2016-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include "netlink_route.h"
+#include "nlattr.h"
+
+#include "netlink.h"
+#ifdef HAVE_STRUCT_GNET_STATS_BASIC
+# include <linux/gen_stats.h>
+#endif
+#include <linux/pkt_sched.h>
+#include <linux/rtnetlink.h>
+
+#include "xlat/rtnl_tc_attrs.h"
+#include "xlat/rtnl_tca_stab_attrs.h"
+#include "xlat/rtnl_tca_stats_attrs.h"
+
+static bool
+decode_tc_stats(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ struct tc_stats st;
+ const unsigned int sizeof_tc_stats =
+ offsetofend(struct tc_stats, backlog);
+
+ if (len < sizeof_tc_stats)
+ return false;
+ else if (!umoven_or_printaddr(tcp, addr, sizeof_tc_stats, &st)) {
+ tprint_struct_begin();
+ PRINT_FIELD_U(st, bytes);
+ tprint_struct_next();
+ PRINT_FIELD_U(st, packets);
+ tprint_struct_next();
+ PRINT_FIELD_U(st, drops);
+ tprint_struct_next();
+ PRINT_FIELD_U(st, overlimits);
+ tprint_struct_next();
+ PRINT_FIELD_U(st, bps);
+ tprint_struct_next();
+ PRINT_FIELD_U(st, pps);
+ tprint_struct_next();
+ PRINT_FIELD_U(st, qlen);
+ tprint_struct_next();
+ PRINT_FIELD_U(st, backlog);
+ tprint_struct_end();
+ }
+
+ return true;
+}
+
+static bool
+decode_tc_estimator(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ struct tc_estimator est;
+
+ if (len < sizeof(est))
+ return false;
+ else if (!umove_or_printaddr(tcp, addr, &est)) {
+ tprint_struct_begin();
+ PRINT_FIELD_D(est, interval);
+ tprint_struct_next();
+ PRINT_FIELD_U(est, ewma_log);
+ tprint_struct_end();
+ }
+
+ return true;
+}
+
+static bool
+decode_gnet_stats_basic(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+#ifdef HAVE_STRUCT_GNET_STATS_BASIC
+ struct gnet_stats_basic sb;
+ const unsigned int sizeof_st_basic =
+ offsetofend(struct gnet_stats_basic, packets);
+
+ if (len < sizeof_st_basic)
+ return false;
+ else if (!umoven_or_printaddr(tcp, addr, sizeof_st_basic, &sb)) {
+ tprint_struct_begin();
+ PRINT_FIELD_U(sb, bytes);
+ tprint_struct_next();
+ PRINT_FIELD_U(sb, packets);
+ tprint_struct_end();
+ }
+
+ return true;
+#else
+ return false;
+#endif
+}
+
+static bool
+decode_gnet_stats_rate_est(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+#ifdef HAVE_STRUCT_GNET_STATS_RATE_EST
+ struct gnet_stats_rate_est est;
+
+ if (len < sizeof(est))
+ return false;
+ else if (!umove_or_printaddr(tcp, addr, &est)) {
+ tprint_struct_begin();
+ PRINT_FIELD_U(est, bps);
+ tprint_struct_next();
+ PRINT_FIELD_U(est, pps);
+ tprint_struct_end();
+ }
+
+ return true;
+#else
+ return false;
+#endif
+}
+
+static bool
+decode_gnet_stats_queue(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+#ifdef HAVE_STRUCT_GNET_STATS_QUEUE
+ struct gnet_stats_queue qstats;
+
+ if (len < sizeof(qstats))
+ return false;
+ else if (!umove_or_printaddr(tcp, addr, &qstats)) {
+ tprint_struct_begin();
+ PRINT_FIELD_U(qstats, qlen);
+ tprint_struct_next();
+ PRINT_FIELD_U(qstats, backlog);
+ tprint_struct_next();
+ PRINT_FIELD_U(qstats, drops);
+ tprint_struct_next();
+ PRINT_FIELD_U(qstats, requeues);
+ tprint_struct_next();
+ PRINT_FIELD_U(qstats, overlimits);
+ tprint_struct_end();
+ }
+
+ return true;
+#else
+ return false;
+#endif
+}
+
+static bool
+decode_gnet_stats_rate_est64(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+#ifdef HAVE_STRUCT_GNET_STATS_RATE_EST64
+ struct gnet_stats_rate_est64 est;
+
+ if (len < sizeof(est))
+ return false;
+ else if (!umove_or_printaddr(tcp, addr, &est)) {
+ tprint_struct_begin();
+ PRINT_FIELD_U(est, bps);
+ tprint_struct_next();
+ PRINT_FIELD_U(est, pps);
+ tprint_struct_end();
+ }
+
+ return true;
+#else
+ return false;
+#endif
+}
+
+static const nla_decoder_t tca_stats_nla_decoders[] = {
+ [TCA_STATS_BASIC] = decode_gnet_stats_basic,
+ [TCA_STATS_RATE_EST] = decode_gnet_stats_rate_est,
+ [TCA_STATS_QUEUE] = decode_gnet_stats_queue,
+ [TCA_STATS_APP] = NULL, /* unimplemented */
+ [TCA_STATS_RATE_EST64] = decode_gnet_stats_rate_est64,
+ [TCA_STATS_PAD] = NULL,
+ [TCA_STATS_BASIC_HW] = decode_gnet_stats_basic,
+ [TCA_STATS_PKT64] = decode_nla_u64,
+};
+
+bool
+decode_nla_tc_stats(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ decode_nlattr(tcp, addr, len, rtnl_tca_stats_attrs, "TCA_STATS_???",
+ tca_stats_nla_decoders,
+ ARRAY_SIZE(tca_stats_nla_decoders), opaque_data);
+
+ return true;
+}
+
+static bool
+decode_tc_sizespec(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+#ifdef HAVE_STRUCT_TC_SIZESPEC
+ struct tc_sizespec s;
+
+ if (len < sizeof(s))
+ return false;
+ else if (!umove_or_printaddr(tcp, addr, &s)) {
+ tprint_struct_begin();
+ PRINT_FIELD_U(s, cell_log);
+ tprint_struct_next();
+ PRINT_FIELD_U(s, size_log);
+ tprint_struct_next();
+ PRINT_FIELD_D(s, cell_align);
+ tprint_struct_next();
+ PRINT_FIELD_D(s, overhead);
+ tprint_struct_next();
+ PRINT_FIELD_U(s, linklayer);
+ tprint_struct_next();
+ PRINT_FIELD_U(s, mpu);
+ tprint_struct_next();
+ PRINT_FIELD_U(s, mtu);
+ tprint_struct_next();
+ PRINT_FIELD_U(s, tsize);
+ tprint_struct_end();
+ }
+
+ return true;
+#else
+ return false;
+#endif
+}
+
+static bool
+print_stab_data(struct tcb *const tcp, void *const elem_buf,
+ const size_t elem_size, void *const opaque_data)
+{
+ tprintf("%" PRIu16, *(uint16_t *) elem_buf);
+
+ return true;
+}
+
+static bool
+decode_tca_stab_data(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ uint16_t data;
+ const size_t nmemb = len / sizeof(data);
+
+ if (!nmemb)
+ return false;
+
+ print_array(tcp, addr, nmemb, &data, sizeof(data),
+ tfetch_mem, print_stab_data, NULL);
+
+ return true;
+}
+
+static const nla_decoder_t tca_stab_nla_decoders[] = {
+ [TCA_STAB_BASE] = decode_tc_sizespec,
+ [TCA_STAB_DATA] = decode_tca_stab_data
+};
+
+static bool
+decode_tca_stab(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ decode_nlattr(tcp, addr, len, rtnl_tca_stab_attrs, "TCA_STAB_???",
+ tca_stab_nla_decoders,
+ ARRAY_SIZE(tca_stab_nla_decoders), opaque_data);
+
+ return true;
+}
+
+static const nla_decoder_t tcmsg_nla_decoders[] = {
+ [TCA_KIND] = decode_nla_str,
+ [TCA_OPTIONS] = NULL, /* unimplemented */
+ [TCA_STATS] = decode_tc_stats,
+ [TCA_XSTATS] = NULL, /* unimplemented */
+ [TCA_RATE] = decode_tc_estimator,
+ [TCA_FCNT] = decode_nla_u32,
+ [TCA_STATS2] = decode_nla_tc_stats,
+ [TCA_STAB] = decode_tca_stab,
+ [TCA_PAD] = NULL,
+ [TCA_DUMP_INVISIBLE] = NULL,
+ [TCA_CHAIN] = decode_nla_u32,
+ [TCA_HW_OFFLOAD] = decode_nla_u8,
+ [TCA_INGRESS_BLOCK] = decode_nla_u32,
+ [TCA_EGRESS_BLOCK] = decode_nla_u32,
+ [TCA_DUMP_FLAGS] = decode_nla_u32,
+};
+
+DECL_NETLINK_ROUTE_DECODER(decode_tcmsg)
+{
+ struct tcmsg tcmsg = { .tcm_family = family };
+ size_t offset = sizeof(tcmsg.tcm_family);
+ bool decode_nla = false;
+
+ tprint_struct_begin();
+ PRINT_FIELD_XVAL(tcmsg, tcm_family, addrfams, "AF_???");
+
+ tprints(", ");
+ if (len >= sizeof(tcmsg)) {
+ if (!umoven_or_printaddr(tcp, addr + offset,
+ sizeof(tcmsg) - offset,
+ (char *) &tcmsg + offset)) {
+ PRINT_FIELD_IFINDEX(tcmsg, tcm_ifindex);
+ tprint_struct_next();
+ PRINT_FIELD_U(tcmsg, tcm_handle);
+ tprint_struct_next();
+ PRINT_FIELD_U(tcmsg, tcm_parent);
+ tprint_struct_next();
+ PRINT_FIELD_U(tcmsg, tcm_info);
+ decode_nla = true;
+ }
+ } else
+ tprint_more_data_follows();
+ tprint_struct_end();
+
+ offset = NLMSG_ALIGN(sizeof(tcmsg));
+ if (decode_nla && len > offset) {
+ tprints(", ");
+ decode_nlattr(tcp, addr + offset, len - offset,
+ rtnl_tc_attrs, "TCA_???", tcmsg_nla_decoders,
+ ARRAY_SIZE(tcmsg_nla_decoders), NULL);
+ }
+}
diff --git a/src/rtnl_tc_action.c b/src/rtnl_tc_action.c
new file mode 100644
index 000000000..fefaced04
--- /dev/null
+++ b/src/rtnl_tc_action.c
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2016 Fabien Siron <fabien.siron@epita.fr>
+ * Copyright (c) 2017 JingPiao Chen <chenjingpiao@gmail.com>
+ * Copyright (c) 2016-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include "netlink_route.h"
+#include "nlattr.h"
+
+#include "netlink.h"
+#include <linux/pkt_cls.h>
+#include <linux/rtnetlink.h>
+
+#include "xlat/rtnl_tc_action_attrs.h"
+#include "xlat/rtnl_tca_act_flags.h"
+#include "xlat/rtnl_tca_act_hw_stats.h"
+
+
+static bool
+decode_tca_act_flags(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ static const struct decode_nla_xlat_opts opts = {
+ rtnl_tca_act_flags, "TCA_ACT_FLAGS_???",
+ .size = 4,
+ };
+
+ return decode_nla_flags(tcp, addr, len, &opts);
+}
+
+static bool
+decode_tca_act_hw_stats(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const void *const opaque_data)
+{
+ static const struct decode_nla_xlat_opts opts = {
+ rtnl_tca_act_hw_stats, "TCA_ACT_HW_STATS_???",
+ .size = 4,
+ };
+
+ return decode_nla_flags(tcp, addr, len, &opts);
+}
+
+static const nla_decoder_t tcamsg_nla_decoders[] = {
+ [TCA_ACT_KIND] = decode_nla_str,
+ [TCA_ACT_OPTIONS] = NULL, /* unimplemented */
+ [TCA_ACT_INDEX] = decode_nla_u32,
+ [TCA_ACT_STATS] = decode_nla_tc_stats,
+ [TCA_ACT_PAD] = NULL,
+ [TCA_ACT_COOKIE] = NULL, /* default parser */
+ [TCA_ACT_FLAGS] = decode_tca_act_flags,
+ [TCA_ACT_HW_STATS] = decode_tca_act_hw_stats,
+ [TCA_ACT_USED_HW_STATS] = decode_tca_act_hw_stats,
+};
+
+DECL_NETLINK_ROUTE_DECODER(decode_tcamsg)
+{
+ struct tcamsg tca = { .tca_family = family };
+
+ tprint_struct_begin();
+ PRINT_FIELD_XVAL(tca, tca_family, addrfams, "AF_???");
+ tprint_struct_end();
+
+ const size_t offset = NLMSG_ALIGN(sizeof(tca));
+ if (len > offset) {
+ tprints(", ");
+ decode_nlattr(tcp, addr + offset, len - offset,
+ rtnl_tc_action_attrs, "TCA_ACT_???",
+ tcamsg_nla_decoders,
+ ARRAY_SIZE(tcamsg_nla_decoders), NULL);
+ }
+}
diff --git a/src/s390.c b/src/s390.c
new file mode 100644
index 000000000..451014610
--- /dev/null
+++ b/src/s390.c
@@ -0,0 +1,1545 @@
+/*
+ * s390-specific syscalls decoders.
+ *
+ * Copyright (c) 2018-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#if defined S390 || defined S390X
+
+# include <sys/user.h>
+
+# include "xlat/s390_guarded_storage_commands.h"
+# include "xlat/s390_runtime_instr_commands.h"
+# include "xlat/s390_sthyi_function_codes.h"
+
+/*
+ * Since, for some reason, kernel doesn't expose all these nice constants and
+ * structures in UAPI, we have to re-declare them ourselves.
+ */
+
+/**
+ * "The header section is placed at the beginning of the response buffer and
+ * identifies the location and length of all other sections. Valid sections have
+ * nonzero offset values in the header. Each section provides information about
+ * validity of fields within that section."
+ */
+struct sthyi_hdr {
+ /**
+ * Header Flag Byte 1 - These flag settings indicate the environment
+ * that the instruction was executed in and may influence the value of
+ * the validity bits. The validity bits, and not these flags, should be
+ * used to determine if a field is valid.
+ * - 0x80 - Global Performance Data unavailable
+ * - 0x40 - One or more hypervisor levels below this level does not
+ * support the STHYI instruction. When this flag is set the
+ * value of INFGPDU is not meaningful because the state of the
+ * Global Performance Data setting cannot be determined.
+ * - 0x20 - Virtualization stack is incomplete. This bit indicates one
+ * of two cases:
+ * - One or more hypervisor levels does not support the STHYI
+ * instruction. For this case, INFSTHYI will also be set.
+ * - There were more than three levels of guest/hypervisor information
+ * to report.
+ * - 0x10 - Execution environment is not within a logical partition.
+ */
+ uint8_t infhflg1;
+ uint8_t infhflg2; /**< Header Flag Byte 2 reserved for IBM(R) use */
+ uint8_t infhval1; /**< Header Validity Byte 1 reserved for IBM use */
+ uint8_t infhval2; /**< Header Validity Byte 2 reserved for IBM use */
+ char reserved_1__[3]; /**< Reserved for future IBM use */
+ uint8_t infhygct; /**< Count of Hypervisor and Guest Sections */
+ uint16_t infhtotl; /**< Total length of response buffer */
+ uint16_t infhdln; /**< Length of Header Section mapped by INF0HDR */
+ uint16_t infmoff; /**< Offset to Machine Section mapped by INF0MAC */
+ uint16_t infmlen; /**< Length of Machine Section */
+ uint16_t infpoff; /**< Offset to Partition Section mapped by INF0PAR */
+ uint16_t infplen; /**< Length of Partition Section */
+ uint16_t infhoff1; /**< Offset to Hypervisor Section1 mapped by INF0HYP */
+ uint16_t infhlen1; /**< Length of Hypervisor Section1 */
+ uint16_t infgoff1; /**< Offset to Guest Section1 mapped by INF0GST */
+ uint16_t infglen1; /**< Length of Guest Section1 */
+ uint16_t infhoff2; /**< Offset to Hypervisor Section2 mapped by INF0HYP */
+ uint16_t infhlen2; /**< Length of Hypervisor Section2 */
+ uint16_t infgoff2; /**< Offset to Guest Section2 mapped by INF0GST */
+ uint16_t infglen2; /**< Length of Guest Section2 */
+ uint16_t infhoff3; /**< Offset to Hypervisor Section3 mapped by INF0HYP */
+ uint16_t infhlen3; /**< Length of Hypervisor Section3 */
+ uint16_t infgoff3; /**< Offset to Guest Section3 mapped by INF0GST */
+ uint16_t infglen3; /**< Length of Guest Section3 */
+} ATTRIBUTE_PACKED;
+static_assert(sizeof(struct sthyi_hdr) == 44,
+ "Unexpected struct sthyi_hdr size");
+
+struct sthyi_machine {
+ uint8_t infmflg1; /**< Machine Flag Byte 1 reserved for IBM use */
+ uint8_t infmflg2; /**< Machine Flag Byte 2 reserved for IBM use */
+ /**
+ * Machine Validity Byte 1.
+ * - 0x80 - INFMPROC, Processor Count Validity. When this bit is on,
+ * it indicates that INFMSCPS, INFMDCPS, INFMSIFL,
+ * and INFMDIFL contain valid counts. The validity bit
+ * may be off when:
+ * - STHYI support is not available on a lower level
+ * hypervisor, or
+ * - Global Performance Data is not enabled.
+ * - 0x40 - INFMMID, Machine ID Validity. This bit being on indicates
+ * that a SYSIB 1.1.1 was obtained from STSI and information
+ * reported in the following fields is valid: INFMTYPE,
+ * INFMMANU, INFMSEQ, and INFMPMAN.
+ * - 0x20 - INFMMNAM, Machine Name Validity. This bit being on
+ * indicates that the INFMNAME field is valid.
+ * - 0x10 - INFMPLNV, reserved for IBM use.
+ */
+ uint8_t infmval1;
+ uint8_t infmval2; /**< Machine Validity Byte 2 reserved for IBM use */
+ /**
+ * Number of shared CPs configured in the machine or in the physical
+ * partition if the system is physically partitioned.
+ */
+ uint16_t infmscps;
+ /**
+ * Number of dedicated CPs configured in this machine or in the physical
+ * partition if the system is physically partitioned.
+ */
+ uint16_t infmdcps;
+ /**
+ * Number of shared IFLs configured in this machine or in the physical
+ * partition if the system is physically partitioned.
+ */
+ uint16_t infmsifl;
+ /**
+ * Number of dedicated IFLs configured in this machine or in the
+ * physical partition if the system is physically partitioned.
+ */
+ uint16_t infmdifl;
+ char infmname[8]; /**< EBCDIC Machine Name */
+ char infmtype[4]; /**< EBCDIC Type */
+ char infmmanu[16]; /**< EBCDIC Manufacturer */
+ char infmseq[16]; /**< EBCDIC Sequence Code */
+ char infmpman[4]; /**< EBCDIC Plant of Manufacture */
+ char reserved_1__[4]; /**< Reserved for future IBM use */
+ char infmplnm[8]; /**< EBCDIC Reserved for IBM use */
+} ATTRIBUTE_PACKED;
+static_assert(sizeof(struct sthyi_machine) == 72,
+ "Unexpected struct sthyi_machine size");
+
+struct sthyi_partition {
+ /**
+ * Partition Flag Byte 1.
+ * - 0x80 - INFPMTEN, multithreading (MT) is enabled.
+ * - 0x40 - INFPPOOL, reserved for IBM use.
+ */
+ uint8_t infpflg1;
+ /** Partition Flag Byte 2 reserved for IBM use */
+ uint8_t infpflg2;
+ /**
+ * Partition Validity Byte 1.
+ * - 0x80 - INFPPROC, Processor Count Validity. This bit being on
+ * indicates that INFPSCPS, INFPDCPS, INFPSIFL, and INFPDIFL
+ * contain valid counts.
+ * - 0x40 - INFPWBCC, Partition Weight-Based Capped Capacity Validity.
+ * This bit being on indicates that INFPWBCP and INFPWBIF
+ * are valid.
+ * - 0x20 - INFPACC, Partition Absolute Capped Capacity Validity.
+ * This bit being on indicates that INFPABCP and INFPABIF
+ * are valid.
+ * - 0x10 - INFPPID, Partition ID Validity. This bit being on indicates
+ * that a SYSIB 2.2.2 was obtained from STSI and information
+ * reported in the following fields is valid: INFPPNUM
+ * and INFPPNAM.
+ * - 0x08 - INFPLGVL, LPAR Group Absolute Capacity Capping Information
+ * Validity. This bit being on indicates that INFPLGNM,
+ * INFPLGCP, and INFPLGIF are valid.
+ * - 0x04 - INFPPLNV, reserved for IBM use.
+ */
+ uint8_t infpval1;
+ /** Partition Validity Byte 2 reserved for IBM use */
+ uint8_t infpval2;
+ /** Logical partition number */
+ uint16_t infppnum;
+ /**
+ * Number of shared logical CPs configured for this partition. Count
+ * of cores when MT is enabled.
+ */
+ uint16_t infpscps;
+ /**
+ * Number of dedicated logical CPs configured for this partition. Count
+ * of cores when MT is enabled.
+ */
+ uint16_t infpdcps;
+ /**
+ * Number of shared logical IFLs configured for this partition. Count
+ * of cores when MT is enabled.
+ */
+ uint16_t infpsifl;
+ /**
+ * Number of dedicated logical IFLs configured for this partition.
+ * Count of cores when MT is enabled.
+ */
+ uint16_t infpdifl;
+ /** Reserved for future IBM use */
+ char reserved_1__[2];
+ /** EBCIDIC Logical partition name */
+ char infppnam[8];
+ /**
+ * Partition weight-based capped capacity for CPs, a scaled number where
+ * 0x00010000 represents one core. Zero if not capped.
+ */
+ uint32_t infpwbcp;
+ /**
+ * Partition absolute capped capacity for CPs, a scaled number where
+ * 0x00010000 represents one core. Zero if not capped.
+ */
+ uint32_t infpabcp;
+ /**
+ * Partition weight-based capped capacity for IFLs, a scaled number
+ * where 0x00010000 represents one core. Zero if not capped.
+ */
+ uint32_t infpwbif;
+ /**
+ * Partition absolute capped capacity for IFLs, a scaled number where
+ * 0x00010000 represents one core. Zero if not capped.
+ */
+ uint32_t infpabif;
+ /**
+ * EBCIDIC LPAR group name. Binary zeros when the partition is not in
+ * an LPAR group. EBCDIC and padded with blanks on the right when in a
+ * group. The group name is reported only when there is a group cap on
+ * CP or IFL CPU types and the partition has the capped CPU type.
+ */
+ char infplgnm[8];
+ /**
+ * LPAR group absolute capacity value for CP CPU type when nonzero. This
+ * field will be nonzero only when INFPLGNM is nonzero and a cap is
+ * defined for the LPAR group for the CP CPU type. When nonzero,
+ * contains a scaled number where 0x00010000 represents one core.
+ */
+ uint32_t infplgcp;
+ /**
+ * LPAR group absolute capacity value for IFL CPU type when nonzero.
+ * This field will be nonzero only when INFPLGNM is nonzero and a cap
+ * is defined for the LPAR group for the IFL CPU type. When nonzero,
+ * contains a scaled number where 0x00010000 represents one core.
+ */
+ uint32_t infplgif;
+ char infpplnm[8]; /**< Reserved for future IBM use. */
+} ATTRIBUTE_PACKED;
+static_assert(sizeof(struct sthyi_partition) == 64,
+ "Unexpected struct sthyi_partition size");
+
+struct sthyi_hypervisor {
+ /**
+ * Hypervisor Flag Byte 1
+ * - 0x80 - INFYLMCN, guest CPU usage hard limiting is using
+ * the consumption method.
+ * - 0x40 - INFYLMPR, if on, LIMITHARD caps use prorated core time
+ * for capping. If off, raw CPU time is used.
+ * - 0x20 - INFYMTEN, hypervisor is MT-enabled.
+ */
+ uint8_t infyflg1;
+ uint8_t infyflg2; /**< Hypervisor Flag Byte 2 reserved for IBM use */
+ uint8_t infyval1; /**< Hypervisor Validity Byte 1 reserved for IBM use */
+ uint8_t infyval2; /**< Hypervisor Validity Byte 2 reserved for IBM use */
+ /**
+ * Hypervisor Type
+ * - 1 - z/VM is the hypervisor.
+ */
+ uint8_t infytype;
+ char reserved_1__[1]; /**< Reserved for future IBM use */
+ /**
+ * Threads in use per CP core. Only valid when MT enabled
+ * (INFPFLG1 0x80 is ON).
+ */
+ uint8_t infycpt;
+ /**
+ * Threads in use per IFL core. Only valid when MT enabled
+ * (INFPFLG1 0x80 is ON).
+ */
+ uint8_t infyiflt;
+ /**
+ * EBCID System Identifier. Left justified and padded with blanks.
+ * This field will be blanks if non-existent.
+ */
+ char infysyid[8];
+ /**
+ * EBCID Cluster Name. Left justified and padded with blanks. This is
+ * the name on the SSI statement in the system configuration file. This
+ * field will be blanks if nonexistent.
+ */
+ char infyclnm[8];
+ /**
+ * Total number of CPs shared among guests of this hypervisor.
+ * Number of cores when MT enabled.
+ */
+ uint16_t infyscps;
+ /**
+ * Total number of CPs dedicated to guests of this hypervisor.
+ * Number of cores when MT enabled.
+ */
+ uint16_t infydcps;
+ /**
+ * Total number of IFLs shared among guests of this hypervisor.
+ * Number of cores when MT enabled.
+ */
+ uint16_t infysifl;
+ /**
+ * Total number of IFLs dedicated to guests of this hypervisor.
+ * Number of cores when MT enabled.
+ */
+ uint16_t infydifl;
+ /**
+ * Mask of installed function codes. Bit position corresponding
+ * to the function code number is on if the function code is supported
+ * by this hypervisor. Bits may be on even if the guest
+ * is not authorized.
+ *
+ * Element 0 (INFYINS0) flags:
+ * - 0x80 - INFYFCCP, FC = 0, Obtain CPU Capacity Info.
+ * - 0x40 - INFYFHYP, FC = 1, Hypervisor Environment Info.
+ * - 0x20 - INFYFGLS, FC = 2, Guest List.
+ * - 0x10 - INFYFGST, FC = 3, Designated Guest Info.
+ * - 0x08 - INFYFPLS, FC = 4, Resource Pool List.
+ * - 0x04 - INFYFPDS, FC = 5, Designated Resource Pool Information.
+ * - 0x02 - INFYFPML, FC = 6, Resource Pool Member List.
+ */
+ uint8_t infyinsf[8];
+ /**
+ * Mask of authorized functions codes. Bit position corresponding
+ * to the function code number is on if the function code is supported
+ * by this hypervisor and the guest has been authorized
+ * in the directory.
+ *
+ * The flags are the same as in infyinsf.
+ */
+ uint8_t infyautf[8];
+} ATTRIBUTE_PACKED;
+static_assert(sizeof(struct sthyi_hypervisor) == 48,
+ "Unexpected struct sthyi_hypervisor size");
+
+struct sthyi_guest {
+ /**
+ * Guest Flag Byte 1
+ * - 0x80 - Guest is mobility enabled
+ * - 0x40 - Guest has multiple virtual CPU types
+ * - 0x20 - Guest CP dispatch type has LIMITHARD cap
+ * - 0x10 - Guest IFL dispatch type has LIMITHARD cap
+ * - 0x08 - Virtual CPs are thread dispatched
+ * - 0x04 - Virtual IFLs are thread dispatched
+ */
+ uint8_t infgflg1;
+ uint8_t infgflg2; /**< Guest Flag Byte 2 reserved for IBM use */
+ uint8_t infgval1; /**< Guest Validity Byte 1 reserved for IBM use */
+ uint8_t infgval2; /**< Guest Validity Byte 2 reserved for IBM use */
+ char infgusid[8]; /**< EBCDIC Userid */
+ uint16_t infgscps; /**< Number of guest shared CPs */
+ uint16_t infgdcps; /**< Number of guest dedicated CPs */
+ /**
+ * Dispatch type for guest CPs. This field is valid if INFGSCPS or
+ * INFGDCPS is greater than zero.
+ * - 0 - General Purpose (CP)
+ */
+ uint8_t infgcpdt;
+ char reserved_1__[3]; /**< Reserved for future IBM use */
+ /**
+ * Guest current capped capacity for shared virtual CPs, a scaled number
+ * where 0x00010000 represents one core. This field is zero to
+ * indicate not capped when:
+ * - There is no CP individual limit (that is, the "Guest CP dispatch
+ * type has LIMITHARD cap" bit in field INFGFLG1 is OFF).
+ * - There are no shared CPs on the system (that is, INFYSCPS = 0).
+ * If there is a CP limit but there are no shared CPs or virtual CPs,
+ * the limit is meaningless and does not apply to anything.
+ */
+ uint32_t infgcpcc;
+ uint16_t infgsifl; /**< Number of guest shared IFLs */
+ uint16_t infgdifl; /**< Number of guest dedicated IFLs */
+ /**
+ * Dispatch type for guest IFLs. This field is valid if INFGSIFL or
+ * INFGDIFL is greater than zero.
+ * - 0 - General Purpose (CP)
+ * - 3 - Integrated Facility for Linux (IFL)
+ */
+ uint8_t infgifdt;
+ char reserved_2__[3]; /**< Reserved for future IBM use */
+ /**
+ * Guest current capped capacity for shared virtual IFLs, a scaled
+ * number where 0x00010000 represents one core. This field is zero
+ * to indicate not capped with an IFL limit when:
+ * - There is no IFL individual limit (that is, the "Guest IFL dispatch
+ * type has LIMITHARD cap" bit in field INFGFLG1 is OFF).
+ * - The guest's IFLs are dispatched on CPs (that is, INFGIFDT = 00).
+ * When the guest's IFLs are dispatched on CPs, the CP individual
+ * limit (in INFGCPCC) is applied to the guest's virtual IFLs and
+ * virtual CPs.
+ */
+ uint32_t infgifcc;
+ /**
+ * CPU Pool Capping Flags
+ * - 0x80 - CPU Pool's CP virtual type has LIMITHARD cap
+ * - 0x40 - CPU Pool's CP virtual type has CAPACITY cap
+ * - 0x20 - CPU Pool's IFL virtual type has LIMITHARD cap
+ * - 0x10 - CPU Pool's IFL virtual type has CAPACITY cap
+ * - 0x08 - CPU Pool uses prorated core time.
+ */
+ uint8_t infgpflg;
+ char reserved_3__[3]; /**< Reserved for future IBM use */
+ /**
+ * EBCDIC CPU Pool Name. This field will be blanks if the guest is not
+ * in a CPU Pool.
+ */
+ char infgpnam[8];
+ /**
+ * CPU Pool capped capacity for shared virtual CPs, a scaled number
+ * where 0x00010000 represents one core. This field will be zero if
+ * not capped.
+ */
+ uint32_t infgpccc;
+ /**
+ * CPU Pool capped capacity for shared virtual IFLs, a scaled number
+ * where 0x00010000 represents one core. This field will be zero if
+ * not capped.
+ */
+ uint32_t infgpicc;
+} ATTRIBUTE_PACKED;
+static_assert(sizeof(struct sthyi_guest) == 56,
+ "Unexpected struct sthyi_guest size");
+
+
+static void
+decode_ebcdic(const char *ebcdic, char *ascii, size_t size)
+{
+ /*
+ * This is mostly Linux's EBCDIC-ASCII conversion table, except for
+ * various non-representable characters that are converted to spaces for
+ * readability purposes, as it is intended to be a hint for the string
+ * contents and not precise conversion.
+ */
+ static char conv_table[] =
+ "\0\1\2\3 \11 \177 \13\14\15\16\17"
+ "\20\21\22\23 \n\10 \30\31 \34\35\36\37"
+ " \34 \n\27\33 \5\6\7"
+ " \26 \4 \24\25 \32"
+ " " " .<(+|"
+ "& " "!$*);~"
+ "-/ " "|,%_>?"
+ " `" ":#@'=\""
+ " abcdefghi" " "
+ " jklmnopqr" " "
+ " ~stuvwxyz" " "
+ "^ " "[] "
+ "{ABCDEFGHI" " "
+ "}JKLMNOPQR" " "
+ "\\ STUVWXYZ" " "
+ "0123456789" " ";
+
+ while (size--)
+ *ascii++ = conv_table[(unsigned char) *ebcdic++];
+}
+
+# define DECODE_EBCDIC(ebcdic_, ascii_) \
+ decode_ebcdic((ebcdic_), (ascii_), \
+ sizeof(ebcdic_) + MUST_BE_ARRAY(ebcdic_))
+# define PRINT_EBCDIC(ebcdic_) \
+ do { \
+ char ascii_str[sizeof(ebcdic_) + MUST_BE_ARRAY(ebcdic_)]; \
+ \
+ DECODE_EBCDIC(ebcdic_, ascii_str); \
+ print_quoted_string(ascii_str, sizeof(ascii_str), \
+ QUOTE_EMIT_COMMENT); \
+ } while (0)
+
+# define PRINT_FIELD_EBCDIC(where_, field_) \
+ do { \
+ PRINT_FIELD_HEX_ARRAY(where_, field_); \
+ PRINT_EBCDIC((where_).field_); \
+ } while (0)
+
+# define PRINT_FIELD_WEIGHT(where_, field_) \
+ do { \
+ PRINT_FIELD_X(where_, field_); \
+ if ((where_).field_) \
+ tprintf_comment("%u %u/65536 cores", \
+ (where_).field_ >> 16, \
+ (where_).field_ & 0xFFFF); \
+ else \
+ tprints_comment("unlimited"); \
+ } while (0)
+
+
+# define IS_BLANK(arr_) /* 0x40 is space in EBCDIC */ \
+ is_filled(arr_, '\x40', sizeof(arr_) + MUST_BE_ARRAY(arr_))
+
+# define CHECK_SIZE_EX(hdr_, min_size_, size_, name_, ...) \
+ do { \
+ if ((size_) < (min_size_)) { \
+ tprintf_comment("Invalid " name_ " with size " \
+ "%hu < %zu expected", \
+ ##__VA_ARGS__, \
+ (size_), (min_size_)); \
+ print_quoted_string((char *) (hdr_), (size_), \
+ QUOTE_FORCE_HEX); \
+ \
+ return; \
+ } \
+ } while (0)
+
+# define CHECK_SIZE(hdr_, size_, name_, ...) \
+ CHECK_SIZE_EX((hdr_), sizeof(*(hdr_)), (size_), name_, ##__VA_ARGS__)
+
+# define PRINT_UNKNOWN_TAIL_EX(hdr_, hdr_size_, size_) \
+ do { \
+ if ((size_) > (hdr_size_) && \
+ !is_filled(((char *) hdr_) + (hdr_size_), '\0', \
+ (size_) - (hdr_size_))) { \
+ tprints(", "); \
+ print_quoted_string(((char *) hdr_) + (hdr_size_), \
+ (size_) - (hdr_size_), \
+ QUOTE_FORCE_HEX); \
+ } \
+ } while (0)
+
+# define PRINT_UNKNOWN_TAIL(hdr_, size_) \
+ PRINT_UNKNOWN_TAIL_EX((hdr_), sizeof(*(hdr_)), (size_))
+
+static void
+print_sthyi_machine(struct tcb *tcp, struct sthyi_machine *hdr, uint16_t size,
+ bool *dummy)
+{
+ size_t last_decoded = offsetofend(typeof(*hdr), infmpman);
+ int cnt_val, name_val, id_val;
+
+ CHECK_SIZE_EX(hdr, last_decoded, size, "machine structure");
+
+ tprints("/* machine */ ");
+ tprint_struct_begin();
+ if (!abbrev(tcp)) {
+ if (hdr->infmflg1) { /* Reserved */
+ PRINT_FIELD_0X(*hdr, infmflg1);
+ tprints(", ");
+ }
+ if (hdr->infmflg2) { /* Reserved */
+ tprint_struct_next();
+ PRINT_FIELD_0X(*hdr, infmflg2);
+ tprints(", ");
+ }
+ }
+
+ PRINT_FIELD_0X(*hdr, infmval1);
+ cnt_val = !!(hdr->infmval1 & 0x80);
+ id_val = !!(hdr->infmval1 & 0x40);
+ name_val = !!(hdr->infmval1 & 0x20);
+
+ if (!abbrev(tcp)) {
+ if (hdr->infmval1)
+ tprintf_comment("processor count validity: %d, "
+ "machine ID validity: %d, "
+ "machine name validity: %d%s%#.0x%s",
+ cnt_val, id_val, name_val,
+ hdr->infmval1 & 0x1F ? ", " : "",
+ hdr->infmval1 & 0x1F,
+ hdr->infmval1 & 0x1F ? " - ???" : "");
+ if (hdr->infmval2) {
+ tprint_struct_next();
+ PRINT_FIELD_0X(*hdr, infmval2);
+ }
+ }
+
+ if (cnt_val || hdr->infmscps) {
+ tprint_struct_next();
+ PRINT_FIELD_U(*hdr, infmscps);
+ }
+ if (cnt_val || hdr->infmdcps) {
+ tprint_struct_next();
+ PRINT_FIELD_U(*hdr, infmdcps);
+ }
+ if (cnt_val || hdr->infmsifl) {
+ tprint_struct_next();
+ PRINT_FIELD_U(*hdr, infmsifl);
+ }
+ if (cnt_val || hdr->infmdifl) {
+ tprint_struct_next();
+ PRINT_FIELD_U(*hdr, infmdifl);
+ }
+
+ if (!abbrev(tcp)) {
+ if (name_val || hdr->infmname) {
+ tprint_struct_next();
+ PRINT_FIELD_EBCDIC(*hdr, infmname);
+ }
+
+ if (id_val || !IS_ARRAY_ZERO(hdr->infmtype)) {
+ tprint_struct_next();
+ PRINT_FIELD_EBCDIC(*hdr, infmtype);
+ }
+ if (id_val || !IS_ARRAY_ZERO(hdr->infmmanu)) {
+ tprint_struct_next();
+ PRINT_FIELD_EBCDIC(*hdr, infmmanu);
+ }
+ if (id_val || !IS_ARRAY_ZERO(hdr->infmseq)) {
+ tprint_struct_next();
+ PRINT_FIELD_EBCDIC(*hdr, infmseq);
+ }
+ if (id_val || !IS_ARRAY_ZERO(hdr->infmpman)) {
+ tprint_struct_next();
+ PRINT_FIELD_EBCDIC(*hdr, infmpman);
+ }
+
+ if (size >= offsetofend(struct sthyi_machine, infmplnm)) {
+ last_decoded = offsetofend(struct sthyi_machine,
+ infmplnm);
+
+ if (!IS_ARRAY_ZERO(hdr->reserved_1__)) {
+ tprint_struct_next();
+ PRINT_FIELD_HEX_ARRAY(*hdr, reserved_1__);
+ }
+
+ if (!IS_ARRAY_ZERO(hdr->infmplnm)) {
+ tprint_struct_next();
+ PRINT_FIELD_EBCDIC(*hdr, infmplnm);
+ }
+ }
+
+ PRINT_UNKNOWN_TAIL_EX(hdr, last_decoded, size);
+ } else {
+ tprint_struct_next();
+ tprint_more_data_follows();
+ }
+
+ tprint_struct_end();
+}
+
+static void
+print_sthyi_partition(struct tcb *tcp, struct sthyi_partition *hdr,
+ uint16_t size, bool *mt)
+{
+ size_t last_decoded = offsetofend(typeof(*hdr), infpabif);
+ int cnt_val, wcap_val, acap_val, id_val, lpar_val;
+
+ *mt = false;
+
+ CHECK_SIZE_EX(hdr, last_decoded, size, "partition structure");
+
+ *mt = !!(hdr->infpflg1 & 0x80);
+
+ tprints("/* partition */ ");
+ tprint_struct_begin();
+ PRINT_FIELD_0X(*hdr, infpflg1);
+ if (!abbrev(tcp) && hdr->infpflg1)
+ tprintf_comment("%s%s%#.0x%s",
+ hdr->infpflg1 & 0x80 ?
+ "0x80 - multithreading is enabled" : "",
+ (hdr->infpflg1 & 0x80) && (hdr->infpflg1 & 0x7F) ?
+ ", " : "",
+ hdr->infpflg1 & 0x7F,
+ hdr->infpflg1 & 0x7F ? " - ???" : "");
+ if (!abbrev(tcp) && hdr->infpflg2) { /* Reserved */
+ tprint_struct_next();
+ PRINT_FIELD_0X(*hdr, infpflg2);
+ }
+
+ tprint_struct_next();
+ PRINT_FIELD_0X(*hdr, infpval1);
+ cnt_val = !!(hdr->infpval1 & 0x80);
+ wcap_val = !!(hdr->infpval1 & 0x40);
+ acap_val = !!(hdr->infpval1 & 0x20);
+ id_val = !!(hdr->infpval1 & 0x10);
+ lpar_val = !!(hdr->infpval1 & 0x08);
+
+ if (!abbrev(tcp) && hdr->infpval1)
+ tprintf_comment("processor count validity: %d, "
+ "partition weight-based capacity validity: %d, "
+ "partition absolute capacity validity: %d, "
+ "partition ID validity: %d, "
+ "LPAR group absolute capacity capping "
+ "information validity: %d%s%#.0x%s",
+ cnt_val, wcap_val, acap_val, id_val, lpar_val,
+ hdr->infpval1 & 0x07 ? ", " : "",
+ hdr->infpval1 & 0x07,
+ hdr->infpval1 & 0x07 ? " - ???" : "");
+ if (!abbrev(tcp) && hdr->infpval2) { /* Reserved */
+ tprint_struct_next();
+ PRINT_FIELD_0X(*hdr, infpval2);
+ }
+
+ if (id_val || hdr->infppnum) {
+ tprint_struct_next();
+ PRINT_FIELD_U(*hdr, infppnum);
+ }
+
+ if (cnt_val || hdr->infpscps) {
+ tprint_struct_next();
+ PRINT_FIELD_U(*hdr, infpscps);
+ }
+ if (cnt_val || hdr->infpdcps) {
+ tprint_struct_next();
+ PRINT_FIELD_U(*hdr, infpdcps);
+ }
+ if (cnt_val || hdr->infpsifl) {
+ tprint_struct_next();
+ PRINT_FIELD_U(*hdr, infpsifl);
+ }
+ if (cnt_val || hdr->infpdifl) {
+ tprint_struct_next();
+ PRINT_FIELD_U(*hdr, infpdifl);
+ }
+
+ if (!abbrev(tcp) && !IS_ARRAY_ZERO(hdr->reserved_1__)) {
+ tprint_struct_next();
+ PRINT_FIELD_HEX_ARRAY(*hdr, reserved_1__);
+ }
+
+ if (id_val || !IS_ARRAY_ZERO(hdr->infppnam)) {
+ tprint_struct_next();
+ PRINT_FIELD_EBCDIC(*hdr, infppnam);
+ }
+
+ if (!abbrev(tcp)) {
+ if (wcap_val || hdr->infpwbcp) {
+ tprint_struct_next();
+ PRINT_FIELD_WEIGHT(*hdr, infpwbcp);
+ }
+ if (acap_val || hdr->infpabcp) {
+ tprint_struct_next();
+ PRINT_FIELD_WEIGHT(*hdr, infpabcp);
+ }
+ if (wcap_val || hdr->infpwbif) {
+ tprint_struct_next();
+ PRINT_FIELD_WEIGHT(*hdr, infpwbif);
+ }
+ if (acap_val || hdr->infpabif) {
+ tprint_struct_next();
+ PRINT_FIELD_WEIGHT(*hdr, infpabif);
+ }
+
+ if (size >= offsetofend(struct sthyi_partition, infplgif)) {
+ if (!IS_ARRAY_ZERO(hdr->infplgnm)) {
+ tprint_struct_next();
+ PRINT_FIELD_EBCDIC(*hdr, infplgnm);
+
+ tprint_struct_next();
+ PRINT_FIELD_WEIGHT(*hdr, infplgcp);
+ tprint_struct_next();
+ PRINT_FIELD_WEIGHT(*hdr, infplgif);
+ } else {
+ if (lpar_val) {
+ tprint_struct_next();
+ PRINT_FIELD_HEX_ARRAY(*hdr, infplgnm);
+ }
+ if (hdr->infplgcp) {
+ tprint_struct_next();
+ PRINT_FIELD_X(*hdr, infplgcp);
+ }
+ if (hdr->infplgif) {
+ tprint_struct_next();
+ PRINT_FIELD_X(*hdr, infplgif);
+ }
+ }
+ }
+
+ if (size >= offsetofend(struct sthyi_partition, infpplnm)) {
+ last_decoded = offsetofend(struct sthyi_partition,
+ infpplnm);
+
+ if (!IS_ARRAY_ZERO(hdr->infpplnm)) {
+ tprint_struct_next();
+ PRINT_FIELD_EBCDIC(*hdr, infpplnm);
+ }
+ }
+
+ PRINT_UNKNOWN_TAIL_EX(hdr, last_decoded, size);
+ } else {
+ tprint_struct_next();
+ tprint_more_data_follows();
+ }
+
+ tprint_struct_end();
+}
+
+static void
+print_funcs(const uint8_t funcs[8])
+{
+ static const char *func_descs[] = {
+ [0] = "Obtain CPU Capacity Info",
+ [1] = "Hypervisor Environment Info",
+ [2] = "Guest List",
+ [3] = "Designated Guest Info",
+ [4] = "Resource Pool List",
+ [5] = "Designated Resource Pool Information",
+ [6] = "Resource Pool Member List",
+ };
+
+ static_assert(ARRAY_SIZE(func_descs) <= 64,
+ "func_descs is too big");
+
+ if (is_filled((const char *) funcs, 0, 8))
+ return;
+
+ bool cont = false;
+
+ for (size_t i = 0; i < ARRAY_SIZE(func_descs); i++) {
+ if (!func_descs[i])
+ continue;
+
+ size_t b = i >> 3;
+ size_t f = 1 << (7 - (i & 7));
+
+ if (!(funcs[b] & f))
+ continue;
+
+ tprintf("%s%zu: %s", cont ? ", " : " /* ", i, func_descs[i]);
+ cont = true;
+ }
+
+ if (cont)
+ tprints(" */");
+}
+
+static void
+print_sthyi_hypervisor(struct tcb *tcp, struct sthyi_hypervisor *hdr,
+ uint16_t size, int num, bool mt)
+{
+ size_t last_decoded = offsetofend(typeof(*hdr), infydifl);
+
+ CHECK_SIZE_EX(hdr, last_decoded, size, "hypervisor %d structure", num);
+
+ tprintf("/* hypervisor %d */ ", num);
+ tprint_struct_begin();
+ PRINT_FIELD_0X(*hdr, infyflg1);
+ if (!abbrev(tcp) && hdr->infyflg1)
+ tprintf_comment("%s%s%s%s%s%s%#.0x%s",
+ hdr->infyflg1 & 0x80 ?
+ "0x80 - guest CPU usage had limiting is using "
+ "the consumption method" : "",
+ (hdr->infyflg1 & 0x80) && (hdr->infyflg1 & 0x40) ?
+ ", " : "",
+ hdr->infyflg1 & 0x40 ?
+ "0x40 - LIMITHARD caps use prorated core time "
+ "for capping" : "",
+ (hdr->infyflg1 & 0xC0) && (hdr->infyflg1 & 0x20) ?
+ ", " : "",
+ hdr->infyflg1 & 0x20 ?
+ "0x20 - hypervisor is MT-enabled" :"",
+ (hdr->infyflg1 & 0xE0) && (hdr->infyflg1 & 0x1F) ?
+ ", " : "",
+ hdr->infyflg1 & 0x1F,
+ hdr->infyflg1 & 0x1F ? " - ???" : "");
+
+ if (!abbrev(tcp)) {
+ if (hdr->infyflg2) { /* Reserved */
+ tprint_struct_next();
+ PRINT_FIELD_0X(*hdr, infyflg2);
+ }
+ if (hdr->infyval1) { /* Reserved */
+ tprint_struct_next();
+ PRINT_FIELD_0X(*hdr, infyval1);
+ }
+ if (hdr->infyval2) { /* Reserved */
+ tprint_struct_next();
+ PRINT_FIELD_0X(*hdr, infyval2);
+ }
+
+ tprint_struct_next();
+ PRINT_FIELD_U(*hdr, infytype);
+ switch (hdr->infytype) {
+ case 1:
+ tprints_comment("z/VM is the hypervisor");
+ break;
+ default:
+ tprints_comment("unknown hypervisor type");
+ }
+
+ if (!IS_ARRAY_ZERO(hdr->reserved_1__)) {
+ tprint_struct_next();
+ PRINT_FIELD_HEX_ARRAY(*hdr, reserved_1__);
+ }
+
+ if (mt || hdr->infycpt) {
+ tprint_struct_next();
+ PRINT_FIELD_U(*hdr, infycpt);
+ }
+ if (mt || hdr->infyiflt) {
+ tprint_struct_next();
+ PRINT_FIELD_U(*hdr, infyiflt);
+ }
+ }
+
+ if (!abbrev(tcp) || !IS_BLANK(hdr->infysyid)) {
+ tprint_struct_next();
+ PRINT_FIELD_EBCDIC(*hdr, infysyid);
+ }
+ if (!abbrev(tcp) || !IS_BLANK(hdr->infyclnm)) {
+ tprint_struct_next();
+ PRINT_FIELD_EBCDIC(*hdr, infyclnm);
+ }
+
+ if (!abbrev(tcp) || hdr->infyscps) {
+ tprint_struct_next();
+ PRINT_FIELD_U(*hdr, infyscps);
+ }
+ if (!abbrev(tcp) || hdr->infydcps) {
+ tprint_struct_next();
+ PRINT_FIELD_U(*hdr, infydcps);
+ }
+ if (!abbrev(tcp) || hdr->infysifl) {
+ tprint_struct_next();
+ PRINT_FIELD_U(*hdr, infysifl);
+ }
+ if (!abbrev(tcp) || hdr->infydifl) {
+ tprint_struct_next();
+ PRINT_FIELD_U(*hdr, infydifl);
+ }
+
+ if (!abbrev(tcp)) {
+ if (size >= offsetofend(struct sthyi_hypervisor, infyautf)) {
+ last_decoded = offsetofend(struct sthyi_hypervisor,
+ infyautf);
+
+ tprint_struct_next();
+ PRINT_FIELD_HEX_ARRAY(*hdr, infyinsf);
+ print_funcs(hdr->infyinsf);
+
+ tprint_struct_next();
+ PRINT_FIELD_HEX_ARRAY(*hdr, infyautf);
+ print_funcs(hdr->infyautf);
+ }
+
+ PRINT_UNKNOWN_TAIL_EX(hdr, last_decoded, size);
+ } else {
+ tprint_struct_next();
+ tprint_more_data_follows();
+ }
+
+ tprint_struct_end();
+}
+
+static void
+print_sthyi_guest(struct tcb *tcp, struct sthyi_guest *hdr, uint16_t size,
+ int num, bool mt)
+{
+ CHECK_SIZE(hdr, size, "guest %d structure", num);
+
+ tprintf("/* guest %d */ ", num);
+ tprint_struct_begin();
+ PRINT_FIELD_0X(*hdr, infgflg1);
+ if (!abbrev(tcp) && hdr->infgflg1)
+ tprintf_comment("%s%s%s%s%s%s%s%s%s%s%s%s%#.0x%s",
+ hdr->infgflg1 & 0x80 ?
+ "0x80 - guest is mobility enabled" : "",
+ (hdr->infgflg1 & 0x80) && (hdr->infgflg1 & 0x40) ?
+ ", " : "",
+ hdr->infgflg1 & 0x40 ?
+ "0x40 - guest has multiple virtual CPU types" :
+ "",
+ (hdr->infgflg1 & 0xC0) && (hdr->infgflg1 & 0x20) ?
+ ", " : "",
+ hdr->infgflg1 & 0x20 ?
+ "0x20 - guest CP dispatch type has LIMITHARD "
+ "cap" : "",
+ (hdr->infgflg1 & 0xE0) && (hdr->infgflg1 & 0x10) ?
+ ", " : "",
+ hdr->infgflg1 & 0x10 ?
+ "0x10 - guest IFL dispatch type has LIMITHARD "
+ "cap" : "",
+ (hdr->infgflg1 & 0xF0) && (hdr->infgflg1 & 0x08) ?
+ ", " : "",
+ hdr->infgflg1 & 0x08 ?
+ "0x08 - virtual CPs are thread dispatched" :
+ "",
+ (hdr->infgflg1 & 0xF8) && (hdr->infgflg1 & 0x04) ?
+ ", " : "",
+ hdr->infgflg1 & 0x04 ?
+ "0x04 - virtual IFLs are thread dispatched" :
+ "",
+ (hdr->infgflg1 & 0xFC) && (hdr->infgflg1 & 0x03) ?
+ ", " : "",
+ hdr->infgflg1 & 0x03,
+ hdr->infgflg1 & 0x03 ? " - ???" : "");
+ if (!abbrev(tcp)) {
+ if (hdr->infgflg2) { /* Reserved */
+ tprint_struct_next();
+ PRINT_FIELD_0X(*hdr, infgflg2);
+ }
+ if (hdr->infgval1) { /* Reserved */
+ tprint_struct_next();
+ PRINT_FIELD_0X(*hdr, infgval1);
+ }
+ if (hdr->infgval2) { /* Reserved */
+ tprint_struct_next();
+ PRINT_FIELD_0X(*hdr, infgval2);
+ }
+ }
+
+ tprint_struct_next();
+ PRINT_FIELD_EBCDIC(*hdr, infgusid);
+
+ if (!abbrev(tcp) || hdr->infgscps) {
+ tprint_struct_next();
+ PRINT_FIELD_U(*hdr, infgscps);
+ }
+ if (!abbrev(tcp) || hdr->infgdcps) {
+ tprint_struct_next();
+ PRINT_FIELD_U(*hdr, infgdcps);
+ }
+
+ if (!abbrev(tcp)) {
+ tprint_struct_next();
+ PRINT_FIELD_U(*hdr, infgcpdt);
+ switch (hdr->infgcpdt) {
+ case 0:
+ tprints_comment("General Purpose (CP)");
+ break;
+ default:
+ tprints_comment("unknown");
+ }
+
+ if (!IS_ARRAY_ZERO(hdr->reserved_1__)) {
+ tprint_struct_next();
+ PRINT_FIELD_HEX_ARRAY(*hdr, reserved_1__);
+ }
+ }
+
+ if (!abbrev(tcp) || hdr->infgcpcc) {
+ tprint_struct_next();
+ PRINT_FIELD_WEIGHT(*hdr, infgcpcc);
+ }
+
+ if (!abbrev(tcp) || hdr->infgsifl) {
+ tprint_struct_next();
+ PRINT_FIELD_U(*hdr, infgsifl);
+ }
+ if (!abbrev(tcp) || hdr->infgdifl) {
+ tprint_struct_next();
+ PRINT_FIELD_U(*hdr, infgdifl);
+ }
+
+ if (!abbrev(tcp)) {
+ tprint_struct_next();
+ PRINT_FIELD_U(*hdr, infgifdt);
+ switch (hdr->infgifdt) {
+ case 0:
+ tprints_comment("General Purpose (CP)");
+ break;
+ case 3:
+ tprints_comment("Integrated Facility for Linux (IFL)");
+ break;
+ default:
+ tprints_comment("unknown");
+ }
+
+ if (!IS_ARRAY_ZERO(hdr->reserved_2__)) {
+ tprint_struct_next();
+ PRINT_FIELD_HEX_ARRAY(*hdr, reserved_2__);
+ }
+ }
+
+ if (!abbrev(tcp) || hdr->infgifcc) {
+ tprint_struct_next();
+ PRINT_FIELD_WEIGHT(*hdr, infgifcc);
+ }
+
+ tprint_struct_next();
+ PRINT_FIELD_0X(*hdr, infgpflg);
+ if (!abbrev(tcp) && hdr->infgpflg)
+ tprintf_comment("%s%s%s%s%s%s%s%s%s%s%#.0x%s",
+ hdr->infgpflg & 0x80 ?
+ "0x80 - CPU pool's CP virtual type has "
+ "LIMITHARD cap" : "",
+ (hdr->infgpflg & 0x80) && (hdr->infgpflg & 0x40) ?
+ ", " : "",
+ hdr->infgpflg & 0x40 ?
+ "0x40 - CPU pool's CP virtual type has "
+ "CAPACITY cap" : "",
+ (hdr->infgpflg & 0xC0) && (hdr->infgpflg & 0x20) ?
+ ", " : "",
+ hdr->infgpflg & 0x20 ?
+ "0x20 - CPU pool's IFL virtual type has "
+ "LIMITHARD cap" : "",
+ (hdr->infgpflg & 0xE0) && (hdr->infgpflg & 0x10) ?
+ ", " : "",
+ hdr->infgpflg & 0x10 ?
+ "0x10 - CPU pool's IFL virtual type has "
+ "CAPACITY cap" : "",
+ (hdr->infgpflg & 0xF0) && (hdr->infgpflg & 0x08) ?
+ ", " : "",
+ hdr->infgpflg & 0x08 ?
+ "0x08 - CPU pool uses prorated core time" : "",
+ (hdr->infgpflg & 0xF8) && (hdr->infgpflg & 0x07) ?
+ ", " : "",
+ hdr->infgpflg & 0x07,
+ hdr->infgpflg & 0x07 ? " - ???" : "");
+
+ if (!abbrev(tcp)) {
+ if (!IS_ARRAY_ZERO(hdr->reserved_3__)) {
+ tprint_struct_next();
+ PRINT_FIELD_HEX_ARRAY(*hdr, reserved_3__);
+ }
+
+ if (!IS_BLANK(hdr->infgpnam)) {
+ tprint_struct_next();
+ PRINT_FIELD_EBCDIC(*hdr, infgpnam);
+ }
+
+ tprint_struct_next();
+ PRINT_FIELD_WEIGHT(*hdr, infgpccc);
+ tprint_struct_next();
+ PRINT_FIELD_WEIGHT(*hdr, infgpicc);
+
+ PRINT_UNKNOWN_TAIL(hdr, size);
+ } else {
+ tprint_struct_next();
+ tprint_more_data_follows();
+ }
+
+ tprint_struct_end();
+}
+
+# define STHYI_PRINT_STRUCT(l_, name_) \
+ do { \
+ if (hdr->inf ##l_## off && hdr->inf ##l_## off + \
+ hdr->inf ##l_## len <= sizeof(data)) { \
+ tprints(", "); \
+ print_sthyi_ ##name_(tcp, (struct sthyi_ ##name_ *) \
+ (data + hdr->inf ##l_## off), \
+ hdr->inf ##l_## len, &mt); \
+ } \
+ } while (0)
+
+# define STHYI_PRINT_HV_STRUCT(l_, n_, name_) \
+ do { \
+ if (hdr->inf ##l_## off ##n_ && hdr->inf ##l_## off ##n_ + \
+ hdr->inf ##l_## len ##n_ <= sizeof(data)) { \
+ tprints(", "); \
+ print_sthyi_ ##name_(tcp, (struct sthyi_ ##name_ *) \
+ (data + hdr->inf ##l_## off ##n_), \
+ hdr->inf ##l_## len ##n_, n_, mt); \
+ } \
+ } while (0)
+
+static void
+print_sthyi_buf(struct tcb *tcp, kernel_ulong_t ptr)
+{
+ char data[PAGE_SIZE];
+ struct sthyi_hdr *hdr = (struct sthyi_hdr *) data;
+ bool mt = false;
+
+ if (umove_or_printaddr(tcp, ptr, &data))
+ return;
+
+ tprint_struct_begin();
+
+ /* Header */
+ tprints("/* header */ ");
+ tprint_struct_begin();
+ PRINT_FIELD_0X(*hdr, infhflg1);
+
+ if (abbrev(tcp)) {
+ tprint_struct_next();
+ tprint_more_data_follows();
+ goto sthyi_sections;
+ }
+
+ if (hdr->infhflg1)
+ tprintf_comment("%s%s%s%s%s%s%s%s%#.0x%s",
+ hdr->infhflg1 & 0x80 ?
+ "0x80 - Global Performance Data unavailable" :
+ "",
+ (hdr->infhflg1 & 0x80) && (hdr->infhflg1 & 0x40) ?
+ ", " : "",
+ hdr->infhflg1 & 0x40 ?
+ "0x40 - One or more hypervisor levels below "
+ "this level does not support the STHYI "
+ "instruction" : "",
+ (hdr->infhflg1 & 0xC0) && (hdr->infhflg1 & 0x20) ?
+ ", " : "",
+ hdr->infhflg1 & 0x20 ?
+ "0x20 - Virtualization stack is incomplete" :
+ "",
+ (hdr->infhflg1 & 0xE0) && (hdr->infhflg1 & 0x10) ?
+ ", " : "",
+ hdr->infhflg1 & 0x10 ?
+ "0x10 - Execution environment is not within "
+ "a logical partition" : "",
+ (hdr->infhflg1 & 0xF0) && (hdr->infhflg1 & 0x0F) ?
+ ", " : "",
+ hdr->infhflg1 & 0x0F,
+ hdr->infhflg1 & 0x0F ? " - ???" : "");
+ if (hdr->infhflg2) { /* Reserved */
+ tprint_struct_next();
+ PRINT_FIELD_0X(*hdr, infhflg2);
+ }
+ if (hdr->infhval1) { /* Reserved */
+ tprint_struct_next();
+ PRINT_FIELD_0X(*hdr, infhval1);
+ }
+ if (hdr->infhval2) { /* Reserved */
+ tprint_struct_next();
+ PRINT_FIELD_0X(*hdr, infhval2);
+ }
+
+ if (!IS_ARRAY_ZERO(hdr->reserved_1__)) {
+ tprint_struct_next();
+ PRINT_FIELD_HEX_ARRAY(*hdr, reserved_1__);
+ }
+
+ tprint_struct_next();
+ PRINT_FIELD_U(*hdr, infhygct);
+ tprint_struct_next();
+ PRINT_FIELD_U(*hdr, infhtotl);
+
+ tprint_struct_next();
+ PRINT_FIELD_U(*hdr, infhdln);
+ tprint_struct_next();
+ PRINT_FIELD_U(*hdr, infmoff);
+ tprint_struct_next();
+ PRINT_FIELD_U(*hdr, infmlen);
+ tprint_struct_next();
+ PRINT_FIELD_U(*hdr, infpoff);
+ tprint_struct_next();
+ PRINT_FIELD_U(*hdr, infplen);
+
+ tprint_struct_next();
+ PRINT_FIELD_U(*hdr, infhoff1);
+ tprint_struct_next();
+ PRINT_FIELD_U(*hdr, infhlen1);
+ tprint_struct_next();
+ PRINT_FIELD_U(*hdr, infgoff1);
+ tprint_struct_next();
+ PRINT_FIELD_U(*hdr, infglen1);
+ tprint_struct_next();
+ PRINT_FIELD_U(*hdr, infhoff2);
+ tprint_struct_next();
+ PRINT_FIELD_U(*hdr, infhlen2);
+ tprint_struct_next();
+ PRINT_FIELD_U(*hdr, infgoff2);
+ tprint_struct_next();
+ PRINT_FIELD_U(*hdr, infglen2);
+ tprint_struct_next();
+ PRINT_FIELD_U(*hdr, infhoff3);
+ tprint_struct_next();
+ PRINT_FIELD_U(*hdr, infhlen3);
+ tprint_struct_next();
+ PRINT_FIELD_U(*hdr, infgoff3);
+ tprint_struct_next();
+ PRINT_FIELD_U(*hdr, infglen3);
+
+ PRINT_UNKNOWN_TAIL(hdr, hdr->infhdln);
+
+sthyi_sections:
+ tprint_struct_end();
+
+ STHYI_PRINT_STRUCT(m, machine);
+ STHYI_PRINT_STRUCT(p, partition);
+
+ STHYI_PRINT_HV_STRUCT(h, 1, hypervisor);
+ STHYI_PRINT_HV_STRUCT(g, 1, guest);
+ STHYI_PRINT_HV_STRUCT(h, 2, hypervisor);
+ STHYI_PRINT_HV_STRUCT(g, 2, guest);
+ STHYI_PRINT_HV_STRUCT(h, 3, hypervisor);
+ STHYI_PRINT_HV_STRUCT(g, 3, guest);
+
+ tprint_struct_end();
+}
+
+/**
+ * Wrapper for the s390 STHYI instruction that provides hypervisor information.
+ *
+ * See
+ * https://www.ibm.com/support/knowledgecenter/SSB27U_6.4.0/com.ibm.zvm.v640.hcpb4/hcpb4sth.htm
+ * https://web.archive.org/web/20170306000915/https://www.ibm.com/support/knowledgecenter/SSB27U_6.3.0/com.ibm.zvm.v630.hcpb4/hcpb4sth.htm
+ * for the instruction documentation.
+ *
+ * The difference in the kernel wrapper is that it doesn't require the 4K
+ * alignment for the resp_buffer page (as it just copies from the internal
+ * cache).
+ */
+SYS_FUNC(s390_sthyi)
+{
+ /* in, function ID from s390_sthyi_function_codes */
+ kernel_ulong_t function_code = tcp->u_arg[0];
+ /* out, pointer to page-sized buffer */
+ kernel_ulong_t resp_buffer_ptr = tcp->u_arg[1];
+ /* out, pointer to u64 containing function result */
+ kernel_ulong_t return_code_ptr = tcp->u_arg[2];
+ /* in, should be 0, at the moment */
+ kernel_ulong_t flags = tcp->u_arg[3];
+
+ if (entering(tcp)) {
+ printxval64(s390_sthyi_function_codes, function_code,
+ "STHYI_FC_???");
+ tprints(", ");
+ } else {
+ switch (function_code) {
+ case STHYI_FC_CP_IFL_CAP:
+ print_sthyi_buf(tcp, resp_buffer_ptr);
+ break;
+
+ default:
+ printaddr(resp_buffer_ptr);
+ }
+
+ tprints(", ");
+ printnum_int64(tcp, return_code_ptr, "%" PRIu64);
+ tprintf(", %#" PRI_klx, flags);
+ }
+
+ return 0;
+}
+
+
+/*
+ * Structures are written based on
+ * https://www-304.ibm.com/support/docview.wss?uid=isg29c69415c1e82603c852576700058075a&aid=1#page=85
+ */
+
+struct guard_storage_control_block {
+ uint64_t reserved;
+ /**
+ * Guard Storage Designation
+ * - Bits 0..J, J == 64-GSC - Guard Storage Origin (GSO)
+ * - Bits 53..55 - Guard Load Shift (GLS)
+ * - Bits 58..63 - Guard Storage Characteristic (GSC), this is J from
+ * the first item, valud values are 25..56.
+ */
+ uint64_t gsd;
+ uint64_t gssm; /**< Guard Storage Section Mask */
+ uint64_t gs_epl_a; /**< Guard Storage Event Parameter List Address */
+};
+
+struct guard_storage_event_parameter_list {
+ uint8_t pad1;
+ /**
+ * Guard Storage Event Addressing Mode
+ * - 0x40 - Extended addressing mode (E)
+ * - 0x80 - Basic addressing mode (B)
+ */
+ uint8_t gs_eam;
+ /**
+ * Guard Storage Event Cause indication
+ * - 0x01 - CPU was in transaction execution mode (TX)
+ * - 0x02 - CPU was in constrained transaction execution mode (CX)
+ * - 0x80 - Instruction causing the event: 0 - LGG, 1 - LLGFGS
+ */
+ uint8_t gs_eci;
+ /**
+ * Guard Storage Event Access Information
+ * - 0x01 - DAT mode
+ * - Bits 1..2 - Address space indication
+ * - Bits 4..7 - AR number
+ */
+ uint8_t gs_eai;
+ uint32_t pad2;
+ uint64_t gs_eha; /**< Guard Storage Event Handler Address */
+ uint64_t gs_eia; /**< Guard Storage Event Instruction Address */
+ uint64_t gs_eoa; /**< Guard Storage Event Operation Address */
+ uint64_t gs_eir; /**< Guard Storage Event Intermediate Result */
+ uint64_t gs_era; /**< Guard Storage Event Return Address */
+};
+
+static void
+guard_storage_print_gsepl(struct tcb *tcp, uint64_t addr)
+{
+ struct guard_storage_event_parameter_list gsepl;
+
+ /* Since it is 64-bit even on 31-bit s390... */
+ if (sizeof(addr) > current_klongsize &&
+ addr >= (1ULL << (current_klongsize * 8))) {
+ tprintf("%#" PRIx64, addr);
+
+ return;
+ }
+
+ if (umove_or_printaddr(tcp, addr, &gsepl))
+ return;
+
+ tprints("[");
+ tprint_struct_begin();
+
+ if (!abbrev(tcp)) {
+ if (gsepl.pad1) {
+ PRINT_FIELD_0X(gsepl, pad1);
+ tprints(", ");
+ }
+
+ PRINT_FIELD_0X(gsepl, gs_eam);
+ tprintf_comment("extended addressing mode: %u, "
+ "basic addressing mode: %u",
+ !!(gsepl.gs_eam & 0x2), !!(gsepl.gs_eam & 0x1));
+
+ tprint_struct_next();
+ PRINT_FIELD_0X(gsepl, gs_eci);
+ tprintf_comment("CPU in TX: %u, CPU in CX: %u, instruction: %s",
+ !!(gsepl.gs_eci & 0x80),
+ !!(gsepl.gs_eci & 0x40),
+ gsepl.gs_eci & 0x01 ? "LLGFGS" : "LGG");
+
+ tprint_struct_next();
+ PRINT_FIELD_0X(gsepl, gs_eai);
+ tprintf_comment("DAT: %u, address space indication: %u, "
+ "AR number: %u",
+ !!(gsepl.gs_eai & 0x40),
+ (gsepl.gs_eai >> 4) & 0x3,
+ gsepl.gs_eai & 0xF);
+
+ if (gsepl.pad2) {
+ tprint_struct_next();
+ PRINT_FIELD_0X(gsepl, pad2);
+ }
+
+ tprints(", ");
+ }
+
+ PRINT_FIELD_X(gsepl, gs_eha);
+
+ if (!abbrev(tcp)) {
+ tprint_struct_next();
+ PRINT_FIELD_X(gsepl, gs_eia);
+ tprint_struct_next();
+ PRINT_FIELD_X(gsepl, gs_eoa);
+ tprint_struct_next();
+ PRINT_FIELD_X(gsepl, gs_eir);
+ tprint_struct_next();
+ PRINT_FIELD_X(gsepl, gs_era);
+ } else {
+ tprint_struct_next();
+ tprint_more_data_follows();
+ }
+
+ tprint_struct_end();
+ tprints("]");
+}
+
+# define DIV_ROUND_UP(x,y) (((x) + ((y) - 1)) / (y))
+
+static void
+guard_storage_print_gscb(struct tcb *tcp, kernel_ulong_t addr)
+{
+ struct guard_storage_control_block gscb;
+
+ if (umove_or_printaddr(tcp, addr, &gscb))
+ return;
+
+ tprint_struct_begin();
+
+ if (gscb.reserved) {
+ PRINT_FIELD_0X(gscb, reserved);
+ tprints(", ");
+ }
+
+ PRINT_FIELD_0X(gscb, gsd);
+
+ if (!abbrev(tcp)) {
+ unsigned int gsc = gscb.gsd & 0x3F;
+ bool gsc_valid = gsc >= 25 && gsc <= 56;
+ tprintf_comment("GS origin: %#*.*" PRIx64 "%s, "
+ "guard load shift: %" PRIu64 ", "
+ "GS characteristic: %u",
+ gsc_valid ? 2 + DIV_ROUND_UP(64 - gsc, 4) : 0,
+ gsc_valid ? DIV_ROUND_UP(64 - gsc, 4) : 0,
+ gsc_valid ? gscb.gsd >> gsc : 0,
+ gsc_valid ? "" : "[invalid]",
+ (gscb.gsd >> 8) & 0x7, gsc);
+ }
+
+ tprint_struct_next();
+ PRINT_FIELD_0X(gscb, gssm);
+
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_TCB_VAL(gscb, gs_epl_a, tcp,
+ guard_storage_print_gsepl);
+
+ tprint_struct_end();
+}
+
+SYS_FUNC(s390_guarded_storage)
+{
+ int command = (int) tcp->u_arg[0];
+ kernel_ulong_t gs_cb = tcp->u_arg[1];
+
+ printxval(s390_guarded_storage_commands, command, "GS_???");
+
+ switch (command) {
+ case GS_ENABLE:
+ case GS_DISABLE:
+ case GS_CLEAR_BC_CB:
+ case GS_BROADCAST:
+ break;
+
+ case GS_SET_BC_CB:
+ tprints(", ");
+ guard_storage_print_gscb(tcp, gs_cb);
+ break;
+
+ default:
+ tprints(", ");
+ printaddr(gs_cb);
+ }
+
+ return RVAL_DECODED;
+}
+
+SYS_FUNC(s390_runtime_instr)
+{
+ int command = (int) tcp->u_arg[0];
+ int signum = (int) tcp->u_arg[1];
+
+
+ printxval_d(s390_runtime_instr_commands, command,
+ "S390_RUNTIME_INSTR_???");
+
+ /*
+ * signum is ignored since Linux 4.4, but let's print it for start
+ * command anyway.
+ */
+ switch (command) {
+ case S390_RUNTIME_INSTR_START:
+ tprints(", ");
+ printsignal(signum);
+ break;
+
+ case S390_RUNTIME_INSTR_STOP:
+ default:
+ break;
+ }
+
+ return RVAL_DECODED;
+}
+
+SYS_FUNC(s390_pci_mmio_write)
+{
+ kernel_ulong_t mmio_addr = tcp->u_arg[0];
+ kernel_ulong_t user_buf = tcp->u_arg[1];
+ kernel_ulong_t length = tcp->u_arg[2];
+
+ tprintf("%#" PRI_klx ", ", mmio_addr);
+ printstr_ex(tcp, user_buf, length, QUOTE_FORCE_HEX);
+ tprintf(", %" PRI_klu, length);
+
+ return RVAL_DECODED;
+}
+
+SYS_FUNC(s390_pci_mmio_read)
+{
+ kernel_ulong_t mmio_addr = tcp->u_arg[0];
+ kernel_ulong_t user_buf = tcp->u_arg[1];
+ kernel_ulong_t length = tcp->u_arg[2];
+
+ if (entering(tcp)) {
+ tprintf("%#" PRI_klx ", ", mmio_addr);
+ } else {
+ if (!syserror(tcp))
+ printstr_ex(tcp, user_buf, length, QUOTE_FORCE_HEX);
+ else
+ printaddr(user_buf);
+
+ tprintf(", %" PRI_klu, length);
+ }
+
+ return 0;
+}
+
+#endif /* defined S390 || defined S390X */
diff --git a/src/sched.c b/src/sched.c
new file mode 100644
index 000000000..4999f9507
--- /dev/null
+++ b/src/sched.c
@@ -0,0 +1,223 @@
+/*
+ * Copyright (c) 2004 Ulrich Drepper <drepper@redhat.com>
+ * Copyright (c) 2005 Roland McGrath <roland@redhat.com>
+ * Copyright (c) 2012-2015 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2014-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#include <sched.h>
+#include "sched_attr.h"
+
+#include "xlat/schedulers.h"
+#include "xlat/sched_flags.h"
+
+SYS_FUNC(sched_getscheduler)
+{
+ if (entering(tcp)) {
+ printpid(tcp, tcp->u_arg[0], PT_TGID);
+ } else if (!syserror(tcp)) {
+ tcp->auxstr = xlookup(schedulers, (kernel_ulong_t) tcp->u_rval);
+ return RVAL_STR;
+ }
+ return 0;
+}
+
+SYS_FUNC(sched_setscheduler)
+{
+ printpid(tcp, tcp->u_arg[0], PT_TGID);
+ tprints(", ");
+ printxval(schedulers, tcp->u_arg[1], "SCHED_???");
+ tprints(", ");
+ printnum_int(tcp, tcp->u_arg[2], "%d");
+
+ return RVAL_DECODED;
+}
+
+SYS_FUNC(sched_getparam)
+{
+ if (entering(tcp)) {
+ printpid(tcp, tcp->u_arg[0], PT_TGID);
+ tprints(", ");
+ } else {
+ printnum_int(tcp, tcp->u_arg[1], "%d");
+ }
+ return 0;
+}
+
+SYS_FUNC(sched_setparam)
+{
+ printpid(tcp, tcp->u_arg[0], PT_TGID);
+ tprints(", ");
+ printnum_int(tcp, tcp->u_arg[1], "%d");
+
+ return RVAL_DECODED;
+}
+
+SYS_FUNC(sched_get_priority_min)
+{
+ printxval(schedulers, tcp->u_arg[0], "SCHED_???");
+
+ return RVAL_DECODED;
+}
+
+static int
+do_sched_rr_get_interval(struct tcb *const tcp,
+ const print_obj_by_addr_fn print_ts)
+{
+ if (entering(tcp)) {
+ printpid(tcp, tcp->u_arg[0], PT_TGID);
+ tprints(", ");
+ } else {
+ if (syserror(tcp))
+ printaddr(tcp->u_arg[1]);
+ else
+ print_ts(tcp, tcp->u_arg[1]);
+ }
+ return 0;
+}
+
+#if HAVE_ARCH_TIME32_SYSCALLS
+SYS_FUNC(sched_rr_get_interval_time32)
+{
+ return do_sched_rr_get_interval(tcp, print_timespec32);
+}
+#endif
+
+SYS_FUNC(sched_rr_get_interval_time64)
+{
+ return do_sched_rr_get_interval(tcp, print_timespec64);
+}
+
+static void
+print_sched_attr(struct tcb *const tcp, const kernel_ulong_t addr,
+ unsigned int usize)
+{
+ struct sched_attr attr = {};
+ unsigned int size;
+ bool is_set = false;
+
+ if (usize) {
+ /* called from sched_getattr */
+ size = usize <= sizeof(attr) ? usize : (unsigned) sizeof(attr);
+ if (umoven_or_printaddr(tcp, addr, size, &attr))
+ return;
+ /* the number of bytes written by the kernel */
+ size = attr.size;
+ } else {
+ /* called from sched_setattr */
+ is_set = true;
+
+ if (umove_or_printaddr(tcp, addr, &attr.size))
+ return;
+ usize = attr.size;
+ if (!usize)
+ usize = SCHED_ATTR_MIN_SIZE;
+ size = usize <= sizeof(attr) ? usize : (unsigned) sizeof(attr);
+ if (size >= SCHED_ATTR_MIN_SIZE) {
+ if (umoven_or_printaddr(tcp, addr, size, &attr))
+ return;
+ }
+ }
+
+ tprint_struct_begin();
+ PRINT_FIELD_U(attr, size);
+
+ if (size < SCHED_ATTR_MIN_SIZE)
+ goto end;
+
+ if (!is_set || (int)attr.sched_policy < 0 || !(attr.sched_flags & (SCHED_FLAG_KEEP_POLICY | SCHED_FLAG_KEEP_PARAMS))) {
+ tprint_struct_next();
+ PRINT_FIELD_XVAL(attr, sched_policy, schedulers,
+ "SCHED_???");
+ }
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(attr, sched_flags, sched_flags, "SCHED_FLAG_???");
+
+
+ if (!is_set || !(attr.sched_flags & SCHED_FLAG_KEEP_PARAMS)) {
+ tprint_struct_next();
+ PRINT_FIELD_D(attr, sched_nice);
+ tprint_struct_next();
+ PRINT_FIELD_U(attr, sched_priority);
+ tprint_struct_next();
+ PRINT_FIELD_U(attr, sched_runtime);
+ tprint_struct_next();
+ PRINT_FIELD_U(attr, sched_deadline);
+ tprint_struct_next();
+ PRINT_FIELD_U(attr, sched_period);
+ }
+
+ if (size < SCHED_ATTR_SIZE_VER1)
+ goto end;
+
+ tprint_struct_next();
+ PRINT_FIELD_U(attr, sched_util_min);
+ tprint_struct_next();
+ PRINT_FIELD_U(attr, sched_util_max);
+
+end:
+ if ((is_set ? usize : attr.size) > size) {
+ tprint_struct_next();
+ tprint_more_data_follows();
+ }
+
+ tprint_struct_end();
+}
+
+SYS_FUNC(sched_setattr)
+{
+ if (entering(tcp)) {
+ printpid(tcp, tcp->u_arg[0], PT_TGID);
+ tprints(", ");
+ print_sched_attr(tcp, tcp->u_arg[1], 0);
+ } else {
+ struct sched_attr attr;
+
+ if (verbose(tcp) && tcp->u_error == E2BIG
+ && umove(tcp, tcp->u_arg[1], &attr.size) == 0) {
+ tprint_value_changed();
+ tprint_struct_begin();
+ PRINT_FIELD_U(attr, size);
+ tprint_struct_end();
+ }
+
+ tprintf(", %u", (unsigned int) tcp->u_arg[2]);
+ }
+
+ return 0;
+}
+
+SYS_FUNC(sched_getattr)
+{
+ if (entering(tcp)) {
+ printpid(tcp, tcp->u_arg[0], PT_TGID);
+ tprints(", ");
+ } else {
+ const unsigned int size = tcp->u_arg[2];
+
+ if (size)
+ print_sched_attr(tcp, tcp->u_arg[1], size);
+ else
+ printaddr(tcp->u_arg[1]);
+ tprints(", ");
+#ifdef AARCH64
+ /*
+ * Due to a subtle gcc bug that leads to miscompiled aarch64
+ * kernels, the 3rd argument of sched_getattr is not quite 32-bit
+ * as on other architectures. For more details see
+ * https://lists.strace.io/pipermail/strace-devel/2017-March/006085.html
+ */
+ if (syserror(tcp))
+ print_abnormal_hi(tcp->u_arg[2]);
+#endif
+ tprintf("%u", size);
+ tprintf(", %u", (unsigned int) tcp->u_arg[3]);
+ }
+
+ return 0;
+}
diff --git a/src/sched_attr.h b/src/sched_attr.h
new file mode 100644
index 000000000..35936745f
--- /dev/null
+++ b/src/sched_attr.h
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2017-2018 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2017-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_SCHED_ATTR_H
+# define STRACE_SCHED_ATTR_H
+
+# include <stdint.h>
+
+struct sched_attr {
+ uint32_t size;
+ uint32_t sched_policy;
+ uint64_t sched_flags;
+ uint32_t sched_nice;
+ uint32_t sched_priority;
+ uint64_t sched_runtime;
+ uint64_t sched_deadline;
+ uint64_t sched_period;
+ /* ver. 1 fields below */
+ uint32_t sched_util_min;
+ uint32_t sched_util_max;
+};
+
+# define SCHED_ATTR_MIN_SIZE 48
+# ifndef SCHED_ATTR_SIZE_VER1
+# define SCHED_ATTR_SIZE_VER1 56
+# endif
+
+#endif /* !STRACE_SCHED_ATTR_H */
diff --git a/src/scno.am b/src/scno.am
new file mode 100644
index 000000000..fd5069a12
--- /dev/null
+++ b/src/scno.am
@@ -0,0 +1,25 @@
+# scno.h make rules for strace.
+#
+# Copyright (c) 2017-2019 Dmitry V. Levin <ldv@strace.io>
+# All rights reserved.
+#
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+SCNO_CPPFLAGS = $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(ARCH_MFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS)
+
+syscallent.i: $(top_builddir)/src/config.h $(top_srcdir)/src/$(OS)/$(ARCH)/syscallent.h
+ $(CPP) -P $(SCNO_CPPFLAGS) -include $^ -o $@
+
+digits = [[:digit:]][[:digit:]]*
+al_nums = [[:alnum:]_][[:alnum:]_]*
+SCNO_SED = /TRACE_INDIRECT_SUBCALL/d; s/^\[[[:space:]]*\($(digits)\([[:space:]]*+[[:space:]]*$(digits)\)\?\)\][[:space:]]*=[[:space:]]*{[^,]*,[^,]*,[^,]*,[[:space:]]*"\($(al_nums)\)"[[:space:]]*},.*/\#ifndef __NR_\3\n\# define __NR_\3 (SYSCALL_BIT | (\1))\n\#endif/p
+
+scno.h: $(top_srcdir)/src/scno.head syscallent.i
+ echo '/* Generated by Makefile from $^; do not edit. */' > $@-t
+ cat $< >> $@-t
+ LC_ALL=C sed -n '$(SCNO_SED)' $(filter-out $<,$^) >> $@-t
+ mv $@-t $@
+
+BUILT_SOURCES += scno.h
+CLEANFILES += syscallent.i scno.h
diff --git a/src/scno.head b/src/scno.head
new file mode 100644
index 000000000..8e2e6e38f
--- /dev/null
+++ b/src/scno.head
@@ -0,0 +1,15 @@
+/*
+ * Copyright (c) 2017-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include <asm/unistd.h>
+
+#if defined __X32_SYSCALL_BIT && defined __NR_read \
+ && (__X32_SYSCALL_BIT & __NR_read) == __X32_SYSCALL_BIT
+# define SYSCALL_BIT __X32_SYSCALL_BIT
+#else
+# define SYSCALL_BIT 0
+#endif
diff --git a/src/scsi.c b/src/scsi.c
new file mode 100644
index 000000000..b3c034e1a
--- /dev/null
+++ b/src/scsi.c
@@ -0,0 +1,167 @@
+/*
+ * Copyright (c) 2007 Vladimir Nadvornik <nadvornik@suse.cz>
+ * Copyright (c) 2007-2018 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2007-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#ifdef HAVE_SCSI_SG_H
+# include <scsi/sg.h>
+#endif
+
+#define XLAT_MACROS_ONLY
+# include "xlat/scsi_sg_commands.h"
+#undef XLAT_MACROS_ONLY
+#include "xlat/sg_scsi_reset.h"
+
+static int
+decode_sg_io(struct tcb *const tcp, const uint32_t iid,
+ const kernel_ulong_t arg)
+{
+ switch (iid) {
+ case 'S':
+ return decode_sg_io_v3(tcp, arg);
+ case 'Q':
+ return decode_sg_io_v4(tcp, arg);
+ default:
+ tprintf("[%u]", iid);
+ return RVAL_IOCTL_DECODED;
+ }
+
+}
+
+#ifdef HAVE_SCSI_SG_H
+
+static int
+decode_sg_scsi_id(struct tcb *const tcp, const kernel_ulong_t arg)
+{
+ struct sg_scsi_id id;
+
+ if (entering(tcp))
+ return 0;
+
+ tprints(", ");
+ if (!umove_or_printaddr(tcp, arg, &id)) {
+ tprint_struct_begin();
+ PRINT_FIELD_D(id, host_no);
+ tprint_struct_next();
+ PRINT_FIELD_D(id, channel);
+ tprint_struct_next();
+ PRINT_FIELD_X(id, scsi_id);
+ tprint_struct_next();
+ PRINT_FIELD_D(id, lun);
+ tprint_struct_next();
+ PRINT_FIELD_X(id, scsi_type);
+ tprint_struct_next();
+ PRINT_FIELD_D(id, h_cmd_per_lun);
+ tprint_struct_next();
+ PRINT_FIELD_D(id, d_queue_depth);
+ tprint_struct_end();
+ }
+ return RVAL_IOCTL_DECODED;
+}
+
+#endif /* HAVE_SCSI_SG_H */
+
+int
+scsi_ioctl(struct tcb *const tcp, const unsigned int code,
+ const kernel_ulong_t arg)
+{
+ switch (code) {
+ case SG_IO:
+ if (entering(tcp)) {
+ uint32_t iid;
+
+ tprints(", ");
+ if (umove_or_printaddr(tcp, arg, &iid)) {
+ break;
+ } else {
+ return decode_sg_io(tcp, iid, arg);
+ }
+ } else {
+ uint32_t *piid = get_tcb_priv_data(tcp);
+ if (piid)
+ decode_sg_io(tcp, *piid, arg);
+ tprint_struct_end();
+ break;
+ }
+
+#ifdef HAVE_SCSI_SG_H
+ /* returns struct sg_scsi_id */
+ case SG_GET_SCSI_ID:
+ return decode_sg_scsi_id(tcp, arg);
+ /* returns struct sg_req_info */
+ case SG_GET_REQUEST_TABLE:
+ return decode_sg_req_info(tcp, arg);
+#endif /* HAVE_SCSI_SG_H */
+
+ /* takes a value by pointer */
+ case SG_SCSI_RESET: {
+ unsigned int val;
+ tprints(", ");
+ if (!umove_or_printaddr(tcp, arg, &val)) {
+ tprints("[");
+ if (val & SG_SCSI_RESET_NO_ESCALATE) {
+ printxval(sg_scsi_reset,
+ SG_SCSI_RESET_NO_ESCALATE, 0);
+ tprints("|");
+ }
+ printxval(sg_scsi_reset,
+ val & ~SG_SCSI_RESET_NO_ESCALATE,
+ "SG_SCSI_RESET_???");
+ tprints("]");
+
+ }
+ break;
+ }
+
+ /* takes a signed int by pointer */
+ case SG_NEXT_CMD_LEN:
+ case SG_SET_COMMAND_Q:
+ case SG_SET_DEBUG:
+ case SG_SET_FORCE_LOW_DMA:
+ case SG_SET_FORCE_PACK_ID:
+ case SG_SET_KEEP_ORPHAN:
+ case SG_SET_RESERVED_SIZE:
+ case SG_SET_TIMEOUT:
+ tprints(", ");
+ printnum_int(tcp, arg, "%d");
+ break;
+
+ /* returns a signed int by pointer */
+ case SG_EMULATED_HOST:
+ case SG_GET_ACCESS_COUNT:
+ case SG_GET_COMMAND_Q:
+ case SG_GET_KEEP_ORPHAN:
+ case SG_GET_LOW_DMA:
+ case SG_GET_NUM_WAITING:
+ case SG_GET_PACK_ID:
+ case SG_GET_RESERVED_SIZE:
+ case SG_GET_SG_TABLESIZE:
+ case SG_GET_TRANSFORM:
+ case SG_GET_VERSION_NUM:
+ if (entering(tcp))
+ return 0;
+ tprints(", ");
+ printnum_int(tcp, arg, "%d");
+ break;
+
+ /* takes an integer by value */
+ case SG_SET_TRANSFORM:
+ tprintf(", %#x", (unsigned int) arg);
+ break;
+
+ /* no arguments */
+ case SG_GET_TIMEOUT:
+ break;
+
+ default:
+ return RVAL_DECODED;
+ }
+
+ return RVAL_IOCTL_DECODED;
+}
diff --git a/src/seccomp.c b/src/seccomp.c
new file mode 100644
index 000000000..761e9acf4
--- /dev/null
+++ b/src/seccomp.c
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2015-2018 Dmitry V. Levin <ldv@strace.io>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#ifdef HAVE_LINUX_SECCOMP_H
+# include <linux/seccomp.h>
+#endif
+#include "xlat/seccomp_ops.h"
+#include "xlat/seccomp_filter_flags.h"
+
+SYS_FUNC(seccomp)
+{
+ unsigned int op = tcp->u_arg[0];
+ unsigned int flags = tcp->u_arg[1];
+ unsigned int act;
+
+ printxval(seccomp_ops, op, "SECCOMP_SET_MODE_???");
+ tprints(", ");
+
+ switch (op) {
+ case SECCOMP_GET_ACTION_AVAIL:
+ tprintf("%u, ", flags);
+ if (!umove_or_printaddr(tcp, tcp->u_arg[2], &act)) {
+ tprints("[");
+ printxval(seccomp_ret_action, act, "SECCOMP_RET_???");
+ tprints("]");
+ }
+ break;
+
+ case SECCOMP_SET_MODE_FILTER:
+ printflags(seccomp_filter_flags, flags,
+ "SECCOMP_FILTER_FLAG_???");
+ tprints(", ");
+ decode_seccomp_fprog(tcp, tcp->u_arg[2]);
+ break;
+
+ case SECCOMP_SET_MODE_STRICT:
+ default:
+ tprintf("%u, ", flags);
+ printaddr(tcp->u_arg[2]);
+ break;
+ }
+
+ return RVAL_DECODED;
+}
diff --git a/src/sendfile.c b/src/sendfile.c
new file mode 100644
index 000000000..f8ceda3e7
--- /dev/null
+++ b/src/sendfile.c
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2015 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+SYS_FUNC(sendfile64)
+{
+ if (entering(tcp)) {
+ printfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ printfd(tcp, tcp->u_arg[1]);
+ tprints(", ");
+ if (!printnum_int64(tcp, tcp->u_arg[2], "%" PRIu64)) {
+ tprintf(", %" PRI_klu, tcp->u_arg[3]);
+ return RVAL_DECODED;
+ }
+ } else {
+ if (!syserror(tcp) && tcp->u_rval) {
+ tprint_value_changed();
+ printnum_int64(tcp, tcp->u_arg[2], "%" PRIu64);
+ }
+ tprintf(", %" PRI_klu, tcp->u_arg[3]);
+ }
+
+ return 0;
+}
+
+SYS_FUNC(sendfile)
+{
+ if (entering(tcp)) {
+ printfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ printfd(tcp, tcp->u_arg[1]);
+ tprints(", ");
+ if (!printnum_ulong(tcp, tcp->u_arg[2])
+ || !tcp->u_arg[3]) {
+ tprintf(", %" PRI_klu, tcp->u_arg[3]);
+ return RVAL_DECODED;
+ }
+ } else {
+ if (!syserror(tcp) && tcp->u_rval) {
+ tprint_value_changed();
+ printnum_ulong(tcp, tcp->u_arg[2]);
+ }
+ tprintf(", %" PRI_klu, tcp->u_arg[3]);
+ }
+
+ return 0;
+}
diff --git a/src/sg_io_v3.c b/src/sg_io_v3.c
new file mode 100644
index 000000000..cb48ad7e3
--- /dev/null
+++ b/src/sg_io_v3.c
@@ -0,0 +1,194 @@
+/*
+ * Copyright (c) 2007 Vladimir Nadvornik <nadvornik@suse.cz>
+ * Copyright (c) 2007-2018 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2015 Bart Van Assche <bart.vanassche@sandisk.com>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#ifdef HAVE_SCSI_SG_H
+
+# include DEF_MPERS_TYPE(struct_sg_io_hdr)
+
+# include <scsi/sg.h>
+
+typedef struct sg_io_hdr struct_sg_io_hdr;
+
+#endif /* HAVE_SCSI_SG_H */
+
+#include MPERS_DEFS
+
+#include "xlat/sg_io_info.h"
+
+#ifdef HAVE_SCSI_SG_H
+# include "xlat/sg_io_dxfer_direction.h"
+# include "xlat/sg_io_flags.h"
+
+static void
+print_sg_io_buffer(struct tcb *const tcp, const kernel_ulong_t addr,
+ const unsigned int data_size, const unsigned int iovec_count)
+{
+ if (iovec_count) {
+ tprint_iov_upto(tcp, iovec_count, addr, IOV_DECODE_STR,
+ data_size);
+ } else {
+ printstr_ex(tcp, addr, data_size, QUOTE_FORCE_HEX);
+ }
+}
+
+# define PRINT_FIELD_SG_IO_BUFFER(where_, field_, size_, count_, tcp_) \
+ do { \
+ tprints_field_name(#field_); \
+ print_sg_io_buffer((tcp_), (mpers_ptr_t)((where_).field_), \
+ (size_), (count_)); \
+ } while (0)
+
+static int
+decode_request(struct tcb *const tcp, const kernel_ulong_t arg)
+{
+ struct_sg_io_hdr sg_io;
+ static const size_t skip_iid =
+ offsetof(struct_sg_io_hdr, dxfer_direction);
+
+ tprint_struct_begin();
+ tprints_field_name("interface_id");
+ tprints("'S'");
+ tprint_struct_next();
+ if (umoven_or_printaddr(tcp, arg + skip_iid, sizeof(sg_io) - skip_iid,
+ &sg_io.dxfer_direction)) {
+ tprint_struct_end();
+ return RVAL_IOCTL_DECODED;
+ }
+
+ PRINT_FIELD_XVAL(sg_io, dxfer_direction, sg_io_dxfer_direction,
+ "SG_DXFER_???");
+ tprint_struct_next();
+ PRINT_FIELD_U(sg_io, cmd_len);
+ tprint_struct_next();
+ PRINT_FIELD_SG_IO_BUFFER(sg_io, cmdp, sg_io.cmd_len, 0, tcp);
+ tprint_struct_next();
+ PRINT_FIELD_U(sg_io, mx_sb_len);
+ tprint_struct_next();
+ PRINT_FIELD_U(sg_io, iovec_count);
+ tprint_struct_next();
+ PRINT_FIELD_U(sg_io, dxfer_len);
+ tprint_struct_next();
+ PRINT_FIELD_U(sg_io, timeout);
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(sg_io, flags, sg_io_flags, "SG_FLAG_???");
+
+ if (sg_io.dxfer_direction == SG_DXFER_TO_DEV ||
+ sg_io.dxfer_direction == SG_DXFER_TO_FROM_DEV) {
+ tprint_struct_next();
+ PRINT_FIELD_SG_IO_BUFFER(sg_io, dxferp, sg_io.dxfer_len, sg_io.iovec_count, tcp);
+ }
+
+ struct_sg_io_hdr *entering_sg_io = malloc(sizeof(*entering_sg_io));
+ if (entering_sg_io) {
+ memcpy(entering_sg_io, &sg_io, sizeof(sg_io));
+ entering_sg_io->interface_id = (unsigned char) 'S';
+ set_tcb_priv_data(tcp, entering_sg_io, free);
+ }
+
+ return 0;
+}
+
+static int
+decode_response(struct tcb *const tcp, const kernel_ulong_t arg)
+{
+ struct_sg_io_hdr *entering_sg_io = get_tcb_priv_data(tcp);
+ struct_sg_io_hdr sg_io;
+
+ if (umove(tcp, arg, &sg_io) < 0) {
+ /* print i/o fields fetched on entering syscall */
+ if (entering_sg_io->dxfer_direction == SG_DXFER_FROM_DEV) {
+ tprint_struct_next();
+ PRINT_FIELD_PTR(*entering_sg_io, dxferp);
+ }
+ tprint_struct_next();
+ PRINT_FIELD_PTR(*entering_sg_io, sbp);
+ return RVAL_IOCTL_DECODED;
+ }
+
+ if (sg_io.interface_id != entering_sg_io->interface_id) {
+ tprint_value_changed();
+ PRINT_FIELD_U(sg_io, interface_id);
+ return RVAL_IOCTL_DECODED;
+ }
+
+ if (sg_io.dxfer_direction == SG_DXFER_FROM_DEV ||
+ sg_io.dxfer_direction == SG_DXFER_TO_FROM_DEV) {
+ uint32_t din_len = sg_io.dxfer_len;
+ bool print_buffer = false;
+
+ if (sg_io.resid > 0 && (unsigned int) sg_io.resid <= din_len)
+ din_len -= sg_io.resid;
+
+ if (sg_io.dxfer_direction == SG_DXFER_FROM_DEV) {
+ tprint_struct_next();
+ print_buffer = true;
+ } else if (din_len) {
+ tprint_value_changed();
+ print_buffer = true;
+ }
+
+ if (print_buffer) {
+ PRINT_FIELD_SG_IO_BUFFER(sg_io, dxferp, din_len,
+ sg_io.iovec_count, tcp);
+ }
+ }
+ tprint_struct_next();
+ PRINT_FIELD_X(sg_io, status);
+ tprint_struct_next();
+ PRINT_FIELD_X(sg_io, masked_status);
+ tprint_struct_next();
+ PRINT_FIELD_X(sg_io, msg_status);
+ tprint_struct_next();
+ PRINT_FIELD_U(sg_io, sb_len_wr);
+ tprint_struct_next();
+ PRINT_FIELD_SG_IO_BUFFER(sg_io, sbp, sg_io.sb_len_wr, 0, tcp);
+ tprint_struct_next();
+ PRINT_FIELD_X(sg_io, host_status);
+ tprint_struct_next();
+ PRINT_FIELD_X(sg_io, driver_status);
+ tprint_struct_next();
+ PRINT_FIELD_D(sg_io, resid);
+ tprint_struct_next();
+ PRINT_FIELD_U(sg_io, duration);
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(sg_io, info, sg_io_info, "SG_INFO_???");
+
+ return RVAL_IOCTL_DECODED;
+}
+
+#else /* !HAVE_SCSI_SG_H */
+
+static int
+decode_request(struct tcb *const tcp, const kernel_ulong_t arg)
+{
+ tprint_struct_begin();
+ tprints_field_name("interface_id");
+ tprints("'S'");
+ tprint_struct_next();
+ tprint_more_data_follows();
+ tprint_struct_end();
+ return RVAL_IOCTL_DECODED;
+}
+
+static int
+decode_response(struct tcb *const tcp, const kernel_ulong_t arg)
+{
+ return 0;
+}
+
+#endif
+
+MPERS_PRINTER_DECL(int, decode_sg_io_v3,
+ struct tcb *const tcp, const kernel_ulong_t arg)
+{
+ return entering(tcp) ? decode_request(tcp, arg)
+ : decode_response(tcp, arg);
+}
diff --git a/src/sg_io_v4.c b/src/sg_io_v4.c
new file mode 100644
index 000000000..229acbb85
--- /dev/null
+++ b/src/sg_io_v4.c
@@ -0,0 +1,182 @@
+/*
+ * Copyright (c) 2015 Bart Van Assche <bart.vanassche@sandisk.com>
+ * Copyright (c) 2015-2018 Dmitry V. Levin <ldv@strace.io>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#ifdef HAVE_LINUX_BSG_H
+
+# include <linux/bsg.h>
+# include "xlat/bsg_protocol.h"
+# include "xlat/bsg_subprotocol.h"
+# include "xlat/bsg_flags.h"
+
+static void
+print_sg_io_buffer(struct tcb *const tcp, const kernel_ulong_t addr,
+ const unsigned int data_size, const unsigned int iovec_count)
+{
+ if (iovec_count) {
+ tprint_iov_upto(tcp, iovec_count, addr, IOV_DECODE_STR,
+ data_size);
+ } else {
+ printstr_ex(tcp, addr, data_size, QUOTE_FORCE_HEX);
+ }
+}
+
+# define PRINT_FIELD_SG_IO_BUFFER(where_, field_, size_, count_, tcp_) \
+ do { \
+ tprints_field_name(#field_); \
+ print_sg_io_buffer((tcp_), (where_).field_, (size_), (count_)); \
+ } while (0)
+
+static int
+decode_request(struct tcb *const tcp, const kernel_ulong_t arg)
+{
+ struct sg_io_v4 sg_io;
+ static const size_t skip_iid = offsetof(struct sg_io_v4, protocol);
+
+ tprint_struct_begin();
+ tprints_field_name("guard");
+ tprints("'Q'");
+ tprint_struct_next();
+ if (umoven_or_printaddr(tcp, arg + skip_iid, sizeof(sg_io) - skip_iid,
+ &sg_io.protocol)) {
+ tprint_struct_end();
+ return RVAL_IOCTL_DECODED;
+ }
+
+ PRINT_FIELD_XVAL(sg_io, protocol, bsg_protocol, "BSG_PROTOCOL_???");
+ tprint_struct_next();
+ PRINT_FIELD_XVAL(sg_io, subprotocol, bsg_subprotocol,
+ "BSG_SUB_PROTOCOL_???");
+ tprint_struct_next();
+ PRINT_FIELD_U(sg_io, request_len);
+ tprint_struct_next();
+ PRINT_FIELD_SG_IO_BUFFER(sg_io, request, sg_io.request_len, 0, tcp);
+ tprint_struct_next();
+ PRINT_FIELD_X(sg_io, request_tag);
+ tprint_struct_next();
+ PRINT_FIELD_U(sg_io, request_attr);
+ tprint_struct_next();
+ PRINT_FIELD_U(sg_io, request_priority);
+ tprint_struct_next();
+ PRINT_FIELD_U(sg_io, request_extra);
+ tprint_struct_next();
+ PRINT_FIELD_U(sg_io, max_response_len);
+
+ tprint_struct_next();
+ PRINT_FIELD_U(sg_io, dout_iovec_count);
+ tprint_struct_next();
+ PRINT_FIELD_U(sg_io, dout_xfer_len);
+ tprint_struct_next();
+ PRINT_FIELD_U(sg_io, din_iovec_count);
+ tprint_struct_next();
+ PRINT_FIELD_U(sg_io, din_xfer_len);
+ tprint_struct_next();
+ PRINT_FIELD_SG_IO_BUFFER(sg_io, dout_xferp, sg_io.dout_xfer_len,
+ sg_io.dout_iovec_count, tcp);
+ tprint_struct_next();
+ PRINT_FIELD_U(sg_io, timeout);
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(sg_io, flags, bsg_flags, "BSG_FLAG_???");
+ tprint_struct_next();
+ PRINT_FIELD_X(sg_io, usr_ptr);
+
+ struct sg_io_v4 *entering_sg_io = malloc(sizeof(*entering_sg_io));
+ if (entering_sg_io) {
+ memcpy(entering_sg_io, &sg_io, sizeof(sg_io));
+ entering_sg_io->guard = (unsigned char) 'Q';
+ set_tcb_priv_data(tcp, entering_sg_io, free);
+ }
+
+ return 0;
+}
+
+static int
+decode_response(struct tcb *const tcp, const kernel_ulong_t arg)
+{
+ struct sg_io_v4 *entering_sg_io = get_tcb_priv_data(tcp);
+ struct sg_io_v4 sg_io;
+ uint32_t din_len;
+
+ if (umove(tcp, arg, &sg_io) < 0) {
+ /* print i/o fields fetched on entering syscall */
+ tprint_struct_next();
+ PRINT_FIELD_X(*entering_sg_io, response);
+ tprint_struct_next();
+ PRINT_FIELD_X(*entering_sg_io, din_xferp);
+ return RVAL_IOCTL_DECODED;
+ }
+
+ if (sg_io.guard != entering_sg_io->guard) {
+ tprint_value_changed();
+ PRINT_FIELD_U(sg_io, guard);
+ return RVAL_IOCTL_DECODED;
+ }
+
+ tprint_struct_next();
+ PRINT_FIELD_U(sg_io, response_len);
+ tprint_struct_next();
+ PRINT_FIELD_SG_IO_BUFFER(sg_io, response, sg_io.response_len, 0, tcp);
+ din_len = sg_io.din_xfer_len;
+ if (sg_io.din_resid > 0 && (unsigned int) sg_io.din_resid <= din_len)
+ din_len -= sg_io.din_resid;
+ tprint_struct_next();
+ PRINT_FIELD_SG_IO_BUFFER(sg_io, din_xferp, din_len,
+ sg_io.din_iovec_count, tcp);
+ tprint_struct_next();
+ PRINT_FIELD_X(sg_io, driver_status);
+ tprint_struct_next();
+ PRINT_FIELD_X(sg_io, transport_status);
+ tprint_struct_next();
+ PRINT_FIELD_X(sg_io, device_status);
+ tprint_struct_next();
+ PRINT_FIELD_U(sg_io, retry_delay);
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(sg_io, info, sg_io_info, "SG_INFO_???");
+ tprint_struct_next();
+ PRINT_FIELD_U(sg_io, duration);
+ tprint_struct_next();
+ PRINT_FIELD_U(sg_io, response_len);
+ tprint_struct_next();
+ PRINT_FIELD_D(sg_io, din_resid);
+ tprint_struct_next();
+ PRINT_FIELD_D(sg_io, dout_resid);
+ tprint_struct_next();
+ PRINT_FIELD_X(sg_io, generated_tag);
+
+ return RVAL_IOCTL_DECODED;
+}
+
+#else /* !HAVE_LINUX_BSG_H */
+
+static int
+decode_request(struct tcb *const tcp, const kernel_ulong_t arg)
+{
+ tprint_struct_begin();
+ tprints_field_name("guard");
+ tprints("'Q'");
+ tprint_struct_next();
+ tprint_more_data_follows();
+ tprint_struct_end();
+ return RVAL_IOCTL_DECODED;
+}
+
+static int
+decode_response(struct tcb *const tcp, const kernel_ulong_t arg)
+{
+ return 0;
+}
+
+#endif
+
+int
+decode_sg_io_v4(struct tcb *const tcp, const kernel_ulong_t arg)
+{
+ return entering(tcp) ? decode_request(tcp, arg)
+ : decode_response(tcp, arg);
+}
diff --git a/src/shutdown.c b/src/shutdown.c
new file mode 100644
index 000000000..fba6e994d
--- /dev/null
+++ b/src/shutdown.c
@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1996-2000 Wichert Akkerman <wichert@cistron.nl>
+ * Copyright (c) 1999-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#include <sys/socket.h>
+#include "xlat/shutdown_modes.h"
+
+SYS_FUNC(shutdown)
+{
+ printfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ printxval(shutdown_modes, tcp->u_arg[1], "SHUT_???");
+
+ return RVAL_DECODED;
+}
diff --git a/src/sigaltstack.c b/src/sigaltstack.c
new file mode 100644
index 000000000..b6eca34f1
--- /dev/null
+++ b/src/sigaltstack.c
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993-1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
+ * Copyright (c) 2005-2015 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2015 Elvira Khabirova <lineprinter0@gmail.com>
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#include DEF_MPERS_TYPE(stack_t)
+
+#include <signal.h>
+
+#include MPERS_DEFS
+
+#include "xlat/sigaltstack_flags.h"
+
+static void
+print_stack_t(struct tcb *const tcp, const kernel_ulong_t addr)
+{
+ stack_t ss;
+
+ if (umove_or_printaddr(tcp, addr, &ss))
+ return;
+
+ tprint_struct_begin();
+ PRINT_FIELD_PTR(ss, ss_sp);
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(ss, ss_flags, sigaltstack_flags, "SS_???");
+ tprint_struct_next();
+ PRINT_FIELD_U(ss, ss_size);
+ tprint_struct_end();
+}
+
+SYS_FUNC(sigaltstack)
+{
+ if (entering(tcp)) {
+ print_stack_t(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ } else {
+ print_stack_t(tcp, tcp->u_arg[1]);
+ }
+ return 0;
+}
diff --git a/src/sigevent.h b/src/sigevent.h
new file mode 100644
index 000000000..85fd68471
--- /dev/null
+++ b/src/sigevent.h
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2016-2018 Dmitry V. Levin <ldv@strace.io>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_SIGEVENT_H
+# define STRACE_SIGEVENT_H
+
+typedef struct {
+ union {
+ int sival_int;
+ void *sival_ptr;
+ } sigev_value;
+ int sigev_signo;
+ int sigev_notify;
+ union {
+ int tid;
+ struct {
+ void *function;
+ void *attribute;
+ } sigev_thread;
+ } sigev_un;
+} struct_sigevent;
+
+#endif /* !STRACE_SIGEVENT_H */
diff --git a/src/signal.c b/src/signal.c
new file mode 100644
index 000000000..f92464978
--- /dev/null
+++ b/src/signal.c
@@ -0,0 +1,728 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
+ * Copyright (c) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation
+ * Linux for s390 port by D.J. Barrow
+ * <barrow_dj@mail.yahoo.com,djbarrow@de.ibm.com>
+ * Copyright (c) 1999-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include "nsig.h"
+#include "xstring.h"
+
+/* The libc headers do not define this constant since it should only be
+ used by the implementation. So we define it here. */
+#ifndef SA_RESTORER
+# ifdef ASM_SA_RESTORER
+# define SA_RESTORER ASM_SA_RESTORER
+# endif
+#endif
+
+/*
+ * Some architectures define SA_RESTORER in their headers,
+ * but do not actually have sa_restorer.
+ *
+ * Some architectures, otherwise, do not define SA_RESTORER in their headers,
+ * but actually have sa_restorer.
+ */
+#ifdef HAVE_ARCH_SA_RESTORER
+# define HAVE_SA_RESTORER HAVE_ARCH_SA_RESTORER
+#else /* !HAVE_ARCH_SA_RESTORER */
+# ifdef SA_RESTORER
+# define HAVE_SA_RESTORER 1
+# else
+# define HAVE_SA_RESTORER 0
+# endif
+#endif /* HAVE_ARCH_SA_RESTORER */
+
+#include "xlat/sa_handler_values.h"
+#include "xlat/sigact_flags.h"
+#include "xlat/sigprocmaskcmds.h"
+
+/* Anonymous realtime signals. */
+#ifndef ASM_SIGRTMIN
+/* Linux kernel >= 3.18 defines SIGRTMIN to 32 on all architectures. */
+# define ASM_SIGRTMIN 32
+#endif
+#ifndef ASM_SIGRTMAX
+/* Under glibc 2.1, SIGRTMAX et al are functions, but __SIGRTMAX is a
+ constant. This is what we want. Otherwise, just use SIGRTMAX. */
+# ifdef SIGRTMAX
+# ifndef __SIGRTMAX
+# define __SIGRTMAX SIGRTMAX
+# endif
+# endif
+# ifdef __SIGRTMAX
+# define ASM_SIGRTMAX __SIGRTMAX
+# endif
+#endif
+
+/* Note on the size of sigset_t:
+ *
+ * In glibc, sigset_t is an array with space for 1024 bits (!),
+ * even though all arches supported by Linux have only 64 signals
+ * except MIPS, which has 128. IOW, it is 128 bytes long.
+ *
+ * In-kernel sigset_t is sized correctly (it is either 64 or 128 bit long).
+ * However, some old syscall return only 32 lower bits (one word).
+ * Example: sys_sigpending vs sys_rt_sigpending.
+ *
+ * Be aware of this fact when you try to
+ * memcpy(&tcp->u_arg[1], &something, sizeof(sigset_t))
+ * - sizeof(sigset_t) is much bigger than you think,
+ * it may overflow tcp->u_arg[] array, and it may try to copy more data
+ * than is really available in <something>.
+ * Similarly,
+ * umoven(tcp, addr, sizeof(sigset_t), &sigset)
+ * may be a bad idea: it'll try to read much more data than needed
+ * to fetch a sigset_t.
+ * Use NSIG_BYTES as a size instead.
+ */
+
+static const char *
+get_sa_handler_str(kernel_ulong_t handler)
+{
+ return xlookup(sa_handler_values, handler);
+}
+
+static void
+print_sa_handler(kernel_ulong_t handler)
+{
+ const char *sa_handler_str = get_sa_handler_str(handler);
+
+ if (sa_handler_str)
+ print_xlat_ex(handler, sa_handler_str, XLAT_STYLE_DEFAULT);
+ else
+ printaddr(handler);
+}
+
+const char *
+signame(const int sig)
+{
+ if (sig > 0) {
+ const unsigned int s = sig;
+
+ if (s < nsignals)
+ return signalent[s];
+#ifdef ASM_SIGRTMAX
+ if (s >= ASM_SIGRTMIN && s <= (unsigned int) ASM_SIGRTMAX) {
+ static char buf[sizeof("SIGRT_%u") + sizeof(s) * 3];
+
+ xsprintf(buf, "SIGRT_%u", s - ASM_SIGRTMIN);
+ return buf;
+ }
+#endif
+ }
+
+ return NULL;
+}
+
+const char *
+sprintsigname(const int sig)
+{
+ const char *str = signame(sig);
+
+ if (str)
+ return str;
+
+ static char buf[sizeof(sig) * 3 + 2];
+
+ xsprintf(buf, "%d", sig);
+
+ return buf;
+}
+
+const char *
+sprintsigmask_n(const char *prefix, const void *sig_mask, unsigned int bytes)
+{
+ /*
+ * The maximum number of signal names to be printed
+ * is NSIG_BYTES * 8 * 2 / 3.
+ * Most of signal names have length 7,
+ * average length of signal names is less than 7.
+ * The length of prefix string does not exceed 16.
+ */
+ static char outstr[128 + 8 * (NSIG_BYTES * 8 * 2 / 3)];
+
+ char *s;
+ const uint32_t *mask;
+ uint32_t inverted_mask[NSIG_BYTES / 4];
+ unsigned int size;
+ int i;
+ char sep;
+
+ s = stpcpy(outstr, prefix);
+
+ mask = sig_mask;
+ /* length of signal mask in 4-byte words */
+ size = (bytes >= NSIG_BYTES) ? NSIG_BYTES / 4 : (bytes + 3) / 4;
+
+ /* check whether 2/3 or more bits are set */
+ if (popcount32(mask, size) >= size * (4 * 8) * 2 / 3) {
+ /* show those signals that are NOT in the mask */
+ unsigned int j;
+ for (j = 0; j < size; ++j)
+ inverted_mask[j] = ~mask[j];
+ mask = inverted_mask;
+ *s++ = '~';
+ }
+
+ sep = '[';
+ for (i = 0; (i = next_set_bit(mask, i, size * (4 * 8))) >= 0; ) {
+ ++i;
+ *s++ = sep;
+ if ((unsigned) i < nsignals) {
+ s = stpcpy(s, signalent[i] + 3);
+ }
+#ifdef ASM_SIGRTMAX
+ else if (i >= ASM_SIGRTMIN && i <= ASM_SIGRTMAX) {
+ s = xappendstr(outstr, s, "RT_%u", i - ASM_SIGRTMIN);
+ }
+#endif
+ else {
+ s = xappendstr(outstr, s, "%u", i);
+ }
+ sep = ' ';
+ }
+ if (sep == '[')
+ *s++ = sep;
+ *s++ = ']';
+ *s = '\0';
+ return outstr;
+}
+
+#define sprintsigmask_val(prefix, mask) \
+ sprintsigmask_n((prefix), &(mask), sizeof(mask))
+
+#define tprintsigmask_val(mask) \
+ tprints(sprintsigmask_n("", &(mask), sizeof(mask)))
+
+static const char *
+sprint_old_sigmask_val(const char *const prefix, const unsigned long mask)
+{
+#if defined(current_wordsize) || !defined(WORDS_BIGENDIAN)
+ return sprintsigmask_n(prefix, &mask, current_wordsize);
+#else /* !current_wordsize && WORDS_BIGENDIAN */
+ if (current_wordsize == sizeof(mask)) {
+ return sprintsigmask_val(prefix, mask);
+ } else {
+ uint32_t mask32 = mask;
+ return sprintsigmask_val(prefix, mask32);
+ }
+#endif
+}
+
+static void
+tprint_old_sigmask_val(const unsigned long mask)
+{
+ tprints(sprint_old_sigmask_val("", mask));
+}
+
+void
+printsignal(int nr)
+{
+ const char *str = signame(nr);
+
+ if (!str || xlat_verbose(xlat_verbosity) != XLAT_STYLE_ABBREV)
+ tprintf("%d", nr);
+ if (!str || xlat_verbose(xlat_verbosity) == XLAT_STYLE_RAW)
+ return;
+ (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE
+ ? tprints_comment : tprints)(str);
+}
+
+static void
+print_sigset_addr_len_limit(struct tcb *const tcp, const kernel_ulong_t addr,
+ const kernel_ulong_t len, const unsigned int min_len)
+{
+ /*
+ * Here len is usually equal to NSIG_BYTES or current_wordsize.
+ * But we code this defensively:
+ */
+ if (len < min_len || len > NSIG_BYTES) {
+ printaddr(addr);
+ return;
+ }
+ int mask[NSIG_BYTES / sizeof(int)] = {};
+ if (umoven_or_printaddr(tcp, addr, len, mask))
+ return;
+ tprints(sprintsigmask_n("", mask, len));
+}
+
+void
+print_sigset_addr_len(struct tcb *const tcp, const kernel_ulong_t addr,
+ const kernel_ulong_t len)
+{
+ print_sigset_addr_len_limit(tcp, addr, len, current_wordsize);
+}
+
+void
+print_sigset_addr(struct tcb *const tcp, const kernel_ulong_t addr)
+{
+ tprint_struct_begin();
+ tprints_field_name("mask");
+ print_sigset_addr_len_limit(tcp, addr, NSIG_BYTES, NSIG_BYTES);
+ tprint_struct_end();
+}
+
+SYS_FUNC(ssetmask)
+{
+ if (entering(tcp)) {
+ tprint_old_sigmask_val((unsigned) tcp->u_arg[0]);
+ } else if (!syserror(tcp)) {
+ tcp->auxstr = sprint_old_sigmask_val("old mask ",
+ (unsigned) tcp->u_rval);
+ return RVAL_HEX | RVAL_STR;
+ }
+ return 0;
+}
+
+struct old_sigaction {
+ /* sa_handler may be a libc #define, need to use other name: */
+#if defined MIPS
+ unsigned int sa_flags;
+ unsigned long sa_handler__;
+ unsigned long sa_mask;
+#elif defined ALPHA
+ unsigned long sa_handler__;
+ unsigned long sa_mask;
+ unsigned int sa_flags;
+#else
+ unsigned long sa_handler__;
+ unsigned long sa_mask;
+ unsigned long sa_flags;
+ unsigned long sa_restorer;
+#endif
+}
+#ifdef ALPHA
+ ATTRIBUTE_PACKED
+#endif
+;
+
+static void
+decode_old_sigaction(struct tcb *const tcp, const kernel_ulong_t addr)
+{
+ struct old_sigaction sa;
+
+#ifndef current_wordsize
+ if (current_wordsize < sizeof(sa.sa_handler__)) {
+ struct old_sigaction32 {
+ uint32_t sa_handler__;
+ uint32_t sa_mask;
+ uint32_t sa_flags;
+ uint32_t sa_restorer;
+ } sa32;
+
+ if (umove_or_printaddr(tcp, addr, &sa32))
+ return;
+
+ memset(&sa, 0, sizeof(sa));
+ sa.sa_handler__ = sa32.sa_handler__;
+ sa.sa_flags = sa32.sa_flags;
+ sa.sa_restorer = sa32.sa_restorer;
+ sa.sa_mask = sa32.sa_mask;
+ } else
+#endif
+ if (umove_or_printaddr(tcp, addr, &sa))
+ return;
+
+ tprint_struct_begin();
+ tprints_field_name("sa_handler");
+ print_sa_handler(sa.sa_handler__);
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_VAL(sa, sa_mask, tprint_old_sigmask_val);
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(sa, sa_flags, sigact_flags, "SA_???");
+#if !(defined ALPHA || defined MIPS)
+ if (sa.sa_flags & 0x04000000U) {
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_VAL(sa, sa_restorer, printaddr);
+ }
+#endif
+ tprint_struct_end();
+}
+
+SYS_FUNC(sigaction)
+{
+ if (entering(tcp)) {
+ int signo = tcp->u_arg[0];
+#if defined SPARC || defined SPARC64
+ if (signo < 0) {
+ tprints("-");
+ signo = -signo;
+ }
+#endif
+ printsignal(signo);
+ tprints(", ");
+ decode_old_sigaction(tcp, tcp->u_arg[1]);
+ tprints(", ");
+ } else
+ decode_old_sigaction(tcp, tcp->u_arg[2]);
+ return 0;
+}
+
+SYS_FUNC(signal)
+{
+ if (entering(tcp)) {
+ printsignal(tcp->u_arg[0]);
+ tprints(", ");
+ print_sa_handler(tcp->u_arg[1]);
+ return 0;
+ } else if (!syserror(tcp)) {
+ tcp->auxstr = get_sa_handler_str(tcp->u_rval);
+ return RVAL_HEX | RVAL_STR;
+ }
+ return 0;
+}
+
+SYS_FUNC(sgetmask)
+{
+ if (exiting(tcp) && !syserror(tcp)) {
+ tcp->auxstr = sprint_old_sigmask_val("mask ", tcp->u_rval);
+ return RVAL_HEX | RVAL_STR;
+ }
+ return 0;
+}
+
+SYS_FUNC(sigsuspend)
+{
+#ifdef MIPS
+ print_sigset_addr_len(tcp, tcp->u_arg[n_args(tcp) - 1],
+ current_wordsize);
+#else
+ tprint_old_sigmask_val(tcp->u_arg[n_args(tcp) - 1]);
+#endif
+
+ return RVAL_DECODED;
+}
+
+#ifdef ALPHA
+/*
+ * The OSF/1 sigprocmask is different: it doesn't pass in two pointers,
+ * but rather passes in the new bitmask as an argument and then returns
+ * the old bitmask. This "works" because we only have 64 signals to worry
+ * about. If you want more, use of the rt_sigprocmask syscall is required.
+ *
+ * Alpha:
+ * old = osf_sigprocmask(how, new);
+ * Everyone else:
+ * ret = sigprocmask(how, &new, &old, ...);
+ */
+SYS_FUNC(osf_sigprocmask)
+{
+ if (entering(tcp)) {
+ printxval(sigprocmaskcmds, tcp->u_arg[0], "SIG_???");
+ tprints(", ");
+ tprintsigmask_val(tcp->u_arg[1]);
+ } else if (!syserror(tcp)) {
+ tcp->auxstr = sprintsigmask_val("old mask ", tcp->u_rval);
+ return RVAL_HEX | RVAL_STR;
+ }
+ return 0;
+}
+
+#else /* !ALPHA */
+
+/* "Old" sigprocmask, which operates with word-sized signal masks */
+SYS_FUNC(sigprocmask)
+{
+ if (entering(tcp)) {
+ printxval(sigprocmaskcmds, tcp->u_arg[0], "SIG_???");
+ tprints(", ");
+ print_sigset_addr_len(tcp, tcp->u_arg[1], current_wordsize);
+ tprints(", ");
+ } else {
+ print_sigset_addr_len(tcp, tcp->u_arg[2], current_wordsize);
+ }
+ return 0;
+}
+#endif /* !ALPHA */
+
+SYS_FUNC(kill)
+{
+ /* pid */
+ printpid_tgid_pgid(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ /* signal */
+ printsignal(tcp->u_arg[1]);
+
+ return RVAL_DECODED;
+}
+
+SYS_FUNC(tkill)
+{
+ printpid(tcp, tcp->u_arg[0], PT_TID);
+ tprints(", ");
+ printsignal(tcp->u_arg[1]);
+
+ return RVAL_DECODED;
+}
+
+SYS_FUNC(tgkill)
+{
+ /* tgid */
+ printpid(tcp, tcp->u_arg[0], PT_TGID);
+ tprints(", ");
+ /* tid */
+ printpid(tcp, tcp->u_arg[1], PT_TID);
+ tprints(", ");
+ /* signal */
+ printsignal(tcp->u_arg[2]);
+
+ return RVAL_DECODED;
+}
+
+SYS_FUNC(sigpending)
+{
+ if (exiting(tcp))
+ print_sigset_addr_len(tcp, tcp->u_arg[0], current_wordsize);
+ return 0;
+}
+
+SYS_FUNC(rt_sigprocmask)
+{
+ /* Note: arg[3] is the length of the sigset. Kernel requires NSIG_BYTES */
+ if (entering(tcp)) {
+ printxval(sigprocmaskcmds, tcp->u_arg[0], "SIG_???");
+ tprints(", ");
+ print_sigset_addr_len(tcp, tcp->u_arg[1], tcp->u_arg[3]);
+ tprints(", ");
+ } else {
+ print_sigset_addr_len(tcp, tcp->u_arg[2], tcp->u_arg[3]);
+ tprintf(", %" PRI_klu, tcp->u_arg[3]);
+ }
+ return 0;
+}
+
+/* Structure describing the action to be taken when a signal arrives. */
+struct new_sigaction {
+ /* sa_handler may be a libc #define, need to use other name: */
+#ifdef MIPS
+ unsigned int sa_flags;
+ unsigned long sa_handler__;
+#else
+ unsigned long sa_handler__;
+ unsigned long sa_flags;
+#endif /* !MIPS */
+#if HAVE_SA_RESTORER
+ unsigned long sa_restorer;
+#endif
+ /* Kernel treats sa_mask as an array of longs. */
+ unsigned long sa_mask[NSIG / sizeof(long)];
+};
+/* Same for i386-on-x86_64 and similar cases */
+struct new_sigaction32 {
+ uint32_t sa_handler__;
+ uint32_t sa_flags;
+#if HAVE_SA_RESTORER
+ uint32_t sa_restorer;
+#endif
+ uint32_t sa_mask[2 * (NSIG / sizeof(long))];
+};
+
+static void
+decode_new_sigaction(struct tcb *const tcp, const kernel_ulong_t addr)
+{
+ struct new_sigaction sa;
+
+#ifndef current_wordsize
+ if (current_wordsize < sizeof(sa.sa_handler__)) {
+ struct new_sigaction32 sa32;
+
+ if (umove_or_printaddr(tcp, addr, &sa32))
+ return;
+
+ memset(&sa, 0, sizeof(sa));
+ sa.sa_handler__ = sa32.sa_handler__;
+ sa.sa_flags = sa32.sa_flags;
+# if HAVE_SA_RESTORER && defined SA_RESTORER
+ sa.sa_restorer = sa32.sa_restorer;
+# endif
+ /* Kernel treats sa_mask as an array of longs.
+ * For 32-bit process, "long" is uint32_t, thus, for example,
+ * 32th bit in sa_mask will end up as bit 0 in sa_mask[1].
+ * But for (64-bit) kernel, 32th bit in sa_mask is
+ * 32th bit in 0th (64-bit) long!
+ * For little-endian, it's the same.
+ * For big-endian, we swap 32-bit words.
+ */
+ sa.sa_mask[0] = ULONG_LONG(sa32.sa_mask[0], sa32.sa_mask[1]);
+ } else
+#endif
+ if (umove_or_printaddr(tcp, addr, &sa))
+ return;
+
+ tprint_struct_begin();
+ tprints_field_name("sa_handler");
+ print_sa_handler(sa.sa_handler__);
+ /*
+ * Sigset size is in tcp->u_arg[4] (SPARC)
+ * or in tcp->u_arg[3] (all other),
+ * but kernel won't handle sys_rt_sigaction
+ * with wrong sigset size (just returns EINVAL instead).
+ * We just fetch the right size, which is NSIG_BYTES.
+ */
+ tprint_struct_next();
+ tprints_field_name("sa_mask");
+ tprintsigmask_val(sa.sa_mask);
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(sa, sa_flags, sigact_flags, "SA_???");
+#if HAVE_SA_RESTORER && defined SA_RESTORER
+ if (sa.sa_flags & SA_RESTORER) {
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_VAL(sa, sa_restorer, printaddr);
+ }
+#endif
+ tprint_struct_end();
+}
+
+SYS_FUNC(rt_sigaction)
+{
+ if (entering(tcp)) {
+ printsignal(tcp->u_arg[0]);
+ tprints(", ");
+ decode_new_sigaction(tcp, tcp->u_arg[1]);
+ tprints(", ");
+ } else {
+ decode_new_sigaction(tcp, tcp->u_arg[2]);
+#if defined(SPARC) || defined(SPARC64)
+ tprintf(", %#" PRI_klx ", %" PRI_klu, tcp->u_arg[3], tcp->u_arg[4]);
+#elif defined(ALPHA)
+ tprintf(", %" PRI_klu ", %#" PRI_klx, tcp->u_arg[3], tcp->u_arg[4]);
+#else
+ tprintf(", %" PRI_klu, tcp->u_arg[3]);
+#endif
+ }
+ return 0;
+}
+
+SYS_FUNC(rt_sigpending)
+{
+ if (exiting(tcp)) {
+ /*
+ * One of the few syscalls where sigset size (arg[1])
+ * is allowed to be <= NSIG_BYTES, not strictly ==.
+ * This allows non-rt sigpending() syscall
+ * to reuse rt_sigpending() code in kernel.
+ */
+ print_sigset_addr_len_limit(tcp, tcp->u_arg[0],
+ tcp->u_arg[1], 1);
+ tprintf(", %" PRI_klu, tcp->u_arg[1]);
+ }
+ return 0;
+}
+
+SYS_FUNC(rt_sigsuspend)
+{
+ /* NB: kernel requires arg[1] == NSIG_BYTES */
+ print_sigset_addr_len(tcp, tcp->u_arg[0], tcp->u_arg[1]);
+ tprintf(", %" PRI_klu, tcp->u_arg[1]);
+
+ return RVAL_DECODED;
+}
+
+static void
+print_sigqueueinfo(struct tcb *const tcp, const int sig,
+ const kernel_ulong_t addr)
+{
+ printsignal(sig);
+ tprints(", ");
+ printsiginfo_at(tcp, addr);
+}
+
+SYS_FUNC(rt_sigqueueinfo)
+{
+ printpid(tcp, tcp->u_arg[0], PT_TGID);
+ tprints(", ");
+ print_sigqueueinfo(tcp, tcp->u_arg[1], tcp->u_arg[2]);
+
+ return RVAL_DECODED;
+}
+
+SYS_FUNC(rt_tgsigqueueinfo)
+{
+ printpid(tcp, tcp->u_arg[0], PT_TGID);
+ tprints(", ");
+ printpid(tcp, tcp->u_arg[1], PT_TID);
+ tprints(", ");
+ print_sigqueueinfo(tcp, tcp->u_arg[2], tcp->u_arg[3]);
+
+ return RVAL_DECODED;
+}
+
+SYS_FUNC(pidfd_send_signal)
+{
+ /* int pidfd */
+ printfd(tcp, tcp->u_arg[0]);
+ /* int sig, siginfo_t *info */
+ tprints(", ");
+ print_sigqueueinfo(tcp, tcp->u_arg[1], tcp->u_arg[2]);
+ /* unsigned int flags */
+ tprintf(", %#x", (unsigned int) tcp->u_arg[3]);
+
+ return RVAL_DECODED;
+}
+
+static int
+do_rt_sigtimedwait(struct tcb *const tcp, const print_obj_by_addr_fn print_ts,
+ const sprint_obj_by_addr_fn sprint_ts)
+{
+ /* NB: kernel requires arg[3] == NSIG_BYTES */
+ if (entering(tcp)) {
+ print_sigset_addr_len(tcp, tcp->u_arg[0], tcp->u_arg[3]);
+ tprints(", ");
+ if (!(tcp->u_arg[1] && verbose(tcp))) {
+ /*
+ * This is the only "return" parameter,
+ * if we are not going to fetch it on exit,
+ * decode all parameters on entry.
+ */
+ printaddr(tcp->u_arg[1]);
+ tprints(", ");
+ print_ts(tcp, tcp->u_arg[2]);
+ tprintf(", %" PRI_klu, tcp->u_arg[3]);
+ } else {
+ char *sts = xstrdup(sprint_ts(tcp, tcp->u_arg[2]));
+ set_tcb_priv_data(tcp, sts, free);
+ }
+ } else {
+ if (tcp->u_arg[1] && verbose(tcp)) {
+ printsiginfo_at(tcp, tcp->u_arg[1]);
+ tprints(", ");
+ tprints(get_tcb_priv_data(tcp));
+ tprintf(", %" PRI_klu, tcp->u_arg[3]);
+ }
+
+ if (!syserror(tcp) && tcp->u_rval) {
+ tcp->auxstr = signame(tcp->u_rval);
+ return RVAL_STR;
+ }
+ }
+ return 0;
+}
+
+#if HAVE_ARCH_TIME32_SYSCALLS
+SYS_FUNC(rt_sigtimedwait_time32)
+{
+ return do_rt_sigtimedwait(tcp, print_timespec32, sprint_timespec32);
+}
+#endif
+
+SYS_FUNC(rt_sigtimedwait_time64)
+{
+ return do_rt_sigtimedwait(tcp, print_timespec64, sprint_timespec64);
+}
+
+SYS_FUNC(restart_syscall)
+{
+ tprintf("<... resuming interrupted %s ...>",
+ tcp->s_prev_ent ? tcp->s_prev_ent->sys_name : "system call");
+
+ return RVAL_DECODED;
+}
diff --git a/src/signalfd.c b/src/signalfd.c
new file mode 100644
index 000000000..d9dad4aef
--- /dev/null
+++ b/src/signalfd.c
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2008-2015 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include <fcntl.h>
+#ifdef HAVE_SYS_SIGNALFD_H
+# include <sys/signalfd.h>
+#endif
+
+#include "xlat/sfd_flags.h"
+
+static int
+do_signalfd(struct tcb *tcp, int flags_arg)
+{
+ /* NB: kernel requires arg[2] == NSIG_BYTES */
+ printfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ print_sigset_addr_len(tcp, tcp->u_arg[1], tcp->u_arg[2]);
+ tprintf(", %" PRI_klu, tcp->u_arg[2]);
+ if (flags_arg >= 0) {
+ tprints(", ");
+ printflags(sfd_flags, tcp->u_arg[flags_arg], "SFD_???");
+ }
+
+ return RVAL_DECODED | RVAL_FD;
+}
+
+SYS_FUNC(signalfd)
+{
+ return do_signalfd(tcp, -1);
+}
+
+SYS_FUNC(signalfd4)
+{
+ return do_signalfd(tcp, 3);
+}
diff --git a/src/sigreturn.c b/src/sigreturn.c
new file mode 100644
index 000000000..30cf75947
--- /dev/null
+++ b/src/sigreturn.c
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2015-2018 Dmitry V. Levin <ldv@strace.io>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include "ptrace.h"
+#include "nsig.h"
+#include "regs.h"
+
+#if defined HAVE_ASM_SIGCONTEXT_H && !defined HAVE_STRUCT_SIGCONTEXT
+# include <asm/sigcontext.h>
+#endif
+
+static inline void
+print_sigmask_addr_size(const void *const addr, const unsigned int size)
+{
+ tprint_struct_begin();
+ tprints_field_name("mask");
+ tprints(sprintsigmask_n("", addr, size));
+ tprint_struct_end();
+}
+
+#define tprintsigmask_addr(mask_) \
+ print_sigmask_addr_size((mask_), sizeof(mask_))
+
+#include "arch_sigreturn.c"
+
+SYS_FUNC(sigreturn)
+{
+ arch_sigreturn(tcp);
+
+ return RVAL_DECODED;
+}
diff --git a/src/sock.c b/src/sock.c
new file mode 100644
index 000000000..d587ca469
--- /dev/null
+++ b/src/sock.c
@@ -0,0 +1,414 @@
+/*
+ * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1996-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#include DEF_MPERS_TYPE(struct_ifconf)
+#include DEF_MPERS_TYPE(struct_ifreq)
+
+#include <sys/socket.h>
+#include <net/if.h>
+
+typedef struct ifconf struct_ifconf;
+typedef struct ifreq struct_ifreq;
+
+#include MPERS_DEFS
+
+#include <linux/ioctl.h>
+#include <linux/sockios.h>
+#include <arpa/inet.h>
+
+#include "xlat/iffflags.h"
+
+#define XLAT_MACROS_ONLY
+#include "xlat/arp_hardware_types.h"
+#undef XLAT_MACROS_ONLY
+
+static void
+print_ifr_hwaddr(const typeof_field(struct_ifreq, ifr_hwaddr) *const p)
+{
+ tprint_struct_begin();
+ PRINT_FIELD_XVAL(*p, sa_family, arp_hardware_types, "ARPHRD_???");
+ tprint_struct_next();
+ PRINT_FIELD_HWADDR_SZ(*p, sa_data, sizeof(p->sa_data), p->sa_family);
+ tprint_struct_end();
+}
+
+static void
+print_ifr_map(const typeof_field(struct_ifreq, ifr_map) *const p)
+{
+ tprint_struct_begin();
+ PRINT_FIELD_X(*p, mem_start);
+ tprint_struct_next();
+ PRINT_FIELD_X(*p, mem_end);
+ tprint_struct_next();
+ PRINT_FIELD_X(*p, base_addr);
+ tprint_struct_next();
+ PRINT_FIELD_X(*p, irq);
+ tprint_struct_next();
+ PRINT_FIELD_X(*p, dma);
+ tprint_struct_next();
+ PRINT_FIELD_X(*p, port);
+ tprint_struct_end();
+}
+
+static void
+print_ifreq(struct tcb *const tcp, const unsigned int code,
+ const kernel_ulong_t arg, const struct_ifreq *const ifr)
+{
+ switch (code) {
+ case SIOCSIFADDR:
+ case SIOCGIFADDR:
+ PRINT_FIELD_SOCKADDR(*ifr, ifr_addr, tcp);
+ break;
+ case SIOCSIFDSTADDR:
+ case SIOCGIFDSTADDR:
+ PRINT_FIELD_SOCKADDR(*ifr, ifr_dstaddr, tcp);
+ break;
+ case SIOCSIFBRDADDR:
+ case SIOCGIFBRDADDR:
+ PRINT_FIELD_SOCKADDR(*ifr, ifr_broadaddr, tcp);
+ break;
+ case SIOCSIFNETMASK:
+ case SIOCGIFNETMASK:
+ PRINT_FIELD_SOCKADDR(*ifr, ifr_netmask, tcp);
+ break;
+ case SIOCADDMULTI:
+ case SIOCDELMULTI:
+ case SIOCGIFHWADDR:
+ case SIOCSIFHWADDR:
+ case SIOCSIFHWBROADCAST:
+ PRINT_FIELD_OBJ_PTR(*ifr, ifr_hwaddr, print_ifr_hwaddr);
+ break;
+ case SIOCSIFFLAGS:
+ case SIOCGIFFLAGS:
+ PRINT_FIELD_FLAGS(*ifr, ifr_flags, iffflags, "IFF_???");
+ break;
+ case SIOCGIFINDEX:
+ PRINT_FIELD_D(*ifr, ifr_ifindex);
+ break;
+ case SIOCSIFMETRIC:
+ case SIOCGIFMETRIC:
+ PRINT_FIELD_D(*ifr, ifr_metric);
+ break;
+ case SIOCSIFMTU:
+ case SIOCGIFMTU:
+ PRINT_FIELD_D(*ifr, ifr_mtu);
+ break;
+ case SIOCSIFSLAVE:
+ case SIOCGIFSLAVE:
+ PRINT_FIELD_CSTRING(*ifr, ifr_slave);
+ break;
+ case SIOCSIFNAME:
+ PRINT_FIELD_CSTRING(*ifr, ifr_newname);
+ break;
+ case SIOCGIFNAME:
+ PRINT_FIELD_CSTRING(*ifr, ifr_name);
+ break;
+ case SIOCSIFTXQLEN:
+ case SIOCGIFTXQLEN:
+ PRINT_FIELD_D(*ifr, ifr_qlen);
+ break;
+ case SIOCSIFMAP:
+ case SIOCGIFMAP:
+ PRINT_FIELD_OBJ_PTR(*ifr, ifr_map, print_ifr_map);
+ break;
+ }
+}
+
+static unsigned int
+print_ifc_len(int len)
+{
+ const unsigned int n = (unsigned int) len / sizeof(struct_ifreq);
+
+ if (len <= 0 || n * sizeof(struct_ifreq) != (unsigned int) len)
+ tprintf("%d", len);
+ else
+ tprintf("%u * sizeof(struct ifreq)", n);
+
+ return n;
+}
+
+static bool
+print_ifconf_ifreq(struct tcb *tcp, void *elem_buf, size_t elem_size,
+ void *dummy)
+{
+ struct_ifreq *ifr = elem_buf;
+
+ tprint_struct_begin();
+ PRINT_FIELD_CSTRING(*ifr, ifr_name);
+ tprint_struct_next();
+ PRINT_FIELD_SOCKADDR(*ifr, ifr_addr, tcp);
+ tprint_struct_end();
+
+ return true;
+}
+
+/*
+ * There are two different modes of operation:
+ *
+ * - Get buffer size. In this case, the callee sets ifc_buf to NULL,
+ * and the kernel returns the buffer size in ifc_len.
+ * - Get actual data. In this case, the callee specifies the buffer address
+ * in ifc_buf and its size in ifc_len. The kernel fills the buffer with
+ * the data, and its amount is returned in ifc_len.
+ *
+ * Note that, technically, the whole struct ifconf is overwritten,
+ * so ifc_buf could be different on exit, but current ioctl handler
+ * implementation does not touch it.
+ */
+static int
+decode_ifconf(struct tcb *const tcp, const kernel_ulong_t addr)
+{
+ struct_ifconf *entering_ifc = NULL;
+ struct_ifconf *ifc =
+ entering(tcp) ? malloc(sizeof(*ifc)) : alloca(sizeof(*ifc));
+
+ if (exiting(tcp)) {
+ entering_ifc = get_tcb_priv_data(tcp);
+
+ if (!entering_ifc) {
+ error_func_msg("where is my ifconf?");
+ return 0;
+ }
+ }
+
+ if (!ifc || umove(tcp, addr, ifc) < 0) {
+ if (entering(tcp)) {
+ free(ifc);
+
+ tprints(", ");
+ printaddr(addr);
+ } else {
+ /*
+ * We failed to fetch the structure on exiting syscall,
+ * print whatever was fetched on entering syscall.
+ */
+ if (!entering_ifc->ifc_buf)
+ print_ifc_len(entering_ifc->ifc_len);
+
+ tprint_struct_next();
+ PRINT_FIELD_PTR(*entering_ifc, ifc_buf);
+
+ tprint_struct_end();
+ }
+
+ return RVAL_IOCTL_DECODED;
+ }
+
+ if (entering(tcp)) {
+ tprints(", ");
+ tprint_struct_begin();
+ tprints_field_name("ifc_len");
+ if (ifc->ifc_buf)
+ print_ifc_len(ifc->ifc_len);
+
+ set_tcb_priv_data(tcp, ifc, free);
+
+ return 0;
+ }
+
+ /* exiting */
+
+ if (entering_ifc->ifc_buf && (entering_ifc->ifc_len != ifc->ifc_len))
+ tprint_value_changed();
+ if (!entering_ifc->ifc_buf || (entering_ifc->ifc_len != ifc->ifc_len))
+ print_ifc_len(ifc->ifc_len);
+
+ if (!entering_ifc->ifc_buf || syserror(tcp)) {
+ tprint_struct_next();
+ PRINT_FIELD_PTR(*entering_ifc, ifc_buf);
+ if (entering_ifc->ifc_buf != ifc->ifc_buf) {
+ tprint_value_changed();
+ printaddr(ptr_to_kulong(ifc->ifc_buf));
+ }
+ } else {
+ struct_ifreq ifr;
+
+ tprint_struct_next();
+ tprints_field_name("ifc_buf");
+ print_array(tcp, ptr_to_kulong(ifc->ifc_buf),
+ ifc->ifc_len / sizeof(struct_ifreq),
+ &ifr, sizeof(ifr),
+ tfetch_mem, print_ifconf_ifreq, NULL);
+ }
+
+ tprint_struct_end();
+
+ return RVAL_IOCTL_DECODED;
+}
+
+MPERS_PRINTER_DECL(int, sock_ioctl,
+ struct tcb *tcp, const unsigned int code,
+ const kernel_ulong_t arg)
+{
+ struct_ifreq ifr;
+
+ switch (code) {
+ case SIOCGIFCONF:
+ return decode_ifconf(tcp, arg);
+
+ case SIOCBRADDBR:
+ case SIOCBRDELBR:
+ tprints(", ");
+ printpathn(tcp, arg, sizeof(ifr.ifr_name) - 1);
+ break;
+
+ case FIOGETOWN:
+ case SIOCATMARK:
+ case SIOCGIFENCAP:
+ case SIOCGPGRP:
+#ifdef SIOCOUTQNSD
+ case SIOCOUTQNSD:
+#endif
+ if (entering(tcp))
+ return 0;
+ ATTRIBUTE_FALLTHROUGH;
+
+ case FIOSETOWN:
+ case SIOCSIFENCAP:
+ case SIOCSPGRP:
+ tprints(", ");
+ printnum_int(tcp, arg, "%d");
+ break;
+
+ case SIOCBRADDIF:
+ case SIOCBRDELIF:
+ tprints(", ");
+ if (!umove_or_printaddr(tcp, arg, &ifr)) {
+ tprint_struct_begin();
+ PRINT_FIELD_IFINDEX(ifr, ifr_ifindex);
+ tprint_struct_end();
+ }
+ break;
+
+ case SIOCADDMULTI:
+ case SIOCDELMULTI:
+ case SIOCSIFADDR:
+ case SIOCSIFBRDADDR:
+ case SIOCSIFDSTADDR:
+ case SIOCSIFFLAGS:
+ case SIOCSIFHWADDR:
+ case SIOCSIFHWBROADCAST:
+ case SIOCSIFMAP:
+ case SIOCSIFMETRIC:
+ case SIOCSIFMTU:
+ case SIOCSIFNAME:
+ case SIOCSIFNETMASK:
+ case SIOCSIFSLAVE:
+ case SIOCSIFTXQLEN:
+ tprints(", ");
+ if (umove_or_printaddr(tcp, arg, &ifr))
+ break;
+
+ tprint_struct_begin();
+ PRINT_FIELD_CSTRING(ifr, ifr_name);
+ tprints(", ");
+ print_ifreq(tcp, code, arg, &ifr);
+ tprint_struct_end();
+ break;
+
+ case SIOCGIFADDR:
+ case SIOCGIFBRDADDR:
+ case SIOCGIFDSTADDR:
+ case SIOCGIFFLAGS:
+ case SIOCGIFHWADDR:
+ case SIOCGIFINDEX:
+ case SIOCGIFMAP:
+ case SIOCGIFMETRIC:
+ case SIOCGIFMTU:
+ case SIOCGIFNAME:
+ case SIOCGIFNETMASK:
+ case SIOCGIFSLAVE:
+ case SIOCGIFTXQLEN:
+ if (entering(tcp)) {
+ tprints(", ");
+ if (umove_or_printaddr(tcp, arg, &ifr))
+ break;
+
+ if (SIOCGIFNAME == code) {
+ tprint_struct_begin();
+ PRINT_FIELD_D(ifr, ifr_ifindex);
+ } else {
+ tprint_struct_begin();
+ PRINT_FIELD_CSTRING(ifr, ifr_name);
+ }
+ return 0;
+ } else {
+ if (!syserror(tcp) && !umove(tcp, arg, &ifr)) {
+ tprints(", ");
+ print_ifreq(tcp, code, arg, &ifr);
+ }
+ tprint_struct_end();
+ break;
+ }
+
+ case SIOCADDDLCI:
+ case SIOCADDRT:
+ case SIOCBONDCHANGEACTIVE:
+ case SIOCBONDENSLAVE:
+ case SIOCBONDINFOQUERY:
+ case SIOCBONDRELEASE:
+ case SIOCBONDSETHWADDR:
+ case SIOCBONDSLAVEINFOQUERY:
+ case SIOCDARP:
+ case SIOCDELDLCI:
+ case SIOCDELRT:
+ case SIOCDIFADDR:
+ case SIOCDRARP:
+ case SIOCETHTOOL:
+ case SIOCGARP:
+#ifdef SIOCGHWTSTAMP
+ case SIOCGHWTSTAMP:
+#endif
+ case SIOCGIFBR:
+ case SIOCGIFCOUNT:
+ case SIOCGIFMEM:
+ case SIOCGIFPFLAGS:
+ case SIOCGIFVLAN:
+ case SIOCGMIIPHY:
+ case SIOCGMIIREG:
+ case SIOCGRARP:
+#ifdef SIOCGSKNS
+ case SIOCGSKNS:
+#endif
+#ifdef SIOCGSTAMP_OLD
+ case SIOCGSTAMP_OLD:
+#endif
+#ifdef SIOCGSTAMP_NEW
+ case SIOCGSTAMP_NEW:
+#endif
+#ifdef SIOCGSTAMPNS_OLD
+ case SIOCGSTAMPNS_OLD:
+#endif
+#ifdef SIOCGSTAMPNS_NEW
+ case SIOCGSTAMPNS_NEW:
+#endif
+ case SIOCRTMSG:
+ case SIOCSARP:
+#ifdef SIOCSHWTSTAMP
+ case SIOCSHWTSTAMP:
+#endif
+ case SIOCSIFBR:
+ case SIOCSIFLINK:
+ case SIOCSIFMEM:
+ case SIOCSIFPFLAGS:
+ case SIOCSIFVLAN:
+ case SIOCSMIIREG:
+ case SIOCSRARP:
+ case SIOCWANDEV:
+ tprints(", ");
+ printaddr(arg);
+ break;
+
+ default:
+ return RVAL_DECODED;
+ }
+
+ return RVAL_IOCTL_DECODED;
+}
diff --git a/src/sockaddr.c b/src/sockaddr.c
new file mode 100644
index 000000000..62bc1c18d
--- /dev/null
+++ b/src/sockaddr.c
@@ -0,0 +1,745 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1996-2000 Wichert Akkerman <wichert@cistron.nl>
+ * Copyright (c) 2005-2016 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2016-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#include <sys/socket.h>
+#include <sys/un.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+
+#include "netlink.h"
+#include <linux/ax25.h>
+#include <linux/if_packet.h>
+#include <linux/if_arp.h>
+#include <linux/if_ether.h>
+#include <linux/x25.h>
+
+#ifdef HAVE_NETIPX_IPX_H
+# include <netipx/ipx.h>
+#else
+# include <linux/ipx.h>
+#endif
+
+#include "xlat/addrfams.h"
+#include "xlat/arp_hardware_types.h"
+#include "xlat/ethernet_protocols.h"
+#include "xlat/af_packet_types.h"
+
+#include "xlat/bdaddr_types.h"
+#include "xlat/bluetooth_l2_cid.h"
+#include "xlat/bluetooth_l2_psm.h"
+#include "xlat/hci_channels.h"
+
+#define SIZEOF_SA_FAMILY sizeof_field(struct sockaddr, sa_family)
+
+const size_t arp_hardware_types_size = ARRAY_SIZE(arp_hardware_types) - 1;
+const size_t ethernet_protocols_size = ARRAY_SIZE(ethernet_protocols) - 1;
+
+static void
+print_sockaddr_data_un(struct tcb *tcp, const void *const buf, const int addrlen)
+{
+ const struct sockaddr_un *const sa_un = buf;
+ const int un_len = addrlen > (int) sizeof(*sa_un)
+ ? (int) sizeof(*sa_un) : addrlen;
+ const int path_len = un_len - SIZEOF_SA_FAMILY;
+
+ tprints_field_name("sun_path");
+ if (sa_un->sun_path[0]) {
+ print_quoted_string(sa_un->sun_path, path_len + 1,
+ QUOTE_0_TERMINATED);
+ } else {
+ tprints("@");
+ print_quoted_string(sa_un->sun_path + 1, path_len - 1, 0);
+ }
+}
+
+bool
+print_inet_addr(const int af,
+ const void *const addr,
+ const unsigned int len,
+ const char *const var_name)
+{
+ char buf[INET6_ADDRSTRLEN];
+
+ switch (af) {
+ case AF_INET:
+ if (inet_ntop(af, addr, buf, sizeof(buf))) {
+ if (var_name)
+ tprints_field_name(var_name);
+
+ if (xlat_verbose(xlat_verbosity) != XLAT_STYLE_ABBREV)
+ print_quoted_string((const char*) addr,
+ len, QUOTE_FORCE_HEX);
+
+ if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_RAW)
+ return true;
+
+ if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE)
+ tprints(" /* ");
+
+ tprintf("inet_addr(\"%s\")", buf);
+
+ if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE)
+ tprints(" */");
+
+ return true;
+ }
+ break;
+ case AF_INET6:
+ if (inet_ntop(af, addr, buf, sizeof(buf))) {
+ if (xlat_verbose(xlat_verbosity) != XLAT_STYLE_ABBREV) {
+ if (var_name)
+ tprints_field_name(var_name);
+ print_quoted_string(addr, len, QUOTE_FORCE_HEX);
+ }
+
+ if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_RAW)
+ return true;
+
+ if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE)
+ tprints(" /* ");
+
+ if (var_name &&
+ (xlat_verbose(xlat_verbosity) == XLAT_STYLE_ABBREV))
+ tprintf("inet_pton(%s, \"%s\", &%s)",
+ "AF_INET6", buf, var_name);
+ else
+ tprintf("inet_pton(%s, \"%s\")",
+ "AF_INET6", buf);
+
+ if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE)
+ tprints(" */");
+
+ return true;
+ }
+ break;
+ }
+
+ if (var_name)
+ tprints_field_name(var_name);
+ print_quoted_string(addr, len, QUOTE_FORCE_HEX);
+ return false;
+}
+
+bool
+decode_inet_addr(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const unsigned int len,
+ const int family,
+ const char *const var_name)
+{
+ union {
+ struct in_addr a4;
+ struct in6_addr a6;
+ } addrbuf;
+ size_t size = 0;
+
+ switch (family) {
+ case AF_INET:
+ size = sizeof(addrbuf.a4);
+ break;
+ case AF_INET6:
+ size = sizeof(addrbuf.a6);
+ break;
+ }
+
+ if (!size || len < size) {
+ if (var_name)
+ tprints_field_name(var_name);
+ printstr_ex(tcp, addr, len, QUOTE_FORCE_HEX);
+ return false;
+ }
+
+ if (umoven(tcp, addr, size, &addrbuf) < 0) {
+ if (var_name)
+ tprints_field_name(var_name);
+ printaddr(addr);
+ return false;
+ }
+
+ return print_inet_addr(family, &addrbuf, size, var_name);
+}
+
+static void
+print_sockaddr_data_in(struct tcb *tcp, const void *const buf,
+ const int addrlen)
+{
+ const struct sockaddr_in *const sa_in = buf;
+
+ PRINT_FIELD_NET_PORT(*sa_in, sin_port);
+ tprint_struct_next();
+ PRINT_FIELD_INET_ADDR(*sa_in, sin_addr, AF_INET);
+}
+
+#define SIN6_MIN_LEN offsetof(struct sockaddr_in6, sin6_scope_id)
+
+static void
+print_sockaddr_data_in6(struct tcb *tcp, const void *const buf,
+ const int addrlen)
+{
+ const struct sockaddr_in6 *const sa_in6 = buf;
+
+ PRINT_FIELD_NET_PORT(*sa_in6, sin6_port);
+ tprint_struct_next();
+ tprints_field_name("sin6_flowinfo");
+ if (xlat_verbose(xlat_verbosity) != XLAT_STYLE_ABBREV)
+ print_quoted_string((const char*) &sa_in6->sin6_flowinfo,
+ sizeof(sa_in6->sin6_flowinfo),
+ QUOTE_FORCE_HEX);
+
+ if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE)
+ tprintf(" /* htonl(%u) */", ntohl(sa_in6->sin6_flowinfo));
+
+ if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_ABBREV)
+ tprintf("htonl(%u)", ntohl(sa_in6->sin6_flowinfo));
+
+ tprint_struct_next();
+ PRINT_FIELD_INET_ADDR(*sa_in6, sin6_addr, AF_INET6);
+ if (addrlen <= (int) SIN6_MIN_LEN)
+ return;
+
+#if defined IN6_IS_ADDR_LINKLOCAL && defined IN6_IS_ADDR_MC_LINKLOCAL
+ if (IN6_IS_ADDR_LINKLOCAL(&sa_in6->sin6_addr)
+ || IN6_IS_ADDR_MC_LINKLOCAL(&sa_in6->sin6_addr)) {
+ tprint_struct_next();
+ PRINT_FIELD_IFINDEX(*sa_in6, sin6_scope_id);
+ } else
+#endif
+ {
+ tprint_struct_next();
+ PRINT_FIELD_U(*sa_in6, sin6_scope_id);
+ }
+}
+
+/**
+ * Check that we can print an AX.25 address in its native form, otherwise it
+ * makes sense to print it in raw also (or in raw only).
+ */
+enum xlat_style
+check_ax25_address(const ax25_address *addr)
+{
+ enum xlat_style ret = XLAT_STYLE_DEFAULT;
+ bool space_seen = false;
+ bool char_seen = false;
+
+ for (size_t i = 0; i < ARRAY_SIZE(addr->ax25_call) - 1; i++) {
+ unsigned char c = addr->ax25_call[i];
+
+ /* The lowest bit should be zero */
+ if (c & 1)
+ ret = XLAT_STYLE_VERBOSE;
+
+ c >>= 1;
+
+ if (c == ' ')
+ space_seen = true;
+ else
+ char_seen = true;
+
+ /* Sane address contains only numbers and uppercase letters */
+ if ((c < '0' || c > '9') && (c < 'A' || c > 'Z') && c != ' ')
+ ret = XLAT_STYLE_VERBOSE;
+ if (c != ' ' && space_seen)
+ ret = XLAT_STYLE_VERBOSE;
+
+ /* non-printable chars */
+ if (c < ' ' || c > 0x7e
+ /* characters used for printing comments */
+ || c == '*' || c == '/')
+ return XLAT_STYLE_RAW;
+ }
+
+ if (addr->ax25_call[ARRAY_SIZE(addr->ax25_call) - 1] & ~0x1e)
+ ret = XLAT_STYLE_VERBOSE;
+
+ if (!char_seen && addr->ax25_call[ARRAY_SIZE(addr->ax25_call) - 1])
+ ret = XLAT_STYLE_VERBOSE;
+
+ return ret;
+}
+
+/** Convert a (presumably) valid AX.25 to a string */
+static const char *
+ax25_addr2str(const ax25_address *addr)
+{
+ static char buf[ARRAY_SIZE(addr->ax25_call) + sizeof("-15")];
+ char *p = buf;
+ size_t end;
+
+ for (end = ARRAY_SIZE(addr->ax25_call) - 1; end; end--)
+ if ((addr->ax25_call[end - 1] >> 1) != ' ')
+ break;
+
+ for (size_t i = 0; i < end; i++)
+ *p++ = ((unsigned char) addr->ax25_call[i]) >> 1;
+
+ *p++ = '-';
+
+ unsigned char ssid = (addr->ax25_call[ARRAY_SIZE(addr->ax25_call) - 1]
+ >> 1) & 0xf;
+
+ if (ssid > 9) {
+ *p++ = '1';
+ ssid -= 10;
+ }
+
+ *p++ = ssid + '0';
+ *p = '\0';
+
+ if (buf[0] == '-' && buf[1] == '0')
+ return "*";
+
+ return buf;
+}
+
+static void
+print_ax25_addr_raw(const ax25_address *addr)
+{
+ tprint_struct_begin();
+ PRINT_FIELD_HEX_ARRAY(*addr, ax25_call);
+ tprint_struct_end();
+}
+
+void
+print_ax25_addr(const void /* ax25_address */ *addr_void)
+{
+ const ax25_address *addr = addr_void;
+ enum xlat_style xs = check_ax25_address(addr);
+
+ if (xs == XLAT_STYLE_DEFAULT)
+ xs = xlat_verbose(xlat_verbosity);
+
+ if (xs != XLAT_STYLE_ABBREV)
+ print_ax25_addr_raw(addr);
+
+ if (xs == XLAT_STYLE_RAW)
+ return;
+
+ const char *addr_str = ax25_addr2str(addr);
+
+ (xs == XLAT_STYLE_VERBOSE ? tprints_comment : tprints)(addr_str);
+}
+
+static void
+print_sockaddr_data_ax25(struct tcb *tcp, const void *const buf,
+ const int addrlen)
+{
+ const struct full_sockaddr_ax25 *const sax25 = buf;
+ size_t addrlen_us = MAX(addrlen, 0);
+ bool full = sax25->fsa_ax25.sax25_ndigis ||
+ (addrlen_us > sizeof(struct sockaddr_ax25));
+
+ if (full) {
+ tprints_field_name("fsa_ax25");
+ tprint_struct_begin();
+ }
+
+ PRINT_FIELD_OBJ_PTR(sax25->fsa_ax25, sax25_call, print_ax25_addr);
+ tprint_struct_next();
+ PRINT_FIELD_D(sax25->fsa_ax25, sax25_ndigis);
+
+ if (!full)
+ return;
+
+ tprint_struct_end();
+
+ size_t has_digis = MIN((addrlen_us - sizeof(sax25->fsa_ax25))
+ / sizeof(sax25->fsa_digipeater[0]),
+ ARRAY_SIZE(sax25->fsa_digipeater));
+ size_t want_digis = MIN(
+ (unsigned int) MAX(sax25->fsa_ax25.sax25_ndigis, 0),
+ ARRAY_SIZE(sax25->fsa_digipeater));
+ size_t digis = MIN(has_digis, want_digis);
+
+ if (want_digis == 0)
+ goto digis_end;
+
+ tprint_struct_next();
+ tprints_field_name("fsa_digipeater");
+ tprints("[");
+ for (size_t i = 0; i < digis; i++) {
+ if (i)
+ tprints(", ");
+
+ print_ax25_addr(sax25->fsa_digipeater + i);
+ }
+
+ if (want_digis > has_digis)
+ tprintf("%s/* ??? */", digis ? ", " : "");
+
+ tprints("]");
+
+digis_end:
+ if (addrlen_us > (has_digis * sizeof(sax25->fsa_digipeater[0])
+ + sizeof(sax25->fsa_ax25))) {
+ tprints(", ");
+ tprint_more_data_follows();
+ }
+}
+
+static void
+print_sockaddr_data_ipx(struct tcb *tcp, const void *const buf,
+ const int addrlen)
+{
+ const struct sockaddr_ipx *const sa_ipx = buf;
+
+ PRINT_FIELD_NET_PORT(*sa_ipx, sipx_port);
+ tprint_struct_next();
+ tprints_field_name("sipx_network");
+ tprintf("htonl(%#08x)", ntohl(sa_ipx->sipx_network));
+ tprint_struct_next();
+ PRINT_FIELD_UINT_ARRAY(*sa_ipx, sipx_node, "%#02llx");
+ tprint_struct_next();
+ PRINT_FIELD_0X(*sa_ipx, sipx_type);
+}
+
+void
+print_x25_addr(const void /* struct x25_address */ *addr_void)
+{
+ const struct x25_address *addr = addr_void;
+
+ tprint_struct_begin();
+ PRINT_FIELD_CSTRING(*addr, x25_addr);
+ tprint_struct_end();
+}
+
+static void
+print_sockaddr_data_x25(struct tcb *tcp, const void *const buf,
+ const int addrlen)
+{
+ const struct sockaddr_x25 *const sa_x25 = buf;
+
+ PRINT_FIELD_OBJ_PTR(*sa_x25, sx25_addr, print_x25_addr);
+}
+
+static void
+print_sockaddr_data_nl(struct tcb *tcp, const void *const buf, const int addrlen)
+{
+ const struct sockaddr_nl *const sa_nl = buf;
+
+ PRINT_FIELD_TGID(*sa_nl, nl_pid, tcp);
+ tprint_struct_next();
+ PRINT_FIELD_0X(*sa_nl, nl_groups);
+}
+
+static void
+print_sll_protocol(const struct sockaddr_ll *const sa_ll)
+{
+ int x_style = xlat_verbose(xlat_verbosity);
+
+ tprints_field_name("sll_protocol");
+ if (x_style != XLAT_STYLE_ABBREV)
+ print_quoted_string((const char *) &sa_ll->sll_protocol,
+ sizeof(sa_ll->sll_protocol),
+ QUOTE_FORCE_HEX);
+
+ if (x_style == XLAT_STYLE_RAW)
+ return;
+
+ if (x_style == XLAT_STYLE_VERBOSE)
+ tprints(" /* ");
+
+ tprints("htons(");
+ printxval_ex(ethernet_protocols, ntohs(sa_ll->sll_protocol),
+ "ETH_P_???", XLAT_STYLE_ABBREV);
+ tprints(")");
+
+ if (x_style == XLAT_STYLE_VERBOSE)
+ tprints(" */");
+}
+
+static void
+print_sockaddr_data_ll(struct tcb *tcp, const void *const buf,
+ const int addrlen)
+{
+ const struct sockaddr_ll *const sa_ll = buf;
+
+ print_sll_protocol(sa_ll);
+ tprint_struct_next();
+ PRINT_FIELD_IFINDEX(*sa_ll, sll_ifindex);
+ tprint_struct_next();
+ PRINT_FIELD_XVAL(*sa_ll, sll_hatype, arp_hardware_types, "ARPHRD_???");
+ tprint_struct_next();
+ PRINT_FIELD_XVAL(*sa_ll, sll_pkttype, af_packet_types, "PACKET_???");
+ tprint_struct_next();
+ PRINT_FIELD_U(*sa_ll, sll_halen);
+ if (sa_ll->sll_halen) {
+ const unsigned int oob_halen =
+ addrlen - offsetof(struct sockaddr_ll, sll_addr);
+ unsigned int i;
+
+ tprint_struct_next();
+ tprints_field_name("sll_addr");
+ tprints("[");
+ for (i = 0; i < sa_ll->sll_halen; ++i) {
+ if (i)
+ tprints(", ");
+ if (i >= oob_halen) {
+ tprint_more_data_follows();
+ break;
+ }
+ tprintf("%#02x", sa_ll->sll_addr[i]);
+ }
+ tprints("]");
+ }
+}
+
+static void
+print_sockaddr_data_raw(const void *const buf, const int addrlen)
+{
+ const char *const data = buf + SIZEOF_SA_FAMILY;
+ const int datalen = addrlen - SIZEOF_SA_FAMILY;
+
+ tprints_field_name("sa_data");
+ print_quoted_string(data, datalen, 0);
+}
+
+static uint16_t
+btohs(uint16_t val)
+{
+#ifdef WORDS_BIGENDIAN
+ return (val << 8) | (val >> 8);
+#else
+ return val;
+#endif
+}
+
+static void
+print_bluetooth_l2_psm(uint16_t psm)
+{
+ const uint16_t psm_he = btohs(psm);
+ const char *psm_name = xlookup(bluetooth_l2_psm, psm_he);
+ const bool psm_str = psm_name || (psm_he >= L2CAP_PSM_LE_DYN_START
+ && psm_he <= L2CAP_PSM_LE_DYN_END)
+ || (psm_he >= L2CAP_PSM_DYN_START);
+
+ tprints("htobs(");
+
+ if (xlat_verbose(xlat_verbosity) != XLAT_STYLE_ABBREV || !psm_str)
+ tprintf("%#x", psm_he);
+
+ if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_RAW)
+ goto print_bluetooth_l2_psm_end;
+
+ if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE || !psm_str)
+ tprints(" /* ");
+
+ if (psm_name) {
+ tprints(psm_name);
+ } else if (psm_he >= L2CAP_PSM_LE_DYN_START
+ && psm_he <= L2CAP_PSM_LE_DYN_END) {
+ print_xlat(L2CAP_PSM_LE_DYN_START);
+ tprintf(" + %u", psm_he - L2CAP_PSM_LE_DYN_START);
+ } else if (psm_he >= L2CAP_PSM_DYN_START) {
+ print_xlat(L2CAP_PSM_DYN_START);
+ tprintf(" + %u", psm_he - L2CAP_PSM_DYN_START);
+ } else {
+ tprints("L2CAP_PSM_???");
+ }
+
+ if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE || !psm_str)
+ tprints(" */");
+
+print_bluetooth_l2_psm_end:
+ tprints(")");
+}
+
+static void
+print_bluetooth_l2_cid(uint16_t cid)
+{
+ const uint16_t cid_he = btohs(cid);
+ const char *cid_name = xlookup(bluetooth_l2_cid, cid_he);
+ const bool cid_str = cid_name || (cid_he >= L2CAP_CID_DYN_START);
+
+ tprints("htobs(");
+
+ if (xlat_verbose(xlat_verbosity) != XLAT_STYLE_ABBREV || !cid_str)
+ tprintf("%#x", cid_he);
+
+ if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_RAW)
+ goto print_bluetooth_l2_cid_end;
+
+ if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE || !cid_str)
+ tprints(" /* ");
+
+ if (cid_name) {
+ tprints(cid_name);
+ } else if (cid_he >= L2CAP_CID_DYN_START) {
+ print_xlat(L2CAP_CID_DYN_START);
+ tprintf(" + %u", cid_he - L2CAP_CID_DYN_START);
+ } else {
+ tprints("L2CAP_CID_???");
+ }
+
+ if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE || !cid_str)
+ tprints(" */");
+
+print_bluetooth_l2_cid_end:
+ tprints(")");
+}
+
+static void
+print_sockaddr_data_bt(struct tcb *tcp, const void *const buf,
+ const int addrlen)
+{
+ struct sockaddr_hci {
+ /* sa_family_t */ uint16_t hci_family;
+ uint16_t hci_dev;
+ uint16_t hci_channel;
+ };
+
+ struct bdaddr {
+ uint8_t b[6];
+ } ATTRIBUTE_PACKED;
+
+ struct sockaddr_sco {
+ /* sa_family_t */ uint16_t sco_family;
+ struct bdaddr sco_bdaddr;
+ };
+
+ struct sockaddr_rc {
+ /* sa_family_t */ uint16_t rc_family;
+ struct bdaddr rc_bdaddr;
+ uint8_t rc_channel;
+ };
+
+ struct sockaddr_l2 {
+ /* sa_family_t */ uint16_t l2_family;
+ /* little endian */ uint16_t l2_psm;
+ struct bdaddr l2_bdaddr;
+ /* little endian */ uint16_t l2_cid;
+ uint8_t l2_bdaddr_type;
+ };
+
+ switch (addrlen) {
+ case offsetofend(struct sockaddr_hci, hci_dev):
+ case sizeof(struct sockaddr_hci): {
+ const struct sockaddr_hci *const hci = buf;
+ tprints_field_name("hci_dev");
+ tprintf("htobs(%hu)", btohs(hci->hci_dev));
+
+ /*
+ * hci_channel field has been introduced
+ * Linux commit in v2.6.38-rc1~476^2~14^2~3^2~43^2~9.
+ */
+ if (addrlen == sizeof(struct sockaddr_hci)) {
+ tprint_struct_next();
+ PRINT_FIELD_XVAL(*hci, hci_channel, hci_channels,
+ "HCI_CHANNEL_???");
+ }
+
+ break;
+ }
+ case sizeof(struct sockaddr_sco): {
+ const struct sockaddr_sco *const sco = buf;
+ print_mac_addr("sco_bdaddr=", sco->sco_bdaddr.b,
+ sizeof(sco->sco_bdaddr.b));
+ break;
+ }
+ case sizeof(struct sockaddr_rc): {
+ const struct sockaddr_rc *const rc = buf;
+ print_mac_addr("rc_bdaddr=", rc->rc_bdaddr.b,
+ sizeof(rc->rc_bdaddr.b));
+ tprint_struct_next();
+ PRINT_FIELD_U(*rc, rc_channel);
+ break;
+ }
+ case offsetof(struct sockaddr_l2, l2_bdaddr_type):
+ case sizeof(struct sockaddr_l2): {
+ const struct sockaddr_l2 *const l2 = buf;
+ PRINT_FIELD_OBJ_VAL(*l2, l2_psm, print_bluetooth_l2_psm);
+ print_mac_addr(", l2_bdaddr=", l2->l2_bdaddr.b,
+ sizeof(l2->l2_bdaddr.b));
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_VAL(*l2, l2_cid, print_bluetooth_l2_cid);
+
+ if (addrlen == sizeof(struct sockaddr_l2)) {
+ tprint_struct_next();
+ PRINT_FIELD_XVAL(*l2, l2_bdaddr_type,
+ bdaddr_types, "BDADDR_???");
+ }
+
+ break;
+ }
+ default:
+ print_sockaddr_data_raw(buf, addrlen);
+ break;
+ }
+}
+
+typedef void (* const sockaddr_printer)(struct tcb *tcp, const void *const, const int);
+
+static const struct {
+ const sockaddr_printer printer;
+ const int min_len;
+} sa_printers[] = {
+ [AF_UNIX] = { print_sockaddr_data_un, SIZEOF_SA_FAMILY + 1 },
+ [AF_INET] = { print_sockaddr_data_in, sizeof(struct sockaddr_in) },
+ [AF_AX25] = { print_sockaddr_data_ax25, sizeof(struct sockaddr_ax25) },
+ [AF_IPX] = { print_sockaddr_data_ipx, sizeof(struct sockaddr_ipx) },
+ [AF_X25] = { print_sockaddr_data_x25, sizeof(struct sockaddr_x25) },
+ [AF_INET6] = { print_sockaddr_data_in6, SIN6_MIN_LEN },
+ [AF_NETLINK] = { print_sockaddr_data_nl, SIZEOF_SA_FAMILY + 1 },
+ [AF_PACKET] = { print_sockaddr_data_ll, sizeof(struct sockaddr_ll) },
+ [AF_BLUETOOTH] = { print_sockaddr_data_bt, SIZEOF_SA_FAMILY + 1 },
+};
+
+void
+print_sockaddr(struct tcb *tcp, const void *const buf, const int addrlen)
+{
+ const struct sockaddr *const sa = buf;
+
+ tprint_struct_begin();
+ PRINT_FIELD_XVAL(*sa, sa_family, addrfams, "AF_???");
+
+ if (addrlen > (int) SIZEOF_SA_FAMILY) {
+ tprints(", ");
+
+ if (sa->sa_family < ARRAY_SIZE(sa_printers)
+ && sa_printers[sa->sa_family].printer
+ && addrlen >= sa_printers[sa->sa_family].min_len) {
+ sa_printers[sa->sa_family].printer(tcp, buf, addrlen);
+ } else {
+ print_sockaddr_data_raw(buf, addrlen);
+ }
+ }
+
+ tprint_struct_end();
+}
+
+int
+decode_sockaddr(struct tcb *const tcp, const kernel_ulong_t addr, int addrlen)
+{
+ if (addrlen < 2) {
+ printaddr(addr);
+ return -1;
+ }
+
+ union {
+ struct sockaddr sa;
+ struct sockaddr_storage storage;
+ char pad[sizeof(struct sockaddr_storage) + 1];
+ } addrbuf;
+
+ if ((unsigned) addrlen > sizeof(addrbuf.storage))
+ addrlen = sizeof(addrbuf.storage);
+
+ if (umoven_or_printaddr(tcp, addr, addrlen, addrbuf.pad))
+ return -1;
+
+ memset(&addrbuf.pad[addrlen], 0, sizeof(addrbuf.pad) - addrlen);
+
+ print_sockaddr(tcp, &addrbuf, addrlen);
+
+ return addrbuf.sa.sa_family;
+}
diff --git a/src/socketcall.c b/src/socketcall.c
new file mode 100644
index 000000000..cb0197a3f
--- /dev/null
+++ b/src/socketcall.c
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2016 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2016-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include "xlat/socketcalls.h"
+
+SYS_FUNC(socketcall)
+{
+ printxval_d(socketcalls, tcp->u_arg[0], NULL);
+ tprints(", ");
+ printaddr(tcp->u_arg[1]);
+
+ return RVAL_DECODED;
+}
diff --git a/src/socketutils.c b/src/socketutils.c
new file mode 100644
index 000000000..0c0f38319
--- /dev/null
+++ b/src/socketutils.c
@@ -0,0 +1,669 @@
+/*
+ * Copyright (c) 2014 Zubin Mithra <zubin.mithra@gmail.com>
+ * Copyright (c) 2014-2016 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2014-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include <netinet/in.h>
+#include <sys/socket.h>
+#include <arpa/inet.h>
+#include "netlink.h"
+#include <linux/sock_diag.h>
+#include <linux/inet_diag.h>
+#include <linux/unix_diag.h>
+#include <linux/netlink_diag.h>
+#include <linux/rtnetlink.h>
+#include <linux/genetlink.h>
+
+#include <sys/un.h>
+#ifndef UNIX_PATH_MAX
+# define UNIX_PATH_MAX sizeof_field(struct sockaddr_un, sun_path)
+#endif
+
+#include "xstring.h"
+
+#define XLAT_MACROS_ONLY
+#include "xlat/inet_protocols.h"
+#undef XLAT_MACROS_ONLY
+
+typedef struct {
+ unsigned long inode;
+ char *details;
+} cache_entry;
+
+#define CACHE_SIZE 1024U
+static cache_entry cache[CACHE_SIZE];
+#define CACHE_MASK (CACHE_SIZE - 1)
+
+static int
+cache_inode_details(const unsigned long inode, char *const details)
+{
+ cache_entry *e = &cache[inode & CACHE_MASK];
+ free(e->details);
+ e->inode = inode;
+ e->details = details;
+
+ return 1;
+}
+
+static const char *
+get_sockaddr_by_inode_cached(const unsigned long inode)
+{
+ const cache_entry *const e = &cache[inode & CACHE_MASK];
+ return (e && inode == e->inode) ? e->details : NULL;
+}
+
+static bool
+print_sockaddr_by_inode_cached(const unsigned long inode)
+{
+ const char *const details = get_sockaddr_by_inode_cached(inode);
+ if (details) {
+ tprints(details);
+ return true;
+ }
+ return false;
+}
+
+static bool
+send_query(struct tcb *tcp, const int fd, void *req, size_t req_size)
+{
+ struct sockaddr_nl nladdr = {
+ .nl_family = AF_NETLINK
+ };
+ struct iovec iov = {
+ .iov_base = req,
+ .iov_len = req_size
+ };
+ const struct msghdr msg = {
+ .msg_name = &nladdr,
+ .msg_namelen = sizeof(nladdr),
+ .msg_iov = &iov,
+ .msg_iovlen = 1
+ };
+
+ for (;;) {
+ if (sendmsg(fd, &msg, 0) < 0) {
+ if (errno == EINTR)
+ continue;
+ return false;
+ }
+ return true;
+ }
+}
+
+static bool
+inet_send_query(struct tcb *tcp, const int fd, const int family,
+ const int proto)
+{
+ struct {
+ const struct nlmsghdr nlh;
+ const struct inet_diag_req_v2 idr;
+ } req = {
+ .nlh = {
+ .nlmsg_len = sizeof(req),
+ .nlmsg_type = SOCK_DIAG_BY_FAMILY,
+ .nlmsg_flags = NLM_F_DUMP | NLM_F_REQUEST
+ },
+ .idr = {
+ .sdiag_family = family,
+ .sdiag_protocol = proto,
+ .idiag_states = -1
+ }
+ };
+ return send_query(tcp, fd, &req, sizeof(req));
+}
+
+static int
+inet_parse_response(const void *const data, const int data_len,
+ const unsigned long inode, void *opaque_data)
+{
+ const char *const proto_name = opaque_data;
+ const struct inet_diag_msg *const diag_msg = data;
+ static const char zero_addr[sizeof(struct in6_addr)];
+ socklen_t addr_size, text_size;
+
+ if (data_len < (int) NLMSG_LENGTH(sizeof(*diag_msg)))
+ return -1;
+ if (diag_msg->idiag_inode != inode)
+ return 0;
+
+ switch (diag_msg->idiag_family) {
+ case AF_INET:
+ addr_size = sizeof(struct in_addr);
+ text_size = INET_ADDRSTRLEN;
+ break;
+ case AF_INET6:
+ addr_size = sizeof(struct in6_addr);
+ text_size = INET6_ADDRSTRLEN;
+ break;
+ default:
+ return -1;
+ }
+
+ char src_buf[text_size];
+ char *details;
+
+ /* open/closing brackets for IPv6 addresses */
+ const char *ob = diag_msg->idiag_family == AF_INET6 ? "[" : "";
+ const char *cb = diag_msg->idiag_family == AF_INET6 ? "]" : "";
+
+ if (!inet_ntop(diag_msg->idiag_family, diag_msg->id.idiag_src,
+ src_buf, text_size))
+ return -1;
+
+ if (diag_msg->id.idiag_dport ||
+ memcmp(zero_addr, diag_msg->id.idiag_dst, addr_size)) {
+ char dst_buf[text_size];
+
+ if (!inet_ntop(diag_msg->idiag_family, diag_msg->id.idiag_dst,
+ dst_buf, text_size))
+ return -1;
+
+ if (asprintf(&details, "%s:[%s%s%s:%u->%s%s%s:%u]", proto_name,
+ ob, src_buf, cb, ntohs(diag_msg->id.idiag_sport),
+ ob, dst_buf, cb, ntohs(diag_msg->id.idiag_dport))
+ < 0)
+ return false;
+ } else {
+ if (asprintf(&details, "%s:[%s%s%s:%u]",
+ proto_name, ob, src_buf, cb,
+ ntohs(diag_msg->id.idiag_sport)) < 0)
+ return false;
+ }
+
+ return cache_inode_details(inode, details);
+}
+
+static bool
+receive_responses(struct tcb *tcp, const int fd, const unsigned long inode,
+ const unsigned long expected_msg_type,
+ int (*parser)(const void *, int,
+ unsigned long, void *),
+ void *opaque_data)
+{
+ static union {
+ struct nlmsghdr hdr;
+ long buf[8192 / sizeof(long)];
+ } hdr_buf;
+
+ struct sockaddr_nl nladdr = {
+ .nl_family = AF_NETLINK
+ };
+ struct iovec iov = {
+ .iov_base = hdr_buf.buf,
+ .iov_len = sizeof(hdr_buf.buf)
+ };
+ int flags = 0;
+
+ for (;;) {
+ struct msghdr msg = {
+ .msg_name = &nladdr,
+ .msg_namelen = sizeof(nladdr),
+ .msg_iov = &iov,
+ .msg_iovlen = 1
+ };
+
+ ssize_t ret = recvmsg(fd, &msg, flags);
+ if (ret < 0) {
+ if (errno == EINTR)
+ continue;
+ return false;
+ }
+
+ const struct nlmsghdr *h = &hdr_buf.hdr;
+ if (!is_nlmsg_ok(h, ret))
+ return false;
+ for (; is_nlmsg_ok(h, ret); h = NLMSG_NEXT(h, ret)) {
+ if (h->nlmsg_type != expected_msg_type)
+ return false;
+ const int rc = parser(NLMSG_DATA(h),
+ h->nlmsg_len, inode, opaque_data);
+ if (rc > 0)
+ return true;
+ if (rc < 0)
+ return false;
+ }
+ flags = MSG_DONTWAIT;
+ }
+}
+
+static bool
+unix_send_query(struct tcb *tcp, const int fd, const unsigned long inode)
+{
+ /*
+ * The kernel bug was fixed in mainline by commit v4.5-rc6~35^2~11
+ * and backported to stable/linux-4.4.y by commit v4.4.4~297.
+ */
+ const uint16_t dump_flag =
+ os_release < KERNEL_VERSION(4, 4, 4) ? NLM_F_DUMP : 0;
+
+ struct {
+ const struct nlmsghdr nlh;
+ const struct unix_diag_req udr;
+ } req = {
+ .nlh = {
+ .nlmsg_len = sizeof(req),
+ .nlmsg_type = SOCK_DIAG_BY_FAMILY,
+ .nlmsg_flags = NLM_F_REQUEST | dump_flag
+ },
+ .udr = {
+ .sdiag_family = AF_UNIX,
+ .udiag_ino = inode,
+ .udiag_states = -1,
+ .udiag_show = UDIAG_SHOW_NAME | UDIAG_SHOW_PEER,
+ .udiag_cookie = { ~0U, ~0U }
+ }
+ };
+ return send_query(tcp, fd, &req, sizeof(req));
+}
+
+static int
+unix_parse_response(const void *data, const int data_len,
+ const unsigned long inode, void *opaque_data)
+{
+ const char *proto_name = opaque_data;
+ const struct unix_diag_msg *diag_msg = data;
+ struct rtattr *attr;
+ int rta_len = data_len - NLMSG_LENGTH(sizeof(*diag_msg));
+ uint32_t peer = 0;
+ size_t path_len = 0;
+ char path[UNIX_PATH_MAX + 1];
+
+ if (rta_len < 0)
+ return -1;
+ if (diag_msg->udiag_ino != inode)
+ return 0;
+ if (diag_msg->udiag_family != AF_UNIX)
+ return -1;
+
+ for (attr = (struct rtattr *) (diag_msg + 1);
+ RTA_OK(attr, rta_len);
+ attr = RTA_NEXT(attr, rta_len)) {
+ switch (attr->rta_type) {
+ case UNIX_DIAG_NAME:
+ if (!path_len) {
+ path_len = RTA_PAYLOAD(attr);
+ if (path_len > UNIX_PATH_MAX)
+ path_len = UNIX_PATH_MAX;
+ memcpy(path, RTA_DATA(attr), path_len);
+ path[path_len] = '\0';
+ }
+ break;
+ case UNIX_DIAG_PEER:
+ if (RTA_PAYLOAD(attr) >= 4)
+ peer = *(uint32_t *) RTA_DATA(attr);
+ break;
+ }
+ }
+
+ /*
+ * print obtained information in the following format:
+ * "UNIX:[" SELF_INODE [ "->" PEER_INODE ][ "," SOCKET_FILE ] "]"
+ */
+ if (!peer && !path_len)
+ return -1;
+
+ char peer_str[3 + sizeof(peer) * 3];
+ if (peer)
+ xsprintf(peer_str, "->%u", peer);
+ else
+ peer_str[0] = '\0';
+
+ const char *path_str;
+ if (path_len) {
+ char *outstr = alloca(4 * path_len + 4);
+
+ outstr[0] = ',';
+ if (path[0] == '\0') {
+ outstr[1] = '@';
+ string_quote(path + 1, outstr + 2,
+ path_len - 1, QUOTE_0_TERMINATED, NULL);
+ } else {
+ string_quote(path, outstr + 1,
+ path_len, QUOTE_0_TERMINATED, NULL);
+ }
+ path_str = outstr;
+ } else {
+ path_str = "";
+ }
+
+ char *details;
+ if (asprintf(&details, "%s:[%lu%s%s]", proto_name, inode,
+ peer_str, path_str) < 0)
+ return -1;
+
+ return cache_inode_details(inode, details);
+}
+
+static bool
+netlink_send_query(struct tcb *tcp, const int fd, const unsigned long inode)
+{
+ struct {
+ const struct nlmsghdr nlh;
+ const struct netlink_diag_req ndr;
+ } req = {
+ .nlh = {
+ .nlmsg_len = sizeof(req),
+ .nlmsg_type = SOCK_DIAG_BY_FAMILY,
+ .nlmsg_flags = NLM_F_DUMP | NLM_F_REQUEST
+ },
+ .ndr = {
+ .sdiag_family = AF_NETLINK,
+ .sdiag_protocol = NDIAG_PROTO_ALL
+ }
+ };
+ return send_query(tcp, fd, &req, sizeof(req));
+}
+
+static int
+netlink_parse_response(const void *data, const int data_len,
+ const unsigned long inode, void *opaque_data)
+{
+ const char *proto_name = opaque_data;
+ const struct netlink_diag_msg *const diag_msg = data;
+ const char *netlink_proto;
+ char *details;
+
+ if (data_len < (int) NLMSG_LENGTH(sizeof(*diag_msg)))
+ return -1;
+ if (diag_msg->ndiag_ino != inode)
+ return 0;
+
+ if (diag_msg->ndiag_family != AF_NETLINK)
+ return -1;
+
+ netlink_proto = xlookup(netlink_protocols,
+ diag_msg->ndiag_protocol);
+
+ if (netlink_proto) {
+ netlink_proto = STR_STRIP_PREFIX(netlink_proto, "NETLINK_");
+ if (asprintf(&details, "%s:[%s:%u]", proto_name,
+ netlink_proto, diag_msg->ndiag_portid) < 0)
+ return -1;
+ } else {
+ if (asprintf(&details, "%s:[%u]", proto_name,
+ (unsigned) diag_msg->ndiag_protocol) < 0)
+ return -1;
+ }
+
+ return cache_inode_details(inode, details);
+}
+
+static const char *
+unix_get(struct tcb *tcp, const int fd, const int family, const int proto,
+ const unsigned long inode, const char *name)
+{
+ return unix_send_query(tcp, fd, inode)
+ && receive_responses(tcp, fd, inode, SOCK_DIAG_BY_FAMILY,
+ unix_parse_response, (void *) name)
+ ? get_sockaddr_by_inode_cached(inode) : NULL;
+}
+
+static const char *
+inet_get(struct tcb *tcp, const int fd, const int family, const int protocol,
+ const unsigned long inode, const char *proto_name)
+{
+ return inet_send_query(tcp, fd, family, protocol)
+ && receive_responses(tcp, fd, inode, SOCK_DIAG_BY_FAMILY,
+ inet_parse_response, (void *) proto_name)
+ ? get_sockaddr_by_inode_cached(inode) : NULL;
+}
+
+static const char *
+netlink_get(struct tcb *tcp, const int fd, const int family, const int protocol,
+ const unsigned long inode, const char *proto_name)
+{
+ return netlink_send_query(tcp, fd, inode)
+ && receive_responses(tcp, fd, inode, SOCK_DIAG_BY_FAMILY,
+ netlink_parse_response,
+ (void *) proto_name)
+ ? get_sockaddr_by_inode_cached(inode) : NULL;
+}
+
+static const struct {
+ const char *const name;
+ const char * (*const get)(struct tcb *, int fd, int family,
+ int protocol, unsigned long inode,
+ const char *proto_name);
+ int family;
+ int proto;
+} protocols[] = {
+ [SOCK_PROTO_UNIX] = { "UNIX", unix_get, AF_UNIX},
+ /*
+ * inet_diag handlers are currently implemented only for TCP,
+ * UDP(lite), SCTP, RAW, and DCCP, but we try to resolve it for all
+ * protocols anyway, just in case.
+ */
+ [SOCK_PROTO_TCP] =
+ { "TCP", inet_get, AF_INET, IPPROTO_TCP },
+ [SOCK_PROTO_UDP] =
+ { "UDP", inet_get, AF_INET, IPPROTO_UDP },
+ [SOCK_PROTO_UDPLITE] =
+ { "UDPLITE", inet_get, AF_INET, IPPROTO_UDPLITE },
+ [SOCK_PROTO_DCCP] =
+ { "DCCP", inet_get, AF_INET, IPPROTO_DCCP },
+ [SOCK_PROTO_SCTP] =
+ { "SCTP", inet_get, AF_INET, IPPROTO_SCTP },
+ [SOCK_PROTO_L2TP_IP] =
+ { "L2TP/IP", inet_get, AF_INET, IPPROTO_L2TP },
+ [SOCK_PROTO_PING] =
+ { "PING", inet_get, AF_INET, IPPROTO_ICMP },
+ [SOCK_PROTO_RAW] =
+ { "RAW", inet_get, AF_INET, IPPROTO_RAW },
+ [SOCK_PROTO_TCPv6] =
+ { "TCPv6", inet_get, AF_INET6, IPPROTO_TCP },
+ [SOCK_PROTO_UDPv6] =
+ { "UDPv6", inet_get, AF_INET6, IPPROTO_UDP },
+ [SOCK_PROTO_UDPLITEv6] =
+ { "UDPLITEv6", inet_get, AF_INET6, IPPROTO_UDPLITE },
+ [SOCK_PROTO_DCCPv6] =
+ { "DCCPv6", inet_get, AF_INET6, IPPROTO_DCCP },
+ [SOCK_PROTO_SCTPv6] =
+ { "SCTPv6", inet_get, AF_INET6, IPPROTO_SCTP },
+ [SOCK_PROTO_L2TP_IPv6] =
+ { "L2TP/IPv6", inet_get, AF_INET6, IPPROTO_L2TP },
+ [SOCK_PROTO_PINGv6] =
+ { "PINGv6", inet_get, AF_INET6, IPPROTO_ICMP },
+ [SOCK_PROTO_RAWv6] =
+ { "RAWv6", inet_get, AF_INET6, IPPROTO_RAW },
+ [SOCK_PROTO_NETLINK] = { "NETLINK", netlink_get, AF_NETLINK },
+};
+
+enum sock_proto
+get_proto_by_name(const char *const name)
+{
+ unsigned int i;
+ for (i = (unsigned int) SOCK_PROTO_UNKNOWN + 1;
+ i < ARRAY_SIZE(protocols); ++i) {
+ if (protocols[i].name && !strcmp(name, protocols[i].name))
+ return (enum sock_proto) i;
+ }
+ return SOCK_PROTO_UNKNOWN;
+}
+
+int
+get_family_by_proto(enum sock_proto proto)
+{
+ if ((size_t) proto < ARRAY_SIZE(protocols))
+ return protocols[proto].family;
+
+ return AF_UNSPEC;
+}
+
+static const char *
+get_sockaddr_by_inode_uncached(struct tcb *tcp, const unsigned long inode,
+ const enum sock_proto proto)
+{
+ if ((unsigned int) proto >= ARRAY_SIZE(protocols) ||
+ (proto != SOCK_PROTO_UNKNOWN && !protocols[proto].get))
+ return NULL;
+
+ const int fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_SOCK_DIAG);
+ if (fd < 0)
+ return NULL;
+ const char *details = NULL;
+
+ if (proto != SOCK_PROTO_UNKNOWN) {
+ details = protocols[proto].get(tcp, fd, protocols[proto].family,
+ protocols[proto].proto, inode,
+ protocols[proto].name);
+ } else {
+ unsigned int i;
+ for (i = (unsigned int) SOCK_PROTO_UNKNOWN + 1;
+ i < ARRAY_SIZE(protocols); ++i) {
+ if (!protocols[i].get)
+ continue;
+ details = protocols[i].get(tcp, fd,
+ protocols[proto].family,
+ protocols[proto].proto,
+ inode,
+ protocols[proto].name);
+ if (details)
+ break;
+ }
+ }
+
+ close(fd);
+ return details;
+}
+
+static bool
+print_sockaddr_by_inode_uncached(struct tcb *tcp, const unsigned long inode,
+ const enum sock_proto proto)
+{
+ const char *details = get_sockaddr_by_inode_uncached(tcp, inode, proto);
+
+ if (details) {
+ tprints(details);
+ return true;
+ }
+
+ if ((unsigned int) proto < ARRAY_SIZE(protocols) &&
+ protocols[proto].name) {
+ tprintf("%s:[%lu]", protocols[proto].name, inode);
+ return true;
+ }
+
+ return false;
+}
+
+/* Given an inode number of a socket, return its protocol details. */
+const char *
+get_sockaddr_by_inode(struct tcb *const tcp, const int fd,
+ const unsigned long inode)
+{
+ const char *details = get_sockaddr_by_inode_cached(inode);
+ return details ? details :
+ get_sockaddr_by_inode_uncached(tcp, inode, getfdproto(tcp, fd));
+}
+
+/* Given an inode number of a socket, print out its protocol details. */
+bool
+print_sockaddr_by_inode(struct tcb *const tcp, const int fd,
+ const unsigned long inode)
+{
+ return print_sockaddr_by_inode_cached(inode) ? true :
+ print_sockaddr_by_inode_uncached(tcp, inode,
+ getfdproto(tcp, fd));
+}
+
+/*
+ * Managing the cache for decoding communications of Netlink GENERIC protocol
+ *
+ * As name shown Netlink GENERIC protocol is generic protocol. The
+ * numbers of msg types used in the protocol are not defined
+ * statically. Kernel defines them on demand. So the xlat converted
+ * from header files doesn't help for decoding the protocol. Following
+ * codes are building xlat(dyxlat) at runtime.
+ */
+static bool
+genl_send_dump_families(struct tcb *tcp, const int fd)
+{
+ struct {
+ const struct nlmsghdr nlh;
+ struct genlmsghdr gnlh;
+ } req = {
+ .nlh = {
+ .nlmsg_len = sizeof(req),
+ .nlmsg_type = GENL_ID_CTRL,
+ .nlmsg_flags = NLM_F_DUMP | NLM_F_REQUEST,
+ },
+ .gnlh = {
+ .cmd = CTRL_CMD_GETFAMILY,
+ }
+ };
+ return send_query(tcp, fd, &req, sizeof(req));
+}
+
+static int
+genl_parse_families_response(const void *const data,
+ const int data_len, const unsigned long inode,
+ void *opaque_data)
+{
+ struct dyxlat *const dyxlat = opaque_data;
+ const struct genlmsghdr *const gnlh = data;
+ struct rtattr *attr;
+ int rta_len = data_len - NLMSG_LENGTH(sizeof(*gnlh));
+
+ char *name = NULL;
+ unsigned int name_len = 0;
+ uint16_t *id = NULL;
+
+ if (rta_len < 0)
+ return -1;
+ if (gnlh->cmd != CTRL_CMD_NEWFAMILY)
+ return -1;
+ if (gnlh->version != 2)
+ return -1;
+
+ for (attr = (struct rtattr *) (gnlh + 1);
+ RTA_OK(attr, rta_len);
+ attr = RTA_NEXT(attr, rta_len)) {
+ switch (attr->rta_type) {
+ case CTRL_ATTR_FAMILY_NAME:
+ if (!name) {
+ name = RTA_DATA(attr);
+ name_len = RTA_PAYLOAD(attr);
+ }
+ break;
+ case CTRL_ATTR_FAMILY_ID:
+ if (!id && RTA_PAYLOAD(attr) == sizeof(*id))
+ id = RTA_DATA(attr);
+ break;
+ }
+
+ if (name && id) {
+ dyxlat_add_pair(dyxlat, *id, name, name_len);
+ name = NULL;
+ id = NULL;
+ }
+ }
+
+ return 0;
+}
+
+const struct xlat *
+genl_families_xlat(struct tcb *tcp)
+{
+ static struct dyxlat *dyxlat;
+
+ if (!dyxlat) {
+ dyxlat = dyxlat_alloc(32);
+
+ int fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_GENERIC);
+ if (fd < 0)
+ goto out;
+
+ if (genl_send_dump_families(tcp, fd))
+ receive_responses(tcp, fd, 0, GENL_ID_CTRL,
+ genl_parse_families_response, dyxlat);
+ close(fd);
+ }
+
+out:
+ return dyxlat_get(dyxlat);
+}
diff --git a/src/sparc.c b/src/sparc.c
new file mode 100644
index 000000000..608127a86
--- /dev/null
+++ b/src/sparc.c
@@ -0,0 +1,26 @@
+/*
+ * SPARC-specific syscall decoders.
+ *
+ * Copyright (c) 2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#if defined SPARC || defined SPARC64
+
+# include "xlat/sparc_kern_features.h"
+
+SYS_FUNC(kern_features)
+{
+ if (entering(tcp) || syserror(tcp))
+ return 0;
+
+ tcp->auxstr = sprintflags("", sparc_kern_features,
+ (kernel_ulong_t) tcp->u_rval);
+ return RVAL_HEX | RVAL_STR;
+}
+
+#endif /* SPARC || SPARC64 */
diff --git a/src/sram_alloc.c b/src/sram_alloc.c
new file mode 100644
index 000000000..c18e76607
--- /dev/null
+++ b/src/sram_alloc.c
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2014-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#ifdef BFIN
+
+# include <bfin_sram.h>
+
+# include "xlat/sram_alloc_flags.h"
+
+SYS_FUNC(sram_alloc)
+{
+ /* size */
+ tprintf("%lu, ", tcp->u_arg[0]);
+ /* flags */
+ printflags64(sram_alloc_flags, tcp->u_arg[1], "???_SRAM");
+
+ return RVAL_DECODED | RVAL_HEX;
+}
+
+#endif /* BFIN */
diff --git a/src/stage_output.c b/src/stage_output.c
new file mode 100644
index 000000000..3bfbdba7d
--- /dev/null
+++ b/src/stage_output.c
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2017 Intel Corporation
+ * Copyright (c) 2019 Paul Chaignon <paul.chaignon@gmail.com>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+/*
+ * open_memstream returns a FILE stream that allows writing to a
+ * dynamically growing buffer, that can be either copied to
+ * tcp->outf (syscall successful) or dropped (syscall failed)
+ */
+
+#include "defs.h"
+
+struct staged_output_data {
+ char *memfptr;
+ size_t memfloc;
+ FILE *real_outf; /* Backup for real outf while staging */
+};
+
+FILE *
+strace_open_memstream(struct tcb *tcp)
+{
+ FILE *fp = NULL;
+
+#if HAVE_OPEN_MEMSTREAM
+ tcp->staged_output_data = xmalloc(sizeof(*tcp->staged_output_data));
+ fp = open_memstream(&tcp->staged_output_data->memfptr,
+ &tcp->staged_output_data->memfloc);
+ if (!fp)
+ perror_msg_and_die("open_memstream");
+ /*
+ * Call to fflush required to update tcp->memfptr,
+ * see open_memstream man page.
+ */
+ fflush(fp);
+
+ /* Store the FILE pointer for later restoration. */
+ tcp->staged_output_data->real_outf = tcp->outf;
+ tcp->outf = fp;
+#endif
+
+ return fp;
+}
+
+void
+strace_close_memstream(struct tcb *tcp, bool publish)
+{
+#if HAVE_OPEN_MEMSTREAM
+ if (!tcp->staged_output_data) {
+ debug_msg("memstream already closed");
+ return;
+ }
+
+ if (fclose(tcp->outf))
+ perror_msg("fclose(tcp->outf)");
+
+ tcp->outf = tcp->staged_output_data->real_outf;
+ if (tcp->staged_output_data->memfptr) {
+ if (publish)
+ fputs_unlocked(tcp->staged_output_data->memfptr,
+ tcp->outf);
+ else
+ debug_msg("syscall output dropped: %s",
+ tcp->staged_output_data->memfptr);
+
+ free(tcp->staged_output_data->memfptr);
+ tcp->staged_output_data->memfptr = NULL;
+ }
+ free(tcp->staged_output_data);
+ tcp->staged_output_data = NULL;
+#endif
+}
diff --git a/src/stat.c b/src/stat.c
new file mode 100644
index 000000000..623a1469b
--- /dev/null
+++ b/src/stat.c
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2005-2015 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2015-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include "stat.h"
+
+static void
+decode_struct_stat(struct tcb *const tcp, const kernel_ulong_t addr)
+{
+ struct strace_stat st;
+
+ if (fetch_struct_stat(tcp, addr, &st))
+ print_struct_stat(tcp, &st);
+}
+
+SYS_FUNC(stat)
+{
+ if (entering(tcp)) {
+ printpath(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ } else {
+ decode_struct_stat(tcp, tcp->u_arg[1]);
+ }
+ return 0;
+}
+
+SYS_FUNC(fstat)
+{
+ if (entering(tcp)) {
+ printfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ } else {
+ decode_struct_stat(tcp, tcp->u_arg[1]);
+ }
+ return 0;
+}
+
+SYS_FUNC(newfstatat)
+{
+ if (entering(tcp)) {
+ print_dirfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ printpath(tcp, tcp->u_arg[1]);
+ tprints(", ");
+ } else {
+ decode_struct_stat(tcp, tcp->u_arg[2]);
+ tprints(", ");
+ printflags(at_flags, tcp->u_arg[3], "AT_???");
+ }
+ return 0;
+}
diff --git a/src/stat.h b/src/stat.h
new file mode 100644
index 000000000..daebbc76f
--- /dev/null
+++ b/src/stat.h
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2016 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2016-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_STAT_H
+# define STRACE_STAT_H
+
+struct strace_stat {
+ unsigned long long dev;
+ unsigned long long ino;
+ unsigned long long rdev;
+ unsigned long long size;
+ unsigned long long blocks;
+ unsigned long long blksize;
+ unsigned long long mode;
+ unsigned long long nlink;
+ unsigned long long uid;
+ unsigned long long gid;
+ long long atime;
+ long long ctime;
+ long long mtime;
+ unsigned long long atime_nsec;
+ unsigned long long ctime_nsec;
+ unsigned long long mtime_nsec;
+ bool has_nsec;
+};
+
+#endif /* !STRACE_STAT_H */
diff --git a/src/stat64.c b/src/stat64.c
new file mode 100644
index 000000000..65993b253
--- /dev/null
+++ b/src/stat64.c
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2005-2015 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2015-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include "stat.h"
+
+static void
+decode_struct_stat64(struct tcb *const tcp, const kernel_ulong_t addr)
+{
+ struct strace_stat st;
+
+ if (fetch_struct_stat64(tcp, addr, &st))
+ print_struct_stat(tcp, &st);
+}
+
+SYS_FUNC(stat64)
+{
+ if (entering(tcp)) {
+ printpath(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ } else {
+ decode_struct_stat64(tcp, tcp->u_arg[1]);
+ }
+ return 0;
+}
+
+SYS_FUNC(fstat64)
+{
+ if (entering(tcp)) {
+ printfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ } else {
+ decode_struct_stat64(tcp, tcp->u_arg[1]);
+ }
+ return 0;
+}
+
+SYS_FUNC(fstatat64)
+{
+ if (entering(tcp)) {
+ print_dirfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ printpath(tcp, tcp->u_arg[1]);
+ tprints(", ");
+ } else {
+ decode_struct_stat64(tcp, tcp->u_arg[2]);
+ tprints(", ");
+ printflags(at_flags, tcp->u_arg[3], "AT_???");
+ }
+ return 0;
+}
diff --git a/src/statfs.c b/src/statfs.c
new file mode 100644
index 000000000..36c99a11d
--- /dev/null
+++ b/src/statfs.c
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2014-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+SYS_FUNC(statfs)
+{
+ if (entering(tcp)) {
+ printpath(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ } else {
+ print_struct_statfs(tcp, tcp->u_arg[1]);
+ }
+ return 0;
+}
diff --git a/src/statfs.h b/src/statfs.h
new file mode 100644
index 000000000..876dbcda8
--- /dev/null
+++ b/src/statfs.h
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2016-2018 Dmitry V. Levin <ldv@strace.io>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_STATFS_H
+# define STRACE_STATFS_H
+
+struct strace_statfs {
+ unsigned long long f_type;
+ unsigned long long f_bsize;
+ unsigned long long f_blocks;
+ unsigned long long f_bfree;
+ unsigned long long f_bavail;
+ unsigned long long f_files;
+ unsigned long long f_ffree;
+ struct {
+ unsigned long long val[2];
+ } f_fsid;
+ unsigned long long f_namelen;
+ unsigned long long f_frsize;
+ unsigned long long f_flags;
+};
+
+#endif /* !STRACE_STATFS_H */
diff --git a/src/statfs64.c b/src/statfs64.c
new file mode 100644
index 000000000..f42307c40
--- /dev/null
+++ b/src/statfs64.c
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2014-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+SYS_FUNC(statfs64)
+{
+ if (entering(tcp)) {
+ printpath(tcp, tcp->u_arg[0]);
+ tprintf(", %" PRI_klu ", ", tcp->u_arg[1]);
+ } else {
+ print_struct_statfs64(tcp, tcp->u_arg[2], tcp->u_arg[1]);
+ }
+ return 0;
+}
diff --git a/src/static_assert.h b/src/static_assert.h
new file mode 100644
index 000000000..349bcc7ab
--- /dev/null
+++ b/src/static_assert.h
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2018 Dmitry V. Levin <ldv@strace.io>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_STATIC_ASSERT_H
+# define STRACE_STATIC_ASSERT_H
+
+# include "assert.h"
+
+# if defined HAVE_STATIC_ASSERT
+
+/* static_assert is already available */
+
+# elif defined HAVE__STATIC_ASSERT
+
+# undef static_assert
+# define static_assert _Static_assert
+
+# else /* !HAVE_STATIC_ASSERT && !HAVE__STATIC_ASSERT */
+
+# define static_assert(expr, message) \
+ extern int (*strace_static_assert(int))[sizeof(int[2 * !!(expr) - 1])]
+
+# endif
+
+#endif /* !STRACE_STATIC_ASSERT_H */
diff --git a/src/statx.c b/src/statx.c
new file mode 100644
index 000000000..4973b0a63
--- /dev/null
+++ b/src/statx.c
@@ -0,0 +1,120 @@
+/*
+ * Copyright (c) 2017-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include "statx.h"
+
+#include <sys/stat.h>
+
+#include "xlat/statx_masks.h"
+#include "xlat/statx_attrs.h"
+#include "xlat/at_statx_sync_types.h"
+
+static void
+print_statx_timestamp(const struct_statx_timestamp *const p)
+{
+ tprint_struct_begin();
+ PRINT_FIELD_D(*p, tv_sec);
+ tprint_struct_next();
+ PRINT_FIELD_U(*p, tv_nsec);
+ tprint_struct_end();
+ tprints_comment(sprinttime_nsec(p->tv_sec,
+ zero_extend_signed_to_ull(p->tv_nsec)));
+}
+
+SYS_FUNC(statx)
+{
+ if (entering(tcp)) {
+ print_dirfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ printpath(tcp, tcp->u_arg[1]);
+ tprints(", ");
+
+ unsigned int flags = tcp->u_arg[2];
+ printflags(at_statx_sync_types, flags & AT_STATX_SYNC_TYPE,
+ NULL);
+ flags &= ~AT_STATX_SYNC_TYPE;
+ if (flags) {
+ tprints("|");
+ printflags(at_flags, flags, NULL);
+ }
+
+ tprints(", ");
+ printflags(statx_masks, tcp->u_arg[3], "STATX_???");
+ tprints(", ");
+ } else {
+ struct_statx stx;
+ if (umove_or_printaddr(tcp, tcp->u_arg[4], &stx))
+ return 0;
+
+ tprint_struct_begin();
+ PRINT_FIELD_FLAGS(stx, stx_mask, statx_masks,
+ "STATX_???");
+
+ if (!abbrev(tcp)) {
+ tprint_struct_next();
+ PRINT_FIELD_U(stx, stx_blksize);
+ }
+
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(stx, stx_attributes, statx_attrs,
+ "STATX_ATTR_???");
+
+ if (!abbrev(tcp)) {
+ tprint_struct_next();
+ PRINT_FIELD_U(stx, stx_nlink);
+ tprint_struct_next();
+ PRINT_FIELD_ID(stx, stx_uid);
+ tprint_struct_next();
+ PRINT_FIELD_ID(stx, stx_gid);
+ }
+
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_VAL(stx, stx_mode, print_symbolic_mode_t);
+
+ if (!abbrev(tcp)) {
+ tprint_struct_next();
+ PRINT_FIELD_U(stx, stx_ino);
+ }
+
+ tprint_struct_next();
+ PRINT_FIELD_U(stx, stx_size);
+
+ if (!abbrev(tcp)) {
+ tprint_struct_next();
+ PRINT_FIELD_U(stx, stx_blocks);
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(stx, stx_attributes_mask,
+ statx_attrs, "STATX_ATTR_???");
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_PTR(stx, stx_atime,
+ print_statx_timestamp);
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_PTR(stx, stx_btime,
+ print_statx_timestamp);
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_PTR(stx, stx_ctime,
+ print_statx_timestamp);
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_PTR(stx, stx_mtime,
+ print_statx_timestamp);
+ tprint_struct_next();
+ PRINT_FIELD_U(stx, stx_rdev_major);
+ tprint_struct_next();
+ PRINT_FIELD_U(stx, stx_rdev_minor);
+ tprint_struct_next();
+ PRINT_FIELD_U(stx, stx_dev_major);
+ tprint_struct_next();
+ PRINT_FIELD_U(stx, stx_dev_minor);
+ } else {
+ tprint_struct_next();
+ tprint_more_data_follows();
+ }
+ tprint_struct_end();
+ }
+ return 0;
+}
diff --git a/src/statx.h b/src/statx.h
new file mode 100644
index 000000000..1e11738bc
--- /dev/null
+++ b/src/statx.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2017-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_STATX_H
+# define STRACE_STATX_H
+
+# include <stdint.h>
+
+typedef struct {
+ int64_t tv_sec;
+ int32_t tv_nsec;
+ int32_t reserved;
+} struct_statx_timestamp;
+
+typedef struct {
+ uint32_t stx_mask; /* What results were written [uncond] */
+ uint32_t stx_blksize; /* Preferred general I/O size [uncond] */
+ uint64_t stx_attributes; /* Flags conveying information about the file
+ [uncond] */
+
+ uint32_t stx_nlink; /* Number of hard links */
+ uint32_t stx_uid; /* User ID of owner */
+ uint32_t stx_gid; /* Group ID of owner */
+ uint16_t stx_mode; /* File mode */
+ uint16_t reserved0[1];
+
+ uint64_t stx_ino; /* Inode number */
+ uint64_t stx_size; /* File size */
+ uint64_t stx_blocks; /* Number of 512-byte blocks allocated */
+ uint64_t stx_attributes_mask; /* Mask to show what's supported in
+ stx_attributes */
+
+ struct_statx_timestamp stx_atime; /* Last access time */
+ struct_statx_timestamp stx_btime; /* File creation time */
+ struct_statx_timestamp stx_ctime; /* Last attribute change time */
+ struct_statx_timestamp stx_mtime; /* Last data modification time */
+
+ uint32_t stx_rdev_major; /* Device ID of special file [if bdev/cdev] */
+ uint32_t stx_rdev_minor;
+ uint32_t stx_dev_major; /* ID of device containing file [uncond] */
+ uint32_t stx_dev_minor;
+
+ uint64_t reserved2[14]; /* Spare space for future expansion */
+} struct_statx;
+
+#endif /* !STRACE_STATX_H */
diff --git a/src/strace-graph b/src/strace-graph
new file mode 100755
index 000000000..41739a3cb
--- /dev/null
+++ b/src/strace-graph
@@ -0,0 +1,341 @@
+#!/usr/bin/perl
+
+# This script processes strace -f output. It displays a graph of invoked
+# subprocesses, and is useful for finding out what complex commands do.
+
+# You will probably want to invoke strace with -q as well, and with
+# -s 100 to get complete filenames.
+
+# The script can also handle the output with strace -t, -tt, or -ttt.
+# It will add elapsed time for each process in that case.
+
+# Copyright (c) 1998 by Richard Braakman <dark@xs4all.nl>.
+# Copyright (c) 1998-2018 The strace developers.
+
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+use strict;
+use warnings;
+
+my %unfinished;
+my $floatform;
+
+# Scales for strace slowdown. Make configurable!
+my $scale_factor = 3.5;
+my %running_fqname;
+
+while (<>) {
+ my ($pid, $call, $args, $result, $time, $time_spent);
+ chop;
+ $floatform = 0;
+
+ s/^(\d+)\s+//;
+ $pid = $1;
+
+ if (s/^(\d\d):(\d\d):(\d\d)(?:\.(\d\d\d\d\d\d))? //) {
+ $time = $1 * 3600 + $2 * 60 + $3;
+ if (defined $4) {
+ $time = $time + $4 / 1000000;
+ $floatform = 1;
+ }
+ } elsif (s/^(\d+)\.(\d\d\d\d\d\d) //) {
+ $time = $1 + ($2 / 1000000);
+ $floatform = 1;
+ }
+
+ if (s/ <unfinished ...>$//) {
+ $unfinished{$pid} = $_;
+ next;
+ }
+
+ if (s/^<... \S+ resumed> //) {
+ unless (exists $unfinished{$pid}) {
+ print STDERR "$0: $ARGV: cannot find start of resumed call on line $.";
+ next;
+ }
+ $_ = $unfinished{$pid} . $_;
+ delete $unfinished{$pid};
+ }
+
+ if (/^--- SIG(\S+) (.*) ---$/) {
+ # $pid received signal $1
+ # currently we don't do anything with this
+ next;
+ }
+
+ if (/^\+\+\+ killed by SIG(\S+) \+\+\+$/) {
+ # $pid received signal $1
+ handle_killed($pid, $time);
+ next;
+ }
+
+ if (/^\+\+\+ exited with (\d+) \+\+\+$/) {
+ # $pid exited $1
+ # currently we don't do anything with this
+ next;
+ }
+
+ ($call, $args, $result) = /(\S+)\((.*)\)\s+= (.*)$/;
+ if ($result =~ /^(.*) <([0-9.]*)>$/) {
+ ($result, $time_spent) = ($1, $2);
+ }
+ unless (defined $result) {
+ print STDERR "$0: $ARGV: $.: cannot parse line.\n";
+ next;
+ }
+
+ handle_trace($pid, $call, $args, $result, $time);
+}
+
+display_trace();
+
+exit 0;
+
+sub parse_str {
+ my ($in) = @_;
+ my $result = "";
+
+ while (1) {
+ if ($in =~ s/^\\(.)//) {
+ $result .= $1;
+ } elsif ($in =~ s/^\"//) {
+ if ($in =~ s/^\.\.\.//) {
+ return ("$result...", $in);
+ }
+ return ($result, $in);
+ } elsif ($in =~ s/([^\\\"]*)//) {
+ $result .= $1;
+ } else {
+ return (undef, $in);
+ }
+ }
+}
+
+sub parse_one {
+ my ($in) = @_;
+
+ if ($in =~ s/^\"//) {
+ my $tmp;
+ ($tmp, $in) = parse_str($in);
+ if (not defined $tmp) {
+ print STDERR "$0: $ARGV: $.: cannot parse string.\n";
+ return (undef, $in);
+ }
+ return ($tmp, $in);
+ } elsif ($in =~ s/^0x([[:xdigit:]]+)//) {
+ return (hex $1, $in);
+ } elsif ($in =~ s/^(\d+)//) {
+ return (int $1, $in);
+ } else {
+ print STDERR "$0: $ARGV: $.: unrecognized element.\n";
+ return (undef, $in);
+ }
+}
+
+sub parseargs {
+ my ($in) = @_;
+ my @args = ();
+ my $tmp;
+
+ while (length $in) {
+ if ($in =~ s/^\[//) {
+ my @subarr = ();
+ if ($in =~ s,^/\* (\d+) vars \*/\],,) {
+ push @args, $1;
+ } else {
+ while ($in !~ s/^\]//) {
+ ($tmp, $in) = parse_one($in);
+ defined $tmp or return undef;
+ push @subarr, $tmp;
+ unless ($in =~ /^\]/ or $in =~ s/^, //) {
+ print STDERR "$0: $ARGV: $.: missing comma in array.\n";
+ return undef;
+ }
+ if ($in =~ s/^\.\.\.//) {
+ push @subarr, "...";
+ }
+ }
+ push @args, \@subarr;
+ }
+ } elsif ($in =~ s/^\{//) {
+ my %subhash = ();
+ while ($in !~ s/^\}//) {
+ my $key;
+ unless ($in =~ s/^(\w+)=//) {
+ print STDERR "$0: $ARGV: $.: struct field expected.\n";
+ return undef;
+ }
+ $key = $1;
+ ($tmp, $in) = parse_one($in);
+ defined $tmp or return undef;
+ $subhash{$key} = $tmp;
+ unless ($in =~ s/, //) {
+ print STDERR "$0: $ARGV: $.: missing comma in struct.\n";
+ return undef;
+ }
+ }
+ push @args, \%subhash;
+ } else {
+ ($tmp, $in) = parse_one($in);
+ defined $tmp or return undef;
+ push @args, $tmp;
+ }
+ unless (length($in) == 0 or $in =~ s/^, //) {
+ print STDERR "$0: $ARGV: $.: missing comma.\n";
+ return undef;
+ }
+ }
+ return @args;
+}
+
+
+my $depth = "";
+
+# process info, indexed by pid.
+# fields:
+# parent pid number
+# seq clones, forks and execs for this pid, in sequence (array)
+
+# filename and argv (from latest exec)
+# basename (derived from filename)
+# argv[0] is modified to add the basename if it differs from the 0th argument.
+
+my %pr;
+
+sub handle_trace {
+ my ($pid, $call, $args, $result, $time) = @_;
+ my $pid_fqname = $pid . "-" . $time;
+
+ if (defined $time and not defined $running_fqname{$pid}) {
+ $pr{$pid_fqname}{start} = $time;
+ $running_fqname{$pid} = $pid_fqname;
+ }
+
+ $pid_fqname = $running_fqname{$pid};
+
+ if ($call eq 'execve') {
+ return if $result ne '0';
+
+ my ($filename, $argv) = parseargs($args);
+ my ($basename) = $filename =~ m/([^\/]*)$/;
+ if ($basename ne $$argv[0]) {
+ $$argv[0] = "$basename($$argv[0])";
+ }
+ my $seq = $pr{$pid_fqname}{seq};
+ $seq = [] if not defined $seq;
+
+ push @$seq, ['EXEC', $filename, $argv];
+
+ $pr{$pid_fqname}{seq} = $seq;
+ } elsif ($call eq 'fork' || $call eq 'clone' || $call eq 'vfork') {
+ return if $result == 0;
+
+ my $seq = $pr{$pid_fqname}{seq};
+ my $result_fqname= $result . "-" . $time;
+ $seq = [] if not defined $seq;
+ push @$seq, ['FORK', $result_fqname];
+ $pr{$pid_fqname}{seq} = $seq;
+ $pr{$result_fqname}{start} = $time;
+ $pr{$result_fqname}{parent} = $pid_fqname;
+ $pr{$result_fqname}{seq} = [];
+ $running_fqname{$result} = $result_fqname;
+ } elsif ($call eq '_exit' || $call eq 'exit_group') {
+ $pr{$running_fqname{$pid}}{end} = $time if defined $time and not defined $pr{$running_fqname{$pid}}{end};
+ delete $running_fqname{$pid};
+ }
+}
+
+sub handle_killed {
+ my ($pid, $time) = @_;
+ $pr{$pid}{end} = $time if defined $time and not defined $pr{$pid}{end};
+}
+
+sub straight_seq {
+ my ($pid) = @_;
+ my $seq = $pr{$pid}{seq};
+
+ for my $elem (@$seq) {
+ if ($$elem[0] eq 'EXEC') {
+ my $argv = $$elem[2];
+ print "$$elem[0] $$elem[1] @$argv\n";
+ } elsif ($$elem[0] eq 'FORK') {
+ print "$$elem[0] $$elem[1]\n";
+ } else {
+ print "$$elem[0]\n";
+ }
+ }
+}
+
+sub first_exec {
+ my ($pid) = @_;
+ my $seq = $pr{$pid}{seq};
+
+ for my $elem (@$seq) {
+ if ($$elem[0] eq 'EXEC') {
+ return $elem;
+ }
+ }
+ return undef;
+}
+
+sub display_pid_trace {
+ my ($pid, $lead) = @_;
+ my $i = 0;
+ my @seq = @{$pr{$pid}{seq}};
+ my $elapsed;
+
+ if (not defined first_exec($pid)) {
+ unshift @seq, ['EXEC', '', ['(anon)'] ];
+ }
+
+ if (defined $pr{$pid}{start} and defined $pr{$pid}{end}) {
+ $elapsed = $pr{$pid}{end} - $pr{$pid}{start};
+ $elapsed /= $scale_factor;
+ if ($floatform) {
+ $elapsed = sprintf("%0.02f", $elapsed);
+ } else {
+ $elapsed = int $elapsed;
+ }
+ }
+
+ for my $elem (@seq) {
+ $i++;
+ if ($$elem[0] eq 'EXEC') {
+ my $argv = $$elem[2];
+ if (defined $elapsed) {
+ print "$lead [$elapsed] $pid @$argv\n";
+ undef $elapsed;
+ } else {
+ print "$lead $pid @$argv\n";
+ }
+ } elsif ($$elem[0] eq 'FORK') {
+ if ($i == 1) {
+ if ($lead =~ /-$/) {
+ display_pid_trace($$elem[1], "$lead--+--");
+ } else {
+ display_pid_trace($$elem[1], "$lead +--");
+ }
+ } elsif ($i == @seq) {
+ display_pid_trace($$elem[1], "$lead `--");
+ } else {
+ display_pid_trace($$elem[1], "$lead +--");
+ }
+ }
+ if ($i == 1) {
+ $lead =~ s/\`--/ /g;
+ $lead =~ s/-/ /g;
+ $lead =~ s/\+/|/g;
+ }
+ }
+}
+
+sub display_trace {
+ my ($startpid) = @_;
+
+ $startpid = (keys %pr)[0];
+ while ($pr{$startpid}{parent}) {
+ $startpid = $pr{$startpid}{parent};
+ }
+
+ display_pid_trace($startpid, "");
+}
diff --git a/src/strace-log-merge b/src/strace-log-merge
new file mode 100755
index 000000000..93d87ba28
--- /dev/null
+++ b/src/strace-log-merge
@@ -0,0 +1,90 @@
+#!/bin/sh
+#
+# This script processes strace -ff -tt output. It merges the contents of all
+# STRACE_LOG.PID files and sorts them, printing result on the standard output.
+#
+# Copyright (c) 2012-2019 The strace developers.
+#
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+show_usage()
+{
+ cat <<__EOF__
+Usage: ${0##*/} STRACE_LOG
+
+Finds all STRACE_LOG.PID files, adds PID prefix to every line,
+then combines and sorts them, and prints result to standard output.
+
+It is assumed that STRACE_LOGs were produced by strace with -tt[t]
+option which prints timestamps (otherwise sorting won't do any good).
+__EOF__
+}
+
+dd='\([0-9][0-9]\)'
+ds='\([0-9][0-9]*\)'
+
+if [ $# -ne 1 ]; then
+ show_usage >&2
+ exit 1
+elif [ "$1" = '--help' ]; then
+ show_usage
+ exit 0
+fi
+
+logfile=$1
+
+iterate_logfiles()
+{
+ local file suffix
+
+ for file in "$logfile".*; do
+ [ -f "$file" ] || continue
+ suffix=${file#"$logfile".}
+ [ "$suffix" -gt 0 ] 2> /dev/null ||
+ continue
+ "$@" "$suffix" "$file"
+ done
+}
+
+max_suffix_length=0
+process_suffix()
+{
+ local suffix len
+ suffix="$1"; shift
+
+ len=${#suffix}
+ if [ $len -gt $max_suffix_length ]; then
+ max_suffix_length=$len
+ fi
+}
+
+process_logfile()
+{
+ local suffix file pid
+ suffix="$1"; shift
+ file="$1"; shift
+
+ pid=$(printf "%-*s" $max_suffix_length $suffix)
+ # Some strace logs have last line which is not '\n' terminated,
+ # so add extra newline to every file.
+ # Empty lines are removed later.
+ sed -n "s/^\($dd:\)\?\($dd:\)\?\($ds\.\)\?$ds /\2\4\6\7 $pid \0/p" < "$file"
+ echo
+}
+
+iterate_logfiles process_suffix
+
+[ $max_suffix_length -gt 0 ] || {
+ echo >&2 "${0##*/}: $logfile: strace output not found"
+ exit 1
+}
+
+iterate_logfiles process_logfile |
+ sort -s -n -k1,1 |
+ sed -n 's/^[0-9][0-9]* //p' |
+ grep -v '^$'
+
+rc=$?
+[ $rc -eq 1 ] &&
+ echo >&2 "${0##*/}: $logfile: strace output not found"
+exit $rc
diff --git a/src/strace.c b/src/strace.c
new file mode 100644
index 000000000..8adbe45fa
--- /dev/null
+++ b/src/strace.c
@@ -0,0 +1,3727 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
+ * Copyright (c) 1999-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include <stdarg.h>
+#include <limits.h>
+#include <fcntl.h>
+#include "ptrace.h"
+#include <signal.h>
+#include <sys/resource.h>
+#include <sys/stat.h>
+#ifdef HAVE_PATHS_H
+# include <paths.h>
+#endif
+#include <getopt.h>
+#include <pwd.h>
+#include <grp.h>
+#include <dirent.h>
+#include <locale.h>
+#include <sys/utsname.h>
+#include <sys/prctl.h>
+
+#include "kill_save_errno.h"
+#include "filter_seccomp.h"
+#include "largefile_wrappers.h"
+#include "mmap_cache.h"
+#include "number_set.h"
+#include "ptrace_syscall_info.h"
+#include "scno.h"
+#include "printsiginfo.h"
+#include "trace_event.h"
+#include "xstring.h"
+#include "delay.h"
+#include "wait.h"
+
+/* In some libc, these aren't declared. Do it ourself: */
+extern char **environ;
+extern int optind;
+extern char *optarg;
+
+#ifdef ENABLE_STACKTRACE
+/* if this is true do the stack trace for every system call */
+bool stack_trace_enabled;
+#endif
+
+#define my_tkill(tid, sig) syscall(__NR_tkill, (tid), (sig))
+
+/* Glue for systems without a MMU that cannot provide fork() */
+#if !defined(HAVE_FORK)
+# undef NOMMU_SYSTEM
+# define NOMMU_SYSTEM 1
+#endif
+#if NOMMU_SYSTEM
+# define fork() vfork()
+#endif
+
+const unsigned int syscall_trap_sig = SIGTRAP | 0x80;
+
+cflag_t cflag = CFLAG_NONE;
+bool followfork;
+bool output_separately;
+unsigned int ptrace_setoptions = PTRACE_O_TRACESYSGOOD | PTRACE_O_TRACEEXEC
+ | PTRACE_O_TRACEEXIT;
+static struct xlat_data xflag_str[] = {
+ { HEXSTR_NON_ASCII, "non-ascii" },
+ { HEXSTR_ALL, "all" },
+};
+unsigned int xflag;
+bool debug_flag;
+bool Tflag;
+int Tflag_scale = 1000;
+int Tflag_width = 6;
+bool iflag;
+bool nflag;
+bool count_wallclock;
+static int tflag_scale = 1000000000;
+static unsigned tflag_width = 0;
+static const char *tflag_format = NULL;
+static bool rflag;
+static int rflag_scale = 1000;
+static int rflag_width = 6;
+static bool print_pid_pfx;
+
+/* -I n */
+enum {
+ INTR_NOT_SET = 0,
+ INTR_ANYWHERE = 1, /* don't block/ignore any signals */
+ INTR_WHILE_WAIT = 2, /* block fatal signals while decoding syscall. default */
+ INTR_NEVER = 3, /* block fatal signals. default if '-o FILE PROG' */
+ INTR_BLOCK_TSTP_TOO = 4, /* block fatal signals and SIGTSTP (^Z); default if -D */
+ NUM_INTR_OPTS
+};
+static int opt_intr;
+/* We play with signal mask only if this mode is active: */
+#define interactive (opt_intr == INTR_WHILE_WAIT)
+
+enum {
+ DAEMONIZE_NONE = 0,
+ DAEMONIZE_GRANDCHILD = 1,
+ DAEMONIZE_NEW_PGROUP = 2,
+ DAEMONIZE_NEW_SESSION = 3,
+
+ DAEMONIZE_OPTS_GUARD__,
+ MAX_DAEMONIZE_OPTS = DAEMONIZE_OPTS_GUARD__ - 1
+};
+static struct xlat_data daemonize_str[] = {
+ { DAEMONIZE_GRANDCHILD, "grandchild" },
+ { DAEMONIZE_NEW_PGROUP, "pgroup" },
+ { DAEMONIZE_NEW_PGROUP, "pgrp" },
+ { DAEMONIZE_NEW_SESSION, "session" },
+};
+/*
+ * daemonized_tracer supports -D option.
+ * With this option, strace forks twice.
+ * Unlike normal case, with -D *grandparent* process exec's,
+ * becoming a traced process. Child exits (this prevents traced process
+ * from having children it doesn't expect to have), and grandchild
+ * attaches to grandparent similarly to strace -p PID.
+ * This allows for more transparent interaction in cases
+ * when process and its parent are communicating via signals,
+ * wait() etc. Without -D, strace process gets lodged in between,
+ * disrupting parent<->child link.
+ */
+static unsigned int daemonized_tracer;
+
+static int post_attach_sigstop = TCB_IGNORE_ONE_SIGSTOP;
+#define use_seize (post_attach_sigstop == 0)
+
+unsigned int pidns_translation;
+
+static bool detach_on_execve;
+
+static int exit_code;
+static int strace_child;
+static int strace_tracer_pid;
+
+static const char *username;
+static uid_t run_uid;
+static gid_t run_gid;
+
+unsigned int max_strlen = DEFAULT_STRLEN;
+static int acolumn = DEFAULT_ACOLUMN;
+static char *acolumn_spaces;
+
+/* Default output style for xlat entities */
+enum xlat_style xlat_verbosity = XLAT_STYLE_ABBREV;
+
+static const char *outfname;
+/* If -ff, points to stderr. Else, it's our common output log */
+static FILE *shared_log;
+static bool open_append;
+
+struct tcb *printing_tcp;
+static struct tcb *current_tcp;
+
+struct tcb_wait_data {
+ enum trace_event te; /**< Event passed to dispatch_event() */
+ int status; /**< status, returned by wait4() */
+ unsigned long msg; /**< Value returned by PTRACE_GETEVENTMSG */
+ siginfo_t si; /**< siginfo, returned by PTRACE_GETSIGINFO */
+};
+
+static struct tcb **tcbtab;
+static unsigned int nprocs;
+static size_t tcbtabsize;
+
+static struct tcb_wait_data *tcb_wait_tab;
+static size_t tcb_wait_tab_size;
+
+
+#ifndef HAVE_PROGRAM_INVOCATION_NAME
+char *program_invocation_name;
+#endif
+
+unsigned os_release; /* generated from uname()'s u.release */
+
+static void detach(struct tcb *tcp);
+static void cleanup(int sig);
+static void interrupt(int sig);
+
+#ifdef HAVE_SIG_ATOMIC_T
+static volatile sig_atomic_t interrupted, restart_failed;
+#else
+static volatile int interrupted, restart_failed;
+#endif
+
+static sigset_t timer_set;
+static void timer_sighandler(int);
+
+#ifndef HAVE_STRERROR
+
+# if !HAVE_DECL_SYS_ERRLIST
+extern int sys_nerr;
+extern char *sys_errlist[];
+# endif
+
+const char *
+strerror(int err_no)
+{
+ static char buf[sizeof("Unknown error %d") + sizeof(int)*3];
+
+ if (err_no < 1 || err_no >= sys_nerr) {
+ xsprintf(buf, "Unknown error %d", err_no);
+ return buf;
+ }
+ return sys_errlist[err_no];
+}
+
+#endif /* HAVE_STERRROR */
+
+static void
+print_version(void)
+{
+ static const char features[] =
+#ifdef ENABLE_STACKTRACE
+ " stack-trace=" USE_UNWINDER
+#endif
+#ifdef USE_DEMANGLE
+ " stack-demangle"
+#endif
+#if SUPPORTED_PERSONALITIES > 1
+# if defined HAVE_M32_MPERS
+ " m32-mpers"
+# else
+ " no-m32-mpers"
+# endif
+#endif /* SUPPORTED_PERSONALITIES > 1 */
+#if SUPPORTED_PERSONALITIES > 2
+# if defined HAVE_MX32_MPERS
+ " mx32-mpers"
+# else
+ " no-mx32-mpers"
+# endif
+#endif /* SUPPORTED_PERSONALITIES > 2 */
+ "";
+
+ printf("%s -- version %s\n"
+ "Copyright (c) 1991-%s The strace developers <%s>.\n"
+ "This is free software; see the source for copying conditions. There is NO\n"
+ "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n",
+ PACKAGE_NAME, PACKAGE_VERSION, COPYRIGHT_YEAR, PACKAGE_URL);
+ printf("\nOptional features enabled:%s\n",
+ features[0] ? features : " (none)");
+}
+
+static void
+usage(void)
+{
+#ifdef ENABLE_STACKTRACE
+# define K_OPT "k"
+#else
+# define K_OPT ""
+#endif
+
+ printf("\
+Usage: strace [-ACdffhi" K_OPT "qqrtttTvVwxxyyzZ] [-I N] [-b execve] [-e EXPR]...\n\
+ [-a COLUMN] [-o FILE] [-s STRSIZE] [-X FORMAT] [-O OVERHEAD]\n\
+ [-S SORTBY] [-P PATH]... [-p PID]... [-U COLUMNS] [--seccomp-bpf]\n\
+ { -p PID | [-DDD] [-E VAR=VAL]... [-u USERNAME] PROG [ARGS] }\n\
+ or: strace -c[dfwzZ] [-I N] [-b execve] [-e EXPR]... [-O OVERHEAD]\n\
+ [-S SORTBY] [-P PATH]... [-p PID]... [-U COLUMNS] [--seccomp-bpf]\n\
+ { -p PID | [-DDD] [-E VAR=VAL]... [-u USERNAME] PROG [ARGS] }\n\
+\n\
+General:\n\
+ -e EXPR a qualifying expression: OPTION=[!]all or OPTION=[!]VAL1[,VAL2]...\n\
+ options: trace, abbrev, verbose, raw, signal, read, write, fault,\n\
+ inject, status, quiet, kvm, decode-fds\n\
+\n\
+Startup:\n\
+ -E VAR=VAL, --env=VAR=VAL\n\
+ put VAR=VAL in the environment for command\n\
+ -E VAR, --env=VAR\n\
+ remove VAR from the environment for command\n\
+ -p PID, --attach=PID\n\
+ trace process with process id PID, may be repeated\n\
+ -u USERNAME, --user=USERNAME\n\
+ run command as USERNAME handling setuid and/or setgid\n\
+\n\
+Tracing:\n\
+ -b execve, --detach-on=execve\n\
+ detach on execve syscall\n\
+ -D, --daemonize[=grandchild]\n\
+ run tracer process as a grandchild, not as a parent\n\
+ -DD, --daemonize=pgroup\n\
+ run tracer process in a separate process group\n\
+ -DDD, --daemonize=session\n\
+ run tracer process in a separate session\n\
+ -f, --follow-forks\n\
+ follow forks\n\
+ -ff, --follow-forks --output-separately\n\
+ follow forks with output into separate files\n\
+ -I INTERRUPTIBLE, --interruptible=INTERRUPTIBLE\n\
+ 1, anywhere: no signals are blocked\n\
+ 2, waiting: fatal signals are blocked while decoding syscall (default)\n\
+ 3, never: fatal signals are always blocked (default if '-o FILE PROG')\n\
+ 4, never_tstp: fatal signals and SIGTSTP (^Z) are always blocked\n\
+ (useful to make 'strace -o FILE PROG' not stop on ^Z)\n\
+\n\
+Filtering:\n\
+ -e trace=[!]{[?]SYSCALL[@64|@32|@x32]|[?]/REGEX|GROUP|all|none},\n\
+ --trace=[!]{[?]SYSCALL[@64|@32|@x32]|[?]/REGEX|GROUP|all|none}\n\
+ trace only specified syscalls.\n\
+ groups: %%clock, %%creds, %%desc, %%file, %%fstat, %%fstatfs %%ipc, %%lstat,\n\
+ %%memory, %%net, %%process, %%pure, %%signal, %%stat, %%%%stat,\n\
+ %%statfs, %%%%statfs\n\
+ -e signal=SET, --signal=SET\n\
+ trace only the specified set of signals\n\
+ print only the signals from SET\n\
+ -e status=SET, --status=SET\n\
+ print only system calls with the return statuses in SET\n\
+ statuses: successful, failed, unfinished, unavailable, detached\n\
+ -P PATH, --trace-path=PATH\n\
+ trace accesses to PATH\n\
+ -z, --successful-only\n\
+ print only syscalls that returned without an error code\n\
+ -Z, --failed-only\n\
+ print only syscalls that returned with an error code\n\
+\n\
+Output format:\n\
+ -a COLUMN, --columns=COLUMN\n\
+ alignment COLUMN for printing syscall results (default %d)\n\
+ -e abbrev=SET, --abbrev=SET\n\
+ abbreviate output for the syscalls in SET\n\
+ -e verbose=SET, --verbose=SET\n\
+ dereference structures for the syscall in SET\n\
+ -e raw=SET, --raw=SET\n\
+ print undecoded arguments for the syscalls in SET\n\
+ -e read=SET, --read=SET\n\
+ dump the data read from the file descriptors in SET\n\
+ -e write=SET, --write=SET\n\
+ dump the data written to the file descriptors in SET\n\
+ -e quiet=SET, --quiet=SET\n\
+ suppress various informational messages\n\
+ messages: attach, exit, path-resolution, personality, thread-execve\n\
+ -e kvm=vcpu, --kvm=vcpu\n\
+ print exit reason of kvm vcpu\n\
+ -e decode-fds=SET, --decode-fds=SET\n\
+ what kinds of file descriptor information details to decode\n\
+ details: dev (device major/minor for block/char device files)\n\
+ path (file path),\n\
+ pidfd (associated PID for pidfds),\n\
+ socket (protocol-specific information for socket descriptors)\n\
+ -i, --instruction-pointer\n\
+ print instruction pointer at time of syscall\n\
+"
+#ifdef ENABLE_STACKTRACE
+"\
+ -k, --stack-traces\n\
+ obtain stack trace between each syscall\n\
+"
+#endif
+"\
+ -n, --syscall-number\n\
+ print syscall number\n\
+ -o FILE, --output=FILE\n\
+ send trace output to FILE instead of stderr\n\
+ -A, --output-append-mode\n\
+ open the file provided in the -o option in append mode\n\
+ --output-separately\n\
+ output into separate files (by appending pid to file names)\n\
+ -q, --quiet=attach,personality\n\
+ suppress messages about attaching, detaching, etc.\n\
+ -qq, --quiet=attach,personality,exit\n\
+ suppress messages about process exit status as well.\n\
+ -qqq, --quiet=all\n\
+ suppress all suppressible messages.\n\
+ -r, --relative-timestamps[=PRECISION]\n\
+ print relative timestamp\n\
+ precision: one of s, ms, us, ns; default is microseconds\n\
+ -s STRSIZE, --string-limit=STRSIZE\n\
+ limit length of print strings to STRSIZE chars (default %d)\n\
+ --absolute-timestamps=[[format:]FORMAT[,[precision:]PRECISION]]\n\
+ set the format of absolute timestamps\n\
+ format: none, time, or unix; default is time\n\
+ precision: one of s, ms, us, ns; default is seconds\n\
+ -t, --absolute-timestamps[=time]\n\
+ print absolute timestamp\n\
+ -tt, --absolute-timestamps=[time,]us\n\
+ print absolute timestamp with usecs\n\
+ -ttt, --absolute-timestamps=unix,us\n\
+ print absolute UNIX time with usecs\n\
+ -T, --syscall-times[=PRECISION]\n\
+ print time spent in each syscall\n\
+ precision: one of s, ms, us, ns; default is microseconds\n\
+ -v, --no-abbrev\n\
+ verbose mode: print entities unabbreviated\n\
+ -x, --strings-in-hex=non-ascii\n\
+ print non-ascii strings in hex\n\
+ -xx, --strings-in-hex[=all]\n\
+ print all strings in hex\n\
+ -X FORMAT, --const-print-style=FORMAT\n\
+ set the FORMAT for printing of named constants and flags\n\
+ formats: raw, abbrev, verbose\n\
+ -y, --decode-fds[=path]\n\
+ print paths associated with file descriptor arguments\n\
+ -yy, --decode-fds=all\n\
+ print all available information associated with file\n\
+ descriptors in addition to paths\n\
+\n\
+Statistics:\n\
+ -c, --summary-only\n\
+ count time, calls, and errors for each syscall and report\n\
+ summary\n\
+ -C, --summary like -c, but also print the regular output\n\
+ -O OVERHEAD[UNIT], --summary-syscall-overhead=OVERHEAD[UNIT]\n\
+ set overhead for tracing syscalls to OVERHEAD UNITs\n\
+ units: one of s, ms, us, ns; default is microseconds\n\
+ -S SORTBY, --summary-sort-by=SORTBY\n\
+ sort syscall counts by: time, min-time, max-time, avg-time,\n\
+ calls, errors, name, nothing (default %s)\n\
+ -U COLUMNS, --summary-columns=COLUMNS\n\
+ show specific columns in the summary report: comma-separated\n\
+ list of time-percent, total-time, min-time, max-time, \n\
+ avg-time, calls, errors, name\n\
+ (default time-percent,total-time,avg-time,calls,errors,name)\n\
+ -w, --summary-wall-clock\n\
+ summarise syscall latency (default is system time)\n\
+\n\
+Tampering:\n\
+ -e inject=SET[:error=ERRNO|:retval=VALUE][:signal=SIG][:syscall=SYSCALL]\n\
+ [:delay_enter=DELAY][:delay_exit=DELAY][:when=WHEN],\n\
+ --inject=SET[:error=ERRNO|:retval=VALUE][:signal=SIG][:syscall=SYSCALL]\n\
+ [:delay_enter=DELAY][:delay_exit=DELAY][:when=WHEN]\n\
+ perform syscall tampering for the syscalls in SET\n\
+ delay: microseconds or NUMBER{s|ms|us|ns}\n\
+ when: FIRST[..LAST][+[STEP]]\n\
+ -e fault=SET[:error=ERRNO][:when=WHEN], --fault=SET[:error=ERRNO][:when=WHEN]\n\
+ synonym for -e inject with default ERRNO set to ENOSYS.\n\
+\n\
+Miscellaneous:\n\
+ -d, --debug enable debug output to stderr\n\
+ -h, --help print help message\n\
+ --seccomp-bpf enable seccomp-bpf filtering\n\
+ -V, --version print version\n\
+"
+/* ancient, no one should use it
+-F -- attempt to follow vforks (deprecated, use -f)\n\
+ */
+, DEFAULT_ACOLUMN, DEFAULT_STRLEN, DEFAULT_SORTBY);
+ exit(0);
+
+#undef K_OPT
+}
+
+void ATTRIBUTE_NORETURN
+die(void)
+{
+ if (strace_tracer_pid == getpid()) {
+ cleanup(0);
+ exit(1);
+ }
+
+ _exit(1);
+}
+
+static void
+error_opt_arg(int opt, const struct option *lopt, const char *arg)
+{
+ if (lopt && lopt->name) {
+ error_msg_and_help("invalid --%s argument: '%s'",
+ lopt->name, arg);
+ } else {
+ error_msg_and_help("invalid -%c argument: '%s'", opt, arg);
+ }
+}
+
+static const char *ptrace_attach_cmd;
+
+static int
+ptrace_attach_or_seize(int pid)
+{
+ int r;
+ if (!use_seize)
+ return ptrace_attach_cmd = "PTRACE_ATTACH",
+ ptrace(PTRACE_ATTACH, pid, 0L, 0L);
+ r = ptrace(PTRACE_SEIZE, pid, 0L, (unsigned long) ptrace_setoptions);
+ if (r)
+ return ptrace_attach_cmd = "PTRACE_SEIZE", r;
+ r = ptrace(PTRACE_INTERRUPT, pid, 0L, 0L);
+ return ptrace_attach_cmd = "PTRACE_INTERRUPT", r;
+}
+
+static const char *
+ptrace_op_str(unsigned int op)
+{
+ const char *str = xlookup(ptrace_cmds, op);
+ if (str)
+ return str;
+
+ static char buf[sizeof(op) * 3];
+ xsprintf(buf, "%u", op);
+ return buf;
+}
+
+/*
+ * Used when we want to unblock stopped traced process.
+ * Should be only used with PTRACE_CONT, PTRACE_DETACH and PTRACE_SYSCALL.
+ * Returns 0 on success or if error was ESRCH
+ * (presumably process was killed while we talk to it).
+ * Otherwise prints error message and returns -1.
+ */
+static int
+ptrace_restart(const unsigned int op, struct tcb *const tcp, unsigned int sig)
+{
+ int err;
+
+ errno = 0;
+ ptrace(op, tcp->pid, 0L, (unsigned long) sig);
+ err = errno;
+ if (!err || err == ESRCH)
+ return 0;
+
+ /*
+ * Why curcol != 0? Otherwise sometimes we get this:
+ *
+ * 10252 kill(10253, SIGKILL) = 0
+ * <ptrace(SYSCALL,10252):No such process>10253 ...next decode...
+ *
+ * 10252 died after we retrieved syscall exit data,
+ * but before we tried to restart it. Log looks ugly.
+ */
+ if (current_tcp && current_tcp->curcol != 0) {
+ tprintf(" <Cannot restart pid %d with ptrace(%s): %s>\n",
+ tcp->pid, ptrace_op_str(op), strerror(err));
+ line_ended();
+ }
+ errno = err;
+ perror_msg("ptrace(%s,pid:%d,sig:%u)",
+ ptrace_op_str(op), tcp->pid, sig);
+ return -1;
+}
+
+static void
+set_cloexec_flag(int fd)
+{
+ int flags, newflags;
+
+ flags = fcntl_fd(fd, F_GETFD);
+ if (flags < 0) {
+ /* Can happen only if fd is bad.
+ * Should never happen: if it does, we have a bug
+ * in the caller. Therefore we just abort
+ * instead of propagating the error.
+ */
+ perror_msg_and_die("fcntl(%d, F_GETFD)", fd);
+ }
+
+ newflags = flags | FD_CLOEXEC;
+ if (flags == newflags)
+ return;
+
+ if (fcntl_fd(fd, F_SETFD, newflags)) /* never fails */
+ perror_msg_and_die("fcntl(%d, F_SETFD, %#x)", fd, newflags);
+}
+
+/*
+ * When strace is setuid executable, we have to swap uids
+ * before and after filesystem and process management operations.
+ */
+static void
+swap_uid(void)
+{
+ int euid = geteuid(), uid = getuid();
+
+ if (euid != uid && setreuid(euid, uid) < 0) {
+ perror_msg_and_die("setreuid");
+ }
+}
+
+static FILE *
+strace_fopen(const char *path)
+{
+ FILE *fp;
+
+ swap_uid();
+ fp = fopen_stream(path, open_append ? "a" : "w");
+ if (!fp)
+ perror_msg_and_die("Can't fopen '%s'", path);
+ swap_uid();
+ set_cloexec_flag(fileno(fp));
+ return fp;
+}
+
+static int popen_pid;
+
+#ifndef _PATH_BSHELL
+# define _PATH_BSHELL "/bin/sh"
+#endif
+
+/*
+ * We cannot use standard popen(3) here because we have to distinguish
+ * popen child process from other processes we trace, and standard popen(3)
+ * does not export its child's pid.
+ */
+static FILE *
+strace_popen(const char *command)
+{
+ FILE *fp;
+ int pid;
+ int fds[2];
+
+ swap_uid();
+ if (pipe(fds) < 0)
+ perror_msg_and_die("pipe");
+
+ set_cloexec_flag(fds[1]); /* never fails */
+
+ pid = vfork();
+ if (pid < 0)
+ perror_msg_and_die("vfork");
+
+ if (pid == 0) {
+ /* child */
+ close(fds[1]);
+ if (fds[0] != 0) {
+ if (dup2(fds[0], 0))
+ perror_msg_and_die("dup2");
+ close(fds[0]);
+ }
+ execl(_PATH_BSHELL, "sh", "-c", command, NULL);
+ perror_msg_and_die("Can't execute '%s'", _PATH_BSHELL);
+ }
+
+ /* parent */
+ popen_pid = pid;
+ close(fds[0]);
+ swap_uid();
+ fp = fdopen(fds[1], "w");
+ if (!fp)
+ perror_msg_and_die("fdopen");
+ return fp;
+}
+
+static void
+outf_perror(const struct tcb * const tcp)
+{
+ if (tcp->outf == stderr)
+ return;
+
+ /* This is ugly, but we don't store separate file names */
+ if (output_separately)
+ perror_msg("%s.%u", outfname, tcp->pid);
+ else
+ perror_msg("%s", outfname);
+}
+
+ATTRIBUTE_FORMAT((printf, 1, 0))
+static void
+tvprintf(const char *const fmt, va_list args)
+{
+ if (current_tcp) {
+ int n = vfprintf(current_tcp->outf, fmt, args);
+ if (n < 0) {
+ /* very unlikely due to vfprintf buffering */
+ outf_perror(current_tcp);
+ } else
+ current_tcp->curcol += n;
+ }
+}
+
+void
+tprintf(const char *fmt, ...)
+{
+ va_list args;
+ va_start(args, fmt);
+ tvprintf(fmt, args);
+ va_end(args);
+}
+
+#ifndef HAVE_FPUTS_UNLOCKED
+# define fputs_unlocked fputs
+#endif
+
+void
+tprints(const char *str)
+{
+ if (current_tcp) {
+ int n = fputs_unlocked(str, current_tcp->outf);
+ if (n >= 0) {
+ current_tcp->curcol += strlen(str);
+ return;
+ }
+ /* very unlikely due to fputs_unlocked buffering */
+ outf_perror(current_tcp);
+ }
+}
+
+void
+tprints_comment(const char *const str)
+{
+ if (str && *str)
+ tprintf(" /* %s */", str);
+}
+
+void
+tprintf_comment(const char *fmt, ...)
+{
+ if (!fmt || !*fmt)
+ return;
+
+ va_list args;
+ va_start(args, fmt);
+ tprints(" /* ");
+ tvprintf(fmt, args);
+ tprints(" */");
+ va_end(args);
+}
+
+static void
+flush_tcp_output(const struct tcb *const tcp)
+{
+ if (fflush(tcp->outf))
+ outf_perror(tcp);
+}
+
+void
+line_ended(void)
+{
+ if (current_tcp) {
+ current_tcp->curcol = 0;
+ flush_tcp_output(current_tcp);
+ }
+ if (printing_tcp) {
+ printing_tcp->curcol = 0;
+ printing_tcp = NULL;
+ }
+}
+
+void
+set_current_tcp(const struct tcb *tcp)
+{
+ current_tcp = (struct tcb *) tcp;
+
+ /* Sync current_personality and stuff */
+ if (current_tcp)
+ set_personality(current_tcp->currpers);
+}
+
+void
+printleader(struct tcb *tcp)
+{
+ /* If -ff, "previous tcb we printed" is always the same as current,
+ * because we have per-tcb output files.
+ */
+ if (output_separately)
+ printing_tcp = tcp;
+
+ if (printing_tcp) {
+ set_current_tcp(printing_tcp);
+ if (!tcp->staged_output_data && printing_tcp->curcol != 0 &&
+ (!output_separately || printing_tcp == tcp)) {
+ /*
+ * case 1: we have a shared log (i.e. not -ff), and last line
+ * wasn't finished (same or different tcb, doesn't matter).
+ * case 2: split log, we are the same tcb, but our last line
+ * didn't finish ("SIGKILL nuked us after syscall entry" etc).
+ */
+ tprints(" <unfinished ...>\n");
+ printing_tcp->curcol = 0;
+ }
+ }
+
+ printing_tcp = tcp;
+ set_current_tcp(tcp);
+ current_tcp->curcol = 0;
+
+ if (print_pid_pfx)
+ tprintf("%-5d ", tcp->pid);
+ else if (nprocs > 1 && !outfname)
+ tprintf("[pid %5u] ", tcp->pid);
+
+ if (tflag_format) {
+ struct timespec ts;
+ clock_gettime(CLOCK_REALTIME, &ts);
+
+ time_t local = ts.tv_sec;
+ char str[MAX(sizeof("HH:MM:SS"), sizeof(local) * 3)];
+ struct tm *tm = localtime(&local);
+
+ if (tm)
+ strftime(str, sizeof(str), tflag_format, tm);
+ else
+ xsprintf(str, "%lld", (long long) local);
+ if (tflag_width)
+ tprintf("%s.%0*ld ", str, tflag_width,
+ (long) ts.tv_nsec / tflag_scale);
+ else
+ tprintf("%s ", str);
+ }
+
+ if (rflag) {
+ struct timespec ts;
+ clock_gettime(CLOCK_MONOTONIC, &ts);
+
+ static struct timespec ots;
+ if (ots.tv_sec == 0)
+ ots = ts;
+
+ struct timespec dts;
+ ts_sub(&dts, &ts, &ots);
+ ots = ts;
+
+ tprintf("%s%6ld", tflag_format ? "(+" : "", (long) dts.tv_sec);
+ if (rflag_width) {
+ tprintf(".%0*ld",
+ rflag_width, (long) dts.tv_nsec / rflag_scale);
+ }
+ tprints(tflag_format ? ") " : " ");
+ }
+
+ if (nflag)
+ print_syscall_number(tcp);
+
+ if (iflag)
+ print_instruction_pointer(tcp);
+}
+
+void
+tabto(void)
+{
+ if (current_tcp->curcol < acolumn)
+ tprints(acolumn_spaces + current_tcp->curcol);
+}
+
+/* Should be only called directly *after successful attach* to a tracee.
+ * Otherwise, "strace -oFILE -ff -p<nonexistant_pid>"
+ * may create bogus empty FILE.<nonexistant_pid>, and then die.
+ */
+static void
+after_successful_attach(struct tcb *tcp, const unsigned int flags)
+{
+ tcp->flags |= TCB_ATTACHED | TCB_STARTUP | flags;
+ tcp->outf = shared_log; /* if not -ff mode, the same file is for all */
+ if (output_separately) {
+ char name[PATH_MAX];
+ xsprintf(name, "%s.%u", outfname, tcp->pid);
+ tcp->outf = strace_fopen(name);
+ }
+
+#ifdef ENABLE_STACKTRACE
+ if (stack_trace_enabled)
+ unwind_tcb_init(tcp);
+#endif
+}
+
+static void
+expand_tcbtab(void)
+{
+ /* Allocate some (more) TCBs (and expand the table).
+ We don't want to relocate the TCBs because our
+ callers have pointers and it would be a pain.
+ So tcbtab is a table of pointers. Since we never
+ free the TCBs, we allocate a single chunk of many. */
+ size_t old_tcbtabsize;
+ struct tcb *newtcbs;
+ struct tcb **tcb_ptr;
+
+ old_tcbtabsize = tcbtabsize;
+
+ tcbtab = xgrowarray(tcbtab, &tcbtabsize, sizeof(tcbtab[0]));
+ newtcbs = xcalloc(tcbtabsize - old_tcbtabsize, sizeof(newtcbs[0]));
+
+ for (tcb_ptr = tcbtab + old_tcbtabsize;
+ tcb_ptr < tcbtab + tcbtabsize; tcb_ptr++, newtcbs++)
+ *tcb_ptr = newtcbs;
+}
+
+static struct tcb *
+alloctcb(int pid)
+{
+ unsigned int i;
+ struct tcb *tcp;
+
+ if (nprocs == tcbtabsize)
+ expand_tcbtab();
+
+ for (i = 0; i < tcbtabsize; i++) {
+ tcp = tcbtab[i];
+ if (!tcp->pid) {
+ memset(tcp, 0, sizeof(*tcp));
+ list_init(&tcp->wait_list);
+ tcp->pid = pid;
+#if SUPPORTED_PERSONALITIES > 1
+ tcp->currpers = current_personality;
+#endif
+ nprocs++;
+ debug_msg("new tcb for pid %d, active tcbs:%d",
+ tcp->pid, nprocs);
+ return tcp;
+ }
+ }
+ error_msg_and_die("bug in alloctcb");
+}
+
+void *
+get_tcb_priv_data(const struct tcb *tcp)
+{
+ return tcp->_priv_data;
+}
+
+int
+set_tcb_priv_data(struct tcb *tcp, void *const priv_data,
+ void (*const free_priv_data)(void *))
+{
+ if (tcp->_priv_data)
+ return -1;
+
+ tcp->_free_priv_data = free_priv_data;
+ tcp->_priv_data = priv_data;
+
+ return 0;
+}
+
+void
+free_tcb_priv_data(struct tcb *tcp)
+{
+ if (tcp->_priv_data) {
+ if (tcp->_free_priv_data) {
+ tcp->_free_priv_data(tcp->_priv_data);
+ tcp->_free_priv_data = NULL;
+ }
+ tcp->_priv_data = NULL;
+ }
+}
+
+static void
+droptcb(struct tcb *tcp)
+{
+ if (tcp->pid == 0)
+ return;
+
+ if (cflag && debug_flag) {
+ struct timespec dt;
+
+ ts_sub(&dt, &tcp->stime, &tcp->atime);
+ debug_func_msg("pid %d: %.9f seconds of system time spent "
+ "since attach", tcp->pid, ts_float(&dt));
+ }
+
+ int p;
+ for (p = 0; p < SUPPORTED_PERSONALITIES; ++p)
+ free(tcp->inject_vec[p]);
+
+ free_tcb_priv_data(tcp);
+
+#ifdef ENABLE_STACKTRACE
+ if (stack_trace_enabled)
+ unwind_tcb_fin(tcp);
+#endif
+
+#ifdef HAVE_LINUX_KVM_H
+ kvm_vcpu_info_free(tcp);
+#endif
+
+ if (tcp->mmap_cache)
+ tcp->mmap_cache->free_fn(tcp, __func__);
+
+ nprocs--;
+ debug_msg("dropped tcb for pid %d, %d remain", tcp->pid, nprocs);
+
+ if (tcp->outf) {
+ bool publish = true;
+ if (!is_complete_set(status_set, NUMBER_OF_STATUSES)) {
+ publish = is_number_in_set(STATUS_DETACHED, status_set);
+ strace_close_memstream(tcp, publish);
+ }
+
+ if (output_separately) {
+ if (tcp->curcol != 0 && publish)
+ fprintf(tcp->outf, " <detached ...>\n");
+ fclose(tcp->outf);
+ } else {
+ if (printing_tcp == tcp && tcp->curcol != 0 && publish)
+ fprintf(tcp->outf, " <detached ...>\n");
+ flush_tcp_output(tcp);
+ }
+ }
+
+ if (current_tcp == tcp)
+ set_current_tcp(NULL);
+ if (printing_tcp == tcp)
+ printing_tcp = NULL;
+
+ list_remove(&tcp->wait_list);
+
+ memset(tcp, 0, sizeof(*tcp));
+}
+
+/* Detach traced process.
+ * Never call DETACH twice on the same process as both unattached and
+ * attached-unstopped processes give the same ESRCH. For unattached process we
+ * would SIGSTOP it and wait for its SIGSTOP notification forever.
+ */
+static void
+detach(struct tcb *tcp)
+{
+ int error;
+ int status;
+
+ /*
+ * Linux wrongly insists the child be stopped
+ * before detaching. Arghh. We go through hoops
+ * to make a clean break of things.
+ */
+
+ if (!(tcp->flags & TCB_ATTACHED))
+ goto drop;
+
+ /* We attached but possibly didn't see the expected SIGSTOP.
+ * We must catch exactly one as otherwise the detached process
+ * would be left stopped (process state T).
+ */
+ if (tcp->flags & TCB_IGNORE_ONE_SIGSTOP)
+ goto wait_loop;
+
+ error = ptrace(PTRACE_DETACH, tcp->pid, 0, 0);
+ if (!error) {
+ /* On a clear day, you can see forever. */
+ goto drop;
+ }
+ if (errno != ESRCH) {
+ /* Shouldn't happen. */
+ perror_func_msg("ptrace(PTRACE_DETACH,%u)", tcp->pid);
+ goto drop;
+ }
+ /* ESRCH: process is either not stopped or doesn't exist. */
+ if (my_tkill(tcp->pid, 0) < 0) {
+ if (errno != ESRCH)
+ /* Shouldn't happen. */
+ perror_func_msg("tkill(%u,0)", tcp->pid);
+ /* else: process doesn't exist. */
+ goto drop;
+ }
+ /* Process is not stopped, need to stop it. */
+ if (use_seize) {
+ /*
+ * With SEIZE, tracee can be in group-stop already.
+ * In this state sending it another SIGSTOP does nothing.
+ * Need to use INTERRUPT.
+ * Testcase: trying to ^C a "strace -p <stopped_process>".
+ */
+ error = ptrace(PTRACE_INTERRUPT, tcp->pid, 0, 0);
+ if (!error)
+ goto wait_loop;
+ if (errno != ESRCH)
+ perror_func_msg("ptrace(PTRACE_INTERRUPT,%u)", tcp->pid);
+ } else {
+ error = my_tkill(tcp->pid, SIGSTOP);
+ if (!error)
+ goto wait_loop;
+ if (errno != ESRCH)
+ perror_func_msg("tkill(%u,SIGSTOP)", tcp->pid);
+ }
+ /* Either process doesn't exist, or some weird error. */
+ goto drop;
+
+ wait_loop:
+ /* We end up here in three cases:
+ * 1. We sent PTRACE_INTERRUPT (use_seize case)
+ * 2. We sent SIGSTOP (!use_seize)
+ * 3. Attach SIGSTOP was already pending (TCB_IGNORE_ONE_SIGSTOP set)
+ */
+ for (;;) {
+ unsigned int sig;
+ if (waitpid(tcp->pid, &status, __WALL) < 0) {
+ if (errno == EINTR)
+ continue;
+ /*
+ * if (errno == ECHILD) break;
+ * ^^^ WRONG! We expect this PID to exist,
+ * and want to emit a message otherwise:
+ */
+ perror_func_msg("waitpid(%u)", tcp->pid);
+ break;
+ }
+ if (!WIFSTOPPED(status)) {
+ /*
+ * Tracee exited or was killed by signal.
+ * We shouldn't normally reach this place:
+ * we don't want to consume exit status.
+ * Consider "strace -p PID" being ^C-ed:
+ * we want merely to detach from PID.
+ *
+ * However, we _can_ end up here if tracee
+ * was SIGKILLed.
+ */
+ break;
+ }
+ sig = WSTOPSIG(status);
+ debug_msg("detach wait: event:%d sig:%d",
+ (unsigned) status >> 16, sig);
+ if (use_seize) {
+ unsigned event = (unsigned)status >> 16;
+ if (event == PTRACE_EVENT_STOP /*&& sig == SIGTRAP*/) {
+ /*
+ * sig == SIGTRAP: PTRACE_INTERRUPT stop.
+ * sig == other: process was already stopped
+ * with this stopping sig (see tests/detach-stopped).
+ * Looks like re-injecting this sig is not necessary
+ * in DETACH for the tracee to remain stopped.
+ */
+ sig = 0;
+ }
+ /*
+ * PTRACE_INTERRUPT is not guaranteed to produce
+ * the above event if other ptrace-stop is pending.
+ * See tests/detach-sleeping testcase:
+ * strace got SIGINT while tracee is sleeping.
+ * We sent PTRACE_INTERRUPT.
+ * We see syscall exit, not PTRACE_INTERRUPT stop.
+ * We won't get PTRACE_INTERRUPT stop
+ * if we would CONT now. Need to DETACH.
+ */
+ if (sig == syscall_trap_sig)
+ sig = 0;
+ /* else: not sure in which case we can be here.
+ * Signal stop? Inject it while detaching.
+ */
+ ptrace_restart(PTRACE_DETACH, tcp, sig);
+ break;
+ }
+ /* Note: this check has to be after use_seize check */
+ /* (else, in use_seize case SIGSTOP will be mistreated) */
+ if (sig == SIGSTOP) {
+ /* Detach, suppressing SIGSTOP */
+ ptrace_restart(PTRACE_DETACH, tcp, 0);
+ break;
+ }
+ if (sig == syscall_trap_sig)
+ sig = 0;
+ /* Can't detach just yet, may need to wait for SIGSTOP */
+ error = ptrace_restart(PTRACE_CONT, tcp, sig);
+ if (error < 0) {
+ /* Should not happen.
+ * Note: ptrace_restart returns 0 on ESRCH, so it's not it.
+ * ptrace_restart already emitted error message.
+ */
+ break;
+ }
+ }
+
+ drop:
+ if (!is_number_in_set(QUIET_ATTACH, quiet_set)
+ && (tcp->flags & TCB_ATTACHED))
+ error_msg("Process %u detached", tcp->pid);
+
+ droptcb(tcp);
+}
+
+static void
+process_opt_p_list(char *opt)
+{
+ while (*opt) {
+ /*
+ * We accept -p PID,PID; -p "`pidof PROG`"; -p "`pgrep PROG`".
+ * pidof uses space as delim, pgrep uses newline. :(
+ */
+ int pid;
+ char *delim = opt + strcspn(opt, "\n\t ,");
+ char c = *delim;
+
+ *delim = '\0';
+ pid = string_to_uint(opt);
+ if (pid <= 0) {
+ error_msg_and_die("Invalid process id: '%s'", opt);
+ }
+ if (pid == strace_tracer_pid) {
+ error_msg_and_die("I'm sorry, I can't let you do that, Dave.");
+ }
+ *delim = c;
+ alloctcb(pid);
+ if (c == '\0')
+ break;
+ opt = delim + 1;
+ }
+}
+
+static void
+attach_tcb(struct tcb *const tcp)
+{
+ if (ptrace_attach_or_seize(tcp->pid) < 0) {
+ perror_msg("attach: ptrace(%s, %d)",
+ ptrace_attach_cmd, tcp->pid);
+ droptcb(tcp);
+ return;
+ }
+
+ after_successful_attach(tcp, TCB_GRABBED | post_attach_sigstop);
+ debug_msg("attach to pid %d (main) succeeded", tcp->pid);
+
+ static const char task_path[] = "/proc/%d/task";
+ char procdir[sizeof(task_path) + sizeof(int) * 3];
+ DIR *dir;
+ unsigned int ntid = 0, nerr = 0;
+
+ if (followfork && tcp->pid != strace_child &&
+ xsprintf(procdir, task_path, get_proc_pid(tcp)) > 0 &&
+ (dir = opendir(procdir)) != NULL) {
+ struct_dirent *de;
+
+ while ((de = read_dir(dir)) != NULL) {
+ if (de->d_fileno == 0)
+ continue;
+
+ int tid = string_to_uint(de->d_name);
+ if (tid <= 0 || tid == tcp->pid)
+ continue;
+
+ ++ntid;
+ if (ptrace_attach_or_seize(tid) < 0) {
+ ++nerr;
+ debug_perror_msg("attach: ptrace(%s, %d)",
+ ptrace_attach_cmd, tid);
+ continue;
+ }
+
+ after_successful_attach(alloctcb(tid),
+ TCB_GRABBED | post_attach_sigstop);
+ debug_msg("attach to pid %d succeeded", tid);
+ }
+
+ closedir(dir);
+ }
+
+ if (!is_number_in_set(QUIET_ATTACH, quiet_set)) {
+ if (ntid > nerr)
+ error_msg("Process %u attached"
+ " with %u threads",
+ tcp->pid, ntid - nerr + 1);
+ else
+ error_msg("Process %u attached",
+ tcp->pid);
+ }
+}
+
+static void
+startup_attach(void)
+{
+ pid_t parent_pid = strace_tracer_pid;
+ unsigned int tcbi;
+ struct tcb *tcp;
+
+ if (daemonized_tracer) {
+ pid_t pid = fork();
+ if (pid < 0)
+ perror_func_msg_and_die("fork");
+
+ if (pid) { /* parent */
+ /*
+ * Wait for grandchild to attach to straced process
+ * (grandparent). Grandchild SIGKILLs us after it attached.
+ * Grandparent's wait() is unblocked by our death,
+ * it proceeds to exec the straced program.
+ */
+ pause();
+ _exit(0); /* paranoia */
+ }
+ /* grandchild */
+ /* We will be the tracer process. Remember our new pid: */
+ strace_tracer_pid = getpid();
+
+ switch (daemonized_tracer) {
+ case DAEMONIZE_NEW_PGROUP:
+ /*
+ * If -D is passed twice, create a new process group,
+ * so we won't be killed by kill(0, ...).
+ */
+ if (setpgid(0, 0) < 0)
+ perror_msg_and_die("Cannot create a new"
+ " process group");
+ break;
+ case DAEMONIZE_NEW_SESSION:
+ /*
+ * If -D is passed thrice, create a new session,
+ * so we won't be killed upon session termination.
+ */
+ if (setsid() < 0)
+ perror_msg_and_die("Cannot create a new"
+ " session");
+ break;
+ }
+ }
+
+ for (tcbi = 0; tcbi < tcbtabsize; tcbi++) {
+ tcp = tcbtab[tcbi];
+
+ if (!tcp->pid)
+ continue;
+
+ /* Is this a process we should attach to, but not yet attached? */
+ if (tcp->flags & TCB_ATTACHED)
+ continue; /* no, we already attached it */
+
+ if (tcp->pid == parent_pid || tcp->pid == strace_tracer_pid) {
+ errno = EPERM;
+ perror_msg("attach: pid %d", tcp->pid);
+ droptcb(tcp);
+ continue;
+ }
+
+ attach_tcb(tcp);
+
+ if (interrupted)
+ return;
+ } /* for each tcbtab[] */
+
+ if (daemonized_tracer) {
+ /*
+ * Make parent go away.
+ * Also makes grandparent's wait() unblock.
+ */
+ kill(parent_pid, SIGKILL);
+ strace_child = 0;
+ }
+}
+
+/* Stack-o-phobic exec helper, in the hope to work around
+ * NOMMU + "daemonized tracer" difficulty.
+ */
+struct exec_params {
+ int fd_to_close;
+ uid_t run_euid;
+ gid_t run_egid;
+ char **argv;
+ char **env;
+ char *pathname;
+ struct sigaction child_sa;
+};
+static struct exec_params params_for_tracee;
+
+static void ATTRIBUTE_NOINLINE ATTRIBUTE_NORETURN
+exec_or_die(void)
+{
+ struct exec_params *params = &params_for_tracee;
+
+ if (params->fd_to_close >= 0)
+ close(params->fd_to_close);
+ if (!daemonized_tracer && !use_seize) {
+ if (ptrace(PTRACE_TRACEME, 0L, 0L, 0L) < 0) {
+ perror_msg_and_die("ptrace(PTRACE_TRACEME, ...)");
+ }
+ }
+
+ if (username != NULL) {
+ /*
+ * It is important to set groups before we
+ * lose privileges on setuid.
+ */
+ if (initgroups(username, run_gid) < 0) {
+ perror_msg_and_die("initgroups");
+ }
+ if (setregid(run_gid, params->run_egid) < 0) {
+ perror_msg_and_die("setregid");
+ }
+ if (setreuid(run_uid, params->run_euid) < 0) {
+ perror_msg_and_die("setreuid");
+ }
+ } else if (geteuid() != 0)
+ if (setreuid(run_uid, run_uid) < 0) {
+ perror_msg_and_die("setreuid");
+ }
+
+ if (!daemonized_tracer) {
+ /*
+ * Induce a ptrace stop. Tracer (our parent)
+ * will resume us with PTRACE_SYSCALL and display
+ * the immediately following execve syscall.
+ * Can't do this on NOMMU systems, we are after
+ * vfork: parent is blocked, stopping would deadlock.
+ */
+ if (!NOMMU_SYSTEM)
+ kill(getpid(), SIGSTOP);
+ } else {
+ alarm(3);
+ /* we depend on SIGCHLD set to SIG_DFL by init code */
+ /* if it happens to be SIG_IGN'ed, wait won't block */
+ wait(NULL);
+ alarm(0);
+ }
+
+ if (params_for_tracee.child_sa.sa_handler != SIG_DFL)
+ sigaction(SIGCHLD, &params_for_tracee.child_sa, NULL);
+
+ debug_msg("seccomp filter %s",
+ seccomp_filtering ? "enabled" : "disabled");
+ if (seccomp_filtering)
+ init_seccomp_filter();
+ execve(params->pathname, params->argv, params->env);
+ perror_msg_and_die("exec");
+}
+
+/*
+ * Open a dummy descriptor for use as a placeholder.
+ * The descriptor is O_RDONLY with FD_CLOEXEC flag set.
+ * A read attempt from such descriptor ends with EOF,
+ * a write attempt is rejected with EBADF.
+ */
+static int
+open_dummy_desc(void)
+{
+ int fds[2];
+
+ if (pipe(fds))
+ perror_func_msg_and_die("pipe");
+ close(fds[1]);
+ set_cloexec_flag(fds[0]);
+ return fds[0];
+}
+
+/* placeholder fds status for stdin and stdout */
+static bool fd_is_placeholder[2];
+
+/*
+ * Ensure that all standard file descriptors are open by opening placeholder
+ * file descriptors for those standard file descriptors that are not open.
+ *
+ * The information which descriptors have been made open is saved
+ * in fd_is_placeholder for later use.
+ */
+static void
+ensure_standard_fds_opened(void)
+{
+ int fd;
+
+ while ((fd = open_dummy_desc()) <= 2) {
+ if (fd == 2)
+ break;
+ fd_is_placeholder[fd] = true;
+ }
+
+ if (fd > 2)
+ close(fd);
+}
+
+/*
+ * Redirect stdin and stdout unless they have been opened earlier
+ * by ensure_standard_fds_opened as placeholders.
+ */
+static void
+redirect_standard_fds(void)
+{
+ int i;
+
+ /*
+ * It might be a good idea to redirect stderr as well,
+ * but we sometimes need to print error messages.
+ */
+ for (i = 0; i <= 1; ++i) {
+ if (!fd_is_placeholder[i]) {
+ close(i);
+ open_dummy_desc();
+ }
+ }
+}
+
+static void
+startup_child(char **argv, char **env)
+{
+ strace_stat_t statbuf;
+ const char *filename;
+ size_t filename_len;
+ char pathname[PATH_MAX];
+ int pid;
+ struct tcb *tcp;
+
+ filename = argv[0];
+ filename_len = strlen(filename);
+
+ if (filename_len > sizeof(pathname) - 1) {
+ errno = ENAMETOOLONG;
+ perror_msg_and_die("exec");
+ }
+ if (strchr(filename, '/')) {
+ strcpy(pathname, filename);
+ }
+#ifdef USE_DEBUGGING_EXEC
+ /*
+ * Debuggers customarily check the current directory
+ * first regardless of the path but doing that gives
+ * security geeks a panic attack.
+ */
+ else if (stat_file(filename, &statbuf) == 0)
+ strcpy(pathname, filename);
+#endif /* USE_DEBUGGING_EXEC */
+ else {
+ const char *path;
+ size_t m, n, len;
+
+ for (path = getenv("PATH"); path && *path; path += m) {
+ const char *colon = strchr(path, ':');
+ if (colon) {
+ n = colon - path;
+ m = n + 1;
+ } else
+ m = n = strlen(path);
+ if (n == 0) {
+ if (!getcwd(pathname, PATH_MAX))
+ continue;
+ len = strlen(pathname);
+ } else if (n > sizeof(pathname) - 1)
+ continue;
+ else {
+ strncpy(pathname, path, n);
+ len = n;
+ }
+ if (len && pathname[len - 1] != '/')
+ pathname[len++] = '/';
+ if (filename_len + len > sizeof(pathname) - 1)
+ continue;
+ strcpy(pathname + len, filename);
+ if (stat_file(pathname, &statbuf) == 0 &&
+ /* Accept only regular files
+ with some execute bits set.
+ XXX not perfect, might still fail */
+ S_ISREG(statbuf.st_mode) &&
+ (statbuf.st_mode & 0111))
+ break;
+ }
+ if (!path || !*path)
+ pathname[0] = '\0';
+ }
+ if (stat_file(pathname, &statbuf) < 0) {
+ perror_msg_and_die("Can't stat '%s'", filename);
+ }
+
+ params_for_tracee.fd_to_close = (shared_log != stderr) ? fileno(shared_log) : -1;
+ params_for_tracee.run_euid = (statbuf.st_mode & S_ISUID) ? statbuf.st_uid : run_uid;
+ params_for_tracee.run_egid = (statbuf.st_mode & S_ISGID) ? statbuf.st_gid : run_gid;
+ params_for_tracee.argv = argv;
+ params_for_tracee.env = env;
+ /*
+ * On NOMMU, can be safely freed only after execve in tracee.
+ * It's hard to know when that happens, so we just leak it.
+ */
+ params_for_tracee.pathname = NOMMU_SYSTEM ? xstrdup(pathname) : pathname;
+
+#if defined PR_SET_PTRACER && defined PR_SET_PTRACER_ANY
+ if (daemonized_tracer)
+ prctl(PR_SET_PTRACER, PR_SET_PTRACER_ANY);
+#endif
+
+ pid = fork();
+ if (pid < 0)
+ perror_func_msg_and_die("fork");
+
+ if ((pid != 0 && daemonized_tracer)
+ || (pid == 0 && !daemonized_tracer)
+ ) {
+ /* We are to become the tracee. Two cases:
+ * -D: we are parent
+ * not -D: we are child
+ */
+ exec_or_die();
+ }
+
+ /* We are the tracer */
+
+ if (!daemonized_tracer) {
+ strace_child = pid;
+ if (!use_seize) {
+ /* child did PTRACE_TRACEME, nothing to do in parent */
+ } else {
+ if (!NOMMU_SYSTEM) {
+ /* Wait until child stopped itself */
+ int status;
+ while (waitpid(pid, &status, WSTOPPED) < 0) {
+ if (errno == EINTR)
+ continue;
+ perror_msg_and_die("waitpid");
+ }
+ if (!WIFSTOPPED(status) || WSTOPSIG(status) != SIGSTOP) {
+ kill_save_errno(pid, SIGKILL);
+ perror_msg_and_die("Unexpected wait status %#x",
+ status);
+ }
+ }
+ /* Else: NOMMU case, we have no way to sync.
+ * Just attach to it as soon as possible.
+ * This means that we may miss a few first syscalls...
+ */
+
+ if (ptrace_attach_or_seize(pid)) {
+ kill_save_errno(pid, SIGKILL);
+ perror_msg_and_die("attach: ptrace(%s, %d)",
+ ptrace_attach_cmd, pid);
+ }
+ if (!NOMMU_SYSTEM)
+ kill(pid, SIGCONT);
+ }
+ tcp = alloctcb(pid);
+ after_successful_attach(tcp, TCB_SKIP_DETACH_ON_FIRST_EXEC
+ | (NOMMU_SYSTEM ? 0
+ : (TCB_HIDE_LOG
+ | post_attach_sigstop)));
+ } else {
+ /* With -D, we are *child* here, the tracee is our parent. */
+ strace_child = strace_tracer_pid;
+ strace_tracer_pid = getpid();
+ tcp = alloctcb(strace_child);
+ tcp->flags |= TCB_SKIP_DETACH_ON_FIRST_EXEC | TCB_HIDE_LOG;
+ /*
+ * Attaching will be done later, by startup_attach.
+ * Note: we don't do after_successful_attach() here either!
+ */
+
+ /* NOMMU BUG! -D mode is active, we (child) return,
+ * and we will scribble over parent's stack!
+ * When parent later unpauses, it segfaults.
+ *
+ * We work around it
+ * (1) by declaring exec_or_die() NORETURN,
+ * hopefully compiler will just jump to it
+ * instead of call (won't push anything to stack),
+ * (2) by trying very hard in exec_or_die()
+ * to not use any stack,
+ * (3) having a really big (PATH_MAX) stack object
+ * in this function, which creates a "buffer" between
+ * child's and parent's stack pointers.
+ * This may save us if (1) and (2) failed
+ * and compiler decided to use stack in exec_or_die() anyway
+ * (happens on i386 because of stack parameter passing).
+ *
+ * A cleaner solution is to use makecontext + setcontext
+ * to create a genuine separate stack and execute on it.
+ */
+ }
+
+ if (seccomp_filtering)
+ tcp->flags |= TCB_SECCOMP_FILTER;
+
+ /*
+ * A case where straced process is part of a pipe:
+ * { sleep 1; yes | head -n99999; } | strace -o/dev/null sh -c 'exec <&-; sleep 9'
+ * If strace won't close its fd#0, closing it in tracee is not enough:
+ * the pipe is still open, it has a reader. Thus, "head" will not get its
+ * SIGPIPE at once, on the first write.
+ *
+ * Preventing it by redirecting strace's stdin/out.
+ * (Don't leave fds 0 and 1 closed, this is bad practice: future opens
+ * will reuse them, unexpectedly making a newly opened object "stdin").
+ */
+ redirect_standard_fds();
+}
+
+static void
+test_ptrace_seize(void)
+{
+ int pid;
+
+ /* Need fork for test. NOMMU has no forks */
+ if (NOMMU_SYSTEM) {
+ post_attach_sigstop = 0; /* this sets use_seize to 1 */
+ return;
+ }
+
+ pid = fork();
+ if (pid < 0)
+ perror_func_msg_and_die("fork");
+
+ if (pid == 0) {
+ pause();
+ _exit(0);
+ }
+
+ /* PTRACE_SEIZE, unlike ATTACH, doesn't force tracee to trap. After
+ * attaching tracee continues to run unless a trap condition occurs.
+ * PTRACE_SEIZE doesn't affect signal or group stop state.
+ */
+ if (ptrace(PTRACE_SEIZE, pid, 0, 0) == 0) {
+ post_attach_sigstop = 0; /* this sets use_seize to 1 */
+ } else {
+ debug_msg("PTRACE_SEIZE doesn't work");
+ }
+
+ kill(pid, SIGKILL);
+
+ while (1) {
+ int status, tracee_pid;
+
+ errno = 0;
+ tracee_pid = waitpid(pid, &status, 0);
+ if (tracee_pid <= 0) {
+ if (errno == EINTR)
+ continue;
+ perror_func_msg_and_die("unexpected wait result %d",
+ tracee_pid);
+ }
+ if (WIFSIGNALED(status))
+ return;
+
+ error_func_msg_and_die("unexpected wait status %#x", status);
+ }
+}
+
+static unsigned int
+get_os_release(void)
+{
+ struct utsname u;
+ if (uname(&u) < 0)
+ perror_msg_and_die("uname");
+ /*
+ * u.release string consists of at most three parts
+ * and normally has this form: "3.2.9[-some-garbage]",
+ * "X.Y-something" means "X.Y.0".
+ */
+ const char *p = u.release;
+ unsigned int rel = 0;
+ for (unsigned int parts = 0; parts < 3; ++parts) {
+ unsigned int n = 0;
+ for (; (*p >= '0') && (*p <= '9'); ++p) {
+ n *= 10;
+ n += *p - '0';
+ }
+ rel <<= 8;
+ rel |= n;
+ if (*p == '.')
+ ++p;
+ }
+ return rel;
+}
+
+static void
+set_sighandler(int signo, void (*sighandler)(int), struct sigaction *oldact)
+{
+ const struct sigaction sa = { .sa_handler = sighandler };
+ sigaction(signo, &sa, oldact);
+}
+
+static int
+parse_interruptible_arg(const char *arg)
+{
+ static const struct xlat_data intr_str[] = {
+ { INTR_ANYWHERE, "anywhere" },
+ { INTR_ANYWHERE, "always" },
+ { INTR_WHILE_WAIT, "waiting" },
+ { INTR_NEVER, "never" },
+ { INTR_BLOCK_TSTP_TOO, "never_tstp" },
+ };
+
+ const struct xlat_data *intr_arg = find_xlat_val(intr_str, arg);
+
+ return intr_arg ? (int) intr_arg->val
+ : (int) string_to_uint_upto(arg, NUM_INTR_OPTS - 1);
+}
+
+static int
+parse_ts_arg(const char *in_arg)
+{
+ static const char format_pfx[] = "format:";
+ static const char scale_pfx[] = "precision:";
+
+ enum {
+ TOKEN_FORMAT = 1 << 0,
+ TOKEN_SCALE = 1 << 1,
+ } token_type;
+ enum {
+ FK_UNSET,
+ FK_NONE,
+ FK_TIME,
+ FK_UNIX,
+ } format_kind = FK_UNSET;
+ int precision_width;
+ int precision_scale = 0;
+ char *arg = xstrdup(in_arg);
+ char *saveptr = NULL;
+
+ for (const char *token = strtok_r(arg, ",", &saveptr);
+ token; token = strtok_r(NULL, ",", &saveptr)) {
+ token_type = TOKEN_FORMAT | TOKEN_SCALE;
+
+ if (!strncasecmp(token, format_pfx, sizeof(format_pfx) - 1)) {
+ token += sizeof(format_pfx) - 1;
+ token_type = TOKEN_FORMAT;
+ } else if (!strncasecmp(token, scale_pfx,
+ sizeof(scale_pfx) - 1)) {
+ token += sizeof(scale_pfx) - 1;
+ token_type = TOKEN_SCALE;
+
+ }
+
+ if (token_type & TOKEN_FORMAT) {
+ if (!strcasecmp(token, "none")) {
+ format_kind = FK_NONE;
+ continue;
+ } else if (!strcasecmp(token, "time")) {
+ format_kind = FK_TIME;
+ continue;
+ } else if (!strcasecmp(token, "unix")) {
+ format_kind = FK_UNIX;
+ continue;
+ }
+ }
+
+ if (token_type & TOKEN_SCALE) {
+ precision_scale =
+ str2timescale_optarg(token, &precision_width);
+
+ if (precision_scale > 0)
+ continue;
+ }
+
+ free(arg);
+ return -1;
+ }
+
+ switch (format_kind) {
+ case FK_UNSET:
+ if (!tflag_format)
+ tflag_format = "%T";
+ break;
+ case FK_NONE:
+ tflag_format = NULL;
+ break;
+ case FK_TIME:
+ tflag_format = "%T";
+ break;
+ case FK_UNIX:
+ tflag_format = "%s";
+ break;
+ }
+
+ if (precision_scale > 0) {
+ tflag_scale = precision_scale;
+ tflag_width = precision_width;
+ }
+
+ free(arg);
+ return 0;
+}
+
+static void
+remove_from_env(char **env, size_t *env_count, const char *var)
+{
+ const size_t len = strlen(var);
+ size_t w = 0;
+
+ debug_func_msg("Removing variable \"%s\" from the command environment",
+ var);
+
+ for (size_t r = 0; r < *env_count; ++r) {
+ if (!strncmp(env[r], var, len) &&
+ (env[r][len] == '=' || env[r][len] == '\0')) {
+ debug_func_msg("Skipping entry %zu (\"%s\")",
+ r, env[r]);
+ continue;
+ }
+ if (w < r) {
+ debug_func_msg("Copying entry %zu to %zu", r, w);
+ env[w] = env[r];
+ }
+ ++w;
+ }
+
+ if (w < *env_count) {
+ debug_func_msg("Decreasing env count from %zu to %zu",
+ *env_count, w);
+ *env_count = w;
+ }
+}
+
+static void
+add_to_env(char **env, size_t *env_count, char *var, const size_t len)
+{
+ size_t r;
+
+ for (r = 0; r < *env_count; ++r) {
+ if (!strncmp(env[r], var, len) &&
+ (env[r][len] == '=' || env[r][len] == '\0'))
+ break;
+ }
+
+ if (r < *env_count) {
+ debug_func_msg("Replacing entry %zu (\"%s\")"
+ ", key=\"%.*s\", var=\"%s\"",
+ r, env[r], (int) len, var, var);
+ } else {
+ debug_func_msg("Adding entry %zu"
+ ", key=\"%.*s\", var=\"%s\"",
+ r, (int) len, var, var);
+ *env_count += 1;
+ }
+
+ env[r] = var;
+}
+
+static void
+update_env(char **env, size_t *env_count, char *var)
+{
+ char *val = strchr(var, '=');
+
+ if (val)
+ add_to_env(env, env_count, var, val - var);
+ else
+ remove_from_env(env, env_count, var);
+}
+
+static char **
+make_env(char **orig_env, char *const *env_changes, size_t env_change_count)
+{
+ if (!env_change_count)
+ return orig_env;
+
+ char **new_env;
+ size_t new_env_count = 0;
+ size_t new_env_size;
+
+ /* Determining the environment variable count. */
+ if (orig_env) {
+ for (; orig_env[new_env_count]; ++new_env_count)
+ ;
+ }
+ new_env_size = new_env_count + env_change_count;
+
+ if (new_env_size < new_env_count || new_env_size < env_change_count ||
+ new_env_size + 1 < new_env_size)
+ error_msg_and_die("Cannot construct new environment: the sum "
+ "of old environment variable count (%zu) and "
+ "environment changes count (%zu) is too big",
+ new_env_count, env_change_count);
+
+ new_env_size++;
+ new_env = xallocarray(new_env_size, sizeof(*new_env));
+ if (new_env_count)
+ memcpy(new_env, orig_env, new_env_count * sizeof(*orig_env));
+
+ for (size_t i = 0; i < env_change_count; ++i)
+ update_env(new_env, &new_env_count, env_changes[i]);
+
+ new_env[new_env_count] = NULL;
+
+ return new_env;
+}
+
+/*
+ * Initialization part of main() was eating much stack (~0.5k),
+ * which was unused after init.
+ * We can reuse it if we move init code into a separate function.
+ *
+ * Don't want main() to inline us and defeat the reason
+ * we have a separate function.
+ */
+static void ATTRIBUTE_NOINLINE
+init(int argc, char *argv[])
+{
+ static const char qflag_qual[] = "attach,personality";
+ static const char qqflag_qual[] = "exit,attach,personality";
+ static const char qqqflag_qual[] = "all";
+ static const char yflag_qual[] = "path";
+ static const char yyflag_qual[] = "all";
+ static const char tflag_str[] = "format:time";
+ static const char ttflag_str[] = "precision:us,format:time";
+ static const char tttflag_str[] = "format:unix,precision:us";
+
+ int c, i;
+ int optF = 0, zflags = 0;
+ int lopt_idx;
+ int daemonized_tracer_long = DAEMONIZE_NONE;
+ int xflag_long = HEXSTR_NONE;
+ int qflag_short = 0;
+ int followfork_short = 0;
+ int yflag_short = 0;
+ bool tflag_long_set = false;
+ int tflag_short = 0;
+ bool columns_set = false;
+ bool sortby_set = false;
+
+ /*
+ * We can initialise global_path_set only after tracing backend
+ * initialisation, so we store pointers to all the paths from
+ * command-line arguments during parsing in this array and then,
+ * after the successful backend initialisation, iterate over it
+ * in order to add them to global_path_set.
+ */
+ const char **pathtrace_paths = NULL;
+ size_t pathtrace_size = 0;
+ size_t pathtrace_count = 0;
+
+ /**
+ * Storage for environment changes requested for command. They
+ * are stored in a temporary array and not applied as is during
+ * command line parsing for two reasons:
+ * - putenv() changes environment of the tracer as well,
+ * which is unacceptable.
+ * - Environment changes have to be applied
+ * in a tracing-backend-specific way.
+ */
+ char **env_changes = NULL;
+ size_t env_change_size = 0;
+ size_t env_change_count = 0;
+
+ if (!program_invocation_name || !*program_invocation_name) {
+ static char name[] = "strace";
+ program_invocation_name =
+ (argc > 0 && argv[0] && *argv[0]) ? argv[0] : name;
+ }
+
+ strace_tracer_pid = getpid();
+
+ os_release = get_os_release();
+
+ pidns_init();
+
+ shared_log = stderr;
+ set_sortby(DEFAULT_SORTBY);
+ set_personality(DEFAULT_PERSONALITY);
+ qualify_trace("all");
+ qualify_abbrev("all");
+ qualify_verbose("all");
+#if DEFAULT_QUAL_FLAGS != (QUAL_TRACE | QUAL_ABBREV | QUAL_VERBOSE)
+# error Bug in DEFAULT_QUAL_FLAGS
+#endif
+ qualify_status("all");
+ qualify_quiet("none");
+ qualify_decode_fd("none");
+ qualify_signals("all");
+
+ static const char optstring[] =
+ "+a:Ab:cCdDe:E:fFhiI:kno:O:p:P:qrs:S:tTu:U:vVwxX:yzZ";
+
+ enum {
+ GETOPT_SECCOMP = 0x100,
+ GETOPT_DAEMONIZE,
+ GETOPT_HEX_STR,
+ GETOPT_FOLLOWFORKS,
+ GETOPT_OUTPUT_SEPARATELY,
+ GETOPT_TS,
+ GETOPT_PIDNS_TRANSLATION,
+
+ GETOPT_QUAL_TRACE,
+ GETOPT_QUAL_ABBREV,
+ GETOPT_QUAL_VERBOSE,
+ GETOPT_QUAL_RAW,
+ GETOPT_QUAL_SIGNAL,
+ GETOPT_QUAL_STATUS,
+ GETOPT_QUAL_READ,
+ GETOPT_QUAL_WRITE,
+ GETOPT_QUAL_FAULT,
+ GETOPT_QUAL_INJECT,
+ GETOPT_QUAL_KVM,
+ GETOPT_QUAL_QUIET,
+ GETOPT_QUAL_DECODE_FD,
+ };
+ static const struct option longopts[] = {
+ { "columns", required_argument, 0, 'a' },
+ { "output-append-mode", no_argument, 0, 'A' },
+ { "detach-on", required_argument, 0, 'b' },
+ { "summary-only", no_argument, 0, 'c' },
+ { "summary", no_argument, 0, 'C' },
+ { "debug", no_argument, 0, 'd' },
+ { "daemonize", optional_argument, 0, GETOPT_DAEMONIZE },
+ { "daemonised", optional_argument, 0, GETOPT_DAEMONIZE },
+ { "daemonized", optional_argument, 0, GETOPT_DAEMONIZE },
+ { "env", required_argument, 0, 'E' },
+ { "follow-forks", no_argument, 0, GETOPT_FOLLOWFORKS },
+ { "output-separately", no_argument, 0,
+ GETOPT_OUTPUT_SEPARATELY },
+ { "help", no_argument, 0, 'h' },
+ { "instruction-pointer", no_argument, 0, 'i' },
+ { "interruptible", required_argument, 0, 'I' },
+ { "stack-traces", no_argument, 0, 'k' },
+ { "syscall-number", no_argument, 0, 'n' },
+ { "output", required_argument, 0, 'o' },
+ { "summary-syscall-overhead", required_argument, 0, 'O' },
+ { "attach", required_argument, 0, 'p' },
+ { "trace-path", required_argument, 0, 'P' },
+ { "relative-timestamps", optional_argument, 0, 'r' },
+ { "string-limit", required_argument, 0, 's' },
+ { "summary-sort-by", required_argument, 0, 'S' },
+ { "absolute-timestamps", optional_argument, 0, GETOPT_TS },
+ { "timestamps", optional_argument, 0, GETOPT_TS },
+ { "syscall-times", optional_argument, 0, 'T' },
+ { "user", required_argument, 0, 'u' },
+ { "summary-columns", required_argument, 0, 'U' },
+ { "no-abbrev", no_argument, 0, 'v' },
+ { "version", no_argument, 0, 'V' },
+ { "summary-wall-clock", no_argument, 0, 'w' },
+ { "strings-in-hex", optional_argument, 0, GETOPT_HEX_STR },
+ { "const-print-style", required_argument, 0, 'X' },
+ { "pidns-translation", no_argument , 0, GETOPT_PIDNS_TRANSLATION },
+ { "successful-only", no_argument, 0, 'z' },
+ { "failed-only", no_argument, 0, 'Z' },
+ { "failing-only", no_argument, 0, 'Z' },
+ { "seccomp-bpf", no_argument, 0, GETOPT_SECCOMP },
+
+ { "trace", required_argument, 0, GETOPT_QUAL_TRACE },
+ { "abbrev", required_argument, 0, GETOPT_QUAL_ABBREV },
+ { "verbose", required_argument, 0, GETOPT_QUAL_VERBOSE },
+ { "raw", required_argument, 0, GETOPT_QUAL_RAW },
+ { "signals", required_argument, 0, GETOPT_QUAL_SIGNAL },
+ { "status", required_argument, 0, GETOPT_QUAL_STATUS },
+ { "read", required_argument, 0, GETOPT_QUAL_READ },
+ { "write", required_argument, 0, GETOPT_QUAL_WRITE },
+ { "fault", required_argument, 0, GETOPT_QUAL_FAULT },
+ { "inject", required_argument, 0, GETOPT_QUAL_INJECT },
+ { "kvm", required_argument, 0, GETOPT_QUAL_KVM },
+ { "quiet", optional_argument, 0, GETOPT_QUAL_QUIET },
+ { "silent", optional_argument, 0, GETOPT_QUAL_QUIET },
+ { "silence", optional_argument, 0, GETOPT_QUAL_QUIET },
+ { "decode-fds", optional_argument, 0, GETOPT_QUAL_DECODE_FD },
+
+ { 0, 0, 0, 0 }
+ };
+
+ lopt_idx = -1;
+ while ((c = getopt_long(argc, argv, optstring, longopts, &lopt_idx)) != EOF) {
+ const struct option *lopt = lopt_idx >= 0
+ && (unsigned) lopt_idx < ARRAY_SIZE(longopts)
+ ? longopts + lopt_idx : NULL;
+ lopt_idx = -1;
+
+ switch (c) {
+ case 'a':
+ acolumn = string_to_uint(optarg);
+ if (acolumn < 0)
+ error_opt_arg(c, lopt, optarg);
+ break;
+ case 'A':
+ open_append = true;
+ break;
+ case 'b':
+ if (strcmp(optarg, "execve") != 0)
+ error_msg_and_die("Syscall '%s' for -b isn't supported",
+ optarg);
+ detach_on_execve = 1;
+ break;
+ case 'c':
+ if (cflag == CFLAG_BOTH) {
+ error_msg_and_help("-c/--summary-only and "
+ "-C/--summary are mutually "
+ "exclusive");
+ }
+ cflag = CFLAG_ONLY_STATS;
+ break;
+ case 'C':
+ if (cflag == CFLAG_ONLY_STATS) {
+ error_msg_and_help("-c/--summary-only and "
+ "-C/--summary are mutually "
+ "exclusive");
+ }
+ cflag = CFLAG_BOTH;
+ break;
+ case 'd':
+ debug_flag = 1;
+ break;
+ case 'D':
+ daemonized_tracer++;
+ break;
+ case GETOPT_DAEMONIZE:
+ daemonized_tracer_long =
+ find_arg_val(optarg, daemonize_str,
+ DAEMONIZE_GRANDCHILD,
+ DAEMONIZE_NONE);
+ if (daemonized_tracer_long <= DAEMONIZE_NONE)
+ error_opt_arg(c, lopt, optarg);
+ break;
+ case 'e':
+ qualify(optarg);
+ break;
+ case 'E':
+ if (env_change_count >= env_change_size)
+ env_changes = xgrowarray(env_changes,
+ &env_change_size,
+ sizeof(*env_changes));
+
+ env_changes[env_change_count++] = optarg;
+ break;
+ case 'f':
+ followfork_short++;
+ break;
+ case GETOPT_FOLLOWFORKS:
+ followfork = true;
+ break;
+ case GETOPT_OUTPUT_SEPARATELY:
+ output_separately = true;
+ break;
+ case 'F':
+ optF = 1;
+ break;
+ case 'h':
+ usage();
+ break;
+ case 'i':
+ iflag = 1;
+ break;
+ case 'I':
+ opt_intr = parse_interruptible_arg(optarg);
+ if (opt_intr <= 0)
+ error_opt_arg(c, lopt, optarg);
+ break;
+ case 'k':
+#ifdef ENABLE_STACKTRACE
+ stack_trace_enabled = true;
+#else
+ error_msg_and_die("Stack traces (-k/--stack-traces "
+ "option) are not supported by this "
+ "build of strace");
+#endif
+ break;
+ case 'n':
+ nflag = 1;
+ break;
+ case 'o':
+ outfname = optarg;
+ break;
+ case 'O':
+ if (set_overhead(optarg) < 0)
+ error_opt_arg(c, lopt, optarg);
+ break;
+ case 'p':
+ process_opt_p_list(optarg);
+ break;
+ case 'P':
+ if (pathtrace_count >= pathtrace_size)
+ pathtrace_paths = xgrowarray(pathtrace_paths,
+ &pathtrace_size,
+ sizeof(pathtrace_paths[0]));
+
+ pathtrace_paths[pathtrace_count++] = optarg;
+ break;
+ case 'q':
+ qflag_short++;
+ break;
+ case 'r':
+ rflag = 1;
+ rflag_width = 6;
+ rflag_scale = str2timescale_optarg(optarg,
+ &rflag_width);
+ if (rflag_scale < 0)
+ error_opt_arg(c, lopt, optarg);
+ break;
+ case 's':
+ i = string_to_uint(optarg);
+ if (i < 0 || (unsigned int) i > -1U / 4)
+ error_opt_arg(c, lopt, optarg);
+ max_strlen = i;
+ break;
+ case 'S':
+ set_sortby(optarg);
+ sortby_set = true;
+ break;
+ case 't':
+ tflag_short++;
+ break;
+ case GETOPT_TS:
+ tflag_long_set = true;
+ if (parse_ts_arg(optarg ?: tflag_str))
+ error_opt_arg(c, lopt, optarg);
+ break;
+ case 'T':
+ Tflag = 1;
+ Tflag_width = 6;
+ Tflag_scale = str2timescale_optarg(optarg,
+ &Tflag_width);
+ if (Tflag_scale < 0)
+ error_opt_arg(c, lopt, optarg);
+ break;
+ case 'u':
+ username = optarg;
+ break;
+ case 'U':
+ columns_set = true;
+ set_count_summary_columns(optarg);
+ break;
+ case 'v':
+ qualify_abbrev("none");
+ break;
+ case 'V':
+ print_version();
+ exit(0);
+ break;
+ case 'w':
+ count_wallclock = 1;
+ break;
+ case 'x':
+ xflag++;
+ break;
+ case GETOPT_HEX_STR:
+ xflag_long = find_arg_val(optarg, xflag_str,
+ HEXSTR_ALL, HEXSTR_NONE);
+ if (xflag_long <= HEXSTR_NONE)
+ error_opt_arg(c, lopt, optarg);
+ break;
+ case 'X':
+ if (!strcmp(optarg, "raw"))
+ xlat_verbosity = XLAT_STYLE_RAW;
+ else if (!strcmp(optarg, "abbrev"))
+ xlat_verbosity = XLAT_STYLE_ABBREV;
+ else if (!strcmp(optarg, "verbose"))
+ xlat_verbosity = XLAT_STYLE_VERBOSE;
+ else
+ error_opt_arg(c, lopt, optarg);
+ break;
+ case 'y':
+ yflag_short++;
+ break;
+ case GETOPT_PIDNS_TRANSLATION:
+ pidns_translation++;
+ break;
+ case 'z':
+ clear_number_set_array(status_set, 1);
+ add_number_to_set(STATUS_SUCCESSFUL, status_set);
+ zflags++;
+ break;
+ case 'Z':
+ clear_number_set_array(status_set, 1);
+ add_number_to_set(STATUS_FAILED, status_set);
+ zflags++;
+ break;
+ case GETOPT_SECCOMP:
+ seccomp_filtering = true;
+ break;
+ case GETOPT_QUAL_TRACE:
+ qualify_trace(optarg);
+ break;
+ case GETOPT_QUAL_ABBREV:
+ qualify_abbrev(optarg);
+ break;
+ case GETOPT_QUAL_VERBOSE:
+ qualify_verbose(optarg);
+ break;
+ case GETOPT_QUAL_RAW:
+ qualify_raw(optarg);
+ break;
+ case GETOPT_QUAL_SIGNAL:
+ qualify_signals(optarg);
+ break;
+ case GETOPT_QUAL_STATUS:
+ qualify_status(optarg);
+ break;
+ case GETOPT_QUAL_READ:
+ qualify_read(optarg);
+ break;
+ case GETOPT_QUAL_WRITE:
+ qualify_write(optarg);
+ break;
+ case GETOPT_QUAL_FAULT:
+ qualify_fault(optarg);
+ break;
+ case GETOPT_QUAL_INJECT:
+ qualify_inject(optarg);
+ break;
+ case GETOPT_QUAL_KVM:
+ qualify_kvm(optarg);
+ break;
+ case GETOPT_QUAL_QUIET:
+ qualify_quiet(optarg ?: qflag_qual);
+ break;
+ case GETOPT_QUAL_DECODE_FD:
+ qualify_decode_fd(optarg ?: yflag_qual);
+ break;
+ default:
+ error_msg_and_help(NULL);
+ break;
+ }
+ }
+
+ argv += optind;
+ argc -= optind;
+
+ if (argc < 0 || (!nprocs && !argc)) {
+ error_msg_and_help("must have PROG [ARGS] or -p PID");
+ }
+
+ if (daemonized_tracer_long) {
+ if (daemonized_tracer) {
+ error_msg_and_die("-D and --daemonize cannot"
+ " be provided simultaneously");
+ } else {
+ daemonized_tracer = daemonized_tracer_long;
+ }
+ }
+
+ if (!argc && daemonized_tracer) {
+ error_msg_and_help("PROG [ARGS] must be specified with "
+ "-D/--daemonize");
+ }
+
+ if (daemonized_tracer > (unsigned int) MAX_DAEMONIZE_OPTS)
+ error_msg_and_help("Too many -D's (%u), maximum supported -D "
+ "count is %d",
+ daemonized_tracer, MAX_DAEMONIZE_OPTS);
+
+ if (tflag_short) {
+ if (tflag_long_set) {
+ error_msg_and_die("-t and --absolute-timestamps cannot"
+ " be provided simultaneously");
+ }
+
+ parse_ts_arg(tflag_short == 1 ? tflag_str :
+ tflag_short == 2 ? ttflag_str : tttflag_str);
+ }
+
+ if (xflag_long) {
+ if (xflag) {
+ error_msg_and_die("-x and --strings-in-hex cannot"
+ " be provided simultaneously");
+ } else {
+ xflag = xflag_long;
+ }
+ }
+
+ if (yflag_short) {
+ if (decode_fd_set_updated) {
+ error_msg_and_die("-y and --decode-fds cannot"
+ " be provided simultaneously");
+ }
+
+ qualify_decode_fd(yflag_short == 1 ? yflag_qual : yyflag_qual);
+ }
+
+ if (seccomp_filtering && detach_on_execve) {
+ error_msg("--seccomp-bpf is not enabled because"
+ " it is not compatible with -b");
+ seccomp_filtering = false;
+ }
+
+ if (followfork_short) {
+ if (followfork) {
+ error_msg_and_die("-f and --follow-forks cannot"
+ " be provided simultaneously");
+ } else if (followfork_short >= 2 && output_separately) {
+ error_msg_and_die("-ff and --output-separately cannot"
+ " be provided simultaneously");
+ } else {
+ followfork = true;
+ output_separately = followfork_short >= 2;
+ }
+ }
+
+ if (seccomp_filtering) {
+ if (nprocs && (!argc || debug_flag))
+ error_msg("--seccomp-bpf is not enabled for processes"
+ " attached with -p");
+ if (!followfork) {
+ error_msg("--seccomp-bpf cannot be used without "
+ "-f/--follow-forks, disabling");
+ seccomp_filtering = false;
+ }
+ }
+
+ if (optF) {
+ if (followfork) {
+ error_msg("deprecated option -F ignored");
+ } else {
+ error_msg("option -F is deprecated, "
+ "please use -f/--follow-forks instead");
+ followfork = true;
+ }
+ }
+
+ if (output_separately && cflag) {
+ error_msg_and_help("(-c/--summary-only or -C/--summary) and"
+ " -ff/--output-separately"
+ " are mutually exclusive");
+ }
+
+ if (count_wallclock && !cflag) {
+ error_msg_and_help("-w/--summary-wall-clock must be given with"
+ " (-c/--summary-only or -C/--summary)");
+ }
+
+ if (columns_set && !cflag) {
+ error_msg_and_help("-U/--summary-columns must be given with"
+ " (-c/--summary-only or -C/--summary)");
+ }
+
+ if (sortby_set && !cflag) {
+ error_msg("-S/--summary-sort-by has no effect without"
+ " (-c/--summary-only or -C/--summary)");
+ }
+
+ if (cflag == CFLAG_ONLY_STATS) {
+ if (iflag)
+ error_msg("-i/--instruction-pointer has no effect "
+ "with -c/--summary-only");
+ if (stack_trace_enabled)
+ error_msg("-k/--stack-traces has no effect "
+ "with -c/--summary-only");
+ if (nflag)
+ error_msg("-n/--syscall-number has no effect "
+ "with -c/--summary-only");
+ if (rflag)
+ error_msg("-r/--relative-timestamps has no effect "
+ "with -c/--summary-only");
+ if (tflag_format)
+ error_msg("-t/--absolute-timestamps has no effect "
+ "with -c/--summary-only");
+ if (Tflag)
+ error_msg("-T/--syscall-times has no effect "
+ "with -c/--summary-only");
+ if (!number_set_array_is_empty(decode_fd_set, 0))
+ error_msg("-y/--decode-fds has no effect "
+ "with -c/--summary-only");
+ }
+
+ if (!outfname) {
+ if (output_separately && !followfork)
+ error_msg("--output-separately has no effect "
+ "without -o/--output");
+ if (open_append)
+ error_msg("-A/--output-append-mode has no effect "
+ "without -o/--output");
+ }
+
+#ifndef HAVE_OPEN_MEMSTREAM
+ if (!is_complete_set(status_set, NUMBER_OF_STATUSES))
+ error_msg_and_help("open_memstream is required to use -z, -Z, or -e status");
+#endif
+
+ if (zflags > 1)
+ error_msg("Only the last of "
+ "-z/--successful-only/-Z/--failed-only options will "
+ "take effect. "
+ "See status qualifier for more complex filters.");
+
+ for (size_t cnt = 0; cnt < pathtrace_count; ++cnt)
+ pathtrace_select(pathtrace_paths[cnt]);
+ free(pathtrace_paths);
+
+ acolumn_spaces = xmalloc(acolumn + 1);
+ memset(acolumn_spaces, ' ', acolumn);
+ acolumn_spaces[acolumn] = '\0';
+
+ set_sighandler(SIGCHLD, SIG_DFL, &params_for_tracee.child_sa);
+
+#ifdef ENABLE_STACKTRACE
+ if (stack_trace_enabled)
+ unwind_init();
+#endif
+
+ /* See if they want to run as another user. */
+ if (username != NULL) {
+ struct passwd *pent;
+
+ if (getuid() != 0 || geteuid() != 0) {
+ error_msg_and_die("You must be root to use "
+ "the -u/--username option");
+ }
+ pent = getpwnam(username);
+ if (pent == NULL) {
+ error_msg_and_die("Cannot find user '%s'", username);
+ }
+ run_uid = pent->pw_uid;
+ run_gid = pent->pw_gid;
+ } else {
+ run_uid = getuid();
+ run_gid = getgid();
+ }
+
+ if (followfork)
+ ptrace_setoptions |= PTRACE_O_TRACECLONE |
+ PTRACE_O_TRACEFORK |
+ PTRACE_O_TRACEVFORK;
+
+ if (seccomp_filtering)
+ check_seccomp_filter();
+ if (seccomp_filtering)
+ ptrace_setoptions |= PTRACE_O_TRACESECCOMP;
+
+ debug_msg("ptrace_setoptions = %#x", ptrace_setoptions);
+ test_ptrace_seize();
+ test_ptrace_get_syscall_info();
+
+ /*
+ * Is something weird with our stdin and/or stdout -
+ * for example, may they be not open? In this case,
+ * ensure that none of the future opens uses them.
+ *
+ * This was seen in the wild when /proc/sys/kernel/core_pattern
+ * was set to "|/bin/strace -o/tmp/LOG PROG":
+ * kernel runs coredump helper with fd#0 open but fd#1 closed (!),
+ * therefore LOG gets opened to fd#1, and fd#1 is closed by
+ * "don't hold up stdin/out open" code soon after.
+ */
+ ensure_standard_fds_opened();
+
+ /* Check if they want to redirect the output. */
+ if (outfname) {
+ /* See if they want to pipe the output. */
+ if (outfname[0] == '|' || outfname[0] == '!') {
+ /*
+ * We can't do the <outfname>.PID funny business
+ * when using popen, so prohibit it.
+ */
+ if (output_separately)
+ error_msg_and_help("piping the output and "
+ "-ff/--output-separately "
+ "are mutually exclusive");
+ shared_log = strace_popen(outfname + 1);
+ } else if (!output_separately) {
+ shared_log = strace_fopen(outfname);
+ } else if (strlen(outfname) >= PATH_MAX - sizeof(int) * 3) {
+ errno = ENAMETOOLONG;
+ perror_msg_and_die("%s", outfname);
+ }
+ } else {
+ /* -ff without -o FILE is the same as single -f */
+ output_separately = false;
+ }
+
+ if (!outfname || outfname[0] == '|' || outfname[0] == '!') {
+ setvbuf(shared_log, NULL, _IOLBF, 0);
+ }
+
+ /*
+ * argv[0] -pPID -oFILE Default interactive setting
+ * yes * 0 INTR_WHILE_WAIT
+ * no 1 0 INTR_WHILE_WAIT
+ * yes * 1 INTR_NEVER
+ * no 1 1 INTR_WHILE_WAIT
+ */
+
+ if (daemonized_tracer && !opt_intr)
+ opt_intr = INTR_BLOCK_TSTP_TOO;
+ if (outfname && argc) {
+ if (!opt_intr)
+ opt_intr = INTR_NEVER;
+ if (!qflag_short && !quiet_set_updated)
+ qflag_short = 1;
+ }
+ if (!opt_intr)
+ opt_intr = INTR_WHILE_WAIT;
+
+ if (qflag_short) {
+ if (quiet_set_updated) {
+ error_msg_and_die("-q and -e quiet/--quiet cannot"
+ " be provided simultaneously");
+ }
+
+ qualify_quiet(qflag_short == 1 ? qflag_qual :
+ qflag_short == 2 ? qqflag_qual : qqqflag_qual);
+ }
+
+ /*
+ * startup_child() must be called before the signal handlers get
+ * installed below as they are inherited into the spawned process.
+ * Also we do not need to be protected by them as during interruption
+ * in the startup_child() mode we kill the spawned process anyway.
+ */
+ if (argc) {
+ char **new_environ = make_env(environ, env_changes,
+ env_change_count);
+ free(env_changes);
+
+ startup_child(argv, new_environ);
+
+ /*
+ * On a NOMMU system, new_environ can be freed only after exec
+ * in child, so we leak it in that case, similar to pathname
+ * in startup_child().
+ */
+ if (new_environ != environ && !NOMMU_SYSTEM)
+ free(new_environ);
+ }
+
+ set_sighandler(SIGTTOU, SIG_IGN, NULL);
+ set_sighandler(SIGTTIN, SIG_IGN, NULL);
+ if (opt_intr != INTR_ANYWHERE) {
+ if (opt_intr == INTR_BLOCK_TSTP_TOO)
+ set_sighandler(SIGTSTP, SIG_IGN, NULL);
+ /*
+ * In interactive mode (if no -o OUTFILE, or -p PID is used),
+ * fatal signals are handled asynchronously and acted
+ * when waiting for process state changes.
+ * In non-interactive mode these signals are ignored.
+ */
+ set_sighandler(SIGHUP, interactive ? interrupt : SIG_IGN, NULL);
+ set_sighandler(SIGINT, interactive ? interrupt : SIG_IGN, NULL);
+ set_sighandler(SIGQUIT, interactive ? interrupt : SIG_IGN, NULL);
+ set_sighandler(SIGPIPE, interactive ? interrupt : SIG_IGN, NULL);
+ set_sighandler(SIGTERM, interactive ? interrupt : SIG_IGN, NULL);
+ }
+
+ sigemptyset(&timer_set);
+ sigaddset(&timer_set, SIGALRM);
+ sigprocmask(SIG_BLOCK, &timer_set, NULL);
+ set_sighandler(SIGALRM, timer_sighandler, NULL);
+
+ if (nprocs != 0 || daemonized_tracer)
+ startup_attach();
+
+ /* Do we want pids printed in our -o OUTFILE?
+ * -ff: no (every pid has its own file); or
+ * -f: yes (there can be more pids in the future); or
+ * -p PID1,PID2: yes (there are already more than one pid)
+ */
+ print_pid_pfx = outfname && !output_separately &&
+ ((followfork && !output_separately) || nprocs > 1);
+}
+
+static struct tcb *
+pid2tcb(const int pid)
+{
+ if (pid <= 0)
+ return NULL;
+
+#define PID2TCB_CACHE_SIZE 1024U
+#define PID2TCB_CACHE_MASK (PID2TCB_CACHE_SIZE - 1)
+
+ static struct tcb *pid2tcb_cache[PID2TCB_CACHE_SIZE];
+ struct tcb **const ptcp = &pid2tcb_cache[pid & PID2TCB_CACHE_MASK];
+ struct tcb *tcp = *ptcp;
+
+ if (tcp && tcp->pid == pid)
+ return tcp;
+
+ for (unsigned int i = 0; i < tcbtabsize; ++i) {
+ tcp = tcbtab[i];
+ if (tcp->pid == pid)
+ return *ptcp = tcp;
+ }
+
+ return NULL;
+}
+
+static void
+cleanup(int fatal_sig)
+{
+ unsigned int i;
+ struct tcb *tcp;
+
+ if (!fatal_sig)
+ fatal_sig = SIGTERM;
+
+ for (i = 0; i < tcbtabsize; i++) {
+ tcp = tcbtab[i];
+ if (!tcp->pid)
+ continue;
+ debug_func_msg("looking at pid %u", tcp->pid);
+ if (tcp->pid == strace_child) {
+ kill(tcp->pid, SIGCONT);
+ kill(tcp->pid, fatal_sig);
+ }
+ detach(tcp);
+ }
+}
+
+static void
+interrupt(int sig)
+{
+ interrupted = sig;
+}
+
+static void
+print_debug_info(const int pid, int status)
+{
+ const unsigned int event = (unsigned int) status >> 16;
+ char buf[sizeof("WIFEXITED,exitcode=%u") + sizeof(int)*3 /*paranoia:*/ + 16];
+ char evbuf[sizeof(",EVENT_VFORK_DONE (%u)") + sizeof(int)*3 /*paranoia:*/ + 16];
+
+ strcpy(buf, "???");
+ if (WIFSIGNALED(status))
+ xsprintf(buf, "WIFSIGNALED,%ssig=%s",
+ WCOREDUMP(status) ? "core," : "",
+ sprintsigname(WTERMSIG(status)));
+ if (WIFEXITED(status))
+ xsprintf(buf, "WIFEXITED,exitcode=%u", WEXITSTATUS(status));
+ if (WIFSTOPPED(status))
+ xsprintf(buf, "WIFSTOPPED,sig=%s",
+ sprintsigname(WSTOPSIG(status)));
+ evbuf[0] = '\0';
+ if (event != 0) {
+ static const char *const event_names[] = {
+ [PTRACE_EVENT_CLONE] = "CLONE",
+ [PTRACE_EVENT_FORK] = "FORK",
+ [PTRACE_EVENT_VFORK] = "VFORK",
+ [PTRACE_EVENT_VFORK_DONE] = "VFORK_DONE",
+ [PTRACE_EVENT_EXEC] = "EXEC",
+ [PTRACE_EVENT_EXIT] = "EXIT",
+ [PTRACE_EVENT_SECCOMP] = "SECCOMP",
+ /* [PTRACE_EVENT_STOP (=128)] would make biggish array */
+ };
+ const char *e = "??";
+ if (event < ARRAY_SIZE(event_names))
+ e = event_names[event];
+ else if (event == PTRACE_EVENT_STOP)
+ e = "STOP";
+ xsprintf(evbuf, ",EVENT_%s (%u)", e, event);
+ }
+ error_msg("[wait(0x%06x) = %u] %s%s", status, pid, buf, evbuf);
+}
+
+static struct tcb *
+maybe_allocate_tcb(const int pid, int status)
+{
+ if (!WIFSTOPPED(status)) {
+ if (detach_on_execve && pid == strace_child) {
+ /* example: strace -bexecve sh -c 'exec true' */
+ strace_child = 0;
+ return NULL;
+ }
+ if (!is_number_in_set(QUIET_EXIT, quiet_set)) {
+ /*
+ * This can happen if we inherited an unknown child.
+ * Example: (sleep 1 & exec strace true)
+ */
+ error_msg("Exit of unknown pid %u ignored", pid);
+ }
+ return NULL;
+ }
+ if (followfork) {
+ /* We assume it's a fork/vfork/clone child */
+ struct tcb *tcp = alloctcb(pid);
+ after_successful_attach(tcp, post_attach_sigstop);
+ if (!is_number_in_set(QUIET_ATTACH, quiet_set))
+ error_msg("Process %d attached", pid);
+ return tcp;
+ } else {
+ /*
+ * This can happen if a clone call misused CLONE_PTRACE itself.
+ *
+ * There used to be a dance around possible re-injection of
+ * WSTOPSIG(status), but it was later removed as the only
+ * observable stop here is the initial ptrace-stop.
+ */
+ ptrace(PTRACE_DETACH, pid, NULL, 0L);
+ if (!is_number_in_set(QUIET_ATTACH, quiet_set))
+ error_msg("Detached unknown pid %d", pid);
+ return NULL;
+ }
+}
+
+/*
+ * Under Linux, execve changes pid to thread leader's pid, and we see this
+ * changed pid on EVENT_EXEC and later, execve sysexit. Leader "disappears"
+ * without exit notification. Let user know that, drop leader's tcb, and fix
+ * up pid in execve thread's tcb. Effectively, execve thread's tcb replaces
+ * leader's tcb.
+ *
+ * BTW, leader is 'stuck undead' (doesn't report WIFEXITED on exit syscall)
+ * in multi-threaded programs exactly in order to handle this case.
+ */
+static struct tcb *
+maybe_switch_tcbs(struct tcb *tcp, const int pid)
+{
+ /*
+ * PTRACE_GETEVENTMSG returns old pid starting from Linux 3.0.
+ * On 2.6 and earlier it can return garbage.
+ */
+ if (os_release < KERNEL_VERSION(3, 0, 0))
+ return NULL;
+
+ const long old_pid = tcb_wait_tab[tcp->wait_data_idx].msg;
+
+ /* Avoid truncation in pid2tcb() param passing */
+ if (old_pid <= 0 || old_pid == pid)
+ return NULL;
+ if ((unsigned long) old_pid > UINT_MAX)
+ return NULL;
+ struct tcb *execve_thread = pid2tcb(old_pid);
+ /* It should be !NULL, but I feel paranoid */
+ if (!execve_thread)
+ return NULL;
+
+ if (execve_thread->curcol != 0) {
+ /*
+ * One case we are here is -ff, try
+ * "strace -oLOG -ff test/threaded_execve".
+ * Another case is demonstrated by
+ * tests/maybe_switch_current_tcp.c
+ */
+ fprintf(execve_thread->outf, " <pid changed to %d ...>\n", pid);
+ /*execve_thread->curcol = 0; - no need, see code below */
+ }
+ /* Swap output FILEs and memstream (needed for -ff) */
+ FILE *fp = execve_thread->outf;
+ execve_thread->outf = tcp->outf;
+ tcp->outf = fp;
+ if (execve_thread->staged_output_data || tcp->staged_output_data) {
+ struct staged_output_data *staged_output_data;
+
+ staged_output_data = execve_thread->staged_output_data;
+ execve_thread->staged_output_data = tcp->staged_output_data;
+ tcp->staged_output_data = staged_output_data;
+ }
+
+ /* And their column positions */
+ execve_thread->curcol = tcp->curcol;
+ tcp->curcol = 0;
+ /* Drop leader, but close execve'd thread outfile (if -ff) */
+ droptcb(tcp);
+ /* Switch to the thread, reusing leader's outfile and pid */
+ tcp = execve_thread;
+ tcp->pid = pid;
+ if (cflag != CFLAG_ONLY_STATS) {
+ if (!is_number_in_set(QUIET_THREAD_EXECVE, quiet_set)) {
+ printleader(tcp);
+ tprintf("+++ superseded by execve in pid %lu +++\n",
+ old_pid);
+ line_ended();
+ }
+ /*
+ * Need to reopen memstream for thread
+ * as we closed it in droptcb.
+ */
+ if (!is_complete_set(status_set, NUMBER_OF_STATUSES))
+ strace_open_memstream(tcp);
+ tcp->flags |= TCB_REPRINT;
+ }
+
+ return tcp;
+}
+
+static struct tcb *
+maybe_switch_current_tcp(void)
+{
+ struct tcb *tcp = maybe_switch_tcbs(current_tcp, current_tcp->pid);
+
+ if (tcp)
+ set_current_tcp(tcp);
+
+ return tcp;
+}
+
+static void
+print_signalled(struct tcb *tcp, const int pid, int status)
+{
+ if (pid == strace_child) {
+ exit_code = 0x100 | WTERMSIG(status);
+ strace_child = 0;
+ }
+
+ if (cflag != CFLAG_ONLY_STATS
+ && is_number_in_set(WTERMSIG(status), signal_set)) {
+ printleader(tcp);
+ tprintf("+++ killed by %s %s+++\n",
+ sprintsigname(WTERMSIG(status)),
+ WCOREDUMP(status) ? "(core dumped) " : "");
+ line_ended();
+ }
+}
+
+static void
+print_exited(struct tcb *tcp, const int pid, int status)
+{
+ if (pid == strace_child) {
+ exit_code = WEXITSTATUS(status);
+ strace_child = 0;
+ }
+
+ if (cflag != CFLAG_ONLY_STATS &&
+ !is_number_in_set(QUIET_EXIT, quiet_set)) {
+ printleader(tcp);
+ tprintf("+++ exited with %d +++\n", WEXITSTATUS(status));
+ line_ended();
+ }
+}
+
+static void
+print_stopped(struct tcb *tcp, const siginfo_t *si, const unsigned int sig)
+{
+ if (cflag != CFLAG_ONLY_STATS
+ && !hide_log(tcp)
+ && is_number_in_set(sig, signal_set)) {
+ printleader(tcp);
+ if (si) {
+ tprintf("--- %s ", sprintsigname(sig));
+ printsiginfo(tcp, si);
+ tprints(" ---\n");
+ } else
+ tprintf("--- stopped by %s ---\n", sprintsigname(sig));
+ line_ended();
+
+#ifdef ENABLE_STACKTRACE
+ if (stack_trace_enabled)
+ unwind_tcb_print(tcp);
+#endif
+ }
+}
+
+static void
+startup_tcb(struct tcb *tcp)
+{
+ debug_msg("pid %d has TCB_STARTUP, initializing it", tcp->pid);
+
+ tcp->flags &= ~TCB_STARTUP;
+
+ if (!use_seize) {
+ debug_msg("setting opts 0x%x on pid %d",
+ ptrace_setoptions, tcp->pid);
+ if (ptrace(PTRACE_SETOPTIONS, tcp->pid, NULL, ptrace_setoptions) < 0) {
+ if (errno != ESRCH) {
+ /* Should never happen, really */
+ perror_msg_and_die("PTRACE_SETOPTIONS");
+ }
+ }
+ }
+
+ if ((tcp->flags & TCB_GRABBED) && (get_scno(tcp) == 1))
+ tcp->s_prev_ent = tcp->s_ent;
+
+ if (cflag) {
+ tcp->atime = tcp->stime;
+ }
+}
+
+static void
+print_event_exit(struct tcb *tcp)
+{
+ if (entering(tcp) || filtered(tcp) || hide_log(tcp)
+ || cflag == CFLAG_ONLY_STATS) {
+ return;
+ }
+
+ if (!output_separately && printing_tcp && printing_tcp != tcp
+ && printing_tcp->curcol != 0) {
+ set_current_tcp(printing_tcp);
+ tprints(" <unfinished ...>\n");
+ flush_tcp_output(printing_tcp);
+ printing_tcp->curcol = 0;
+ set_current_tcp(tcp);
+ }
+
+ print_syscall_resume(tcp);
+
+ if (!(tcp->sys_func_rval & RVAL_DECODED)) {
+ /*
+ * The decoder has probably decided to print something
+ * on exiting syscall which is not going to happen.
+ */
+ tprints(" <unfinished ...>");
+ }
+
+ printing_tcp = tcp;
+ tprints(") ");
+ tabto();
+ tprints("= ?\n");
+ if (!is_complete_set(status_set, NUMBER_OF_STATUSES)) {
+ bool publish = is_number_in_set(STATUS_UNFINISHED, status_set);
+ strace_close_memstream(tcp, publish);
+ }
+ line_ended();
+}
+
+static size_t
+trace_wait_data_size(struct tcb *tcp)
+{
+ return sizeof(struct tcb_wait_data);
+}
+
+static struct tcb_wait_data *
+init_trace_wait_data(void *p)
+{
+ struct tcb_wait_data *wd = p;
+
+ memset(wd, 0, sizeof(*wd));
+
+ return wd;
+}
+
+static struct tcb_wait_data *
+copy_trace_wait_data(const struct tcb_wait_data *wd)
+{
+ struct tcb_wait_data *new_wd = xmalloc(sizeof(*new_wd));
+
+ memcpy(new_wd, wd, sizeof(*wd));
+
+ return new_wd;
+}
+
+static void
+free_trace_wait_data(struct tcb_wait_data *wd)
+{
+ free(wd);
+}
+
+static void
+tcb_wait_tab_check_size(const size_t size)
+{
+ while (size >= tcb_wait_tab_size) {
+ tcb_wait_tab = xgrowarray(tcb_wait_tab,
+ &tcb_wait_tab_size,
+ sizeof(tcb_wait_tab[0]));
+ }
+}
+
+static const struct tcb_wait_data *
+next_event(void)
+{
+ if (interrupted)
+ return NULL;
+
+ invalidate_umove_cache();
+
+ struct tcb *tcp = NULL;
+ struct list_item *elem;
+
+ static EMPTY_LIST(pending_tcps);
+ /* Handle the queued tcbs before waiting for new events. */
+ if (!list_is_empty(&pending_tcps))
+ goto next_event_get_tcp;
+
+ static struct tcb *extra_tcp;
+ static size_t wait_extra_data_idx;
+ /* Handle the extra tcb event. */
+ if (extra_tcp) {
+ tcp = extra_tcp;
+ extra_tcp = NULL;
+ tcp->wait_data_idx = wait_extra_data_idx;
+
+ debug_msg("dequeued extra event for pid %u", tcp->pid);
+ goto next_event_exit;
+ }
+
+ /*
+ * Used to exit simply when nprocs hits zero, but in this testcase:
+ * int main(void) { _exit(!!fork()); }
+ * under strace -f, parent sometimes (rarely) manages
+ * to exit before we see the first stop of the child,
+ * and we are losing track of it:
+ * 19923 clone(...) = 19924
+ * 19923 exit_group(1) = ?
+ * 19923 +++ exited with 1 +++
+ * Exiting only when wait() returns ECHILD works better.
+ */
+ if (popen_pid != 0) {
+ /* However, if -o|logger is in use, we can't do that.
+ * Can work around that by double-forking the logger,
+ * but that loses the ability to wait for its completion
+ * on exit. Oh well...
+ */
+ if (nprocs == 0)
+ return NULL;
+ }
+
+ const bool unblock_delay_timer = is_delay_timer_armed();
+
+ /*
+ * The window of opportunity to handle expirations
+ * of the delay timer opens here.
+ *
+ * Unblock the signal handler for the delay timer
+ * iff the delay timer is already created.
+ */
+ if (unblock_delay_timer)
+ sigprocmask(SIG_UNBLOCK, &timer_set, NULL);
+
+ /*
+ * If the delay timer has expired, then its expiration
+ * has been handled already by the signal handler.
+ *
+ * If the delay timer expires during wait4(),
+ * then the system call will be interrupted and
+ * the expiration will be handled by the signal handler.
+ */
+ int status;
+ struct rusage ru;
+ int pid = wait4(-1, &status, __WALL, (cflag ? &ru : NULL));
+ int wait_errno = errno;
+
+ /*
+ * The window of opportunity to handle expirations
+ * of the delay timer closes here.
+ *
+ * Block the signal handler for the delay timer
+ * iff it was unblocked earlier.
+ */
+ if (unblock_delay_timer) {
+ sigprocmask(SIG_BLOCK, &timer_set, NULL);
+
+ if (restart_failed)
+ return NULL;
+ }
+
+ size_t wait_tab_pos = 0;
+ bool wait_nohang = false;
+
+ /*
+ * Wait for new events until wait4() returns 0 (meaning that there's
+ * nothing more to wait for for now), or a second event for some tcb
+ * appears (which may happen if a tracee was SIGKILL'ed, for example).
+ */
+ for (;;) {
+ struct tcb_wait_data *wd;
+
+ if (pid < 0) {
+ if (wait_errno == EINTR)
+ break;
+ if (wait_nohang)
+ break;
+ if (nprocs == 0 && wait_errno == ECHILD)
+ return NULL;
+ /*
+ * If nprocs > 0, ECHILD is not expected,
+ * treat it as any other error here:
+ */
+ errno = wait_errno;
+ perror_msg_and_die("wait4(__WALL)");
+ }
+
+ if (!pid)
+ break;
+
+ if (pid == popen_pid) {
+ if (!WIFSTOPPED(status))
+ popen_pid = 0;
+ break;
+ }
+
+ if (debug_flag)
+ print_debug_info(pid, status);
+
+ /* Look up 'pid' in our table. */
+ tcp = pid2tcb(pid);
+
+ if (!tcp) {
+ tcp = maybe_allocate_tcb(pid, status);
+ if (!tcp)
+ goto next_event_wait_next;
+ }
+
+ if (cflag) {
+ tcp->stime.tv_sec = ru.ru_stime.tv_sec;
+ tcp->stime.tv_nsec = ru.ru_stime.tv_usec * 1000;
+ }
+
+ tcb_wait_tab_check_size(wait_tab_pos);
+
+ /* Initialise a new wait data structure. */
+ wd = tcb_wait_tab + wait_tab_pos;
+ init_trace_wait_data(wd);
+ wd->status = status;
+
+ if (WIFSIGNALED(status)) {
+ wd->te = TE_SIGNALLED;
+ } else if (WIFEXITED(status)) {
+ wd->te = TE_EXITED;
+ } else {
+ /*
+ * As WCONTINUED flag has not been specified to wait4,
+ * it cannot be WIFCONTINUED(status), so the only case
+ * that remains is WIFSTOPPED(status).
+ */
+
+ const unsigned int sig = WSTOPSIG(status);
+ const unsigned int event = (unsigned int) status >> 16;
+
+ switch (event) {
+ case 0:
+ /*
+ * Is this post-attach SIGSTOP?
+ * Interestingly, the process may stop
+ * with STOPSIG equal to some other signal
+ * than SIGSTOP if we happened to attach
+ * just before the process takes a signal.
+ */
+ if (sig == SIGSTOP &&
+ (tcp->flags & TCB_IGNORE_ONE_SIGSTOP)) {
+ debug_func_msg("ignored SIGSTOP on "
+ "pid %d", tcp->pid);
+ tcp->flags &= ~TCB_IGNORE_ONE_SIGSTOP;
+ wd->te = TE_RESTART;
+ } else if (sig == syscall_trap_sig) {
+ wd->te = TE_SYSCALL_STOP;
+ } else {
+ /*
+ * True if tracee is stopped by signal
+ * (as opposed to "tracee received
+ * signal").
+ * TODO: shouldn't we check for
+ * errno == EINVAL too?
+ * We can get ESRCH instead, you know...
+ */
+ bool stopped = ptrace(PTRACE_GETSIGINFO,
+ pid, 0, &wd->si) < 0;
+
+ wd->te = stopped ? TE_GROUP_STOP
+ : TE_SIGNAL_DELIVERY_STOP;
+ }
+ break;
+ case PTRACE_EVENT_STOP:
+ /*
+ * PTRACE_INTERRUPT-stop or group-stop.
+ * PTRACE_INTERRUPT-stop has sig == SIGTRAP here.
+ */
+ switch (sig) {
+ case SIGSTOP:
+ case SIGTSTP:
+ case SIGTTIN:
+ case SIGTTOU:
+ wd->te = TE_GROUP_STOP;
+ break;
+ default:
+ wd->te = TE_RESTART;
+ }
+ break;
+ case PTRACE_EVENT_EXEC:
+ /*
+ * TODO: shouldn't we check for
+ * errno == EINVAL here, too?
+ * We can get ESRCH instead, you know...
+ */
+ if (ptrace(PTRACE_GETEVENTMSG, pid, NULL,
+ &wd->msg) < 0)
+ wd->msg = 0;
+
+ wd->te = TE_STOP_BEFORE_EXECVE;
+ break;
+ case PTRACE_EVENT_EXIT:
+ wd->te = TE_STOP_BEFORE_EXIT;
+ break;
+ case PTRACE_EVENT_SECCOMP:
+ wd->te = TE_SECCOMP;
+ break;
+ default:
+ wd->te = TE_RESTART;
+ }
+ }
+
+ if (!wd->te)
+ error_func_msg("Tracing event hasn't been determined "
+ "for pid %d, status %0#x", pid, status);
+
+ if (!list_is_empty(&tcp->wait_list)) {
+ wait_extra_data_idx = wait_tab_pos;
+ extra_tcp = tcp;
+ debug_func_msg("queued extra pid %d", tcp->pid);
+ } else {
+ tcp->wait_data_idx = wait_tab_pos;
+ list_append(&pending_tcps, &tcp->wait_list);
+ debug_func_msg("queued pid %d", tcp->pid);
+ }
+
+ wait_tab_pos++;
+
+ if (extra_tcp)
+ break;
+
+next_event_wait_next:
+ pid = wait4(-1, &status, __WALL | WNOHANG, (cflag ? &ru : NULL));
+ wait_errno = errno;
+ wait_nohang = true;
+ }
+
+next_event_get_tcp:
+ elem = list_remove_head(&pending_tcps);
+
+ if (!elem) {
+ tcb_wait_tab_check_size(0);
+ memset(tcb_wait_tab, 0, sizeof(*tcb_wait_tab));
+ tcb_wait_tab->te = TE_NEXT;
+
+ return tcb_wait_tab;
+ } else {
+ tcp = list_elem(elem, struct tcb, wait_list);
+ debug_func_msg("dequeued pid %d", tcp->pid);
+ }
+
+next_event_exit:
+ /* Is this the very first time we see this tracee stopped? */
+ if (tcp->flags & TCB_STARTUP)
+ startup_tcb(tcp);
+
+ clear_regs(tcp);
+
+ /* Set current output file */
+ set_current_tcp(tcp);
+
+ return tcb_wait_tab + tcp->wait_data_idx;
+}
+
+static int
+trace_syscall(struct tcb *tcp, unsigned int *sig)
+{
+ if (entering(tcp)) {
+ int res = syscall_entering_decode(tcp);
+ switch (res) {
+ case 0:
+ return 0;
+ case 1:
+ res = syscall_entering_trace(tcp, sig);
+ }
+ syscall_entering_finish(tcp, res);
+ return res;
+ } else {
+ struct timespec ts = {};
+ int res = syscall_exiting_decode(tcp, &ts);
+ if (res != 0) {
+ res = syscall_exiting_trace(tcp, &ts, res);
+ }
+ syscall_exiting_finish(tcp);
+ return res;
+ }
+}
+
+/* Returns true iff the main trace loop has to continue. */
+static bool
+dispatch_event(const struct tcb_wait_data *wd)
+{
+ unsigned int restart_op;
+ unsigned int restart_sig = 0;
+ enum trace_event te = wd ? wd->te : TE_BREAK;
+ /*
+ * Copy wd->status to a non-const variable to workaround glibc bugs
+ * around union wait fixed by glibc commit glibc-2.24~391
+ */
+ int status = wd ? wd->status : 0;
+
+ if (current_tcp && has_seccomp_filter(current_tcp))
+ restart_op = seccomp_filter_restart_operator(current_tcp);
+ else
+ restart_op = PTRACE_SYSCALL;
+
+ switch (te) {
+ case TE_BREAK:
+ return false;
+
+ case TE_NEXT:
+ return true;
+
+ case TE_RESTART:
+ break;
+
+ case TE_SECCOMP:
+ if (!has_seccomp_filter(current_tcp)) {
+ /*
+ * We don't know if forks/clones have a seccomp filter
+ * when they are created, but we can detect it when we
+ * have a seccomp-stop.
+ * In such a case, if !seccomp_before_sysentry, we have
+ * already processed the syscall entry, so we avoid
+ * processing it a second time.
+ */
+ current_tcp->flags |= TCB_SECCOMP_FILTER;
+ restart_op = PTRACE_SYSCALL;
+ break;
+ }
+
+ if (seccomp_before_sysentry) {
+ restart_op = PTRACE_SYSCALL;
+ break;
+ }
+ ATTRIBUTE_FALLTHROUGH;
+
+ case TE_SYSCALL_STOP:
+ if (trace_syscall(current_tcp, &restart_sig) < 0) {
+ /*
+ * ptrace() failed in trace_syscall().
+ * Likely a result of process disappearing mid-flight.
+ * Observed case: exit_group() or SIGKILL terminating
+ * all processes in thread group.
+ * We assume that ptrace error was caused by process death.
+ * We used to detach(current_tcp) here, but since we no
+ * longer implement "detach before death" policy/hack,
+ * we can let this process to report its death to us
+ * normally, via WIFEXITED or WIFSIGNALED wait status.
+ */
+ return true;
+ }
+ if (has_seccomp_filter(current_tcp)) {
+ /*
+ * Syscall and seccomp stops can happen in different
+ * orders depending on kernel. strace tests this in
+ * check_seccomp_order_tracer().
+ *
+ * Linux 3.5--4.7:
+ * (seccomp-stop before syscall-entry-stop)
+ * +--> seccomp-stop ->-PTRACE_SYSCALL->-+
+ * | |
+ * PTRACE_CONT syscall-entry-stop
+ * | |
+ * syscall-exit-stop <---PTRACE_SYSCALL-----<----+
+ *
+ * Linux 4.8+:
+ * (seccomp-stop after syscall-entry-stop)
+ * syscall-entry-stop
+ *
+ * +---->-----PTRACE_CONT---->----+
+ * | |
+ * syscall-exit-stop seccomp-stop
+ * | |
+ * +----<----PTRACE_SYSCALL---<---+
+ *
+ * Note in Linux 4.8+, we restart in PTRACE_CONT
+ * after syscall-exit to skip the syscall-entry-stop.
+ * The next seccomp-stop will be treated as a syscall
+ * entry.
+ *
+ * The line below implements this behavior.
+ * Note that exiting(current_tcp) actually marks
+ * a syscall-entry-stop because the flag was inverted
+ * in the above call to trace_syscall.
+ */
+ restart_op = exiting(current_tcp) ? PTRACE_SYSCALL : PTRACE_CONT;
+ }
+ break;
+
+ case TE_SIGNAL_DELIVERY_STOP:
+ restart_sig = WSTOPSIG(status);
+ print_stopped(current_tcp, &wd->si, restart_sig);
+ break;
+
+ case TE_SIGNALLED:
+ print_signalled(current_tcp, current_tcp->pid, status);
+ droptcb(current_tcp);
+ return true;
+
+ case TE_GROUP_STOP:
+ restart_sig = WSTOPSIG(status);
+ print_stopped(current_tcp, NULL, restart_sig);
+ if (use_seize) {
+ /*
+ * This ends ptrace-stop, but does *not* end group-stop.
+ * This makes stopping signals work properly on straced
+ * process (that is, process really stops. It used to
+ * continue to run).
+ */
+ restart_op = PTRACE_LISTEN;
+ restart_sig = 0;
+ }
+ break;
+
+ case TE_EXITED:
+ print_exited(current_tcp, current_tcp->pid, status);
+ droptcb(current_tcp);
+ return true;
+
+ case TE_STOP_BEFORE_EXECVE:
+ /* The syscall succeeded, clear the flag. */
+ current_tcp->flags &= ~TCB_CHECK_EXEC_SYSCALL;
+ /*
+ * Check that we are inside syscall now (next event after
+ * PTRACE_EVENT_EXEC should be for syscall exiting). If it is
+ * not the case, we might have a situation when we attach to a
+ * process and the first thing we see is a PTRACE_EVENT_EXEC
+ * and all the following syscall state tracking is screwed up
+ * otherwise.
+ */
+ if (!maybe_switch_current_tcp() && entering(current_tcp)) {
+ int ret;
+
+ error_msg("Stray PTRACE_EVENT_EXEC from pid %d"
+ ", trying to recover...",
+ current_tcp->pid);
+
+ current_tcp->flags |= TCB_RECOVERING;
+ ret = trace_syscall(current_tcp, &restart_sig);
+ current_tcp->flags &= ~TCB_RECOVERING;
+
+ if (ret < 0) {
+ /* The reason is described in TE_SYSCALL_STOP */
+ return true;
+ }
+ }
+
+ if (detach_on_execve) {
+ if (current_tcp->flags & TCB_SKIP_DETACH_ON_FIRST_EXEC) {
+ current_tcp->flags &= ~TCB_SKIP_DETACH_ON_FIRST_EXEC;
+ } else {
+ detach(current_tcp); /* do "-b execve" thingy */
+ return true;
+ }
+ }
+ break;
+
+ case TE_STOP_BEFORE_EXIT:
+ print_event_exit(current_tcp);
+ break;
+ }
+
+ /* We handled quick cases, we are permitted to interrupt now. */
+ if (interrupted)
+ return false;
+
+ /* If the process is being delayed, do not ptrace_restart just yet */
+ if (syscall_delayed(current_tcp)) {
+ if (current_tcp->delayed_wait_data)
+ error_func_msg("pid %d has delayed wait data set"
+ " already", current_tcp->pid);
+
+ current_tcp->delayed_wait_data = copy_trace_wait_data(wd);
+
+ return true;
+ }
+
+ if (ptrace_restart(restart_op, current_tcp, restart_sig) < 0) {
+ /* Note: ptrace_restart emitted error message */
+ exit_code = 1;
+ return false;
+ }
+ return true;
+}
+
+static bool
+restart_delayed_tcb(struct tcb *const tcp)
+{
+ struct tcb_wait_data *wd = tcp->delayed_wait_data;
+
+ if (!wd) {
+ error_func_msg("No delayed wait data found for pid %d",
+ tcp->pid);
+ wd = init_trace_wait_data(alloca(trace_wait_data_size(tcp)));
+ }
+
+ wd->te = TE_RESTART;
+
+ debug_func_msg("pid %d", tcp->pid);
+
+ tcp->flags &= ~TCB_DELAYED;
+
+ struct tcb *const prev_tcp = current_tcp;
+ current_tcp = tcp;
+ bool ret = dispatch_event(wd);
+ current_tcp = prev_tcp;
+
+ free_trace_wait_data(tcp->delayed_wait_data);
+ tcp->delayed_wait_data = NULL;
+
+ return ret;
+}
+
+static bool
+restart_delayed_tcbs(void)
+{
+ struct tcb *tcp_next = NULL;
+ struct timespec ts_now;
+
+ clock_gettime(CLOCK_MONOTONIC, &ts_now);
+
+ for (size_t i = 0; i < tcbtabsize; i++) {
+ struct tcb *tcp = tcbtab[i];
+
+ if (tcp->pid && syscall_delayed(tcp)) {
+ if (ts_cmp(&ts_now, &tcp->delay_expiration_time) > 0) {
+ if (!restart_delayed_tcb(tcp))
+ return false;
+ } else {
+ /* Check whether this tcb is the next. */
+ if (!tcp_next ||
+ ts_cmp(&tcp_next->delay_expiration_time,
+ &tcp->delay_expiration_time) > 0) {
+ tcp_next = tcp;
+ }
+ }
+ }
+ }
+
+ if (tcp_next)
+ arm_delay_timer(tcp_next);
+
+ return true;
+}
+
+/*
+ * As this signal handler does a lot of work that is not suitable
+ * for signal handlers, extra care must be taken to ensure that
+ * it is enabled only in those places where it's safe.
+ */
+static void
+timer_sighandler(int sig)
+{
+ delay_timer_expired();
+
+ if (restart_failed)
+ return;
+
+ int saved_errno = errno;
+
+ if (!restart_delayed_tcbs())
+ restart_failed = 1;
+
+ errno = saved_errno;
+}
+
+static void ATTRIBUTE_NORETURN
+terminate(void)
+{
+ int sig = interrupted;
+
+ cleanup(sig);
+ if (cflag)
+ call_summary(shared_log);
+ fflush(NULL);
+ if (shared_log != stderr)
+ fclose(shared_log);
+ if (popen_pid) {
+ while (waitpid(popen_pid, NULL, 0) < 0 && errno == EINTR)
+ ;
+ }
+ if (sig) {
+ exit_code = 0x100 | sig;
+ }
+ if (exit_code > 0xff) {
+ /* Avoid potential core file clobbering. */
+ struct_rlimit rlim = {0, 0};
+ set_rlimit(RLIMIT_CORE, &rlim);
+
+ /* Child was killed by a signal, mimic that. */
+ exit_code &= 0xff;
+ signal(exit_code, SIG_DFL);
+ GCOV_DUMP;
+ raise(exit_code);
+
+ /* Unblock the signal. */
+ sigset_t mask;
+ sigemptyset(&mask);
+ sigaddset(&mask, exit_code);
+ GCOV_DUMP;
+ sigprocmask(SIG_UNBLOCK, &mask, NULL);
+
+ /* Paranoia - what if this signal is not fatal?
+ Exit with 128 + signo then. */
+ exit_code += 128;
+ }
+ exit(exit_code);
+}
+
+int
+main(int argc, char *argv[])
+{
+ setlocale(LC_ALL, "");
+ init(argc, argv);
+
+ exit_code = !nprocs;
+
+ while (dispatch_event(next_event()))
+ ;
+ terminate();
+}
diff --git a/src/string_to_uint.c b/src/string_to_uint.c
new file mode 100644
index 000000000..6300f9bce
--- /dev/null
+++ b/src/string_to_uint.c
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2001-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "string_to_uint.h"
+
+long long
+string_to_uint_ex(const char *const str, char **const endptr,
+ const unsigned long long max_val,
+ const char *const accepted_ending)
+{
+ char *end;
+ long long val;
+
+ if (!*str)
+ return -1;
+
+ errno = 0;
+ val = strtoll(str, &end, 10);
+
+ if (str == end || val < 0 || (unsigned long long) val > max_val
+ || (val == LLONG_MAX && errno == ERANGE))
+ return -1;
+
+ if (*end && (!accepted_ending || !strchr(accepted_ending, *end)))
+ return -1;
+
+ if (endptr)
+ *endptr = end;
+
+ return val;
+}
diff --git a/src/string_to_uint.h b/src/string_to_uint.h
new file mode 100644
index 000000000..3eb9c8e70
--- /dev/null
+++ b/src/string_to_uint.h
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2001-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_STRING_TO_UINT_H
+# define STRACE_STRING_TO_UINT_H
+
+# include <limits.h>
+
+# include "kernel_types.h"
+
+extern long long
+string_to_uint_ex(const char *str, char **endptr,
+ unsigned long long max_val, const char *accepted_ending);
+
+static inline long long
+string_to_uint_upto(const char *const str, const unsigned long long max_val)
+{
+ return string_to_uint_ex(str, NULL, max_val, NULL);
+}
+
+static inline int
+string_to_uint(const char *str)
+{
+ return string_to_uint_upto(str, INT_MAX);
+}
+
+static inline long
+string_to_ulong(const char *str)
+{
+ return string_to_uint_upto(str, LONG_MAX);
+}
+
+static inline kernel_long_t
+string_to_kulong(const char *str)
+{
+ return string_to_uint_upto(str, ((kernel_ulong_t) -1ULL) >> 1);
+}
+
+static inline long long
+string_to_ulonglong(const char *str)
+{
+ return string_to_uint_upto(str, LLONG_MAX);
+}
+
+#endif /* !STRACE_STRING_TO_UINT_H */
diff --git a/src/swapon.c b/src/swapon.c
new file mode 100644
index 000000000..87fd3c1fe
--- /dev/null
+++ b/src/swapon.c
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2014-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#include <sys/swap.h>
+
+#include "xlat/swap_flags.h"
+
+SYS_FUNC(swapon)
+{
+ unsigned int flags = tcp->u_arg[1];
+ unsigned int prio = flags & SWAP_FLAG_PRIO_MASK;
+ flags &= ~SWAP_FLAG_PRIO_MASK;
+
+ printpath(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ if (flags) {
+ printflags(swap_flags, flags, "SWAP_FLAG_???");
+ tprintf("|%u", prio);
+ } else {
+ tprintf("%u", prio);
+ }
+
+ return RVAL_DECODED;
+}
diff --git a/src/sync_file_range.c b/src/sync_file_range.c
new file mode 100644
index 000000000..b5637aad6
--- /dev/null
+++ b/src/sync_file_range.c
@@ -0,0 +1,25 @@
+/*
+ * Copyright (c) 2013 William Manley <william.manley@youview.com>
+ * Copyright (c) 2014-2015 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2014-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include <fcntl.h>
+#include "xlat/sync_file_range_flags.h"
+
+SYS_FUNC(sync_file_range)
+{
+ int argn;
+
+ printfd(tcp, tcp->u_arg[0]);
+ argn = printllval(tcp, ", %lld, ", 1);
+ argn = printllval(tcp, "%lld, ", argn);
+ printflags(sync_file_range_flags, tcp->u_arg[argn],
+ "SYNC_FILE_RANGE_???");
+
+ return RVAL_DECODED;
+}
diff --git a/src/sync_file_range2.c b/src/sync_file_range2.c
new file mode 100644
index 000000000..dce5622b7
--- /dev/null
+++ b/src/sync_file_range2.c
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2013 William Manley <william.manley@youview.com>
+ * Copyright (c) 2014-2015 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include <fcntl.h>
+#include "xlat/sync_file_range_flags.h"
+
+SYS_FUNC(sync_file_range2)
+{
+ int argn;
+
+ printfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ printflags(sync_file_range_flags, tcp->u_arg[1],
+ "SYNC_FILE_RANGE_???");
+ argn = printllval(tcp, ", %lld, ", 2);
+ printllval(tcp, "%lld", argn);
+
+ return RVAL_DECODED;
+}
diff --git a/src/syscall.c b/src/syscall.c
new file mode 100644
index 000000000..9691de5b5
--- /dev/null
+++ b/src/syscall.c
@@ -0,0 +1,1549 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
+ * Copyright (c) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation
+ * Linux for s390 port by D.J. Barrow
+ * <barrow_dj@mail.yahoo.com,djbarrow@de.ibm.com>
+ * Copyright (c) 1999-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include "get_personality.h"
+#include "mmap_notify.h"
+#include "native_defs.h"
+#include "ptrace.h"
+#include "ptrace_syscall_info.h"
+#include "nsig.h"
+#include "number_set.h"
+#include "delay.h"
+#include "retval.h"
+#include <limits.h>
+
+/* for struct iovec */
+#include <sys/uio.h>
+
+/* for __X32_SYSCALL_BIT */
+#include "scno.h"
+
+#include "regs.h"
+
+#if defined(SPARC64)
+# undef PTRACE_GETREGS
+# define PTRACE_GETREGS PTRACE_GETREGS64
+# undef PTRACE_SETREGS
+# define PTRACE_SETREGS PTRACE_SETREGS64
+#endif
+
+#include "syscall.h"
+#include "xstring.h"
+#include "syscallent_base_nr.h"
+
+/* Define these shorthand notations to simplify the syscallent files. */
+#include "sysent_shorthand_defs.h"
+
+#define SEN(syscall_name) SEN_ ## syscall_name, SYS_FUNC_NAME(sys_ ## syscall_name)
+
+const struct_sysent sysent0[] = {
+#include "syscallent.h"
+};
+
+#if SUPPORTED_PERSONALITIES > 1
+# include PERSONALITY1_INCLUDE_FUNCS
+static const struct_sysent sysent1[] = {
+# include "syscallent1.h"
+};
+#endif
+
+#if SUPPORTED_PERSONALITIES > 2
+# include PERSONALITY2_INCLUDE_FUNCS
+static const struct_sysent sysent2[] = {
+# include "syscallent2.h"
+};
+#endif
+
+/* Now undef them since short defines cause wicked namespace pollution. */
+#include "sysent_shorthand_undefs.h"
+
+const char *const errnoent[] = {
+#include "errnoent.h"
+};
+const char *const signalent[] = {
+#include "signalent.h"
+
+};
+/*
+ * `ioctlent[012].h' files are automatically generated by the auxiliary
+ * program `ioctlsort', such that the list is sorted by the `code' field.
+ * This has the side-effect of resolving the _IO.. macros into
+ * plain integers, eliminating the need to include here everything
+ * in "/usr/include".
+ */
+
+const struct_ioctlent ioctlent0[] = {
+#include "ioctlent0.h"
+};
+
+#if SUPPORTED_PERSONALITIES > 1
+static const struct_ioctlent ioctlent1[] = {
+# include "ioctlent1.h"
+};
+# include PERSONALITY0_INCLUDE_PRINTERS_DECLS
+static const struct_printers printers0 = {
+# include PERSONALITY0_INCLUDE_PRINTERS_DEFS
+};
+# include PERSONALITY1_INCLUDE_PRINTERS_DECLS
+static const struct_printers printers1 = {
+# include PERSONALITY1_INCLUDE_PRINTERS_DEFS
+};
+#endif
+
+#if SUPPORTED_PERSONALITIES > 2
+static const struct_ioctlent ioctlent2[] = {
+# include "ioctlent2.h"
+};
+# include PERSONALITY2_INCLUDE_PRINTERS_DECLS
+static const struct_printers printers2 = {
+# include PERSONALITY2_INCLUDE_PRINTERS_DEFS
+};
+#endif
+
+enum {
+ nsyscalls0 = ARRAY_SIZE(sysent0)
+#if SUPPORTED_PERSONALITIES > 1
+ , nsyscalls1 = ARRAY_SIZE(sysent1)
+# if SUPPORTED_PERSONALITIES > 2
+ , nsyscalls2 = ARRAY_SIZE(sysent2)
+# endif
+#endif
+};
+
+enum {
+ nioctlents0 = ARRAY_SIZE(ioctlent0)
+#if SUPPORTED_PERSONALITIES > 1
+ , nioctlents1 = ARRAY_SIZE(ioctlent1)
+# if SUPPORTED_PERSONALITIES > 2
+ , nioctlents2 = ARRAY_SIZE(ioctlent2)
+# endif
+#endif
+};
+
+#if SUPPORTED_PERSONALITIES > 1
+const struct_sysent *sysent = sysent0;
+const struct_ioctlent *ioctlent = ioctlent0;
+const struct_printers *printers = &printers0;
+#endif
+
+const unsigned int nerrnos = ARRAY_SIZE(errnoent);
+const unsigned int nsignals = ARRAY_SIZE(signalent);
+unsigned nsyscalls = nsyscalls0;
+unsigned nioctlents = nioctlents0;
+
+const unsigned int nsyscall_vec[SUPPORTED_PERSONALITIES] = {
+ nsyscalls0,
+#if SUPPORTED_PERSONALITIES > 1
+ nsyscalls1,
+#endif
+#if SUPPORTED_PERSONALITIES > 2
+ nsyscalls2,
+#endif
+};
+const struct_sysent *const sysent_vec[SUPPORTED_PERSONALITIES] = {
+ sysent0,
+#if SUPPORTED_PERSONALITIES > 1
+ sysent1,
+#endif
+#if SUPPORTED_PERSONALITIES > 2
+ sysent2,
+#endif
+};
+
+const char *const personality_names[] =
+#if defined X86_64
+ {"64 bit", "32 bit", "x32"}
+#elif defined X32
+ {"x32", "32 bit"}
+#elif SUPPORTED_PERSONALITIES == 2
+ {"64 bit", "32 bit"}
+#else
+ {STRINGIFY_VAL(__WORDSIZE) " bit"}
+#endif
+ ;
+
+const char *const personality_designators[] =
+#if defined X86_64
+ { "64", "32", "x32" }
+#elif defined X32
+ { "x32", "32" }
+#elif SUPPORTED_PERSONALITIES == 2
+ { "64", "32" }
+#else
+ { STRINGIFY_VAL(__WORDSIZE) }
+#endif
+ ;
+
+#if SUPPORTED_PERSONALITIES > 1
+
+unsigned current_personality;
+
+# ifndef current_wordsize
+unsigned current_wordsize = PERSONALITY0_WORDSIZE;
+static const int personality_wordsize[SUPPORTED_PERSONALITIES] = {
+ PERSONALITY0_WORDSIZE,
+ PERSONALITY1_WORDSIZE,
+# if SUPPORTED_PERSONALITIES > 2
+ PERSONALITY2_WORDSIZE,
+# endif
+};
+# endif
+
+# ifndef current_klongsize
+unsigned current_klongsize = PERSONALITY0_KLONGSIZE;
+static const int personality_klongsize[SUPPORTED_PERSONALITIES] = {
+ PERSONALITY0_KLONGSIZE,
+ PERSONALITY1_KLONGSIZE,
+# if SUPPORTED_PERSONALITIES > 2
+ PERSONALITY2_KLONGSIZE,
+# endif
+};
+# endif
+
+void
+set_personality(unsigned int personality)
+{
+ if (personality == current_personality)
+ return;
+
+ if (personality >= SUPPORTED_PERSONALITIES)
+ error_msg_and_die("Requested switch to unsupported personality "
+ "%u", personality);
+
+ nsyscalls = nsyscall_vec[personality];
+ sysent = sysent_vec[personality];
+
+ switch (personality) {
+ case 0:
+ ioctlent = ioctlent0;
+ nioctlents = nioctlents0;
+ printers = &printers0;
+ break;
+
+ case 1:
+ ioctlent = ioctlent1;
+ nioctlents = nioctlents1;
+ printers = &printers1;
+ break;
+
+# if SUPPORTED_PERSONALITIES > 2
+ case 2:
+ ioctlent = ioctlent2;
+ nioctlents = nioctlents2;
+ printers = &printers2;
+ break;
+# endif
+ }
+
+ current_personality = personality;
+# ifndef current_wordsize
+ current_wordsize = personality_wordsize[personality];
+# endif
+# ifndef current_klongsize
+ current_klongsize = personality_klongsize[personality];
+# endif
+}
+
+static void
+update_personality(struct tcb *tcp, unsigned int personality)
+{
+ static bool need_mpers_warning[] =
+ { false, !HAVE_PERSONALITY_1_MPERS, !HAVE_PERSONALITY_2_MPERS };
+
+ set_personality(personality);
+
+ if (personality == tcp->currpers)
+ return;
+ tcp->currpers = personality;
+
+ if (!is_number_in_set(QUIET_PERSONALITY, quiet_set)) {
+ printleader(tcp);
+ tprintf("[ Process PID=%d runs in %s mode. ]\n",
+ tcp->pid, personality_names[personality]);
+ line_ended();
+ }
+
+ if (need_mpers_warning[personality]) {
+ error_msg("WARNING: Proper structure decoding for this "
+ "personality is not supported, please consider "
+ "building strace with mpers support enabled.");
+ need_mpers_warning[personality] = false;
+ }
+
+#if defined(ENABLE_STACKTRACE) && !defined(USE_LIBUNWIND)
+ if (stack_trace_enabled) {
+ unwind_tcb_fin(tcp);
+ unwind_tcb_init(tcp);
+ }
+#endif
+}
+#endif
+
+#ifdef SYS_socket_subcall
+static void
+decode_socket_subcall(struct tcb *tcp)
+{
+ const int call = tcp->u_arg[0];
+
+ if (call < 1 || call >= SYS_socket_nsubcalls)
+ return;
+
+ const kernel_ulong_t scno = SYS_socket_subcall + call;
+ const unsigned int nargs = sysent[scno].nargs;
+ uint64_t buf[nargs];
+
+ if (umoven(tcp, tcp->u_arg[1], nargs * current_wordsize, buf) < 0)
+ return;
+
+ tcp->scno = scno;
+ tcp->qual_flg = qual_flags(scno);
+ tcp->s_ent = &sysent[scno];
+
+ unsigned int i;
+ for (i = 0; i < nargs; ++i)
+ tcp->u_arg[i] = (sizeof(uint32_t) == current_wordsize)
+ ? ((uint32_t *) (void *) buf)[i] : buf[i];
+}
+#endif /* SYS_socket_subcall */
+
+#ifdef SYS_ipc_subcall
+static void
+decode_ipc_subcall(struct tcb *tcp)
+{
+ unsigned int call = tcp->u_arg[0];
+ const unsigned int version = call >> 16;
+
+ if (version) {
+# if defined S390 || defined S390X
+ return;
+# else
+# ifdef SPARC64
+ if (current_wordsize == 8)
+ return;
+# endif
+ set_tcb_priv_ulong(tcp, version);
+ call &= 0xffff;
+# endif
+ }
+
+ switch (call) {
+ case 1: case 2: case 3: case 4:
+ case 11: case 12: case 13: case 14:
+ case 21: case 22: case 23: case 24:
+ break;
+ default:
+ return;
+ }
+
+ tcp->scno = SYS_ipc_subcall + call;
+ tcp->qual_flg = qual_flags(tcp->scno);
+ tcp->s_ent = &sysent[tcp->scno];
+
+ const unsigned int n = n_args(tcp);
+ unsigned int i;
+ for (i = 0; i < n; i++)
+ tcp->u_arg[i] = tcp->u_arg[i + 1];
+}
+#endif /* SYS_ipc_subcall */
+
+#ifdef SYS_syscall_subcall
+/* The implementation is architecture specific. */
+static void decode_syscall_subcall(struct tcb *);
+#endif /* SYS_syscall_subcall */
+
+static void
+dumpio(struct tcb *tcp)
+{
+ int fd = tcp->u_arg[0];
+ if (fd < 0)
+ return;
+
+ if (is_number_in_set(fd, write_set)) {
+ switch (tcp_sysent(tcp)->sen) {
+ case SEN_write:
+ case SEN_pwrite:
+ case SEN_send:
+ case SEN_sendto:
+ case SEN_mq_timedsend_time32:
+ case SEN_mq_timedsend_time64:
+ dumpstr(tcp, tcp->u_arg[1], tcp->u_arg[2]);
+ break;
+ case SEN_writev:
+ case SEN_pwritev:
+ case SEN_pwritev2:
+ case SEN_vmsplice:
+ dumpiov_upto(tcp, tcp->u_arg[2], tcp->u_arg[1], -1);
+ break;
+ case SEN_sendmsg:
+ dumpiov_in_msghdr(tcp, tcp->u_arg[1], -1);
+ break;
+ case SEN_sendmmsg:
+ dumpiov_in_mmsghdr(tcp, tcp->u_arg[1]);
+ break;
+ }
+ }
+
+ if (syserror(tcp))
+ return;
+
+ if (is_number_in_set(fd, read_set)) {
+ switch (tcp_sysent(tcp)->sen) {
+ case SEN_read:
+ case SEN_pread:
+ case SEN_recv:
+ case SEN_recvfrom:
+ case SEN_mq_timedreceive_time32:
+ case SEN_mq_timedreceive_time64:
+ dumpstr(tcp, tcp->u_arg[1], tcp->u_rval);
+ return;
+ case SEN_readv:
+ case SEN_preadv:
+ case SEN_preadv2:
+ dumpiov_upto(tcp, tcp->u_arg[2], tcp->u_arg[1],
+ tcp->u_rval);
+ return;
+ case SEN_recvmsg:
+ dumpiov_in_msghdr(tcp, tcp->u_arg[1], tcp->u_rval);
+ return;
+ case SEN_recvmmsg:
+ case SEN_recvmmsg_time32:
+ case SEN_recvmmsg_time64:
+ dumpiov_in_mmsghdr(tcp, tcp->u_arg[1]);
+ return;
+ }
+ }
+}
+
+static const char *
+err_name(uint64_t err)
+{
+ return err < nerrnos ? errnoent[err] : NULL;
+}
+
+void
+print_err(int64_t err, bool negated)
+{
+ const char *str = err_name(negated ? -err : err);
+
+ if (!str || xlat_verbose(xlat_verbosity) != XLAT_STYLE_ABBREV)
+ tprintf(negated ? "%" PRId64 : "%" PRIu64, err);
+ if (!str || xlat_verbose(xlat_verbosity) == XLAT_STYLE_RAW)
+ return;
+ (xlat_verbose(xlat_verbosity) == XLAT_STYLE_ABBREV
+ ? tprintf : tprintf_comment)("%s%s",
+ negated ? "-" : "", str);
+}
+
+static void
+print_err_ret(kernel_ulong_t ret, unsigned long u_error)
+{
+ const char *u_error_str = err_name(u_error);
+
+ if (u_error_str)
+ tprintf("= %" PRI_kld " %s (%s)",
+ ret, u_error_str, strerror(u_error));
+ else
+ tprintf("= %" PRI_kld " (errno %lu)", ret, u_error);
+}
+
+static long get_regs(struct tcb *);
+static int get_syscall_args(struct tcb *);
+static int get_syscall_result(struct tcb *);
+static void get_error(struct tcb *, bool);
+static void set_error(struct tcb *, unsigned long);
+static void set_success(struct tcb *, kernel_long_t);
+static int arch_get_scno(struct tcb *);
+static int arch_check_scno(struct tcb *);
+static int arch_set_scno(struct tcb *, kernel_ulong_t);
+static int arch_get_syscall_args(struct tcb *);
+static void arch_get_error(struct tcb *, bool);
+static int arch_set_error(struct tcb *);
+static int arch_set_success(struct tcb *);
+#if MAX_ARGS > 6
+static void arch_get_syscall_args_extra(struct tcb *, unsigned int);
+#endif
+
+struct inject_opts *inject_vec[SUPPORTED_PERSONALITIES];
+
+static struct inject_opts *
+tcb_inject_opts(struct tcb *tcp)
+{
+ return (scno_in_range(tcp->scno) && tcp->inject_vec[current_personality])
+ ? &tcp->inject_vec[current_personality][tcp->scno] : NULL;
+}
+
+
+static long
+tamper_with_syscall_entering(struct tcb *tcp, unsigned int *signo)
+{
+ if (!tcp->inject_vec[current_personality]) {
+ tcp->inject_vec[current_personality] =
+ xcalloc(nsyscalls, sizeof(**inject_vec));
+ memcpy(tcp->inject_vec[current_personality],
+ inject_vec[current_personality],
+ nsyscalls * sizeof(**inject_vec));
+ }
+
+ struct inject_opts *opts = tcb_inject_opts(tcp);
+
+ if (!opts || opts->first == 0 || opts->last == 0)
+ return 0;
+
+ if (opts->last != INJECT_LAST_INF)
+ --opts->last;
+
+ --opts->first;
+
+ if (opts->first != 0)
+ return 0;
+
+ opts->first = opts->step;
+
+ if (!recovering(tcp)) {
+ if (opts->data.flags & INJECT_F_SIGNAL)
+ *signo = opts->data.signo;
+ if (opts->data.flags & (INJECT_F_ERROR | INJECT_F_RETVAL)) {
+ kernel_long_t scno =
+ (opts->data.flags & INJECT_F_SYSCALL)
+ ? (kernel_long_t) shuffle_scno(opts->data.scno)
+ : -1;
+
+ if (!arch_set_scno(tcp, scno)) {
+ tcp->flags |= TCB_TAMPERED;
+ if (scno != -1)
+ tcp->flags |= TCB_TAMPERED_NO_FAIL;
+#if ARCH_NEEDS_SET_ERROR_FOR_SCNO_TAMPERING
+ /*
+ * So far it's just a workaround for hppa,
+ * but let's pretend it could be used elsewhere.
+ */
+ else {
+ kernel_long_t rval =
+ (opts->data.flags & INJECT_F_RETVAL) ?
+ ENOSYS : retval_get(opts->data.rval_idx);
+
+ tcp->u_error = 0; /* force reset */
+ set_error(tcp, rval);
+ }
+#endif
+ }
+ }
+ if (opts->data.flags & INJECT_F_DELAY_ENTER)
+ delay_tcb(tcp, opts->data.delay_idx, true);
+ if (opts->data.flags & INJECT_F_DELAY_EXIT)
+ tcp->flags |= TCB_INJECT_DELAY_EXIT;
+ }
+
+ return 0;
+}
+
+static long
+tamper_with_syscall_exiting(struct tcb *tcp)
+{
+ struct inject_opts *opts = tcb_inject_opts(tcp);
+ if (!opts)
+ return 0;
+
+ if (inject_delay_exit(tcp))
+ delay_tcb(tcp, opts->data.delay_idx, false);
+
+ if (!syscall_tampered(tcp))
+ return 0;
+
+ if (!syserror(tcp) ^ !!syscall_tampered_nofail(tcp)) {
+ error_msg("Failed to tamper with process %d: unexpectedly got"
+ " %serror (return value %#" PRI_klx ", error %lu)",
+ tcp->pid, syscall_tampered_nofail(tcp) ? "" : "no ",
+ tcp->u_rval, tcp->u_error);
+
+ return 1;
+ }
+
+ if (opts->data.flags & INJECT_F_RETVAL)
+ set_success(tcp, retval_get(opts->data.rval_idx));
+ else
+ set_error(tcp, retval_get(opts->data.rval_idx));
+
+ return 0;
+}
+
+/*
+ * Returns:
+ * 0: "ignore this ptrace stop", bail out silently.
+ * 1: ok, decoded; call
+ * syscall_entering_finish(tcp, syscall_entering_trace(tcp, ...)).
+ * other: error; call syscall_entering_finish(tcp, res), where res is the value
+ * returned.
+ */
+int
+syscall_entering_decode(struct tcb *tcp)
+{
+ int res = get_scno(tcp);
+ if (res == 0)
+ return res;
+ if (res != 1 || (res = get_syscall_args(tcp)) != 1) {
+ printleader(tcp);
+ tprintf("%s(", tcp_sysent(tcp)->sys_name);
+ /*
+ * " <unavailable>" will be added later by the code which
+ * detects ptrace errors.
+ */
+ return res;
+ }
+
+#ifdef SYS_syscall_subcall
+ if (tcp_sysent(tcp)->sen == SEN_syscall)
+ decode_syscall_subcall(tcp);
+#endif
+#if defined SYS_ipc_subcall \
+ || defined SYS_socket_subcall
+ switch (tcp_sysent(tcp)->sen) {
+# ifdef SYS_ipc_subcall
+ case SEN_ipc:
+ decode_ipc_subcall(tcp);
+ break;
+# endif
+# ifdef SYS_socket_subcall
+ case SEN_socketcall:
+ decode_socket_subcall(tcp);
+ break;
+# endif
+ }
+#endif
+
+ return 1;
+}
+
+int
+syscall_entering_trace(struct tcb *tcp, unsigned int *sig)
+{
+ if (hide_log(tcp)) {
+ /*
+ * Restrain from fault injection
+ * while the tracee executes strace code.
+ */
+ tcp->qual_flg &= ~QUAL_INJECT;
+
+ switch (tcp_sysent(tcp)->sen) {
+ case SEN_execve:
+ case SEN_execveat:
+ case SEN_execv:
+ /*
+ * First exec* syscall makes the log visible.
+ */
+ tcp->flags &= ~TCB_HIDE_LOG;
+ /*
+ * Check whether this exec* syscall succeeds.
+ */
+ tcp->flags |= TCB_CHECK_EXEC_SYSCALL;
+ break;
+ }
+ }
+
+ if (hide_log(tcp) || !traced(tcp) || (tracing_paths && !pathtrace_match(tcp))) {
+ tcp->flags |= TCB_FILTERED;
+ return 0;
+ }
+
+ tcp->flags &= ~TCB_FILTERED;
+
+ if (inject(tcp))
+ tamper_with_syscall_entering(tcp, sig);
+
+ if (cflag == CFLAG_ONLY_STATS) {
+ return 0;
+ }
+
+#ifdef ENABLE_STACKTRACE
+ if (stack_trace_enabled &&
+ !check_exec_syscall(tcp) &&
+ tcp_sysent(tcp)->sys_flags & STACKTRACE_CAPTURE_ON_ENTER) {
+ unwind_tcb_capture(tcp);
+ }
+#endif
+
+ if (!is_complete_set(status_set, NUMBER_OF_STATUSES))
+ strace_open_memstream(tcp);
+
+ printleader(tcp);
+ tprintf("%s(", tcp_sysent(tcp)->sys_name);
+ int res = raw(tcp) ? printargs(tcp) : tcp_sysent(tcp)->sys_func(tcp);
+ fflush(tcp->outf);
+ return res;
+}
+
+void
+syscall_entering_finish(struct tcb *tcp, int res)
+{
+ tcp->flags |= TCB_INSYSCALL;
+ tcp->sys_func_rval = res;
+
+ /* Measure the entrance time as late as possible to avoid errors. */
+ if ((Tflag || cflag) && !filtered(tcp))
+ clock_gettime(CLOCK_MONOTONIC, &tcp->etime);
+
+ /* Start tracking system time */
+ if (cflag) {
+ if (debug_flag) {
+ struct timespec dt;
+
+ ts_sub(&dt, &tcp->stime, &tcp->ltime);
+
+ if (ts_nz(&dt))
+ debug_func_msg("pid %d: %.9f seconds of system "
+ "time spent since the last "
+ "syscall exit",
+ tcp->pid, ts_float(&dt));
+ }
+
+ tcp->ltime = tcp->stime;
+ }
+}
+
+/* Returns:
+ * 0: "bail out".
+ * 1: ok.
+ * -1: error in one of ptrace ops.
+ *
+ * If not 0, call syscall_exiting_trace(tcp, res), where res is the return
+ * value. Anyway, call syscall_exiting_finish(tcp) then.
+ */
+int
+syscall_exiting_decode(struct tcb *tcp, struct timespec *pts)
+{
+ /* Measure the exit time as early as possible to avoid errors. */
+ if ((Tflag || cflag) && !filtered(tcp))
+ clock_gettime(CLOCK_MONOTONIC, pts);
+
+ if (tcp_sysent(tcp)->sys_flags & MEMORY_MAPPING_CHANGE)
+ mmap_notify_report(tcp);
+
+ if (filtered(tcp))
+ return 0;
+
+ if (check_exec_syscall(tcp)) {
+ /* The check failed, hide the log. */
+ tcp->flags |= TCB_HIDE_LOG;
+ }
+
+#if SUPPORTED_PERSONALITIES > 1
+ update_personality(tcp, tcp->currpers);
+#endif
+
+ return get_syscall_result(tcp);
+}
+
+void
+print_syscall_resume(struct tcb *tcp)
+{
+ /* If not in -ff mode, and printing_tcp != tcp,
+ * then the log currently does not end with output
+ * of _our syscall entry_, but with something else.
+ * We need to say which syscall's return is this.
+ *
+ * Forced reprinting via TCB_REPRINT is used only by
+ * "strace -ff -oLOG test/threaded_execve" corner case.
+ * It's the only case when -ff mode needs reprinting.
+ */
+ if ((!output_separately && printing_tcp != tcp && !tcp->staged_output_data)
+ || (tcp->flags & TCB_REPRINT)) {
+ tcp->flags &= ~TCB_REPRINT;
+ printleader(tcp);
+ tprintf("<... %s resumed>", tcp_sysent(tcp)->sys_name);
+ }
+}
+
+int
+syscall_exiting_trace(struct tcb *tcp, struct timespec *ts, int res)
+{
+ if (syscall_tampered(tcp) || inject_delay_exit(tcp))
+ tamper_with_syscall_exiting(tcp);
+
+ if (cflag) {
+ count_syscall(tcp, ts);
+ if (cflag == CFLAG_ONLY_STATS) {
+ return 0;
+ }
+ }
+
+ print_syscall_resume(tcp);
+ printing_tcp = tcp;
+
+ tcp->s_prev_ent = NULL;
+ if (res != 1) {
+ /* There was error in one of prior ptrace ops */
+ tprints(") ");
+ tabto();
+ tprints("= ? <unavailable>\n");
+ if (!is_complete_set(status_set, NUMBER_OF_STATUSES)) {
+ bool publish = is_number_in_set(STATUS_UNAVAILABLE,
+ status_set);
+ strace_close_memstream(tcp, publish);
+ }
+ line_ended();
+ return res;
+ }
+ tcp->s_prev_ent = tcp->s_ent;
+
+ int sys_res = 0;
+ if (raw(tcp)) {
+ /* sys_res = printargs(tcp); - but it's nop on sysexit */
+ } else {
+ if (tcp->sys_func_rval & RVAL_DECODED)
+ sys_res = tcp->sys_func_rval;
+ else
+ sys_res = tcp_sysent(tcp)->sys_func(tcp);
+ }
+
+ if (!is_complete_set(status_set, NUMBER_OF_STATUSES)) {
+ bool publish = syserror(tcp)
+ && is_number_in_set(STATUS_FAILED, status_set);
+ publish |= !syserror(tcp)
+ && is_number_in_set(STATUS_SUCCESSFUL, status_set);
+ strace_close_memstream(tcp, publish);
+ if (!publish) {
+ line_ended();
+ return 0;
+ }
+ }
+
+ tprints(") ");
+ tabto();
+
+ if (raw(tcp)) {
+ if (tcp->u_error)
+ print_err_ret(tcp->u_rval, tcp->u_error);
+ else
+ tprintf("= %#" PRI_klx, tcp->u_rval);
+
+ if (syscall_tampered(tcp))
+ tprints(" (INJECTED)");
+ } else if (!(sys_res & RVAL_NONE) && tcp->u_error) {
+ switch (tcp->u_error) {
+ /* Blocked signals do not interrupt any syscalls.
+ * In this case syscalls don't return ERESTARTfoo codes.
+ *
+ * Deadly signals set to SIG_DFL interrupt syscalls
+ * and kill the process regardless of which of the codes below
+ * is returned by the interrupted syscall.
+ * In some cases, kernel forces a kernel-generated deadly
+ * signal to be unblocked and set to SIG_DFL (and thus cause
+ * death) if it is blocked or SIG_IGNed: for example, SIGSEGV
+ * or SIGILL. (The alternative is to leave process spinning
+ * forever on the faulty instruction - not useful).
+ *
+ * SIG_IGNed signals and non-deadly signals set to SIG_DFL
+ * (for example, SIGCHLD, SIGWINCH) interrupt syscalls,
+ * but kernel will always restart them.
+ */
+ case ERESTARTSYS:
+ /* Most common type of signal-interrupted syscall exit code.
+ * The system call will be restarted with the same arguments
+ * if SA_RESTART is set; otherwise, it will fail with EINTR.
+ */
+ tprints("= ? ERESTARTSYS (To be restarted if SA_RESTART is set)");
+ break;
+ case ERESTARTNOINTR:
+ /* Rare. For example, fork() returns this if interrupted.
+ * SA_RESTART is ignored (assumed set): the restart is unconditional.
+ */
+ tprints("= ? ERESTARTNOINTR (To be restarted)");
+ break;
+ case ERESTARTNOHAND:
+ /* pause(), rt_sigsuspend() etc use this code.
+ * SA_RESTART is ignored (assumed not set):
+ * syscall won't restart (will return EINTR instead)
+ * even after signal with SA_RESTART set. However,
+ * after SIG_IGN or SIG_DFL signal it will restart
+ * (thus the name "restart only if has no handler").
+ */
+ tprints("= ? ERESTARTNOHAND (To be restarted if no handler)");
+ break;
+ case ERESTART_RESTARTBLOCK:
+ /* Syscalls like nanosleep(), poll() which can't be
+ * restarted with their original arguments use this
+ * code. Kernel will execute restart_syscall() instead,
+ * which changes arguments before restarting syscall.
+ * SA_RESTART is ignored (assumed not set) similarly
+ * to ERESTARTNOHAND. (Kernel can't honor SA_RESTART
+ * since restart data is saved in "restart block"
+ * in task struct, and if signal handler uses a syscall
+ * which in turn saves another such restart block,
+ * old data is lost and restart becomes impossible)
+ */
+ tprints("= ? ERESTART_RESTARTBLOCK (Interrupted by signal)");
+ break;
+ default:
+ print_err_ret(tcp->u_rval, tcp->u_error);
+ break;
+ }
+ if (syscall_tampered(tcp))
+ tprints(" (INJECTED)");
+ if ((sys_res & RVAL_STR) && tcp->auxstr)
+ tprintf(" (%s)", tcp->auxstr);
+ } else {
+ if (sys_res & RVAL_NONE)
+ tprints("= ?");
+ else {
+ switch (sys_res & RVAL_MASK) {
+ case RVAL_HEX:
+#if ANY_WORDSIZE_LESS_THAN_KERNEL_LONG
+ if (current_klongsize < sizeof(tcp->u_rval)) {
+ tprintf("= %#x",
+ (unsigned int) tcp->u_rval);
+ } else
+#endif
+ {
+ tprintf("= %#" PRI_klx, tcp->u_rval);
+ }
+ break;
+ case RVAL_OCTAL: {
+ unsigned long long mode =
+ zero_extend_signed_to_ull(tcp->u_rval);
+ tprints("= ");
+#if ANY_WORDSIZE_LESS_THAN_KERNEL_LONG
+ if (current_klongsize < sizeof(tcp->u_rval))
+ mode = (unsigned int) mode;
+#endif
+ print_numeric_ll_umode_t(mode);
+ break;
+ }
+ case RVAL_UDECIMAL:
+#if ANY_WORDSIZE_LESS_THAN_KERNEL_LONG
+ if (current_klongsize < sizeof(tcp->u_rval)) {
+ tprintf("= %u",
+ (unsigned int) tcp->u_rval);
+ } else
+#endif
+ {
+ tprintf("= %" PRI_klu, tcp->u_rval);
+ }
+ break;
+ case RVAL_FD:
+ /*
+ * printfd accepts int as fd and it makes
+ * little sense to pass negative fds to it.
+ */
+ if ((current_klongsize < sizeof(tcp->u_rval)) ||
+ ((kernel_ulong_t) tcp->u_rval <= INT_MAX)) {
+ tprints("= ");
+ printfd(tcp, tcp->u_rval);
+ } else {
+ tprintf("= %" PRI_kld, tcp->u_rval);
+ }
+ break;
+ case RVAL_TID:
+ case RVAL_SID:
+ case RVAL_TGID:
+ case RVAL_PGID: {
+ #define _(_t) [RVAL_##_t - RVAL_TID] = PT_##_t
+ static const enum pid_type types[] = {
+ _(TID), _(SID), _(TGID), _(PGID),
+ };
+ #undef _
+
+ tprints("= ");
+ printpid(tcp, tcp->u_rval,
+ types[(sys_res & RVAL_MASK) - RVAL_TID]);
+ break;
+ }
+ default:
+ error_msg("invalid rval format");
+ break;
+ }
+ }
+ if ((sys_res & RVAL_STR) && tcp->auxstr)
+ tprintf(" (%s)", tcp->auxstr);
+ if (syscall_tampered(tcp))
+ tprints(" (INJECTED)");
+ }
+ if (Tflag) {
+ ts_sub(ts, ts, &tcp->etime);
+ tprintf(" <%ld", (long) ts->tv_sec);
+ if (Tflag_width) {
+ tprintf(".%0*ld",
+ Tflag_width, (long) ts->tv_nsec / Tflag_scale);
+ }
+ tprints(">");
+ }
+ tprints("\n");
+ dumpio(tcp);
+ line_ended();
+
+#ifdef ENABLE_STACKTRACE
+ if (stack_trace_enabled)
+ unwind_tcb_print(tcp);
+#endif
+ return 0;
+}
+
+void
+syscall_exiting_finish(struct tcb *tcp)
+{
+ tcp->flags &= ~(TCB_INSYSCALL | TCB_TAMPERED | TCB_INJECT_DELAY_EXIT);
+ tcp->sys_func_rval = 0;
+ free_tcb_priv_data(tcp);
+
+ if (cflag)
+ tcp->ltime = tcp->stime;
+}
+
+bool
+is_erestart(struct tcb *tcp)
+{
+ switch (tcp->u_error) {
+ case ERESTARTSYS:
+ case ERESTARTNOINTR:
+ case ERESTARTNOHAND:
+ case ERESTART_RESTARTBLOCK:
+ return true;
+ default:
+ return false;
+ }
+}
+
+static unsigned long saved_u_error;
+
+void
+temporarily_clear_syserror(struct tcb *tcp)
+{
+ saved_u_error = tcp->u_error;
+ tcp->u_error = 0;
+}
+
+void
+restore_cleared_syserror(struct tcb *tcp)
+{
+ tcp->u_error = saved_u_error;
+}
+
+static struct_ptrace_syscall_info ptrace_sci;
+
+static bool
+ptrace_syscall_info_is_valid(void)
+{
+ return ptrace_get_syscall_info_supported &&
+ ptrace_sci.op <= PTRACE_SYSCALL_INFO_SECCOMP;
+}
+
+#define XLAT_MACROS_ONLY
+#include "xlat/nt_descriptor_types.h"
+#undef XLAT_MACROS_ONLY
+
+#define ARCH_MIGHT_USE_SET_REGS 1
+
+#include "arch_regs.c"
+
+#if HAVE_ARCH_GETRVAL2
+# include "arch_getrval2.c"
+#endif
+
+#include "getregs_old.h"
+#ifdef HAVE_GETREGS_OLD
+/* Either getregs_old() or set_regs() */
+# undef ARCH_MIGHT_USE_SET_REGS
+# define ARCH_MIGHT_USE_SET_REGS 0
+#endif
+
+#undef ptrace_getregset_or_getregs
+#undef ptrace_setregset_or_setregs
+#ifdef ARCH_REGS_FOR_GETREGSET
+
+# define ptrace_getregset_or_getregs ptrace_getregset
+static long
+ptrace_getregset(pid_t pid)
+{
+# ifdef ARCH_IOVEC_FOR_GETREGSET
+ /* variable iovec */
+ ARCH_IOVEC_FOR_GETREGSET.iov_len = sizeof(ARCH_REGS_FOR_GETREGSET);
+ return ptrace(PTRACE_GETREGSET, pid, NT_PRSTATUS,
+ &ARCH_IOVEC_FOR_GETREGSET);
+# else
+ /* constant iovec */
+ static struct iovec io = {
+ .iov_base = &ARCH_REGS_FOR_GETREGSET,
+ .iov_len = sizeof(ARCH_REGS_FOR_GETREGSET)
+ };
+ return ptrace(PTRACE_GETREGSET, pid, NT_PRSTATUS, &io);
+
+# endif
+}
+
+# if ARCH_MIGHT_USE_SET_REGS
+# define ptrace_setregset_or_setregs ptrace_setregset
+static int
+ptrace_setregset(pid_t pid)
+{
+# ifdef ARCH_IOVEC_FOR_GETREGSET
+ /* variable iovec */
+ return ptrace(PTRACE_SETREGSET, pid, NT_PRSTATUS,
+ &ARCH_IOVEC_FOR_GETREGSET);
+# else
+ /* constant iovec */
+ static struct iovec io = {
+ .iov_base = &ARCH_REGS_FOR_GETREGSET,
+ .iov_len = sizeof(ARCH_REGS_FOR_GETREGSET)
+ };
+ return ptrace(PTRACE_SETREGSET, pid, NT_PRSTATUS, &io);
+# endif
+}
+# endif /* ARCH_MIGHT_USE_SET_REGS */
+
+#elif defined ARCH_REGS_FOR_GETREGS
+
+# define ptrace_getregset_or_getregs ptrace_getregs
+static long
+ptrace_getregs(pid_t pid)
+{
+# if defined SPARC || defined SPARC64
+ /* SPARC systems have the meaning of data and addr reversed */
+ return ptrace(PTRACE_GETREGS, pid, (void *) &ARCH_REGS_FOR_GETREGS, 0);
+# else
+ return ptrace(PTRACE_GETREGS, pid, NULL, &ARCH_REGS_FOR_GETREGS);
+# endif
+}
+
+# if ARCH_MIGHT_USE_SET_REGS
+# define ptrace_setregset_or_setregs ptrace_setregs
+static int
+ptrace_setregs(pid_t pid)
+{
+# if defined SPARC || defined SPARC64
+ /* SPARC systems have the meaning of data and addr reversed */
+ return ptrace(PTRACE_SETREGS, pid, (void *) &ARCH_REGS_FOR_GETREGS, 0);
+# else
+ return ptrace(PTRACE_SETREGS, pid, NULL, &ARCH_REGS_FOR_GETREGS);
+# endif
+}
+# endif /* ARCH_MIGHT_USE_SET_REGS */
+
+#endif /* ARCH_REGS_FOR_GETREGSET || ARCH_REGS_FOR_GETREGS */
+
+static long get_regs_error = -1;
+
+void
+clear_regs(struct tcb *tcp)
+{
+ ptrace_sci.op = 0xff;
+ get_regs_error = -1;
+}
+
+static long
+get_regs(struct tcb *const tcp)
+{
+#ifdef ptrace_getregset_or_getregs
+
+ if (get_regs_error != -1)
+ return get_regs_error;
+
+# ifdef HAVE_GETREGS_OLD
+ /*
+ * Try PTRACE_GETREGSET/PTRACE_GETREGS first,
+ * fallback to getregs_old.
+ */
+ static int use_getregs_old;
+ if (use_getregs_old < 0) {
+ return get_regs_error = ptrace_getregset_or_getregs(tcp->pid);
+ } else if (use_getregs_old == 0) {
+ get_regs_error = ptrace_getregset_or_getregs(tcp->pid);
+ if (get_regs_error >= 0) {
+ use_getregs_old = -1;
+ return get_regs_error;
+ }
+ if (errno == EPERM || errno == ESRCH)
+ return get_regs_error;
+ use_getregs_old = 1;
+ }
+ return get_regs_error = getregs_old(tcp);
+# else /* !HAVE_GETREGS_OLD */
+ /* Assume that PTRACE_GETREGSET/PTRACE_GETREGS works. */
+ get_regs_error = ptrace_getregset_or_getregs(tcp->pid);
+
+# if defined ARCH_PERSONALITY_0_IOV_SIZE
+ if (get_regs_error)
+ return get_regs_error;
+
+ switch (ARCH_IOVEC_FOR_GETREGSET.iov_len) {
+ case ARCH_PERSONALITY_0_IOV_SIZE:
+ update_personality(tcp, 0);
+ break;
+ case ARCH_PERSONALITY_1_IOV_SIZE:
+ update_personality(tcp, 1);
+ break;
+ default: {
+ static bool printed = false;
+
+ if (!printed) {
+ error_msg("Unsupported regset size returned by "
+ "PTRACE_GETREGSET: %zu",
+ ARCH_IOVEC_FOR_GETREGSET.iov_len);
+
+ printed = true;
+ }
+
+ update_personality(tcp, 0);
+ }
+ }
+# endif /* ARCH_PERSONALITY_0_IOV_SIZE */
+
+ return get_regs_error;
+
+# endif /* !HAVE_GETREGS_OLD */
+
+#else /* !ptrace_getregset_or_getregs */
+
+# warning get_regs is not implemented for this architecture yet
+ return 0;
+
+#endif /* !ptrace_getregset_or_getregs */
+}
+
+#ifdef ptrace_setregset_or_setregs
+static int
+set_regs(pid_t pid)
+{
+ return ptrace_setregset_or_setregs(pid);
+}
+#endif /* ptrace_setregset_or_setregs */
+
+struct sysent_buf {
+ struct tcb *tcp;
+ struct_sysent ent;
+ char buf[sizeof("syscall_0x") + sizeof(kernel_ulong_t) * 2];
+};
+
+static void
+free_sysent_buf(void *ptr)
+{
+ struct sysent_buf *s = ptr;
+ s->tcp->s_prev_ent = s->tcp->s_ent = NULL;
+ free(ptr);
+}
+
+static bool
+strace_get_syscall_info(struct tcb *tcp)
+{
+ /*
+ * ptrace_get_syscall_info_supported should have been checked
+ * by the caller.
+ */
+ if (ptrace_sci.op == 0xff) {
+ const size_t size = sizeof(ptrace_sci);
+ if (ptrace(PTRACE_GET_SYSCALL_INFO, tcp->pid,
+ (void *) size, &ptrace_sci) < 0) {
+ get_regs_error = -2;
+ return false;
+ }
+#if SUPPORTED_PERSONALITIES > 1
+ int newpers = get_personality_from_syscall_info(&ptrace_sci);
+ if (newpers >= 0)
+ update_personality(tcp, newpers);
+#endif
+ }
+
+ if (entering(tcp)) {
+ if (ptrace_sci.op == PTRACE_SYSCALL_INFO_EXIT) {
+ error_msg("pid %d: entering"
+ ", ptrace_syscall_info.op == %u",
+ tcp->pid, ptrace_sci.op);
+ /* TODO: handle this. */
+ }
+ } else {
+ if (ptrace_sci.op == PTRACE_SYSCALL_INFO_ENTRY) {
+ error_msg("pid %d: exiting"
+ ", ptrace_syscall_info.op == %u",
+ tcp->pid, ptrace_sci.op);
+ /* TODO: handle this. */
+ }
+ }
+
+ return true;
+}
+
+bool
+get_instruction_pointer(struct tcb *tcp, kernel_ulong_t *ip)
+{
+ if (get_regs_error < -1)
+ return false;
+
+ if (ptrace_get_syscall_info_supported) {
+ if (!strace_get_syscall_info(tcp))
+ return false;
+ *ip = (kernel_ulong_t) ptrace_sci.instruction_pointer;
+ return true;
+ }
+
+#if defined ARCH_PC_REG
+ if (get_regs(tcp) < 0)
+ return false;
+ *ip = (kernel_ulong_t) ARCH_PC_REG;
+ return true;
+#elif defined ARCH_PC_PEEK_ADDR
+ if (upeek(tcp, ARCH_PC_PEEK_ADDR, ip) < 0)
+ return false;
+ return true;
+#else
+# error Neither ARCH_PC_REG nor ARCH_PC_PEEK_ADDR is defined
+#endif
+}
+
+bool
+get_stack_pointer(struct tcb *tcp, kernel_ulong_t *sp)
+{
+ if (get_regs_error < -1)
+ return false;
+
+ if (ptrace_get_syscall_info_supported) {
+ if (!strace_get_syscall_info(tcp))
+ return false;
+ *sp = (kernel_ulong_t) ptrace_sci.stack_pointer;
+ return true;
+ }
+
+#if defined ARCH_SP_REG
+ if (get_regs(tcp) < 0)
+ return false;
+ *sp = (kernel_ulong_t) ARCH_SP_REG;
+ return true;
+#elif defined ARCH_SP_PEEK_ADDR
+ if (upeek(tcp, ARCH_SP_PEEK_ADDR, sp) < 0)
+ return false;
+ return true;
+#else
+ return false;
+#endif
+}
+
+static int
+get_syscall_regs(struct tcb *tcp)
+{
+ if (get_regs_error != -1)
+ return get_regs_error;
+
+ if (ptrace_get_syscall_info_supported)
+ return strace_get_syscall_info(tcp) ? 0 : get_regs_error;
+
+ return get_regs(tcp);
+}
+
+const struct_sysent stub_sysent = {
+ .nargs = MAX_ARGS,
+ .sys_flags = MEMORY_MAPPING_CHANGE,
+ .sen = SEN_printargs,
+ .sys_func = printargs,
+ .sys_name = "????",
+};
+
+/*
+ * Returns:
+ * 0: "ignore this ptrace stop", syscall_entering_decode() should return a "bail
+ * out silently" code.
+ * 1: ok, continue in syscall_entering_decode().
+ * other: error, syscall_entering_decode() should print error indicator
+ * ("????" etc) and return an appropriate code.
+ */
+int
+get_scno(struct tcb *tcp)
+{
+ tcp->scno = -1;
+ tcp->s_ent = NULL;
+ tcp->qual_flg = QUAL_RAW | DEFAULT_QUAL_FLAGS;
+
+ if (get_syscall_regs(tcp) < 0)
+ return -1;
+
+ if (ptrace_syscall_info_is_valid()) {
+ /* Apply arch-specific workarounds. */
+ int rc = arch_check_scno(tcp);
+ if (rc != 1)
+ return rc;
+ tcp->scno = ptrace_sci.entry.nr;
+ } else {
+ int rc = arch_get_scno(tcp);
+ if (rc != 1)
+ return rc;
+ }
+
+ tcp->true_scno = tcp->scno;
+ tcp->scno = shuffle_scno(tcp->scno);
+
+ if (scno_is_valid(tcp->scno)) {
+ tcp->s_ent = &sysent[tcp->scno];
+ tcp->qual_flg = qual_flags(tcp->scno);
+ } else {
+ struct sysent_buf *s = xzalloc(sizeof(*s));
+
+ s->tcp = tcp;
+ s->ent = stub_sysent;
+ s->ent.sys_name = s->buf;
+ xsprintf(s->buf, "syscall_%#" PRI_klx, shuffle_scno(tcp->scno));
+
+ tcp->s_ent = &s->ent;
+
+ set_tcb_priv_data(tcp, s, free_sysent_buf);
+
+ debug_msg("pid %d invalid syscall %#" PRI_klx,
+ tcp->pid, shuffle_scno(tcp->scno));
+ }
+
+ /*
+ * We refrain from argument decoding during recovering
+ * as tracee memory mappings has changed and the registers
+ * are very likely pointing to garbage already.
+ */
+ if (recovering(tcp))
+ tcp->qual_flg |= QUAL_RAW;
+
+ return 1;
+}
+
+static int
+get_syscall_args(struct tcb *tcp)
+{
+ if (ptrace_syscall_info_is_valid()) {
+ const unsigned int n =
+ MIN(ARRAY_SIZE(tcp->u_arg),
+ ARRAY_SIZE(ptrace_sci.entry.args));
+ for (unsigned int i = 0; i < n; ++i)
+ tcp->u_arg[i] = ptrace_sci.entry.args[i];
+#if SUPPORTED_PERSONALITIES > 1
+ if (tcp_sysent(tcp)->sys_flags & COMPAT_SYSCALL_TYPES) {
+ for (unsigned int i = 0; i < n; ++i)
+ tcp->u_arg[i] = (uint32_t) tcp->u_arg[i];
+ }
+#endif
+ /*
+ * So far it's just a workaround for mips o32,
+ * but let's pretend it could be used elsewhere.
+ */
+#if MAX_ARGS > 6
+ arch_get_syscall_args_extra(tcp, n);
+#endif
+ return 1;
+ }
+ return arch_get_syscall_args(tcp);
+}
+
+#ifdef ptrace_getregset_or_getregs
+# define get_syscall_result_regs get_syscall_regs
+#else
+static int get_syscall_result_regs(struct tcb *);
+#endif
+
+/* Returns:
+ * 1: ok, continue in syscall_exiting_trace().
+ * -1: error, syscall_exiting_trace() should print error indicator
+ * ("????" etc) and bail out.
+ */
+static int
+get_syscall_result(struct tcb *tcp)
+{
+ if (get_syscall_result_regs(tcp) < 0)
+ return -1;
+ get_error(tcp,
+ (!(tcp_sysent(tcp)->sys_flags & SYSCALL_NEVER_FAILS)
+ || syscall_tampered(tcp))
+ && !syscall_tampered_nofail(tcp));
+
+ return 1;
+}
+
+static void
+get_error(struct tcb *tcp, const bool check_errno)
+{
+ if (ptrace_syscall_info_is_valid()) {
+ if (ptrace_sci.exit.is_error) {
+ tcp->u_rval = -1;
+ tcp->u_error = -ptrace_sci.exit.rval;
+ } else {
+ tcp->u_error = 0;
+ tcp->u_rval = ptrace_sci.exit.rval;
+ }
+ } else {
+ tcp->u_error = 0;
+ arch_get_error(tcp, check_errno);
+ }
+}
+
+static void
+set_error(struct tcb *tcp, unsigned long new_error)
+{
+ const unsigned long old_error = tcp->u_error;
+
+ if (new_error == old_error || new_error > MAX_ERRNO_VALUE)
+ return;
+
+#ifdef ptrace_setregset_or_setregs
+ /* if we are going to invoke set_regs, call get_regs first */
+ if (get_regs(tcp) < 0)
+ return;
+#endif
+
+ tcp->u_error = new_error;
+ if (arch_set_error(tcp)) {
+ tcp->u_error = old_error;
+ /* arch_set_error does not update u_rval */
+ } else {
+ if (ptrace_syscall_info_is_valid())
+ tcp->u_rval = -1;
+ else
+ get_error(tcp, !(tcp_sysent(tcp)->sys_flags &
+ SYSCALL_NEVER_FAILS));
+ }
+}
+
+static void
+set_success(struct tcb *tcp, kernel_long_t new_rval)
+{
+ const kernel_long_t old_rval = tcp->u_rval;
+
+#ifdef ptrace_setregset_or_setregs
+ /* if we are going to invoke set_regs, call get_regs first */
+ if (get_regs(tcp) < 0)
+ return;
+#endif
+
+ tcp->u_rval = new_rval;
+ if (arch_set_success(tcp)) {
+ tcp->u_rval = old_rval;
+ /* arch_set_success does not update u_error */
+ } else {
+ if (ptrace_syscall_info_is_valid())
+ tcp->u_error = 0;
+ else
+ get_error(tcp, !(tcp_sysent(tcp)->sys_flags &
+ SYSCALL_NEVER_FAILS));
+ }
+}
+
+#include "get_scno.c"
+#include "check_scno.c"
+#include "set_scno.c"
+#include "get_syscall_args.c"
+#ifndef ptrace_getregset_or_getregs
+# include "get_syscall_result.c"
+#endif
+#include "get_error.c"
+#include "set_error.c"
+#ifdef HAVE_GETREGS_OLD
+# include "getregs_old.c"
+#endif
+#include "shuffle_scno.c"
+
+const char *
+syscall_name(kernel_ulong_t scno)
+{
+ return scno_is_valid(scno) ? sysent[scno].sys_name : NULL;
+}
diff --git a/src/sysctl.c b/src/sysctl.c
new file mode 100644
index 000000000..3eab1266b
--- /dev/null
+++ b/src/sysctl.c
@@ -0,0 +1,173 @@
+/*
+ * Copyright (c) 1999 Ulrich Drepper <drepper@cygnus.com>
+ * Copyright (c) 2005 Roland McGrath <roland@redhat.com>
+ * Copyright (c) 2005-2015 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2014-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#include <linux/sysctl.h>
+
+#include "xlat/sysctl_root.h"
+#include "xlat/sysctl_kern.h"
+#include "xlat/sysctl_vm.h"
+#include "xlat/sysctl_net.h"
+#include "xlat/sysctl_net_core.h"
+#include "xlat/sysctl_net_unix.h"
+#include "xlat/sysctl_net_ipv4.h"
+#include "xlat/sysctl_net_ipv4_route.h"
+#include "xlat/sysctl_net_ipv4_conf.h"
+#include "xlat/sysctl_net_ipv6.h"
+#include "xlat/sysctl_net_ipv6_route.h"
+
+SYS_FUNC(sysctl)
+{
+ struct __sysctl_args info;
+ int *name;
+ unsigned long size;
+
+ if (umove_or_printaddr(tcp, tcp->u_arg[0], &info))
+ return RVAL_DECODED;
+
+ size = sizeof(int) * (unsigned long) info.nlen;
+ name = (size / sizeof(int) != (unsigned long) info.nlen) ? NULL : malloc(size);
+ if (name == NULL ||
+ umoven(tcp, (unsigned long) info.name, size, name) < 0) {
+ free(name);
+ if (entering(tcp))
+ tprintf("{%p, %d, %p, %p, %p, %lu}",
+ info.name, info.nlen, info.oldval,
+ info.oldlenp, info.newval, (unsigned long)info.newlen);
+ return RVAL_DECODED;
+ }
+
+ if (entering(tcp)) {
+ unsigned int cnt = 0, max_cnt;
+
+ tprints("{{");
+
+ if (info.nlen == 0)
+ goto out;
+ printxval(sysctl_root, name[0], "CTL_???");
+ ++cnt;
+
+ if (info.nlen == 1)
+ goto out;
+ switch (name[0]) {
+ case CTL_KERN:
+ tprints(", ");
+ printxval(sysctl_kern, name[1], "KERN_???");
+ ++cnt;
+ break;
+ case CTL_VM:
+ tprints(", ");
+ printxval(sysctl_vm, name[1], "VM_???");
+ ++cnt;
+ break;
+ case CTL_NET:
+ tprints(", ");
+ printxval(sysctl_net, name[1], "NET_???");
+ ++cnt;
+
+ if (info.nlen == 2)
+ goto out;
+ switch (name[1]) {
+ case NET_CORE:
+ tprints(", ");
+ printxval(sysctl_net_core, name[2],
+ "NET_CORE_???");
+ break;
+ case NET_UNIX:
+ tprints(", ");
+ printxval(sysctl_net_unix, name[2],
+ "NET_UNIX_???");
+ break;
+ case NET_IPV4:
+ tprints(", ");
+ printxval(sysctl_net_ipv4, name[2],
+ "NET_IPV4_???");
+
+ if (info.nlen == 3)
+ goto out;
+ switch (name[2]) {
+ case NET_IPV4_ROUTE:
+ tprints(", ");
+ printxval(sysctl_net_ipv4_route,
+ name[3],
+ "NET_IPV4_ROUTE_???");
+ break;
+ case NET_IPV4_CONF:
+ tprints(", ");
+ printxval(sysctl_net_ipv4_conf,
+ name[3],
+ "NET_IPV4_CONF_???");
+ break;
+ default:
+ goto out;
+ }
+ break;
+ case NET_IPV6:
+ tprints(", ");
+ printxval(sysctl_net_ipv6, name[2],
+ "NET_IPV6_???");
+
+ if (info.nlen == 3)
+ goto out;
+ switch (name[2]) {
+ case NET_IPV6_ROUTE:
+ tprints(", ");
+ printxval(sysctl_net_ipv6_route,
+ name[3],
+ "NET_IPV6_ROUTE_???");
+ break;
+ default:
+ goto out;
+ }
+ break;
+ default:
+ goto out;
+ }
+ break;
+ default:
+ goto out;
+ }
+out:
+ max_cnt = info.nlen;
+ if (abbrev(tcp) && max_cnt > max_strlen)
+ max_cnt = max_strlen;
+ while (cnt < max_cnt)
+ tprintf(", %x", name[cnt++]);
+ if (cnt < (unsigned) info.nlen)
+ tprints(", ...");
+ tprintf("}, %d, ", info.nlen);
+ } else {
+ size_t oldlen = 0;
+ if (info.oldval == NULL) {
+ tprints("NULL");
+ } else if (umove(tcp, ptr_to_kulong(info.oldlenp), &oldlen) >= 0
+ && info.nlen >= 2
+ && ((name[0] == CTL_KERN
+ && (name[1] == KERN_OSRELEASE
+ || name[1] == KERN_OSTYPE
+ )))) {
+ printpath(tcp, ptr_to_kulong(info.oldval));
+ } else {
+ tprintf("%p", info.oldval);
+ }
+ tprintf(", %lu, ", (unsigned long)oldlen);
+ if (info.newval == NULL)
+ tprints("NULL");
+ else if (syserror(tcp))
+ tprintf("%p", info.newval);
+ else
+ printpath(tcp, ptr_to_kulong(info.newval));
+ tprintf(", %lu", (unsigned long)info.newlen);
+ }
+
+ free(name);
+ return 0;
+}
diff --git a/src/sysent.h b/src/sysent.h
new file mode 100644
index 000000000..eed15b25a
--- /dev/null
+++ b/src/sysent.h
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2016-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_SYSENT_H
+# define STRACE_SYSENT_H
+
+typedef struct sysent {
+ unsigned nargs;
+ int sys_flags;
+ int sen;
+ int (*sys_func)();
+ const char *sys_name;
+} struct_sysent;
+
+# define TRACE_FILE 000000001 /* Trace file-related syscalls. */
+# define TRACE_IPC 000000002 /* Trace IPC-related syscalls. */
+# define TRACE_NETWORK 000000004 /* Trace network-related syscalls. */
+# define TRACE_PROCESS 000000010 /* Trace process-related syscalls. */
+# define TRACE_SIGNAL 000000020 /* Trace signal-related syscalls. */
+# define TRACE_DESC 000000040 /* Trace file descriptor-related syscalls. */
+# define TRACE_MEMORY 000000100 /* Trace memory mapping-related syscalls. */
+# define SYSCALL_NEVER_FAILS 000000200 /* Syscall is always successful. */
+# define MEMORY_MAPPING_CHANGE 000000400 /* Trigger proc/maps cache updating */
+# define STACKTRACE_CAPTURE_ON_ENTER 000001000 /* Capture stacktrace on "entering" stage */
+# define TRACE_INDIRECT_SUBCALL 000002000 /* Syscall is an indirect socket/ipc subcall. */
+# define COMPAT_SYSCALL_TYPES 000004000 /* A compat syscall that uses compat types. */
+# define TRACE_STAT 000010000 /* Trace {,*_}{,old}{,x}stat{,64} syscalls. */
+# define TRACE_LSTAT 000020000 /* Trace *lstat* syscalls. */
+# define TRACE_STATFS 000040000 /* Trace statfs, statfs64, and statvfs syscalls. */
+# define TRACE_FSTATFS 000100000 /* Trace fstatfs, fstatfs64 and fstatvfs syscalls. */
+# define TRACE_STATFS_LIKE 000200000 /* Trace statfs-like, fstatfs-like and ustat syscalls. */
+# define TRACE_FSTAT 000400000 /* Trace *fstat{,at}{,64} syscalls. */
+# define TRACE_STAT_LIKE 001000000 /* Trace *{,l,f}stat{,x,at}{,64} syscalls. */
+# define TRACE_PURE 002000000 /* Trace getter syscalls with no arguments. */
+# define TRACE_SECCOMP_DEFAULT 004000000 /* Syscall is traced by seccomp filter by default. */
+# define TRACE_CREDS 010000000 /* Trace process credentials-related syscalls. */
+# define TRACE_CLOCK 020000000 /* Trace syscalls reading or modifying system clocks. */
+
+#endif /* !STRACE_SYSENT_H */
diff --git a/src/sysent_shorthand_defs.h b/src/sysent_shorthand_defs.h
new file mode 100644
index 000000000..e9c83f74c
--- /dev/null
+++ b/src/sysent_shorthand_defs.h
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2017-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifdef STRACE_TESTS_H
+
+# define TD 0
+# define TF 0
+# define TI 0
+# define TN 0
+# define TP 0
+# define TS 0
+# define TM 0
+# define TST 0
+# define TLST 0
+# define TFST 0
+# define TSTA 0
+# define TSF 0
+# define TFSF 0
+# define TSFA 0
+# define PU 0
+# define NF 0
+# define MA 0
+# define SI 0
+# define SE 0
+# define CST 0
+# define TSD 0
+# define TC 0
+# define TCL 0
+# define SEN(a) 0, 0
+
+#else /* !STRACE_TESTS_H */
+
+# define TD TRACE_DESC
+# define TF TRACE_FILE
+# define TI TRACE_IPC
+# define TN TRACE_NETWORK
+# define TP TRACE_PROCESS
+# define TS TRACE_SIGNAL
+# define TM TRACE_MEMORY
+# define TST TRACE_STAT
+# define TLST TRACE_LSTAT
+# define TFST TRACE_FSTAT
+# define TSTA TRACE_STAT_LIKE
+# define TSF TRACE_STATFS
+# define TFSF TRACE_FSTATFS
+# define TSFA TRACE_STATFS_LIKE
+# define PU TRACE_PURE
+# define NF SYSCALL_NEVER_FAILS
+# define MA MAX_ARGS
+# define SI MEMORY_MAPPING_CHANGE
+# define SE STACKTRACE_CAPTURE_ON_ENTER
+# define CST COMPAT_SYSCALL_TYPES
+# define TSD TRACE_SECCOMP_DEFAULT
+# define TC TRACE_CREDS
+# define TCL TRACE_CLOCK
+/* SEN(a) is defined elsewhere */
+
+#endif
diff --git a/src/sysent_shorthand_undefs.h b/src/sysent_shorthand_undefs.h
new file mode 100644
index 000000000..708dd552f
--- /dev/null
+++ b/src/sysent_shorthand_undefs.h
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2017-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#undef TD
+#undef TF
+#undef TI
+#undef TN
+#undef TP
+#undef TS
+#undef TM
+#undef TST
+#undef TLST
+#undef TFST
+#undef TSTA
+#undef TSF
+#undef TFSF
+#undef TSFA
+#undef PU
+#undef NF
+#undef MA
+#undef SI
+#undef SE
+#undef CST
+#undef TSD
+#undef TC
+#undef TCL
+#undef SEN
diff --git a/src/sysinfo.c b/src/sysinfo.c
new file mode 100644
index 000000000..202525952
--- /dev/null
+++ b/src/sysinfo.c
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993-1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
+ * Copyright (c) 2012 H.J. Lu <hongjiu.lu@intel.com>
+ * Copyright (c) 2012 Denys Vlasenko <vda.linux@googlemail.com>
+ * Copyright (c) 2014-2015 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2015 Elvira Khabirova <lineprinter0@gmail.com>
+ * Copyright (c) 2014-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include DEF_MPERS_TYPE(sysinfo_t)
+#include <sys/sysinfo.h>
+typedef struct sysinfo sysinfo_t;
+#include MPERS_DEFS
+
+SYS_FUNC(sysinfo)
+{
+ sysinfo_t si;
+
+ if (entering(tcp))
+ return 0;
+
+ if (!umove_or_printaddr(tcp, tcp->u_arg[0], &si)) {
+ tprint_struct_begin();
+ PRINT_FIELD_U(si, uptime);
+ tprint_struct_next();
+ PRINT_FIELD_ARRAY(si, loads, tcp,
+ print_kulong_array_member);
+ tprint_struct_next();
+ PRINT_FIELD_U(si, totalram);
+ tprint_struct_next();
+ PRINT_FIELD_U(si, freeram);
+ tprint_struct_next();
+ PRINT_FIELD_U(si, sharedram);
+ tprint_struct_next();
+ PRINT_FIELD_U(si, bufferram);
+ tprint_struct_next();
+ PRINT_FIELD_U(si, totalswap);
+ tprint_struct_next();
+ PRINT_FIELD_U(si, freeswap);
+ tprint_struct_next();
+ PRINT_FIELD_U(si, procs);
+ tprint_struct_next();
+ PRINT_FIELD_U(si, totalhigh);
+ tprint_struct_next();
+ PRINT_FIELD_U(si, freehigh);
+ tprint_struct_next();
+ PRINT_FIELD_U(si, mem_unit);
+ tprint_struct_end();
+ }
+
+ return 0;
+}
diff --git a/src/syslog.c b/src/syslog.c
new file mode 100644
index 000000000..e3420802a
--- /dev/null
+++ b/src/syslog.c
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2012-2015 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2014-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#include "xlat/syslog_action_type.h"
+#include "xlat/syslog_console_levels.h"
+
+SYS_FUNC(syslog)
+{
+ int type = tcp->u_arg[0];
+ int len = tcp->u_arg[2];
+
+ if (entering(tcp)) {
+ /* type */
+ printxval_ex(syslog_action_type, type, "SYSLOG_ACTION_???",
+ XLAT_STYLE_VERBOSE | XLAT_STYLE_FMT_D);
+ }
+
+ switch (type) {
+ /* Those commands have bufp and len ignored */
+ case SYSLOG_ACTION_CLOSE:
+ case SYSLOG_ACTION_OPEN:
+ case SYSLOG_ACTION_CLEAR:
+ case SYSLOG_ACTION_CONSOLE_OFF:
+ case SYSLOG_ACTION_CONSOLE_ON:
+ case SYSLOG_ACTION_SIZE_UNREAD:
+ case SYSLOG_ACTION_SIZE_BUFFER:
+ return RVAL_DECODED;
+
+ case SYSLOG_ACTION_READ:
+ case SYSLOG_ACTION_READ_ALL:
+ case SYSLOG_ACTION_READ_CLEAR:
+ if (entering(tcp)) {
+ tprints(", ");
+ return 0;
+ }
+ break;
+
+ case SYSLOG_ACTION_CONSOLE_LEVEL: /* Uses len */
+ tprints(", ");
+ printaddr64(tcp->u_arg[1]);
+ tprints(", ");
+ printxval_ex(syslog_console_levels, len, "LOGLEVEL_???",
+ XLAT_STYLE_VERBOSE | XLAT_STYLE_FMT_D);
+ return RVAL_DECODED;
+
+ default:
+ tprints(", ");
+ printaddr64(tcp->u_arg[1]);
+ tprintf(", %d", len);
+ return RVAL_DECODED;
+ }
+
+ /* syscall exit handler for SYSLOG_ACTION_READ* */
+
+ /* bufp */
+ if (syserror(tcp))
+ printaddr64(tcp->u_arg[1]);
+ else
+ printstrn(tcp, tcp->u_arg[1], tcp->u_rval);
+ /* len */
+ tprintf(", %d", len);
+
+ return 0;
+}
diff --git a/src/sysmips.c b/src/sysmips.c
new file mode 100644
index 000000000..db595a9de
--- /dev/null
+++ b/src/sysmips.c
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2001 Wichert Akkerman <wichert@deephackmode.org>
+ * Copyright (c) 2014-2015 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2014-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#ifdef MIPS
+
+# ifdef HAVE_LINUX_UTSNAME_H
+# include <linux/utsname.h>
+# endif
+# ifdef HAVE_ASM_SYSMIPS_H
+# include <asm/sysmips.h>
+# endif
+
+# ifndef __NEW_UTS_LEN
+# define __NEW_UTS_LEN 64
+# endif
+
+# include "xlat/sysmips_operations.h"
+
+SYS_FUNC(sysmips)
+{
+ printxval64(sysmips_operations, tcp->u_arg[0], "???");
+ tprints(", ");
+
+ switch (tcp->u_arg[0]) {
+ case SETNAME: {
+ char nodename[__NEW_UTS_LEN + 1];
+
+ if (!verbose(tcp))
+ break;
+ if (umovestr(tcp, tcp->u_arg[1], (__NEW_UTS_LEN + 1),
+ nodename) < 0) {
+ printaddr(tcp->u_arg[1]);
+ } else {
+ print_quoted_cstring(nodename, __NEW_UTS_LEN + 1);
+ }
+ return RVAL_DECODED;
+ }
+ case MIPS_ATOMIC_SET:
+ printaddr(tcp->u_arg[1]);
+ tprintf(", %#" PRI_klx, tcp->u_arg[2]);
+ return RVAL_DECODED;
+ case MIPS_FIXADE:
+ tprintf("%#" PRI_klx, tcp->u_arg[1]);
+ return RVAL_DECODED;
+ }
+
+ tprintf("%" PRI_kld ", %" PRI_kld ", %" PRI_kld,
+ tcp->u_arg[1], tcp->u_arg[2], tcp->u_arg[3]);
+ return RVAL_DECODED;
+}
+
+#endif /* MIPS */
diff --git a/src/tee.c b/src/tee.c
new file mode 100644
index 000000000..abd70fb64
--- /dev/null
+++ b/src/tee.c
@@ -0,0 +1,594 @@
+/*
+ * Copyright (c) 2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#include "types/tee.h"
+
+#define XLAT_MACROS_ONLY
+#include "xlat/tee_ioctl_cmds.h"
+#undef XLAT_MACROS_ONLY
+
+#include "xlat/tee_ioctl_gen_caps.h"
+#include "xlat/tee_ioctl_impl_ids.h"
+#include "xlat/tee_ioctl_login_types.h"
+#include "xlat/tee_ioctl_max_arg_size.h"
+#include "xlat/tee_ioctl_origins.h"
+#include "xlat/tee_ioctl_optee_caps.h"
+#include "xlat/tee_ioctl_param_attr_types.h"
+#include "xlat/tee_ioctl_shm_flags.h"
+
+#define TEE_IOCTL_PARAM_SIZE(x) (sizeof(struct_tee_ioctl_param) * (x))
+
+#define TEE_FETCH_BUF_DATA(buf_, arg_, params_) \
+ tee_fetch_buf_data(tcp, arg, &buf_, sizeof(arg_), \
+ &arg_, &arg_.num_params, \
+ params_)
+
+/* session id is printed as 0x%x in libteec */
+#define PRINT_FIELD_SESSION(where_, field_) \
+ PRINT_FIELD_X(where_, field_)
+
+static void
+tee_print_buf(struct_tee_ioctl_buf_data *buf)
+{
+ tprint_struct_begin();
+ PRINT_FIELD_U(*buf, buf_len);
+ tprint_struct_next();
+ PRINT_FIELD_ADDR64(*buf, buf_ptr);
+ tprint_struct_end();
+}
+
+static int
+tee_fetch_buf_data(struct tcb *const tcp,
+ const kernel_ulong_t arg,
+ struct_tee_ioctl_buf_data *buf,
+ size_t arg_size,
+ void *arg_struct,
+ unsigned *num_params,
+ uint64_t *params)
+{
+ if (umove_or_printaddr(tcp, arg, buf))
+ return RVAL_IOCTL_DECODED;
+ if (buf->buf_len > TEE_MAX_ARG_SIZE || buf->buf_len < arg_size) {
+ tee_print_buf(buf);
+ return RVAL_IOCTL_DECODED;
+ }
+ if (umoven(tcp, buf->buf_ptr, arg_size, arg_struct)) {
+ tee_print_buf(buf);
+ return RVAL_IOCTL_DECODED;
+ }
+ if (entering(tcp) &&
+ (arg_size + TEE_IOCTL_PARAM_SIZE(*num_params) != buf->buf_len)) {
+ /*
+ * We could print whatever number of params
+ * is in buf_data, but the kernel would ignore
+ * them anyway (and return -EINVAL) if
+ * the above condition is not satisfied.
+ *
+ * Except for on exiting. The kernel has the right
+ * to update num_params but not buf_len
+ * (see tee_ioctl_supp_recv)
+ */
+ tee_print_buf(buf);
+ return RVAL_IOCTL_DECODED;
+ }
+ if (*num_params) {
+ *params = buf->buf_ptr + arg_size;
+ } else {
+ *params = 0;
+ }
+
+ return 0;
+}
+
+static bool
+tee_print_param_fn(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data)
+{
+ struct_tee_ioctl_param *param = (struct_tee_ioctl_param *) elem_buf;
+
+ tprint_struct_begin();
+ tprints_field_name("attr");
+ printxval(tee_ioctl_param_attr_types,
+ param->attr & ~TEE_IOCTL_PARAM_ATTR_META,
+ "TEE_IOCTL_PARAM_ATTR_");
+ if (param->attr & TEE_IOCTL_PARAM_ATTR_META)
+ tprints("|TEE_IOCTL_PARAM_ATTR_META");
+
+ switch (param->attr) {
+ case TEE_IOCTL_PARAM_ATTR_TYPE_NONE:
+ break;
+
+ case TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_INPUT:
+ case TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_INOUT:
+ case TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_OUTPUT:
+ tprint_struct_next();
+ tprints_field_name("shm_offs");
+ tprintf("%#llx", (unsigned long long) param->a);
+ tprint_struct_next();
+ tprints_field_name("size");
+ tprintf("%#llx", (unsigned long long) param->b);
+ tprint_struct_next();
+ tprints_field_name("shm_id");
+ tprintf("%llu", (unsigned long long) param->c);
+ break;
+
+ case TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_INPUT:
+ case TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_INOUT:
+ case TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_OUTPUT:
+ default:
+ tprint_struct_next();
+ PRINT_FIELD_X(*param, a);
+ tprint_struct_next();
+ PRINT_FIELD_X(*param, b);
+ tprint_struct_next();
+ PRINT_FIELD_X(*param, c);
+ break;
+ }
+ tprint_struct_end();
+ return true;
+}
+
+static void
+tee_print_params(struct tcb *const tcp, uint64_t params_start, unsigned num_params)
+{
+ struct_tee_ioctl_param param_buffer;
+
+ tprint_struct_next();
+ tprints_field_name("params");
+ print_array(tcp, params_start, num_params, &param_buffer, sizeof(param_buffer),
+ tfetch_mem, tee_print_param_fn, NULL);
+}
+
+static int
+tee_version(struct tcb *const tcp, const kernel_ulong_t arg)
+{
+ struct_tee_ioctl_version_data version;
+
+ if (entering(tcp)) {
+ tprints(", ");
+ return 0;
+ }
+
+ if (umove_or_printaddr(tcp, arg, &version))
+ return RVAL_IOCTL_DECODED;
+
+ tprint_struct_begin();
+ PRINT_FIELD_XVAL(version, impl_id,
+ tee_ioctl_impl_ids, "TEE_IMPL_ID_???");
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(version, gen_caps,
+ tee_ioctl_gen_caps, "TEE_GEN_CAP_???");
+ if (version.impl_id == TEE_IMPL_ID_OPTEE) {
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(version, impl_caps,
+ tee_ioctl_optee_caps, "TEE_OPTEE_CAP_???");
+ } else {
+ tprint_struct_next();
+ PRINT_FIELD_X(version, impl_caps);
+ }
+
+ tprint_struct_end();
+ return RVAL_IOCTL_DECODED;
+}
+
+static int
+tee_open_session(struct tcb *const tcp, const kernel_ulong_t arg)
+{
+ int rval;
+ struct_tee_ioctl_buf_data buf_data;
+ struct_tee_ioctl_open_session_arg open_session;
+ uint64_t params;
+ gid_t gid;
+
+ if (entering(tcp)) {
+ tprints(", ");
+
+ if ((rval = TEE_FETCH_BUF_DATA(buf_data, open_session, &params)))
+ return rval;
+
+ tprint_struct_begin();
+ PRINT_FIELD_U(buf_data, buf_len);
+ tprint_struct_next();
+ tprints_field_name("buf_ptr");
+ tprint_struct_begin();
+ PRINT_FIELD_UUID(open_session, uuid);
+ tprint_struct_next();
+ PRINT_FIELD_XVAL(open_session, clnt_login,
+ tee_ioctl_login_types, "TEE_IOCTL_LOGIN_???");
+ /*
+ * tee_ioctl_open_session_arg.clnt_uuid is used to pass
+ * connectionData, which is currently only used to indicate
+ * which group the client application wishes to authenticate as
+ * (when TEE_IOCTL_LOGIN_GROUP or TEE_IOCTL_LOGIN_GROUP_APPLICATION
+ * are used).
+ *
+ * It is not an UUID; actual client UUID is computed in the kernel.
+ */
+ switch (open_session.clnt_login) {
+ case TEE_IOCTL_LOGIN_PUBLIC:
+ case TEE_IOCTL_LOGIN_USER:
+ case TEE_IOCTL_LOGIN_APPLICATION:
+ case TEE_IOCTL_LOGIN_USER_APPLICATION:
+ break;
+ case TEE_IOCTL_LOGIN_GROUP:
+ case TEE_IOCTL_LOGIN_GROUP_APPLICATION:
+ memcpy(&gid, open_session.clnt_uuid, sizeof(gid));
+ printuid(", clnt_uuid=", gid);
+ break;
+ default:
+ tprint_struct_next();
+ PRINT_FIELD_X_ARRAY(open_session, clnt_uuid);
+ }
+ tprint_struct_next();
+ PRINT_FIELD_U(open_session, cancel_id);
+ tprint_struct_next();
+ PRINT_FIELD_U(open_session, num_params);
+ tee_print_params(tcp, params, open_session.num_params);
+
+ tprint_struct_end();
+ return 0;
+
+ } else if (syserror(tcp)) {
+ tprint_struct_end();
+ return RVAL_IOCTL_DECODED;
+
+ } else {
+ tprint_value_changed();
+ /*
+ * Yes, params are [in/out] for TEE_IOC_OPEN_SESSION.
+ * As for all other operations they are used in.
+ */
+ if ((rval = TEE_FETCH_BUF_DATA(buf_data, open_session, &params)))
+ return rval;
+
+ tprint_struct_begin();
+ PRINT_FIELD_SESSION(open_session, session);
+ tprint_struct_next();
+ PRINT_FIELD_U(open_session, ret);
+ tprint_struct_next();
+ PRINT_FIELD_XVAL(open_session, ret_origin, tee_ioctl_origins,
+ "TEEC_ORIGIN_???");
+ tee_print_params(tcp, params, open_session.num_params);
+
+ tprint_struct_end();
+ tprint_struct_end();
+ return RVAL_IOCTL_DECODED;
+ }
+}
+
+static int
+tee_invoke(struct tcb *const tcp, const kernel_ulong_t arg)
+{
+ int rval;
+ struct_tee_ioctl_buf_data buf_data;
+ struct_tee_ioctl_invoke_arg invoke;
+ uint64_t params;
+
+ if (entering(tcp)) {
+ tprints(", ");
+ if ((rval = TEE_FETCH_BUF_DATA(buf_data, invoke, &params)))
+ return rval;
+
+ tprint_struct_begin();
+ PRINT_FIELD_U(buf_data, buf_len);
+ tprint_struct_next();
+ tprints_field_name("buf_ptr");
+ tprint_struct_begin();
+ PRINT_FIELD_U(invoke, func);
+ tprint_struct_next();
+ PRINT_FIELD_SESSION(invoke, session);
+ tprint_struct_next();
+ PRINT_FIELD_U(invoke, cancel_id);
+ tprint_struct_next();
+ PRINT_FIELD_U(invoke, num_params);
+ tee_print_params(tcp, params, invoke.num_params);
+
+ tprint_struct_end();
+ return 0;
+
+ } else if (syserror(tcp)) {
+ tprint_struct_end();
+ return RVAL_IOCTL_DECODED;
+
+ } else {
+ tprint_value_changed();
+ if ((rval = TEE_FETCH_BUF_DATA(buf_data, invoke, &params)))
+ return rval;
+
+ tprint_struct_begin();
+ PRINT_FIELD_U(invoke, ret);
+ tprint_struct_next();
+ PRINT_FIELD_XVAL(invoke, ret_origin, tee_ioctl_origins,
+ "TEEC_ORIGIN_???");
+ tee_print_params(tcp, params, invoke.num_params);
+
+ tprint_struct_end();
+ tprint_struct_end();
+ return RVAL_IOCTL_DECODED;
+ }
+}
+
+static int
+tee_cancel(struct tcb *const tcp, const kernel_ulong_t arg)
+{
+ struct_tee_ioctl_cancel_arg cancel;
+
+ tprints(", ");
+ if (umove_or_printaddr(tcp, arg, &cancel))
+ return RVAL_IOCTL_DECODED;
+
+ tprint_struct_begin();
+ PRINT_FIELD_U(cancel, cancel_id);
+ tprint_struct_next();
+ PRINT_FIELD_SESSION(cancel, session);
+
+ tprint_struct_end();
+ return RVAL_IOCTL_DECODED;
+}
+
+static int
+tee_close_session(struct tcb *const tcp, const kernel_ulong_t arg)
+{
+ struct_tee_ioctl_close_session_arg close_session;
+
+ tprints(", ");
+ if (umove_or_printaddr(tcp, arg, &close_session))
+ return RVAL_IOCTL_DECODED;
+
+ tprint_struct_begin();
+ PRINT_FIELD_SESSION(close_session, session);
+
+ tprint_struct_end();
+ return RVAL_IOCTL_DECODED;
+}
+
+static int
+tee_suppl_recv(struct tcb *const tcp, const kernel_ulong_t arg)
+{
+ int rval;
+ struct_tee_ioctl_buf_data buf_data;
+ struct_tee_iocl_supp_recv_arg supp_recv;
+ uint64_t params;
+
+ if (entering(tcp)) {
+ tprints(", ");
+ if ((rval = TEE_FETCH_BUF_DATA(buf_data, supp_recv, &params)))
+ return rval;
+
+ tprint_struct_begin();
+ PRINT_FIELD_U(buf_data, buf_len);
+ tprint_struct_next();
+ tprints_field_name("buf_ptr");
+ tprint_struct_begin();
+ PRINT_FIELD_U(supp_recv, func);
+ tprint_struct_next();
+ PRINT_FIELD_U(supp_recv, num_params);
+ tee_print_params(tcp, params, supp_recv.num_params);
+
+ tprint_struct_end();
+ return 0;
+
+ } else if (syserror(tcp)) {
+ tprint_struct_end();
+ return RVAL_IOCTL_DECODED;
+
+ } else {
+ tprint_value_changed();
+ if ((rval = TEE_FETCH_BUF_DATA(buf_data, supp_recv, &params)))
+ return rval;
+
+ /* num_params is [in/out] for TEE_IOC_SUPPL_RECV only */
+ tprint_struct_begin();
+ PRINT_FIELD_U(supp_recv, num_params);
+ tee_print_params(tcp, params, supp_recv.num_params);
+
+ tprint_struct_end();
+ tprint_struct_end();
+ return RVAL_IOCTL_DECODED;
+ }
+}
+
+static int
+tee_suppl_send(struct tcb *const tcp, const kernel_ulong_t arg)
+{
+ int rval;
+ struct_tee_ioctl_buf_data buf_data;
+ struct_tee_iocl_supp_send_arg supp_send;
+ uint64_t params;
+
+ if (entering(tcp)) {
+ tprints(", ");
+ if ((rval = TEE_FETCH_BUF_DATA(buf_data, supp_send, &params)))
+ return rval;
+
+ tprint_struct_begin();
+ PRINT_FIELD_U(buf_data, buf_len);
+ tprint_struct_next();
+ tprints_field_name("buf_ptr");
+ tprint_struct_begin();
+ PRINT_FIELD_U(supp_send, num_params);
+ tee_print_params(tcp, params, supp_send.num_params);
+
+ tprint_struct_end();
+ return 0;
+
+ } else if (syserror(tcp)) {
+ tprint_struct_end();
+ return RVAL_IOCTL_DECODED;
+
+ } else {
+ tprint_value_changed();
+ if ((rval = TEE_FETCH_BUF_DATA(buf_data, supp_send, &params)))
+ return rval;
+
+ tprint_struct_begin();
+ PRINT_FIELD_U(supp_send, ret);
+ tee_print_params(tcp, params, supp_send.num_params);
+
+ tprint_struct_end();
+ tprint_struct_end();
+ return RVAL_IOCTL_DECODED;
+ }
+}
+
+static int
+tee_shm_alloc(struct tcb *const tcp, const kernel_ulong_t arg)
+{
+ struct_tee_ioctl_shm_alloc_data shm_alloc;
+
+ if (entering(tcp)) {
+ tprints(", ");
+ if (umove_or_printaddr(tcp, arg, &shm_alloc))
+ return RVAL_IOCTL_DECODED;
+
+ tprint_struct_begin();
+ PRINT_FIELD_X(shm_alloc, size);
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(shm_alloc, flags,
+ tee_ioctl_shm_flags, "TEE_IOCTL_SHM_???");
+ tprint_struct_end();
+ return 0;
+
+ } else if (syserror(tcp)) {
+ return RVAL_IOCTL_DECODED;
+
+ } else {
+ tprint_value_changed();
+ if (umove_or_printaddr(tcp, arg, &shm_alloc))
+ return RVAL_IOCTL_DECODED;
+
+ tprint_struct_begin();
+ PRINT_FIELD_X(shm_alloc, size);
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(shm_alloc, flags,
+ tee_ioctl_shm_flags, "TEE_IOCTL_SHM_???");
+ tprint_struct_next();
+ PRINT_FIELD_D(shm_alloc, id);
+
+ tprint_struct_end();
+ return RVAL_IOCTL_DECODED;
+ }
+}
+
+static int
+tee_shm_register_fd(struct tcb *const tcp, const kernel_ulong_t arg)
+{
+ struct_tee_ioctl_shm_register_fd_data shm_register_fd;
+
+ if (entering(tcp)) {
+ tprints(", ");
+ if (umove_or_printaddr(tcp, arg, &shm_register_fd))
+ return RVAL_IOCTL_DECODED;
+
+ tprint_struct_begin();
+ PRINT_FIELD_FD(shm_register_fd, fd, tcp);
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(shm_register_fd, flags,
+ tee_ioctl_shm_flags, "TEE_IOCTL_SHM_???");
+ tprint_struct_end();
+ return 0;
+
+ } else if (syserror(tcp)) {
+ return RVAL_IOCTL_DECODED;
+
+ } else {
+ tprint_value_changed();
+ if (umove_or_printaddr(tcp, arg, &shm_register_fd))
+ return RVAL_IOCTL_DECODED;
+
+ tprint_struct_begin();
+ PRINT_FIELD_X(shm_register_fd, size);
+ tprint_struct_next();
+ PRINT_FIELD_D(shm_register_fd, id);
+
+ tprint_struct_end();
+ return RVAL_IOCTL_DECODED;
+ }
+}
+
+static int
+tee_shm_register(struct tcb *const tcp, const kernel_ulong_t arg)
+{
+ struct_tee_ioctl_shm_register_data shm_register;
+
+ if (entering(tcp)) {
+ tprints(", ");
+ if (umove_or_printaddr(tcp, arg, &shm_register))
+ return RVAL_IOCTL_DECODED;
+
+ tprint_struct_begin();
+ PRINT_FIELD_ADDR64(shm_register, addr);
+ tprint_struct_next();
+ PRINT_FIELD_X(shm_register, length);
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(shm_register, flags,
+ tee_ioctl_shm_flags, "TEE_IOCTL_SHM_???");
+ tprint_struct_end();
+ return 0;
+
+ } else if (syserror(tcp)) {
+ return RVAL_IOCTL_DECODED;
+
+ } else {
+ tprint_value_changed();
+ if (umove_or_printaddr(tcp, arg, &shm_register))
+ return RVAL_IOCTL_DECODED;
+
+ tprint_struct_begin();
+ PRINT_FIELD_X(shm_register, length);
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(shm_register, flags,
+ tee_ioctl_shm_flags, "TEE_IOCTL_SHM_???");
+ tprint_struct_next();
+ PRINT_FIELD_D(shm_register, id);
+
+ tprint_struct_end();
+ return RVAL_IOCTL_DECODED;
+ }
+}
+
+int
+tee_ioctl(struct tcb *const tcp, const unsigned int code,
+ const kernel_ulong_t arg)
+{
+ switch (code) {
+ case TEE_IOC_VERSION:
+ return tee_version(tcp, arg);
+
+ case TEE_IOC_OPEN_SESSION:
+ return tee_open_session(tcp, arg);
+
+ case TEE_IOC_INVOKE:
+ return tee_invoke(tcp, arg);
+
+ case TEE_IOC_CANCEL:
+ return tee_cancel(tcp, arg);
+
+ case TEE_IOC_CLOSE_SESSION:
+ return tee_close_session(tcp, arg);
+
+ case TEE_IOC_SUPPL_RECV:
+ return tee_suppl_recv(tcp, arg);
+
+ case TEE_IOC_SUPPL_SEND:
+ return tee_suppl_send(tcp, arg);
+
+ case TEE_IOC_SHM_ALLOC:
+ return tee_shm_alloc(tcp, arg);
+
+ case TEE_IOC_SHM_REGISTER_FD:
+ /* This one isn't upstream */
+ return tee_shm_register_fd(tcp, arg);
+
+ case TEE_IOC_SHM_REGISTER:
+ return tee_shm_register(tcp, arg);
+
+ default:
+ return RVAL_DECODED;
+ }
+}
diff --git a/src/term.c b/src/term.c
new file mode 100644
index 000000000..b413a62a4
--- /dev/null
+++ b/src/term.c
@@ -0,0 +1,276 @@
+/*
+ * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1996-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+/*
+ * The C library's definition of struct termios might differ from
+ * the kernel one, and we need to use the kernel layout.
+ */
+#include <linux/termios.h>
+
+#include "xlat/tcxonc_options.h"
+#include "xlat/tcflsh_options.h"
+#include "xlat/baud_options.h"
+#include "xlat/modem_flags.h"
+
+static void
+decode_termios(struct tcb *const tcp, const kernel_ulong_t addr)
+{
+ struct termios tios;
+
+ tprints(", ");
+ if (umove_or_printaddr(tcp, addr, &tios))
+ return;
+ if (abbrev(tcp)) {
+ tprints("{");
+ printxval(baud_options, tios.c_cflag & CBAUD, "B???");
+ tprintf(" %sopost %sisig %sicanon %secho ...}",
+ (tios.c_oflag & OPOST) ? "" : "-",
+ (tios.c_lflag & ISIG) ? "" : "-",
+ (tios.c_lflag & ICANON) ? "" : "-",
+ (tios.c_lflag & ECHO) ? "" : "-");
+ return;
+ }
+ tprintf("{c_iflags=%#lx, c_oflags=%#lx, ",
+ (long) tios.c_iflag, (long) tios.c_oflag);
+ tprintf("c_cflags=%#lx, c_lflags=%#lx, ",
+ (long) tios.c_cflag, (long) tios.c_lflag);
+ tprintf("c_line=%u, ", tios.c_line);
+ if (!(tios.c_lflag & ICANON))
+ tprintf("c_cc[VMIN]=%d, c_cc[VTIME]=%d, ",
+ tios.c_cc[VMIN], tios.c_cc[VTIME]);
+ tprints("c_cc=");
+ print_quoted_string((char *) tios.c_cc, NCCS, QUOTE_FORCE_HEX);
+ tprints("}");
+}
+
+static void
+decode_termio(struct tcb *const tcp, const kernel_ulong_t addr)
+{
+ struct termio tio;
+ int i;
+
+ tprints(", ");
+ if (umove_or_printaddr(tcp, addr, &tio))
+ return;
+ if (abbrev(tcp)) {
+ tprints("{");
+ printxval(baud_options, tio.c_cflag & CBAUD, "B???");
+ tprintf(" %sopost %sisig %sicanon %secho ...}",
+ (tio.c_oflag & OPOST) ? "" : "-",
+ (tio.c_lflag & ISIG) ? "" : "-",
+ (tio.c_lflag & ICANON) ? "" : "-",
+ (tio.c_lflag & ECHO) ? "" : "-");
+ return;
+ }
+ tprintf("{c_iflags=%#lx, c_oflags=%#lx, ",
+ (long) tio.c_iflag, (long) tio.c_oflag);
+ tprintf("c_cflags=%#lx, c_lflags=%#lx, ",
+ (long) tio.c_cflag, (long) tio.c_lflag);
+ tprintf("c_line=%u, ", tio.c_line);
+#ifdef _VMIN
+ if (!(tio.c_lflag & ICANON))
+ tprintf("c_cc[_VMIN]=%d, c_cc[_VTIME]=%d, ",
+ tio.c_cc[_VMIN], tio.c_cc[_VTIME]);
+#else /* !_VMIN */
+ if (!(tio.c_lflag & ICANON))
+ tprintf("c_cc[VMIN]=%d, c_cc[VTIME]=%d, ",
+ tio.c_cc[VMIN], tio.c_cc[VTIME]);
+#endif /* !_VMIN */
+ tprints("c_cc=\"");
+ for (i = 0; i < NCC; i++)
+ tprintf("\\x%02x", tio.c_cc[i]);
+ tprints("\"}");
+}
+
+static void
+decode_winsize(struct tcb *const tcp, const kernel_ulong_t addr)
+{
+ struct winsize ws;
+
+ tprints(", ");
+ if (umove_or_printaddr(tcp, addr, &ws))
+ return;
+ tprintf("{ws_row=%d, ws_col=%d, ws_xpixel=%d, ws_ypixel=%d}",
+ ws.ws_row, ws.ws_col, ws.ws_xpixel, ws.ws_ypixel);
+}
+
+#ifdef TIOCGSIZE
+static void
+decode_ttysize(struct tcb *const tcp, const kernel_ulong_t addr)
+{
+ struct ttysize ts;
+
+ tprints(", ");
+ if (umove_or_printaddr(tcp, addr, &ts))
+ return;
+ tprintf("{ts_lines=%d, ts_cols=%d}",
+ ts.ts_lines, ts.ts_cols);
+}
+#endif
+
+static void
+decode_modem_flags(struct tcb *const tcp, const kernel_ulong_t addr)
+{
+ int i;
+
+ tprints(", ");
+ if (umove_or_printaddr(tcp, addr, &i))
+ return;
+ tprints("[");
+ printflags(modem_flags, i, "TIOCM_???");
+ tprints("]");
+}
+
+int
+term_ioctl(struct tcb *const tcp, const unsigned int code,
+ const kernel_ulong_t arg)
+{
+ switch (code) {
+ /* struct termios */
+ case TCGETS:
+#ifdef TCGETS2
+ case TCGETS2:
+#endif
+ case TIOCGLCKTRMIOS:
+ if (entering(tcp))
+ return 0;
+ ATTRIBUTE_FALLTHROUGH;
+ case TCSETS:
+#ifdef TCSETS2
+ case TCSETS2:
+#endif
+ case TCSETSW:
+#ifdef TCSETSW2
+ case TCSETSW2:
+#endif
+ case TCSETSF:
+#ifdef TCSETSF2
+ case TCSETSF2:
+#endif
+ case TIOCSLCKTRMIOS:
+ decode_termios(tcp, arg);
+ break;
+
+ /* struct termio */
+ case TCGETA:
+ if (entering(tcp))
+ return 0;
+ ATTRIBUTE_FALLTHROUGH;
+ case TCSETA:
+ case TCSETAW:
+ case TCSETAF:
+ decode_termio(tcp, arg);
+ break;
+
+ /* struct winsize */
+ case TIOCGWINSZ:
+ if (entering(tcp))
+ return 0;
+ ATTRIBUTE_FALLTHROUGH;
+ case TIOCSWINSZ:
+ decode_winsize(tcp, arg);
+ break;
+
+ /* struct ttysize */
+#ifdef TIOCGSIZE
+ case TIOCGSIZE:
+ if (entering(tcp))
+ return 0;
+ ATTRIBUTE_FALLTHROUGH;
+ case TIOCSSIZE:
+ decode_ttysize(tcp, arg);
+ break;
+#endif
+
+ /* ioctls with a direct decodable arg */
+ case TCXONC:
+ tprints(", ");
+ printxval64(tcxonc_options, arg, "TC???");
+ break;
+ case TCFLSH:
+ tprints(", ");
+ printxval64(tcflsh_options, arg, "TC???");
+ break;
+ case TCSBRK:
+ case TCSBRKP:
+ case TIOCSCTTY:
+ tprintf(", %d", (int) arg);
+ break;
+
+ /* ioctls with an indirect parameter displayed as modem flags */
+ case TIOCMGET:
+ if (entering(tcp))
+ return 0;
+ ATTRIBUTE_FALLTHROUGH;
+ case TIOCMBIS:
+ case TIOCMBIC:
+ case TIOCMSET:
+ decode_modem_flags(tcp, arg);
+ break;
+
+ /* ioctls with an indirect parameter displayed in decimal */
+ case TIOCGPGRP:
+ case TIOCGSID:
+ case TIOCGETD:
+ case TIOCGSOFTCAR:
+ case TIOCGPTN:
+ case FIONREAD:
+ case TIOCOUTQ:
+#ifdef TIOCGEXCL
+ case TIOCGEXCL:
+#endif
+#ifdef TIOCGDEV
+ case TIOCGDEV:
+#endif
+ if (entering(tcp))
+ return 0;
+ ATTRIBUTE_FALLTHROUGH;
+ case TIOCSPGRP:
+ case TIOCSETD:
+ case FIONBIO:
+ case FIOASYNC:
+ case TIOCPKT:
+ case TIOCSSOFTCAR:
+ case TIOCSPTLCK:
+ tprints(", ");
+ printnum_int(tcp, arg, "%d");
+ break;
+
+ /* ioctls with an indirect parameter displayed as a char */
+ case TIOCSTI:
+ tprints(", ");
+ printstrn(tcp, arg, 1);
+ break;
+
+ /* ioctls with no parameters */
+
+ case TIOCSBRK:
+ case TIOCCBRK:
+ case TIOCCONS:
+ case TIOCNOTTY:
+ case TIOCEXCL:
+ case TIOCNXCL:
+ case FIOCLEX:
+ case FIONCLEX:
+#ifdef TIOCVHANGUP
+ case TIOCVHANGUP:
+#endif
+#ifdef TIOCSSERIAL
+ case TIOCSSERIAL:
+#endif
+ break;
+
+ /* ioctls which are unknown */
+
+ default:
+ return RVAL_DECODED;
+ }
+
+ return RVAL_IOCTL_DECODED;
+}
diff --git a/src/time.c b/src/time.c
new file mode 100644
index 000000000..b8b13177a
--- /dev/null
+++ b/src/time.c
@@ -0,0 +1,480 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1996-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include <fcntl.h>
+#include <signal.h>
+#include <sys/timex.h>
+
+#if HAVE_ARCH_TIME32_SYSCALLS || HAVE_ARCH_OLD_TIME64_SYSCALLS
+static void
+print_timezone(struct tcb *const tcp, const kernel_ulong_t addr)
+{
+ struct timezone tz;
+
+ if (umove_or_printaddr(tcp, addr, &tz))
+ return;
+
+ tprint_struct_begin();
+ PRINT_FIELD_D(tz, tz_minuteswest);
+ tprint_struct_next();
+ PRINT_FIELD_D(tz, tz_dsttime);
+ tprint_struct_end();
+}
+
+SYS_FUNC(gettimeofday)
+{
+ if (exiting(tcp)) {
+ print_timeval(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ print_timezone(tcp, tcp->u_arg[1]);
+ }
+ return 0;
+}
+
+SYS_FUNC(settimeofday)
+{
+ print_timeval(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ print_timezone(tcp, tcp->u_arg[1]);
+
+ return RVAL_DECODED;
+}
+#endif
+
+#ifdef ALPHA
+SYS_FUNC(osf_gettimeofday)
+{
+ if (exiting(tcp)) {
+ print_timeval32(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ print_timezone(tcp, tcp->u_arg[1]);
+ }
+ return 0;
+}
+#endif
+
+#ifdef ALPHA
+SYS_FUNC(osf_settimeofday)
+{
+ print_timeval32(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ print_timezone(tcp, tcp->u_arg[1]);
+
+ return RVAL_DECODED;
+}
+#endif
+
+#if HAVE_ARCH_TIME32_SYSCALLS || HAVE_ARCH_OLD_TIME64_SYSCALLS
+static int
+do_nanosleep(struct tcb *const tcp, const print_obj_by_addr_fn print_ts)
+{
+ if (entering(tcp)) {
+ print_ts(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ } else {
+
+ /*
+ * Second (returned) timespec is only significant if syscall
+ * was interrupted. On success and in case of other errors we
+ * print only its address, since kernel doesn't modify it,
+ * and printing the value may show uninitialized data.
+ */
+ if (is_erestart(tcp)) {
+ temporarily_clear_syserror(tcp);
+ print_ts(tcp, tcp->u_arg[1]);
+ restore_cleared_syserror(tcp);
+ } else {
+ printaddr(tcp->u_arg[1]);
+ }
+ }
+ return 0;
+}
+#endif /* HAVE_ARCH_TIME32_SYSCALLS || HAVE_ARCH_OLD_TIME64_SYSCALLS */
+
+#if HAVE_ARCH_TIME32_SYSCALLS
+SYS_FUNC(nanosleep_time32)
+{
+ return do_nanosleep(tcp, print_timespec32);
+}
+#endif
+
+#if HAVE_ARCH_OLD_TIME64_SYSCALLS
+SYS_FUNC(nanosleep_time64)
+{
+ return do_nanosleep(tcp, print_timespec64);
+}
+#endif
+
+#include "xlat/itimer_which.h"
+
+SYS_FUNC(getitimer)
+{
+ if (entering(tcp)) {
+ printxval(itimer_which, tcp->u_arg[0], "ITIMER_???");
+ tprints(", ");
+ } else {
+ print_itimerval(tcp, tcp->u_arg[1]);
+ }
+ return 0;
+}
+
+#ifdef ALPHA
+SYS_FUNC(osf_getitimer)
+{
+ if (entering(tcp)) {
+ printxval(itimer_which, tcp->u_arg[0], "ITIMER_???");
+ tprints(", ");
+ } else {
+ print_itimerval32(tcp, tcp->u_arg[1]);
+ }
+ return 0;
+}
+#endif
+
+SYS_FUNC(setitimer)
+{
+ if (entering(tcp)) {
+ printxval(itimer_which, tcp->u_arg[0], "ITIMER_???");
+ tprints(", ");
+ print_itimerval(tcp, tcp->u_arg[1]);
+ tprints(", ");
+ } else {
+ print_itimerval(tcp, tcp->u_arg[2]);
+ }
+ return 0;
+}
+
+#ifdef ALPHA
+SYS_FUNC(osf_setitimer)
+{
+ if (entering(tcp)) {
+ printxval(itimer_which, tcp->u_arg[0], "ITIMER_???");
+ tprints(", ");
+ print_itimerval32(tcp, tcp->u_arg[1]);
+ tprints(", ");
+ } else {
+ print_itimerval32(tcp, tcp->u_arg[2]);
+ }
+ return 0;
+}
+#endif
+
+#include "xlat/adjtimex_state.h"
+
+static int
+do_adjtimex(struct tcb *const tcp, const print_obj_by_addr_fn print_tx,
+ const kernel_ulong_t addr)
+{
+ if (print_tx(tcp, addr))
+ return 0;
+ tcp->auxstr = xlookup(adjtimex_state, (kernel_ulong_t) tcp->u_rval);
+ return RVAL_STR;
+}
+
+#if HAVE_ARCH_TIME32_SYSCALLS
+SYS_FUNC(adjtimex32)
+{
+ if (exiting(tcp))
+ return do_adjtimex(tcp, print_timex32, tcp->u_arg[0]);
+ return 0;
+}
+#endif
+
+#if HAVE_ARCH_OLD_TIME64_SYSCALLS
+SYS_FUNC(adjtimex64)
+{
+ if (exiting(tcp))
+# ifndef SPARC64
+ return do_adjtimex(tcp, print_timex64, tcp->u_arg[0]);
+# else
+ return do_adjtimex(tcp, print_sparc64_timex, tcp->u_arg[0]);
+# endif
+ return 0;
+}
+#endif
+
+#include "xlat/clockflags.h"
+#include "xlat/clocknames.h"
+
+static void
+printclockname(int clockid)
+{
+#ifdef CLOCKID_TO_FD
+# include "xlat/cpuclocknames.h"
+
+ if (clockid < 0) {
+ if (xlat_verbose(xlat_verbosity) != XLAT_STYLE_ABBREV)
+ tprintf("%d", clockid);
+
+ if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_RAW)
+ return;
+
+ if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE)
+ tprints(" /* ");
+
+ if ((clockid & CLOCKFD_MASK) == CLOCKFD)
+ tprintf("FD_TO_CLOCKID(%d)", CLOCKID_TO_FD(clockid));
+ else {
+ tprintf("%s(%d,",
+ CPUCLOCK_PERTHREAD(clockid) ?
+ "MAKE_THREAD_CPUCLOCK" :
+ "MAKE_PROCESS_CPUCLOCK",
+ CPUCLOCK_PID(clockid));
+ printxval(cpuclocknames, clockid & CLOCKFD_MASK,
+ "CPUCLOCK_???");
+ tprints(")");
+ }
+
+ if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE)
+ tprints(" */");
+ } else
+#endif
+ printxval(clocknames, clockid, "CLOCK_???");
+}
+
+static int
+do_clock_settime(struct tcb *const tcp, const print_obj_by_addr_fn print_ts)
+{
+ printclockname(tcp->u_arg[0]);
+ tprints(", ");
+ print_ts(tcp, tcp->u_arg[1]);
+
+ return RVAL_DECODED;
+}
+
+#if HAVE_ARCH_TIME32_SYSCALLS
+SYS_FUNC(clock_settime32)
+{
+ return do_clock_settime(tcp, print_timespec32);
+}
+#endif
+
+SYS_FUNC(clock_settime64)
+{
+ return do_clock_settime(tcp, print_timespec64);
+}
+
+static int
+do_clock_gettime(struct tcb *const tcp, const print_obj_by_addr_fn print_ts)
+{
+ if (entering(tcp)) {
+ printclockname(tcp->u_arg[0]);
+ tprints(", ");
+ } else {
+ print_ts(tcp, tcp->u_arg[1]);
+ }
+ return 0;
+}
+
+#if HAVE_ARCH_TIME32_SYSCALLS
+SYS_FUNC(clock_gettime32)
+{
+ return do_clock_gettime(tcp, print_timespec32);
+}
+#endif
+
+SYS_FUNC(clock_gettime64)
+{
+ return do_clock_gettime(tcp, print_timespec64);
+}
+
+static int
+do_clock_nanosleep(struct tcb *const tcp, const print_obj_by_addr_fn print_ts)
+{
+ if (entering(tcp)) {
+ printclockname(tcp->u_arg[0]);
+ tprints(", ");
+ printflags(clockflags, tcp->u_arg[1], "TIMER_???");
+ tprints(", ");
+ print_ts(tcp, tcp->u_arg[2]);
+ tprints(", ");
+ } else {
+ /*
+ * Second (returned) timespec is only significant
+ * if syscall was interrupted and flags is not TIMER_ABSTIME.
+ */
+ if (!tcp->u_arg[1] && is_erestart(tcp)) {
+ temporarily_clear_syserror(tcp);
+ print_ts(tcp, tcp->u_arg[3]);
+ restore_cleared_syserror(tcp);
+ } else {
+ printaddr(tcp->u_arg[3]);
+ }
+ }
+ return 0;
+}
+
+#if HAVE_ARCH_TIME32_SYSCALLS
+SYS_FUNC(clock_nanosleep_time32)
+{
+ return do_clock_nanosleep(tcp, print_timespec32);
+}
+#endif
+
+SYS_FUNC(clock_nanosleep_time64)
+{
+ return do_clock_nanosleep(tcp, print_timespec64);
+}
+
+static int
+do_clock_adjtime(struct tcb *const tcp, const print_obj_by_addr_fn print_tx)
+{
+ if (exiting(tcp))
+ return do_adjtimex(tcp, print_tx, tcp->u_arg[1]);
+ printclockname(tcp->u_arg[0]);
+ tprints(", ");
+ return 0;
+}
+
+#if HAVE_ARCH_TIME32_SYSCALLS
+SYS_FUNC(clock_adjtime32)
+{
+ return do_clock_adjtime(tcp, print_timex32);
+}
+#endif
+
+SYS_FUNC(clock_adjtime64)
+{
+ return do_clock_adjtime(tcp, print_timex64);
+}
+
+#ifdef SPARC64
+SYS_FUNC(clock_sparc64_adjtime)
+{
+ return do_clock_adjtime(tcp, print_sparc64_timex);
+}
+#endif
+
+SYS_FUNC(timer_create)
+{
+ if (entering(tcp)) {
+ printclockname(tcp->u_arg[0]);
+ tprints(", ");
+ print_sigevent(tcp, tcp->u_arg[1]);
+ tprints(", ");
+ } else {
+ printnum_int(tcp, tcp->u_arg[2], "%d");
+ }
+ return 0;
+}
+
+static int
+do_timer_settime(struct tcb *const tcp, const print_obj_by_addr_fn print_its)
+{
+ if (entering(tcp)) {
+ tprintf("%d, ", (int) tcp->u_arg[0]);
+ printflags(clockflags, tcp->u_arg[1], "TIMER_???");
+ tprints(", ");
+ print_its(tcp, tcp->u_arg[2]);
+ tprints(", ");
+ } else {
+ print_its(tcp, tcp->u_arg[3]);
+ }
+ return 0;
+}
+
+#if HAVE_ARCH_TIME32_SYSCALLS
+SYS_FUNC(timer_settime32)
+{
+ return do_timer_settime(tcp, print_itimerspec32);
+}
+#endif
+
+SYS_FUNC(timer_settime64)
+{
+ return do_timer_settime(tcp, print_itimerspec64);
+}
+
+static int
+do_timer_gettime(struct tcb *const tcp, const print_obj_by_addr_fn print_its)
+{
+ if (entering(tcp)) {
+ tprintf("%d, ", (int) tcp->u_arg[0]);
+ } else {
+ print_its(tcp, tcp->u_arg[1]);
+ }
+ return 0;
+}
+
+#if HAVE_ARCH_TIME32_SYSCALLS
+SYS_FUNC(timer_gettime32)
+{
+ return do_timer_gettime(tcp, print_itimerspec32);
+}
+#endif
+
+SYS_FUNC(timer_gettime64)
+{
+ return do_timer_gettime(tcp, print_itimerspec64);
+}
+
+#include "xlat/timerfdflags.h"
+
+SYS_FUNC(timerfd_create)
+{
+ printclockname(tcp->u_arg[0]);
+ tprints(", ");
+ printflags(timerfdflags, tcp->u_arg[1], "TFD_???");
+
+ return RVAL_DECODED | RVAL_FD;
+}
+
+static int
+do_timerfd_settime(struct tcb *const tcp, const print_obj_by_addr_fn print_its)
+{
+ if (entering(tcp)) {
+ printfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ printflags(timerfdflags, tcp->u_arg[1], "TFD_???");
+ tprints(", ");
+ print_its(tcp, tcp->u_arg[2]);
+ tprints(", ");
+ } else {
+ print_its(tcp, tcp->u_arg[3]);
+ }
+ return 0;
+}
+
+#if HAVE_ARCH_TIME32_SYSCALLS
+SYS_FUNC(timerfd_settime32)
+{
+ return do_timerfd_settime(tcp, print_itimerspec32);
+}
+#endif
+
+SYS_FUNC(timerfd_settime64)
+{
+ return do_timerfd_settime(tcp, print_itimerspec64);
+}
+
+static int
+do_timerfd_gettime(struct tcb *const tcp, const print_obj_by_addr_fn print_its)
+{
+ if (entering(tcp)) {
+ printfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ } else {
+ print_its(tcp, tcp->u_arg[1]);
+ }
+ return 0;
+}
+
+#if HAVE_ARCH_TIME32_SYSCALLS
+SYS_FUNC(timerfd_gettime32)
+{
+ return do_timerfd_gettime(tcp, print_itimerspec32);
+}
+#endif
+
+SYS_FUNC(timerfd_gettime64)
+{
+ return do_timerfd_gettime(tcp, print_itimerspec64);
+}
diff --git a/src/times.c b/src/times.c
new file mode 100644
index 000000000..4729ea72e
--- /dev/null
+++ b/src/times.c
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993-1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
+ * Copyright (c) 2012 H.J. Lu <hongjiu.lu@intel.com>
+ * Copyright (c) 2015 Elvira Khabirova <lineprinter0@gmail.com>
+ * Copyright (c) 2015 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include DEF_MPERS_TYPE(tms_t)
+#include <sys/times.h>
+typedef struct tms tms_t;
+#include MPERS_DEFS
+
+SYS_FUNC(times)
+{
+ tms_t tbuf;
+
+ if (exiting(tcp) && !umove_or_printaddr(tcp, tcp->u_arg[0], &tbuf)) {
+ tprint_struct_begin();
+ PRINT_FIELD_U(tbuf, tms_utime);
+ tprint_struct_next();
+ PRINT_FIELD_U(tbuf, tms_stime);
+ tprint_struct_next();
+ PRINT_FIELD_U(tbuf, tms_cutime);
+ tprint_struct_next();
+ PRINT_FIELD_U(tbuf, tms_cstime);
+ tprint_struct_end();
+ }
+
+ return 0;
+}
diff --git a/src/trace_event.h b/src/trace_event.h
new file mode 100644
index 000000000..9021fc550
--- /dev/null
+++ b/src/trace_event.h
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2017-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_TRACE_EVENT_H
+# define STRACE_TRACE_EVENT_H
+
+/* Possible trace event loop states. Returned by next_event() and dispatched by
+ * dispatch_event(). */
+enum trace_event {
+ /* Break the main loop. */
+ TE_BREAK,
+
+ /* Call next_event() again. */
+ TE_NEXT,
+
+ /* Restart the tracee with signal 0 and call next_event() again. */
+ TE_RESTART,
+
+ /*
+ * For all the events below, current_tcp is set to current tracee's
+ * tcb. All the suggested actions imply that you want to continue
+ * tracing of the current tracee; alternatively, you can detach it.
+ */
+
+ /*
+ * Syscall entry or exit.
+ * Restart the tracee with signal 0, or with an injected signal number.
+ */
+ TE_SYSCALL_STOP,
+
+ /*
+ * Tracee received signal with number WSTOPSIG(*pstatus); signal info
+ * is written to *si. Restart the tracee (with that signal number
+ * if you want to deliver it).
+ */
+ TE_SIGNAL_DELIVERY_STOP,
+
+ /*
+ * Tracee was killed by a signal with number WTERMSIG(*pstatus).
+ */
+ TE_SIGNALLED,
+
+ /*
+ * Tracee was stopped by a signal with number WSTOPSIG(*pstatus).
+ * Restart the tracee with that signal number.
+ */
+ TE_GROUP_STOP,
+
+ /*
+ * Tracee exited with status WEXITSTATUS(*pstatus).
+ */
+ TE_EXITED,
+
+ /*
+ * Tracee is going to perform execve().
+ * Restart the tracee with signal 0.
+ */
+ TE_STOP_BEFORE_EXECVE,
+
+ /*
+ * Tracee is going to terminate.
+ * Restart the tracee with signal 0.
+ */
+ TE_STOP_BEFORE_EXIT,
+
+ /*
+ * SECCOMP_RET_TRACE rule is triggered.
+ */
+ TE_SECCOMP,
+};
+
+#endif /* !STRACE_TRACE_EVENT_H */
diff --git a/src/trie.c b/src/trie.c
new file mode 100644
index 000000000..c26368edc
--- /dev/null
+++ b/src/trie.c
@@ -0,0 +1,290 @@
+/*
+ * Simple trie implementation for key-value mapping storage
+ *
+ * Copyright (c) 2020 Ákos Uzonyi <uzonyi.akos@gmail.com>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <stdlib.h>
+#include <stdio.h>
+
+#include "trie.h"
+#include "xmalloc.h"
+
+static const uint8_t ptr_sz_lg = (sizeof(void *) == 8 ? 6 : 5);
+
+/**
+ * Returns lg2 of node size in bits for the specific level of the trie.
+ */
+static uint8_t
+trie_get_node_size(struct trie *t, uint8_t depth)
+{
+ /* Last level contains data and we allow it having a different size */
+ if (depth == t->max_depth)
+ return t->data_block_key_bits + t->item_size_lg;
+ /* Last level of the tree can be smaller */
+ if (depth == t->max_depth - 1)
+ return (t->key_size - t->data_block_key_bits - 1) %
+ t->node_key_bits + 1 + ptr_sz_lg;
+
+ return t->node_key_bits + ptr_sz_lg;
+}
+
+/**
+ * Provides starting offset of bits in key corresponding to the node index
+ * at the specific level.
+ */
+static uint8_t
+trie_get_node_bit_offs(struct trie *t, uint8_t depth)
+{
+ uint8_t offs;
+
+ if (depth == t->max_depth)
+ return 0;
+
+ offs = t->data_block_key_bits;
+
+ if (depth == t->max_depth - 1)
+ return offs;
+
+ /* data_block_size + remainder */
+ offs += trie_get_node_size(t, t->max_depth - 1) - ptr_sz_lg;
+ offs += (t->max_depth - depth - 2) * t->node_key_bits;
+
+ return offs;
+}
+
+struct trie *
+trie_create(uint8_t key_size, uint8_t item_size_lg, uint8_t node_key_bits,
+ uint8_t data_block_key_bits, uint64_t empty_value)
+{
+ if (item_size_lg > 6)
+ return NULL;
+ if (key_size > 64)
+ return NULL;
+ if (node_key_bits < 1)
+ return NULL;
+ if (data_block_key_bits < 1 || data_block_key_bits > key_size)
+ return NULL;
+
+ struct trie *t = malloc(sizeof(*t));
+ if (!t)
+ return NULL;
+
+ t->empty_value = empty_value;
+ t->data = NULL;
+ t->item_size_lg = item_size_lg;
+ t->node_key_bits = node_key_bits;
+ t->data_block_key_bits = data_block_key_bits;
+ t->key_size = key_size;
+ t->max_depth = (key_size - data_block_key_bits + node_key_bits - 1)
+ / t->node_key_bits;
+
+ if (item_size_lg != 6)
+ t->empty_value &= (((uint64_t) 1 << (1 << t->item_size_lg)) - 1);
+
+ return t;
+}
+
+static void *
+trie_create_data_block(struct trie *t)
+{
+ uint64_t fill_value = t->empty_value;
+ for (int i = 1; i < 1 << (6 - t->item_size_lg); i++) {
+ fill_value <<= (1 << t->item_size_lg);
+ fill_value |= t->empty_value;
+ }
+
+ uint8_t sz = t->data_block_key_bits + t->item_size_lg;
+ if (sz < 6)
+ sz = 6;
+
+ size_t count = 1 << (sz - 6);
+ uint64_t *data_block = xcalloc(count, 8);
+
+ for (size_t i = 0; i < count; i++)
+ data_block[i] = fill_value;
+
+ return data_block;
+}
+
+static uint64_t *
+trie_get_node(struct trie *t, uint64_t key, bool auto_create)
+{
+ void **cur_node = &(t->data);
+
+ if (t->key_size < 64 && key > (uint64_t) 1 << t->key_size)
+ return NULL;
+
+ for (uint8_t cur_depth = 0; cur_depth <= t->max_depth; cur_depth++) {
+ uint8_t offs = trie_get_node_bit_offs(t, cur_depth);
+ uint8_t sz = trie_get_node_size(t, cur_depth);
+
+ if (!*cur_node) {
+ if (!auto_create)
+ return NULL;
+
+ if (cur_depth == t->max_depth)
+ *cur_node = trie_create_data_block(t);
+ else
+ *cur_node = xcalloc(1 << sz, 1);
+ }
+
+ if (cur_depth == t->max_depth)
+ break;
+
+ size_t pos = (key >> offs) & ((1 << (sz - ptr_sz_lg)) - 1);
+ cur_node = (((void **) (*cur_node)) + pos);
+ }
+
+ return (uint64_t *) (*cur_node);
+}
+
+static void
+trie_data_block_calc_pos(struct trie *t, uint64_t key,
+ uint64_t *pos, uint64_t *mask, uint64_t *offs)
+{
+ uint64_t key_mask;
+
+ key_mask = (1 << t->data_block_key_bits) - 1;
+ *pos = (key & key_mask) >> (6 - t->item_size_lg);
+
+ if (t->item_size_lg == 6) {
+ *offs = 0;
+ *mask = -1;
+ return;
+ }
+
+ key_mask = (1 << (6 - t->item_size_lg)) - 1;
+ *offs = (key & key_mask) * (1 << t->item_size_lg);
+
+ *mask = (((uint64_t) 1 << (1 << t->item_size_lg)) - 1) << *offs;
+}
+
+bool
+trie_set(struct trie *t, uint64_t key, uint64_t val)
+{
+ uint64_t *data = trie_get_node(t, key, true);
+ if (!data)
+ return false;
+
+ uint64_t pos, mask, offs;
+ trie_data_block_calc_pos(t, key, &pos, &mask, &offs);
+
+ data[pos] &= ~mask;
+ data[pos] |= (val << offs) & mask;
+
+ return true;
+}
+
+static uint64_t
+trie_data_block_get(struct trie *t, uint64_t *data, uint64_t key)
+{
+ if (!data)
+ return t->empty_value;
+
+ uint64_t pos, mask, offs;
+ trie_data_block_calc_pos(t, key, &pos, &mask, &offs);
+
+ return (data[pos] & mask) >> offs;
+}
+
+uint64_t
+trie_get(struct trie *b, uint64_t key)
+{
+ return trie_data_block_get(b, trie_get_node(b, key, false), key);
+}
+
+static uint64_t
+trie_iterate_keys_node(struct trie *t,
+ trie_iterate_fn fn, void *fn_data,
+ void *node, uint64_t start, uint64_t end,
+ uint8_t depth)
+{
+ if (start > end || !node)
+ return 0;
+
+ if (t->key_size < 64) {
+ uint64_t key_max = ((uint64_t) 1 << t->key_size) - 1;
+ if (end > key_max)
+ end = key_max;
+ }
+
+ if (depth == t->max_depth) {
+ for (uint64_t i = start; i <= end; i++)
+ fn(fn_data, i, trie_data_block_get(t,
+ (uint64_t *) node, i));
+
+ return end - start + 1;
+ }
+
+ uint8_t parent_node_bit_off = depth == 0 ?
+ t->key_size :
+ trie_get_node_bit_offs(t, depth - 1);
+
+ uint64_t first_key_in_node = start &
+ (uint64_t) -1 << parent_node_bit_off;
+
+ uint8_t node_bit_off = trie_get_node_bit_offs(t, depth);
+ uint8_t node_key_bits = parent_node_bit_off - node_bit_off;
+ uint64_t mask = ((uint64_t) 1 << (node_key_bits)) - 1;
+ uint64_t start_index = (start >> node_bit_off) & mask;
+ uint64_t end_index = (end >> node_bit_off) & mask;
+ uint64_t child_key_count = (uint64_t) 1 << node_bit_off;
+
+ uint64_t count = 0;
+
+ for (uint64_t i = start_index; i <= end_index; i++) {
+ uint64_t child_start = first_key_in_node + i * child_key_count;
+ uint64_t child_end = first_key_in_node +
+ (i + 1) * child_key_count - 1;
+
+ if (child_start < start)
+ child_start = start;
+ if (child_end > end)
+ child_end = end;
+
+ count += trie_iterate_keys_node(t, fn, fn_data,
+ ((void **) node)[i], child_start, child_end,
+ depth + 1);
+ }
+
+ return count;
+}
+
+uint64_t trie_iterate_keys(struct trie *t, uint64_t start, uint64_t end,
+ trie_iterate_fn fn, void *fn_data)
+{
+ return trie_iterate_keys_node(t, fn, fn_data, t->data,
+ start, end, 0);
+}
+
+static void
+trie_free_node(struct trie *t, void *node, uint8_t depth)
+{
+ if (!node)
+ return;
+
+ if (depth >= t->max_depth)
+ goto free_node;
+
+ size_t sz = 1 << (trie_get_node_size(t, depth) - ptr_sz_lg);
+ for (size_t i = 0; i < sz; i++)
+ trie_free_node(t, ((void **) node)[i], depth + 1);
+
+free_node:
+ free(node);
+}
+
+void
+trie_free(struct trie *t)
+{
+ trie_free_node(t, t->data, 0);
+ free(t);
+}
diff --git a/src/trie.h b/src/trie.h
new file mode 100644
index 000000000..da8f45e77
--- /dev/null
+++ b/src/trie.h
@@ -0,0 +1,92 @@
+/*
+ * Simple trie interface
+ *
+ * Copyright (c) 2020 Ákos Uzonyi <uzonyi.akos@gmail.com>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_TRIE_H
+# define STRACE_TRIE_H
+
+# include <stdbool.h>
+# include <stdint.h>
+
+/**
+ * Trie control structure.
+ * Trie implemented here has the following properties:
+ * * It allows storing values of the same size, the size can vary from 1 bit to
+ * 64 bit values (only power of 2 sizes are allowed).
+ * * The key can be up to 64 bits in size.
+ * * It has separate configuration for node size and data block size.
+ *
+ * How bits of key are used for different node levels:
+ *
+ * highest bits lowest bits
+ * | node_key_bits | node_key_bits | ... | <remainder> | data_block_key_bits |
+ * \_________________________________________________________________________/
+ * key_size
+ *
+ * So, the remainder is used on the lowest non-data node level.
+ *
+ * As of now, it doesn't implement any mechanisms for resizing/changing key
+ * size. De-fragmentation is also unsupported currently.
+ */
+struct trie {
+ /** Return value of trie_get if key is not found */
+ uint64_t empty_value;
+
+ /** Pointer to root node */
+ void *data;
+
+ /** Key size in bits (0..64). */
+ uint8_t key_size;
+
+ /**
+ * Size of the stored values in log2 bits (0..6).
+ * (6: 64 bit values, 5: 32 bit values, ...)
+ */
+ uint8_t item_size_lg;
+
+ /**
+ * Number of bits in the key that make a symbol for a node.
+ * (equals to log2 of the child count of the node)
+ */
+ uint8_t node_key_bits;
+
+ /**
+ * Number of bits in the key that make a symbol for the data block (leaf).
+ * (equals to log2 of the value count stored in a data block)
+ */
+ uint8_t data_block_key_bits;
+
+ /** The depth of the data block. Calculated from the values above */
+ uint8_t max_depth;
+};
+
+struct trie* trie_create(uint8_t key_size, uint8_t item_size_lg,
+ uint8_t node_key_bits, uint8_t data_block_key_bits,
+ uint64_t empty_value);
+
+bool trie_set(struct trie *t, uint64_t key, uint64_t val);
+uint64_t trie_get(struct trie *t, uint64_t key);
+
+typedef void (*trie_iterate_fn)(void *data, uint64_t key, uint64_t val);
+
+/**
+ * Calls trie_iterate_fn for each key-value pair where
+ * key is inside the [start, end] interval (inclusive).
+ *
+ * @param t The trie.
+ * @param start The start of the key interval (inclusive).
+ * @param end The end of the key interval (inclusive).
+ * @param fn The function to be called.
+ * @param fn_data The value to be passed to fn.
+ */
+uint64_t trie_iterate_keys(struct trie *t, uint64_t start, uint64_t end,
+ trie_iterate_fn fn, void *fn_data);
+
+void trie_free(struct trie *t);
+
+#endif /* !STRACE_TRIE_H */
diff --git a/src/truncate.c b/src/truncate.c
new file mode 100644
index 000000000..12918dd99
--- /dev/null
+++ b/src/truncate.c
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2014-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+SYS_FUNC(truncate)
+{
+ printpath(tcp, tcp->u_arg[0]);
+ tprintf(", %" PRI_klu, tcp->u_arg[1]);
+
+ return RVAL_DECODED;
+}
+
+SYS_FUNC(truncate64)
+{
+ printpath(tcp, tcp->u_arg[0]);
+ printllval(tcp, ", %llu", 1);
+
+ return RVAL_DECODED;
+}
+
+SYS_FUNC(ftruncate)
+{
+ printfd(tcp, tcp->u_arg[0]);
+ tprintf(", %" PRI_klu, tcp->u_arg[1]);
+
+ return RVAL_DECODED;
+}
+
+SYS_FUNC(ftruncate64)
+{
+ printfd(tcp, tcp->u_arg[0]);
+ printllval(tcp, ", %llu", 1);
+
+ return RVAL_DECODED;
+}
diff --git a/src/types/btrfs.h b/src/types/btrfs.h
new file mode 100644
index 000000000..41d4c3ff2
--- /dev/null
+++ b/src/types/btrfs.h
@@ -0,0 +1,25 @@
+/*
+ * Copyright (c) 2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_TYPES_BTRFS_H
+# define STRACE_TYPES_BTRFS_H
+
+# ifdef HAVE_LINUX_BTRFS_H
+# include <stdio.h>
+# include <stdint.h>
+# include <linux/btrfs.h>
+# endif
+
+typedef struct {
+ uint64_t logical;
+ uint64_t size;
+ uint64_t reserved[3];
+ uint64_t flags;
+ uint64_t inodes;
+} struct_btrfs_ioctl_logical_ino_args;
+
+#endif /* STRACE_TYPES_BTRFS_H */
diff --git a/src/types/cryptouser.h b/src/types/cryptouser.h
new file mode 100644
index 000000000..31aea9ca0
--- /dev/null
+++ b/src/types/cryptouser.h
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2019-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_TYPES_CRYPTOUSER_H
+# define STRACE_TYPES_CRYPTOUSER_H
+
+# ifdef HAVE_LINUX_CRYPTOUSER_H
+# include <linux/cryptouser.h>
+# endif
+
+# ifndef CRYPTO_MAX_NAME
+# define CRYPTO_MAX_NAME 64
+# endif
+
+typedef struct {
+ char cru_name[CRYPTO_MAX_NAME];
+ char cru_driver_name[CRYPTO_MAX_NAME];
+ char cru_module_name[CRYPTO_MAX_NAME];
+ uint32_t cru_type;
+ uint32_t cru_mask;
+ int32_t cru_refcnt;
+ uint32_t cru_flags;
+} struct_crypto_user_alg;
+
+typedef struct {
+ char type[CRYPTO_MAX_NAME];
+ uint32_t blocksize;
+ uint32_t digestsize;
+} struct_crypto_report_hash;
+
+typedef struct {
+ char type[CRYPTO_MAX_NAME];
+ uint32_t blocksize;
+ uint32_t min_keysize;
+ uint32_t max_keysize;
+} struct_crypto_report_cipher;
+
+typedef struct {
+ char type[CRYPTO_MAX_NAME];
+ char geniv[CRYPTO_MAX_NAME];
+ uint32_t blocksize;
+ uint32_t min_keysize;
+ uint32_t max_keysize;
+ uint32_t ivsize;
+} struct_crypto_report_blkcipher;
+
+typedef struct {
+ char type[CRYPTO_MAX_NAME];
+ char geniv[CRYPTO_MAX_NAME];
+ uint32_t blocksize;
+ uint32_t maxauthsize;
+ uint32_t ivsize;
+} struct_crypto_report_aead;
+
+typedef struct {
+ char type[CRYPTO_MAX_NAME];
+ uint32_t seedsize;
+} struct_crypto_report_rng;
+
+#endif /* !STRACE_TYPES_CRYPTOUSER_H */
diff --git a/src/types/evdev.h b/src/types/evdev.h
new file mode 100644
index 000000000..06e8183ec
--- /dev/null
+++ b/src/types/evdev.h
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2019-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_TYPES_EVDEV_H
+# define STRACE_TYPES_EVDEV_H
+
+# ifdef HAVE_LINUX_INPUT_H
+# include <linux/input.h>
+# endif
+
+typedef struct {
+ int32_t value;
+ int32_t minimum;
+ int32_t maximum;
+ int32_t fuzz;
+ int32_t flat;
+ int32_t resolution; /**< Added by Linux commit v2.6.31-rc1~100^2~1 */
+} struct_input_absinfo;
+
+/** Added by Linux commit v2.6.37-rc1~5^2~3^2~47 */
+typedef struct {
+ uint8_t flags;
+ uint8_t len;
+ uint16_t index;
+ uint32_t keycode;
+ uint8_t scancode[32];
+} struct_input_keymap_entry;
+
+/** Added by Linux commit v4.4-rc1~11^2~3^2~2 */
+typedef struct {
+ uint32_t type;
+ uint32_t codes_size;
+ uint64_t codes_ptr;
+} struct_input_mask;
+
+#endif /* !STRACE_TYPES_EVDEV_H */
diff --git a/src/types/fib_rules.h b/src/types/fib_rules.h
new file mode 100644
index 000000000..e8b9f1422
--- /dev/null
+++ b/src/types/fib_rules.h
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2021 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_TYPES_FIB_RULES_H
+# define STRACE_TYPES_FIB_RULES_H
+
+#ifdef HAVE_LINUX_FIB_RULES_H
+# include <linux/fib_rules.h>
+#endif
+
+typedef struct {
+ uint8_t family;
+ uint8_t dst_len;
+ uint8_t src_len;
+ uint8_t tos;
+ uint8_t table;
+ uint8_t res1;
+ uint8_t res2;
+ uint8_t action;
+ uint32_t flags;
+} struct_fib_rule_hdr;
+
+typedef struct {
+ uint32_t start;
+ uint32_t end;
+} struct_fib_rule_uid_range;
+
+typedef struct {
+ uint16_t start;
+ uint16_t end;
+} struct_fib_rule_port_range;
+
+#endif /* STRACE_TYPES_FIB_RULES_H */
diff --git a/src/types/fiemap.h b/src/types/fiemap.h
new file mode 100644
index 000000000..10f32e27b
--- /dev/null
+++ b/src/types/fiemap.h
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2021 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_TYPES_FIEMAP_H
+# define STRACE_TYPES_FIEMAP_H
+
+# ifdef HAVE_LINUX_FIEMAP_H
+# include <linux/types.h>
+# include <linux/fiemap.h>
+# endif
+
+typedef struct {
+ uint64_t fe_logical;
+ uint64_t fe_physical;
+ uint64_t fe_length;
+ uint64_t fe_reserved64[2];
+ uint32_t fe_flags;
+ uint32_t fe_reserved[3];
+} struct_fiemap_extent;
+
+typedef struct {
+ uint64_t fm_start;
+ uint64_t fm_length;
+ uint32_t fm_flags;
+ uint32_t fm_mapped_extents;
+ uint32_t fm_extent_count;
+ uint32_t fm_reserved;
+ struct fiemap_extent fm_extents[0];
+} struct_fiemap;
+
+#endif /* STRACE_TYPES_FIEMAP_H */
diff --git a/src/types/find_last_type_fields.awk b/src/types/find_last_type_fields.awk
new file mode 100644
index 000000000..b9121e88c
--- /dev/null
+++ b/src/types/find_last_type_fields.awk
@@ -0,0 +1,24 @@
+#!/bin/gawk -f
+#
+# Copyright (c) 2018-2020 Dmitry V. Levin <ldv@strace.io>
+# All rights reserved.
+#
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+/^typedef struct {$/ {
+ in_struct = 1
+ last_field = ""
+ next
+}
+
+(in_struct == 1) {
+ if (match($0, /^}( ATTRIBUTE_[^ ]*)* struct_([a-z][a-z_0-9]*);$/, a)) {
+ in_struct = 0
+ print a[2] "." last_field
+ next
+ }
+ if (match($0, /^[[:space:]]+[^];[:space:]:\/[][^];:[]*[[:space:]]+([^][:space:];:[]+)(\[[^];:[]*\])?;.*$/, a)) {
+ last_field = a[1]
+ next
+ }
+}
diff --git a/src/types/fs_0x94.h b/src/types/fs_0x94.h
new file mode 100644
index 000000000..f55e146a6
--- /dev/null
+++ b/src/types/fs_0x94.h
@@ -0,0 +1,41 @@
+/*
+ * Type definitions related to linux/fs.h 0x94 ioctl commands.
+ *
+ * Copyright (c) 2016-2021 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_TYPES_FS_0X94_H
+# define STRACE_TYPES_FS_0X94_H
+
+# include <linux/fs.h>
+
+typedef struct {
+ int64_t src_fd;
+ uint64_t src_offset;
+ uint64_t src_length;
+ uint64_t dest_offset;
+} struct_file_clone_range;
+
+typedef struct {
+ int64_t dest_fd;
+ uint64_t dest_offset;
+ uint64_t bytes_deduped;
+ int32_t status;
+ uint32_t reserved;
+} struct_file_dedupe_range_info;
+
+typedef struct {
+ uint64_t src_offset;
+ uint64_t src_length;
+ uint16_t dest_count;
+ uint16_t reserved1;
+ uint32_t reserved2;
+ struct_file_dedupe_range_info info[0];
+} struct_file_dedupe_range;
+
+typedef char fs_0x94_label_t[256];
+
+#endif /* STRACE_TYPES_FS_0X94_H */
diff --git a/src/types/fs_x.h b/src/types/fs_x.h
new file mode 100644
index 000000000..ba61396ae
--- /dev/null
+++ b/src/types/fs_x.h
@@ -0,0 +1,30 @@
+/*
+ * Type definitions related to linux/fs.h 'X' ioctl commands.
+ *
+ * Copyright (c) 2016-2021 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_TYPES_FS_X_H
+# define STRACE_TYPES_FS_X_H
+
+# include <linux/fs.h>
+
+typedef struct {
+ uint64_t start;
+ uint64_t len;
+ uint64_t minlen;
+} struct_fstrim_range;
+
+typedef struct {
+ uint32_t fsx_xflags;
+ uint32_t fsx_extsize;
+ uint32_t fsx_nextents;
+ uint32_t fsx_projid;
+ uint32_t fsx_cowextsize;
+ unsigned char fsx_pad[8];
+} struct_fsxattr;
+
+#endif /* STRACE_TYPES_FS_X_H */
diff --git a/src/types/gen.sh b/src/types/gen.sh
new file mode 100755
index 000000000..019c757e7
--- /dev/null
+++ b/src/types/gen.sh
@@ -0,0 +1,209 @@
+#!/bin/sh -efu
+#
+# Copyright (c) 2014-2015 Mike Frysinger <vapier@gentoo.org>
+# Copyright (c) 2014-2015 Dmitry V. Levin <ldv@strace.io>
+# Copyright (c) 2014-2020 The strace developers.
+# All rights reserved.
+#
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+[ "x${D:-0}" != x1 ] || set -x
+
+export LC_ALL=C
+
+usage()
+{
+ cat <<EOF
+Usage: $0 <input-header> <output-c> <output-m4>
+
+Generate .c and .m4 files from <input-header> (a file or dir of files)
+and write the generated files to <output-c> and <output-m4>.
+EOF
+ exit 1
+}
+
+gen_c_check()
+{
+ local input output
+ input="$1"; shift
+ output="$1"; shift
+
+ local type_fields
+ type_fields="$(gawk -f "${0%/*}/find_last_type_fields.awk" "$input")"
+ [ -n "$type_fields" ] || {
+ echo >&2 "$input: no types found"
+ return 1
+ }
+
+ echo "generating $output"
+ {
+ cat <<-EOF
+ /* Generated by $0 from $input; do not edit. */
+ #include "defs.h"
+ #include "static_assert.h"
+ #include "types/${input##*/}"
+ EOF
+ local type_field type field TYPE FIELD
+ for type_field in $type_fields; do
+ type="${type_field%%.*}"
+ field="${type_field#*.}"
+ TYPE="$(printf %s "$type" |tr '[:lower:] ' '[:upper:]_')"
+ FIELD="$(printf %s "$field" |tr '[:lower:].' '[:upper:]_')"
+
+ cat <<-EOF
+
+ #ifdef HAVE_STRUCT_$TYPE
+ # ifdef HAVE_STRUCT_${TYPE}_$FIELD
+ static_assert(sizeof(struct $type) == sizeof(struct_$type),
+ "struct $type size mismatch, please update the decoder or fix the kernel");
+ # else
+ static_assert(sizeof(struct $type) <= offsetof(struct_$type, $field),
+ "struct $type size mismatch, please update the decoder or fix the kernel");
+ # endif /* HAVE_STRUCT_${TYPE}_$FIELD */
+ #endif /* HAVE_STRUCT_$TYPE */
+ EOF
+ done
+ } > "$output"
+}
+
+gen_m4_check()
+{
+ local input output macro
+ input="$1"; shift
+ output="$1"; shift
+ macro="$1"; shift
+
+ local type_fields
+ type_fields="$(gawk -f "${0%/*}/find_last_type_fields.awk" "$input")"
+ [ -n "$type_fields" ] || {
+ echo >&2 "$input: no types found"
+ return 1
+ }
+
+ local header
+ header="$(sed -n 's/^#[[:space:]]*include[[:space:]]\+<\([^>]\+\)>.*/\1/p' "$input" |
+ tail -1)"
+ [ -n "$header" ] || {
+ echo >&2 "$input: no included headers found"
+ return 1
+ }
+
+ local inc_expr1 inc_expr2 includes header_includes
+ inc_expr1='s/^#[[:space:]]*include[[:space:]]\+\(<[^>]\+>\).*/#include \1/p'
+ inc_expr2='s/^#[[:space:]]*include[[:space:]]\+"\([^"]\+\)".*/#include "\$srcdir\/src\/\1"/p'
+ includes="$(sed -n "$inc_expr1; $inc_expr2" "$input")"
+ header_includes="$(printf %s "$includes" |sed '$d')"
+
+ echo "generating $output"
+ {
+ cat <<-EOF
+ dnl Generated by $0 from $input; do not edit.
+ AC_DEFUN([$macro],[
+ AC_CHECK_HEADERS([$header],[
+ EOF
+ local type_field type field
+ for type_field in $type_fields; do
+ type="${type_field%%.*}"
+ field="${type_field#*.}"
+ cat <<-EOF
+
+ AC_CHECK_TYPES([struct $type],
+ [AC_CHECK_MEMBERS([struct $type.$field],,,[AC_INCLUDES_DEFAULT
+ $includes])],,[AC_INCLUDES_DEFAULT
+ $includes])
+ EOF
+ done
+ cat <<-EOF
+ ],[],[AC_INCLUDES_DEFAULT
+ $header_includes])])
+ EOF
+ } > "$output"
+}
+
+gen_m4_entry()
+{
+ local output
+ output="$1"; shift
+ echo "generating $output"
+ {
+ printf 'AC_DEFUN([st_CHECK_TYPES],[\n'
+ printf '\t%s\n' "$@"
+ printf '])\n'
+ } >"$output"
+}
+
+gen_gitignore()
+{
+ local output
+ output="$1"; shift
+ echo "generating $output"
+ {
+ printf '/%s\n' .gitignore Makemodule.am st_check_types.m4
+ printf '/check-%s.c\n' "$@"
+ printf '/check-%s.m4\n' "$@"
+ } >"$output"
+}
+
+gen_makefile()
+{
+ local output
+ output="$1"; shift
+ echo "generating $output"
+ {
+ printf 'TYPES_HEADER_FILES = '
+ [ $# -eq 0 ] ||
+ printf 'types/%s.h ' "$@"
+ echo
+ printf 'TYPES_CHECK_FILES = '
+ [ $# -eq 0 ] ||
+ printf 'types/check-%s.c ' "$@"
+ echo
+ } >"$output"
+}
+
+process_all()
+{
+ local dir
+ dir="${0%/*}"
+
+ set +f
+ set -- "$dir"/*.h
+ set -f
+
+ local f
+ local names= macros=
+ for f; do
+ [ -f "$f" ] || continue
+ local name macro
+ name=${f##*/}
+ name=${name%.h}
+ macro="st_CHECK_TYPES_$(printf %s "$name" |tr '[:lower:].' '[:upper:]_')"
+ gen_c_check "$f" "$dir/check-$name.c"
+ gen_m4_check "$f" "$dir/check-$name.m4" "$macro"
+ names="$names $name"
+ macros="$macros $macro"
+ done
+ gen_m4_entry "$dir/st_check_types.m4" $macros
+ gen_gitignore "$dir/.gitignore" $names
+ gen_makefile "$dir/Makemodule.am" $names
+}
+
+process_one()
+{
+ local input output_c output_m4 name macro
+ input="$1"; shift
+ output_c="$1"; shift
+ output_m4="$1"; shift
+
+ name=${input##*/}
+ name=${name%.h}
+ macro="st_CHECK_TYPES_$(printf %s "$name" |tr '[:lower:].' '[:upper:]_')"
+ gen_c_check "$input" "$output_c"
+ gen_m4_check "$input" "$output_m4" "$macro"
+}
+
+case $# in
+ 0) process_all ;;
+ 3) process_one "$@" ;;
+ *) usage ;;
+esac
diff --git a/src/types/gpio.h b/src/types/gpio.h
new file mode 100644
index 000000000..67c981cae
--- /dev/null
+++ b/src/types/gpio.h
@@ -0,0 +1,120 @@
+/*
+ * Copyright (c) 2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_TYPES_GPIO_H
+# define STRACE_TYPES_GPIO_H
+
+# include <stdint.h>
+# include <linux/ioctl.h>
+# ifdef HAVE_LINUX_GPIO_H
+# include <linux/gpio.h>
+# endif
+
+# ifndef GPIO_MAX_NAME_SIZE
+# define GPIO_MAX_NAME_SIZE 32
+# endif
+
+# ifndef GPIOHANDLES_MAX
+# define GPIOHANDLES_MAX 64
+# endif
+
+# ifndef GPIO_V2_LINES_MAX
+# define GPIO_V2_LINES_MAX 64
+# endif
+
+# ifndef GPIO_V2_LINE_NUM_ATTRS_MAX
+# define GPIO_V2_LINE_NUM_ATTRS_MAX 10
+# endif
+
+typedef struct {
+ char name[GPIO_MAX_NAME_SIZE];
+ char label[GPIO_MAX_NAME_SIZE];
+ uint32_t lines;
+} struct_gpiochip_info;
+
+typedef struct {
+ uint32_t line_offset;
+ uint32_t flags;
+ char name[GPIO_MAX_NAME_SIZE];
+ char consumer[GPIO_MAX_NAME_SIZE];
+} struct_gpioline_info;
+
+typedef struct {
+ uint32_t lineoffsets[GPIOHANDLES_MAX];
+ uint32_t flags;
+ uint8_t default_values[GPIOHANDLES_MAX];
+ char consumer_label[GPIO_MAX_NAME_SIZE];
+ uint32_t lines;
+ int fd;
+} struct_gpiohandle_request;
+
+typedef struct {
+ uint32_t lineoffset;
+ uint32_t handleflags;
+ uint32_t eventflags;
+ char consumer_label[GPIO_MAX_NAME_SIZE];
+ int fd;
+} struct_gpioevent_request;
+
+typedef struct {
+ uint8_t values[GPIOHANDLES_MAX];
+} struct_gpiohandle_data;
+
+typedef struct {
+ uint32_t flags;
+ uint8_t default_values[GPIOHANDLES_MAX];
+ uint32_t padding[4];
+} struct_gpiohandle_config;
+
+typedef struct {
+ uint64_t bits;
+ uint64_t mask;
+} struct_gpio_v2_line_values;
+
+typedef struct {
+ uint32_t id;
+ uint32_t padding;
+ union {
+ uint32_t debounce_period_us;
+ uint64_t flags;
+ uint64_t values;
+ };
+} struct_gpio_v2_line_attribute;
+
+typedef struct {
+ struct_gpio_v2_line_attribute attr;
+ uint64_t mask;
+} struct_gpio_v2_line_config_attribute;
+
+typedef struct {
+ uint64_t flags;
+ uint32_t num_attrs;
+ uint32_t padding[5];
+ struct_gpio_v2_line_config_attribute attrs[GPIO_V2_LINE_NUM_ATTRS_MAX];
+} struct_gpio_v2_line_config;
+
+typedef struct {
+ uint32_t offsets[GPIO_V2_LINES_MAX];
+ char consumer[GPIO_MAX_NAME_SIZE];
+ struct_gpio_v2_line_config config;
+ uint32_t num_lines;
+ uint32_t event_buffer_size;
+ uint32_t padding[5];
+ int32_t fd;
+} struct_gpio_v2_line_request;
+
+typedef struct {
+ char name[GPIO_MAX_NAME_SIZE];
+ char consumer[GPIO_MAX_NAME_SIZE];
+ uint32_t offset;
+ uint32_t num_attrs;
+ uint64_t flags;
+ struct_gpio_v2_line_attribute attrs[GPIO_V2_LINE_NUM_ATTRS_MAX];
+ uint32_t padding[4];
+} struct_gpio_v2_line_info;
+
+#endif /* STRACE_TYPES_GPIO_H */
diff --git a/src/types/io_uring.h b/src/types/io_uring.h
new file mode 100644
index 000000000..2fe1c13a4
--- /dev/null
+++ b/src/types/io_uring.h
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2019-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_TYPES_IO_URING_H
+# define STRACE_TYPES_IO_URING_H
+
+# ifdef HAVE_LINUX_IO_URING_H
+# include <linux/io_uring.h>
+# endif
+
+typedef struct {
+ uint32_t head;
+ uint32_t tail;
+ uint32_t ring_mask;
+ uint32_t ring_entries;
+ uint32_t flags;
+ uint32_t dropped;
+ uint32_t array;
+ uint32_t resv1;
+ uint64_t resv2;
+} struct_io_sqring_offsets;
+
+typedef struct {
+ uint32_t head;
+ uint32_t tail;
+ uint32_t ring_mask;
+ uint32_t ring_entries;
+ uint32_t overflow;
+ uint32_t cqes;
+ /** Added by v5.8-rc1~190^2~22 */ uint32_t flags;
+ /** Added by v5.8-rc1~190^2~22 */ uint32_t resv1;
+ /** Added by v5.8-rc1~190^2~22 */ uint64_t resv2;
+} struct_io_cqring_offsets;
+
+typedef struct {
+ uint32_t sq_entries;
+ uint32_t cq_entries;
+ uint32_t flags;
+ uint32_t sq_thread_cpu;
+ uint32_t sq_thread_idle;
+ uint32_t features;
+ uint32_t wq_fd;
+ uint32_t resv[3];
+ struct_io_sqring_offsets sq_off;
+ struct_io_cqring_offsets cq_off;
+} struct_io_uring_params;
+
+typedef struct {
+ uint32_t offset;
+ uint32_t resv;
+ uint64_t /* int * */ fds;
+} struct_io_uring_files_update;
+
+typedef struct {
+ uint8_t op;
+ uint8_t resv;
+ uint16_t flags; /* IO_URING_OP_* flags */
+ uint32_t resv2;
+} struct_io_uring_probe_op;
+
+typedef struct {
+ uint8_t last_op; /* last opcode supported */
+ uint8_t ops_len; /* length of ops[] array below */
+ uint16_t resv;
+ uint32_t resv2[3];
+ struct_io_uring_probe_op ops[0];
+} struct_io_uring_probe;
+
+#endif /* !STRACE_TYPES_IO_URING_H */
diff --git a/src/types/loop.h b/src/types/loop.h
new file mode 100644
index 000000000..f5127b21e
--- /dev/null
+++ b/src/types/loop.h
@@ -0,0 +1,21 @@
+/*
+ * Copyright (c) 2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_TYPES_LOOP_H
+# define STRACE_TYPES_LOOP_H
+
+# include <linux/ioctl.h>
+# include <linux/loop.h>
+
+typedef struct {
+ uint32_t fd;
+ uint32_t block_size;
+ struct loop_info64 info;
+ uint64_t __reserved[8];
+} struct_loop_config;
+
+#endif /* STRACE_TYPES_LOOP_H */
diff --git a/src/types/openat2.h b/src/types/openat2.h
new file mode 100644
index 000000000..1d9dd7050
--- /dev/null
+++ b/src/types/openat2.h
@@ -0,0 +1,21 @@
+/*
+ * Copyright (c) 2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_TYPES_OPENAT2_H
+# define STRACE_TYPES_OPENAT2_H
+
+# ifdef HAVE_LINUX_OPENAT2_H
+# include <linux/openat2.h>
+# endif
+
+typedef struct {
+ uint64_t flags;
+ uint64_t mode;
+ uint64_t resolve;
+} struct_open_how;
+
+#endif /* STRACE_TYPES_OPENAT2_H */
diff --git a/src/types/rtnl_link.h b/src/types/rtnl_link.h
new file mode 100644
index 000000000..923df0882
--- /dev/null
+++ b/src/types/rtnl_link.h
@@ -0,0 +1,94 @@
+/*
+ * Copyright (c) 2019-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_TYPES_IF_LINK_H
+# define STRACE_TYPES_IF_LINK_H
+
+/*
+ * <linux/rtnetlink.h> used to require other headers be included beforehand,
+ * include "netlink.h" that pulls in all necessary headers.
+ */
+# include "netlink.h"
+
+/*
+ * These types are defined in <linux/if_link.h> nowadays, but that was not
+ * always the case in the past. Fortunately, when these types were moved
+ * out of <linux/rtnetlink.h>, it was changed to include necessary headers
+ * for backwards compatibility.
+ */
+# include <linux/rtnetlink.h>
+
+typedef struct {
+ uint32_t rx_packets;
+ uint32_t tx_packets;
+ uint32_t rx_bytes;
+ uint32_t tx_bytes;
+ uint32_t rx_errors;
+ uint32_t tx_errors;
+ uint32_t rx_dropped;
+ uint32_t tx_dropped;
+ uint32_t multicast;
+ uint32_t collisions;
+ uint32_t rx_length_errors;
+ uint32_t rx_over_errors;
+ uint32_t rx_crc_errors;
+ uint32_t rx_frame_errors;
+ uint32_t rx_fifo_errors;
+ uint32_t rx_missed_errors;
+ uint32_t tx_aborted_errors;
+ uint32_t tx_carrier_errors;
+ uint32_t tx_fifo_errors;
+ uint32_t tx_heartbeat_errors;
+ uint32_t tx_window_errors;
+ uint32_t rx_compressed;
+ uint32_t tx_compressed;
+ uint32_t rx_nohandler; /**< Added by v4.6-rc1~91^2~329^2~2 */
+} struct_rtnl_link_stats;
+
+/** Added by Linux commit v2.6.35-rc1~473^2~759 */
+typedef struct {
+ uint64_t rx_packets;
+ uint64_t tx_packets;
+ uint64_t rx_bytes;
+ uint64_t tx_bytes;
+ uint64_t rx_errors;
+ uint64_t tx_errors;
+ uint64_t rx_dropped;
+ uint64_t tx_dropped;
+ uint64_t multicast;
+ uint64_t collisions;
+ uint64_t rx_length_errors;
+ uint64_t rx_over_errors;
+ uint64_t rx_crc_errors;
+ uint64_t rx_frame_errors;
+ uint64_t rx_fifo_errors;
+ uint64_t rx_missed_errors;
+ uint64_t tx_aborted_errors;
+ uint64_t tx_carrier_errors;
+ uint64_t tx_fifo_errors;
+ uint64_t tx_heartbeat_errors;
+ uint64_t tx_window_errors;
+ uint64_t rx_compressed;
+ uint64_t tx_compressed;
+ uint64_t rx_nohandler; /**< Added by v4.6-rc1~91^2~329^2~2 */
+} struct_rtnl_link_stats64;
+
+/** Added by Linux commit v4.4-rc1~141^2~231^2~18 */
+typedef struct {
+ uint8_t prio[2];
+ uint8_t addr[6];
+} struct_ifla_bridge_id;
+
+/** Added by Linux commit v2.6.35-rc1~473^2~33 */
+typedef struct {
+ uint8_t vsi_mgr_id;
+ uint8_t vsi_type_id[3];
+ uint8_t vsi_type_version;
+ uint8_t pad[3];
+} struct_ifla_port_vsi;
+
+#endif /* !STRACE_TYPES_IF_LINK_H */
diff --git a/src/types/rtnl_mdb.h b/src/types/rtnl_mdb.h
new file mode 100644
index 000000000..789140b9a
--- /dev/null
+++ b/src/types/rtnl_mdb.h
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2019-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_TYPES_RTNL_MDB_H
+# define STRACE_TYPES_RTNL_MDB_H
+
+/* struct_br_mdb_entry needs a definition of struct in6_addr. */
+# include <netinet/in.h>
+
+# include <linux/if_bridge.h>
+
+/** Added by Linux commit v3.8-rc1~139^2~50 */
+typedef struct {
+ uint8_t family; /** Added by Linux commit v3.8-rc1~139^2~3 */
+ uint32_t ifindex;
+} struct_br_port_msg;
+
+/** Added by Linux commit v3.8-rc1~139^2~50 */
+typedef struct {
+ uint32_t ifindex;
+ uint8_t state; /** Added by Linux commit v3.8-rc1~40^2~30 */
+ uint8_t flags; /** Added by Linux commit v4.6-rc1~91^2~309^2~2 */
+ uint16_t vid; /** Added by Linux commit v4.3-rc1~96^2~365 */
+ struct {
+ union {
+ uint32_t /* __be32 */ ip4;
+ struct in6_addr ip6;
+ } u;
+ uint16_t /* __be16 */ proto;
+ } addr;
+} struct_br_mdb_entry;
+
+#endif /* !STRACE_TYPES_RTNL_MDB_H */
diff --git a/src/types/rtnl_neightbl.h b/src/types/rtnl_neightbl.h
new file mode 100644
index 000000000..3bdd22a4a
--- /dev/null
+++ b/src/types/rtnl_neightbl.h
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2019-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_TYPES_RTNL_NEIGHTBL_H
+# define STRACE_TYPES_RTNL_NEIGHTBL_H
+
+/*
+ * <linux/rtnetlink.h> used to require other headers be included beforehand,
+ * include "netlink.h" that pulls in all necessary headers.
+ */
+# include "netlink.h"
+
+/*
+ * These types are defined in <linux/neighbour.h> nowadays, but that was not
+ * always the case in the past. Fortunately, when these types were moved
+ * out of <linux/rtnetlink.h>, it was changed to include necessary headers
+ * for backwards compatibility.
+ */
+# include <linux/rtnetlink.h>
+
+typedef struct {
+ uint16_t ndtc_key_len;
+ uint16_t ndtc_entry_size;
+ uint32_t ndtc_entries;
+ uint32_t ndtc_last_flush;
+ uint32_t ndtc_last_rand;
+ uint32_t ndtc_hash_rnd;
+ uint32_t ndtc_hash_mask;
+ uint32_t ndtc_hash_chain_gc;
+ uint32_t ndtc_proxy_qlen;
+} struct_ndt_config;
+
+typedef struct {
+ uint64_t ndts_allocs;
+ uint64_t ndts_destroys;
+ uint64_t ndts_hash_grows;
+ uint64_t ndts_res_failed;
+ uint64_t ndts_lookups;
+ uint64_t ndts_hits;
+ uint64_t ndts_rcv_probes_mcast;
+ uint64_t ndts_rcv_probes_ucast;
+ uint64_t ndts_periodic_gc_runs;
+ uint64_t ndts_forced_gc_runs;
+ uint64_t ndts_table_fulls; /**< Added by v4.3-rc1~96^2~202 */
+} struct_ndt_stats;
+
+#endif /* !STRACE_TYPES_RTNL_NEIGHTBL_H */
diff --git a/src/types/rtnl_route.h b/src/types/rtnl_route.h
new file mode 100644
index 000000000..a355e7f53
--- /dev/null
+++ b/src/types/rtnl_route.h
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2019-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_TYPES_RTNL_ROUTE_H
+# define STRACE_TYPES_RTNL_ROUTE_H
+
+/*
+ * <linux/rtnetlink.h> used to require other headers be included beforehand,
+ * include "netlink.h" that pulls in all necessary headers.
+ */
+# include "netlink.h"
+# include <linux/rtnetlink.h>
+
+/** Added by Linux commit v3.8-rc1~139^2~90 */
+typedef struct {
+ uint64_t mfcs_packets;
+ uint64_t mfcs_bytes;
+ uint64_t mfcs_wrong_if;
+} struct_rta_mfc_stats;
+
+/** Added by Linux commit v4.1-rc1~128^2~350^2~1 */
+typedef struct {
+ uint16_t /* __kernel_sa_family_t */ rtvia_family;
+ uint8_t rtvia_addr[0];
+} struct_rtvia;
+
+#endif /* !STRACE_TYPES_RTNL_ROUTE_H */
diff --git a/src/types/tee.h b/src/types/tee.h
new file mode 100644
index 000000000..ab3a25de9
--- /dev/null
+++ b/src/types/tee.h
@@ -0,0 +1,107 @@
+/*
+ * Copyright (c) 2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_TYPES_TEE_H
+# define STRACE_TYPES_TEE_H
+
+# include <linux/ioctl.h>
+
+# ifdef HAVE_LINUX_TEE_H
+# include <linux/tee.h>
+# else
+# define TEE_IOCTL_UUID_LEN 16
+# endif
+
+typedef struct {
+ uint64_t buf_ptr;
+ uint64_t buf_len;
+} struct_tee_ioctl_buf_data;
+
+typedef struct {
+ uint32_t cancel_id;
+ uint32_t session;
+} struct_tee_ioctl_cancel_arg;
+
+typedef struct {
+ uint32_t session;
+} struct_tee_ioctl_close_session_arg;
+
+typedef struct {
+ uint64_t size;
+ uint32_t flags;
+ int32_t id;
+} struct_tee_ioctl_shm_alloc_data;
+
+/* Not in mainline */
+typedef struct {
+ int64_t fd;
+ uint64_t size;
+ uint32_t flags;
+ uint8_t _pad1[4];
+ int32_t id;
+ uint8_t _pad2[4];
+} ATTRIBUTE_ALIGNED(8) struct_tee_ioctl_shm_register_fd_data;
+
+typedef struct {
+ uint64_t addr;
+ uint64_t length;
+ uint32_t flags;
+ int32_t id;
+} struct_tee_ioctl_shm_register_data;
+
+typedef struct {
+ uint32_t impl_id;
+ uint32_t impl_caps;
+ uint32_t gen_caps;
+} struct_tee_ioctl_version_data;
+
+typedef struct {
+ uint64_t attr;
+ uint64_t a;
+ uint64_t b;
+ uint64_t c;
+} struct_tee_ioctl_param;
+
+typedef struct {
+ uint32_t func;
+ uint32_t session;
+ uint32_t cancel_id;
+ uint32_t ret;
+ uint32_t ret_origin;
+ uint32_t num_params;
+ /* num_params tells the actual number of element in params */
+ struct_tee_ioctl_param params[];
+} struct_tee_ioctl_invoke_arg;
+
+typedef struct {
+ uint32_t func;
+ uint32_t num_params;
+ /* num_params tells the actual number of element in params */
+ struct_tee_ioctl_param params[];
+} struct_tee_iocl_supp_recv_arg;
+
+typedef struct {
+ uint32_t ret;
+ uint32_t num_params;
+ /* num_params tells the actual number of element in params */
+ struct_tee_ioctl_param params[];
+} struct_tee_iocl_supp_send_arg;
+
+typedef struct {
+ uint8_t uuid[TEE_IOCTL_UUID_LEN];
+ uint8_t clnt_uuid[TEE_IOCTL_UUID_LEN];
+ uint32_t clnt_login;
+ uint32_t cancel_id;
+ uint32_t session;
+ uint32_t ret;
+ uint32_t ret_origin;
+ uint32_t num_params;
+ /* num_params tells the actual number of element in params */
+ struct_tee_ioctl_param params[];
+} struct_tee_ioctl_open_session_arg;
+
+#endif /* STRACE_TYPES_TEE_H */
diff --git a/src/types/v4l2.h b/src/types/v4l2.h
new file mode 100644
index 000000000..59382001a
--- /dev/null
+++ b/src/types/v4l2.h
@@ -0,0 +1,273 @@
+/*
+ * V4L2-related type definitions.
+ *
+ * Copyright (c) 2016-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_TYPES_V4L2_H
+# define STRACE_TYPES_V4L2_H
+
+# include <stdint.h>
+# include <linux/ioctl.h>
+# include <linux/types.h>
+# include <linux/videodev2.h>
+
+typedef struct v4l2_framebuffer struct_v4l2_framebuffer;
+typedef struct v4l2_input struct_v4l2_input;
+typedef struct v4l2_standard struct_v4l2_standard;
+
+
+typedef struct {
+ uint8_t driver[16];
+ uint8_t card[32];
+ uint8_t bus_info[32];
+ uint32_t version;
+ uint32_t capabilities;
+ uint32_t device_caps; /**< Added by v3.4-rc1~110^2^2~259 */
+ uint32_t reserved[3];
+} struct_v4l2_capability;
+
+
+typedef struct {
+ uint32_t width;
+ uint32_t height;
+ uint32_t pixelformat;
+ uint32_t field;
+ uint32_t bytesperline;
+ uint32_t sizeimage;
+ uint32_t colorspace; /**< enum v4l2_colorspace */
+ uint32_t priv;
+ /** Format flags (V4L2_PIX_FMT_FLAG_*), added by v3.17-rc1~112^2~326 */
+ uint32_t flags;
+ union {
+ /** enum v4l2_ycbcr_encoding, added by v3.19-rc1~29^2~72 */
+ uint32_t ycbcr_enc;
+ /** enum v4l2_hsv_encoding, added by v4.10-rc1~71^2^2~352 */
+ uint32_t hsv_enc;
+ };
+ /** enum v4l2_quantization, added by v3.19-rc1~29^2~72 */
+ uint32_t quantization;
+ /** enum v4l2_xfer_func, added by Linux commit v4.2-rc1~107^2~136 */
+ uint32_t xfer_func;
+} struct_v4l2_pix_format;
+
+/** Added by Linux commit v2.6.39-rc1~86^2~437 */
+typedef struct {
+ uint32_t sizeimage;
+ uint32_t bytesperline; /**< Type has changed in v4.1-rc1~59^2~1^2~88 */
+ uint16_t reserved[6];
+} struct_v4l2_plane_pix_format;
+
+/** Added by Linux commit v2.6.39-rc1~86^2~437 */
+typedef struct {
+ uint32_t width;
+ uint32_t height;
+ uint32_t pixelformat;
+ uint32_t field;
+ uint32_t colorspace;
+
+ struct_v4l2_plane_pix_format plane_fmt[8 /* VIDEO_MAX_PLANES */];
+ uint8_t num_planes;
+ /** Format flags (V4L2_PIX_FMT_FLAG_*), added by v3.17-rc1~112^2~326 */
+ uint8_t flags;
+ union {
+ /** enum v4l2_ycbcr_encoding, added by v3.19-rc1~29^2~72 */
+ uint8_t ycbcr_enc;
+ /** enum v4l2_hsv_encoding, added by v4.10-rc1~71^2^2~352 */
+ uint8_t hsv_enc;
+ };
+ /** enum v4l2_quantization, added by v3.19-rc1~29^2~72 */
+ uint8_t quantization;
+ /** enum v4l2_xfer_func, added by Linux commit v4.2-rc1~107^2~136 */
+ uint8_t xfer_func;
+ uint8_t reserved[7];
+} ATTRIBUTE_PACKED struct_v4l2_pix_format_mplane;
+
+typedef struct strace_v4l2_clip {
+ struct v4l2_rect c;
+ struct strace_v4l2_clip * next;
+} struct_v4l2_clip;
+
+typedef struct {
+ struct v4l2_rect w;
+ uint32_t field; /* enum v4l2_field */
+ uint32_t chromakey;
+ struct_v4l2_clip *clips;
+ uint32_t clipcount;
+ void *bitmap;
+ uint8_t global_alpha; /**< Added by v2.6.22-rc1~1118^2~179 */
+} struct_v4l2_window;
+
+typedef struct {
+ uint32_t sampling_rate;
+ uint32_t offset;
+ uint32_t samples_per_line;
+ uint32_t sample_format; /* V4L2_PIX_FMT_* */
+ int32_t start[2];
+ uint32_t count[2];
+ uint32_t flags; /* V4L2_VBI_* */
+ uint32_t reserved[2];
+} struct_v4l2_vbi_format;
+
+/** Added by Linux commit v2.6.16.28-rc1~3732 */
+typedef struct {
+ uint16_t service_set;
+ uint16_t service_lines[2][24];
+ uint32_t io_size;
+ uint32_t reserved[2];
+} struct_v4l2_sliced_vbi_format;
+
+typedef struct {
+ uint16_t service_set;
+ uint16_t service_lines[2][24];
+ uint32_t type; /**< enum v4l2_buf_type, added by v2.6.19-rc1~643^2~52 */
+ uint32_t reserved[3];
+} struct_v4l2_sliced_vbi_cap;
+
+/** Added by Linux commits v3.15-rc1~85^2~213, v3.15-rc1~85^2~41 */
+typedef struct {
+ uint32_t pixelformat;
+ uint32_t buffersize; /**< Added by Linux commit v3.17-rc1~112^2~230 */
+ uint8_t reserved[24];
+} ATTRIBUTE_PACKED struct_v4l2_sdr_format;
+
+/** Added by Linux commit v4.12-rc1~85^2~71 */
+typedef struct {
+ uint32_t dataformat;
+ uint32_t buffersize;
+} ATTRIBUTE_PACKED struct_v4l2_meta_format;
+
+typedef struct {
+ uint32_t type;
+ union {
+ struct_v4l2_pix_format pix;
+ /** Added by Linux commit v2.6.39-rc1~86^2~437 */
+ struct_v4l2_pix_format_mplane pix_mp;
+ struct_v4l2_window win;
+ struct_v4l2_vbi_format vbi;
+ /** Added by Linux commit v2.6.16.28-rc1~3732 */
+ struct_v4l2_sliced_vbi_format sliced;
+ /** Added by v3.15-rc1~85^2~213, v3.15-rc1~85^2~41 */
+ struct_v4l2_sdr_format sdr;
+ /** Added by Linux commit v4.12-rc1~85^2~71 */
+ struct_v4l2_meta_format meta;
+ uint8_t raw_data[200];
+ } fmt;
+} struct_v4l2_format;
+
+
+/** Added by Linux v5.5-rc1~143^2^2~225 */
+typedef struct {
+ __u32 width;
+ __u32 height;
+} struct_v4l2_area;
+
+/** Added by Linux commit v2.6.18-rc1~862^2~18 */
+typedef struct {
+ uint32_t id;
+ uint32_t size; /* Added by v2.6.32-rc1~679^2~72 */
+ uint32_t reserved2[1];
+ union {
+ char * string; /**< Added by v2.6.32-rc1~679^2~72 */
+ uint8_t * p_u8; /**< Added by v3.17-rc1~112^2~343 */
+ uint16_t * p_u16; /**< Added by v3.17-rc1~112^2~343 */
+ uint32_t * p_u32; /**< Added by v3.17-rc1~112^2~112 */
+ struct_v4l2_area * p_area; /**< Added by v5.5-rc1~143^2^2~51 */
+ void * ptr; /**< Added by v3.17-rc1~112^2~363 */
+ int32_t value;
+ int64_t value64;
+ };
+} ATTRIBUTE_PACKED struct_v4l2_ext_control;
+
+/** Added by Linux commit v2.6.18-rc1~862^2~18 */
+typedef struct {
+ union {
+ uint32_t ctrl_class;
+ uint32_t which;
+ };
+ uint32_t count;
+ uint32_t error_idx;
+ int32_t request_fd; /**< Added by Linux commit v4.20-rc1~51^2~44 */
+ uint32_t reserved[1];
+ struct_v4l2_ext_control * controls;
+} struct_v4l2_ext_controls;
+
+
+/** Added by Linux commit v3.17-rc1~112^2~362 */
+typedef struct {
+ uint32_t id;
+ uint32_t type;
+ char name[32];
+ int64_t minimum;
+ int64_t maximum;
+ uint64_t step; /* Signedness differs from v4l2_queryctrl.step */
+ int64_t default_value;
+ uint32_t flags; /* V4L2_CTRL_FLAG_* */
+ uint32_t elem_size;
+ uint32_t elems;
+ uint32_t nr_of_dims;
+ uint32_t dims[4 /* V4L2_CTRL_MAX_DIMS */];
+ uint32_t reserved[32];
+} struct_v4l2_query_ext_ctrl;
+
+
+typedef struct {
+ uint32_t width;
+ uint32_t height;
+} struct_v4l2_frmsize_discrete;
+
+typedef struct {
+ uint32_t min_width;
+ uint32_t max_width;
+ uint32_t step_width;
+ uint32_t min_height;
+ uint32_t max_height;
+ uint32_t step_height;
+} struct_v4l2_frmsize_stepwise;
+
+/** Added by Linux commit v2.6.19-rc1~183 */
+typedef struct {
+ uint32_t index;
+ uint32_t pixel_format;
+ uint32_t type; /**< enum v4l2_frmsizetypes */
+ union {
+ struct_v4l2_frmsize_discrete discrete;
+ struct_v4l2_frmsize_stepwise stepwise;
+ };
+ uint32_t reserved[2];
+} struct_v4l2_frmsizeenum;
+
+typedef struct {
+ struct v4l2_fract min;
+ struct v4l2_fract max;
+ struct v4l2_fract step;
+} struct_v4l2_frmival_stepwise;
+
+typedef struct {
+ uint32_t index;
+ uint32_t pixel_format;
+ uint32_t width;
+ uint32_t height;
+ uint32_t type; /**< enum v4l2_frmivaltypes */
+ union {
+ struct v4l2_fract discrete;
+ struct_v4l2_frmival_stepwise stepwise;
+ };
+ uint32_t reserved[2];
+} struct_v4l2_frmivalenum;
+
+
+typedef struct {
+ uint32_t index;
+ uint32_t count;
+ uint32_t memory;
+ struct_v4l2_format format;
+ /** V4L2_BUF_CAP_*, added by Linux commit v4.20-rc1~51^2~14 */
+ uint32_t capabilities;
+ uint32_t reserved[7];
+} struct_v4l2_create_buffers;
+
+#endif /* STRACE_TYPES_V4L2_H */
diff --git a/src/ubi.c b/src/ubi.c
new file mode 100644
index 000000000..93cec79c4
--- /dev/null
+++ b/src/ubi.c
@@ -0,0 +1,256 @@
+/*
+ * Copyright (c) 2012 Mike Frysinger <vapier@gentoo.org>
+ * Copyright (c) 2012-2021 The strace developers.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#ifdef HAVE_STRUCT_UBI_ATTACH_REQ_MAX_BEB_PER1024
+
+# include <linux/ioctl.h>
+# include <mtd/ubi-user.h>
+
+# include "xlat/ubi_volume_types.h"
+# include "xlat/ubi_volume_flags.h"
+# include "xlat/ubi_volume_props.h"
+# include "xlat/ubi_data_types.h"
+
+static int
+decode_UBI_IOCMKVOL(struct tcb *const tcp, const kernel_ulong_t arg)
+{
+ struct ubi_mkvol_req mkvol;
+
+ if (entering(tcp)) {
+ tprints(", ");
+ if (umove_or_printaddr(tcp, arg, &mkvol))
+ return RVAL_IOCTL_DECODED;
+
+ tprint_struct_begin();
+ PRINT_FIELD_D(mkvol, vol_id);
+ tprint_struct_next();
+ PRINT_FIELD_D(mkvol, alignment);
+ tprint_struct_next();
+ PRINT_FIELD_D(mkvol, bytes);
+ tprint_struct_next();
+ PRINT_FIELD_XVAL(mkvol, vol_type,
+ ubi_volume_types, "UBI_???_VOLUME");
+# ifndef HAVE_STRUCT_UBI_MKVOL_REQ_FLAGS
+# define flags padding1
+# endif
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(mkvol, flags,
+ ubi_volume_flags, "UBI_VOL_???");
+# ifndef HAVE_STRUCT_UBI_MKVOL_REQ_FLAGS
+# undef flags
+# endif
+ tprint_struct_next();
+ PRINT_FIELD_D(mkvol, name_len);
+ tprint_struct_next();
+ PRINT_FIELD_CSTRING_SZ(mkvol, name,
+ 1 + CLAMP(mkvol.name_len, 0,
+ (int) sizeof(mkvol.name) - 1));
+ tprint_struct_end();
+ return 0;
+ }
+
+ if (!syserror(tcp)) {
+ tprint_value_changed();
+ printnum_int(tcp, arg, "%d");
+ }
+
+ return RVAL_IOCTL_DECODED;
+}
+
+static int
+decode_UBI_IOCRSVOL(struct tcb *const tcp, const kernel_ulong_t arg)
+{
+ struct ubi_rsvol_req rsvol;
+
+ tprints(", ");
+ if (!umove_or_printaddr(tcp, arg, &rsvol)) {
+ tprint_struct_begin();
+ PRINT_FIELD_D(rsvol, bytes);
+ tprint_struct_next();
+ PRINT_FIELD_D(rsvol, vol_id);
+ tprint_struct_end();
+ }
+
+ return RVAL_IOCTL_DECODED;
+}
+
+static bool
+print_ubi_rnvol_req_ent_array_member(struct tcb *tcp, void *elem_buf,
+ size_t elem_size, void *data)
+{
+ typeof(&((struct ubi_rnvol_req *) NULL)->ents[0]) p = elem_buf;
+
+ tprint_struct_begin();
+ PRINT_FIELD_D(*p, vol_id);
+ tprint_struct_next();
+ PRINT_FIELD_D(*p, name_len);
+ tprint_struct_next();
+ PRINT_FIELD_CSTRING_SZ(*p, name,
+ 1 + CLAMP(p->name_len, 0,
+ (int) sizeof(p->name) - 1));
+ tprint_struct_end();
+
+ return true;
+}
+
+static int
+decode_UBI_IOCRNVOL(struct tcb *const tcp, const kernel_ulong_t arg)
+{
+ struct ubi_rnvol_req rnvol;
+
+ tprints(", ");
+ if (umove_or_printaddr(tcp, arg, &rnvol))
+ return RVAL_IOCTL_DECODED;
+
+ tprint_struct_begin();
+ PRINT_FIELD_D(rnvol, count);
+ tprint_struct_next();
+ PRINT_FIELD_ARRAY_UPTO(rnvol, ents, rnvol.count, tcp,
+ print_ubi_rnvol_req_ent_array_member);
+ tprint_struct_end();
+
+ return RVAL_IOCTL_DECODED;
+}
+
+static int
+decode_UBI_IOCEBCH(struct tcb *const tcp, const kernel_ulong_t arg)
+{
+ struct ubi_leb_change_req leb;
+
+ tprints(", ");
+ if (!umove_or_printaddr(tcp, arg, &leb)) {
+ tprint_struct_begin();
+ PRINT_FIELD_D(leb, lnum);
+ tprint_struct_next();
+ PRINT_FIELD_D(leb, bytes);
+ tprint_struct_next();
+ PRINT_FIELD_XVAL(leb, dtype, ubi_data_types, "UBI_???");
+ tprint_struct_end();
+ }
+
+ return RVAL_IOCTL_DECODED;
+}
+
+static int
+decode_UBI_IOCATT(struct tcb *const tcp, const kernel_ulong_t arg)
+{
+ if (entering(tcp)) {
+ struct ubi_attach_req attach;
+
+ tprints(", ");
+ if (umove_or_printaddr(tcp, arg, &attach))
+ return RVAL_IOCTL_DECODED;
+
+ tprint_struct_begin();
+ PRINT_FIELD_D(attach, ubi_num);
+ tprint_struct_next();
+ PRINT_FIELD_D(attach, mtd_num);
+ tprint_struct_next();
+ PRINT_FIELD_D(attach, vid_hdr_offset);
+ tprint_struct_next();
+ PRINT_FIELD_D(attach, max_beb_per1024);
+ tprint_struct_end();
+ return 0;
+ }
+
+ if (!syserror(tcp)) {
+ tprint_value_changed();
+ printnum_int(tcp, arg, "%d");
+ }
+
+ return RVAL_IOCTL_DECODED;
+}
+
+static int
+decode_UBI_IOCEBMAP(struct tcb *const tcp, const kernel_ulong_t arg)
+{
+ struct ubi_map_req map;
+
+ tprints(", ");
+ if (!umove_or_printaddr(tcp, arg, &map)) {
+ tprint_struct_begin();
+ PRINT_FIELD_D(map, lnum);
+ tprint_struct_next();
+ PRINT_FIELD_XVAL(map, dtype, ubi_data_types, "UBI_???");
+ tprint_struct_end();
+ }
+
+ return RVAL_IOCTL_DECODED;
+}
+
+static int
+decode_UBI_IOCSETVOLPROP(struct tcb *const tcp, const kernel_ulong_t arg)
+{
+ struct ubi_set_vol_prop_req prop;
+
+ tprints(", ");
+ if (!umove_or_printaddr(tcp, arg, &prop)) {
+ tprint_struct_begin();
+ PRINT_FIELD_XVAL(prop, property,
+ ubi_volume_props, "UBI_VOL_PROP_???");
+ tprint_struct_next();
+ PRINT_FIELD_X(prop, value);
+ tprint_struct_end();
+ }
+
+ return RVAL_IOCTL_DECODED;
+}
+
+int
+ubi_ioctl(struct tcb *const tcp, const unsigned int code,
+ const kernel_ulong_t arg)
+{
+ switch (code) {
+# define case_UBI(name) case UBI_ ## name: return decode_UBI_ ## name(tcp, arg)
+ case_UBI(IOCATT);
+ case_UBI(IOCEBCH);
+ case_UBI(IOCEBMAP);
+ case_UBI(IOCMKVOL);
+ case_UBI(IOCRNVOL);
+ case_UBI(IOCRSVOL);
+ case_UBI(IOCSETVOLPROP);
+# undef case_UBI
+
+ case UBI_IOCVOLUP:
+ tprints(", ");
+ printnum_int64(tcp, arg, "%" PRIi64);
+ break;
+
+ case UBI_IOCDET:
+ case UBI_IOCEBER:
+ case UBI_IOCEBISMAP:
+ case UBI_IOCEBUNMAP:
+ case UBI_IOCRMVOL:
+# ifdef UBI_IOCRPEB
+ case UBI_IOCRPEB:
+# endif
+# ifdef UBI_IOCSPEB
+ case UBI_IOCSPEB:
+# endif
+ tprints(", ");
+ printnum_int(tcp, arg, "%d");
+ break;
+
+# ifdef UBI_IOCVOLCRBLK
+ case UBI_IOCVOLCRBLK:
+# endif
+# ifdef UBI_IOCVOLRMBLK
+ case UBI_IOCVOLRMBLK:
+# endif
+ /* no arguments */
+ break;
+
+ default:
+ return RVAL_DECODED;
+ }
+
+ return RVAL_IOCTL_DECODED;
+}
+
+#endif /* HAVE_STRUCT_UBI_ATTACH_REQ_MAX_BEB_PER1024 */
diff --git a/src/ucopy.c b/src/ucopy.c
new file mode 100644
index 000000000..59af86417
--- /dev/null
+++ b/src/ucopy.c
@@ -0,0 +1,415 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
+ * Copyright (c) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation
+ * Linux for s390 port by D.J. Barrow
+ * <barrow_dj@mail.yahoo.com,djbarrow@de.ibm.com>
+ * Copyright (c) 1999-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include <sys/uio.h>
+
+#include "scno.h"
+#include "ptrace.h"
+
+static bool process_vm_readv_not_supported;
+
+#ifndef HAVE_PROCESS_VM_READV
+/*
+ * Need to do this since process_vm_readv() is not yet available in libc.
+ * When libc is updated, only "static bool process_vm_readv_not_supported"
+ * line remains.
+ * The name is different to avoid potential collision with OS headers.
+ */
+static ssize_t strace_process_vm_readv(pid_t pid,
+ const struct iovec *lvec,
+ unsigned long liovcnt,
+ const struct iovec *rvec,
+ unsigned long riovcnt,
+ unsigned long flags)
+{
+ return syscall(__NR_process_vm_readv,
+ (long) pid, lvec, liovcnt, rvec, riovcnt, flags);
+}
+# define process_vm_readv strace_process_vm_readv
+#endif /* !HAVE_PROCESS_VM_READV */
+
+static ssize_t
+process_read_mem(const pid_t pid, void *const laddr,
+ void *const raddr, const size_t len)
+{
+ const struct iovec local = {
+ .iov_base = laddr,
+ .iov_len = len
+ };
+ const struct iovec remote = {
+ .iov_base = raddr,
+ .iov_len = len
+ };
+
+ const ssize_t rc = process_vm_readv(pid, &local, 1, &remote, 1, 0);
+ if (rc < 0 && errno == ENOSYS)
+ process_vm_readv_not_supported = true;
+
+ return rc;
+}
+
+static int cached_idx = -1;
+static unsigned long cached_raddr[4];
+
+void
+invalidate_umove_cache(void)
+{
+ cached_idx = -1;
+}
+
+static int
+get_next_unused_idx(void)
+{
+ return (cached_idx + 1) % ARRAY_SIZE(cached_raddr);
+}
+
+static int
+lookup_cached_raddr_idx(const unsigned long raddr)
+{
+ if (cached_idx >= 0) {
+ for (int i = cached_idx; i >= 0; --i)
+ if (raddr == cached_raddr[i])
+ return i;
+ for (int i = (int) ARRAY_SIZE(cached_raddr) - 1;
+ i > cached_idx; --i)
+ if (raddr == cached_raddr[i])
+ return i;
+ }
+ return -1;
+}
+
+static void
+set_cached_raddr_idx(const unsigned long raddr, const int idx)
+{
+ if (cached_idx < 0)
+ memset(cached_raddr, 0, sizeof(cached_raddr));
+ cached_raddr[idx] = raddr;
+ cached_idx = idx;
+}
+
+static ssize_t
+vm_read_mem(const pid_t pid, void *laddr,
+ const kernel_ulong_t kraddr, size_t len)
+{
+ if (!len)
+ return len;
+
+ unsigned long taddr = kraddr;
+
+#if SIZEOF_LONG < SIZEOF_KERNEL_LONG_T
+ if (kraddr != (kernel_ulong_t) taddr) {
+ errno = EIO;
+ return -1;
+ }
+#endif
+
+ const size_t page_size = get_pagesize();
+ const size_t page_mask = page_size - 1;
+ unsigned long page_start = taddr & ~page_mask;
+ const unsigned long page_after_last =
+ (taddr + len + page_mask) & ~page_mask;
+
+ if (!page_start ||
+ page_after_last < page_start ||
+ page_after_last - page_start > ARRAY_SIZE(cached_raddr) * page_size)
+ return process_read_mem(pid, laddr, (void *) taddr, len);
+
+ size_t total_read = 0;
+
+ for (;;) {
+ static char *buf[ARRAY_SIZE(cached_raddr)];
+ int idx = lookup_cached_raddr_idx(page_start);
+
+ if (idx == -1) {
+ idx = get_next_unused_idx();
+
+ if (!buf[idx])
+ buf[idx] = xmalloc(page_size);
+
+ const ssize_t rc =
+ process_read_mem(pid, buf[idx],
+ (void *) page_start, page_size);
+ if (rc < 0)
+ return total_read ? (ssize_t) total_read : rc;
+
+ set_cached_raddr_idx(page_start, idx);
+ }
+
+ const unsigned long offset = taddr - page_start;
+ size_t copy_len, next_len;
+
+ if (len <= page_size - offset) {
+ copy_len = len;
+ next_len = 0;
+ } else {
+ copy_len = page_size - offset;
+ next_len = len - copy_len;
+ }
+
+ memcpy(laddr, buf[idx] + offset, copy_len);
+ total_read += copy_len;
+
+ if (!next_len)
+ break;
+
+ len = next_len;
+ laddr += copy_len;
+ page_start += page_size;
+ taddr = page_start;
+ }
+
+ return total_read;
+}
+
+static bool
+tracee_addr_is_invalid(kernel_ulong_t addr)
+{
+ return
+#if ANY_WORDSIZE_LESS_THAN_KERNEL_LONG
+ current_wordsize < sizeof(addr) && addr & ~(kernel_ulong_t) -1U;
+#else
+ false;
+#endif
+}
+
+/* legacy method of copying from tracee */
+static int
+umoven_peekdata(const int pid, kernel_ulong_t addr, unsigned int len,
+ void *laddr)
+{
+ unsigned int nread = 0;
+ unsigned int residue = addr & (sizeof(long) - 1);
+
+ while (len) {
+ addr &= -sizeof(long); /* aligned address */
+
+ errno = 0;
+ union {
+ long val;
+ char x[sizeof(long)];
+ } u = { .val = ptrace(PTRACE_PEEKDATA, pid, addr, 0) };
+
+ switch (errno) {
+ case 0:
+ break;
+ case ESRCH: case EINVAL:
+ /* these could be seen if the process is gone */
+ return -1;
+ case EFAULT: case EIO: case EPERM:
+ /* address space is inaccessible */
+ if (nread) {
+ perror_func_msg("short read (%u < %u)"
+ " @0x%" PRI_klx,
+ nread, nread + len,
+ addr - nread);
+ }
+ return -1;
+ default:
+ /* all the rest is strange and should be reported */
+ perror_func_msg("pid:%d @0x%" PRI_klx,
+ pid, addr);
+ return -1;
+ }
+
+ unsigned int m = MIN(sizeof(long) - residue, len);
+ memcpy(laddr, &u.x[residue], m);
+ residue = 0;
+ addr += sizeof(long);
+ laddr += m;
+ nread += m;
+ len -= m;
+ }
+
+ return 0;
+}
+
+/*
+ * Copy `len' bytes of data from process `pid'
+ * at address `addr' to our space at `our_addr'.
+ */
+int
+umoven(struct tcb *const tcp, kernel_ulong_t addr, unsigned int len,
+ void *const our_addr)
+{
+ if (tracee_addr_is_invalid(addr))
+ return -1;
+
+ const int pid = tcp->pid;
+
+ if (process_vm_readv_not_supported)
+ return umoven_peekdata(pid, addr, len, our_addr);
+
+ int r = vm_read_mem(pid, our_addr, addr, len);
+ if ((unsigned int) r == len)
+ return 0;
+ if (r >= 0) {
+ error_func_msg("short read (%u < %u) @0x%" PRI_klx,
+ (unsigned int) r, len, addr);
+ return -1;
+ }
+ switch (errno) {
+ case ENOSYS:
+ case EPERM:
+ /* try PTRACE_PEEKDATA */
+ return umoven_peekdata(pid, addr, len, our_addr);
+ case ESRCH:
+ /* the process is gone */
+ return -1;
+ case EFAULT: case EIO:
+ /* address space is inaccessible */
+ return -1;
+ default:
+ /* all the rest is strange and should be reported */
+ perror_func_msg("pid:%d @0x%" PRI_klx, pid, addr);
+ return -1;
+ }
+}
+
+/*
+ * Like umoven_peekdata but make the additional effort of looking
+ * for a terminating zero byte.
+ */
+static int
+umovestr_peekdata(const int pid, kernel_ulong_t addr, unsigned int len,
+ void *laddr)
+{
+ unsigned int nread = 0;
+ unsigned int residue = addr & (sizeof(long) - 1);
+ void *const orig_addr = laddr;
+
+ while (len) {
+ addr &= -sizeof(long); /* aligned address */
+
+ errno = 0;
+ union {
+ unsigned long val;
+ char x[sizeof(long)];
+ } u = { .val = ptrace(PTRACE_PEEKDATA, pid, addr, 0) };
+
+ switch (errno) {
+ case 0:
+ break;
+ case ESRCH: case EINVAL:
+ /* these could be seen if the process is gone */
+ return -1;
+ case EFAULT: case EIO: case EPERM:
+ /* address space is inaccessible */
+ if (nread) {
+ perror_func_msg("short read (%d < %d)"
+ " @0x%" PRI_klx,
+ nread, nread + len,
+ addr - nread);
+ }
+ return -1;
+ default:
+ /* all the rest is strange and should be reported */
+ perror_func_msg("pid:%d @0x%" PRI_klx,
+ pid, addr);
+ return -1;
+ }
+
+ unsigned int m = MIN(sizeof(long) - residue, len);
+ memcpy(laddr, &u.x[residue], m);
+ while (residue < sizeof(long))
+ if (u.x[residue++] == '\0')
+ return (laddr - orig_addr) + residue;
+ residue = 0;
+ addr += sizeof(long);
+ laddr += m;
+ nread += m;
+ len -= m;
+ }
+
+ return 0;
+}
+
+/*
+ * Like `umove' but make the additional effort of looking
+ * for a terminating zero byte.
+ *
+ * Returns < 0 on error, strlen + 1 if NUL was seen,
+ * else 0 if len bytes were read but no NUL byte seen.
+ *
+ * Note: there is no guarantee we won't overwrite some bytes
+ * in laddr[] _after_ terminating NUL (but, of course,
+ * we never write past laddr[len-1]).
+ */
+int
+umovestr(struct tcb *const tcp, kernel_ulong_t addr, unsigned int len,
+ char *laddr)
+{
+ if (tracee_addr_is_invalid(addr))
+ return -1;
+
+ const int pid = tcp->pid;
+
+ if (process_vm_readv_not_supported)
+ return umovestr_peekdata(pid, addr, len, laddr);
+
+ const size_t page_size = get_pagesize();
+ const size_t page_mask = page_size - 1;
+ unsigned int nread = 0;
+
+ while (len) {
+ /*
+ * Don't cross pages, otherwise we can get EFAULT
+ * and fail to notice that terminating NUL lies
+ * in the existing (first) page.
+ */
+ unsigned int chunk_len = len > page_size ? page_size : len;
+ unsigned int end_in_page = (addr + chunk_len) & page_mask;
+ if (chunk_len > end_in_page) /* crosses to the next page */
+ chunk_len -= end_in_page;
+
+ int r = vm_read_mem(pid, laddr, addr, chunk_len);
+ if (r > 0) {
+ char *nul_addr = memchr(laddr, '\0', r);
+
+ if (nul_addr)
+ return (nul_addr - laddr) + 1;
+ addr += r;
+ laddr += r;
+ nread += r;
+ len -= r;
+ continue;
+ }
+ switch (errno) {
+ case ENOSYS:
+ case EPERM:
+ /* try PTRACE_PEEKDATA */
+ if (!nread)
+ return umovestr_peekdata(pid, addr,
+ len, laddr);
+ ATTRIBUTE_FALLTHROUGH;
+ case EFAULT: case EIO:
+ /* address space is inaccessible */
+ if (nread)
+ perror_func_msg("short read (%d < %d)"
+ " @0x%" PRI_klx,
+ nread, nread + len,
+ addr - nread);
+ return -1;
+ case ESRCH:
+ /* the process is gone */
+ return -1;
+ default:
+ /* all the rest is strange and should be reported */
+ perror_func_msg("pid:%d @0x%" PRI_klx, pid, addr);
+ return -1;
+ }
+ }
+
+ return 0;
+}
diff --git a/src/uid.c b/src/uid.c
new file mode 100644
index 000000000..1292f1c83
--- /dev/null
+++ b/src/uid.c
@@ -0,0 +1,184 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993-1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
+ * Copyright (c) 2003-2016 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2014-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifdef STRACE_UID_SIZE
+# if STRACE_UID_SIZE != 16
+# error invalid STRACE_UID_SIZE
+# endif
+
+# define SIZEIFY(x) SIZEIFY_(x, STRACE_UID_SIZE)
+# define SIZEIFY_(x, size) SIZEIFY__(x, size)
+# define SIZEIFY__(x, size) x ## size
+
+# define printuid SIZEIFY(printuid)
+# define sys_chown SIZEIFY(sys_chown)
+# define sys_fchown SIZEIFY(sys_fchown)
+# define sys_getgroups SIZEIFY(sys_getgroups)
+# define sys_getresuid SIZEIFY(sys_getresuid)
+# define sys_getuid SIZEIFY(sys_getuid)
+# define sys_setfsuid SIZEIFY(sys_setfsuid)
+# define sys_setgroups SIZEIFY(sys_setgroups)
+# define sys_setresuid SIZEIFY(sys_setresuid)
+# define sys_setreuid SIZEIFY(sys_setreuid)
+# define sys_setuid SIZEIFY(sys_setuid)
+#endif /* STRACE_UID_SIZE */
+
+#include "defs.h"
+
+#ifdef STRACE_UID_SIZE
+# if !HAVE_ARCH_UID16_SYSCALLS
+# undef STRACE_UID_SIZE
+# endif
+#else
+# define STRACE_UID_SIZE 32
+#endif
+
+#ifdef STRACE_UID_SIZE
+
+# undef uid_t
+# define uid_t uid_t_(STRACE_UID_SIZE)
+# define uid_t_(size) uid_t__(size)
+# define uid_t__(size) uint ## size ## _t
+
+SYS_FUNC(getuid)
+{
+ return RVAL_DECODED;
+}
+
+SYS_FUNC(setfsuid)
+{
+ printuid("", tcp->u_arg[0]);
+
+ return RVAL_DECODED;
+}
+
+SYS_FUNC(setuid)
+{
+ printuid("", tcp->u_arg[0]);
+
+ return RVAL_DECODED;
+}
+
+static void
+get_print_uid(struct tcb *const tcp, const char *const prefix,
+ const kernel_ulong_t addr)
+{
+ uid_t uid;
+
+ tprints(prefix);
+ if (!umove_or_printaddr(tcp, addr, &uid)) {
+ printuid("[", uid);
+ tprints("]");
+ }
+}
+
+SYS_FUNC(getresuid)
+{
+ if (entering(tcp))
+ return 0;
+
+ get_print_uid(tcp, "", tcp->u_arg[0]);
+ get_print_uid(tcp, ", ", tcp->u_arg[1]);
+ get_print_uid(tcp, ", ", tcp->u_arg[2]);
+
+ return 0;
+}
+
+SYS_FUNC(setreuid)
+{
+ printuid("", tcp->u_arg[0]);
+ printuid(", ", tcp->u_arg[1]);
+
+ return RVAL_DECODED;
+}
+
+SYS_FUNC(setresuid)
+{
+ printuid("", tcp->u_arg[0]);
+ printuid(", ", tcp->u_arg[1]);
+ printuid(", ", tcp->u_arg[2]);
+
+ return RVAL_DECODED;
+}
+
+SYS_FUNC(chown)
+{
+ printpath(tcp, tcp->u_arg[0]);
+ printuid(", ", tcp->u_arg[1]);
+ printuid(", ", tcp->u_arg[2]);
+
+ return RVAL_DECODED;
+}
+
+SYS_FUNC(fchown)
+{
+ printfd(tcp, tcp->u_arg[0]);
+ printuid(", ", tcp->u_arg[1]);
+ printuid(", ", tcp->u_arg[2]);
+
+ return RVAL_DECODED;
+}
+
+void
+printuid(const char *text, const unsigned int uid)
+{
+ if ((uid_t) -1U == (uid_t) uid)
+ tprintf("%s-1", text);
+ else
+ tprintf("%s%u", text, (uid_t) uid);
+}
+
+static bool
+print_gid(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data)
+{
+ printuid("", (*(uid_t *) elem_buf));
+
+ return true;
+}
+
+static void
+print_groups(struct tcb *const tcp, const unsigned int len,
+ const kernel_ulong_t addr)
+{
+ static unsigned long ngroups_max;
+ if (!ngroups_max)
+ ngroups_max = sysconf(_SC_NGROUPS_MAX);
+
+ if (len > ngroups_max) {
+ printaddr(addr);
+ return;
+ }
+
+ uid_t gid;
+ print_array(tcp, addr, len, &gid, sizeof(gid),
+ tfetch_mem, print_gid, 0);
+}
+
+SYS_FUNC(setgroups)
+{
+ const int len = tcp->u_arg[0];
+
+ tprintf("%d, ", len);
+ print_groups(tcp, len, tcp->u_arg[1]);
+ return RVAL_DECODED;
+}
+
+SYS_FUNC(getgroups)
+{
+ if (entering(tcp))
+ tprintf("%d, ", (int) tcp->u_arg[0]);
+ else
+ print_groups(tcp, tcp->u_rval, tcp->u_arg[1]);
+ return 0;
+}
+
+#endif /* STRACE_UID_SIZE */
diff --git a/src/uid16.c b/src/uid16.c
new file mode 100644
index 000000000..9502c2d3a
--- /dev/null
+++ b/src/uid16.c
@@ -0,0 +1,9 @@
+/*
+ * Copyright (c) 2014-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#define STRACE_UID_SIZE 16
+#include "uid.c"
diff --git a/src/umask.c b/src/umask.c
new file mode 100644
index 000000000..43de25e19
--- /dev/null
+++ b/src/umask.c
@@ -0,0 +1,15 @@
+/*
+ * Copyright (c) 2014-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+SYS_FUNC(umask)
+{
+ print_numeric_umode_t(tcp->u_arg[0]);
+
+ return RVAL_DECODED | RVAL_OCTAL;
+}
diff --git a/src/umount.c b/src/umount.c
new file mode 100644
index 000000000..7f431654b
--- /dev/null
+++ b/src/umount.c
@@ -0,0 +1,18 @@
+/*
+ * Copyright (c) 2014-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include "xlat/umount_flags.h"
+
+SYS_FUNC(umount2)
+{
+ printpath(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ printflags(umount_flags, tcp->u_arg[1], "MNT_???");
+
+ return RVAL_DECODED;
+}
diff --git a/src/uname.c b/src/uname.c
new file mode 100644
index 000000000..6e804295d
--- /dev/null
+++ b/src/uname.c
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993-1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
+ * Copyright (c) 2012-2015 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2014-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include <sys/utsname.h>
+
+SYS_FUNC(uname)
+{
+ struct utsname uname;
+
+ if (entering(tcp))
+ return 0;
+
+ if (!umove_or_printaddr(tcp, tcp->u_arg[0], &uname)) {
+ tprint_struct_begin();
+ PRINT_FIELD_CSTRING(uname, sysname);
+ tprint_struct_next();
+ PRINT_FIELD_CSTRING(uname, nodename);
+ if (abbrev(tcp)) {
+ tprint_struct_next();
+ tprint_more_data_follows();
+ tprint_struct_end();
+ return 0;
+ }
+ tprint_struct_next();
+ PRINT_FIELD_CSTRING(uname, release);
+ tprint_struct_next();
+ PRINT_FIELD_CSTRING(uname, version);
+ tprint_struct_next();
+ PRINT_FIELD_CSTRING(uname, machine);
+#ifdef HAVE_STRUCT_UTSNAME_DOMAINNAME
+ tprint_struct_next();
+ PRINT_FIELD_CSTRING(uname, domainname);
+#endif
+ tprint_struct_end();
+ }
+
+ return 0;
+}
diff --git a/src/unwind-libdw.c b/src/unwind-libdw.c
new file mode 100644
index 000000000..a16cdce7a
--- /dev/null
+++ b/src/unwind-libdw.c
@@ -0,0 +1,258 @@
+/*
+ * This file is based on a patch submitted by Mark Wielaard <mjw@redhat.com>
+ * to ltrace project:
+ * https://anonscm.debian.org/cgit/collab-maint/ltrace.git/commit/?id=dfefa9f057857735a073ea655f5cb34351032c8e
+ *
+ * It was re-licensed for strace by the original author:
+ * https://lists.strace.io/pipermail/strace-devel/2018-March/008063.html
+ *
+ * Copyright (c) 2014-2018 Mark Wielaard <mjw@redhat.com>
+ * Copyright (c) 2018 Masatake YAMATO <yamato@redhat.com>
+ * Copyright (c) 2018-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include "unwind.h"
+#include "mmap_notify.h"
+#include "static_assert.h"
+#include <elfutils/libdwfl.h>
+
+#define STRACE_UW_CACHE_SIZE 2048
+#define STRACE_UW_CACHE_ASSOC 32
+static_assert(STRACE_UW_CACHE_SIZE % STRACE_UW_CACHE_ASSOC == 0,
+ "STRACE_UW_CACHE_SIZE % STRACE_UW_CACHE_ASSOC != 0");
+
+struct cache_entry {
+ /* key */
+ Dwarf_Addr pc;
+ unsigned long long generation;
+
+ /* value */
+ const char *modname;
+ const char *symname;
+ GElf_Off off;
+ Dwarf_Addr true_offset;
+
+ /* replacement */
+ unsigned long long last_use;
+};
+
+struct ctx {
+ Dwfl *dwfl;
+ unsigned long long last_proc_updating;
+ struct cache_entry cache[STRACE_UW_CACHE_SIZE];
+};
+
+static unsigned long long mapping_generation = 1;
+static unsigned long long uwcache_clock;
+
+static void
+update_mapping_generation(struct tcb *tcp, void *unused)
+{
+ mapping_generation++;
+}
+
+static void
+init(void)
+{
+ mmap_notify_register_client(update_mapping_generation, NULL);
+}
+
+static void *
+tcb_init(struct tcb *tcp)
+{
+ static const Dwfl_Callbacks proc_callbacks = {
+ .find_elf = dwfl_linux_proc_find_elf,
+ .find_debuginfo = dwfl_standard_find_debuginfo
+ };
+
+ Dwfl *dwfl = dwfl_begin(&proc_callbacks);
+ if (dwfl == NULL) {
+ error_msg("dwfl_begin: %s", dwfl_errmsg(-1));
+ return NULL;
+ }
+
+ int r = dwfl_linux_proc_attach(dwfl, tcp->pid, true);
+ if (r) {
+ const char *msg = NULL;
+
+ if (r < 0)
+ msg = dwfl_errmsg(-1);
+ else if (r > 0)
+ msg = strerror(r);
+
+ error_msg("dwfl_linux_proc_attach returned an error"
+ " for process %d: %s", tcp->pid, msg);
+ dwfl_end(dwfl);
+ return NULL;
+ }
+
+ struct ctx *ctx = xmalloc(sizeof(*ctx));
+ ctx->dwfl = dwfl;
+ ctx->last_proc_updating = mapping_generation - 1;
+ memset(ctx->cache, 0, sizeof(ctx->cache));
+ return ctx;
+}
+
+static void
+tcb_fin(struct tcb *tcp)
+{
+ struct ctx *ctx = tcp->unwind_ctx;
+ if (ctx) {
+ dwfl_end(ctx->dwfl);
+ free(ctx);
+ }
+}
+
+static void
+flush_cache_maybe(struct tcb *tcp)
+{
+ struct ctx *ctx = tcp->unwind_ctx;
+ if (!ctx)
+ return;
+
+ if (ctx->last_proc_updating == mapping_generation)
+ return;
+
+ int r = dwfl_linux_proc_report(ctx->dwfl, tcp->pid);
+
+ if (r < 0)
+ error_msg("dwfl_linux_proc_report returned an error"
+ " for pid %d: %s", tcp->pid, dwfl_errmsg(-1));
+ else if (r > 0)
+ error_msg("dwfl_linux_proc_report returned an error"
+ " for pid %d", tcp->pid);
+ else if (dwfl_report_end(ctx->dwfl, NULL, NULL) != 0)
+ error_msg("dwfl_report_end returned an error"
+ " for pid %d: %s", tcp->pid, dwfl_errmsg(-1));
+
+ ctx->last_proc_updating = mapping_generation;
+}
+
+struct frame_user_data {
+ unwind_call_action_fn call_action;
+ unwind_error_action_fn error_action;
+ void *data;
+ int stack_depth;
+ struct ctx *ctx;
+};
+
+static bool
+find_bucket(struct ctx *ctx, Dwarf_Addr pc, struct cache_entry **res) {
+ unsigned int idx = pc & ((STRACE_UW_CACHE_SIZE-1) &
+ ~(STRACE_UW_CACHE_ASSOC-1));
+ struct cache_entry *unused = NULL;
+ struct cache_entry *lru = ctx->cache + idx;
+ for (unsigned int i = 0; i < STRACE_UW_CACHE_ASSOC; ++i) {
+ struct cache_entry *ce = ctx->cache + (idx + i);
+ if (ce->generation == mapping_generation && ce->pc == pc) {
+ ce->last_use = uwcache_clock++;
+ *res = ce;
+ return true;
+ }
+ if (ce->generation != mapping_generation) {
+ unused = ce;
+ continue;
+ }
+ if (ce->last_use < lru->last_use)
+ lru = ce;
+ }
+ *res = unused ? unused : lru;
+
+ return false;
+}
+
+static int
+frame_callback(Dwfl_Frame *state, void *arg)
+{
+ struct frame_user_data *user_data = arg;
+ Dwarf_Addr pc;
+ bool isactivation;
+
+ if (!dwfl_frame_pc(state, &pc, &isactivation)) {
+ /* Propagate the error to the caller. */
+ return -1;
+ }
+
+ if (!isactivation)
+ pc--;
+
+ struct cache_entry *ce;
+ if (find_bucket(user_data->ctx, pc, &ce)) {
+ user_data->call_action(user_data->data,
+ ce->modname, ce->symname,
+ ce->off, ce->true_offset);
+ } else {
+ Dwfl *dwfl = dwfl_thread_dwfl(dwfl_frame_thread(state));
+ Dwfl_Module *mod = dwfl_addrmodule(dwfl, pc);
+ GElf_Off off = 0;
+
+ if (mod != NULL) {
+ const char *modname = NULL;
+ const char *symname = NULL;
+ GElf_Sym sym;
+ Dwarf_Addr true_offset = pc;
+
+ modname = dwfl_module_info(mod, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL);
+ symname = dwfl_module_addrinfo(mod, pc, &off, &sym,
+ NULL, NULL, NULL);
+ dwfl_module_relocate_address(mod, &true_offset);
+ user_data->call_action(user_data->data, modname, symname,
+ off, true_offset);
+
+ ce->generation = mapping_generation;
+ ce->pc = pc;
+ ce->modname = modname;
+ ce->symname = symname;
+ ce->off = off;
+ ce->true_offset = true_offset;
+ ce->last_use = uwcache_clock++;
+ }
+ }
+
+ /* Max number of frames to print reached? */
+ if (user_data->stack_depth-- == 0)
+ return DWARF_CB_ABORT;
+
+ return DWARF_CB_OK;
+}
+
+static void
+tcb_walk(struct tcb *tcp,
+ unwind_call_action_fn call_action,
+ unwind_error_action_fn error_action,
+ void *data)
+{
+ struct ctx *ctx = tcp->unwind_ctx;
+ if (!ctx)
+ return;
+
+ struct frame_user_data user_data = {
+ .call_action = call_action,
+ .error_action = error_action,
+ .data = data,
+ .stack_depth = 256,
+ .ctx = ctx,
+ };
+
+ flush_cache_maybe(tcp);
+
+ int r = dwfl_getthread_frames(ctx->dwfl, tcp->pid, frame_callback,
+ &user_data);
+ if (r)
+ error_action(data,
+ r < 0 ? dwfl_errmsg(-1) : "too many stack frames",
+ 0);
+}
+
+const struct unwind_unwinder_t unwinder = {
+ .name = "libdw",
+ .init = init,
+ .tcb_init = tcb_init,
+ .tcb_fin = tcb_fin,
+ .tcb_walk = tcb_walk,
+};
diff --git a/src/unwind-libunwind.c b/src/unwind-libunwind.c
new file mode 100644
index 000000000..76ec658fe
--- /dev/null
+++ b/src/unwind-libunwind.c
@@ -0,0 +1,170 @@
+/*
+ * Copyright (c) 2013 Luca Clementi <luca.clementi@gmail.com>
+ * Copyright (c) 2013-2018 The strace developers.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include "unwind.h"
+
+#include "mmap_cache.h"
+#include <libunwind-ptrace.h>
+
+static unw_addr_space_t libunwind_as;
+
+static void
+init(void)
+{
+ mmap_cache_enable();
+
+ libunwind_as = unw_create_addr_space(&_UPT_accessors, 0);
+ if (!libunwind_as)
+ error_msg_and_die("failed to create address space"
+ " for stack tracing");
+ unw_set_caching_policy(libunwind_as, UNW_CACHE_GLOBAL);
+}
+
+static void *
+tcb_init(struct tcb *tcp)
+{
+ void *r = _UPT_create(tcp->pid);
+
+ if (!r)
+ perror_msg_and_die("_UPT_create");
+ return r;
+}
+
+static void
+tcb_fin(struct tcb *tcp)
+{
+ _UPT_destroy(tcp->unwind_ctx);
+}
+
+static void
+get_symbol_name(unw_cursor_t *cursor, char **name,
+ size_t *size, unw_word_t *offset)
+{
+ for (;;) {
+ int rc = unw_get_proc_name(cursor, *name, *size, offset);
+
+ if (rc == 0)
+ break;
+ if (rc != -UNW_ENOMEM) {
+ **name = '\0';
+ *offset = 0;
+ break;
+ }
+ *name = xgrowarray(*name, size, 1);
+ }
+}
+
+static int
+print_stack_frame(struct tcb *tcp,
+ unwind_call_action_fn call_action,
+ unwind_error_action_fn error_action,
+ void *data,
+ unw_cursor_t *cursor,
+ char **symbol_name,
+ size_t *symbol_name_size)
+{
+ unw_word_t ip;
+
+ if (unw_get_reg(cursor, UNW_REG_IP, &ip) < 0) {
+ perror_msg("cannot walk the stack of process %d", tcp->pid);
+ return -1;
+ }
+
+ struct mmap_cache_entry_t *entry = mmap_cache_search(tcp, ip);
+
+ if (entry
+ /* ignore mappings that have no PROT_EXEC bit set */
+ && (entry->protections & MMAP_CACHE_PROT_EXECUTABLE)) {
+ unw_word_t function_offset;
+
+ get_symbol_name(cursor, symbol_name, symbol_name_size,
+ &function_offset);
+ unsigned long true_offset =
+ ip - entry->start_addr + entry->mmap_offset;
+ call_action(data,
+ entry->binary_filename,
+ *symbol_name,
+ function_offset,
+ true_offset);
+
+ return 0;
+ }
+
+ /*
+ * there is a bug in libunwind >= 1.0
+ * after a set_tid_address syscall
+ * unw_get_reg returns IP == 0
+ */
+ if (ip)
+ error_action(data, "unexpected_backtracing_error", ip);
+ return -1;
+}
+
+static void
+walk(struct tcb *tcp,
+ unwind_call_action_fn call_action,
+ unwind_error_action_fn error_action,
+ void *data)
+{
+ char *symbol_name;
+ size_t symbol_name_size = 40;
+ unw_cursor_t cursor;
+ int stack_depth;
+
+ if (!tcp->mmap_cache)
+ error_func_msg_and_die("mmap_cache is NULL");
+
+ symbol_name = xmalloc(symbol_name_size);
+
+ if (unw_init_remote(&cursor, libunwind_as, tcp->unwind_ctx) < 0)
+ perror_func_msg_and_die("cannot initialize libunwind");
+
+ for (stack_depth = 0; stack_depth < 256; ++stack_depth) {
+ if (print_stack_frame(tcp, call_action, error_action, data,
+ &cursor, &symbol_name, &symbol_name_size) < 0)
+ break;
+ if (unw_step(&cursor) <= 0)
+ break;
+ }
+ if (stack_depth >= 256)
+ error_action(data, "too many stack frames", 0);
+
+ free(symbol_name);
+}
+
+static void
+tcb_walk(struct tcb *tcp,
+ unwind_call_action_fn call_action,
+ unwind_error_action_fn error_action,
+ void *data)
+{
+ switch (mmap_cache_rebuild_if_invalid(tcp, __func__)) {
+ case MMAP_CACHE_REBUILD_RENEWED:
+ /*
+ * Rebuild the unwinder internal cache.
+ * Called when mmap cache subsystem detects a
+ * change of tracee memory mapping.
+ */
+ unw_flush_cache(libunwind_as, 0, 0);
+ ATTRIBUTE_FALLTHROUGH;
+ case MMAP_CACHE_REBUILD_READY:
+ walk(tcp, call_action, error_action, data);
+ break;
+ default:
+ /* Do nothing */
+ ;
+ }
+}
+
+const struct unwind_unwinder_t unwinder = {
+ .name = "libunwind",
+ .init = init,
+ .tcb_init = tcb_init,
+ .tcb_fin = tcb_fin,
+ .tcb_walk = tcb_walk,
+};
diff --git a/src/unwind.c b/src/unwind.c
new file mode 100644
index 000000000..3d854d0e8
--- /dev/null
+++ b/src/unwind.c
@@ -0,0 +1,301 @@
+/*
+ * Copyright (c) 2013 Luca Clementi <luca.clementi@gmail.com>
+ * Copyright (c) 2013-2020 The strace developers.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include "unwind.h"
+
+#ifdef USE_DEMANGLE
+# if defined HAVE_DEMANGLE_H
+# include <demangle.h>
+# elif defined HAVE_LIBIBERTY_DEMANGLE_H
+# include <libiberty/demangle.h>
+# endif
+#endif
+
+/*
+ * Type used in stacktrace capturing
+ */
+struct call_t {
+ struct call_t *next;
+ char *output_line;
+};
+
+struct unwind_queue_t {
+ struct call_t *tail;
+ struct call_t *head;
+};
+
+static void queue_print(struct unwind_queue_t *queue);
+
+static const char asprintf_error_str[] = "???";
+
+void
+unwind_init(void)
+{
+ if (unwinder.init)
+ unwinder.init();
+}
+
+void
+unwind_tcb_init(struct tcb *tcp)
+{
+ if (tcp->unwind_queue)
+ return;
+
+ tcp->unwind_queue = xmalloc(sizeof(*tcp->unwind_queue));
+ tcp->unwind_queue->head = NULL;
+ tcp->unwind_queue->tail = NULL;
+
+ tcp->unwind_ctx = unwinder.tcb_init(tcp);
+}
+
+void
+unwind_tcb_fin(struct tcb *tcp)
+{
+ if (!tcp->unwind_queue)
+ return;
+
+ queue_print(tcp->unwind_queue);
+ free(tcp->unwind_queue);
+ tcp->unwind_queue = NULL;
+
+ unwinder.tcb_fin(tcp);
+ tcp->unwind_ctx = NULL;
+}
+
+/*
+ * printing an entry in stack to stream or buffer
+ */
+/*
+ * we want to keep the format used by backtrace_symbols from the glibc
+ *
+ * ./a.out() [0x40063d]
+ * ./a.out() [0x4006bb]
+ * ./a.out() [0x4006c6]
+ * /lib64/libc.so.6(__libc_start_main+0xed) [0x7fa2f8a5976d]
+ * ./a.out() [0x400569]
+ */
+#define STACK_ENTRY_SYMBOL_FMT(SYM) \
+ " > %s(%s+0x%lx) [0x%lx]\n", \
+ binary_filename, \
+ (SYM), \
+ (unsigned long) function_offset, \
+ true_offset
+#define STACK_ENTRY_NOSYMBOL_FMT \
+ " > %s() [0x%lx]\n", \
+ binary_filename, true_offset
+#define STACK_ENTRY_BUG_FMT \
+ " > BUG IN %s\n"
+#define STACK_ENTRY_ERROR_WITH_OFFSET_FMT \
+ " > %s [0x%lx]\n", error, true_offset
+#define STACK_ENTRY_ERROR_FMT \
+ " > %s\n", error
+
+static void
+print_call_cb(void *dummy,
+ const char *binary_filename,
+ const char *symbol_name,
+ unwind_function_offset_t function_offset,
+ unsigned long true_offset)
+{
+ if (symbol_name && (symbol_name[0] != '\0')) {
+#ifdef USE_DEMANGLE
+ char *demangled_name =
+ cplus_demangle(symbol_name,
+ DMGL_AUTO | DMGL_PARAMS);
+#endif
+ tprintf(STACK_ENTRY_SYMBOL_FMT(
+#ifdef USE_DEMANGLE
+ demangled_name ? demangled_name :
+#endif
+ symbol_name));
+#ifdef USE_DEMANGLE
+ free(demangled_name);
+#endif
+ }
+ else if (binary_filename)
+ tprintf(STACK_ENTRY_NOSYMBOL_FMT);
+ else
+ tprintf(STACK_ENTRY_BUG_FMT, __func__);
+
+ line_ended();
+}
+
+static void
+print_error_cb(void *dummy,
+ const char *error,
+ unsigned long true_offset)
+{
+ if (true_offset)
+ tprintf(STACK_ENTRY_ERROR_WITH_OFFSET_FMT);
+ else
+ tprintf(STACK_ENTRY_ERROR_FMT);
+
+ line_ended();
+}
+
+static char *
+sprint_call_or_error(const char *binary_filename,
+ const char *symbol_name,
+ unwind_function_offset_t function_offset,
+ unsigned long true_offset,
+ const char *error)
+{
+ char *output_line = NULL;
+ int n;
+
+ if (symbol_name) {
+#ifdef USE_DEMANGLE
+ char *demangled_name =
+ cplus_demangle(symbol_name,
+ DMGL_AUTO | DMGL_PARAMS);
+#endif
+ n = asprintf(&output_line,
+ STACK_ENTRY_SYMBOL_FMT(
+#ifdef USE_DEMANGLE
+ demangled_name ? demangled_name :
+#endif
+ symbol_name));
+#ifdef USE_DEMANGLE
+ free(demangled_name);
+#endif
+ }
+ else if (binary_filename)
+ n = asprintf(&output_line, STACK_ENTRY_NOSYMBOL_FMT);
+ else if (error)
+ n = true_offset
+ ? asprintf(&output_line, STACK_ENTRY_ERROR_WITH_OFFSET_FMT)
+ : asprintf(&output_line, STACK_ENTRY_ERROR_FMT);
+ else
+ n = asprintf(&output_line, STACK_ENTRY_BUG_FMT, __func__);
+
+ if (n < 0) {
+ perror_func_msg("asprintf");
+ output_line = (char *) asprintf_error_str;
+ }
+
+ return output_line;
+}
+
+/*
+ * queue manipulators
+ */
+static void
+queue_put(struct unwind_queue_t *queue,
+ const char *binary_filename,
+ const char *symbol_name,
+ unwind_function_offset_t function_offset,
+ unsigned long true_offset,
+ const char *error)
+{
+ struct call_t *call;
+
+ call = xmalloc(sizeof(*call));
+ call->output_line = sprint_call_or_error(binary_filename,
+ symbol_name,
+ function_offset,
+ true_offset,
+ error);
+ call->next = NULL;
+
+ if (!queue->head) {
+ queue->head = call;
+ queue->tail = call;
+ } else {
+ queue->tail->next = call;
+ queue->tail = call;
+ }
+}
+
+static void
+queue_put_call(void *queue,
+ const char *binary_filename,
+ const char *symbol_name,
+ unwind_function_offset_t function_offset,
+ unsigned long true_offset)
+{
+ queue_put(queue,
+ binary_filename,
+ symbol_name,
+ function_offset,
+ true_offset,
+ NULL);
+}
+
+static void
+queue_put_error(void *queue,
+ const char *error,
+ unsigned long ip)
+{
+ queue_put(queue, NULL, NULL, 0, ip, error);
+}
+
+static void
+queue_print(struct unwind_queue_t *queue)
+{
+ struct call_t *call, *tmp;
+
+ queue->tail = NULL;
+ call = queue->head;
+ queue->head = NULL;
+ while (call) {
+ tmp = call;
+ call = call->next;
+
+ tprints(tmp->output_line);
+ line_ended();
+
+ if (tmp->output_line != asprintf_error_str)
+ free(tmp->output_line);
+
+ tmp->output_line = NULL;
+ tmp->next = NULL;
+ free(tmp);
+ }
+}
+
+/*
+ * printing stack
+ */
+void
+unwind_tcb_print(struct tcb *tcp)
+{
+#if defined(USE_LIBUNWIND) && (SUPPORTED_PERSONALITIES > 1)
+ if (tcp->currpers != DEFAULT_PERSONALITY) {
+ /* disable stack trace */
+ return;
+ }
+#endif
+ if (tcp->unwind_queue->head) {
+ debug_func_msg("head: tcp=%p, queue=%p",
+ tcp, tcp->unwind_queue->head);
+ queue_print(tcp->unwind_queue);
+ } else
+ unwinder.tcb_walk(tcp, print_call_cb, print_error_cb, NULL);
+}
+
+/*
+ * capturing stack
+ */
+void
+unwind_tcb_capture(struct tcb *tcp)
+{
+#if defined(USE_LIBUNWIND) && (SUPPORTED_PERSONALITIES > 1)
+ if (tcp->currpers != DEFAULT_PERSONALITY) {
+ /* disable stack trace */
+ return;
+ }
+#endif
+ if (tcp->unwind_queue->head)
+ error_msg_and_die("bug: unprinted entries in queue");
+ else {
+ debug_func_msg("walk: tcp=%p, queue=%p",
+ tcp, tcp->unwind_queue->head);
+ unwinder.tcb_walk(tcp, queue_put_call, queue_put_error,
+ tcp->unwind_queue);
+ }
+}
diff --git a/src/unwind.h b/src/unwind.h
new file mode 100644
index 000000000..1cf4c367b
--- /dev/null
+++ b/src/unwind.h
@@ -0,0 +1,50 @@
+/*
+ * Unwinder backends interface.
+ *
+ * Copyright (c) 2013 Luca Clementi <luca.clementi@gmail.com>
+ * Copyright (c) 2013-2018 The strace developers.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_UNWIND_H
+# define STRACE_UNWIND_H
+
+# include "defs.h"
+
+/*
+ * Type used in stacktrace walker.
+ */
+
+/* This storage be enough large to store unw_word_t. */
+typedef unsigned long unwind_function_offset_t;
+
+typedef void (*unwind_call_action_fn)(void *data,
+ const char *binary_filename,
+ const char *symbol_name,
+ unwind_function_offset_t function_offset,
+ unsigned long true_offset);
+typedef void (*unwind_error_action_fn)(void *data,
+ const char *error,
+ unsigned long true_offset);
+
+struct unwind_unwinder_t {
+ const char *name;
+
+ /* Initialize the unwinder. */
+ void (*init)(void);
+
+ /* Make/destroy the context data attached to tcb. */
+ void * (*tcb_init)(struct tcb *);
+ void (*tcb_fin)(struct tcb *);
+
+ /* Walk the stack. */
+ void (*tcb_walk)(struct tcb *,
+ unwind_call_action_fn,
+ unwind_error_action_fn,
+ void *);
+};
+
+extern const struct unwind_unwinder_t unwinder;
+
+#endif /* !STRACE_UNWIND_H */
diff --git a/src/upeek.c b/src/upeek.c
new file mode 100644
index 000000000..b28b73cc4
--- /dev/null
+++ b/src/upeek.c
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
+ * Copyright (c) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation
+ * Linux for s390 port by D.J. Barrow
+ * <barrow_dj@mail.yahoo.com,djbarrow@de.ibm.com>
+ * Copyright (c) 1999-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include "ptrace.h"
+
+int
+upeek(struct tcb *tcp, unsigned long off, kernel_ulong_t *res)
+{
+ long val;
+
+ errno = 0;
+ val = ptrace(PTRACE_PEEKUSER, (pid_t) tcp->pid, (void *) off, 0);
+ if (val == -1 && errno) {
+ if (errno != ESRCH)
+ perror_func_msg("PTRACE_PEEKUSER pid:%d @0x%lx)",
+ tcp->pid, off);
+ return -1;
+ }
+ *res = (unsigned long) val;
+ return 0;
+}
diff --git a/src/upoke.c b/src/upoke.c
new file mode 100644
index 000000000..b657b1a12
--- /dev/null
+++ b/src/upoke.c
@@ -0,0 +1,23 @@
+/*
+ * Copyright (c) 2016 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2016-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include "ptrace.h"
+#include "ptrace_pokeuser.c"
+
+int
+upoke(struct tcb *tcp, unsigned long off, kernel_ulong_t val)
+{
+ if (ptrace_pokeuser(tcp->pid, off, val) < 0) {
+ if (errno != ESRCH)
+ perror_func_msg("PTRACE_POKEUSER pid:%d @%#lx)",
+ tcp->pid, off);
+ return -1;
+ }
+ return 0;
+}
diff --git a/src/userfaultfd.c b/src/userfaultfd.c
new file mode 100644
index 000000000..2b6c07657
--- /dev/null
+++ b/src/userfaultfd.c
@@ -0,0 +1,195 @@
+/*
+ * Copyright (c) 2015 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2015-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include <fcntl.h>
+
+#include "xlat/uffd_flags.h"
+
+SYS_FUNC(userfaultfd)
+{
+ printflags(uffd_flags, tcp->u_arg[0], "UFFD_???");
+
+ return RVAL_DECODED | RVAL_FD;
+}
+
+#ifdef HAVE_LINUX_USERFAULTFD_H
+# include <linux/ioctl.h>
+# include <linux/userfaultfd.h>
+
+# include "xlat/uffd_api_features.h"
+# include "xlat/uffd_api_flags.h"
+# include "xlat/uffd_copy_flags.h"
+# include "xlat/uffd_register_ioctl_flags.h"
+# include "xlat/uffd_register_mode_flags.h"
+# include "xlat/uffd_zeropage_flags.h"
+
+static void
+tprintf_uffdio_range(const struct uffdio_range *range)
+{
+ tprint_struct_begin();
+ PRINT_FIELD_X(*range, start);
+ tprint_struct_next();
+ PRINT_FIELD_X(*range, len);
+ tprint_struct_end();
+}
+
+int
+uffdio_ioctl(struct tcb *const tcp, const unsigned int code,
+ const kernel_ulong_t arg)
+{
+ switch (code) {
+ case UFFDIO_API: {
+ uint64_t *entering_features;
+ struct uffdio_api ua;
+
+ if (entering(tcp)) {
+ tprints(", ");
+ if (umove_or_printaddr(tcp, arg, &ua))
+ break;
+ tprint_struct_begin();
+ PRINT_FIELD_X(ua, api);
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(ua, features, uffd_api_features,
+ "UFFD_FEATURE_???");
+ entering_features = malloc(sizeof(*entering_features));
+ if (entering_features) {
+ *entering_features = ua.features;
+ set_tcb_priv_data(tcp, entering_features, free);
+ }
+
+ return 0;
+ }
+
+ if (!syserror(tcp) && !umove(tcp, arg, &ua)) {
+ entering_features = get_tcb_priv_data(tcp);
+
+ if (!entering_features
+ || *entering_features != ua.features) {
+ tprint_value_changed();
+ PRINT_FIELD_FLAGS(ua, features,
+ uffd_api_features,
+ "UFFD_FEATURE_???");
+ }
+
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(ua, ioctls, uffd_api_flags,
+ "_UFFDIO_???");
+ }
+
+ tprint_struct_end();
+
+ break;
+ }
+
+ case UFFDIO_COPY: {
+ struct uffdio_copy uc;
+
+ if (entering(tcp)) {
+ tprints(", ");
+ if (umove_or_printaddr(tcp, arg, &uc))
+ return RVAL_IOCTL_DECODED;
+ tprint_struct_begin();
+ PRINT_FIELD_X(uc, dst);
+ tprint_struct_next();
+ PRINT_FIELD_X(uc, src);
+ tprint_struct_next();
+ PRINT_FIELD_X(uc, len);
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(uc, mode, uffd_copy_flags,
+ "UFFDIO_COPY_???");
+
+ return 0;
+ }
+
+ if (!syserror(tcp) && !umove(tcp, arg, &uc)) {
+ tprint_struct_next();
+ PRINT_FIELD_X(uc, copy);
+ }
+
+ tprint_struct_end();
+
+ break;
+ }
+
+ case UFFDIO_REGISTER: {
+ struct uffdio_register ur;
+
+ if (entering(tcp)) {
+ tprints(", ");
+ if (umove_or_printaddr(tcp, arg, &ur))
+ return RVAL_IOCTL_DECODED;
+ tprint_struct_begin();
+ PRINT_FIELD_OBJ_PTR(ur, range,
+ tprintf_uffdio_range);
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(ur, mode,
+ uffd_register_mode_flags,
+ "UFFDIO_REGISTER_MODE_???");
+
+ return 0;
+ }
+
+ if (!syserror(tcp) && !umove(tcp, arg, &ur)) {
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(ur, ioctls,
+ uffd_register_ioctl_flags,
+ "UFFDIO_???");
+ }
+
+ tprint_struct_end();
+
+ break;
+ }
+
+ case UFFDIO_UNREGISTER:
+ case UFFDIO_WAKE: {
+ struct uffdio_range ura;
+
+ tprints(", ");
+
+ if (!umove_or_printaddr(tcp, arg, &ura))
+ tprintf_uffdio_range(&ura);
+
+ break;
+ }
+
+ case UFFDIO_ZEROPAGE: {
+ struct uffdio_zeropage uz;
+
+ if (entering(tcp)) {
+ tprints(", ");
+ if (umove_or_printaddr(tcp, arg, &uz))
+ return RVAL_IOCTL_DECODED;
+ tprint_struct_begin();
+ PRINT_FIELD_OBJ_PTR(uz, range,
+ tprintf_uffdio_range);
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(uz, mode, uffd_zeropage_flags,
+ "UFFDIO_ZEROPAGE_???");
+
+ return 0;
+ }
+
+ if (!syserror(tcp) && !umove(tcp, arg, &uz)) {
+ tprint_struct_next();
+ PRINT_FIELD_X(uz, zeropage);
+ }
+
+ tprint_struct_end();
+
+ break;
+ }
+
+ default:
+ return RVAL_DECODED;
+ }
+
+ return RVAL_IOCTL_DECODED;
+}
+#endif /* HAVE_LINUX_USERFAULTFD_H */
diff --git a/src/ustat.c b/src/ustat.c
new file mode 100644
index 000000000..f69951e89
--- /dev/null
+++ b/src/ustat.c
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2017 JingPiao Chen <chenjingpiao@gmail.com>
+ * Copyright (c) 2017-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#ifdef HAVE_USTAT_H
+# include DEF_MPERS_TYPE(struct_ustat)
+# include <ustat.h>
+typedef struct ustat struct_ustat;
+#endif /* HAVE_USTAT_H */
+
+#include MPERS_DEFS
+
+SYS_FUNC(ustat)
+{
+ if (entering(tcp))
+ print_dev_t((unsigned int) tcp->u_arg[0]);
+ else {
+ tprints(", ");
+#ifdef HAVE_USTAT_H
+ struct_ustat ust;
+
+ if (!umove_or_printaddr(tcp, tcp->u_arg[1], &ust)) {
+ tprint_struct_begin();
+ PRINT_FIELD_U(ust, f_tfree);
+ tprint_struct_next();
+ PRINT_FIELD_U(ust, f_tinode);
+ tprint_struct_end();
+ }
+#else /* !HAVE_USTAT_H */
+ printaddr(tcp->u_arg[1]);
+#endif /* HAVE_USTAT_H */
+ }
+
+ return 0;
+}
diff --git a/src/util.c b/src/util.c
new file mode 100644
index 000000000..bb88376ab
--- /dev/null
+++ b/src/util.c
@@ -0,0 +1,1587 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
+ * Copyright (c) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation
+ * Linux for s390 port by D.J. Barrow
+ * <barrow_dj@mail.yahoo.com,djbarrow@de.ibm.com>
+ * Copyright (c) 1999-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include <limits.h>
+#include <fcntl.h>
+#include <stdarg.h>
+#include <sys/stat.h>
+#include <sys/sysmacros.h>
+#ifdef HAVE_SYS_XATTR_H
+# include <sys/xattr.h>
+#endif
+#include <sys/uio.h>
+
+#include "largefile_wrappers.h"
+#include "number_set.h"
+#include "print_utils.h"
+#include "static_assert.h"
+#include "string_to_uint.h"
+#include "xlat.h"
+#include "xstring.h"
+
+const struct xlat_data *
+find_xlat_val_ex(const struct xlat_data *items, const char *s, size_t num_items,
+ unsigned int flags)
+{
+ for (size_t i = 0; i < num_items; i++) {
+ if (!(flags & FXL_CASE_SENSITIVE ? strcmp
+ : strcasecmp)(items[i].str, s))
+ return items + i;
+ }
+
+ return NULL;
+}
+
+uint64_t
+find_arg_val_(const char *arg, const struct xlat_data *strs, size_t strs_size,
+ uint64_t default_val, uint64_t not_found)
+{
+ if (!arg)
+ return default_val;
+
+ const struct xlat_data *res = find_xlat_val_ex(strs, arg, strs_size, 0);
+
+ return res ? res->val : not_found;
+}
+
+int
+str2timescale_ex(const char *arg, int empty_dflt, int null_dflt,
+ int *width)
+{
+ static const struct xlat_data units[] = {
+ { 1000000000U | (0ULL << 32), "s" },
+ { 1000000U | (3ULL << 32), "ms" },
+ { 1000U | (6ULL << 32), "us" },
+ { 1U | (9ULL << 32), "ns" },
+ };
+
+ if (!arg)
+ return null_dflt;
+ if (!arg[0])
+ return empty_dflt;
+
+ uint64_t res = find_arg_val(arg, units, null_dflt, -1ULL);
+
+ if (width && res != -1ULL)
+ *width = res >> 32;
+
+ return res & 0xffffffff;
+}
+
+int
+ts_nz(const struct timespec *a)
+{
+ return a->tv_sec || a->tv_nsec;
+}
+
+int
+ts_cmp(const struct timespec *a, const struct timespec *b)
+{
+ if (a->tv_sec < b->tv_sec
+ || (a->tv_sec == b->tv_sec && a->tv_nsec < b->tv_nsec))
+ return -1;
+ if (a->tv_sec > b->tv_sec
+ || (a->tv_sec == b->tv_sec && a->tv_nsec > b->tv_nsec))
+ return 1;
+ return 0;
+}
+
+double
+ts_float(const struct timespec *tv)
+{
+ return tv->tv_sec + tv->tv_nsec/1000000000.0;
+}
+
+void
+ts_add(struct timespec *tv, const struct timespec *a, const struct timespec *b)
+{
+ tv->tv_sec = a->tv_sec + b->tv_sec;
+ tv->tv_nsec = a->tv_nsec + b->tv_nsec;
+ if (tv->tv_nsec >= 1000000000) {
+ tv->tv_sec++;
+ tv->tv_nsec -= 1000000000;
+ }
+}
+
+void
+ts_sub(struct timespec *tv, const struct timespec *a, const struct timespec *b)
+{
+ tv->tv_sec = a->tv_sec - b->tv_sec;
+ tv->tv_nsec = a->tv_nsec - b->tv_nsec;
+ if (tv->tv_nsec < 0) {
+ tv->tv_sec--;
+ tv->tv_nsec += 1000000000;
+ }
+}
+
+void
+ts_div(struct timespec *tv, const struct timespec *a, uint64_t n)
+{
+ long long nsec = (a->tv_sec % n * 1000000000LL + a->tv_nsec + n / 2) / n;
+ tv->tv_sec = a->tv_sec / n + nsec / 1000000000;
+ tv->tv_nsec = nsec % 1000000000;
+}
+
+void
+ts_mul(struct timespec *tv, const struct timespec *a, uint64_t n)
+{
+ long long nsec = a->tv_nsec * n;
+ tv->tv_sec = a->tv_sec * n + nsec / 1000000000;
+ tv->tv_nsec = nsec % 1000000000;
+}
+
+const struct timespec *
+ts_min(const struct timespec *a, const struct timespec *b)
+{
+ return ts_cmp(a, b) < 0 ? a : b;
+}
+
+const struct timespec *
+ts_max(const struct timespec *a, const struct timespec *b)
+{
+ return ts_cmp(a, b) > 0 ? a : b;
+}
+
+int
+parse_ts(const char *s, struct timespec *t)
+{
+ enum { NS_IN_S = 1000000000 };
+
+ static const char float_accept[] = "eE.-+0123456789";
+ static const char int_accept[] = "+0123456789";
+
+ size_t float_len = strspn(s, float_accept);
+ size_t int_len = strspn(s, int_accept);
+ char *endptr = NULL;
+ double float_val = -1;
+ long long int_val = -1;
+
+ if (float_len > int_len) {
+ errno = 0;
+
+ float_val = strtod(s, &endptr);
+
+ if (endptr == s || errno)
+ return -1;
+ if (float_val < 0)
+ return -1;
+ } else {
+ int_val = string_to_uint_ex(s, &endptr, LLONG_MAX, "smun");
+
+ if (int_val < 0)
+ return -1;
+ }
+
+ int scale = str2timescale_sfx(endptr, NULL);
+ if (scale <= 0)
+ return -1;
+
+ if (float_len > int_len) {
+ t->tv_sec = float_val / (NS_IN_S / scale);
+ t->tv_nsec = ((uint64_t) ((float_val -
+ (t->tv_sec * (NS_IN_S / scale)))
+ * scale)) % NS_IN_S;
+ } else {
+ t->tv_sec = int_val / (NS_IN_S / scale);
+ t->tv_nsec = (int_val % (NS_IN_S / scale)) * scale;
+ }
+
+ return 0;
+}
+
+#if !defined HAVE_STPCPY
+char *
+stpcpy(char *dst, const char *src)
+{
+ while ((*dst = *src++) != '\0')
+ dst++;
+ return dst;
+}
+#endif
+
+/* Find a next bit which is set.
+ * Starts testing at cur_bit.
+ * Returns -1 if no more bits are set.
+ *
+ * We never touch bytes we don't need to.
+ * On big-endian, array is assumed to consist of
+ * current_wordsize wide words: for example, is current_wordsize is 4,
+ * the bytes are walked in 3,2,1,0, 7,6,5,4, 11,10,9,8 ... sequence.
+ * On little-endian machines, word size is immaterial.
+ */
+int
+next_set_bit(const void *bit_array, unsigned cur_bit, unsigned size_bits)
+{
+ const unsigned endian = 1;
+ int little_endian = *(char *) (void *) &endian;
+
+ const uint8_t *array = bit_array;
+ unsigned pos = cur_bit / 8;
+ unsigned pos_xor_mask = little_endian ? 0 : current_wordsize-1;
+
+ for (;;) {
+ uint8_t bitmask;
+ uint8_t cur_byte;
+
+ if (cur_bit >= size_bits)
+ return -1;
+ cur_byte = array[pos ^ pos_xor_mask];
+ if (cur_byte == 0) {
+ cur_bit = (cur_bit + 8) & (-8);
+ pos++;
+ continue;
+ }
+ bitmask = 1 << (cur_bit & 7);
+ for (;;) {
+ if (cur_byte & bitmask)
+ return cur_bit;
+ cur_bit++;
+ if (cur_bit >= size_bits)
+ return -1;
+ bitmask <<= 1;
+ /* This check *can't be* optimized out: */
+ if (bitmask == 0)
+ break;
+ }
+ pos++;
+ }
+}
+
+/*
+ * Fetch 64bit argument at position arg_no and
+ * return the index of the next argument.
+ */
+int
+getllval(struct tcb *tcp, unsigned long long *val, int arg_no)
+{
+#if SIZEOF_KERNEL_LONG_T > 4
+# ifndef current_klongsize
+ if (current_klongsize < SIZEOF_KERNEL_LONG_T) {
+# if defined(AARCH64) || defined(POWERPC64) || defined(POWERPC64LE)
+ /* Align arg_no to the next even number. */
+ arg_no = (arg_no + 1) & 0xe;
+# endif /* AARCH64 || POWERPC64 || POWERPC64LE */
+ *val = ULONG_LONG(tcp->u_arg[arg_no], tcp->u_arg[arg_no + 1]);
+ arg_no += 2;
+ } else
+# endif /* !current_klongsize */
+ {
+ *val = tcp->u_arg[arg_no];
+ arg_no++;
+ }
+#else /* SIZEOF_KERNEL_LONG_T == 4 */
+# if defined __ARM_EABI__ \
+ || defined LINUX_MIPSO32 \
+ || defined POWERPC \
+ || defined XTENSA
+ /* Align arg_no to the next even number. */
+ arg_no = (arg_no + 1) & 0xe;
+# elif defined SH
+ /*
+ * The SH4 ABI does allow long longs in odd-numbered registers, but
+ * does not allow them to be split between registers and memory - and
+ * there are only four argument registers for normal functions. As a
+ * result, pread, for example, takes an extra padding argument before
+ * the offset. This was changed late in the 2.4 series (around 2.4.20).
+ */
+ if (arg_no == 3)
+ arg_no++;
+# endif /* __ARM_EABI__ || LINUX_MIPSO32 || POWERPC || XTENSA || SH */
+ *val = ULONG_LONG(tcp->u_arg[arg_no], tcp->u_arg[arg_no + 1]);
+ arg_no += 2;
+#endif
+
+ return arg_no;
+}
+
+/*
+ * Print 64bit argument at position arg_no and
+ * return the index of the next argument.
+ */
+int
+printllval(struct tcb *tcp, const char *format, int arg_no)
+{
+ unsigned long long val = 0;
+
+ arg_no = getllval(tcp, &val, arg_no);
+ tprintf(format, val);
+ return arg_no;
+}
+
+void
+printaddr64(const uint64_t addr)
+{
+ if (!addr)
+ tprints("NULL");
+ else
+ tprintf("%#" PRIx64, addr);
+}
+
+#define DEF_PRINTNUM(name, type) \
+bool \
+printnum_ ## name(struct tcb *const tcp, const kernel_ulong_t addr, \
+ const char *const fmt) \
+{ \
+ type num; \
+ if (umove_or_printaddr(tcp, addr, &num)) \
+ return false; \
+ tprints("["); \
+ tprintf(fmt, num); \
+ tprints("]"); \
+ return true; \
+}
+
+#define DEF_PRINTNUM_ADDR(name, type) \
+bool \
+printnum_addr_ ## name(struct tcb *tcp, const kernel_ulong_t addr) \
+{ \
+ type num; \
+ if (umove_or_printaddr(tcp, addr, &num)) \
+ return false; \
+ tprints("["); \
+ printaddr64(num); \
+ tprints("]"); \
+ return true; \
+}
+
+#define DEF_PRINTPAIR(name, type) \
+bool \
+printpair_ ## name(struct tcb *const tcp, const kernel_ulong_t addr, \
+ const char *const fmt) \
+{ \
+ type pair[2]; \
+ if (umove_or_printaddr(tcp, addr, &pair)) \
+ return false; \
+ tprints("["); \
+ tprintf(fmt, pair[0]); \
+ tprints(", "); \
+ tprintf(fmt, pair[1]); \
+ tprints("]"); \
+ return true; \
+}
+
+DEF_PRINTNUM(int, int)
+DEF_PRINTNUM_ADDR(int, unsigned int)
+DEF_PRINTPAIR(int, int)
+DEF_PRINTNUM(short, short)
+DEF_PRINTNUM(int64, uint64_t)
+DEF_PRINTNUM_ADDR(int64, uint64_t)
+DEF_PRINTPAIR(int64, uint64_t)
+
+bool
+printnum_fd(struct tcb *const tcp, const kernel_ulong_t addr)
+{
+ int fd;
+ if (umove_or_printaddr(tcp, addr, &fd))
+ return false;
+ tprints("[");
+ printfd(tcp, fd);
+ tprints("]");
+ return true;
+}
+
+bool
+printnum_pid(struct tcb *const tcp, const kernel_ulong_t addr, enum pid_type type)
+{
+ int pid;
+ if (umove_or_printaddr(tcp, addr, &pid))
+ return false;
+ tprints("[");
+ printpid(tcp, pid, type);
+ tprints("]");
+ return true;
+}
+
+/**
+ * Prints time to a (static internal) buffer and returns pointer to it.
+ * Returns NULL if the provided time specification is not correct.
+ *
+ * @param sec Seconds since epoch.
+ * @param part_sec Amount of second parts since the start of a second.
+ * @param max_part_sec Maximum value of a valid part_sec.
+ * @param width 1 + floor(log10(max_part_sec)).
+ * @return Pointer to a statically allocated string on success,
+ * NULL on error.
+ */
+static const char *
+sprinttime_ex(const long long sec, const unsigned long long part_sec,
+ const unsigned int max_part_sec, const int width)
+{
+ static char buf[sizeof(int) * 3 * 6 + sizeof(part_sec) * 3
+ + sizeof("+0000")];
+
+ if ((sec == 0 && part_sec == 0) || part_sec > max_part_sec)
+ return NULL;
+
+ time_t t = (time_t) sec;
+ struct tm *tmp = (sec == t) ? localtime(&t) : NULL;
+ if (!tmp)
+ return NULL;
+
+ size_t pos = strftime(buf, sizeof(buf), "%FT%T", tmp);
+ if (!pos)
+ return NULL;
+
+ if (part_sec > 0)
+ pos += xsnprintf(buf + pos, sizeof(buf) - pos, ".%0*llu",
+ width, part_sec);
+
+ return strftime(buf + pos, sizeof(buf) - pos, "%z", tmp) ? buf : NULL;
+}
+
+const char *
+sprinttime(long long sec)
+{
+ return sprinttime_ex(sec, 0, 0, 0);
+}
+
+const char *
+sprinttime_usec(long long sec, unsigned long long usec)
+{
+ return sprinttime_ex(sec, usec, 999999, 6);
+}
+
+const char *
+sprinttime_nsec(long long sec, unsigned long long nsec)
+{
+ return sprinttime_ex(sec, nsec, 999999999, 9);
+}
+
+void
+print_uuid(const unsigned char *uuid)
+{
+ const char str[] = {
+ BYTE_HEX_CHARS(uuid[0]),
+ BYTE_HEX_CHARS(uuid[1]),
+ BYTE_HEX_CHARS(uuid[2]),
+ BYTE_HEX_CHARS(uuid[3]),
+ '-',
+ BYTE_HEX_CHARS(uuid[4]),
+ BYTE_HEX_CHARS(uuid[5]),
+ '-',
+ BYTE_HEX_CHARS(uuid[6]),
+ BYTE_HEX_CHARS(uuid[7]),
+ '-',
+ BYTE_HEX_CHARS(uuid[8]),
+ BYTE_HEX_CHARS(uuid[9]),
+ '-',
+ BYTE_HEX_CHARS(uuid[10]),
+ BYTE_HEX_CHARS(uuid[11]),
+ BYTE_HEX_CHARS(uuid[12]),
+ BYTE_HEX_CHARS(uuid[13]),
+ BYTE_HEX_CHARS(uuid[14]),
+ BYTE_HEX_CHARS(uuid[15]),
+ '\0'
+ };
+
+ tprints(str);
+}
+
+enum sock_proto
+getfdproto(struct tcb *tcp, int fd)
+{
+#ifdef HAVE_SYS_XATTR_H
+ size_t bufsize = 256;
+ char buf[bufsize];
+ ssize_t r;
+ char path[sizeof("/proc/%u/fd/%u") + 2 * sizeof(int)*3];
+
+ if (fd < 0)
+ return SOCK_PROTO_UNKNOWN;
+
+ xsprintf(path, "/proc/%u/fd/%u", get_proc_pid(tcp), fd);
+ r = getxattr(path, "system.sockprotoname", buf, bufsize - 1);
+ if (r <= 0)
+ return SOCK_PROTO_UNKNOWN;
+ else {
+ /*
+ * This is a protection for the case when the kernel
+ * side does not append a null byte to the buffer.
+ */
+ buf[r] = '\0';
+
+ return get_proto_by_name(buf);
+ }
+#else
+ return SOCK_PROTO_UNKNOWN;
+#endif
+}
+
+unsigned long
+getfdinode(struct tcb *tcp, int fd)
+{
+ char path[PATH_MAX + 1];
+
+ if (getfdpath(tcp, fd, path, sizeof(path)) >= 0) {
+ const char *str = STR_STRIP_PREFIX(path, "socket:[");
+
+ if (str != path) {
+ const size_t str_len = strlen(str);
+ if (str_len && str[str_len - 1] == ']')
+ return strtoul(str, NULL, 10);
+ }
+ }
+
+ return 0;
+}
+
+static bool
+printsocket(struct tcb *tcp, int fd, const char *path)
+{
+ const char *str = STR_STRIP_PREFIX(path, "socket:[");
+ size_t len;
+ unsigned long inode;
+
+ return (str != path)
+ && (len = strlen(str))
+ && (str[len - 1] == ']')
+ && (inode = strtoul(str, NULL, 10))
+ && print_sockaddr_by_inode(tcp, fd, inode);
+}
+
+static bool
+printdev(struct tcb *tcp, int fd, const char *path)
+{
+ strace_stat_t st;
+
+ if (path[0] != '/')
+ return false;
+
+ if (stat_file(path, &st)) {
+ debug_func_perror_msg("stat(\"%s\")", path);
+ return false;
+ }
+
+ switch (st.st_mode & S_IFMT) {
+ case S_IFBLK:
+ case S_IFCHR:
+ print_quoted_string_ex(path, strlen(path),
+ QUOTE_OMIT_LEADING_TRAILING_QUOTES,
+ "<>");
+ tprintf("<%s %u:%u>",
+ S_ISBLK(st.st_mode)? "block" : "char",
+ major(st.st_rdev), minor(st.st_rdev));
+ return true;
+ }
+
+ return false;
+}
+
+pid_t
+pidfd_get_pid(pid_t pid_of_fd, int fd)
+{
+ int proc_pid = 0;
+ translate_pid(NULL, pid_of_fd, PT_TID, &proc_pid);
+ if (!proc_pid)
+ return -1;
+
+ char fdi_path[sizeof("/proc/%u/fdinfo/%u") + 2 * sizeof(int) * 3];
+ xsprintf(fdi_path, "/proc/%u/fdinfo/%u", proc_pid, fd);
+
+ FILE *f = fopen_stream(fdi_path, "r");
+ if (!f)
+ return -1;
+
+ static const char pid_pfx[] = "Pid:\t";
+ char *line = NULL;
+ size_t sz = 0;
+ pid_t pid = -1;
+ while (getline(&line, &sz, f) > 0) {
+ const char *pos = STR_STRIP_PREFIX(line, pid_pfx);
+ if (pos == line)
+ continue;
+
+ pid = string_to_uint_ex(pos, NULL, INT_MAX, "\n");
+ break;
+ }
+
+ free(line);
+ fclose(f);
+
+ return pid;
+}
+
+static bool
+printpidfd(pid_t pid_of_fd, int fd, const char *path)
+{
+ static const char pidfd_path[] = "anon_inode:[pidfd]";
+
+ if (strcmp(path, pidfd_path))
+ return false;
+
+ pid_t pid = pidfd_get_pid(pid_of_fd, fd);
+ if (pid <= 0)
+ return false;
+
+ tprintf("pid:%d", pid);
+ return true;
+}
+
+void
+printfd_pid(struct tcb *tcp, pid_t pid, int fd)
+{
+ char path[PATH_MAX + 1];
+ if (pid > 0 && !number_set_array_is_empty(decode_fd_set, 0)
+ && getfdpath_pid(pid, fd, path, sizeof(path)) >= 0) {
+ tprintf("%d<", (int) fd);
+ if (is_number_in_set(DECODE_FD_SOCKET, decode_fd_set) &&
+ printsocket(tcp, fd, path))
+ goto printed;
+ if (is_number_in_set(DECODE_FD_DEV, decode_fd_set) &&
+ printdev(tcp, fd, path))
+ goto printed;
+ if (is_number_in_set(DECODE_FD_PIDFD, decode_fd_set) &&
+ printpidfd(pid, fd, path))
+ goto printed;
+ print_quoted_string_ex(path, strlen(path),
+ QUOTE_OMIT_LEADING_TRAILING_QUOTES, "<>");
+
+printed:
+ tprints(">");
+ } else {
+ tprintf("%d", fd);
+ }
+}
+
+void
+printfd_pid_tracee_ns(struct tcb *tcp, pid_t pid, int fd)
+{
+ int strace_pid = translate_pid(tcp, pid, PT_TGID, NULL);
+ printfd_pid(tcp, strace_pid, fd);
+}
+
+/*
+ * Quote string `instr' of length `size'
+ * Write up to (3 + `size' * 4) bytes to `outstr' buffer.
+ *
+ * `escape_chars' specifies characters (in addition to characters with
+ * codes 0..31, 127..255, single and double quotes) that should be escaped.
+ *
+ * If QUOTE_0_TERMINATED `style' flag is set,
+ * treat `instr' as a NUL-terminated string,
+ * checking up to (`size' + 1) bytes of `instr'.
+ *
+ * If QUOTE_OMIT_LEADING_TRAILING_QUOTES `style' flag is set,
+ * do not add leading and trailing quoting symbols.
+ *
+ * Returns 0 if QUOTE_0_TERMINATED is set and NUL was seen, 1 otherwise.
+ * Note that if QUOTE_0_TERMINATED is not set, always returns 1.
+ */
+int
+string_quote(const char *instr, char *outstr, const unsigned int size,
+ const unsigned int style, const char *escape_chars)
+{
+ const unsigned char *ustr = (const unsigned char *) instr;
+ char *s = outstr;
+ unsigned int i;
+ int usehex, c, eol;
+ bool printable;
+
+ if (style & QUOTE_0_TERMINATED)
+ eol = '\0';
+ else
+ eol = 0x100; /* this can never match a char */
+
+ usehex = 0;
+ if ((xflag > 1) || (style & QUOTE_FORCE_HEX)) {
+ usehex = 1;
+ } else if (xflag) {
+ /* Check for presence of symbol which require
+ to hex-quote the whole string. */
+ for (i = 0; i < size; ++i) {
+ c = ustr[i];
+ /* Check for NUL-terminated string. */
+ if (c == eol)
+ break;
+
+ /* Force hex unless c is printable or whitespace */
+ if (c > 0x7e) {
+ usehex = 1;
+ break;
+ }
+ /* In ASCII isspace is only these chars: "\t\n\v\f\r".
+ * They happen to have ASCII codes 9,10,11,12,13.
+ */
+ if (c < ' ' && (unsigned)(c - 9) >= 5) {
+ usehex = 1;
+ break;
+ }
+ }
+ }
+
+ if (style & QUOTE_EMIT_COMMENT)
+ s = stpcpy(s, " /* ");
+ if (!(style & QUOTE_OMIT_LEADING_TRAILING_QUOTES))
+ *s++ = '\"';
+
+ if (usehex) {
+ /* Hex-quote the whole string. */
+ for (i = 0; i < size; ++i) {
+ c = ustr[i];
+ /* Check for NUL-terminated string. */
+ if (c == eol)
+ goto asciz_ended;
+ *s++ = '\\';
+ *s++ = 'x';
+ s = sprint_byte_hex(s, c);
+ }
+
+ goto string_ended;
+ }
+
+ for (i = 0; i < size; ++i) {
+ c = ustr[i];
+ /* Check for NUL-terminated string. */
+ if (c == eol)
+ goto asciz_ended;
+ if ((i == (size - 1)) &&
+ (style & QUOTE_OMIT_TRAILING_0) && (c == '\0'))
+ goto asciz_ended;
+ switch (c) {
+ case '\"': case '\\':
+ *s++ = '\\';
+ *s++ = c;
+ break;
+ case '\f':
+ *s++ = '\\';
+ *s++ = 'f';
+ break;
+ case '\n':
+ *s++ = '\\';
+ *s++ = 'n';
+ break;
+ case '\r':
+ *s++ = '\\';
+ *s++ = 'r';
+ break;
+ case '\t':
+ *s++ = '\\';
+ *s++ = 't';
+ break;
+ case '\v':
+ *s++ = '\\';
+ *s++ = 'v';
+ break;
+ default:
+ printable = is_print(c);
+
+ if (printable && escape_chars)
+ printable = !strchr(escape_chars, c);
+
+ if (printable) {
+ *s++ = c;
+ } else {
+ /* Print \octal */
+ *s++ = '\\';
+ if (i + 1 < size
+ && ustr[i + 1] >= '0'
+ && ustr[i + 1] <= '7'
+ ) {
+ /* Print \ooo */
+ *s++ = '0' + (c >> 6);
+ *s++ = '0' + ((c >> 3) & 0x7);
+ } else {
+ /* Print \[[o]o]o */
+ if ((c >> 3) != 0) {
+ if ((c >> 6) != 0)
+ *s++ = '0' + (c >> 6);
+ *s++ = '0' + ((c >> 3) & 0x7);
+ }
+ }
+ *s++ = '0' + (c & 0x7);
+ }
+ }
+ }
+
+ string_ended:
+ if (!(style & QUOTE_OMIT_LEADING_TRAILING_QUOTES))
+ *s++ = '\"';
+ if (style & QUOTE_EMIT_COMMENT)
+ s = stpcpy(s, " */");
+ *s = '\0';
+
+ /* Return zero if we printed entire ASCIZ string (didn't truncate it) */
+ if (style & QUOTE_0_TERMINATED && ustr[i] == '\0') {
+ /* We didn't see NUL yet (otherwise we'd jump to 'asciz_ended')
+ * but next char is NUL.
+ */
+ return 0;
+ }
+
+ return 1;
+
+ asciz_ended:
+ if (!(style & QUOTE_OMIT_LEADING_TRAILING_QUOTES))
+ *s++ = '\"';
+ if (style & QUOTE_EMIT_COMMENT)
+ s = stpcpy(s, " */");
+ *s = '\0';
+ /* Return zero: we printed entire ASCIZ string (didn't truncate it) */
+ return 0;
+}
+
+#ifndef ALLOCA_CUTOFF
+# define ALLOCA_CUTOFF 4032
+#endif
+#define use_alloca(n) ((n) <= ALLOCA_CUTOFF)
+
+/*
+ * Quote string `str' of length `size' and print the result.
+ *
+ * If QUOTE_0_TERMINATED `style' flag is set,
+ * treat `str' as a NUL-terminated string and
+ * quote at most (`size' - 1) bytes.
+ *
+ * If QUOTE_OMIT_LEADING_TRAILING_QUOTES `style' flag is set,
+ * do not add leading and trailing quoting symbols.
+ *
+ * Returns 0 if QUOTE_0_TERMINATED is set and NUL was seen, 1 otherwise.
+ * Note that if QUOTE_0_TERMINATED is not set, always returns 1.
+ */
+int
+print_quoted_string_ex(const char *str, unsigned int size,
+ const unsigned int style, const char *escape_chars)
+{
+ char *buf;
+ char *outstr;
+ unsigned int alloc_size;
+ int rc;
+
+ if (size && style & QUOTE_0_TERMINATED)
+ --size;
+
+ alloc_size = 4 * size;
+ if (alloc_size / 4 != size) {
+ error_func_msg("requested %u bytes exceeds %u bytes limit",
+ size, -1U / 4);
+ tprints("???");
+ return -1;
+ }
+ alloc_size += 1 + (style & QUOTE_OMIT_LEADING_TRAILING_QUOTES ? 0 : 2) +
+ (style & QUOTE_EMIT_COMMENT ? 7 : 0);
+
+ if (use_alloca(alloc_size)) {
+ outstr = alloca(alloc_size);
+ buf = NULL;
+ } else {
+ outstr = buf = malloc(alloc_size);
+ if (!buf) {
+ error_func_msg("memory exhausted when tried to allocate"
+ " %u bytes", alloc_size);
+ tprints("???");
+ return -1;
+ }
+ }
+
+ rc = string_quote(str, outstr, size, style, escape_chars);
+ tprints(outstr);
+
+ free(buf);
+ return rc;
+}
+
+inline int
+print_quoted_string(const char *str, unsigned int size,
+ const unsigned int style)
+{
+ return print_quoted_string_ex(str, size, style, NULL);
+}
+
+/*
+ * Quote a NUL-terminated string `str' of length up to `size' - 1
+ * and print the result.
+ *
+ * Returns 0 if NUL was seen, 1 otherwise.
+ */
+int
+print_quoted_cstring(const char *str, unsigned int size)
+{
+ int unterminated =
+ print_quoted_string(str, size, QUOTE_0_TERMINATED);
+
+ if (unterminated)
+ tprints("...");
+
+ return unterminated;
+}
+
+/*
+ * Print path string specified by address `addr' and length `n'.
+ * If path length exceeds `n', append `...' to the output.
+ *
+ * Returns the result of umovenstr.
+ */
+int
+printpathn(struct tcb *const tcp, const kernel_ulong_t addr, unsigned int n)
+{
+ char path[PATH_MAX];
+ int nul_seen;
+
+ if (!addr) {
+ tprints("NULL");
+ return -1;
+ }
+
+ /* Cap path length to the path buffer size */
+ if (n > sizeof(path) - 1)
+ n = sizeof(path) - 1;
+
+ /* Fetch one byte more to find out whether path length > n. */
+ nul_seen = umovestr(tcp, addr, n + 1, path);
+ if (nul_seen < 0)
+ printaddr(addr);
+ else {
+ path[n++] = !nul_seen;
+ print_quoted_cstring(path, n);
+ }
+
+ return nul_seen;
+}
+
+int
+printpath(struct tcb *const tcp, const kernel_ulong_t addr)
+{
+ /* Size must correspond to char path[] size in printpathn */
+ return printpathn(tcp, addr, PATH_MAX - 1);
+}
+
+/*
+ * Print string specified by address `addr' and length `len'.
+ * If `user_style' has QUOTE_0_TERMINATED bit set, treat the string
+ * as a NUL-terminated string.
+ * Pass `user_style' on to `string_quote'.
+ * Append `...' to the output if either the string length exceeds `max_strlen',
+ * or QUOTE_0_TERMINATED bit is set and the string length exceeds `len'.
+ *
+ * Returns the result of umovenstr if style has QUOTE_0_TERMINATED,
+ * or the result of umoven otherwise.
+ */
+int
+printstr_ex(struct tcb *const tcp, const kernel_ulong_t addr,
+ const kernel_ulong_t len, const unsigned int user_style)
+{
+ static char *str;
+ static char *outstr;
+
+ unsigned int size;
+ unsigned int style = user_style;
+ int rc;
+ int ellipsis;
+
+ if (!addr) {
+ tprints("NULL");
+ return -1;
+ }
+ /* Allocate static buffers if they are not allocated yet. */
+ if (!str) {
+ const unsigned int outstr_size =
+ 4 * max_strlen + /* for quotes and NUL */ 3;
+ /*
+ * We can assume that outstr_size / 4 == max_strlen
+ * since we have a guarantee that max_strlen <= -1U / 4.
+ */
+
+ str = xmalloc(max_strlen + 1);
+ outstr = xmalloc(outstr_size);
+ }
+
+ /* Fetch one byte more because string_quote may look one byte ahead. */
+ size = max_strlen + 1;
+
+ if (size > len)
+ size = len;
+ if (style & QUOTE_0_TERMINATED)
+ rc = umovestr(tcp, addr, size, str);
+ else
+ rc = umoven(tcp, addr, size, str);
+
+ if (rc < 0) {
+ printaddr(addr);
+ return rc;
+ }
+
+ if (size > max_strlen)
+ size = max_strlen;
+ else
+ str[size] = '\xff';
+
+ /* If string_quote didn't see NUL and (it was supposed to be ASCIZ str
+ * or we were requested to print more than -s NUM chars)...
+ */
+ ellipsis = string_quote(str, outstr, size, style, NULL)
+ && len
+ && ((style & (QUOTE_0_TERMINATED | QUOTE_EXPECT_TRAILING_0))
+ || len > max_strlen);
+
+ tprints(outstr);
+ if (ellipsis)
+ tprints("...");
+
+ return rc;
+}
+
+bool
+print_nonzero_bytes(struct tcb *const tcp,
+ void (*const prefix_fun)(void),
+ const kernel_ulong_t start_addr,
+ const unsigned int start_offs,
+ const unsigned int total_len,
+ const unsigned int style)
+{
+ if (start_offs >= total_len)
+ return false;
+
+ const kernel_ulong_t addr = start_addr + start_offs;
+ const unsigned int len = total_len - start_offs;
+ const unsigned int size = MIN(len, max_strlen);
+
+ char *str = malloc(len);
+
+ if (!str) {
+ error_func_msg("memory exhausted when tried to allocate"
+ " %u bytes", len);
+ prefix_fun();
+ tprints("???");
+ return true;
+ }
+
+ bool ret = true;
+
+ if (umoven(tcp, addr, len, str)) {
+ prefix_fun();
+ tprints("???");
+ } else if (is_filled(str, 0, len)) {
+ ret = false;
+ } else {
+ prefix_fun();
+ tprintf("/* bytes %u..%u */ ", start_offs, total_len - 1);
+
+ print_quoted_string(str, size, style);
+
+ if (size < len)
+ tprints("...");
+ }
+
+ free(str);
+ return ret;
+}
+
+void
+dumpiov_upto(struct tcb *const tcp, const int len, const kernel_ulong_t addr,
+ kernel_ulong_t data_size)
+{
+#if ANY_WORDSIZE_LESS_THAN_KERNEL_LONG
+ union {
+ struct { uint32_t base; uint32_t len; } *iov32;
+ struct { uint64_t base; uint64_t len; } *iov64;
+ } iovu;
+# define iov iovu.iov64
+# define sizeof_iov \
+ (current_wordsize == 4 ? (unsigned int) sizeof(*iovu.iov32) \
+ : (unsigned int) sizeof(*iovu.iov64))
+# define iov_iov_base(i) \
+ (current_wordsize == 4 ? (uint64_t) iovu.iov32[i].base : iovu.iov64[i].base)
+# define iov_iov_len(i) \
+ (current_wordsize == 4 ? (uint64_t) iovu.iov32[i].len : iovu.iov64[i].len)
+#else
+ struct iovec *iov;
+# define sizeof_iov ((unsigned int) sizeof(*iov))
+# define iov_iov_base(i) ptr_to_kulong(iov[i].iov_base)
+# define iov_iov_len(i) iov[i].iov_len
+#endif
+ int i;
+ unsigned int size = sizeof_iov * len;
+ if (size / sizeof_iov != (unsigned int) len) {
+ error_func_msg("requested %u iovec elements exceeds"
+ " %u iovec limit", len, -1U / sizeof_iov);
+ return;
+ }
+
+ iov = malloc(size);
+ if (!iov) {
+ error_func_msg("memory exhausted when tried to allocate"
+ " %u bytes", size);
+ return;
+ }
+ if (umoven(tcp, addr, size, iov) >= 0) {
+ for (i = 0; i < len; i++) {
+ kernel_ulong_t iov_len = iov_iov_len(i);
+ if (iov_len > data_size)
+ iov_len = data_size;
+ if (!iov_len)
+ break;
+ data_size -= iov_len;
+ /* include the buffer number to make it easy to
+ * match up the trace with the source */
+ tprintf(" * %" PRI_klu " bytes in buffer %d\n", iov_len, i);
+ dumpstr(tcp, iov_iov_base(i), iov_len);
+ }
+ }
+ free(iov);
+#undef sizeof_iov
+#undef iov_iov_base
+#undef iov_iov_len
+#undef iov
+}
+
+void
+dumpstr(struct tcb *const tcp, const kernel_ulong_t addr,
+ const kernel_ulong_t len)
+{
+ /* xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx 1234567890123456 */
+ enum {
+ HEX_BIT = 4,
+
+ DUMPSTR_GROUP_BYTES = 8,
+ DUMPSTR_GROUPS = 2,
+ DUMPSTR_WIDTH_BYTES = DUMPSTR_GROUP_BYTES * DUMPSTR_GROUPS,
+
+ /** Width of formatted dump in characters. */
+ DUMPSTR_WIDTH_CHARS = DUMPSTR_WIDTH_BYTES +
+ sizeof("xx") * DUMPSTR_WIDTH_BYTES + DUMPSTR_GROUPS,
+
+ DUMPSTR_GROUP_MASK = DUMPSTR_GROUP_BYTES - 1,
+ DUMPSTR_BYTES_MASK = DUMPSTR_WIDTH_BYTES - 1,
+
+ /** Minimal width of the offset field in the output. */
+ DUMPSTR_OFFS_MIN_CHARS = 5,
+
+ /** Arbitrarily chosen internal dumpstr buffer limit. */
+ DUMPSTR_BUF_MAXSZ = 1 << 16,
+ };
+
+ static_assert(!(DUMPSTR_BUF_MAXSZ % DUMPSTR_WIDTH_BYTES),
+ "Maximum internal buffer size should be divisible "
+ "by amount of bytes dumped per line");
+ static_assert(!(DUMPSTR_GROUP_BYTES & DUMPSTR_GROUP_MASK),
+ "DUMPSTR_GROUP_BYTES is not power of 2");
+ static_assert(!(DUMPSTR_WIDTH_BYTES & DUMPSTR_BYTES_MASK),
+ "DUMPSTR_WIDTH_BYTES is not power of 2");
+
+ if (len > len + DUMPSTR_WIDTH_BYTES || addr + len < addr) {
+ debug_func_msg("len %" PRI_klu " at addr %#" PRI_klx
+ " is too big, skipped", len, addr);
+ return;
+ }
+
+ static kernel_ulong_t strsize;
+ static unsigned char *str;
+
+ const kernel_ulong_t alloc_size =
+ MIN(ROUNDUP(len, DUMPSTR_WIDTH_BYTES), DUMPSTR_BUF_MAXSZ);
+
+ if (strsize < alloc_size) {
+ free(str);
+ str = malloc(alloc_size);
+ if (!str) {
+ strsize = 0;
+ error_func_msg("memory exhausted when tried to allocate"
+ " %" PRI_klu " bytes", alloc_size);
+ return;
+ }
+ strsize = alloc_size;
+ }
+
+ /**
+ * Characters needed in order to print the offset field. We calculate
+ * it this way in order to avoid ilog2_64 call most of the time.
+ */
+ const int offs_chars = len > (1 << (DUMPSTR_OFFS_MIN_CHARS * HEX_BIT))
+ ? 1 + ilog2_klong(len - 1) / HEX_BIT : DUMPSTR_OFFS_MIN_CHARS;
+ kernel_ulong_t i = 0;
+ const unsigned char *src;
+
+ while (i < len) {
+ /*
+ * It is important to overwrite all the byte values, as we
+ * re-use the buffer in order to avoid its re-initialisation.
+ */
+ static char outbuf[] = {
+ [0 ... DUMPSTR_WIDTH_CHARS - 1] = ' ',
+ '\0'
+ };
+ char *dst = outbuf;
+
+ /* Fetching data from tracee. */
+ if (!i || (i % DUMPSTR_BUF_MAXSZ) == 0) {
+ kernel_ulong_t fetch_size = MIN(len - i, alloc_size);
+
+ if (umoven(tcp, addr + i, fetch_size, str) < 0) {
+ /*
+ * Don't silently abort if we have printed
+ * something already.
+ */
+ if (i)
+ tprintf(" | <Cannot fetch %" PRI_klu
+ " byte%s from pid %d"
+ " @%#" PRI_klx ">\n",
+ fetch_size,
+ fetch_size == 1 ? "" : "s",
+ tcp->pid, addr + i);
+ return;
+ }
+ src = str;
+ }
+
+ /* hex dump */
+ do {
+ if (i < len) {
+ dst = sprint_byte_hex(dst, *src);
+ } else {
+ *dst++ = ' ';
+ *dst++ = ' ';
+ }
+ dst++; /* space is there */
+ i++;
+ if ((i & DUMPSTR_GROUP_MASK) == 0)
+ dst++; /* space is there */
+ src++;
+ } while (i & DUMPSTR_BYTES_MASK);
+
+ /* ASCII dump */
+ i -= DUMPSTR_WIDTH_BYTES;
+ src -= DUMPSTR_WIDTH_BYTES;
+ do {
+ if (i < len) {
+ if (is_print(*src))
+ *dst++ = *src;
+ else
+ *dst++ = '.';
+ } else {
+ *dst++ = ' ';
+ }
+ src++;
+ } while (++i & DUMPSTR_BYTES_MASK);
+
+ tprintf(" | %0*" PRI_klx " %s |\n",
+ offs_chars, i - DUMPSTR_WIDTH_BYTES, outbuf);
+ }
+}
+
+bool
+tfetch_mem64(struct tcb *const tcp, const uint64_t addr,
+ const unsigned int len, void *const our_addr)
+{
+ return addr && verbose(tcp) &&
+ (entering(tcp) || !syserror(tcp)) &&
+ !umoven(tcp, addr, len, our_addr);
+}
+
+bool
+tfetch_mem64_ignore_syserror(struct tcb *const tcp, const uint64_t addr,
+ const unsigned int len, void *const our_addr)
+{
+ return addr && verbose(tcp) &&
+ !umoven(tcp, addr, len, our_addr);
+}
+
+int
+umoven_or_printaddr64(struct tcb *const tcp, const uint64_t addr,
+ const unsigned int len, void *const our_addr)
+{
+ if (tfetch_mem64(tcp, addr, len, our_addr))
+ return 0;
+ printaddr64(addr);
+ return -1;
+}
+
+int
+umoven_or_printaddr64_ignore_syserror(struct tcb *const tcp,
+ const uint64_t addr,
+ const unsigned int len,
+ void *const our_addr)
+{
+ if (tfetch_mem64_ignore_syserror(tcp, addr, len, our_addr))
+ return 0;
+ printaddr64(addr);
+ return -1;
+}
+
+bool
+print_int8_array_member(struct tcb *tcp, void *elem_buf, size_t elem_size,
+ void *data)
+{
+ tprintf("%" PRId8, *(int8_t *) elem_buf);
+
+ return true;
+}
+
+bool
+print_uint8_array_member(struct tcb *tcp, void *elem_buf, size_t elem_size,
+ void *data)
+{
+ tprintf("%" PRIu8, *(uint8_t *) elem_buf);
+
+ return true;
+}
+
+bool
+print_int32_array_member(struct tcb *tcp, void *elem_buf, size_t elem_size,
+ void *data)
+{
+ tprintf("%" PRId32, *(int32_t *) elem_buf);
+
+ return true;
+}
+
+bool
+print_uint32_array_member(struct tcb *tcp, void *elem_buf, size_t elem_size,
+ void *data)
+{
+ tprintf("%" PRIu32, *(uint32_t *) elem_buf);
+
+ return true;
+}
+
+bool
+print_uint64_array_member(struct tcb *tcp, void *elem_buf, size_t elem_size,
+ void *data)
+{
+ tprintf("%" PRIu64, *(uint64_t *) elem_buf);
+
+ return true;
+}
+
+bool
+print_xint32_array_member(struct tcb *tcp, void *elem_buf, size_t elem_size,
+ void *data)
+{
+ tprintf("%#" PRIx32, *(uint32_t *) elem_buf);
+
+ return true;
+}
+
+bool
+print_xint64_array_member(struct tcb *tcp, void *elem_buf, size_t elem_size,
+ void *data)
+{
+ tprintf("%#" PRIx64, *(uint64_t *) elem_buf);
+
+ return true;
+}
+
+/*
+ * Iteratively fetch and print up to nmemb elements of elem_size size
+ * from the array that starts at tracee's address start_addr.
+ *
+ * Array elements are being fetched to the address specified by elem_buf.
+ *
+ * The fetcher callback function specified by tfetch_mem_func should follow
+ * the same semantics as tfetch_mem function.
+ *
+ * The printer callback function specified by print_func is expected
+ * to print something; if it returns false, no more iterations will be made.
+ *
+ * The pointer specified by opaque_data is passed to each invocation
+ * of print_func callback function.
+ *
+ * This function prints:
+ * - "NULL", if start_addr is NULL;
+ * - "[]", if nmemb is 0;
+ * - start_addr, if nmemb * elem_size overflows or wraps around;
+ * - start_addr, if the first tfetch_mem_func invocation returned false;
+ * - elements of the array, delimited by ", ", with the array itself
+ * enclosed with [] brackets.
+ *
+ * If abbrev(tcp) is true, then
+ * - the maximum number of elements printed equals to max_strlen;
+ * - "..." is printed instead of max_strlen+1 element
+ * and no more iterations will be made.
+ *
+ * This function returns true only if tfetch_mem_func has returned true
+ * at least once.
+ */
+bool
+print_array_ex(struct tcb *const tcp,
+ const kernel_ulong_t start_addr,
+ const size_t nmemb,
+ void *elem_buf,
+ const size_t elem_size,
+ tfetch_mem_fn tfetch_mem_func,
+ print_fn print_func,
+ void *const opaque_data,
+ unsigned int flags,
+ const struct xlat *index_xlat,
+ const char *index_dflt)
+{
+ if (!start_addr) {
+ tprints("NULL");
+ return false;
+ }
+
+ if (!nmemb) {
+ tprints("[]");
+ return false;
+ }
+
+ const size_t size = nmemb * elem_size;
+ const kernel_ulong_t end_addr = start_addr + size;
+
+ if (end_addr <= start_addr || size / elem_size != nmemb) {
+ if (tfetch_mem_func)
+ printaddr(start_addr);
+ else
+ tprints("???");
+ return false;
+ }
+
+ const kernel_ulong_t abbrev_end =
+ (abbrev(tcp) && max_strlen < nmemb) ?
+ start_addr + elem_size * max_strlen : end_addr;
+ kernel_ulong_t cur;
+ kernel_ulong_t idx = 0;
+ enum xlat_style xlat_style = flags & XLAT_STYLE_MASK;
+ bool truncated = false;
+
+ for (cur = start_addr; cur < end_addr; cur += elem_size, idx++) {
+ if (cur != start_addr)
+ tprints(", ");
+
+ if (tfetch_mem_func) {
+ if (!tfetch_mem_func(tcp, cur, elem_size, elem_buf)) {
+ if (cur == start_addr)
+ printaddr(cur);
+ else {
+ tprints("...");
+ printaddr_comment(cur);
+ truncated = true;
+ }
+ break;
+ }
+ } else {
+ elem_buf = (void *) (uintptr_t) cur;
+ }
+
+ if (cur == start_addr)
+ tprints("[");
+
+ if (cur >= abbrev_end) {
+ tprints("...");
+ cur = end_addr;
+ truncated = true;
+ break;
+ }
+
+ if (flags & PAF_PRINT_INDICES) {
+ tprints("[");
+
+ if (!index_xlat) {
+ print_xlat_ex(idx, NULL, xlat_style);
+ } else {
+ printxval_ex(idx ? NULL : index_xlat, idx,
+ index_dflt, xlat_style);
+ }
+
+ tprints("] = ");
+ }
+
+ if (!print_func(tcp, elem_buf, elem_size, opaque_data)) {
+ cur = end_addr;
+ break;
+ }
+ }
+
+ if ((cur != start_addr) || !tfetch_mem_func) {
+ if ((flags & PAF_ARRAY_TRUNCATED) && !truncated) {
+ if (cur != start_addr)
+ tprints(", ");
+
+ tprints("...");
+ }
+
+ tprints("]");
+ }
+
+ return cur >= end_addr;
+}
+
+int
+printargs(struct tcb *tcp)
+{
+ const int n = n_args(tcp);
+ int i;
+ for (i = 0; i < n; ++i)
+ tprintf("%s%#" PRI_klx, i ? ", " : "", tcp->u_arg[i]);
+ return RVAL_DECODED;
+}
+
+int
+printargs_u(struct tcb *tcp)
+{
+ const int n = n_args(tcp);
+ int i;
+ for (i = 0; i < n; ++i)
+ tprintf("%s%u", i ? ", " : "",
+ (unsigned int) tcp->u_arg[i]);
+ return RVAL_DECODED;
+}
+
+int
+printargs_d(struct tcb *tcp)
+{
+ const int n = n_args(tcp);
+ int i;
+ for (i = 0; i < n; ++i)
+ tprintf("%s%d", i ? ", " : "",
+ (int) tcp->u_arg[i]);
+ return RVAL_DECODED;
+}
+
+/* Print abnormal high bits of a kernel_ulong_t value. */
+void
+print_abnormal_hi(const kernel_ulong_t val)
+{
+ if (current_klongsize > 4) {
+ const unsigned int hi = (unsigned int) ((uint64_t) val >> 32);
+ if (hi)
+ tprintf("%#x<<32|", hi);
+ }
+}
+
+int
+read_int_from_file(const char *const fname, int *const pvalue)
+{
+ const int fd = open_file(fname, O_RDONLY);
+ if (fd < 0)
+ return -1;
+
+ long lval;
+ char buf[sizeof(lval) * 3];
+ int n = read(fd, buf, sizeof(buf) - 1);
+ int saved_errno = errno;
+ close(fd);
+
+ if (n < 0) {
+ errno = saved_errno;
+ return -1;
+ }
+
+ buf[n] = '\0';
+ char *endptr = 0;
+ errno = 0;
+ lval = strtol(buf, &endptr, 10);
+ if (!endptr || (*endptr && '\n' != *endptr)
+#if INT_MAX < LONG_MAX
+ || lval > INT_MAX || lval < INT_MIN
+#endif
+ || ERANGE == errno) {
+ if (!errno)
+ errno = EINVAL;
+ return -1;
+ }
+
+ *pvalue = (int) lval;
+ return 0;
+}
diff --git a/src/utime.c b/src/utime.c
new file mode 100644
index 000000000..fdb41721a
--- /dev/null
+++ b/src/utime.c
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2014-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#include DEF_MPERS_TYPE(utimbuf_t)
+
+#include <utime.h>
+
+typedef struct utimbuf utimbuf_t;
+
+#include MPERS_DEFS
+
+SYS_FUNC(utime)
+{
+ utimbuf_t u;
+
+ printpath(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ if (!umove_or_printaddr(tcp, tcp->u_arg[1], &u)) {
+ tprint_struct_begin();
+ PRINT_FIELD_D(u, actime);
+ tprints_comment(sprinttime(u.actime));
+ tprint_struct_next();
+ PRINT_FIELD_D(u, modtime);
+ tprints_comment(sprinttime(u.modtime));
+ tprint_struct_end();
+ }
+
+ return RVAL_DECODED;
+}
diff --git a/src/utimes.c b/src/utimes.c
new file mode 100644
index 000000000..7f351e518
--- /dev/null
+++ b/src/utimes.c
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993-1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
+ * Copyright (c) 2006-2007 Ulrich Drepper <drepper@redhat.com>
+ * Copyright (c) 2006 Bernhard Kaindl <bk@suse.de>
+ * Copyright (c) 2006-2015 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2014-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+SYS_FUNC(utimes)
+{
+ printpath(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ print_timeval_utimes(tcp, tcp->u_arg[1]);
+
+ return RVAL_DECODED;
+}
+
+SYS_FUNC(futimesat)
+{
+ print_dirfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ printpath(tcp, tcp->u_arg[1]);
+ tprints(", ");
+ print_timeval_utimes(tcp, tcp->u_arg[2]);
+
+ return RVAL_DECODED;
+}
+
+static int
+do_utimensat(struct tcb *const tcp, const print_obj_by_addr_fn print_ts)
+{
+ print_dirfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ printpath(tcp, tcp->u_arg[1]);
+ tprints(", ");
+ print_ts(tcp, tcp->u_arg[2]);
+ tprints(", ");
+ printflags(at_flags, tcp->u_arg[3], "AT_???");
+
+ return RVAL_DECODED;
+}
+
+#if HAVE_ARCH_TIME32_SYSCALLS
+SYS_FUNC(utimensat_time32)
+{
+ return do_utimensat(tcp, print_timespec32_utime_pair);
+}
+#endif
+
+SYS_FUNC(utimensat_time64)
+{
+ return do_utimensat(tcp, print_timespec64_utime_pair);
+}
+
+#ifdef ALPHA
+SYS_FUNC(osf_utimes)
+{
+ printpath(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ print_timeval32_utimes(tcp, tcp->u_arg[1]);
+
+ return RVAL_DECODED;
+}
+#endif /* ALPHA */
diff --git a/src/v4l2.c b/src/v4l2.c
new file mode 100644
index 000000000..00edf5ebd
--- /dev/null
+++ b/src/v4l2.c
@@ -0,0 +1,1568 @@
+/*
+ * Copyright (c) 2014 Philippe De Muyter <phdm@macqel.be>
+ * Copyright (c) 2014 William Manley <will@williammanley.net>
+ * Copyright (c) 2011 Peter Zotov <whitequark@whitequark.org>
+ * Copyright (c) 2014-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#include "static_assert.h"
+
+#define CHECK_V4L2_STRUCT_SIZE(s_) \
+ static_assert(sizeof(struct s_) == sizeof(struct_##s_), \
+ "Unexpected struct " #s_ " size")
+#define CHECK_V4L2_STRUCT_SIZE_LE(s_) \
+ static_assert(sizeof(struct s_) <= sizeof(struct_##s_), \
+ "Unexpected struct " #s_ " size, " \
+ "please update the decoder")
+#define CHECK_V4L2_RESERVED_SIZE(s_) \
+ static_assert(sizeof_field(struct s_, reserved) \
+ >= sizeof_field(struct_##s_, reserved), \
+ "Unexpected struct " #s_ ".reserved size, " \
+ "please update the decoder")
+#define CHECK_V4L2_STRUCT_RESERVED_SIZE(s_) \
+ CHECK_V4L2_STRUCT_SIZE(s_); \
+ CHECK_V4L2_RESERVED_SIZE(s_)
+
+#include DEF_MPERS_TYPE(kernel_v4l2_buffer_t)
+#include DEF_MPERS_TYPE(kernel_v4l2_event_t)
+#include DEF_MPERS_TYPE(kernel_v4l2_timeval_t)
+#include DEF_MPERS_TYPE(struct_v4l2_clip)
+#include DEF_MPERS_TYPE(struct_v4l2_create_buffers)
+#include DEF_MPERS_TYPE(struct_v4l2_ext_control)
+#include DEF_MPERS_TYPE(struct_v4l2_ext_controls)
+#include DEF_MPERS_TYPE(struct_v4l2_format)
+#include DEF_MPERS_TYPE(struct_v4l2_framebuffer)
+#include DEF_MPERS_TYPE(struct_v4l2_input)
+#include DEF_MPERS_TYPE(struct_v4l2_standard)
+#include DEF_MPERS_TYPE(struct_v4l2_window)
+
+#include "kernel_v4l2_types.h"
+
+CHECK_V4L2_STRUCT_RESERVED_SIZE(v4l2_capability);
+CHECK_V4L2_STRUCT_SIZE_LE(v4l2_pix_format);
+#ifdef HAVE_STRUCT_V4L2_PLANE_PIX_FORMAT
+CHECK_V4L2_STRUCT_RESERVED_SIZE(v4l2_plane_pix_format);
+#endif
+#ifdef HAVE_STRUCT_V4L2_PIX_FORMAT_MPLANE
+CHECK_V4L2_STRUCT_RESERVED_SIZE(v4l2_pix_format_mplane);
+#endif
+CHECK_V4L2_STRUCT_SIZE(v4l2_clip);
+CHECK_V4L2_STRUCT_SIZE_LE(v4l2_window);
+CHECK_V4L2_STRUCT_RESERVED_SIZE(v4l2_vbi_format);
+CHECK_V4L2_STRUCT_RESERVED_SIZE(v4l2_sliced_vbi_format);
+CHECK_V4L2_STRUCT_RESERVED_SIZE(v4l2_sliced_vbi_cap);
+#ifdef HAVE_STRUCT_V4L2_SDR_FORMAT
+CHECK_V4L2_STRUCT_RESERVED_SIZE(v4l2_sdr_format);
+#endif
+#ifdef HAVE_STRUCT_V4L2_META_FORMAT
+CHECK_V4L2_STRUCT_SIZE(v4l2_meta_format);
+#endif
+CHECK_V4L2_STRUCT_SIZE(v4l2_format);
+#ifdef HAVE_STRUCT_V4L2_QUERY_EXT_CTRL
+CHECK_V4L2_STRUCT_RESERVED_SIZE(v4l2_query_ext_ctrl);
+#endif
+#ifdef HAVE_STRUCT_V4L2_FRMSIZEENUM
+CHECK_V4L2_STRUCT_RESERVED_SIZE(v4l2_frmsizeenum);
+#endif
+#ifdef HAVE_STRUCT_V4L2_FRMIVALENUM
+CHECK_V4L2_STRUCT_RESERVED_SIZE(v4l2_frmivalenum);
+#endif
+#ifdef HAVE_STRUCT_V4L2_CREATE_BUFFERS
+CHECK_V4L2_STRUCT_RESERVED_SIZE(v4l2_create_buffers);
+#endif
+
+#include MPERS_DEFS
+
+#include "print_utils.h"
+#include "xstring.h"
+
+/* v4l2_fourcc_be was added by Linux commit v3.18-rc1~101^2^2~127 */
+#ifndef v4l2_fourcc_be
+# define v4l2_fourcc_be(a, b, c, d) (v4l2_fourcc(a, b, c, d) | (1U << 31))
+#endif
+
+#ifndef VIDEO_MAX_PLANES
+# define VIDEO_MAX_PLANES 8
+#endif
+
+#include "xlat/v4l2_meta_fmts.h"
+#include "xlat/v4l2_pix_fmts.h"
+#include "xlat/v4l2_sdr_fmts.h"
+
+#define XLAT_MACROS_ONLY
+# include "xlat/v4l2_ioctl_cmds.h"
+#undef XLAT_MACROS_ONLY
+
+static void
+print_v4l2_rect(const MPERS_PTR_ARG(struct v4l2_rect *) const arg)
+{
+ const struct v4l2_rect *const p = arg;
+ tprint_struct_begin();
+ PRINT_FIELD_D(*p, left);
+ tprint_struct_next();
+ PRINT_FIELD_D(*p, top);
+ tprint_struct_next();
+ PRINT_FIELD_U(*p, width);
+ tprint_struct_next();
+ PRINT_FIELD_U(*p, height);
+ tprint_struct_end();
+}
+
+#define PRINT_FIELD_FRACT(where_, field_) \
+ do { \
+ tprints_field_name(#field_); \
+ STRACE_PRINTF("%u/%u", \
+ (where_).field_.numerator, \
+ (where_).field_.denominator); \
+ } while (0)
+
+static void
+print_pixelformat(uint32_t fourcc, const struct xlat *xlat)
+{
+ if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_RAW) {
+ tprintf("%#x", fourcc);
+ return;
+ }
+
+ unsigned char a[] = {
+ (unsigned char) fourcc,
+ (unsigned char) (fourcc >> 8),
+ (unsigned char) (fourcc >> 16),
+ (unsigned char) (fourcc >> 24),
+ };
+ unsigned int i;
+
+ tprints("v4l2_fourcc(");
+ /* Generic char array printing routine. */
+ for (i = 0; i < ARRAY_SIZE(a); ++i) {
+ unsigned char c = a[i];
+
+ if (i)
+ tprints(", ");
+ if (c == '\'' || c == '\\') {
+ char sym[] = {
+ '\'',
+ '\\',
+ c,
+ '\'',
+ '\0'
+ };
+ tprints(sym);
+ } else if (is_print(c)) {
+ char sym[] = {
+ '\'',
+ c,
+ '\'',
+ '\0'
+ };
+ tprints(sym);
+ } else {
+ char hex[] = {
+ BYTE_HEX_CHARS_PRINTF_QUOTED(c),
+ '\0'
+ };
+ tprints(hex);
+ }
+ }
+ tprints(")");
+
+ if (xlat) {
+ const char *pixfmt_name = xlookup(xlat, fourcc);
+
+ if (pixfmt_name)
+ tprints_comment(pixfmt_name);
+ }
+}
+
+#define PRINT_FIELD_PIXFMT(where_, field_, xlat_) \
+ do { \
+ tprints_field_name(#field_); \
+ print_pixelformat((where_).field_, (xlat_)); \
+ } while (0)
+
+#include "xlat/v4l2_device_capabilities_flags.h"
+
+static int
+print_v4l2_capability(struct tcb *const tcp, const kernel_ulong_t arg)
+{
+ struct_v4l2_capability caps;
+
+ if (entering(tcp))
+ return 0;
+ tprints(", ");
+ if (umove_or_printaddr(tcp, arg, &caps))
+ return RVAL_IOCTL_DECODED;
+ tprint_struct_begin();
+ PRINT_FIELD_CSTRING(caps, driver);
+ tprint_struct_next();
+ PRINT_FIELD_CSTRING(caps, card);
+ tprint_struct_next();
+ PRINT_FIELD_CSTRING(caps, bus_info);
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_VAL(caps, version, print_kernel_version);
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(caps, capabilities,
+ v4l2_device_capabilities_flags, "V4L2_CAP_???");
+ if (caps.device_caps) {
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(caps, device_caps,
+ v4l2_device_capabilities_flags,
+ "V4L2_CAP_???");
+ }
+ tprint_struct_end();
+ return RVAL_IOCTL_DECODED;
+}
+
+#include "xlat/v4l2_buf_types.h"
+#include "xlat/v4l2_format_description_flags.h"
+
+static int
+print_v4l2_fmtdesc(struct tcb *const tcp, const kernel_ulong_t arg)
+{
+ struct v4l2_fmtdesc f;
+
+ if (entering(tcp)) {
+ tprints(", ");
+ if (umove_or_printaddr(tcp, arg, &f))
+ return RVAL_IOCTL_DECODED;
+ tprint_struct_begin();
+ PRINT_FIELD_U(f, index);
+ tprint_struct_next();
+ PRINT_FIELD_XVAL(f, type, v4l2_buf_types,
+ "V4L2_BUF_TYPE_???");
+ return 0;
+ }
+
+ if (!syserror(tcp) && !umove(tcp, arg, &f)) {
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(f, flags,
+ v4l2_format_description_flags,
+ "V4L2_FMT_FLAG_???");
+ tprint_struct_next();
+ PRINT_FIELD_CSTRING(f, description);
+ tprint_struct_next();
+ PRINT_FIELD_PIXFMT(f, pixelformat, v4l2_pix_fmts);
+ }
+ tprint_struct_end();
+ return RVAL_IOCTL_DECODED;
+}
+
+#include "xlat/v4l2_fields.h"
+#include "xlat/v4l2_colorspaces.h"
+#include "xlat/v4l2_vbi_flags.h"
+#include "xlat/v4l2_sliced_flags.h"
+
+static bool
+print_v4l2_clip(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data)
+{
+ const struct_v4l2_clip *p = elem_buf;
+ tprint_struct_begin();
+ PRINT_FIELD_OBJ_PTR(*p, c, print_v4l2_rect);
+ tprint_struct_end();
+ return true;
+}
+
+#define DECL_print_v4l2_format_fmt(name_) \
+ print_v4l2_format_fmt_ ## name_(struct tcb *const tcp, \
+ const typeof_field(struct_v4l2_format, fmt.name_) *const p)
+
+static bool
+DECL_print_v4l2_format_fmt(pix)
+{
+ tprint_struct_begin();
+ PRINT_FIELD_U(*p, width);
+ tprint_struct_next();
+ PRINT_FIELD_U(*p, height);
+ tprint_struct_next();
+ PRINT_FIELD_PIXFMT(*p, pixelformat, v4l2_pix_fmts);
+ tprint_struct_next();
+ PRINT_FIELD_XVAL(*p, field, v4l2_fields, "V4L2_FIELD_???");
+ tprint_struct_next();
+ PRINT_FIELD_U(*p, bytesperline);
+ tprint_struct_next();
+ PRINT_FIELD_U(*p, sizeimage);
+ tprint_struct_next();
+ PRINT_FIELD_XVAL(*p, colorspace, v4l2_colorspaces,
+ "V4L2_COLORSPACE_???");
+ tprint_struct_end();
+ return true;
+}
+
+static bool
+print_v4l2_plane_pix_format_array_member(struct tcb *tcp, void *elem_buf,
+ size_t elem_size, void *data)
+{
+ struct_v4l2_plane_pix_format *p = elem_buf;
+
+ tprint_struct_begin();
+ PRINT_FIELD_U(*p, sizeimage);
+ tprint_struct_next();
+ PRINT_FIELD_U(*p, bytesperline);
+ tprint_struct_end();
+
+ return true;
+}
+
+static bool
+DECL_print_v4l2_format_fmt(pix_mp)
+{
+ tprint_struct_begin();
+ PRINT_FIELD_U(*p, width);
+ tprint_struct_next();
+ PRINT_FIELD_U(*p, height);
+ tprint_struct_next();
+ PRINT_FIELD_PIXFMT(*p, pixelformat, v4l2_pix_fmts);
+ tprint_struct_next();
+ PRINT_FIELD_XVAL(*p, field, v4l2_fields, "V4L2_FIELD_???");
+ tprint_struct_next();
+ PRINT_FIELD_XVAL(*p, colorspace, v4l2_colorspaces,
+ "V4L2_COLORSPACE_???");
+ tprint_struct_next();
+ PRINT_FIELD_ARRAY_UPTO(*p, plane_fmt, p->num_planes, tcp,
+ print_v4l2_plane_pix_format_array_member);
+ tprint_struct_next();
+ PRINT_FIELD_U(*p, num_planes);
+ tprint_struct_end();
+ return true;
+}
+
+static bool
+DECL_print_v4l2_format_fmt(win)
+{
+ tprint_struct_begin();
+ PRINT_FIELD_OBJ_PTR(*p, w, print_v4l2_rect);
+ tprint_struct_next();
+ PRINT_FIELD_XVAL(*p, field, v4l2_fields, "V4L2_FIELD_???");
+ tprint_struct_next();
+ PRINT_FIELD_X(*p, chromakey);
+
+ tprint_struct_next();
+ tprints_field_name("clips");
+ struct_v4l2_clip clip;
+ bool rc = print_array(tcp, ptr_to_kulong(p->clips),
+ p->clipcount, &clip, sizeof(clip),
+ tfetch_mem, print_v4l2_clip, 0);
+
+ tprint_struct_next();
+ PRINT_FIELD_U(*p, clipcount);
+ tprint_struct_next();
+ PRINT_FIELD_PTR(*p, bitmap);
+ if (p->global_alpha) {
+ tprint_struct_next();
+ PRINT_FIELD_X(*p, global_alpha);
+ }
+ tprint_struct_end();
+ return rc;
+}
+
+static bool
+DECL_print_v4l2_format_fmt(vbi)
+{
+ tprint_struct_begin();
+ PRINT_FIELD_U(*p, sampling_rate);
+ tprint_struct_next();
+ PRINT_FIELD_U(*p, offset);
+ tprint_struct_next();
+ PRINT_FIELD_U(*p, samples_per_line);
+ tprint_struct_next();
+ PRINT_FIELD_PIXFMT(*p, sample_format, v4l2_pix_fmts);
+ tprint_struct_next();
+ PRINT_FIELD_D_ARRAY(*p, start);
+ tprint_struct_next();
+ PRINT_FIELD_U_ARRAY(*p, count);
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(*p, flags, v4l2_vbi_flags, "V4L2_VBI_???");
+ tprint_struct_end();
+ return true;
+}
+
+static bool
+DECL_print_v4l2_format_fmt(sliced)
+{
+ tprint_struct_begin();
+ PRINT_FIELD_FLAGS(*p, service_set, v4l2_sliced_flags,
+ "V4L2_SLICED_???");
+ tprint_struct_next();
+ PRINT_FIELD_X_ARRAY2D(*p, service_lines);
+ tprint_struct_next();
+ PRINT_FIELD_U(*p, io_size);
+ tprint_struct_end();
+ return true;
+}
+
+static bool
+DECL_print_v4l2_format_fmt(sdr)
+{
+ tprint_struct_begin();
+ PRINT_FIELD_PIXFMT(*p, pixelformat, v4l2_sdr_fmts);
+ if (p->buffersize) {
+ tprint_struct_next();
+ PRINT_FIELD_U(*p, buffersize);
+ }
+ tprint_struct_end();
+ return true;
+}
+
+static bool
+DECL_print_v4l2_format_fmt(meta)
+{
+ tprint_struct_begin();
+ PRINT_FIELD_PIXFMT(*p, dataformat, v4l2_meta_fmts);
+ tprint_struct_next();
+ PRINT_FIELD_U(*p, buffersize);
+ tprint_struct_end();
+ return true;
+}
+
+#define PRINT_FIELD_V4L2_FORMAT_FMT(where_, fmt_, field_, tcp_, ret_) \
+ do { \
+ tprints_field_name(#fmt_ "." #field_); \
+ (ret_) = (print_v4l2_format_fmt_ ## field_) \
+ ((tcp_), &((where_).fmt_.field_)); \
+ } while (0)
+
+static bool
+print_v4l2_format_fmt(struct tcb *const tcp, void (*const prefix_fun)(void),
+ const struct_v4l2_format *const f)
+{
+ bool ret = true;
+ switch (f->type) {
+ case V4L2_BUF_TYPE_VIDEO_CAPTURE:
+ case V4L2_BUF_TYPE_VIDEO_OUTPUT:
+ prefix_fun();
+ PRINT_FIELD_V4L2_FORMAT_FMT(*f, fmt, pix, tcp, ret);
+ break;
+
+ case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE:
+ case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE:
+ prefix_fun();
+ PRINT_FIELD_V4L2_FORMAT_FMT(*f, fmt, pix_mp, tcp, ret);
+ break;
+
+ /* OUTPUT_OVERLAY since Linux v2.6.22-rc1~1118^2~179 */
+ case V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY:
+ case V4L2_BUF_TYPE_VIDEO_OVERLAY:
+ prefix_fun();
+ PRINT_FIELD_V4L2_FORMAT_FMT(*f, fmt, win, tcp, ret);
+ break;
+
+ case V4L2_BUF_TYPE_VBI_CAPTURE:
+ case V4L2_BUF_TYPE_VBI_OUTPUT:
+ prefix_fun();
+ PRINT_FIELD_V4L2_FORMAT_FMT(*f, fmt, vbi, tcp, ret);
+ break;
+
+ /* both since Linux v2.6.14-rc2~64 */
+ case V4L2_BUF_TYPE_SLICED_VBI_CAPTURE:
+ case V4L2_BUF_TYPE_SLICED_VBI_OUTPUT:
+ prefix_fun();
+ PRINT_FIELD_V4L2_FORMAT_FMT(*f, fmt, sliced, tcp, ret);
+ break;
+
+ /* since Linux v4.4-rc1~118^2~14 */
+ case V4L2_BUF_TYPE_SDR_OUTPUT:
+ /* since Linux v3.15-rc1~85^2~213 */
+ case V4L2_BUF_TYPE_SDR_CAPTURE:
+ prefix_fun();
+ PRINT_FIELD_V4L2_FORMAT_FMT(*f, fmt, sdr, tcp, ret);
+ break;
+ /* since Linux v5.0-rc1~181^2~21 */
+ case V4L2_BUF_TYPE_META_OUTPUT:
+ /* since Linux v4.12-rc1~85^2~71 */
+ case V4L2_BUF_TYPE_META_CAPTURE:
+ prefix_fun();
+ PRINT_FIELD_V4L2_FORMAT_FMT(*f, fmt, meta, tcp, ret);
+ break;
+ default:
+ return false;
+ }
+ return ret;
+}
+
+static void
+tprint_struct_end_value_changed_struct_begin(void)
+{
+ tprint_struct_end();
+ tprint_value_changed();
+ tprint_struct_begin();
+}
+
+static int
+print_v4l2_format(struct tcb *const tcp, const kernel_ulong_t arg,
+ const bool is_get)
+{
+ struct_v4l2_format f;
+
+ if (entering(tcp)) {
+ tprints(", ");
+ if (umove_or_printaddr(tcp, arg, &f))
+ return RVAL_IOCTL_DECODED;
+ tprint_struct_begin();
+ PRINT_FIELD_XVAL(f, type, v4l2_buf_types,
+ "V4L2_BUF_TYPE_???");
+ if (is_get)
+ return 0;
+ if (!print_v4l2_format_fmt(tcp, tprint_struct_next, &f)) {
+ tprint_struct_end();
+ return RVAL_IOCTL_DECODED;
+ }
+
+ return 0;
+ }
+
+ if (!syserror(tcp) && !umove(tcp, arg, &f)) {
+ void (*const prefix_fun)(void) =
+ is_get ? tprint_struct_next :
+ tprint_struct_end_value_changed_struct_begin;
+ print_v4l2_format_fmt(tcp, prefix_fun, &f);
+ }
+
+ tprint_struct_end();
+
+ return RVAL_IOCTL_DECODED;
+}
+
+#include "xlat/v4l2_memories.h"
+
+static int
+print_v4l2_requestbuffers(struct tcb *const tcp, const kernel_ulong_t arg)
+{
+ struct v4l2_requestbuffers reqbufs;
+
+ if (entering(tcp)) {
+ tprints(", ");
+
+ if (umove_or_printaddr(tcp, arg, &reqbufs))
+ return RVAL_IOCTL_DECODED;
+
+ tprint_struct_begin();
+ PRINT_FIELD_XVAL(reqbufs, type, v4l2_buf_types,
+ "V4L2_BUF_TYPE_???");
+ tprint_struct_next();
+ PRINT_FIELD_XVAL(reqbufs, memory, v4l2_memories,
+ "V4L2_MEMORY_???");
+ tprint_struct_next();
+ PRINT_FIELD_U(reqbufs, count);
+
+ return 0;
+ }
+
+ if (!syserror(tcp) && !umove(tcp, arg, &reqbufs)) {
+ tprint_value_changed();
+ tprintf("%u", reqbufs.count);
+ }
+
+ tprint_struct_end();
+
+ return RVAL_IOCTL_DECODED;
+}
+
+#include "xlat/v4l2_buf_flags.h"
+#include "xlat/v4l2_buf_flags_ts_type.h"
+#include "xlat/v4l2_buf_flags_ts_src.h"
+
+#define XLAT_MACROS_ONLY
+# include "xlat/v4l2_buf_flags_masks.h"
+#undef XLAT_MACROS_ONLY
+
+static void
+print_v4l2_buffer_flags(uint32_t val)
+{
+ const uint32_t ts_type = val & V4L2_BUF_FLAG_TIMESTAMP_MASK;
+ const uint32_t ts_src = val & V4L2_BUF_FLAG_TSTAMP_SRC_MASK;
+ const uint32_t flags = val & ~ts_type & ~ts_src;
+
+ if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_RAW) {
+ tprintf("%#" PRIx32, val);
+ return;
+ }
+
+ if (flags) {
+ printflags(v4l2_buf_flags, flags, "V4L2_BUF_FLAG_???");
+ tprints("|");
+ }
+ printxval(v4l2_buf_flags_ts_type, ts_type,
+ "V4L2_BUF_FLAG_TIMESTAMP_???");
+ tprints("|");
+ printxval(v4l2_buf_flags_ts_src, ts_src,
+ "V4L2_BUF_FLAG_TSTAMP_SRC_???");
+}
+
+#define PRINT_FIELD_V4L2_BUFFER_FLAGS(where_, field_) \
+ do { \
+ tprints_field_name(#field_); \
+ print_v4l2_buffer_flags((where_).field_); \
+ } while (0)
+
+static void
+print_v4l2_timeval(const MPERS_PTR_ARG(kernel_v4l2_timeval_t *) const arg)
+{
+ const kernel_v4l2_timeval_t *const t = arg;
+ kernel_timeval64_t tv;
+
+ if (sizeof(tv.tv_sec) == sizeof(t->tv_sec) &&
+ sizeof(tv.tv_usec) == sizeof(t->tv_usec)) {
+ print_timeval64_data_size(t, sizeof(*t));
+ } else {
+ tv.tv_sec = sign_extend_unsigned_to_ll(t->tv_sec);
+ tv.tv_usec = zero_extend_signed_to_ull(t->tv_usec);
+ print_timeval64_data_size(&tv, sizeof(tv));
+ }
+}
+
+#define PRINT_FIELD_V4L2_TIMEVAL(where_, field_) \
+ do { \
+ tprints_field_name(#field_); \
+ print_v4l2_timeval(&((where_).field_)); \
+ } while (0)
+
+static int
+print_v4l2_buffer(struct tcb *const tcp, const unsigned int code,
+ const kernel_ulong_t arg)
+{
+ kernel_v4l2_buffer_t b;
+
+ if (entering(tcp)) {
+ tprints(", ");
+ if (umove_or_printaddr(tcp, arg, &b))
+ return RVAL_IOCTL_DECODED;
+ tprint_struct_begin();
+ PRINT_FIELD_XVAL(b, type, v4l2_buf_types,
+ "V4L2_BUF_TYPE_???");
+ if (code != VIDIOC_DQBUF) {
+ tprint_struct_next();
+ PRINT_FIELD_U(b, index);
+ }
+
+ return 0;
+ }
+
+ if (!syserror(tcp) && !umove(tcp, arg, &b)) {
+ if (code == VIDIOC_DQBUF) {
+ tprint_struct_next();
+ PRINT_FIELD_U(b, index);
+ }
+ tprint_struct_next();
+ PRINT_FIELD_XVAL(b, memory, v4l2_memories,
+ "V4L2_MEMORY_???");
+
+ if (b.memory == V4L2_MEMORY_MMAP) {
+ tprint_struct_next();
+ PRINT_FIELD_X(b, m.offset);
+ } else if (b.memory == V4L2_MEMORY_USERPTR) {
+ tprint_struct_next();
+ PRINT_FIELD_PTR(b, m.userptr);
+ }
+
+ tprint_struct_next();
+ PRINT_FIELD_U(b, length);
+ tprint_struct_next();
+ PRINT_FIELD_U(b, bytesused);
+ tprint_struct_next();
+ PRINT_FIELD_V4L2_BUFFER_FLAGS(b, flags);
+ if (code == VIDIOC_DQBUF) {
+ tprint_struct_next();
+ PRINT_FIELD_V4L2_TIMEVAL(b, timestamp);
+ }
+ tprint_struct_next();
+ tprint_more_data_follows();
+ }
+
+ tprint_struct_end();
+
+ return RVAL_IOCTL_DECODED;
+}
+
+static int
+print_v4l2_framebuffer(struct tcb *const tcp, const kernel_ulong_t arg)
+{
+ struct_v4l2_framebuffer b;
+
+ tprints(", ");
+ if (!umove_or_printaddr(tcp, arg, &b)) {
+ tprint_struct_begin();
+ PRINT_FIELD_X(b, capability);
+ tprint_struct_next();
+ PRINT_FIELD_X(b, flags);
+ tprint_struct_next();
+ PRINT_FIELD_PTR(b, base);
+ tprint_struct_end();
+ }
+
+ return RVAL_IOCTL_DECODED;
+}
+
+static int
+print_v4l2_buf_type(struct tcb *const tcp, const kernel_ulong_t arg)
+{
+ int type;
+
+ tprints(", ");
+ if (!umove_or_printaddr(tcp, arg, &type)) {
+ tprints("[");
+ printxval(v4l2_buf_types, type, "V4L2_BUF_TYPE_???");
+ tprints("]");
+ }
+ return RVAL_IOCTL_DECODED;
+}
+
+#include "xlat/v4l2_streaming_capabilities.h"
+#include "xlat/v4l2_capture_modes.h"
+
+static void
+print_v4l2_streamparm_capture(const struct v4l2_captureparm *const p)
+{
+ tprint_struct_begin();
+ PRINT_FIELD_FLAGS(*p, capability, v4l2_streaming_capabilities,
+ "V4L2_CAP_???");
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(*p, capturemode, v4l2_capture_modes,
+ "V4L2_MODE_???");
+ tprint_struct_next();
+ PRINT_FIELD_FRACT(*p, timeperframe);
+ tprint_struct_next();
+ PRINT_FIELD_X(*p, extendedmode);
+ tprint_struct_next();
+ PRINT_FIELD_U(*p, readbuffers);
+ tprint_struct_end();
+}
+
+static void
+print_v4l2_streamparm_output(const struct v4l2_outputparm *const p)
+{
+ tprint_struct_begin();
+ PRINT_FIELD_FLAGS(*p, capability, v4l2_streaming_capabilities,
+ "V4L2_CAP_???");
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(*p, outputmode, v4l2_capture_modes,
+ "V4L2_MODE_???");
+ tprint_struct_next();
+ PRINT_FIELD_FRACT(*p, timeperframe);
+ tprint_struct_next();
+ PRINT_FIELD_X(*p, extendedmode);
+ tprint_struct_next();
+ PRINT_FIELD_U(*p, writebuffers);
+ tprint_struct_end();
+}
+
+#define PRINT_FIELD_V4L2_STREAMPARM_PARM(where_, parm_, field_) \
+ do { \
+ tprints_field_name(#parm_ "." #field_); \
+ print_v4l2_streamparm_ ## field_(&((where_).parm_.field_)); \
+ } while (0)
+
+static int
+print_v4l2_streamparm(struct tcb *const tcp, const kernel_ulong_t arg,
+ const bool is_get)
+{
+ struct v4l2_streamparm s;
+
+ if (entering(tcp)) {
+ tprints(", ");
+ if (umove_or_printaddr(tcp, arg, &s))
+ return RVAL_IOCTL_DECODED;
+ tprint_struct_begin();
+ PRINT_FIELD_XVAL(s, type, v4l2_buf_types,
+ "V4L2_BUF_TYPE_???");
+ switch (s.type) {
+ case V4L2_BUF_TYPE_VIDEO_CAPTURE:
+ case V4L2_BUF_TYPE_VIDEO_OUTPUT:
+ if (is_get)
+ return 0;
+ tprints(", ");
+ break;
+ default:
+ tprint_struct_end();
+ return RVAL_IOCTL_DECODED;
+ }
+ } else {
+ if (syserror(tcp) || umove(tcp, arg, &s) < 0) {
+ tprint_struct_end();
+ return RVAL_IOCTL_DECODED;
+ }
+ tprints(is_get ? ", " : "} => {");
+ }
+
+ if (s.type == V4L2_BUF_TYPE_VIDEO_CAPTURE) {
+ PRINT_FIELD_V4L2_STREAMPARM_PARM(s, parm, capture);
+ } else {
+ PRINT_FIELD_V4L2_STREAMPARM_PARM(s, parm, output);
+ }
+
+ if (entering(tcp)) {
+ return 0;
+ } else {
+ tprint_struct_end();
+ return RVAL_IOCTL_DECODED;
+ }
+}
+
+static int
+print_v4l2_standard(struct tcb *const tcp, const kernel_ulong_t arg)
+{
+ struct_v4l2_standard s;
+
+ if (entering(tcp)) {
+ tprints(", ");
+ if (umove_or_printaddr(tcp, arg, &s))
+ return RVAL_IOCTL_DECODED;
+ tprint_struct_begin();
+ PRINT_FIELD_U(s, index);
+
+ return 0;
+ }
+
+ if (!syserror(tcp) && !umove(tcp, arg, &s)) {
+ tprint_struct_next();
+ PRINT_FIELD_CSTRING(s, name);
+ tprint_struct_next();
+ PRINT_FIELD_FRACT(s, frameperiod);
+ tprint_struct_next();
+ PRINT_FIELD_U(s, framelines);
+ }
+
+ tprint_struct_end();
+
+ return RVAL_IOCTL_DECODED;
+}
+
+#include "xlat/v4l2_input_types.h"
+
+static int
+print_v4l2_input(struct tcb *const tcp, const kernel_ulong_t arg)
+{
+ struct_v4l2_input i;
+
+ if (entering(tcp)) {
+ tprints(", ");
+ if (umove_or_printaddr(tcp, arg, &i))
+ return RVAL_IOCTL_DECODED;
+ tprint_struct_begin();
+ PRINT_FIELD_U(i, index);
+
+ return 0;
+ }
+
+ if (!syserror(tcp) && !umove(tcp, arg, &i)) {
+ tprint_struct_next();
+ PRINT_FIELD_CSTRING(i, name);
+ tprint_struct_next();
+ PRINT_FIELD_XVAL(i, type, v4l2_input_types,
+ "V4L2_INPUT_TYPE_???");
+ }
+
+ tprint_struct_end();
+
+ return RVAL_IOCTL_DECODED;
+}
+
+/*
+ * We include it here and not before print_v4l2_ext_controls as we need
+ * V4L2_CTRL_CLASS_* definitions for V4L2_CID_*_BASE ones.
+ */
+#include "xlat/v4l2_control_classes.h"
+#include "xlat/v4l2_control_id_bases.h"
+#include "xlat/v4l2_control_ids.h"
+#include "xlat/v4l2_control_query_flags.h"
+
+static void
+print_v4l2_cid(uint32_t cid, bool next_flags)
+{
+ if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_RAW) {
+ tprintf("%#x", cid);
+ return;
+ }
+
+ if (next_flags) {
+ uint32_t flags = cid & v4l2_control_query_flags->flags_mask;
+
+ if (flags) {
+ printflags(v4l2_control_query_flags, flags,
+ "V4L2_CTRL_FLAG_NEXT_???");
+ tprints("|");
+
+ cid &= ~flags;
+ }
+ }
+
+ const char *id_name = xlookup(v4l2_control_ids, cid);
+
+ if (id_name) {
+ print_xlat_ex(cid, id_name, XLAT_STYLE_DEFAULT);
+ return;
+ }
+
+ uint64_t class_id = cid;
+ const char *class_str = xlookup_le(v4l2_control_classes, &class_id);
+
+ if (!class_str || (cid - class_id) >= 0x10000) {
+ print_xlat_ex(cid, "V4L2_CID_???", PXF_DEFAULT_STR);
+ return;
+ }
+
+ /*
+ * As of now, the longest control class name is V4L2_CTRL_CLASS_IMAGE_SOURCE,
+ * of 28 characters long.
+ */
+ char tmp_str[64 + sizeof("+%#") + sizeof(class_id) * 2];
+
+ xsprintf(tmp_str, "%s+%#" PRIx64, class_str, cid - class_id);
+ print_xlat_ex(cid, tmp_str, XLAT_STYLE_DEFAULT);
+}
+
+#define PRINT_FIELD_V4L2_CID(where_, field_, next_) \
+ do { \
+ tprints_field_name(#field_); \
+ print_v4l2_cid((where_).field_, (next_)); \
+ } while (0)
+
+static int
+print_v4l2_control(struct tcb *const tcp, const kernel_ulong_t arg,
+ const bool is_get)
+{
+ struct v4l2_control c;
+
+ if (entering(tcp)) {
+ tprints(", ");
+ if (umove_or_printaddr(tcp, arg, &c))
+ return RVAL_IOCTL_DECODED;
+
+ tprint_struct_begin();
+ PRINT_FIELD_V4L2_CID(c, id, false);
+ if (!is_get) {
+ tprint_struct_next();
+ PRINT_FIELD_D(c, value);
+ }
+ return 0;
+ }
+
+ if (!syserror(tcp) && !umove(tcp, arg, &c)) {
+ if (is_get) {
+ tprint_struct_next();
+ PRINT_FIELD_D(c, value);
+ } else {
+ tprint_value_changed();
+ tprintf("%d", c.value);
+ }
+ }
+
+ tprint_struct_end();
+
+ return RVAL_IOCTL_DECODED;
+}
+
+#include "xlat/v4l2_tuner_types.h"
+#include "xlat/v4l2_tuner_capabilities.h"
+#include "xlat/v4l2_tuner_rxsubchanses.h"
+#include "xlat/v4l2_tuner_audmodes.h"
+
+static int
+print_v4l2_tuner(struct tcb *const tcp, const kernel_ulong_t arg,
+ const bool is_get)
+{
+ struct v4l2_tuner c;
+ if (entering(tcp)) {
+ tprints(", ");
+ if (umove_or_printaddr(tcp, arg, &c))
+ return RVAL_IOCTL_DECODED;
+ tprint_struct_begin();
+ PRINT_FIELD_U(c, index);
+ if (is_get)
+ return 0;
+ tprints(", ");
+ } else {
+ if (syserror(tcp) || umove(tcp, arg, &c) < 0) {
+ tprint_struct_end();
+ return RVAL_IOCTL_DECODED;
+ }
+ tprints(is_get ? ", " : "} => {");
+ }
+
+ PRINT_FIELD_CSTRING(c, name);
+ tprint_struct_next();
+ PRINT_FIELD_XVAL(c, type, v4l2_tuner_types, "V4L2_TUNER_???");
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(c, capability, v4l2_tuner_capabilities,
+ "V4L2_TUNER_CAP_???");
+ tprint_struct_next();
+ PRINT_FIELD_U(c, rangelow);
+ tprint_struct_next();
+ PRINT_FIELD_U(c, rangehigh);
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(c, rxsubchans, v4l2_tuner_rxsubchanses,
+ "V4L2_TUNER_SUB_???");
+ tprint_struct_next();
+ PRINT_FIELD_XVAL(c, audmode, v4l2_tuner_audmodes,
+ "V4L2_TUNER_MODE_???");
+ tprint_struct_next();
+ PRINT_FIELD_D(c, signal);
+ tprint_struct_next();
+ PRINT_FIELD_D(c, afc);
+
+ if (entering(tcp)) {
+ return 0;
+ } else {
+ tprint_struct_end();
+ return RVAL_IOCTL_DECODED;
+ }
+}
+
+#include "xlat/v4l2_control_types.h"
+#include "xlat/v4l2_control_flags.h"
+
+static int
+print_v4l2_queryctrl(struct tcb *const tcp, const kernel_ulong_t arg)
+{
+ struct v4l2_queryctrl c;
+
+ if (entering(tcp)) {
+ tprints(", ");
+ if (umove_or_printaddr(tcp, arg, &c))
+ return RVAL_IOCTL_DECODED;
+ set_tcb_priv_ulong(tcp, c.id);
+ tprint_struct_begin();
+ PRINT_FIELD_V4L2_CID(c, id, true);
+
+ return 0;
+ }
+
+ /* exiting */
+ if (syserror(tcp) || umove(tcp, arg, &c) < 0) {
+ tprint_struct_end();
+ return RVAL_IOCTL_DECODED;
+ }
+
+ unsigned long entry_id = get_tcb_priv_ulong(tcp);
+
+ if (c.id != entry_id) {
+ tprint_value_changed();
+ print_v4l2_cid(c.id, false);
+ }
+
+ tprint_struct_next();
+ PRINT_FIELD_XVAL(c, type, v4l2_control_types,
+ "V4L2_CTRL_TYPE_???");
+ tprint_struct_next();
+ PRINT_FIELD_CSTRING(c, name);
+ if (!abbrev(tcp)) {
+ tprint_struct_next();
+ PRINT_FIELD_D(c, minimum);
+ tprint_struct_next();
+ PRINT_FIELD_D(c, maximum);
+ tprint_struct_next();
+ PRINT_FIELD_D(c, step);
+ tprint_struct_next();
+ PRINT_FIELD_D(c, default_value);
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(c, flags, v4l2_control_flags,
+ "V4L2_CTRL_FLAG_???");
+ if (!IS_ARRAY_ZERO(c.reserved)) {
+ tprint_struct_next();
+ PRINT_FIELD_ARRAY(c, reserved, tcp,
+ print_xint32_array_member);
+ }
+ } else {
+ tprint_struct_next();
+ tprint_more_data_follows();
+ }
+ tprint_struct_end();
+
+ return RVAL_IOCTL_DECODED;
+}
+
+static int
+print_v4l2_query_ext_ctrl(struct tcb *const tcp, const kernel_ulong_t arg)
+{
+ struct_v4l2_query_ext_ctrl c;
+
+ if (entering(tcp)) {
+ tprints(", ");
+ if (umove_or_printaddr(tcp, arg, &c))
+ return RVAL_IOCTL_DECODED;
+ set_tcb_priv_ulong(tcp, c.id);
+ tprint_struct_begin();
+ PRINT_FIELD_V4L2_CID(c, id, true);
+
+ return 0;
+ }
+
+ /* exiting */
+ if (syserror(tcp) || umove(tcp, arg, &c) < 0) {
+ tprint_struct_end();
+ return RVAL_IOCTL_DECODED;
+ }
+
+ unsigned long entry_id = get_tcb_priv_ulong(tcp);
+
+ if (c.id != entry_id) {
+ tprint_value_changed();
+ print_v4l2_cid(c.id, false);
+ }
+
+ tprint_struct_next();
+ PRINT_FIELD_XVAL(c, type, v4l2_control_types,
+ "V4L2_CTRL_TYPE_???");
+ tprint_struct_next();
+ PRINT_FIELD_CSTRING(c, name);
+ if (!abbrev(tcp)) {
+ tprint_struct_next();
+ PRINT_FIELD_D(c, minimum);
+ tprint_struct_next();
+ PRINT_FIELD_D(c, maximum);
+ tprint_struct_next();
+ PRINT_FIELD_U(c, step);
+ tprint_struct_next();
+ PRINT_FIELD_D(c, default_value);
+ tprint_struct_next();
+ PRINT_FIELD_FLAGS(c, flags, v4l2_control_flags,
+ "V4L2_CTRL_FLAG_???");
+ tprint_struct_next();
+ PRINT_FIELD_U(c, elem_size);
+ tprint_struct_next();
+ PRINT_FIELD_U(c, elems);
+ tprint_struct_next();
+ PRINT_FIELD_U(c, nr_of_dims);
+ tprint_struct_next();
+ PRINT_FIELD_ARRAY_UPTO(c, dims, c.nr_of_dims, tcp,
+ print_uint32_array_member);
+ if (!IS_ARRAY_ZERO(c.reserved)) {
+ tprint_struct_next();
+ PRINT_FIELD_ARRAY(c, reserved, tcp,
+ print_xint32_array_member);
+ }
+ } else {
+ tprint_struct_next();
+ tprint_more_data_follows();
+ }
+ tprint_struct_end();
+
+ return RVAL_IOCTL_DECODED;
+}
+
+static int
+print_v4l2_cropcap(struct tcb *const tcp, const kernel_ulong_t arg)
+{
+ struct v4l2_cropcap c;
+
+ if (entering(tcp)) {
+ tprints(", ");
+ if (umove_or_printaddr(tcp, arg, &c))
+ return RVAL_IOCTL_DECODED;
+ tprint_struct_begin();
+ PRINT_FIELD_XVAL(c, type, v4l2_buf_types,
+ "V4L2_BUF_TYPE_???");
+
+ return 0;
+ }
+
+ if (!syserror(tcp) && !umove(tcp, arg, &c)) {
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_PTR(c, bounds, print_v4l2_rect);
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_PTR(c, defrect, print_v4l2_rect);
+ tprint_struct_next();
+ PRINT_FIELD_FRACT(c, pixelaspect);
+ }
+
+ tprint_struct_end();
+
+ return RVAL_IOCTL_DECODED;
+}
+
+static int
+print_v4l2_crop(struct tcb *const tcp, const kernel_ulong_t arg,
+ const bool is_get)
+{
+ struct v4l2_crop c;
+
+ if (entering(tcp)) {
+ tprints(", ");
+ if (umove_or_printaddr(tcp, arg, &c))
+ return RVAL_IOCTL_DECODED;
+ tprint_struct_begin();
+ PRINT_FIELD_XVAL(c, type, v4l2_buf_types,
+ "V4L2_BUF_TYPE_???");
+ if (is_get)
+ return 0;
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_PTR(c, c, print_v4l2_rect);
+ } else {
+ if (!syserror(tcp) && !umove(tcp, arg, &c)) {
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_PTR(c, c, print_v4l2_rect);
+ }
+ }
+
+ tprint_struct_end();
+
+ return RVAL_IOCTL_DECODED;
+}
+
+static bool
+print_v4l2_ext_control(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data)
+{
+ const struct_v4l2_ext_control *p = elem_buf;
+
+ tprint_struct_begin();
+ PRINT_FIELD_XVAL(*p, id, v4l2_control_ids, "V4L2_CID_???");
+ tprint_struct_next();
+ PRINT_FIELD_U(*p, size);
+ if (p->size > 0) {
+ tprint_struct_next();
+ tprints_field_name("string");
+ printstrn(tcp, ptr_to_kulong(p->string), p->size);
+ } else {
+ tprint_struct_next();
+ PRINT_FIELD_D(*p, value);
+ tprint_struct_next();
+ PRINT_FIELD_D(*p, value64);
+ }
+ tprint_struct_end();
+
+ return true;
+}
+
+static int
+print_v4l2_ext_controls(struct tcb *const tcp, const kernel_ulong_t arg,
+ const bool is_get)
+{
+ struct_v4l2_ext_controls c;
+
+ if (entering(tcp)) {
+ tprints(", ");
+ if (umove_or_printaddr(tcp, arg, &c))
+ return RVAL_IOCTL_DECODED;
+ tprint_struct_begin();
+ PRINT_FIELD_XVAL(c, ctrl_class, v4l2_control_classes,
+ "V4L2_CTRL_CLASS_???");
+ tprint_struct_next();
+ PRINT_FIELD_U(c, count);
+ if (!c.count) {
+ tprint_struct_end();
+ return RVAL_IOCTL_DECODED;
+ }
+ if (is_get)
+ return 0;
+ tprints(", ");
+ } else {
+ if (umove(tcp, arg, &c) < 0) {
+ tprint_struct_end();
+ return RVAL_IOCTL_DECODED;
+ }
+ tprints(is_get ? ", " : "} => {");
+ }
+
+ tprints_field_name("controls");
+ struct_v4l2_ext_control ctrl;
+ bool fail = !print_array(tcp, ptr_to_kulong(c.controls), c.count,
+ &ctrl, sizeof(ctrl),
+ tfetch_mem_ignore_syserror,
+ print_v4l2_ext_control, 0);
+
+ if (exiting(tcp) && syserror(tcp)) {
+ tprint_struct_next();
+ PRINT_FIELD_U(c, error_idx);
+ }
+
+ if (exiting(tcp) || fail) {
+ tprint_struct_end();
+ return RVAL_IOCTL_DECODED;
+ }
+
+ /* entering */
+ return 0;
+}
+
+#include "xlat/v4l2_framesize_types.h"
+
+static void
+print_v4l2_frmsize_discrete(const MPERS_PTR_ARG(struct_v4l2_frmsize_discrete *) const arg)
+{
+ const struct_v4l2_frmsize_discrete *const p = arg;
+ tprint_struct_begin();
+ PRINT_FIELD_U(*p, width);
+ tprint_struct_next();
+ PRINT_FIELD_U(*p, height);
+ tprint_struct_end();
+}
+
+static void
+print_v4l2_frmsize_stepwise(const MPERS_PTR_ARG(struct_v4l2_frmsize_stepwise *) const arg)
+{
+ const struct_v4l2_frmsize_stepwise *const p = arg;
+ tprint_struct_begin();
+ PRINT_FIELD_U(*p, min_width);
+ tprint_struct_next();
+ PRINT_FIELD_U(*p, max_width);
+ tprint_struct_next();
+ PRINT_FIELD_U(*p, step_width);
+ tprint_struct_next();
+ PRINT_FIELD_U(*p, min_height);
+ tprint_struct_next();
+ PRINT_FIELD_U(*p, max_height);
+ tprint_struct_next();
+ PRINT_FIELD_U(*p, step_height);
+ tprint_struct_end();
+}
+
+#define PRINT_FIELD_V4L2_FRMSIZE_TYPE(where_, field_) \
+ do { \
+ tprints_field_name(#field_); \
+ print_v4l2_frmsize_ ## field_(&((where_).field_)); \
+ } while (0)
+
+static int
+print_v4l2_frmsizeenum(struct tcb *const tcp, const kernel_ulong_t arg)
+{
+ struct_v4l2_frmsizeenum s;
+
+ if (entering(tcp)) {
+ tprints(", ");
+ if (umove_or_printaddr(tcp, arg, &s))
+ return RVAL_IOCTL_DECODED;
+ tprint_struct_begin();
+ PRINT_FIELD_U(s, index);
+ tprint_struct_next();
+ PRINT_FIELD_PIXFMT(s, pixel_format, v4l2_pix_fmts);
+ return 0;
+ }
+
+ if (!syserror(tcp) && !umove(tcp, arg, &s)) {
+ tprint_struct_next();
+ PRINT_FIELD_XVAL(s, type, v4l2_framesize_types,
+ "V4L2_FRMSIZE_TYPE_???");
+ switch (s.type) {
+ case V4L2_FRMSIZE_TYPE_DISCRETE:
+ tprint_struct_next();
+ PRINT_FIELD_V4L2_FRMSIZE_TYPE(s, discrete);
+ break;
+ case V4L2_FRMSIZE_TYPE_STEPWISE:
+ tprint_struct_next();
+ PRINT_FIELD_V4L2_FRMSIZE_TYPE(s, stepwise);
+ break;
+ }
+ }
+ tprint_struct_end();
+ return RVAL_IOCTL_DECODED;
+}
+
+#include "xlat/v4l2_frameinterval_types.h"
+
+static void
+print_v4l2_frmival_stepwise(const MPERS_PTR_ARG(struct_v4l2_frmival_stepwise *) const arg)
+{
+ const struct_v4l2_frmival_stepwise *const p = arg;
+ tprint_struct_begin();
+ PRINT_FIELD_FRACT(*p, min);
+ tprint_struct_next();
+ PRINT_FIELD_FRACT(*p, max);
+ tprint_struct_next();
+ PRINT_FIELD_FRACT(*p, step);
+ tprint_struct_end();
+}
+
+#define PRINT_FIELD_V4L2_FRMIVAL_STEPWISE(where_, field_) \
+ do { \
+ tprints_field_name(#field_); \
+ print_v4l2_frmival_stepwise(&((where_).field_)); \
+ } while (0)
+
+static int
+print_v4l2_frmivalenum(struct tcb *const tcp, const kernel_ulong_t arg)
+{
+ struct_v4l2_frmivalenum f;
+
+ if (entering(tcp)) {
+ tprints(", ");
+ if (umove_or_printaddr(tcp, arg, &f))
+ return RVAL_IOCTL_DECODED;
+ tprint_struct_begin();
+ PRINT_FIELD_U(f, index);
+ tprint_struct_next();
+ PRINT_FIELD_PIXFMT(f, pixel_format, v4l2_pix_fmts);
+ tprint_struct_next();
+ PRINT_FIELD_U(f, width);
+ tprint_struct_next();
+ PRINT_FIELD_U(f, height);
+ return 0;
+ }
+
+ if (!syserror(tcp) && !umove(tcp, arg, &f)) {
+ tprint_struct_next();
+ PRINT_FIELD_XVAL(f, type, v4l2_frameinterval_types,
+ "V4L2_FRMIVAL_TYPE_???");
+ switch (f.type) {
+ case V4L2_FRMIVAL_TYPE_DISCRETE:
+ tprint_struct_next();
+ PRINT_FIELD_FRACT(f, discrete);
+ break;
+ case V4L2_FRMIVAL_TYPE_STEPWISE:
+ case V4L2_FRMSIZE_TYPE_CONTINUOUS:
+ tprint_struct_next();
+ PRINT_FIELD_V4L2_FRMIVAL_STEPWISE(f, stepwise);
+ break;
+ }
+ }
+
+ tprint_struct_end();
+
+ return RVAL_IOCTL_DECODED;
+}
+
+static void
+print_v4l2_create_buffers_format(const typeof_field(struct_v4l2_create_buffers, format) *const p,
+ struct tcb *const tcp)
+{
+ tprint_struct_begin();
+ PRINT_FIELD_XVAL(*p, type, v4l2_buf_types,
+ "V4L2_BUF_TYPE_???");
+ print_v4l2_format_fmt(tcp, tprint_struct_next,
+ (const struct_v4l2_format *) p);
+ tprint_struct_end();
+}
+
+static int
+print_v4l2_create_buffers(struct tcb *const tcp, const kernel_ulong_t arg)
+{
+ static const char fmt[] = "{index=%u, count=%u}";
+ static char outstr[sizeof(fmt) + sizeof(int) * 6];
+
+ struct_v4l2_create_buffers b;
+
+ if (entering(tcp)) {
+ tprints(", ");
+ if (umove_or_printaddr(tcp, arg, &b))
+ return RVAL_IOCTL_DECODED;
+ tprint_struct_begin();
+ PRINT_FIELD_U(b, count);
+ tprint_struct_next();
+ PRINT_FIELD_XVAL(b, memory, v4l2_memories,
+ "V4L2_MEMORY_???");
+ tprint_struct_next();
+ PRINT_FIELD_OBJ_PTR(b, format,
+ print_v4l2_create_buffers_format, tcp);
+ tprint_struct_end();
+ return 0;
+ }
+
+ if (syserror(tcp) || umove(tcp, arg, &b))
+ return RVAL_IOCTL_DECODED;
+
+ xsprintf(outstr, fmt, b.index, b.count);
+ tcp->auxstr = outstr;
+
+ return RVAL_IOCTL_DECODED | RVAL_STR;
+}
+
+MPERS_PRINTER_DECL(int, v4l2_ioctl, struct tcb *const tcp,
+ const unsigned int code, const kernel_ulong_t arg)
+{
+ if (!verbose(tcp))
+ return RVAL_DECODED;
+
+ switch (code) {
+ case VIDIOC_QUERYCAP: /* R */
+ return print_v4l2_capability(tcp, arg);
+
+ case VIDIOC_ENUM_FMT: /* RW */
+ return print_v4l2_fmtdesc(tcp, arg);
+
+ case VIDIOC_G_FMT: /* RW */
+ case VIDIOC_S_FMT: /* RW */
+ case VIDIOC_TRY_FMT: /* RW */
+ return print_v4l2_format(tcp, arg, code == VIDIOC_G_FMT);
+
+ case VIDIOC_REQBUFS: /* RW */
+ return print_v4l2_requestbuffers(tcp, arg);
+
+ case VIDIOC_QUERYBUF: /* RW */
+ case VIDIOC_QBUF: /* RW */
+ case VIDIOC_DQBUF: /* RW */
+ return print_v4l2_buffer(tcp, code, arg);
+
+ case VIDIOC_G_FBUF: /* R */
+ if (entering(tcp))
+ return 0;
+ ATTRIBUTE_FALLTHROUGH;
+ case VIDIOC_S_FBUF: /* W */
+ return print_v4l2_framebuffer(tcp, arg);
+
+ case VIDIOC_STREAMON: /* W */
+ case VIDIOC_STREAMOFF: /* W */
+ return print_v4l2_buf_type(tcp, arg);
+
+ case VIDIOC_G_PARM: /* RW */
+ case VIDIOC_S_PARM: /* RW */
+ return print_v4l2_streamparm(tcp, arg, code == VIDIOC_G_PARM);
+
+ case VIDIOC_G_STD: /* R */
+ if (entering(tcp))
+ return 0;
+ ATTRIBUTE_FALLTHROUGH;
+ case VIDIOC_S_STD: /* W */
+ tprints(", ");
+ printnum_int64(tcp, arg, "%#" PRIx64);
+ break;
+
+ case VIDIOC_ENUMSTD: /* RW */
+ return print_v4l2_standard(tcp, arg);
+
+ case VIDIOC_ENUMINPUT: /* RW */
+ return print_v4l2_input(tcp, arg);
+
+ case VIDIOC_G_CTRL: /* RW */
+ case VIDIOC_S_CTRL: /* RW */
+ return print_v4l2_control(tcp, arg, code == VIDIOC_G_CTRL);
+
+ case VIDIOC_G_TUNER: /* RW */
+ case VIDIOC_S_TUNER: /* RW */
+ return print_v4l2_tuner(tcp, arg, code == VIDIOC_G_TUNER);
+
+ case VIDIOC_QUERYCTRL: /* RW */
+ return print_v4l2_queryctrl(tcp, arg);
+
+ case VIDIOC_QUERY_EXT_CTRL: /* RW */
+ return print_v4l2_query_ext_ctrl(tcp, arg);
+
+ case VIDIOC_G_INPUT: /* R */
+ if (entering(tcp))
+ return 0;
+ ATTRIBUTE_FALLTHROUGH;
+ case VIDIOC_S_INPUT: /* RW */
+ tprints(", ");
+ printnum_int(tcp, arg, "%u");
+ break;
+
+ case VIDIOC_CROPCAP: /* RW */
+ return print_v4l2_cropcap(tcp, arg);
+
+ case VIDIOC_G_CROP: /* RW */
+ case VIDIOC_S_CROP: /* W */
+ return print_v4l2_crop(tcp, arg, code == VIDIOC_G_CROP);
+
+ case VIDIOC_S_EXT_CTRLS: /* RW */
+ case VIDIOC_TRY_EXT_CTRLS: /* RW */
+ case VIDIOC_G_EXT_CTRLS: /* RW */
+ return print_v4l2_ext_controls(tcp, arg,
+ code == VIDIOC_G_EXT_CTRLS);
+
+ case VIDIOC_ENUM_FRAMESIZES: /* RW */
+ return print_v4l2_frmsizeenum(tcp, arg);
+
+ case VIDIOC_ENUM_FRAMEINTERVALS: /* RW */
+ return print_v4l2_frmivalenum(tcp, arg);
+
+ case VIDIOC_CREATE_BUFS: /* RW */
+ return print_v4l2_create_buffers(tcp, arg);
+
+ default:
+ return RVAL_DECODED;
+ }
+
+ return RVAL_IOCTL_DECODED;
+}
diff --git a/src/wait.c b/src/wait.c
new file mode 100644
index 000000000..df2ace9ee
--- /dev/null
+++ b/src/wait.c
@@ -0,0 +1,164 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993-1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
+ * Copyright (c) 2002-2004 Roland McGrath <roland@redhat.com>
+ * Copyright (c) 2004 Ulrich Drepper <drepper@redhat.com>
+ * Copyright (c) 2009-2013 Denys Vlasenko <dvlasenk@redhat.com>
+ * Copyright (c) 2014-2015 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2014-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include "ptrace.h"
+
+#include "wait.h"
+
+#include "xlat/wait4_options.h"
+#include "xlat/ptrace_events.h"
+
+static int
+printstatus(int status)
+{
+ int exited = 0;
+
+ /*
+ * Here is a tricky presentation problem. This solution
+ * is still not entirely satisfactory but since there
+ * are no wait status constructors it will have to do.
+ */
+ if (WIFSTOPPED(status)) {
+ int sig = WSTOPSIG(status);
+ tprintf("[{WIFSTOPPED(s) && WSTOPSIG(s) == %s%s}",
+ sprintsigname(sig & 0x7f),
+ sig & 0x80 ? " | 0x80" : "");
+ status &= ~W_STOPCODE(sig);
+ } else if (WIFSIGNALED(status)) {
+ tprintf("[{WIFSIGNALED(s) && WTERMSIG(s) == %s%s}",
+ sprintsigname(WTERMSIG(status)),
+ WCOREDUMP(status) ? " && WCOREDUMP(s)" : "");
+ status &= ~(W_EXITCODE(0, WTERMSIG(status)) | WCOREFLAG);
+ } else if (WIFEXITED(status)) {
+ tprintf("[{WIFEXITED(s) && WEXITSTATUS(s) == %d}",
+ WEXITSTATUS(status));
+ exited = 1;
+ status &= ~W_EXITCODE(WEXITSTATUS(status), 0);
+ }
+#ifdef WIFCONTINUED
+ else if (WIFCONTINUED(status)) {
+ tprints("[{WIFCONTINUED(s)}");
+ status &= ~W_CONTINUED;
+ }
+#endif
+ else {
+ tprintf("[%#x]", status);
+ return 0;
+ }
+
+ if (status) {
+ unsigned int event = (unsigned int) status >> 16;
+ if (event) {
+ tprints(" | ");
+ printxval(ptrace_events, event, "PTRACE_EVENT_???");
+ tprints(" << 16");
+ status &= 0xffff;
+ }
+ if (status)
+ tprintf(" | %#x", status);
+ }
+ tprints("]");
+
+ return exited;
+}
+
+static int
+printwaitn(struct tcb *const tcp,
+ void (*const print_rusage)(struct tcb *, kernel_ulong_t))
+{
+ if (entering(tcp)) {
+ printpid_tgid_pgid(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ } else {
+ int status;
+
+ /* status */
+ if (tcp->u_rval == 0)
+ printaddr(tcp->u_arg[1]);
+ else if (!umove_or_printaddr(tcp, tcp->u_arg[1], &status))
+ printstatus(status);
+ /* options */
+ tprints(", ");
+ printflags(wait4_options, tcp->u_arg[2], "W???");
+ if (print_rusage) {
+ /* usage */
+ tprints(", ");
+ if (tcp->u_rval > 0)
+ print_rusage(tcp, tcp->u_arg[3]);
+ else
+ printaddr(tcp->u_arg[3]);
+ }
+ }
+ return RVAL_TGID;
+}
+
+SYS_FUNC(waitpid)
+{
+ return printwaitn(tcp, NULL);
+}
+
+#if HAVE_ARCH_TIME32_SYSCALLS || HAVE_ARCH_OLD_TIME64_SYSCALLS
+SYS_FUNC(wait4)
+{
+ return printwaitn(tcp, printrusage);
+}
+#endif
+
+#ifdef ALPHA
+SYS_FUNC(osf_wait4)
+{
+ return printwaitn(tcp, printrusage32);
+}
+#endif
+
+#include "xlat/waitid_types.h"
+
+SYS_FUNC(waitid)
+{
+ unsigned int idtype = (unsigned int) tcp->u_arg[0];
+ int id = tcp->u_arg[1];
+
+ if (entering(tcp)) {
+ printxval(waitid_types, idtype, "P_???");
+ tprints(", ");
+ switch (idtype)
+ {
+ case P_PID:
+ printpid(tcp, id, PT_TGID);
+ break;
+ case P_PIDFD:
+ printfd(tcp, id);
+ break;
+ case P_PGID:
+ printpid(tcp, id, PT_PGID);
+ break;
+ default:
+ tprintf("%d", id);
+ break;
+ }
+ tprints(", ");
+ } else {
+ /* siginfo */
+ printsiginfo_at(tcp, tcp->u_arg[2]);
+ /* options */
+ tprints(", ");
+ printflags(wait4_options, tcp->u_arg[3], "W???");
+ /* usage */
+ tprints(", ");
+ printrusage(tcp, tcp->u_arg[4]);
+ }
+ return 0;
+}
diff --git a/src/wait.h b/src/wait.h
new file mode 100644
index 000000000..f4e626bc5
--- /dev/null
+++ b/src/wait.h
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2004-2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_WAIT_H
+# define STRACE_WAIT_H
+
+# include "defs.h"
+
+# include <sys/wait.h>
+
+# include "static_assert.h"
+
+/*
+ * On Linux, the "core dumped" flag is hard-coded to 0x80:
+ * fs/coredump.c:coredump_finish() after v3.10-rc1~143^2~41,
+ * fs/coredump.c:do_coredump() between v3.7-rc1~134^2~4 and v3.10-rc1~143^2~41,
+ * or fs/exec.c:do_coredump() before v3.7-rc1~134^2~4
+ */
+# ifndef WCOREFLAG
+# define WCOREFLAG 0x80
+# else
+static_assert((WCOREFLAG) == 0x80, "WCOREFLAG != 0x80");
+# endif
+# ifndef WCOREDUMP
+# define WCOREDUMP(status) ((status) & (WCOREFLAG))
+# endif
+
+# ifndef W_STOPCODE
+# define W_STOPCODE(sig) ((sig) << 8 | 0x7f)
+# endif
+# ifndef W_EXITCODE
+# define W_EXITCODE(ret, sig) ((ret) << 8 | (sig))
+# endif
+# ifndef W_CONTINUED
+# define W_CONTINUED 0xffff
+# endif
+
+#endif /* STRACE_WAIT_H */
diff --git a/src/watchdog_ioctl.c b/src/watchdog_ioctl.c
new file mode 100644
index 000000000..160c5f52f
--- /dev/null
+++ b/src/watchdog_ioctl.c
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#include <linux/watchdog.h>
+
+#define XLAT_MACROS_ONLY
+#include "xlat/watchdog_ioctl_cmds.h"
+#undef XLAT_MACROS_ONLY
+
+int
+watchdog_ioctl(struct tcb *const tcp, const unsigned int code,
+ const kernel_ulong_t arg)
+{
+ switch (code) {
+ case WDIOC_GETSTATUS:
+ case WDIOC_GETBOOTSTATUS:
+ case WDIOC_GETTEMP:
+ case WDIOC_GETTIMEOUT:
+ case WDIOC_GETPRETIMEOUT:
+ case WDIOC_GETTIMELEFT:
+ if (entering(tcp))
+ return 0;
+ ATTRIBUTE_FALLTHROUGH;
+ case WDIOC_SETTIMEOUT:
+ case WDIOC_SETPRETIMEOUT:
+ tprints(", ");
+ printnum_int(tcp, arg, "%d");
+ break;
+
+ /*
+ * linux/watchdog.h says that this takes an int, but in
+ * practice the argument is ignored.
+ */
+ case WDIOC_KEEPALIVE:
+ break;
+ default:
+ return RVAL_DECODED;
+ }
+ return RVAL_IOCTL_DECODED;
+}
diff --git a/src/xattr.c b/src/xattr.c
new file mode 100644
index 000000000..089b3e3a7
--- /dev/null
+++ b/src/xattr.c
@@ -0,0 +1,131 @@
+/*
+ * Copyright (c) 2002-2005 Roland McGrath <roland@redhat.com>
+ * Copyright (c) 2004 Ulrich Drepper <drepper@redhat.com>
+ * Copyright (c) 2005-2018 Dmitry V. Levin <ldv@strace.io>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#ifdef HAVE_SYS_XATTR_H
+# include <sys/xattr.h>
+#endif
+
+#include "xlat/xattrflags.h"
+
+#ifndef XATTR_SIZE_MAX
+# define XATTR_SIZE_MAX 65536
+#endif
+
+static void
+print_xattr_val(struct tcb *const tcp,
+ const kernel_ulong_t addr,
+ const kernel_ulong_t insize,
+ const kernel_ulong_t size)
+{
+ tprints(", ");
+
+ if (size > XATTR_SIZE_MAX)
+ printaddr(addr);
+ else
+ printstr_ex(tcp, addr, size, QUOTE_OMIT_TRAILING_0);
+ tprintf(", %" PRI_klu, insize);
+}
+
+SYS_FUNC(setxattr)
+{
+ printpath(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ printstr(tcp, tcp->u_arg[1]);
+ print_xattr_val(tcp, tcp->u_arg[2], tcp->u_arg[3], tcp->u_arg[3]);
+ tprints(", ");
+ printflags(xattrflags, tcp->u_arg[4], "XATTR_???");
+ return RVAL_DECODED;
+}
+
+SYS_FUNC(fsetxattr)
+{
+ printfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ printstr(tcp, tcp->u_arg[1]);
+ print_xattr_val(tcp, tcp->u_arg[2], tcp->u_arg[3], tcp->u_arg[3]);
+ tprints(", ");
+ printflags(xattrflags, tcp->u_arg[4], "XATTR_???");
+ return RVAL_DECODED;
+}
+
+SYS_FUNC(getxattr)
+{
+ if (entering(tcp)) {
+ printpath(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ printstr(tcp, tcp->u_arg[1]);
+ } else {
+ print_xattr_val(tcp, tcp->u_arg[2], tcp->u_arg[3], tcp->u_rval);
+ }
+ return 0;
+}
+
+SYS_FUNC(fgetxattr)
+{
+ if (entering(tcp)) {
+ printfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ printstr(tcp, tcp->u_arg[1]);
+ } else {
+ print_xattr_val(tcp, tcp->u_arg[2], tcp->u_arg[3], tcp->u_rval);
+ }
+ return 0;
+}
+
+static void
+print_xattr_list(struct tcb *const tcp, const kernel_ulong_t addr,
+ const kernel_ulong_t size)
+{
+ if (!size || syserror(tcp)) {
+ printaddr(addr);
+ } else {
+ printstrn(tcp, addr, tcp->u_rval);
+ }
+ tprintf(", %" PRI_klu, size);
+}
+
+SYS_FUNC(listxattr)
+{
+ if (entering(tcp)) {
+ printpath(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ } else {
+ print_xattr_list(tcp, tcp->u_arg[1], tcp->u_arg[2]);
+ }
+ return 0;
+}
+
+SYS_FUNC(flistxattr)
+{
+ if (entering(tcp)) {
+ printfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ } else {
+ print_xattr_list(tcp, tcp->u_arg[1], tcp->u_arg[2]);
+ }
+ return 0;
+}
+
+SYS_FUNC(removexattr)
+{
+ printpath(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ printstr(tcp, tcp->u_arg[1]);
+ return RVAL_DECODED;
+}
+
+SYS_FUNC(fremovexattr)
+{
+ printfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ printstr(tcp, tcp->u_arg[1]);
+ return RVAL_DECODED;
+}
diff --git a/src/xfs_quota_stat.h b/src/xfs_quota_stat.h
new file mode 100644
index 000000000..3e78004a0
--- /dev/null
+++ b/src/xfs_quota_stat.h
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2018 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include <stdint.h>
+#include "kernel_types.h"
+
+typedef struct fs_qfilestat {
+ uint64_t qfs_ino; /* inode number */
+ uint64_t qfs_nblks; /* number of BBs 512-byte-blks */
+ uint32_t qfs_nextents; /* number of extents */
+} fs_qfilestat_t;
+
+struct xfs_dqstats {
+ int8_t qs_version; /* version number for future changes */
+ uint16_t qs_flags; /* XFS_QUOTA_{U,P,G}DQ_{ACCT,ENFD} */
+ int8_t qs_pad; /* unused */
+ fs_qfilestat_t qs_uquota; /* user quota storage information */
+ fs_qfilestat_t qs_gquota; /* group quota storage information */
+ uint32_t qs_incoredqs; /* number of dquots incore */
+ int32_t qs_btimelimit; /* limit for blks timer */
+ int32_t qs_itimelimit; /* limit for inodes timer */
+ int32_t qs_rtbtimelimit; /* limit for rt blks timer */
+ uint16_t qs_bwarnlimit; /* limit for num warnings */
+ uint16_t qs_iwarnlimit; /* limit for num warnings */
+};
diff --git a/src/xgetdents.c b/src/xgetdents.c
new file mode 100644
index 000000000..f5764ab1a
--- /dev/null
+++ b/src/xgetdents.c
@@ -0,0 +1,141 @@
+/*
+ * Copyright (c) 2020 Dmitry V. Levin <ldv@strace.io>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "xgetdents.h"
+#include "kernel_dirent.h"
+
+static void
+decode_dents(struct tcb *const tcp, kernel_ulong_t addr, unsigned int len,
+ const unsigned int header_size,
+ const decode_dentry_head_fn decode_dentry_head,
+ const decode_dentry_tail_fn decode_dentry_tail)
+{
+ union {
+ kernel_dirent_t ent;
+ kernel_dirent64_t ent64;
+ } dent;
+ unsigned int count = 0;
+
+ if (abbrev(tcp))
+ printaddr(addr);
+
+ for (;;) {
+ if (len < header_size) {
+ if (!abbrev(tcp)) {
+ if (!len) {
+ tprints("[");
+ ++count;
+ } else {
+ printstr_ex(tcp, addr, len,
+ QUOTE_FORCE_HEX);
+ }
+ }
+ break;
+ }
+
+ /* len >= header_size after this point. */
+ if (!tfetch_mem(tcp, addr, header_size, &dent)) {
+ if (!abbrev(tcp)) {
+ if (count) {
+ tprints("...");
+ printaddr_comment(addr);
+ } else {
+ printaddr(addr);
+ }
+ }
+
+ break;
+ }
+
+ if (!abbrev(tcp)) {
+ if (!count)
+ tprints("[");
+ }
+ ++count;
+
+ kernel_ulong_t next_addr = 0;
+ unsigned int next_len = 0;
+ unsigned int d_reclen = decode_dentry_head(tcp, &dent);
+
+ if (d_reclen > len) {
+ /* cannot happen? */
+ tprintf_comment("%s%u bytes overflow",
+ (abbrev(tcp) ? "d_reclen " : ""),
+ d_reclen - len);
+ d_reclen = len;
+ } else if (d_reclen < header_size) {
+ /* cannot happen? */
+ tprintf_comment("%s%u bytes underflow",
+ (abbrev(tcp) ? "d_reclen " : ""),
+ header_size - d_reclen);
+ d_reclen = header_size;
+ next_len = len - header_size;
+ } else {
+ next_len = len - d_reclen;
+ if (next_len) {
+ if (addr + d_reclen > addr) {
+ next_addr = addr + d_reclen;
+ } else {
+ /* cannot happen? */
+ tprints_comment("address overflow");
+ }
+ }
+ }
+
+ len = next_len;
+ /* Do not use len inside the loop after this point. */
+
+ if (!abbrev(tcp)) {
+ int rc = decode_dentry_tail(tcp, addr + header_size,
+ &dent,
+ d_reclen - header_size);
+ if (next_addr) {
+ tprints(", ");
+ if (rc < 0) {
+ tprints("...");
+ break;
+ }
+ }
+ }
+
+ if (!next_addr)
+ break;
+ addr = next_addr;
+ }
+
+ if (!abbrev(tcp)) {
+ if (count)
+ tprints("]");
+ } else {
+ tprintf_comment("%u%s entries", count, len ? "+" : "");
+ }
+}
+
+int
+xgetdents(struct tcb *const tcp, const unsigned int header_size,
+ const decode_dentry_head_fn decode_dentry_head,
+ const decode_dentry_tail_fn decode_dentry_tail)
+{
+ if (entering(tcp)) {
+ printfd(tcp, tcp->u_arg[0]);
+ tprints(", ");
+ return 0;
+ }
+
+ const unsigned int count = tcp->u_arg[2];
+
+ if (syserror(tcp) || !verbose(tcp) ||
+ (kernel_ulong_t) tcp->u_rval > count /* kernel gone bananas? */) {
+ printaddr(tcp->u_arg[1]);
+ } else {
+ decode_dents(tcp, tcp->u_arg[1], tcp->u_rval, header_size,
+ decode_dentry_head, decode_dentry_tail);
+ }
+
+ tprintf(", %u", count);
+ return 0;
+}
diff --git a/src/xgetdents.h b/src/xgetdents.h
new file mode 100644
index 000000000..96fefc73b
--- /dev/null
+++ b/src/xgetdents.h
@@ -0,0 +1,21 @@
+/*
+ * Copyright (c) 2020 Dmitry V. Levin <ldv@strace.io>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_XGETDENTS_H
+# define STRACE_XGETDENTS_H
+
+# include "defs.h"
+
+typedef unsigned int (*decode_dentry_head_fn)(struct tcb *, const void *);
+typedef int (*decode_dentry_tail_fn)(struct tcb *, kernel_ulong_t,
+ const void *, unsigned int);
+
+extern int
+xgetdents(struct tcb *, unsigned int header_size,
+ decode_dentry_head_fn, decode_dentry_tail_fn);
+
+#endif /* !STRACE_XGETDENTS_H */
diff --git a/src/xlat.c b/src/xlat.c
new file mode 100644
index 000000000..bc3378cee
--- /dev/null
+++ b/src/xlat.c
@@ -0,0 +1,516 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
+ * Copyright (c) 1999-2020 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+#include "xstring.h"
+#include <stdarg.h>
+
+static inline enum xlat_style
+get_xlat_style(enum xlat_style style)
+{
+ if (xlat_verbose(style) == XLAT_STYLE_DEFAULT)
+ return style | xlat_verbosity;
+
+ return style;
+}
+
+static inline const char *
+sprint_xlat_val(uint64_t val, enum xlat_style style)
+{
+ static char buf[sizeof(val) * 3];
+
+ switch (xlat_format(style)) {
+ case XLAT_STYLE_FMT_D:
+ xsprintf(buf, "%" PRId64, val);
+ break;
+
+ case XLAT_STYLE_FMT_U:
+ xsprintf(buf, "%" PRIu64, val);
+ break;
+
+ case XLAT_STYLE_FMT_X:
+ xsprintf(buf, "%#" PRIx64, val);
+ break;
+ }
+
+ return buf;
+}
+
+static inline void
+print_xlat_val(uint64_t val, enum xlat_style style)
+{
+ tprints(sprint_xlat_val(val, style));
+}
+
+static int
+xlat_bsearch_compare(const void *a, const void *b)
+{
+ const uint64_t val1 = *(const uint64_t *) a;
+ const uint64_t val2 = ((const struct xlat_data *) b)->val;
+ return (val1 > val2) ? 1 : (val1 < val2) ? -1 : 0;
+}
+
+const char *
+xlookup(const struct xlat *xlat, const uint64_t val)
+{
+ static const struct xlat *x;
+ static size_t idx;
+ const struct xlat_data *e;
+
+ if (xlat) {
+ x = xlat;
+ idx = 0;
+ }
+
+ if (!x || !x->data)
+ return NULL;
+
+ switch (x->type) {
+ case XT_NORMAL:
+ for (; idx < x->size; idx++)
+ if (x->data[idx].val == val)
+ return x->data[idx].str;
+ break;
+
+ case XT_SORTED:
+ e = bsearch((const void *) &val,
+ x->data + idx,
+ x->size - idx,
+ sizeof(x->data[0]),
+ xlat_bsearch_compare);
+ if (e) {
+ idx = e - x->data;
+ return e->str;
+ }
+ break;
+
+ case XT_INDEXED:
+ if (val < x->size) {
+ if (val == x->data[val].val)
+ return x->data[val].str;
+ if (x->data[val].val == 0)
+ break; /* a hole in the index */
+ error_func_msg("Unexpected xlat value %" PRIu64
+ " at index %" PRIu64 " (str %s)",
+ x->data[val].val, val,
+ x->data[val].str);
+ }
+ break;
+
+ default:
+ error_func_msg("Invalid xlat type: %#x", x->type);
+ }
+
+ return NULL;
+}
+
+static const char *
+xlat_search_eq_or_less(const struct xlat *xlat, uint64_t *val)
+{
+ const struct xlat_data *base = xlat->data;
+ const struct xlat_data *cur = xlat->data;
+ size_t nmemb = xlat->size;
+
+ for (; nmemb > 0; nmemb >>= 1) {
+ cur = base + (nmemb >> 1);
+
+ if (*val == cur->val)
+ return cur->str;
+
+ if (*val > cur->val) {
+ base = cur + 1;
+ nmemb--;
+ }
+ }
+
+ if (*val < cur->val) {
+ if (cur > xlat->data)
+ cur--;
+ else
+ return NULL;
+ }
+
+ *val = cur->val;
+ return cur->str;
+}
+
+const char *
+xlookup_le(const struct xlat *xlat, uint64_t *val)
+{
+ if (!xlat || !xlat->data)
+ return NULL;
+
+ switch (xlat->type) {
+ case XT_SORTED:
+ return xlat_search_eq_or_less(xlat, val);
+
+#if 0 /* enable when used */
+ case XT_NORMAL: {
+ uint64_t best_hit = 0;
+ const char *str = NULL;
+
+ for (size_t idx = 0; idx < xlat->size; idx++) {
+ if (xlat->data[idx].val == *val)
+ return xlat->data[idx].str;
+
+ if (xlat->data[idx].val < *val
+ && xlat->data[idx].val > best_hit) {
+ best_hit = xlat->data[idx].val;
+ str = xlat->data[idx].str;
+ }
+ }
+
+ *val = best_hit;
+ return str;
+ }
+
+ case XT_INDEXED: {
+ size_t idx = *val;
+
+ if (idx >= xlat->size) {
+ if (!xlat->size)
+ return NULL;
+
+ idx = xlat->size - 1;
+ }
+
+ do {
+ if (idx == xlat->data[idx].val && xlat->data[idx].str) {
+ *val = idx;
+ return xlat->data[idx].str;
+ }
+ if (xlat->data[idx].val == 0)
+ continue; /* a hole in the index */
+ error_func_msg("Unexpected xlat value %" PRIu64
+ " at index %zu (str %s)",
+ xlat->data[idx].val, idx,
+ xlat->data[idx].str);
+ } while (idx--);
+ return NULL;
+ }
+#endif
+
+ default:
+ error_func_msg("Invalid xlat type: %#x", xlat->type);
+ }
+
+ return NULL;
+}
+
+/**
+ * Print entry in struct xlat table, if there.
+ *
+ * @param val Value to search a literal representation for.
+ * @param dflt String (abbreviated in comment syntax) which should be emitted
+ * if no appropriate xlat value has been found.
+ * @param style Style in which xlat value should be printed.
+ * @param xlat (And the following arguments) Pointers to arrays of xlat values.
+ * The last argument should be NULL.
+ * @return 1 if appropriate xlat value has been found, 0 otherwise.
+ */
+int
+printxvals_ex(const uint64_t val, const char *dflt, enum xlat_style style,
+ const struct xlat *xlat, ...)
+{
+ static const struct xlat *last;
+
+ style = get_xlat_style(style);
+
+ if (xlat_verbose(style) == XLAT_STYLE_RAW) {
+ print_xlat_val(val, style);
+ return 0;
+ }
+
+ const char *str = NULL;
+ va_list args;
+
+ va_start(args, xlat);
+
+ if (!xlat)
+ xlat = last;
+
+ for (; xlat; xlat = va_arg(args, const struct xlat *)) {
+ last = xlat;
+
+ str = xlookup(xlat, val);
+
+ if (str) {
+ if (xlat_verbose(style) == XLAT_STYLE_VERBOSE) {
+ print_xlat_val(val, style);
+ tprints_comment(str);
+ } else {
+ tprints(str);
+ }
+
+ goto printxvals_ex_end;
+ }
+ }
+
+ /* No hits -- print raw # instead. */
+ print_xlat_val(val, style);
+ tprints_comment(dflt);
+
+printxvals_ex_end:
+ va_end(args);
+
+ return !!str;
+}
+
+int
+sprintxval_ex(char *const buf, const size_t size, const struct xlat *const x,
+ const unsigned int val, const char *const dflt,
+ enum xlat_style style)
+{
+ style = get_xlat_style(style);
+
+ if (xlat_verbose(style) == XLAT_STYLE_RAW)
+ return xsnprintf(buf, size, "%s", sprint_xlat_val(val, style));
+
+ const char *const str = xlookup(x, val);
+
+ if (str) {
+ if (xlat_verbose(style) == XLAT_STYLE_VERBOSE)
+ return xsnprintf(buf, size, "%s /* %s */",
+ sprint_xlat_val(val, style), str);
+ else
+ return xsnprintf(buf, size, "%s", str);
+ }
+ if (dflt)
+ return xsnprintf(buf, size, "%s /* %s */",
+ sprint_xlat_val(val, style), dflt);
+
+ return xsnprintf(buf, size, "%s", sprint_xlat_val(val, style));
+}
+
+/*
+ * Interpret `xlat' as an array of flags.
+ * Print to static string the entries whose bits are on in `flags'
+ * Return static string. If 0 is provided as flags, and there is no flag that
+ * has the value of 0 (it should be the first in xlat table), return NULL.
+ *
+ * Expected output:
+ * +------------+------------+---------+------------+
+ * | flags != 0 | xlat found | style | output |
+ * +------------+------------+---------+------------+
+ * | false | (any) | raw | <none> |
+ * | true | (any) | raw | VAL |
+ * +------------+------------+---------+------------+
+ * | false | false | abbrev | <none> |
+ * | true | false | abbrev | VAL |
+ * | (any) | true | abbrev | XLAT |
+ * +------------+------------+---------+------------+
+ * | false | false | verbose | <none> |
+ * | true | false | verbose | VAL |
+ * | (any) | true | verbose | VAL (XLAT) |
+ * +------------+------------+---------+------------+
+ */
+const char *
+sprintflags_ex(const char *prefix, const struct xlat *xlat, uint64_t flags,
+ char sep, enum xlat_style style)
+{
+ static char outstr[1024];
+ char *outptr;
+ int found = 0;
+
+ outptr = stpcpy(outstr, prefix);
+ style = get_xlat_style(style);
+
+ if (xlat_verbose(style) == XLAT_STYLE_RAW) {
+ if (!flags)
+ return NULL;
+
+ if (sep)
+ *outptr++ = sep;
+ outptr = xappendstr(outstr, outptr, "%s",
+ sprint_xlat_val(flags, style));
+
+ return outstr;
+ }
+
+ if (flags == 0 && xlat->data->val == 0 && xlat->data->str) {
+ if (sep)
+ *outptr++ = sep;
+ if (xlat_verbose(style) == XLAT_STYLE_VERBOSE) {
+ outptr = xappendstr(outstr, outptr, "0 /* %s */",
+ xlat->data->str);
+ } else {
+ strcpy(outptr, xlat->data->str);
+ }
+
+ return outstr;
+ }
+
+ if (xlat_verbose(style) == XLAT_STYLE_VERBOSE && flags) {
+ if (sep) {
+ *outptr++ = sep;
+ sep = '\0';
+ }
+ outptr = xappendstr(outstr, outptr, "%s",
+ sprint_xlat_val(flags, style));
+ }
+
+ for (size_t idx = 0; flags && idx < xlat->size; idx++) {
+ if (xlat->data[idx].val && xlat->data[idx].str
+ && (flags & xlat->data[idx].val) == xlat->data[idx].val) {
+ if (sep) {
+ *outptr++ = sep;
+ } else if (xlat_verbose(style) == XLAT_STYLE_VERBOSE) {
+ outptr = stpcpy(outptr, " /* ");
+ }
+
+ outptr = stpcpy(outptr, xlat->data[idx].str);
+ found = 1;
+ sep = '|';
+ flags &= ~xlat->data[idx].val;
+ }
+ }
+
+ if (flags) {
+ if (sep)
+ *outptr++ = sep;
+ if (found || xlat_verbose(style) != XLAT_STYLE_VERBOSE)
+ outptr = xappendstr(outstr, outptr, "%s",
+ sprint_xlat_val(flags, style));
+ } else {
+ if (!found)
+ return NULL;
+ }
+
+ if (found && xlat_verbose(style) == XLAT_STYLE_VERBOSE)
+ outptr = stpcpy(outptr, " */");
+
+ return outstr;
+}
+
+/**
+ * Print flags from multiple xlat tables.
+ *
+ * Expected output:
+ * +------------+--------------+------------+---------+------------+
+ * | flags != 0 | dflt != NULL | xlat found | style | output |
+ * +------------+--------------+------------+---------+------------+
+ * | false | false | (any) | raw | <none> |
+ * | false | true | (any) | raw | VAL |
+ * | true | (any) | (any) | raw | VAL |
+ * +------------+--------------+------------+---------+------------+
+ * | false | false | false | abbrev | <none> |
+ * | false | true | false | abbrev | VAL |
+ * | true | false | false | abbrev | VAL |
+ * | true | true | false | abbrev | VAL (DFLT) |
+ * | (any) | (any) | true | abbrev | XLAT |
+ * +------------+--------------+------------+---------+------------+
+ * | false | false | false | verbose | <none> |
+ * | false | true | false | verbose | VAL |
+ * | true | false | false | verbose | VAL |
+ * | true | true | false | verbose | VAL (DFLT) |
+ * | (any) | (any) | true | verbose | VAL (XLAT) |
+ * +------------+--------------+------------+---------+------------+
+ */
+int
+printflags_ex(uint64_t flags, const char *dflt, enum xlat_style style,
+ const struct xlat *xlat, ...)
+{
+ style = get_xlat_style(style);
+
+ if (xlat_verbose(style) == XLAT_STYLE_RAW) {
+ if (flags || dflt) {
+ print_xlat_val(flags, style);
+ return 1;
+ }
+
+ return 0;
+ }
+
+ const char *init_sep = "";
+ unsigned int n = 0;
+ va_list args;
+
+ if (xlat_verbose(style) == XLAT_STYLE_VERBOSE) {
+ init_sep = " /* ";
+ if (flags)
+ print_xlat_val(flags, style);
+ }
+
+ va_start(args, xlat);
+ for (; xlat; xlat = va_arg(args, const struct xlat *)) {
+ for (size_t idx = 0; (flags || !n) && idx < xlat->size; ++idx) {
+ uint64_t v = xlat->data[idx].val;
+ if (xlat->data[idx].str
+ && ((flags == v) || (v && (flags & v) == v))) {
+ if (xlat_verbose(style) == XLAT_STYLE_VERBOSE
+ && !flags)
+ tprints("0");
+ tprintf("%s%s",
+ (n++ ? "|" : init_sep),
+ xlat->data[idx].str);
+ flags &= ~v;
+ }
+ if (!flags)
+ break;
+ }
+ }
+ va_end(args);
+
+ if (n) {
+ if (flags) {
+ tprints("|");
+ print_xlat_val(flags, style);
+ n++;
+ }
+
+ if (xlat_verbose(style) == XLAT_STYLE_VERBOSE)
+ tprints(" */");
+ } else {
+ if (flags) {
+ if (xlat_verbose(style) != XLAT_STYLE_VERBOSE)
+ print_xlat_val(flags, style);
+ tprints_comment(dflt);
+ } else {
+ if (dflt)
+ tprints("0");
+ }
+ }
+
+ return n;
+}
+
+void
+print_xlat_ex(const uint64_t val, const char *str, uint32_t style)
+{
+ bool default_str = style & PXF_DEFAULT_STR;
+ style = get_xlat_style(style);
+
+ switch (xlat_verbose(style)) {
+ case XLAT_STYLE_ABBREV:
+ if (str) {
+ if (default_str) {
+ print_xlat_val(val, style);
+ tprints_comment(str);
+ } else {
+ tprints(str);
+ }
+ break;
+ }
+ ATTRIBUTE_FALLTHROUGH;
+
+ case XLAT_STYLE_RAW:
+ print_xlat_val(val, style);
+ break;
+
+ default:
+ error_func_msg("Unexpected style value of %#x", style);
+ ATTRIBUTE_FALLTHROUGH;
+
+ case XLAT_STYLE_VERBOSE:
+ print_xlat_val(val, style);
+ tprints_comment(str);
+ }
+}
diff --git a/src/xlat.h b/src/xlat.h
new file mode 100644
index 000000000..05311bf98
--- /dev/null
+++ b/src/xlat.h
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2016-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_XLAT_H
+# define STRACE_XLAT_H
+
+# include <stdint.h>
+
+enum xlat_type {
+ XT_NORMAL,
+ XT_SORTED,
+ XT_INDEXED,
+};
+
+enum xlat_style {
+ /**
+ * Special value that is used for passing to *print{xval,flags}*_ex
+ * routines that indicates that no overriding of user-supplied xlat
+ * verbosity/formatting configuration is intended.
+ */
+ XLAT_STYLE_DEFAULT = 0,
+
+ /** Print xlat value as is without xlat processing */
+ XLAT_STYLE_RAW = 1 << 0,
+ /**
+ * Historic strace style, process xlat and print the result (xlat
+ * constant name/combination of flags), raw number only if nothing is
+ * found.
+ */
+ XLAT_STYLE_ABBREV = 1 << 1,
+ /** Always print both raw number and xlat processing result. */
+ XLAT_STYLE_VERBOSE = XLAT_STYLE_RAW | XLAT_STYLE_ABBREV,
+
+# define XLAT_STYLE_FORMAT_SHIFT 2
+# define XLAT_STYLE_VERBOSITY_MASK ((1 << XLAT_STYLE_FORMAT_SHIFT) - 1)
+
+ XLAT_STYLE_FMT_X = 0 << XLAT_STYLE_FORMAT_SHIFT,
+ XLAT_STYLE_FMT_U = 1 << XLAT_STYLE_FORMAT_SHIFT,
+ XLAT_STYLE_FMT_D = 2 << XLAT_STYLE_FORMAT_SHIFT,
+
+# define XLAT_STYLE_FORMAT_MASK (3 << XLAT_STYLE_FORMAT_SHIFT)
+
+# define XLAT_STYLE_SPEC_BITS (XLAT_STYLE_FORMAT_SHIFT + 2)
+# define XLAT_STYLE_MASK ((1 << XLAT_STYLE_SPEC_BITS) - 1)
+};
+
+struct xlat_data {
+ uint64_t val;
+ const char *str;
+};
+
+struct xlat {
+ const struct xlat_data *data;
+ size_t flags_strsz;
+ uint32_t size;
+ enum xlat_type type;
+ uint64_t flags_mask;
+};
+
+# define XLAT(val) { (unsigned)(val), #val }
+# define XLAT_PAIR(val, str) { (unsigned)(val), str }
+# define XLAT_TYPE(type, val) { (type)(val), #val }
+# define XLAT_TYPE_PAIR(type, val, str) { (type)(val), str }
+
+#endif /* !STRACE_XLAT_H */
diff --git a/src/xlat/access_modes.in b/src/xlat/access_modes.in
new file mode 100644
index 000000000..3e57702bb
--- /dev/null
+++ b/src/xlat/access_modes.in
@@ -0,0 +1,4 @@
+F_OK 0
+R_OK 4
+W_OK 2
+X_OK 1
diff --git a/src/xlat/addrfams.in b/src/xlat/addrfams.in
new file mode 100644
index 000000000..e6a623290
--- /dev/null
+++ b/src/xlat/addrfams.in
@@ -0,0 +1,46 @@
+#value_indexed
+AF_UNSPEC 0
+AF_UNIX 1
+AF_INET 2
+AF_AX25 3
+AF_IPX 4
+AF_APPLETALK 5
+AF_NETROM 6
+AF_BRIDGE 7
+AF_ATMPVC 8
+AF_X25 9
+AF_INET6 10
+AF_ROSE 11
+AF_DECnet 12
+AF_NETBEUI 13
+AF_SECURITY 14
+AF_KEY 15
+AF_NETLINK 16
+AF_PACKET 17
+AF_ASH 18
+AF_ECONET 19
+AF_ATMSVC 20
+AF_RDS 21
+AF_SNA 22
+AF_IRDA 23
+AF_PPPOX 24
+AF_WANPIPE 25
+AF_LLC 26
+AF_IB 27
+AF_MPLS 28
+AF_CAN 29
+AF_TIPC 30
+AF_BLUETOOTH 31
+AF_IUCV 32
+AF_RXRPC 33
+AF_ISDN 34
+AF_PHONET 35
+AF_IEEE802154 36
+AF_CAIF 37
+AF_ALG 38
+AF_NFC 39
+AF_VSOCK 40
+AF_KCM 41
+AF_QIPCRTR 42
+AF_SMC 43
+AF_XDP 44
diff --git a/src/xlat/adjtimex_modes.in b/src/xlat/adjtimex_modes.in
new file mode 100644
index 000000000..fa616e60c
--- /dev/null
+++ b/src/xlat/adjtimex_modes.in
@@ -0,0 +1,13 @@
+ADJ_OFFSET_SS_READ 0xa001
+ADJ_OFFSET_SINGLESHOT 0x8001
+ADJ_OFFSET 0x0001
+ADJ_FREQUENCY 0x0002
+ADJ_MAXERROR 0x0004
+ADJ_ESTERROR 0x0008
+ADJ_STATUS 0x0010
+ADJ_TIMECONST 0x0020
+ADJ_TAI 0x0080
+ADJ_SETOFFSET 0x0100
+ADJ_MICRO 0x1000
+ADJ_NANO 0x2000
+ADJ_TICK 0x4000
diff --git a/src/xlat/adjtimex_state.in b/src/xlat/adjtimex_state.in
new file mode 100644
index 000000000..c4ec23c4c
--- /dev/null
+++ b/src/xlat/adjtimex_state.in
@@ -0,0 +1,7 @@
+#value_indexed
+TIME_OK 0
+TIME_INS 1
+TIME_DEL 2
+TIME_OOP 3
+TIME_WAIT 4
+TIME_ERROR 5
diff --git a/src/xlat/adjtimex_status.in b/src/xlat/adjtimex_status.in
new file mode 100644
index 000000000..7b83da884
--- /dev/null
+++ b/src/xlat/adjtimex_status.in
@@ -0,0 +1,16 @@
+STA_PLL 0x0001
+STA_PPSFREQ 0x0002
+STA_PPSTIME 0x0004
+STA_FLL 0x0008
+STA_INS 0x0010
+STA_DEL 0x0020
+STA_UNSYNC 0x0040
+STA_FREQHOLD 0x0080
+STA_PPSSIGNAL 0x0100
+STA_PPSJITTER 0x0200
+STA_PPSWANDER 0x0400
+STA_PPSERROR 0x0800
+STA_CLOCKERR 0x1000
+STA_NANO 0x2000
+STA_MODE 0x4000
+STA_CLK 0x8000
diff --git a/src/xlat/advise.in b/src/xlat/advise.in
new file mode 100644
index 000000000..5284335f0
--- /dev/null
+++ b/src/xlat/advise.in
@@ -0,0 +1,11 @@
+POSIX_FADV_NORMAL 0
+POSIX_FADV_RANDOM 1
+POSIX_FADV_SEQUENTIAL 2
+POSIX_FADV_WILLNEED 3
+#if defined __s390x__
+POSIX_FADV_DONTNEED 6
+POSIX_FADV_NOREUSE 7
+#else
+POSIX_FADV_DONTNEED 4
+POSIX_FADV_NOREUSE 5
+#endif
diff --git a/src/xlat/af_packet_types.in b/src/xlat/af_packet_types.in
new file mode 100644
index 000000000..68f751526
--- /dev/null
+++ b/src/xlat/af_packet_types.in
@@ -0,0 +1,9 @@
+#value_indexed
+PACKET_HOST 0
+PACKET_BROADCAST 1
+PACKET_MULTICAST 2
+PACKET_OTHERHOST 3
+PACKET_OUTGOING 4
+PACKET_LOOPBACK 5
+PACKET_USER 6
+PACKET_KERNEL 7
diff --git a/src/xlat/af_packet_versions.in b/src/xlat/af_packet_versions.in
new file mode 100644
index 000000000..17a9f31a5
--- /dev/null
+++ b/src/xlat/af_packet_versions.in
@@ -0,0 +1,4 @@
+#value_indexed
+TPACKET_V1 0
+TPACKET_V2 1
+TPACKET_V3 2
diff --git a/src/xlat/aio_cmds.in b/src/xlat/aio_cmds.in
new file mode 100644
index 000000000..fd27d94ac
--- /dev/null
+++ b/src/xlat/aio_cmds.in
@@ -0,0 +1,10 @@
+#value_indexed
+IOCB_CMD_PREAD 0
+IOCB_CMD_PWRITE 1
+IOCB_CMD_FSYNC 2
+IOCB_CMD_FDSYNC 3
+IOCB_CMD_PREADX 4
+IOCB_CMD_POLL 5
+IOCB_CMD_NOOP 6
+IOCB_CMD_PREADV 7
+IOCB_CMD_PWRITEV 8
diff --git a/src/xlat/aio_iocb_flags.in b/src/xlat/aio_iocb_flags.in
new file mode 100644
index 000000000..f6a5ab7cc
--- /dev/null
+++ b/src/xlat/aio_iocb_flags.in
@@ -0,0 +1,2 @@
+IOCB_FLAG_RESFD 1
+IOCB_FLAG_IOPRIO 2
diff --git a/src/xlat/archvals.in b/src/xlat/archvals.in
new file mode 100644
index 000000000..1dbbb8d00
--- /dev/null
+++ b/src/xlat/archvals.in
@@ -0,0 +1,9 @@
+ARCH_SET_GS 0x1001
+ARCH_SET_FS 0x1002
+ARCH_GET_FS 0x1003
+ARCH_GET_GS 0x1004
+ARCH_GET_CPUID 0x1011
+ARCH_SET_CPUID 0x1012
+ARCH_MAP_VDSO_X32 0x2001
+ARCH_MAP_VDSO_32 0x2002
+ARCH_MAP_VDSO_64 0x2003
diff --git a/src/xlat/arp_hardware_types.in b/src/xlat/arp_hardware_types.in
new file mode 100644
index 000000000..9b57da344
--- /dev/null
+++ b/src/xlat/arp_hardware_types.in
@@ -0,0 +1,67 @@
+#sorted sort -k2,2g
+ARPHRD_NETROM 0
+ARPHRD_ETHER 1
+ARPHRD_EETHER 2
+ARPHRD_AX25 3
+ARPHRD_PRONET 4
+ARPHRD_CHAOS 5
+ARPHRD_IEEE802 6
+ARPHRD_ARCNET 7
+ARPHRD_APPLETLK 8
+ARPHRD_DLCI 15
+ARPHRD_ATM 19
+ARPHRD_METRICOM 23
+ARPHRD_IEEE1394 24
+ARPHRD_EUI64 27
+ARPHRD_INFINIBAND 32
+ARPHRD_SLIP 256
+ARPHRD_CSLIP 257
+ARPHRD_SLIP6 258
+ARPHRD_CSLIP6 259
+ARPHRD_RSRVD 260
+ARPHRD_ADAPT 264
+ARPHRD_ROSE 270
+ARPHRD_X25 271
+ARPHRD_HWX25 272
+ARPHRD_CAN 280
+ARPHRD_PPP 512
+ARPHRD_CISCO 513
+ARPHRD_LAPB 516
+ARPHRD_DDCMP 517
+ARPHRD_RAWHDLC 518
+ARPHRD_RAWIP 519
+ARPHRD_TUNNEL 768
+ARPHRD_TUNNEL6 769
+ARPHRD_FRAD 770
+ARPHRD_SKIP 771
+ARPHRD_LOOPBACK 772
+ARPHRD_LOCALTLK 773
+ARPHRD_FDDI 774
+ARPHRD_BIF 775
+ARPHRD_SIT 776
+ARPHRD_IPDDP 777
+ARPHRD_IPGRE 778
+ARPHRD_PIMREG 779
+ARPHRD_HIPPI 780
+ARPHRD_ASH 781
+ARPHRD_ECONET 782
+ARPHRD_IRDA 783
+ARPHRD_FCPP 784
+ARPHRD_FCAL 785
+ARPHRD_FCPL 786
+ARPHRD_FCFABRIC 787
+ARPHRD_IEEE802_TR 800
+ARPHRD_IEEE80211 801
+ARPHRD_IEEE80211_PRISM 802
+ARPHRD_IEEE80211_RADIOTAP 803
+ARPHRD_IEEE802154 804
+ARPHRD_IEEE802154_MONITOR 805
+ARPHRD_PHONET 820
+ARPHRD_PHONET_PIPE 821
+ARPHRD_CAIF 822
+ARPHRD_IP6GRE 823
+ARPHRD_NETLINK 824
+ARPHRD_6LOWPAN 825
+ARPHRD_VSOCKMON 826
+ARPHRD_NONE 0xFFFE
+ARPHRD_VOID 0xFFFF
diff --git a/src/xlat/at_flags.in b/src/xlat/at_flags.in
new file mode 100644
index 000000000..6fe238921
--- /dev/null
+++ b/src/xlat/at_flags.in
@@ -0,0 +1,6 @@
+AT_SYMLINK_NOFOLLOW 0x100
+AT_REMOVEDIR 0x200
+AT_SYMLINK_FOLLOW 0x400
+AT_NO_AUTOMOUNT 0x800
+AT_EMPTY_PATH 0x1000
+AT_RECURSIVE 0x8000
diff --git a/src/xlat/at_statx_sync_types.in b/src/xlat/at_statx_sync_types.in
new file mode 100644
index 000000000..5d0ed494f
--- /dev/null
+++ b/src/xlat/at_statx_sync_types.in
@@ -0,0 +1,5 @@
+AT_STATX_SYNC_AS_STAT 0x0000
+AT_STATX_FORCE_SYNC 0x2000
+AT_STATX_DONT_SYNC 0x4000
+
+AT_STATX_SYNC_TYPE 0x6000
diff --git a/src/xlat/atomic_ops.in b/src/xlat/atomic_ops.in
new file mode 100644
index 000000000..42261ea54
--- /dev/null
+++ b/src/xlat/atomic_ops.in
@@ -0,0 +1,9 @@
+ { OR1K_ATOMIC_SWAP, "SWAP" },
+ { OR1K_ATOMIC_CMPXCHG, "CMPXCHG" },
+ { OR1K_ATOMIC_XCHG, "XCHG" },
+ { OR1K_ATOMIC_ADD, "ADD" },
+ { OR1K_ATOMIC_DECPOS, "DECPOS" },
+ { OR1K_ATOMIC_AND, "AND" },
+ { OR1K_ATOMIC_OR, "OR" },
+ { OR1K_ATOMIC_UMAX, "UMAX" },
+ { OR1K_ATOMIC_UMIN, "UMIN" },
diff --git a/src/xlat/audit_arch.in b/src/xlat/audit_arch.in
new file mode 100644
index 000000000..63d3fe52b
--- /dev/null
+++ b/src/xlat/audit_arch.in
@@ -0,0 +1,62 @@
+#ifndef __AUDIT_ARCH_CONVENTION_MIPS64_N32
+# define __AUDIT_ARCH_CONVENTION_MIPS64_N32 0x20000000
+#endif
+#ifndef __AUDIT_ARCH_64BIT
+# define __AUDIT_ARCH_64BIT 0x80000000
+#endif
+#ifndef __AUDIT_ARCH_LE
+# define __AUDIT_ARCH_LE 0x40000000
+#endif
+
+AUDIT_ARCH_AARCH64 (EM_AARCH64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
+AUDIT_ARCH_ALPHA (EM_ALPHA|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
+AUDIT_ARCH_ARCOMPACT (EM_ARCOMPACT|__AUDIT_ARCH_LE)
+AUDIT_ARCH_ARCOMPACTBE (EM_ARCOMPACT)
+AUDIT_ARCH_ARCV2 (EM_ARCV2|__AUDIT_ARCH_LE)
+AUDIT_ARCH_ARCV2BE (EM_ARCV2)
+AUDIT_ARCH_ARM (EM_ARM|__AUDIT_ARCH_LE)
+AUDIT_ARCH_ARMEB (EM_ARM)
+AUDIT_ARCH_C6X (EM_TI_C6000|__AUDIT_ARCH_LE)
+AUDIT_ARCH_C6XBE (EM_TI_C6000)
+AUDIT_ARCH_CRIS (EM_CRIS|__AUDIT_ARCH_LE)
+AUDIT_ARCH_CSKY (EM_CSKY|__AUDIT_ARCH_LE)
+AUDIT_ARCH_FRV (EM_FRV)
+AUDIT_ARCH_H8300 (EM_H8_300) /* Removed in v3.13-rc1~130^2~2 */
+AUDIT_ARCH_HEXAGON (EM_HEXAGON)
+AUDIT_ARCH_I386 (EM_386|__AUDIT_ARCH_LE)
+AUDIT_ARCH_IA64 (EM_IA_64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
+AUDIT_ARCH_M32R (EM_M32R)
+AUDIT_ARCH_M68K (EM_68K)
+AUDIT_ARCH_MICROBLAZE (EM_MICROBLAZE)
+AUDIT_ARCH_MIPS (EM_MIPS)
+AUDIT_ARCH_MIPS64 (EM_MIPS|__AUDIT_ARCH_64BIT)
+AUDIT_ARCH_MIPS64N32 (EM_MIPS|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_CONVENTION_MIPS64_N32)
+AUDIT_ARCH_MIPSEL (EM_MIPS|__AUDIT_ARCH_LE)
+AUDIT_ARCH_MIPSEL64 (EM_MIPS|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
+AUDIT_ARCH_MIPSEL64N32 (EM_MIPS|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE|__AUDIT_ARCH_CONVENTION_MIPS64_N32)
+AUDIT_ARCH_NDS32 (EM_NDS32|__AUDIT_ARCH_LE)
+AUDIT_ARCH_NDS32BE (EM_NDS32)
+AUDIT_ARCH_NIOS2 (EM_ALTERA_NIOS2|__AUDIT_ARCH_LE)
+AUDIT_ARCH_OPENRISC (EM_OPENRISC)
+AUDIT_ARCH_PARISC (EM_PARISC)
+AUDIT_ARCH_PARISC64 (EM_PARISC|__AUDIT_ARCH_64BIT)
+AUDIT_ARCH_PPC (EM_PPC)
+AUDIT_ARCH_PPC64 (EM_PPC64|__AUDIT_ARCH_64BIT)
+AUDIT_ARCH_PPC64LE (EM_PPC64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
+AUDIT_ARCH_RISCV32 (EM_RISCV|__AUDIT_ARCH_LE)
+AUDIT_ARCH_RISCV64 (EM_RISCV|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
+AUDIT_ARCH_S390 (EM_S390)
+AUDIT_ARCH_S390X (EM_S390|__AUDIT_ARCH_64BIT)
+AUDIT_ARCH_SH (EM_SH)
+AUDIT_ARCH_SH64 (EM_SH|__AUDIT_ARCH_64BIT)
+AUDIT_ARCH_SHEL (EM_SH|__AUDIT_ARCH_LE)
+AUDIT_ARCH_SHEL64 (EM_SH|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
+AUDIT_ARCH_SPARC (EM_SPARC)
+AUDIT_ARCH_SPARC64 (EM_SPARCV9|__AUDIT_ARCH_64BIT)
+AUDIT_ARCH_TILEGX (EM_TILEGX|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
+AUDIT_ARCH_TILEGX32 (EM_TILEGX|__AUDIT_ARCH_LE)
+AUDIT_ARCH_TILEPRO (EM_TILEPRO|__AUDIT_ARCH_LE)
+AUDIT_ARCH_UNICORE (EM_UNICORE|__AUDIT_ARCH_LE)
+AUDIT_ARCH_V850 (EM_V850|__AUDIT_ARCH_LE) /* Removed in v2.6.27-rc1~721 */
+AUDIT_ARCH_X86_64 (EM_X86_64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
+AUDIT_ARCH_XTENSA (EM_XTENSA)
diff --git a/src/xlat/ax25_protocols.in b/src/xlat/ax25_protocols.in
new file mode 100644
index 000000000..9cac1a636
--- /dev/null
+++ b/src/xlat/ax25_protocols.in
@@ -0,0 +1,17 @@
+#sorted
+/* Those are pulled from include/net/ax25.h, they should be part of UAPI */
+AX25_P_ROSE 0x01
+AX25_P_VJCOMP 0x06 /* Compressed TCP/IP packet */
+ /* Van Jacobsen (RFC 1144) */
+AX25_P_VJUNCOMP 0x07 /* Uncompressed TCP/IP packet */
+ /* Van Jacobsen (RFC 1144) */
+AX25_P_SEGMENT 0x08 /* Segmentation fragment */
+AX25_P_TEXNET 0xc3 /* TEXTNET datagram protocol */
+AX25_P_LQ 0xc4 /* Link Quality Protocol */
+AX25_P_ATALK 0xca /* Appletalk */
+AX25_P_ATALK_ARP 0xcb /* Appletalk ARP */
+AX25_P_IP 0xcc /* ARPA Internet Protocol */
+AX25_P_ARP 0xcd /* ARPA Address Resolution */
+AX25_P_FLEXNET 0xce /* FlexNet */
+AX25_P_NETROM 0xcf /* NET/ROM */
+AX25_P_TEXT 0xf0 /* No layer 3 protocol impl. */
diff --git a/src/xlat/baud_options.in b/src/xlat/baud_options.in
new file mode 100644
index 000000000..be7311abe
--- /dev/null
+++ b/src/xlat/baud_options.in
@@ -0,0 +1,33 @@
+B0
+B50
+B75
+B110
+B134
+B150
+B200
+B300
+B600
+B1200
+B1800
+B2400
+B4800
+B9600
+B19200
+B38400
+B57600
+B115200
+B230400
+B460800
+B500000
+B576000
+B921600
+B1000000
+B1152000
+B1500000
+B2000000
+B2500000
+B3000000
+B3500000
+B4000000
+EXTA
+EXTB
diff --git a/src/xlat/bdaddr_types.in b/src/xlat/bdaddr_types.in
new file mode 100644
index 000000000..b81b6fc34
--- /dev/null
+++ b/src/xlat/bdaddr_types.in
@@ -0,0 +1,4 @@
+#value_indexed
+BDADDR_BREDR 0
+BDADDR_LE_PUBLIC 1
+BDADDR_LE_RANDOM 2
diff --git a/src/xlat/blkpg_ops.in b/src/xlat/blkpg_ops.in
new file mode 100644
index 000000000..f4dc1e169
--- /dev/null
+++ b/src/xlat/blkpg_ops.in
@@ -0,0 +1,4 @@
+#value_indexed
+BLKPG_ADD_PARTITION 1
+BLKPG_DEL_PARTITION 2
+BLKPG_RESIZE_PARTITION 3
diff --git a/src/xlat/block_ioctl_cmds.in b/src/xlat/block_ioctl_cmds.in
new file mode 100644
index 000000000..45c402f29
--- /dev/null
+++ b/src/xlat/block_ioctl_cmds.in
@@ -0,0 +1,39 @@
+BLKROSET _IO(0x12, 93)
+BLKROGET _IO(0x12, 94)
+BLKRRPART _IO(0x12, 95)
+BLKGETSIZE _IO(0x12, 96)
+BLKFLSBUF _IO(0x12, 97)
+BLKRASET _IO(0x12, 98)
+BLKRAGET _IO(0x12, 99)
+BLKFRASET _IO(0x12, 100)
+BLKFRAGET _IO(0x12, 101)
+BLKSECTSET _IO(0x12, 102)
+BLKSECTGET _IO(0x12, 103)
+BLKSSZGET _IO(0x12, 104)
+BLKPG _IO(0x12, 105)
+BLKELVGET _IOR(0x12, 106, size_t)
+BLKELVSET _IOW(0x12, 107, size_t)
+BLKBSZGET _IOR(0x12, 112, size_t)
+BLKBSZSET _IOW(0x12, 113, size_t)
+BLKGETSIZE64 _IOR(0x12, 114, size_t)
+BLKTRACESETUP _IOWR(0x12, 115, struct blk_user_trace_setup)
+BLKTRACESTART _IO(0x12, 116)
+BLKTRACESTOP _IO(0x12, 117)
+BLKTRACETEARDOWN _IO(0x12, 118)
+BLKDISCARD _IO(0x12, 119)
+BLKIOMIN _IO(0x12, 120)
+BLKIOOPT _IO(0x12, 121)
+BLKALIGNOFF _IO(0x12, 122)
+BLKPBSZGET _IO(0x12, 123)
+BLKDISCARDZEROES _IO(0x12, 124)
+BLKSECDISCARD _IO(0x12, 125)
+BLKROTATIONAL _IO(0x12, 126)
+BLKZEROOUT _IO(0x12, 127)
+/* BLKDAXSET was present between v4.5-rc1~112^2^2~16 and v4.5-rc3~23^2~3 */
+/* BLKDAXSET _IO(0x12, 128) */
+/* BLKDAXGET was present between v4.5-rc1~112^2^2~16 and v4.7-rc1~78^2^2~4 */
+BLKDAXGET _IO(0x12, 129)
+/* BLKREPORTZONE _IOWR(0x12, 130, struct blk_zone_report) */
+/* BLKRESETZONE _IOW(0x12, 131, struct blk_zone_range) */
+BLKGETZONESZ _IOR(0x12, 132, uint32_t)
+BLKGETNRZONES _IOR(0x12, 133, uint32_t)
diff --git a/src/xlat/bluetooth_l2_cid.in b/src/xlat/bluetooth_l2_cid.in
new file mode 100644
index 000000000..e2b47f732
--- /dev/null
+++ b/src/xlat/bluetooth_l2_cid.in
@@ -0,0 +1,11 @@
+#sorted sort -k2,2
+L2CAP_CID_SIGNALING 0x0001
+L2CAP_CID_CONN_LESS 0x0002
+L2CAP_CID_A2MP 0x0003
+L2CAP_CID_ATT 0x0004
+L2CAP_CID_LE_SIGNALING 0x0005
+L2CAP_CID_SMP 0x0006
+L2CAP_CID_SMP_BREDR 0x0007
+L2CAP_CID_DYN_START 0x0040
+L2CAP_CID_LE_DYN_END 0x007f
+L2CAP_CID_DYN_END 0xffff
diff --git a/src/xlat/bluetooth_l2_psm.in b/src/xlat/bluetooth_l2_psm.in
new file mode 100644
index 000000000..f83370432
--- /dev/null
+++ b/src/xlat/bluetooth_l2_psm.in
@@ -0,0 +1,10 @@
+#sorted sort -k2,2
+L2CAP_PSM_SDP 0x0001
+L2CAP_PSM_RFCOMM 0x0003
+L2CAP_PSM_3DSP 0x0021
+L2CAP_PSM_IPSP 0x0023
+L2CAP_PSM_LE_DYN_START 0x0080
+L2CAP_PSM_LE_DYN_END 0x00ff
+L2CAP_PSM_DYN_START 0x1001
+L2CAP_PSM_AUTO_END 0x10ff
+L2CAP_PSM_DYN_END 0xffff
diff --git a/src/xlat/bootflags1.in b/src/xlat/bootflags1.in
new file mode 100644
index 000000000..420482310
--- /dev/null
+++ b/src/xlat/bootflags1.in
@@ -0,0 +1 @@
+LINUX_REBOOT_MAGIC1 0xfee1dead
diff --git a/src/xlat/bootflags2.in b/src/xlat/bootflags2.in
new file mode 100644
index 000000000..8daa342ea
--- /dev/null
+++ b/src/xlat/bootflags2.in
@@ -0,0 +1,4 @@
+LINUX_REBOOT_MAGIC2 672274793
+LINUX_REBOOT_MAGIC2A 85072278
+LINUX_REBOOT_MAGIC2B 369367448
+LINUX_REBOOT_MAGIC2C 537993216
diff --git a/src/xlat/bootflags3.in b/src/xlat/bootflags3.in
new file mode 100644
index 000000000..c0337e893
--- /dev/null
+++ b/src/xlat/bootflags3.in
@@ -0,0 +1,8 @@
+LINUX_REBOOT_CMD_RESTART 0x01234567
+LINUX_REBOOT_CMD_HALT 0xCDEF0123
+LINUX_REBOOT_CMD_CAD_ON 0x89ABCDEF
+LINUX_REBOOT_CMD_CAD_OFF 0x00000000
+LINUX_REBOOT_CMD_POWER_OFF 0x4321FEDC
+LINUX_REBOOT_CMD_RESTART2 0xA1B2C3D4
+LINUX_REBOOT_CMD_SW_SUSPEND 0xD000FCE2
+LINUX_REBOOT_CMD_KEXEC 0x45584543
diff --git a/src/xlat/bpf_attach_flags.in b/src/xlat/bpf_attach_flags.in
new file mode 100644
index 000000000..cee8d1918
--- /dev/null
+++ b/src/xlat/bpf_attach_flags.in
@@ -0,0 +1,3 @@
+BPF_F_ALLOW_OVERRIDE 1U
+BPF_F_ALLOW_MULTI (1U << 1)
+BPF_F_REPLACE (1U << 2)
diff --git a/src/xlat/bpf_attach_type.in b/src/xlat/bpf_attach_type.in
new file mode 100644
index 000000000..c2da7348e
--- /dev/null
+++ b/src/xlat/bpf_attach_type.in
@@ -0,0 +1,39 @@
+#value_indexed
+BPF_CGROUP_INET_INGRESS 0
+BPF_CGROUP_INET_EGRESS 1
+BPF_CGROUP_INET_SOCK_CREATE 2
+BPF_CGROUP_SOCK_OPS 3
+BPF_SK_SKB_STREAM_PARSER 4
+BPF_SK_SKB_STREAM_VERDICT 5
+BPF_CGROUP_DEVICE 6
+BPF_SK_MSG_VERDICT 7
+BPF_CGROUP_INET4_BIND 8
+BPF_CGROUP_INET6_BIND 9
+BPF_CGROUP_INET4_CONNECT 10
+BPF_CGROUP_INET6_CONNECT 11
+BPF_CGROUP_INET4_POST_BIND 12
+BPF_CGROUP_INET6_POST_BIND 13
+BPF_CGROUP_UDP4_SENDMSG 14
+BPF_CGROUP_UDP6_SENDMSG 15
+BPF_LIRC_MODE2 16
+BPF_FLOW_DISSECTOR 17
+BPF_CGROUP_SYSCTL 18
+BPF_CGROUP_UDP4_RECVMSG 19
+BPF_CGROUP_UDP6_RECVMSG 20
+BPF_CGROUP_GETSOCKOPT 21
+BPF_CGROUP_SETSOCKOPT 22
+BPF_TRACE_RAW_TP 23
+BPF_TRACE_FENTRY 24
+BPF_TRACE_FEXIT 25
+BPF_MODIFY_RETURN 26
+BPF_LSM_MAC 27
+BPF_TRACE_ITER 28
+BPF_CGROUP_INET4_GETPEERNAME 29
+BPF_CGROUP_INET6_GETPEERNAME 30
+BPF_CGROUP_INET4_GETSOCKNAME 31
+BPF_CGROUP_INET6_GETSOCKNAME 32
+BPF_XDP_DEVMAP 33
+BPF_CGROUP_INET_SOCK_RELEASE 34
+BPF_XDP_CPUMAP 35
+BPF_SK_LOOKUP 36
+BPF_XDP 37
diff --git a/src/xlat/bpf_class.in b/src/xlat/bpf_class.in
new file mode 100644
index 000000000..69f6d1666
--- /dev/null
+++ b/src/xlat/bpf_class.in
@@ -0,0 +1,9 @@
+#value_indexed
+BPF_LD 0x0
+BPF_LDX 0x1
+BPF_ST 0x2
+BPF_STX 0x3
+BPF_ALU 0x4
+BPF_JMP 0x5
+BPF_RET 0x6
+BPF_MISC 0x7
diff --git a/src/xlat/bpf_commands.in b/src/xlat/bpf_commands.in
new file mode 100644
index 000000000..07fb7905c
--- /dev/null
+++ b/src/xlat/bpf_commands.in
@@ -0,0 +1,37 @@
+#value_indexed
+BPF_MAP_CREATE 0
+BPF_MAP_LOOKUP_ELEM 1
+BPF_MAP_UPDATE_ELEM 2
+BPF_MAP_DELETE_ELEM 3
+BPF_MAP_GET_NEXT_KEY 4
+BPF_PROG_LOAD 5
+BPF_OBJ_PIN 6
+BPF_OBJ_GET 7
+BPF_PROG_ATTACH 8
+BPF_PROG_DETACH 9
+BPF_PROG_TEST_RUN 10
+BPF_PROG_GET_NEXT_ID 11
+BPF_MAP_GET_NEXT_ID 12
+BPF_PROG_GET_FD_BY_ID 13
+BPF_MAP_GET_FD_BY_ID 14
+BPF_OBJ_GET_INFO_BY_FD 15
+BPF_PROG_QUERY 16
+BPF_RAW_TRACEPOINT_OPEN 17
+BPF_BTF_LOAD 18
+BPF_BTF_GET_FD_BY_ID 19
+BPF_TASK_FD_QUERY 20
+BPF_MAP_LOOKUP_AND_DELETE_ELEM 21
+BPF_MAP_FREEZE 22
+BPF_BTF_GET_NEXT_ID 23
+BPF_MAP_LOOKUP_BATCH 24
+BPF_MAP_LOOKUP_AND_DELETE_BATCH 25
+BPF_MAP_UPDATE_BATCH 26
+BPF_MAP_DELETE_BATCH 27
+BPF_LINK_CREATE 28
+BPF_LINK_UPDATE 29
+BPF_LINK_GET_FD_BY_ID 30
+BPF_LINK_GET_NEXT_ID 31
+BPF_ENABLE_STATS 32
+BPF_ITER_CREATE 33
+BPF_LINK_DETACH 34
+BPF_PROG_BIND_MAP 35
diff --git a/src/xlat/bpf_file_mode_flags.in b/src/xlat/bpf_file_mode_flags.in
new file mode 100644
index 000000000..c345891aa
--- /dev/null
+++ b/src/xlat/bpf_file_mode_flags.in
@@ -0,0 +1,2 @@
+BPF_F_RDONLY (1U << 3)
+BPF_F_WRONLY (1U << 4)
diff --git a/src/xlat/bpf_map_flags.in b/src/xlat/bpf_map_flags.in
new file mode 100644
index 000000000..6d034638d
--- /dev/null
+++ b/src/xlat/bpf_map_flags.in
@@ -0,0 +1,13 @@
+BPF_F_NO_PREALLOC 1U
+BPF_F_NO_COMMON_LRU (1U << 1)
+BPF_F_NUMA_NODE (1U << 2)
+BPF_F_RDONLY (1U << 3)
+BPF_F_WRONLY (1U << 4)
+BPF_F_STACK_BUILD_ID (1U << 5)
+BPF_F_ZERO_SEED (1U << 6)
+BPF_F_RDONLY_PROG (1U << 7)
+BPF_F_WRONLY_PROG (1U << 8)
+BPF_F_CLONE (1U << 9)
+BPF_F_MMAPABLE (1U << 10)
+BPF_F_PRESERVE_ELEMS (1U << 11)
+BPF_F_INNER_MAP (1U << 12)
diff --git a/src/xlat/bpf_map_lookup_elem_flags.in b/src/xlat/bpf_map_lookup_elem_flags.in
new file mode 100644
index 000000000..68c936b75
--- /dev/null
+++ b/src/xlat/bpf_map_lookup_elem_flags.in
@@ -0,0 +1,2 @@
+BPF_ANY 0
+BPF_F_LOCK 4
diff --git a/src/xlat/bpf_map_types.in b/src/xlat/bpf_map_types.in
new file mode 100644
index 000000000..ff3a26046
--- /dev/null
+++ b/src/xlat/bpf_map_types.in
@@ -0,0 +1,30 @@
+#value_indexed
+BPF_MAP_TYPE_UNSPEC 0
+BPF_MAP_TYPE_HASH 1
+BPF_MAP_TYPE_ARRAY 2
+BPF_MAP_TYPE_PROG_ARRAY 3
+BPF_MAP_TYPE_PERF_EVENT_ARRAY 4
+BPF_MAP_TYPE_PERCPU_HASH 5
+BPF_MAP_TYPE_PERCPU_ARRAY 6
+BPF_MAP_TYPE_STACK_TRACE 7
+BPF_MAP_TYPE_CGROUP_ARRAY 8
+BPF_MAP_TYPE_LRU_HASH 9
+BPF_MAP_TYPE_LRU_PERCPU_HASH 10
+BPF_MAP_TYPE_LPM_TRIE 11
+BPF_MAP_TYPE_ARRAY_OF_MAPS 12
+BPF_MAP_TYPE_HASH_OF_MAPS 13
+BPF_MAP_TYPE_DEVMAP 14
+BPF_MAP_TYPE_SOCKMAP 15
+BPF_MAP_TYPE_CPUMAP 16
+BPF_MAP_TYPE_XSKMAP 17
+BPF_MAP_TYPE_SOCKHASH 18
+BPF_MAP_TYPE_CGROUP_STORAGE 19
+BPF_MAP_TYPE_REUSEPORT_SOCKARRAY 20
+BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE 21
+BPF_MAP_TYPE_QUEUE 22
+BPF_MAP_TYPE_STACK 23
+BPF_MAP_TYPE_SK_STORAGE 24
+BPF_MAP_TYPE_DEVMAP_HASH 25
+BPF_MAP_TYPE_STRUCT_OPS 26
+BPF_MAP_TYPE_RINGBUF 27
+BPF_MAP_TYPE_INODE_STORAGE 28
diff --git a/src/xlat/bpf_map_update_elem_flags.in b/src/xlat/bpf_map_update_elem_flags.in
new file mode 100644
index 000000000..03f362cbc
--- /dev/null
+++ b/src/xlat/bpf_map_update_elem_flags.in
@@ -0,0 +1,5 @@
+#value_indexed
+BPF_ANY 0
+BPF_NOEXIST 1
+BPF_EXIST 2
+BPF_F_LOCK 4
diff --git a/src/xlat/bpf_miscop.in b/src/xlat/bpf_miscop.in
new file mode 100644
index 000000000..6df47b3a0
--- /dev/null
+++ b/src/xlat/bpf_miscop.in
@@ -0,0 +1,2 @@
+BPF_TAX 0x00
+BPF_TXA 0x80
diff --git a/src/xlat/bpf_mode.in b/src/xlat/bpf_mode.in
new file mode 100644
index 000000000..a412c0ed8
--- /dev/null
+++ b/src/xlat/bpf_mode.in
@@ -0,0 +1,7 @@
+BPF_IMM 0x00
+BPF_ABS 0x20
+BPF_IND 0x40
+BPF_MEM 0x60
+BPF_LEN 0x80
+BPF_MSH 0xa0
+BPF_XADD 0xc0
diff --git a/src/xlat/bpf_op_alu.in b/src/xlat/bpf_op_alu.in
new file mode 100644
index 000000000..5016a46ec
--- /dev/null
+++ b/src/xlat/bpf_op_alu.in
@@ -0,0 +1,14 @@
+BPF_ADD 0x00
+BPF_SUB 0x10
+BPF_MUL 0x20
+BPF_DIV 0x30
+BPF_OR 0x40
+BPF_AND 0x50
+BPF_LSH 0x60
+BPF_RSH 0x70
+BPF_NEG 0x80
+BPF_MOD 0x90
+BPF_XOR 0xa0
+BPF_MOV 0xb0
+BPF_ARSH 0xc0
+BPF_END 0xd0
diff --git a/src/xlat/bpf_op_jmp.in b/src/xlat/bpf_op_jmp.in
new file mode 100644
index 000000000..1e9b6f701
--- /dev/null
+++ b/src/xlat/bpf_op_jmp.in
@@ -0,0 +1,14 @@
+BPF_JA 0x00
+BPF_JEQ 0x10
+BPF_JGT 0x20
+BPF_JGE 0x30
+BPF_JSET 0x40
+BPF_JNE 0x50
+BPF_JSGT 0x60
+BPF_JSGE 0x70
+BPF_CALL 0x80
+BPF_EXIT 0x90
+BPF_JLT 0xa0
+BPF_JLE 0xb0
+BPF_JSLT 0xc0
+BPF_JSLE 0xd0
diff --git a/src/xlat/bpf_prog_flags.in b/src/xlat/bpf_prog_flags.in
new file mode 100644
index 000000000..d4723c2ad
--- /dev/null
+++ b/src/xlat/bpf_prog_flags.in
@@ -0,0 +1,5 @@
+BPF_F_STRICT_ALIGNMENT 1U
+BPF_F_ANY_ALIGNMENT (1U << 1)
+BPF_F_TEST_RND_HI32 (1U << 2)
+BPF_F_TEST_STATE_FREQ (1U << 3)
+BPF_F_SLEEPABLE (1U << 4)
diff --git a/src/xlat/bpf_prog_types.in b/src/xlat/bpf_prog_types.in
new file mode 100644
index 000000000..2fcb1ef91
--- /dev/null
+++ b/src/xlat/bpf_prog_types.in
@@ -0,0 +1,32 @@
+#value_indexed
+BPF_PROG_TYPE_UNSPEC 0
+BPF_PROG_TYPE_SOCKET_FILTER 1
+BPF_PROG_TYPE_KPROBE 2
+BPF_PROG_TYPE_SCHED_CLS 3
+BPF_PROG_TYPE_SCHED_ACT 4
+BPF_PROG_TYPE_TRACEPOINT 5
+BPF_PROG_TYPE_XDP 6
+BPF_PROG_TYPE_PERF_EVENT 7
+BPF_PROG_TYPE_CGROUP_SKB 8
+BPF_PROG_TYPE_CGROUP_SOCK 9
+BPF_PROG_TYPE_LWT_IN 10
+BPF_PROG_TYPE_LWT_OUT 11
+BPF_PROG_TYPE_LWT_XMIT 12
+BPF_PROG_TYPE_SOCK_OPS 13
+BPF_PROG_TYPE_SK_SKB 14
+BPF_PROG_TYPE_CGROUP_DEVICE 15
+BPF_PROG_TYPE_SK_MSG 16
+BPF_PROG_TYPE_RAW_TRACEPOINT 17
+BPF_PROG_TYPE_CGROUP_SOCK_ADDR 18
+BPF_PROG_TYPE_LWT_SEG6LOCAL 19
+BPF_PROG_TYPE_LIRC_MODE2 20
+BPF_PROG_TYPE_SK_REUSEPORT 21
+BPF_PROG_TYPE_FLOW_DISSECTOR 22
+BPF_PROG_TYPE_CGROUP_SYSCTL 23
+BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE 24
+BPF_PROG_TYPE_CGROUP_SOCKOPT 25
+BPF_PROG_TYPE_TRACING 26
+BPF_PROG_TYPE_STRUCT_OPS 27
+BPF_PROG_TYPE_EXT 28
+BPF_PROG_TYPE_LSM 29
+BPF_PROG_TYPE_SK_LOOKUP 30
diff --git a/src/xlat/bpf_query_flags.in b/src/xlat/bpf_query_flags.in
new file mode 100644
index 000000000..b380ac1b3
--- /dev/null
+++ b/src/xlat/bpf_query_flags.in
@@ -0,0 +1 @@
+BPF_F_QUERY_EFFECTIVE (1U << 0)
diff --git a/src/xlat/bpf_rval.in b/src/xlat/bpf_rval.in
new file mode 100644
index 000000000..37073bd24
--- /dev/null
+++ b/src/xlat/bpf_rval.in
@@ -0,0 +1,3 @@
+BPF_K 0x00
+BPF_X 0x08
+BPF_A 0x10
diff --git a/src/xlat/bpf_size.in b/src/xlat/bpf_size.in
new file mode 100644
index 000000000..104428fc4
--- /dev/null
+++ b/src/xlat/bpf_size.in
@@ -0,0 +1,4 @@
+BPF_W 0x00
+BPF_H 0x08
+BPF_B 0x10
+BPF_DW 0x18
diff --git a/src/xlat/bpf_src.in b/src/xlat/bpf_src.in
new file mode 100644
index 000000000..46237178a
--- /dev/null
+++ b/src/xlat/bpf_src.in
@@ -0,0 +1,2 @@
+BPF_K 0x00
+BPF_X 0x08
diff --git a/src/xlat/bpf_task_fd_type.in b/src/xlat/bpf_task_fd_type.in
new file mode 100644
index 000000000..33e89ada3
--- /dev/null
+++ b/src/xlat/bpf_task_fd_type.in
@@ -0,0 +1,7 @@
+#value_indexed
+BPF_FD_TYPE_RAW_TRACEPOINT 0
+BPF_FD_TYPE_TRACEPOINT 1
+BPF_FD_TYPE_KPROBE 2
+BPF_FD_TYPE_KRETPROBE 3
+BPF_FD_TYPE_UPROBE 4
+BPF_FD_TYPE_URETPROBE 5
diff --git a/src/xlat/bsg_flags.in b/src/xlat/bsg_flags.in
new file mode 100644
index 000000000..6ef777294
--- /dev/null
+++ b/src/xlat/bsg_flags.in
@@ -0,0 +1,2 @@
+BSG_FLAG_Q_AT_TAIL 0x10
+BSG_FLAG_Q_AT_HEAD 0x20
diff --git a/src/xlat/bsg_protocol.in b/src/xlat/bsg_protocol.in
new file mode 100644
index 000000000..d47f15b78
--- /dev/null
+++ b/src/xlat/bsg_protocol.in
@@ -0,0 +1 @@
+BSG_PROTOCOL_SCSI
diff --git a/src/xlat/bsg_subprotocol.in b/src/xlat/bsg_subprotocol.in
new file mode 100644
index 000000000..5e63cd032
--- /dev/null
+++ b/src/xlat/bsg_subprotocol.in
@@ -0,0 +1,3 @@
+BSG_SUB_PROTOCOL_SCSI_CMD
+BSG_SUB_PROTOCOL_SCSI_TMF
+BSG_SUB_PROTOCOL_SCSI_TRANSPORT
diff --git a/src/xlat/bt_protocols.in b/src/xlat/bt_protocols.in
new file mode 100644
index 000000000..a0ad05653
--- /dev/null
+++ b/src/xlat/bt_protocols.in
@@ -0,0 +1,9 @@
+#value_indexed
+BTPROTO_L2CAP 0
+BTPROTO_HCI 1
+BTPROTO_SCO 2
+BTPROTO_RFCOMM 3
+BTPROTO_BNEP 4
+BTPROTO_CMTP 5
+BTPROTO_HIDP 6
+BTPROTO_AVDTP 7
diff --git a/src/xlat/btrfs_balance_args.in b/src/xlat/btrfs_balance_args.in
new file mode 100644
index 000000000..ffeaacc08
--- /dev/null
+++ b/src/xlat/btrfs_balance_args.in
@@ -0,0 +1,12 @@
+#val_type uint64_t
+BTRFS_BALANCE_ARGS_PROFILES (1ULL << 0)
+BTRFS_BALANCE_ARGS_USAGE (1ULL << 1)
+BTRFS_BALANCE_ARGS_DEVID (1ULL << 2)
+BTRFS_BALANCE_ARGS_DRANGE (1ULL << 3)
+BTRFS_BALANCE_ARGS_VRANGE (1ULL << 4)
+BTRFS_BALANCE_ARGS_LIMIT (1ULL << 5)
+BTRFS_BALANCE_ARGS_LIMIT_RANGE (1ULL << 6)
+BTRFS_BALANCE_ARGS_STRIPES_RANGE (1ULL << 7)
+BTRFS_BALANCE_ARGS_CONVERT (1ULL << 8)
+BTRFS_BALANCE_ARGS_SOFT (1ULL << 9)
+BTRFS_BALANCE_ARGS_USAGE_RANGE (1ULL << 10)
diff --git a/src/xlat/btrfs_balance_ctl_cmds.in b/src/xlat/btrfs_balance_ctl_cmds.in
new file mode 100644
index 000000000..3e38dd9a2
--- /dev/null
+++ b/src/xlat/btrfs_balance_ctl_cmds.in
@@ -0,0 +1,3 @@
+#value_indexed
+BTRFS_BALANCE_CTL_PAUSE 1
+BTRFS_BALANCE_CTL_CANCEL 2
diff --git a/src/xlat/btrfs_balance_flags.in b/src/xlat/btrfs_balance_flags.in
new file mode 100644
index 000000000..00ae0d105
--- /dev/null
+++ b/src/xlat/btrfs_balance_flags.in
@@ -0,0 +1,6 @@
+#val_type uint64_t
+BTRFS_BALANCE_DATA (1ULL << 0)
+BTRFS_BALANCE_SYSTEM (1ULL << 1)
+BTRFS_BALANCE_METADATA (1ULL << 2)
+BTRFS_BALANCE_FORCE (1ULL << 3)
+BTRFS_BALANCE_RESUME (1ULL << 4)
diff --git a/src/xlat/btrfs_balance_state.in b/src/xlat/btrfs_balance_state.in
new file mode 100644
index 000000000..5dbfca5eb
--- /dev/null
+++ b/src/xlat/btrfs_balance_state.in
@@ -0,0 +1,3 @@
+BTRFS_BALANCE_STATE_RUNNING (1ULL << 0)
+BTRFS_BALANCE_STATE_PAUSE_REQ (1ULL << 1)
+BTRFS_BALANCE_STATE_CANCEL_REQ (1ULL << 2)
diff --git a/src/xlat/btrfs_compress_types.in b/src/xlat/btrfs_compress_types.in
new file mode 100644
index 000000000..595a2855f
--- /dev/null
+++ b/src/xlat/btrfs_compress_types.in
@@ -0,0 +1,8 @@
+#value_indexed
+#enum
+#include <stdio.h>
+#include <linux/btrfs.h>
+BTRFS_COMPRESS_NONE 0
+BTRFS_COMPRESS_ZLIB 1
+BTRFS_COMPRESS_LZO 2
+BTRFS_COMPRESS_ZSTD 3
diff --git a/src/xlat/btrfs_cont_reading_from_srcdev_mode.in b/src/xlat/btrfs_cont_reading_from_srcdev_mode.in
new file mode 100644
index 000000000..0ae8b5164
--- /dev/null
+++ b/src/xlat/btrfs_cont_reading_from_srcdev_mode.in
@@ -0,0 +1,3 @@
+#value_indexed
+BTRFS_IOCTL_DEV_REPLACE_CONT_READING_FROM_SRCDEV_MODE_ALWAYS 0
+BTRFS_IOCTL_DEV_REPLACE_CONT_READING_FROM_SRCDEV_MODE_AVOID 1
diff --git a/src/xlat/btrfs_defrag_flags.in b/src/xlat/btrfs_defrag_flags.in
new file mode 100644
index 000000000..ae026c84e
--- /dev/null
+++ b/src/xlat/btrfs_defrag_flags.in
@@ -0,0 +1,3 @@
+#val_type uint64_t
+BTRFS_DEFRAG_RANGE_COMPRESS
+BTRFS_DEFRAG_RANGE_START_IO
diff --git a/src/xlat/btrfs_dev_replace_cmds.in b/src/xlat/btrfs_dev_replace_cmds.in
new file mode 100644
index 000000000..18600f0f1
--- /dev/null
+++ b/src/xlat/btrfs_dev_replace_cmds.in
@@ -0,0 +1,4 @@
+#val_type uint64_t
+BTRFS_IOCTL_DEV_REPLACE_CMD_START
+BTRFS_IOCTL_DEV_REPLACE_CMD_STATUS
+BTRFS_IOCTL_DEV_REPLACE_CMD_CANCEL
diff --git a/src/xlat/btrfs_dev_replace_results.in b/src/xlat/btrfs_dev_replace_results.in
new file mode 100644
index 000000000..bf8928239
--- /dev/null
+++ b/src/xlat/btrfs_dev_replace_results.in
@@ -0,0 +1,5 @@
+#val_type uint64_t
+BTRFS_IOCTL_DEV_REPLACE_RESULT_NO_ERROR
+BTRFS_IOCTL_DEV_REPLACE_RESULT_NOT_STARTED
+BTRFS_IOCTL_DEV_REPLACE_RESULT_ALREADY_STARTED
+BTRFS_IOCTL_DEV_REPLACE_RESULT_SCRUB_INPROGRESS
diff --git a/src/xlat/btrfs_dev_replace_state.in b/src/xlat/btrfs_dev_replace_state.in
new file mode 100644
index 000000000..bbc0ba150
--- /dev/null
+++ b/src/xlat/btrfs_dev_replace_state.in
@@ -0,0 +1,6 @@
+#val_type uint64_t
+BTRFS_IOCTL_DEV_REPLACE_STATE_NEVER_STARTED
+BTRFS_IOCTL_DEV_REPLACE_STATE_STARTED
+BTRFS_IOCTL_DEV_REPLACE_STATE_FINISHED
+BTRFS_IOCTL_DEV_REPLACE_STATE_CANCELED
+BTRFS_IOCTL_DEV_REPLACE_STATE_SUSPENDED
diff --git a/src/xlat/btrfs_dev_stats_flags.in b/src/xlat/btrfs_dev_stats_flags.in
new file mode 100644
index 000000000..9ff56c33a
--- /dev/null
+++ b/src/xlat/btrfs_dev_stats_flags.in
@@ -0,0 +1,2 @@
+#val_type uint64_t
+BTRFS_DEV_STATS_RESET
diff --git a/src/xlat/btrfs_dev_stats_values.in b/src/xlat/btrfs_dev_stats_values.in
new file mode 100644
index 000000000..47644b07b
--- /dev/null
+++ b/src/xlat/btrfs_dev_stats_values.in
@@ -0,0 +1,8 @@
+#unconditional
+#value_indexed
+#val_type uint64_t
+BTRFS_DEV_STAT_WRITE_ERRS
+BTRFS_DEV_STAT_READ_ERRS
+BTRFS_DEV_STAT_FLUSH_ERRS
+BTRFS_DEV_STAT_CORRUPTION_ERRS
+BTRFS_DEV_STAT_GENERATION_ERRS
diff --git a/src/xlat/btrfs_features_compat.in b/src/xlat/btrfs_features_compat.in
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/src/xlat/btrfs_features_compat.in
diff --git a/src/xlat/btrfs_features_compat_ro.in b/src/xlat/btrfs_features_compat_ro.in
new file mode 100644
index 000000000..5a745ee38
--- /dev/null
+++ b/src/xlat/btrfs_features_compat_ro.in
@@ -0,0 +1,3 @@
+#val_type uint64_t
+BTRFS_FEATURE_COMPAT_RO_FREE_SPACE_TREE (1ULL << 0)
+BTRFS_FEATURE_COMPAT_RO_FREE_SPACE_TREE_VALID (1ULL << 1)
diff --git a/src/xlat/btrfs_features_incompat.in b/src/xlat/btrfs_features_incompat.in
new file mode 100644
index 000000000..248772b59
--- /dev/null
+++ b/src/xlat/btrfs_features_incompat.in
@@ -0,0 +1,12 @@
+#val_type uint64_t
+BTRFS_FEATURE_INCOMPAT_MIXED_BACKREF (1ULL << 0)
+BTRFS_FEATURE_INCOMPAT_DEFAULT_SUBVOL (1ULL << 1)
+BTRFS_FEATURE_INCOMPAT_MIXED_GROUPS (1ULL << 2)
+BTRFS_FEATURE_INCOMPAT_COMPRESS_LZO (1ULL << 3)
+BTRFS_FEATURE_INCOMPAT_COMPRESS_LZOv2 (1ULL << 4)
+BTRFS_FEATURE_INCOMPAT_BIG_METADATA (1ULL << 5)
+BTRFS_FEATURE_INCOMPAT_EXTENDED_IREF (1ULL << 6)
+BTRFS_FEATURE_INCOMPAT_RAID56 (1ULL << 7)
+BTRFS_FEATURE_INCOMPAT_SKINNY_METADATA (1ULL << 8)
+BTRFS_FEATURE_INCOMPAT_NO_HOLES (1ULL << 9)
+BTRFS_FEATURE_INCOMPAT_METADATA_UUID (1ULL << 10)
diff --git a/src/xlat/btrfs_key_types.in b/src/xlat/btrfs_key_types.in
new file mode 100644
index 000000000..5721e6009
--- /dev/null
+++ b/src/xlat/btrfs_key_types.in
@@ -0,0 +1,42 @@
+#val_type uint64_t
+BTRFS_INODE_ITEM_KEY 1
+BTRFS_INODE_REF_KEY 12
+BTRFS_INODE_EXTREF_KEY 13
+BTRFS_XATTR_ITEM_KEY 24
+BTRFS_ORPHAN_ITEM_KEY 48
+BTRFS_DIR_LOG_ITEM_KEY 60
+BTRFS_DIR_LOG_INDEX_KEY 72
+BTRFS_DIR_ITEM_KEY 84
+BTRFS_DIR_INDEX_KEY 96
+BTRFS_EXTENT_DATA_KEY 108
+BTRFS_EXTENT_CSUM_KEY 128
+BTRFS_ROOT_ITEM_KEY 132
+BTRFS_ROOT_BACKREF_KEY 144
+BTRFS_ROOT_REF_KEY 156
+BTRFS_EXTENT_ITEM_KEY 168
+BTRFS_METADATA_ITEM_KEY 169
+BTRFS_TREE_BLOCK_REF_KEY 176
+BTRFS_EXTENT_DATA_REF_KEY 178
+BTRFS_EXTENT_REF_V0_KEY 180
+BTRFS_SHARED_BLOCK_REF_KEY 182
+BTRFS_SHARED_DATA_REF_KEY 184
+BTRFS_BLOCK_GROUP_ITEM_KEY 192
+BTRFS_FREE_SPACE_INFO_KEY 198
+BTRFS_FREE_SPACE_EXTENT_KEY 199
+BTRFS_FREE_SPACE_BITMAP_KEY 200
+BTRFS_DEV_EXTENT_KEY 204
+BTRFS_DEV_ITEM_KEY 216
+BTRFS_CHUNK_ITEM_KEY 228
+BTRFS_QGROUP_STATUS_KEY 240
+BTRFS_QGROUP_INFO_KEY 242
+BTRFS_QGROUP_LIMIT_KEY 244
+BTRFS_QGROUP_RELATION_KEY 246
+BTRFS_BALANCE_ITEM_KEY 248
+BTRFS_TEMPORARY_ITEM_KEY 248
+BTRFS_DEV_STATS_KEY 249
+BTRFS_PERSISTENT_ITEM_KEY 249
+BTRFS_DEV_REPLACE_KEY 250
+BTRFS_UUID_KEY_SUBVOL 251
+BTRFS_UUID_KEY_RECEIVED_SUBVOL 252
+BTRFS_STRING_ITEM_KEY 253
+UINT32_MAX -1U
diff --git a/src/xlat/btrfs_logical_ino_args_flags.in b/src/xlat/btrfs_logical_ino_args_flags.in
new file mode 100644
index 000000000..5eea6c240
--- /dev/null
+++ b/src/xlat/btrfs_logical_ino_args_flags.in
@@ -0,0 +1 @@
+BTRFS_LOGICAL_INO_ARGS_IGNORE_OFFSET (1ULL << 0)
diff --git a/src/xlat/btrfs_qgroup_ctl_cmds.in b/src/xlat/btrfs_qgroup_ctl_cmds.in
new file mode 100644
index 000000000..05e200363
--- /dev/null
+++ b/src/xlat/btrfs_qgroup_ctl_cmds.in
@@ -0,0 +1,4 @@
+#val_type uint64_t
+BTRFS_QUOTA_CTL_ENABLE
+BTRFS_QUOTA_CTL_DISABLE
+BTRFS_QUOTA_CTL_RESCAN__NOTUSED
diff --git a/src/xlat/btrfs_qgroup_inherit_flags.in b/src/xlat/btrfs_qgroup_inherit_flags.in
new file mode 100644
index 000000000..0e133b9cb
--- /dev/null
+++ b/src/xlat/btrfs_qgroup_inherit_flags.in
@@ -0,0 +1,2 @@
+#val_type uint64_t
+BTRFS_QGROUP_INHERIT_SET_LIMITS
diff --git a/src/xlat/btrfs_qgroup_limit_flags.in b/src/xlat/btrfs_qgroup_limit_flags.in
new file mode 100644
index 000000000..bac7abed9
--- /dev/null
+++ b/src/xlat/btrfs_qgroup_limit_flags.in
@@ -0,0 +1,7 @@
+#val_type uint64_t
+BTRFS_QGROUP_LIMIT_MAX_RFER (1ULL << 0)
+BTRFS_QGROUP_LIMIT_MAX_EXCL (1ULL << 1)
+BTRFS_QGROUP_LIMIT_RSV_RFER (1ULL << 2)
+BTRFS_QGROUP_LIMIT_RSV_EXCL (1ULL << 3)
+BTRFS_QGROUP_LIMIT_RFER_CMPR (1ULL << 4)
+BTRFS_QGROUP_LIMIT_EXCL_CMPR (1ULL << 5)
diff --git a/src/xlat/btrfs_qgroup_status_flags.in b/src/xlat/btrfs_qgroup_status_flags.in
new file mode 100644
index 000000000..86f60ac51
--- /dev/null
+++ b/src/xlat/btrfs_qgroup_status_flags.in
@@ -0,0 +1,3 @@
+#val_type uint64_t
+BTRFS_QGROUP_STATUS_FLAG_ON (1ULL << 0)
+BTRFS_QGROUP_STATUS_FLAG_RESCAN (1ULL << 1)
diff --git a/src/xlat/btrfs_scrub_flags.in b/src/xlat/btrfs_scrub_flags.in
new file mode 100644
index 000000000..914de3d12
--- /dev/null
+++ b/src/xlat/btrfs_scrub_flags.in
@@ -0,0 +1,2 @@
+#val_type uint64_t
+BTRFS_SCRUB_READONLY 1
diff --git a/src/xlat/btrfs_send_flags.in b/src/xlat/btrfs_send_flags.in
new file mode 100644
index 000000000..652ef390f
--- /dev/null
+++ b/src/xlat/btrfs_send_flags.in
@@ -0,0 +1,3 @@
+BTRFS_SEND_FLAG_NO_FILE_DATA 0x1
+BTRFS_SEND_FLAG_OMIT_STREAM_HEADER 0x2
+BTRFS_SEND_FLAG_OMIT_END_CMD 0x4
diff --git a/src/xlat/btrfs_snap_flags_v2.in b/src/xlat/btrfs_snap_flags_v2.in
new file mode 100644
index 000000000..43ea5749b
--- /dev/null
+++ b/src/xlat/btrfs_snap_flags_v2.in
@@ -0,0 +1,4 @@
+#val_type uint64_t
+BTRFS_SUBVOL_CREATE_ASYNC
+BTRFS_SUBVOL_RDONLY
+BTRFS_SUBVOL_QGROUP_INHERIT
diff --git a/src/xlat/btrfs_space_info_flags.in b/src/xlat/btrfs_space_info_flags.in
new file mode 100644
index 000000000..be6d1951d
--- /dev/null
+++ b/src/xlat/btrfs_space_info_flags.in
@@ -0,0 +1,12 @@
+#val_type uint64_t
+BTRFS_BLOCK_GROUP_DATA (1ULL << 0)
+BTRFS_BLOCK_GROUP_SYSTEM (1ULL << 1)
+BTRFS_BLOCK_GROUP_METADATA (1ULL << 2)
+BTRFS_BLOCK_GROUP_RAID0 (1ULL << 3)
+BTRFS_BLOCK_GROUP_RAID1 (1ULL << 4)
+BTRFS_BLOCK_GROUP_DUP (1ULL << 5)
+BTRFS_BLOCK_GROUP_RAID10 (1ULL << 6)
+BTRFS_BLOCK_GROUP_RAID5 (1ULL << 7)
+BTRFS_BLOCK_GROUP_RAID6 (1ULL << 8)
+BTRFS_AVAIL_ALLOC_BIT_SINGLE (1ULL << 48)
+BTRFS_SPACE_INFO_GLOBAL_RSV (1ULL << 49)
diff --git a/src/xlat/btrfs_tree_objectids.in b/src/xlat/btrfs_tree_objectids.in
new file mode 100644
index 000000000..0b6e598c5
--- /dev/null
+++ b/src/xlat/btrfs_tree_objectids.in
@@ -0,0 +1,14 @@
+#val_type uint64_t
+BTRFS_ROOT_TREE_OBJECTID 1ULL
+BTRFS_EXTENT_TREE_OBJECTID 2ULL
+BTRFS_CHUNK_TREE_OBJECTID 3ULL
+BTRFS_DEV_TREE_OBJECTID 4ULL
+BTRFS_FS_TREE_OBJECTID 5ULL
+BTRFS_ROOT_TREE_DIR_OBJECTID 6ULL
+BTRFS_CSUM_TREE_OBJECTID 7ULL
+BTRFS_QUOTA_TREE_OBJECTID 8ULL
+BTRFS_UUID_TREE_OBJECTID 9ULL
+BTRFS_FREE_SPACE_TREE_OBJECTID 10ULL
+BTRFS_FIRST_FREE_OBJECTID 256ULL
+BTRFS_LAST_FREE_OBJECTID -256ULL
+UINT64_MAX -1ULL
diff --git a/src/xlat/cacheflush_flags.in b/src/xlat/cacheflush_flags.in
new file mode 100644
index 000000000..06ed0d6ca
--- /dev/null
+++ b/src/xlat/cacheflush_flags.in
@@ -0,0 +1,21 @@
+#if defined M68K
+
+FLUSH_CACHE_BOTH 3
+FLUSH_CACHE_DATA 1
+FLUSH_CACHE_INSN 2
+
+#elif defined BFIN || defined CSKY
+
+BCACHE 3
+ICACHE 1
+DCACHE 2
+
+#elif defined SH
+
+BCACHE 7
+ICACHE 4
+DCACHE 3
+CACHEFLUSH_D_INVAL 1
+CACHEFLUSH_D_WB 2
+
+#endif
diff --git a/src/xlat/cacheflush_scope.in b/src/xlat/cacheflush_scope.in
new file mode 100644
index 000000000..5f91b9077
--- /dev/null
+++ b/src/xlat/cacheflush_scope.in
@@ -0,0 +1,3 @@
+FLUSH_SCOPE_LINE
+FLUSH_SCOPE_PAGE
+FLUSH_SCOPE_ALL
diff --git a/src/xlat/caif_protocols.in b/src/xlat/caif_protocols.in
new file mode 100644
index 000000000..76ba89600
--- /dev/null
+++ b/src/xlat/caif_protocols.in
@@ -0,0 +1,7 @@
+#value_indexed
+CAIFPROTO_AT 0
+CAIFPROTO_DATAGRAM 1
+CAIFPROTO_DATAGRAM_LOOP 2
+CAIFPROTO_UTIL 3
+CAIFPROTO_RFM 4
+CAIFPROTO_DEBUG 5
diff --git a/src/xlat/can_protocols.in b/src/xlat/can_protocols.in
new file mode 100644
index 000000000..05a7ae617
--- /dev/null
+++ b/src/xlat/can_protocols.in
@@ -0,0 +1,8 @@
+#value_indexed
+CAN_RAW 1
+CAN_BCM 2
+CAN_TP16 3
+CAN_TP20 4
+CAN_MCNET 5
+CAN_ISOTP 6
+CAN_J1939 7
diff --git a/src/xlat/cap.in b/src/xlat/cap.in
new file mode 100644
index 000000000..b6af93ba9
--- /dev/null
+++ b/src/xlat/cap.in
@@ -0,0 +1,43 @@
+#unconditional
+#value_indexed
+CAP_CHOWN
+CAP_DAC_OVERRIDE
+CAP_DAC_READ_SEARCH
+CAP_FOWNER
+CAP_FSETID
+CAP_KILL
+CAP_SETGID
+CAP_SETUID
+CAP_SETPCAP
+CAP_LINUX_IMMUTABLE
+CAP_NET_BIND_SERVICE
+CAP_NET_BROADCAST
+CAP_NET_ADMIN
+CAP_NET_RAW
+CAP_IPC_LOCK
+CAP_IPC_OWNER
+CAP_SYS_MODULE
+CAP_SYS_RAWIO
+CAP_SYS_CHROOT
+CAP_SYS_PTRACE
+CAP_SYS_PACCT
+CAP_SYS_ADMIN
+CAP_SYS_BOOT
+CAP_SYS_NICE
+CAP_SYS_RESOURCE
+CAP_SYS_TIME
+CAP_SYS_TTY_CONFIG
+CAP_MKNOD
+CAP_LEASE
+CAP_AUDIT_WRITE
+CAP_AUDIT_CONTROL
+CAP_SETFCAP
+CAP_MAC_OVERRIDE
+CAP_MAC_ADMIN
+CAP_SYSLOG
+CAP_WAKE_ALARM
+CAP_BLOCK_SUSPEND
+CAP_AUDIT_READ
+CAP_PERFMON
+CAP_BPF
+CAP_CHECKPOINT_RESTORE
diff --git a/src/xlat/cap_mask0.in b/src/xlat/cap_mask0.in
new file mode 100644
index 000000000..4c48b847c
--- /dev/null
+++ b/src/xlat/cap_mask0.in
@@ -0,0 +1,33 @@
+#unconditional
+1<<CAP_CHOWN
+1<<CAP_DAC_OVERRIDE
+1<<CAP_DAC_READ_SEARCH
+1<<CAP_FOWNER
+1<<CAP_FSETID
+1<<CAP_KILL
+1<<CAP_SETGID
+1<<CAP_SETUID
+1<<CAP_SETPCAP
+1<<CAP_LINUX_IMMUTABLE
+1<<CAP_NET_BIND_SERVICE
+1<<CAP_NET_BROADCAST
+1<<CAP_NET_ADMIN
+1<<CAP_NET_RAW
+1<<CAP_IPC_LOCK
+1<<CAP_IPC_OWNER
+1<<CAP_SYS_MODULE
+1<<CAP_SYS_RAWIO
+1<<CAP_SYS_CHROOT
+1<<CAP_SYS_PTRACE
+1<<CAP_SYS_PACCT
+1<<CAP_SYS_ADMIN
+1<<CAP_SYS_BOOT
+1<<CAP_SYS_NICE
+1<<CAP_SYS_RESOURCE
+1<<CAP_SYS_TIME
+1<<CAP_SYS_TTY_CONFIG
+1<<CAP_MKNOD
+1<<CAP_LEASE
+1<<CAP_AUDIT_WRITE
+1<<CAP_AUDIT_CONTROL
+1<<CAP_SETFCAP
diff --git a/src/xlat/cap_mask1.in b/src/xlat/cap_mask1.in
new file mode 100644
index 000000000..82153e1dd
--- /dev/null
+++ b/src/xlat/cap_mask1.in
@@ -0,0 +1,10 @@
+#unconditional
+1<<CAP_MAC_OVERRIDE
+1<<CAP_MAC_ADMIN
+1<<CAP_SYSLOG
+1<<CAP_WAKE_ALARM
+1<<CAP_BLOCK_SUSPEND
+1<<CAP_AUDIT_READ
+1<<CAP_PERFMON
+1<<CAP_BPF
+1<<CAP_CHECKPOINT_RESTORE
diff --git a/src/xlat/cap_version.in b/src/xlat/cap_version.in
new file mode 100644
index 000000000..3d5b74464
--- /dev/null
+++ b/src/xlat/cap_version.in
@@ -0,0 +1,4 @@
+#unconditional
+_LINUX_CAPABILITY_VERSION_1
+_LINUX_CAPABILITY_VERSION_2
+_LINUX_CAPABILITY_VERSION_3
diff --git a/src/xlat/clockflags.in b/src/xlat/clockflags.in
new file mode 100644
index 000000000..2c3a82ff2
--- /dev/null
+++ b/src/xlat/clockflags.in
@@ -0,0 +1 @@
+TIMER_ABSTIME
diff --git a/src/xlat/clocknames.in b/src/xlat/clocknames.in
new file mode 100644
index 000000000..207ade8e7
--- /dev/null
+++ b/src/xlat/clocknames.in
@@ -0,0 +1,13 @@
+#value_indexed
+CLOCK_REALTIME 0
+CLOCK_MONOTONIC 1
+CLOCK_PROCESS_CPUTIME_ID 2
+CLOCK_THREAD_CPUTIME_ID 3
+CLOCK_MONOTONIC_RAW 4
+CLOCK_REALTIME_COARSE 5
+CLOCK_MONOTONIC_COARSE 6
+CLOCK_BOOTTIME 7
+CLOCK_REALTIME_ALARM 8
+CLOCK_BOOTTIME_ALARM 9
+CLOCK_SGI_CYCLE 10
+CLOCK_TAI 11
diff --git a/src/xlat/clone3_flags.in b/src/xlat/clone3_flags.in
new file mode 100644
index 000000000..9eb55e17a
--- /dev/null
+++ b/src/xlat/clone3_flags.in
@@ -0,0 +1,4 @@
+#val_type uint64_t
+CLONE_NEWTIME 0x80
+CLONE_CLEAR_SIGHAND 0x100000000ULL
+CLONE_INTO_CGROUP 0x200000000ULL
diff --git a/src/xlat/clone_flags.in b/src/xlat/clone_flags.in
new file mode 100644
index 000000000..9c967234b
--- /dev/null
+++ b/src/xlat/clone_flags.in
@@ -0,0 +1,24 @@
+CLONE_VM 0x00000100
+CLONE_FS 0x00000200
+CLONE_FILES 0x00000400
+CLONE_SIGHAND 0x00000800
+CLONE_PIDFD 0x00001000
+CLONE_PTRACE 0x00002000
+CLONE_VFORK 0x00004000
+CLONE_PARENT 0x00008000
+CLONE_THREAD 0x00010000
+CLONE_NEWNS 0x00020000
+CLONE_SYSVSEM 0x00040000
+CLONE_SETTLS 0x00080000
+CLONE_PARENT_SETTID 0x00100000
+CLONE_CHILD_CLEARTID 0x00200000
+/* CLONE_DETACHED 0x00400000 - ignored by kernel */
+CLONE_UNTRACED 0x00800000
+CLONE_CHILD_SETTID 0x01000000
+CLONE_NEWCGROUP 0x02000000
+CLONE_NEWUTS 0x04000000
+CLONE_NEWIPC 0x08000000
+CLONE_NEWUSER 0x10000000
+CLONE_NEWPID 0x20000000
+CLONE_NEWNET 0x40000000
+CLONE_IO 0x80000000
diff --git a/src/xlat/close_range_flags.in b/src/xlat/close_range_flags.in
new file mode 100644
index 000000000..5b4261e9c
--- /dev/null
+++ b/src/xlat/close_range_flags.in
@@ -0,0 +1,3 @@
+#enum
+#include <linux/close_range.h>
+CLOSE_RANGE_UNSHARE (1U << 1)
diff --git a/src/xlat/cpuclocknames.in b/src/xlat/cpuclocknames.in
new file mode 100644
index 000000000..b7b9a828e
--- /dev/null
+++ b/src/xlat/cpuclocknames.in
@@ -0,0 +1,4 @@
+#value_indexed
+CPUCLOCK_PROF 0
+CPUCLOCK_VIRT 1
+CPUCLOCK_SCHED 2
diff --git a/src/xlat/crypto_msgs.in b/src/xlat/crypto_msgs.in
new file mode 100644
index 000000000..89426a9ac
--- /dev/null
+++ b/src/xlat/crypto_msgs.in
@@ -0,0 +1,7 @@
+#sorted
+CRYPTO_MSG_NEWALG 0x10
+CRYPTO_MSG_DELALG 0x11
+CRYPTO_MSG_UPDATEALG 0x12
+CRYPTO_MSG_GETALG 0x13
+CRYPTO_MSG_DELRNG 0x14
+CRYPTO_MSG_GETSTAT 0x15
diff --git a/src/xlat/crypto_nl_attrs.in b/src/xlat/crypto_nl_attrs.in
new file mode 100644
index 000000000..7ec320739
--- /dev/null
+++ b/src/xlat/crypto_nl_attrs.in
@@ -0,0 +1,13 @@
+#value_indexed
+CRYPTOCFGA_UNSPEC 0
+CRYPTOCFGA_PRIORITY_VAL 1
+CRYPTOCFGA_REPORT_LARVAL 2
+CRYPTOCFGA_REPORT_HASH 3
+CRYPTOCFGA_REPORT_BLKCIPHER 4
+CRYPTOCFGA_REPORT_AEAD 5
+CRYPTOCFGA_REPORT_COMPRESS 6
+CRYPTOCFGA_REPORT_RNG 7
+CRYPTOCFGA_REPORT_CIPHER 8
+CRYPTOCFGA_REPORT_AKCIPHER 9
+CRYPTOCFGA_REPORT_KPP 10
+CRYPTOCFGA_REPORT_ACOMP 11
diff --git a/src/xlat/dcb_commands.in b/src/xlat/dcb_commands.in
new file mode 100644
index 000000000..9b3f5c3ed
--- /dev/null
+++ b/src/xlat/dcb_commands.in
@@ -0,0 +1,29 @@
+#value_indexed
+DCB_CMD_UNDEFINED 0
+DCB_CMD_GSTATE 1
+DCB_CMD_SSTATE 2
+DCB_CMD_PGTX_GCFG 3
+DCB_CMD_PGTX_SCFG 4
+DCB_CMD_PGRX_GCFG 5
+DCB_CMD_PGRX_SCFG 6
+DCB_CMD_PFC_GCFG 7
+DCB_CMD_PFC_SCFG 8
+DCB_CMD_SET_ALL 9
+DCB_CMD_GPERM_HWADDR 10
+DCB_CMD_GCAP 11
+DCB_CMD_GNUMTCS 12
+DCB_CMD_SNUMTCS 13
+DCB_CMD_PFC_GSTATE 14
+DCB_CMD_PFC_SSTATE 15
+DCB_CMD_BCN_GCFG 16
+DCB_CMD_BCN_SCFG 17
+DCB_CMD_GAPP 18
+DCB_CMD_SAPP 19
+DCB_CMD_IEEE_SET 20
+DCB_CMD_IEEE_GET 21
+DCB_CMD_GDCBX 22
+DCB_CMD_SDCBX 23
+DCB_CMD_GFEATCFG 24
+DCB_CMD_SFEATCFG 25
+DCB_CMD_CEE_GET 26
+DCB_CMD_IEEE_DEL 27
diff --git a/src/xlat/delete_module_flags.in b/src/xlat/delete_module_flags.in
new file mode 100644
index 000000000..8f0271180
--- /dev/null
+++ b/src/xlat/delete_module_flags.in
@@ -0,0 +1,2 @@
+O_NONBLOCK
+O_TRUNC
diff --git a/src/xlat/dirent_types.in b/src/xlat/dirent_types.in
new file mode 100644
index 000000000..b16cc21aa
--- /dev/null
+++ b/src/xlat/dirent_types.in
@@ -0,0 +1,9 @@
+DT_UNKNOWN
+DT_FIFO
+DT_CHR
+DT_DIR
+DT_BLK
+DT_REG
+DT_LNK
+DT_SOCK
+DT_WHT
diff --git a/src/xlat/dm_flags.in b/src/xlat/dm_flags.in
new file mode 100644
index 000000000..fa734c813
--- /dev/null
+++ b/src/xlat/dm_flags.in
@@ -0,0 +1,19 @@
+DM_READONLY_FLAG (1 << 0)
+DM_SUSPEND_FLAG (1 << 1)
+/* Defined in lvm2/libdm/ioctl/libdm-iface.c */
+DM_EXISTS_FLAG (1 << 2)
+DM_PERSISTENT_DEV_FLAG (1 << 3)
+DM_STATUS_TABLE_FLAG (1 << 4)
+DM_ACTIVE_PRESENT_FLAG (1 << 5)
+DM_INACTIVE_PRESENT_FLAG (1 << 6)
+DM_BUFFER_FULL_FLAG (1 << 8)
+DM_SKIP_BDGET_FLAG (1 << 9)
+DM_SKIP_LOCKFS_FLAG (1 << 10)
+DM_NOFLUSH_FLAG (1 << 11)
+DM_QUERY_INACTIVE_TABLE_FLAG (1 << 12)
+DM_UEVENT_GENERATED_FLAG (1 << 13)
+DM_UUID_FLAG (1 << 14)
+DM_SECURE_DATA_FLAG (1 << 15)
+DM_DATA_OUT_FLAG (1 << 16)
+DM_DEFERRED_REMOVE (1 << 17)
+DM_INTERNAL_SUSPEND_FLAG (1 << 18)
diff --git a/src/xlat/ebpf_class.in b/src/xlat/ebpf_class.in
new file mode 100644
index 000000000..259bdd9d8
--- /dev/null
+++ b/src/xlat/ebpf_class.in
@@ -0,0 +1,9 @@
+#value_indexed
+BPF_LD 0x0
+BPF_LDX 0x1
+BPF_ST 0x2
+BPF_STX 0x3
+BPF_ALU 0x4
+BPF_JMP 0x5
+BPF_JMP32 0x6
+BPF_ALU64 0x7
diff --git a/src/xlat/ebpf_mode.in b/src/xlat/ebpf_mode.in
new file mode 100644
index 000000000..d8a65b6d4
--- /dev/null
+++ b/src/xlat/ebpf_mode.in
@@ -0,0 +1,5 @@
+BPF_IMM 0x00
+BPF_ABS 0x20
+BPF_IND 0x40
+BPF_MEM 0x60
+BPF_XADD 0xc0
diff --git a/src/xlat/ebpf_op_alu.in b/src/xlat/ebpf_op_alu.in
new file mode 100644
index 000000000..2b46f200f
--- /dev/null
+++ b/src/xlat/ebpf_op_alu.in
@@ -0,0 +1,3 @@
+BPF_MOV 0xb0
+BPF_ARSH 0xc0
+BPF_END 0xd0
diff --git a/src/xlat/ebpf_op_jmp.in b/src/xlat/ebpf_op_jmp.in
new file mode 100644
index 000000000..8d49cf674
--- /dev/null
+++ b/src/xlat/ebpf_op_jmp.in
@@ -0,0 +1,9 @@
+BPF_JNE 0x50
+BPF_JSGT 0x60
+BPF_JSGE 0x70
+BPF_CALL 0x80
+BPF_EXIT 0x90
+BPF_JLT 0xa0
+BPF_JLE 0xb0
+BPF_JSLT 0xc0
+BPF_JSLE 0xd0
diff --git a/src/xlat/ebpf_regs.in b/src/xlat/ebpf_regs.in
new file mode 100644
index 000000000..9db066efe
--- /dev/null
+++ b/src/xlat/ebpf_regs.in
@@ -0,0 +1,12 @@
+#value_indexed
+BPF_REG_0 0
+BPF_REG_1 1
+BPF_REG_2 2
+BPF_REG_3 3
+BPF_REG_4 4
+BPF_REG_5 5
+BPF_REG_6 6
+BPF_REG_7 7
+BPF_REG_8 8
+BPF_REG_9 9
+BPF_REG_10 10
diff --git a/src/xlat/ebpf_size.in b/src/xlat/ebpf_size.in
new file mode 100644
index 000000000..5f9afa385
--- /dev/null
+++ b/src/xlat/ebpf_size.in
@@ -0,0 +1 @@
+BPF_DW 0x18
diff --git a/src/xlat/efd_flags.in b/src/xlat/efd_flags.in
new file mode 100644
index 000000000..258fb9f0d
--- /dev/null
+++ b/src/xlat/efd_flags.in
@@ -0,0 +1,5 @@
+EFD_SEMAPHORE 1
+#if defined EFD_CLOEXEC || defined O_CLOEXEC
+EFD_CLOEXEC O_CLOEXEC
+#endif
+EFD_NONBLOCK O_NONBLOCK
diff --git a/src/xlat/elf_em.in b/src/xlat/elf_em.in
new file mode 100644
index 000000000..9ffbcd6e0
--- /dev/null
+++ b/src/xlat/elf_em.in
@@ -0,0 +1,202 @@
+#sorted
+/* General source: include/uapi/linux/elf-em.h */
+/* See also https://www.sco.com/developers/gabi/latest/ch4.eheader.html */
+EM_NONE 0
+EM_M32 1 /* AT&T WE 32100 */
+EM_SPARC 2 /* SPARC */
+EM_386 3 /* Intel 80386 */
+EM_68K 4 /* Motorola 68000 */
+EM_88K 5 /* Motorola 88000 */
+EM_486 6 /* "Perhaps disused" */
+/* EM_IAMCU 6 - Intel MCU */
+EM_860 7 /* Intel 80860 */
+EM_MIPS 8 /* MIPS I, MIPS R3000 (officially, big-endian only) */
+EM_S370 9 /* IBM System/370 Processor */
+EM_MIPS_RS3_LE 10 /* MIPS RS3000 Little-endian */
+/* EM_MIPS_RS4_BE 10 - MIPS R4000 big-endian */
+/* 11-14 reserved for future use */
+EM_PARISC 15 /* Hewlett-Packard PA-RISC */
+/* 16 reserved for future use */
+EM_VPP500 17 /* Fujitsu VPP500 */
+EM_SPARC32PLUS 18 /* Enhanced instruction seti SPARC, Sun's "v8plus" */
+EM_960 19 /* Intel 80960 */
+EM_PPC 20 /* PowerPC */
+EM_PPC64 21 /* 64-bit PowerPC */
+EM_S390 22 /* IBM System/390 Processor */
+EM_SPU 23 /* IBM Cell BE SPU/SPC */
+/* 24-35 reserved for future use */
+EM_V800 36 /* NEC V800 */
+EM_FR20 37 /* Fujitsu FR20 */
+EM_RH32 38 /* TRW RH-32 */
+EM_RCE 39 /* Motorola RCE */
+EM_ARM 40 /* ARM 32-bit architecture */
+/* EM_ALPHA 41 - Digital Alpha */
+EM_SH 42 /* Hitachi SH */
+EM_SPARCV9 43 /* SPARC Version 9 */
+EM_TRICORE 44 /* Siemens TriCore embedded processor */
+EM_ARC 45 /* Argonaut RISC Core, Argonaut Technologies Inc. */
+EM_H8_300 46 /* Hitachi/Renesas H8/300 */
+EM_H8_300H 47 /* Hitachi H8/300H */
+EM_H8S 48 /* Hitachi H8S */
+EM_H8_500 49 /* Hitachi H8/500 */
+EM_IA_64 50 /* Intel IA-64 processor architecture */
+EM_MIPS_X 51 /* Stanford MIPS-X */
+EM_COLDFIRE 52 /* Motorola ColdFire */
+EM_68HC12 53 /* Motorola M68HC12 */
+EM_MMA 54 /* Fujitsu MMA Multimedia Accelerator */
+EM_PCP 55 /* Siemens PCP */
+EM_NCPU 56 /* Sony nCPU embedded RISC processor */
+EM_NDR1 57 /* Denso NDR1 microprocessor */
+EM_STARCORE 58 /* Motorola Star*Core processor */
+EM_ME16 59 /* Toyota ME16 processor */
+EM_ST100 60 /* STMicroelectronics ST100 processor */
+EM_TINYJ 61 /* Advanced Logic Corp. TinyJ embedded processor family */
+EM_X86_64 62 /* AMD x86-64 architecture */
+EM_PDSP 63 /* Sony DSP Processor */
+EM_PDP10 64 /* Digital Equipment Corp. PDP-10 */
+EM_PDP11 65 /* Digital Equipment Corp. PDP-11 */
+EM_FX66 66 /* Siemens FX66 microcontroller */
+EM_ST9PLUS 67 /* STMicroelectronics ST9+ 8/16 bit microcontroller */
+EM_ST7 68 /* STMicroelectronics ST7 8-bit microcontroller */
+EM_68HC16 69 /* Motorola MC68HC16 Microcontroller */
+EM_68HC11 70 /* Motorola MC68HC11 Microcontroller */
+EM_68HC08 71 /* Motorola MC68HC08 Microcontroller */
+EM_68HC05 72 /* Motorola MC68HC05 Microcontroller */
+EM_SVX 73 /* Silicon Graphics SVx */
+EM_ST19 74 /* STMicroelectronics ST19 8-bit microcontroller */
+EM_VAX 75 /* Digital VAX */
+EM_CRIS 76 /* Axis Communications 32-bit embedded processor */
+EM_JAVELIN 77 /* Infineon Technologies 32-bit embedded processor */
+EM_FIREPATH 78 /* Element 14 64-bit DSP Processor */
+EM_ZSP 79 /* LSI Logic 16-bit DSP Processor */
+EM_MMIX 80 /* Donald Knuth's educational 64-bit processor */
+EM_HUANY 81 /* Harvard University machine-independent object files */
+EM_PRISM 82 /* SiTera Prism */
+EM_AVR 83 /* Atmel AVR 8-bit microcontroller */
+EM_FR30 84 /* Fujitsu FR30 */
+EM_D10V 85 /* Mitsubishi D10V */
+EM_D30V 86 /* Mitsubishi D30V */
+EM_V850 87 /* NEC v850, removed in v4.6-rc1~95^2~36 */
+EM_M32R 88 /* Mitsubishi M32R */
+EM_MN10300 89 /* Matsushita MN10300 */
+EM_MN10200 90 /* Matsushita MN10200 */
+EM_PJ 91 /* picoJava */
+EM_OPENRISC 92 /* OpenRISC 32-bit embedded processor */
+EM_ARCOMPACT 93 /* ARCompact processor */
+EM_XTENSA 94 /* arch/xtensa/include/asm/elf.h; Tensilica Xtensa Architecture */
+EM_VIDEOCORE 95 /* Alphamosaic VideoCore processor */
+EM_TMM_GPP 96 /* Thompson Multimedia General Purpose Processor */
+EM_NS32K 97 /* National Semiconductor 32000 series */
+EM_TPC 98 /* Tenor Network TPC processor */
+EM_SNP1K 99 /* Trebia SNP 1000 processor */
+EM_ST200 100 /* STMicroelectronics (www.st.com) ST200 microcontroller */
+EM_IP2K 101 /* Ubicom IP2xxx microcontroller family */
+EM_MAX 102 /* MAX Processor */
+EM_CR 103 /* National Semiconductor CompactRISC microprocessor */
+EM_F2MC16 104 /* Fujitsu F2MC16 */
+EM_MSP430 105 /* Texas Instruments embedded microcontroller msp430 */
+EM_BLACKFIN 106 /* ADI Blackfin Processor */
+EM_SE_C33 107 /* S1C33 Family of Seiko Epson processors */
+EM_SEP 108 /* Sharp embedded microprocessor */
+EM_ARCA 109 /* Arca RISC Microprocessor */
+EM_UNICORE 110 /* UniCore-32 */
+EM_EXCESS 111 /* eXcess: 16/32/64-bit configurable embedded CPU */
+EM_DXP 112 /* Icera Semiconductor Inc. Deep Execution Processor */
+EM_ALTERA_NIOS2 113 /* Altera Nios II soft-core processor */
+EM_CRX 114 /* National Semiconductor CompactRISC CRX microprocessor */
+EM_XGATE 115 /* Motorola XGATE embedded processor */
+EM_C166 116 /* Infineon C16x/XC16x processor */
+EM_M16C 117 /* Renesas M16C series microprocessors */
+EM_DSPIC30F 118 /* Microchip Technology dsPIC30F Digital Signal Controller */
+EM_CE 119 /* Freescale Communication Engine RISC core */
+EM_M32C 120 /* Renesas M32C series microprocessors */
+/* 121-130 reserved for future use */
+EM_TSK3000 131 /* Altium TSK3000 core */
+EM_RS08 132 /* Freescale RS08 embedded processor */
+EM_SHARC 133 /* Analog Devices SHARC family of 32-bit DSP processors */
+EM_ECOG2 134 /* Cyan Technology eCOG2 microprocessor */
+EM_SCORE7 135 /* Sunplus S+core7 RISC processor, arch/score/include/asm/elf.h; removed in v4.17-rc1~163^2~59 */
+EM_DSP24 136 /* New Japan Radio (NJR) 24-bit DSP Processor */
+EM_VIDEOCORE3 137 /* Broadcom VideoCore III processor */
+EM_LATTICEMICO32 138 /* RISC processor for Lattice FPGA architecture */
+EM_SE_C17 139 /* Seiko Epson C17 family */
+EM_TI_C6000 140 /* The Texas Instruments TMS320C6000 DSP family */
+EM_TI_C2000 141 /* The Texas Instruments TMS320C2000 DSP family */
+EM_TI_C5500 142 /* The Texas Instruments TMS320C55x DSP family */
+EM_TI_ARP32 143 /* Texas Instruments Application Specific RISC Processor, 32bit fetch */
+EM_TI_PRU 144 /* Texas Instruments Programmable Realtime Unit */
+/* 145-159 reserved for future use */
+EM_MMDSP_PLUS 160
+EM_CYPRESS_M8C 161 /* Cypress M8C microprocessor */
+EM_R32C 162 /* Renesas R32C series microprocessors */
+EM_TRIMEDIA 163 /* NXP Semiconductors TriMedia architecture family */
+EM_HEXAGON 164 /* QUALCOMM Hexagon */
+EM_8051 165 /* Intel 8051 and variants */
+EM_STXP7X 166 /* STMicroelectronics STxP7x family of configurable and extensible RISC processors */
+EM_NDS32 167 /* Andes Technology compact code size embedded RISC processor family */
+EM_ECOG1X 168 /* Cyan Technology eCOG1X family (synonym: EM_ECOG1) */
+EM_MAXQ30 169 /* Dallas Semiconductor MAXQ30 Core Micro-controllers */
+EM_XIMO16 170 /* New Japan Radio (NJR) 16-bit DSP Processor */
+EM_MANIK 171 /* M2000 Reconfigurable RISC Microprocessor */
+EM_CRAYNV2 172 /* Cray Inc. NV2 vector architecture */
+EM_RX 173 /* Renesas RX family */
+EM_METAG 174 /* Imagination Technologies META processor architecture, arch/metag/include/asm/elf.h; removed in v4.17-rc1~163^2~63^2~10 */
+EM_MCST_ELBRUS 175 /* MCST Elbrus general purpose hardware architecture */
+EM_ECOG16 176 /* Cyan Technology eCOG16 family */
+EM_CR16 177 /* National Semiconductor CompactRISC CR16 16-bit microprocessor */
+EM_ETPU 178 /* Freescale Extended Time Processing Unit */
+EM_SLE9X 179 /* Infineon Technologies SLE9X core */
+EM_L10M 180 /* Intel L10M/L1OM - Larrabee/Knights Ferry */
+EM_K10M 181 /* Intel K10M/K1OM - Knights Korner */
+/* 182 reserved for future Intel use */
+EM_AARCH64 183
+/* 184 reserved for future ARM use */
+/* EM_AVR32 185 - Atmel Corporation 32-bit microprocessor family */
+EM_STM8 186 /* STMicroeletronics STM8 8-bit microcontroller */
+EM_TILE64 187 /* Tilera TILE64 multicore architecture family */
+EM_TILEPRO 188 /* Tilera TILEPro multicore architecture family */
+EM_MICROBLAZE 189 /* Xilinx MicroBlaze 32-bit RISC soft processor core */
+EM_CUDA 190 /* NVIDIA CUDA architecture */
+EM_TILEGX 191 /* Tilera TILE-Gx multicore architecture family */
+EM_CLOUDSHIELD 192 /* CloudShield architecture family */
+EM_COREA_1ST 193 /* KIPO-KAIST Core-A 1st generation processor family */
+EM_COREA_2ND 194 /* KIPO-KAIST Core-A 2nd generation processor family */
+EM_ARCV2 195 /* Synopsys ARCv2 Cores */
+EM_OPEN8 196 /* Open8 8-bit RISC soft processor core */
+EM_RL78 197 /* Renesas RL78 family */
+EM_VIDEOCORE5 198 /* Broadcom VideoCore V processor */
+EM_78KOR 199 /* Renesas 78KOR family */
+EM_56800EX 200 /* Freescale 56800EX Digital Signal Controller (DSC) */
+EM_BA1 201 /* Beyond BA1 CPU architecture */
+EM_BA2 202 /* Beyond BA2 CPU architecture */
+EM_XCORE 203 /* XMOS xCORE processor family */
+EM_MCHP_PIC 204 /* Microchip 8-bit PIC(r) family */
+/* 205-209 reserved by Intel */
+EM_KM32 210 /* KM211 KM32 32-bit processor */
+EM_KMX32 211 /* KM211 KMX32 32-bit processor */
+EM_KMX16 212 /* KM211 KMX16 16-bit processor */
+EM_KMX8 213 /* KM211 KMX8 8-bit processor */
+EM_KVARC 214 /* KM211 KVARC processor */
+EM_CDP 215 /* Paneve CDP architecture family */
+EM_COGE 216 /* Cognitive Smart Memory Processor */
+EM_COOL 217 /* Bluechip Systems CoolEngine */
+EM_NORC 218 /* Nanoradio Optimized RISC */
+EM_CSR_KALIMBA 219 /* CSR Kalimba architecture family */
+EM_Z80 220 /* Zilog Z80 */
+EM_VISIUM 221 /* Controls and Data Services VISIUMcore processor */
+EM_FT32 222 /* FTDI Chip FT32 high performance 32-bit RISC architecture */
+EM_MOXIE 223 /* Moxie processor family */
+EM_AMDGPU 224 /* AMD GPU architecture */
+EM_RISCV 243 /* RISC-V */
+EM_BPF 247 /* Linux BPF - in-kernel virtual machine */
+EM_CSKY 252 /* C-SKY */
+EM_AVR32 0x18ad /* Atmel AVR32, removed in v4.12-rc1~159^2~5 */
+EM_FRV 0x5441 /* Fujitsu FR-V */
+EM_OR32 0x8472 /* arch/openrisc/include/uapi/asm/elf.h */
+EM_ALPHA 0x9026 /* "This is an interim value that we will use until the committee comes up with a final number."; see also 41 */
+EM_CYGNUS_V850 0x9080 /* Bogus old v850 magic number, used by old tools, removed in v4.6-rc1~95^2~36 */
+EM_CYGNUS_M32R 0x9041 /* Bogus old m32r magic number, used by old tools. */
+EM_S390_OLD 0xa390 /* This is the old interim value for S/390 architecture */
+EM_XTENSA_OLD 0xabc7 /* arch/xtensa/include/asm/elf.h */
+EM_MICROBLAZE_OLD 0xbaab /* arch/microblaze/include/uapi/asm/elf.h */
+EM_CYGNUS_MN10300 0xbeef /* Also Panasonic/MEI MN10300, AM33 */
diff --git a/src/xlat/epollctls.in b/src/xlat/epollctls.in
new file mode 100644
index 000000000..2955c3a0d
--- /dev/null
+++ b/src/xlat/epollctls.in
@@ -0,0 +1,4 @@
+#value_indexed
+EPOLL_CTL_ADD 1
+EPOLL_CTL_DEL 2
+EPOLL_CTL_MOD 3
diff --git a/src/xlat/epollevents.in b/src/xlat/epollevents.in
new file mode 100644
index 000000000..2dced0049
--- /dev/null
+++ b/src/xlat/epollevents.in
@@ -0,0 +1,16 @@
+EPOLLIN 0x00000001
+EPOLLPRI 0x00000002
+EPOLLOUT 0x00000004
+EPOLLERR 0x00000008
+EPOLLHUP 0x00000010
+EPOLLNVAL 0x00000020
+EPOLLRDNORM 0x00000040
+EPOLLRDBAND 0x00000080
+EPOLLWRNORM 0x00000100
+EPOLLWRBAND 0x00000200
+EPOLLMSG 0x00000400
+EPOLLRDHUP 0x00002000
+EPOLLEXCLUSIVE 0x10000000
+EPOLLWAKEUP 0x20000000
+EPOLLONESHOT 0x40000000
+EPOLLET 0x80000000
diff --git a/src/xlat/epollflags.in b/src/xlat/epollflags.in
new file mode 100644
index 000000000..e7ebaafd4
--- /dev/null
+++ b/src/xlat/epollflags.in
@@ -0,0 +1,3 @@
+#if defined EPOLL_CLOEXEC || defined O_CLOEXEC
+EPOLL_CLOEXEC O_CLOEXEC
+#endif
diff --git a/src/xlat/ethernet_protocols.in b/src/xlat/ethernet_protocols.in
new file mode 100644
index 000000000..6277b4f6a
--- /dev/null
+++ b/src/xlat/ethernet_protocols.in
@@ -0,0 +1,95 @@
+#sorted sort -k2,2
+ETH_P_802_3 0x0001 /* Dummy type for 802.3 frames */
+ETH_P_AX25 0x0002 /* Dummy protocol id for AX.25 */
+ETH_P_ALL 0x0003 /* Every packet (be careful!!!) */
+ETH_P_802_2 0x0004 /* 802.2 frames */
+ETH_P_SNAP 0x0005 /* Internal only */
+ETH_P_DDCMP 0x0006 /* DEC DDCMP: Internal only */
+ETH_P_WAN_PPP 0x0007 /* Dummy type for WAN PPP frames*/
+ETH_P_PPP_MP 0x0008 /* Dummy type for PPP MP frames */
+ETH_P_LOCALTALK 0x0009 /* Localtalk pseudo type */
+ETH_P_CAN 0x000C /* CAN: Controller Area Network */
+ETH_P_CANFD 0x000D /* CANFD: CAN flexible data rate*/
+ETH_P_PPPTALK 0x0010 /* Dummy type for Atalk over PPP*/
+ETH_P_TR_802_2 0x0011 /* 802.2 frames */
+ETH_P_MOBITEX 0x0015 /* Mobitex (kaz@cafe.net) */
+ETH_P_CONTROL 0x0016 /* Card specific control frames */
+ETH_P_IRDA 0x0017 /* Linux-IrDA */
+ETH_P_ECONET 0x0018 /* Acorn Econet */
+ETH_P_HDLC 0x0019 /* HDLC frames */
+ETH_P_ARCNET 0x001A /* 1A for ArcNet :-) */
+ETH_P_DSA 0x001B /* Distributed Switch Arch. */
+ETH_P_TRAILER 0x001C /* Trailer switch tagging */
+ETH_P_LOOP 0x0060 /* Ethernet Loopback packet */
+ETH_P_PHONET 0x00F5 /* Nokia Phonet frames */
+ETH_P_IEEE802154 0x00F6 /* IEEE802.15.4 frame */
+ETH_P_CAIF 0x00F7 /* ST-Ericsson CAIF protocol */
+ETH_P_XDSA 0x00F8 /* Multiplexed DSA protocol */
+ETH_P_MAP 0x00F9 /* Qualcomm multiplexing and aggregation protocol */
+ETH_P_PUP 0x0200 /* Xerox PUP packet */
+ETH_P_PUPAT 0x0201 /* Xerox PUP Addr Trans packet */
+ETH_P_802_3_MIN 0x0600 /* If the value in the ethernet type is less than this value then the frame is Ethernet II. Else it is 802.3 */
+ETH_P_IP 0x0800 /* Internet Protocol packet */
+ETH_P_X25 0x0805 /* CCITT X.25 */
+ETH_P_ARP 0x0806 /* Address Resolution packet */
+ETH_P_BPQ 0x08FF /* G8BPQ AX.25 Ethernet Packet [ NOT AN OFFICIALLY REGISTERED ID ] */
+ETH_P_IEEEPUP 0x0a00 /* Xerox IEEE802.3 PUP packet */
+ETH_P_IEEEPUPAT 0x0a01 /* Xerox IEEE802.3 PUP Addr Trans packet */
+ETH_P_ERSPAN2 0x22EB /* ERSPAN version 2 (type III) */
+ETH_P_TSN 0x22F0 /* TSN (IEEE 1722) packet */
+ETH_P_BATMAN 0x4305 /* B.A.T.M.A.N.-Advanced packet [ NOT AN OFFICIALLY REGISTERED ID ] */
+ETH_P_DEC 0x6000 /* DEC Assigned proto */
+ETH_P_DNA_DL 0x6001 /* DEC DNA Dump/Load */
+ETH_P_DNA_RC 0x6002 /* DEC DNA Remote Console */
+ETH_P_DNA_RT 0x6003 /* DEC DNA Routing */
+ETH_P_LAT 0x6004 /* DEC LAT */
+ETH_P_DIAG 0x6005 /* DEC Diagnostics */
+ETH_P_CUST 0x6006 /* DEC Customer use */
+ETH_P_SCA 0x6007 /* DEC Systems Comms Arch */
+ETH_P_TEB 0x6558 /* Trans Ether Bridging */
+ETH_P_RARP 0x8035 /* Reverse Addr Res packet */
+ETH_P_ATALK 0x809B /* Appletalk DDP */
+ETH_P_AARP 0x80F3 /* Appletalk AARP */
+ETH_P_8021Q 0x8100 /* 802.1Q VLAN Extended Header */
+ETH_P_IPX 0x8137 /* IPX over DIX */
+ETH_P_IPV6 0x86DD /* IPv6 over bluebook */
+ETH_P_PAUSE 0x8808 /* IEEE Pause frames. See 802.3 31B */
+ETH_P_SLOW 0x8809 /* Slow Protocol. See 802.3ad 43B */
+ETH_P_WCCP 0x883E /* Web-cache coordination protocol */
+ETH_P_MPLS_UC 0x8847 /* MPLS Unicast traffic */
+ETH_P_MPLS_MC 0x8848 /* MPLS Multicast traffic */
+ETH_P_ATMMPOA 0x884c /* MultiProtocol Over ATM */
+ETH_P_PPP_DISC 0x8863 /* PPPoE discovery messages */
+ETH_P_PPP_SES 0x8864 /* PPPoE session messages */
+ETH_P_LINK_CTL 0x886c /* HPNA, wlan link local tunnel */
+ETH_P_ATMFATE 0x8884 /* Frame-based ATM Transport over Ethernet */
+ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */
+ETH_P_AOE 0x88A2 /* ATA over Ethernet */
+ETH_P_8021AD 0x88A8 /* 802.1ad Service VLAN */
+ETH_P_802_EX1 0x88B5 /* 802.1 Local Experimental 1. */
+ETH_P_ERSPAN 0x88BE /* ERSPAN type II */
+ETH_P_PREAUTH 0x88C7 /* 802.11 Preauthentication */
+ETH_P_TIPC 0x88CA /* TIPC */
+ETH_P_LLDP 0x88CC /* Link Layer Discovery Protocol */
+ETH_P_MRP 0x88E3 /* Media Redundancy Protocol */
+ETH_P_MACSEC 0x88E5 /* 802.1ae MACsec */
+ETH_P_8021AH 0x88E7 /* 802.1ah Backbone Service Tag */
+ETH_P_MVRP 0x88F5 /* 802.1Q MVRP */
+ETH_P_1588 0x88F7 /* IEEE 1588 Timesync */
+ETH_P_NCSI 0x88F8 /* NCSI protocol */
+ETH_P_PRP 0x88FB /* IEC 62439-3 PRP/HSRv0 */
+ETH_P_FCOE 0x8906 /* Fibre Channel over Ethernet */
+ETH_P_TDLS 0x890D /* TDLS */
+ETH_P_FIP 0x8914 /* FCoE Initialization Protocol */
+ETH_P_IBOE 0x8915 /* Infiniband over Ethernet */
+ETH_P_80221 0x8917 /* IEEE 802.21 Media Independent Handover Protocol */
+ETH_P_HSR 0x892F /* IEC 62439-3 HSRv1 */
+ETH_P_NSH 0x894F /* Network Service Header */
+ETH_P_LOOPBACK 0x9000 /* Ethernet loopback packet, per IEEE 802.3 */
+ETH_P_QINQ1 0x9100 /* deprecated QinQ VLAN [ NOT AN OFFICIALLY REGISTERED ID ] */
+ETH_P_QINQ2 0x9200 /* deprecated QinQ VLAN [ NOT AN OFFICIALLY REGISTERED ID ] */
+ETH_P_QINQ3 0x9300 /* deprecated QinQ VLAN [ NOT AN OFFICIALLY REGISTERED ID ] */
+ETH_P_EDSA 0xDADA /* Ethertype DSA [ NOT AN OFFICIALLY REGISTERED ID ] */
+ETH_P_DSA_8021Q 0xDADB /* Fake VLAN Header for DSA [ NOT AN OFFICIALLY REGISTERED ID ] */
+ETH_P_IFE 0xED3E /* ForCES inter-FE LFB type */
+ETH_P_AF_IUCV 0xFBFB /* IBM af_iucv [ NOT AN OFFICIALLY REGISTERED ID ] */
diff --git a/src/xlat/evdev_abs.in b/src/xlat/evdev_abs.in
new file mode 100644
index 000000000..e2d69000e
--- /dev/null
+++ b/src/xlat/evdev_abs.in
@@ -0,0 +1,43 @@
+#value_indexed
+ABS_X 0x00
+ABS_Y 0x01
+ABS_Z 0x02
+ABS_RX 0x03
+ABS_RY 0x04
+ABS_RZ 0x05
+ABS_THROTTLE 0x06
+ABS_RUDDER 0x07
+ABS_WHEEL 0x08
+ABS_GAS 0x09
+ABS_BRAKE 0x0a
+ABS_HAT0X 0x10
+ABS_HAT0Y 0x11
+ABS_HAT1X 0x12
+ABS_HAT1Y 0x13
+ABS_HAT2X 0x14
+ABS_HAT2Y 0x15
+ABS_HAT3X 0x16
+ABS_HAT3Y 0x17
+ABS_PRESSURE 0x18
+ABS_DISTANCE 0x19
+ABS_TILT_X 0x1a
+ABS_TILT_Y 0x1b
+ABS_TOOL_WIDTH 0x1c
+ABS_VOLUME 0x20
+ABS_MISC 0x28
+ABS_RESERVED 0x2e
+ABS_MT_SLOT 0x2f
+ABS_MT_TOUCH_MAJOR 0x30
+ABS_MT_TOUCH_MINOR 0x31
+ABS_MT_WIDTH_MAJOR 0x32
+ABS_MT_WIDTH_MINOR 0x33
+ABS_MT_ORIENTATION 0x34
+ABS_MT_POSITION_X 0x35
+ABS_MT_POSITION_Y 0x36
+ABS_MT_TOOL_TYPE 0x37
+ABS_MT_BLOB_ID 0x38
+ABS_MT_TRACKING_ID 0x39
+ABS_MT_PRESSURE 0x3a
+ABS_MT_DISTANCE 0x3b
+ABS_MT_TOOL_X 0x3c
+ABS_MT_TOOL_Y 0x3d
diff --git a/src/xlat/evdev_autorepeat.in b/src/xlat/evdev_autorepeat.in
new file mode 100644
index 000000000..7ab7e2e75
--- /dev/null
+++ b/src/xlat/evdev_autorepeat.in
@@ -0,0 +1,3 @@
+#value_indexed
+REP_DELAY 0x00
+REP_PERIOD 0x01
diff --git a/src/xlat/evdev_ev.in b/src/xlat/evdev_ev.in
new file mode 100644
index 000000000..4d81952b3
--- /dev/null
+++ b/src/xlat/evdev_ev.in
@@ -0,0 +1,12 @@
+EV_SYN 0x00
+EV_KEY 0x01
+EV_REL 0x02
+EV_ABS 0x03
+EV_MSC 0x04
+EV_SW 0x05
+EV_LED 0x11
+EV_SND 0x12
+EV_REP 0x14
+EV_FF 0x15
+EV_PWR 0x16
+EV_FF_STATUS 0x17
diff --git a/src/xlat/evdev_ff_status.in b/src/xlat/evdev_ff_status.in
new file mode 100644
index 000000000..1f2815f76
--- /dev/null
+++ b/src/xlat/evdev_ff_status.in
@@ -0,0 +1,3 @@
+#value_indexed
+FF_STATUS_STOPPED 0x00
+FF_STATUS_PLAYING 0x01
diff --git a/src/xlat/evdev_ff_types.in b/src/xlat/evdev_ff_types.in
new file mode 100644
index 000000000..71dc53822
--- /dev/null
+++ b/src/xlat/evdev_ff_types.in
@@ -0,0 +1,17 @@
+#sorted sort -k2,2
+FF_RUMBLE 0x50
+FF_PERIODIC 0x51
+FF_CONSTANT 0x52
+FF_SPRING 0x53
+FF_FRICTION 0x54
+FF_DAMPER 0x55
+FF_INERTIA 0x56
+FF_RAMP 0x57
+FF_SQUARE 0x58
+FF_TRIANGLE 0x59
+FF_SINE 0x5a
+FF_SAW_UP 0x5b
+FF_SAW_DOWN 0x5c
+FF_CUSTOM 0x5d
+FF_GAIN 0x60
+FF_AUTOCENTER 0x61
diff --git a/src/xlat/evdev_ioctl_cmds.in b/src/xlat/evdev_ioctl_cmds.in
new file mode 100644
index 000000000..29a5864e7
--- /dev/null
+++ b/src/xlat/evdev_ioctl_cmds.in
@@ -0,0 +1,17 @@
+EVIOCGVERSION _IOR('E', 0x01, int)
+EVIOCGID _IOR('E', 0x02, struct input_id)
+EVIOCGREP _IOR('E', 0x03, unsigned int[2])
+EVIOCSREP _IOW('E', 0x03, unsigned int[2])
+EVIOCGKEYCODE _IOR('E', 0x04, unsigned int[2])
+EVIOCGKEYCODE_V2 _IOR('E', 0x04, struct_input_keymap_entry)
+EVIOCSKEYCODE _IOW('E', 0x04, unsigned int[2])
+EVIOCSKEYCODE_V2 _IOW('E', 0x04, struct_input_keymap_entry)
+/* struct ff_effect is personality-dependent in size */
+/* EVIOCSFF _IOW('E', 0x80, struct ff_effect) */
+EVIOCRMFF _IOW('E', 0x81, int)
+EVIOCGEFFECTS _IOR('E', 0x84, int)
+EVIOCGRAB _IOW('E', 0x90, int)
+EVIOCREVOKE _IOW('E', 0x91, int)
+EVIOCGMASK _IOR('E', 0x92, struct_input_mask)
+EVIOCSMASK _IOW('E', 0x93, struct_input_mask)
+EVIOCSCLOCKID _IOW('E', 0xa0, int)
diff --git a/src/xlat/evdev_keycode.in b/src/xlat/evdev_keycode.in
new file mode 100644
index 000000000..f9669d9ed
--- /dev/null
+++ b/src/xlat/evdev_keycode.in
@@ -0,0 +1,678 @@
+#value_indexed
+/* awk '{if (NF>1) {n=strtonum($2)}; printf("%d %s\n", n, $0)}' |sort -s -k1,1n |sed 's/^[0-9]* //' */
+KEY_RESERVED 0
+KEY_ESC 1
+KEY_1 2
+KEY_2 3
+KEY_3 4
+KEY_4 5
+KEY_5 6
+KEY_6 7
+KEY_7 8
+KEY_8 9
+KEY_9 10
+KEY_0 11
+KEY_MINUS 12
+KEY_EQUAL 13
+KEY_BACKSPACE 14
+KEY_TAB 15
+KEY_Q 16
+KEY_W 17
+KEY_E 18
+KEY_R 19
+KEY_T 20
+KEY_Y 21
+KEY_U 22
+KEY_I 23
+KEY_O 24
+KEY_P 25
+KEY_LEFTBRACE 26
+KEY_RIGHTBRACE 27
+KEY_ENTER 28
+KEY_LEFTCTRL 29
+KEY_A 30
+KEY_S 31
+KEY_D 32
+KEY_F 33
+KEY_G 34
+KEY_H 35
+KEY_J 36
+KEY_K 37
+KEY_L 38
+KEY_SEMICOLON 39
+KEY_APOSTROPHE 40
+KEY_GRAVE 41
+KEY_LEFTSHIFT 42
+KEY_BACKSLASH 43
+KEY_Z 44
+KEY_X 45
+KEY_C 46
+KEY_V 47
+KEY_B 48
+KEY_N 49
+KEY_M 50
+KEY_COMMA 51
+KEY_DOT 52
+KEY_SLASH 53
+KEY_RIGHTSHIFT 54
+KEY_KPASTERISK 55
+KEY_LEFTALT 56
+KEY_SPACE 57
+KEY_CAPSLOCK 58
+KEY_F1 59
+KEY_F2 60
+KEY_F3 61
+KEY_F4 62
+KEY_F5 63
+KEY_F6 64
+KEY_F7 65
+KEY_F8 66
+KEY_F9 67
+KEY_F10 68
+KEY_NUMLOCK 69
+KEY_SCROLLLOCK 70
+KEY_KP7 71
+KEY_KP8 72
+KEY_KP9 73
+KEY_KPMINUS 74
+KEY_KP4 75
+KEY_KP5 76
+KEY_KP6 77
+KEY_KPPLUS 78
+KEY_KP1 79
+KEY_KP2 80
+KEY_KP3 81
+KEY_KP0 82
+KEY_KPDOT 83
+
+KEY_ZENKAKUHANKAKU 85
+KEY_102ND 86
+KEY_F11 87
+KEY_F12 88
+KEY_RO 89
+KEY_KATAKANA 90
+KEY_HIRAGANA 91
+KEY_HENKAN 92
+KEY_KATAKANAHIRAGANA 93
+KEY_MUHENKAN 94
+KEY_KPJPCOMMA 95
+KEY_KPENTER 96
+KEY_RIGHTCTRL 97
+KEY_KPSLASH 98
+KEY_SYSRQ 99
+KEY_RIGHTALT 100
+KEY_LINEFEED 101
+KEY_HOME 102
+KEY_UP 103
+KEY_PAGEUP 104
+KEY_LEFT 105
+KEY_RIGHT 106
+KEY_END 107
+KEY_DOWN 108
+KEY_PAGEDOWN 109
+KEY_INSERT 110
+KEY_DELETE 111
+KEY_MACRO 112
+KEY_MUTE 113
+KEY_VOLUMEDOWN 114
+KEY_VOLUMEUP 115
+KEY_POWER 116
+KEY_KPEQUAL 117
+KEY_KPPLUSMINUS 118
+KEY_PAUSE 119
+KEY_SCALE 120
+
+KEY_KPCOMMA 121
+KEY_HANGEUL 122
+KEY_HANJA 123
+KEY_YEN 124
+KEY_LEFTMETA 125
+KEY_RIGHTMETA 126
+KEY_COMPOSE 127
+
+KEY_STOP 128
+KEY_AGAIN 129
+KEY_PROPS 130
+KEY_UNDO 131
+KEY_FRONT 132
+KEY_COPY 133
+KEY_OPEN 134
+KEY_PASTE 135
+KEY_FIND 136
+KEY_CUT 137
+KEY_HELP 138
+KEY_MENU 139
+KEY_CALC 140
+KEY_SETUP 141
+KEY_SLEEP 142
+KEY_WAKEUP 143
+KEY_FILE 144
+KEY_SENDFILE 145
+KEY_DELETEFILE 146
+KEY_XFER 147
+KEY_PROG1 148
+KEY_PROG2 149
+KEY_WWW 150
+KEY_MSDOS 151
+KEY_COFFEE 152
+KEY_ROTATE_DISPLAY 153
+KEY_CYCLEWINDOWS 154
+KEY_MAIL 155
+KEY_BOOKMARKS 156
+KEY_COMPUTER 157
+KEY_BACK 158
+KEY_FORWARD 159
+KEY_CLOSECD 160
+KEY_EJECTCD 161
+KEY_EJECTCLOSECD 162
+KEY_NEXTSONG 163
+KEY_PLAYPAUSE 164
+KEY_PREVIOUSSONG 165
+KEY_STOPCD 166
+KEY_RECORD 167
+KEY_REWIND 168
+KEY_PHONE 169
+KEY_ISO 170
+KEY_CONFIG 171
+KEY_HOMEPAGE 172
+KEY_REFRESH 173
+KEY_EXIT 174
+KEY_MOVE 175
+KEY_EDIT 176
+KEY_SCROLLUP 177
+KEY_SCROLLDOWN 178
+KEY_KPLEFTPAREN 179
+KEY_KPRIGHTPAREN 180
+KEY_NEW 181
+KEY_REDO 182
+
+KEY_F13 183
+KEY_F14 184
+KEY_F15 185
+KEY_F16 186
+KEY_F17 187
+KEY_F18 188
+KEY_F19 189
+KEY_F20 190
+KEY_F21 191
+KEY_F22 192
+KEY_F23 193
+KEY_F24 194
+
+KEY_PLAYCD 200
+KEY_PAUSECD 201
+KEY_PROG3 202
+KEY_PROG4 203
+KEY_DASHBOARD 204
+KEY_SUSPEND 205
+KEY_CLOSE 206
+KEY_PLAY 207
+KEY_FASTFORWARD 208
+KEY_BASSBOOST 209
+KEY_PRINT 210
+KEY_HP 211
+KEY_CAMERA 212
+KEY_SOUND 213
+KEY_QUESTION 214
+KEY_EMAIL 215
+KEY_CHAT 216
+KEY_SEARCH 217
+KEY_CONNECT 218
+KEY_FINANCE 219
+KEY_SPORT 220
+KEY_SHOP 221
+KEY_ALTERASE 222
+KEY_CANCEL 223
+KEY_BRIGHTNESSDOWN 224
+KEY_BRIGHTNESSUP 225
+KEY_MEDIA 226
+
+KEY_SWITCHVIDEOMODE 227
+
+KEY_KBDILLUMTOGGLE 228
+KEY_KBDILLUMDOWN 229
+KEY_KBDILLUMUP 230
+
+KEY_SEND 231
+KEY_REPLY 232
+KEY_FORWARDMAIL 233
+KEY_SAVE 234
+KEY_DOCUMENTS 235
+
+KEY_BATTERY 236
+
+KEY_BLUETOOTH 237
+KEY_WLAN 238
+KEY_UWB 239
+
+KEY_UNKNOWN 240
+
+KEY_VIDEO_NEXT 241
+KEY_VIDEO_PREV 242
+KEY_BRIGHTNESS_CYCLE 243
+KEY_BRIGHTNESS_AUTO 244
+KEY_DISPLAY_OFF 245
+
+KEY_WWAN 246
+
+#ifndef STRACE_WORKAROUND_FOR_KEY_RFKILL
+# define STRACE_WORKAROUND_FOR_KEY_RFKILL
+/*
+ * KEY_RFKILL and KEY_NUMERIC_A constants were introduced by Linux kernel
+ * commits v2.6.33~17^2~2 and v4.1-rc1~150^2~1^10~6, respectively.
+ * Apparently, RHEL6 introduced an alternative KEY_RFKILL constant
+ * with the same value as upstream KEY_NUMERIC_A.
+ * Downstream vendors are *not* allowed to do this.
+ * Ignore the system value of KEY_RFKILL.
+ */
+# undef KEY_RFKILL
+#endif
+KEY_RFKILL 247
+
+KEY_MICMUTE 248
+
+BTN_0 0x100
+BTN_1 0x101
+BTN_2 0x102
+BTN_3 0x103
+BTN_4 0x104
+BTN_5 0x105
+BTN_6 0x106
+BTN_7 0x107
+BTN_8 0x108
+BTN_9 0x109
+
+BTN_LEFT 0x110
+BTN_RIGHT 0x111
+BTN_MIDDLE 0x112
+BTN_SIDE 0x113
+BTN_EXTRA 0x114
+BTN_FORWARD 0x115
+BTN_BACK 0x116
+BTN_TASK 0x117
+
+BTN_TRIGGER 0x120
+BTN_THUMB 0x121
+BTN_THUMB2 0x122
+BTN_TOP 0x123
+BTN_TOP2 0x124
+BTN_PINKIE 0x125
+BTN_BASE 0x126
+BTN_BASE2 0x127
+BTN_BASE3 0x128
+BTN_BASE4 0x129
+BTN_BASE5 0x12a
+BTN_BASE6 0x12b
+BTN_DEAD 0x12f
+
+BTN_SOUTH 0x130
+BTN_EAST 0x131
+BTN_C 0x132
+BTN_NORTH 0x133
+BTN_WEST 0x134
+BTN_Z 0x135
+BTN_TL 0x136
+BTN_TR 0x137
+BTN_TL2 0x138
+BTN_TR2 0x139
+BTN_SELECT 0x13a
+BTN_START 0x13b
+BTN_MODE 0x13c
+BTN_THUMBL 0x13d
+BTN_THUMBR 0x13e
+
+BTN_TOOL_PEN 0x140
+BTN_TOOL_RUBBER 0x141
+BTN_TOOL_BRUSH 0x142
+BTN_TOOL_PENCIL 0x143
+BTN_TOOL_AIRBRUSH 0x144
+BTN_TOOL_FINGER 0x145
+BTN_TOOL_MOUSE 0x146
+BTN_TOOL_LENS 0x147
+BTN_TOOL_QUINTTAP 0x148
+BTN_STYLUS3 0x149
+BTN_TOUCH 0x14a
+BTN_STYLUS 0x14b
+BTN_STYLUS2 0x14c
+BTN_TOOL_DOUBLETAP 0x14d
+BTN_TOOL_TRIPLETAP 0x14e
+BTN_TOOL_QUADTAP 0x14f
+
+BTN_GEAR_DOWN 0x150
+BTN_GEAR_UP 0x151
+
+KEY_OK 0x160
+KEY_SELECT 0x161
+KEY_GOTO 0x162
+KEY_CLEAR 0x163
+KEY_POWER2 0x164
+KEY_OPTION 0x165
+KEY_INFO 0x166
+KEY_TIME 0x167
+KEY_VENDOR 0x168
+KEY_ARCHIVE 0x169
+KEY_PROGRAM 0x16a
+KEY_CHANNEL 0x16b
+KEY_FAVORITES 0x16c
+KEY_EPG 0x16d
+KEY_PVR 0x16e
+KEY_MHP 0x16f
+KEY_LANGUAGE 0x170
+KEY_TITLE 0x171
+KEY_SUBTITLE 0x172
+KEY_ANGLE 0x173
+KEY_ZOOM 0x174
+KEY_MODE 0x175
+KEY_KEYBOARD 0x176
+KEY_SCREEN 0x177
+KEY_PC 0x178
+KEY_TV 0x179
+KEY_TV2 0x17a
+KEY_VCR 0x17b
+KEY_VCR2 0x17c
+KEY_SAT 0x17d
+KEY_SAT2 0x17e
+KEY_CD 0x17f
+KEY_TAPE 0x180
+KEY_RADIO 0x181
+KEY_TUNER 0x182
+KEY_PLAYER 0x183
+KEY_TEXT 0x184
+KEY_DVD 0x185
+KEY_AUX 0x186
+KEY_MP3 0x187
+KEY_AUDIO 0x188
+KEY_VIDEO 0x189
+KEY_DIRECTORY 0x18a
+KEY_LIST 0x18b
+KEY_MEMO 0x18c
+KEY_CALENDAR 0x18d
+KEY_RED 0x18e
+KEY_GREEN 0x18f
+KEY_YELLOW 0x190
+KEY_BLUE 0x191
+KEY_CHANNELUP 0x192
+KEY_CHANNELDOWN 0x193
+KEY_FIRST 0x194
+KEY_LAST 0x195
+KEY_AB 0x196
+KEY_NEXT 0x197
+KEY_RESTART 0x198
+KEY_SLOW 0x199
+KEY_SHUFFLE 0x19a
+KEY_BREAK 0x19b
+KEY_PREVIOUS 0x19c
+KEY_DIGITS 0x19d
+KEY_TEEN 0x19e
+KEY_TWEN 0x19f
+KEY_VIDEOPHONE 0x1a0
+KEY_GAMES 0x1a1
+KEY_ZOOMIN 0x1a2
+KEY_ZOOMOUT 0x1a3
+KEY_ZOOMRESET 0x1a4
+KEY_WORDPROCESSOR 0x1a5
+KEY_EDITOR 0x1a6
+KEY_SPREADSHEET 0x1a7
+KEY_GRAPHICSEDITOR 0x1a8
+KEY_PRESENTATION 0x1a9
+KEY_DATABASE 0x1aa
+KEY_NEWS 0x1ab
+KEY_VOICEMAIL 0x1ac
+KEY_ADDRESSBOOK 0x1ad
+KEY_MESSENGER 0x1ae
+KEY_DISPLAYTOGGLE 0x1af
+KEY_SPELLCHECK 0x1b0
+KEY_LOGOFF 0x1b1
+
+KEY_DOLLAR 0x1b2
+KEY_EURO 0x1b3
+
+KEY_FRAMEBACK 0x1b4
+KEY_FRAMEFORWARD 0x1b5
+KEY_CONTEXT_MENU 0x1b6
+KEY_MEDIA_REPEAT 0x1b7
+KEY_10CHANNELSUP 0x1b8
+KEY_10CHANNELSDOWN 0x1b9
+KEY_IMAGES 0x1ba
+KEY_NOTIFICATION_CENTER 0x1bc
+KEY_PICKUP_PHONE 0x1bd
+KEY_HANGUP_PHONE 0x1be
+
+KEY_DEL_EOL 0x1c0
+KEY_DEL_EOS 0x1c1
+KEY_INS_LINE 0x1c2
+KEY_DEL_LINE 0x1c3
+
+KEY_FN 0x1d0
+KEY_FN_ESC 0x1d1
+KEY_FN_F1 0x1d2
+KEY_FN_F2 0x1d3
+KEY_FN_F3 0x1d4
+KEY_FN_F4 0x1d5
+KEY_FN_F5 0x1d6
+KEY_FN_F6 0x1d7
+KEY_FN_F7 0x1d8
+KEY_FN_F8 0x1d9
+KEY_FN_F9 0x1da
+KEY_FN_F10 0x1db
+KEY_FN_F11 0x1dc
+KEY_FN_F12 0x1dd
+KEY_FN_1 0x1de
+KEY_FN_2 0x1df
+KEY_FN_D 0x1e0
+KEY_FN_E 0x1e1
+KEY_FN_F 0x1e2
+KEY_FN_S 0x1e3
+KEY_FN_B 0x1e4
+KEY_FN_RIGHT_SHIFT 0x1e5
+
+KEY_BRL_DOT1 0x1f1
+KEY_BRL_DOT2 0x1f2
+KEY_BRL_DOT3 0x1f3
+KEY_BRL_DOT4 0x1f4
+KEY_BRL_DOT5 0x1f5
+KEY_BRL_DOT6 0x1f6
+KEY_BRL_DOT7 0x1f7
+KEY_BRL_DOT8 0x1f8
+KEY_BRL_DOT9 0x1f9
+KEY_BRL_DOT10 0x1fa
+
+KEY_NUMERIC_0 0x200
+KEY_NUMERIC_1 0x201
+KEY_NUMERIC_2 0x202
+KEY_NUMERIC_3 0x203
+KEY_NUMERIC_4 0x204
+KEY_NUMERIC_5 0x205
+KEY_NUMERIC_6 0x206
+KEY_NUMERIC_7 0x207
+KEY_NUMERIC_8 0x208
+KEY_NUMERIC_9 0x209
+KEY_NUMERIC_STAR 0x20a
+KEY_NUMERIC_POUND 0x20b
+KEY_NUMERIC_A 0x20c
+KEY_NUMERIC_B 0x20d
+KEY_NUMERIC_C 0x20e
+KEY_NUMERIC_D 0x20f
+
+KEY_CAMERA_FOCUS 0x210
+KEY_WPS_BUTTON 0x211
+
+KEY_TOUCHPAD_TOGGLE 0x212
+KEY_TOUCHPAD_ON 0x213
+KEY_TOUCHPAD_OFF 0x214
+
+KEY_CAMERA_ZOOMIN 0x215
+KEY_CAMERA_ZOOMOUT 0x216
+KEY_CAMERA_UP 0x217
+KEY_CAMERA_DOWN 0x218
+KEY_CAMERA_LEFT 0x219
+KEY_CAMERA_RIGHT 0x21a
+
+KEY_ATTENDANT_ON 0x21b
+KEY_ATTENDANT_OFF 0x21c
+KEY_ATTENDANT_TOGGLE 0x21d
+KEY_LIGHTS_TOGGLE 0x21e
+
+BTN_DPAD_UP 0x220
+BTN_DPAD_DOWN 0x221
+BTN_DPAD_LEFT 0x222
+BTN_DPAD_RIGHT 0x223
+
+KEY_ALS_TOGGLE 0x230
+KEY_ROTATE_LOCK_TOGGLE 0x231
+
+KEY_BUTTONCONFIG 0x240
+KEY_TASKMANAGER 0x241
+KEY_JOURNAL 0x242
+KEY_CONTROLPANEL 0x243
+KEY_APPSELECT 0x244
+KEY_SCREENSAVER 0x245
+KEY_VOICECOMMAND 0x246
+KEY_ASSISTANT 0x247
+KEY_KBD_LAYOUT_NEXT 0x248
+
+#ifndef STRACE_WORKAROUND_FOR_KEY_BRIGHTNESS_MIN
+# define STRACE_WORKAROUND_FOR_KEY_BRIGHTNESS_MIN
+/*
+ * KEY_BRIGHTNESS_MIN and KEY_BRIGHTNESS_MAX constants were introduced
+ * by Linux kernel commit v3.16-rc1~30^2~6^2~1^2~7.
+ * Apparently, RHEL7 introduced an alternative KEY_BRIGHTNESS_MIN constant
+ * with the same value as upstream KEY_BRIGHTNESS_MAX.
+ * Downstream vendors are *not* allowed to do this.
+ * Ignore the system value of KEY_BRIGHTNESS_MIN.
+ */
+# undef KEY_BRIGHTNESS_MIN
+#endif
+KEY_BRIGHTNESS_MIN 0x250
+
+KEY_BRIGHTNESS_MAX 0x251
+
+KEY_KBDINPUTASSIST_PREV 0x260
+KEY_KBDINPUTASSIST_NEXT 0x261
+KEY_KBDINPUTASSIST_PREVGROUP 0x262
+KEY_KBDINPUTASSIST_NEXTGROUP 0x263
+KEY_KBDINPUTASSIST_ACCEPT 0x264
+KEY_KBDINPUTASSIST_CANCEL 0x265
+
+KEY_RIGHT_UP 0x266
+KEY_RIGHT_DOWN 0x267
+KEY_LEFT_UP 0x268
+KEY_LEFT_DOWN 0x269
+
+KEY_ROOT_MENU 0x26a
+KEY_MEDIA_TOP_MENU 0x26b
+KEY_NUMERIC_11 0x26c
+KEY_NUMERIC_12 0x26d
+
+KEY_AUDIO_DESC 0x26e
+KEY_3D_MODE 0x26f
+KEY_NEXT_FAVORITE 0x270
+KEY_STOP_RECORD 0x271
+KEY_PAUSE_RECORD 0x272
+KEY_VOD 0x273
+KEY_UNMUTE 0x274
+KEY_FASTREVERSE 0x275
+KEY_SLOWREVERSE 0x276
+
+#ifndef STRACE_WORKAROUND_FOR_KEY_DATA
+# define STRACE_WORKAROUND_FOR_KEY_DATA
+/*
+ * Linux kernel commit v4.9-rc8~12^2 has changed the value of KEY_DATA
+ * constant introduced by commit v4.7-rc6~32^2~6^2 because the old value
+ * was already used by KEY_FASTREVERSE.
+ * Looks like the best way to handle this situation is to pretend that
+ * the old value of KEY_DATA didn't exist.
+ */
+# undef KEY_DATA
+#endif
+KEY_DATA 0x277
+
+KEY_ONSCREEN_KEYBOARD 0x278
+KEY_PRIVACY_SCREEN_TOGGLE 0x279
+
+KEY_SELECTIVE_SCREENSHOT 0x27a
+
+KEY_MACRO1 0x290
+KEY_MACRO2 0x291
+KEY_MACRO3 0x292
+KEY_MACRO4 0x293
+KEY_MACRO5 0x294
+KEY_MACRO6 0x295
+KEY_MACRO7 0x296
+KEY_MACRO8 0x297
+KEY_MACRO9 0x298
+KEY_MACRO10 0x299
+KEY_MACRO11 0x29a
+KEY_MACRO12 0x29b
+KEY_MACRO13 0x29c
+KEY_MACRO14 0x29d
+KEY_MACRO15 0x29e
+KEY_MACRO16 0x29f
+KEY_MACRO17 0x2a0
+KEY_MACRO18 0x2a1
+KEY_MACRO19 0x2a2
+KEY_MACRO20 0x2a3
+KEY_MACRO21 0x2a4
+KEY_MACRO22 0x2a5
+KEY_MACRO23 0x2a6
+KEY_MACRO24 0x2a7
+KEY_MACRO25 0x2a8
+KEY_MACRO26 0x2a9
+KEY_MACRO27 0x2aa
+KEY_MACRO28 0x2ab
+KEY_MACRO29 0x2ac
+KEY_MACRO30 0x2ad
+
+KEY_MACRO_RECORD_START 0x2b0
+KEY_MACRO_RECORD_STOP 0x2b1
+KEY_MACRO_PRESET_CYCLE 0x2b2
+KEY_MACRO_PRESET1 0x2b3
+KEY_MACRO_PRESET2 0x2b4
+KEY_MACRO_PRESET3 0x2b5
+
+KEY_KBD_LCD_MENU1 0x2b8
+KEY_KBD_LCD_MENU2 0x2b9
+KEY_KBD_LCD_MENU3 0x2ba
+KEY_KBD_LCD_MENU4 0x2bb
+KEY_KBD_LCD_MENU5 0x2bc
+
+BTN_TRIGGER_HAPPY1 0x2c0
+BTN_TRIGGER_HAPPY2 0x2c1
+BTN_TRIGGER_HAPPY3 0x2c2
+BTN_TRIGGER_HAPPY4 0x2c3
+BTN_TRIGGER_HAPPY5 0x2c4
+BTN_TRIGGER_HAPPY6 0x2c5
+BTN_TRIGGER_HAPPY7 0x2c6
+BTN_TRIGGER_HAPPY8 0x2c7
+BTN_TRIGGER_HAPPY9 0x2c8
+BTN_TRIGGER_HAPPY10 0x2c9
+BTN_TRIGGER_HAPPY11 0x2ca
+BTN_TRIGGER_HAPPY12 0x2cb
+BTN_TRIGGER_HAPPY13 0x2cc
+BTN_TRIGGER_HAPPY14 0x2cd
+BTN_TRIGGER_HAPPY15 0x2ce
+BTN_TRIGGER_HAPPY16 0x2cf
+BTN_TRIGGER_HAPPY17 0x2d0
+BTN_TRIGGER_HAPPY18 0x2d1
+BTN_TRIGGER_HAPPY19 0x2d2
+BTN_TRIGGER_HAPPY20 0x2d3
+BTN_TRIGGER_HAPPY21 0x2d4
+BTN_TRIGGER_HAPPY22 0x2d5
+BTN_TRIGGER_HAPPY23 0x2d6
+BTN_TRIGGER_HAPPY24 0x2d7
+BTN_TRIGGER_HAPPY25 0x2d8
+BTN_TRIGGER_HAPPY26 0x2d9
+BTN_TRIGGER_HAPPY27 0x2da
+BTN_TRIGGER_HAPPY28 0x2db
+BTN_TRIGGER_HAPPY29 0x2dc
+BTN_TRIGGER_HAPPY30 0x2dd
+BTN_TRIGGER_HAPPY31 0x2de
+BTN_TRIGGER_HAPPY32 0x2df
+BTN_TRIGGER_HAPPY33 0x2e0
+BTN_TRIGGER_HAPPY34 0x2e1
+BTN_TRIGGER_HAPPY35 0x2e2
+BTN_TRIGGER_HAPPY36 0x2e3
+BTN_TRIGGER_HAPPY37 0x2e4
+BTN_TRIGGER_HAPPY38 0x2e5
+BTN_TRIGGER_HAPPY39 0x2e6
+BTN_TRIGGER_HAPPY40 0x2e7
diff --git a/src/xlat/evdev_leds.in b/src/xlat/evdev_leds.in
new file mode 100644
index 000000000..6178bbd8a
--- /dev/null
+++ b/src/xlat/evdev_leds.in
@@ -0,0 +1,12 @@
+#value_indexed
+LED_NUML 0x00
+LED_CAPSL 0x01
+LED_SCROLLL 0x02
+LED_COMPOSE 0x03
+LED_KANA 0x04
+LED_SLEEP 0x05
+LED_SUSPEND 0x06
+LED_MUTE 0x07
+LED_MISC 0x08
+LED_MAIL 0x09
+LED_CHARGING 0x0a
diff --git a/src/xlat/evdev_misc.in b/src/xlat/evdev_misc.in
new file mode 100644
index 000000000..0528092ac
--- /dev/null
+++ b/src/xlat/evdev_misc.in
@@ -0,0 +1,7 @@
+#value_indexed
+MSC_SERIAL 0x00
+MSC_PULSELED 0x01
+MSC_GESTURE 0x02
+MSC_RAW 0x03
+MSC_SCAN 0x04
+MSC_TIMESTAMP 0x05
diff --git a/src/xlat/evdev_mtslots.in b/src/xlat/evdev_mtslots.in
new file mode 100644
index 000000000..f0e36b37d
--- /dev/null
+++ b/src/xlat/evdev_mtslots.in
@@ -0,0 +1,16 @@
+#sorted
+ABS_MT_SLOT 0x2f
+ABS_MT_TOUCH_MAJOR 0x30
+ABS_MT_TOUCH_MINOR 0x31
+ABS_MT_WIDTH_MAJOR 0x32
+ABS_MT_WIDTH_MINOR 0x33
+ABS_MT_ORIENTATION 0x34
+ABS_MT_POSITION_X 0x35
+ABS_MT_POSITION_Y 0x36
+ABS_MT_TOOL_TYPE 0x37
+ABS_MT_BLOB_ID 0x38
+ABS_MT_TRACKING_ID 0x39
+ABS_MT_PRESSURE 0x3a
+ABS_MT_DISTANCE 0x3b
+ABS_MT_TOOL_X 0x3c
+ABS_MT_TOOL_Y 0x3d
diff --git a/src/xlat/evdev_prop.in b/src/xlat/evdev_prop.in
new file mode 100644
index 000000000..5e7d025c2
--- /dev/null
+++ b/src/xlat/evdev_prop.in
@@ -0,0 +1,8 @@
+#value_indexed
+INPUT_PROP_POINTER 0
+INPUT_PROP_DIRECT 1
+INPUT_PROP_BUTTONPAD 2
+INPUT_PROP_SEMI_MT 3
+INPUT_PROP_TOPBUTTONPAD 4
+INPUT_PROP_POINTING_STICK 5
+INPUT_PROP_ACCELEROMETER 6
diff --git a/src/xlat/evdev_relative_axes.in b/src/xlat/evdev_relative_axes.in
new file mode 100644
index 000000000..657289f72
--- /dev/null
+++ b/src/xlat/evdev_relative_axes.in
@@ -0,0 +1,14 @@
+#value_indexed
+REL_X 0x00
+REL_Y 0x01
+REL_Z 0x02
+REL_RX 0x03
+REL_RY 0x04
+REL_RZ 0x05
+REL_HWHEEL 0x06
+REL_DIAL 0x07
+REL_WHEEL 0x08
+REL_MISC 0x09
+REL_RESERVED 0x0a
+REL_WHEEL_HI_RES 0x0b
+REL_HWHEEL_HI_RES 0x0c
diff --git a/src/xlat/evdev_snd.in b/src/xlat/evdev_snd.in
new file mode 100644
index 000000000..22e51cc15
--- /dev/null
+++ b/src/xlat/evdev_snd.in
@@ -0,0 +1,4 @@
+#value_indexed
+SND_CLICK 0x00
+SND_BELL 0x01
+SND_TONE 0x02
diff --git a/src/xlat/evdev_switch.in b/src/xlat/evdev_switch.in
new file mode 100644
index 000000000..8f8087252
--- /dev/null
+++ b/src/xlat/evdev_switch.in
@@ -0,0 +1,17 @@
+#value_indexed
+SW_LID 0x00
+SW_TABLET_MODE 0x01
+SW_HEADPHONE_INSERT 0x02
+SW_RFKILL_ALL 0x03
+SW_MICROPHONE_INSERT 0x04
+SW_DOCK 0x05
+SW_LINEOUT_INSERT 0x06
+SW_JACK_PHYSICAL_INSERT 0x07
+SW_VIDEOOUT_INSERT 0x08
+SW_CAMERA_LENS_COVER 0x09
+SW_KEYPAD_SLIDE 0x0a
+SW_FRONT_PROXIMITY 0x0b
+SW_ROTATE_LOCK 0x0c
+SW_LINEIN_INSERT 0x0d
+SW_MUTE_DEVICE 0x0e
+SW_PEN_INSERTED 0x0f
diff --git a/src/xlat/f_owner_types.in b/src/xlat/f_owner_types.in
new file mode 100644
index 000000000..d1c0d3970
--- /dev/null
+++ b/src/xlat/f_owner_types.in
@@ -0,0 +1,4 @@
+#value_indexed
+F_OWNER_TID 0
+F_OWNER_PID 1
+F_OWNER_PGRP 2
diff --git a/src/xlat/f_seals.in b/src/xlat/f_seals.in
new file mode 100644
index 000000000..3bdceeb4e
--- /dev/null
+++ b/src/xlat/f_seals.in
@@ -0,0 +1,5 @@
+F_SEAL_SEAL 1
+F_SEAL_SHRINK 2
+F_SEAL_GROW 4
+F_SEAL_WRITE 8
+F_SEAL_FUTURE_WRITE 16
diff --git a/src/xlat/faccessat_flags.in b/src/xlat/faccessat_flags.in
new file mode 100644
index 000000000..d20e8cbcb
--- /dev/null
+++ b/src/xlat/faccessat_flags.in
@@ -0,0 +1,3 @@
+AT_SYMLINK_NOFOLLOW 0x100
+AT_EACCESS 0x200
+AT_EMPTY_PATH 0x1000
diff --git a/src/xlat/falloc_flags.in b/src/xlat/falloc_flags.in
new file mode 100644
index 000000000..63c4bdbe2
--- /dev/null
+++ b/src/xlat/falloc_flags.in
@@ -0,0 +1,7 @@
+FALLOC_FL_KEEP_SIZE 0x01
+FALLOC_FL_PUNCH_HOLE 0x02
+FALLOC_FL_NO_HIDE_STALE 0x04
+FALLOC_FL_COLLAPSE_RANGE 0x08
+FALLOC_FL_ZERO_RANGE 0x10
+FALLOC_FL_INSERT_RANGE 0x20
+FALLOC_FL_UNSHARE_RANGE 0x40
diff --git a/src/xlat/fan_classes.in b/src/xlat/fan_classes.in
new file mode 100644
index 000000000..e7cd30787
--- /dev/null
+++ b/src/xlat/fan_classes.in
@@ -0,0 +1,3 @@
+FAN_CLASS_NOTIF 0x00000000
+FAN_CLASS_CONTENT 0x00000004
+FAN_CLASS_PRE_CONTENT 0x00000008
diff --git a/src/xlat/fan_event_flags.in b/src/xlat/fan_event_flags.in
new file mode 100644
index 000000000..210e2b126
--- /dev/null
+++ b/src/xlat/fan_event_flags.in
@@ -0,0 +1,20 @@
+FAN_ACCESS 0x00000001
+FAN_MODIFY 0x00000002
+FAN_ATTRIB 0x00000004
+FAN_CLOSE_WRITE 0x00000008
+FAN_CLOSE_NOWRITE 0x00000010
+FAN_OPEN 0x00000020
+FAN_MOVED_FROM 0x00000040
+FAN_MOVED_TO 0x00000080
+FAN_CREATE 0x00000100
+FAN_DELETE 0x00000200
+FAN_DELETE_SELF 0x00000400
+FAN_MOVE_SELF 0x00000800
+FAN_OPEN_EXEC 0x00001000
+FAN_Q_OVERFLOW 0x00004000
+FAN_OPEN_PERM 0x00010000
+FAN_ACCESS_PERM 0x00020000
+FAN_OPEN_EXEC_PERM 0x00040000
+FAN_DIR_MODIFY 0x00080000
+FAN_ONDIR 0x40000000
+FAN_EVENT_ON_CHILD 0x08000000
diff --git a/src/xlat/fan_init_flags.in b/src/xlat/fan_init_flags.in
new file mode 100644
index 000000000..69501bbbc
--- /dev/null
+++ b/src/xlat/fan_init_flags.in
@@ -0,0 +1,9 @@
+FAN_CLOEXEC 0x00000001
+FAN_NONBLOCK 0x00000002
+FAN_UNLIMITED_QUEUE 0x00000010
+FAN_UNLIMITED_MARKS 0x00000020
+FAN_ENABLE_AUDIT 0x00000040
+FAN_REPORT_TID 0x00000100
+FAN_REPORT_FID 0x00000200
+FAN_REPORT_DIR_FID 0x00000400
+FAN_REPORT_NAME 0x00000800
diff --git a/src/xlat/fan_mark_flags.in b/src/xlat/fan_mark_flags.in
new file mode 100644
index 000000000..56cd8e58f
--- /dev/null
+++ b/src/xlat/fan_mark_flags.in
@@ -0,0 +1,9 @@
+FAN_MARK_ADD 0x00000001
+FAN_MARK_REMOVE 0x00000002
+FAN_MARK_DONT_FOLLOW 0x00000004
+FAN_MARK_ONLYDIR 0x00000008
+FAN_MARK_MOUNT 0x00000010
+FAN_MARK_IGNORED_MASK 0x00000020
+FAN_MARK_IGNORED_SURV_MODIFY 0x00000040
+FAN_MARK_FLUSH 0x00000080
+FAN_MARK_FILESYSTEM 0x00000100
diff --git a/src/xlat/fcntlcmds.in b/src/xlat/fcntlcmds.in
new file mode 100644
index 000000000..5602e6fff
--- /dev/null
+++ b/src/xlat/fcntlcmds.in
@@ -0,0 +1,98 @@
+/* asm-generic/fcntl.h */
+F_DUPFD 0
+F_GETFD 1
+F_SETFD 2
+F_GETFL 3
+F_SETFL 4
+
+#if defined __alpha__ || defined __sparc__
+F_GETLK 7
+#elif defined __mips__
+F_GETLK 14
+#else
+F_GETLK 5
+#endif
+
+#if defined __alpha__ || defined __sparc__
+F_SETLK 8
+F_SETLKW 9
+#else
+F_SETLK 6
+F_SETLKW 7
+#endif
+
+#if defined __alpha__
+F_SETOWN 5
+F_GETOWN 6
+#elif defined __hppa__
+F_GETOWN 11
+F_SETOWN 12
+#elif defined __mips__
+F_GETOWN 23
+F_SETOWN 24
+#elif defined __sparc__
+F_GETOWN 5
+F_SETOWN 6
+#else
+F_SETOWN 8
+F_GETOWN 9
+#endif
+
+#ifdef __hppa__
+F_SETSIG 13
+F_GETSIG 14
+#else
+F_SETSIG 10
+F_GETSIG 11
+#endif
+
+#if defined __hppa__
+F_GETLK64 8
+F_SETLK64 9
+F_SETLKW64 10
+#elif defined __mips__ && !defined __mips64
+F_GETLK64 33
+F_SETLK64 34
+F_SETLKW64 35
+#else
+F_GETLK64 12
+F_SETLK64 13
+F_SETLKW64 14
+#endif
+
+#ifndef STRACE_WORKAROUND_FOR_F_OWNER_EX
+# define STRACE_WORKAROUND_FOR_F_OWNER_EX
+/*
+ * Linux kernel commit v2.6.32-rc7~23 has changed values of F_SETOWN_EX
+ * and F_GETOWN_EX constants introduced by commit v2.6.32-rc1~96 to fix
+ * the conflict with F_GETLK64 and F_SETLK64 constants.
+ * Looks like the best way to handle this situation is to pretend that
+ * old values of F_SETOWN_EX and F_GETOWN_EX didn't exist.
+ */
+# if defined F_SETOWN_EX && F_SETOWN_EX != 15
+# warning invalid value of F_SETOWN_EX ignored
+# endif
+# undef F_SETOWN_EX
+# if defined F_GETOWN_EX && F_GETOWN_EX != 16
+# warning invalid value of F_GETOWN_EX ignored
+# endif
+# undef F_GETOWN_EX
+#endif
+F_SETOWN_EX 15
+F_GETOWN_EX 16
+
+F_GETOWNER_UIDS 17
+F_OFD_GETLK 36
+F_OFD_SETLK 37
+F_OFD_SETLKW 38
+
+/* linux/fcntl.h */
+F_SETLEASE (1024 + 0)
+F_GETLEASE (1024 + 1)
+F_NOTIFY (1024 + 2)
+F_CANCELLK (1024 + 5)
+F_DUPFD_CLOEXEC (1024 + 6)
+F_SETPIPE_SZ (1024 + 7)
+F_GETPIPE_SZ (1024 + 8)
+F_ADD_SEALS (1024 + 9)
+F_GET_SEALS (1024 + 10)
diff --git a/src/xlat/fdflags.in b/src/xlat/fdflags.in
new file mode 100644
index 000000000..f6c02b437
--- /dev/null
+++ b/src/xlat/fdflags.in
@@ -0,0 +1 @@
+FD_CLOEXEC
diff --git a/src/xlat/fib_rule_actions.in b/src/xlat/fib_rule_actions.in
new file mode 100644
index 000000000..181c2eabb
--- /dev/null
+++ b/src/xlat/fib_rule_actions.in
@@ -0,0 +1,10 @@
+#value_indexed
+FR_ACT_UNSPEC 0
+FR_ACT_TO_TBL 1
+FR_ACT_GOTO 2
+FR_ACT_NOP 3
+FR_ACT_RES3 4
+FR_ACT_RES4 5
+FR_ACT_BLACKHOLE 6
+FR_ACT_UNREACHABLE 7
+FR_ACT_PROHIBIT 8
diff --git a/src/xlat/fib_rule_flags.in b/src/xlat/fib_rule_flags.in
new file mode 100644
index 000000000..001db9a3c
--- /dev/null
+++ b/src/xlat/fib_rule_flags.in
@@ -0,0 +1,6 @@
+FIB_RULE_PERMANENT 0x00000001
+FIB_RULE_INVERT 0x00000002
+FIB_RULE_UNRESOLVED 0x00000004
+FIB_RULE_IIF_DETACHED 0x00000008
+FIB_RULE_OIF_DETACHED 0x00000010
+FIB_RULE_FIND_SADDR 0x00010000
diff --git a/src/xlat/fiemap_extent_flags.in b/src/xlat/fiemap_extent_flags.in
new file mode 100644
index 000000000..4d8911ab0
--- /dev/null
+++ b/src/xlat/fiemap_extent_flags.in
@@ -0,0 +1,11 @@
+FIEMAP_EXTENT_LAST 0x00000001
+FIEMAP_EXTENT_UNKNOWN 0x00000002
+FIEMAP_EXTENT_DELALLOC 0x00000004
+FIEMAP_EXTENT_ENCODED 0x00000008
+FIEMAP_EXTENT_DATA_ENCRYPTED 0x00000080
+FIEMAP_EXTENT_NOT_ALIGNED 0x00000100
+FIEMAP_EXTENT_DATA_INLINE 0x00000200
+FIEMAP_EXTENT_DATA_TAIL 0x00000400
+FIEMAP_EXTENT_UNWRITTEN 0x00000800
+FIEMAP_EXTENT_MERGED 0x00001000
+FIEMAP_EXTENT_SHARED 0x00002000
diff --git a/src/xlat/fiemap_flags.in b/src/xlat/fiemap_flags.in
new file mode 100644
index 000000000..aff729518
--- /dev/null
+++ b/src/xlat/fiemap_flags.in
@@ -0,0 +1,3 @@
+FIEMAP_FLAG_SYNC 1
+FIEMAP_FLAG_XATTR 2
+FIEMAP_FLAG_CACHE 4
diff --git a/src/xlat/flockcmds.in b/src/xlat/flockcmds.in
new file mode 100644
index 000000000..d6bddb32b
--- /dev/null
+++ b/src/xlat/flockcmds.in
@@ -0,0 +1,8 @@
+LOCK_SH 1
+LOCK_EX 2
+LOCK_NB 4
+LOCK_UN 8
+LOCK_MAND 32
+LOCK_RW 192
+LOCK_READ 64
+LOCK_WRITE 128
diff --git a/src/xlat/fs_0x94_ioctl_cmds.in b/src/xlat/fs_0x94_ioctl_cmds.in
new file mode 100644
index 000000000..bf13d8eda
--- /dev/null
+++ b/src/xlat/fs_0x94_ioctl_cmds.in
@@ -0,0 +1,8 @@
+/* Introduced by Linux kernel commit v4.5-rc1~135^2~6. */
+FICLONE _IOW(0x94, 9, int)
+FICLONERANGE _IOW(0x94, 13, struct_file_clone_range)
+/* Introduced by Linux kernel commit v4.5-rc1~135^2~1. */
+FIDEDUPERANGE _IOWR(0x94, 54, struct_file_dedupe_range)
+/* Introduced by Linux kernel commit v4.18-rc1~37^2~66. */
+FS_IOC_GETFSLABEL _IOR(0x94, 49, fs_0x94_label_t)
+FS_IOC_SETFSLABEL _IOW(0x94, 50, fs_0x94_label_t)
diff --git a/src/xlat/fs_f_ioctl_cmds.in b/src/xlat/fs_f_ioctl_cmds.in
new file mode 100644
index 000000000..ec431dbb7
--- /dev/null
+++ b/src/xlat/fs_f_ioctl_cmds.in
@@ -0,0 +1,5 @@
+FS_IOC_GETFLAGS _IOR('f', 1, long)
+FS_IOC32_GETFLAGS _IOR('f', 1, int)
+FS_IOC_SETFLAGS _IOW('f', 2, long)
+FS_IOC32_SETFLAGS _IOW('f', 2, int)
+FS_IOC_FIEMAP _IOWR('f', 11, struct_fiemap)
diff --git a/src/xlat/fs_ioc_flags.in b/src/xlat/fs_ioc_flags.in
new file mode 100644
index 000000000..c192ea48f
--- /dev/null
+++ b/src/xlat/fs_ioc_flags.in
@@ -0,0 +1,29 @@
+FS_SECRM_FL 0x00000001
+FS_UNRM_FL 0x00000002
+FS_COMPR_FL 0x00000004
+FS_SYNC_FL 0x00000008
+FS_IMMUTABLE_FL 0x00000010
+FS_APPEND_FL 0x00000020
+FS_NODUMP_FL 0x00000040
+FS_NOATIME_FL 0x00000080
+FS_DIRTY_FL 0x00000100
+FS_COMPRBLK_FL 0x00000200
+FS_NOCOMP_FL 0x00000400
+FS_ENCRYPT_FL 0x00000800
+FS_INDEX_FL 0x00001000
+FS_IMAGIC_FL 0x00002000
+FS_JOURNAL_DATA_FL 0x00004000
+FS_NOTAIL_FL 0x00008000
+FS_DIRSYNC_FL 0x00010000
+FS_TOPDIR_FL 0x00020000
+FS_HUGE_FILE_FL 0x00040000
+FS_EXTENT_FL 0x00080000
+FS_VERITY_FL 0x00100000
+FS_EA_INODE_FL 0x00200000
+FS_EOFBLOCKS_FL 0x00400000
+FS_NOCOW_FL 0x00800000
+FS_DAX_FL 0x02000000
+FS_INLINE_DATA_FL 0x10000000
+FS_PROJINHERIT_FL 0x20000000
+FS_CASEFOLD_FL 0x40000000
+FS_RESERVED_FL 0x80000000
diff --git a/src/xlat/fs_x_ioctl_cmds.in b/src/xlat/fs_x_ioctl_cmds.in
new file mode 100644
index 000000000..80af1f88e
--- /dev/null
+++ b/src/xlat/fs_x_ioctl_cmds.in
@@ -0,0 +1,8 @@
+/* Introduced by Linux kernel commit v2.6.29-rc1~10. */
+FIFREEZE _IOWR('X', 119, int)
+FITHAW _IOWR('X', 120, int)
+/* Introduced by Linux kernel commit v2.6.37-rc1~76^2^2~16. */
+FITRIM _IOWR('X', 121, struct_fstrim_range)
+/* Introduced by Linux kernel commit v4.5-rc1~23^2~1^2~2. */
+FS_IOC_FSGETXATTR _IOR('X', 31, struct_fsxattr)
+FS_IOC_FSSETXATTR _IOW('X', 32, struct_fsxattr)
diff --git a/src/xlat/fs_xflags.in b/src/xlat/fs_xflags.in
new file mode 100644
index 000000000..42e4a89b2
--- /dev/null
+++ b/src/xlat/fs_xflags.in
@@ -0,0 +1,17 @@
+FS_XFLAG_REALTIME 0x00000001U
+FS_XFLAG_PREALLOC 0x00000002U
+FS_XFLAG_IMMUTABLE 0x00000008U
+FS_XFLAG_APPEND 0x00000010U
+FS_XFLAG_SYNC 0x00000020U
+FS_XFLAG_NOATIME 0x00000040U
+FS_XFLAG_NODUMP 0x00000080U
+FS_XFLAG_RTINHERIT 0x00000100U
+FS_XFLAG_PROJINHERIT 0x00000200U
+FS_XFLAG_NOSYMLINKS 0x00000400U
+FS_XFLAG_EXTSIZE 0x00000800U
+FS_XFLAG_EXTSZINHERIT 0x00001000U
+FS_XFLAG_NODEFRAG 0x00002000U
+FS_XFLAG_FILESTREAM 0x00004000U
+FS_XFLAG_DAX 0x00008000U
+FS_XFLAG_COWEXTSIZE 0x00010000U
+FS_XFLAG_HASATTR 0x80000000U
diff --git a/src/xlat/fsconfig_cmds.in b/src/xlat/fsconfig_cmds.in
new file mode 100644
index 000000000..be33679be
--- /dev/null
+++ b/src/xlat/fsconfig_cmds.in
@@ -0,0 +1,9 @@
+#value_indexed
+FSCONFIG_SET_FLAG 0
+FSCONFIG_SET_STRING 1
+FSCONFIG_SET_BINARY 2
+FSCONFIG_SET_PATH 3
+FSCONFIG_SET_PATH_EMPTY 4
+FSCONFIG_SET_FD 5
+FSCONFIG_CMD_CREATE 6
+FSCONFIG_CMD_RECONFIGURE 7
diff --git a/src/xlat/fsmagic.in b/src/xlat/fsmagic.in
new file mode 100644
index 000000000..9cdaba519
--- /dev/null
+++ b/src/xlat/fsmagic.in
@@ -0,0 +1,110 @@
+#sorted sort -k2,2
+QNX4_SUPER_MAGIC 0x0000002f
+Z3FOLD_MAGIC 0x00000033
+AUTOFS_SUPER_MAGIC 0x00000187
+DEVFS_SUPER_MAGIC 0x00001373
+EXT_SUPER_MAGIC 0x0000137d
+MINIX_SUPER_MAGIC 0x0000137f
+MINIX_SUPER_MAGIC2 0x0000138f
+DEVPTS_SUPER_MAGIC 0x00001cd1
+MINIX2_SUPER_MAGIC 0x00002468
+MINIX2_SUPER_MAGIC2 0x00002478
+NILFS_SUPER_MAGIC 0x00003434
+HFS_SUPER_MAGIC 0x00004244
+HFSPLUS_SUPER_MAGIC 0x0000482b
+MSDOS_SUPER_MAGIC 0x00004d44
+MINIX3_SUPER_MAGIC 0x00004d5a
+SMB_SUPER_MAGIC 0x0000517b
+NCP_SUPER_MAGIC 0x0000564c
+EXOFS_SUPER_MAGIC 0x00005df5
+NFS_SUPER_MAGIC 0x00006969
+ROMFS_MAGIC 0x00007275
+JFFS2_SUPER_MAGIC 0x000072b6
+ISOFS_SUPER_MAGIC 0x00009660
+PROC_SUPER_MAGIC 0x00009fa0
+OPENPROM_SUPER_MAGIC 0x00009fa1
+USBDEVICE_SUPER_MAGIC 0x00009fa2
+ADFS_SUPER_MAGIC 0x0000adf5
+AFFS_SUPER_MAGIC 0x0000adff
+EXT2_OLD_SUPER_MAGIC 0x0000ef51
+EXT2_SUPER_MAGIC 0x0000ef53
+ECRYPTFS_SUPER_MAGIC 0x0000f15f
+UFS_MAGIC 0x00011954
+CGROUP_SUPER_MAGIC 0x0027e0eb
+EFS_SUPER_MAGIC 0x00414a53
+HOSTFS_SUPER_MAGIC 0x00c0ffee
+CEPH_SUPER_MAGIC 0x00c36400
+TMPFS_MAGIC 0x01021994
+V9FS_MAGIC 0x01021997
+GFS2_MAGIC 0x01161970
+XIAFS_SUPER_MAGIC 0x012fd16d
+XENIX_SUPER_MAGIC 0x012ff7b4
+SYSV4_SUPER_MAGIC 0x012ff7b5
+SYSV2_SUPER_MAGIC 0x012ff7b6
+COH_SUPER_MAGIC 0x012ff7b7
+SHMFS_SUPER_MAGIC 0x02011994
+ANON_INODE_FS_MAGIC 0x09041934
+FUTEXFS_SUPER_MAGIC 0x0bad1dea
+MTD_INODE_FS_MAGIC 0x11307854
+BALLOON_KVM_MAGIC 0x13661366
+UDF_SUPER_MAGIC 0x15013346
+BFS_MAGIC 0x1badface
+UBIFS_SUPER_MAGIC 0x24051905
+CRAMFS_MAGIC 0x28cd3d45
+ZFS_SUPER_MAGIC 0x2fc12fc1
+JFS_SUPER_MAGIC 0x3153464a
+BEFS_SUPER_MAGIC 0x42465331
+BINFMTFS_MAGIC 0x42494e4d
+SMACK_MAGIC 0x43415d53
+DMA_BUF_MAGIC 0x444d4142
+CRAMFS_MAGIC_WEND 0x453dcd28
+DEVMEM_MAGIC 0x454d444d
+GPFS_SUPER_MAGIC 0x47504653
+PIPEFS_MAGIC 0x50495045
+REISERFS_SUPER_MAGIC 0x52654973
+AFS_SUPER_MAGIC 0x5346414f
+NTFS_SB_MAGIC 0x5346544e
+SOCKFS_MAGIC 0x534f434b
+UFS_CIGAM 0x54190100
+VZFS_SUPER_MAGIC 0x565a4653
+STACK_END_MAGIC 0x57ac6e9d
+ZSMALLOC_MAGIC 0x58295829
+XFS_SB_MAGIC 0x58465342
+AAFS_MAGIC 0x5a3c69f0
+ZONEFS_MAGIC 0x5a4f4653
+PSTOREFS_MAGIC 0x6165676c
+AUFS_SUPER_MAGIC 0x61756673
+BDEVFS_MAGIC 0x62646576
+CONFIGFS_MAGIC 0x62656570
+SYSFS_MAGIC 0x62656572
+CGROUP2_SUPER_MAGIC 0x63677270
+DEBUGFS_MAGIC 0x64626720
+DAXFS_MAGIC 0x64646178
+FUSE_CTL_SUPER_MAGIC 0x65735543
+FUSE_SUPER_MAGIC 0x65735546
+QNX6_SUPER_MAGIC 0x68191122
+AFS_FS_MAGIC 0x6b414653
+BINDERFS_SUPER_MAGIC 0x6c6f6f70
+NSFS_MAGIC 0x6e736673
+SECURITYFS_MAGIC 0x73636673
+SQUASHFS_MAGIC 0x73717368
+BTRFS_TEST_MAGIC 0x73727279
+CODA_SUPER_MAGIC 0x73757245
+OCFS2_SUPER_MAGIC 0x7461636f
+TRACEFS_MAGIC 0x74726163
+OVERLAYFS_SUPER_MAGIC 0x794c7630
+RAMFS_MAGIC 0x858458f6
+BTRFS_SUPER_MAGIC 0x9123683e
+HUGETLBFS_MAGIC 0x958458f6
+VXFS_SUPER_MAGIC 0xa501fcf5
+XENFS_SUPER_MAGIC 0xabba1974
+PPC_CMM_MAGIC 0xc7571590
+LOGFS_MAGIC 0xc97e8168
+BPF_FS_MAGIC 0xcafe4a11
+EFIVARFS_MAGIC 0xde5e81e4
+EROFS_SUPER_MAGIC_V1 0xe0f5e1e2
+F2FS_SUPER_MAGIC 0xf2f52010
+SELINUX_MAGIC 0xf97cff8c
+HPFS_SUPER_MAGIC 0xf995e849
+SMB2_MAGIC_NUMBER 0xfe534d42
+CIFS_MAGIC_NUMBER 0xff534d42
diff --git a/src/xlat/fsmount_flags.in b/src/xlat/fsmount_flags.in
new file mode 100644
index 000000000..8a3b95e4e
--- /dev/null
+++ b/src/xlat/fsmount_flags.in
@@ -0,0 +1 @@
+FSMOUNT_CLOEXEC 1
diff --git a/src/xlat/fsopen_flags.in b/src/xlat/fsopen_flags.in
new file mode 100644
index 000000000..ce01ddf0e
--- /dev/null
+++ b/src/xlat/fsopen_flags.in
@@ -0,0 +1 @@
+FSOPEN_CLOEXEC 1
diff --git a/src/xlat/fspick_flags.in b/src/xlat/fspick_flags.in
new file mode 100644
index 000000000..52ed0350e
--- /dev/null
+++ b/src/xlat/fspick_flags.in
@@ -0,0 +1,4 @@
+FSPICK_CLOEXEC 0x01
+FSPICK_SYMLINK_NOFOLLOW 0x02
+FSPICK_NO_AUTOMOUNT 0x04
+FSPICK_EMPTY_PATH 0x08
diff --git a/src/xlat/futexbitset.in b/src/xlat/futexbitset.in
new file mode 100644
index 000000000..1290c87c7
--- /dev/null
+++ b/src/xlat/futexbitset.in
@@ -0,0 +1 @@
+FUTEX_BITSET_MATCH_ANY 0xffffffff
diff --git a/src/xlat/futexops.in b/src/xlat/futexops.in
new file mode 100644
index 000000000..3e589ab3f
--- /dev/null
+++ b/src/xlat/futexops.in
@@ -0,0 +1,32 @@
+FUTEX_WAIT 0
+FUTEX_WAKE 1
+FUTEX_FD 2
+FUTEX_REQUEUE 3
+FUTEX_CMP_REQUEUE 4
+FUTEX_WAKE_OP 5
+FUTEX_LOCK_PI 6
+FUTEX_UNLOCK_PI 7
+FUTEX_TRYLOCK_PI 8
+FUTEX_WAIT_BITSET 9
+FUTEX_WAKE_BITSET 10
+FUTEX_WAIT_REQUEUE_PI 11
+FUTEX_CMP_REQUEUE_PI 12
+FUTEX_WAIT_PRIVATE (FUTEX_WAIT | FUTEX_PRIVATE_FLAG)
+FUTEX_WAKE_PRIVATE (FUTEX_WAKE | FUTEX_PRIVATE_FLAG)
+FUTEX_FD|FUTEX_PRIVATE_FLAG
+FUTEX_REQUEUE_PRIVATE (FUTEX_REQUEUE | FUTEX_PRIVATE_FLAG)
+FUTEX_CMP_REQUEUE_PRIVATE (FUTEX_CMP_REQUEUE | FUTEX_PRIVATE_FLAG)
+FUTEX_WAKE_OP_PRIVATE (FUTEX_WAKE_OP | FUTEX_PRIVATE_FLAG)
+FUTEX_LOCK_PI_PRIVATE (FUTEX_LOCK_PI | FUTEX_PRIVATE_FLAG)
+FUTEX_UNLOCK_PI_PRIVATE (FUTEX_UNLOCK_PI | FUTEX_PRIVATE_FLAG)
+FUTEX_TRYLOCK_PI_PRIVATE (FUTEX_TRYLOCK_PI | FUTEX_PRIVATE_FLAG)
+FUTEX_WAIT_BITSET_PRIVATE (FUTEX_WAIT_BITSET | FUTEX_PRIVATE_FLAG)
+FUTEX_WAKE_BITSET_PRIVATE (FUTEX_WAKE_BITSET | FUTEX_PRIVATE_FLAG)
+FUTEX_WAIT_REQUEUE_PI_PRIVATE (FUTEX_WAIT_REQUEUE_PI | FUTEX_PRIVATE_FLAG)
+FUTEX_CMP_REQUEUE_PI_PRIVATE (FUTEX_CMP_REQUEUE_PI | FUTEX_PRIVATE_FLAG)
+FUTEX_WAIT|FUTEX_CLOCK_REALTIME
+FUTEX_WAIT_PRIVATE|FUTEX_CLOCK_REALTIME
+FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME
+FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME
+FUTEX_WAIT_REQUEUE_PI|FUTEX_CLOCK_REALTIME
+FUTEX_WAIT_REQUEUE_PI_PRIVATE|FUTEX_CLOCK_REALTIME
diff --git a/src/xlat/futexwakecmps.in b/src/xlat/futexwakecmps.in
new file mode 100644
index 000000000..96d92069b
--- /dev/null
+++ b/src/xlat/futexwakecmps.in
@@ -0,0 +1,7 @@
+#value_indexed
+FUTEX_OP_CMP_EQ 0
+FUTEX_OP_CMP_NE 1
+FUTEX_OP_CMP_LT 2
+FUTEX_OP_CMP_LE 3
+FUTEX_OP_CMP_GT 4
+FUTEX_OP_CMP_GE 5
diff --git a/src/xlat/futexwakeops.in b/src/xlat/futexwakeops.in
new file mode 100644
index 000000000..1086fecf8
--- /dev/null
+++ b/src/xlat/futexwakeops.in
@@ -0,0 +1,6 @@
+#value_indexed
+FUTEX_OP_SET 0
+FUTEX_OP_ADD 1
+FUTEX_OP_OR 2
+FUTEX_OP_ANDN 3
+FUTEX_OP_XOR 4
diff --git a/src/xlat/gen.sh b/src/xlat/gen.sh
new file mode 100755
index 000000000..a952cb822
--- /dev/null
+++ b/src/xlat/gen.sh
@@ -0,0 +1,484 @@
+#!/bin/sh -efu
+#
+# Copyright (c) 2014-2015 Mike Frysinger <vapier@gentoo.org>
+# Copyright (c) 2014-2015 Dmitry V. Levin <ldv@strace.io>
+# Copyright (c) 2014-2020 The strace developers.
+# All rights reserved.
+#
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+export LC_ALL=C
+
+usage()
+{
+ cat <<EOF
+Usage: $0 <input> <output>
+
+Generate xlat header files from <input> (a file or dir of files) and write
+the generated headers to <output>.
+EOF
+ exit 1
+}
+
+print_m4_record()
+{
+ local val output
+ val="$1"; shift
+ output="$1"; shift
+ [ -n "$output" ] || return 0
+
+ if [ "$first_enum" = 1 ]; then
+ printf '%s' "$val"
+ else
+ printf ',\n%s' "$val"
+ fi >> "$output"
+
+ first_enum=0
+}
+
+cond_def()
+{
+ local line
+ line="$1"; shift
+
+ local val
+ val="${line%%[!A-Za-z0-9_]*}"
+
+ local t def=
+ t="${line#*[ ]}"
+ if [ "$line" != "$t" ]; then
+ while [ "$def" != "$t" ]; do
+ def="$t"
+ t="${t##[ ]}"
+ done
+ fi
+
+ if [ -n "$def" ]; then
+ printf "%s\n" \
+ "#if defined($val) || (defined(HAVE_DECL_$val) && HAVE_DECL_$val)" \
+ "DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE" \
+ "static_assert(($val) == ($def), \"$val != $def\");" \
+ "DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE" \
+ "#else" \
+ "# define $val $def" \
+ "#endif"
+ fi
+}
+
+print_xlat()
+{
+ local val
+ val="$1"; shift
+
+ [ 1 = "$value_indexed" ] && printf " [%s] =" "${val}"
+ if [ -z "${val_type-}" ]; then
+ echo " XLAT(${val}),"
+ else
+ echo " XLAT_TYPE(${val_type}, ${val}),"
+ fi
+
+ echo " #define XLAT_VAL_$xlat_flag_cnt ((${val_type:-unsigned}) (${val}))"
+ echo " #define XLAT_STR_$xlat_flag_cnt STRINGIFY(${val})"
+ xlat_flag_cnt=$((xlat_flag_cnt + 1))
+
+ [ -z "$enum" ] || print_m4_record "$val" "$output_m4"
+}
+
+print_xlat_pair()
+{
+ local val str macro
+ val="$1"; shift
+ str="$1"; shift
+ macro="$1"; shift
+
+ [ 1 = "$value_indexed" ] && printf " [%s] =" "${val}"
+ if [ -z "${val_type-}" ]; then
+ echo " XLAT_PAIR(${val}, \"${str}\"),"
+ else
+ echo " XLAT_TYPE_PAIR(${val_type}, ${val}, \"${str}\"),"
+ fi
+
+ echo " #define XLAT_VAL_$xlat_flag_cnt ((${val_type:-unsigned}) (${val}))"
+ echo " #define XLAT_STR_$xlat_flag_cnt \"${str}\""
+ xlat_flag_cnt=$((xlat_flag_cnt + 1))
+
+ [ -z "$enum" ] || print_m4_record "$macro" "$output_m4"
+}
+
+cond_xlat()
+{
+ echo "$1" | {
+ local val def m xlat
+
+ read val def
+
+ m="${val%%|*}"
+
+ if [ "${m}" = "${m#1<<}" ]; then
+ xlat="$(print_xlat "${val}")"
+ else
+ m="${m#1<<}"
+ xlat="$(print_xlat_pair "1ULL<<${val#1<<}" "${val}" "$m")"
+ fi
+
+ if [ -z "${def}" ]; then
+ printf "%s\n" \
+ "#if defined(${m}) || (defined(HAVE_DECL_${m}) && HAVE_DECL_${m})" \
+ " ${xlat}" \
+ "#endif"
+ else
+ echo "$xlat"
+ fi
+ }
+
+ # Since we're calling print_xlat/print_xlat_pair in subprocess
+ xlat_flag_cnt=$((xlat_flag_cnt + 1))
+ first_enum=0
+}
+
+gen_header()
+{
+ local input="$1" output="$2" name="$3" output_m4="$4"
+
+ exec 3>&1
+
+ echo "generating ${output}" >&2
+ (
+ local defs="${0%/*}/../defs.h"
+ local mpers="${0%/*}/../mpers_xlat.h"
+ local decl="extern const struct xlat ${name}[];"
+ local in_defs= in_mpers=
+ local xlat_type="XT_NORMAL"
+ local includes=""
+ local enum=""
+
+ first_enum=1
+ value_indexed=0
+ xlat_flag_cnt=0
+
+ if grep -F -q -x "$decl" "$defs"; then
+ in_defs=1
+ elif grep -F -q -x "$decl" "$mpers"; then
+ in_mpers=1
+ fi
+
+ cat <<-EOF
+ /* Generated by $0 from $1; do not edit. */
+
+ #include "gcc_compat.h"
+ #include "static_assert.h"
+
+ EOF
+
+ local unconditional= line
+ # 1st pass: output directives.
+ while read line; do
+ case "$line" in
+ */\**)
+ line=$(printf "%s" "$line" |
+ sed "s|[[:space:]]*/\*.*\*/[[:space:]]*||")
+ ;;
+ esac
+
+ case $line in
+ '#conditional')
+ unconditional=
+ ;;
+ '#unconditional')
+ unconditional=1
+ ;;
+ '#val_type '*)
+ # to be processed during 2nd pass
+ ;;
+ '#sorted'|'#sorted '*)
+ xlat_type="XT_SORTED"
+ ;;
+ '#value_indexed')
+ value_indexed=1
+ xlat_type="XT_INDEXED"
+ ;;
+ '#enum')
+ [ -z "$output_m4" ] || enum=1
+ ;;
+ '#include '*)
+ includes="${includes} ${line###include }"
+ ;;
+ '#'*)
+ echo "${line}"
+ ;;
+ [A-Z_]*)
+ [ -n "$unconditional" ] ||
+ cond_def "$line"
+ ;;
+ esac
+ done < "$input"
+
+ cat <<-EOF
+
+ #ifndef XLAT_MACROS_ONLY
+
+ EOF
+
+ [ "$enum" != 1 ] || (
+ echo "generating ${output_m4}" >&2
+ printf 'dnl Generated by %s from %s; do not edit.\n' \
+ "$0" "$input"
+ printf 'AC_DEFUN([st_CHECK_ENUMS_%s],[\n' "$name"
+ printf 'AC_CHECK_DECLS(m4_normalize([\n'
+ ) > "${output_m4}"
+
+ if [ -n "$in_defs" ]; then
+ cat <<-EOF
+ # ifndef IN_MPERS
+
+ EOF
+ elif [ -n "$in_mpers" ]; then
+ cat <<-EOF
+ # ifdef IN_MPERS
+
+ ${decl}
+
+ # else
+
+ EOF
+ else
+ cat <<-EOF
+ # ifdef IN_MPERS
+
+ # error static const struct xlat ${name} in mpers mode
+
+ # else
+
+ EOF
+ fi
+
+ echo "static const struct xlat_data ${name}_xdata[] = {"
+
+ unconditional= val_type=
+ # 2nd pass: output everything.
+ while read line; do
+ case "$line" in
+ */\**)
+ line=$(printf "%s" "$line" |
+ sed "s|[[:space:]]*/\*.*\*/[[:space:]]*||")
+ ;;
+ esac
+
+ case ${line} in
+ '#conditional')
+ unconditional=
+ ;;
+ '#unconditional')
+ unconditional=1
+ ;;
+ '#sorted'|'#sorted '*)
+ ;;
+ '#value_indexed')
+ ;;
+ '#enum')
+ ;;
+ '#include '*)
+ ;;
+ '#val_type '*)
+ val_type="${line#\#val_type }"
+ ;;
+ [A-Z_]*) # symbolic constants
+ if [ -n "${unconditional}" ]; then
+ print_xlat "${line}"
+ else
+ cond_xlat "${line}"
+ fi
+ ;;
+ '1<<'[A-Z_]*) # symbolic constants with shift
+ if [ -n "${unconditional}" ]; then
+ print_xlat_pair "1ULL<<${line#1<<}" "${line}" "${line#1<<}"
+ else
+ cond_xlat "${line}"
+ fi
+ ;;
+ [0-9]*) # numeric constants
+ print_xlat "${line}"
+ ;;
+ *) # verbatim lines
+ echo "${line}"
+ ;;
+ esac
+ done < "${input}"
+ echo '};'
+
+ [ "$enum" != 1 ] || (
+ printf '\n]),,, [\n'
+ [ -z "$includes" ] || printf '#include %s\n' $includes
+ printf '])])])\n'
+
+ # Providing macro name to main
+ echo "st_CHECK_ENUMS_${name}" >&3
+ ) >> "${output_m4}"
+
+ if [ -n "$in_defs" ]; then
+ :
+ elif [ -n "$in_mpers" ]; then
+ cat <<-EOF
+ # if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS)
+ static
+ # endif
+ EOF
+ else
+ cat <<-EOF
+ static
+ EOF
+ fi
+
+ cat <<-EOF
+ const struct xlat ${name}[1] = { {
+ .data = ${name}_xdata,
+ .size = ARRAY_SIZE(${name}_xdata),
+ .type = ${xlat_type},
+ EOF
+
+ echo " .flags_mask = 0"
+ for i in $(seq 0 "$((xlat_flag_cnt - 1))"); do
+ cat <<-EOF
+ # ifdef XLAT_VAL_${i}
+ | XLAT_VAL_${i}
+ # endif
+ EOF
+ done
+ echo " ,"
+
+ echo " .flags_strsz = 0"
+ for i in $(seq 0 "$((xlat_flag_cnt - 1))"); do
+ cat <<-EOF
+ # ifdef XLAT_STR_${i}
+ + sizeof(XLAT_STR_${i})
+ # endif
+ EOF
+ done
+ echo " ,"
+
+ cat <<-EOF
+ } };
+
+ EOF
+
+ for i in $(seq 0 "$((xlat_flag_cnt - 1))"); do
+ cat <<-EOF
+ # undef XLAT_STR_${i}
+ # undef XLAT_VAL_${i}
+ EOF
+ done
+
+ cat <<-EOF
+ # endif /* !IN_MPERS */
+
+ #endif /* !XLAT_MACROS_ONLY */
+ EOF
+ ) >"${output}"
+
+ exec 3>&-
+}
+
+gen_make()
+{
+ local output="$1"
+ local name
+ shift
+ echo "generating ${output}" >&2
+ (
+ printf "XLAT_INPUT_FILES = "
+ printf 'xlat/%s.in ' "$@"
+ echo
+ printf "XLAT_HEADER_FILES = "
+ printf 'xlat/%s.h ' "$@"
+ echo
+ for name; do
+ printf '$(top_srcdir)/src/xlat/%s.h: $(top_srcdir)/src/xlat/%s.in $(top_srcdir)/src/xlat/gen.sh\n' \
+ "${name}" "${name}"
+ echo ' $(AM_V_GEN)$(top_srcdir)/src/xlat/gen.sh $< $@'
+ done
+ ) >"${output}"
+}
+
+gen_git()
+{
+ local output="$1"
+ shift
+ echo "generating ${output}" >&2
+ (
+ printf '/%s\n' .gitignore Makemodule.am st_check_enums.m4
+ printf '/%s.h\n' "$@"
+ printf '/%s.m4\n' "$@"
+ ) >"${output}"
+}
+
+gen_m4_entry()
+{
+ local output
+ output="$1"; shift
+
+ echo "generating $output" >&2
+ {
+ printf 'AC_DEFUN([st_CHECK_ENUMS],[\n'
+ while read fun; do
+ printf '\t%s\n' "$fun"
+ done
+ printf '])\n'
+ } >"$output"
+}
+
+main()
+{
+ case $# in
+ 0) set -- "${0%/*}" "${0%/*}" ;;
+ 2) ;;
+ 3) ;;
+ *) usage ;;
+ esac
+
+ local input="$1"
+ local output="$2"
+ local output_m4="${3:-}"
+ local name
+ local jobs=0
+ local ncpus="$(getconf _NPROCESSORS_ONLN)"
+ local pids=
+ [ "${ncpus}" -ge 1 ] ||
+ ncpus=1
+
+ if [ -d "${input}" ]; then
+ (
+ local f names=
+ set +f
+ set -- "${input}"/*.in
+ set -f
+ for f; do
+ [ -f "${f}" ] || continue
+ name=${f##*/}
+ name=${name%.in}
+ gen_header "${f}" "${output}/${name}.h" "${name}" \
+ "${output}/${name}.m4" &
+ pids="$pids $!"
+ names="${names} ${name}"
+ : $(( jobs += 1 ))
+ if [ "${jobs}" -gt "$(( ncpus * 2 ))" ]; then
+ read wait_pid rest
+ pids="$rest"
+ wait -n 2>/dev/null || wait "$wait_pid"
+ : $(( jobs -= 1 ))
+ fi <<- EOF
+ $pids
+ EOF
+ done
+ gen_git "${output}/.gitignore" ${names} &
+ gen_make "${output}/Makemodule.am" ${names} &
+ wait
+ ) | sort | gen_m4_entry "${output}/st_check_enums.m4"
+ else
+ name=${input##*/}
+ name=${name%.in}
+ gen_header "${input}" "${output}" "${name}" "${output_m4}" \
+ > /dev/null
+ fi
+}
+
+main "$@"
diff --git a/src/xlat/get_mempolicy_flags.in b/src/xlat/get_mempolicy_flags.in
new file mode 100644
index 000000000..4e8025b29
--- /dev/null
+++ b/src/xlat/get_mempolicy_flags.in
@@ -0,0 +1,3 @@
+MPOL_F_NODE 1
+MPOL_F_ADDR 2
+MPOL_F_MEMS_ALLOWED 4
diff --git a/src/xlat/getrandom_flags.in b/src/xlat/getrandom_flags.in
new file mode 100644
index 000000000..96fdcb00e
--- /dev/null
+++ b/src/xlat/getrandom_flags.in
@@ -0,0 +1,3 @@
+GRND_NONBLOCK 1
+GRND_RANDOM 2
+GRND_INSECURE 4
diff --git a/src/xlat/getsock_ip_options.in b/src/xlat/getsock_ip_options.in
new file mode 100644
index 000000000..7b054608c
--- /dev/null
+++ b/src/xlat/getsock_ip_options.in
@@ -0,0 +1,29 @@
+/*
+ * Options specific to getsockopt(SOL_IP).
+ * Common {g,s}etsockopt(SOL_IP) options
+ * should be in sock_ip_options.in instead.
+ */
+
+ARPT_SO_GET_INFO
+ARPT_SO_GET_ENTRIES
+ARPT_SO_GET_REVISION_MATCH
+ARPT_SO_GET_REVISION_TARGET
+
+EBT_SO_GET_INFO
+EBT_SO_GET_ENTRIES
+EBT_SO_GET_INIT_INFO
+EBT_SO_GET_INIT_ENTRIES
+
+IP_VS_SO_GET_VERSION
+IP_VS_SO_GET_INFO
+IP_VS_SO_GET_SERVICES
+IP_VS_SO_GET_SERVICE
+IP_VS_SO_GET_DESTS
+IP_VS_SO_GET_DEST
+IP_VS_SO_GET_TIMEOUT
+IP_VS_SO_GET_DAEMON
+
+IPT_SO_GET_INFO
+IPT_SO_GET_ENTRIES
+IPT_SO_GET_REVISION_MATCH
+IPT_SO_GET_REVISION_TARGET
diff --git a/src/xlat/getsock_ipv6_options.in b/src/xlat/getsock_ipv6_options.in
new file mode 100644
index 000000000..98c450fa7
--- /dev/null
+++ b/src/xlat/getsock_ipv6_options.in
@@ -0,0 +1,10 @@
+/*
+ * Options specific to getsockopt(SOL_IPV6).
+ * Common {g,s}etsockopt(SOL_IPV6) options
+ * should be in sock_ipv6_options.in instead.
+ */
+
+IP6T_SO_GET_INFO
+IP6T_SO_GET_ENTRIES
+IP6T_SO_GET_REVISION_MATCH
+IP6T_SO_GET_REVISION_TARGET
diff --git a/src/xlat/getsock_options.in b/src/xlat/getsock_options.in
new file mode 100644
index 000000000..6e4762393
--- /dev/null
+++ b/src/xlat/getsock_options.in
@@ -0,0 +1,5 @@
+#if defined __hppa__
+SO_GET_FILTER 16410
+#else
+SO_GET_FILTER 26
+#endif
diff --git a/src/xlat/gpio_event_flags.in b/src/xlat/gpio_event_flags.in
new file mode 100644
index 000000000..c355b10bd
--- /dev/null
+++ b/src/xlat/gpio_event_flags.in
@@ -0,0 +1,3 @@
+GPIOEVENT_REQUEST_BOTH_EDGES 0x00000003
+GPIOEVENT_REQUEST_RISING_EDGE 0x00000001
+GPIOEVENT_REQUEST_FALLING_EDGE 0x00000002
diff --git a/src/xlat/gpio_handle_flags.in b/src/xlat/gpio_handle_flags.in
new file mode 100644
index 000000000..0c75034ee
--- /dev/null
+++ b/src/xlat/gpio_handle_flags.in
@@ -0,0 +1,8 @@
+GPIOHANDLE_REQUEST_INPUT 0x00000001
+GPIOHANDLE_REQUEST_OUTPUT 0x00000002
+GPIOHANDLE_REQUEST_ACTIVE_LOW 0x00000004
+GPIOHANDLE_REQUEST_OPEN_DRAIN 0x00000008
+GPIOHANDLE_REQUEST_OPEN_SOURCE 0x00000010
+GPIOHANDLE_REQUEST_BIAS_PULL_UP 0x00000020
+GPIOHANDLE_REQUEST_BIAS_PULL_DOWN 0x00000040
+GPIOHANDLE_REQUEST_BIAS_DISABLE 0x00000080
diff --git a/src/xlat/gpio_ioctl_cmds.in b/src/xlat/gpio_ioctl_cmds.in
new file mode 100644
index 000000000..1b3d70367
--- /dev/null
+++ b/src/xlat/gpio_ioctl_cmds.in
@@ -0,0 +1,15 @@
+GPIO_GET_CHIPINFO_IOCTL _IOR(0xB4, 0x01, struct_gpiochip_info)
+GPIO_GET_LINEINFO_IOCTL _IOWR(0xB4, 0x02, struct_gpioline_info)
+GPIO_GET_LINEHANDLE_IOCTL _IOWR(0xB4, 0x03, struct_gpiohandle_request)
+GPIO_GET_LINEEVENT_IOCTL _IOWR(0xB4, 0x04, struct_gpioevent_request)
+GPIO_V2_GET_LINEINFO_IOCTL _IOWR(0xB4, 0x05, struct_gpio_v2_line_info)
+GPIO_V2_GET_LINEINFO_WATCH_IOCTL _IOWR(0xB4, 0x06, struct_gpio_v2_line_info)
+GPIO_V2_GET_LINE_IOCTL _IOWR(0xB4, 0x07, struct_gpio_v2_line_request)
+GPIOHANDLE_GET_LINE_VALUES_IOCTL _IOWR(0xB4, 0x08, struct_gpiohandle_data)
+GPIOHANDLE_SET_LINE_VALUES_IOCTL _IOWR(0xB4, 0x09, struct_gpiohandle_data)
+GPIOHANDLE_SET_CONFIG_IOCTL _IOWR(0xB4, 0x0A, struct_gpiohandle_config)
+GPIO_GET_LINEINFO_WATCH_IOCTL _IOWR(0xB4, 0x0B, struct_gpioline_info)
+GPIO_GET_LINEINFO_UNWATCH_IOCTL _IOWR(0xB4, 0x0C, uint32_t)
+GPIO_V2_LINE_SET_CONFIG_IOCTL _IOWR(0xB4, 0x0D, struct_gpio_v2_line_config)
+GPIO_V2_LINE_GET_VALUES_IOCTL _IOWR(0xB4, 0x0E, struct_gpio_v2_line_values)
+GPIO_V2_LINE_SET_VALUES_IOCTL _IOWR(0xB4, 0x0F, struct_gpio_v2_line_values)
diff --git a/src/xlat/gpio_line_flags.in b/src/xlat/gpio_line_flags.in
new file mode 100644
index 000000000..a7d505e2d
--- /dev/null
+++ b/src/xlat/gpio_line_flags.in
@@ -0,0 +1,8 @@
+GPIOLINE_FLAG_KERNEL 0x00000001
+GPIOLINE_FLAG_IS_OUT 0x00000002
+GPIOLINE_FLAG_ACTIVE_LOW 0x00000004
+GPIOLINE_FLAG_OPEN_DRAIN 0x00000008
+GPIOLINE_FLAG_OPEN_SOURCE 0x00000010
+GPIOLINE_FLAG_BIAS_PULL_UP 0x00000020
+GPIOLINE_FLAG_BIAS_PULL_DOWN 0x00000040
+GPIOLINE_FLAG_BIAS_DISABLE 0x00000080
diff --git a/src/xlat/gpio_v2_line_attr_ids.in b/src/xlat/gpio_v2_line_attr_ids.in
new file mode 100644
index 000000000..5217e4004
--- /dev/null
+++ b/src/xlat/gpio_v2_line_attr_ids.in
@@ -0,0 +1,5 @@
+#enum
+#include <linux/gpio.h>
+GPIO_V2_LINE_ATTR_ID_FLAGS 0x00000001
+GPIO_V2_LINE_ATTR_ID_OUTPUT_VALUES 0x00000002
+GPIO_V2_LINE_ATTR_ID_DEBOUNCE 0x00000003
diff --git a/src/xlat/gpio_v2_line_flags.in b/src/xlat/gpio_v2_line_flags.in
new file mode 100644
index 000000000..e2f0da35a
--- /dev/null
+++ b/src/xlat/gpio_v2_line_flags.in
@@ -0,0 +1,14 @@
+#enum
+#include <linux/gpio.h>
+GPIO_V2_LINE_FLAG_USED 0x00000001
+GPIO_V2_LINE_FLAG_ACTIVE_LOW 0x00000002
+GPIO_V2_LINE_FLAG_INPUT 0x00000004
+GPIO_V2_LINE_FLAG_OUTPUT 0x00000008
+GPIO_V2_LINE_FLAG_EDGE_RISING 0x00000010
+GPIO_V2_LINE_FLAG_EDGE_FALLING 0x00000020
+GPIO_V2_LINE_FLAG_OPEN_DRAIN 0x00000040
+GPIO_V2_LINE_FLAG_OPEN_SOURCE 0x00000080
+GPIO_V2_LINE_FLAG_BIAS_PULL_UP 0x00000100
+GPIO_V2_LINE_FLAG_BIAS_PULL_DOWN 0x00000200
+GPIO_V2_LINE_FLAG_BIAS_DISABLED 0x00000400
+GPIO_V2_LINE_FLAG_EVENT_CLOCK_REALTIME 0x00000800
diff --git a/src/xlat/hci_channels.in b/src/xlat/hci_channels.in
new file mode 100644
index 000000000..42055bbee
--- /dev/null
+++ b/src/xlat/hci_channels.in
@@ -0,0 +1,6 @@
+#value_indexed
+HCI_CHANNEL_RAW 0
+HCI_CHANNEL_USER 1
+HCI_CHANNEL_MONITOR 2
+HCI_CHANNEL_CONTROL 3
+HCI_CHANNEL_LOGGING 4
diff --git a/src/xlat/hdio_drive_cmds.in b/src/xlat/hdio_drive_cmds.in
new file mode 100644
index 000000000..1158abb55
--- /dev/null
+++ b/src/xlat/hdio_drive_cmds.in
@@ -0,0 +1,94 @@
+#sorted sort -k2,2
+ATA_CMD_NOP 0x00
+ATA_CMD_CFA_REQ_EXT_ERR 0x03
+ATA_CMD_DSM 0x06
+ATA_CMD_DEV_RESET 0x08
+ATA_CMD_REQ_SENSE_DATA 0x0B
+ATA_CMD_RESTORE 0x10
+ATA_CMD_PIO_READ 0x20
+ATA_CMD_READ_LONG 0x22
+ATA_CMD_READ_LONG_ONCE 0x23
+ATA_CMD_PIO_READ_EXT 0x24
+ATA_CMD_READ_EXT 0x25
+ATA_CMD_READ_QUEUED 0x26
+ATA_CMD_READ_NATIVE_MAX_EXT 0x27
+ATA_CMD_READ_MULTI_EXT 0x29
+ATA_CMD_READ_STREAM_DMA_EXT 0x2A
+ATA_CMD_READ_STREAM_EXT 0x2B
+ATA_CMD_READ_LOG_EXT 0x2F
+ATA_CMD_PIO_WRITE 0x30
+ATA_CMD_WRITE_LONG 0x32
+ATA_CMD_WRITE_LONG_ONCE 0x33
+ATA_CMD_PIO_WRITE_EXT 0x34
+ATA_CMD_WRITE_EXT 0x35
+ATA_CMD_WRITE_QUEUED 0x36
+ATA_CMD_SET_MAX_EXT 0x37
+ATA_CMD_CFA_WRITE_NE 0x38
+ATA_CMD_WRITE_MULTI_EXT 0x39
+ATA_CMD_WRITE_STREAM_DMA_EXT 0x3A
+ATA_CMD_WRITE_STREAM_EXT 0x3B
+ATA_CMD_WRITE_FUA_EXT 0x3D
+ATA_CMD_WRITE_QUEUED_FUA_EXT 0x3E
+ATA_CMD_WRITE_LOG_EXT 0x3F
+ATA_CMD_VERIFY 0x40
+ATA_CMD_VERIFY_EXT 0x42
+ATA_CMD_WRITE_UNCORR_EXT 0x45
+ATA_CMD_READ_LOG_DMA_EXT 0x47
+ATA_CMD_ZAC_MGMT_IN 0x4A
+ATA_CMD_CONFIG_STREAM 0x51
+ATA_CMD_WRITE_LOG_DMA_EXT 0x57
+ATA_CMD_TRUSTED_NONDATA 0x5B
+ATA_CMD_TRUSTED_RCV 0x5C
+ATA_CMD_TRUSTED_RCV_DMA 0x5D
+ATA_CMD_TRUSTED_SND 0x5E
+ATA_CMD_TRUSTED_SND_DMA 0x5F
+ATA_CMD_FPDMA_READ 0x60
+ATA_CMD_FPDMA_WRITE 0x61
+ATA_CMD_NCQ_NON_DATA 0x63
+ATA_CMD_FPDMA_SEND 0x64
+ATA_CMD_FPDMA_RECV 0x65
+ATA_CMD_CFA_TRANS_SECT 0x87
+ATA_CMD_EDD 0x90
+ATA_CMD_INIT_DEV_PARAMS 0x91
+ATA_CMD_DOWNLOAD_MICRO 0x92
+ATA_CMD_DOWNLOAD_MICRO_DMA 0x93
+ATA_CMD_ZAC_MGMT_OUT 0x9F
+ATA_CMD_PACKET 0xA0
+ATA_CMD_ID_ATAPI 0xA1
+ATA_CMD_SERVICE 0xA2
+ATA_CMD_SMART 0xB0
+ATA_CMD_CONF_OVERLAY 0xB1
+ATA_CMD_SANITIZE_DEVICE 0xB4
+ATA_CMD_CFA_ERASE 0xC0
+ATA_CMD_READ_MULTI 0xC4
+ATA_CMD_WRITE_MULTI 0xC5
+ATA_CMD_SET_MULTI 0xC6
+ATA_CMD_READ 0xC8
+ATA_CMD_WRITE 0xCA
+ATA_CMD_CFA_WRITE_MULT_NE 0xCD
+ATA_CMD_WRITE_MULTI_FUA_EXT 0xCE
+ATA_CMD_CHK_MED_CRD_TYP 0xD1
+ATA_CMD_MEDIA_LOCK 0xDE
+ATA_CMD_MEDIA_UNLOCK 0xDF
+ATA_CMD_STANDBYNOW1 0xE0
+ATA_CMD_IDLEIMMEDIATE 0xE1
+ATA_CMD_STANDBY 0xE2
+ATA_CMD_IDLE 0xE3
+ATA_CMD_PMP_READ 0xE4
+ATA_CMD_CHK_POWER 0xE5
+ATA_CMD_SLEEP 0xE6
+ATA_CMD_FLUSH 0xE7
+ATA_CMD_PMP_WRITE 0xE8
+ATA_CMD_PMP_READ_DMA 0xE9
+ATA_CMD_FLUSH_EXT 0xEA
+ATA_CMD_PMP_WRITE_DMA 0xEB
+ATA_CMD_ID_ATA 0xEC
+ATA_CMD_SET_FEATURES 0xEF
+ATA_CMD_SEC_SET_PASS 0xF1
+ATA_CMD_SEC_UNLOCK 0xF2
+ATA_CMD_SEC_ERASE_PREP 0xF3
+ATA_CMD_SEC_ERASE_UNIT 0xF4
+ATA_CMD_SEC_FREEZE_LOCK 0xF5
+ATA_CMD_SEC_DISABLE_PASS 0xF6
+ATA_CMD_READ_NATIVE_MAX 0xF8
+ATA_CMD_SET_MAX 0xF9
diff --git a/src/xlat/hw_breakpoint_len.in b/src/xlat/hw_breakpoint_len.in
new file mode 100644
index 000000000..f2b91a033
--- /dev/null
+++ b/src/xlat/hw_breakpoint_len.in
@@ -0,0 +1,4 @@
+HW_BREAKPOINT_LEN_1 1
+HW_BREAKPOINT_LEN_2 2
+HW_BREAKPOINT_LEN_4 4
+HW_BREAKPOINT_LEN_8 8
diff --git a/src/xlat/hw_breakpoint_type.in b/src/xlat/hw_breakpoint_type.in
new file mode 100644
index 000000000..4ffcaae13
--- /dev/null
+++ b/src/xlat/hw_breakpoint_type.in
@@ -0,0 +1,6 @@
+#sorted sort -k2,2n
+HW_BREAKPOINT_EMPTY 0
+HW_BREAKPOINT_R 1
+HW_BREAKPOINT_W 2
+HW_BREAKPOINT_RW 3
+HW_BREAKPOINT_X 4
diff --git a/src/xlat/icmpfilterflags.in b/src/xlat/icmpfilterflags.in
new file mode 100644
index 000000000..dac579edb
--- /dev/null
+++ b/src/xlat/icmpfilterflags.in
@@ -0,0 +1,13 @@
+1<<ICMP_ECHOREPLY
+1<<ICMP_DEST_UNREACH
+1<<ICMP_SOURCE_QUENCH
+1<<ICMP_REDIRECT
+1<<ICMP_ECHO
+1<<ICMP_TIME_EXCEEDED
+1<<ICMP_PARAMETERPROB
+1<<ICMP_TIMESTAMP
+1<<ICMP_TIMESTAMPREPLY
+1<<ICMP_INFO_REQUEST
+1<<ICMP_INFO_REPLY
+1<<ICMP_ADDRESS
+1<<ICMP_ADDRESSREPLY
diff --git a/src/xlat/if_dqblk_valid.in b/src/xlat/if_dqblk_valid.in
new file mode 100644
index 000000000..2b3ea549c
--- /dev/null
+++ b/src/xlat/if_dqblk_valid.in
@@ -0,0 +1,6 @@
+QIF_BLIMITS (1 << 0)
+QIF_SPACE (1 << 1)
+QIF_ILIMITS (1 << 2)
+QIF_INODES (1 << 3)
+QIF_BTIME (1 << 4)
+QIF_ITIME (1 << 5)
diff --git a/src/xlat/if_dqinfo_flags.in b/src/xlat/if_dqinfo_flags.in
new file mode 100644
index 000000000..914532c13
--- /dev/null
+++ b/src/xlat/if_dqinfo_flags.in
@@ -0,0 +1,2 @@
+DQF_ROOT_SQUASH (1 << 0)
+DQF_SYS_FILE (1 << 16)
diff --git a/src/xlat/if_dqinfo_valid.in b/src/xlat/if_dqinfo_valid.in
new file mode 100644
index 000000000..7d6eca685
--- /dev/null
+++ b/src/xlat/if_dqinfo_valid.in
@@ -0,0 +1,3 @@
+IIF_BGRACE (1 << 0)
+IIF_IGRACE (1 << 1)
+IIF_FLAGS (1 << 2)
diff --git a/src/xlat/ifaddrflags.in b/src/xlat/ifaddrflags.in
new file mode 100644
index 000000000..19df46b18
--- /dev/null
+++ b/src/xlat/ifaddrflags.in
@@ -0,0 +1,12 @@
+IFA_F_SECONDARY
+IFA_F_NODAD
+IFA_F_OPTIMISTIC
+IFA_F_DADFAILED
+IFA_F_HOMEADDRESS
+IFA_F_DEPRECATED
+IFA_F_TENTATIVE
+IFA_F_PERMANENT
+IFA_F_MANAGETEMPADDR
+IFA_F_NOPREFIXROUTE
+IFA_F_MCAUTOJOIN
+IFA_F_STABLE_PRIVACY
diff --git a/src/xlat/iffflags.in b/src/xlat/iffflags.in
new file mode 100644
index 000000000..53b552402
--- /dev/null
+++ b/src/xlat/iffflags.in
@@ -0,0 +1,20 @@
+#sorted sort -k4,4g
+IFF_UP (1 << 0)
+IFF_BROADCAST (1 << 1)
+IFF_DEBUG (1 << 2)
+IFF_LOOPBACK (1 << 3)
+IFF_POINTOPOINT (1 << 4)
+IFF_NOTRAILERS (1 << 5)
+IFF_RUNNING (1 << 6)
+IFF_NOARP (1 << 7)
+IFF_PROMISC (1 << 8)
+IFF_ALLMULTI (1 << 9)
+IFF_MASTER (1 << 10)
+IFF_SLAVE (1 << 11)
+IFF_MULTICAST (1 << 12)
+IFF_PORTSEL (1 << 13)
+IFF_AUTOMEDIA (1 << 14)
+IFF_DYNAMIC (1 << 15)
+IFF_LOWER_UP (1 << 16)
+IFF_DORMANT (1 << 17)
+IFF_ECHO (1 << 18)
diff --git a/src/xlat/in6_addr_gen_mode.in b/src/xlat/in6_addr_gen_mode.in
new file mode 100644
index 000000000..5d01a135a
--- /dev/null
+++ b/src/xlat/in6_addr_gen_mode.in
@@ -0,0 +1,5 @@
+#value_indexed
+IN6_ADDR_GEN_MODE_EUI64 0
+IN6_ADDR_GEN_MODE_NONE 1
+IN6_ADDR_GEN_MODE_STABLE_PRIVACY 2
+IN6_ADDR_GEN_MODE_RANDOM 3
diff --git a/src/xlat/inet6_devconf_indices.in b/src/xlat/inet6_devconf_indices.in
new file mode 100644
index 000000000..89efe7fbf
--- /dev/null
+++ b/src/xlat/inet6_devconf_indices.in
@@ -0,0 +1,52 @@
+#value_indexed
+DEVCONF_FORWARDING 0
+DEVCONF_HOPLIMIT 1
+DEVCONF_MTU6 2
+DEVCONF_ACCEPT_RA 3
+DEVCONF_ACCEPT_REDIRECTS 4
+DEVCONF_AUTOCONF 5
+DEVCONF_DAD_TRANSMITS 6
+DEVCONF_RTR_SOLICITS 7
+DEVCONF_RTR_SOLICIT_INTERVAL 8
+DEVCONF_RTR_SOLICIT_DELAY 9
+DEVCONF_USE_TEMPADDR 10
+DEVCONF_TEMP_VALID_LFT 11
+DEVCONF_TEMP_PREFERED_LFT 12
+DEVCONF_REGEN_MAX_RETRY 13
+DEVCONF_MAX_DESYNC_FACTOR 14
+DEVCONF_MAX_ADDRESSES 15
+DEVCONF_FORCE_MLD_VERSION 16
+DEVCONF_ACCEPT_RA_DEFRTR 17
+DEVCONF_ACCEPT_RA_PINFO 18
+DEVCONF_ACCEPT_RA_RTR_PREF 19
+DEVCONF_RTR_PROBE_INTERVAL 20
+DEVCONF_ACCEPT_RA_RT_INFO_MAX_PLEN 21
+DEVCONF_PROXY_NDP 22
+DEVCONF_OPTIMISTIC_DAD 23
+DEVCONF_ACCEPT_SOURCE_ROUTE 24
+DEVCONF_MC_FORWARDING 25
+DEVCONF_DISABLE_IPV6 26
+DEVCONF_ACCEPT_DAD 27
+DEVCONF_FORCE_TLLAO 28
+DEVCONF_NDISC_NOTIFY 29
+DEVCONF_MLDV1_UNSOLICITED_REPORT_INTERVAL 30
+DEVCONF_MLDV2_UNSOLICITED_REPORT_INTERVAL 31
+DEVCONF_SUPPRESS_FRAG_NDISC 32
+DEVCONF_ACCEPT_RA_FROM_LOCAL 33
+DEVCONF_USE_OPTIMISTIC 34
+DEVCONF_ACCEPT_RA_MTU 35
+DEVCONF_STABLE_SECRET 36
+DEVCONF_USE_OIF_ADDRS_ONLY 37
+DEVCONF_ACCEPT_RA_MIN_HOP_LIMIT 38
+DEVCONF_IGNORE_ROUTES_WITH_LINKDOWN 39
+DEVCONF_DROP_UNICAST_IN_L2_MULTICAST 40
+DEVCONF_DROP_UNSOLICITED_NA 41
+DEVCONF_KEEP_ADDR_ON_DOWN 42
+DEVCONF_RTR_SOLICIT_MAX_INTERVAL 43
+DEVCONF_SEG6_ENABLED 44
+DEVCONF_SEG6_REQUIRE_HMAC 45
+DEVCONF_ENHANCED_DAD 46
+DEVCONF_ADDR_GEN_MODE 47
+DEVCONF_DISABLE_POLICY 48
+DEVCONF_ACCEPT_RA_RT_INFO_MIN_PLEN 49
+DEVCONF_NDISC_TCLASS 50
diff --git a/src/xlat/inet6_if_flags.in b/src/xlat/inet6_if_flags.in
new file mode 100644
index 000000000..634c9ab21
--- /dev/null
+++ b/src/xlat/inet6_if_flags.in
@@ -0,0 +1,6 @@
+#sorted sort -k2,2g
+IF_RS_SENT 0x10
+IF_RA_RCVD 0x20
+IF_RA_MANAGED 0x40
+IF_RA_OTHERCONF 0x80
+IF_READY 0x80000000
diff --git a/src/xlat/inet_devconf_indices.in b/src/xlat/inet_devconf_indices.in
new file mode 100644
index 000000000..dd262370a
--- /dev/null
+++ b/src/xlat/inet_devconf_indices.in
@@ -0,0 +1,34 @@
+#value_indexed
+/* These fallback definitions are for constants, not for expressions. */
+IPV4_DEVCONF_FORWARDING-1 1
+IPV4_DEVCONF_MC_FORWARDING-1 2
+IPV4_DEVCONF_PROXY_ARP-1 3
+IPV4_DEVCONF_ACCEPT_REDIRECTS-1 4
+IPV4_DEVCONF_SECURE_REDIRECTS-1 5
+IPV4_DEVCONF_SEND_REDIRECTS-1 6
+IPV4_DEVCONF_SHARED_MEDIA-1 7
+IPV4_DEVCONF_RP_FILTER-1 8
+IPV4_DEVCONF_ACCEPT_SOURCE_ROUTE-1 9
+IPV4_DEVCONF_BOOTP_RELAY-1 10
+IPV4_DEVCONF_LOG_MARTIANS-1 11
+IPV4_DEVCONF_TAG-1 12
+IPV4_DEVCONF_ARPFILTER-1 13
+IPV4_DEVCONF_MEDIUM_ID-1 14
+IPV4_DEVCONF_NOXFRM-1 15
+IPV4_DEVCONF_NOPOLICY-1 16
+IPV4_DEVCONF_FORCE_IGMP_VERSION-1 17
+IPV4_DEVCONF_ARP_ANNOUNCE-1 18
+IPV4_DEVCONF_ARP_IGNORE-1 19
+IPV4_DEVCONF_PROMOTE_SECONDARIES-1 20
+IPV4_DEVCONF_ARP_ACCEPT-1 21
+IPV4_DEVCONF_ARP_NOTIFY-1 22
+IPV4_DEVCONF_ACCEPT_LOCAL-1 23
+IPV4_DEVCONF_SRC_VMARK-1 24
+IPV4_DEVCONF_PROXY_ARP_PVLAN-1 25
+IPV4_DEVCONF_ROUTE_LOCALNET-1 26
+IPV4_DEVCONF_IGMPV2_UNSOLICITED_REPORT_INTERVAL-1 27
+IPV4_DEVCONF_IGMPV3_UNSOLICITED_REPORT_INTERVAL-1 28
+IPV4_DEVCONF_IGNORE_ROUTES_WITH_LINKDOWN-1 29
+IPV4_DEVCONF_DROP_UNICAST_IN_L2_MULTICAST-1 30
+IPV4_DEVCONF_DROP_GRATUITOUS_ARP-1 31
+IPV4_DEVCONF_BC_FORWARDING-1 32
diff --git a/src/xlat/inet_diag_attrs.in b/src/xlat/inet_diag_attrs.in
new file mode 100644
index 000000000..dd0ae78b5
--- /dev/null
+++ b/src/xlat/inet_diag_attrs.in
@@ -0,0 +1,25 @@
+#unconditional
+#value_indexed
+INET_DIAG_NONE
+INET_DIAG_MEMINFO
+INET_DIAG_INFO
+INET_DIAG_VEGASINFO
+INET_DIAG_CONG
+INET_DIAG_TOS
+INET_DIAG_TCLASS
+INET_DIAG_SKMEMINFO
+INET_DIAG_SHUTDOWN
+INET_DIAG_DCTCPINFO
+INET_DIAG_PROTOCOL
+INET_DIAG_SKV6ONLY
+INET_DIAG_LOCALS
+INET_DIAG_PEERS
+INET_DIAG_PAD
+INET_DIAG_MARK
+INET_DIAG_BBRINFO
+INET_DIAG_CLASS_ID
+INET_DIAG_MD5SIG
+INET_DIAG_ULP_INFO
+INET_DIAG_SK_BPF_STORAGES
+INET_DIAG_CGROUP_ID
+INET_DIAG_SOCKOPT
diff --git a/src/xlat/inet_diag_bytecodes.in b/src/xlat/inet_diag_bytecodes.in
new file mode 100644
index 000000000..d9f1eb57d
--- /dev/null
+++ b/src/xlat/inet_diag_bytecodes.in
@@ -0,0 +1,16 @@
+#unconditional
+#value_indexed
+INET_DIAG_BC_NOP
+INET_DIAG_BC_JMP
+INET_DIAG_BC_S_GE
+INET_DIAG_BC_S_LE
+INET_DIAG_BC_D_GE
+INET_DIAG_BC_D_LE
+INET_DIAG_BC_AUTO
+INET_DIAG_BC_S_COND
+INET_DIAG_BC_D_COND
+INET_DIAG_BC_DEV_COND
+INET_DIAG_BC_MARK_COND
+INET_DIAG_BC_S_EQ
+INET_DIAG_BC_D_EQ
+INET_DIAG_BC_CGROUP_COND
diff --git a/src/xlat/inet_diag_extended_flags.in b/src/xlat/inet_diag_extended_flags.in
new file mode 100644
index 000000000..eeaa367d3
--- /dev/null
+++ b/src/xlat/inet_diag_extended_flags.in
@@ -0,0 +1,23 @@
+#unconditional
+1<<(INET_DIAG_MEMINFO-1)
+1<<(INET_DIAG_INFO-1)
+1<<(INET_DIAG_VEGASINFO-1)
+1<<(INET_DIAG_CONG-1)
+1<<(INET_DIAG_TOS-1)
+1<<(INET_DIAG_TCLASS-1)
+1<<(INET_DIAG_SKMEMINFO-1)
+1<<(INET_DIAG_SHUTDOWN-1)
+1<<(INET_DIAG_DCTCPINFO-1)
+1<<(INET_DIAG_PROTOCOL-1)
+1<<(INET_DIAG_SKV6ONLY-1)
+1<<(INET_DIAG_LOCALS-1)
+1<<(INET_DIAG_PEERS-1)
+1<<(INET_DIAG_PAD-1)
+1<<(INET_DIAG_MARK-1)
+1<<(INET_DIAG_BBRINFO-1)
+1<<(INET_DIAG_CLASS_ID-1)
+1<<(INET_DIAG_MD5SIG-1)
+1<<(INET_DIAG_ULP_INFO-1)
+1<<(INET_DIAG_SK_BPF_STORAGES-1)
+1<<(INET_DIAG_CGROUP_ID-1)
+1<<(INET_DIAG_SOCKOPT-1)
diff --git a/src/xlat/inet_diag_req_attrs.in b/src/xlat/inet_diag_req_attrs.in
new file mode 100644
index 000000000..26690d3db
--- /dev/null
+++ b/src/xlat/inet_diag_req_attrs.in
@@ -0,0 +1,6 @@
+#unconditional
+#value_indexed
+INET_DIAG_REQ_NONE
+INET_DIAG_REQ_BYTECODE
+INET_DIAG_REQ_SK_BPF_STORAGES
+INET_DIAG_REQ_PROTOCOL
diff --git a/src/xlat/inet_protocols.in b/src/xlat/inet_protocols.in
new file mode 100644
index 000000000..89aa56ac4
--- /dev/null
+++ b/src/xlat/inet_protocols.in
@@ -0,0 +1,35 @@
+#sorted sort -k2,2n
+IPPROTO_IP 0
+IPPROTO_ICMP 1
+IPPROTO_IGMP 2
+IPPROTO_IPIP 4
+IPPROTO_TCP 6
+IPPROTO_EGP 8
+IPPROTO_PUP 12
+IPPROTO_UDP 17
+IPPROTO_IDP 22
+IPPROTO_TP 29
+IPPROTO_DCCP 33
+IPPROTO_IPV6 41
+IPPROTO_ROUTING 43
+IPPROTO_FRAGMENT 44
+IPPROTO_RSVP 46
+IPPROTO_GRE 47
+IPPROTO_ESP 50
+IPPROTO_AH 51
+IPPROTO_ICMPV6 58
+IPPROTO_NONE 59
+IPPROTO_DSTOPTS 60
+IPPROTO_MTP 92
+IPPROTO_BEETPH 94
+IPPROTO_ENCAP 98
+IPPROTO_PIM 103
+IPPROTO_COMP 108
+IPPROTO_L2TP 115
+IPPROTO_SCTP 132
+IPPROTO_MH 135
+IPPROTO_UDPLITE 136
+IPPROTO_MPLS 137
+IPPROTO_ETHERNET 143
+IPPROTO_RAW 255
+IPPROTO_MPTCP 262
diff --git a/src/xlat/inotify_flags.in b/src/xlat/inotify_flags.in
new file mode 100644
index 000000000..671bd0e69
--- /dev/null
+++ b/src/xlat/inotify_flags.in
@@ -0,0 +1,22 @@
+IN_ACCESS 0x00000001
+IN_MODIFY 0x00000002
+IN_ATTRIB 0x00000004
+IN_CLOSE_WRITE 0x00000008
+IN_CLOSE_NOWRITE 0x00000010
+IN_OPEN 0x00000020
+IN_MOVED_FROM 0x00000040
+IN_MOVED_TO 0x00000080
+IN_CREATE 0x00000100
+IN_DELETE 0x00000200
+IN_DELETE_SELF 0x00000400
+IN_MOVE_SELF 0x00000800
+IN_UNMOUNT 0x00002000
+IN_Q_OVERFLOW 0x00004000
+IN_IGNORED 0x00008000
+IN_ONLYDIR 0x01000000
+IN_DONT_FOLLOW 0x02000000
+IN_EXCL_UNLINK 0x04000000
+IN_MASK_CREATE 0x10000000
+IN_MASK_ADD 0x20000000
+IN_ISDIR 0x40000000
+IN_ONESHOT 0x80000000
diff --git a/src/xlat/inotify_init_flags.in b/src/xlat/inotify_init_flags.in
new file mode 100644
index 000000000..163fb8f7e
--- /dev/null
+++ b/src/xlat/inotify_init_flags.in
@@ -0,0 +1,4 @@
+IN_NONBLOCK O_NONBLOCK
+#if defined IN_CLOEXEC || defined O_CLOEXEC
+IN_CLOEXEC O_CLOEXEC
+#endif
diff --git a/src/xlat/ioctl_dirs.in b/src/xlat/ioctl_dirs.in
new file mode 100644
index 000000000..c069dd735
--- /dev/null
+++ b/src/xlat/ioctl_dirs.in
@@ -0,0 +1,3 @@
+_IOC_NONE
+_IOC_READ
+_IOC_WRITE
diff --git a/src/xlat/ioprio_class.in b/src/xlat/ioprio_class.in
new file mode 100644
index 000000000..dafd17427
--- /dev/null
+++ b/src/xlat/ioprio_class.in
@@ -0,0 +1,5 @@
+#value_indexed
+IOPRIO_CLASS_NONE 0
+IOPRIO_CLASS_RT 1
+IOPRIO_CLASS_BE 2
+IOPRIO_CLASS_IDLE 3
diff --git a/src/xlat/ioprio_who.in b/src/xlat/ioprio_who.in
new file mode 100644
index 000000000..2c2f4521d
--- /dev/null
+++ b/src/xlat/ioprio_who.in
@@ -0,0 +1,4 @@
+#value_indexed
+IOPRIO_WHO_PROCESS 1
+IOPRIO_WHO_PGRP 2
+IOPRIO_WHO_USER 3
diff --git a/src/xlat/ip_cmsg_types.in b/src/xlat/ip_cmsg_types.in
new file mode 100644
index 000000000..1bc81f496
--- /dev/null
+++ b/src/xlat/ip_cmsg_types.in
@@ -0,0 +1,9 @@
+IP_TOS 1
+IP_TTL 2
+IP_RECVOPTS 6
+IP_RETOPTS 7
+IP_PKTINFO 8
+IP_RECVERR 11
+IP_ORIGDSTADDR 20
+IP_CHECKSUM 23
+SCM_SECURITY
diff --git a/src/xlat/ip_type_of_services.in b/src/xlat/ip_type_of_services.in
new file mode 100644
index 000000000..41c526a12
--- /dev/null
+++ b/src/xlat/ip_type_of_services.in
@@ -0,0 +1,4 @@
+IPTOS_LOWDELAY
+IPTOS_THROUGHPUT
+IPTOS_RELIABILITY
+IPTOS_MINCOST
diff --git a/src/xlat/ipc_msg_flags.in b/src/xlat/ipc_msg_flags.in
new file mode 100644
index 000000000..c49392518
--- /dev/null
+++ b/src/xlat/ipc_msg_flags.in
@@ -0,0 +1,4 @@
+MSG_NOERROR 010000
+MSG_EXCEPT 020000
+MSG_COPY 040000
+IPC_NOWAIT 004000
diff --git a/src/xlat/ipc_private.in b/src/xlat/ipc_private.in
new file mode 100644
index 000000000..b3b233be5
--- /dev/null
+++ b/src/xlat/ipc_private.in
@@ -0,0 +1 @@
+IPC_PRIVATE 0
diff --git a/src/xlat/ipccalls.in b/src/xlat/ipccalls.in
new file mode 100644
index 000000000..b338678dc
--- /dev/null
+++ b/src/xlat/ipccalls.in
@@ -0,0 +1,12 @@
+SEMOP 1
+SEMGET 2
+SEMCTL 3
+SEMTIMEDOP 4
+MSGSND 11
+MSGRCV 12
+MSGGET 13
+MSGCTL 14
+SHMAT 21
+SHMDT 22
+SHMGET 23
+SHMCTL 24
diff --git a/src/xlat/irda_protocols.in b/src/xlat/irda_protocols.in
new file mode 100644
index 000000000..e3cd40f64
--- /dev/null
+++ b/src/xlat/irda_protocols.in
@@ -0,0 +1,3 @@
+#value_indexed
+IRDAPROTO_UNITDATA 0
+IRDAPROTO_ULTRA 1
diff --git a/src/xlat/isdn_protocols.in b/src/xlat/isdn_protocols.in
new file mode 100644
index 000000000..a1936077f
--- /dev/null
+++ b/src/xlat/isdn_protocols.in
@@ -0,0 +1,19 @@
+ISDN_P_BASE 0
+ISDN_P_TE_S0 1
+ISDN_P_NT_S0 2
+ISDN_P_TE_E1 3
+ISDN_P_NT_E1 4
+ISDN_P_LAPD_TE 0x10
+ISDN_P_LAPD_NT 0x11
+ISDN_P_B_RAW 0x21
+ISDN_P_B_HDLC 0x22
+ISDN_P_B_X75SLP 0x23
+ISDN_P_B_L2DTMF 0x24
+ISDN_P_B_L2DSP 0x25
+ISDN_P_B_L2DSPHDLC 0x26
+/*
+ * those two are present in include/linux/mISDNif.h but are not handled during
+ * socket creation.
+ */
+/* ISDN_P_B_T30_FAX 0x27 */
+/* ISDN_P_B_MODEM_ASYNC 0x28 */
diff --git a/src/xlat/itimer_which.in b/src/xlat/itimer_which.in
new file mode 100644
index 000000000..23635a23a
--- /dev/null
+++ b/src/xlat/itimer_which.in
@@ -0,0 +1,4 @@
+#value_indexed
+ITIMER_REAL 0
+ITIMER_VIRTUAL 1
+ITIMER_PROF 2
diff --git a/src/xlat/kcm_protocols.in b/src/xlat/kcm_protocols.in
new file mode 100644
index 000000000..0001455dc
--- /dev/null
+++ b/src/xlat/kcm_protocols.in
@@ -0,0 +1,2 @@
+#value_indexed
+KCMPROTO_CONNECTED 0
diff --git a/src/xlat/kcmp_types.in b/src/xlat/kcmp_types.in
new file mode 100644
index 000000000..66f379250
--- /dev/null
+++ b/src/xlat/kcmp_types.in
@@ -0,0 +1,9 @@
+#value_indexed
+KCMP_FILE 0
+KCMP_VM 1
+KCMP_FILES 2
+KCMP_FS 3
+KCMP_SIGHAND 4
+KCMP_IO 5
+KCMP_SYSVSEM 6
+KCMP_EPOLL_TFD 7
diff --git a/src/xlat/kexec_arch_values.in b/src/xlat/kexec_arch_values.in
new file mode 100644
index 000000000..5106f34dd
--- /dev/null
+++ b/src/xlat/kexec_arch_values.in
@@ -0,0 +1,14 @@
+KEXEC_ARCH_DEFAULT ( 0 << 16)
+KEXEC_ARCH_386 ( 3 << 16)
+KEXEC_ARCH_68K ( 4 << 16)
+KEXEC_ARCH_PARISC ( 15 << 16)
+KEXEC_ARCH_X86_64 ( 62 << 16)
+KEXEC_ARCH_PPC ( 20 << 16)
+KEXEC_ARCH_PPC64 ( 21 << 16)
+KEXEC_ARCH_IA_64 ( 50 << 16)
+KEXEC_ARCH_ARM ( 40 << 16)
+KEXEC_ARCH_S390 ( 22 << 16)
+KEXEC_ARCH_SH ( 42 << 16)
+KEXEC_ARCH_MIPS_LE ( 10 << 16)
+KEXEC_ARCH_MIPS ( 8 << 16)
+KEXEC_ARCH_AARCH64 (183 << 16)
diff --git a/src/xlat/kexec_file_load_flags.in b/src/xlat/kexec_file_load_flags.in
new file mode 100644
index 000000000..3ca755298
--- /dev/null
+++ b/src/xlat/kexec_file_load_flags.in
@@ -0,0 +1,3 @@
+KEXEC_FILE_UNLOAD 1
+KEXEC_FILE_ON_CRASH 2
+KEXEC_FILE_NO_INITRAMFS 4
diff --git a/src/xlat/kexec_load_flags.in b/src/xlat/kexec_load_flags.in
new file mode 100644
index 000000000..4fa8b68b3
--- /dev/null
+++ b/src/xlat/kexec_load_flags.in
@@ -0,0 +1,2 @@
+KEXEC_ON_CRASH 0x00000001
+KEXEC_PRESERVE_CONTEXT 0x00000002
diff --git a/src/xlat/key_perms.in b/src/xlat/key_perms.in
new file mode 100644
index 000000000..c96a9ed99
--- /dev/null
+++ b/src/xlat/key_perms.in
@@ -0,0 +1,28 @@
+KEY_POS_VIEW 0x01000000
+KEY_POS_READ 0x02000000
+KEY_POS_WRITE 0x04000000
+KEY_POS_SEARCH 0x08000000
+KEY_POS_LINK 0x10000000
+KEY_POS_SETATTR 0x20000000
+KEY_POS_ALL 0x3f000000
+KEY_USR_VIEW 0x00010000
+KEY_USR_READ 0x00020000
+KEY_USR_WRITE 0x00040000
+KEY_USR_SEARCH 0x00080000
+KEY_USR_LINK 0x00100000
+KEY_USR_SETATTR 0x00200000
+KEY_USR_ALL 0x003f0000
+KEY_GRP_VIEW 0x00000100
+KEY_GRP_READ 0x00000200
+KEY_GRP_WRITE 0x00000400
+KEY_GRP_SEARCH 0x00000800
+KEY_GRP_LINK 0x00001000
+KEY_GRP_SETATTR 0x00002000
+KEY_GRP_ALL 0x00003f00
+KEY_OTH_VIEW 0x00000001
+KEY_OTH_READ 0x00000002
+KEY_OTH_WRITE 0x00000004
+KEY_OTH_SEARCH 0x00000008
+KEY_OTH_LINK 0x00000010
+KEY_OTH_SETATTR 0x00000020
+KEY_OTH_ALL 0x0000003f
diff --git a/src/xlat/key_reqkeys.in b/src/xlat/key_reqkeys.in
new file mode 100644
index 000000000..ca60ca69f
--- /dev/null
+++ b/src/xlat/key_reqkeys.in
@@ -0,0 +1,10 @@
+#val_type int
+KEY_REQKEY_DEFL_NO_CHANGE -1
+KEY_REQKEY_DEFL_DEFAULT 0
+KEY_REQKEY_DEFL_THREAD_KEYRING 1
+KEY_REQKEY_DEFL_PROCESS_KEYRING 2
+KEY_REQKEY_DEFL_SESSION_KEYRING 3
+KEY_REQKEY_DEFL_USER_KEYRING 4
+KEY_REQKEY_DEFL_USER_SESSION_KEYRING 5
+KEY_REQKEY_DEFL_GROUP_KEYRING 6
+KEY_REQKEY_DEFL_REQUESTOR_KEYRING 7
diff --git a/src/xlat/key_spec.in b/src/xlat/key_spec.in
new file mode 100644
index 000000000..02d9ee044
--- /dev/null
+++ b/src/xlat/key_spec.in
@@ -0,0 +1,9 @@
+#val_type int
+KEY_SPEC_THREAD_KEYRING -1
+KEY_SPEC_PROCESS_KEYRING -2
+KEY_SPEC_SESSION_KEYRING -3
+KEY_SPEC_USER_KEYRING -4
+KEY_SPEC_USER_SESSION_KEYRING -5
+KEY_SPEC_GROUP_KEYRING -6
+KEY_SPEC_REQKEY_AUTH_KEY -7
+KEY_SPEC_REQUESTOR_KEYRING -8
diff --git a/src/xlat/keyctl_caps0.in b/src/xlat/keyctl_caps0.in
new file mode 100644
index 000000000..e73505275
--- /dev/null
+++ b/src/xlat/keyctl_caps0.in
@@ -0,0 +1,8 @@
+KEYCTL_CAPS0_CAPABILITIES 0x01
+KEYCTL_CAPS0_PERSISTENT_KEYRINGS 0x02
+KEYCTL_CAPS0_DIFFIE_HELLMAN 0x04
+KEYCTL_CAPS0_PUBLIC_KEY 0x08
+KEYCTL_CAPS0_BIG_KEY 0x10
+KEYCTL_CAPS0_INVALIDATE 0x20
+KEYCTL_CAPS0_RESTRICT_KEYRING 0x40
+KEYCTL_CAPS0_MOVE 0x80
diff --git a/src/xlat/keyctl_caps1.in b/src/xlat/keyctl_caps1.in
new file mode 100644
index 000000000..3ee24ec9c
--- /dev/null
+++ b/src/xlat/keyctl_caps1.in
@@ -0,0 +1,3 @@
+KEYCTL_CAPS1_NS_KEYRING_NAME 0x01
+KEYCTL_CAPS1_NS_KEY_TAG 0x02
+KEYCTL_CAPS1_NOTIFICATIONS 0x04
diff --git a/src/xlat/keyctl_commands.in b/src/xlat/keyctl_commands.in
new file mode 100644
index 000000000..e3d82ff52
--- /dev/null
+++ b/src/xlat/keyctl_commands.in
@@ -0,0 +1,34 @@
+#value_indexed
+KEYCTL_GET_KEYRING_ID 0
+KEYCTL_JOIN_SESSION_KEYRING 1
+KEYCTL_UPDATE 2
+KEYCTL_REVOKE 3
+KEYCTL_CHOWN 4
+KEYCTL_SETPERM 5
+KEYCTL_DESCRIBE 6
+KEYCTL_CLEAR 7
+KEYCTL_LINK 8
+KEYCTL_UNLINK 9
+KEYCTL_SEARCH 10
+KEYCTL_READ 11
+KEYCTL_INSTANTIATE 12
+KEYCTL_NEGATE 13
+KEYCTL_SET_REQKEY_KEYRING 14
+KEYCTL_SET_TIMEOUT 15
+KEYCTL_ASSUME_AUTHORITY 16
+KEYCTL_GET_SECURITY 17
+KEYCTL_SESSION_TO_PARENT 18
+KEYCTL_REJECT 19
+KEYCTL_INSTANTIATE_IOV 20
+KEYCTL_INVALIDATE 21
+KEYCTL_GET_PERSISTENT 22
+KEYCTL_DH_COMPUTE 23
+KEYCTL_PKEY_QUERY 24
+KEYCTL_PKEY_ENCRYPT 25
+KEYCTL_PKEY_DECRYPT 26
+KEYCTL_PKEY_SIGN 27
+KEYCTL_PKEY_VERIFY 28
+KEYCTL_RESTRICT_KEYRING 29
+KEYCTL_MOVE 30
+KEYCTL_CAPABILITIES 31
+KEYCTL_WATCH_KEY 32
diff --git a/src/xlat/keyctl_move_flags.in b/src/xlat/keyctl_move_flags.in
new file mode 100644
index 000000000..6588e2cc8
--- /dev/null
+++ b/src/xlat/keyctl_move_flags.in
@@ -0,0 +1 @@
+KEYCTL_MOVE_EXCL 0x1
diff --git a/src/xlat/keyctl_pkey_ops.in b/src/xlat/keyctl_pkey_ops.in
new file mode 100644
index 000000000..d77f1dfeb
--- /dev/null
+++ b/src/xlat/keyctl_pkey_ops.in
@@ -0,0 +1,4 @@
+KEYCTL_SUPPORTS_ENCRYPT 0x01
+KEYCTL_SUPPORTS_DECRYPT 0x02
+KEYCTL_SUPPORTS_SIGN 0x04
+KEYCTL_SUPPORTS_VERIFY 0x08
diff --git a/src/xlat/kvm_cap.in b/src/xlat/kvm_cap.in
new file mode 100644
index 000000000..8cb9f5b0e
--- /dev/null
+++ b/src/xlat/kvm_cap.in
@@ -0,0 +1,186 @@
+#value_indexed
+KVM_CAP_IRQCHIP 0
+KVM_CAP_HLT 1
+KVM_CAP_MMU_SHADOW_CACHE_CONTROL 2
+KVM_CAP_USER_MEMORY 3
+KVM_CAP_SET_TSS_ADDR 4
+KVM_CAP_VAPIC 6
+KVM_CAP_EXT_CPUID 7
+KVM_CAP_CLOCKSOURCE 8
+KVM_CAP_NR_VCPUS 9
+KVM_CAP_NR_MEMSLOTS 10
+KVM_CAP_PIT 11
+KVM_CAP_NOP_IO_DELAY 12
+KVM_CAP_PV_MMU 13
+KVM_CAP_MP_STATE 14
+KVM_CAP_COALESCED_MMIO 15
+KVM_CAP_SYNC_MMU 16
+KVM_CAP_IOMMU 18
+KVM_CAP_DESTROY_MEMORY_REGION_WORKS 21
+KVM_CAP_USER_NMI 22
+KVM_CAP_SET_GUEST_DEBUG 23
+KVM_CAP_REINJECT_CONTROL 24
+KVM_CAP_IRQ_ROUTING 25
+KVM_CAP_IRQ_INJECT_STATUS 26
+KVM_CAP_ASSIGN_DEV_IRQ 29
+KVM_CAP_JOIN_MEMORY_REGIONS_WORKS 30
+KVM_CAP_MCE 31
+KVM_CAP_IRQFD 32
+KVM_CAP_PIT2 33
+KVM_CAP_SET_BOOT_CPU_ID 34
+KVM_CAP_PIT_STATE2 35
+KVM_CAP_IOEVENTFD 36
+KVM_CAP_SET_IDENTITY_MAP_ADDR 37
+KVM_CAP_XEN_HVM 38
+KVM_CAP_ADJUST_CLOCK 39
+KVM_CAP_INTERNAL_ERROR_DATA 40
+KVM_CAP_VCPU_EVENTS 41
+KVM_CAP_S390_PSW 42
+KVM_CAP_PPC_SEGSTATE 43
+KVM_CAP_HYPERV 44
+KVM_CAP_HYPERV_VAPIC 45
+KVM_CAP_HYPERV_SPIN 46
+KVM_CAP_PCI_SEGMENT 47
+KVM_CAP_PPC_PAIRED_SINGLES 48
+KVM_CAP_INTR_SHADOW 49
+KVM_CAP_DEBUGREGS 50
+KVM_CAP_X86_ROBUST_SINGLESTEP 51
+KVM_CAP_PPC_OSI 52
+KVM_CAP_PPC_UNSET_IRQ 53
+KVM_CAP_ENABLE_CAP 54
+KVM_CAP_XSAVE 55
+KVM_CAP_XCRS 56
+KVM_CAP_PPC_GET_PVINFO 57
+KVM_CAP_PPC_IRQ_LEVEL 58
+KVM_CAP_ASYNC_PF 59
+KVM_CAP_TSC_CONTROL 60
+KVM_CAP_GET_TSC_KHZ 61
+KVM_CAP_PPC_BOOKE_SREGS 62
+KVM_CAP_SPAPR_TCE 63
+KVM_CAP_PPC_SMT 64
+KVM_CAP_PPC_RMA 65
+KVM_CAP_MAX_VCPUS 66
+KVM_CAP_PPC_HIOR 67
+KVM_CAP_PPC_PAPR 68
+KVM_CAP_SW_TLB 69
+KVM_CAP_ONE_REG 70
+KVM_CAP_S390_GMAP 71
+KVM_CAP_TSC_DEADLINE_TIMER 72
+KVM_CAP_S390_UCONTROL 73
+KVM_CAP_SYNC_REGS 74
+KVM_CAP_PCI_2_3 75
+KVM_CAP_KVMCLOCK_CTRL 76
+KVM_CAP_SIGNAL_MSI 77
+KVM_CAP_PPC_GET_SMMU_INFO 78
+KVM_CAP_S390_COW 79
+KVM_CAP_PPC_ALLOC_HTAB 80
+KVM_CAP_READONLY_MEM 81
+KVM_CAP_IRQFD_RESAMPLE 82
+KVM_CAP_PPC_BOOKE_WATCHDOG 83
+KVM_CAP_PPC_HTAB_FD 84
+KVM_CAP_S390_CSS_SUPPORT 85
+KVM_CAP_PPC_EPR 86
+KVM_CAP_ARM_PSCI 87
+KVM_CAP_ARM_SET_DEVICE_ADDR 88
+KVM_CAP_DEVICE_CTRL 89
+KVM_CAP_IRQ_MPIC 90
+KVM_CAP_PPC_RTAS 91
+KVM_CAP_IRQ_XICS 92
+KVM_CAP_ARM_EL1_32BIT 93
+KVM_CAP_SPAPR_MULTITCE 94
+KVM_CAP_EXT_EMUL_CPUID 95
+KVM_CAP_HYPERV_TIME 96
+KVM_CAP_IOAPIC_POLARITY_IGNORED 97
+KVM_CAP_ENABLE_CAP_VM 98
+KVM_CAP_S390_IRQCHIP 99
+KVM_CAP_IOEVENTFD_NO_LENGTH 100
+KVM_CAP_VM_ATTRIBUTES 101
+KVM_CAP_ARM_PSCI_0_2 102
+KVM_CAP_PPC_FIXUP_HCALL 103
+KVM_CAP_PPC_ENABLE_HCALL 104
+KVM_CAP_CHECK_EXTENSION_VM 105
+KVM_CAP_S390_USER_SIGP 106
+KVM_CAP_S390_VECTOR_REGISTERS 107
+KVM_CAP_S390_MEM_OP 108
+KVM_CAP_S390_USER_STSI 109
+KVM_CAP_S390_SKEYS 110
+KVM_CAP_MIPS_FPU 111
+KVM_CAP_MIPS_MSA 112
+KVM_CAP_S390_INJECT_IRQ 113
+KVM_CAP_S390_IRQ_STATE 114
+KVM_CAP_PPC_HWRNG 115
+KVM_CAP_DISABLE_QUIRKS 116
+KVM_CAP_X86_SMM 117
+KVM_CAP_MULTI_ADDRESS_SPACE 118
+KVM_CAP_GUEST_DEBUG_HW_BPS 119
+KVM_CAP_GUEST_DEBUG_HW_WPS 120
+KVM_CAP_SPLIT_IRQCHIP 121
+KVM_CAP_IOEVENTFD_ANY_LENGTH 122
+KVM_CAP_HYPERV_SYNIC 123
+KVM_CAP_S390_RI 124
+KVM_CAP_SPAPR_TCE_64 125
+KVM_CAP_ARM_PMU_V3 126
+KVM_CAP_VCPU_ATTRIBUTES 127
+KVM_CAP_MAX_VCPU_ID 128
+KVM_CAP_X2APIC_API 129
+KVM_CAP_S390_USER_INSTR0 130
+KVM_CAP_MSI_DEVID 131
+KVM_CAP_PPC_HTM 132
+KVM_CAP_SPAPR_RESIZE_HPT 133
+KVM_CAP_PPC_MMU_RADIX 134
+KVM_CAP_PPC_MMU_HASH_V3 135
+KVM_CAP_IMMEDIATE_EXIT 136
+KVM_CAP_MIPS_VZ 137
+KVM_CAP_MIPS_TE 138
+KVM_CAP_MIPS_64BIT 139
+KVM_CAP_S390_GS 140
+KVM_CAP_S390_AIS 141
+KVM_CAP_SPAPR_TCE_VFIO 142
+KVM_CAP_X86_DISABLE_EXITS 143
+KVM_CAP_ARM_USER_IRQ 144
+KVM_CAP_S390_CMMA_MIGRATION 145
+KVM_CAP_PPC_FWNMI 146
+KVM_CAP_PPC_SMT_POSSIBLE 147
+KVM_CAP_HYPERV_SYNIC2 148
+KVM_CAP_HYPERV_VP_INDEX 149
+KVM_CAP_S390_AIS_MIGRATION 150
+KVM_CAP_PPC_GET_CPU_CHAR 151
+KVM_CAP_S390_BPB 152
+KVM_CAP_GET_MSR_FEATURES 153
+KVM_CAP_HYPERV_EVENTFD 154
+KVM_CAP_HYPERV_TLBFLUSH 155
+KVM_CAP_S390_HPAGE_1M 156
+KVM_CAP_NESTED_STATE 157
+KVM_CAP_ARM_INJECT_SERROR_ESR 158
+KVM_CAP_MSR_PLATFORM_INFO 159
+KVM_CAP_PPC_NESTED_HV 160
+KVM_CAP_HYPERV_SEND_IPI 161
+KVM_CAP_COALESCED_PIO 162
+KVM_CAP_HYPERV_ENLIGHTENED_VMCS 163
+KVM_CAP_EXCEPTION_PAYLOAD 164
+KVM_CAP_ARM_VM_IPA_SIZE 165
+KVM_CAP_MANUAL_DIRTY_LOG_PROTECT 166
+KVM_CAP_HYPERV_CPUID 167
+KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2 168
+KVM_CAP_PPC_IRQ_XIVE 169
+KVM_CAP_ARM_SVE 170
+KVM_CAP_ARM_PTRAUTH_ADDRESS 171
+KVM_CAP_ARM_PTRAUTH_GENERIC 172
+KVM_CAP_PMU_EVENT_FILTER 173
+KVM_CAP_ARM_IRQ_LINE_LAYOUT_2 174
+KVM_CAP_HYPERV_DIRECT_TLBFLUSH 175
+KVM_CAP_PPC_GUEST_DEBUG_SSTEP 176
+KVM_CAP_ARM_NISV_TO_USER 177
+KVM_CAP_ARM_INJECT_EXT_DABT 178
+KVM_CAP_S390_VCPU_RESETS 179
+KVM_CAP_S390_PROTECTED 180
+KVM_CAP_PPC_SECURE_GUEST 181
+KVM_CAP_HALT_POLL 182
+KVM_CAP_ASYNC_PF_INT 183
+KVM_CAP_LAST_CPU 184
+KVM_CAP_SMALLER_MAXPHYADDR 185
+KVM_CAP_S390_DIAG318 186
+KVM_CAP_STEAL_TIME 187
+KVM_CAP_X86_USER_SPACE_MSR 188
+KVM_CAP_X86_MSR_FILTER 189
+KVM_CAP_ENFORCE_PV_FEATURE_CPUID 190
diff --git a/src/xlat/kvm_cpuid_flags.in b/src/xlat/kvm_cpuid_flags.in
new file mode 100644
index 000000000..43640b762
--- /dev/null
+++ b/src/xlat/kvm_cpuid_flags.in
@@ -0,0 +1,10 @@
+#ifndef BIT
+/*
+ * Workaround a bug in kernel headers fixed by linux commit v4.7-rc1~32^2~42.
+ */
+# define BIT(nr_) (1UL << (nr_))
+#endif
+
+KVM_CPUID_FLAG_SIGNIFCANT_INDEX (1 << 0)
+KVM_CPUID_FLAG_STATEFUL_FUNC (1 << 1)
+KVM_CPUID_FLAG_STATE_READ_NEXT (1 << 2)
diff --git a/src/xlat/kvm_exit_reason.in b/src/xlat/kvm_exit_reason.in
new file mode 100644
index 000000000..973c708ca
--- /dev/null
+++ b/src/xlat/kvm_exit_reason.in
@@ -0,0 +1,33 @@
+#value_indexed
+KVM_EXIT_UNKNOWN 0
+KVM_EXIT_EXCEPTION 1
+KVM_EXIT_IO 2
+KVM_EXIT_HYPERCALL 3
+KVM_EXIT_DEBUG 4
+KVM_EXIT_HLT 5
+KVM_EXIT_MMIO 6
+KVM_EXIT_IRQ_WINDOW_OPEN 7
+KVM_EXIT_SHUTDOWN 8
+KVM_EXIT_FAIL_ENTRY 9
+KVM_EXIT_INTR 10
+KVM_EXIT_SET_TPR 11
+KVM_EXIT_TPR_ACCESS 12
+KVM_EXIT_S390_SIEIC 13
+KVM_EXIT_S390_RESET 14
+/* deprecated */
+KVM_EXIT_DCR 15
+KVM_EXIT_NMI 16
+KVM_EXIT_INTERNAL_ERROR 17
+KVM_EXIT_OSI 18
+KVM_EXIT_PAPR_HCALL 19
+KVM_EXIT_S390_UCONTROL 20
+KVM_EXIT_WATCHDOG 21
+KVM_EXIT_S390_TSCH 22
+KVM_EXIT_EPR 23
+KVM_EXIT_SYSTEM_EVENT 24
+KVM_EXIT_S390_STSI 25
+KVM_EXIT_IOAPIC_EOI 26
+KVM_EXIT_HYPERV 27
+KVM_EXIT_ARM_NISV 28
+KVM_EXIT_X86_RDMSR 29
+KVM_EXIT_X86_WRMSR 30
diff --git a/src/xlat/kvm_mem_flags.in b/src/xlat/kvm_mem_flags.in
new file mode 100644
index 000000000..82b93ba77
--- /dev/null
+++ b/src/xlat/kvm_mem_flags.in
@@ -0,0 +1,2 @@
+KVM_MEM_LOG_DIRTY_PAGES (1 << 0)
+KVM_MEM_READONLY (1 << 1)
diff --git a/src/xlat/lockfcmds.in b/src/xlat/lockfcmds.in
new file mode 100644
index 000000000..2d65ba968
--- /dev/null
+++ b/src/xlat/lockfcmds.in
@@ -0,0 +1,5 @@
+F_RDLCK
+F_WRLCK
+F_UNLCK
+F_EXLCK
+F_SHLCK
diff --git a/src/xlat/loop_cmds.in b/src/xlat/loop_cmds.in
new file mode 100644
index 000000000..17cebe57e
--- /dev/null
+++ b/src/xlat/loop_cmds.in
@@ -0,0 +1,14 @@
+LOOP_SET_FD 0x4C00
+LOOP_CLR_FD 0x4C01
+LOOP_SET_STATUS 0x4C02
+LOOP_GET_STATUS 0x4C03
+LOOP_SET_STATUS64 0x4C04
+LOOP_GET_STATUS64 0x4C05
+LOOP_CHANGE_FD 0x4C06
+LOOP_SET_CAPACITY 0x4C07
+LOOP_SET_DIRECT_IO 0x4C08
+LOOP_SET_BLOCK_SIZE 0x4C09
+LOOP_CONFIGURE 0x4C0A
+LOOP_CTL_ADD 0x4C80
+LOOP_CTL_REMOVE 0x4C81
+LOOP_CTL_GET_FREE 0x4C82
diff --git a/src/xlat/loop_crypt_type_options.in b/src/xlat/loop_crypt_type_options.in
new file mode 100644
index 000000000..e9b7bddc5
--- /dev/null
+++ b/src/xlat/loop_crypt_type_options.in
@@ -0,0 +1,10 @@
+LO_CRYPT_NONE
+LO_CRYPT_XOR
+LO_CRYPT_DES
+LO_CRYPT_FISH2
+LO_CRYPT_BLOW
+LO_CRYPT_CAST128
+LO_CRYPT_IDEA
+LO_CRYPT_DUMMY
+LO_CRYPT_SKIPJACK
+LO_CRYPT_CRYPTOAPI
diff --git a/src/xlat/loop_flags_options.in b/src/xlat/loop_flags_options.in
new file mode 100644
index 000000000..03d11c4f3
--- /dev/null
+++ b/src/xlat/loop_flags_options.in
@@ -0,0 +1,11 @@
+#enum
+#include <linux/loop.h>
+LO_FLAGS_READ_ONLY 1
+/* Added in v2.6.11-732-gf3f28e4, Removed in v3.2-rc1~49^2~5^2~3 */
+LO_FLAGS_USE_AOPS 2
+/* Added in v2.6.25-rc1~758 */
+LO_FLAGS_AUTOCLEAR 4
+/* Added in v3.2-rc1~48^2~7 */
+LO_FLAGS_PARTSCAN 8
+/* Added in v4.4-rc1~133^2~22 */
+LO_FLAGS_DIRECT_IO 16
diff --git a/src/xlat/lwtunnel_encap_types.in b/src/xlat/lwtunnel_encap_types.in
new file mode 100644
index 000000000..90a31127d
--- /dev/null
+++ b/src/xlat/lwtunnel_encap_types.in
@@ -0,0 +1,10 @@
+#value_indexed
+LWTUNNEL_ENCAP_NONE 0
+LWTUNNEL_ENCAP_MPLS 1
+LWTUNNEL_ENCAP_IP 2
+LWTUNNEL_ENCAP_ILA 3
+LWTUNNEL_ENCAP_IP6 4
+LWTUNNEL_ENCAP_SEG6 5
+LWTUNNEL_ENCAP_BPF 6
+LWTUNNEL_ENCAP_SEG6_LOCAL 7
+LWTUNNEL_ENCAP_RPL 8
diff --git a/src/xlat/madvise_cmds.in b/src/xlat/madvise_cmds.in
new file mode 100644
index 000000000..3e8d63580
--- /dev/null
+++ b/src/xlat/madvise_cmds.in
@@ -0,0 +1,79 @@
+/* Generated by maint/gen_xlat_defs.sh -f 'd' -p 'MADV_' -c 'asm-generic/mman-common.h' -a 'asm/mman.h' */
+
+MADV_NORMAL 0
+
+MADV_RANDOM 1
+
+MADV_SEQUENTIAL 2
+
+MADV_WILLNEED 3
+
+#if defined __alpha__
+MADV_DONTNEED 6
+#else
+MADV_DONTNEED 4
+#endif
+
+MADV_FREE 8
+
+MADV_REMOVE 9
+
+MADV_DONTFORK 10
+
+MADV_DOFORK 11
+
+#if defined __hppa__
+MADV_MERGEABLE 65
+#else
+MADV_MERGEABLE 12
+#endif
+
+#if defined __hppa__
+MADV_UNMERGEABLE 66
+#else
+MADV_UNMERGEABLE 13
+#endif
+
+#if defined __hppa__
+MADV_HUGEPAGE 67
+#else
+MADV_HUGEPAGE 14
+#endif
+
+#if defined __hppa__
+MADV_NOHUGEPAGE 68
+#else
+MADV_NOHUGEPAGE 15
+#endif
+
+#if defined __hppa__
+MADV_DONTDUMP 69
+#else
+MADV_DONTDUMP 16
+#endif
+
+#if defined __hppa__
+MADV_DODUMP 70
+#else
+MADV_DODUMP 17
+#endif
+
+#if defined __hppa__
+MADV_WIPEONFORK 71
+#else
+MADV_WIPEONFORK 18
+#endif
+
+#if defined __hppa__
+MADV_KEEPONFORK 72
+#else
+MADV_KEEPONFORK 19
+#endif
+
+MADV_COLD 20
+
+MADV_PAGEOUT 21
+
+MADV_HWPOISON 100
+
+MADV_SOFT_OFFLINE 101
diff --git a/src/xlat/mbind_flags.in b/src/xlat/mbind_flags.in
new file mode 100644
index 000000000..04f3ae65b
--- /dev/null
+++ b/src/xlat/mbind_flags.in
@@ -0,0 +1,3 @@
+MPOL_MF_STRICT 1
+MPOL_MF_MOVE 2
+MPOL_MF_MOVE_ALL 4
diff --git a/src/xlat/mctl_sync.in b/src/xlat/mctl_sync.in
new file mode 100644
index 000000000..1db406897
--- /dev/null
+++ b/src/xlat/mctl_sync.in
@@ -0,0 +1,3 @@
+MS_SYNC
+MS_ASYNC
+MS_INVALIDATE
diff --git a/src/xlat/mdb_flags.in b/src/xlat/mdb_flags.in
new file mode 100644
index 000000000..b009cce5f
--- /dev/null
+++ b/src/xlat/mdb_flags.in
@@ -0,0 +1,4 @@
+MDB_FLAGS_OFFLOAD (1 << 0)
+MDB_FLAGS_FAST_LEAVE (1 << 1)
+MDB_FLAGS_STAR_EXCL (1 << 2)
+MDB_FLAGS_BLOCKED (1 << 3)
diff --git a/src/xlat/mdb_states.in b/src/xlat/mdb_states.in
new file mode 100644
index 000000000..7a580b901
--- /dev/null
+++ b/src/xlat/mdb_states.in
@@ -0,0 +1,2 @@
+MDB_TEMPORARY
+MDB_PERMANENT
diff --git a/src/xlat/membarrier_cmds.in b/src/xlat/membarrier_cmds.in
new file mode 100644
index 000000000..cfa683328
--- /dev/null
+++ b/src/xlat/membarrier_cmds.in
@@ -0,0 +1,10 @@
+MEMBARRIER_CMD_QUERY 0
+MEMBARRIER_CMD_GLOBAL (1 << 0)
+MEMBARRIER_CMD_GLOBAL_EXPEDITED (1 << 1)
+MEMBARRIER_CMD_REGISTER_GLOBAL_EXPEDITED (1 << 2)
+MEMBARRIER_CMD_PRIVATE_EXPEDITED (1 << 3)
+MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED (1 << 4)
+MEMBARRIER_CMD_PRIVATE_EXPEDITED_SYNC_CORE (1 << 5)
+MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_SYNC_CORE (1 << 6)
+MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ (1 << 7)
+MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_RSEQ (1 << 8)
diff --git a/src/xlat/membarrier_flags.in b/src/xlat/membarrier_flags.in
new file mode 100644
index 000000000..3987d4160
--- /dev/null
+++ b/src/xlat/membarrier_flags.in
@@ -0,0 +1 @@
+MEMBARRIER_CMD_FLAG_CPU (1 << 0)
diff --git a/src/xlat/memfd_create_flags.in b/src/xlat/memfd_create_flags.in
new file mode 100644
index 000000000..9dd625fb1
--- /dev/null
+++ b/src/xlat/memfd_create_flags.in
@@ -0,0 +1,3 @@
+MFD_CLOEXEC 1
+MFD_ALLOW_SEALING 2
+MFD_HUGETLB 4
diff --git a/src/xlat/mlock_flags.in b/src/xlat/mlock_flags.in
new file mode 100644
index 000000000..b285e673c
--- /dev/null
+++ b/src/xlat/mlock_flags.in
@@ -0,0 +1 @@
+MLOCK_ONFAULT 1
diff --git a/src/xlat/mlockall_flags.in b/src/xlat/mlockall_flags.in
new file mode 100644
index 000000000..d9ad7afdb
--- /dev/null
+++ b/src/xlat/mlockall_flags.in
@@ -0,0 +1,9 @@
+#if defined __alpha__ || defined __powerpc__ || defined __powerpc64__ || defined __sparc__
+MCL_CURRENT 0x2000
+MCL_FUTURE 0x4000
+MCL_ONFAULT 0x8000
+#else
+MCL_CURRENT 1
+MCL_FUTURE 2
+MCL_ONFAULT 4
+#endif
diff --git a/src/xlat/mmap_flags.in b/src/xlat/mmap_flags.in
new file mode 100644
index 000000000..0fb824030
--- /dev/null
+++ b/src/xlat/mmap_flags.in
@@ -0,0 +1,192 @@
+/* Generated by maint/gen_xlat_defs.sh -f '#x' -p '_?MAP_' -c '[al]*/mman*.h' -a 'asm/mman.h' */
+
+MAP_SHARED 0x1
+
+MAP_PRIVATE 0x2
+
+MAP_SHARED_VALIDATE 0x3
+
+#if defined __hppa__
+MAP_FIXED 0x4
+#elif defined __alpha__
+MAP_FIXED 0x100
+#else
+MAP_FIXED 0x10
+#endif
+
+#if defined __alpha__ || defined __hppa__
+MAP_ANONYMOUS 0x10
+#elif defined __mips__ || defined __xtensa__
+MAP_ANONYMOUS 0x800
+#else
+MAP_ANONYMOUS 0x20
+#endif
+
+#if defined __x86_64__ || defined __i386__
+MAP_32BIT 0x40
+#else
+MAP_32BIT
+#endif
+
+#if defined MAP_RENAME && MAP_RENAME == MAP_ANONYMOUS /* MAP_RENAME is unusual */
+# ifndef STRACE_WORKAROUND_FOR_MAP_RENAME
+# define STRACE_WORKAROUND_FOR_MAP_RENAME
+/* glibc erroneously defines MAP_RENAME to MAP_ANONYMOUS on some architectures. */
+/* This is just wrong and has to be fixed. */
+# undef MAP_RENAME
+# endif
+#endif /* MAP_RENAME */
+
+#if defined __mips__ || defined __xtensa__
+MAP_RENAME 0x20
+#else
+MAP_RENAME
+#endif
+
+#if defined __powerpc__ || defined __sparc__
+MAP_NORESERVE 0x40
+#elif defined __mips__ || defined __xtensa__
+MAP_NORESERVE 0x400
+#elif defined __alpha__
+MAP_NORESERVE 0x10000
+#else
+MAP_NORESERVE 0x4000
+#endif
+
+#if defined __hppa__ || defined __mips__ || defined __xtensa__
+MAP_POPULATE 0x10000
+#elif defined __alpha__
+MAP_POPULATE 0x20000
+#else
+MAP_POPULATE 0x8000
+#endif
+
+#if defined __hppa__ || defined __mips__ || defined __xtensa__
+MAP_NONBLOCK 0x20000
+#elif defined __alpha__
+MAP_NONBLOCK 0x40000
+#else
+MAP_NONBLOCK 0x10000
+#endif
+
+#if defined __sparc__
+_MAP_NEW 0x80000000
+#else
+_MAP_NEW
+#endif
+
+#if defined __sparc__
+MAP_GROWSDOWN 0x200
+#elif defined __alpha__ || defined __mips__ || defined __xtensa__
+MAP_GROWSDOWN 0x1000
+#elif defined __hppa__
+MAP_GROWSDOWN 0x8000
+#else
+MAP_GROWSDOWN 0x100
+#endif
+
+#if defined __ia64__
+MAP_GROWSUP 0x200
+#else
+MAP_GROWSUP
+#endif
+
+#if defined __alpha__ || defined __mips__ || defined __xtensa__
+MAP_DENYWRITE 0x2000
+#else
+MAP_DENYWRITE 0x800
+#endif
+
+#if defined __alpha__ || defined __mips__ || defined __xtensa__
+MAP_EXECUTABLE 0x4000
+#else
+MAP_EXECUTABLE 0x1000
+#endif
+
+#if defined __sparc__
+MAP_INHERIT 0x80
+#else
+MAP_INHERIT
+#endif
+
+#if defined __alpha__
+_MAP_INHERIT 0x400
+#else
+_MAP_INHERIT
+#endif
+
+MAP_FILE 0
+
+#if defined __powerpc__
+MAP_LOCKED 0x80
+#elif defined __sparc__
+MAP_LOCKED 0x100
+#elif defined __alpha__ || defined __mips__ || defined __xtensa__
+MAP_LOCKED 0x8000
+#else
+MAP_LOCKED 0x2000
+#endif
+
+#if defined __alpha__
+_MAP_HASSEMAPHORE 0x200
+#else
+_MAP_HASSEMAPHORE
+#endif
+
+#if defined __hppa__ || defined __mips__ || defined __xtensa__
+MAP_STACK 0x40000
+#elif defined __alpha__
+MAP_STACK 0x80000
+#else
+MAP_STACK 0x20000
+#endif
+
+#if defined __hppa__ || defined __mips__ || defined __xtensa__
+MAP_HUGETLB 0x80000
+#elif defined __alpha__
+MAP_HUGETLB 0x100000
+#else
+MAP_HUGETLB 0x40000
+#endif
+
+MAP_SYNC 0x80000
+
+#if defined MAP_UNINITIALIZED && MAP_UNINITIALIZED == 0 /* MAP_UNINITIALIZED is special */
+/* Linux commit v5.3-rc1~65^2~86 fixed the definition of MAP_UNINITIALIZED */
+/* flag that used to depend on CONFIG_MMAP_ALLOW_UNINITIALIZED. */
+# ifndef STRACE_WORKAROUND_FOR_MAP_UNINITIALIZED
+# define STRACE_WORKAROUND_FOR_MAP_UNINITIALIZED
+# undef MAP_UNINITIALIZED
+# endif /* STRACE_WORKAROUND_FOR_MAP_UNINITIALIZED */
+#endif /* MAP_UNINITIALIZED == 0 */
+MAP_UNINITIALIZED 0x4000000
+
+#if defined __alpha__
+MAP_FIXED_NOREPLACE 0x200000
+#else
+MAP_FIXED_NOREPLACE 0x100000
+#endif
+
+#if defined __mips__ || defined __xtensa__
+MAP_AUTOGROW 0x40
+#else
+MAP_AUTOGROW
+#endif
+
+#if defined __mips__ || defined __xtensa__
+MAP_AUTORSRV 0x100
+#else
+MAP_AUTORSRV
+#endif
+
+#if defined __mips__ || defined __xtensa__
+MAP_LOCAL 0x80
+#else
+MAP_LOCAL
+#endif
+
+#if defined __alpha__
+_MAP_UNALIGNED 0x800
+#else
+_MAP_UNALIGNED
+#endif
diff --git a/src/xlat/mmap_prot.in b/src/xlat/mmap_prot.in
new file mode 100644
index 000000000..e99ec2970
--- /dev/null
+++ b/src/xlat/mmap_prot.in
@@ -0,0 +1,9 @@
+PROT_NONE
+PROT_READ
+PROT_WRITE
+PROT_EXEC
+PROT_SEM
+PROT_GROWSDOWN
+PROT_GROWSUP
+PROT_SAO
+PROT_ADI
diff --git a/src/xlat/modem_flags.in b/src/xlat/modem_flags.in
new file mode 100644
index 000000000..ad42d5e61
--- /dev/null
+++ b/src/xlat/modem_flags.in
@@ -0,0 +1,11 @@
+TIOCM_LE
+TIOCM_DTR
+TIOCM_RTS
+TIOCM_ST
+TIOCM_SR
+TIOCM_CTS
+TIOCM_CAR
+TIOCM_CD
+TIOCM_RNG
+TIOCM_RI
+TIOCM_DSR
diff --git a/src/xlat/modetypes.in b/src/xlat/modetypes.in
new file mode 100644
index 000000000..602cb0068
--- /dev/null
+++ b/src/xlat/modetypes.in
@@ -0,0 +1,7 @@
+S_IFREG
+S_IFSOCK
+S_IFIFO
+S_IFLNK
+S_IFDIR
+S_IFBLK
+S_IFCHR
diff --git a/src/xlat/module_init_flags.in b/src/xlat/module_init_flags.in
new file mode 100644
index 000000000..1547189ce
--- /dev/null
+++ b/src/xlat/module_init_flags.in
@@ -0,0 +1,2 @@
+MODULE_INIT_IGNORE_MODVERSIONS (1 << 0)
+MODULE_INIT_IGNORE_VERMAGIC (1 << 1)
diff --git a/src/xlat/mount_attr_flags.in b/src/xlat/mount_attr_flags.in
new file mode 100644
index 000000000..f6356c193
--- /dev/null
+++ b/src/xlat/mount_attr_flags.in
@@ -0,0 +1,7 @@
+MOUNT_ATTR_RDONLY 0x01
+MOUNT_ATTR_NOSUID 0x02
+MOUNT_ATTR_NODEV 0x04
+MOUNT_ATTR_NOEXEC 0x08
+MOUNT_ATTR_NOATIME 0x10
+MOUNT_ATTR_STRICTATIME 0x20
+MOUNT_ATTR_NODIRATIME 0x80
diff --git a/src/xlat/mount_flags.in b/src/xlat/mount_flags.in
new file mode 100644
index 000000000..416cdd9c5
--- /dev/null
+++ b/src/xlat/mount_flags.in
@@ -0,0 +1,31 @@
+MS_RDONLY (1U<<0)
+MS_NOSUID (1U<<1)
+MS_NODEV (1U<<2)
+MS_NOEXEC (1U<<3)
+MS_SYNCHRONOUS (1U<<4)
+MS_REMOUNT (1U<<5)
+MS_MANDLOCK (1U<<6)
+MS_DIRSYNC (1U<<7)
+MS_NOSYMFOLLOW (1U<<8)
+MS_NOATIME (1U<<10)
+MS_NODIRATIME (1U<<11)
+MS_BIND (1U<<12)
+MS_MOVE (1U<<13)
+MS_REC (1U<<14)
+MS_SILENT (1U<<15)
+MS_POSIXACL (1U<<16)
+MS_UNBINDABLE (1U<<17)
+MS_PRIVATE (1U<<18)
+MS_SLAVE (1U<<19)
+MS_SHARED (1U<<20)
+MS_RELATIME (1U<<21)
+MS_KERNMOUNT (1U<<22)
+MS_I_VERSION (1U<<23)
+MS_STRICTATIME (1U<<24)
+MS_LAZYTIME (1U<<25)
+MS_SUBMOUNT (1U<<26)
+MS_NOREMOTELOCK (1U<<27)
+MS_NOSEC (1U<<28)
+MS_BORN (1U<<29)
+MS_ACTIVE (1U<<30)
+MS_NOUSER (1U<<31)
diff --git a/src/xlat/move_mount_flags.in b/src/xlat/move_mount_flags.in
new file mode 100644
index 000000000..441387c44
--- /dev/null
+++ b/src/xlat/move_mount_flags.in
@@ -0,0 +1,6 @@
+MOVE_MOUNT_F_SYMLINKS 0x01
+MOVE_MOUNT_F_AUTOMOUNTS 0x02
+MOVE_MOUNT_F_EMPTY_PATH 0x04
+MOVE_MOUNT_T_SYMLINKS 0x10
+MOVE_MOUNT_T_AUTOMOUNTS 0x20
+MOVE_MOUNT_T_EMPTY_PATH 0x40
diff --git a/src/xlat/move_pages_flags.in b/src/xlat/move_pages_flags.in
new file mode 100644
index 000000000..03555b899
--- /dev/null
+++ b/src/xlat/move_pages_flags.in
@@ -0,0 +1,2 @@
+MPOL_MF_MOVE
+MPOL_MF_MOVE_ALL
diff --git a/src/xlat/mpol_mode_flags.in b/src/xlat/mpol_mode_flags.in
new file mode 100644
index 000000000..eeef95348
--- /dev/null
+++ b/src/xlat/mpol_mode_flags.in
@@ -0,0 +1,2 @@
+MPOL_F_STATIC_NODES (1U << 15)
+MPOL_F_RELATIVE_NODES (1U << 14)
diff --git a/src/xlat/mpol_modes.in b/src/xlat/mpol_modes.in
new file mode 100644
index 000000000..93d1b10d5
--- /dev/null
+++ b/src/xlat/mpol_modes.in
@@ -0,0 +1,6 @@
+#value_indexed
+MPOL_DEFAULT 0
+MPOL_PREFERRED 1
+MPOL_BIND 2
+MPOL_INTERLEAVE 3
+MPOL_LOCAL 4
diff --git a/src/xlat/mq_attr_flags.in b/src/xlat/mq_attr_flags.in
new file mode 100644
index 000000000..062207531
--- /dev/null
+++ b/src/xlat/mq_attr_flags.in
@@ -0,0 +1 @@
+O_NONBLOCK
diff --git a/src/xlat/mremap_flags.in b/src/xlat/mremap_flags.in
new file mode 100644
index 000000000..065f6ed89
--- /dev/null
+++ b/src/xlat/mremap_flags.in
@@ -0,0 +1,3 @@
+MREMAP_MAYMOVE 1
+MREMAP_FIXED 2
+MREMAP_DONTUNMAP 4
diff --git a/src/xlat/msg_flags.in b/src/xlat/msg_flags.in
new file mode 100644
index 000000000..946b1326e
--- /dev/null
+++ b/src/xlat/msg_flags.in
@@ -0,0 +1,34 @@
+MSG_OOB 0x1
+MSG_PEEK 0x2
+MSG_DONTROUTE 0x4
+/* MSG_TRYHARD 0x4 - synonym for MSG_DONTROUTE for DECnet */
+MSG_CTRUNC 0x8
+MSG_PROBE 0x10
+MSG_TRUNC 0x20
+MSG_DONTWAIT 0x40
+MSG_EOR 0x80
+MSG_WAITALL 0x100
+MSG_FIN 0x200
+MSG_SYN 0x400
+MSG_CONFIRM 0x800
+MSG_RST 0x1000
+MSG_ERRQUEUE 0x2000
+MSG_NOSIGNAL 0x4000
+MSG_MORE 0x8000
+MSG_WAITFORONE 0x10000
+MSG_SENDPAGE_NOTLAST 0x20000 /* sendpage() internal */
+MSG_BATCH 0x40000
+MSG_NO_SHARED_FRAGS 0x80000 /* sendpage() internal */
+MSG_ZEROCOPY 0x4000000
+/* MSG_EOF MSG_FIN */
+MSG_FASTOPEN 0x20000000
+MSG_CMSG_CLOEXEC 0x40000000
+#ifndef STRACE_WORKAROUND_FOR_MSG_CMSG_COMPAT
+# define STRACE_WORKAROUND_FOR_MSG_CMSG_COMPAT
+/*
+ * In Linux, the value of MSG_CMSG_COMPAT depends on CONFIG_COMPAT,
+ * and libc might want to replicate that behaviour.
+ */
+# undef MSG_CMSG_COMPAT
+#endif
+MSG_CMSG_COMPAT 0x80000000
diff --git a/src/xlat/msgctl_flags.in b/src/xlat/msgctl_flags.in
new file mode 100644
index 000000000..20da35d87
--- /dev/null
+++ b/src/xlat/msgctl_flags.in
@@ -0,0 +1,8 @@
+#sorted sort -k2,2g
+IPC_RMID 0
+IPC_SET 1
+IPC_STAT 2
+IPC_INFO 3
+MSG_STAT 11
+MSG_INFO 12
+MSG_STAT_ANY 13
diff --git a/src/xlat/mtd_file_mode_options.in b/src/xlat/mtd_file_mode_options.in
new file mode 100644
index 000000000..cbe568c1f
--- /dev/null
+++ b/src/xlat/mtd_file_mode_options.in
@@ -0,0 +1,6 @@
+#unconditional
+#value_indexed
+MTD_FILE_MODE_NORMAL
+MTD_FILE_MODE_OTP_FACTORY
+MTD_FILE_MODE_OTP_USER
+MTD_FILE_MODE_RAW
diff --git a/src/xlat/mtd_flags_options.in b/src/xlat/mtd_flags_options.in
new file mode 100644
index 000000000..8b5a0a5e0
--- /dev/null
+++ b/src/xlat/mtd_flags_options.in
@@ -0,0 +1,4 @@
+MTD_WRITEABLE
+MTD_BIT_WRITEABLE
+MTD_NO_ERASE
+MTD_POWERUP_LOCK
diff --git a/src/xlat/mtd_mode_options.in b/src/xlat/mtd_mode_options.in
new file mode 100644
index 000000000..01962f2ae
--- /dev/null
+++ b/src/xlat/mtd_mode_options.in
@@ -0,0 +1,5 @@
+#unconditional
+#value_indexed
+MTD_OPS_PLACE_OOB
+MTD_OPS_AUTO_OOB
+MTD_OPS_RAW
diff --git a/src/xlat/mtd_nandecc_options.in b/src/xlat/mtd_nandecc_options.in
new file mode 100644
index 000000000..cd96f3db0
--- /dev/null
+++ b/src/xlat/mtd_nandecc_options.in
@@ -0,0 +1,5 @@
+MTD_NANDECC_OFF
+MTD_NANDECC_PLACE
+MTD_NANDECC_AUTOPLACE
+MTD_NANDECC_PLACEONLY
+MTD_NANDECC_AUTOPL_USR
diff --git a/src/xlat/mtd_otp_options.in b/src/xlat/mtd_otp_options.in
new file mode 100644
index 000000000..a00248f73
--- /dev/null
+++ b/src/xlat/mtd_otp_options.in
@@ -0,0 +1,3 @@
+MTD_OTP_OFF
+MTD_OTP_FACTORY
+MTD_OTP_USER
diff --git a/src/xlat/mtd_type_options.in b/src/xlat/mtd_type_options.in
new file mode 100644
index 000000000..42643f9e9
--- /dev/null
+++ b/src/xlat/mtd_type_options.in
@@ -0,0 +1,8 @@
+MTD_ABSENT
+MTD_RAM
+MTD_ROM
+MTD_NORFLASH
+MTD_NANDFLASH
+MTD_DATAFLASH
+MTD_UBIVOLUME
+MTD_MLCNANDFLASH
diff --git a/src/xlat/multicast_router_types.in b/src/xlat/multicast_router_types.in
new file mode 100644
index 000000000..b53ea7893
--- /dev/null
+++ b/src/xlat/multicast_router_types.in
@@ -0,0 +1,5 @@
+#value_indexed
+MDB_RTR_TYPE_DISABLED 0
+MDB_RTR_TYPE_TEMP_QUERY 1
+MDB_RTR_TYPE_PERM 2
+MDB_RTR_TYPE_TEMP 3
diff --git a/src/xlat/name_to_handle_at_flags.in b/src/xlat/name_to_handle_at_flags.in
new file mode 100644
index 000000000..4522a8014
--- /dev/null
+++ b/src/xlat/name_to_handle_at_flags.in
@@ -0,0 +1,2 @@
+AT_SYMLINK_FOLLOW 0x400
+AT_EMPTY_PATH 0x1000
diff --git a/src/xlat/nbd_ioctl_cmds.in b/src/xlat/nbd_ioctl_cmds.in
new file mode 100644
index 000000000..34f891e3e
--- /dev/null
+++ b/src/xlat/nbd_ioctl_cmds.in
@@ -0,0 +1,11 @@
+NBD_SET_SOCK _IO( 0xab, 0 )
+NBD_SET_BLKSIZE _IO( 0xab, 1 )
+NBD_SET_SIZE _IO( 0xab, 2 )
+NBD_DO_IT _IO( 0xab, 3 )
+NBD_CLEAR_SOCK _IO( 0xab, 4 )
+NBD_CLEAR_QUE _IO( 0xab, 5 )
+NBD_PRINT_DEBUG _IO( 0xab, 6 )
+NBD_SET_SIZE_BLOCKS _IO( 0xab, 7 )
+NBD_DISCONNECT _IO( 0xab, 8 )
+NBD_SET_TIMEOUT _IO( 0xab, 9 )
+NBD_SET_FLAGS _IO( 0xab, 10)
diff --git a/src/xlat/nbd_ioctl_flags.in b/src/xlat/nbd_ioctl_flags.in
new file mode 100644
index 000000000..60bb07f99
--- /dev/null
+++ b/src/xlat/nbd_ioctl_flags.in
@@ -0,0 +1,29 @@
+/*
+ * Some flags are not defined in <linux/nbd.h>, but are passed anyway.
+ * These flags are sent from nbd-server to the client, and the client
+ * passes them to the kernel unmodified after parsing. Both the client
+ * and the kernel ignore flags unknown to them.
+ */
+
+/* The server supports flags */
+NBD_FLAG_HAS_FLAGS (1 << 0)
+/* The export is read-only */
+NBD_FLAG_READ_ONLY (1 << 1)
+/* The server supports NBD_CMD_FLUSH */
+NBD_FLAG_SEND_FLUSH (1 << 2)
+/* The server supports NBD_CMD_FLAG_FUA (Force Unit Access) */
+NBD_FLAG_SEND_FUA (1 << 3)
+/* The export is a rotational medium */
+NBD_FLAG_ROTATIONAL (1 << 4)
+/* The server supports NBD_CMD_TRIM */
+NBD_FLAG_SEND_TRIM (1 << 5)
+/* The server supports NBD_CMD_WRITE_ZEROES and NBD_CMD_FLAG_NO_HOLE */
+NBD_FLAG_SEND_WRITE_ZEROES (1 << 6)
+/* The server supports NBD_CMD_FLAG_DF (don't fragment replies) */
+NBD_FLAG_SEND_DF (1 << 7)
+/* The server supports multiple connections */
+NBD_FLAG_CAN_MULTI_CONN (1 << 8)
+/* The server supports NBD_CMD_RESIZE (resizing the device) */
+NBD_FLAG_SEND_RESIZE (1 << 9)
+/* The server supports NBD_CMD_CACHE */
+NBD_FLAG_SEND_CACHE (1 << 10)
diff --git a/src/xlat/neighbor_cache_entry_flags.in b/src/xlat/neighbor_cache_entry_flags.in
new file mode 100644
index 000000000..0f0a83ebf
--- /dev/null
+++ b/src/xlat/neighbor_cache_entry_flags.in
@@ -0,0 +1,8 @@
+NTF_USE 0x01
+NTF_SELF 0x02
+NTF_MASTER 0x04
+NTF_PROXY 0x08
+NTF_EXT_LEARNED 0x10
+NTF_OFFLOADED 0x20
+NTF_STICKY 0x40
+NTF_ROUTER 0x80
diff --git a/src/xlat/neighbor_cache_entry_states.in b/src/xlat/neighbor_cache_entry_states.in
new file mode 100644
index 000000000..5ae9c4dac
--- /dev/null
+++ b/src/xlat/neighbor_cache_entry_states.in
@@ -0,0 +1,9 @@
+NUD_INCOMPLETE
+NUD_REACHABLE
+NUD_STALE
+NUD_DELAY
+NUD_PROBE
+NUD_FAILED
+NUD_NOARP
+NUD_PERMANENT
+NUD_NONE
diff --git a/src/xlat/netfilter_versions.in b/src/xlat/netfilter_versions.in
new file mode 100644
index 000000000..981ab4ac8
--- /dev/null
+++ b/src/xlat/netfilter_versions.in
@@ -0,0 +1,3 @@
+#value_indexed
+NFNETLINK_V0 0
+NFNETLINK_V1 1
diff --git a/src/xlat/netlink_ack_flags.in b/src/xlat/netlink_ack_flags.in
new file mode 100644
index 000000000..8dd223ac4
--- /dev/null
+++ b/src/xlat/netlink_ack_flags.in
@@ -0,0 +1,2 @@
+NLM_F_CAPPED 0x100
+NLM_F_ACK_TLVS 0x200
diff --git a/src/xlat/netlink_delete_flags.in b/src/xlat/netlink_delete_flags.in
new file mode 100644
index 000000000..01af41db0
--- /dev/null
+++ b/src/xlat/netlink_delete_flags.in
@@ -0,0 +1 @@
+NLM_F_NONREC
diff --git a/src/xlat/netlink_diag_attrs.in b/src/xlat/netlink_diag_attrs.in
new file mode 100644
index 000000000..420b29f39
--- /dev/null
+++ b/src/xlat/netlink_diag_attrs.in
@@ -0,0 +1,7 @@
+#unconditional
+#value_indexed
+NETLINK_DIAG_MEMINFO
+NETLINK_DIAG_GROUPS
+NETLINK_DIAG_RX_RING
+NETLINK_DIAG_TX_RING
+NETLINK_DIAG_FLAGS
diff --git a/src/xlat/netlink_diag_show.in b/src/xlat/netlink_diag_show.in
new file mode 100644
index 000000000..eee9620e0
--- /dev/null
+++ b/src/xlat/netlink_diag_show.in
@@ -0,0 +1,4 @@
+NDIAG_SHOW_MEMINFO
+NDIAG_SHOW_GROUPS
+NDIAG_SHOW_RING_CFG
+NDIAG_SHOW_FLAGS
diff --git a/src/xlat/netlink_flags.in b/src/xlat/netlink_flags.in
new file mode 100644
index 000000000..d84f4ddb2
--- /dev/null
+++ b/src/xlat/netlink_flags.in
@@ -0,0 +1,6 @@
+NLM_F_REQUEST 0x1
+NLM_F_MULTI 0x2
+NLM_F_ACK 0x4
+NLM_F_ECHO 0x8
+NLM_F_DUMP_INTR 0x10
+NLM_F_DUMP_FILTERED 0x20
diff --git a/src/xlat/netlink_get_flags.in b/src/xlat/netlink_get_flags.in
new file mode 100644
index 000000000..96ab4a065
--- /dev/null
+++ b/src/xlat/netlink_get_flags.in
@@ -0,0 +1,4 @@
+NLM_F_DUMP
+NLM_F_ROOT
+NLM_F_MATCH
+NLM_F_ATOMIC
diff --git a/src/xlat/netlink_new_flags.in b/src/xlat/netlink_new_flags.in
new file mode 100644
index 000000000..4ef2fea63
--- /dev/null
+++ b/src/xlat/netlink_new_flags.in
@@ -0,0 +1,4 @@
+NLM_F_REPLACE
+NLM_F_EXCL
+NLM_F_CREATE
+NLM_F_APPEND
diff --git a/src/xlat/netlink_protocols.in b/src/xlat/netlink_protocols.in
new file mode 100644
index 000000000..020718b85
--- /dev/null
+++ b/src/xlat/netlink_protocols.in
@@ -0,0 +1,23 @@
+#value_indexed
+NETLINK_ROUTE 0
+NETLINK_UNUSED 1
+NETLINK_USERSOCK 2
+NETLINK_FIREWALL 3
+NETLINK_SOCK_DIAG 4
+NETLINK_NFLOG 5
+NETLINK_XFRM 6
+NETLINK_SELINUX 7
+NETLINK_ISCSI 8
+NETLINK_AUDIT 9
+NETLINK_FIB_LOOKUP 10
+NETLINK_CONNECTOR 11
+NETLINK_NETFILTER 12
+NETLINK_IP6_FW 13
+NETLINK_DNRTMSG 14
+NETLINK_KOBJECT_UEVENT 15
+NETLINK_GENERIC 16
+NETLINK_SCSITRANSPORT 18
+NETLINK_ECRYPTFS 19
+NETLINK_RDMA 20
+NETLINK_CRYPTO 21
+NETLINK_SMC 22
diff --git a/src/xlat/netlink_sk_meminfo_indices.in b/src/xlat/netlink_sk_meminfo_indices.in
new file mode 100644
index 000000000..1e2f7950d
--- /dev/null
+++ b/src/xlat/netlink_sk_meminfo_indices.in
@@ -0,0 +1,10 @@
+#value_indexed
+SK_MEMINFO_RMEM_ALLOC 0
+SK_MEMINFO_RCVBUF 1
+SK_MEMINFO_WMEM_ALLOC 2
+SK_MEMINFO_SNDBUF 3
+SK_MEMINFO_FWD_ALLOC 4
+SK_MEMINFO_WMEM_QUEUED 5
+SK_MEMINFO_OPTMEM 6
+SK_MEMINFO_BACKLOG 7
+SK_MEMINFO_DROPS 8
diff --git a/src/xlat/netlink_socket_flags.in b/src/xlat/netlink_socket_flags.in
new file mode 100644
index 000000000..f36e35c65
--- /dev/null
+++ b/src/xlat/netlink_socket_flags.in
@@ -0,0 +1,6 @@
+NDIAG_FLAG_CB_RUNNING
+NDIAG_FLAG_PKTINFO
+NDIAG_FLAG_BROADCAST_ERROR
+NDIAG_FLAG_NO_ENOBUFS
+NDIAG_FLAG_LISTEN_ALL_NSID
+NDIAG_FLAG_CAP_ACK
diff --git a/src/xlat/netlink_states.in b/src/xlat/netlink_states.in
new file mode 100644
index 000000000..d2ffb7bc8
--- /dev/null
+++ b/src/xlat/netlink_states.in
@@ -0,0 +1,4 @@
+NETLINK_UNCONNECTED 0
+NETLINK_CONNECTED 1
+/* The initial socket state, as set by net/code/sock.c:sock_init_data */
+TCP_CLOSE 7
diff --git a/src/xlat/netlink_types.in b/src/xlat/netlink_types.in
new file mode 100644
index 000000000..ad4a841ec
--- /dev/null
+++ b/src/xlat/netlink_types.in
@@ -0,0 +1,5 @@
+#value_indexed
+NLMSG_NOOP 0x1
+NLMSG_ERROR 0x2
+NLMSG_DONE 0x3
+NLMSG_OVERRUN 0x4
diff --git a/src/xlat/nf_acct_msg_types.in b/src/xlat/nf_acct_msg_types.in
new file mode 100644
index 000000000..b5c16024b
--- /dev/null
+++ b/src/xlat/nf_acct_msg_types.in
@@ -0,0 +1,6 @@
+#value_indexed
+NFNL_MSG_ACCT_NEW 0
+NFNL_MSG_ACCT_GET 1
+NFNL_MSG_ACCT_GET_CTRZERO 2
+NFNL_MSG_ACCT_DEL 3
+NFNL_MSG_ACCT_OVERQUOTA 4
diff --git a/src/xlat/nf_cthelper_msg_types.in b/src/xlat/nf_cthelper_msg_types.in
new file mode 100644
index 000000000..34959a83f
--- /dev/null
+++ b/src/xlat/nf_cthelper_msg_types.in
@@ -0,0 +1,4 @@
+#value_indexed
+NFNL_MSG_CTHELPER_NEW 0
+NFNL_MSG_CTHELPER_GET 1
+NFNL_MSG_CTHELPER_DEL 2
diff --git a/src/xlat/nf_ctnetlink_exp_msg_types.in b/src/xlat/nf_ctnetlink_exp_msg_types.in
new file mode 100644
index 000000000..0f4eed4f3
--- /dev/null
+++ b/src/xlat/nf_ctnetlink_exp_msg_types.in
@@ -0,0 +1,5 @@
+#value_indexed
+IPCTNL_MSG_EXP_NEW 0
+IPCTNL_MSG_EXP_GET 1
+IPCTNL_MSG_EXP_DELETE 2
+IPCTNL_MSG_EXP_GET_STATS_CPU 3
diff --git a/src/xlat/nf_ctnetlink_msg_types.in b/src/xlat/nf_ctnetlink_msg_types.in
new file mode 100644
index 000000000..ceec1c322
--- /dev/null
+++ b/src/xlat/nf_ctnetlink_msg_types.in
@@ -0,0 +1,9 @@
+#value_indexed
+IPCTNL_MSG_CT_NEW 0
+IPCTNL_MSG_CT_GET 1
+IPCTNL_MSG_CT_DELETE 2
+IPCTNL_MSG_CT_GET_CTRZERO 3
+IPCTNL_MSG_CT_GET_STATS_CPU 4
+IPCTNL_MSG_CT_GET_STATS 5
+IPCTNL_MSG_CT_GET_DYING 6
+IPCTNL_MSG_CT_GET_UNCONFIRMED 7
diff --git a/src/xlat/nf_cttimeout_msg_types.in b/src/xlat/nf_cttimeout_msg_types.in
new file mode 100644
index 000000000..cbb5429e3
--- /dev/null
+++ b/src/xlat/nf_cttimeout_msg_types.in
@@ -0,0 +1,6 @@
+#value_indexed
+IPCTNL_MSG_TIMEOUT_NEW 0
+IPCTNL_MSG_TIMEOUT_GET 1
+IPCTNL_MSG_TIMEOUT_DELETE 2
+IPCTNL_MSG_TIMEOUT_DEFAULT_SET 3
+IPCTNL_MSG_TIMEOUT_DEFAULT_GET 4
diff --git a/src/xlat/nf_ipset_msg_types.in b/src/xlat/nf_ipset_msg_types.in
new file mode 100644
index 000000000..22410324e
--- /dev/null
+++ b/src/xlat/nf_ipset_msg_types.in
@@ -0,0 +1,22 @@
+#value_indexed
+IPSET_CMD_NONE 0
+IPSET_CMD_PROTOCOL 1
+IPSET_CMD_CREATE 2
+IPSET_CMD_DESTROY 3
+IPSET_CMD_FLUSH 4
+IPSET_CMD_RENAME 5
+IPSET_CMD_SWAP 6
+IPSET_CMD_LIST 7
+IPSET_CMD_SAVE 8
+IPSET_CMD_ADD 9
+IPSET_CMD_DEL 10
+IPSET_CMD_TEST 11
+IPSET_CMD_HEADER 12
+IPSET_CMD_TYPE 13
+
+IPSET_CMD_RESTORE 14
+IPSET_CMD_HELP 15
+IPSET_CMD_VERSION 16
+IPSET_CMD_QUIT 17
+
+IPSET_CMD_COMMIT 18
diff --git a/src/xlat/nf_nft_compat_msg_types.in b/src/xlat/nf_nft_compat_msg_types.in
new file mode 100644
index 000000000..e2f7da1c3
--- /dev/null
+++ b/src/xlat/nf_nft_compat_msg_types.in
@@ -0,0 +1 @@
+NFNL_MSG_COMPAT_GET 0
diff --git a/src/xlat/nf_nftables_msg_types.in b/src/xlat/nf_nftables_msg_types.in
new file mode 100644
index 000000000..d1c6732bf
--- /dev/null
+++ b/src/xlat/nf_nftables_msg_types.in
@@ -0,0 +1,23 @@
+#value_indexed
+NFT_MSG_NEWTABLE 0
+NFT_MSG_GETTABLE 1
+NFT_MSG_DELTABLE 2
+NFT_MSG_NEWCHAIN 3
+NFT_MSG_GETCHAIN 4
+NFT_MSG_DELCHAIN 5
+NFT_MSG_NEWRULE 6
+NFT_MSG_GETRULE 7
+NFT_MSG_DELRULE 8
+NFT_MSG_NEWSET 9
+NFT_MSG_GETSET 10
+NFT_MSG_DELSET 11
+NFT_MSG_NEWSETELEM 12
+NFT_MSG_GETSETELEM 13
+NFT_MSG_DELSETELEM 14
+NFT_MSG_NEWGEN 15
+NFT_MSG_GETGEN 16
+NFT_MSG_TRACE 17
+NFT_MSG_NEWOBJ 18
+NFT_MSG_GETOBJ 19
+NFT_MSG_DELOBJ 20
+NFT_MSG_GETOBJ_RESET 21
diff --git a/src/xlat/nf_osf_msg_types.in b/src/xlat/nf_osf_msg_types.in
new file mode 100644
index 000000000..def28f777
--- /dev/null
+++ b/src/xlat/nf_osf_msg_types.in
@@ -0,0 +1,3 @@
+#value_indexed
+OSF_MSG_ADD 0
+OSF_MSG_REMOVE 1
diff --git a/src/xlat/nf_queue_msg_types.in b/src/xlat/nf_queue_msg_types.in
new file mode 100644
index 000000000..76b113d82
--- /dev/null
+++ b/src/xlat/nf_queue_msg_types.in
@@ -0,0 +1,5 @@
+#value_indexed
+NFQNL_MSG_PACKET 0
+NFQNL_MSG_VERDICT 1
+NFQNL_MSG_CONFIG 2
+NFQNL_MSG_VERDICT_BATCH 3
diff --git a/src/xlat/nf_ulog_msg_types.in b/src/xlat/nf_ulog_msg_types.in
new file mode 100644
index 000000000..00b48559a
--- /dev/null
+++ b/src/xlat/nf_ulog_msg_types.in
@@ -0,0 +1,3 @@
+#value_indexed
+NFULNL_MSG_PACKET 0
+NFULNL_MSG_CONFIG 1
diff --git a/src/xlat/nfc_protocols.in b/src/xlat/nfc_protocols.in
new file mode 100644
index 000000000..277189764
--- /dev/null
+++ b/src/xlat/nfc_protocols.in
@@ -0,0 +1,3 @@
+#value_indexed
+NFC_SOCKPROTO_RAW 0
+NFC_SOCKPROTO_LLCP 1
diff --git a/src/xlat/nl_audit_types.in b/src/xlat/nl_audit_types.in
new file mode 100644
index 000000000..109bc6364
--- /dev/null
+++ b/src/xlat/nl_audit_types.in
@@ -0,0 +1,124 @@
+#sorted sort -k2,2n
+AUDIT_GET 1000
+AUDIT_SET 1001
+AUDIT_LIST 1002
+AUDIT_ADD 1003
+AUDIT_DEL 1004
+AUDIT_USER 1005
+AUDIT_LOGIN 1006
+AUDIT_WATCH_INS 1007
+AUDIT_WATCH_REM 1008
+AUDIT_WATCH_LIST 1009
+AUDIT_SIGNAL_INFO 1010
+AUDIT_ADD_RULE 1011
+AUDIT_DEL_RULE 1012
+AUDIT_LIST_RULES 1013
+AUDIT_TRIM 1014
+AUDIT_MAKE_EQUIV 1015
+AUDIT_TTY_GET 1016
+AUDIT_TTY_SET 1017
+AUDIT_SET_FEATURE 1018
+AUDIT_GET_FEATURE 1019
+
+AUDIT_FIRST_USER_MSG 1100
+AUDIT_USER_AVC 1107
+AUDIT_USER_TTY 1124
+AUDIT_LAST_USER_MSG 1199
+
+AUDIT_DAEMON_START 1200
+AUDIT_DAEMON_END 1201
+AUDIT_DAEMON_ABORT 1202
+AUDIT_DAEMON_CONFIG 1203
+
+AUDIT_SYSCALL 1300
+AUDIT_FS_WATCH 1301
+AUDIT_PATH 1302
+AUDIT_IPC 1303
+AUDIT_SOCKETCALL 1304
+AUDIT_CONFIG_CHANGE 1305
+AUDIT_SOCKADDR 1306
+AUDIT_CWD 1307
+AUDIT_EXECVE 1309
+AUDIT_IPC_SET_PERM 1311
+AUDIT_MQ_OPEN 1312
+AUDIT_MQ_SENDRECV 1313
+AUDIT_MQ_NOTIFY 1314
+AUDIT_MQ_GETSETATTR 1315
+AUDIT_KERNEL_OTHER 1316
+AUDIT_FD_PAIR 1317
+AUDIT_OBJ_PID 1318
+AUDIT_TTY 1319
+AUDIT_EOE 1320
+AUDIT_BPRM_FCAPS 1321
+AUDIT_CAPSET 1322
+AUDIT_MMAP 1323
+AUDIT_NETFILTER_PKT 1324
+AUDIT_NETFILTER_CFG 1325
+AUDIT_SECCOMP 1326
+AUDIT_PROCTITLE 1327
+
+#ifndef STRACE_WORKAROUND_FOR_AUDIT_FEATURE_CHANGE
+# define STRACE_WORKAROUND_FOR_AUDIT_FEATURE_CHANGE
+/*
+ * Linux kernel commit v3.15-rc1~18^2~1 has changed the value
+ * of AUDIT_FEATURE_CHANGE constant introduced by commit v3.13-rc1~19^2~20
+ * which is of course an ABI breakage that affected 3.13 and 3.14 kernel
+ * releases as well as their LTS derivatives.
+ * Linux kernel commit v3.15-rc1~18^2~1 also claims that the old value
+ * of AUDIT_FEATURE_CHANGE was ignored by userspace because of the established
+ * convention how netlink messages for the audit system are divided into blocks.
+ * Looks like the best way to handle this situation is to pretend that
+ * the old value of AUDIT_FEATURE_CHANGE didn't exist.
+ */
+# undef AUDIT_FEATURE_CHANGE
+#endif
+AUDIT_FEATURE_CHANGE 1328
+
+AUDIT_REPLACE 1329
+AUDIT_KERN_MODULE 1330
+AUDIT_FANOTIFY 1331
+AUDIT_TIME_INJOFFSET 1332
+AUDIT_TIME_ADJNTPVAL 1333
+AUDIT_BPF 1334
+AUDIT_EVENT_LISTENER 1335
+
+AUDIT_AVC 1400
+AUDIT_SELINUX_ERR 1401
+AUDIT_AVC_PATH 1402
+AUDIT_MAC_POLICY_LOAD 1403
+AUDIT_MAC_STATUS 1404
+AUDIT_MAC_CONFIG_CHANGE 1405
+AUDIT_MAC_UNLBL_ALLOW 1406
+AUDIT_MAC_CIPSOV4_ADD 1407
+AUDIT_MAC_CIPSOV4_DEL 1408
+AUDIT_MAC_MAP_ADD 1409
+AUDIT_MAC_MAP_DEL 1410
+AUDIT_MAC_IPSEC_ADDSA 1411
+AUDIT_MAC_IPSEC_DELSA 1412
+AUDIT_MAC_IPSEC_ADDSPD 1413
+AUDIT_MAC_IPSEC_DELSPD 1414
+AUDIT_MAC_IPSEC_EVENT 1415
+AUDIT_MAC_UNLBL_STCADD 1416
+AUDIT_MAC_UNLBL_STCDEL 1417
+AUDIT_MAC_CALIPSO_ADD 1418
+AUDIT_MAC_CALIPSO_DEL 1419
+
+AUDIT_ANOM_PROMISCUOUS 1700
+AUDIT_ANOM_ABEND 1701
+AUDIT_ANOM_LINK 1702
+AUDIT_ANOM_CREAT 1703
+AUDIT_LAST_KERN_ANOM_MSG 1799
+
+AUDIT_INTEGRITY_DATA 1800
+AUDIT_INTEGRITY_METADATA 1801
+AUDIT_INTEGRITY_STATUS 1802
+AUDIT_INTEGRITY_HASH 1803
+AUDIT_INTEGRITY_PCR 1804
+AUDIT_INTEGRITY_RULE 1805
+AUDIT_INTEGRITY_EVM_XATTR 1806
+AUDIT_INTEGRITY_POLICY_RULE 1807
+
+AUDIT_KERNEL 2000
+
+AUDIT_FIRST_USER_MSG2 2100
+AUDIT_LAST_USER_MSG2 2999
diff --git a/src/xlat/nl_crypto_types.in b/src/xlat/nl_crypto_types.in
new file mode 100644
index 000000000..021f85fca
--- /dev/null
+++ b/src/xlat/nl_crypto_types.in
@@ -0,0 +1,5 @@
+CRYPTO_MSG_NEWALG 0x10
+CRYPTO_MSG_DELALG 0x11
+CRYPTO_MSG_UPDATEALG 0x12
+CRYPTO_MSG_GETALG 0x13
+CRYPTO_MSG_DELRNG 0x14
diff --git a/src/xlat/nl_netfilter_msg_types.in b/src/xlat/nl_netfilter_msg_types.in
new file mode 100644
index 000000000..dd13207ec
--- /dev/null
+++ b/src/xlat/nl_netfilter_msg_types.in
@@ -0,0 +1,2 @@
+NFNL_MSG_BATCH_BEGIN 0x10
+NFNL_MSG_BATCH_END 0x11
diff --git a/src/xlat/nl_netfilter_subsys_ids.in b/src/xlat/nl_netfilter_subsys_ids.in
new file mode 100644
index 000000000..815d0772a
--- /dev/null
+++ b/src/xlat/nl_netfilter_subsys_ids.in
@@ -0,0 +1,13 @@
+#value_indexed
+NFNL_SUBSYS_NONE 0
+NFNL_SUBSYS_CTNETLINK 1
+NFNL_SUBSYS_CTNETLINK_EXP 2
+NFNL_SUBSYS_QUEUE 3
+NFNL_SUBSYS_ULOG 4
+NFNL_SUBSYS_OSF 5
+NFNL_SUBSYS_IPSET 6
+NFNL_SUBSYS_ACCT 7
+NFNL_SUBSYS_CTNETLINK_TIMEOUT 8
+NFNL_SUBSYS_CTHELPER 9
+NFNL_SUBSYS_NFTABLES 10
+NFNL_SUBSYS_NFT_COMPAT 11
diff --git a/src/xlat/nl_route_types.in b/src/xlat/nl_route_types.in
new file mode 100644
index 000000000..c389ab962
--- /dev/null
+++ b/src/xlat/nl_route_types.in
@@ -0,0 +1,75 @@
+RTM_NEWLINK 16
+RTM_DELLINK 17
+RTM_GETLINK 18
+RTM_SETLINK 19
+
+RTM_NEWADDR 20
+RTM_DELADDR 21
+RTM_GETADDR 22
+
+RTM_NEWROUTE 24
+RTM_DELROUTE 25
+RTM_GETROUTE 26
+
+RTM_NEWNEIGH 28
+RTM_DELNEIGH 29
+RTM_GETNEIGH 30
+
+RTM_NEWRULE 32
+RTM_DELRULE 33
+RTM_GETRULE 34
+
+RTM_NEWQDISC 36
+RTM_DELQDISC 37
+RTM_GETQDISC 38
+
+RTM_NEWTCLASS 40
+RTM_DELTCLASS 41
+RTM_GETTCLASS 42
+
+RTM_NEWTFILTER 44
+RTM_DELTFILTER 45
+RTM_GETTFILTER 46
+
+RTM_NEWACTION 48
+RTM_DELACTION 49
+RTM_GETACTION 50
+
+RTM_NEWPREFIX 52
+RTM_GETPREFIX 54
+
+RTM_GETMULTICAST 58
+
+RTM_GETANYCAST 62
+
+RTM_NEWNEIGHTBL 64
+RTM_GETNEIGHTBL 66
+RTM_SETNEIGHTBL 67
+
+RTM_NEWNDUSEROPT 68
+
+RTM_NEWADDRLABEL 72
+RTM_DELADDRLABEL 73
+RTM_GETADDRLABEL 74
+
+RTM_GETDCB 78
+RTM_SETDCB 79
+
+RTM_NEWNETCONF 80
+RTM_DELNETCONF 81
+RTM_GETNETCONF 82
+
+RTM_NEWMDB 84
+RTM_DELMDB 85
+RTM_GETMDB 86
+
+RTM_NEWNSID 88
+RTM_DELNSID 89
+RTM_GETNSID 90
+
+RTM_NEWSTATS 92
+RTM_GETSTATS 94
+
+RTM_NEWCHAIN 100
+RTM_DELCHAIN 101
+RTM_GETCHAIN 102
diff --git a/src/xlat/nl_selinux_types.in b/src/xlat/nl_selinux_types.in
new file mode 100644
index 000000000..1ac46053c
--- /dev/null
+++ b/src/xlat/nl_selinux_types.in
@@ -0,0 +1,2 @@
+SELNL_MSG_SETENFORCE 0x10
+SELNL_MSG_POLICYLOAD 0x11
diff --git a/src/xlat/nl_sock_diag_types.in b/src/xlat/nl_sock_diag_types.in
new file mode 100644
index 000000000..5c176c808
--- /dev/null
+++ b/src/xlat/nl_sock_diag_types.in
@@ -0,0 +1,4 @@
+TCPDIAG_GETSOCK 18
+DCCPDIAG_GETSOCK 19
+SOCK_DIAG_BY_FAMILY 20
+SOCK_DESTROY 21
diff --git a/src/xlat/nl_xfrm_types.in b/src/xlat/nl_xfrm_types.in
new file mode 100644
index 000000000..ee81394c3
--- /dev/null
+++ b/src/xlat/nl_xfrm_types.in
@@ -0,0 +1,34 @@
+XFRM_MSG_NEWSA 0x10
+XFRM_MSG_DELSA 0x11
+XFRM_MSG_GETSA 0x12
+
+XFRM_MSG_NEWPOLICY 0x13
+XFRM_MSG_DELPOLICY 0x14
+XFRM_MSG_GETPOLICY 0x15
+
+XFRM_MSG_ALLOCSPI 0x16
+XFRM_MSG_ACQUIRE 0x17
+XFRM_MSG_EXPIRE 0x18
+
+XFRM_MSG_UPDPOLICY 0x19
+XFRM_MSG_UPDSA 0x1a
+
+XFRM_MSG_POLEXPIRE 0x1b
+
+XFRM_MSG_FLUSHSA 0x1c
+XFRM_MSG_FLUSHPOLICY 0x1d
+
+XFRM_MSG_NEWAE 0x1e
+XFRM_MSG_GETAE 0x1f
+
+XFRM_MSG_REPORT 0x20
+
+XFRM_MSG_MIGRATE 0x21
+
+XFRM_MSG_NEWSADINFO 0x22
+XFRM_MSG_GETSADINFO 0x23
+
+XFRM_MSG_NEWSPDINFO 0x24
+XFRM_MSG_GETSPDINFO 0x25
+
+XFRM_MSG_MAPPING 0x26
diff --git a/src/xlat/nlmsgerr_attrs.in b/src/xlat/nlmsgerr_attrs.in
new file mode 100644
index 000000000..7cc38d83e
--- /dev/null
+++ b/src/xlat/nlmsgerr_attrs.in
@@ -0,0 +1,6 @@
+#value_indexed
+NLMSGERR_ATTR_UNUSED 0
+NLMSGERR_ATTR_MSG 1
+NLMSGERR_ATTR_OFFS 2
+NLMSGERR_ATTR_COOKIE 3
+NLMSGERR_ATTR_POLICY 4
diff --git a/src/xlat/notifyflags.in b/src/xlat/notifyflags.in
new file mode 100644
index 000000000..e9f1492a1
--- /dev/null
+++ b/src/xlat/notifyflags.in
@@ -0,0 +1,7 @@
+DN_ACCESS
+DN_MODIFY
+DN_CREATE
+DN_DELETE
+DN_RENAME
+DN_ATTRIB
+DN_MULTISHOT
diff --git a/src/xlat/nt_descriptor_types.in b/src/xlat/nt_descriptor_types.in
new file mode 100644
index 000000000..2be960076
--- /dev/null
+++ b/src/xlat/nt_descriptor_types.in
@@ -0,0 +1,71 @@
+NT_PRSTATUS 1
+NT_FPREGSET 2
+NT_PRPSINFO 3
+NT_PRXREG 4
+NT_TASKSTRUCT 4
+NT_PLATFORM 5
+NT_AUXV 6
+NT_GWINDOWS 7
+NT_ASRS 8
+NT_PSTATUS 10
+NT_PSINFO 13
+NT_PRCRED 14
+NT_UTSNAME 15
+NT_LWPSTATUS 16
+NT_LWPSINFO 17
+NT_PRFPXREG 20
+NT_SIGINFO 0x53494749
+NT_FILE 0x46494c45
+NT_PRXFPREG 0x46e62b7f
+NT_PPC_VMX 0x100
+NT_PPC_SPE 0x101
+NT_PPC_VSX 0x102
+NT_PPC_TAR 0x103
+NT_PPC_PPR 0x104
+NT_PPC_DSCR 0x105
+NT_PPC_EBB 0x106
+NT_PPC_PMU 0x107
+NT_PPC_TM_CGPR 0x108
+NT_PPC_TM_CFPR 0x109
+NT_PPC_TM_CVMX 0x10a
+NT_PPC_TM_CVSX 0x10b
+NT_PPC_TM_SPR 0x10c
+NT_PPC_TM_CTAR 0x10d
+NT_PPC_TM_CPPR 0x10e
+NT_PPC_TM_CDSCR 0x10f
+NT_PPC_PKEY 0x110
+NT_386_TLS 0x200
+NT_386_IOPERM 0x201
+NT_X86_XSTATE 0x202
+NT_S390_HIGH_GPRS 0x300
+NT_S390_TIMER 0x301
+NT_S390_TODCMP 0x302
+NT_S390_TODPREG 0x303
+NT_S390_CTRS 0x304
+NT_S390_PREFIX 0x305
+NT_S390_LAST_BREAK 0x306
+NT_S390_SYSTEM_CALL 0x307
+NT_S390_TDB 0x308
+NT_S390_VXRS_LOW 0x309
+NT_S390_VXRS_HIGH 0x30a
+NT_S390_GS_CB 0x30b
+NT_S390_GS_BC 0x30c
+NT_S390_RI_CB 0x30d
+NT_ARM_VFP 0x400
+NT_ARM_TLS 0x401
+NT_ARM_HW_BREAK 0x402
+NT_ARM_HW_WATCH 0x403
+NT_ARM_SYSTEM_CALL 0x404
+NT_ARM_SVE 0x405
+NT_ARM_PAC_MASK 0x406
+NT_ARM_PACA_KEYS 0x407
+NT_ARM_PACG_KEYS 0x408
+NT_ARM_TAGGED_ADDR_CTRL 0x409
+NT_METAG_CBUF 0x500
+NT_METAG_RPIPE 0x501
+NT_METAG_TLS 0x502
+NT_ARC_V2 0x600
+NT_VMCOREDD 0x700
+NT_MIPS_DSP 0x800
+NT_MIPS_FP_MODE 0x801
+NT_MIPS_MSA 0x802
diff --git a/src/xlat/numa_node.in b/src/xlat/numa_node.in
new file mode 100644
index 000000000..414b35a9a
--- /dev/null
+++ b/src/xlat/numa_node.in
@@ -0,0 +1 @@
+NUMA_NO_NODE -1U
diff --git a/src/xlat/open_access_modes.in b/src/xlat/open_access_modes.in
new file mode 100644
index 000000000..45dcd7374
--- /dev/null
+++ b/src/xlat/open_access_modes.in
@@ -0,0 +1,5 @@
+#value_indexed
+O_RDONLY 0
+O_WRONLY 1
+O_RDWR 2
+O_ACCMODE 3
diff --git a/src/xlat/open_mode_flags.in b/src/xlat/open_mode_flags.in
new file mode 100644
index 000000000..82377e2bc
--- /dev/null
+++ b/src/xlat/open_mode_flags.in
@@ -0,0 +1,199 @@
+/* Generated by maint/gen_xlat_defs.sh -f '#o' -p '[_OF]' -c 'asm-generic/fcntl.h' -a 'asm/fcntl.h' */
+
+#if defined __hppa__ || defined __mips__
+O_CREAT 0400
+#elif defined __alpha__ || defined __sparc__
+O_CREAT 01000
+#else
+O_CREAT 0100
+#endif
+
+#if defined __hppa__ || defined __mips__
+O_EXCL 02000
+#elif defined __alpha__ || defined __sparc__
+O_EXCL 04000
+#else
+O_EXCL 0200
+#endif
+
+#if defined __mips__
+O_NOCTTY 04000
+#elif defined __alpha__
+O_NOCTTY 010000
+#elif defined __sparc__
+O_NOCTTY 0100000
+#elif defined __hppa__
+O_NOCTTY 0400000
+#else
+O_NOCTTY 0400
+#endif
+
+#if defined __alpha__ || defined __sparc__
+O_TRUNC 02000
+#else
+O_TRUNC 01000
+#endif
+
+#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__
+O_APPEND 010
+#else
+O_APPEND 02000
+#endif
+
+#if defined __alpha__
+O_NONBLOCK 04
+#elif defined __mips__
+O_NONBLOCK 0200
+#elif defined __sparc__
+O_NONBLOCK 040000
+#elif defined __hppa__
+O_NONBLOCK 0200004
+#else
+O_NONBLOCK 04000
+#endif
+
+/* O_SYNC should be listed before O_DSYNC and __O_SYNC */
+O_SYNC
+
+#if defined __mips__
+__O_SYNC 040000
+#elif defined __hppa__
+__O_SYNC 0100000
+#elif defined __alpha__
+__O_SYNC 020000000
+#elif defined __sparc__
+__O_SYNC 040000000
+#else
+__O_SYNC 04000000
+#endif
+
+O_ASYNC
+
+#if defined __mips__
+O_DSYNC 020
+#elif defined __sparc__
+O_DSYNC 020000
+#elif defined __alpha__
+O_DSYNC 040000
+#elif defined __hppa__
+O_DSYNC 01000000
+#else
+O_DSYNC 010000
+#endif
+
+#if defined __hppa__
+O_RSYNC 02000000
+#else
+O_RSYNC
+#endif
+
+#if defined O_NDELAY && O_NDELAY & O_NONBLOCK /* O_NDELAY is unusual */
+# ifndef STRACE_WORKAROUND_FOR_O_NDELAY
+# define STRACE_WORKAROUND_FOR_O_NDELAY
+/* On sparc32 O_NDELAY is erroneously defined to (0x0004 | O_NONBLOCK). */
+/* On many architectures O_NDELAY is defined to O_NONBLOCK. */
+/* Both cases are wrong and have to be fixed. */
+# undef O_NDELAY
+# endif
+#endif /* O_NDELAY & O_NONBLOCK */
+
+#if defined __sparc__
+O_NDELAY 04
+#else
+O_NDELAY
+#endif
+
+#if defined __sparc__
+O_DIRECT 04000000
+#elif defined __mips__
+O_DIRECT 0100000
+#elif defined __arm__ || defined __arm64__ || defined __aarch64__ || defined __m68k__
+O_DIRECT 0200000
+#elif defined __powerpc__
+O_DIRECT 0400000
+#elif defined __alpha__
+O_DIRECT 02000000
+#else
+O_DIRECT 040000
+#endif
+
+#if defined __hppa__
+O_LARGEFILE 04000
+#elif defined __mips__
+O_LARGEFILE 020000
+#elif defined __powerpc__
+O_LARGEFILE 0200000
+#elif defined __alpha__ || defined __arm__ || defined __arm64__ || defined __aarch64__ || defined __m68k__
+O_LARGEFILE 0400000
+#elif defined __sparc__
+O_LARGEFILE 01000000
+#else
+O_LARGEFILE 0100000
+#endif
+
+#if defined __hppa__
+O_NOFOLLOW 0200
+#elif defined __arm__ || defined __arm64__ || defined __aarch64__ || defined __m68k__ || defined __powerpc__
+O_NOFOLLOW 0100000
+#elif defined __alpha__
+O_NOFOLLOW 0200000
+#else
+O_NOFOLLOW 0400000
+#endif
+
+#if defined __alpha__ || defined __hppa__
+O_NOATIME 04000000
+#elif defined __sparc__
+O_NOATIME 010000000
+#else
+O_NOATIME 01000000
+#endif
+
+#if defined __alpha__ || defined __hppa__
+O_CLOEXEC 010000000
+#elif defined __sparc__
+O_CLOEXEC 020000000
+#else
+O_CLOEXEC 02000000
+#endif
+
+#if defined __hppa__
+O_PATH 020000000
+#elif defined __alpha__
+O_PATH 040000000
+#elif defined __sparc__
+O_PATH 0100000000
+#else
+O_PATH 010000000
+#endif
+
+/* O_TMPFILE should be listed before O_DIRECTORY and __O_TMPFILE */
+O_TMPFILE
+
+#if defined __hppa__
+__O_TMPFILE 040000000
+#elif defined __alpha__
+__O_TMPFILE 0100000000
+#elif defined __sparc__
+__O_TMPFILE 0200000000
+#else
+__O_TMPFILE 020000000
+#endif
+
+#if defined __hppa__
+O_DIRECTORY 010000
+#elif defined __arm__ || defined __arm64__ || defined __aarch64__ || defined __m68k__ || defined __powerpc__
+O_DIRECTORY 040000
+#elif defined __alpha__
+O_DIRECTORY 0100000
+#else
+O_DIRECTORY 0200000
+#endif
+
+#if defined __sparc__
+FASYNC 0100
+#elif defined __mips__
+FASYNC 010000
+#else
+FASYNC 020000
+#endif
diff --git a/src/xlat/open_resolve_flags.in b/src/xlat/open_resolve_flags.in
new file mode 100644
index 000000000..22d397a65
--- /dev/null
+++ b/src/xlat/open_resolve_flags.in
@@ -0,0 +1,5 @@
+RESOLVE_NO_XDEV 0x01
+RESOLVE_NO_MAGICLINKS 0x02
+RESOLVE_NO_SYMLINKS 0x04
+RESOLVE_BENEATH 0x08
+RESOLVE_IN_ROOT 0x10
diff --git a/src/xlat/open_tree_flags.in b/src/xlat/open_tree_flags.in
new file mode 100644
index 000000000..3080dc083
--- /dev/null
+++ b/src/xlat/open_tree_flags.in
@@ -0,0 +1,10 @@
+OPEN_TREE_CLONE 1
+#if defined OPEN_TREE_CLOEXEC || defined O_CLOEXEC
+OPEN_TREE_CLOEXEC O_CLOEXEC
+#endif
+AT_SYMLINK_NOFOLLOW 0x100
+AT_REMOVEDIR 0x200
+AT_SYMLINK_FOLLOW 0x400
+AT_NO_AUTOMOUNT 0x800
+AT_EMPTY_PATH 0x1000
+AT_RECURSIVE 0x8000
diff --git a/src/xlat/packet_diag_attrs.in b/src/xlat/packet_diag_attrs.in
new file mode 100644
index 000000000..4f688b450
--- /dev/null
+++ b/src/xlat/packet_diag_attrs.in
@@ -0,0 +1,10 @@
+#unconditional
+#value_indexed
+PACKET_DIAG_INFO
+PACKET_DIAG_MCLIST
+PACKET_DIAG_RX_RING
+PACKET_DIAG_TX_RING
+PACKET_DIAG_FANOUT
+PACKET_DIAG_UID
+PACKET_DIAG_MEMINFO
+PACKET_DIAG_FILTER
diff --git a/src/xlat/packet_diag_info_flags.in b/src/xlat/packet_diag_info_flags.in
new file mode 100644
index 000000000..7e591d853
--- /dev/null
+++ b/src/xlat/packet_diag_info_flags.in
@@ -0,0 +1,5 @@
+PDI_RUNNING
+PDI_AUXDATA
+PDI_ORIGDEV
+PDI_VNETHDR
+PDI_LOSS
diff --git a/src/xlat/packet_diag_show.in b/src/xlat/packet_diag_show.in
new file mode 100644
index 000000000..b495af810
--- /dev/null
+++ b/src/xlat/packet_diag_show.in
@@ -0,0 +1,6 @@
+PACKET_SHOW_INFO
+PACKET_SHOW_MCLIST
+PACKET_SHOW_RING_CFG
+PACKET_SHOW_FANOUT
+PACKET_SHOW_MEMINFO
+PACKET_SHOW_FILTER
diff --git a/src/xlat/packet_mreq_type.in b/src/xlat/packet_mreq_type.in
new file mode 100644
index 000000000..0d6adfe3a
--- /dev/null
+++ b/src/xlat/packet_mreq_type.in
@@ -0,0 +1,4 @@
+PACKET_MR_MULTICAST
+PACKET_MR_PROMISC
+PACKET_MR_ALLMULTI
+PACKET_MR_UNICAST
diff --git a/src/xlat/perf_attr_size.in b/src/xlat/perf_attr_size.in
new file mode 100644
index 000000000..9b5cf9894
--- /dev/null
+++ b/src/xlat/perf_attr_size.in
@@ -0,0 +1,7 @@
+PERF_ATTR_SIZE_VER0 64
+PERF_ATTR_SIZE_VER1 72
+PERF_ATTR_SIZE_VER2 80
+PERF_ATTR_SIZE_VER3 96
+PERF_ATTR_SIZE_VER4 104
+PERF_ATTR_SIZE_VER5 112
+PERF_ATTR_SIZE_VER6 120
diff --git a/src/xlat/perf_branch_sample_type.in b/src/xlat/perf_branch_sample_type.in
new file mode 100644
index 000000000..7ae59a65e
--- /dev/null
+++ b/src/xlat/perf_branch_sample_type.in
@@ -0,0 +1,18 @@
+PERF_SAMPLE_BRANCH_USER 1 << 0
+PERF_SAMPLE_BRANCH_KERNEL 1 << 1
+PERF_SAMPLE_BRANCH_HV 1 << 2
+PERF_SAMPLE_BRANCH_ANY 1 << 3
+PERF_SAMPLE_BRANCH_ANY_CALL 1 << 4
+PERF_SAMPLE_BRANCH_ANY_RETURN 1 << 5
+PERF_SAMPLE_BRANCH_IND_CALL 1 << 6
+PERF_SAMPLE_BRANCH_ABORT_TX 1 << 7
+PERF_SAMPLE_BRANCH_IN_TX 1 << 8
+PERF_SAMPLE_BRANCH_NO_TX 1 << 9
+PERF_SAMPLE_BRANCH_COND 1 << 10
+PERF_SAMPLE_BRANCH_CALL_STACK 1 << 11
+PERF_SAMPLE_BRANCH_IND_JUMP 1 << 12
+PERF_SAMPLE_BRANCH_CALL 1 << 13
+PERF_SAMPLE_BRANCH_NO_FLAGS 1 << 14
+PERF_SAMPLE_BRANCH_NO_CYCLES 1 << 15
+PERF_SAMPLE_BRANCH_TYPE_SAVE 1 << 16
+PERF_SAMPLE_BRANCH_HW_INDEX 1 << 17
diff --git a/src/xlat/perf_event_open_flags.in b/src/xlat/perf_event_open_flags.in
new file mode 100644
index 000000000..b2a3450e0
--- /dev/null
+++ b/src/xlat/perf_event_open_flags.in
@@ -0,0 +1,4 @@
+PERF_FLAG_FD_NO_GROUP 1
+PERF_FLAG_FD_OUTPUT 2
+PERF_FLAG_PID_CGROUP 4
+PERF_FLAG_FD_CLOEXEC 8
diff --git a/src/xlat/perf_event_read_format.in b/src/xlat/perf_event_read_format.in
new file mode 100644
index 000000000..a270700fa
--- /dev/null
+++ b/src/xlat/perf_event_read_format.in
@@ -0,0 +1,4 @@
+PERF_FORMAT_TOTAL_TIME_ENABLED 1 << 0
+PERF_FORMAT_TOTAL_TIME_RUNNING 1 << 1
+PERF_FORMAT_ID 1 << 2
+PERF_FORMAT_GROUP 1 << 3
diff --git a/src/xlat/perf_event_sample_format.in b/src/xlat/perf_event_sample_format.in
new file mode 100644
index 000000000..cfa2da65a
--- /dev/null
+++ b/src/xlat/perf_event_sample_format.in
@@ -0,0 +1,21 @@
+PERF_SAMPLE_IP 1 << 0
+PERF_SAMPLE_TID 1 << 1
+PERF_SAMPLE_TIME 1 << 2
+PERF_SAMPLE_ADDR 1 << 3
+PERF_SAMPLE_READ 1 << 4
+PERF_SAMPLE_CALLCHAIN 1 << 5
+PERF_SAMPLE_ID 1 << 6
+PERF_SAMPLE_CPU 1 << 7
+PERF_SAMPLE_PERIOD 1 << 8
+PERF_SAMPLE_STREAM_ID 1 << 9
+PERF_SAMPLE_RAW 1 << 10
+PERF_SAMPLE_BRANCH_STACK 1 << 11
+PERF_SAMPLE_REGS_USER 1 << 12
+PERF_SAMPLE_STACK_USER 1 << 13
+PERF_SAMPLE_WEIGHT 1 << 14
+PERF_SAMPLE_DATA_SRC 1 << 15
+PERF_SAMPLE_IDENTIFIER 1 << 16
+PERF_SAMPLE_TRANSACTION 1 << 17
+PERF_SAMPLE_REGS_INTR 1 << 18
+PERF_SAMPLE_PHYS_ADDR 1 << 19
+PERF_SAMPLE_AUX 1 << 20
diff --git a/src/xlat/perf_hw_cache_id.in b/src/xlat/perf_hw_cache_id.in
new file mode 100644
index 000000000..40c2827d3
--- /dev/null
+++ b/src/xlat/perf_hw_cache_id.in
@@ -0,0 +1,8 @@
+#sorted sort -k2,2n
+PERF_COUNT_HW_CACHE_L1D 0
+PERF_COUNT_HW_CACHE_L1I 1
+PERF_COUNT_HW_CACHE_LL 2
+PERF_COUNT_HW_CACHE_DTLB 3
+PERF_COUNT_HW_CACHE_ITLB 4
+PERF_COUNT_HW_CACHE_BPU 5
+PERF_COUNT_HW_CACHE_NODE 6
diff --git a/src/xlat/perf_hw_cache_op_id.in b/src/xlat/perf_hw_cache_op_id.in
new file mode 100644
index 000000000..0b27e866d
--- /dev/null
+++ b/src/xlat/perf_hw_cache_op_id.in
@@ -0,0 +1,4 @@
+#sorted sort -k2,2n
+PERF_COUNT_HW_CACHE_OP_READ 0
+PERF_COUNT_HW_CACHE_OP_WRITE 1
+PERF_COUNT_HW_CACHE_OP_PREFETCH 2
diff --git a/src/xlat/perf_hw_cache_op_result_id.in b/src/xlat/perf_hw_cache_op_result_id.in
new file mode 100644
index 000000000..e40322902
--- /dev/null
+++ b/src/xlat/perf_hw_cache_op_result_id.in
@@ -0,0 +1,3 @@
+#sorted sort -k2,2n
+PERF_COUNT_HW_CACHE_RESULT_ACCESS 0
+PERF_COUNT_HW_CACHE_RESULT_MISS 1
diff --git a/src/xlat/perf_hw_id.in b/src/xlat/perf_hw_id.in
new file mode 100644
index 000000000..3b0ce4a7c
--- /dev/null
+++ b/src/xlat/perf_hw_id.in
@@ -0,0 +1,11 @@
+#sorted sort -k2,2n
+PERF_COUNT_HW_CPU_CYCLES 0
+PERF_COUNT_HW_INSTRUCTIONS 1
+PERF_COUNT_HW_CACHE_REFERENCES 2
+PERF_COUNT_HW_CACHE_MISSES 3
+PERF_COUNT_HW_BRANCH_INSTRUCTIONS 4
+PERF_COUNT_HW_BRANCH_MISSES 5
+PERF_COUNT_HW_BUS_CYCLES 6
+PERF_COUNT_HW_STALLED_CYCLES_FRONTEND 7
+PERF_COUNT_HW_STALLED_CYCLES_BACKEND 8
+PERF_COUNT_HW_REF_CPU_CYCLES 9
diff --git a/src/xlat/perf_ioctl_cmds.in b/src/xlat/perf_ioctl_cmds.in
new file mode 100644
index 000000000..bf7ad78a3
--- /dev/null
+++ b/src/xlat/perf_ioctl_cmds.in
@@ -0,0 +1,12 @@
+PERF_EVENT_IOC_ENABLE _IO ('$', 0)
+PERF_EVENT_IOC_DISABLE _IO ('$', 1)
+PERF_EVENT_IOC_REFRESH _IO ('$', 2)
+PERF_EVENT_IOC_RESET _IO ('$', 3)
+PERF_EVENT_IOC_PERIOD _IOW('$', 4, uint64_t)
+PERF_EVENT_IOC_SET_OUTPUT _IO ('$', 5)
+PERF_EVENT_IOC_SET_FILTER _IOW('$', 6, char *)
+PERF_EVENT_IOC_ID _IOR('$', 7, uint64_t *)
+PERF_EVENT_IOC_SET_BPF _IOW('$', 8, uint32_t)
+PERF_EVENT_IOC_PAUSE_OUTPUT _IOW('$', 9, uint32_t)
+PERF_EVENT_IOC_QUERY_BPF _IOWR('$', 10, struct perf_event_query_bpf *)
+PERF_EVENT_IOC_MODIFY_ATTRIBUTES _IOW('$', 11, struct perf_event_attr *)
diff --git a/src/xlat/perf_ioctl_flags.in b/src/xlat/perf_ioctl_flags.in
new file mode 100644
index 000000000..502f69a73
--- /dev/null
+++ b/src/xlat/perf_ioctl_flags.in
@@ -0,0 +1 @@
+PERF_IOC_FLAG_GROUP (1U << 0)
diff --git a/src/xlat/perf_sw_ids.in b/src/xlat/perf_sw_ids.in
new file mode 100644
index 000000000..0e097112c
--- /dev/null
+++ b/src/xlat/perf_sw_ids.in
@@ -0,0 +1,12 @@
+#sorted sort -k2,2n
+PERF_COUNT_SW_CPU_CLOCK 0
+PERF_COUNT_SW_TASK_CLOCK 1
+PERF_COUNT_SW_PAGE_FAULTS 2
+PERF_COUNT_SW_CONTEXT_SWITCHES 3
+PERF_COUNT_SW_CPU_MIGRATIONS 4
+PERF_COUNT_SW_PAGE_FAULTS_MIN 5
+PERF_COUNT_SW_PAGE_FAULTS_MAJ 6
+PERF_COUNT_SW_ALIGNMENT_FAULTS 7
+PERF_COUNT_SW_EMULATION_FAULTS 8
+PERF_COUNT_SW_DUMMY 9
+PERF_COUNT_SW_BPF_OUTPUT 10
diff --git a/src/xlat/perf_type_id.in b/src/xlat/perf_type_id.in
new file mode 100644
index 000000000..29f6f2b85
--- /dev/null
+++ b/src/xlat/perf_type_id.in
@@ -0,0 +1,7 @@
+#sorted sort -k2,2n
+PERF_TYPE_HARDWARE 0
+PERF_TYPE_SOFTWARE 1
+PERF_TYPE_TRACEPOINT 2
+PERF_TYPE_HW_CACHE 3
+PERF_TYPE_RAW 4
+PERF_TYPE_BREAKPOINT 5
diff --git a/src/xlat/personality_flags.in b/src/xlat/personality_flags.in
new file mode 100644
index 000000000..886b5b998
--- /dev/null
+++ b/src/xlat/personality_flags.in
@@ -0,0 +1,11 @@
+UNAME26 0x0020000
+ADDR_NO_RANDOMIZE 0x0040000
+FDPIC_FUNCPTRS 0x0080000
+MMAP_PAGE_ZERO 0x0100000
+ADDR_COMPAT_LAYOUT 0x0200000
+READ_IMPLIES_EXEC 0x0400000
+ADDR_LIMIT_32BIT 0x0800000
+SHORT_INODE 0x1000000
+WHOLE_SECONDS 0x2000000
+STICKY_TIMEOUTS 0x4000000
+ADDR_LIMIT_3GB 0x8000000
diff --git a/src/xlat/personality_types.in b/src/xlat/personality_types.in
new file mode 100644
index 000000000..5b2f545de
--- /dev/null
+++ b/src/xlat/personality_types.in
@@ -0,0 +1,23 @@
+PER_LINUX 0
+PER_LINUX_32BIT ADDR_LIMIT_32BIT
+PER_LINUX_FDPIC FDPIC_FUNCPTRS
+PER_SVR4 (0x0001 | STICKY_TIMEOUTS | MMAP_PAGE_ZERO)
+PER_SVR3 (0x0002 | STICKY_TIMEOUTS | SHORT_INODE)
+PER_SCOSVR3 (0x0003 | STICKY_TIMEOUTS | WHOLE_SECONDS | SHORT_INODE)
+PER_OSR5 (0x0003 | STICKY_TIMEOUTS | WHOLE_SECONDS)
+PER_WYSEV386 (0x0004 | STICKY_TIMEOUTS | SHORT_INODE)
+PER_ISCR4 (0x0005 | STICKY_TIMEOUTS)
+PER_BSD 0x0006
+PER_SUNOS (0x0006 | STICKY_TIMEOUTS)
+PER_XENIX (0x0007 | STICKY_TIMEOUTS | SHORT_INODE)
+PER_LINUX32 0x0008
+PER_LINUX32_3GB (0x0008 | ADDR_LIMIT_3GB)
+PER_IRIX32 (0x0009 | STICKY_TIMEOUTS)
+PER_IRIXN32 (0x000a | STICKY_TIMEOUTS)
+PER_IRIX64 (0x000b | STICKY_TIMEOUTS)
+PER_RISCOS 0x000c
+PER_SOLARIS (0x000d | STICKY_TIMEOUTS)
+PER_UW7 (0x000e | STICKY_TIMEOUTS | MMAP_PAGE_ZERO)
+PER_OSF4 0x000f
+PER_HPUX 0x0010
+PER_MASK 0x00ff
diff --git a/src/xlat/phonet_protocols.in b/src/xlat/phonet_protocols.in
new file mode 100644
index 000000000..5245ed7eb
--- /dev/null
+++ b/src/xlat/phonet_protocols.in
@@ -0,0 +1,4 @@
+#value_indexed
+PN_PROTO_TRANSPORT 0
+PN_PROTO_PHONET 1
+PN_PROTO_PIPE 2
diff --git a/src/xlat/pidfd_open_flags.in b/src/xlat/pidfd_open_flags.in
new file mode 100644
index 000000000..aac14f2ae
--- /dev/null
+++ b/src/xlat/pidfd_open_flags.in
@@ -0,0 +1 @@
+PIDFD_NONBLOCK O_NONBLOCK
diff --git a/src/xlat/pkey_access.in b/src/xlat/pkey_access.in
new file mode 100644
index 000000000..108eb3b73
--- /dev/null
+++ b/src/xlat/pkey_access.in
@@ -0,0 +1,3 @@
+PKEY_DISABLE_ACCESS 0x1
+PKEY_DISABLE_WRITE 0x2
+PKEY_DISABLE_EXECUTE 0x4
diff --git a/src/xlat/pollflags.in b/src/xlat/pollflags.in
new file mode 100644
index 000000000..8081e78ba
--- /dev/null
+++ b/src/xlat/pollflags.in
@@ -0,0 +1,42 @@
+POLLIN 0x0001
+POLLPRI 0x0002
+POLLOUT 0x0004
+POLLERR 0x0008
+POLLHUP 0x0010
+POLLNVAL 0x0020
+POLLRDNORM 0x0040
+POLLRDBAND 0x0080
+
+#if defined(__m68k__) || defined(__mips__) || defined(__sparc__) || defined(__xtensa__)
+/* POLLWRNORM POLLOUT */
+#else
+POLLWRNORM 0x0100
+#endif
+
+#if defined(__m68k__) || defined(__mips__) || defined(__sparc__) || defined(__xtensa__)
+POLLWRBAND 0x0100
+#else
+POLLWRBAND 0x0200
+#endif
+
+#if defined(__sparc__)
+POLLMSG 0x0200
+#else
+POLLMSG 0x0400
+#endif
+
+#if defined(__sparc__)
+POLLREMOVE 0x0400
+#elif defined(__xtensa__)
+POLLREMOVE 0x0800
+#else
+POLLREMOVE 0x1000
+#endif
+
+#if defined(__sparc__)
+POLLRDHUP 0x0800
+#else
+POLLRDHUP 0x2000
+#endif
+
+POLL_BUSY_LOOP 0x8000
diff --git a/src/xlat/pr_cap_ambient.in b/src/xlat/pr_cap_ambient.in
new file mode 100644
index 000000000..321fe364f
--- /dev/null
+++ b/src/xlat/pr_cap_ambient.in
@@ -0,0 +1,5 @@
+#value_indexed
+PR_CAP_AMBIENT_IS_SET 1
+PR_CAP_AMBIENT_RAISE 2
+PR_CAP_AMBIENT_LOWER 3
+PR_CAP_AMBIENT_CLEAR_ALL 4
diff --git a/src/xlat/pr_dumpable.in b/src/xlat/pr_dumpable.in
new file mode 100644
index 000000000..b73fb648d
--- /dev/null
+++ b/src/xlat/pr_dumpable.in
@@ -0,0 +1,5 @@
+#value_indexed
+/* Defined in include/linux/sched.h */
+SUID_DUMP_DISABLE 0 /* No setuid dumping */
+SUID_DUMP_USER 1 /* Dump as user of process */
+SUID_DUMP_ROOT 2 /* Dump as root */
diff --git a/src/xlat/pr_fp_mode.in b/src/xlat/pr_fp_mode.in
new file mode 100644
index 000000000..8f1445466
--- /dev/null
+++ b/src/xlat/pr_fp_mode.in
@@ -0,0 +1,2 @@
+PR_FP_MODE_FR (1 << 0) /* 64b FP registers */
+PR_FP_MODE_FRE (1 << 1) /* 32b compatibility */
diff --git a/src/xlat/pr_mce_kill.in b/src/xlat/pr_mce_kill.in
new file mode 100644
index 000000000..66f5121f2
--- /dev/null
+++ b/src/xlat/pr_mce_kill.in
@@ -0,0 +1,3 @@
+#value_indexed
+PR_MCE_KILL_CLEAR 0
+PR_MCE_KILL_SET 1
diff --git a/src/xlat/pr_mce_kill_policy.in b/src/xlat/pr_mce_kill_policy.in
new file mode 100644
index 000000000..ad05cbf13
--- /dev/null
+++ b/src/xlat/pr_mce_kill_policy.in
@@ -0,0 +1,4 @@
+#value_indexed
+PR_MCE_KILL_LATE 0
+PR_MCE_KILL_EARLY 1
+PR_MCE_KILL_DEFAULT 2
diff --git a/src/xlat/pr_set_mm.in b/src/xlat/pr_set_mm.in
new file mode 100644
index 000000000..65dda0809
--- /dev/null
+++ b/src/xlat/pr_set_mm.in
@@ -0,0 +1,16 @@
+#value_indexed
+PR_SET_MM_START_CODE 1
+PR_SET_MM_END_CODE 2
+PR_SET_MM_START_DATA 3
+PR_SET_MM_END_DATA 4
+PR_SET_MM_START_STACK 5
+PR_SET_MM_START_BRK 6
+PR_SET_MM_BRK 7
+PR_SET_MM_ARG_START 8
+PR_SET_MM_ARG_END 9
+PR_SET_MM_ENV_START 10
+PR_SET_MM_ENV_END 11
+PR_SET_MM_AUXV 12
+PR_SET_MM_EXE_FILE 13
+PR_SET_MM_MAP 14
+PR_SET_MM_MAP_SIZE 15
diff --git a/src/xlat/pr_spec_cmds.in b/src/xlat/pr_spec_cmds.in
new file mode 100644
index 000000000..8e5ded0b3
--- /dev/null
+++ b/src/xlat/pr_spec_cmds.in
@@ -0,0 +1,3 @@
+#value_indexed
+PR_SPEC_STORE_BYPASS 0
+PR_SPEC_INDIRECT_BRANCH 1
diff --git a/src/xlat/pr_spec_get_store_bypass_flags.in b/src/xlat/pr_spec_get_store_bypass_flags.in
new file mode 100644
index 000000000..64309c380
--- /dev/null
+++ b/src/xlat/pr_spec_get_store_bypass_flags.in
@@ -0,0 +1,6 @@
+PR_SPEC_NOT_AFFECTED 0
+PR_SPEC_PRCTL (1 << 0)
+PR_SPEC_ENABLE (1 << 1)
+PR_SPEC_DISABLE (1 << 2)
+PR_SPEC_FORCE_DISABLE (1 << 3)
+PR_SPEC_DISABLE_NOEXEC (1 << 4)
diff --git a/src/xlat/pr_spec_set_store_bypass_flags.in b/src/xlat/pr_spec_set_store_bypass_flags.in
new file mode 100644
index 000000000..6f9b62595
--- /dev/null
+++ b/src/xlat/pr_spec_set_store_bypass_flags.in
@@ -0,0 +1,4 @@
+PR_SPEC_ENABLE (1 << 1)
+PR_SPEC_DISABLE (1 << 2)
+PR_SPEC_FORCE_DISABLE (1 << 3)
+PR_SPEC_DISABLE_NOEXEC (1 << 4)
diff --git a/src/xlat/pr_sve_vl_flags.in b/src/xlat/pr_sve_vl_flags.in
new file mode 100644
index 000000000..dcd699803
--- /dev/null
+++ b/src/xlat/pr_sve_vl_flags.in
@@ -0,0 +1,2 @@
+PR_SVE_SET_VL_ONEXEC (1 << 18)
+PR_SVE_VL_INHERIT (1 << 17)
diff --git a/src/xlat/pr_tsc.in b/src/xlat/pr_tsc.in
new file mode 100644
index 000000000..2c3eb0026
--- /dev/null
+++ b/src/xlat/pr_tsc.in
@@ -0,0 +1,3 @@
+#value_indexed
+PR_TSC_ENABLE 1
+PR_TSC_SIGSEGV 2
diff --git a/src/xlat/pr_unalign_flags.in b/src/xlat/pr_unalign_flags.in
new file mode 100644
index 000000000..0d3f2ff84
--- /dev/null
+++ b/src/xlat/pr_unalign_flags.in
@@ -0,0 +1,2 @@
+PR_UNALIGN_NOPRINT 1
+PR_UNALIGN_SIGBUS 2
diff --git a/src/xlat/prctl_options.in b/src/xlat/prctl_options.in
new file mode 100644
index 000000000..892fff601
--- /dev/null
+++ b/src/xlat/prctl_options.in
@@ -0,0 +1,57 @@
+#sorted
+PR_SET_PDEATHSIG 1
+PR_GET_PDEATHSIG 2
+PR_GET_DUMPABLE 3
+PR_SET_DUMPABLE 4
+PR_GET_UNALIGN 5
+PR_SET_UNALIGN 6
+PR_GET_KEEPCAPS 7
+PR_SET_KEEPCAPS 8
+PR_GET_FPEMU 9
+PR_SET_FPEMU 10
+PR_GET_FPEXC 11
+PR_SET_FPEXC 12
+PR_GET_TIMING 13
+PR_SET_TIMING 14
+PR_SET_NAME 15
+PR_GET_NAME 16
+PR_GET_ENDIAN 19
+PR_SET_ENDIAN 20
+PR_GET_SECCOMP 21
+PR_SET_SECCOMP 22
+PR_CAPBSET_READ 23
+PR_CAPBSET_DROP 24
+PR_GET_TSC 25
+PR_SET_TSC 26
+PR_GET_SECUREBITS 27
+PR_SET_SECUREBITS 28
+PR_SET_TIMERSLACK 29
+PR_GET_TIMERSLACK 30
+PR_TASK_PERF_EVENTS_DISABLE 31
+PR_TASK_PERF_EVENTS_ENABLE 32
+PR_MCE_KILL 33
+PR_MCE_KILL_GET 34
+PR_SET_MM 35
+PR_SET_CHILD_SUBREAPER 36
+PR_GET_CHILD_SUBREAPER 37
+PR_SET_NO_NEW_PRIVS 38
+PR_GET_NO_NEW_PRIVS 39
+PR_GET_TID_ADDRESS 40
+PR_SET_THP_DISABLE 41
+PR_GET_THP_DISABLE 42
+PR_MPX_ENABLE_MANAGEMENT 43
+PR_MPX_DISABLE_MANAGEMENT 44
+PR_SET_FP_MODE 45
+PR_GET_FP_MODE 46
+PR_CAP_AMBIENT 47
+PR_SVE_SET_VL 50
+PR_SVE_GET_VL 51
+PR_GET_SPECULATION_CTRL 52
+PR_SET_SPECULATION_CTRL 53
+PR_PAC_RESET_KEYS 54
+PR_SET_TAGGED_ADDR_CTRL 55
+PR_GET_TAGGED_ADDR_CTRL 56
+PR_SET_IO_FLUSHER 57
+PR_GET_IO_FLUSHER 58
+PR_SET_VMA 0x53564d41 /* "SVMA" */
+PR_SET_PTRACER 0x59616d61 /* "Yama" */
diff --git a/src/xlat/priorities.in b/src/xlat/priorities.in
new file mode 100644
index 000000000..d1eaaeeec
--- /dev/null
+++ b/src/xlat/priorities.in
@@ -0,0 +1,3 @@
+PRIO_PROCESS
+PRIO_PGRP
+PRIO_USER
diff --git a/src/xlat/ptp_extts_flags.in b/src/xlat/ptp_extts_flags.in
new file mode 100644
index 000000000..63e8fc97e
--- /dev/null
+++ b/src/xlat/ptp_extts_flags.in
@@ -0,0 +1,4 @@
+PTP_ENABLE_FEATURE (1<<0)
+PTP_RISING_EDGE (1<<1)
+PTP_FALLING_EDGE (1<<2)
+PTP_STRICT_FLAGS (1<<3)
diff --git a/src/xlat/ptp_perout_flags.in b/src/xlat/ptp_perout_flags.in
new file mode 100644
index 000000000..ecb0c298c
--- /dev/null
+++ b/src/xlat/ptp_perout_flags.in
@@ -0,0 +1,3 @@
+PTP_PEROUT_ONE_SHOT (1<<0)
+PTP_PEROUT_DUTY_CYCLE (1<<1)
+PTP_PEROUT_PHASE (1<<2)
diff --git a/src/xlat/ptrace_cmds.in b/src/xlat/ptrace_cmds.in
new file mode 100644
index 000000000..48ae959b2
--- /dev/null
+++ b/src/xlat/ptrace_cmds.in
@@ -0,0 +1,474 @@
+/* Generated by maint/gen_xlat_defs.sh -f '#x' -p 'PTRACE_' -c 'linux/ptrace.h' -a 'asm/ptrace*.h' */
+PTRACE_TRACEME 0
+PTRACE_PEEKTEXT 0x1
+PTRACE_PEEKDATA 0x2
+PTRACE_PEEKUSER 0x3 /* PTRACE_PEEKUSR in kernel headers */
+PTRACE_POKETEXT 0x4
+PTRACE_POKEDATA 0x5
+PTRACE_POKEUSER 0x6 /* PTRACE_POKEUSR in kernel headers*/
+PTRACE_CONT 0x7
+PTRACE_KILL 0x8
+PTRACE_SINGLESTEP 0x9
+PTRACE_ATTACH 0x10
+
+/*
+ * On sparc, there is PTRACE_SPARC_DETACH (= 11) that is used instead
+ * of PTRACE_DETACH, as PTRACE_DETACH's number (0x11) is occupied
+ * by PTRACE_WRITEDATA.
+ */
+#if !defined __sparc__
+PTRACE_DETACH 0x11
+#else
+PTRACE_DETACH
+#endif
+
+PTRACE_SYSCALL 0x18
+
+PTRACE_SETOPTIONS 0x4200
+PTRACE_GETEVENTMSG 0x4201
+PTRACE_GETSIGINFO 0x4202
+PTRACE_SETSIGINFO 0x4203
+PTRACE_GETREGSET 0x4204
+PTRACE_SETREGSET 0x4205
+PTRACE_SEIZE 0x4206
+PTRACE_INTERRUPT 0x4207
+PTRACE_LISTEN 0x4208
+PTRACE_PEEKSIGINFO 0x4209
+PTRACE_GETSIGMASK 0x420a
+PTRACE_SETSIGMASK 0x420b
+PTRACE_SECCOMP_GET_FILTER 0x420c
+PTRACE_SECCOMP_GET_METADATA 0x420d
+PTRACE_GET_SYSCALL_INFO 0x420e
+
+/* arch-specific */
+#if defined __arm__ || defined __m68k__ || defined __mips__ || defined __powerpc__ || defined __sh__ || defined __sparc__ || defined __x86_64__ || defined __i386__ || defined __xtensa__
+PTRACE_GETREGS 0xc
+#elif defined __hppa__ || defined __ia64__
+PTRACE_GETREGS 0x12
+#else
+PTRACE_GETREGS
+#endif
+
+#if defined __arm__ || defined __m68k__ || defined __mips__ || defined __powerpc__ || defined __sh__ || defined __sparc__ || defined __x86_64__ || defined __i386__ || defined __xtensa__
+PTRACE_SETREGS 0xd
+#elif defined __hppa__ || defined __ia64__
+PTRACE_SETREGS 0x13
+#else
+PTRACE_SETREGS
+#endif
+
+#if defined __arm__ || defined __hppa__ || defined __m68k__ || defined __mips__ || defined __powerpc__ || defined __sh__ || defined __sparc__ || defined __x86_64__ || defined __i386__
+PTRACE_GETFPREGS 0xe
+#else
+PTRACE_GETFPREGS
+#endif
+
+#if defined __arm__ || defined __hppa__ || defined __m68k__ || defined __mips__ || defined __powerpc__ || defined __sh__ || defined __sparc__ || defined __x86_64__ || defined __i386__
+PTRACE_SETFPREGS 0xf
+#else
+PTRACE_SETFPREGS
+#endif
+
+#if defined __mips__ || defined __x86_64__ || defined __i386__
+PTRACE_GETFPXREGS 0x12
+#else
+PTRACE_GETFPXREGS
+#endif
+
+#if defined __mips__ || defined __x86_64__ || defined __i386__
+PTRACE_SETFPXREGS 0x13
+#else
+PTRACE_SETFPXREGS
+#endif
+
+#if defined __xtensa__
+PTRACE_GETHBPREGS 0x14
+#elif defined __arm__
+PTRACE_GETHBPREGS 0x1d
+#else
+PTRACE_GETHBPREGS
+#endif
+
+#if defined __xtensa__
+PTRACE_SETHBPREGS 0x15
+#elif defined __arm__
+PTRACE_SETHBPREGS 0x1e
+#else
+PTRACE_SETHBPREGS
+#endif
+
+#if defined __arm__ || defined __ia64__ || defined __mips__ || defined __s390__ || defined __x86_64__ || defined __i386__
+PTRACE_OLDSETOPTIONS 0x15
+#else
+PTRACE_OLDSETOPTIONS
+#endif
+
+#if defined __powerpc__ || defined __sparc__
+PTRACE_GETREGS64 0x16
+#else
+PTRACE_GETREGS64
+#endif
+#if defined __powerpc__ || defined __sparc__
+PTRACE_SETREGS64 0x17
+#else
+PTRACE_SETREGS64
+#endif
+
+#if defined __arm__ || defined __unicore32__
+PTRACE_GET_THREAD_AREA 0x16
+#elif defined __arc__ || defined __m68k__ || defined __mips__ || defined __x86_64__ || defined __i386__
+PTRACE_GET_THREAD_AREA 0x19
+#else
+PTRACE_GET_THREAD_AREA
+#endif
+
+#if defined __mips__ || defined __x86_64__ || defined __i386__
+PTRACE_SET_THREAD_AREA 0x1a
+#else
+PTRACE_SET_THREAD_AREA
+#endif
+
+#if defined __arm__ || defined __c6x__ || defined __sh__
+PTRACE_GETFDPIC 0x1f
+#else
+PTRACE_GETFDPIC
+#endif
+
+#if defined __powerpc__
+PTRACE_SYSEMU 0x1d
+#elif defined __arm64__ || defined __aarch64__ || defined __x86_64__ || defined __i386__
+PTRACE_SYSEMU 0x1f
+#else
+PTRACE_SYSEMU
+#endif
+
+#if defined __powerpc__
+PTRACE_SYSEMU_SINGLESTEP 0x1e
+#elif defined __arm64__ || defined __aarch64__ || defined __x86_64__ || defined __i386__
+PTRACE_SYSEMU_SINGLESTEP 0x20
+#else
+PTRACE_SYSEMU_SINGLESTEP
+#endif
+
+#if defined __hppa__ || defined __ia64__ || defined __s390__
+PTRACE_SINGLEBLOCK 0xc
+#elif defined __m68k__ || defined __x86_64__ || defined __i386__
+PTRACE_SINGLEBLOCK 0x21
+#elif defined __powerpc__
+PTRACE_SINGLEBLOCK 0x100
+#else
+PTRACE_SINGLEBLOCK
+#endif
+
+/* arm */
+#if defined __arm__
+PTRACE_GETWMMXREGS 0x12
+#else
+PTRACE_GETWMMXREGS
+#endif
+#if defined __arm__
+PTRACE_SETWMMXREGS 0x13
+#else
+PTRACE_SETWMMXREGS
+#endif
+#if defined __arm__
+PTRACE_SET_SYSCALL 0x17
+#else
+PTRACE_SET_SYSCALL
+#endif
+#if defined __arm__
+PTRACE_GETCRUNCHREGS 0x19
+#else
+PTRACE_GETCRUNCHREGS
+#endif
+#if defined __arm__
+PTRACE_SETCRUNCHREGS 0x1a
+#else
+PTRACE_SETCRUNCHREGS
+#endif
+#if defined __arm__
+PTRACE_GETVFPREGS 0x1b
+#else
+PTRACE_GETVFPREGS
+#endif
+#if defined __arm__
+PTRACE_SETVFPREGS 0x1c
+#else
+PTRACE_SETVFPREGS
+#endif
+
+/* ia64 */
+#if defined __ia64__
+PTRACE_OLD_GETSIGINFO 0xd
+#else
+PTRACE_OLD_GETSIGINFO
+#endif
+#if defined __ia64__
+PTRACE_OLD_SETSIGINFO 0xe
+#else
+PTRACE_OLD_SETSIGINFO
+#endif
+
+/* mips */
+#if defined __mips__
+PTRACE_PEEKTEXT_3264 0xc0
+#else
+PTRACE_PEEKTEXT_3264
+#endif
+#if defined __mips__
+PTRACE_PEEKDATA_3264 0xc1
+#else
+PTRACE_PEEKDATA_3264
+#endif
+#if defined __mips__
+PTRACE_POKETEXT_3264 0xc2
+#else
+PTRACE_POKETEXT_3264
+#endif
+#if defined __mips__
+PTRACE_POKEDATA_3264 0xc3
+#else
+PTRACE_POKEDATA_3264
+#endif
+#if defined __mips__
+PTRACE_GET_THREAD_AREA_3264 0xc4
+#else
+PTRACE_GET_THREAD_AREA_3264
+#endif
+#if defined __mips__
+PTRACE_GET_WATCH_REGS 0xd0
+#else
+PTRACE_GET_WATCH_REGS
+#endif
+#if defined __mips__
+PTRACE_SET_WATCH_REGS 0xd1
+#else
+PTRACE_SET_WATCH_REGS
+#endif
+
+/* powerpc */
+#if defined __powerpc__
+PTRACE_GETVRREGS 0x12
+#else
+PTRACE_GETVRREGS
+#endif
+#if defined __powerpc__
+PTRACE_SETVRREGS 0x13
+#else
+PTRACE_SETVRREGS
+#endif
+#if defined __powerpc__
+PTRACE_GETEVRREGS 0x14
+#else
+PTRACE_GETEVRREGS
+#endif
+#if defined __powerpc__
+PTRACE_SETEVRREGS 0x15
+#else
+PTRACE_SETEVRREGS
+#endif
+#if defined __powerpc__
+PTRACE_GETVSRREGS 0x1b
+#else
+PTRACE_GETVSRREGS
+#endif
+#if defined __powerpc__
+PTRACE_SETVSRREGS 0x1c
+#else
+PTRACE_SETVSRREGS
+#endif
+#if defined __powerpc__
+PTRACE_GET_DEBUGREG 0x19
+#else
+PTRACE_GET_DEBUGREG
+#endif
+#if defined __powerpc__
+PTRACE_SET_DEBUGREG 0x1a
+#else
+PTRACE_SET_DEBUGREG
+#endif
+#if defined __powerpc__
+PPC_PTRACE_DELHWDEBUG 0x87
+#else
+PPC_PTRACE_DELHWDEBUG
+#endif
+#if defined __powerpc__
+PPC_PTRACE_SETHWDEBUG 0x88
+#else
+PPC_PTRACE_SETHWDEBUG
+#endif
+#if defined __powerpc__
+PPC_PTRACE_GETHWDBGINFO 0x89
+#else
+PPC_PTRACE_GETHWDBGINFO
+#endif
+#if defined __powerpc__
+PPC_PTRACE_POKEUSR_3264 0x90
+#else
+PPC_PTRACE_POKEUSR_3264
+#endif
+#if defined __powerpc__
+PPC_PTRACE_PEEKUSR_3264 0x91
+#else
+PPC_PTRACE_PEEKUSR_3264
+#endif
+#if defined __powerpc__
+PPC_PTRACE_POKEDATA_3264 0x92
+#else
+PPC_PTRACE_POKEDATA_3264
+#endif
+#if defined __powerpc__
+PPC_PTRACE_POKETEXT_3264 0x93
+#else
+PPC_PTRACE_POKETEXT_3264
+#endif
+#if defined __powerpc__
+PPC_PTRACE_PEEKDATA_3264 0x94
+#else
+PPC_PTRACE_PEEKDATA_3264
+#endif
+#if defined __powerpc__
+PPC_PTRACE_PEEKTEXT_3264 0x95
+#else
+PPC_PTRACE_PEEKTEXT_3264
+#endif
+
+/* s390 */
+#if defined __s390__
+PTRACE_PEEKUSR_AREA 0x5000
+#else
+PTRACE_PEEKUSR_AREA
+#endif
+#if defined __s390__
+PTRACE_POKEUSR_AREA 0x5001
+#else
+PTRACE_POKEUSR_AREA
+#endif
+#if defined __s390__
+PTRACE_PEEKTEXT_AREA 0x5002
+#else
+PTRACE_PEEKTEXT_AREA
+#endif
+#if defined __s390__
+PTRACE_PEEKDATA_AREA 0x5003
+#else
+PTRACE_PEEKDATA_AREA
+#endif
+#if defined __s390__
+PTRACE_POKETEXT_AREA 0x5004
+#else
+PTRACE_POKETEXT_AREA
+#endif
+#if defined __s390__
+PTRACE_POKEDATA_AREA 0x5005
+#else
+PTRACE_POKEDATA_AREA
+#endif
+#if defined __s390__
+PTRACE_GET_LAST_BREAK 0x5006
+#else
+PTRACE_GET_LAST_BREAK
+#endif
+#if defined __s390__
+PTRACE_PEEK_SYSTEM_CALL 0x5007
+#else
+PTRACE_PEEK_SYSTEM_CALL
+#endif
+#if defined __s390__
+PTRACE_POKE_SYSTEM_CALL 0x5008
+#else
+PTRACE_POKE_SYSTEM_CALL
+#endif
+#if defined __s390__
+PTRACE_ENABLE_TE 0x5009
+#else
+PTRACE_ENABLE_TE
+#endif
+#if defined __s390__
+PTRACE_DISABLE_TE 0x5010
+#else
+PTRACE_DISABLE_TE
+#endif
+#if defined __s390__
+PTRACE_TE_ABORT_RAND 0x5011
+#else
+PTRACE_TE_ABORT_RAND
+#endif
+
+/* sh */
+#if defined __sh__
+PTRACE_GETDSPREGS 0x37
+#else
+PTRACE_GETDSPREGS
+#endif
+#if defined __sh__
+PTRACE_SETDSPREGS 0x38
+#else
+PTRACE_SETDSPREGS
+#endif
+
+/* sparc */
+#if defined __sparc__
+PTRACE_SPARC_DETACH 0xb
+#else
+PTRACE_SPARC_DETACH
+#endif
+#if defined __sparc__
+PTRACE_READDATA 0x10
+#else
+PTRACE_READDATA
+#endif
+#if defined __sparc__
+PTRACE_WRITEDATA 0x11
+#else
+PTRACE_WRITEDATA
+#endif
+#if defined __sparc__
+PTRACE_READTEXT 0x12
+#else
+PTRACE_READTEXT
+#endif
+#if defined __sparc__
+PTRACE_WRITETEXT 0x13
+#else
+PTRACE_WRITETEXT
+#endif
+#if defined __sparc__
+PTRACE_GETFPAREGS 0x14
+#else
+PTRACE_GETFPAREGS
+#endif
+#if defined __sparc__
+PTRACE_SETFPAREGS 0x15
+#else
+PTRACE_SETFPAREGS
+#endif
+#if defined __sparc__
+PTRACE_GETFPREGS64 0x19
+#else
+PTRACE_GETFPREGS64
+#endif
+#if defined __sparc__
+PTRACE_SETFPREGS64 0x1a
+#else
+PTRACE_SETFPREGS64
+#endif
+
+/* x86 */
+#if defined __x86_64__ || defined __i386__
+PTRACE_ARCH_PRCTL 0x1e
+#else
+PTRACE_ARCH_PRCTL
+#endif
+
+/* xtensa */
+#if defined __xtensa__
+PTRACE_GETXTREGS 0x12
+#else
+PTRACE_GETXTREGS
+#endif
+#if defined __xtensa__
+PTRACE_SETXTREGS 0x13
+#else
+PTRACE_SETXTREGS
+#endif
diff --git a/src/xlat/ptrace_events.in b/src/xlat/ptrace_events.in
new file mode 100644
index 000000000..a772e3c15
--- /dev/null
+++ b/src/xlat/ptrace_events.in
@@ -0,0 +1,10 @@
+PTRACE_EVENT_FORK
+PTRACE_EVENT_VFORK
+PTRACE_EVENT_CLONE
+PTRACE_EVENT_EXEC
+PTRACE_EVENT_VFORK_DONE
+PTRACE_EVENT_EXIT
+PTRACE_EVENT_SECCOMP
+PTRACE_EVENT_STOP
+/* tile */
+PTRACE_EVENT_MIGRATE
diff --git a/src/xlat/ptrace_peeksiginfo_flags.in b/src/xlat/ptrace_peeksiginfo_flags.in
new file mode 100644
index 000000000..28a4c222c
--- /dev/null
+++ b/src/xlat/ptrace_peeksiginfo_flags.in
@@ -0,0 +1 @@
+PTRACE_PEEKSIGINFO_SHARED 1
diff --git a/src/xlat/ptrace_setoptions_flags.in b/src/xlat/ptrace_setoptions_flags.in
new file mode 100644
index 000000000..8610c86dc
--- /dev/null
+++ b/src/xlat/ptrace_setoptions_flags.in
@@ -0,0 +1,12 @@
+PTRACE_O_TRACESYSGOOD
+PTRACE_O_TRACEFORK
+PTRACE_O_TRACEVFORK
+PTRACE_O_TRACECLONE
+PTRACE_O_TRACEEXEC
+PTRACE_O_TRACEVFORKDONE
+PTRACE_O_TRACEEXIT
+PTRACE_O_TRACESECCOMP
+PTRACE_O_EXITKILL
+PTRACE_O_SUSPEND_SECCOMP
+/* tile */
+PTRACE_O_TRACEMIGRATE
diff --git a/src/xlat/ptrace_syscall_info_op.in b/src/xlat/ptrace_syscall_info_op.in
new file mode 100644
index 000000000..96e762099
--- /dev/null
+++ b/src/xlat/ptrace_syscall_info_op.in
@@ -0,0 +1,5 @@
+#value_indexed
+PTRACE_SYSCALL_INFO_NONE
+PTRACE_SYSCALL_INFO_ENTRY
+PTRACE_SYSCALL_INFO_EXIT
+PTRACE_SYSCALL_INFO_SECCOMP
diff --git a/src/xlat/quota_formats.in b/src/xlat/quota_formats.in
new file mode 100644
index 000000000..6f59c058d
--- /dev/null
+++ b/src/xlat/quota_formats.in
@@ -0,0 +1,5 @@
+#value_indexed
+QFMT_VFS_OLD 1
+QFMT_VFS_V0 2
+QFMT_OCFS2 3
+QFMT_VFS_V1 4
diff --git a/src/xlat/quotacmds.in b/src/xlat/quotacmds.in
new file mode 100644
index 000000000..5ff19937c
--- /dev/null
+++ b/src/xlat/quotacmds.in
@@ -0,0 +1,38 @@
+Q_V1_QUOTAON OLD_CMD(0x1)
+Q_V1_QUOTAOFF OLD_CMD(0x2)
+Q_V1_GETQUOTA OLD_CMD(0x3)
+Q_V1_SETQUOTA OLD_CMD(0x4)
+Q_V1_SETUSE OLD_CMD(0x5)
+Q_V1_SYNC OLD_CMD(0x6)
+Q_SETQLIM OLD_CMD(0x7)
+Q_V1_GETSTATS OLD_CMD(0x8)
+Q_V1_RSQUASH OLD_CMD(0x10)
+
+Q_V2_GETQUOTA OLD_CMD(0xD)
+Q_V2_SETQUOTA OLD_CMD(0xE)
+Q_V2_SETUSE OLD_CMD(0xF)
+Q_V2_GETINFO OLD_CMD(0x9)
+Q_V2_SETINFO OLD_CMD(0xA)
+Q_V2_SETGRACE OLD_CMD(0xB)
+Q_V2_SETFLAGS OLD_CMD(0xC)
+Q_V2_GETSTATS OLD_CMD(0x11)
+
+Q_SYNC NEW_CMD(0x1)
+Q_QUOTAON NEW_CMD(0x2)
+Q_QUOTAOFF NEW_CMD(0x3)
+Q_GETFMT NEW_CMD(0x4)
+Q_GETINFO NEW_CMD(0x5)
+Q_SETINFO NEW_CMD(0x6)
+Q_GETQUOTA NEW_CMD(0x7)
+Q_SETQUOTA NEW_CMD(0x8)
+Q_GETNEXTQUOTA NEW_CMD(0x9)
+
+Q_XQUOTAON XQM_CMD(0x1)
+Q_XQUOTAOFF XQM_CMD(0x2)
+Q_XGETQUOTA XQM_CMD(0x3)
+Q_XSETQLIM XQM_CMD(0x4)
+Q_XGETQSTAT XQM_CMD(0x5)
+Q_XQUOTARM XQM_CMD(0x6)
+Q_XQUOTASYNC XQM_CMD(0x7)
+Q_XGETQSTATV XQM_CMD(0x8)
+Q_XGETNEXTQUOTA XQM_CMD(0x9)
diff --git a/src/xlat/quotatypes.in b/src/xlat/quotatypes.in
new file mode 100644
index 000000000..fec94f8b9
--- /dev/null
+++ b/src/xlat/quotatypes.in
@@ -0,0 +1,4 @@
+#value_indexed
+USRQUOTA 0
+GRPQUOTA 1
+PRJQUOTA 2
diff --git a/src/xlat/random_ioctl_cmds.in b/src/xlat/random_ioctl_cmds.in
new file mode 100644
index 000000000..1b31dc527
--- /dev/null
+++ b/src/xlat/random_ioctl_cmds.in
@@ -0,0 +1,7 @@
+RNDGETENTCNT _IOR( 'R', 0x00, int )
+RNDADDTOENTCNT _IOW( 'R', 0x01, int )
+RNDGETPOOL _IOR( 'R', 0x02, int [2] )
+RNDADDENTROPY _IOW( 'R', 0x03, int [2] )
+RNDZAPENTCNT _IO( 'R', 0x04 )
+RNDCLEARPOOL _IO( 'R', 0x06 )
+RNDRESEEDCRNG _IO( 'R', 0x07 )
diff --git a/src/xlat/rename_flags.in b/src/xlat/rename_flags.in
new file mode 100644
index 000000000..8d96b9b49
--- /dev/null
+++ b/src/xlat/rename_flags.in
@@ -0,0 +1,3 @@
+RENAME_NOREPLACE 1
+RENAME_EXCHANGE 2
+RENAME_WHITEOUT 4
diff --git a/src/xlat/resource_flags.in b/src/xlat/resource_flags.in
new file mode 100644
index 000000000..e7ce9c6e3
--- /dev/null
+++ b/src/xlat/resource_flags.in
@@ -0,0 +1,3 @@
+IPC_CREAT
+IPC_EXCL
+IPC_NOWAIT
diff --git a/src/xlat/resources.in b/src/xlat/resources.in
new file mode 100644
index 000000000..f12cb855d
--- /dev/null
+++ b/src/xlat/resources.in
@@ -0,0 +1,39 @@
+#value_indexed
+RLIMIT_CPU 0
+RLIMIT_FSIZE 1
+RLIMIT_DATA 2
+RLIMIT_STACK 3
+RLIMIT_CORE 4
+
+#if defined(__alpha__)
+RLIMIT_RSS 5
+RLIMIT_NOFILE 6
+RLIMIT_AS 7
+RLIMIT_NPROC 8
+RLIMIT_MEMLOCK 9
+#elif defined(__mips__)
+RLIMIT_NOFILE 5
+RLIMIT_AS 6
+RLIMIT_RSS 7
+RLIMIT_NPROC 8
+RLIMIT_MEMLOCK 9
+#elif defined(__sparc__)
+RLIMIT_RSS 5
+RLIMIT_NOFILE 6
+RLIMIT_NPROC 7
+RLIMIT_MEMLOCK 8
+RLIMIT_AS 9
+#else
+RLIMIT_RSS 5
+RLIMIT_NPROC 6
+RLIMIT_NOFILE 7
+RLIMIT_MEMLOCK 8
+RLIMIT_AS 9
+#endif
+
+RLIMIT_LOCKS 10
+RLIMIT_SIGPENDING 11
+RLIMIT_MSGQUEUE 12
+RLIMIT_NICE 13
+RLIMIT_RTPRIO 14
+RLIMIT_RTTIME 15
diff --git a/src/xlat/riscv_flush_icache_flags.in b/src/xlat/riscv_flush_icache_flags.in
new file mode 100644
index 000000000..173da0762
--- /dev/null
+++ b/src/xlat/riscv_flush_icache_flags.in
@@ -0,0 +1 @@
+SYS_RISCV_FLUSH_ICACHE_LOCAL 1
diff --git a/src/xlat/route_nexthop_flags.in b/src/xlat/route_nexthop_flags.in
new file mode 100644
index 000000000..a64a98859
--- /dev/null
+++ b/src/xlat/route_nexthop_flags.in
@@ -0,0 +1,6 @@
+RTNH_F_DEAD 1
+RTNH_F_PERVASIVE 2
+RTNH_F_ONLINK 4
+RTNH_F_OFFLOAD 8
+RTNH_F_LINKDOWN 16
+RTNH_F_UNRESOLVED 32
diff --git a/src/xlat/routing_flags.in b/src/xlat/routing_flags.in
new file mode 100644
index 000000000..28501a27f
--- /dev/null
+++ b/src/xlat/routing_flags.in
@@ -0,0 +1,9 @@
+#sorted sort -k2,2g
+RTM_F_NOTIFY 0x100
+RTM_F_CLONED 0x200
+RTM_F_EQUALIZE 0x400
+RTM_F_PREFIX 0x800
+RTM_F_LOOKUP_TABLE 0x1000
+RTM_F_FIB_MATCH 0x2000
+RTM_F_OFFLOAD 0x4000
+RTM_F_TRAP 0x8000
diff --git a/src/xlat/routing_protocols.in b/src/xlat/routing_protocols.in
new file mode 100644
index 000000000..4c6897d8a
--- /dev/null
+++ b/src/xlat/routing_protocols.in
@@ -0,0 +1,23 @@
+#sorted sort -k2,2n
+RTPROT_UNSPEC 0
+RTPROT_REDIRECT 1
+RTPROT_KERNEL 2
+RTPROT_BOOT 3
+RTPROT_STATIC 4
+RTPROT_GATED 8
+RTPROT_RA 9
+RTPROT_MRT 10
+RTPROT_ZEBRA 11
+RTPROT_BIRD 12
+RTPROT_DNROUTED 13
+RTPROT_XORP 14
+RTPROT_NTK 15
+RTPROT_DHCP 16
+RTPROT_MROUTED 17
+RTPROT_KEEPALIVED 18
+RTPROT_BABEL 42
+RTPROT_BGP 186
+RTPROT_ISIS 187
+RTPROT_OSPF 188
+RTPROT_RIP 189
+RTPROT_EIGRP 192
diff --git a/src/xlat/routing_scopes.in b/src/xlat/routing_scopes.in
new file mode 100644
index 000000000..c431e9f2e
--- /dev/null
+++ b/src/xlat/routing_scopes.in
@@ -0,0 +1,5 @@
+RT_SCOPE_UNIVERSE 0
+RT_SCOPE_SITE 200
+RT_SCOPE_LINK 253
+RT_SCOPE_HOST 254
+RT_SCOPE_NOWHERE 255
diff --git a/src/xlat/routing_table_ids.in b/src/xlat/routing_table_ids.in
new file mode 100644
index 000000000..6a1f79777
--- /dev/null
+++ b/src/xlat/routing_table_ids.in
@@ -0,0 +1,5 @@
+RT_TABLE_UNSPEC 0
+RT_TABLE_COMPAT 252
+RT_TABLE_DEFAULT 253
+RT_TABLE_MAIN 254
+RT_TABLE_LOCAL 255
diff --git a/src/xlat/routing_types.in b/src/xlat/routing_types.in
new file mode 100644
index 000000000..e9656a7d1
--- /dev/null
+++ b/src/xlat/routing_types.in
@@ -0,0 +1,13 @@
+#value_indexed
+RTN_UNSPEC 0
+RTN_UNICAST 1
+RTN_LOCAL 2
+RTN_BROADCAST 3
+RTN_ANYCAST 4
+RTN_MULTICAST 5
+RTN_BLACKHOLE 6
+RTN_UNREACHABLE 7
+RTN_PROHIBIT 8
+RTN_THROW 9
+RTN_NAT 10
+RTN_XRESOLVE 11
diff --git a/src/xlat/rtc_ioctl_cmds.in b/src/xlat/rtc_ioctl_cmds.in
new file mode 100644
index 000000000..cc781982f
--- /dev/null
+++ b/src/xlat/rtc_ioctl_cmds.in
@@ -0,0 +1,22 @@
+RTC_AIE_ON _IO ('p', 0x01)
+RTC_AIE_OFF _IO ('p', 0x02)
+RTC_UIE_ON _IO ('p', 0x03)
+RTC_UIE_OFF _IO ('p', 0x04)
+RTC_PIE_ON _IO ('p', 0x05)
+RTC_PIE_OFF _IO ('p', 0x06)
+RTC_WIE_ON _IO ('p', 0x0f)
+RTC_WIE_OFF _IO ('p', 0x10)
+RTC_ALM_SET _IOW('p', 0x07, struct rtc_time)
+RTC_ALM_READ _IOR('p', 0x08, struct rtc_time)
+RTC_RD_TIME _IOR('p', 0x09, struct rtc_time)
+RTC_SET_TIME _IOW('p', 0x0a, struct rtc_time)
+/* RTC_IRQP_READ _IOR('p', 0x0b, unsigned long) - mpers-dependent */
+/* RTC_IRQP_SET _IOW('p', 0x0c, unsigned long) - mpers-dependent */
+/* RTC_EPOCH_READ _IOR('p', 0x0d, unsigned long) - mpers-dependent */
+/* RTC_EPOCH_SET _IOW('p', 0x0e, unsigned long) - mpers-dependent */
+RTC_WKALM_SET _IOW('p', 0x0f, struct rtc_wkalrm)
+RTC_WKALM_RD _IOR('p', 0x10, struct rtc_wkalrm)
+RTC_PLL_GET _IOR('p', 0x11, struct_rtc_pll_info)
+RTC_PLL_SET _IOW('p', 0x12, struct_rtc_pll_info)
+RTC_VL_READ _IOR('p', 0x13, unsigned int)
+RTC_VL_CLR _IO ('p', 0x14)
diff --git a/src/xlat/rtc_vl_flags.in b/src/xlat/rtc_vl_flags.in
new file mode 100644
index 000000000..b82618271
--- /dev/null
+++ b/src/xlat/rtc_vl_flags.in
@@ -0,0 +1,5 @@
+RTC_VL_DATA_INVALID (1 << 0)
+RTC_VL_BACKUP_LOW (1 << 1)
+RTC_VL_BACKUP_EMPTY (1 << 2)
+RTC_VL_ACCURACY_LOW (1 << 3)
+RTC_VL_BACKUP_SWITCH (1 << 4)
diff --git a/src/xlat/rtnl_addr_attrs.in b/src/xlat/rtnl_addr_attrs.in
new file mode 100644
index 000000000..71a9afb48
--- /dev/null
+++ b/src/xlat/rtnl_addr_attrs.in
@@ -0,0 +1,12 @@
+#value_indexed
+IFA_UNSPEC 0
+IFA_ADDRESS 1
+IFA_LOCAL 2
+IFA_LABEL 3
+IFA_BROADCAST 4
+IFA_ANYCAST 5
+IFA_CACHEINFO 6
+IFA_MULTICAST 7
+IFA_FLAGS 8
+IFA_RT_PRIORITY 9
+IFA_TARGET_NETNSID 10
diff --git a/src/xlat/rtnl_addrlabel_attrs.in b/src/xlat/rtnl_addrlabel_attrs.in
new file mode 100644
index 000000000..bae0b6075
--- /dev/null
+++ b/src/xlat/rtnl_addrlabel_attrs.in
@@ -0,0 +1,3 @@
+#value_indexed
+IFAL_ADDRESS 1
+IFAL_LABEL 2
diff --git a/src/xlat/rtnl_dcb_attrs.in b/src/xlat/rtnl_dcb_attrs.in
new file mode 100644
index 000000000..19cac7782
--- /dev/null
+++ b/src/xlat/rtnl_dcb_attrs.in
@@ -0,0 +1,18 @@
+#value_indexed
+DCB_ATTR_UNDEFINED 0
+DCB_ATTR_IFNAME 1
+DCB_ATTR_STATE 2
+DCB_ATTR_PFC_STATE 3
+DCB_ATTR_PFC_CFG 4
+DCB_ATTR_NUM_TC 5
+DCB_ATTR_PG_CFG 6
+DCB_ATTR_SET_ALL 7
+DCB_ATTR_PERM_HWADDR 8
+DCB_ATTR_CAP 9
+DCB_ATTR_NUMTCS 10
+DCB_ATTR_BCN 11
+DCB_ATTR_APP 12
+DCB_ATTR_IEEE 13
+DCB_ATTR_DCBX 14
+DCB_ATTR_FEATCFG 15
+DCB_ATTR_CEE 16
diff --git a/src/xlat/rtnl_ifla_af_spec_inet6_attrs.in b/src/xlat/rtnl_ifla_af_spec_inet6_attrs.in
new file mode 100644
index 000000000..9717d5aa2
--- /dev/null
+++ b/src/xlat/rtnl_ifla_af_spec_inet6_attrs.in
@@ -0,0 +1,10 @@
+#value_indexed
+IFLA_INET6_UNSPEC 0
+IFLA_INET6_FLAGS 1
+IFLA_INET6_CONF 2
+IFLA_INET6_STATS 3
+IFLA_INET6_MCAST 4
+IFLA_INET6_CACHEINFO 5
+IFLA_INET6_ICMP6STATS 6
+IFLA_INET6_TOKEN 7
+IFLA_INET6_ADDR_GEN_MODE 8
diff --git a/src/xlat/rtnl_ifla_af_spec_inet_attrs.in b/src/xlat/rtnl_ifla_af_spec_inet_attrs.in
new file mode 100644
index 000000000..79799758c
--- /dev/null
+++ b/src/xlat/rtnl_ifla_af_spec_inet_attrs.in
@@ -0,0 +1,3 @@
+#value_indexed
+IFLA_INET_UNSPEC 0
+IFLA_INET_CONF 1
diff --git a/src/xlat/rtnl_ifla_brport_attrs.in b/src/xlat/rtnl_ifla_brport_attrs.in
new file mode 100644
index 000000000..2a5150bbc
--- /dev/null
+++ b/src/xlat/rtnl_ifla_brport_attrs.in
@@ -0,0 +1,36 @@
+#value_indexed
+IFLA_BRPORT_UNSPEC 0
+IFLA_BRPORT_STATE 1
+IFLA_BRPORT_PRIORITY 2
+IFLA_BRPORT_COST 3
+IFLA_BRPORT_MODE 4
+IFLA_BRPORT_GUARD 5
+IFLA_BRPORT_PROTECT 6
+IFLA_BRPORT_FAST_LEAVE 7
+IFLA_BRPORT_LEARNING 8
+IFLA_BRPORT_UNICAST_FLOOD 9
+IFLA_BRPORT_PROXYARP 10
+IFLA_BRPORT_LEARNING_SYNC 11
+IFLA_BRPORT_PROXYARP_WIFI 12
+IFLA_BRPORT_ROOT_ID 13
+IFLA_BRPORT_BRIDGE_ID 14
+IFLA_BRPORT_DESIGNATED_PORT 15
+IFLA_BRPORT_DESIGNATED_COST 16
+IFLA_BRPORT_ID 17
+IFLA_BRPORT_NO 18
+IFLA_BRPORT_TOPOLOGY_CHANGE_ACK 19
+IFLA_BRPORT_CONFIG_PENDING 20
+IFLA_BRPORT_MESSAGE_AGE_TIMER 21
+IFLA_BRPORT_FORWARD_DELAY_TIMER 22
+IFLA_BRPORT_HOLD_TIMER 23
+IFLA_BRPORT_FLUSH 24
+IFLA_BRPORT_MULTICAST_ROUTER 25
+IFLA_BRPORT_PAD 26
+IFLA_BRPORT_MCAST_FLOOD 27
+IFLA_BRPORT_MCAST_TO_UCAST 28
+IFLA_BRPORT_VLAN_TUNNEL 29
+IFLA_BRPORT_BCAST_FLOOD 30
+IFLA_BRPORT_GROUP_FWD_MASK 31
+IFLA_BRPORT_NEIGH_SUPPRESS 32
+IFLA_BRPORT_ISOLATED 33
+IFLA_BRPORT_BACKUP_PORT 34
diff --git a/src/xlat/rtnl_ifla_events.in b/src/xlat/rtnl_ifla_events.in
new file mode 100644
index 000000000..ff7ca83f1
--- /dev/null
+++ b/src/xlat/rtnl_ifla_events.in
@@ -0,0 +1,8 @@
+#value_indexed
+IFLA_EVENT_NONE 0
+IFLA_EVENT_REBOOT 1
+IFLA_EVENT_FEATURES 2
+IFLA_EVENT_BONDING_FAILOVER 3
+IFLA_EVENT_NOTIFY_PEERS 4
+IFLA_EVENT_IGMP_RESEND 5
+IFLA_EVENT_BONDING_OPTIONS 6
diff --git a/src/xlat/rtnl_ifla_info_attrs.in b/src/xlat/rtnl_ifla_info_attrs.in
new file mode 100644
index 000000000..2b1445c42
--- /dev/null
+++ b/src/xlat/rtnl_ifla_info_attrs.in
@@ -0,0 +1,7 @@
+#value_indexed
+IFLA_INFO_UNSPEC 0
+IFLA_INFO_KIND 1
+IFLA_INFO_DATA 2
+IFLA_INFO_XSTATS 3
+IFLA_INFO_SLAVE_KIND 4
+IFLA_INFO_SLAVE_DATA 5
diff --git a/src/xlat/rtnl_ifla_info_data_bridge_attrs.in b/src/xlat/rtnl_ifla_info_data_bridge_attrs.in
new file mode 100644
index 000000000..87988471e
--- /dev/null
+++ b/src/xlat/rtnl_ifla_info_data_bridge_attrs.in
@@ -0,0 +1,48 @@
+#value_indexed
+IFLA_BR_UNSPEC 0
+IFLA_BR_FORWARD_DELAY 1
+IFLA_BR_HELLO_TIME 2
+IFLA_BR_MAX_AGE 3
+IFLA_BR_AGEING_TIME 4
+IFLA_BR_STP_STATE 5
+IFLA_BR_PRIORITY 6
+IFLA_BR_VLAN_FILTERING 7
+IFLA_BR_VLAN_PROTOCOL 8
+IFLA_BR_GROUP_FWD_MASK 9
+IFLA_BR_ROOT_ID 10
+IFLA_BR_BRIDGE_ID 11
+IFLA_BR_ROOT_PORT 12
+IFLA_BR_ROOT_PATH_COST 13
+IFLA_BR_TOPOLOGY_CHANGE 14
+IFLA_BR_TOPOLOGY_CHANGE_DETECTED 15
+IFLA_BR_HELLO_TIMER 16
+IFLA_BR_TCN_TIMER 17
+IFLA_BR_TOPOLOGY_CHANGE_TIMER 18
+IFLA_BR_GC_TIMER 19
+IFLA_BR_GROUP_ADDR 20
+IFLA_BR_FDB_FLUSH 21
+IFLA_BR_MCAST_ROUTER 22
+IFLA_BR_MCAST_SNOOPING 23
+IFLA_BR_MCAST_QUERY_USE_IFADDR 24
+IFLA_BR_MCAST_QUERIER 25
+IFLA_BR_MCAST_HASH_ELASTICITY 26
+IFLA_BR_MCAST_HASH_MAX 27
+IFLA_BR_MCAST_LAST_MEMBER_CNT 28
+IFLA_BR_MCAST_STARTUP_QUERY_CNT 29
+IFLA_BR_MCAST_LAST_MEMBER_INTVL 30
+IFLA_BR_MCAST_MEMBERSHIP_INTVL 31
+IFLA_BR_MCAST_QUERIER_INTVL 32
+IFLA_BR_MCAST_QUERY_INTVL 33
+IFLA_BR_MCAST_QUERY_RESPONSE_INTVL 34
+IFLA_BR_MCAST_STARTUP_QUERY_INTVL 35
+IFLA_BR_NF_CALL_IPTABLES 36
+IFLA_BR_NF_CALL_IP6TABLES 37
+IFLA_BR_NF_CALL_ARPTABLES 38
+IFLA_BR_VLAN_DEFAULT_PVID 39
+IFLA_BR_PAD 40
+IFLA_BR_VLAN_STATS_ENABLED 41
+IFLA_BR_MCAST_STATS_ENABLED 42
+IFLA_BR_MCAST_IGMP_VERSION 43
+IFLA_BR_MCAST_MLD_VERSION 44
+IFLA_BR_VLAN_STATS_PER_PORT 45
+IFLA_BR_MULTI_BOOLOPT 46
diff --git a/src/xlat/rtnl_ifla_info_data_tun_attrs.in b/src/xlat/rtnl_ifla_info_data_tun_attrs.in
new file mode 100644
index 000000000..2ac187e3f
--- /dev/null
+++ b/src/xlat/rtnl_ifla_info_data_tun_attrs.in
@@ -0,0 +1,11 @@
+#value_indexed
+IFLA_TUN_UNSPEC 0
+IFLA_TUN_OWNER 1
+IFLA_TUN_GROUP 2
+IFLA_TUN_TYPE 3
+IFLA_TUN_PI 4
+IFLA_TUN_VNET_HDR 5
+IFLA_TUN_PERSIST 6
+IFLA_TUN_MULTI_QUEUE 7
+IFLA_TUN_NUM_QUEUES 8
+IFLA_TUN_NUM_DISABLED_QUEUES 9
diff --git a/src/xlat/rtnl_ifla_port_attrs.in b/src/xlat/rtnl_ifla_port_attrs.in
new file mode 100644
index 000000000..e498c6993
--- /dev/null
+++ b/src/xlat/rtnl_ifla_port_attrs.in
@@ -0,0 +1,9 @@
+#value_indexed
+IFLA_PORT_UNSPEC 0
+IFLA_PORT_VF 1
+IFLA_PORT_PROFILE 2
+IFLA_PORT_VSI_TYPE 3
+IFLA_PORT_INSTANCE_UUID 4
+IFLA_PORT_HOST_UUID 5
+IFLA_PORT_REQUEST 6
+IFLA_PORT_RESPONSE 7
diff --git a/src/xlat/rtnl_ifla_vf_port_attrs.in b/src/xlat/rtnl_ifla_vf_port_attrs.in
new file mode 100644
index 000000000..afff1f3fb
--- /dev/null
+++ b/src/xlat/rtnl_ifla_vf_port_attrs.in
@@ -0,0 +1,3 @@
+#value_indexed
+IFLA_VF_PORT_UNSPEC 0
+IFLA_VF_PORT 1
diff --git a/src/xlat/rtnl_ifla_xdp_attached_mode.in b/src/xlat/rtnl_ifla_xdp_attached_mode.in
new file mode 100644
index 000000000..2d8365e99
--- /dev/null
+++ b/src/xlat/rtnl_ifla_xdp_attached_mode.in
@@ -0,0 +1,9 @@
+#value_indexed
+#enum
+#include <netinet/in.h>
+#include <linux/rtnetlink.h>
+XDP_ATTACHED_NONE 0
+XDP_ATTACHED_DRV 1
+XDP_ATTACHED_SKB 2
+XDP_ATTACHED_HW 3
+XDP_ATTACHED_MULTI 4
diff --git a/src/xlat/rtnl_ifla_xdp_attrs.in b/src/xlat/rtnl_ifla_xdp_attrs.in
new file mode 100644
index 000000000..d743ac8a8
--- /dev/null
+++ b/src/xlat/rtnl_ifla_xdp_attrs.in
@@ -0,0 +1,13 @@
+#value_indexed
+#enum
+#include <netinet/in.h>
+#include <linux/rtnetlink.h>
+IFLA_XDP_UNSPEC 0
+IFLA_XDP_FD 1
+IFLA_XDP_ATTACHED 2
+IFLA_XDP_FLAGS 3
+IFLA_XDP_PROG_ID 4
+IFLA_XDP_DRV_PROG_ID 5
+IFLA_XDP_SKB_PROG_ID 6
+IFLA_XDP_HW_PROG_ID 7
+IFLA_XDP_EXPECTED_FD 8
diff --git a/src/xlat/rtnl_link_attrs.in b/src/xlat/rtnl_link_attrs.in
new file mode 100644
index 000000000..904494125
--- /dev/null
+++ b/src/xlat/rtnl_link_attrs.in
@@ -0,0 +1,60 @@
+#value_indexed
+#enum
+#include <sys/socket.h>
+#include <linux/rtnetlink.h>
+IFLA_UNSPEC 0
+IFLA_ADDRESS 1
+IFLA_BROADCAST 2
+IFLA_IFNAME 3
+IFLA_MTU 4
+IFLA_LINK 5
+IFLA_QDISC 6
+IFLA_STATS 7
+IFLA_COST 8
+IFLA_PRIORITY 9
+IFLA_MASTER 10
+IFLA_WIRELESS 11
+IFLA_PROTINFO 12
+IFLA_TXQLEN 13
+IFLA_MAP 14
+IFLA_WEIGHT 15
+IFLA_OPERSTATE 16
+IFLA_LINKMODE 17
+IFLA_LINKINFO 18
+IFLA_NET_NS_PID 19
+IFLA_IFALIAS 20
+IFLA_NUM_VF 21
+IFLA_VFINFO_LIST 22
+IFLA_STATS64 23
+IFLA_VF_PORTS 24
+IFLA_PORT_SELF 25
+IFLA_AF_SPEC 26
+IFLA_GROUP 27
+IFLA_NET_NS_FD 28
+IFLA_EXT_MASK 29
+IFLA_PROMISCUITY 30
+IFLA_NUM_TX_QUEUES 31
+IFLA_NUM_RX_QUEUES 32
+IFLA_CARRIER 33
+IFLA_PHYS_PORT_ID 34
+IFLA_CARRIER_CHANGES 35
+IFLA_PHYS_SWITCH_ID 36
+IFLA_LINK_NETNSID 37
+IFLA_PHYS_PORT_NAME 38
+IFLA_PROTO_DOWN 39
+IFLA_GSO_MAX_SEGS 40
+IFLA_GSO_MAX_SIZE 41
+IFLA_PAD 42
+IFLA_XDP 43
+IFLA_EVENT 44
+IFLA_NEW_NETNSID 45
+IFLA_IF_NETNSID 46
+IFLA_CARRIER_UP_COUNT 47
+IFLA_CARRIER_DOWN_COUNT 48
+IFLA_NEW_IFINDEX 49
+IFLA_MIN_MTU 50
+IFLA_MAX_MTU 51
+IFLA_PROP_LIST 52
+IFLA_ALT_IFNAME 53
+IFLA_PERM_ADDRESS 54
+IFLA_PROTO_DOWN_REASON 55
diff --git a/src/xlat/rtnl_mdb_attrs.in b/src/xlat/rtnl_mdb_attrs.in
new file mode 100644
index 000000000..9db05cd1e
--- /dev/null
+++ b/src/xlat/rtnl_mdb_attrs.in
@@ -0,0 +1,4 @@
+#value_indexed
+MDBA_UNSPEC 0
+MDBA_MDB 1
+MDBA_ROUTER 2
diff --git a/src/xlat/rtnl_mdba_mdb_attrs.in b/src/xlat/rtnl_mdba_mdb_attrs.in
new file mode 100644
index 000000000..41f396272
--- /dev/null
+++ b/src/xlat/rtnl_mdba_mdb_attrs.in
@@ -0,0 +1,3 @@
+#value_indexed
+MDBA_MDB_UNSPEC 0
+MDBA_MDB_ENTRY 1
diff --git a/src/xlat/rtnl_mdba_mdb_eattr_attrs.in b/src/xlat/rtnl_mdba_mdb_eattr_attrs.in
new file mode 100644
index 000000000..ed01faeae
--- /dev/null
+++ b/src/xlat/rtnl_mdba_mdb_eattr_attrs.in
@@ -0,0 +1,7 @@
+#value_indexed
+MDBA_MDB_EATTR_UNSPEC 0
+MDBA_MDB_EATTR_TIMER 1
+MDBA_MDB_EATTR_SRC_LIST 2
+MDBA_MDB_EATTR_GROUP_MODE 3
+MDBA_MDB_EATTR_SOURCE 4
+MDBA_MDB_EATTR_RTPROT 5
diff --git a/src/xlat/rtnl_mdba_mdb_entry_attrs.in b/src/xlat/rtnl_mdba_mdb_entry_attrs.in
new file mode 100644
index 000000000..7216a6b09
--- /dev/null
+++ b/src/xlat/rtnl_mdba_mdb_entry_attrs.in
@@ -0,0 +1,3 @@
+#value_indexed
+MDBA_MDB_ENTRY_UNSPEC 0
+MDBA_MDB_ENTRY_INFO 1
diff --git a/src/xlat/rtnl_mdba_router_attrs.in b/src/xlat/rtnl_mdba_router_attrs.in
new file mode 100644
index 000000000..04505a155
--- /dev/null
+++ b/src/xlat/rtnl_mdba_router_attrs.in
@@ -0,0 +1,3 @@
+#value_indexed
+MDBA_ROUTER_UNSPEC 0
+MDBA_ROUTER_PORT 1
diff --git a/src/xlat/rtnl_mdba_router_pattr_attrs.in b/src/xlat/rtnl_mdba_router_pattr_attrs.in
new file mode 100644
index 000000000..c2964defd
--- /dev/null
+++ b/src/xlat/rtnl_mdba_router_pattr_attrs.in
@@ -0,0 +1,4 @@
+#value_indexed
+MDBA_ROUTER_PATTR_UNSPEC 0
+MDBA_ROUTER_PATTR_TIMER 1
+MDBA_ROUTER_PATTR_TYPE 2
diff --git a/src/xlat/rtnl_neigh_attrs.in b/src/xlat/rtnl_neigh_attrs.in
new file mode 100644
index 000000000..5b09915f5
--- /dev/null
+++ b/src/xlat/rtnl_neigh_attrs.in
@@ -0,0 +1,16 @@
+#value_indexed
+NDA_UNSPEC 0
+NDA_DST 1
+NDA_LLADDR 2
+NDA_CACHEINFO 3
+NDA_PROBES 4
+NDA_VLAN 5
+NDA_PORT 6
+NDA_VNI 7
+NDA_IFINDEX 8
+NDA_MASTER 9
+NDA_LINK_NETNSID 10
+NDA_SRC_VNI 11
+NDA_PROTOCOL 12
+NDA_NH_ID 13
+NDA_FDB_EXT_ATTRS 14
diff --git a/src/xlat/rtnl_neightbl_attrs.in b/src/xlat/rtnl_neightbl_attrs.in
new file mode 100644
index 000000000..92982d299
--- /dev/null
+++ b/src/xlat/rtnl_neightbl_attrs.in
@@ -0,0 +1,11 @@
+#value_indexed
+NDTA_UNSPEC 0
+NDTA_NAME 1
+NDTA_THRESH1 2
+NDTA_THRESH2 3
+NDTA_THRESH3 4
+NDTA_CONFIG 5
+NDTA_PARMS 6
+NDTA_STATS 7
+NDTA_GC_INTERVAL 8
+NDTA_PAD 9
diff --git a/src/xlat/rtnl_neightbl_parms_attrs.in b/src/xlat/rtnl_neightbl_parms_attrs.in
new file mode 100644
index 000000000..47f4adea1
--- /dev/null
+++ b/src/xlat/rtnl_neightbl_parms_attrs.in
@@ -0,0 +1,20 @@
+#value_indexed
+NDTPA_UNSPEC 0
+NDTPA_IFINDEX 1
+NDTPA_REFCNT 2
+NDTPA_REACHABLE_TIME 3
+NDTPA_BASE_REACHABLE_TIME 4
+NDTPA_RETRANS_TIME 5
+NDTPA_GC_STALETIME 6
+NDTPA_DELAY_PROBE_TIME 7
+NDTPA_QUEUE_LEN 8
+NDTPA_APP_PROBES 9
+NDTPA_UCAST_PROBES 10
+NDTPA_MCAST_PROBES 11
+NDTPA_ANYCAST_DELAY 12
+NDTPA_PROXY_DELAY 13
+NDTPA_PROXY_QLEN 14
+NDTPA_LOCKTIME 15
+NDTPA_QUEUE_LENBYTES 16
+NDTPA_MCAST_REPROBES 17
+NDTPA_PAD 18
diff --git a/src/xlat/rtnl_netconf_attrs.in b/src/xlat/rtnl_netconf_attrs.in
new file mode 100644
index 000000000..3aab81eee
--- /dev/null
+++ b/src/xlat/rtnl_netconf_attrs.in
@@ -0,0 +1,10 @@
+#value_indexed
+NETCONFA_UNSPEC 0
+NETCONFA_IFINDEX 1
+NETCONFA_FORWARDING 2
+NETCONFA_RP_FILTER 3
+NETCONFA_MC_FORWARDING 4
+NETCONFA_PROXY_NEIGH 5
+NETCONFA_IGNORE_ROUTES_WITH_LINKDOWN 6
+NETCONFA_INPUT 7
+NETCONFA_BC_FORWARDING 8
diff --git a/src/xlat/rtnl_nsid_attrs.in b/src/xlat/rtnl_nsid_attrs.in
new file mode 100644
index 000000000..591fb23f5
--- /dev/null
+++ b/src/xlat/rtnl_nsid_attrs.in
@@ -0,0 +1,7 @@
+NETNSA_NSID_NOT_ASSIGNED -1
+NETNSA_NONE 0
+NETNSA_NSID 1
+NETNSA_PID 2
+NETNSA_FD 3
+NETNSA_TARGET_NSID 4
+NETNSA_CURRENT_NSID 5
diff --git a/src/xlat/rtnl_route_attrs.in b/src/xlat/rtnl_route_attrs.in
new file mode 100644
index 000000000..dd7c973e3
--- /dev/null
+++ b/src/xlat/rtnl_route_attrs.in
@@ -0,0 +1,31 @@
+#value_indexed
+RTA_UNSPEC 0
+RTA_DST 1
+RTA_SRC 2
+RTA_IIF 3
+RTA_OIF 4
+RTA_GATEWAY 5
+RTA_PRIORITY 6
+RTA_PREFSRC 7
+RTA_METRICS 8
+RTA_MULTIPATH 9
+RTA_PROTOINFO 10
+RTA_FLOW 11
+RTA_CACHEINFO 12
+RTA_SESSION 13
+RTA_MP_ALGO 14
+RTA_TABLE 15
+RTA_MARK 16
+RTA_MFC_STATS 17
+RTA_VIA 18
+RTA_NEWDST 19
+RTA_PREF 20
+RTA_ENCAP_TYPE 21
+RTA_ENCAP 22
+RTA_EXPIRES 23
+RTA_PAD 24
+RTA_UID 25
+RTA_TTL_PROPAGATE 26
+RTA_IP_PROTO 27
+RTA_SPORT 28
+RTA_DPORT 29
diff --git a/src/xlat/rtnl_rta_metrics_attrs.in b/src/xlat/rtnl_rta_metrics_attrs.in
new file mode 100644
index 000000000..17d7a9a13
--- /dev/null
+++ b/src/xlat/rtnl_rta_metrics_attrs.in
@@ -0,0 +1,18 @@
+#value_indexed
+RTAX_UNSPEC 0
+RTAX_LOCK 1
+RTAX_MTU 2
+RTAX_WINDOW 3
+RTAX_RTT 4
+RTAX_RTTVAR 5
+RTAX_SSTHRESH 6
+RTAX_CWND 7
+RTAX_ADVMSS 8
+RTAX_REORDERING 9
+RTAX_HOPLIMIT 10
+RTAX_INITCWND 11
+RTAX_FEATURES 12
+RTAX_RTO_MIN 13
+RTAX_INITRWND 14
+RTAX_QUICKACK 15
+RTAX_CC_ALGO 16
diff --git a/src/xlat/rtnl_rule_attrs.in b/src/xlat/rtnl_rule_attrs.in
new file mode 100644
index 000000000..4552f2a28
--- /dev/null
+++ b/src/xlat/rtnl_rule_attrs.in
@@ -0,0 +1,26 @@
+#value_indexed
+FRA_UNSPEC 0
+FRA_DST 1
+FRA_SRC 2
+FRA_IIFNAME 3
+FRA_GOTO 4
+FRA_UNUSED2 5
+FRA_PRIORITY 6
+FRA_UNUSED3 7
+FRA_UNUSED4 8
+FRA_UNUSED5 9
+FRA_FWMARK 10
+FRA_FLOW 11
+FRA_TUN_ID 12
+FRA_SUPPRESS_IFGROUP 13
+FRA_SUPPRESS_PREFIXLEN 14
+FRA_TABLE 15
+FRA_FWMASK 16
+FRA_OIFNAME 17
+FRA_PAD 18
+FRA_L3MDEV 19
+FRA_UID_RANGE 20
+FRA_PROTOCOL 21
+FRA_IP_PROTO 22
+FRA_SPORT_RANGE 23
+FRA_DPORT_RANGE 24
diff --git a/src/xlat/rtnl_tc_action_attrs.in b/src/xlat/rtnl_tc_action_attrs.in
new file mode 100644
index 000000000..dcf9f407f
--- /dev/null
+++ b/src/xlat/rtnl_tc_action_attrs.in
@@ -0,0 +1,13 @@
+#value_indexed
+#enum
+#include <linux/pkt_cls.h>
+TCA_ACT_UNSPEC 0
+TCA_ACT_KIND 1
+TCA_ACT_OPTIONS 2
+TCA_ACT_INDEX 3
+TCA_ACT_STATS 4
+TCA_ACT_PAD 5
+TCA_ACT_COOKIE 6
+TCA_ACT_FLAGS 7
+TCA_ACT_HW_STATS 8
+TCA_ACT_USED_HW_STATS 9
diff --git a/src/xlat/rtnl_tc_attrs.in b/src/xlat/rtnl_tc_attrs.in
new file mode 100644
index 000000000..d822920c1
--- /dev/null
+++ b/src/xlat/rtnl_tc_attrs.in
@@ -0,0 +1,17 @@
+#value_indexed
+TCA_UNSPEC 0
+TCA_KIND 1
+TCA_OPTIONS 2
+TCA_STATS 3
+TCA_XSTATS 4
+TCA_RATE 5
+TCA_FCNT 6
+TCA_STATS2 7
+TCA_STAB 8
+TCA_PAD 9
+TCA_DUMP_INVISIBLE 10
+TCA_CHAIN 11
+TCA_HW_OFFLOAD 12
+TCA_INGRESS_BLOCK 13
+TCA_EGRESS_BLOCK 14
+TCA_DUMP_FLAGS 15
diff --git a/src/xlat/rtnl_tca_act_flags.in b/src/xlat/rtnl_tca_act_flags.in
new file mode 100644
index 000000000..2541b64c3
--- /dev/null
+++ b/src/xlat/rtnl_tca_act_flags.in
@@ -0,0 +1 @@
+TCA_ACT_FLAGS_NO_PERCPU_STATS 1
diff --git a/src/xlat/rtnl_tca_act_hw_stats.in b/src/xlat/rtnl_tca_act_hw_stats.in
new file mode 100644
index 000000000..46eff98dc
--- /dev/null
+++ b/src/xlat/rtnl_tca_act_hw_stats.in
@@ -0,0 +1,2 @@
+TCA_ACT_HW_STATS_IMMEDIATE (1<<0)
+TCA_ACT_HW_STATS_DELAYED (1<<1)
diff --git a/src/xlat/rtnl_tca_stab_attrs.in b/src/xlat/rtnl_tca_stab_attrs.in
new file mode 100644
index 000000000..1c83326f0
--- /dev/null
+++ b/src/xlat/rtnl_tca_stab_attrs.in
@@ -0,0 +1,7 @@
+#value_indexed
+#enum
+#include <linux/types.h>
+#include <linux/pkt_sched.h>
+TCA_STAB_UNSPEC 0
+TCA_STAB_BASE 1
+TCA_STAB_DATA 2
diff --git a/src/xlat/rtnl_tca_stats_attrs.in b/src/xlat/rtnl_tca_stats_attrs.in
new file mode 100644
index 000000000..ad19d3136
--- /dev/null
+++ b/src/xlat/rtnl_tca_stats_attrs.in
@@ -0,0 +1,12 @@
+#value_indexed
+#enum
+#include <linux/gen_stats.h>
+TCA_STATS_UNSPEC 0
+TCA_STATS_BASIC 1
+TCA_STATS_RATE_EST 2
+TCA_STATS_QUEUE 3
+TCA_STATS_APP 4
+TCA_STATS_RATE_EST64 5
+TCA_STATS_PAD 6
+TCA_STATS_BASIC_HW 7
+TCA_STATS_PKT64 8
diff --git a/src/xlat/rwf_flags.in b/src/xlat/rwf_flags.in
new file mode 100644
index 000000000..3f63f5a2d
--- /dev/null
+++ b/src/xlat/rwf_flags.in
@@ -0,0 +1,5 @@
+RWF_HIPRI 0x01
+RWF_DSYNC 0x02
+RWF_SYNC 0x04
+RWF_NOWAIT 0x08
+RWF_APPEND 0x10
diff --git a/src/xlat/s390_guarded_storage_commands.in b/src/xlat/s390_guarded_storage_commands.in
new file mode 100644
index 000000000..e9a82dde8
--- /dev/null
+++ b/src/xlat/s390_guarded_storage_commands.in
@@ -0,0 +1,6 @@
+#value_indexed
+GS_ENABLE 0
+GS_DISABLE 1
+GS_SET_BC_CB 2
+GS_CLEAR_BC_CB 3
+GS_BROADCAST 4
diff --git a/src/xlat/s390_runtime_instr_commands.in b/src/xlat/s390_runtime_instr_commands.in
new file mode 100644
index 000000000..220acc4b5
--- /dev/null
+++ b/src/xlat/s390_runtime_instr_commands.in
@@ -0,0 +1,3 @@
+#value_indexed
+S390_RUNTIME_INSTR_START 0x1
+S390_RUNTIME_INSTR_STOP 0x2
diff --git a/src/xlat/s390_sthyi_function_codes.in b/src/xlat/s390_sthyi_function_codes.in
new file mode 100644
index 000000000..380cd7fcd
--- /dev/null
+++ b/src/xlat/s390_sthyi_function_codes.in
@@ -0,0 +1 @@
+STHYI_FC_CP_IFL_CAP 0
diff --git a/src/xlat/sa_handler_values.in b/src/xlat/sa_handler_values.in
new file mode 100644
index 000000000..e90761163
--- /dev/null
+++ b/src/xlat/sa_handler_values.in
@@ -0,0 +1,4 @@
+#val_type unsigned long
+SIG_ERR
+SIG_DFL
+SIG_IGN
diff --git a/src/xlat/sched_flags.in b/src/xlat/sched_flags.in
new file mode 100644
index 000000000..62698327e
--- /dev/null
+++ b/src/xlat/sched_flags.in
@@ -0,0 +1,7 @@
+SCHED_FLAG_RESET_ON_FORK 0x01
+SCHED_FLAG_RECLAIM 0x02
+SCHED_FLAG_DL_OVERRUN 0x04
+SCHED_FLAG_KEEP_POLICY 0x08
+SCHED_FLAG_KEEP_PARAMS 0x10
+SCHED_FLAG_UTIL_CLAMP_MIN 0x20
+SCHED_FLAG_UTIL_CLAMP_MAX 0x40
diff --git a/src/xlat/schedulers.in b/src/xlat/schedulers.in
new file mode 100644
index 000000000..4a6e366e1
--- /dev/null
+++ b/src/xlat/schedulers.in
@@ -0,0 +1,7 @@
+SCHED_OTHER
+SCHED_FIFO
+SCHED_RR
+SCHED_BATCH
+SCHED_ISO
+SCHED_IDLE
+SCHED_DEADLINE
diff --git a/src/xlat/scmvals.in b/src/xlat/scmvals.in
new file mode 100644
index 000000000..c3b5539b1
--- /dev/null
+++ b/src/xlat/scmvals.in
@@ -0,0 +1,28 @@
+SCM_RIGHTS 1
+SCM_CREDENTIALS 2
+SCM_SECURITY 3
+
+SO_WIFI_STATUS
+SO_TXTIME
+SO_TIMESTAMP_OLD
+SO_TIMESTAMPNS_OLD
+SO_TIMESTAMPING_OLD
+SO_TIMESTAMP_NEW
+SO_TIMESTAMPNS_NEW
+SO_TIMESTAMPING_NEW
+
+/* Generated by maint/gen_xlat_defs.sh -f '#x' -p 'SCM_TIMESTAMPING_' -c 'asm-generic/socket.h' -a 'asm/socket.h' */
+#if defined __sparc__
+SCM_TIMESTAMPING_OPT_STATS 0x38
+#elif defined __hppa__
+SCM_TIMESTAMPING_OPT_STATS 0x402f
+#else
+SCM_TIMESTAMPING_OPT_STATS 0x36
+#endif
+#if defined __sparc__
+SCM_TIMESTAMPING_PKTINFO 0x3c
+#elif defined __hppa__
+SCM_TIMESTAMPING_PKTINFO 0x4033
+#else
+SCM_TIMESTAMPING_PKTINFO 0x3a
+#endif
diff --git a/src/xlat/scsi_sg_commands.in b/src/xlat/scsi_sg_commands.in
new file mode 100644
index 000000000..44631b533
--- /dev/null
+++ b/src/xlat/scsi_sg_commands.in
@@ -0,0 +1,25 @@
+SG_SET_TIMEOUT 0x2201
+SG_GET_TIMEOUT 0x2202
+SG_EMULATED_HOST 0x2203
+SG_SET_TRANSFORM 0x2204
+SG_GET_TRANSFORM 0x2205
+SG_GET_COMMAND_Q 0x2270
+SG_SET_COMMAND_Q 0x2271
+SG_GET_RESERVED_SIZE 0x2272
+SG_SET_RESERVED_SIZE 0x2275
+SG_GET_SCSI_ID 0x2276
+SG_SET_FORCE_LOW_DMA 0x2279
+SG_GET_LOW_DMA 0x227a
+SG_SET_FORCE_PACK_ID 0x227b
+SG_GET_PACK_ID 0x227c
+SG_GET_NUM_WAITING 0x227d
+SG_SET_DEBUG 0x227e
+SG_GET_SG_TABLESIZE 0x227F
+SG_GET_VERSION_NUM 0x2282
+SG_NEXT_CMD_LEN 0x2283
+SG_SCSI_RESET 0x2284
+SG_IO 0x2285
+SG_GET_REQUEST_TABLE 0x2286
+SG_SET_KEEP_ORPHAN 0x2287
+SG_GET_KEEP_ORPHAN 0x2288
+SG_GET_ACCESS_COUNT 0x2289
diff --git a/src/xlat/secbits.in b/src/xlat/secbits.in
new file mode 100644
index 000000000..975bd8306
--- /dev/null
+++ b/src/xlat/secbits.in
@@ -0,0 +1,8 @@
+SECBIT_NOROOT (1 << 0)
+SECBIT_NOROOT_LOCKED (1 << 1)
+SECBIT_NO_SETUID_FIXUP (1 << 2)
+SECBIT_NO_SETUID_FIXUP_LOCKED (1 << 3)
+SECBIT_KEEP_CAPS (1 << 4)
+SECBIT_KEEP_CAPS_LOCKED (1 << 5)
+SECBIT_NO_CAP_AMBIENT_RAISE (1 << 6)
+SECBIT_NO_CAP_AMBIENT_RAISE_LOCKED (1 << 7)
diff --git a/src/xlat/seccomp_filter_flags.in b/src/xlat/seccomp_filter_flags.in
new file mode 100644
index 000000000..af18f7011
--- /dev/null
+++ b/src/xlat/seccomp_filter_flags.in
@@ -0,0 +1,5 @@
+SECCOMP_FILTER_FLAG_TSYNC (1<<0)
+SECCOMP_FILTER_FLAG_LOG (1<<1)
+SECCOMP_FILTER_FLAG_SPEC_ALLOW (1<<2)
+SECCOMP_FILTER_FLAG_NEW_LISTENER (1<<3)
+SECCOMP_FILTER_FLAG_TSYNC_ESRCH (1<<4)
diff --git a/src/xlat/seccomp_mode.in b/src/xlat/seccomp_mode.in
new file mode 100644
index 000000000..bdaab34fb
--- /dev/null
+++ b/src/xlat/seccomp_mode.in
@@ -0,0 +1,4 @@
+#value_indexed
+SECCOMP_MODE_DISABLED 0
+SECCOMP_MODE_STRICT 1
+SECCOMP_MODE_FILTER 2
diff --git a/src/xlat/seccomp_ops.in b/src/xlat/seccomp_ops.in
new file mode 100644
index 000000000..6695f25bd
--- /dev/null
+++ b/src/xlat/seccomp_ops.in
@@ -0,0 +1,5 @@
+#value_indexed
+SECCOMP_SET_MODE_STRICT 0
+SECCOMP_SET_MODE_FILTER 1
+SECCOMP_GET_ACTION_AVAIL 2
+SECCOMP_GET_NOTIF_SIZES 3
diff --git a/src/xlat/seccomp_ret_action.in b/src/xlat/seccomp_ret_action.in
new file mode 100644
index 000000000..4b1455f52
--- /dev/null
+++ b/src/xlat/seccomp_ret_action.in
@@ -0,0 +1,8 @@
+SECCOMP_RET_KILL_PROCESS 0x80000000U
+SECCOMP_RET_KILL_THREAD 0
+SECCOMP_RET_TRAP 0x00030000U
+SECCOMP_RET_ERRNO 0x00050000U
+SECCOMP_RET_USER_NOTIF 0x7fc00000U
+SECCOMP_RET_TRACE 0x7ff00000U
+SECCOMP_RET_LOG 0x7ffc0000U
+SECCOMP_RET_ALLOW 0x7fff0000U
diff --git a/src/xlat/semctl_flags.in b/src/xlat/semctl_flags.in
new file mode 100644
index 000000000..455ceebd4
--- /dev/null
+++ b/src/xlat/semctl_flags.in
@@ -0,0 +1,15 @@
+#sorted sort -k2,2g
+IPC_RMID 0
+IPC_SET 1
+IPC_STAT 2
+IPC_INFO 3
+GETPID 11
+GETVAL 12
+GETALL 13
+GETNCNT 14
+GETZCNT 15
+SETVAL 16
+SETALL 17
+SEM_STAT 18
+SEM_INFO 19
+SEM_STAT_ANY 20
diff --git a/src/xlat/semop_flags.in b/src/xlat/semop_flags.in
new file mode 100644
index 000000000..110eca640
--- /dev/null
+++ b/src/xlat/semop_flags.in
@@ -0,0 +1,2 @@
+SEM_UNDO
+IPC_NOWAIT
diff --git a/src/xlat/setns_types.in b/src/xlat/setns_types.in
new file mode 100644
index 000000000..df71d25b9
--- /dev/null
+++ b/src/xlat/setns_types.in
@@ -0,0 +1,9 @@
+0
+CLONE_NEWTIME 0x00000080
+CLONE_NEWNS 0x00020000
+CLONE_NEWCGROUP 0x02000000
+CLONE_NEWUTS 0x04000000
+CLONE_NEWIPC 0x08000000
+CLONE_NEWUSER 0x10000000
+CLONE_NEWPID 0x20000000
+CLONE_NEWNET 0x40000000
diff --git a/src/xlat/setsock_ip_options.in b/src/xlat/setsock_ip_options.in
new file mode 100644
index 000000000..c811439f0
--- /dev/null
+++ b/src/xlat/setsock_ip_options.in
@@ -0,0 +1,31 @@
+/*
+ * Options specific to setsockopt(SOL_IP).
+ * Common {g,s}etsockopt(SOL_IP) options
+ * should be in sock_ip_options.in instead.
+ */
+
+ARPT_SO_SET_REPLACE
+ARPT_SO_SET_ADD_COUNTERS
+
+EBT_SO_SET_ENTRIES
+EBT_SO_SET_COUNTERS
+
+IP_VS_SO_SET_NONE
+IP_VS_SO_SET_INSERT
+IP_VS_SO_SET_ADD
+IP_VS_SO_SET_EDIT
+IP_VS_SO_SET_DEL
+IP_VS_SO_SET_FLUSH
+IP_VS_SO_SET_LIST
+IP_VS_SO_SET_ADDDEST
+IP_VS_SO_SET_DELDEST
+IP_VS_SO_SET_EDITDEST
+IP_VS_SO_SET_TIMEOUT
+IP_VS_SO_SET_STARTDAEMON
+IP_VS_SO_SET_STOPDAEMON
+IP_VS_SO_SET_RESTORE
+IP_VS_SO_SET_SAVE
+IP_VS_SO_SET_ZERO
+
+IPT_SO_SET_REPLACE
+IPT_SO_SET_ADD_COUNTERS
diff --git a/src/xlat/setsock_ipv6_options.in b/src/xlat/setsock_ipv6_options.in
new file mode 100644
index 000000000..5a42cdf9a
--- /dev/null
+++ b/src/xlat/setsock_ipv6_options.in
@@ -0,0 +1,8 @@
+/*
+ * Options specific to setsockopt(SOL_IPV6).
+ * Common {g,s}etsockopt(SOL_IPV6) options
+ * should be in sock_ipv6_options.in instead.
+ */
+
+IP6T_SO_SET_REPLACE 64
+IP6T_SO_SET_ADD_COUNTERS 65
diff --git a/src/xlat/setsock_options.in b/src/xlat/setsock_options.in
new file mode 100644
index 000000000..3f14eefd0
--- /dev/null
+++ b/src/xlat/setsock_options.in
@@ -0,0 +1,6 @@
+/* Generated by maint/gen_xlat_defs.sh -f 'u' -p 'SO_ATTACH_FILTER' -c 'asm-generic/socket.h' -a 'asm/socket.h' */
+#if defined __hppa__
+SO_ATTACH_FILTER 16410
+#else
+SO_ATTACH_FILTER 26
+#endif
diff --git a/src/xlat/sfd_flags.in b/src/xlat/sfd_flags.in
new file mode 100644
index 000000000..20a5d1f85
--- /dev/null
+++ b/src/xlat/sfd_flags.in
@@ -0,0 +1,4 @@
+#if defined SFD_CLOEXEC || defined O_CLOEXEC
+SFD_CLOEXEC O_CLOEXEC
+#endif
+SFD_NONBLOCK O_NONBLOCK
diff --git a/src/xlat/sg_io_dxfer_direction.in b/src/xlat/sg_io_dxfer_direction.in
new file mode 100644
index 000000000..ef2ebd323
--- /dev/null
+++ b/src/xlat/sg_io_dxfer_direction.in
@@ -0,0 +1,4 @@
+SG_DXFER_NONE
+SG_DXFER_TO_DEV
+SG_DXFER_FROM_DEV
+SG_DXFER_TO_FROM_DEV
diff --git a/src/xlat/sg_io_flags.in b/src/xlat/sg_io_flags.in
new file mode 100644
index 000000000..68ed12c8a
--- /dev/null
+++ b/src/xlat/sg_io_flags.in
@@ -0,0 +1,6 @@
+SG_FLAG_DIRECT_IO 1
+SG_FLAG_UNUSED_LUN_INHIBIT 2
+SG_FLAG_MMAP_IO 4
+SG_FLAG_NO_DXFER 0x10000
+SG_FLAG_Q_AT_TAIL 0x10
+SG_FLAG_Q_AT_HEAD 0x20
diff --git a/src/xlat/sg_io_info.in b/src/xlat/sg_io_info.in
new file mode 100644
index 000000000..afebe4f3f
--- /dev/null
+++ b/src/xlat/sg_io_info.in
@@ -0,0 +1,3 @@
+SG_INFO_CHECK 1
+SG_INFO_DIRECT_IO 2
+SG_INFO_MIXED_IO 4
diff --git a/src/xlat/sg_scsi_reset.in b/src/xlat/sg_scsi_reset.in
new file mode 100644
index 000000000..0df4a90df
--- /dev/null
+++ b/src/xlat/sg_scsi_reset.in
@@ -0,0 +1,6 @@
+SG_SCSI_RESET_NOTHING 0
+SG_SCSI_RESET_DEVICE 1
+SG_SCSI_RESET_BUS 2
+SG_SCSI_RESET_HOST 3
+SG_SCSI_RESET_TARGET 4
+SG_SCSI_RESET_NO_ESCALATE 0x100
diff --git a/src/xlat/shm_flags.in b/src/xlat/shm_flags.in
new file mode 100644
index 000000000..d93745b9c
--- /dev/null
+++ b/src/xlat/shm_flags.in
@@ -0,0 +1,4 @@
+SHM_RDONLY 010000
+SHM_RND 020000
+SHM_REMAP 040000
+SHM_EXEC 0100000
diff --git a/src/xlat/shm_resource_flags.in b/src/xlat/shm_resource_flags.in
new file mode 100644
index 000000000..30ace6788
--- /dev/null
+++ b/src/xlat/shm_resource_flags.in
@@ -0,0 +1,4 @@
+IPC_CREAT 01000
+IPC_EXCL 02000
+SHM_HUGETLB 04000
+SHM_NORESERVE 010000
diff --git a/src/xlat/shmctl_flags.in b/src/xlat/shmctl_flags.in
new file mode 100644
index 000000000..8394a53e8
--- /dev/null
+++ b/src/xlat/shmctl_flags.in
@@ -0,0 +1,10 @@
+#sorted sort -k2,2g
+IPC_RMID 0
+IPC_SET 1
+IPC_STAT 2
+IPC_INFO 3
+SHM_LOCK 11
+SHM_UNLOCK 12
+SHM_STAT 13
+SHM_INFO 14
+SHM_STAT_ANY 15
diff --git a/src/xlat/shutdown_modes.in b/src/xlat/shutdown_modes.in
new file mode 100644
index 000000000..da592b912
--- /dev/null
+++ b/src/xlat/shutdown_modes.in
@@ -0,0 +1,4 @@
+#value_indexed
+SHUT_RD 0
+SHUT_WR 1
+SHUT_RDWR 2
diff --git a/src/xlat/sigact_flags.in b/src/xlat/sigact_flags.in
new file mode 100644
index 000000000..00ad94314
--- /dev/null
+++ b/src/xlat/sigact_flags.in
@@ -0,0 +1,20 @@
+SA_RESTORER
+SA_ONSTACK
+SA_RESTART
+SA_INTERRUPT
+SA_NODEFER
+#if defined SA_NOMASK && SA_NODEFER != SA_NOMASK
+SA_NOMASK
+#endif
+SA_RESETHAND
+#if defined SA_ONESHOT && SA_ONESHOT != SA_RESETHAND
+SA_ONESHOT
+#endif
+SA_SIGINFO
+SA_RESETHAND
+SA_ONSTACK
+SA_NODEFER
+SA_NOCLDSTOP
+SA_NOCLDWAIT
+_SA_BSDCALL
+SA_NOPTRACE
diff --git a/src/xlat/sigaltstack_flags.in b/src/xlat/sigaltstack_flags.in
new file mode 100644
index 000000000..931379844
--- /dev/null
+++ b/src/xlat/sigaltstack_flags.in
@@ -0,0 +1,3 @@
+SS_ONSTACK 1
+SS_DISABLE 2
+SS_AUTODISARM (1U << 31)
diff --git a/src/xlat/sigbus_codes.in b/src/xlat/sigbus_codes.in
new file mode 100644
index 000000000..54f1b433a
--- /dev/null
+++ b/src/xlat/sigbus_codes.in
@@ -0,0 +1,6 @@
+BUS_ADRALN 1
+BUS_ADRERR 2
+BUS_OBJERR 3
+BUS_OPFETCH /* 4 - bfin */
+BUS_MCEERR_AR 4
+BUS_MCEERR_AO 5
diff --git a/src/xlat/sigchld_codes.in b/src/xlat/sigchld_codes.in
new file mode 100644
index 000000000..a919bbae8
--- /dev/null
+++ b/src/xlat/sigchld_codes.in
@@ -0,0 +1,7 @@
+#value_indexed
+CLD_EXITED 1
+CLD_KILLED 2
+CLD_DUMPED 3
+CLD_TRAPPED 4
+CLD_STOPPED 5
+CLD_CONTINUED 6
diff --git a/src/xlat/sigemt_codes.in b/src/xlat/sigemt_codes.in
new file mode 100644
index 000000000..eb8756160
--- /dev/null
+++ b/src/xlat/sigemt_codes.in
@@ -0,0 +1 @@
+EMT_TAGOVF 1
diff --git a/src/xlat/sigev_value.in b/src/xlat/sigev_value.in
new file mode 100644
index 000000000..961d0ec77
--- /dev/null
+++ b/src/xlat/sigev_value.in
@@ -0,0 +1,5 @@
+#value_indexed
+SIGEV_SIGNAL 0
+SIGEV_NONE 1
+SIGEV_THREAD 2
+SIGEV_THREAD_ID 4
diff --git a/src/xlat/sigfpe_codes.in b/src/xlat/sigfpe_codes.in
new file mode 100644
index 000000000..4abd621aa
--- /dev/null
+++ b/src/xlat/sigfpe_codes.in
@@ -0,0 +1,16 @@
+FPE_INTDIV 1
+FPE_INTOVF 2
+FPE_FLTDIV 3
+FPE_FLTOVF 4
+FPE_FLTUND 5
+FPE_FLTRES 6
+FPE_FLTINV 7
+FPE_FLTSUB 8
+FPE_MDAOVF /* 9 - frv */
+__FPE_DECOVF /* 9 - ia64 */
+__FPE_DECDIV /* 10 - ia64 */
+__FPE_DECERR /* 11 - ia64 */
+__FPE_INVASC /* 12 - ia64 */
+__FPE_INVDEC /* 13 - ia64 */
+FPE_FLTUNK 14
+FPE_CONDTRAP 15
diff --git a/src/xlat/sigill_codes.in b/src/xlat/sigill_codes.in
new file mode 100644
index 000000000..12cd2cfa6
--- /dev/null
+++ b/src/xlat/sigill_codes.in
@@ -0,0 +1,18 @@
+ILL_ILLOPC 1
+ILL_ILLPARAOP /* 2 - bfin */
+ILL_ILLOPN 2
+ILL_ILLADR 3
+ILL_ILLEXCPT /* 4 - bfin */
+ILL_ILLTRP 4
+ILL_PRVOPC 5
+ILL_PRVREG 6
+ILL_COPROC 7
+ILL_BADSTK 8
+ILL_CPLB_VI /* 9 - bfin */
+ILL_CPLB_MISS /* 10 - bfin */
+ILL_CPLB_MULHIT /* 11 - bfin */
+ILL_DBLFLT /* 9 - tile */
+ILL_HARDWALL /* 10 - tile */
+ILL_BADIADDR /* 9 - ia64 */
+__ILL_BREAK /* 10 - ia64 */
+__ILL_BNDMOD /* 11 - ia64 */
diff --git a/src/xlat/siginfo_codes.in b/src/xlat/siginfo_codes.in
new file mode 100644
index 000000000..b3e0888a0
--- /dev/null
+++ b/src/xlat/siginfo_codes.in
@@ -0,0 +1,22 @@
+SI_USER 0
+SI_KERNEL 0x80
+SI_QUEUE -1
+
+#ifdef __mips__
+SI_ASYNCIO -2
+SI_TIMER -3
+SI_MESGQ -4
+#else
+SI_TIMER -2
+SI_MESGQ -3
+SI_ASYNCIO -4
+#endif
+
+SI_SIGIO -5
+SI_TKILL -6
+SI_DETHREAD -7
+SI_ASYNCNL -60
+
+#ifdef __sparc__
+SI_NOINFO 32767
+#endif
diff --git a/src/xlat/sigpoll_codes.in b/src/xlat/sigpoll_codes.in
new file mode 100644
index 000000000..a5471678b
--- /dev/null
+++ b/src/xlat/sigpoll_codes.in
@@ -0,0 +1,7 @@
+#value_indexed
+POLL_IN 1
+POLL_OUT 2
+POLL_MSG 3
+POLL_ERR 4
+POLL_PRI 5
+POLL_HUP 6
diff --git a/src/xlat/sigprocmaskcmds.in b/src/xlat/sigprocmaskcmds.in
new file mode 100644
index 000000000..d88a02db2
--- /dev/null
+++ b/src/xlat/sigprocmaskcmds.in
@@ -0,0 +1,4 @@
+SIG_BLOCK
+SIG_UNBLOCK
+SIG_SETMASK
+SIG_SETMASK32
diff --git a/src/xlat/sigprof_codes.in b/src/xlat/sigprof_codes.in
new file mode 100644
index 000000000..64dac115e
--- /dev/null
+++ b/src/xlat/sigprof_codes.in
@@ -0,0 +1 @@
+PROF_SIG
diff --git a/src/xlat/sigsegv_codes.in b/src/xlat/sigsegv_codes.in
new file mode 100644
index 000000000..a5fa5f833
--- /dev/null
+++ b/src/xlat/sigsegv_codes.in
@@ -0,0 +1,11 @@
+SEGV_MAPERR 1
+SEGV_ACCERR 2
+SEGV_STACKFLOW /* 3 - bfin */
+SEGV_BNDERR 3
+__SEGV_PSTKOVF /* 4 - ia64 */
+SEGV_PKUERR 4
+SEGV_ACCADI 5 /* sparc */
+SEGV_ADIDERR 6 /* sparc */
+SEGV_ADIPERR 7 /* sparc */
+SEGV_MTEAERR 8 /* arm64 */
+SEGV_MTESERR 9 /* arm64 */
diff --git a/src/xlat/sigsys_codes.in b/src/xlat/sigsys_codes.in
new file mode 100644
index 000000000..a8c489160
--- /dev/null
+++ b/src/xlat/sigsys_codes.in
@@ -0,0 +1 @@
+SYS_SECCOMP 1
diff --git a/src/xlat/sigtrap_codes.in b/src/xlat/sigtrap_codes.in
new file mode 100644
index 000000000..55917a7f0
--- /dev/null
+++ b/src/xlat/sigtrap_codes.in
@@ -0,0 +1,9 @@
+TRAP_STEP /* 1 - bfin */
+TRAP_BRKPT 1
+TRAP_TRACEFLOW /* 2 - bfin */
+TRAP_TRACE 2
+TRAP_WATCHPT /* 3 - bfin */
+TRAP_BRANCH 3
+TRAP_ILLTRAP /* 4 - bfin */
+TRAP_HWBKPT 4
+TRAP_UNK 5
diff --git a/src/xlat/skf_ad.in b/src/xlat/skf_ad.in
new file mode 100644
index 000000000..f5b56134f
--- /dev/null
+++ b/src/xlat/skf_ad.in
@@ -0,0 +1,16 @@
+SKF_AD_PROTOCOL 0
+SKF_AD_PKTTYPE 4
+SKF_AD_IFINDEX 8
+SKF_AD_NLATTR 12
+SKF_AD_NLATTR_NEST 16
+SKF_AD_MARK 20
+SKF_AD_QUEUE 24
+SKF_AD_HATYPE 28
+SKF_AD_RXHASH 32
+SKF_AD_CPU 36
+SKF_AD_ALU_XOR_X 40
+SKF_AD_VLAN_TAG 44
+SKF_AD_VLAN_TAG_PRESENT 48
+SKF_AD_PAY_OFFSET 52
+SKF_AD_RANDOM 56
+SKF_AD_VLAN_TPID 60
diff --git a/src/xlat/skf_off.in b/src/xlat/skf_off.in
new file mode 100644
index 000000000..afb75eeab
--- /dev/null
+++ b/src/xlat/skf_off.in
@@ -0,0 +1,3 @@
+SKF_AD_OFF -0x1000
+SKF_NET_OFF -0x100000
+SKF_LL_OFF -0x200000
diff --git a/src/xlat/smc_decl_codes.in b/src/xlat/smc_decl_codes.in
new file mode 100644
index 000000000..2832da334
--- /dev/null
+++ b/src/xlat/smc_decl_codes.in
@@ -0,0 +1,17 @@
+#sorted
+SMC_CLC_DECL_MEM 0x01010000
+SMC_CLC_DECL_TIMEOUT_CL 0x02010000
+SMC_CLC_DECL_TIMEOUT_AL 0x02020000
+SMC_CLC_DECL_CNFERR 0x03000000
+SMC_CLC_DECL_PEERNOSMC 0x03010000
+SMC_CLC_DECL_IPSEC 0x03020000
+SMC_CLC_DECL_NOSMCDEV 0x03030000
+SMC_CLC_DECL_MODEUNSUPP 0x03040000
+SMC_CLC_DECL_RMBE_EC 0x03050000
+SMC_CLC_DECL_OPTUNSUPP 0x03060000
+SMC_CLC_DECL_SYNCERR 0x04000000
+SMC_CLC_DECL_PEERDECL 0x05000000
+SMC_CLC_DECL_INTERR 0x99990000
+SMC_CLC_DECL_ERR_RTOK 0x99990001
+SMC_CLC_DECL_ERR_RDYLNK 0x99990002
+SMC_CLC_DECL_ERR_REGRMB 0x99990003
diff --git a/src/xlat/smc_diag_attrs.in b/src/xlat/smc_diag_attrs.in
new file mode 100644
index 000000000..4da24d57e
--- /dev/null
+++ b/src/xlat/smc_diag_attrs.in
@@ -0,0 +1,8 @@
+#unconditional
+#value_indexed
+SMC_DIAG_NONE
+SMC_DIAG_CONNINFO
+SMC_DIAG_LGRINFO
+SMC_DIAG_SHUTDOWN
+SMC_DIAG_DMBINFO
+SMC_DIAG_FALLBACK
diff --git a/src/xlat/smc_diag_extended_flags.in b/src/xlat/smc_diag_extended_flags.in
new file mode 100644
index 000000000..9bd395813
--- /dev/null
+++ b/src/xlat/smc_diag_extended_flags.in
@@ -0,0 +1,3 @@
+#unconditional
+1<<(SMC_DIAG_CONNINFO-1)
+1<<(SMC_DIAG_LGRINFO-1)
diff --git a/src/xlat/smc_diag_mode.in b/src/xlat/smc_diag_mode.in
new file mode 100644
index 000000000..4ac39639c
--- /dev/null
+++ b/src/xlat/smc_diag_mode.in
@@ -0,0 +1,4 @@
+#value_indexed
+SMC_DIAG_MODE_SMCR 0
+SMC_DIAG_MODE_FALLBACK_TCP 1
+SMC_DIAG_MODE_SMCD 2
diff --git a/src/xlat/smc_link_group_roles.in b/src/xlat/smc_link_group_roles.in
new file mode 100644
index 000000000..c278526ae
--- /dev/null
+++ b/src/xlat/smc_link_group_roles.in
@@ -0,0 +1,3 @@
+#value_indexed
+SMC_CLNT 0
+SMC_SERV 1
diff --git a/src/xlat/smc_protocols.in b/src/xlat/smc_protocols.in
new file mode 100644
index 000000000..b8c1aaeaf
--- /dev/null
+++ b/src/xlat/smc_protocols.in
@@ -0,0 +1,3 @@
+#value_indexed
+SMCPROTO_SMC 0
+SMCPROTO_SMC6 1
diff --git a/src/xlat/smc_states.in b/src/xlat/smc_states.in
new file mode 100644
index 000000000..d197b1f7b
--- /dev/null
+++ b/src/xlat/smc_states.in
@@ -0,0 +1,12 @@
+SMC_ACTIVE 1
+SMC_INIT 2
+SMC_CLOSED 7
+SMC_LISTEN 10
+SMC_PEERCLOSEWAIT1 20
+SMC_PEERCLOSEWAIT2 21
+SMC_APPFINCLOSEWAIT 24
+SMC_APPCLOSEWAIT1 22
+SMC_APPCLOSEWAIT2 23
+SMC_PEERFINCLOSEWAIT 25
+SMC_PEERABORTWAIT 26
+SMC_PROCESSABORT 27
diff --git a/src/xlat/snmp_icmp6_stats.in b/src/xlat/snmp_icmp6_stats.in
new file mode 100644
index 000000000..ee4769e7c
--- /dev/null
+++ b/src/xlat/snmp_icmp6_stats.in
@@ -0,0 +1,7 @@
+#value_indexed
+ICMP6_MIB_NUM 0
+ICMP6_MIB_INMSGS 1
+ICMP6_MIB_INERRORS 2
+ICMP6_MIB_OUTMSGS 3
+ICMP6_MIB_OUTERRORS 4
+ICMP6_MIB_CSUMERRORS 5
diff --git a/src/xlat/snmp_ip_stats.in b/src/xlat/snmp_ip_stats.in
new file mode 100644
index 000000000..7de755dc9
--- /dev/null
+++ b/src/xlat/snmp_ip_stats.in
@@ -0,0 +1,38 @@
+#value_indexed
+IPSTATS_MIB_NUM 0
+IPSTATS_MIB_INPKTS 1
+IPSTATS_MIB_INOCTETS 2
+IPSTATS_MIB_INDELIVERS 3
+IPSTATS_MIB_OUTFORWDATAGRAMS 4
+IPSTATS_MIB_OUTPKTS 5
+IPSTATS_MIB_OUTOCTETS 6
+IPSTATS_MIB_INHDRERRORS 7
+IPSTATS_MIB_INTOOBIGERRORS 8
+IPSTATS_MIB_INNOROUTES 9
+IPSTATS_MIB_INADDRERRORS 10
+IPSTATS_MIB_INUNKNOWNPROTOS 11
+IPSTATS_MIB_INTRUNCATEDPKTS 12
+IPSTATS_MIB_INDISCARDS 13
+IPSTATS_MIB_OUTDISCARDS 14
+IPSTATS_MIB_OUTNOROUTES 15
+IPSTATS_MIB_REASMTIMEOUT 16
+IPSTATS_MIB_REASMREQDS 17
+IPSTATS_MIB_REASMOKS 18
+IPSTATS_MIB_REASMFAILS 19
+IPSTATS_MIB_FRAGOKS 20
+IPSTATS_MIB_FRAGFAILS 21
+IPSTATS_MIB_FRAGCREATES 22
+IPSTATS_MIB_INMCASTPKTS 23
+IPSTATS_MIB_OUTMCASTPKTS 24
+IPSTATS_MIB_INBCASTPKTS 25
+IPSTATS_MIB_OUTBCASTPKTS 26
+IPSTATS_MIB_INMCASTOCTETS 27
+IPSTATS_MIB_OUTMCASTOCTETS 28
+IPSTATS_MIB_INBCASTOCTETS 29
+IPSTATS_MIB_OUTBCASTOCTETS 30
+IPSTATS_MIB_CSUMERRORS 31
+IPSTATS_MIB_NOECTPKTS 32
+IPSTATS_MIB_ECT1PKTS 33
+IPSTATS_MIB_ECT0PKTS 34
+IPSTATS_MIB_CEPKTS 35
+IPSTATS_MIB_REASM_OVERLAPS 36
diff --git a/src/xlat/sock_alg_options.in b/src/xlat/sock_alg_options.in
new file mode 100644
index 000000000..ca1f870bc
--- /dev/null
+++ b/src/xlat/sock_alg_options.in
@@ -0,0 +1,7 @@
+#value_indexed
+ALG_SET_KEY 1
+ALG_SET_IV 2
+ALG_SET_OP 3
+ALG_SET_AEAD_ASSOCLEN 4
+ALG_SET_AEAD_AUTHSIZE 5
+ALG_SET_DRBG_ENTROPY 6
diff --git a/src/xlat/sock_ax25_options.in b/src/xlat/sock_ax25_options.in
new file mode 100644
index 000000000..2a526104f
--- /dev/null
+++ b/src/xlat/sock_ax25_options.in
@@ -0,0 +1,15 @@
+#sorted
+AX25_WINDOW 1
+AX25_T1 2
+AX25_N2 3
+AX25_T3 4
+AX25_T2 5
+AX25_BACKOFF 6
+AX25_EXTSEQ 7
+AX25_PIDINCL 8
+AX25_IDLE 9
+AX25_PACLEN 10
+AX25_IAMDIGI 12
+
+/* 13, 25, or 16409, depending on arch */
+SO_BINDTODEVICE
diff --git a/src/xlat/sock_bluetooth_options.in b/src/xlat/sock_bluetooth_options.in
new file mode 100644
index 000000000..4c91dd296
--- /dev/null
+++ b/src/xlat/sock_bluetooth_options.in
@@ -0,0 +1,9 @@
+#sorted sort -k2,2n
+BT_SECURITY 4
+BT_DEFER_SETUP 7
+BT_FLUSHABLE 8
+BT_POWER 9
+BT_CHANNEL_POLICY 10
+BT_VOICE 11
+BT_SNDMTU 12
+BT_RCVMTU 13
diff --git a/src/xlat/sock_caif_options.in b/src/xlat/sock_caif_options.in
new file mode 100644
index 000000000..5e1c0444f
--- /dev/null
+++ b/src/xlat/sock_caif_options.in
@@ -0,0 +1,3 @@
+CAIFSO_LINK_SELECT 127
+CAIFSO_REQ_PARAM 128
+CAIFSO_RSP_PARAM 129
diff --git a/src/xlat/sock_dccp_options.in b/src/xlat/sock_dccp_options.in
new file mode 100644
index 000000000..e168b06b3
--- /dev/null
+++ b/src/xlat/sock_dccp_options.in
@@ -0,0 +1,17 @@
+#sorted sort -k2,2n
+DCCP_SOCKOPT_PACKET_SIZE 1
+DCCP_SOCKOPT_SERVICE 2
+DCCP_SOCKOPT_CHANGE_L 3
+DCCP_SOCKOPT_CHANGE_R 4
+DCCP_SOCKOPT_GET_CUR_MPS 5
+DCCP_SOCKOPT_SERVER_TIMEWAIT 6
+DCCP_SOCKOPT_SEND_CSCOV 10
+DCCP_SOCKOPT_RECV_CSCOV 11
+DCCP_SOCKOPT_AVAILABLE_CCIDS 12
+DCCP_SOCKOPT_CCID 13
+DCCP_SOCKOPT_TX_CCID 14
+DCCP_SOCKOPT_RX_CCID 15
+DCCP_SOCKOPT_QPOLICY_ID 16
+DCCP_SOCKOPT_QPOLICY_TXQLEN 17
+DCCP_SOCKOPT_CCID_RX_INFO 128
+DCCP_SOCKOPT_CCID_TX_INFO 192
diff --git a/src/xlat/sock_ip_options.in b/src/xlat/sock_ip_options.in
new file mode 100644
index 000000000..d9a60d389
--- /dev/null
+++ b/src/xlat/sock_ip_options.in
@@ -0,0 +1,51 @@
+IP_TOS
+IP_TTL
+IP_HDRINCL
+IP_OPTIONS
+IP_ROUTER_ALERT
+IP_RECVOPTIONS
+IP_RECVOPTS
+IP_RETOPTS
+IP_RECVRETOPTS
+IP_RECVDSTADDR
+IP_PKTINFO
+IP_PKTOPTIONS
+IP_MTU_DISCOVER
+IP_RECVERR
+IP_RECVTTL
+IP_RECVTOS
+IP_MTU
+IP_MULTICAST_IF
+IP_MULTICAST_TTL
+IP_MULTICAST_LOOP
+IP_ADD_MEMBERSHIP
+IP_DROP_MEMBERSHIP
+IP_BROADCAST_IF
+IP_RECVIFINDEX
+IP_MSFILTER
+IP_FREEBIND
+IP_IPSEC_POLICY
+IP_XFRM_POLICY
+IP_PASSSEC
+IP_TRANSPARENT
+IP_ORIGDSTADDR
+IP_RECVORIGDSTADDR
+IP_MINTTL
+IP_NODEFRAG
+IP_CHECKSUM
+IP_BIND_ADDRESS_NO_PORT
+IP_RECVFRAGSIZE
+IP_RECVERR_RFC4884
+IP_UNBLOCK_SOURCE
+IP_BLOCK_SOURCE
+IP_ADD_SOURCE_MEMBERSHIP
+IP_DROP_SOURCE_MEMBERSHIP
+MCAST_JOIN_GROUP
+MCAST_BLOCK_SOURCE
+MCAST_UNBLOCK_SOURCE
+MCAST_LEAVE_GROUP
+MCAST_JOIN_SOURCE_GROUP
+MCAST_LEAVE_SOURCE_GROUP
+MCAST_MSFILTER
+IP_MULTICAST_ALL
+IP_UNICAST_IF
diff --git a/src/xlat/sock_ipv6_options.in b/src/xlat/sock_ipv6_options.in
new file mode 100644
index 000000000..39c811d14
--- /dev/null
+++ b/src/xlat/sock_ipv6_options.in
@@ -0,0 +1,65 @@
+IPV6_ADDRFORM
+IPV6_2292PKTINFO
+IPV6_2292HOPOPTS
+IPV6_2292DSTOPTS
+IPV6_2292RTHDR
+IPV6_2292PKTOPTIONS
+IPV6_CHECKSUM
+IPV6_2292HOPLIMIT
+IPV6_NEXTHOP
+IPV6_AUTHHDR
+IPV6_FLOWINFO
+IPV6_UNICAST_HOPS
+IPV6_MULTICAST_IF
+IPV6_MULTICAST_HOPS
+IPV6_MULTICAST_LOOP
+IPV6_ADD_MEMBERSHIP
+IPV6_DROP_MEMBERSHIP
+IPV6_ROUTER_ALERT
+IPV6_MTU_DISCOVER
+IPV6_MTU
+IPV6_RECVERR
+IPV6_V6ONLY
+IPV6_JOIN_ANYCAST
+IPV6_LEAVE_ANYCAST
+IPV6_MULTICAST_ALL
+IPV6_ROUTER_ALERT_ISOLATE
+IPV6_RECVERR_RFC4884
+IPV6_FLOWLABEL_MGR
+IPV6_FLOWINFO_SEND
+IPV6_IPSEC_POLICY
+IPV6_XFRM_POLICY
+IPV6_HDRINCL
+MCAST_JOIN_GROUP
+MCAST_BLOCK_SOURCE
+MCAST_UNBLOCK_SOURCE
+MCAST_LEAVE_GROUP
+MCAST_JOIN_SOURCE_GROUP
+MCAST_LEAVE_SOURCE_GROUP
+MCAST_MSFILTER
+IPV6_RECVPKTINFO
+IPV6_PKTINFO
+IPV6_RECVHOPLIMIT
+IPV6_HOPLIMIT
+IPV6_RECVHOPOPTS
+IPV6_HOPOPTS
+IPV6_RTHDRDSTOPTS
+IPV6_RECVRTHDR
+IPV6_RTHDR
+IPV6_RECVDSTOPTS
+IPV6_DSTOPTS
+IPV6_RECVPATHMTU
+IPV6_PATHMTU
+IPV6_DONTFRAG
+IPV6_USE_MIN_MTU
+IPV6_RECVTCLASS
+IPV6_TCLASS
+IPV6_AUTOFLOWLABEL
+IPV6_ADDR_PREFERENCES
+IPV6_MINHOPCOUNT
+IPV6_ORIGDSTADDR
+IPV6_RECVORIGDSTADDR
+IPV6_TRANSPARENT
+IPV6_UNICAST_IF
+IPV6_RECVFRAGSIZE
+IPV6_FREEBIND
diff --git a/src/xlat/sock_ipx_options.in b/src/xlat/sock_ipx_options.in
new file mode 100644
index 000000000..eba97fd71
--- /dev/null
+++ b/src/xlat/sock_ipx_options.in
@@ -0,0 +1 @@
+IPX_TYPE
diff --git a/src/xlat/sock_irda_options.in b/src/xlat/sock_irda_options.in
new file mode 100644
index 000000000..a26e098b5
--- /dev/null
+++ b/src/xlat/sock_irda_options.in
@@ -0,0 +1,12 @@
+#value_indexed
+IRLMP_ENUMDEVICES 1
+IRLMP_IAS_SET 2
+IRLMP_IAS_QUERY 3
+IRLMP_HINTS_SET 4
+IRLMP_QOS_SET 5
+IRLMP_QOS_GET 6
+IRLMP_MAX_SDU_SIZE 7
+IRLMP_IAS_GET 8
+IRLMP_IAS_DEL 9
+IRLMP_HINT_MASK_SET 10
+IRLMP_WAITDEVICE 11
diff --git a/src/xlat/sock_iucv_options.in b/src/xlat/sock_iucv_options.in
new file mode 100644
index 000000000..827b54c2b
--- /dev/null
+++ b/src/xlat/sock_iucv_options.in
@@ -0,0 +1,3 @@
+SO_IPRMDATA_MSG 0x0080
+SO_MSGLIMIT 0x1000
+SO_MSGSIZE 0x0800
diff --git a/src/xlat/sock_kcm_options.in b/src/xlat/sock_kcm_options.in
new file mode 100644
index 000000000..ee58639a4
--- /dev/null
+++ b/src/xlat/sock_kcm_options.in
@@ -0,0 +1 @@
+KCM_RECV_DISABLE 1
diff --git a/src/xlat/sock_llc_options.in b/src/xlat/sock_llc_options.in
new file mode 100644
index 000000000..7a948d712
--- /dev/null
+++ b/src/xlat/sock_llc_options.in
@@ -0,0 +1,11 @@
+#value_indexed
+LLC_OPT_UNKNOWN 0
+LLC_OPT_RETRY 1
+LLC_OPT_SIZE 2
+LLC_OPT_ACK_TMR_EXP 3
+LLC_OPT_P_TMR_EXP 4
+LLC_OPT_REJ_TMR_EXP 5
+LLC_OPT_BUSY_TMR_EXP 6
+LLC_OPT_TX_WIN 7
+LLC_OPT_RX_WIN 8
+LLC_OPT_PKTINFO 9
diff --git a/src/xlat/sock_netlink_options.in b/src/xlat/sock_netlink_options.in
new file mode 100644
index 000000000..e754ba590
--- /dev/null
+++ b/src/xlat/sock_netlink_options.in
@@ -0,0 +1,13 @@
+#value_indexed
+NETLINK_ADD_MEMBERSHIP 1
+NETLINK_DROP_MEMBERSHIP 2
+NETLINK_PKTINFO 3
+NETLINK_BROADCAST_ERROR 4
+NETLINK_NO_ENOBUFS 5
+NETLINK_RX_RING 6
+NETLINK_TX_RING 7
+NETLINK_LISTEN_ALL_NSID 8
+NETLINK_LIST_MEMBERSHIPS 9
+NETLINK_CAP_ACK 10
+NETLINK_EXT_ACK 11
+NETLINK_DUMP_STRICT_CHK 12
diff --git a/src/xlat/sock_nfcllcp_options.in b/src/xlat/sock_nfcllcp_options.in
new file mode 100644
index 000000000..c9f9fdc0f
--- /dev/null
+++ b/src/xlat/sock_nfcllcp_options.in
@@ -0,0 +1,6 @@
+#value_indexed
+NFC_LLCP_RW 0
+NFC_LLCP_MIUX 1
+NFC_LLCP_REMOTE_MIU 2
+NFC_LLCP_REMOTE_LTO 3
+NFC_LLCP_REMOTE_RW 4
diff --git a/src/xlat/sock_options.in b/src/xlat/sock_options.in
new file mode 100644
index 000000000..d6452a5d7
--- /dev/null
+++ b/src/xlat/sock_options.in
@@ -0,0 +1,513 @@
+/* Generated by maint/gen_xlat_defs.sh -f 'u' -p 'SO_' -c 'asm-generic/socket.h' -a 'asm/socket.h' */
+
+SO_DEBUG 1
+
+#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__
+SO_REUSEADDR 4
+#else
+SO_REUSEADDR 2
+#endif
+
+#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__
+SO_TYPE 4104
+#else
+SO_TYPE 3
+#endif
+
+#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__
+SO_ERROR 4103
+#else
+SO_ERROR 4
+#endif
+
+#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__
+SO_DONTROUTE 16
+#else
+SO_DONTROUTE 5
+#endif
+
+#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__
+SO_BROADCAST 32
+#else
+SO_BROADCAST 6
+#endif
+
+#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__
+SO_SNDBUF 4097
+#else
+SO_SNDBUF 7
+#endif
+
+#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__
+SO_RCVBUF 4098
+#else
+SO_RCVBUF 8
+#endif
+
+#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__
+SO_KEEPALIVE 8
+#else
+SO_KEEPALIVE 9
+#endif
+
+#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__
+SO_OOBINLINE 256
+#else
+SO_OOBINLINE 10
+#endif
+
+#if defined __hppa__
+SO_NO_CHECK 16395
+#else
+SO_NO_CHECK 11
+#endif
+
+#if defined __hppa__
+SO_PRIORITY 16396
+#else
+SO_PRIORITY 12
+#endif
+
+#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__
+SO_LINGER 128
+#else
+SO_LINGER 13
+#endif
+
+#if defined __sparc__
+SO_BSDCOMPAT 1024
+#elif defined __hppa__
+SO_BSDCOMPAT 16398
+#else
+SO_BSDCOMPAT 14
+#endif
+
+#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__
+SO_REUSEPORT 512
+#else
+SO_REUSEPORT 15
+#endif
+
+#if defined __sparc__
+SO_PASSCRED 2
+#elif defined __alpha__ || defined __mips__
+SO_PASSCRED 17
+#elif defined __powerpc__
+SO_PASSCRED 20
+#elif defined __hppa__
+SO_PASSCRED 16400
+#else
+SO_PASSCRED 16
+#endif
+
+#if defined __alpha__ || defined __mips__
+SO_PEERCRED 18
+#elif defined __powerpc__
+SO_PEERCRED 21
+#elif defined __sparc__
+SO_PEERCRED 64
+#elif defined __hppa__
+SO_PEERCRED 16401
+#else
+SO_PEERCRED 17
+#endif
+
+#if defined __powerpc__
+SO_RCVLOWAT 16
+#elif defined __sparc__
+SO_RCVLOWAT 2048
+#elif defined __hppa__ || defined __mips__
+SO_RCVLOWAT 4100
+#elif defined __alpha__
+SO_RCVLOWAT 4112
+#else
+SO_RCVLOWAT 18
+#endif
+
+#if defined __powerpc__
+SO_SNDLOWAT 17
+#elif defined __sparc__
+SO_SNDLOWAT 4096
+#elif defined __hppa__ || defined __mips__
+SO_SNDLOWAT 4099
+#elif defined __alpha__
+SO_SNDLOWAT 4113
+#else
+SO_SNDLOWAT 19
+#endif
+
+#if defined __powerpc__
+SO_RCVTIMEO_OLD 18
+#elif defined __hppa__ || defined __mips__
+SO_RCVTIMEO_OLD 4102
+#elif defined __alpha__
+SO_RCVTIMEO_OLD 4114
+#elif defined __sparc__
+SO_RCVTIMEO_OLD 8192
+#else
+SO_RCVTIMEO_OLD 20
+#endif
+
+#if defined __powerpc__
+SO_SNDTIMEO_OLD 19
+#elif defined __hppa__ || defined __mips__
+SO_SNDTIMEO_OLD 4101
+#elif defined __alpha__
+SO_SNDTIMEO_OLD 4115
+#elif defined __sparc__
+SO_SNDTIMEO_OLD 16384
+#else
+SO_SNDTIMEO_OLD 21
+#endif
+
+#if defined __alpha__
+SO_SECURITY_AUTHENTICATION 19
+#elif defined __hppa__
+SO_SECURITY_AUTHENTICATION 16406
+#elif defined __sparc__
+SO_SECURITY_AUTHENTICATION 20481
+#else
+SO_SECURITY_AUTHENTICATION 22
+#endif
+
+#if defined __alpha__
+SO_SECURITY_ENCRYPTION_TRANSPORT 20
+#elif defined __hppa__
+SO_SECURITY_ENCRYPTION_TRANSPORT 16407
+#elif defined __sparc__
+SO_SECURITY_ENCRYPTION_TRANSPORT 20482
+#else
+SO_SECURITY_ENCRYPTION_TRANSPORT 23
+#endif
+
+#if defined __alpha__
+SO_SECURITY_ENCRYPTION_NETWORK 21
+#elif defined __hppa__
+SO_SECURITY_ENCRYPTION_NETWORK 16408
+#elif defined __sparc__
+SO_SECURITY_ENCRYPTION_NETWORK 20484
+#else
+SO_SECURITY_ENCRYPTION_NETWORK 24
+#endif
+
+#if defined __sparc__
+SO_BINDTODEVICE 13
+#elif defined __hppa__
+SO_BINDTODEVICE 16409
+#else
+SO_BINDTODEVICE 25
+#endif
+
+/* SO_ATTACH_FILTER is in setsock_options.h */
+
+#if defined __hppa__
+SO_DETACH_FILTER 16411
+#else
+SO_DETACH_FILTER 27
+#endif
+
+#if defined __hppa__
+SO_PEERNAME 8192
+#else
+SO_PEERNAME 28
+#endif
+
+#if defined __hppa__
+SO_TIMESTAMP_OLD 16402
+#else
+SO_TIMESTAMP_OLD 29
+#endif
+
+#if defined __mips__
+SO_ACCEPTCONN 4105
+#elif defined __alpha__
+SO_ACCEPTCONN 4116
+#elif defined __hppa__
+SO_ACCEPTCONN 16412
+#elif defined __sparc__
+SO_ACCEPTCONN 32768
+#else
+SO_ACCEPTCONN 30
+#endif
+
+#if defined __alpha__ || defined __mips__ || defined __sparc__
+SO_PEERSEC 30
+#elif defined __hppa__
+SO_PEERSEC 16413
+#else
+SO_PEERSEC 31
+#endif
+
+#if defined __mips__
+SO_SNDBUFFORCE 31
+#elif defined __alpha__ || defined __hppa__ || defined __sparc__
+SO_SNDBUFFORCE 4106
+#else
+SO_SNDBUFFORCE 32
+#endif
+
+#if defined __alpha__ || defined __hppa__ || defined __sparc__
+SO_RCVBUFFORCE 4107
+#else
+SO_RCVBUFFORCE 33
+#endif
+
+#if defined __sparc__
+SO_PASSSEC 31
+#elif defined __hppa__
+SO_PASSSEC 16414
+#else
+SO_PASSSEC 34
+#endif
+
+#if defined __sparc__
+SO_TIMESTAMPNS_OLD 33
+#elif defined __hppa__
+SO_TIMESTAMPNS_OLD 16403
+#else
+SO_TIMESTAMPNS_OLD 35
+#endif
+
+#if defined __sparc__
+SO_MARK 34
+#elif defined __hppa__
+SO_MARK 16415
+#else
+SO_MARK 36
+#endif
+
+#if defined __sparc__
+SO_TIMESTAMPING_OLD 35
+#elif defined __hppa__
+SO_TIMESTAMPING_OLD 16416
+#else
+SO_TIMESTAMPING_OLD 37
+#endif
+
+#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__
+SO_PROTOCOL 4136
+#else
+SO_PROTOCOL 38
+#endif
+
+#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__
+SO_DOMAIN 4137
+#else
+SO_DOMAIN 39
+#endif
+
+#if defined __sparc__
+SO_RXQ_OVFL 36
+#elif defined __hppa__
+SO_RXQ_OVFL 16417
+#else
+SO_RXQ_OVFL 40
+#endif
+
+#if defined __sparc__
+SO_WIFI_STATUS 37
+#elif defined __hppa__
+SO_WIFI_STATUS 16418
+#else
+SO_WIFI_STATUS 41
+#endif
+
+#if defined __sparc__
+SO_PEEK_OFF 38
+#elif defined __hppa__
+SO_PEEK_OFF 16419
+#else
+SO_PEEK_OFF 42
+#endif
+
+#if defined __sparc__
+SO_NOFCS 39
+#elif defined __hppa__
+SO_NOFCS 16420
+#else
+SO_NOFCS 43
+#endif
+
+#if defined __sparc__
+SO_LOCK_FILTER 40
+#elif defined __hppa__
+SO_LOCK_FILTER 16421
+#else
+SO_LOCK_FILTER 44
+#endif
+
+#if defined __sparc__
+SO_SELECT_ERR_QUEUE 41
+#elif defined __hppa__
+SO_SELECT_ERR_QUEUE 16422
+#else
+SO_SELECT_ERR_QUEUE 45
+#endif
+
+#if defined __sparc__
+SO_BUSY_POLL 48
+#elif defined __hppa__
+SO_BUSY_POLL 16423
+#else
+SO_BUSY_POLL 46
+#endif
+
+#if defined __sparc__
+SO_MAX_PACING_RATE 49
+#elif defined __hppa__
+SO_MAX_PACING_RATE 16424
+#else
+SO_MAX_PACING_RATE 47
+#endif
+
+#if defined __sparc__
+SO_BPF_EXTENSIONS 50
+#elif defined __hppa__
+SO_BPF_EXTENSIONS 16425
+#else
+SO_BPF_EXTENSIONS 48
+#endif
+
+#if defined __sparc__
+SO_INCOMING_CPU 51
+#elif defined __hppa__
+SO_INCOMING_CPU 16426
+#else
+SO_INCOMING_CPU 49
+#endif
+
+#if defined __sparc__
+SO_ATTACH_BPF 52
+#elif defined __hppa__
+SO_ATTACH_BPF 16427
+#else
+SO_ATTACH_BPF 50
+#endif
+
+#if defined __sparc__
+SO_ATTACH_REUSEPORT_CBPF 53
+#elif defined __hppa__
+SO_ATTACH_REUSEPORT_CBPF 16428
+#else
+SO_ATTACH_REUSEPORT_CBPF 51
+#endif
+
+#if defined __sparc__
+SO_ATTACH_REUSEPORT_EBPF 54
+#elif defined __hppa__
+SO_ATTACH_REUSEPORT_EBPF 16429
+#else
+SO_ATTACH_REUSEPORT_EBPF 52
+#endif
+
+#if defined __sparc__
+SO_CNX_ADVICE 55
+#elif defined __hppa__
+SO_CNX_ADVICE 16430
+#else
+SO_CNX_ADVICE 53
+#endif
+
+#if defined __sparc__
+SO_MEMINFO 57
+#elif defined __hppa__
+SO_MEMINFO 16432
+#else
+SO_MEMINFO 55
+#endif
+
+#if defined __sparc__
+SO_INCOMING_NAPI_ID 58
+#elif defined __hppa__
+SO_INCOMING_NAPI_ID 16433
+#else
+SO_INCOMING_NAPI_ID 56
+#endif
+
+#if defined __sparc__
+SO_COOKIE 59
+#elif defined __hppa__
+SO_COOKIE 16434
+#else
+SO_COOKIE 57
+#endif
+
+#if defined __sparc__
+SO_PEERGROUPS 61
+#elif defined __hppa__
+SO_PEERGROUPS 16436
+#else
+SO_PEERGROUPS 59
+#endif
+
+#if defined __sparc__
+SO_ZEROCOPY 62
+#elif defined __hppa__
+SO_ZEROCOPY 16437
+#else
+SO_ZEROCOPY 60
+#endif
+
+#if defined __sparc__
+SO_TXTIME 63
+#elif defined __hppa__
+SO_TXTIME 16438
+#else
+SO_TXTIME 61
+#endif
+
+#if defined __sparc__
+SO_BINDTOIFINDEX 65
+#elif defined __hppa__
+SO_BINDTOIFINDEX 16439
+#else
+SO_BINDTOIFINDEX 62
+#endif
+
+#if defined __sparc__
+SO_TIMESTAMP_NEW 70
+#elif defined __hppa__
+SO_TIMESTAMP_NEW 16440
+#else
+SO_TIMESTAMP_NEW 63
+#endif
+
+#if defined __sparc__
+SO_TIMESTAMPNS_NEW 66
+#elif defined __hppa__
+SO_TIMESTAMPNS_NEW 16441
+#else
+SO_TIMESTAMPNS_NEW 64
+#endif
+
+#if defined __sparc__
+SO_TIMESTAMPING_NEW 67
+#elif defined __hppa__
+SO_TIMESTAMPING_NEW 16442
+#else
+SO_TIMESTAMPING_NEW 65
+#endif
+
+#if defined __sparc__
+SO_RCVTIMEO_NEW 68
+#elif defined __hppa__
+SO_RCVTIMEO_NEW 16448
+#else
+SO_RCVTIMEO_NEW 66
+#endif
+
+#if defined __sparc__
+SO_SNDTIMEO_NEW 69
+#elif defined __hppa__
+SO_SNDTIMEO_NEW 16449
+#else
+SO_SNDTIMEO_NEW 67
+#endif
+
+#if defined __sparc__
+SO_DETACH_REUSEPORT_BPF 71
+#elif defined __hppa__
+SO_DETACH_REUSEPORT_BPF 16450
+#else
+SO_DETACH_REUSEPORT_BPF 68
+#endif
diff --git a/src/xlat/sock_packet_options.in b/src/xlat/sock_packet_options.in
new file mode 100644
index 000000000..d11ad0b4b
--- /dev/null
+++ b/src/xlat/sock_packet_options.in
@@ -0,0 +1,21 @@
+PACKET_ADD_MEMBERSHIP
+PACKET_DROP_MEMBERSHIP
+PACKET_RECV_OUTPUT
+PACKET_RX_RING
+PACKET_STATISTICS
+PACKET_COPY_THRESH
+PACKET_AUXDATA
+PACKET_ORIGDEV
+PACKET_VERSION
+PACKET_HDRLEN
+PACKET_RESERVE
+PACKET_TX_RING
+PACKET_LOSS
+PACKET_VNET_HDR
+PACKET_TX_TIMESTAMP
+PACKET_TIMESTAMP
+PACKET_FANOUT
+PACKET_TX_HAS_OFF
+PACKET_QDISC_BYPASS
+PACKET_ROLLOVER_STATS
+PACKET_FANOUT_DATA
diff --git a/src/xlat/sock_pnp_options.in b/src/xlat/sock_pnp_options.in
new file mode 100644
index 000000000..03d251b36
--- /dev/null
+++ b/src/xlat/sock_pnp_options.in
@@ -0,0 +1,5 @@
+#value_indexed
+PNPIPE_ENCAP 1
+PNPIPE_IFINDEX 2
+PNPIPE_HANDLE 3
+PNPIPE_INITSTATE 4
diff --git a/src/xlat/sock_pppol2tp_options.in b/src/xlat/sock_pppol2tp_options.in
new file mode 100644
index 000000000..9c4177a01
--- /dev/null
+++ b/src/xlat/sock_pppol2tp_options.in
@@ -0,0 +1,6 @@
+#value_indexed
+PPPOL2TP_SO_DEBUG 1
+PPPOL2TP_SO_RECVSEQ 2
+PPPOL2TP_SO_SENDSEQ 3
+PPPOL2TP_SO_LNSMODE 4
+PPPOL2TP_SO_REORDERTO 5
diff --git a/src/xlat/sock_raw_options.in b/src/xlat/sock_raw_options.in
new file mode 100644
index 000000000..b34113479
--- /dev/null
+++ b/src/xlat/sock_raw_options.in
@@ -0,0 +1 @@
+ICMP_FILTER
diff --git a/src/xlat/sock_rds_options.in b/src/xlat/sock_rds_options.in
new file mode 100644
index 000000000..041261c28
--- /dev/null
+++ b/src/xlat/sock_rds_options.in
@@ -0,0 +1,29 @@
+RDS_CANCEL_SENT_TO 1
+RDS_GET_MR 2
+RDS_FREE_MR 3
+RDS_BARRIER 4
+RDS_RECVERR 5
+RDS_CONG_MONITOR 6
+RDS_GET_MR_FOR_DEST 7
+SO_RDS_TRANSPORT 8
+SO_RDS_MSG_RXPATH_LATENCY 10
+
+#ifndef __hppa__
+SO_TIMESTAMP_OLD 29
+#endif
+
+RDS_INFO_COUNTERS 10000
+RDS_INFO_CONNECTIONS 10001
+RDS_INFO_FLOWS 10002
+RDS_INFO_SEND_MESSAGES 10003
+RDS_INFO_RETRANS_MESSAGES 10004
+RDS_INFO_RECV_MESSAGES 10005
+RDS_INFO_SOCKETS 10006
+RDS_INFO_TCP_SOCKETS 10007
+RDS_INFO_IB_CONNECTIONS 10008
+RDS_INFO_CONNECTION_STATS 10009
+RDS_INFO_IWARP_CONNECTIONS 10010
+
+#ifdef __hppa__
+SO_TIMESTAMP_OLD 0x4012
+#endif
diff --git a/src/xlat/sock_rxrpc_options.in b/src/xlat/sock_rxrpc_options.in
new file mode 100644
index 000000000..554082927
--- /dev/null
+++ b/src/xlat/sock_rxrpc_options.in
@@ -0,0 +1,7 @@
+#value_indexed
+RXRPC_SECURITY_KEY 1
+RXRPC_SECURITY_KEYRING 2
+RXRPC_EXCLUSIVE_CONNECTION 3
+RXRPC_MIN_SECURITY_LEVEL 4
+RXRPC_UPGRADEABLE_SERVICE 5
+RXRPC_SUPPORTED_CMSG 6
diff --git a/src/xlat/sock_sctp_options.in b/src/xlat/sock_sctp_options.in
new file mode 100644
index 000000000..b7bec4a8d
--- /dev/null
+++ b/src/xlat/sock_sctp_options.in
@@ -0,0 +1,71 @@
+SCTP_RTOINFO 0
+SCTP_ASSOCINFO 1
+SCTP_INITMSG 2
+SCTP_NODELAY 3
+SCTP_AUTOCLOSE 4
+SCTP_SET_PEER_PRIMARY_ADDR 5
+SCTP_PRIMARY_ADDR 6
+SCTP_ADAPTATION_LAYER 7
+SCTP_DISABLE_FRAGMENTS 8
+SCTP_PEER_ADDR_PARAMS 9
+SCTP_DEFAULT_SEND_PARAM 10
+SCTP_EVENTS 11
+SCTP_I_WANT_MAPPED_V4_ADDR 12
+SCTP_MAXSEG 13
+SCTP_STATUS 14
+SCTP_GET_PEER_ADDR_INFO 15
+SCTP_DELAYED_SACK 16
+SCTP_CONTEXT 17
+SCTP_FRAGMENT_INTERLEAVE 18
+SCTP_PARTIAL_DELIVERY_POINT 19
+SCTP_MAX_BURST 20
+SCTP_AUTH_CHUNK 21
+SCTP_HMAC_IDENT 22
+SCTP_AUTH_KEY 23
+SCTP_AUTH_ACTIVE_KEY 24
+SCTP_AUTH_DELETE_KEY 25
+SCTP_PEER_AUTH_CHUNKS 26
+SCTP_LOCAL_AUTH_CHUNKS 27
+SCTP_GET_ASSOC_NUMBER 28
+SCTP_GET_ASSOC_ID_LIST 29
+SCTP_AUTO_ASCONF 30
+SCTP_PEER_ADDR_THLDS 31
+SCTP_RECVRCVINFO 32
+SCTP_RECVNXTINFO 33
+SCTP_DEFAULT_SNDINFO 34
+SCTP_AUTH_DEACTIVATE_KEY 35
+SCTP_REUSE_PORT 36
+SCTP_PEER_ADDR_THLDS_V2 37
+/* linux specific things */
+SCTP_SOCKOPT_BINDX_ADD 100
+SCTP_SOCKOPT_BINDX_REM 101
+SCTP_SOCKOPT_PEELOFF 102
+SCTP_GET_PEER_ADDRS_NUM_OLD 103
+SCTP_GET_PEER_ADDRS_OLD 104
+SCTP_GET_LOCAL_ADDRS_NUM_OLD 105
+SCTP_GET_LOCAL_ADDRS_OLD 106
+SCTP_SOCKOPT_CONNECTX_OLD 107
+SCTP_GET_PEER_ADDRS 108
+SCTP_GET_LOCAL_ADDRS 109
+SCTP_SOCKOPT_CONNECTX 110
+SCTP_SOCKOPT_CONNECTX3 111
+SCTP_GET_ASSOC_STATS 112
+SCTP_PR_SUPPORTED 113
+SCTP_DEFAULT_PRINFO 114
+SCTP_PR_ASSOC_STATUS 115
+SCTP_PR_STREAM_STATUS 116
+SCTP_RECONFIG_SUPPORTED 117
+SCTP_ENABLE_STREAM_RESET 118
+SCTP_RESET_STREAMS 119
+SCTP_RESET_ASSOC 120
+SCTP_ADD_STREAMS 121
+SCTP_SOCKOPT_PEELOFF_FLAGS 122
+SCTP_STREAM_SCHEDULER 123
+SCTP_STREAM_SCHEDULER_VALUE 124
+SCTP_INTERLEAVING_SUPPORTED 125
+SCTP_SENDMSG_CONNECT 126
+SCTP_EVENT 127
+SCTP_ASCONF_SUPPORTED 128
+SCTP_AUTH_SUPPORTED 129
+SCTP_ECN_SUPPORTED 130
+SCTP_EXPOSE_POTENTIALLY_FAILED_STATE 131
diff --git a/src/xlat/sock_shutdown_flags.in b/src/xlat/sock_shutdown_flags.in
new file mode 100644
index 000000000..ff7d4322c
--- /dev/null
+++ b/src/xlat/sock_shutdown_flags.in
@@ -0,0 +1,2 @@
+RCV_SHUTDOWN 1
+SEND_SHUTDOWN 2
diff --git a/src/xlat/sock_tcp_options.in b/src/xlat/sock_tcp_options.in
new file mode 100644
index 000000000..cb1de24b7
--- /dev/null
+++ b/src/xlat/sock_tcp_options.in
@@ -0,0 +1,38 @@
+#value_indexed
+TCP_NODELAY 1
+TCP_MAXSEG 2
+TCP_CORK 3
+TCP_KEEPIDLE 4
+TCP_KEEPINTVL 5
+TCP_KEEPCNT 6
+TCP_SYNCNT 7
+TCP_LINGER2 8
+TCP_DEFER_ACCEPT 9
+TCP_WINDOW_CLAMP 10
+TCP_INFO 11
+TCP_QUICKACK 12
+TCP_CONGESTION 13
+TCP_MD5SIG 14
+TCP_COOKIE_TRANSACTIONS 15
+TCP_THIN_LINEAR_TIMEOUTS 16
+TCP_THIN_DUPACK 17
+TCP_USER_TIMEOUT 18
+TCP_REPAIR 19
+TCP_REPAIR_QUEUE 20
+TCP_QUEUE_SEQ 21
+TCP_REPAIR_OPTIONS 22
+TCP_FASTOPEN 23
+TCP_TIMESTAMP 24
+TCP_NOTSENT_LOWAT 25
+TCP_CC_INFO 26
+TCP_SAVE_SYN 27
+TCP_SAVED_SYN 28
+TCP_REPAIR_WINDOW 29
+TCP_FASTOPEN_CONNECT 30
+TCP_ULP 31
+TCP_MD5SIG_EXT 32
+TCP_FASTOPEN_KEY 33
+TCP_FASTOPEN_NO_COOKIE 34
+TCP_ZEROCOPY_RECEIVE 35
+TCP_INQ 36
+TCP_TX_DELAY 37
diff --git a/src/xlat/sock_tipc_options.in b/src/xlat/sock_tipc_options.in
new file mode 100644
index 000000000..fbc70d64e
--- /dev/null
+++ b/src/xlat/sock_tipc_options.in
@@ -0,0 +1,13 @@
+#sorted sort -k2,2n
+TIPC_IMPORTANCE 127
+TIPC_SRC_DROPPABLE 128
+TIPC_DEST_DROPPABLE 129
+TIPC_CONN_TIMEOUT 130
+TIPC_NODE_RECVQ_DEPTH 131
+TIPC_SOCK_RECVQ_DEPTH 132
+TIPC_MCAST_BROADCAST 133
+TIPC_MCAST_REPLICAST 134
+TIPC_GROUP_JOIN 135
+TIPC_GROUP_LEAVE 136
+TIPC_SOCK_RECVQ_USED 137
+TIPC_NODELAY 138
diff --git a/src/xlat/sock_tls_options.in b/src/xlat/sock_tls_options.in
new file mode 100644
index 000000000..9a2ddb0a1
--- /dev/null
+++ b/src/xlat/sock_tls_options.in
@@ -0,0 +1,3 @@
+#value_indexed
+TLS_TX 1
+TLS_RX 2
diff --git a/src/xlat/sock_type_flags.in b/src/xlat/sock_type_flags.in
new file mode 100644
index 000000000..b99786b70
--- /dev/null
+++ b/src/xlat/sock_type_flags.in
@@ -0,0 +1,2 @@
+SOCK_CLOEXEC
+SOCK_NONBLOCK
diff --git a/src/xlat/sock_udp_options.in b/src/xlat/sock_udp_options.in
new file mode 100644
index 000000000..753582f30
--- /dev/null
+++ b/src/xlat/sock_udp_options.in
@@ -0,0 +1,6 @@
+UDP_CORK 1
+UDP_ENCAP 100
+UDP_NO_CHECK6_TX 101
+UDP_NO_CHECK6_RX 102
+UDP_SEGMENT 103
+UDP_GRO 104
diff --git a/src/xlat/sock_xdp_options.in b/src/xlat/sock_xdp_options.in
new file mode 100644
index 000000000..b98f83c41
--- /dev/null
+++ b/src/xlat/sock_xdp_options.in
@@ -0,0 +1,9 @@
+#value_indexed
+XDP_MMAP_OFFSETS 1
+XDP_RX_RING 2
+XDP_TX_RING 3
+XDP_UMEM_REG 4
+XDP_UMEM_FILL_RING 5
+XDP_UMEM_COMPLETION_RING 6
+XDP_STATISTICS 7
+XDP_OPTIONS 8
diff --git a/src/xlat/socketcalls.in b/src/xlat/socketcalls.in
new file mode 100644
index 000000000..d31a91042
--- /dev/null
+++ b/src/xlat/socketcalls.in
@@ -0,0 +1,21 @@
+#value_indexed
+SYS_SOCKET 1
+SYS_BIND 2
+SYS_CONNECT 3
+SYS_LISTEN 4
+SYS_ACCEPT 5
+SYS_GETSOCKNAME 6
+SYS_GETPEERNAME 7
+SYS_SOCKETPAIR 8
+SYS_SEND 9
+SYS_RECV 10
+SYS_SENDTO 11
+SYS_RECVFROM 12
+SYS_SHUTDOWN 13
+SYS_SETSOCKOPT 14
+SYS_GETSOCKOPT 15
+SYS_SENDMSG 16
+SYS_RECVMSG 17
+SYS_ACCEPT4 18
+SYS_RECVMMSG 19
+SYS_SENDMMSG 20
diff --git a/src/xlat/socketlayers.in b/src/xlat/socketlayers.in
new file mode 100644
index 000000000..e633cf5cd
--- /dev/null
+++ b/src/xlat/socketlayers.in
@@ -0,0 +1,45 @@
+#sorted sort -k2,2n
+SOL_IP 0
+#if !(defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__)
+SOL_SOCKET 1
+#endif
+SOL_TCP 6
+SOL_UDP 17
+SOL_IPV6 41
+SOL_ICMPV6 58
+SOL_CAN_BASE 100
+SOL_CAN_RAW 101
+SOL_SCTP 132
+SOL_UDPLITE 136
+SOL_RAW 255
+SOL_IPX 256
+SOL_AX25 257
+SOL_ATALK 258
+SOL_NETROM 259
+SOL_ROSE 260
+SOL_DECNET 261
+SOL_X25 262
+SOL_PACKET 263
+SOL_ATM 264
+SOL_AAL 265
+SOL_IRDA 266
+SOL_NETBEUI 267
+SOL_LLC 268
+SOL_DCCP 269
+SOL_NETLINK 270
+SOL_TIPC 271
+SOL_RXRPC 272
+SOL_PPPOL2TP 273
+SOL_BLUETOOTH 274
+SOL_PNPIPE 275
+SOL_RDS 276
+SOL_IUCV 277
+SOL_CAIF 278
+SOL_ALG 279
+SOL_NFC 280
+SOL_KCM 281
+SOL_TLS 282
+SOL_XDP 283
+#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__
+SOL_SOCKET 0xffff
+#endif
diff --git a/src/xlat/socktypes.in b/src/xlat/socktypes.in
new file mode 100644
index 000000000..678c2dae9
--- /dev/null
+++ b/src/xlat/socktypes.in
@@ -0,0 +1,12 @@
+#ifdef __mips__
+SOCK_DGRAM 1
+SOCK_STREAM 2
+#else
+SOCK_STREAM 1
+SOCK_DGRAM 2
+#endif
+SOCK_RAW 3
+SOCK_RDM 4
+SOCK_SEQPACKET 5
+SOCK_DCCP 6
+SOCK_PACKET 10
diff --git a/src/xlat/sparc_kern_features.in b/src/xlat/sparc_kern_features.in
new file mode 100644
index 000000000..6c4b2d707
--- /dev/null
+++ b/src/xlat/sparc_kern_features.in
@@ -0,0 +1 @@
+KERN_FEATURE_MIXED_MODE_STACK 1
diff --git a/src/xlat/splice_flags.in b/src/xlat/splice_flags.in
new file mode 100644
index 000000000..72e2c0bee
--- /dev/null
+++ b/src/xlat/splice_flags.in
@@ -0,0 +1,4 @@
+SPLICE_F_MOVE
+SPLICE_F_NONBLOCK
+SPLICE_F_MORE
+SPLICE_F_GIFT
diff --git a/src/xlat/sram_alloc_flags.in b/src/xlat/sram_alloc_flags.in
new file mode 100644
index 000000000..8c0663329
--- /dev/null
+++ b/src/xlat/sram_alloc_flags.in
@@ -0,0 +1,5 @@
+L1_INST_SRAM
+L1_DATA_A_SRAM
+L1_DATA_B_SRAM
+L1_DATA_SRAM
+L2_SRAM
diff --git a/src/xlat/statfs_flags.in b/src/xlat/statfs_flags.in
new file mode 100644
index 000000000..f791a60e5
--- /dev/null
+++ b/src/xlat/statfs_flags.in
@@ -0,0 +1,10 @@
+ST_VALID 0x0020
+ST_RDONLY 0x0001
+ST_NOSUID 0x0002
+ST_NODEV 0x0004
+ST_NOEXEC 0x0008
+ST_SYNCHRONOUS 0x0010
+ST_MANDLOCK 0x0040
+ST_NOATIME 0x0400
+ST_NODIRATIME 0x0800
+ST_RELATIME 0x1000
diff --git a/src/xlat/statx_attrs.in b/src/xlat/statx_attrs.in
new file mode 100644
index 000000000..4d5c6ae87
--- /dev/null
+++ b/src/xlat/statx_attrs.in
@@ -0,0 +1,19 @@
+STATX_ATTR_COMPRESSED 0x00000004
+STATX_ATTR_IMMUTABLE 0x00000010
+STATX_ATTR_APPEND 0x00000020
+STATX_ATTR_NODUMP 0x00000040
+STATX_ATTR_ENCRYPTED 0x00000800
+STATX_ATTR_AUTOMOUNT 0x00001000
+STATX_ATTR_MOUNT_ROOT 0x00002000
+STATX_ATTR_VERITY 0x00100000
+#ifndef STRACE_WORKAROUND_FOR_STATX_ATTR_DAX
+# define STRACE_WORKAROUND_FOR_STATX_ATTR_DAX
+/*
+ * Linux kernel commit v5.10-rc6-63-g72d1249e2ffdbc344e465031ec5335fa3489d62e
+ * has changed the value of STATX_ATTR_DAX constant introduced by commit
+ * v5.8-rc1~51^2~9 because the old value was already used by
+ * STATX_ATTR_MOUNT_ROOT.
+ */
+# undef STATX_ATTR_DAX
+#endif
+STATX_ATTR_DAX 0x00200000
diff --git a/src/xlat/statx_masks.in b/src/xlat/statx_masks.in
new file mode 100644
index 000000000..3438672bb
--- /dev/null
+++ b/src/xlat/statx_masks.in
@@ -0,0 +1,16 @@
+STATX_ALL 0x00000fffU
+STATX_BASIC_STATS 0x000007ffU
+
+STATX_TYPE 0x00000001U
+STATX_MODE 0x00000002U
+STATX_NLINK 0x00000004U
+STATX_UID 0x00000008U
+STATX_GID 0x00000010U
+STATX_ATIME 0x00000020U
+STATX_MTIME 0x00000040U
+STATX_CTIME 0x00000080U
+STATX_INO 0x00000100U
+STATX_SIZE 0x00000200U
+STATX_BLOCKS 0x00000400U
+STATX_BTIME 0x00000800U
+STATX_MNT_ID 0x00001000U
diff --git a/src/xlat/swap_flags.in b/src/xlat/swap_flags.in
new file mode 100644
index 000000000..8800e3015
--- /dev/null
+++ b/src/xlat/swap_flags.in
@@ -0,0 +1,4 @@
+SWAP_FLAG_PREFER 0x8000
+SWAP_FLAG_DISCARD 0x10000
+SWAP_FLAG_DISCARD_ONCE 0x20000
+SWAP_FLAG_DISCARD_PAGES 0x40000
diff --git a/src/xlat/sync_file_range_flags.in b/src/xlat/sync_file_range_flags.in
new file mode 100644
index 000000000..0b179a10c
--- /dev/null
+++ b/src/xlat/sync_file_range_flags.in
@@ -0,0 +1,3 @@
+SYNC_FILE_RANGE_WAIT_BEFORE 1
+SYNC_FILE_RANGE_WRITE 2
+SYNC_FILE_RANGE_WAIT_AFTER 4
diff --git a/src/xlat/sysctl_kern.in b/src/xlat/sysctl_kern.in
new file mode 100644
index 000000000..150657bc5
--- /dev/null
+++ b/src/xlat/sysctl_kern.in
@@ -0,0 +1,73 @@
+#enum
+#include <sys/types.h>
+#include <linux/sysctl.h>
+#unconditional
+KERN_OSTYPE
+KERN_OSRELEASE
+KERN_OSREV
+KERN_VERSION
+KERN_SECUREMASK
+KERN_PROF
+KERN_NODENAME
+KERN_DOMAINNAME
+KERN_PANIC
+KERN_REALROOTDEV
+KERN_SPARC_REBOOT
+KERN_CTLALTDEL
+KERN_PRINTK
+KERN_NAMETRANS
+KERN_PPC_HTABRECLAIM
+KERN_PPC_ZEROPAGED
+KERN_PPC_POWERSAVE_NAP
+KERN_MODPROBE
+KERN_SG_BIG_BUFF
+KERN_ACCT
+KERN_PPC_L2CR
+KERN_RTSIGNR
+KERN_RTSIGMAX
+KERN_SHMMAX
+KERN_MSGMAX
+KERN_MSGMNB
+KERN_MSGPOOL
+KERN_SYSRQ
+KERN_MAX_THREADS
+KERN_RANDOM
+KERN_SHMALL
+KERN_MSGMNI
+KERN_SEM
+KERN_SPARC_STOP_A
+KERN_SHMMNI
+KERN_OVERFLOWUID
+KERN_OVERFLOWGID
+KERN_SHMPATH
+KERN_HOTPLUG
+KERN_IEEE_EMULATION_WARNINGS
+KERN_S390_USER_DEBUG_LOGGING
+KERN_CORE_USES_PID
+KERN_TAINTED
+KERN_CADPID
+KERN_PIDMAX
+KERN_CORE_PATTERN
+KERN_PANIC_ON_OOPS
+KERN_HPPA_PWRSW
+KERN_HPPA_UNALIGNED
+#conditional
+KERN_PRINTK_RATELIMIT
+KERN_PRINTK_RATELIMIT_BURST
+KERN_PTY
+KERN_NGROUPS_MAX
+KERN_SPARC_SCONS_PWROFF
+KERN_HZ_TIMER
+KERN_UNKNOWN_NMI_PANIC
+KERN_BOOTLOADER_TYPE
+KERN_RANDOMIZE
+KERN_SETUID_DUMPABLE
+KERN_SPIN_RETRY
+KERN_ACPI_VIDEO_FLAGS
+KERN_IA64_UNALIGNED
+KERN_COMPAT_LOG
+KERN_MAX_LOCK_DEPTH
+KERN_NMI_WATCHDOG
+KERN_PANIC_ON_NMI
+KERN_PANIC_ON_WARN
+KERN_PANIC_PRINT
diff --git a/src/xlat/sysctl_net.in b/src/xlat/sysctl_net.in
new file mode 100644
index 000000000..d922bbfa9
--- /dev/null
+++ b/src/xlat/sysctl_net.in
@@ -0,0 +1,26 @@
+#enum
+#include <sys/types.h>
+#include <linux/sysctl.h>
+#unconditional
+NET_CORE
+NET_ETHER
+NET_802
+NET_UNIX
+NET_IPV4
+NET_IPX
+NET_ATALK
+NET_NETROM
+NET_AX25
+NET_BRIDGE
+NET_ROSE
+NET_IPV6
+NET_X25
+NET_TR
+NET_DECNET
+NET_ECONET
+NET_SCTP
+#conditional
+NET_LLC
+NET_NETFILTER
+NET_DCCP
+NET_IRDA
diff --git a/src/xlat/sysctl_net_core.in b/src/xlat/sysctl_net_core.in
new file mode 100644
index 000000000..07719cf81
--- /dev/null
+++ b/src/xlat/sysctl_net_core.in
@@ -0,0 +1,27 @@
+#enum
+#include <sys/types.h>
+#include <linux/sysctl.h>
+#unconditional
+NET_CORE_WMEM_MAX
+NET_CORE_RMEM_MAX
+NET_CORE_WMEM_DEFAULT
+NET_CORE_RMEM_DEFAULT
+NET_CORE_MAX_BACKLOG
+NET_CORE_FASTROUTE
+NET_CORE_MSG_COST
+NET_CORE_MSG_BURST
+NET_CORE_OPTMEM_MAX
+NET_CORE_HOT_LIST_LENGTH
+NET_CORE_DIVERT_VERSION
+NET_CORE_NO_CONG_THRESH
+NET_CORE_NO_CONG
+NET_CORE_LO_CONG
+NET_CORE_MOD_CONG
+NET_CORE_DEV_WEIGHT
+NET_CORE_SOMAXCONN
+#conditional
+NET_CORE_DESTROY_DELAY
+NET_CORE_BUDGET
+NET_CORE_AEVENT_ETIME
+NET_CORE_AEVENT_RSEQTH
+NET_CORE_WARNINGS
diff --git a/src/xlat/sysctl_net_ipv4.in b/src/xlat/sysctl_net_ipv4.in
new file mode 100644
index 000000000..be0f5ed82
--- /dev/null
+++ b/src/xlat/sysctl_net_ipv4.in
@@ -0,0 +1,97 @@
+#enum
+#include <sys/types.h>
+#include <linux/sysctl.h>
+#unconditional
+NET_IPV4_FORWARD
+NET_IPV4_DYNADDR
+NET_IPV4_CONF
+NET_IPV4_NEIGH
+NET_IPV4_ROUTE
+NET_IPV4_FIB_HASH
+NET_IPV4_NETFILTER
+NET_IPV4_TCP_TIMESTAMPS
+NET_IPV4_TCP_WINDOW_SCALING
+NET_IPV4_TCP_SACK
+NET_IPV4_TCP_RETRANS_COLLAPSE
+NET_IPV4_DEFAULT_TTL
+NET_IPV4_AUTOCONFIG
+NET_IPV4_NO_PMTU_DISC
+NET_IPV4_TCP_SYN_RETRIES
+NET_IPV4_IPFRAG_HIGH_THRESH
+NET_IPV4_IPFRAG_LOW_THRESH
+NET_IPV4_IPFRAG_TIME
+NET_IPV4_TCP_MAX_KA_PROBES
+NET_IPV4_TCP_KEEPALIVE_TIME
+NET_IPV4_TCP_KEEPALIVE_PROBES
+NET_IPV4_TCP_RETRIES1
+NET_IPV4_TCP_RETRIES2
+NET_IPV4_TCP_FIN_TIMEOUT
+NET_IPV4_IP_MASQ_DEBUG
+NET_TCP_SYNCOOKIES
+NET_TCP_STDURG
+NET_TCP_RFC1337
+NET_TCP_SYN_TAILDROP
+NET_TCP_MAX_SYN_BACKLOG
+NET_IPV4_LOCAL_PORT_RANGE
+NET_IPV4_ICMP_ECHO_IGNORE_ALL
+NET_IPV4_ICMP_ECHO_IGNORE_BROADCASTS
+NET_IPV4_ICMP_SOURCEQUENCH_RATE
+NET_IPV4_ICMP_DESTUNREACH_RATE
+NET_IPV4_ICMP_TIMEEXCEED_RATE
+NET_IPV4_ICMP_PARAMPROB_RATE
+NET_IPV4_ICMP_ECHOREPLY_RATE
+NET_IPV4_ICMP_IGNORE_BOGUS_ERROR_RESPONSES
+NET_IPV4_IGMP_MAX_MEMBERSHIPS
+NET_TCP_TW_RECYCLE
+NET_IPV4_ALWAYS_DEFRAG
+NET_IPV4_TCP_KEEPALIVE_INTVL
+NET_IPV4_INET_PEER_THRESHOLD
+NET_IPV4_INET_PEER_MINTTL
+NET_IPV4_INET_PEER_MAXTTL
+NET_IPV4_INET_PEER_GC_MINTIME
+NET_IPV4_INET_PEER_GC_MAXTIME
+NET_TCP_ORPHAN_RETRIES
+NET_TCP_ABORT_ON_OVERFLOW
+NET_TCP_SYNACK_RETRIES
+NET_TCP_MAX_ORPHANS
+NET_TCP_MAX_TW_BUCKETS
+NET_TCP_FACK
+NET_TCP_REORDERING
+NET_TCP_ECN
+NET_TCP_DSACK
+NET_TCP_MEM
+NET_TCP_WMEM
+NET_TCP_RMEM
+NET_TCP_APP_WIN
+NET_TCP_ADV_WIN_SCALE
+NET_IPV4_NONLOCAL_BIND
+NET_IPV4_ICMP_RATELIMIT
+NET_IPV4_ICMP_RATEMASK
+NET_TCP_TW_REUSE
+NET_TCP_FRTO
+NET_TCP_LOW_LATENCY
+NET_IPV4_IPFRAG_SECRET_INTERVAL
+#conditional
+NET_IPV4_IGMP_MAX_MSF
+NET_TCP_NO_METRICS_SAVE
+NET_TCP_DEFAULT_WIN_SCALE
+NET_TCP_MODERATE_RCVBUF
+NET_TCP_TSO_WIN_DIVISOR
+NET_TCP_BIC_BETA
+NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR
+NET_TCP_CONG_CONTROL
+NET_TCP_ABC
+NET_IPV4_IPFRAG_MAX_DIST
+NET_TCP_MTU_PROBING
+NET_TCP_BASE_MSS
+NET_IPV4_TCP_WORKAROUND_SIGNED_WINDOWS
+NET_TCP_DMA_COPYBREAK
+NET_TCP_SLOW_START_AFTER_IDLE
+NET_CIPSOV4_CACHE_ENABLE
+NET_CIPSOV4_CACHE_BUCKET_SIZE
+NET_CIPSOV4_RBM_OPTFMT
+NET_CIPSOV4_RBM_STRICTVALID
+NET_TCP_AVAIL_CONG_CONTROL
+NET_TCP_ALLOWED_CONG_CONTROL
+NET_TCP_MAX_SSTHRESH
+NET_TCP_FRTO_RESPONSE
diff --git a/src/xlat/sysctl_net_ipv4_conf.in b/src/xlat/sysctl_net_ipv4_conf.in
new file mode 100644
index 000000000..9558be291
--- /dev/null
+++ b/src/xlat/sysctl_net_ipv4_conf.in
@@ -0,0 +1,27 @@
+#enum
+#include <sys/types.h>
+#include <linux/sysctl.h>
+#unconditional
+NET_IPV4_CONF_FORWARDING
+NET_IPV4_CONF_MC_FORWARDING
+NET_IPV4_CONF_PROXY_ARP
+NET_IPV4_CONF_ACCEPT_REDIRECTS
+NET_IPV4_CONF_SECURE_REDIRECTS
+NET_IPV4_CONF_SEND_REDIRECTS
+NET_IPV4_CONF_SHARED_MEDIA
+NET_IPV4_CONF_RP_FILTER
+NET_IPV4_CONF_ACCEPT_SOURCE_ROUTE
+NET_IPV4_CONF_BOOTP_RELAY
+NET_IPV4_CONF_LOG_MARTIANS
+NET_IPV4_CONF_TAG
+NET_IPV4_CONF_ARPFILTER
+NET_IPV4_CONF_MEDIUM_ID
+NET_IPV4_CONF_NOXFRM
+NET_IPV4_CONF_NOPOLICY
+#conditional
+NET_IPV4_CONF_FORCE_IGMP_VERSION
+NET_IPV4_CONF_ARP_ANNOUNCE
+NET_IPV4_CONF_ARP_IGNORE
+NET_IPV4_CONF_PROMOTE_SECONDARIES
+NET_IPV4_CONF_ARP_ACCEPT
+NET_IPV4_CONF_ARP_NOTIFY
diff --git a/src/xlat/sysctl_net_ipv4_route.in b/src/xlat/sysctl_net_ipv4_route.in
new file mode 100644
index 000000000..d7b5bc65c
--- /dev/null
+++ b/src/xlat/sysctl_net_ipv4_route.in
@@ -0,0 +1,24 @@
+#enum
+#include <sys/types.h>
+#include <linux/sysctl.h>
+#unconditional
+NET_IPV4_ROUTE_FLUSH
+NET_IPV4_ROUTE_MIN_DELAY
+NET_IPV4_ROUTE_MAX_DELAY
+NET_IPV4_ROUTE_GC_THRESH
+NET_IPV4_ROUTE_MAX_SIZE
+NET_IPV4_ROUTE_GC_MIN_INTERVAL
+NET_IPV4_ROUTE_GC_TIMEOUT
+NET_IPV4_ROUTE_GC_INTERVAL
+NET_IPV4_ROUTE_REDIRECT_LOAD
+NET_IPV4_ROUTE_REDIRECT_NUMBER
+NET_IPV4_ROUTE_REDIRECT_SILENCE
+NET_IPV4_ROUTE_ERROR_COST
+NET_IPV4_ROUTE_ERROR_BURST
+NET_IPV4_ROUTE_GC_ELASTICITY
+NET_IPV4_ROUTE_MTU_EXPIRES
+NET_IPV4_ROUTE_MIN_PMTU
+NET_IPV4_ROUTE_MIN_ADVMSS
+NET_IPV4_ROUTE_SECRET_INTERVAL
+#conditional
+NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS
diff --git a/src/xlat/sysctl_net_ipv6.in b/src/xlat/sysctl_net_ipv6.in
new file mode 100644
index 000000000..3cd48c523
--- /dev/null
+++ b/src/xlat/sysctl_net_ipv6.in
@@ -0,0 +1,15 @@
+#enum
+#include <sys/types.h>
+#include <linux/sysctl.h>
+#unconditional
+NET_IPV6_CONF
+NET_IPV6_NEIGH
+NET_IPV6_ROUTE
+NET_IPV6_ICMP
+NET_IPV6_BINDV6ONLY
+NET_IPV6_IP6FRAG_HIGH_THRESH
+NET_IPV6_IP6FRAG_LOW_THRESH
+NET_IPV6_IP6FRAG_TIME
+NET_IPV6_IP6FRAG_SECRET_INTERVAL
+#conditional
+NET_IPV6_MLD_MAX_MSF
diff --git a/src/xlat/sysctl_net_ipv6_route.in b/src/xlat/sysctl_net_ipv6_route.in
new file mode 100644
index 000000000..ec3f958f9
--- /dev/null
+++ b/src/xlat/sysctl_net_ipv6_route.in
@@ -0,0 +1,15 @@
+#enum
+#include <sys/types.h>
+#include <linux/sysctl.h>
+#unconditional
+NET_IPV6_ROUTE_FLUSH
+NET_IPV6_ROUTE_GC_THRESH
+NET_IPV6_ROUTE_MAX_SIZE
+NET_IPV6_ROUTE_GC_MIN_INTERVAL
+NET_IPV6_ROUTE_GC_TIMEOUT
+NET_IPV6_ROUTE_GC_INTERVAL
+NET_IPV6_ROUTE_GC_ELASTICITY
+NET_IPV6_ROUTE_MTU_EXPIRES
+NET_IPV6_ROUTE_MIN_ADVMSS
+#conditional
+NET_IPV6_ROUTE_GC_MIN_INTERVAL_MS
diff --git a/src/xlat/sysctl_net_unix.in b/src/xlat/sysctl_net_unix.in
new file mode 100644
index 000000000..c20eb0cd1
--- /dev/null
+++ b/src/xlat/sysctl_net_unix.in
@@ -0,0 +1,7 @@
+#enum
+#include <sys/types.h>
+#include <linux/sysctl.h>
+#unconditional
+NET_UNIX_DESTROY_DELAY
+NET_UNIX_DELETE_DELAY
+NET_UNIX_MAX_DGRAM_QLEN
diff --git a/src/xlat/sysctl_root.in b/src/xlat/sysctl_root.in
new file mode 100644
index 000000000..f8d18485a
--- /dev/null
+++ b/src/xlat/sysctl_root.in
@@ -0,0 +1,20 @@
+#enum
+#include <sys/types.h>
+#include <linux/sysctl.h>
+#unconditional
+CTL_KERN
+CTL_VM
+CTL_NET
+CTL_FS
+CTL_DEBUG
+CTL_DEV
+CTL_BUS
+CTL_ABI
+CTL_CPU
+#conditional
+CTL_PROC
+CTL_ARLAN
+CTL_S390DBF
+CTL_SUNRPC
+CTL_PM
+CTL_FRV
diff --git a/src/xlat/sysctl_vm.in b/src/xlat/sysctl_vm.in
new file mode 100644
index 000000000..71c41727a
--- /dev/null
+++ b/src/xlat/sysctl_vm.in
@@ -0,0 +1,25 @@
+#enum
+#include <sys/types.h>
+#include <linux/sysctl.h>
+#unconditional
+VM_OVERCOMMIT_MEMORY
+VM_PAGE_CLUSTER
+VM_DIRTY_BACKGROUND
+VM_DIRTY_RATIO
+VM_DIRTY_WB_CS
+VM_DIRTY_EXPIRE_CS
+VM_NR_PDFLUSH_THREADS
+VM_OVERCOMMIT_RATIO
+VM_PAGEBUF
+VM_HUGETLB_PAGES
+VM_SWAPPINESS
+VM_LOWMEM_RESERVE_RATIO
+VM_MIN_FREE_KBYTES
+#conditional
+VM_MAX_MAP_COUNT
+VM_LAPTOP_MODE
+VM_BLOCK_DUMP
+VM_HUGETLB_GROUP
+VM_VFS_CACHE_PRESSURE
+VM_LEGACY_VA_LAYOUT
+VM_SWAP_TOKEN_TIMEOUT
diff --git a/src/xlat/syslog_action_type.in b/src/xlat/syslog_action_type.in
new file mode 100644
index 000000000..e2f78e765
--- /dev/null
+++ b/src/xlat/syslog_action_type.in
@@ -0,0 +1,12 @@
+#value_indexed
+SYSLOG_ACTION_CLOSE 0
+SYSLOG_ACTION_OPEN 1
+SYSLOG_ACTION_READ 2
+SYSLOG_ACTION_READ_ALL 3
+SYSLOG_ACTION_READ_CLEAR 4
+SYSLOG_ACTION_CLEAR 5
+SYSLOG_ACTION_CONSOLE_OFF 6
+SYSLOG_ACTION_CONSOLE_ON 7
+SYSLOG_ACTION_CONSOLE_LEVEL 8
+SYSLOG_ACTION_SIZE_UNREAD 9
+SYSLOG_ACTION_SIZE_BUFFER 10
diff --git a/src/xlat/syslog_console_levels.in b/src/xlat/syslog_console_levels.in
new file mode 100644
index 000000000..9309658e5
--- /dev/null
+++ b/src/xlat/syslog_console_levels.in
@@ -0,0 +1,11 @@
+#value_indexed
+/* from include/linux/kern_levels.h */
+LOGLEVEL_EMERG 0
+LOGLEVEL_ALERT 1
+LOGLEVEL_CRIT 2
+LOGLEVEL_ERR 3
+LOGLEVEL_WARNING 4
+LOGLEVEL_NOTICE 5
+LOGLEVEL_INFO 6
+LOGLEVEL_DEBUG 7
+LOGLEVEL_DEBUG+1 7
diff --git a/src/xlat/sysmips_operations.in b/src/xlat/sysmips_operations.in
new file mode 100644
index 000000000..3d367cb9b
--- /dev/null
+++ b/src/xlat/sysmips_operations.in
@@ -0,0 +1,5 @@
+SETNAME
+FLUSH_CACHE
+MIPS_FIXADE
+MIPS_RDNVRAM
+MIPS_ATOMIC_SET
diff --git a/src/xlat/tcflsh_options.in b/src/xlat/tcflsh_options.in
new file mode 100644
index 000000000..470a5a4e0
--- /dev/null
+++ b/src/xlat/tcflsh_options.in
@@ -0,0 +1,3 @@
+TCIFLUSH
+TCOFLUSH
+TCIOFLUSH
diff --git a/src/xlat/tcp_state_flags.in b/src/xlat/tcp_state_flags.in
new file mode 100644
index 000000000..8b63c1582
--- /dev/null
+++ b/src/xlat/tcp_state_flags.in
@@ -0,0 +1,13 @@
+/* this file should be included after xlat/tcp_states.h */
+1<<TCP_ESTABLISHED
+1<<TCP_SYN_SENT
+1<<TCP_SYN_RECV
+1<<TCP_FIN_WAIT1
+1<<TCP_FIN_WAIT2
+1<<TCP_TIME_WAIT
+1<<TCP_CLOSE
+1<<TCP_CLOSE_WAIT
+1<<TCP_LAST_ACK
+1<<TCP_LISTEN
+1<<TCP_CLOSING
+1<<TCP_NEW_SYN_RECV
diff --git a/src/xlat/tcp_states.in b/src/xlat/tcp_states.in
new file mode 100644
index 000000000..d78d779fd
--- /dev/null
+++ b/src/xlat/tcp_states.in
@@ -0,0 +1,13 @@
+#value_indexed
+TCP_ESTABLISHED 1
+TCP_SYN_SENT 2
+TCP_SYN_RECV 3
+TCP_FIN_WAIT1 4
+TCP_FIN_WAIT2 5
+TCP_TIME_WAIT 6
+TCP_CLOSE 7
+TCP_CLOSE_WAIT 8
+TCP_LAST_ACK 9
+TCP_LISTEN 10
+TCP_CLOSING 11
+TCP_NEW_SYN_RECV 12
diff --git a/src/xlat/tcxonc_options.in b/src/xlat/tcxonc_options.in
new file mode 100644
index 000000000..733aee930
--- /dev/null
+++ b/src/xlat/tcxonc_options.in
@@ -0,0 +1,4 @@
+TCOOFF
+TCOON
+TCIOFF
+TCION
diff --git a/src/xlat/tee_ioctl_cmds.in b/src/xlat/tee_ioctl_cmds.in
new file mode 100644
index 000000000..abd9700d7
--- /dev/null
+++ b/src/xlat/tee_ioctl_cmds.in
@@ -0,0 +1,10 @@
+TEE_IOC_VERSION _IOR (0xa4, 0, struct_tee_ioctl_version_data)
+TEE_IOC_SHM_ALLOC _IOWR(0xa4, 1, struct_tee_ioctl_shm_alloc_data)
+TEE_IOC_OPEN_SESSION _IOR (0xa4, 2, struct_tee_ioctl_buf_data)
+TEE_IOC_INVOKE _IOR (0xa4, 3, struct_tee_ioctl_buf_data)
+TEE_IOC_CANCEL _IOR (0xa4, 4, struct_tee_ioctl_cancel_arg)
+TEE_IOC_CLOSE_SESSION _IOR (0xa4, 5, struct_tee_ioctl_close_session_arg)
+TEE_IOC_SUPPL_RECV _IOR (0xa4, 6, struct_tee_ioctl_buf_data)
+TEE_IOC_SUPPL_SEND _IOR (0xa4, 7, struct_tee_ioctl_buf_data)
+TEE_IOC_SHM_REGISTER_FD _IOWR(0xa4, 8, struct_tee_ioctl_shm_register_fd_data) /* Not in mainline */
+TEE_IOC_SHM_REGISTER _IOWR(0xa4, 9, struct_tee_ioctl_shm_register_data)
diff --git a/src/xlat/tee_ioctl_gen_caps.in b/src/xlat/tee_ioctl_gen_caps.in
new file mode 100644
index 000000000..c6a22526a
--- /dev/null
+++ b/src/xlat/tee_ioctl_gen_caps.in
@@ -0,0 +1,4 @@
+TEE_GEN_CAP_GP (1 << 0)
+TEE_GEN_CAP_PRIVILEGED (1 << 1)
+TEE_GEN_CAP_REG_MEM (1 << 2)
+TEE_GEN_CAP_MEMREF_NULL (1 << 3)
diff --git a/src/xlat/tee_ioctl_impl_ids.in b/src/xlat/tee_ioctl_impl_ids.in
new file mode 100644
index 000000000..b62ed35b9
--- /dev/null
+++ b/src/xlat/tee_ioctl_impl_ids.in
@@ -0,0 +1,2 @@
+TEE_IMPL_ID_OPTEE 1
+TEE_IMPL_ID_AMDTEE 2
diff --git a/src/xlat/tee_ioctl_login_types.in b/src/xlat/tee_ioctl_login_types.in
new file mode 100644
index 000000000..2e59bc6cd
--- /dev/null
+++ b/src/xlat/tee_ioctl_login_types.in
@@ -0,0 +1,7 @@
+#value_indexed
+TEE_IOCTL_LOGIN_PUBLIC 0
+TEE_IOCTL_LOGIN_USER 1
+TEE_IOCTL_LOGIN_GROUP 2
+TEE_IOCTL_LOGIN_APPLICATION 4
+TEE_IOCTL_LOGIN_USER_APPLICATION 5
+TEE_IOCTL_LOGIN_GROUP_APPLICATION 6
diff --git a/src/xlat/tee_ioctl_max_arg_size.in b/src/xlat/tee_ioctl_max_arg_size.in
new file mode 100644
index 000000000..5e7f6fa69
--- /dev/null
+++ b/src/xlat/tee_ioctl_max_arg_size.in
@@ -0,0 +1 @@
+TEE_MAX_ARG_SIZE 1024
diff --git a/src/xlat/tee_ioctl_optee_caps.in b/src/xlat/tee_ioctl_optee_caps.in
new file mode 100644
index 000000000..8d46cf04c
--- /dev/null
+++ b/src/xlat/tee_ioctl_optee_caps.in
@@ -0,0 +1 @@
+TEE_OPTEE_CAP_TZ (1 << 0)
diff --git a/src/xlat/tee_ioctl_origins.in b/src/xlat/tee_ioctl_origins.in
new file mode 100644
index 000000000..4b4937898
--- /dev/null
+++ b/src/xlat/tee_ioctl_origins.in
@@ -0,0 +1,4 @@
+TEEC_ORIGIN_API 0x00000001
+TEEC_ORIGIN_COMMS 0x00000002
+TEEC_ORIGIN_TEE 0x00000003
+TEEC_ORIGIN_TRUSTED_APP 0x00000004
diff --git a/src/xlat/tee_ioctl_param_attr_types.in b/src/xlat/tee_ioctl_param_attr_types.in
new file mode 100644
index 000000000..2c15d5148
--- /dev/null
+++ b/src/xlat/tee_ioctl_param_attr_types.in
@@ -0,0 +1,8 @@
+TEE_IOCTL_PARAM_ATTR_TYPE_NONE 0
+TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_INPUT 1
+TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_OUTPUT 2
+TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_INOUT 3
+TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_INPUT 5
+TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_OUTPUT 6
+TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_INOUT 7
+TEE_IOCTL_PARAM_ATTR_META 0x100
diff --git a/src/xlat/tee_ioctl_shm_flags.in b/src/xlat/tee_ioctl_shm_flags.in
new file mode 100644
index 000000000..881044b9d
--- /dev/null
+++ b/src/xlat/tee_ioctl_shm_flags.in
@@ -0,0 +1,8 @@
+TEE_IOCTL_SHM_MAPPED 0x1
+TEE_IOCTL_SHM_DMA_BUF 0x2
+/* These ones aren't in uapi */
+TEE_IOCTL_SHM_EXT_DMA_BUF 0x4
+TEE_IOCTL_SHM_REGISTER 0x8
+TEE_IOCTL_SHM_USER_MAPPED 0x10
+TEE_IOCTL_SHM_POOL 0x20
+TEE_IOCTL_SHM_KERNEL_MAPPED 0x40
diff --git a/src/xlat/timerfdflags.in b/src/xlat/timerfdflags.in
new file mode 100644
index 000000000..bf767e3f4
--- /dev/null
+++ b/src/xlat/timerfdflags.in
@@ -0,0 +1,8 @@
+/* The Linux userspace headers didn't export these for a long time. */
+
+TFD_TIMER_ABSTIME (1 << 0)
+TFD_TIMER_CANCEL_ON_SET (1 << 1)
+#if defined TFD_CLOEXEC || defined O_CLOEXEC
+TFD_CLOEXEC O_CLOEXEC
+#endif
+TFD_NONBLOCK O_NONBLOCK
diff --git a/src/xlat/tun_device_types.in b/src/xlat/tun_device_types.in
new file mode 100644
index 000000000..81af0bc15
--- /dev/null
+++ b/src/xlat/tun_device_types.in
@@ -0,0 +1,3 @@
+#value_indexed
+IFF_TUN 1
+IFF_TAP 2
diff --git a/src/xlat/ubi_data_types.in b/src/xlat/ubi_data_types.in
new file mode 100644
index 000000000..6fda7d417
--- /dev/null
+++ b/src/xlat/ubi_data_types.in
@@ -0,0 +1,3 @@
+UBI_LONGTERM 1
+UBI_SHORTTERM 2
+UBI_UNKNOWN 3
diff --git a/src/xlat/ubi_volume_flags.in b/src/xlat/ubi_volume_flags.in
new file mode 100644
index 000000000..02c732103
--- /dev/null
+++ b/src/xlat/ubi_volume_flags.in
@@ -0,0 +1 @@
+UBI_VOL_SKIP_CRC_CHECK_FLG 1U
diff --git a/src/xlat/ubi_volume_props.in b/src/xlat/ubi_volume_props.in
new file mode 100644
index 000000000..78f288094
--- /dev/null
+++ b/src/xlat/ubi_volume_props.in
@@ -0,0 +1,2 @@
+#unconditional
+UBI_VOL_PROP_DIRECT_WRITE
diff --git a/src/xlat/ubi_volume_types.in b/src/xlat/ubi_volume_types.in
new file mode 100644
index 000000000..b4de52e57
--- /dev/null
+++ b/src/xlat/ubi_volume_types.in
@@ -0,0 +1,3 @@
+#unconditional
+UBI_DYNAMIC_VOLUME
+UBI_STATIC_VOLUME
diff --git a/src/xlat/uffd_api_features.in b/src/xlat/uffd_api_features.in
new file mode 100644
index 000000000..33d644778
--- /dev/null
+++ b/src/xlat/uffd_api_features.in
@@ -0,0 +1,10 @@
+#val_type uint64_t
+UFFD_FEATURE_PAGEFAULT_FLAG_WP (1<<0)
+UFFD_FEATURE_EVENT_FORK (1<<1)
+UFFD_FEATURE_EVENT_REMAP (1<<2)
+UFFD_FEATURE_EVENT_REMOVE (1<<3)
+UFFD_FEATURE_MISSING_HUGETLBFS (1<<4)
+UFFD_FEATURE_MISSING_SHMEM (1<<5)
+UFFD_FEATURE_EVENT_UNMAP (1<<6)
+UFFD_FEATURE_SIGBUS (1<<7)
+UFFD_FEATURE_THREAD_ID (1<<8)
diff --git a/src/xlat/uffd_api_flags.in b/src/xlat/uffd_api_flags.in
new file mode 100644
index 000000000..fd210872b
--- /dev/null
+++ b/src/xlat/uffd_api_flags.in
@@ -0,0 +1,4 @@
+#val_type uint64_t
+1<<_UFFDIO_REGISTER
+1<<_UFFDIO_UNREGISTER
+1<<_UFFDIO_API
diff --git a/src/xlat/uffd_copy_flags.in b/src/xlat/uffd_copy_flags.in
new file mode 100644
index 000000000..a9e3e9416
--- /dev/null
+++ b/src/xlat/uffd_copy_flags.in
@@ -0,0 +1,3 @@
+#val_type uint64_t
+UFFDIO_COPY_MODE_DONTWAKE (1ULL<<0)
+UFFDIO_COPY_MODE_WP (1ULL<<1)
diff --git a/src/xlat/uffd_flags.in b/src/xlat/uffd_flags.in
new file mode 100644
index 000000000..fb0338bcc
--- /dev/null
+++ b/src/xlat/uffd_flags.in
@@ -0,0 +1,2 @@
+O_NONBLOCK
+O_CLOEXEC
diff --git a/src/xlat/uffd_register_ioctl_flags.in b/src/xlat/uffd_register_ioctl_flags.in
new file mode 100644
index 000000000..077871f93
--- /dev/null
+++ b/src/xlat/uffd_register_ioctl_flags.in
@@ -0,0 +1,5 @@
+#val_type uint64_t
+1<<_UFFDIO_WAKE
+1<<_UFFDIO_COPY
+1<<_UFFDIO_ZEROPAGE
+1<<_UFFDIO_WRITEPROTECT
diff --git a/src/xlat/uffd_register_mode_flags.in b/src/xlat/uffd_register_mode_flags.in
new file mode 100644
index 000000000..996b1f32e
--- /dev/null
+++ b/src/xlat/uffd_register_mode_flags.in
@@ -0,0 +1,3 @@
+#val_type uint64_t
+UFFDIO_REGISTER_MODE_MISSING
+UFFDIO_REGISTER_MODE_WP
diff --git a/src/xlat/uffd_zeropage_flags.in b/src/xlat/uffd_zeropage_flags.in
new file mode 100644
index 000000000..6d48a040d
--- /dev/null
+++ b/src/xlat/uffd_zeropage_flags.in
@@ -0,0 +1,2 @@
+#val_type uint64_t
+UFFDIO_ZEROPAGE_MODE_DONTWAKE
diff --git a/src/xlat/umount_flags.in b/src/xlat/umount_flags.in
new file mode 100644
index 000000000..2edabcdbb
--- /dev/null
+++ b/src/xlat/umount_flags.in
@@ -0,0 +1,4 @@
+MNT_FORCE 1
+MNT_DETACH 2
+MNT_EXPIRE 4
+UMOUNT_NOFOLLOW 8
diff --git a/src/xlat/unix_diag_attrs.in b/src/xlat/unix_diag_attrs.in
new file mode 100644
index 000000000..3d34d6765
--- /dev/null
+++ b/src/xlat/unix_diag_attrs.in
@@ -0,0 +1,10 @@
+#unconditional
+#value_indexed
+UNIX_DIAG_NAME
+UNIX_DIAG_VFS
+UNIX_DIAG_PEER
+UNIX_DIAG_ICONS
+UNIX_DIAG_RQLEN
+UNIX_DIAG_MEMINFO
+UNIX_DIAG_SHUTDOWN
+UNIX_DIAG_UID
diff --git a/src/xlat/unix_diag_show.in b/src/xlat/unix_diag_show.in
new file mode 100644
index 000000000..5f50887fc
--- /dev/null
+++ b/src/xlat/unix_diag_show.in
@@ -0,0 +1,7 @@
+UDIAG_SHOW_NAME
+UDIAG_SHOW_VFS
+UDIAG_SHOW_PEER
+UDIAG_SHOW_ICONS
+UDIAG_SHOW_RQLEN
+UDIAG_SHOW_MEMINFO
+UDIAG_SHOW_UID
diff --git a/src/xlat/unshare_flags.in b/src/xlat/unshare_flags.in
new file mode 100644
index 000000000..e9b574926
--- /dev/null
+++ b/src/xlat/unshare_flags.in
@@ -0,0 +1,15 @@
+#sorted sort -k2,2g
+CLONE_NEWTIME 0x00000080
+CLONE_VM 0x00000100
+CLONE_FS 0x00000200
+CLONE_FILES 0x00000400
+CLONE_SIGHAND 0x00000800
+CLONE_THREAD 0x00010000
+CLONE_NEWNS 0x00020000
+CLONE_SYSVSEM 0x00040000
+CLONE_NEWCGROUP 0x02000000
+CLONE_NEWUTS 0x04000000
+CLONE_NEWIPC 0x08000000
+CLONE_NEWUSER 0x10000000
+CLONE_NEWPID 0x20000000
+CLONE_NEWNET 0x40000000
diff --git a/src/xlat/uring_cqring_flags.in b/src/xlat/uring_cqring_flags.in
new file mode 100644
index 000000000..c81fbc20e
--- /dev/null
+++ b/src/xlat/uring_cqring_flags.in
@@ -0,0 +1 @@
+IORING_CQ_EVENTFD_DISABLED 1U
diff --git a/src/xlat/uring_enter_flags.in b/src/xlat/uring_enter_flags.in
new file mode 100644
index 000000000..2bc892ec4
--- /dev/null
+++ b/src/xlat/uring_enter_flags.in
@@ -0,0 +1,3 @@
+IORING_ENTER_GETEVENTS 1U
+IORING_ENTER_SQ_WAKEUP (1U << 1)
+IORING_ENTER_SQ_WAIT (1U << 2)
diff --git a/src/xlat/uring_op_flags.in b/src/xlat/uring_op_flags.in
new file mode 100644
index 000000000..98d25cee8
--- /dev/null
+++ b/src/xlat/uring_op_flags.in
@@ -0,0 +1 @@
+IO_URING_OP_SUPPORTED (1U << 0)
diff --git a/src/xlat/uring_ops.in b/src/xlat/uring_ops.in
new file mode 100644
index 000000000..d27261443
--- /dev/null
+++ b/src/xlat/uring_ops.in
@@ -0,0 +1,37 @@
+#enum
+#value_indexed
+#include <linux/io_uring.h>
+IORING_OP_NOP 0
+IORING_OP_READV 1
+IORING_OP_WRITEV 2
+IORING_OP_FSYNC 3
+IORING_OP_READ_FIXED 4
+IORING_OP_WRITE_FIXED 5
+IORING_OP_POLL_ADD 6
+IORING_OP_POLL_REMOVE 7
+IORING_OP_SYNC_FILE_RANGE 8
+IORING_OP_SENDMSG 9
+IORING_OP_RECVMSG 10
+IORING_OP_TIMEOUT 11
+IORING_OP_TIMEOUT_REMOVE 12
+IORING_OP_ACCEPT 13
+IORING_OP_ASYNC_CANCEL 14
+IORING_OP_LINK_TIMEOUT 15
+IORING_OP_CONNECT 16
+IORING_OP_FALLOCATE 17
+IORING_OP_OPENAT 18
+IORING_OP_CLOSE 19
+IORING_OP_FILES_UPDATE 20
+IORING_OP_STATX 21
+IORING_OP_READ 22
+IORING_OP_WRITE 23
+IORING_OP_FADVISE 24
+IORING_OP_MADVISE 25
+IORING_OP_SEND 26
+IORING_OP_RECV 27
+IORING_OP_OPENAT2 28
+IORING_OP_EPOLL_CTL 29
+IORING_OP_SPLICE 30
+IORING_OP_PROVIDE_BUFFERS 31
+IORING_OP_REMOVE_BUFFERS 32
+IORING_OP_TEE 33
diff --git a/src/xlat/uring_register_opcodes.in b/src/xlat/uring_register_opcodes.in
new file mode 100644
index 000000000..c6604291a
--- /dev/null
+++ b/src/xlat/uring_register_opcodes.in
@@ -0,0 +1,16 @@
+#enum
+#value_indexed
+#include <linux/io_uring.h>
+IORING_REGISTER_BUFFERS 0U
+IORING_UNREGISTER_BUFFERS 1U
+IORING_REGISTER_FILES 2U
+IORING_UNREGISTER_FILES 3U
+IORING_REGISTER_EVENTFD 4U
+IORING_UNREGISTER_EVENTFD 5U
+IORING_REGISTER_FILES_UPDATE 6U
+IORING_REGISTER_EVENTFD_ASYNC 7U
+IORING_REGISTER_PROBE 8U
+IORING_REGISTER_PERSONALITY 9U
+IORING_UNREGISTER_PERSONALITY 10U
+IORING_REGISTER_RESTRICTIONS 11U
+IORING_REGISTER_ENABLE_RINGS 12U
diff --git a/src/xlat/uring_setup_features.in b/src/xlat/uring_setup_features.in
new file mode 100644
index 000000000..29d963c0d
--- /dev/null
+++ b/src/xlat/uring_setup_features.in
@@ -0,0 +1,7 @@
+IORING_FEAT_SINGLE_MMAP (1<<0)
+IORING_FEAT_NODROP (1<<1)
+IORING_FEAT_SUBMIT_STABLE (1<<2)
+IORING_FEAT_RW_CUR_POS (1<<3)
+IORING_FEAT_CUR_PERSONALITY (1<<4)
+IORING_FEAT_FAST_POLL (1<<5)
+IORING_FEAT_POLL_32BITS (1<<6)
diff --git a/src/xlat/uring_setup_flags.in b/src/xlat/uring_setup_flags.in
new file mode 100644
index 000000000..3011ac261
--- /dev/null
+++ b/src/xlat/uring_setup_flags.in
@@ -0,0 +1,7 @@
+IORING_SETUP_IOPOLL 1U
+IORING_SETUP_SQPOLL (1U << 1)
+IORING_SETUP_SQ_AFF (1U << 2)
+IORING_SETUP_CQSIZE (1U << 3)
+IORING_SETUP_CLAMP (1U << 4)
+IORING_SETUP_ATTACH_WQ (1U << 5)
+IORING_SETUP_R_DISABLED (1U << 6)
diff --git a/src/xlat/usagewho.in b/src/xlat/usagewho.in
new file mode 100644
index 000000000..1b1255c92
--- /dev/null
+++ b/src/xlat/usagewho.in
@@ -0,0 +1,4 @@
+RUSAGE_SELF 0
+RUSAGE_CHILDREN (-1)
+RUSAGE_BOTH (-2)
+RUSAGE_THREAD 1
diff --git a/src/xlat/v4l2_buf_flags.in b/src/xlat/v4l2_buf_flags.in
new file mode 100644
index 000000000..276004271
--- /dev/null
+++ b/src/xlat/v4l2_buf_flags.in
@@ -0,0 +1,15 @@
+V4L2_BUF_FLAG_MAPPED 0x00000001
+V4L2_BUF_FLAG_QUEUED 0x00000002
+V4L2_BUF_FLAG_DONE 0x00000004
+V4L2_BUF_FLAG_KEYFRAME 0x00000008
+V4L2_BUF_FLAG_PFRAME 0x00000010
+V4L2_BUF_FLAG_BFRAME 0x00000020
+V4L2_BUF_FLAG_ERROR 0x00000040
+V4L2_BUF_FLAG_IN_REQUEST 0x00000080
+V4L2_BUF_FLAG_TIMECODE 0x00000100
+V4L2_BUF_FLAG_INPUT 0x00000200
+V4L2_BUF_FLAG_PREPARED 0x00000400
+V4L2_BUF_FLAG_NO_CACHE_INVALIDATE 0x00000800
+V4L2_BUF_FLAG_NO_CACHE_CLEAN 0x00001000
+V4L2_BUF_FLAG_LAST 0x00100000
+V4L2_BUF_FLAG_REQUEST_FD 0x00800000
diff --git a/src/xlat/v4l2_buf_flags_masks.in b/src/xlat/v4l2_buf_flags_masks.in
new file mode 100644
index 000000000..f7f51fa8e
--- /dev/null
+++ b/src/xlat/v4l2_buf_flags_masks.in
@@ -0,0 +1,2 @@
+V4L2_BUF_FLAG_TIMESTAMP_MASK 0x0000e000
+V4L2_BUF_FLAG_TSTAMP_SRC_MASK 0x00070000
diff --git a/src/xlat/v4l2_buf_flags_ts_src.in b/src/xlat/v4l2_buf_flags_ts_src.in
new file mode 100644
index 000000000..01a1c87db
--- /dev/null
+++ b/src/xlat/v4l2_buf_flags_ts_src.in
@@ -0,0 +1,3 @@
+/* V4L2_BUF_FLAG_TSTAMP_SRC_MASK 0x00070000 */
+V4L2_BUF_FLAG_TSTAMP_SRC_EOF 0x00000000
+V4L2_BUF_FLAG_TSTAMP_SRC_SOE 0x00010000
diff --git a/src/xlat/v4l2_buf_flags_ts_type.in b/src/xlat/v4l2_buf_flags_ts_type.in
new file mode 100644
index 000000000..b9d2f1790
--- /dev/null
+++ b/src/xlat/v4l2_buf_flags_ts_type.in
@@ -0,0 +1,4 @@
+/* V4L2_BUF_FLAG_TIMESTAMP_MASK 0x0000e000 */
+V4L2_BUF_FLAG_TIMESTAMP_UNKNOWN 0x00000000
+V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC 0x00002000
+V4L2_BUF_FLAG_TIMESTAMP_COPY 0x00004000
diff --git a/src/xlat/v4l2_buf_types.in b/src/xlat/v4l2_buf_types.in
new file mode 100644
index 000000000..a3e77bb29
--- /dev/null
+++ b/src/xlat/v4l2_buf_types.in
@@ -0,0 +1,21 @@
+#value_indexed
+#enum
+#include <sys/time.h>
+#include <linux/ioctl.h>
+#include <linux/types.h>
+#include <linux/videodev2.h>
+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_SDR_OUTPUT 12
+V4L2_BUF_TYPE_META_CAPTURE 13
+V4L2_BUF_TYPE_META_OUTPUT 14
+/* V4L2_BUF_TYPE_PRIVATE 0x80 */
diff --git a/src/xlat/v4l2_capture_modes.in b/src/xlat/v4l2_capture_modes.in
new file mode 100644
index 000000000..2ef053742
--- /dev/null
+++ b/src/xlat/v4l2_capture_modes.in
@@ -0,0 +1 @@
+V4L2_MODE_HIGHQUALITY 0x0001
diff --git a/src/xlat/v4l2_colorspaces.in b/src/xlat/v4l2_colorspaces.in
new file mode 100644
index 000000000..4012d2d57
--- /dev/null
+++ b/src/xlat/v4l2_colorspaces.in
@@ -0,0 +1,19 @@
+#value_indexed
+#enum
+#include <sys/time.h>
+#include <linux/ioctl.h>
+#include <linux/types.h>
+#include <linux/videodev2.h>
+V4L2_COLORSPACE_DEFAULT 0
+V4L2_COLORSPACE_SMPTE170M 1
+V4L2_COLORSPACE_SMPTE240M 2
+V4L2_COLORSPACE_REC709 3
+V4L2_COLORSPACE_BT878 4
+V4L2_COLORSPACE_470_SYSTEM_M 5
+V4L2_COLORSPACE_470_SYSTEM_BG 6
+V4L2_COLORSPACE_JPEG 7
+V4L2_COLORSPACE_SRGB 8
+V4L2_COLORSPACE_OPRGB 9
+V4L2_COLORSPACE_BT2020 10
+V4L2_COLORSPACE_RAW 11
+V4L2_COLORSPACE_DCI_P3 12
diff --git a/src/xlat/v4l2_control_classes.in b/src/xlat/v4l2_control_classes.in
new file mode 100644
index 000000000..cc86e3b2f
--- /dev/null
+++ b/src/xlat/v4l2_control_classes.in
@@ -0,0 +1,13 @@
+#sorted sort -k2,2
+V4L2_CTRL_CLASS_USER 0x00980000 /* Old-style 'user' controls */
+V4L2_CTRL_CLASS_MPEG 0x00990000 /* MPEG-compression controls */
+V4L2_CTRL_CLASS_CAMERA 0x009a0000 /* Camera class controls */
+V4L2_CTRL_CLASS_FM_TX 0x009b0000 /* FM Modulator controls */
+V4L2_CTRL_CLASS_FLASH 0x009c0000 /* Camera flash controls */
+V4L2_CTRL_CLASS_JPEG 0x009d0000 /* JPEG-compression controls */
+V4L2_CTRL_CLASS_IMAGE_SOURCE 0x009e0000 /* Image source controls */
+V4L2_CTRL_CLASS_IMAGE_PROC 0x009f0000 /* Image processing controls */
+V4L2_CTRL_CLASS_DV 0x00a00000 /* Digital Video controls */
+V4L2_CTRL_CLASS_FM_RX 0x00a10000 /* FM Receiver controls */
+V4L2_CTRL_CLASS_RF_TUNER 0x00a20000 /* RF tuner controls */
+V4L2_CTRL_CLASS_DETECT 0x00a30000 /* Detection controls */
diff --git a/src/xlat/v4l2_control_flags.in b/src/xlat/v4l2_control_flags.in
new file mode 100644
index 000000000..025b2b1ba
--- /dev/null
+++ b/src/xlat/v4l2_control_flags.in
@@ -0,0 +1,11 @@
+V4L2_CTRL_FLAG_DISABLED 0x0001
+V4L2_CTRL_FLAG_GRABBED 0x0002
+V4L2_CTRL_FLAG_READ_ONLY 0x0004
+V4L2_CTRL_FLAG_UPDATE 0x0008
+V4L2_CTRL_FLAG_INACTIVE 0x0010
+V4L2_CTRL_FLAG_SLIDER 0x0020
+V4L2_CTRL_FLAG_WRITE_ONLY 0x0040
+V4L2_CTRL_FLAG_VOLATILE 0x0080
+V4L2_CTRL_FLAG_HAS_PAYLOAD 0x0100
+V4L2_CTRL_FLAG_EXECUTE_ON_WRITE 0x0200
+V4L2_CTRL_FLAG_MODIFY_LAYOUT 0x0400
diff --git a/src/xlat/v4l2_control_id_bases.in b/src/xlat/v4l2_control_id_bases.in
new file mode 100644
index 000000000..e2e68073a
--- /dev/null
+++ b/src/xlat/v4l2_control_id_bases.in
@@ -0,0 +1,40 @@
+V4L2_CID_BASE (V4L2_CTRL_CLASS_USER | 0x900)
+V4L2_CID_USER_MEYE_BASE (V4L2_CID_BASE | 0x1000)
+V4L2_CID_USER_BTTV_BASE (V4L2_CID_BASE | 0x1010)
+V4L2_CID_USER_S2255_BASE (V4L2_CID_BASE | 0x1030)
+V4L2_CID_USER_SI476X_BASE (V4L2_CID_BASE | 0x1040)
+V4L2_CID_USER_TI_VPE_BASE (V4L2_CID_BASE | 0x1050)
+V4L2_CID_USER_SAA7134_BASE (V4L2_CID_BASE | 0x1060)
+V4L2_CID_USER_ADV7180_BASE (V4L2_CID_BASE | 0x1070)
+V4L2_CID_USER_TC358743_BASE (V4L2_CID_BASE | 0x1080)
+V4L2_CID_USER_MAX217X_BASE (V4L2_CID_BASE | 0x1090)
+#ifndef STRACE_WORKAROUND_FOR_V4L2_CID_USER_IMX_BASE
+# define STRACE_WORKAROUND_FOR_V4L2_CID_USER_IMX_BASE
+/*
+ * Linux kernel commit v4.18-rc2-106-g421860b9d47053badce4b247576fa48df9ab4c48
+ * has changed the value of V4L2_CID_USER_IMX_BASE constant introduced
+ * by commit v4.13-rc1~141^2~121 because the old value was already used
+ * by V4L2_CID_USER_MAX217X_BASE.
+ * This is of course an ABI breakage that affects Linux kernels starting
+ * with 4.13 and up to 4.18, as well as their LTS derivatives.
+ * Since the imx driver didn't provide any public control ID definitions,
+ * it looks like the best way to handle this situation is to pretend that
+ * the old value of V4L2_CID_USER_IMX_BASE didn't exist.
+ */
+# undef V4L2_CID_USER_IMX_BASE
+#endif
+V4L2_CID_USER_IMX_BASE (V4L2_CID_BASE | 0x10b0)
+V4L2_CID_USER_ATMEL_ISC_BASE (V4L2_CID_BASE | 0x10c0)
+V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900)
+V4L2_CID_MPEG_CX2341X_BASE (V4L2_CTRL_CLASS_MPEG | 0x1000)
+V4L2_CID_MPEG_MFC51_BASE (V4L2_CTRL_CLASS_MPEG | 0x1100)
+V4L2_CID_CAMERA_CLASS_BASE (V4L2_CTRL_CLASS_CAMERA | 0x900)
+V4L2_CID_FM_TX_CLASS_BASE (V4L2_CTRL_CLASS_FM_TX | 0x900)
+V4L2_CID_FLASH_CLASS_BASE (V4L2_CTRL_CLASS_FLASH | 0x900)
+V4L2_CID_JPEG_CLASS_BASE (V4L2_CTRL_CLASS_JPEG | 0x900)
+V4L2_CID_IMAGE_SOURCE_CLASS_BASE (V4L2_CTRL_CLASS_IMAGE_SOURCE | 0x900)
+V4L2_CID_IMAGE_PROC_CLASS_BASE (V4L2_CTRL_CLASS_IMAGE_PROC | 0x900)
+V4L2_CID_DV_CLASS_BASE (V4L2_CTRL_CLASS_DV | 0x900)
+V4L2_CID_FM_RX_CLASS_BASE (V4L2_CTRL_CLASS_FM_RX | 0x900)
+V4L2_CID_RF_TUNER_CLASS_BASE (V4L2_CTRL_CLASS_RF_TUNER | 0x900)
+V4L2_CID_DETECT_CLASS_BASE (V4L2_CTRL_CLASS_DETECT | 0x900)
diff --git a/src/xlat/v4l2_control_ids.in b/src/xlat/v4l2_control_ids.in
new file mode 100644
index 000000000..eeb495f42
--- /dev/null
+++ b/src/xlat/v4l2_control_ids.in
@@ -0,0 +1,361 @@
+/* User-class control IDs */
+V4L2_CID_BRIGHTNESS (V4L2_CID_BASE+0)
+V4L2_CID_CONTRAST (V4L2_CID_BASE+1)
+V4L2_CID_SATURATION (V4L2_CID_BASE+2)
+V4L2_CID_HUE (V4L2_CID_BASE+3)
+V4L2_CID_AUDIO_VOLUME (V4L2_CID_BASE+5)
+V4L2_CID_AUDIO_BALANCE (V4L2_CID_BASE+6)
+V4L2_CID_AUDIO_BASS (V4L2_CID_BASE+7)
+V4L2_CID_AUDIO_TREBLE (V4L2_CID_BASE+8)
+V4L2_CID_AUDIO_MUTE (V4L2_CID_BASE+9)
+V4L2_CID_AUDIO_LOUDNESS (V4L2_CID_BASE+10)
+V4L2_CID_BLACK_LEVEL (V4L2_CID_BASE+11) /* Deprecated */
+V4L2_CID_AUTO_WHITE_BALANCE (V4L2_CID_BASE+12)
+V4L2_CID_DO_WHITE_BALANCE (V4L2_CID_BASE+13)
+V4L2_CID_RED_BALANCE (V4L2_CID_BASE+14)
+V4L2_CID_BLUE_BALANCE (V4L2_CID_BASE+15)
+V4L2_CID_GAMMA (V4L2_CID_BASE+16)
+V4L2_CID_EXPOSURE (V4L2_CID_BASE+17)
+V4L2_CID_AUTOGAIN (V4L2_CID_BASE+18)
+V4L2_CID_GAIN (V4L2_CID_BASE+19)
+V4L2_CID_HFLIP (V4L2_CID_BASE+20)
+V4L2_CID_VFLIP (V4L2_CID_BASE+21)
+V4L2_CID_HCENTER (V4L2_CID_BASE+22)
+V4L2_CID_VCENTER (V4L2_CID_BASE+23)
+V4L2_CID_POWER_LINE_FREQUENCY (V4L2_CID_BASE+24)
+V4L2_CID_HUE_AUTO (V4L2_CID_BASE+25)
+V4L2_CID_WHITE_BALANCE_TEMPERATURE (V4L2_CID_BASE+26)
+V4L2_CID_SHARPNESS (V4L2_CID_BASE+27)
+V4L2_CID_BACKLIGHT_COMPENSATION (V4L2_CID_BASE+28)
+V4L2_CID_CHROMA_AGC (V4L2_CID_BASE+29)
+V4L2_CID_COLOR_KILLER (V4L2_CID_BASE+30)
+V4L2_CID_COLORFX (V4L2_CID_BASE+31)
+V4L2_CID_AUTOBRIGHTNESS (V4L2_CID_BASE+32)
+V4L2_CID_BAND_STOP_FILTER (V4L2_CID_BASE+33)
+V4L2_CID_ROTATE (V4L2_CID_BASE+34)
+V4L2_CID_BG_COLOR (V4L2_CID_BASE+35)
+V4L2_CID_CHROMA_GAIN (V4L2_CID_BASE+36)
+V4L2_CID_ILLUMINATORS_1 (V4L2_CID_BASE+37)
+V4L2_CID_ILLUMINATORS_2 (V4L2_CID_BASE+38)
+V4L2_CID_MIN_BUFFERS_FOR_CAPTURE (V4L2_CID_BASE+39)
+V4L2_CID_MIN_BUFFERS_FOR_OUTPUT (V4L2_CID_BASE+40)
+V4L2_CID_ALPHA_COMPONENT (V4L2_CID_BASE+41)
+V4L2_CID_COLORFX_CBCR (V4L2_CID_BASE+42)
+/* MPEG-class control IDs */
+/* MPEG streams, specific to multiplexed streams */
+V4L2_CID_MPEG_STREAM_TYPE (V4L2_CID_MPEG_BASE+0)
+V4L2_CID_MPEG_STREAM_PID_PMT (V4L2_CID_MPEG_BASE+1)
+V4L2_CID_MPEG_STREAM_PID_AUDIO (V4L2_CID_MPEG_BASE+2)
+V4L2_CID_MPEG_STREAM_PID_VIDEO (V4L2_CID_MPEG_BASE+3)
+V4L2_CID_MPEG_STREAM_PID_PCR (V4L2_CID_MPEG_BASE+4)
+V4L2_CID_MPEG_STREAM_PES_ID_AUDIO (V4L2_CID_MPEG_BASE+5)
+V4L2_CID_MPEG_STREAM_PES_ID_VIDEO (V4L2_CID_MPEG_BASE+6)
+V4L2_CID_MPEG_STREAM_VBI_FMT (V4L2_CID_MPEG_BASE+7)
+/* MPEG audio controls specific to multiplexed streams */
+V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ (V4L2_CID_MPEG_BASE+100)
+V4L2_CID_MPEG_AUDIO_ENCODING (V4L2_CID_MPEG_BASE+101)
+V4L2_CID_MPEG_AUDIO_L1_BITRATE (V4L2_CID_MPEG_BASE+102)
+V4L2_CID_MPEG_AUDIO_L2_BITRATE (V4L2_CID_MPEG_BASE+103)
+V4L2_CID_MPEG_AUDIO_L3_BITRATE (V4L2_CID_MPEG_BASE+104)
+V4L2_CID_MPEG_AUDIO_MODE (V4L2_CID_MPEG_BASE+105)
+V4L2_CID_MPEG_AUDIO_MODE_EXTENSION (V4L2_CID_MPEG_BASE+106)
+V4L2_CID_MPEG_AUDIO_EMPHASIS (V4L2_CID_MPEG_BASE+107)
+V4L2_CID_MPEG_AUDIO_CRC (V4L2_CID_MPEG_BASE+108)
+V4L2_CID_MPEG_AUDIO_MUTE (V4L2_CID_MPEG_BASE+109)
+V4L2_CID_MPEG_AUDIO_AAC_BITRATE (V4L2_CID_MPEG_BASE+110)
+V4L2_CID_MPEG_AUDIO_AC3_BITRATE (V4L2_CID_MPEG_BASE+111)
+V4L2_CID_MPEG_AUDIO_DEC_PLAYBACK (V4L2_CID_MPEG_BASE+112)
+V4L2_CID_MPEG_AUDIO_DEC_MULTILINGUAL_PLAYBACK (V4L2_CID_MPEG_BASE+113)
+/* MPEG video controls specific to multiplexed streams */
+V4L2_CID_MPEG_VIDEO_ENCODING (V4L2_CID_MPEG_BASE+200)
+V4L2_CID_MPEG_VIDEO_ASPECT (V4L2_CID_MPEG_BASE+201)
+V4L2_CID_MPEG_VIDEO_B_FRAMES (V4L2_CID_MPEG_BASE+202)
+V4L2_CID_MPEG_VIDEO_GOP_SIZE (V4L2_CID_MPEG_BASE+203)
+V4L2_CID_MPEG_VIDEO_GOP_CLOSURE (V4L2_CID_MPEG_BASE+204)
+V4L2_CID_MPEG_VIDEO_PULLDOWN (V4L2_CID_MPEG_BASE+205)
+V4L2_CID_MPEG_VIDEO_BITRATE_MODE (V4L2_CID_MPEG_BASE+206)
+V4L2_CID_MPEG_VIDEO_BITRATE (V4L2_CID_MPEG_BASE+207)
+V4L2_CID_MPEG_VIDEO_BITRATE_PEAK (V4L2_CID_MPEG_BASE+208)
+V4L2_CID_MPEG_VIDEO_TEMPORAL_DECIMATION (V4L2_CID_MPEG_BASE+209)
+V4L2_CID_MPEG_VIDEO_MUTE (V4L2_CID_MPEG_BASE+210)
+V4L2_CID_MPEG_VIDEO_MUTE_YUV (V4L2_CID_MPEG_BASE+211)
+V4L2_CID_MPEG_VIDEO_DECODER_SLICE_INTERFACE (V4L2_CID_MPEG_BASE+212)
+V4L2_CID_MPEG_VIDEO_DECODER_MPEG4_DEBLOCK_FILTER (V4L2_CID_MPEG_BASE+213)
+V4L2_CID_MPEG_VIDEO_CYCLIC_INTRA_REFRESH_MB (V4L2_CID_MPEG_BASE+214)
+V4L2_CID_MPEG_VIDEO_FRAME_RC_ENABLE (V4L2_CID_MPEG_BASE+215)
+V4L2_CID_MPEG_VIDEO_HEADER_MODE (V4L2_CID_MPEG_BASE+216)
+V4L2_CID_MPEG_VIDEO_MAX_REF_PIC (V4L2_CID_MPEG_BASE+217)
+V4L2_CID_MPEG_VIDEO_MB_RC_ENABLE (V4L2_CID_MPEG_BASE+218)
+V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MAX_BYTES (V4L2_CID_MPEG_BASE+219)
+V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MAX_MB (V4L2_CID_MPEG_BASE+220)
+V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MODE (V4L2_CID_MPEG_BASE+221)
+V4L2_CID_MPEG_VIDEO_VBV_SIZE (V4L2_CID_MPEG_BASE+222)
+V4L2_CID_MPEG_VIDEO_DEC_PTS (V4L2_CID_MPEG_BASE+223)
+V4L2_CID_MPEG_VIDEO_DEC_FRAME (V4L2_CID_MPEG_BASE+224)
+V4L2_CID_MPEG_VIDEO_VBV_DELAY (V4L2_CID_MPEG_BASE+225)
+V4L2_CID_MPEG_VIDEO_REPEAT_SEQ_HEADER (V4L2_CID_MPEG_BASE+226)
+V4L2_CID_MPEG_VIDEO_MV_H_SEARCH_RANGE (V4L2_CID_MPEG_BASE+227)
+V4L2_CID_MPEG_VIDEO_MV_V_SEARCH_RANGE (V4L2_CID_MPEG_BASE+228)
+V4L2_CID_MPEG_VIDEO_FORCE_KEY_FRAME (V4L2_CID_MPEG_BASE+229)
+V4L2_CID_MPEG_VIDEO_MPEG2_SLICE_PARAMS (V4L2_CID_MPEG_BASE+250)
+V4L2_CID_MPEG_VIDEO_MPEG2_QUANTIZATION (V4L2_CID_MPEG_BASE+251)
+V4L2_CID_FWHT_I_FRAME_QP (V4L2_CID_MPEG_BASE+290)
+V4L2_CID_FWHT_P_FRAME_QP (V4L2_CID_MPEG_BASE+291)
+V4L2_CID_MPEG_VIDEO_H263_I_FRAME_QP (V4L2_CID_MPEG_BASE+300)
+V4L2_CID_MPEG_VIDEO_H263_P_FRAME_QP (V4L2_CID_MPEG_BASE+301)
+V4L2_CID_MPEG_VIDEO_H263_B_FRAME_QP (V4L2_CID_MPEG_BASE+302)
+V4L2_CID_MPEG_VIDEO_H263_MIN_QP (V4L2_CID_MPEG_BASE+303)
+V4L2_CID_MPEG_VIDEO_H263_MAX_QP (V4L2_CID_MPEG_BASE+304)
+V4L2_CID_MPEG_VIDEO_H264_I_FRAME_QP (V4L2_CID_MPEG_BASE+350)
+V4L2_CID_MPEG_VIDEO_H264_P_FRAME_QP (V4L2_CID_MPEG_BASE+351)
+V4L2_CID_MPEG_VIDEO_H264_B_FRAME_QP (V4L2_CID_MPEG_BASE+352)
+V4L2_CID_MPEG_VIDEO_H264_MIN_QP (V4L2_CID_MPEG_BASE+353)
+V4L2_CID_MPEG_VIDEO_H264_MAX_QP (V4L2_CID_MPEG_BASE+354)
+V4L2_CID_MPEG_VIDEO_H264_8X8_TRANSFORM (V4L2_CID_MPEG_BASE+355)
+V4L2_CID_MPEG_VIDEO_H264_CPB_SIZE (V4L2_CID_MPEG_BASE+356)
+V4L2_CID_MPEG_VIDEO_H264_ENTROPY_MODE (V4L2_CID_MPEG_BASE+357)
+V4L2_CID_MPEG_VIDEO_H264_I_PERIOD (V4L2_CID_MPEG_BASE+358)
+V4L2_CID_MPEG_VIDEO_H264_LEVEL (V4L2_CID_MPEG_BASE+359)
+V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_ALPHA (V4L2_CID_MPEG_BASE+360)
+V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_BETA (V4L2_CID_MPEG_BASE+361)
+V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_MODE (V4L2_CID_MPEG_BASE+362)
+V4L2_CID_MPEG_VIDEO_H264_PROFILE (V4L2_CID_MPEG_BASE+363)
+V4L2_CID_MPEG_VIDEO_H264_VUI_EXT_SAR_HEIGHT (V4L2_CID_MPEG_BASE+364)
+V4L2_CID_MPEG_VIDEO_H264_VUI_EXT_SAR_WIDTH (V4L2_CID_MPEG_BASE+365)
+V4L2_CID_MPEG_VIDEO_H264_VUI_SAR_ENABLE (V4L2_CID_MPEG_BASE+366)
+V4L2_CID_MPEG_VIDEO_H264_VUI_SAR_IDC (V4L2_CID_MPEG_BASE+367)
+V4L2_CID_MPEG_VIDEO_H264_SEI_FRAME_PACKING (V4L2_CID_MPEG_BASE+368)
+V4L2_CID_MPEG_VIDEO_H264_SEI_FP_CURRENT_FRAME_0 (V4L2_CID_MPEG_BASE+369)
+V4L2_CID_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE (V4L2_CID_MPEG_BASE+370)
+V4L2_CID_MPEG_VIDEO_H264_FMO (V4L2_CID_MPEG_BASE+371)
+V4L2_CID_MPEG_VIDEO_H264_FMO_MAP_TYPE (V4L2_CID_MPEG_BASE+372)
+V4L2_CID_MPEG_VIDEO_H264_FMO_SLICE_GROUP (V4L2_CID_MPEG_BASE+373)
+V4L2_CID_MPEG_VIDEO_H264_FMO_CHANGE_DIRECTION (V4L2_CID_MPEG_BASE+374)
+V4L2_CID_MPEG_VIDEO_H264_FMO_CHANGE_RATE (V4L2_CID_MPEG_BASE+375)
+V4L2_CID_MPEG_VIDEO_H264_FMO_RUN_LENGTH (V4L2_CID_MPEG_BASE+376)
+V4L2_CID_MPEG_VIDEO_H264_ASO (V4L2_CID_MPEG_BASE+377)
+V4L2_CID_MPEG_VIDEO_H264_ASO_SLICE_ORDER (V4L2_CID_MPEG_BASE+378)
+V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING (V4L2_CID_MPEG_BASE+379)
+V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_TYPE (V4L2_CID_MPEG_BASE+380)
+V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_LAYER (V4L2_CID_MPEG_BASE+381)
+V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_LAYER_QP (V4L2_CID_MPEG_BASE+382)
+V4L2_CID_MPEG_VIDEO_H264_CONSTRAINED_INTRA_PREDICTION (V4L2_CID_MPEG_BASE+383)
+V4L2_CID_MPEG_VIDEO_H264_CHROMA_QP_INDEX_OFFSET (V4L2_CID_MPEG_BASE+384)
+V4L2_CID_MPEG_VIDEO_H264_I_FRAME_MIN_QP (V4L2_CID_MPEG_BASE+385)
+V4L2_CID_MPEG_VIDEO_H264_I_FRAME_MAX_QP (V4L2_CID_MPEG_BASE+386)
+V4L2_CID_MPEG_VIDEO_H264_P_FRAME_MIN_QP (V4L2_CID_MPEG_BASE+387)
+V4L2_CID_MPEG_VIDEO_H264_P_FRAME_MAX_QP (V4L2_CID_MPEG_BASE+388)
+V4L2_CID_MPEG_VIDEO_MPEG4_I_FRAME_QP (V4L2_CID_MPEG_BASE+400)
+V4L2_CID_MPEG_VIDEO_MPEG4_P_FRAME_QP (V4L2_CID_MPEG_BASE+401)
+V4L2_CID_MPEG_VIDEO_MPEG4_B_FRAME_QP (V4L2_CID_MPEG_BASE+402)
+V4L2_CID_MPEG_VIDEO_MPEG4_MIN_QP (V4L2_CID_MPEG_BASE+403)
+V4L2_CID_MPEG_VIDEO_MPEG4_MAX_QP (V4L2_CID_MPEG_BASE+404)
+V4L2_CID_MPEG_VIDEO_MPEG4_LEVEL (V4L2_CID_MPEG_BASE+405)
+V4L2_CID_MPEG_VIDEO_MPEG4_PROFILE (V4L2_CID_MPEG_BASE+406)
+V4L2_CID_MPEG_VIDEO_MPEG4_QPEL (V4L2_CID_MPEG_BASE+407)
+/* Control IDs for VP8 streams */
+V4L2_CID_MPEG_VIDEO_VPX_NUM_PARTITIONS (V4L2_CID_MPEG_BASE+500)
+V4L2_CID_MPEG_VIDEO_VPX_IMD_DISABLE_4X4 (V4L2_CID_MPEG_BASE+501)
+V4L2_CID_MPEG_VIDEO_VPX_NUM_REF_FRAMES (V4L2_CID_MPEG_BASE+502)
+V4L2_CID_MPEG_VIDEO_VPX_FILTER_LEVEL (V4L2_CID_MPEG_BASE+503)
+V4L2_CID_MPEG_VIDEO_VPX_FILTER_SHARPNESS (V4L2_CID_MPEG_BASE+504)
+V4L2_CID_MPEG_VIDEO_VPX_GOLDEN_FRAME_REF_PERIOD (V4L2_CID_MPEG_BASE+505)
+V4L2_CID_MPEG_VIDEO_VPX_GOLDEN_FRAME_SEL (V4L2_CID_MPEG_BASE+506)
+V4L2_CID_MPEG_VIDEO_VPX_MIN_QP (V4L2_CID_MPEG_BASE+507)
+V4L2_CID_MPEG_VIDEO_VPX_MAX_QP (V4L2_CID_MPEG_BASE+508)
+V4L2_CID_MPEG_VIDEO_VPX_I_FRAME_QP (V4L2_CID_MPEG_BASE+509)
+V4L2_CID_MPEG_VIDEO_VPX_P_FRAME_QP (V4L2_CID_MPEG_BASE+510)
+V4L2_CID_MPEG_VIDEO_VP8_PROFILE (V4L2_CID_MPEG_BASE+511)
+V4L2_CID_MPEG_VIDEO_VP9_PROFILE (V4L2_CID_MPEG_BASE+512)
+/* CIDs for HEVC encoding. */
+V4L2_CID_MPEG_VIDEO_HEVC_MIN_QP (V4L2_CID_MPEG_BASE + 600)
+V4L2_CID_MPEG_VIDEO_HEVC_MAX_QP (V4L2_CID_MPEG_BASE + 601)
+V4L2_CID_MPEG_VIDEO_HEVC_I_FRAME_QP (V4L2_CID_MPEG_BASE + 602)
+V4L2_CID_MPEG_VIDEO_HEVC_P_FRAME_QP (V4L2_CID_MPEG_BASE + 603)
+V4L2_CID_MPEG_VIDEO_HEVC_B_FRAME_QP (V4L2_CID_MPEG_BASE + 604)
+V4L2_CID_MPEG_VIDEO_HEVC_HIER_QP (V4L2_CID_MPEG_BASE + 605)
+V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_TYPE (V4L2_CID_MPEG_BASE + 606)
+V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_LAYER (V4L2_CID_MPEG_BASE + 607)
+V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L0_QP (V4L2_CID_MPEG_BASE + 608)
+V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L1_QP (V4L2_CID_MPEG_BASE + 609)
+V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L2_QP (V4L2_CID_MPEG_BASE + 610)
+V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L3_QP (V4L2_CID_MPEG_BASE + 611)
+V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L4_QP (V4L2_CID_MPEG_BASE + 612)
+V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L5_QP (V4L2_CID_MPEG_BASE + 613)
+V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L6_QP (V4L2_CID_MPEG_BASE + 614)
+V4L2_CID_MPEG_VIDEO_HEVC_PROFILE (V4L2_CID_MPEG_BASE + 615)
+V4L2_CID_MPEG_VIDEO_HEVC_LEVEL (V4L2_CID_MPEG_BASE + 616)
+V4L2_CID_MPEG_VIDEO_HEVC_FRAME_RATE_RESOLUTION (V4L2_CID_MPEG_BASE + 617)
+V4L2_CID_MPEG_VIDEO_HEVC_TIER (V4L2_CID_MPEG_BASE + 618)
+V4L2_CID_MPEG_VIDEO_HEVC_MAX_PARTITION_DEPTH (V4L2_CID_MPEG_BASE + 619)
+V4L2_CID_MPEG_VIDEO_HEVC_LOOP_FILTER_MODE (V4L2_CID_MPEG_BASE + 620)
+V4L2_CID_MPEG_VIDEO_HEVC_LF_BETA_OFFSET_DIV2 (V4L2_CID_MPEG_BASE + 621)
+V4L2_CID_MPEG_VIDEO_HEVC_LF_TC_OFFSET_DIV2 (V4L2_CID_MPEG_BASE + 622)
+V4L2_CID_MPEG_VIDEO_HEVC_REFRESH_TYPE (V4L2_CID_MPEG_BASE + 623)
+V4L2_CID_MPEG_VIDEO_HEVC_REFRESH_PERIOD (V4L2_CID_MPEG_BASE + 624)
+V4L2_CID_MPEG_VIDEO_HEVC_LOSSLESS_CU (V4L2_CID_MPEG_BASE + 625)
+V4L2_CID_MPEG_VIDEO_HEVC_CONST_INTRA_PRED (V4L2_CID_MPEG_BASE + 626)
+V4L2_CID_MPEG_VIDEO_HEVC_WAVEFRONT (V4L2_CID_MPEG_BASE + 627)
+V4L2_CID_MPEG_VIDEO_HEVC_GENERAL_PB (V4L2_CID_MPEG_BASE + 628)
+V4L2_CID_MPEG_VIDEO_HEVC_TEMPORAL_ID (V4L2_CID_MPEG_BASE + 629)
+V4L2_CID_MPEG_VIDEO_HEVC_STRONG_SMOOTHING (V4L2_CID_MPEG_BASE + 630)
+V4L2_CID_MPEG_VIDEO_HEVC_MAX_NUM_MERGE_MV_MINUS1 (V4L2_CID_MPEG_BASE + 631)
+V4L2_CID_MPEG_VIDEO_HEVC_INTRA_PU_SPLIT (V4L2_CID_MPEG_BASE + 632)
+V4L2_CID_MPEG_VIDEO_HEVC_TMV_PREDICTION (V4L2_CID_MPEG_BASE + 633)
+V4L2_CID_MPEG_VIDEO_HEVC_WITHOUT_STARTCODE (V4L2_CID_MPEG_BASE + 634)
+V4L2_CID_MPEG_VIDEO_HEVC_SIZE_OF_LENGTH_FIELD (V4L2_CID_MPEG_BASE + 635)
+V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L0_BR (V4L2_CID_MPEG_BASE + 636)
+V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L1_BR (V4L2_CID_MPEG_BASE + 637)
+V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L2_BR (V4L2_CID_MPEG_BASE + 638)
+V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L3_BR (V4L2_CID_MPEG_BASE + 639)
+V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L4_BR (V4L2_CID_MPEG_BASE + 640)
+V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L5_BR (V4L2_CID_MPEG_BASE + 641)
+V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_L6_BR (V4L2_CID_MPEG_BASE + 642)
+V4L2_CID_MPEG_VIDEO_REF_NUMBER_FOR_PFRAMES (V4L2_CID_MPEG_BASE + 643)
+V4L2_CID_MPEG_VIDEO_PREPEND_SPSPPS_TO_IDR (V4L2_CID_MPEG_BASE + 644)
+/* MPEG-class control IDs specific to the CX2341x driver as defined by V4L2 */
+V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE (V4L2_CID_MPEG_CX2341X_BASE+0)
+V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER (V4L2_CID_MPEG_CX2341X_BASE+1)
+V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE (V4L2_CID_MPEG_CX2341X_BASE+2)
+V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE (V4L2_CID_MPEG_CX2341X_BASE+3)
+V4L2_CID_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE (V4L2_CID_MPEG_CX2341X_BASE+4)
+V4L2_CID_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER (V4L2_CID_MPEG_CX2341X_BASE+5)
+V4L2_CID_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE (V4L2_CID_MPEG_CX2341X_BASE+6)
+V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_MEDIAN_FILTER_BOTTOM (V4L2_CID_MPEG_CX2341X_BASE+7)
+V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_MEDIAN_FILTER_TOP (V4L2_CID_MPEG_CX2341X_BASE+8)
+V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_BOTTOM (V4L2_CID_MPEG_CX2341X_BASE+9)
+V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_TOP (V4L2_CID_MPEG_CX2341X_BASE+10)
+V4L2_CID_MPEG_CX2341X_STREAM_INSERT_NAV_PACKETS (V4L2_CID_MPEG_CX2341X_BASE+11)
+/* MPEG-class control IDs specific to the Samsung MFC 5.1 driver as defined by V4L2 */
+V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY (V4L2_CID_MPEG_MFC51_BASE+0)
+V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY_ENABLE (V4L2_CID_MPEG_MFC51_BASE+1)
+V4L2_CID_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE (V4L2_CID_MPEG_MFC51_BASE+2)
+V4L2_CID_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE (V4L2_CID_MPEG_MFC51_BASE+3)
+V4L2_CID_MPEG_MFC51_VIDEO_PADDING (V4L2_CID_MPEG_MFC51_BASE+4)
+V4L2_CID_MPEG_MFC51_VIDEO_PADDING_YUV (V4L2_CID_MPEG_MFC51_BASE+5)
+V4L2_CID_MPEG_MFC51_VIDEO_RC_FIXED_TARGET_BIT (V4L2_CID_MPEG_MFC51_BASE+6)
+V4L2_CID_MPEG_MFC51_VIDEO_RC_REACTION_COEFF (V4L2_CID_MPEG_MFC51_BASE+7)
+V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_ACTIVITY (V4L2_CID_MPEG_MFC51_BASE+50)
+V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_DARK (V4L2_CID_MPEG_MFC51_BASE+51)
+V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_SMOOTH (V4L2_CID_MPEG_MFC51_BASE+52)
+V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_STATIC (V4L2_CID_MPEG_MFC51_BASE+53)
+V4L2_CID_MPEG_MFC51_VIDEO_H264_NUM_REF_PIC_FOR_P (V4L2_CID_MPEG_MFC51_BASE+54)
+/* Camera class control IDs */
+V4L2_CID_EXPOSURE_AUTO (V4L2_CID_CAMERA_CLASS_BASE+1)
+V4L2_CID_EXPOSURE_ABSOLUTE (V4L2_CID_CAMERA_CLASS_BASE+2)
+V4L2_CID_EXPOSURE_AUTO_PRIORITY (V4L2_CID_CAMERA_CLASS_BASE+3)
+V4L2_CID_PAN_RELATIVE (V4L2_CID_CAMERA_CLASS_BASE+4)
+V4L2_CID_TILT_RELATIVE (V4L2_CID_CAMERA_CLASS_BASE+5)
+V4L2_CID_PAN_RESET (V4L2_CID_CAMERA_CLASS_BASE+6)
+V4L2_CID_TILT_RESET (V4L2_CID_CAMERA_CLASS_BASE+7)
+V4L2_CID_PAN_ABSOLUTE (V4L2_CID_CAMERA_CLASS_BASE+8)
+V4L2_CID_TILT_ABSOLUTE (V4L2_CID_CAMERA_CLASS_BASE+9)
+V4L2_CID_FOCUS_ABSOLUTE (V4L2_CID_CAMERA_CLASS_BASE+10)
+V4L2_CID_FOCUS_RELATIVE (V4L2_CID_CAMERA_CLASS_BASE+11)
+V4L2_CID_FOCUS_AUTO (V4L2_CID_CAMERA_CLASS_BASE+12)
+V4L2_CID_ZOOM_ABSOLUTE (V4L2_CID_CAMERA_CLASS_BASE+13)
+V4L2_CID_ZOOM_RELATIVE (V4L2_CID_CAMERA_CLASS_BASE+14)
+V4L2_CID_ZOOM_CONTINUOUS (V4L2_CID_CAMERA_CLASS_BASE+15)
+V4L2_CID_PRIVACY (V4L2_CID_CAMERA_CLASS_BASE+16)
+V4L2_CID_IRIS_ABSOLUTE (V4L2_CID_CAMERA_CLASS_BASE+17)
+V4L2_CID_IRIS_RELATIVE (V4L2_CID_CAMERA_CLASS_BASE+18)
+V4L2_CID_AUTO_EXPOSURE_BIAS (V4L2_CID_CAMERA_CLASS_BASE+19)
+V4L2_CID_AUTO_N_PRESET_WHITE_BALANCE (V4L2_CID_CAMERA_CLASS_BASE+20)
+V4L2_CID_WIDE_DYNAMIC_RANGE (V4L2_CID_CAMERA_CLASS_BASE+21)
+V4L2_CID_IMAGE_STABILIZATION (V4L2_CID_CAMERA_CLASS_BASE+22)
+V4L2_CID_ISO_SENSITIVITY (V4L2_CID_CAMERA_CLASS_BASE+23)
+V4L2_CID_ISO_SENSITIVITY_AUTO (V4L2_CID_CAMERA_CLASS_BASE+24)
+V4L2_CID_EXPOSURE_METERING (V4L2_CID_CAMERA_CLASS_BASE+25)
+V4L2_CID_SCENE_MODE (V4L2_CID_CAMERA_CLASS_BASE+26)
+V4L2_CID_3A_LOCK (V4L2_CID_CAMERA_CLASS_BASE+27)
+V4L2_CID_AUTO_FOCUS_START (V4L2_CID_CAMERA_CLASS_BASE+28)
+V4L2_CID_AUTO_FOCUS_STOP (V4L2_CID_CAMERA_CLASS_BASE+29)
+V4L2_CID_AUTO_FOCUS_STATUS (V4L2_CID_CAMERA_CLASS_BASE+30)
+V4L2_CID_AUTO_FOCUS_RANGE (V4L2_CID_CAMERA_CLASS_BASE+31)
+V4L2_CID_PAN_SPEED (V4L2_CID_CAMERA_CLASS_BASE+32)
+V4L2_CID_TILT_SPEED (V4L2_CID_CAMERA_CLASS_BASE+33)
+/* FM Modulator class control IDs */
+V4L2_CID_RDS_TX_DEVIATION (V4L2_CID_FM_TX_CLASS_BASE + 1)
+V4L2_CID_RDS_TX_PI (V4L2_CID_FM_TX_CLASS_BASE + 2)
+V4L2_CID_RDS_TX_PTY (V4L2_CID_FM_TX_CLASS_BASE + 3)
+V4L2_CID_RDS_TX_PS_NAME (V4L2_CID_FM_TX_CLASS_BASE + 5)
+V4L2_CID_RDS_TX_RADIO_TEXT (V4L2_CID_FM_TX_CLASS_BASE + 6)
+V4L2_CID_RDS_TX_MONO_STEREO (V4L2_CID_FM_TX_CLASS_BASE + 7)
+V4L2_CID_RDS_TX_ARTIFICIAL_HEAD (V4L2_CID_FM_TX_CLASS_BASE + 8)
+V4L2_CID_RDS_TX_COMPRESSED (V4L2_CID_FM_TX_CLASS_BASE + 9)
+V4L2_CID_RDS_TX_DYNAMIC_PTY (V4L2_CID_FM_TX_CLASS_BASE + 10)
+V4L2_CID_RDS_TX_TRAFFIC_ANNOUNCEMENT (V4L2_CID_FM_TX_CLASS_BASE + 11)
+V4L2_CID_RDS_TX_TRAFFIC_PROGRAM (V4L2_CID_FM_TX_CLASS_BASE + 12)
+V4L2_CID_RDS_TX_MUSIC_SPEECH (V4L2_CID_FM_TX_CLASS_BASE + 13)
+V4L2_CID_RDS_TX_ALT_FREQS_ENABLE (V4L2_CID_FM_TX_CLASS_BASE + 14)
+V4L2_CID_RDS_TX_ALT_FREQS (V4L2_CID_FM_TX_CLASS_BASE + 15)
+V4L2_CID_AUDIO_LIMITER_ENABLED (V4L2_CID_FM_TX_CLASS_BASE + 64)
+V4L2_CID_AUDIO_LIMITER_RELEASE_TIME (V4L2_CID_FM_TX_CLASS_BASE + 65)
+V4L2_CID_AUDIO_LIMITER_DEVIATION (V4L2_CID_FM_TX_CLASS_BASE + 66)
+V4L2_CID_AUDIO_COMPRESSION_ENABLED (V4L2_CID_FM_TX_CLASS_BASE + 80)
+V4L2_CID_AUDIO_COMPRESSION_GAIN (V4L2_CID_FM_TX_CLASS_BASE + 81)
+V4L2_CID_AUDIO_COMPRESSION_THRESHOLD (V4L2_CID_FM_TX_CLASS_BASE + 82)
+V4L2_CID_AUDIO_COMPRESSION_ATTACK_TIME (V4L2_CID_FM_TX_CLASS_BASE + 83)
+V4L2_CID_AUDIO_COMPRESSION_RELEASE_TIME (V4L2_CID_FM_TX_CLASS_BASE + 84)
+V4L2_CID_PILOT_TONE_ENABLED (V4L2_CID_FM_TX_CLASS_BASE + 96)
+V4L2_CID_PILOT_TONE_DEVIATION (V4L2_CID_FM_TX_CLASS_BASE + 97)
+V4L2_CID_PILOT_TONE_FREQUENCY (V4L2_CID_FM_TX_CLASS_BASE + 98)
+V4L2_CID_TUNE_PREEMPHASIS (V4L2_CID_FM_TX_CLASS_BASE + 112)
+V4L2_CID_TUNE_POWER_LEVEL (V4L2_CID_FM_TX_CLASS_BASE + 113)
+V4L2_CID_TUNE_ANTENNA_CAPACITOR (V4L2_CID_FM_TX_CLASS_BASE + 114)
+/* Flash and privacy (indicator) light controls */
+V4L2_CID_FLASH_LED_MODE (V4L2_CID_FLASH_CLASS_BASE + 1)
+V4L2_CID_FLASH_STROBE_SOURCE (V4L2_CID_FLASH_CLASS_BASE + 2)
+V4L2_CID_FLASH_STROBE (V4L2_CID_FLASH_CLASS_BASE + 3)
+V4L2_CID_FLASH_STROBE_STOP (V4L2_CID_FLASH_CLASS_BASE + 4)
+V4L2_CID_FLASH_STROBE_STATUS (V4L2_CID_FLASH_CLASS_BASE + 5)
+V4L2_CID_FLASH_TIMEOUT (V4L2_CID_FLASH_CLASS_BASE + 6)
+V4L2_CID_FLASH_INTENSITY (V4L2_CID_FLASH_CLASS_BASE + 7)
+V4L2_CID_FLASH_TORCH_INTENSITY (V4L2_CID_FLASH_CLASS_BASE + 8)
+V4L2_CID_FLASH_INDICATOR_INTENSITY (V4L2_CID_FLASH_CLASS_BASE + 9)
+V4L2_CID_FLASH_FAULT (V4L2_CID_FLASH_CLASS_BASE + 10)
+V4L2_CID_FLASH_CHARGE (V4L2_CID_FLASH_CLASS_BASE + 11)
+V4L2_CID_FLASH_READY (V4L2_CID_FLASH_CLASS_BASE + 12)
+/* Image source controls */
+V4L2_CID_VBLANK (V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 1)
+V4L2_CID_HBLANK (V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 2)
+V4L2_CID_ANALOGUE_GAIN (V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 3)
+V4L2_CID_TEST_PATTERN_RED (V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 4)
+V4L2_CID_TEST_PATTERN_GREENR (V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 5)
+V4L2_CID_TEST_PATTERN_BLUE (V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 6)
+V4L2_CID_TEST_PATTERN_GREENB (V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 7)
+V4L2_CID_UNIT_CELL_SIZE (V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 8)
+/* Image processing controls */
+V4L2_CID_LINK_FREQ (V4L2_CID_IMAGE_PROC_CLASS_BASE + 1)
+V4L2_CID_PIXEL_RATE (V4L2_CID_IMAGE_PROC_CLASS_BASE + 2)
+V4L2_CID_TEST_PATTERN (V4L2_CID_IMAGE_PROC_CLASS_BASE + 3)
+V4L2_CID_DEINTERLACING_MODE (V4L2_CID_IMAGE_PROC_CLASS_BASE + 4)
+V4L2_CID_DIGITAL_GAIN (V4L2_CID_IMAGE_PROC_CLASS_BASE + 5)
+/* DV-class control IDs defined by V4L2 */
+V4L2_CID_DV_TX_RGB_RANGE (V4L2_CID_DV_CLASS_BASE + 5)
+V4L2_CID_DV_TX_IT_CONTENT_TYPE (V4L2_CID_DV_CLASS_BASE + 6)
+V4L2_CID_DV_RX_RGB_RANGE (V4L2_CID_DV_CLASS_BASE + 101)
+V4L2_CID_DV_RX_IT_CONTENT_TYPE (V4L2_CID_DV_CLASS_BASE + 102)
+V4L2_CID_TUNE_DEEMPHASIS (V4L2_CID_FM_RX_CLASS_BASE + 1)
+V4L2_CID_RDS_RECEPTION (V4L2_CID_FM_RX_CLASS_BASE + 2)
+V4L2_CID_RDS_RX_PTY (V4L2_CID_FM_RX_CLASS_BASE + 3)
+V4L2_CID_RDS_RX_PS_NAME (V4L2_CID_FM_RX_CLASS_BASE + 4)
+V4L2_CID_RDS_RX_RADIO_TEXT (V4L2_CID_FM_RX_CLASS_BASE + 5)
+V4L2_CID_RDS_RX_TRAFFIC_ANNOUNCEMENT (V4L2_CID_FM_RX_CLASS_BASE + 6)
+V4L2_CID_RDS_RX_TRAFFIC_PROGRAM (V4L2_CID_FM_RX_CLASS_BASE + 7)
+V4L2_CID_RDS_RX_MUSIC_SPEECH (V4L2_CID_FM_RX_CLASS_BASE + 8)
+V4L2_CID_RF_TUNER_BANDWIDTH_AUTO (V4L2_CID_RF_TUNER_CLASS_BASE + 11)
+V4L2_CID_RF_TUNER_BANDWIDTH (V4L2_CID_RF_TUNER_CLASS_BASE + 12)
+V4L2_CID_RF_TUNER_RF_GAIN (V4L2_CID_RF_TUNER_CLASS_BASE + 32)
+V4L2_CID_RF_TUNER_LNA_GAIN_AUTO (V4L2_CID_RF_TUNER_CLASS_BASE + 41)
+V4L2_CID_RF_TUNER_LNA_GAIN (V4L2_CID_RF_TUNER_CLASS_BASE + 42)
+V4L2_CID_RF_TUNER_MIXER_GAIN_AUTO (V4L2_CID_RF_TUNER_CLASS_BASE + 51)
+V4L2_CID_RF_TUNER_MIXER_GAIN (V4L2_CID_RF_TUNER_CLASS_BASE + 52)
+V4L2_CID_RF_TUNER_IF_GAIN_AUTO (V4L2_CID_RF_TUNER_CLASS_BASE + 61)
+V4L2_CID_RF_TUNER_IF_GAIN (V4L2_CID_RF_TUNER_CLASS_BASE + 62)
+V4L2_CID_RF_TUNER_PLL_LOCK (V4L2_CID_RF_TUNER_CLASS_BASE + 91)
+/* Detection-class control IDs defined by V4L2 */
+V4L2_CID_DETECT_MD_MODE (V4L2_CID_DETECT_CLASS_BASE + 1)
+V4L2_CID_DETECT_MD_GLOBAL_THRESHOLD (V4L2_CID_DETECT_CLASS_BASE + 2)
+V4L2_CID_DETECT_MD_THRESHOLD_GRID (V4L2_CID_DETECT_CLASS_BASE + 3)
+V4L2_CID_DETECT_MD_REGION_GRID (V4L2_CID_DETECT_CLASS_BASE + 4)
diff --git a/src/xlat/v4l2_control_query_flags.in b/src/xlat/v4l2_control_query_flags.in
new file mode 100644
index 000000000..3d32bf5de
--- /dev/null
+++ b/src/xlat/v4l2_control_query_flags.in
@@ -0,0 +1,2 @@
+V4L2_CTRL_FLAG_NEXT_CTRL 0x80000000
+V4L2_CTRL_FLAG_NEXT_COMPOUND 0x40000000
diff --git a/src/xlat/v4l2_control_types.in b/src/xlat/v4l2_control_types.in
new file mode 100644
index 000000000..eb8966d7c
--- /dev/null
+++ b/src/xlat/v4l2_control_types.in
@@ -0,0 +1,19 @@
+#sorted
+#enum
+#include <sys/time.h>
+#include <linux/ioctl.h>
+#include <linux/types.h>
+#include <linux/videodev2.h>
+V4L2_CTRL_TYPE_INTEGER 1
+V4L2_CTRL_TYPE_BOOLEAN 2
+V4L2_CTRL_TYPE_MENU 3
+V4L2_CTRL_TYPE_BUTTON 4
+V4L2_CTRL_TYPE_INTEGER64 5
+V4L2_CTRL_TYPE_CTRL_CLASS 6
+V4L2_CTRL_TYPE_STRING 7
+V4L2_CTRL_TYPE_BITMASK 8
+V4L2_CTRL_TYPE_INTEGER_MENU 9
+V4L2_CTRL_TYPE_U8 0x100
+V4L2_CTRL_TYPE_U16 0x101
+V4L2_CTRL_TYPE_U32 0x102
+V4L2_CTRL_TYPE_AREA 0x106
diff --git a/src/xlat/v4l2_device_capabilities_flags.in b/src/xlat/v4l2_device_capabilities_flags.in
new file mode 100644
index 000000000..fa65c105f
--- /dev/null
+++ b/src/xlat/v4l2_device_capabilities_flags.in
@@ -0,0 +1,29 @@
+V4L2_CAP_VIDEO_CAPTURE 0x00000001
+V4L2_CAP_VIDEO_OUTPUT 0x00000002
+V4L2_CAP_VIDEO_OVERLAY 0x00000004
+V4L2_CAP_VBI_CAPTURE 0x00000010
+V4L2_CAP_VBI_OUTPUT 0x00000020
+V4L2_CAP_SLICED_VBI_CAPTURE 0x00000040
+V4L2_CAP_SLICED_VBI_OUTPUT 0x00000080
+V4L2_CAP_RDS_CAPTURE 0x00000100
+V4L2_CAP_VIDEO_OUTPUT_OVERLAY 0x00000200
+V4L2_CAP_HW_FREQ_SEEK 0x00000400
+V4L2_CAP_RDS_OUTPUT 0x00000800
+V4L2_CAP_VIDEO_CAPTURE_MPLANE 0x00001000
+V4L2_CAP_VIDEO_OUTPUT_MPLANE 0x00002000
+V4L2_CAP_VIDEO_M2M_MPLANE 0x00004000
+V4L2_CAP_VIDEO_M2M 0x00008000
+V4L2_CAP_TUNER 0x00010000
+V4L2_CAP_AUDIO 0x00020000
+V4L2_CAP_RADIO 0x00040000
+V4L2_CAP_MODULATOR 0x00080000
+V4L2_CAP_SDR_CAPTURE 0x00100000
+V4L2_CAP_EXT_PIX_FORMAT 0x00200000
+V4L2_CAP_SDR_OUTPUT 0x00400000
+V4L2_CAP_META_CAPTURE 0x00800000
+V4L2_CAP_READWRITE 0x01000000
+V4L2_CAP_ASYNCIO 0x02000000
+V4L2_CAP_STREAMING 0x04000000
+V4L2_CAP_META_OUTPUT 0x08000000
+V4L2_CAP_TOUCH 0x10000000
+V4L2_CAP_DEVICE_CAPS 0x80000000
diff --git a/src/xlat/v4l2_fields.in b/src/xlat/v4l2_fields.in
new file mode 100644
index 000000000..5a8dcf839
--- /dev/null
+++ b/src/xlat/v4l2_fields.in
@@ -0,0 +1,16 @@
+#value_indexed
+#enum
+#include <sys/time.h>
+#include <linux/ioctl.h>
+#include <linux/types.h>
+#include <linux/videodev2.h>
+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
diff --git a/src/xlat/v4l2_format_description_flags.in b/src/xlat/v4l2_format_description_flags.in
new file mode 100644
index 000000000..e091075f4
--- /dev/null
+++ b/src/xlat/v4l2_format_description_flags.in
@@ -0,0 +1,9 @@
+V4L2_FMT_FLAG_COMPRESSED 0x0001
+V4L2_FMT_FLAG_EMULATED 0x0002
+V4L2_FMT_FLAG_CONTINUOUS_BYTESTREAM 0x0004
+V4L2_FMT_FLAG_DYN_RESOLUTION 0x0008
+V4L2_FMT_FLAG_ENC_CAP_FRAME_INTERVAL 0x0010
+V4L2_FMT_FLAG_CSC_COLORSPACE 0x0020
+V4L2_FMT_FLAG_CSC_XFER_FUNC 0x0040
+V4L2_FMT_FLAG_CSC_YCBCR_ENC 0x0080
+V4L2_FMT_FLAG_CSC_QUANTIZATION 0x0100
diff --git a/src/xlat/v4l2_frameinterval_types.in b/src/xlat/v4l2_frameinterval_types.in
new file mode 100644
index 000000000..8cd22563d
--- /dev/null
+++ b/src/xlat/v4l2_frameinterval_types.in
@@ -0,0 +1,4 @@
+#value_indexed
+V4L2_FRMIVAL_TYPE_DISCRETE 1
+V4L2_FRMIVAL_TYPE_CONTINUOUS 2
+V4L2_FRMIVAL_TYPE_STEPWISE 3
diff --git a/src/xlat/v4l2_framesize_types.in b/src/xlat/v4l2_framesize_types.in
new file mode 100644
index 000000000..49ae6a2d9
--- /dev/null
+++ b/src/xlat/v4l2_framesize_types.in
@@ -0,0 +1,9 @@
+#value_indexed
+#enum
+#include <sys/time.h>
+#include <linux/ioctl.h>
+#include <linux/types.h>
+#include <linux/videodev2.h>
+V4L2_FRMSIZE_TYPE_DISCRETE 1
+V4L2_FRMSIZE_TYPE_CONTINUOUS 2
+V4L2_FRMSIZE_TYPE_STEPWISE 3
diff --git a/src/xlat/v4l2_input_types.in b/src/xlat/v4l2_input_types.in
new file mode 100644
index 000000000..1a8ec1bef
--- /dev/null
+++ b/src/xlat/v4l2_input_types.in
@@ -0,0 +1,4 @@
+#value_indexed
+V4L2_INPUT_TYPE_TUNER 1
+V4L2_INPUT_TYPE_CAMERA 2
+V4L2_INPUT_TYPE_TOUCH 3
diff --git a/src/xlat/v4l2_ioctl_cmds.in b/src/xlat/v4l2_ioctl_cmds.in
new file mode 100644
index 000000000..4d1a0f0ee
--- /dev/null
+++ b/src/xlat/v4l2_ioctl_cmds.in
@@ -0,0 +1,114 @@
+#ifndef STRACE_WORKAROUND_V4L2_TIME64
+# define STRACE_WORKAROUND_V4L2_TIME64
+/* Constants based on struct v4l2_buffer are unreliable as the latter uses struct timeval. */
+# undef VIDIOC_QUERYBUF
+# undef VIDIOC_QBUF
+# undef VIDIOC_DQBUF
+# undef VIDIOC_PREPARE_BUF
+/* Constants based on struct v4l2_event are unreliable as the latter uses struct timespec. */
+# undef VIDIOC_DQEVENT
+#endif
+
+VIDIOC_QUERYCAP _IOR ('V', 0, struct_v4l2_capability)
+VIDIOC_ENUM_FMT _IOWR('V', 2, struct v4l2_fmtdesc)
+VIDIOC_G_FMT _IOWR('V', 4, struct_v4l2_format)
+VIDIOC_S_FMT _IOWR('V', 5, struct_v4l2_format)
+/* VIDIOC_G_MPEGCOMP _IOR ('V', 6, struct v4l2_mpeg_compression) - removed in v2.6.24-rc1~66^2~32 */
+/* VIDIOC_S_MPEGCOMP _IOW ('V', 7, struct v4l2_mpeg_compression) - removed in v2.6.24-rc1~66^2~32 */
+VIDIOC_REQBUFS _IOWR('V', 8, struct v4l2_requestbuffers)
+VIDIOC_QUERYBUF _IOWR('V', 9, kernel_v4l2_buffer_t)
+VIDIOC_G_FBUF _IOR ('V', 10, struct_v4l2_framebuffer)
+VIDIOC_S_FBUF _IOW ('V', 11, struct_v4l2_framebuffer)
+/* VIDIOC_OVERLAY _IOW ('V', 14, int) */
+VIDIOC_QBUF _IOWR('V', 15, kernel_v4l2_buffer_t)
+/* VIDIOC_EXPBUF _IOWR('V', 16, struct v4l2_exportbuffer) - added in v3.8-rc1~115^2^2~34 */
+VIDIOC_DQBUF _IOWR('V', 17, kernel_v4l2_buffer_t)
+VIDIOC_STREAMON _IOW ('V', 18, int)
+VIDIOC_STREAMOFF _IOW ('V', 19, int)
+VIDIOC_G_PARM _IOWR('V', 21, struct v4l2_streamparm)
+VIDIOC_S_PARM _IOWR('V', 22, struct v4l2_streamparm)
+VIDIOC_G_STD _IOR ('V', 23, uint64_t) /* v4l2_std_id */
+VIDIOC_S_STD _IOW ('V', 24, uint64_t) /* v4l2_std_id */
+VIDIOC_ENUMSTD _IOWR('V', 25, struct_v4l2_standard)
+VIDIOC_ENUMINPUT _IOWR('V', 26, struct_v4l2_input)
+VIDIOC_G_CTRL _IOWR('V', 27, struct v4l2_control)
+VIDIOC_S_CTRL _IOWR('V', 28, struct v4l2_control)
+VIDIOC_G_TUNER _IOWR('V', 29, struct v4l2_tuner)
+VIDIOC_S_TUNER _IOW ('V', 30, struct v4l2_tuner)
+/* VIDIOC_G_AUDIO _IOR ('V', 33, struct v4l2_audio) */
+/* VIDIOC_S_AUDIO _IOW ('V', 34, struct v4l2_audio) */
+VIDIOC_QUERYCTRL _IOWR('V', 36, struct v4l2_queryctrl)
+/* VIDIOC_QUERYMENU _IOWR('V', 37, struct_v4l2_querymenu) */
+VIDIOC_G_INPUT _IOR ('V', 38, int)
+VIDIOC_S_INPUT _IOWR('V', 39, int)
+/* VIDIOC_G_EDID _IOWR('V', 40, struct v4l2_edid) - renamed from VIDIOC_SUBDEV_G_EDID in v3.15-rc1~85^2~113 */
+/* VIDIOC_S_EDID _IOWR('V', 41, struct v4l2_edid) - renamed from VIDIOC_SUBDEV_G_EDID in v3.15-rc1~85^2~113 */
+/* VIDIOC_G_OUTPUT _IOR ('V', 46, int) */
+/* VIDIOC_S_OUTPUT _IOWR('V', 47, int) */
+/* VIDIOC_ENUMOUTPUT _IOWR('V', 48, struct_v4l2_output) */
+/* VIDIOC_G_AUDOUT _IOR ('V', 49, struct v4l2_audioout) */
+/* VIDIOC_S_AUDOUT _IOW ('V', 50, struct v4l2_audioout) */
+/* VIDIOC_G_MODULATOR _IOWR('V', 54, struct_v4l2_modulator) */
+/* VIDIOC_S_MODULATOR _IOW ('V', 55, struct_v4l2_modulator) */
+/* VIDIOC_G_FREQUENCY _IOWR('V', 56, struct v4l2_frequency) */
+/* VIDIOC_S_FREQUENCY _IOW ('V', 57, struct v4l2_frequency) */
+VIDIOC_CROPCAP _IOWR('V', 58, struct v4l2_cropcap)
+VIDIOC_G_CROP _IOWR('V', 59, struct v4l2_crop)
+VIDIOC_S_CROP _IOW ('V', 60, struct v4l2_crop)
+/* VIDIOC_G_JPEGCOMP _IOR ('V', 61, struct v4l2_jpegcompression) */
+/* VIDIOC_S_JPEGCOMP _IOW ('V', 62, struct v4l2_jpegcompression) */
+/* VIDIOC_QUERYSTD _IOR ('V', 63, uint64_t) */ /* v4l2_std_id */
+VIDIOC_TRY_FMT _IOWR('V', 64, struct_v4l2_format)
+/* VIDIOC_ENUMAUDIO _IOWR('V', 65, struct v4l2_audio) */
+/* VIDIOC_ENUMAUDOUT _IOWR('V', 66, struct v4l2_audioout) */
+/* VIDIOC_G_PRIORITY _IOR ('V', 67, uint32_t) */ /* enum v4l2_priority */
+/* VIDIOC_S_PRIORITY _IOW ('V', 68, uint32_t) */ /* enum v4l2_priority */
+/* VIDIOC_G_SLICED_VBI_CAP _IOWR('V', 69, struct_v4l2_sliced_vbi_cap) - added in v2.6.16.28-rc1~3732 */
+/* VIDIOC_LOG_STATUS _IO ('V', 70) - added in v2.6.16.28-rc1~2961 */
+VIDIOC_G_EXT_CTRLS _IOWR('V', 71, struct_v4l2_ext_controls) /* added in v2.6.18-rc1~862^2~18 */
+VIDIOC_S_EXT_CTRLS _IOWR('V', 72, struct_v4l2_ext_controls) /* added in v2.6.18-rc1~862^2~18 */
+VIDIOC_TRY_EXT_CTRLS _IOWR('V', 73, struct_v4l2_ext_controls) /* added in v2.6.18-rc1~862^2~18 */
+VIDIOC_ENUM_FRAMESIZES _IOWR('V', 74, struct_v4l2_frmsizeenum) /* added in v2.6.19-rc1~183 */
+VIDIOC_ENUM_FRAMEINTERVALS _IOWR('V', 75, struct_v4l2_frmivalenum) /* added in v2.6.19-rc1~183 */
+/* VIDIOC_G_ENC_INDEX _IOR ('V', 76, struct v4l2_enc_idx) - added in v2.6.21-rc3~150^2~2*/
+/* VIDIOC_ENCODER_CMD _IOWR('V', 77, struct v4l2_encoder_cmd) - added in v2.6.21-rc3~150^2~1 */
+/* VIDIOC_TRY_ENCODER_CMD _IOWR('V', 78, struct v4l2_encoder_cmd) - added in v2.6.21-rc3~150^2~1 */
+/* VIDIOC_DBG_S_REGISTER _IOW ('V', 79, struct v4l2_dbg_register) - added in v2.6.29-rc1~523^2~24 */
+/* VIDIOC_DBG_G_REGISTER _IOWR('V', 80, struct v4l2_dbg_register) - added in v2.6.29-rc1~523^2~24 */
+/* VIDIOC_G_CHIP_IDENT_OLD _IOWR('V', 81, struct v4l2_chip_ident_old) - added in v2.6.22-rc1~1118^2~172, renamed in v2.6.29-rc1~523^2~24, removed in v2.6.30-rc1~621^2~278 */
+/* VIDIOC_DBG_G_CHIP_IDENT _IOWR('V', 81, struct v4l2_dbg_chip_ident) - added in v2.6.29-rc1~523^2~24, removed in v3.11-rc1~17^2~99 */
+/* VIDIOC_S_HW_FREQ_SEEK _IOW ('V', 82, struct v4l2_hw_freq_seek) - added in v2.6.27-rc1~966^2~258 */
+/* VIDIOC_ENUM_DV_PRESETS _IOWR('V', 83, struct v4l2_dv_enum_preset) - added in v2.6.33-rc1~70^2~91, removed in v3.10-rc1~136^2~239 */
+/* VIDIOC_S_DV_PRESET _IOWR('V', 84, struct v4l2_dv_preset) - added in v2.6.33-rc1~70^2~91, removed in v3.10-rc1~136^2~239 */
+/* VIDIOC_G_DV_PRESET _IOWR('V', 85, struct v4l2_dv_preset) - added in v2.6.33-rc1~70^2~91, removed in v3.10-rc1~136^2~239 */
+/* VIDIOC_QUERY_DV_PRESET _IOR('V', 86, struct v4l2_dv_preset) - added in v2.6.33-rc1~70^2~91, removed in v3.10-rc1~136^2~239 */
+/* VIDIOC_S_DV_TIMINGS _IOWR('V', 87, struct v4l2_dv_timings) - added in v2.6.33-rc1~70^2~91 */
+/* VIDIOC_G_DV_TIMINGS _IOWR('V', 88, struct v4l2_dv_timings) - added in v2.6.33-rc1~70^2~91 */
+VIDIOC_DQEVENT _IOR ('V', 89, kernel_v4l2_event_t) /* added in v2.6.35-rc1~480^2~121 */
+/* VIDIOC_SUBSCRIBE_EVENT _IOW ('V', 90, struct v4l2_event_subscription) - added in v2.6.35-rc1~480^2~121 */
+/* VIDIOC_UNSUBSCRIBE_EVENT _IOW ('V', 91, struct v4l2_event_subscription) - added in v2.6.35-rc1~480^2~121 */
+VIDIOC_CREATE_BUFS _IOWR('V', 92, struct_v4l2_create_buffers) /* added in v3.2-rc1~63^2~55 */
+VIDIOC_PREPARE_BUF _IOWR('V', 93, kernel_v4l2_buffer_t) /* added in v3.2-rc1~63^2~55 */
+/* VIDIOC_G_SELECTION _IOWR('V', 94, struct v4l2_selection) - added in v3.3-rc1~48^2~18 */
+/* VIDIOC_S_SELECTION _IOWR('V', 95, struct v4l2_selection) - added in v3.3-rc1~48^2~18 */
+/* VIDIOC_DECODER_CMD _IOWR('V', 96, struct v4l2_decoder_cmd) - added in v3.4-rc1~110^2^2~239 */
+/* VIDIOC_TRY_DECODER_CMD _IOWR('V', 97, struct v4l2_decoder_cmd) - added in v3.4-rc1~110^2^2~239 */
+/* VIDIOC_ENUM_DV_TIMINGS _IOWR('V', 98, struct v4l2_enum_dv_timings) - added in v3.5-rc1~104^2~100, changed in v3.5-rc5~26^2~41 */
+/* VIDIOC_QUERY_DV_TIMINGS _IOR ('V', 99, struct v4l2_dv_timings) - added in v3.5-rc1~104^2~100, changed in v3.5-rc5~26^2~41 */
+/* VIDIOC_DV_TIMINGS_CAP _IOWR('V', 100, struct v4l2_dv_timings_cap) - added in v3.5-rc1~104^2~100, changed in v3.5-rc5~26^2~41 */
+/* VIDIOC_ENUM_FREQ_BANDS _IOWR('V', 101, struct v4l2_frequency_band) - added in v3.6-rc1~28^2~46 */
+/* VIDIOC_DBG_G_CHIP_INFO _IOWR('V', 102, struct v4l2_dbg_chip_info) - added in v3.10-rc1~136^2~200 as VIDIOC_DBG_G_CHIP_NAME, renamed in v3.10-rc1~136^2~42 */
+VIDIOC_QUERY_EXT_CTRL _IOWR('V', 103, struct_v4l2_query_ext_ctrl) /* added in v3.17-rc1~112^2~362 */
+
+/* subdev ioctls */
+/* VIDIOC_SUBDEV_ENUM_MBUS_CODE _IOWR('V', 2, struct v4l2_subdev_mbus_code_enum) */
+/* VIDIOC_SUBDEV_G_FMT _IOWR('V', 4, struct v4l2_subdev_format) */
+/* VIDIOC_SUBDEV_S_FMT _IOWR('V', 5, struct v4l2_subdev_format) */
+/* VIDIOC_SUBDEV_G_FRAME_INTERVAL _IOWR('V', 21, struct v4l2_subdev_frame_interval) - added in v2.6.39-rc1~86^2~163 */
+/* VIDIOC_SUBDEV_S_FRAME_INTERVAL _IOWR('V', 22, struct v4l2_subdev_frame_interval) - added in v2.6.39-rc1~86^2~163 */
+/* VIDIOC_SUBDEV_G_CROP _IOWR('V', 59, struct v4l2_subdev_crop) - added in v2.6.39-rc1~86^2~162 */
+/* VIDIOC_SUBDEV_S_CROP _IOWR('V', 60, struct v4l2_subdev_crop) - added in v2.6.39-rc1~86^2~162 */
+/* VIDIOC_SUBDEV_G_SELECTION _IOWR('V', 61, struct v4l2_subdev_selection) - added in v3.5-rc1~104^2~443 */
+/* VIDIOC_SUBDEV_S_SELECTION _IOWR('V', 62, struct v4l2_subdev_selection) - added in v3.5-rc1~104^2~443 */
+/* VIDIOC_SUBDEV_ENUM_FRAME_SIZE _IOWR('V', 74, struct v4l2_subdev_frame_size_enum) */
+/* VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL _IOWR('V', 75, struct v4l2_subdev_frame_interval_enum) - added in v2.6.39-rc1~86^2~163 */
diff --git a/src/xlat/v4l2_memories.in b/src/xlat/v4l2_memories.in
new file mode 100644
index 000000000..6e9df1909
--- /dev/null
+++ b/src/xlat/v4l2_memories.in
@@ -0,0 +1,10 @@
+#value_indexed
+#enum
+#include <sys/time.h>
+#include <linux/ioctl.h>
+#include <linux/types.h>
+#include <linux/videodev2.h>
+V4L2_MEMORY_MMAP 1
+V4L2_MEMORY_USERPTR 2
+V4L2_MEMORY_OVERLAY 3
+V4L2_MEMORY_DMABUF 4
diff --git a/src/xlat/v4l2_meta_fmts.in b/src/xlat/v4l2_meta_fmts.in
new file mode 100644
index 000000000..61a72d371
--- /dev/null
+++ b/src/xlat/v4l2_meta_fmts.in
@@ -0,0 +1,6 @@
+#sorted sed -rn 's/.*v4l2_fourcc(_be)?\('"'(.)', '(.)', '(.)', '(.)'"'\).*/\10\5\4\3\2\t\0/p' |LC_COLLATE=C sort -k1,1 -t' ' |cut -f2-
+V4L2_META_FMT_VIVID v4l2_fourcc('V', 'I', 'V', 'D') /* Vivid Metadata */
+V4L2_META_FMT_UVC v4l2_fourcc('U', 'V', 'C', 'H') /* UVC Payload Header metadata */
+V4L2_META_FMT_VSP1_HGO v4l2_fourcc('V', 'S', 'P', 'H') /* R-Car VSP1 1-D Histogram */
+V4L2_META_FMT_VSP1_HGT v4l2_fourcc('V', 'S', 'P', 'T') /* R-Car VSP1 2-D Histogram */
+V4L2_META_FMT_D4XX v4l2_fourcc('D', '4', 'X', 'X') /* D4XX Payload Header metadata */
diff --git a/src/xlat/v4l2_pix_fmts.in b/src/xlat/v4l2_pix_fmts.in
new file mode 100644
index 000000000..006564c22
--- /dev/null
+++ b/src/xlat/v4l2_pix_fmts.in
@@ -0,0 +1,199 @@
+#sorted sed -rn 's/.*v4l2_fourcc(_be)?\('"'(.)', '(.)', '(.)', '(.)'"'\).*/\10\5\4\3\2\t\0/p' |LC_COLLATE=C sort -k1,1 -t' ' |cut -f2-
+V4L2_PIX_FMT_Y10 v4l2_fourcc('Y', '1', '0', ' ') /* 10 Greyscale */
+V4L2_PIX_FMT_Y12 v4l2_fourcc('Y', '1', '2', ' ') /* 12 Greyscale */
+V4L2_PIX_FMT_Y4 v4l2_fourcc('Y', '0', '4', ' ') /* 4 Greyscale */
+V4L2_PIX_FMT_Y14 v4l2_fourcc('Y', '1', '4', ' ') /* 14 Greyscale */
+V4L2_PIX_FMT_Y6 v4l2_fourcc('Y', '0', '6', ' ') /* 6 Greyscale */
+V4L2_PIX_FMT_Y16 v4l2_fourcc('Y', '1', '6', ' ') /* 16 Greyscale */
+V4L2_PIX_FMT_Z16 v4l2_fourcc('Z', '1', '6', ' ') /* Depth data 16-bit */
+V4L2_PIX_FMT_UV8 v4l2_fourcc('U', 'V', '8', ' ') /* 8 UV 4:4 */
+V4L2_PIX_FMT_Y8I v4l2_fourcc('Y', '8', 'I', ' ') /* Greyscale 8-bit L/R interleaved */
+V4L2_PIX_FMT_MR97310A v4l2_fourcc('M', '3', '1', '0') /* compressed BGGR bayer */
+V4L2_PIX_FMT_SN9C10X v4l2_fourcc('S', '9', '1', '0') /* SN9C10x compression */
+V4L2_PIX_FMT_SGRBG10 v4l2_fourcc('B', 'A', '1', '0') /* 10 GRGR.. BGBG.. */
+V4L2_PIX_FMT_SGBRG10 v4l2_fourcc('G', 'B', '1', '0') /* 10 GBGB.. RGRG.. */
+V4L2_PIX_FMT_SGRBG10DPCM8 v4l2_fourcc('B', 'D', '1', '0')
+V4L2_PIX_FMT_SBGGR10 v4l2_fourcc('B', 'G', '1', '0') /* 10 BGBG.. GRGR.. */
+V4L2_PIX_FMT_SRGGB10 v4l2_fourcc('R', 'G', '1', '0') /* 10 RGRG.. GBGB.. */
+V4L2_PIX_FMT_M420 v4l2_fourcc('M', '4', '2', '0') /* 12 YUV 4:2:0 2 lines y, 1 line uv interleaved */
+V4L2_PIX_FMT_SN9C20X_I420 v4l2_fourcc('S', '9', '2', '0') /* SN9C20x YUV 4:2:0 */
+V4L2_PIX_FMT_JL2005BCD v4l2_fourcc('J', 'L', '2', '0') /* compressed RGGB bayer */
+V4L2_PIX_FMT_TM6000 v4l2_fourcc('T', 'M', '6', '0') /* tm5600/tm60x0 */
+V4L2_PIX_FMT_STV0680 v4l2_fourcc('S', '6', '8', '0') /* stv0680 bayer */
+V4L2_PIX_FMT_VP8 v4l2_fourcc('V', 'P', '8', '0') /* VP8 */
+V4L2_PIX_FMT_VP9 v4l2_fourcc('V', 'P', '9', '0') /* VP9 */
+V4L2_PIX_FMT_SE401 v4l2_fourcc('S', '4', '0', '1') /* se401 janggu compressed rgb */
+V4L2_PIX_FMT_SPCA501 v4l2_fourcc('S', '5', '0', '1') /* YUYV per line */
+V4L2_PIX_FMT_OV511 v4l2_fourcc('O', '5', '1', '1') /* ov511 JPEG */
+V4L2_PIX_FMT_NV21M v4l2_fourcc('N', 'M', '2', '1') /* 21 Y/CrCb 4:2:0 */
+V4L2_PIX_FMT_YVU420M v4l2_fourcc('Y', 'M', '2', '1') /* 12 YVU420 planar */
+V4L2_PIX_FMT_MT21C v4l2_fourcc('M', 'T', '2', '1') /* Mediatek compressed block mode */
+V4L2_PIX_FMT_NV21 v4l2_fourcc('N', 'V', '2', '1') /* 12 Y/CrCb 4:2:0 */
+V4L2_PIX_FMT_SPCA561 v4l2_fourcc('S', '5', '6', '1') /* compressed GBRG bayer */
+V4L2_PIX_FMT_NV61M v4l2_fourcc('N', 'M', '6', '1') /* 16 Y/CrCb 4:2:2 */
+V4L2_PIX_FMT_YVU422M v4l2_fourcc('Y', 'M', '6', '1') /* 16 YVU422 planar */
+V4L2_PIX_FMT_NV61 v4l2_fourcc('N', 'V', '6', '1') /* 16 Y/CrCb 4:2:2 */
+V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B', 'A', '8', '1') /* 8 BGBG.. GRGR.. */
+V4L2_PIX_FMT_RGB332 v4l2_fourcc('R', 'G', 'B', '1') /* 8 RGB-3-3-2 */
+V4L2_PIX_FMT_H264_NO_SC v4l2_fourcc('A', 'V', 'C', '1') /* H264 without start codes */
+V4L2_PIX_FMT_PWC1 v4l2_fourcc('P', 'W', 'C', '1') /* pwc older webcam */
+V4L2_PIX_FMT_MPEG1 v4l2_fourcc('M', 'P', 'G', '1') /* MPEG-1 ES */
+V4L2_PIX_FMT_SGRBG12 v4l2_fourcc('B', 'A', '1', '2') /* 12 GRGR.. BGBG.. */
+#ifndef STRACE_WORKAROUND_FOR_V4L2_PIX_FMT_BGRA444
+# define STRACE_WORKAROUND_FOR_V4L2_PIX_FMT_BGRA444
+/*
+ * V4L2_PIX_FMT_BGRA444 was introduced in Linux commit v5.2-rc1~33^2~24 with
+ * the value of v4l2_fourcc('B', 'A', '1', '2') and changed in commit
+ * v5.2-rc5-403-g22be8233b34f as it clashed with V4L2_PIX_FMT_SGRBG12.
+ */
+# undef V4L2_PIX_FMT_BGRA444
+#endif
+V4L2_PIX_FMT_BGRA444 v4l2_fourcc('G', 'A', '1', '2') /* 16 bbbbgggg rrrraaaa */
+V4L2_PIX_FMT_RGBA444 v4l2_fourcc('R', 'A', '1', '2') /* 16 rrrrgggg bbbbaaaa */
+V4L2_PIX_FMT_ABGR444 v4l2_fourcc('A', 'B', '1', '2') /* 16 aaaabbbb ggggrrrr */
+V4L2_PIX_FMT_SGBRG12 v4l2_fourcc('G', 'B', '1', '2') /* 12 GBGB.. RGRG.. */
+V4L2_PIX_FMT_XBGR444 v4l2_fourcc('X', 'B', '1', '2') /* 16 xxxxbbbb ggggrrrr */
+V4L2_PIX_FMT_SBGGR12 v4l2_fourcc('B', 'G', '1', '2') /* 12 BGBG.. GRGR.. */
+V4L2_PIX_FMT_SRGGB12 v4l2_fourcc('R', 'G', '1', '2') /* 12 RGRG.. GBGB.. */
+V4L2_PIX_FMT_HM12 v4l2_fourcc('H', 'M', '1', '2') /* 8 YUV 4:2:0 16x16 macroblocks */
+V4L2_PIX_FMT_NV12M v4l2_fourcc('N', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 */
+V4L2_PIX_FMT_NV12MT v4l2_fourcc('T', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 64x32 macroblocks */
+V4L2_PIX_FMT_NV12MT_16X16 v4l2_fourcc('V', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 16x16 macroblocks */
+V4L2_PIX_FMT_YUV420M v4l2_fourcc('Y', 'M', '1', '2') /* 12 YUV420 planar */
+V4L2_PIX_FMT_ARGB444 v4l2_fourcc('A', 'R', '1', '2') /* 16 aaaarrrr ggggbbbb */
+V4L2_PIX_FMT_XRGB444 v4l2_fourcc('X', 'R', '1', '2') /* 16 xxxxrrrr ggggbbbb */
+V4L2_PIX_FMT_SUNXI_TILED_NV12 v4l2_fourcc('S', 'T', '1', '2') /* Sunxi Tiled NV12 Format */
+V4L2_PIX_FMT_YUV420 v4l2_fourcc('Y', 'U', '1', '2') /* 12 YUV 4:2:0 */
+V4L2_PIX_FMT_NV12 v4l2_fourcc('N', 'V', '1', '2') /* 12 Y/CbCr 4:2:0 */
+V4L2_PIX_FMT_YVU420 v4l2_fourcc('Y', 'V', '1', '2') /* 12 YVU 4:2:0 */
+V4L2_PIX_FMT_BGRX444 v4l2_fourcc('B', 'X', '1', '2') /* 16 bbbbgggg rrrrxxxx */
+V4L2_PIX_FMT_RGBX444 v4l2_fourcc('R', 'X', '1', '2') /* 16 rrrrgggg bbbbxxxx */
+V4L2_PIX_FMT_YVU444M v4l2_fourcc('Y', 'M', '4', '2') /* 24 YVU444 planar */
+V4L2_PIX_FMT_NV42 v4l2_fourcc('N', 'V', '4', '2') /* 24 Y/CrCb 4:4:4 */
+V4L2_PIX_FMT_PWC2 v4l2_fourcc('P', 'W', 'C', '2') /* pwc newer webcam */
+V4L2_PIX_FMT_MPEG2 v4l2_fourcc('M', 'P', 'G', '2') /* MPEG-2 ES */
+V4L2_PIX_FMT_SBGGR16 v4l2_fourcc('B', 'Y', 'R', '2') /* 16 BGBG.. GRGR.. */
+V4L2_PIX_FMT_H263 v4l2_fourcc('H', '2', '6', '3') /* H263 */
+V4L2_PIX_FMT_RGB24 v4l2_fourcc('R', 'G', 'B', '3') /* 24 RGB-8-8-8 */
+V4L2_PIX_FMT_BGR24 v4l2_fourcc('B', 'G', 'R', '3') /* 24 BGR-8-8-8 */
+V4L2_PIX_FMT_HSV24 v4l2_fourcc('H', 'S', 'V', '3')
+V4L2_PIX_FMT_SGBRG14 v4l2_fourcc('G', 'B', '1', '4') /* 14 GBGB.. RGRG.. */
+V4L2_PIX_FMT_SBGGR14 v4l2_fourcc('B', 'G', '1', '4') /* 14 BGBG.. GRGR.. */
+V4L2_PIX_FMT_SRGGB14 v4l2_fourcc('R', 'G', '1', '4') /* 14 RGRG.. GBGB.. */
+V4L2_PIX_FMT_SGRBG14 v4l2_fourcc('G', 'R', '1', '4') /* 14 GRGR.. BGBG.. */
+V4L2_PIX_FMT_ARGB32 v4l2_fourcc('B', 'A', '2', '4') /* 32 ARGB-8-8-8-8 */
+V4L2_PIX_FMT_BGRA32 v4l2_fourcc('R', 'A', '2', '4') /* 32 ABGR-8-8-8-8 */
+V4L2_PIX_FMT_RGBA32 v4l2_fourcc('A', 'B', '2', '4') /* 32 RGBA-8-8-8-8 */
+V4L2_PIX_FMT_RGBX32 v4l2_fourcc('X', 'B', '2', '4') /* 32 RGBX-8-8-8-8 */
+V4L2_PIX_FMT_HI240 v4l2_fourcc('H', 'I', '2', '4') /* 8 8-bit color */
+V4L2_PIX_FMT_YUV444M v4l2_fourcc('Y', 'M', '2', '4') /* 24 YUV444 planar */
+V4L2_PIX_FMT_ABGR32 v4l2_fourcc('A', 'R', '2', '4') /* 32 BGRA-8-8-8-8 */
+V4L2_PIX_FMT_XBGR32 v4l2_fourcc('X', 'R', '2', '4') /* 32 BGRX-8-8-8-8 */
+V4L2_PIX_FMT_NV24 v4l2_fourcc('N', 'V', '2', '4') /* 24 Y/CbCr 4:4:4 */
+V4L2_PIX_FMT_XRGB32 v4l2_fourcc('B', 'X', '2', '4') /* 32 XRGB-8-8-8-8 */
+V4L2_PIX_FMT_BGRX32 v4l2_fourcc('R', 'X', '2', '4') /* 32 XBGR-8-8-8-8 */
+V4L2_PIX_FMT_RGB444 v4l2_fourcc('R', '4', '4', '4') /* 16 xxxxrrrr ggggbbbb */
+V4L2_PIX_FMT_YUV444 v4l2_fourcc('Y', '4', '4', '4') /* 16 xxxxyyyy uuuuvvvv */
+V4L2_PIX_FMT_H264 v4l2_fourcc('H', '2', '6', '4') /* H264 with start codes */
+V4L2_PIX_FMT_H264_MVC v4l2_fourcc('M', '2', '6', '4') /* H264 MVC */
+V4L2_PIX_FMT_RGB32 v4l2_fourcc('R', 'G', 'B', '4') /* 32 RGB-8-8-8-8 */
+V4L2_PIX_FMT_CNF4 v4l2_fourcc('C', 'N', 'F', '4') /* Intel 4-bit packed depth confidence information */
+V4L2_PIX_FMT_MPEG4 v4l2_fourcc('M', 'P', 'G', '4') /* MPEG-4 part 2 ES */
+V4L2_PIX_FMT_BGR32 v4l2_fourcc('B', 'G', 'R', '4') /* 32 BGR-8-8-8-8 */
+V4L2_PIX_FMT_HSV32 v4l2_fourcc('H', 'S', 'V', '4')
+V4L2_PIX_FMT_YUV32 v4l2_fourcc('Y', 'U', 'V', '4') /* 32 YUV-8-8-8-8 */
+V4L2_PIX_FMT_SPCA505 v4l2_fourcc('S', '5', '0', '5') /* YYUV per line */
+V4L2_PIX_FMT_BGRA555 v4l2_fourcc('B', 'A', '1', '5') /* 16 BGRA-5-5-5-1 */
+V4L2_PIX_FMT_RGBA555 v4l2_fourcc('R', 'A', '1', '5') /* 16 RGBA-5-5-5-1 */
+V4L2_PIX_FMT_ABGR555 v4l2_fourcc('A', 'B', '1', '5') /* 16 ABGR-1-5-5-5 */
+V4L2_PIX_FMT_XBGR555 v4l2_fourcc('X', 'B', '1', '5') /* 16 XBGR-1-5-5-5 */
+V4L2_PIX_FMT_ARGB555 v4l2_fourcc('A', 'R', '1', '5') /* 16 ARGB-1-5-5-5 */
+V4L2_PIX_FMT_XRGB555 v4l2_fourcc('X', 'R', '1', '5') /* 16 XRGB-1-5-5-5 */
+V4L2_PIX_FMT_BGRX555 v4l2_fourcc('B', 'X', '1', '5') /* 16 BGRX-5-5-5-1 */
+V4L2_PIX_FMT_RGBX555 v4l2_fourcc('R', 'X', '1', '5') /* 16 RGBX-5-5-5-1 */
+V4L2_PIX_FMT_ET61X251 v4l2_fourcc('E', '6', '2', '5') /* ET61X251 compression */
+V4L2_PIX_FMT_SGBRG16 v4l2_fourcc('G', 'B', '1', '6') /* 16 GBGB.. RGRG.. */
+V4L2_PIX_FMT_SRGGB16 v4l2_fourcc('R', 'G', '1', '6') /* 16 RGRG.. GBGB.. */
+V4L2_PIX_FMT_NV16M v4l2_fourcc('N', 'M', '1', '6') /* 16 Y/CbCr 4:2:2 */
+V4L2_PIX_FMT_YUV422M v4l2_fourcc('Y', 'M', '1', '6') /* 16 YUV422 planar */
+V4L2_PIX_FMT_SGRBG16 v4l2_fourcc('G', 'R', '1', '6') /* 16 GRGR.. BGBG.. */
+V4L2_PIX_FMT_NV16 v4l2_fourcc('N', 'V', '1', '6') /* 16 Y/CbCr 4:2:2 */
+V4L2_PIX_FMT_PAC207 v4l2_fourcc('P', '2', '0', '7') /* compressed BGGR bayer */
+V4L2_PIX_FMT_SPCA508 v4l2_fourcc('S', '5', '0', '8') /* YUVY per line */
+V4L2_PIX_FMT_OV518 v4l2_fourcc('O', '5', '1', '8') /* ov518 JPEG */
+V4L2_PIX_FMT_SBGGR10ALAW8 v4l2_fourcc('a', 'B', 'A', '8')
+V4L2_PIX_FMT_SBGGR10DPCM8 v4l2_fourcc('b', 'B', 'A', '8')
+V4L2_PIX_FMT_SGBRG10ALAW8 v4l2_fourcc('a', 'G', 'A', '8')
+V4L2_PIX_FMT_SGBRG10DPCM8 v4l2_fourcc('b', 'G', 'A', '8')
+V4L2_PIX_FMT_SRGGB10ALAW8 v4l2_fourcc('a', 'R', 'A', '8')
+V4L2_PIX_FMT_SRGGB10DPCM8 v4l2_fourcc('b', 'R', 'A', '8')
+V4L2_PIX_FMT_SGRBG10ALAW8 v4l2_fourcc('a', 'g', 'A', '8')
+V4L2_PIX_FMT_PAL8 v4l2_fourcc('P', 'A', 'L', '8') /* 8 8-bit palette */
+V4L2_PIX_FMT_YVU410 v4l2_fourcc('Y', 'V', 'U', '9') /* 9 YVU 4:1:0 */
+V4L2_PIX_FMT_YUV410 v4l2_fourcc('Y', 'U', 'V', '9') /* 9 YUV 4:1:0 */
+V4L2_PIX_FMT_SBGGR10P v4l2_fourcc('p', 'B', 'A', 'A')
+V4L2_PIX_FMT_SGBRG10P v4l2_fourcc('p', 'G', 'A', 'A')
+V4L2_PIX_FMT_SRGGB10P v4l2_fourcc('p', 'R', 'A', 'A')
+V4L2_PIX_FMT_SGRBG10P v4l2_fourcc('p', 'g', 'A', 'A')
+V4L2_PIX_FMT_CPIA1 v4l2_fourcc('C', 'P', 'I', 'A') /* cpia1 YUV */
+V4L2_PIX_FMT_WNVA v4l2_fourcc('W', 'N', 'V', 'A') /* Winnov hw compress */
+V4L2_PIX_FMT_VUYA32 v4l2_fourcc('V', 'U', 'Y', 'A') /* 32 VUYA-8-8-8-8 */
+V4L2_PIX_FMT_Y10BPACK v4l2_fourcc('Y', '1', '0', 'B') /* 10 Greyscale bit-packed */
+V4L2_PIX_FMT_SRGGB8 v4l2_fourcc('R', 'G', 'G', 'B') /* 8 RGRG.. GBGB.. */
+V4L2_PIX_FMT_SQ905C v4l2_fourcc('9', '0', '5', 'C') /* compressed RGGB bayer */
+V4L2_PIX_FMT_SBGGR12P v4l2_fourcc('p', 'B', 'C', 'C')
+V4L2_PIX_FMT_SGBRG12P v4l2_fourcc('p', 'G', 'C', 'C')
+V4L2_PIX_FMT_SRGGB12P v4l2_fourcc('p', 'R', 'C', 'C')
+V4L2_PIX_FMT_SGRBG12P v4l2_fourcc('p', 'g', 'C', 'C')
+V4L2_PIX_FMT_HEVC v4l2_fourcc('H', 'E', 'V', 'C') /* HEVC aka H.265 */
+V4L2_PIX_FMT_XVID v4l2_fourcc('X', 'V', 'I', 'D') /* Xvid */
+V4L2_PIX_FMT_SBGGR14P v4l2_fourcc('p', 'B', 'E', 'E')
+V4L2_PIX_FMT_SGBRG14P v4l2_fourcc('p', 'G', 'E', 'E')
+V4L2_PIX_FMT_SRGGB14P v4l2_fourcc('p', 'R', 'E', 'E')
+V4L2_PIX_FMT_SGRBG14P v4l2_fourcc('p', 'g', 'E', 'E')
+V4L2_PIX_FMT_VC1_ANNEX_G v4l2_fourcc('V', 'C', '1', 'G') /* SMPTE 421M Annex G compliant stream */
+V4L2_PIX_FMT_IPU3_SGRBG10 v4l2_fourcc('i', 'p', '3', 'G') /* IPU3 packed 10-bit GRBG bayer */
+V4L2_PIX_FMT_SGRBG8 v4l2_fourcc('G', 'R', 'B', 'G') /* 8 GRGR.. BGBG.. */
+V4L2_PIX_FMT_JPEG v4l2_fourcc('J', 'P', 'E', 'G') /* JFIF JPEG */
+V4L2_PIX_FMT_MPEG v4l2_fourcc('M', 'P', 'E', 'G') /* MPEG-1/2/4 Multiplexed */
+V4L2_PIX_FMT_MJPEG v4l2_fourcc('M', 'J', 'P', 'G') /* Motion-JPEG */
+V4L2_PIX_FMT_PJPG v4l2_fourcc('P', 'J', 'P', 'G') /* Pixart 73xx JPEG */
+V4L2_PIX_FMT_SGBRG8 v4l2_fourcc('G', 'B', 'R', 'G') /* 8 GBGB.. RGRG.. */
+V4L2_PIX_FMT_BGR666 v4l2_fourcc('B', 'G', 'R', 'H') /* 18 BGR-6-6-6 */
+V4L2_PIX_FMT_FWHT_STATELESS v4l2_fourcc('S', 'F', 'W', 'H') /* Stateless FWHT (vicodec) */
+V4L2_PIX_FMT_Y12I v4l2_fourcc('Y', '1', '2', 'I') /* Greyscale 12-bit L/R interleaved */
+V4L2_PIX_FMT_S5C_UYVY_JPG v4l2_fourcc('S', '5', 'C', 'I') /* S5C73M3 interleaved UYVY/JPEG */
+V4L2_PIX_FMT_KONICA420 v4l2_fourcc('K', 'O', 'N', 'I') /* YUV420 planar in blocks of 256 pixels */
+V4L2_PIX_FMT_INZI v4l2_fourcc('I', 'N', 'Z', 'I') /* Intel Planar Greyscale 10-bit and Depth 16-bit */
+V4L2_PIX_FMT_VC1_ANNEX_L v4l2_fourcc('V', 'C', '1', 'L') /* SMPTE 421M Annex L compliant stream */
+V4L2_PIX_FMT_JPGL v4l2_fourcc('J', 'P', 'G', 'L') /* JPEG-Lite */
+V4L2_PIX_FMT_RGB555 v4l2_fourcc('R', 'G', 'B', 'O') /* 16 RGB-5-5-5 */
+V4L2_PIX_FMT_YUV555 v4l2_fourcc('Y', 'U', 'V', 'O') /* 16 YUV-5-5-5 */
+V4L2_PIX_FMT_Y10P v4l2_fourcc('Y', '1', '0', 'P') /* 10 Greyscale, MIPI RAW10 packed */
+V4L2_PIX_FMT_YUV411P v4l2_fourcc('4', '1', '1', 'P') /* 12 YVU411 planar */
+V4L2_PIX_FMT_Y41P v4l2_fourcc('Y', '4', '1', 'P') /* 12 YUV 4:1:1 */
+V4L2_PIX_FMT_YUV422P v4l2_fourcc('4', '2', '2', 'P') /* 16 YVU422 planar */
+V4L2_PIX_FMT_RGB565 v4l2_fourcc('R', 'G', 'B', 'P') /* 16 RGB-5-6-5 */
+V4L2_PIX_FMT_YUV565 v4l2_fourcc('Y', 'U', 'V', 'P') /* 16 YUV-5-6-5 */
+V4L2_PIX_FMT_RGB555X v4l2_fourcc('R', 'G', 'B', 'Q') /* 16 RGB-5-5-5 BE */
+V4L2_PIX_FMT_RGB565X v4l2_fourcc('R', 'G', 'B', 'R') /* 16 RGB-5-6-5 BE */
+V4L2_PIX_FMT_MPEG2_SLICE v4l2_fourcc('M', 'G', '2', 'S') /* MPEG-2 parsed slice data */
+V4L2_PIX_FMT_FWHT v4l2_fourcc('F', 'W', 'H', 'T') /* Fast Walsh Hadamard Transform (vicodec) */
+V4L2_PIX_FMT_YVYU v4l2_fourcc('Y', 'V', 'Y', 'U') /* 16 YVU 4:2:2 */
+V4L2_PIX_FMT_CIT_YYVYUY v4l2_fourcc('C', 'I', 'T', 'V') /* one line of Y then 1 line of VYUY */
+V4L2_PIX_FMT_AYUV32 v4l2_fourcc('A', 'Y', 'U', 'V') /* 32 AYUV-8-8-8-8 */
+V4L2_PIX_FMT_XYUV32 v4l2_fourcc('X', 'Y', 'U', 'V') /* 32 XYUV-8-8-8-8 */
+V4L2_PIX_FMT_YYUV v4l2_fourcc('Y', 'Y', 'U', 'V') /* 16 YUV 4:2:2 */
+V4L2_PIX_FMT_YUYV v4l2_fourcc('Y', 'U', 'Y', 'V') /* 16 YUV 4:2:2 */
+V4L2_PIX_FMT_SN9C2028 v4l2_fourcc('S', 'O', 'N', 'X') /* compressed GBRG bayer */
+V4L2_PIX_FMT_VUYX32 v4l2_fourcc('V', 'U', 'Y', 'X') /* 32 VUYX-8-8-8-8 */
+V4L2_PIX_FMT_GREY v4l2_fourcc('G', 'R', 'E', 'Y') /* 8 Greyscale */
+V4L2_PIX_FMT_VYUY v4l2_fourcc('V', 'Y', 'U', 'Y') /* 16 YUV 4:2:2 */
+V4L2_PIX_FMT_UYVY v4l2_fourcc('U', 'Y', 'V', 'Y') /* 16 YUV 4:2:2 */
+V4L2_PIX_FMT_IPU3_SBGGR10 v4l2_fourcc('i', 'p', '3', 'b') /* IPU3 packed 10-bit BGGR bayer */
+V4L2_PIX_FMT_DV v4l2_fourcc('d', 'v', 's', 'd') /* 1394 */
+V4L2_PIX_FMT_IPU3_SGBRG10 v4l2_fourcc('i', 'p', '3', 'g') /* IPU3 packed 10-bit GBRG bayer */
+V4L2_PIX_FMT_IPU3_SRGGB10 v4l2_fourcc('i', 'p', '3', 'r') /* IPU3 packed 10-bit RGGB bayer */
+V4L2_PIX_FMT_Y16_BE v4l2_fourcc_be('Y', '1', '6', ' ') /* 16 Greyscale BE */
+V4L2_PIX_FMT_ARGB555X v4l2_fourcc_be('A', 'R', '1', '5') /* 16 ARGB-5-5-5 BE */
+V4L2_PIX_FMT_XRGB555X v4l2_fourcc_be('X', 'R', '1', '5') /* 16 XRGB-5-5-5 BE */
diff --git a/src/xlat/v4l2_sdr_fmts.in b/src/xlat/v4l2_sdr_fmts.in
new file mode 100644
index 000000000..bd5a24822
--- /dev/null
+++ b/src/xlat/v4l2_sdr_fmts.in
@@ -0,0 +1,9 @@
+#sorted sed -rn 's/.*v4l2_fourcc(_be)?\('"'(.)', '(.)', '(.)', '(.)'"'\).*/\10\5\4\3\2\t\0/p' |LC_COLLATE=C sort -k1,1 -t' ' |cut -f2-
+V4L2_SDR_FMT_PCU20BE v4l2_fourcc('P', 'C', '2', '0') /* planar complex u20be */
+V4L2_SDR_FMT_RU12LE v4l2_fourcc('R', 'U', '1', '2') /* real u12le */
+V4L2_SDR_FMT_CS14LE v4l2_fourcc('C', 'S', '1', '4') /* complex s14le */
+V4L2_SDR_FMT_PCU16BE v4l2_fourcc('P', 'C', '1', '6') /* planar complex u16be */
+V4L2_SDR_FMT_CU16LE v4l2_fourcc('C', 'U', '1', '6') /* IQ u16le */
+V4L2_SDR_FMT_CS8 v4l2_fourcc('C', 'S', '0', '8') /* complex s8 */
+V4L2_SDR_FMT_CU8 v4l2_fourcc('C', 'U', '0', '8') /* IQ u8 */
+V4L2_SDR_FMT_PCU18BE v4l2_fourcc('P', 'C', '1', '8') /* planar complex u18be */
diff --git a/src/xlat/v4l2_sliced_flags.in b/src/xlat/v4l2_sliced_flags.in
new file mode 100644
index 000000000..6c509fa18
--- /dev/null
+++ b/src/xlat/v4l2_sliced_flags.in
@@ -0,0 +1,6 @@
+V4L2_SLICED_VBI_625 (V4L2_SLICED_TELETEXT_B | V4L2_SLICED_VPS | V4L2_SLICED_WSS_625)
+V4L2_SLICED_TELETEXT_B 0x0001
+V4L2_SLICED_VPS 0x0400
+V4L2_SLICED_CAPTION_525 0x1000
+V4L2_SLICED_WSS_625 0x4000
+/* V4L2_SLICED_VBI_525 V4L2_SLICED_CAPTION_525 */
diff --git a/src/xlat/v4l2_streaming_capabilities.in b/src/xlat/v4l2_streaming_capabilities.in
new file mode 100644
index 000000000..a9d8508a7
--- /dev/null
+++ b/src/xlat/v4l2_streaming_capabilities.in
@@ -0,0 +1 @@
+V4L2_CAP_TIMEPERFRAME 0x1000
diff --git a/src/xlat/v4l2_tuner_audmodes.in b/src/xlat/v4l2_tuner_audmodes.in
new file mode 100644
index 000000000..cfa308e7e
--- /dev/null
+++ b/src/xlat/v4l2_tuner_audmodes.in
@@ -0,0 +1,7 @@
+#value_indexed
+V4L2_TUNER_MODE_MONO 0x0000
+V4L2_TUNER_MODE_STEREO 0x0001
+V4L2_TUNER_MODE_LANG2 0x0002
+/* V4L2_TUNER_MODE_SAP 0x0002 */
+V4L2_TUNER_MODE_LANG1 0x0003
+V4L2_TUNER_MODE_LANG1_LANG2 0x0004
diff --git a/src/xlat/v4l2_tuner_capabilities.in b/src/xlat/v4l2_tuner_capabilities.in
new file mode 100644
index 000000000..60ed20a09
--- /dev/null
+++ b/src/xlat/v4l2_tuner_capabilities.in
@@ -0,0 +1,14 @@
+V4L2_TUNER_CAP_LOW 0x0001
+V4L2_TUNER_CAP_NORM 0x0002
+V4L2_TUNER_CAP_HWSEEK_BOUNDED 0x0004
+V4L2_TUNER_CAP_HWSEEK_WRAP 0x0008
+V4L2_TUNER_CAP_STEREO 0x0010
+V4L2_TUNER_CAP_LANG2 0x0020
+/* V4L2_TUNER_CAP_SAP 0x0020 */
+V4L2_TUNER_CAP_LANG1 0x0040
+V4L2_TUNER_CAP_RDS 0x0080
+V4L2_TUNER_CAP_RDS_BLOCK_IO 0x0100
+V4L2_TUNER_CAP_RDS_CONTROLS 0x0200
+V4L2_TUNER_CAP_FREQ_BANDS 0x0400
+V4L2_TUNER_CAP_HWSEEK_PROG_LIM 0x0800
+V4L2_TUNER_CAP_1HZ 0x1000
diff --git a/src/xlat/v4l2_tuner_rxsubchanses.in b/src/xlat/v4l2_tuner_rxsubchanses.in
new file mode 100644
index 000000000..578309cae
--- /dev/null
+++ b/src/xlat/v4l2_tuner_rxsubchanses.in
@@ -0,0 +1,6 @@
+V4L2_TUNER_SUB_MONO 0x0001
+V4L2_TUNER_SUB_STEREO 0x0002
+V4L2_TUNER_SUB_LANG2 0x0004
+/* V4L2_TUNER_SUB_SAP 0x0004 */
+V4L2_TUNER_SUB_LANG1 0x0008
+V4L2_TUNER_SUB_RDS 0x0010
diff --git a/src/xlat/v4l2_tuner_types.in b/src/xlat/v4l2_tuner_types.in
new file mode 100644
index 000000000..22e1b2318
--- /dev/null
+++ b/src/xlat/v4l2_tuner_types.in
@@ -0,0 +1,11 @@
+#value_indexed
+#enum
+#include <sys/time.h>
+#include <linux/ioctl.h>
+#include <linux/types.h>
+#include <linux/videodev2.h>
+V4L2_TUNER_RADIO 1
+V4L2_TUNER_ANALOG_TV 2
+V4L2_TUNER_DIGITAL_TV 3
+V4L2_TUNER_SDR 4
+V4L2_TUNER_RF 5
diff --git a/src/xlat/v4l2_vbi_flags.in b/src/xlat/v4l2_vbi_flags.in
new file mode 100644
index 000000000..1bd6ef534
--- /dev/null
+++ b/src/xlat/v4l2_vbi_flags.in
@@ -0,0 +1,2 @@
+V4L2_VBI_UNSYNC (1 << 0)
+V4L2_VBI_INTERLACED (1 << 1)
diff --git a/src/xlat/wait4_options.in b/src/xlat/wait4_options.in
new file mode 100644
index 000000000..df9f085a9
--- /dev/null
+++ b/src/xlat/wait4_options.in
@@ -0,0 +1,12 @@
+WNOHANG
+#ifndef WSTOPPED
+WUNTRACED
+#endif
+WEXITED
+WTRAPPED
+WSTOPPED
+WCONTINUED
+WNOWAIT
+__WCLONE 0x80000000
+__WALL 0x40000000
+__WNOTHREAD 0x20000000
diff --git a/src/xlat/waitid_types.in b/src/xlat/waitid_types.in
new file mode 100644
index 000000000..cec9a7c09
--- /dev/null
+++ b/src/xlat/waitid_types.in
@@ -0,0 +1,8 @@
+#value_indexed
+#enum
+#include <sys/types.h>
+#include <sys/wait.h>
+P_ALL 0
+P_PID 1
+P_PGID 2
+P_PIDFD 3
diff --git a/src/xlat/watchdog_ioctl_cmds.in b/src/xlat/watchdog_ioctl_cmds.in
new file mode 100644
index 000000000..b871cbd1e
--- /dev/null
+++ b/src/xlat/watchdog_ioctl_cmds.in
@@ -0,0 +1,10 @@
+WDIOC_GETSTATUS _IOR('W', 1, int)
+WDIOC_GETBOOTSTATUS _IOR('W', 2, int)
+WDIOC_GETTEMP _IOR('W', 3, int)
+WDIOC_GETTIMEOUT _IOR('W', 7, int)
+WDIOC_GETPRETIMEOUT _IOR('W', 9, int)
+WDIOC_GETTIMELEFT _IOR('W', 10, int)
+WDIOC_SETOPTIONS _IOR('W', 4, int)
+WDIOC_KEEPALIVE _IOR('W', 5, int)
+WDIOC_SETTIMEOUT _IOWR('W', 6, int)
+WDIOC_SETPRETIMEOUT _IOWR('W', 8, int)
diff --git a/src/xlat/whence_codes.in b/src/xlat/whence_codes.in
new file mode 100644
index 000000000..c04d79ab2
--- /dev/null
+++ b/src/xlat/whence_codes.in
@@ -0,0 +1,5 @@
+SEEK_SET
+SEEK_CUR
+SEEK_END
+SEEK_DATA
+SEEK_HOLE
diff --git a/src/xlat/xattrflags.in b/src/xlat/xattrflags.in
new file mode 100644
index 000000000..37488ee50
--- /dev/null
+++ b/src/xlat/xattrflags.in
@@ -0,0 +1,2 @@
+XATTR_CREATE 1
+XATTR_REPLACE 2
diff --git a/src/xlat/xdp_flags.in b/src/xlat/xdp_flags.in
new file mode 100644
index 000000000..b6a1787ce
--- /dev/null
+++ b/src/xlat/xdp_flags.in
@@ -0,0 +1,6 @@
+XDP_FLAGS_MODES 0x0e
+XDP_FLAGS_UPDATE_IF_NOEXIST 0x01
+XDP_FLAGS_SKB_MODE 0x02
+XDP_FLAGS_DRV_MODE 0x04
+XDP_FLAGS_HW_MODE 0x08
+XDP_FLAGS_REPLACE 0x10
diff --git a/src/xlat/xfs_dqblk_flags.in b/src/xlat/xfs_dqblk_flags.in
new file mode 100644
index 000000000..c3277bb1e
--- /dev/null
+++ b/src/xlat/xfs_dqblk_flags.in
@@ -0,0 +1,3 @@
+XFS_USER_QUOTA (1<<0)
+XFS_PROJ_QUOTA (1<<1)
+XFS_GROUP_QUOTA (1<<2)
diff --git a/src/xlat/xfs_quota_flags.in b/src/xlat/xfs_quota_flags.in
new file mode 100644
index 000000000..cf44da513
--- /dev/null
+++ b/src/xlat/xfs_quota_flags.in
@@ -0,0 +1,6 @@
+XFS_QUOTA_UDQ_ACCT (1<<0)
+XFS_QUOTA_UDQ_ENFD (1<<1)
+XFS_QUOTA_GDQ_ACCT (1<<2)
+XFS_QUOTA_GDQ_ENFD (1<<3)
+XFS_QUOTA_PDQ_ACCT (1<<4)
+XFS_QUOTA_PDQ_ENFD (1<<5)
diff --git a/src/xmalloc.c b/src/xmalloc.c
new file mode 100644
index 000000000..cb085cd8f
--- /dev/null
+++ b/src/xmalloc.c
@@ -0,0 +1,148 @@
+/*
+ * Copyright (c) 2015 Dmitry V. Levin <ldv@strace.io>
+ * Copyright (c) 2015-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <stdlib.h>
+#include <string.h>
+
+#include "error_prints.h"
+#include "xmalloc.h"
+
+static void
+die_out_of_memory(void)
+{
+ static int recursed;
+
+ if (recursed)
+ exit(1);
+ recursed = 1;
+
+ error_msg_and_die("Out of memory");
+}
+
+void *
+xmalloc(size_t size)
+{
+ void *p = malloc(size);
+
+ if (!p)
+ die_out_of_memory();
+
+ return p;
+}
+
+void *
+xcalloc(size_t nmemb, size_t size)
+{
+ void *p = calloc(nmemb, size);
+
+ if (!p)
+ die_out_of_memory();
+
+ return p;
+}
+
+#define HALF_SIZE_T (((size_t) 1) << (sizeof(size_t) * 4))
+
+void *
+xallocarray(size_t nmemb, size_t size)
+{
+ size_t bytes = nmemb * size;
+
+ if ((nmemb | size) >= HALF_SIZE_T &&
+ size && bytes / size != nmemb)
+ die_out_of_memory();
+
+ void *p = malloc(bytes);
+
+ if (!p)
+ die_out_of_memory();
+
+ return p;
+}
+
+void *
+xreallocarray(void *ptr, size_t nmemb, size_t size)
+{
+ size_t bytes = nmemb * size;
+
+ if ((nmemb | size) >= HALF_SIZE_T &&
+ size && bytes / size != nmemb)
+ die_out_of_memory();
+
+ void *p = realloc(ptr, bytes);
+
+ if (!p)
+ die_out_of_memory();
+
+ return p;
+}
+
+void *
+xgrowarray(void *const ptr, size_t *const nmemb, const size_t memb_size)
+{
+ /* this is the same value as glibc DEFAULT_MXFAST */
+ enum { DEFAULT_ALLOC_SIZE = 64 * SIZEOF_LONG / 4 };
+
+ size_t grow_memb;
+
+ if (ptr == NULL)
+ grow_memb = *nmemb ? 0 :
+ (DEFAULT_ALLOC_SIZE + memb_size - 1) / memb_size;
+ else
+ grow_memb = (*nmemb >> 1) + 1;
+
+ if ((*nmemb + grow_memb) < *nmemb)
+ die_out_of_memory();
+
+ *nmemb += grow_memb;
+
+ return xreallocarray(ptr, *nmemb, memb_size);
+}
+
+char *
+xstrdup(const char *str)
+{
+ if (!str)
+ return NULL;
+
+ char *p = strdup(str);
+
+ if (!p)
+ die_out_of_memory();
+
+ return p;
+}
+
+char *
+xstrndup(const char *str, size_t n)
+{
+ char *p;
+
+ if (!str)
+ return NULL;
+
+#ifdef HAVE_STRNDUP
+ p = strndup(str, n);
+#else
+ p = xmalloc(n + 1);
+#endif
+
+ if (!p)
+ die_out_of_memory();
+
+#ifndef HAVE_STRNDUP
+ strncpy(p, str, n);
+ p[n] = '\0';
+#endif
+
+ return p;
+}
diff --git a/src/xmalloc.h b/src/xmalloc.h
new file mode 100644
index 000000000..4bf1e2ce9
--- /dev/null
+++ b/src/xmalloc.h
@@ -0,0 +1,80 @@
+/*
+ * This file contains wrapper functions working with memory allocations,
+ * they just terminate the program in case of memory allocation failure.
+ * These functions can be used by various binaries included in the strace
+ * package.
+ *
+ * Copyright (c) 2001-2019 The strace developers.
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_XMALLOC_H
+# define STRACE_XMALLOC_H
+
+# include <stddef.h>
+# include "gcc_compat.h"
+
+# define xcalloc strace_calloc
+# define xmalloc strace_malloc
+
+/** Allocate memory, die if the allocation has failed. */
+void *xmalloc(size_t size) ATTRIBUTE_MALLOC ATTRIBUTE_ALLOC_SIZE((1));
+
+/**
+ * Allocate an array and zero it out (similar to calloc), die if the allocation
+ * has failed or if the product of nmemb and size is too big.
+ */
+void *xcalloc(size_t nmemb, size_t size)
+ ATTRIBUTE_MALLOC ATTRIBUTE_ALLOC_SIZE((1, 2));
+
+/** Wrapper for xcalloc(1, size) with xmalloc-like interface. */
+ATTRIBUTE_MALLOC ATTRIBUTE_ALLOC_SIZE((1))
+static inline void *
+xzalloc(size_t size)
+{
+ return xcalloc(1, size);
+}
+
+/**
+ * Allocate an array, but do not zero it out, die if the allocation
+ * has failed or if the product of nmemb and size is too big.
+ */
+void *xallocarray(size_t nmemb, size_t size)
+ ATTRIBUTE_MALLOC ATTRIBUTE_ALLOC_SIZE((1, 2));
+
+/**
+ * Reallocate memory for the array, die if the allocation has failed or
+ * if the product of nmemb and size is too big.
+ */
+void *xreallocarray(void *ptr, size_t nmemb, size_t size)
+ ATTRIBUTE_ALLOC_SIZE((2, 3));
+
+/**
+ * Utility function for the simplification of managing various dynamic arrays.
+ * Knows better how to resize arrays. Dies if there's no enough memory.
+ *
+ * @param[in] ptr Pointer to the array to be resized. If ptr is NULL,
+ * new array is allocated.
+ * @param[in, out] nmemb Pointer to the current member count. If ptr is
+ * NULL, it specifies number of members in the newly
+ * created array. If ptr is NULL and nmemb is 0,
+ * number of members in the new array is decided by
+ * the function. Member count is updated by the
+ * function to the new value.
+ * @param[in] memb_size Size of array member in bytes.
+ * @return Pointer to the (re)allocated array.
+ */
+void *xgrowarray(void *ptr, size_t *nmemb, size_t memb_size);
+
+/*
+ * Note that the following two functions return NULL when NULL is specified
+ * and not when allocation is failed, since, as the "x" prefix implies,
+ * the allocation failure leads to program termination, so we may re-purpose
+ * this return value and simplify the idiom "str ? xstrdup(str) : NULL".
+ */
+char *xstrdup(const char *str) ATTRIBUTE_MALLOC;
+char *xstrndup(const char *str, size_t n) ATTRIBUTE_MALLOC;
+
+#endif /* !STRACE_XMALLOC_H */
diff --git a/src/xstring.h b/src/xstring.h
new file mode 100644
index 000000000..affaf791d
--- /dev/null
+++ b/src/xstring.h
@@ -0,0 +1,113 @@
+/*
+ * Copyright (c) 2018 Eugene Syromyatnikov <evgsyr@gmail.com>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_XSTRING_H
+# define STRACE_XSTRING_H
+
+# include <stdarg.h>
+# include <stdio.h>
+
+# include "error_prints.h"
+# include "gcc_compat.h"
+
+/**
+ * Print to static buffer and die on (really unexpected) errors and overflows.
+ * Shouldn't be used directly; please refer to helper macros xsnprintf and
+ * xsprint instead.
+ *
+ * @param str String buffer to print into.
+ * @param size Size of the string buffer in bytes.
+ * @param func Function name from which this function is called.
+ * @param argstr Stringified arguments (including format argument).
+ * @param format Format string.
+ * @param ... Format arguments.
+ * @return Number of characters printed, excluding terminating null byte
+ * (the same as s(n)printf).
+ */
+static inline int ATTRIBUTE_FORMAT((printf, 5, 6))
+xsnprintf_(char *str, size_t size, const char *func, const char *argstr,
+ const char *format, ...)
+{
+ int ret;
+ va_list ap;
+
+ va_start(ap, format);
+ ret = vsnprintf(str, size, format, ap);
+ va_end(ap);
+
+ if (ret < 0 || (unsigned int) ret >= size)
+ error_msg_and_die("%s: got unexpected return value %d for "
+ "snprintf(buf, %zu, %s)",
+ func, ret, size, argstr);
+
+ return ret;
+}
+
+/**
+ * snprintf that dies on (really unexpected) errors and overflows.
+ *
+ * @param str_ String buffer to print into.
+ * @param size_ Size of the string buffer in bytes.
+ * @param fmt_ Format string.
+ * @param ... Format arguments.
+ */
+# define xsnprintf(str_, size_, fmt_, ...) \
+ xsnprintf_((str_), (size_), __func__, #fmt_ ", " #__VA_ARGS__, \
+ (fmt_), __VA_ARGS__)
+
+/**
+ * Print to a character array buffer and die on (really unexpected) errors and
+ * overflows. Buffer size is obtained with sizeof().
+ *
+ * @param str_ Character array buffer to print into.
+ * @param fmt_ Format string.
+ * @param ... Format arguments.
+ */
+# define xsprintf(str_, fmt_, ...) \
+ xsnprintf((str_), sizeof(str_) + MUST_BE_ARRAY(str_), (fmt_), \
+ __VA_ARGS__)
+
+static inline size_t
+get_pos_diff_(char *str, size_t size, char *pos, const char *func,
+ const char *call)
+{
+ if ((str + size) < str)
+ error_msg_and_die("%s: string size overflow (%p+%zu) in %s",
+ func, str, size, call);
+
+ if (pos > (str + size))
+ error_msg_and_die("%s: got position (%p) beyond string "
+ "(%p+%zu) in %s",
+ func, pos, str, size, call);
+
+ if (pos < str)
+ error_msg_and_die("%s: got position %p before string %p in %s",
+ func, pos, str, call);
+
+ return pos - str;
+}
+
+/**
+ * Helper function for constructing string in a character array by appending
+ * new formatted parts. Returns new position. Fails on error or buffer
+ * overflow, in line with the rest of x* functions. Obtains buffer size via
+ * sizeof(str_).
+ *
+ * @param str_ Character array buffer to print into.
+ * @param pos_ Current position.
+ * @param fmt_ Format string.
+ * @param ... Format arguments.
+ * @return New position.
+ */
+# define xappendstr(str_, pos_, fmt_, ...) \
+ (xsnprintf((pos_), sizeof(str_) + MUST_BE_ARRAY(str_) - \
+ get_pos_diff_((str_), sizeof(str_), (pos_), __func__, \
+ "xappendstr(" #str_ ", " #pos_ ", " #fmt_ ", " \
+ #__VA_ARGS__ ")"), \
+ (fmt_), ##__VA_ARGS__) + (pos_))
+
+#endif /* !STRACE_XSTRING_H */