File indexing completed on 2025-01-18 10:13:23
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058
0059
0060
0061
0062
0063
0064
0065
0066
0067
0068
0069
0070
0071
0072
0073 #ifndef __VKI_LINUX_H
0074 #define __VKI_LINUX_H
0075
0076
0077
0078
0079
0080 #if defined(VGA_x86)
0081 # include "vki-posixtypes-x86-linux.h"
0082 #elif defined(VGA_amd64)
0083 # include "vki-posixtypes-amd64-linux.h"
0084 #elif defined(VGA_ppc32)
0085 # include "vki-posixtypes-ppc32-linux.h"
0086 #elif defined(VGA_ppc64be) || defined(VGA_ppc64le)
0087 # include "vki-posixtypes-ppc64-linux.h"
0088 #elif defined(VGA_arm)
0089 # include "vki-posixtypes-arm-linux.h"
0090 #elif defined(VGA_arm64)
0091 # include "vki-posixtypes-arm64-linux.h"
0092 #elif defined(VGA_s390x)
0093 # include "vki-posixtypes-s390x-linux.h"
0094 #elif defined(VGA_mips32)
0095 # include "vki-posixtypes-mips32-linux.h"
0096 #elif defined(VGA_mips64)
0097 # include "vki-posixtypes-mips64-linux.h"
0098 #elif defined(VGA_nanomips)
0099 # include "vki-posixtypes-nanomips-linux.h"
0100 #else
0101 # error Unknown platform
0102 #endif
0103
0104
0105
0106
0107
0108
0109
0110
0111
0112
0113
0114 #ifdef __cplusplus
0115 template <bool b> struct vki_static_assert { int m_bitfield:(2*b-1); };
0116 #define VKI_STATIC_ASSERT(expr) \
0117 (sizeof(vki_static_assert<(expr)>) - sizeof(int))
0118 #else
0119 #define VKI_STATIC_ASSERT(expr) (sizeof(struct { int:-!(expr); }))
0120 #endif
0121
0122
0123
0124
0125
0126
0127 #define _VKI_IOC_TYPECHECK(t) \
0128 (VKI_STATIC_ASSERT((sizeof(t) == sizeof(t[1]) \
0129 && sizeof(t) < (1 << _VKI_IOC_SIZEBITS))) \
0130 + sizeof(t))
0131
0132
0133
0134
0135
0136 # define __user
0137
0138
0139
0140
0141
0142 #ifdef __GNUC__
0143 #define __vki_packed __attribute__((packed))
0144 #endif
0145
0146
0147
0148
0149
0150 #undef __VKI_NFDBITS
0151 #define __VKI_NFDBITS (8 * sizeof(unsigned long))
0152
0153 #undef __VKI_FD_SETSIZE
0154 #define __VKI_FD_SETSIZE 1024
0155
0156 #undef __VKI_FDSET_LONGS
0157 #define __VKI_FDSET_LONGS (__VKI_FD_SETSIZE/__VKI_NFDBITS)
0158
0159 #undef __VKI_FDELT
0160 #define __VKI_FDELT(d) ((d) / __VKI_NFDBITS)
0161
0162 #undef __VKI_FDMASK
0163 #define __VKI_FDMASK(d) (1UL << ((d) % __VKI_NFDBITS))
0164
0165 typedef struct {
0166 unsigned long fds_bits [__VKI_FDSET_LONGS];
0167 } __vki_kernel_fd_set;
0168
0169 typedef int __vki_kernel_key_t;
0170 typedef int __vki_kernel_mqd_t;
0171
0172
0173
0174
0175
0176 typedef __vki_kernel_fd_set vki_fd_set;
0177 typedef __vki_kernel_mode_t vki_mode_t;
0178 typedef __vki_kernel_off_t vki_off_t;
0179 typedef __vki_kernel_pid_t vki_pid_t;
0180 typedef __vki_kernel_key_t vki_key_t;
0181 typedef __vki_kernel_suseconds_t vki_suseconds_t;
0182 typedef __vki_kernel_timer_t vki_timer_t;
0183 typedef __vki_kernel_clockid_t vki_clockid_t;
0184 typedef __vki_kernel_mqd_t vki_mqd_t;
0185
0186
0187 typedef __vki_kernel_uid32_t vki_uid_t;
0188 typedef __vki_kernel_gid32_t vki_gid_t;
0189
0190 typedef __vki_kernel_old_uid_t vki_old_uid_t;
0191 typedef __vki_kernel_old_gid_t vki_old_gid_t;
0192
0193 typedef __vki_kernel_loff_t vki_loff_t;
0194
0195 typedef __vki_kernel_size_t vki_size_t;
0196 typedef __vki_kernel_time_t vki_time_t;
0197 typedef __vki_kernel_clock_t vki_clock_t;
0198 typedef __vki_kernel_caddr_t vki_caddr_t;
0199
0200 typedef unsigned long vki_u_long;
0201
0202 typedef unsigned int vki_uint;
0203
0204
0205
0206
0207
0208 #if defined(VGA_x86)
0209 # include "vki-x86-linux.h"
0210 #elif defined(VGA_amd64)
0211 # include "vki-amd64-linux.h"
0212 #elif defined(VGA_ppc32)
0213 # include "vki-ppc32-linux.h"
0214 #elif defined(VGA_ppc64be) || defined(VGA_ppc64le)
0215 # include "vki-ppc64-linux.h"
0216 #elif defined(VGA_arm)
0217 # include "vki-arm-linux.h"
0218 #elif defined(VGA_arm64)
0219 # include "vki-arm64-linux.h"
0220 #elif defined(VGA_s390x)
0221 # include "vki-s390x-linux.h"
0222 #elif defined(VGA_mips32)
0223 # include "vki-mips32-linux.h"
0224 #elif defined(VGA_mips64)
0225 # include "vki-mips64-linux.h"
0226 #elif defined(VGA_nanomips)
0227 # include "vki-nanomips-linux.h"
0228 #else
0229 # error Unknown platform
0230 #endif
0231
0232
0233
0234
0235
0236 typedef __vki_s32 vki_int32_t;
0237 typedef __vki_s16 vki_int16_t;
0238 typedef __vki_s64 vki_int64_t;
0239
0240 typedef __vki_u8 vki_uint8_t;
0241 typedef __vki_u16 vki_uint16_t;
0242 typedef __vki_u32 vki_uint32_t;
0243 typedef __vki_u64 vki_uint64_t;
0244
0245 typedef __vki_u16 __vki_le16;
0246
0247 #define __vki_aligned_u64 __vki_u64 __attribute__((aligned(8)))
0248
0249
0250
0251
0252
0253 #define VKI_PATH_MAX 4096
0254
0255
0256
0257
0258
0259 struct vki_sysinfo {
0260 long uptime;
0261 unsigned long loads[3];
0262 unsigned long totalram;
0263 unsigned long freeram;
0264 unsigned long sharedram;
0265 unsigned long bufferram;
0266 unsigned long totalswap;
0267 unsigned long freeswap;
0268 unsigned short procs;
0269 unsigned short pad;
0270 unsigned long totalhigh;
0271 unsigned long freehigh;
0272 unsigned int mem_unit;
0273 char _f[20-2*sizeof(long)-sizeof(int)];
0274 };
0275
0276
0277
0278
0279
0280 #define VKI_CLOCK_REALTIME 0
0281 #define VKI_CLOCK_MONOTONIC 1
0282 #define VKI_CLOCK_PROCESS_CPUTIME_ID 2
0283 #define VKI_CLOCK_THREAD_CPUTIME_ID 3
0284
0285 struct vki_timespec {
0286 vki_time_t tv_sec;
0287 long tv_nsec;
0288 };
0289
0290
0291 #define VKI_UTIME_NOW ((1l << 30) - 1l)
0292 #define VKI_UTIME_OMIT ((1l << 30) - 2l)
0293
0294 struct vki_timeval {
0295 vki_time_t tv_sec;
0296 vki_suseconds_t tv_usec;
0297 };
0298
0299 struct vki_timezone {
0300 int tz_minuteswest;
0301 int tz_dsttime;
0302 };
0303
0304 struct vki_itimerspec {
0305 struct vki_timespec it_interval;
0306 struct vki_timespec it_value;
0307 };
0308
0309 struct vki_itimerval {
0310 struct vki_timeval it_interval;
0311 struct vki_timeval it_value;
0312 };
0313
0314
0315
0316
0317
0318 struct vki_timex {
0319 unsigned int modes;
0320 long offset;
0321 long freq;
0322 long maxerror;
0323 long esterror;
0324 int status;
0325 long constant;
0326 long precision;
0327 long tolerance;
0328
0329
0330 struct vki_timeval time;
0331 long tick;
0332
0333 long ppsfreq;
0334 long jitter;
0335 int shift;
0336 long stabil;
0337 long jitcnt;
0338 long calcnt;
0339 long errcnt;
0340 long stbcnt;
0341
0342 int :32; int :32; int :32; int :32;
0343 int :32; int :32; int :32; int :32;
0344 int :32; int :32; int :32; int :32;
0345 };
0346
0347 #define VKI_ADJ_OFFSET 0x0001
0348 #define VKI_ADJ_FREQUENCY 0x0002
0349 #define VKI_ADJ_MAXERROR 0x0004
0350 #define VKI_ADJ_ESTERROR 0x0008
0351 #define VKI_ADJ_STATUS 0x0010
0352 #define VKI_ADJ_TIMECONST 0x0020
0353 #define VKI_ADJ_TAI 0x0080
0354 #define VKI_ADJ_TICK 0x4000
0355 #define VKI_ADJ_ADJTIME 0x8000
0356
0357 #define VKI_ADJ_OFFSET_READONLY 0x2000
0358
0359
0360
0361
0362
0363 struct vki_tms {
0364 vki_clock_t tms_utime;
0365 vki_clock_t tms_stime;
0366 vki_clock_t tms_cutime;
0367 vki_clock_t tms_cstime;
0368 };
0369
0370
0371
0372
0373
0374 struct vki_utimbuf {
0375 vki_time_t actime;
0376 vki_time_t modtime;
0377 };
0378
0379
0380
0381
0382
0383 #define VKI_CSIGNAL 0x000000ff
0384 #define VKI_CLONE_VM 0x00000100
0385 #define VKI_CLONE_FS 0x00000200
0386 #define VKI_CLONE_FILES 0x00000400
0387 #define VKI_CLONE_SIGHAND 0x00000800
0388 #define VKI_CLONE_PIDFD 0x00001000
0389 #define VKI_CLONE_PTRACE 0x00002000
0390 #define VKI_CLONE_VFORK 0x00004000
0391 #define VKI_CLONE_PARENT 0x00008000
0392 #define VKI_CLONE_THREAD 0x00010000
0393 #define VKI_CLONE_NEWNS 0x00020000
0394 #define VKI_CLONE_SYSVSEM 0x00040000
0395 #define VKI_CLONE_SETTLS 0x00080000
0396 #define VKI_CLONE_PARENT_SETTID 0x00100000
0397 #define VKI_CLONE_CHILD_CLEARTID 0x00200000
0398 #define VKI_CLONE_DETACHED 0x00400000
0399 #define VKI_CLONE_UNTRACED 0x00800000
0400 #define VKI_CLONE_CHILD_SETTID 0x01000000
0401 #define VKI_CLONE_NEWCGROUP 0x02000000
0402 #define VKI_CLONE_NEWUTS 0x04000000
0403 #define VKI_CLONE_NEWIPC 0x08000000
0404 #define VKI_CLONE_NEWUSER 0x10000000
0405 #define VKI_CLONE_NEWPID 0x20000000
0406 #define VKI_CLONE_NEWNET 0x40000000
0407 #define VKI_CLONE_IO 0x80000000
0408
0409 struct vki_sched_param {
0410 int sched_priority;
0411 };
0412
0413 struct vki_sched_attr {
0414 vki_uint32_t size;
0415 vki_uint32_t sched_policy;
0416 vki_uint64_t sched_flags;
0417
0418
0419 vki_int32_t sched_nice;
0420
0421
0422 vki_uint32_t sched_priority;
0423
0424
0425 vki_uint64_t sched_runtime;
0426 vki_uint64_t sched_deadline;
0427 vki_uint64_t sched_period;
0428 };
0429
0430 #define VKI_TASK_COMM_LEN 16
0431
0432
0433
0434
0435
0436
0437 #ifndef HAVE_ARCH_SIGINFO_T
0438 typedef union vki_sigval {
0439 int sival_int;
0440 void __user *sival_ptr;
0441 } vki_sigval_t;
0442
0443 #ifndef __VKI_ARCH_SI_PREAMBLE_SIZE
0444 #define __VKI_ARCH_SI_PREAMBLE_SIZE (3 * sizeof(int))
0445 #endif
0446
0447 #define VKI_SI_MAX_SIZE 128
0448
0449 #ifndef VKI_SI_PAD_SIZE
0450 #define VKI_SI_PAD_SIZE ((VKI_SI_MAX_SIZE - __VKI_ARCH_SI_PREAMBLE_SIZE) / sizeof(int))
0451 #endif
0452
0453 #ifndef __VKI_ARCH_SI_UID_T
0454 #define __VKI_ARCH_SI_UID_T vki_uid_t
0455 #endif
0456
0457 #ifndef __VKI_ARCH_SI_BAND_T
0458 #define __VKI_ARCH_SI_BAND_T long
0459 #endif
0460
0461 #ifndef __VKI_ARCH_SI_CLOCK_T
0462 #define __VKI_ARCH_SI_CLOCK_T vki_clock_t
0463 #endif
0464
0465 #ifndef __VKI_ARCH_SI_ATTRIBUTES
0466 #define __VKI_ARCH_SI_ATTRIBUTES
0467 #endif
0468
0469
0470
0471 typedef struct vki_siginfo {
0472 int si_signo;
0473 int si_errno;
0474 int si_code;
0475
0476 union {
0477 int _pad[VKI_SI_PAD_SIZE];
0478
0479
0480 struct {
0481 vki_pid_t _pid;
0482 __VKI_ARCH_SI_UID_T _uid;
0483 } _kill;
0484
0485
0486 struct {
0487 vki_timer_t _tid;
0488 int _overrun;
0489 char _pad[sizeof( __VKI_ARCH_SI_UID_T) - sizeof(int)];
0490 vki_sigval_t _sigval;
0491 int _sys_private;
0492 } _timer;
0493
0494
0495 struct {
0496 vki_pid_t _pid;
0497 __VKI_ARCH_SI_UID_T _uid;
0498 vki_sigval_t _sigval;
0499 } _rt;
0500
0501
0502 struct {
0503 vki_pid_t _pid;
0504 __VKI_ARCH_SI_UID_T _uid;
0505 int _status;
0506 __VKI_ARCH_SI_CLOCK_T _utime;
0507 __VKI_ARCH_SI_CLOCK_T _stime;
0508 } _sigchld;
0509
0510
0511 struct {
0512 void __user *_addr;
0513 #ifdef __ARCH_SI_TRAPNO
0514 int _trapno;
0515 #endif
0516 } _sigfault;
0517
0518
0519 struct {
0520 __VKI_ARCH_SI_BAND_T _band;
0521 int _fd;
0522 } _sigpoll;
0523 } _sifields;
0524 } __VKI_ARCH_SI_ATTRIBUTES vki_siginfo_t;
0525 #endif
0526
0527 #define __VKI_SI_FAULT 0
0528
0529
0530
0531
0532
0533 #define VKI_SI_USER 0
0534 #define VKI_SI_TKILL -6
0535
0536
0537
0538
0539 #define VKI_ILL_ILLOPC (__VKI_SI_FAULT|1)
0540 #define VKI_ILL_ILLOPN (__VKI_SI_FAULT|2)
0541 #define VKI_ILL_ILLADR (__VKI_SI_FAULT|3)
0542 #define VKI_ILL_ILLTRP (__VKI_SI_FAULT|4)
0543 #define VKI_ILL_PRVOPC (__VKI_SI_FAULT|5)
0544 #define VKI_ILL_PRVREG (__VKI_SI_FAULT|6)
0545 #define VKI_ILL_COPROC (__VKI_SI_FAULT|7)
0546 #define VKI_ILL_BADSTK (__VKI_SI_FAULT|8)
0547
0548
0549
0550
0551 #define VKI_FPE_INTDIV (__VKI_SI_FAULT|1)
0552 #define VKI_FPE_INTOVF (__VKI_SI_FAULT|2)
0553 #define VKI_FPE_FLTDIV (__VKI_SI_FAULT|3)
0554 #define VKI_FPE_FLTOVF (__VKI_SI_FAULT|4)
0555 #define VKI_FPE_FLTUND (__VKI_SI_FAULT|5)
0556 #define VKI_FPE_FLTRES (__VKI_SI_FAULT|6)
0557 #define VKI_FPE_FLTINV (__VKI_SI_FAULT|7)
0558 #define VKI_FPE_FLTSUB (__VKI_SI_FAULT|8)
0559
0560
0561
0562
0563 #define VKI_SEGV_MAPERR (__VKI_SI_FAULT|1)
0564 #define VKI_SEGV_ACCERR (__VKI_SI_FAULT|2)
0565
0566
0567
0568
0569 #define VKI_BUS_ADRALN (__VKI_SI_FAULT|1)
0570 #define VKI_BUS_ADRERR (__VKI_SI_FAULT|2)
0571 #define VKI_BUS_OBJERR (__VKI_SI_FAULT|3)
0572
0573
0574
0575
0576 #define VKI_TRAP_BRKPT (__VKI_SI_FAULT|1)
0577 #define VKI_TRAP_TRACE (__VKI_SI_FAULT|2)
0578
0579
0580
0581
0582 #define VKI_CLD_EXITED (__VKI_SI_FAULT|1)
0583 #define VKI_CLD_KILLED (__VKI_SI_FAULT|2)
0584 #define VKI_CLD_DUMPED (__VKI_SI_FAULT|3)
0585 #define VKI_CLD_TRAPPED (__VKI_SI_FAULT|4)
0586 #define VKI_CLD_STOPPED (__VKI_SI_FAULT|5)
0587 #define VKI_CLD_CONTINUED (__VKI_SI_FAULT|6)
0588
0589
0590
0591
0592
0593 #ifndef VKI___ARCH_SIGEV_PREAMBLE_SIZE
0594 #define VKI___ARCH_SIGEV_PREAMBLE_SIZE (sizeof(int) * 2 + sizeof(vki_sigval_t))
0595 #endif
0596
0597 #define VKI_SIGEV_MAX_SIZE 64
0598 #define VKI_SIGEV_PAD_SIZE ((VKI_SIGEV_MAX_SIZE - VKI___ARCH_SIGEV_PREAMBLE_SIZE) \
0599 / sizeof(int))
0600
0601
0602 #define VKI_SIGEV_THREAD_ID 4
0603
0604 typedef struct vki_sigevent {
0605 vki_sigval_t sigev_value;
0606 int sigev_signo;
0607 int sigev_notify;
0608 union {
0609 int _pad[VKI_SIGEV_PAD_SIZE];
0610 int _tid;
0611
0612 struct {
0613 void (*_function)(vki_sigval_t);
0614 void *_attribute;
0615 } _sigev_thread;
0616 } _sigev_un;
0617 } vki_sigevent_t;
0618
0619 #define vki_sigev_notify_thread_id _sigev_un._tid
0620
0621
0622
0623
0624
0625
0626
0627 #define VKI_SEEK_SET 0
0628 #define VKI_SEEK_CUR 1
0629 #define VKI_SEEK_END 2
0630
0631
0632
0633
0634
0635 #define VKI_SYS_SOCKET 1
0636 #define VKI_SYS_BIND 2
0637 #define VKI_SYS_CONNECT 3
0638 #define VKI_SYS_LISTEN 4
0639 #define VKI_SYS_ACCEPT 5
0640 #define VKI_SYS_GETSOCKNAME 6
0641 #define VKI_SYS_GETPEERNAME 7
0642 #define VKI_SYS_SOCKETPAIR 8
0643 #define VKI_SYS_SEND 9
0644 #define VKI_SYS_RECV 10
0645 #define VKI_SYS_SENDTO 11
0646 #define VKI_SYS_RECVFROM 12
0647 #define VKI_SYS_SHUTDOWN 13
0648 #define VKI_SYS_SETSOCKOPT 14
0649 #define VKI_SYS_GETSOCKOPT 15
0650 #define VKI_SYS_SENDMSG 16
0651 #define VKI_SYS_RECVMSG 17
0652 #define VKI_SYS_ACCEPT4 18
0653 #define VKI_SYS_RECVMMSG 19
0654 #define VKI_SYS_SENDMMSG 20
0655
0656 #ifndef ARCH_HAS_SOCKET_TYPES
0657 enum vki_sock_type {
0658 VKI_SOCK_STREAM = 1,
0659
0660 };
0661 #endif
0662
0663
0664
0665
0666
0667 struct vki_iovec
0668 {
0669 void __user *iov_base;
0670 __vki_kernel_size_t iov_len;
0671 };
0672
0673
0674
0675
0676
0677
0678
0679 #define __KINLINE static __inline__
0680
0681 typedef unsigned short vki_sa_family_t;
0682
0683 struct vki_sockaddr {
0684 vki_sa_family_t sa_family;
0685 char sa_data[14];
0686 };
0687
0688 struct vki_msghdr {
0689 void * msg_name;
0690 int msg_namelen;
0691 struct vki_iovec * msg_iov;
0692 __vki_kernel_size_t msg_iovlen;
0693 void * msg_control;
0694 __vki_kernel_size_t msg_controllen;
0695 unsigned msg_flags;
0696 };
0697
0698 struct vki_mmsghdr {
0699 struct vki_msghdr msg_hdr;
0700 unsigned msg_len;
0701 };
0702
0703 struct vki_cmsghdr {
0704 __vki_kernel_size_t cmsg_len;
0705 int cmsg_level;
0706 int cmsg_type;
0707 };
0708
0709 #define __VKI_CMSG_NXTHDR(ctl, len, cmsg) __vki_cmsg_nxthdr((ctl),(len),(cmsg))
0710 #define VKI_CMSG_NXTHDR(mhdr, cmsg) vki_cmsg_nxthdr((mhdr), (cmsg))
0711
0712 #define VKI_CMSG_ALIGN(len) ( ((len)+sizeof(long)-1) & ~(sizeof(long)-1) )
0713
0714 #define VKI_CMSG_DATA(cmsg) ((void *)((char *)(cmsg) + VKI_CMSG_ALIGN(sizeof(struct vki_cmsghdr))))
0715
0716 #define __VKI_CMSG_FIRSTHDR(ctl,len) ((len) >= sizeof(struct vki_cmsghdr) ? \
0717 (struct vki_cmsghdr *)(ctl) : \
0718 (struct vki_cmsghdr *)NULL)
0719 #define VKI_CMSG_FIRSTHDR(msg) __VKI_CMSG_FIRSTHDR((msg)->msg_control, (msg)->msg_controllen)
0720
0721
0722 __KINLINE struct vki_cmsghdr * __vki_cmsg_nxthdr(void *__ctl, __vki_kernel_size_t __size,
0723 struct vki_cmsghdr *__cmsg)
0724 {
0725 struct vki_cmsghdr * __ptr;
0726
0727 __ptr = ASSUME_ALIGNED(struct vki_cmsghdr *,
0728 ((unsigned char *) __cmsg) + VKI_CMSG_ALIGN(__cmsg->cmsg_len));
0729 if ((unsigned long)((char*)(__ptr+1) - (char *) __ctl) > __size)
0730 return (struct vki_cmsghdr *)0;
0731
0732 return __ptr;
0733 }
0734
0735 __KINLINE struct vki_cmsghdr * vki_cmsg_nxthdr (struct vki_msghdr *__msg, struct vki_cmsghdr *__cmsg)
0736 {
0737 return __vki_cmsg_nxthdr(__msg->msg_control, __msg->msg_controllen, __cmsg);
0738 }
0739
0740 #define VKI_SCM_RIGHTS 0x01
0741
0742 #define VKI_AF_UNSPEC 0
0743 #define VKI_AF_UNIX 1
0744 #define VKI_AF_INET 2
0745 #define VKI_AF_INET6 10
0746 #define VKI_AF_NETLINK 16
0747 #define VKI_AF_BLUETOOTH 31
0748
0749 #define VKI_MSG_NOSIGNAL 0x4000
0750
0751 #define VKI_SOL_SCTP 132
0752
0753
0754
0755
0756
0757 struct vki_in_addr {
0758 __vki_u32 s_addr;
0759 };
0760
0761
0762 #define __VKI_SOCK_SIZE__ 16
0763 struct vki_sockaddr_in {
0764 vki_sa_family_t sin_family;
0765 unsigned short int sin_port;
0766 struct vki_in_addr sin_addr;
0767
0768
0769 unsigned char __pad[__VKI_SOCK_SIZE__ - sizeof(short int) -
0770 sizeof(unsigned short int) - sizeof(struct vki_in_addr)];
0771 };
0772
0773 #define VKI_IPPROTO_TCP 6
0774
0775
0776
0777
0778
0779 struct vki_in6_addr
0780 {
0781 union
0782 {
0783 __vki_u8 u6_addr8[16];
0784 __vki_u16 u6_addr16[8];
0785 __vki_u32 u6_addr32[4];
0786 } vki_in6_u;
0787 #define vki_s6_addr vki_in6_u.u6_addr8
0788 #define vki_s6_addr16 vki_in6_u.u6_addr16
0789 #define vki_s6_addr32 vki_in6_u.u6_addr32
0790 };
0791
0792 struct vki_sockaddr_in6 {
0793 unsigned short int sin6_family;
0794 __vki_u16 sin6_port;
0795 __vki_u32 sin6_flowinfo;
0796 struct vki_in6_addr sin6_addr;
0797 __vki_u32 sin6_scope_id;
0798 };
0799
0800
0801
0802
0803
0804 #define VKI_TCP_NODELAY 1
0805
0806
0807
0808
0809
0810
0811 #define VKI_UNIX_PATH_MAX 108
0812
0813 struct vki_sockaddr_un {
0814 vki_sa_family_t sun_family;
0815 char sun_path[VKI_UNIX_PATH_MAX];
0816 };
0817
0818
0819
0820
0821
0822 struct vki_sockaddr_nl {
0823 vki_sa_family_t nl_family;
0824 unsigned short nl_pad;
0825 __vki_u32 nl_pid;
0826 __vki_u32 nl_groups;
0827 };
0828
0829
0830
0831
0832
0833 #define VKI_IFNAMSIZ 16
0834
0835 struct vki_ifmap
0836 {
0837 unsigned long mem_start;
0838 unsigned long mem_end;
0839 unsigned short base_addr;
0840 unsigned char irq;
0841 unsigned char dma;
0842 unsigned char port;
0843
0844 };
0845
0846 struct vki_if_settings
0847 {
0848 unsigned int type;
0849 unsigned int size;
0850 union {
0851
0852
0853
0854 void __user *raw_hdlc;
0855 void __user *cisco;
0856 void __user *fr;
0857 void __user *fr_pvc;
0858 void __user *fr_pvc_info;
0859
0860
0861 void __user *sync;
0862 void __user *te1;
0863 } ifs_ifsu;
0864 };
0865
0866 struct vki_ifreq
0867 {
0868 #define VKI_IFHWADDRLEN 6
0869 union
0870 {
0871 char ifrn_name[VKI_IFNAMSIZ];
0872 } ifr_ifrn;
0873
0874 union {
0875 struct vki_sockaddr ifru_addr;
0876 struct vki_sockaddr ifru_dstaddr;
0877 struct vki_sockaddr ifru_broadaddr;
0878 struct vki_sockaddr ifru_netmask;
0879 struct vki_sockaddr ifru_hwaddr;
0880 short ifru_flags;
0881 int ifru_ivalue;
0882 int ifru_mtu;
0883 struct vki_ifmap ifru_map;
0884 char ifru_slave[VKI_IFNAMSIZ];
0885 char ifru_newname[VKI_IFNAMSIZ];
0886 void __user * ifru_data;
0887 struct vki_if_settings ifru_settings;
0888 } ifr_ifru;
0889 };
0890
0891 #define vki_ifr_name ifr_ifrn.ifrn_name
0892 #define vki_ifr_hwaddr ifr_ifru.ifru_hwaddr
0893 #define vki_ifr_addr ifr_ifru.ifru_addr
0894 #define vki_ifr_dstaddr ifr_ifru.ifru_dstaddr
0895 #define vki_ifr_broadaddr ifr_ifru.ifru_broadaddr
0896 #define vki_ifr_netmask ifr_ifru.ifru_netmask
0897 #define vki_ifr_flags ifr_ifru.ifru_flags
0898 #define vki_ifr_metric ifr_ifru.ifru_ivalue
0899 #define vki_ifr_mtu ifr_ifru.ifru_mtu
0900 #define vki_ifr_map ifr_ifru.ifru_map
0901 #define vki_ifr_slave ifr_ifru.ifru_slave
0902 #define vki_ifr_data ifr_ifru.ifru_data
0903 #define vki_ifr_ifindex ifr_ifru.ifru_ivalue
0904 #define vki_ifr_bandwidth ifr_ifru.ifru_ivalue
0905 #define vki_ifr_qlen ifr_ifru.ifru_ivalue
0906 #define vki_ifr_newname ifr_ifru.ifru_newname
0907 #define vki_ifr_settings ifr_ifru.ifru_settings
0908
0909 struct vki_ifconf
0910 {
0911 int ifc_len;
0912 union
0913 {
0914 char __user *ifcu_buf;
0915 struct vki_ifreq __user *ifcu_req;
0916 } ifc_ifcu;
0917 };
0918 #define vki_ifc_buf ifc_ifcu.ifcu_buf
0919
0920
0921
0922
0923
0924 struct vki_arpreq {
0925 struct vki_sockaddr arp_pa;
0926 struct vki_sockaddr arp_ha;
0927 int arp_flags;
0928 struct vki_sockaddr arp_netmask;
0929 char arp_dev[16];
0930 };
0931
0932
0933
0934
0935
0936 struct vki_rtentry
0937 {
0938 unsigned long rt_pad1;
0939 struct vki_sockaddr rt_dst;
0940 struct vki_sockaddr rt_gateway;
0941 struct vki_sockaddr rt_genmask;
0942 unsigned short rt_flags;
0943 short rt_pad2;
0944 unsigned long rt_pad3;
0945 void *rt_pad4;
0946 short rt_metric;
0947 char __user *rt_dev;
0948 unsigned long rt_mtu;
0949
0950
0951
0952
0953 unsigned long rt_window;
0954 unsigned short rt_irtt;
0955 };
0956
0957
0958
0959
0960
0961 typedef __vki_s32 vki_sctp_assoc_t;
0962
0963 enum vki_sctp_optname {
0964 VKI_SCTP_RTOINFO,
0965 #define VKI_SCTP_RTOINFO VKI_SCTP_RTOINFO
0966 VKI_SCTP_ASSOCINFO,
0967 #define VKI_SCTP_ASSOCINFO VKI_SCTP_ASSOCINFO
0968 VKI_SCTP_INITMSG,
0969 #define VKI_SCTP_INITMSG VKI_SCTP_INITMSG
0970 VKI_SCTP_NODELAY,
0971 #define VKI_SCTP_NODELAY VKI_SCTP_NODELAY
0972 VKI_SCTP_AUTOCLOSE,
0973 #define VKI_SCTP_AUTOCLOSE VKI_SCTP_AUTOCLOSE
0974 VKI_SCTP_SET_PEER_PRIMARY_ADDR,
0975 #define VKI_SCTP_SET_PEER_PRIMARY_ADDR VKI_SCTP_SET_PEER_PRIMARY_ADDR
0976 VKI_SCTP_PRIMARY_ADDR,
0977 #define VKI_SCTP_PRIMARY_ADDR VKI_SCTP_PRIMARY_ADDR
0978 VKI_SCTP_ADAPTION_LAYER,
0979 #define VKI_SCTP_ADAPTION_LAYER VKI_SCTP_ADAPTION_LAYER
0980 VKI_SCTP_DISABLE_FRAGMENTS,
0981 #define VKI_SCTP_DISABLE_FRAGMENTS VKI_SCTP_DISABLE_FRAGMENTS
0982 VKI_SCTP_PEER_ADDR_PARAMS,
0983 #define VKI_SCTP_PEER_ADDR_PARAMS VKI_SCTP_PEER_ADDR_PARAMS
0984 VKI_SCTP_DEFAULT_SEND_PARAM,
0985 #define VKI_SCTP_DEFAULT_SEND_PARAM VKI_SCTP_DEFAULT_SEND_PARAM
0986 VKI_SCTP_EVENTS,
0987 #define VKI_SCTP_EVENTS VKI_SCTP_EVENTS
0988 VKI_SCTP_I_WANT_MAPPED_V4_ADDR,
0989 #define VKI_SCTP_I_WANT_MAPPED_V4_ADDR VKI_SCTP_I_WANT_MAPPED_V4_ADDR
0990 VKI_SCTP_MAXSEG,
0991 #define VKI_SCTP_MAXSEG VKI_SCTP_MAXSEG
0992 VKI_SCTP_STATUS,
0993 #define VKI_SCTP_STATUS VKI_SCTP_STATUS
0994 VKI_SCTP_GET_PEER_ADDR_INFO,
0995 #define VKI_SCTP_GET_PEER_ADDR_INFO VKI_SCTP_GET_PEER_ADDR_INFO
0996
0997
0998
0999
1000 VKI_SCTP_SOCKOPT_BINDX_ADD = 100,
1001 #define VKI_SCTP_SOCKOPT_BINDX_ADD VKI_SCTP_SOCKOPT_BINDX_ADD
1002 VKI_SCTP_SOCKOPT_BINDX_REM,
1003 #define VKI_SCTP_SOCKOPT_BINDX_REM VKI_SCTP_SOCKOPT_BINDX_REM
1004 VKI_SCTP_SOCKOPT_PEELOFF,
1005 #define VKI_SCTP_SOCKOPT_PEELOFF VKI_SCTP_SOCKOPT_PEELOFF
1006 VKI_SCTP_GET_PEER_ADDRS_NUM,
1007 #define VKI_SCTP_GET_PEER_ADDRS_NUM VKI_SCTP_GET_PEER_ADDRS_NUM
1008 VKI_SCTP_GET_PEER_ADDRS,
1009 #define VKI_SCTP_GET_PEER_ADDRS VKI_SCTP_GET_PEER_ADDRS
1010 VKI_SCTP_GET_LOCAL_ADDRS_NUM,
1011 #define VKI_SCTP_GET_LOCAL_ADDRS_NUM VKI_SCTP_GET_LOCAL_ADDRS_NUM
1012 VKI_SCTP_GET_LOCAL_ADDRS,
1013 #define VKI_SCTP_GET_LOCAL_ADDRS VKI_SCTP_GET_LOCAL_ADDRS
1014 VKI_SCTP_SOCKOPT_CONNECTX,
1015 #define VKI_SCTP_SOCKOPT_CONNECTX VKI_SCTP_SOCKOPT_CONNECTX
1016 };
1017
1018 struct vki_sctp_getaddrs {
1019 vki_sctp_assoc_t assoc_id;
1020 int addr_num;
1021 struct vki_sockaddr *addrs;
1022 };
1023
1024
1025
1026
1027
1028 #define VKI_RUSAGE_SELF 0
1029 #define VKI_RUSAGE_CHILDREN (-1)
1030 #define VKI_RUSAGE_BOTH (-2)
1031 #define VKI_RUSAGE_THREAD 1
1032
1033 struct vki_rusage {
1034 struct vki_timeval ru_utime;
1035 struct vki_timeval ru_stime;
1036 long ru_maxrss;
1037 long ru_ixrss;
1038 long ru_idrss;
1039 long ru_isrss;
1040 long ru_minflt;
1041 long ru_majflt;
1042 long ru_nswap;
1043 long ru_inblock;
1044 long ru_oublock;
1045 long ru_msgsnd;
1046 long ru_msgrcv;
1047 long ru_nsignals;
1048 long ru_nvcsw;
1049 long ru_nivcsw;
1050 };
1051
1052 struct vki_rlimit {
1053 unsigned long rlim_cur;
1054 unsigned long rlim_max;
1055 };
1056
1057 struct vki_rlimit64 {
1058 __vki_u64 rlim_cur;
1059 __vki_u64 rlim_max;
1060 };
1061
1062
1063
1064
1065
1066 struct vki_elf_siginfo
1067 {
1068 int si_signo;
1069 int si_code;
1070 int si_errno;
1071 };
1072
1073
1074 struct vki_elf_prstatus
1075 {
1076 struct vki_elf_siginfo pr_info;
1077 short pr_cursig;
1078 unsigned long pr_sigpend;
1079 unsigned long pr_sighold;
1080 vki_pid_t pr_pid;
1081 vki_pid_t pr_ppid;
1082 vki_pid_t pr_pgrp;
1083 vki_pid_t pr_sid;
1084 struct vki_timeval pr_utime;
1085 struct vki_timeval pr_stime;
1086 struct vki_timeval pr_cutime;
1087 struct vki_timeval pr_cstime;
1088 vki_elf_gregset_t pr_reg;
1089 int pr_fpvalid;
1090 };
1091
1092 #define VKI_ELF_PRARGSZ (80)
1093
1094 struct vki_elf_prpsinfo
1095 {
1096 char pr_state;
1097 char pr_sname;
1098 char pr_zomb;
1099 char pr_nice;
1100 unsigned long pr_flag;
1101 __vki_kernel_uid_t pr_uid;
1102 __vki_kernel_gid_t pr_gid;
1103 vki_pid_t pr_pid, pr_ppid, pr_pgrp, pr_sid;
1104
1105 char pr_fname[16];
1106 char pr_psargs[VKI_ELF_PRARGSZ];
1107 };
1108
1109
1110
1111
1112
1113
1114 #define VKI_EPOLL_CTL_ADD 1
1115 #define VKI_EPOLL_CTL_DEL 2
1116 #define VKI_EPOLL_CTL_MOD 3
1117
1118 #ifdef __x86_64__
1119 #define VKI_EPOLL_PACKED __attribute__((packed))
1120 #else
1121 #define VKI_EPOLL_PACKED
1122 #endif
1123
1124 struct vki_epoll_event {
1125 __vki_u32 events;
1126 __vki_u64 data;
1127 } VKI_EPOLL_PACKED;
1128
1129
1130
1131
1132
1133
1134 struct vki_mq_attr {
1135 long mq_flags;
1136 long mq_maxmsg;
1137 long mq_msgsize;
1138 long mq_curmsgs;
1139 long __reserved[4];
1140 };
1141
1142
1143
1144
1145
1146 struct vki_new_utsname {
1147 char sysname[65];
1148 char nodename[65];
1149 char release[65];
1150 char version[65];
1151 char machine[65];
1152 char domainname[65];
1153 };
1154
1155
1156
1157
1158
1159
1160 struct vki_mii_ioctl_data {
1161 vki_u16 phy_id;
1162 vki_u16 reg_num;
1163 vki_u16 val_in;
1164 vki_u16 val_out;
1165 };
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179 typedef struct __vki_user_cap_header_struct {
1180 __vki_u32 version;
1181 int pid;
1182 } __user *vki_cap_user_header_t;
1183
1184 typedef struct __vki_user_cap_data_struct {
1185 __vki_u32 effective;
1186 __vki_u32 permitted;
1187 __vki_u32 inheritable;
1188 } __user *vki_cap_user_data_t;
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203 struct vki_ipc_perm
1204 {
1205 __vki_kernel_key_t key;
1206 __vki_kernel_uid_t uid;
1207 __vki_kernel_gid_t gid;
1208 __vki_kernel_uid_t cuid;
1209 __vki_kernel_gid_t cgid;
1210 __vki_kernel_mode_t mode;
1211 unsigned short seq;
1212 };
1213
1214 #define VKI_IPC_CREAT 00001000
1215 #define VKI_IPC_EXCL 00002000
1216 #define VKI_IPC_NOWAIT 00004000
1217
1218
1219 #define VKI_IPC_SET 1
1220 #define VKI_IPC_STAT 2
1221 #define VKI_IPC_INFO 3
1222
1223 #define VKI_IPC_64 0x0100
1224
1225
1226 # define VKI_SHM_HUGETLB 04000
1227
1228
1229
1230
1231
1232
1233 #define VKI_GETALL 13
1234 #define VKI_SETVAL 16
1235 #define VKI_SETALL 17
1236
1237 #define VKI_SEM_STAT 18
1238 #define VKI_SEM_INFO 19
1239
1240
1241 struct vki_semid_ds {
1242 struct vki_ipc_perm sem_perm;
1243 __vki_kernel_time_t sem_otime;
1244 __vki_kernel_time_t sem_ctime;
1245
1246 void*sem_base;
1247 void*sem_pending;
1248 void**sem_pending_last;
1249 void*undo;
1250 unsigned short sem_nsems;
1251 };
1252
1253 struct vki_sembuf {
1254 unsigned short sem_num;
1255 short sem_op;
1256 short sem_flg;
1257 };
1258
1259 union vki_semun {
1260 int val;
1261 struct vki_semid_ds __user *buf;
1262 struct vki_semid64_ds __user *buf64;
1263 unsigned short __user *array;
1264 struct vki_seminfo __user *__buf;
1265 void __user *__pad;
1266 };
1267
1268 struct vki_seminfo {
1269 int semmap;
1270 int semmni;
1271 int semmns;
1272 int semmnu;
1273 int semmsl;
1274 int semopm;
1275 int semume;
1276 int semusz;
1277 int semvmx;
1278 int semaem;
1279 };
1280
1281
1282
1283
1284
1285 #define VKI_EPERM 1
1286 #define VKI_ENOENT 2
1287 #define VKI_ESRCH 3
1288 #define VKI_EINTR 4
1289 #define VKI_EIO 5
1290 #define VKI_ENXIO 6
1291 #define VKI_E2BIG 7
1292 #define VKI_ENOEXEC 8
1293 #define VKI_EBADF 9
1294 #define VKI_ECHILD 10
1295 #define VKI_EAGAIN 11
1296 #define VKI_ENOMEM 12
1297 #define VKI_EACCES 13
1298 #define VKI_EFAULT 14
1299 #define VKI_ENOTBLK 15
1300 #define VKI_EBUSY 16
1301 #define VKI_EEXIST 17
1302 #define VKI_EXDEV 18
1303 #define VKI_ENODEV 19
1304 #define VKI_ENOTDIR 20
1305 #define VKI_EISDIR 21
1306 #define VKI_EINVAL 22
1307 #define VKI_ENFILE 23
1308 #define VKI_EMFILE 24
1309 #define VKI_ENOTTY 25
1310 #define VKI_ETXTBSY 26
1311 #define VKI_EFBIG 27
1312 #define VKI_ENOSPC 28
1313 #define VKI_ESPIPE 29
1314 #define VKI_EROFS 30
1315 #define VKI_EMLINK 31
1316 #define VKI_EPIPE 32
1317 #define VKI_EDOM 33
1318 #define VKI_ERANGE 34
1319
1320
1321
1322
1323
1324 #define VKI_EWOULDBLOCK VKI_EAGAIN
1325
1326 #define VKI_ELOOP 40
1327
1328
1329
1330
1331
1332 #define VKI_WNOHANG 0x00000001
1333
1334 #define __VKI_WALL 0x40000000
1335 #define __VKI_WCLONE 0x80000000
1336
1337
1338
1339
1340
1341 #define VKI_MREMAP_MAYMOVE 1
1342 #define VKI_MREMAP_FIXED 2
1343
1344
1345
1346
1347
1348 #define VKI_FUTEX_WAIT (0)
1349 #define VKI_FUTEX_WAKE (1)
1350 #define VKI_FUTEX_FD (2)
1351 #define VKI_FUTEX_REQUEUE (3)
1352 #define VKI_FUTEX_CMP_REQUEUE (4)
1353 #define VKI_FUTEX_WAKE_OP (5)
1354 #define VKI_FUTEX_LOCK_PI (6)
1355 #define VKI_FUTEX_UNLOCK_PI (7)
1356 #define VKI_FUTEX_TRYLOCK_PI (8)
1357 #define VKI_FUTEX_WAIT_BITSET (9)
1358 #define VKI_FUTEX_WAKE_BITSET (10)
1359 #define VKI_FUTEX_WAIT_REQUEUE_PI (11)
1360 #define VKI_FUTEX_CMP_REQUEUE_PI (12)
1361 #define VKI_FUTEX_PRIVATE_FLAG (128)
1362 #define VKI_FUTEX_CLOCK_REALTIME (256)
1363
1364 struct vki_robust_list {
1365 struct vki_robust_list __user *next;
1366 };
1367
1368 struct vki_robust_list_head {
1369
1370
1371
1372 struct vki_robust_list list;
1373
1374
1375
1376
1377
1378
1379
1380 long futex_offset;
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392 struct vki_robust_list __user *list_op_pending;
1393 };
1394
1395
1396
1397
1398
1399 #define VKI_ERESTARTSYS 512
1400
1401
1402
1403
1404
1405 #define VKI_S_IFMT 00170000
1406 #define VKI_S_IFSOCK 0140000
1407 #define VKI_S_IFLNK 0120000
1408 #define VKI_S_IFREG 0100000
1409 #define VKI_S_IFBLK 0060000
1410 #define VKI_S_IFDIR 0040000
1411 #define VKI_S_IFCHR 0020000
1412 #define VKI_S_IFIFO 0010000
1413 #define VKI_S_ISUID 0004000
1414 #define VKI_S_ISGID 0002000
1415 #define VKI_S_ISVTX 0001000
1416
1417 #define VKI_S_ISLNK(m) (((m) & VKI_S_IFMT) == VKI_S_IFLNK)
1418 #define VKI_S_ISREG(m) (((m) & VKI_S_IFMT) == VKI_S_IFREG)
1419 #define VKI_S_ISDIR(m) (((m) & VKI_S_IFMT) == VKI_S_IFDIR)
1420 #define VKI_S_ISCHR(m) (((m) & VKI_S_IFMT) == VKI_S_IFCHR)
1421 #define VKI_S_ISBLK(m) (((m) & VKI_S_IFMT) == VKI_S_IFBLK)
1422 #define VKI_S_ISFIFO(m) (((m) & VKI_S_IFMT) == VKI_S_IFIFO)
1423 #define VKI_S_ISSOCK(m) (((m) & VKI_S_IFMT) == VKI_S_IFSOCK)
1424
1425 #define VKI_S_IRWXU 00700
1426 #define VKI_S_IRUSR 00400
1427 #define VKI_S_IWUSR 00200
1428 #define VKI_S_IXUSR 00100
1429
1430 #define VKI_S_IRWXG 00070
1431 #define VKI_S_IRGRP 00040
1432 #define VKI_S_IWGRP 00020
1433 #define VKI_S_IXGRP 00010
1434
1435 #define VKI_S_IRWXO 00007
1436 #define VKI_S_IROTH 00004
1437 #define VKI_S_IWOTH 00002
1438 #define VKI_S_IXOTH 00001
1439
1440 #define VKI_STATX_ALL 0x00000FFFU
1441
1442 struct vki_statx_timestamp {
1443 __vki_s64 tv_sec;
1444 __vki_u32 tv_nsec;
1445 __vki_s32 __reserved;
1446 };
1447
1448 struct vki_statx {
1449
1450 __vki_u32 stx_mask;
1451 __vki_u32 stx_blksize;
1452 __vki_u64 stx_attributes;
1453
1454 __vki_u32 stx_nlink;
1455 __vki_u32 stx_uid;
1456 __vki_u32 stx_gid;
1457 __vki_u16 stx_mode;
1458 __vki_u16 __spare0[1];
1459
1460 __vki_u64 stx_ino;
1461 __vki_u64 stx_size;
1462 __vki_u64 stx_blocks;
1463 __vki_u64 stx_attributes_mask;
1464
1465 struct vki_statx_timestamp stx_atime;
1466 struct vki_statx_timestamp stx_btime;
1467 struct vki_statx_timestamp stx_ctime;
1468 struct vki_statx_timestamp stx_mtime;
1469
1470 __vki_u32 stx_rdev_major;
1471 __vki_u32 stx_rdev_minor;
1472 __vki_u32 stx_dev_major;
1473 __vki_u32 stx_dev_minor;
1474
1475 __vki_u64 __spare2[14];
1476
1477 };
1478
1479
1480
1481
1482
1483
1484
1485 struct vki_dirent {
1486 long d_ino;
1487 __vki_kernel_off_t d_off;
1488 unsigned short d_reclen;
1489 char d_name[256];
1490 };
1491
1492
1493 struct vki_dirent64 {
1494 __vki_u64 d_ino;
1495 __vki_s64 d_off;
1496 unsigned short d_reclen;
1497 unsigned char d_type;
1498 char d_name[256];
1499 };
1500
1501
1502
1503
1504
1505 #define VKI_F_SETLEASE (VKI_F_LINUX_SPECIFIC_BASE + 0)
1506 #define VKI_F_GETLEASE (VKI_F_LINUX_SPECIFIC_BASE + 1)
1507
1508 #define VKI_F_CANCELLK (VKI_F_LINUX_SPECIFIC_BASE + 5)
1509
1510 #define VKI_F_DUPFD_CLOEXEC (VKI_F_LINUX_SPECIFIC_BASE + 6)
1511
1512 #define VKI_F_NOTIFY (VKI_F_LINUX_SPECIFIC_BASE + 2)
1513
1514 #define VKI_F_SETPIPE_SZ (VKI_F_LINUX_SPECIFIC_BASE + 7)
1515 #define VKI_F_GETPIPE_SZ (VKI_F_LINUX_SPECIFIC_BASE + 8)
1516
1517 #define VKI_F_ADD_SEALS (VKI_F_LINUX_SPECIFIC_BASE + 9)
1518 #define VKI_F_GET_SEALS (VKI_F_LINUX_SPECIFIC_BASE + 10)
1519
1520 struct vki_flock {
1521 short l_type;
1522 short l_whence;
1523 __vki_kernel_off_t l_start;
1524 __vki_kernel_off_t l_len;
1525 __vki_kernel_pid_t l_pid;
1526 };
1527
1528 struct vki_flock64 {
1529 short l_type;
1530 short l_whence;
1531 __vki_kernel_loff_t l_start;
1532 __vki_kernel_loff_t l_len;
1533 __vki_kernel_pid_t l_pid;
1534 };
1535
1536 #define VKI_AT_EMPTY_PATH 0x1000
1537 #define VKI_AT_SYMLINK_NOFOLLOW 0x100
1538
1539
1540
1541
1542
1543 struct __vki_sysctl_args {
1544 int __user *name;
1545 int nlen;
1546 void __user *oldval;
1547 vki_size_t __user *oldlenp;
1548 void __user *newval;
1549 vki_size_t newlen;
1550 unsigned long __unused0[4];
1551 };
1552
1553
1554
1555
1556
1557 typedef unsigned long vki_aio_context_t;
1558
1559 enum {
1560 VKI_IOCB_CMD_PREAD = 0,
1561 VKI_IOCB_CMD_PWRITE = 1,
1562 VKI_IOCB_CMD_FSYNC = 2,
1563 VKI_IOCB_CMD_FDSYNC = 3,
1564 VKI_IOCB_CMD_PREADV = 7,
1565 VKI_IOCB_CMD_PWRITEV = 8,
1566 };
1567
1568
1569 struct vki_io_event {
1570 __vki_u64 data;
1571 __vki_u64 obj;
1572
1573
1574 __vki_s64 result;
1575 __vki_s64 result2;
1576 };
1577
1578 #if defined(VKI_LITTLE_ENDIAN)
1579 # define VKI_PADDED(x,y) x, y
1580 #elif defined(VKI_BIG_ENDIAN)
1581 # define VKI_PADDED(x,y) y, x
1582 #else
1583 #error edit for your odd byteorder.
1584 #endif
1585
1586 struct vki_iocb {
1587
1588 __vki_u64 aio_data;
1589 __vki_u32 VKI_PADDED(aio_key, aio_reserved1);
1590
1591
1592
1593 __vki_u16 aio_lio_opcode;
1594 __vki_s16 aio_reqprio;
1595 __vki_u32 aio_fildes;
1596
1597 __vki_u64 aio_buf;
1598 __vki_u64 aio_nbytes;
1599 __vki_s64 aio_offset;
1600
1601
1602 __vki_u64 aio_reserved2;
1603 __vki_u64 aio_reserved3;
1604 };
1605
1606
1607
1608
1609
1610 struct vki_aio_ring {
1611 unsigned id;
1612 unsigned nr;
1613 unsigned head;
1614 unsigned tail;
1615
1616 unsigned magic;
1617 unsigned compat_features;
1618 unsigned incompat_features;
1619 unsigned header_length;
1620
1621 struct vki_io_event io_events[0];
1622 };
1623
1624
1625
1626
1627
1628 #define VKI_MSG_STAT 11
1629 #define VKI_MSG_INFO 12
1630
1631 struct vki_msqid_ds {
1632 struct vki_ipc_perm msg_perm;
1633 struct vki_msg *msg_first;
1634 struct vki_msg *msg_last;
1635 __vki_kernel_time_t msg_stime;
1636 __vki_kernel_time_t msg_rtime;
1637 __vki_kernel_time_t msg_ctime;
1638 unsigned long msg_lcbytes;
1639 unsigned long msg_lqbytes;
1640 unsigned short msg_cbytes;
1641 unsigned short msg_qnum;
1642 unsigned short msg_qbytes;
1643 __vki_kernel_ipc_pid_t msg_lspid;
1644 __vki_kernel_ipc_pid_t msg_lrpid;
1645 };
1646
1647 struct vki_msgbuf {
1648 long mtype;
1649 char mtext[1];
1650 };
1651
1652 struct vki_msginfo {
1653 int msgpool;
1654 int msgmap;
1655 int msgmax;
1656 int msgmnb;
1657 int msgmni;
1658 int msgssz;
1659 int msgtql;
1660 unsigned short msgseg;
1661 };
1662
1663
1664
1665
1666
1667 struct vki_shmid_ds {
1668 struct vki_ipc_perm shm_perm;
1669 int shm_segsz;
1670 __vki_kernel_time_t shm_atime;
1671 __vki_kernel_time_t shm_dtime;
1672 __vki_kernel_time_t shm_ctime;
1673 __vki_kernel_ipc_pid_t shm_cpid;
1674 __vki_kernel_ipc_pid_t shm_lpid;
1675 unsigned short shm_nattch;
1676 unsigned short shm_unused;
1677 void *shm_unused2;
1678 void *shm_unused3;
1679 };
1680
1681 #define VKI_SHM_RDONLY 010000
1682 #define VKI_SHM_RND 020000
1683
1684 #define VKI_SHM_STAT 13
1685 #define VKI_SHM_INFO 14
1686
1687
1688 struct vki_shminfo {
1689 int shmmax;
1690 int shmmin;
1691 int shmmni;
1692 int shmseg;
1693 int shmall;
1694 };
1695
1696 struct vki_shm_info {
1697 int used_ids;
1698 unsigned long shm_tot;
1699 unsigned long shm_rss;
1700 unsigned long shm_swp;
1701 unsigned long swap_attempts;
1702 unsigned long swap_successes;
1703 };
1704
1705
1706
1707
1708
1709 struct vki_rtc_time {
1710 int tm_sec;
1711 int tm_min;
1712 int tm_hour;
1713 int tm_mday;
1714 int tm_mon;
1715 int tm_year;
1716 int tm_wday;
1717 int tm_yday;
1718 int tm_isdst;
1719 };
1720
1721 #define VKI_RTC_AIE_ON _VKI_IO('p', 0x01)
1722 #define VKI_RTC_AIE_OFF _VKI_IO('p', 0x02)
1723 #define VKI_RTC_UIE_ON _VKI_IO('p', 0x03)
1724 #define VKI_RTC_UIE_OFF _VKI_IO('p', 0x04)
1725 #define VKI_RTC_PIE_ON _VKI_IO('p', 0x05)
1726 #define VKI_RTC_PIE_OFF _VKI_IO('p', 0x06)
1727
1728 #define VKI_RTC_ALM_SET _VKI_IOW('p', 0x07, struct vki_rtc_time)
1729 #define VKI_RTC_ALM_READ _VKI_IOR('p', 0x08, struct vki_rtc_time)
1730 #define VKI_RTC_RD_TIME _VKI_IOR('p', 0x09, struct vki_rtc_time)
1731
1732 #define VKI_RTC_IRQP_READ _VKI_IOR('p', 0x0b, unsigned long)
1733 #define VKI_RTC_IRQP_SET _VKI_IOW('p', 0x0c, unsigned long)
1734
1735
1736
1737
1738
1739
1740
1741 #define VKI_ISDN_MAX_CHANNELS 64
1742
1743 #define VKI_IIOCGETCPS _VKI_IO('I',21)
1744
1745 #define VKI_IIOCNETGPN _VKI_IO('I',34)
1746
1747 #define VKI_ISDN_MSNLEN 32
1748
1749 typedef struct {
1750 char name[10];
1751 char phone[VKI_ISDN_MSNLEN];
1752 int outgoing;
1753 } vki_isdn_net_ioctl_phone;
1754
1755
1756
1757
1758
1759 #define VKI_SIOCOUTQ VKI_TIOCOUTQ
1760
1761 #define VKI_SIOCADDRT 0x890B
1762 #define VKI_SIOCDELRT 0x890C
1763
1764 #define VKI_SIOCGIFNAME 0x8910
1765 #define VKI_SIOCGIFCONF 0x8912
1766 #define VKI_SIOCGIFFLAGS 0x8913
1767 #define VKI_SIOCSIFFLAGS 0x8914
1768 #define VKI_SIOCGIFADDR 0x8915
1769 #define VKI_SIOCSIFADDR 0x8916
1770 #define VKI_SIOCGIFDSTADDR 0x8917
1771 #define VKI_SIOCSIFDSTADDR 0x8918
1772 #define VKI_SIOCGIFBRDADDR 0x8919
1773 #define VKI_SIOCSIFBRDADDR 0x891a
1774 #define VKI_SIOCGIFNETMASK 0x891b
1775 #define VKI_SIOCSIFNETMASK 0x891c
1776 #define VKI_SIOCGIFMETRIC 0x891d
1777 #define VKI_SIOCSIFMETRIC 0x891e
1778 #define VKI_SIOCGIFMTU 0x8921
1779 #define VKI_SIOCSIFMTU 0x8922
1780 #define VKI_SIOCSIFHWADDR 0x8924
1781 #define VKI_SIOCGIFHWADDR 0x8927
1782 #define VKI_SIOCGIFINDEX 0x8933
1783
1784 #define VKI_SIOCGIFTXQLEN 0x8942
1785 #define VKI_SIOCSIFTXQLEN 0x8943
1786
1787 #define VKI_SIOCETHTOOL 0x8946
1788
1789 #define VKI_SIOCGMIIPHY 0x8947
1790 #define VKI_SIOCGMIIREG 0x8948
1791 #define VKI_SIOCSMIIREG 0x8949
1792
1793 #define VKI_SIOCDARP 0x8953
1794 #define VKI_SIOCGARP 0x8954
1795 #define VKI_SIOCSARP 0x8955
1796
1797 #define VKI_SIOCDRARP 0x8960
1798 #define VKI_SIOCGRARP 0x8961
1799 #define VKI_SIOCSRARP 0x8962
1800
1801 #define VKI_SIOCGIFMAP 0x8970
1802 #define VKI_SIOCSIFMAP 0x8971
1803
1804 #define VKI_SIOCSHWTSTAMP 0x89B0
1805
1806
1807
1808
1809
1810 #define VKI_PP_MAJOR 99
1811
1812 #define VKI_PP_IOCTL 'p'
1813
1814
1815 #define VKI_PPSETMODE _VKI_IOW(VKI_PP_IOCTL, 0x80, int)
1816
1817
1818 #define VKI_PPRSTATUS _VKI_IOR(VKI_PP_IOCTL, 0x81, unsigned char)
1819
1820
1821
1822 #define VKI_PPRCONTROL _VKI_IOR(VKI_PP_IOCTL, 0x83, unsigned char)
1823 #define VKI_PPWCONTROL _VKI_IOW(VKI_PP_IOCTL, 0x84, unsigned char)
1824
1825 struct vki_ppdev_frob_struct {
1826 unsigned char mask;
1827 unsigned char val;
1828 };
1829 #define VKI_PPFCONTROL _VKI_IOW(VKI_PP_IOCTL, 0x8e, struct vki_ppdev_frob_struct)
1830
1831
1832 #define VKI_PPRDATA _VKI_IOR(VKI_PP_IOCTL, 0x85, unsigned char)
1833 #define VKI_PPWDATA _VKI_IOW(VKI_PP_IOCTL, 0x86, unsigned char)
1834
1835
1836 #define VKI_PPCLAIM _VKI_IO(VKI_PP_IOCTL, 0x8b)
1837
1838
1839 #define VKI_PPRELEASE _VKI_IO(VKI_PP_IOCTL, 0x8c)
1840
1841
1842
1843 #define VKI_PPYIELD _VKI_IO(VKI_PP_IOCTL, 0x8d)
1844
1845
1846 #define VKI_PPEXCL _VKI_IO(VKI_PP_IOCTL, 0x8f)
1847
1848
1849 #define VKI_PPDATADIR _VKI_IOW(VKI_PP_IOCTL, 0x90, int)
1850
1851
1852 #define VKI_PPNEGOT _VKI_IOW(VKI_PP_IOCTL, 0x91, int)
1853
1854
1855 #define VKI_PPWCTLONIRQ _VKI_IOW(VKI_PP_IOCTL, 0x92, unsigned char)
1856
1857
1858 #define VKI_PPCLRIRQ _VKI_IOR(VKI_PP_IOCTL, 0x93, int)
1859
1860
1861 #define VKI_PPSETPHASE _VKI_IOW(VKI_PP_IOCTL, 0x94, int)
1862
1863
1864 #define VKI_PPGETTIME _VKI_IOR(VKI_PP_IOCTL, 0x95, struct vki_timeval)
1865 #define VKI_PPSETTIME _VKI_IOW(VKI_PP_IOCTL, 0x96, struct vki_timeval)
1866
1867 #define VKI_PPGETMODES _VKI_IOR(VKI_PP_IOCTL, 0x97, unsigned int)
1868
1869 #define VKI_PPGETMODE _VKI_IOR(VKI_PP_IOCTL, 0x98, int)
1870 #define VKI_PPGETPHASE _VKI_IOR(VKI_PP_IOCTL, 0x99, int)
1871
1872 #define VKI_PPGETFLAGS _VKI_IOR(VKI_PP_IOCTL, 0x9a, int)
1873 #define VKI_PPSETFLAGS _VKI_IOW(VKI_PP_IOCTL, 0x9b, int)
1874
1875
1876
1877
1878
1879 #define VKI_BLKROSET _VKI_IO(0x12,93)
1880 #define VKI_BLKROGET _VKI_IO(0x12,94)
1881 #define VKI_BLKRRPART _VKI_IO(0x12,95)
1882 #define VKI_BLKGETSIZE _VKI_IO(0x12,96)
1883 #define VKI_BLKFLSBUF _VKI_IO(0x12,97)
1884 #define VKI_BLKRASET _VKI_IO(0x12,98)
1885 #define VKI_BLKRAGET _VKI_IO(0x12,99)
1886 #define VKI_BLKFRASET _VKI_IO(0x12,100)
1887 #define VKI_BLKFRAGET _VKI_IO(0x12,101)
1888 #define VKI_BLKSECTSET _VKI_IO(0x12,102)
1889 #define VKI_BLKSECTGET _VKI_IO(0x12,103)
1890 #define VKI_BLKSSZGET _VKI_IO(0x12,104)
1891 #define VKI_BLKBSZGET _VKI_IOR(0x12,112,vki_size_t)
1892 #define VKI_BLKBSZSET _VKI_IOW(0x12,113,vki_size_t)
1893 #define VKI_BLKGETSIZE64 _VKI_IOR(0x12,114,vki_size_t)
1894 #define VKI_BLKDISCARD _VKI_IO(0x12,119)
1895 #define VKI_BLKIOMIN _VKI_IO(0x12,120)
1896 #define VKI_BLKIOOPT _VKI_IO(0x12,121)
1897 #define VKI_BLKALIGNOFF _VKI_IO(0x12,122)
1898 #define VKI_BLKPBSZGET _VKI_IO(0x12,123)
1899 #define VKI_BLKDISCARDZEROES _VKI_IO(0x12,124)
1900 #define VKI_BLKZEROOUT _VKI_IO(0x12,127)
1901
1902 #define VKI_FIBMAP _VKI_IO(0x00,1)
1903 #define VKI_FIGETBSZ _VKI_IO(0x00,2)
1904 #define VKI_FICLONE _VKI_IOW(0x94, 9, int)
1905
1906
1907
1908
1909
1910 typedef struct vki_sg_io_hdr
1911 {
1912 int interface_id;
1913 int dxfer_direction;
1914 unsigned char cmd_len;
1915 unsigned char mx_sb_len;
1916 unsigned short iovec_count;
1917 unsigned int dxfer_len;
1918 void __user *dxferp;
1919
1920 unsigned char __user *cmdp;
1921 void __user *sbp;
1922 unsigned int timeout;
1923 unsigned int flags;
1924 int pack_id;
1925 void __user * usr_ptr;
1926 unsigned char status;
1927 unsigned char masked_status;
1928 unsigned char msg_status;
1929 unsigned char sb_len_wr;
1930 unsigned short host_status;
1931 unsigned short driver_status;
1932 int resid;
1933 unsigned int duration;
1934 unsigned int info;
1935 } vki_sg_io_hdr_t;
1936
1937 #define VKI_SG_DXFER_NONE -1
1938 #define VKI_SG_DXFER_TO_DEV -2
1939 #define VKI_SG_DXFER_FROM_DEV -3
1940 #define VKI_SG_DXFER_TO_FROM_DEV -4
1941
1942
1943
1944
1945 typedef struct vki_sg_scsi_id {
1946 int host_no;
1947 int channel;
1948 int scsi_id;
1949 int lun;
1950 int scsi_type;
1951 short h_cmd_per_lun;
1952 short d_queue_depth;
1953 int unused[2];
1954 } vki_sg_scsi_id_t;
1955
1956 #define VKI_SG_EMULATED_HOST 0x2203
1957
1958 #define VKI_SG_SET_RESERVED_SIZE 0x2275
1959 #define VKI_SG_GET_RESERVED_SIZE 0x2272
1960
1961 #define VKI_SG_GET_SCSI_ID 0x2276
1962
1963 #define VKI_SG_GET_SG_TABLESIZE 0x227F
1964
1965 #define VKI_SG_GET_VERSION_NUM 0x2282
1966
1967 #define VKI_SG_IO 0x2285
1968
1969 #define VKI_SG_SET_TIMEOUT 0x2201
1970 #define VKI_SG_GET_TIMEOUT 0x2202
1971
1972
1973 #define VKI_SG_SET_COMMAND_Q 0x2271
1974
1975
1976
1977
1978
1979 #define VKI_SCSI_IOCTL_DOORLOCK 0x5380
1980 #define VKI_SCSI_IOCTL_DOORUNLOCK 0x5381
1981 #define VKI_SCSI_IOCTL_GET_IDLUN 0x5382
1982 #define VKI_SCSI_IOCTL_GET_BUS_NUMBER 0x5386
1983
1984 struct vki_scsi_idlun {
1985 __vki_u32 dev_id;
1986 __vki_u32 host_unique_id;
1987 };
1988
1989
1990
1991
1992
1993 #define VKI_CDROMPLAYMSF 0x5303
1994 #define VKI_CDROMREADTOCHDR 0x5305
1995
1996 #define VKI_CDROMREADTOCENTRY 0x5306
1997
1998 #define VKI_CDROMSTOP 0x5307
1999 #define VKI_CDROMSUBCHNL 0x530b
2000
2001 #define VKI_CDROMREADMODE2 0x530c
2002
2003 #define VKI_CDROMREADMODE1 0x530d
2004
2005 #define VKI_CDROMREADAUDIO 0x530e
2006 #define VKI_CDROMMULTISESSION 0x5310
2007
2008
2009 #define VKI_CDROM_GET_MCN 0x5311
2010
2011 #define VKI_CDROMVOLREAD 0x5313
2012
2013 #define VKI_CDROMREADRAW 0x5314
2014
2015 #define VKI_CDROM_CLEAR_OPTIONS 0x5321
2016 #define VKI_CDROM_DRIVE_STATUS 0x5326
2017 #define VKI_CDROM_DISC_STATUS 0x5327
2018 #define VKI_CDROM_GET_CAPABILITY 0x5331
2019
2020 #define VKI_DVD_READ_STRUCT 0x5390
2021 #define VKI_CDROM_SEND_PACKET 0x5393
2022
2023 struct vki_cdrom_msf0
2024 {
2025 __vki_u8 minute;
2026 __vki_u8 second;
2027 __vki_u8 frame;
2028 };
2029
2030 union vki_cdrom_addr
2031 {
2032 struct vki_cdrom_msf0 msf;
2033 int lba;
2034 };
2035
2036 struct vki_cdrom_msf
2037 {
2038 __vki_u8 cdmsf_min0;
2039 __vki_u8 cdmsf_sec0;
2040 __vki_u8 cdmsf_frame0;
2041 __vki_u8 cdmsf_min1;
2042 __vki_u8 cdmsf_sec1;
2043 __vki_u8 cdmsf_frame1;
2044 };
2045
2046 struct vki_cdrom_tochdr
2047 {
2048 __vki_u8 cdth_trk0;
2049 __vki_u8 cdth_trk1;
2050 };
2051
2052 struct vki_cdrom_volctrl
2053 {
2054 __vki_u8 channel0;
2055 __vki_u8 channel1;
2056 __vki_u8 channel2;
2057 __vki_u8 channel3;
2058 };
2059
2060 struct vki_cdrom_subchnl
2061 {
2062 __vki_u8 cdsc_format;
2063 __vki_u8 cdsc_audiostatus;
2064 __vki_u8 cdsc_adr: 4;
2065 __vki_u8 cdsc_ctrl: 4;
2066 __vki_u8 cdsc_trk;
2067 __vki_u8 cdsc_ind;
2068 union vki_cdrom_addr cdsc_absaddr;
2069 union vki_cdrom_addr cdsc_reladdr;
2070 };
2071
2072 struct vki_cdrom_tocentry
2073 {
2074 __vki_u8 cdte_track;
2075 __vki_u8 cdte_adr :4;
2076 __vki_u8 cdte_ctrl :4;
2077 __vki_u8 cdte_format;
2078 union vki_cdrom_addr cdte_addr;
2079 __vki_u8 cdte_datamode;
2080 };
2081
2082 struct vki_cdrom_read
2083 {
2084 int cdread_lba;
2085 char *cdread_bufaddr;
2086 int cdread_buflen;
2087 };
2088
2089 struct vki_cdrom_read_audio
2090 {
2091 union vki_cdrom_addr addr;
2092 __vki_u8 addr_format;
2093 int nframes;
2094 __vki_u8 __user *buf;
2095 };
2096
2097 struct vki_cdrom_multisession
2098 {
2099 union vki_cdrom_addr addr;
2100
2101
2102 __vki_u8 xa_flag;
2103 __vki_u8 addr_format;
2104 };
2105
2106 struct vki_cdrom_mcn
2107 {
2108 __vki_u8 medium_catalog_number[14];
2109 };
2110
2111 #define VKI_CDROM_PACKET_SIZE 12
2112
2113 struct vki_cdrom_generic_command
2114 {
2115 unsigned char cmd[VKI_CDROM_PACKET_SIZE];
2116 unsigned char __user *buffer;
2117 unsigned int buflen;
2118 int stat;
2119
2120 void__user *sense;
2121 unsigned char data_direction;
2122 int quiet;
2123 int timeout;
2124 void __user *reserved[1];
2125 };
2126
2127 #define VKI_CD_SYNC_SIZE 12
2128 #define VKI_CD_HEAD_SIZE 4
2129 #define VKI_CD_FRAMESIZE_RAW 2352
2130 #define VKI_CD_FRAMESIZE_RAW0 (VKI_CD_FRAMESIZE_RAW-VKI_CD_SYNC_SIZE-VKI_CD_HEAD_SIZE)
2131 #define VKI_CD_FRAMESIZE_RAW1 2048
2132
2133
2134
2135
2136
2137 #ifndef _VKI_SIOWR
2138 #if defined(_VKI_IOWR) && (defined(_AIX) || (!defined(sun) && !defined(sparc) && !defined(__sparc__) && !defined(__INCioctlh) && !defined(__Lynx__)))
2139
2140 #define _VKI_SIO _VKI_IO
2141 #define _VKI_SIOR _VKI_IOR
2142 #define _VKI_SIOW _VKI_IOW
2143 #define _VKI_SIOWR _VKI_IOWR
2144 #else
2145
2146 #error Valgrind: Cannot handle sparc/sun case yet...
2147 # endif
2148 #endif
2149
2150 #define VKI_SNDCTL_SEQ_CTRLRATE _VKI_SIOWR('Q', 3, int)
2151 #define VKI_SNDCTL_SEQ_GETOUTCOUNT _VKI_SIOR ('Q', 4, int)
2152 #define VKI_SNDCTL_SEQ_GETINCOUNT _VKI_SIOR ('Q', 5, int)
2153 #define VKI_SNDCTL_SEQ_PERCMODE _VKI_SIOW ('Q', 6, int)
2154 #define VKI_SNDCTL_SEQ_TESTMIDI _VKI_SIOW ('Q', 8, int)
2155 #define VKI_SNDCTL_SEQ_RESETSAMPLES _VKI_SIOW ('Q', 9, int)
2156 #define VKI_SNDCTL_SEQ_NRSYNTHS _VKI_SIOR ('Q',10, int)
2157 #define VKI_SNDCTL_SEQ_NRMIDIS _VKI_SIOR ('Q',11, int)
2158 #define VKI_SNDCTL_SEQ_GETTIME _VKI_SIOR ('Q',19, int)
2159
2160 #define VKI_SNDCTL_TMR_TIMEBASE _VKI_SIOWR('T', 1, int)
2161 #define VKI_SNDCTL_TMR_TEMPO _VKI_SIOWR('T', 5, int)
2162 #define VKI_SNDCTL_TMR_SOURCE _VKI_SIOWR('T', 6, int)
2163
2164 #define VKI_SNDCTL_MIDI_PRETIME _VKI_SIOWR('m', 0, int)
2165 #define VKI_SNDCTL_MIDI_MPUMODE _VKI_SIOWR('m', 1, int)
2166
2167 #define VKI_SNDCTL_DSP_RESET _VKI_SIO ('P', 0)
2168 #define VKI_SNDCTL_DSP_SYNC _VKI_SIO ('P', 1)
2169 #define VKI_SNDCTL_DSP_SPEED _VKI_SIOWR('P', 2, int)
2170 #define VKI_SNDCTL_DSP_STEREO _VKI_SIOWR('P', 3, int)
2171 #define VKI_SNDCTL_DSP_GETBLKSIZE _VKI_SIOWR('P', 4, int)
2172 #define VKI_SNDCTL_DSP_CHANNELS _VKI_SIOWR('P', 6, int)
2173 #define VKI_SOUND_PCM_WRITE_FILTER _VKI_SIOWR('P', 7, int)
2174 #define VKI_SNDCTL_DSP_POST _VKI_SIO ('P', 8)
2175 #define VKI_SNDCTL_DSP_SUBDIVIDE _VKI_SIOWR('P', 9, int)
2176 #define VKI_SNDCTL_DSP_SETFRAGMENT _VKI_SIOWR('P',10, int)
2177
2178 #define VKI_SNDCTL_DSP_GETFMTS _VKI_SIOR ('P',11, int)
2179 #define VKI_SNDCTL_DSP_SETFMT _VKI_SIOWR('P', 5, int)
2180
2181 typedef struct vki_audio_buf_info {
2182 int fragments;
2183 int fragstotal;
2184 int fragsize;
2185
2186 int bytes;
2187
2188 } vki_audio_buf_info;
2189
2190 #define VKI_SNDCTL_DSP_GETOSPACE _VKI_SIOR ('P',12, vki_audio_buf_info)
2191 #define VKI_SNDCTL_DSP_GETISPACE _VKI_SIOR ('P',13, vki_audio_buf_info)
2192 #define VKI_SNDCTL_DSP_NONBLOCK _VKI_SIO ('P',14)
2193 #define VKI_SNDCTL_DSP_GETCAPS _VKI_SIOR ('P',15, int)
2194
2195 #define VKI_SNDCTL_DSP_GETTRIGGER _VKI_SIOR ('P',16, int)
2196 #define VKI_SNDCTL_DSP_SETTRIGGER _VKI_SIOW ('P',16, int)
2197
2198 #define VKI_SNDCTL_DSP_SETSYNCRO _VKI_SIO ('P', 21)
2199 #define VKI_SNDCTL_DSP_SETDUPLEX _VKI_SIO ('P', 22)
2200 #define VKI_SNDCTL_DSP_GETODELAY _VKI_SIOR ('P', 23, int)
2201
2202 #define VKI_SNDCTL_DSP_GETCHANNELMASK _VKI_SIOWR('P', 64, int)
2203 #define VKI_SNDCTL_DSP_BIND_CHANNEL _VKI_SIOWR('P', 65, int)
2204
2205 #define VKI_SNDCTL_DSP_SETSPDIF _VKI_SIOW ('P', 66, int)
2206 #define VKI_SNDCTL_DSP_GETSPDIF _VKI_SIOR ('P', 67, int)
2207
2208 #define VKI_SOUND_PCM_READ_RATE _VKI_SIOR ('P', 2, int)
2209 #define VKI_SOUND_PCM_READ_CHANNELS _VKI_SIOR ('P', 6, int)
2210 #define VKI_SOUND_PCM_READ_BITS _VKI_SIOR ('P', 5, int)
2211 #define VKI_SOUND_PCM_READ_FILTER _VKI_SIOR ('P', 7, int)
2212
2213
2214
2215
2216
2217
2218 struct vki_hd_geometry {
2219 unsigned char heads;
2220 unsigned char sectors;
2221 unsigned short cylinders;
2222 unsigned long start;
2223 };
2224
2225 #define VKI_HDIO_GETGEO 0x0301
2226 #define VKI_HDIO_GET_DMA 0x030b
2227 #define VKI_HDIO_GET_IDENTITY 0x030d
2228
2229
2230
2231 #define VKI_SIZEOF_STRUCT_HD_DRIVEID 512
2232
2233
2234
2235
2236
2237 #define VKI_FBIOGET_VSCREENINFO 0x4600
2238 #define VKI_FBIOPUT_VSCREENINFO 0x4601
2239 #define VKI_FBIOGET_FSCREENINFO 0x4602
2240 #define VKI_FBIOPAN_DISPLAY 0x4606
2241
2242 struct vki_fb_fix_screeninfo {
2243 char id[16];
2244 unsigned long smem_start;
2245
2246 __vki_u32 smem_len;
2247 __vki_u32 type;
2248 __vki_u32 type_aux;
2249 __vki_u32 visual;
2250 __vki_u16 xpanstep;
2251 __vki_u16 ypanstep;
2252 __vki_u16 ywrapstep;
2253 __vki_u32 line_length;
2254 unsigned long mmio_start;
2255
2256 __vki_u32 mmio_len;
2257 __vki_u32 accel;
2258
2259 __vki_u16 reserved[3];
2260 };
2261
2262 struct vki_fb_bitfield {
2263 __vki_u32 offset;
2264 __vki_u32 length;
2265 __vki_u32 msb_right;
2266
2267 };
2268
2269 struct vki_fb_var_screeninfo {
2270 __vki_u32 xres;
2271 __vki_u32 yres;
2272 __vki_u32 xres_virtual;
2273 __vki_u32 yres_virtual;
2274 __vki_u32 xoffset;
2275 __vki_u32 yoffset;
2276
2277 __vki_u32 bits_per_pixel;
2278 __vki_u32 grayscale;
2279
2280 struct vki_fb_bitfield red;
2281 struct vki_fb_bitfield green;
2282 struct vki_fb_bitfield blue;
2283 struct vki_fb_bitfield transp;
2284
2285 __vki_u32 nonstd;
2286
2287 __vki_u32 activate;
2288
2289 __vki_u32 height;
2290 __vki_u32 width;
2291
2292 __vki_u32 accel_flags;
2293
2294
2295 __vki_u32 pixclock;
2296 __vki_u32 left_margin;
2297 __vki_u32 right_margin;
2298 __vki_u32 upper_margin;
2299 __vki_u32 lower_margin;
2300 __vki_u32 hsync_len;
2301 __vki_u32 vsync_len;
2302 __vki_u32 sync;
2303 __vki_u32 vmode;
2304 __vki_u32 rotate;
2305 __vki_u32 reserved[5];
2306 };
2307
2308
2309
2310
2311
2312 #define VKI_GIO_FONT 0x4B60
2313 #define VKI_PIO_FONT 0x4B61
2314
2315 #define VKI_GIO_FONTX 0x4B6B
2316 #define VKI_PIO_FONTX 0x4B6C
2317 struct vki_consolefontdesc {
2318 unsigned short charcount;
2319 unsigned short charheight;
2320 char __user *chardata;
2321 };
2322
2323 #define VKI_PIO_FONTRESET 0x4B6D
2324
2325 #define VKI_GIO_CMAP 0x4B70
2326 #define VKI_PIO_CMAP 0x4B71
2327
2328 #define VKI_KIOCSOUND 0x4B2F
2329 #define VKI_KDMKTONE 0x4B30
2330
2331 #define VKI_KDGETLED 0x4B31
2332 #define VKI_KDSETLED 0x4B32
2333
2334 #define VKI_KDGKBTYPE 0x4B33
2335
2336 #define VKI_KDADDIO 0x4B34
2337 #define VKI_KDDELIO 0x4B35
2338 #define VKI_KDENABIO 0x4B36
2339 #define VKI_KDDISABIO 0x4B37
2340
2341 #define VKI_KDSETMODE 0x4B3A
2342 #define VKI_KDGETMODE 0x4B3B
2343
2344 #define VKI_KDMAPDISP 0x4B3C
2345 #define VKI_KDUNMAPDISP 0x4B3D
2346
2347 #define VKI_E_TABSZ 256
2348 #define VKI_GIO_SCRNMAP 0x4B40
2349 #define VKI_PIO_SCRNMAP 0x4B41
2350 #define VKI_GIO_UNISCRNMAP 0x4B69
2351 #define VKI_PIO_UNISCRNMAP 0x4B6A
2352
2353 #define VKI_GIO_UNIMAP 0x4B66
2354 struct vki_unipair {
2355 unsigned short unicode;
2356 unsigned short fontpos;
2357 };
2358 struct vki_unimapdesc {
2359 unsigned short entry_ct;
2360 struct vki_unipair __user *entries;
2361 };
2362 #define VKI_PIO_UNIMAP 0x4B67
2363 #define VKI_PIO_UNIMAPCLR 0x4B68
2364 struct vki_unimapinit {
2365 unsigned short advised_hashsize;
2366 unsigned short advised_hashstep;
2367 unsigned short advised_hashlevel;
2368 };
2369
2370 #define VKI_KDGKBMODE 0x4B44
2371 #define VKI_KDSKBMODE 0x4B45
2372
2373 #define VKI_KDGKBMETA 0x4B62
2374 #define VKI_KDSKBMETA 0x4B63
2375
2376 #define VKI_KDGKBLED 0x4B64
2377 #define VKI_KDSKBLED 0x4B65
2378
2379 struct vki_kbentry {
2380 unsigned char kb_table;
2381 unsigned char kb_index;
2382 unsigned short kb_value;
2383 };
2384 #define VKI_KDGKBENT 0x4B46
2385 #define VKI_KDSKBENT 0x4B47
2386
2387 struct vki_kbsentry {
2388 unsigned char kb_func;
2389 unsigned char kb_string[512];
2390 };
2391 #define VKI_KDGKBSENT 0x4B48
2392 #define VKI_KDSKBSENT 0x4B49
2393
2394 struct vki_kbdiacr {
2395 unsigned char diacr, base, result;
2396 };
2397 struct vki_kbdiacrs {
2398 unsigned int kb_cnt;
2399 struct vki_kbdiacr kbdiacr[256];
2400 };
2401 #define VKI_KDGKBDIACR 0x4B4A
2402 #define VKI_KDSKBDIACR 0x4B4B
2403
2404 struct vki_kbkeycode {
2405 unsigned int scancode, keycode;
2406 };
2407 #define VKI_KDGETKEYCODE 0x4B4C
2408 #define VKI_KDSETKEYCODE 0x4B4D
2409
2410 #define VKI_KDSIGACCEPT 0x4B4E
2411
2412 struct vki_kbd_repeat {
2413 int delay;
2414 int period;
2415
2416 };
2417 #define VKI_KDKBDREP 0x4B52
2418
2419
2420 #define VKI_KDFONTOP 0x4B72
2421
2422 struct vki_console_font_op {
2423 unsigned int op;
2424 unsigned int flags;
2425 unsigned int width, height;
2426 unsigned int charcount;
2427 unsigned char __user *data;
2428 };
2429
2430 #define VKI_KD_FONT_OP_SET 0
2431 #define VKI_KD_FONT_OP_GET 1
2432 #define VKI_KD_FONT_OP_SET_DEFAULT 2
2433 #define VKI_KD_FONT_OP_COPY 3
2434
2435
2436
2437
2438
2439 typedef __vki_kernel_uid32_t vki_qid_t;
2440
2441
2442
2443
2444
2445 #define VKI_PTRACE_TRACEME 0
2446 #define VKI_PTRACE_PEEKTEXT 1
2447 #define VKI_PTRACE_PEEKDATA 2
2448 #define VKI_PTRACE_PEEKUSR 3
2449 #define VKI_PTRACE_POKEUSR 6
2450
2451 #define VKI_PTRACE_DETACH 17
2452
2453 #define VKI_PTRACE_GETEVENTMSG 0x4201
2454 #define VKI_PTRACE_GETSIGINFO 0x4202
2455 #define VKI_PTRACE_SETSIGINFO 0x4203
2456 #define VKI_PTRACE_GETREGSET 0x4204
2457 #define VKI_PTRACE_SETREGSET 0x4205
2458
2459 #define VKI_PT_PTRACED 0x00000001
2460
2461
2462
2463
2464
2465 enum {
2466 VKI_SNDRV_PCM_IOCTL_HW_FREE = _VKI_IO('A', 0x12),
2467 VKI_SNDRV_PCM_IOCTL_HWSYNC = _VKI_IO('A', 0x22),
2468 VKI_SNDRV_PCM_IOCTL_PREPARE = _VKI_IO('A', 0x40),
2469 VKI_SNDRV_PCM_IOCTL_RESET = _VKI_IO('A', 0x41),
2470 VKI_SNDRV_PCM_IOCTL_START = _VKI_IO('A', 0x42),
2471 VKI_SNDRV_PCM_IOCTL_DROP = _VKI_IO('A', 0x43),
2472 VKI_SNDRV_PCM_IOCTL_DRAIN = _VKI_IO('A', 0x44),
2473 VKI_SNDRV_PCM_IOCTL_PAUSE = _VKI_IOW('A', 0x45, int),
2474 VKI_SNDRV_PCM_IOCTL_RESUME = _VKI_IO('A', 0x47),
2475 VKI_SNDRV_PCM_IOCTL_XRUN = _VKI_IO('A', 0x48),
2476 VKI_SNDRV_PCM_IOCTL_LINK = _VKI_IOW('A', 0x60, int),
2477 VKI_SNDRV_PCM_IOCTL_UNLINK = _VKI_IO('A', 0x61),
2478 };
2479
2480 enum {
2481 VKI_SNDRV_TIMER_IOCTL_START = _VKI_IO('T', 0xa0),
2482 VKI_SNDRV_TIMER_IOCTL_STOP = _VKI_IO('T', 0xa1),
2483 VKI_SNDRV_TIMER_IOCTL_CONTINUE = _VKI_IO('T', 0xa2),
2484 VKI_SNDRV_TIMER_IOCTL_PAUSE = _VKI_IO('T', 0xa3),
2485 };
2486
2487 struct vki_snd_ctl_card_info {
2488 int card;
2489 int pad;
2490 unsigned char id[16];
2491 unsigned char driver[16];
2492 unsigned char name[32];
2493 unsigned char longname[80];
2494 unsigned char reserved_[16];
2495 unsigned char mixername[80];
2496 unsigned char components[128];
2497 };
2498
2499 typedef int vki_snd_ctl_elem_iface_t;
2500 #define VKI_SNDRV_CTL_ELEM_IFACE_CARD ((vki_snd_ctl_elem_iface_t) 0)
2501 #define VKI_SNDRV_CTL_ELEM_IFACE_HWDEP ((vki_snd_ctl_elem_iface_t) 1)
2502 #define VKI_SNDRV_CTL_ELEM_IFACE_MIXER ((vki_snd_ctl_elem_iface_t) 2)
2503 #define VKI_SNDRV_CTL_ELEM_IFACE_PCM ((vki_snd_ctl_elem_iface_t) 3)
2504 #define VKI_SNDRV_CTL_ELEM_IFACE_RAWMIDI ((vki_snd_ctl_elem_iface_t) 4)
2505 #define VKI_SNDRV_CTL_ELEM_IFACE_TIMER ((vki_snd_ctl_elem_iface_t) 5)
2506 #define VKI_SNDRV_CTL_ELEM_IFACE_SEQUENCER ((vki_snd_ctl_elem_iface_t) 6)
2507 #define VKI_SNDRV_CTL_ELEM_IFACE_LAST VKI_SNDRV_CTL_ELEM_IFACE_SEQUENCER
2508
2509 struct vki_snd_ctl_elem_id {
2510 unsigned int numid;
2511 vki_snd_ctl_elem_iface_t iface;
2512 unsigned int device;
2513 unsigned int subdevice;
2514 unsigned char name[44];
2515 unsigned int index;
2516 };
2517
2518 struct vki_snd_ctl_elem_list {
2519 unsigned int offset;
2520 unsigned int space;
2521 unsigned int used;
2522 unsigned int count;
2523 struct vki_snd_ctl_elem_id __user *pids;
2524 unsigned char reserved[50];
2525 };
2526
2527 struct vki_snd_ctl_tlv {
2528 unsigned int numid;
2529 unsigned int length;
2530 unsigned int tlv[0];
2531 };
2532
2533 #define VKI_SNDRV_CTL_IOCTL_PVERSION _VKI_IOR('U', 0x00, int)
2534 #define VKI_SNDRV_CTL_IOCTL_CARD_INFO _VKI_IOR('U', 0x01, struct vki_snd_ctl_card_info)
2535 #define VKI_SNDRV_CTL_IOCTL_ELEM_LIST _VKI_IOWR('U', 0x10, struct vki_snd_ctl_elem_list)
2536 #define VKI_SNDRV_CTL_IOCTL_TLV_READ _VKI_IOWR('U', 0x1a, struct vki_snd_ctl_tlv)
2537 #define VKI_SNDRV_CTL_IOCTL_TLV_WRITE _VKI_IOWR('U', 0x1b, struct vki_snd_ctl_tlv)
2538 #define VKI_SNDRV_CTL_IOCTL_TLV_COMMAND _VKI_IOWR('U', 0x1c, struct vki_snd_ctl_tlv)
2539
2540
2541
2542
2543
2544 struct vki_serial_icounter_struct {
2545 int cts, dsr, rng, dcd;
2546 int rx, tx;
2547 int frame, overrun, parity, brk;
2548 int buf_overrun;
2549 int reserved[9];
2550 };
2551
2552
2553
2554
2555
2556 #define VKI_VT_OPENQRY 0x5600
2557
2558 struct vki_vt_mode {
2559 char mode;
2560 char waitv;
2561 short relsig;
2562 short acqsig;
2563 short frsig;
2564 };
2565 #define VKI_VT_GETMODE 0x5601
2566 #define VKI_VT_SETMODE 0x5602
2567
2568 struct vki_vt_stat {
2569 unsigned short v_active;
2570 unsigned short v_signal;
2571 unsigned short v_state;
2572 };
2573 #define VKI_VT_GETSTATE 0x5603
2574 #define VKI_VT_SENDSIG 0x5604
2575
2576 #define VKI_VT_RELDISP 0x5605
2577
2578 #define VKI_VT_ACTIVATE 0x5606
2579 #define VKI_VT_WAITACTIVE 0x5607
2580 #define VKI_VT_DISALLOCATE 0x5608
2581
2582 struct vki_vt_sizes {
2583 unsigned short v_rows;
2584 unsigned short v_cols;
2585 unsigned short v_scrollsize;
2586 };
2587 #define VKI_VT_RESIZE 0x5609
2588
2589 struct vki_vt_consize {
2590 unsigned short v_rows;
2591 unsigned short v_cols;
2592 unsigned short v_vlin;
2593 unsigned short v_clin;
2594 unsigned short v_vcol;
2595 unsigned short v_ccol;
2596 };
2597 #define VKI_VT_RESIZEX 0x560A
2598 #define VKI_VT_LOCKSWITCH 0x560B
2599 #define VKI_VT_UNLOCKSWITCH 0x560C
2600
2601
2602
2603
2604
2605 #define VKI_PR_SET_PDEATHSIG 1
2606 #define VKI_PR_GET_PDEATHSIG 2
2607
2608 #define VKI_PR_GET_DUMPABLE 3
2609 #define VKI_PR_SET_DUMPABLE 4
2610
2611 #define VKI_PR_GET_UNALIGN 5
2612 #define VKI_PR_SET_UNALIGN 6
2613 # define VKI_PR_UNALIGN_NOPRINT 1
2614 # define VKI_PR_UNALIGN_SIGBUS 2
2615
2616 #define VKI_PR_GET_KEEPCAPS 7
2617 #define VKI_PR_SET_KEEPCAPS 8
2618
2619 #define VKI_PR_GET_FPEMU 9
2620 #define VKI_PR_SET_FPEMU 10
2621 # define VKI_PR_FPEMU_NOPRINT 1
2622 # define VKI_PR_FPEMU_SIGFPE 2
2623
2624 #define VKI_PR_GET_FPEXC 11
2625 #define VKI_PR_SET_FPEXC 12
2626 # define VKI_PR_FP_EXC_SW_ENABLE 0x80
2627 # define VKI_PR_FP_EXC_DIV 0x010000
2628 # define VKI_PR_FP_EXC_OVF 0x020000
2629 # define VKI_PR_FP_EXC_UND 0x040000
2630 # define VKI_PR_FP_EXC_RES 0x080000
2631 # define VKI_PR_FP_EXC_INV 0x100000
2632 # define VKI_PR_FP_EXC_DISABLED 0
2633 # define VKI_PR_FP_EXC_NONRECOV 1
2634 # define VKI_PR_FP_EXC_ASYNC 2
2635 # define VKI_PR_FP_EXC_PRECISE 3
2636
2637 #define VKI_PR_GET_TIMING 13
2638 #define VKI_PR_SET_TIMING 14
2639 # define VKI_PR_TIMING_STATISTICAL 0
2640
2641 # define VKI_PR_TIMING_TIMESTAMP 1
2642
2643
2644 #define VKI_PR_SET_NAME 15
2645 #define VKI_PR_GET_NAME 16
2646
2647 #define VKI_PR_GET_ENDIAN 19
2648 #define VKI_PR_SET_ENDIAN 20
2649 # define VKI_PR_ENDIAN_BIG 0
2650 # define VKI_PR_ENDIAN_LITTLE 1
2651 # define VKI_PR_ENDIAN_PPC_LITTLE 2
2652
2653 #define VKI_PR_SET_SECCOMP 22
2654
2655 #define VKI_PR_CAPBSET_READ 23
2656 #define VKI_PR_CAPBSET_DROP 24
2657
2658 #define VKI_PR_GET_TSC 25
2659 #define VKI_PR_SET_TSC 26
2660
2661 #define VKI_PR_GET_SECUREBITS 27
2662 #define VKI_PR_SET_SECUREBITS 28
2663
2664 #define VKI_PR_SET_TIMERSLACK 29
2665 #define VKI_PR_GET_TIMERSLACK 30
2666
2667 #define VKI_PR_TASK_PERF_EVENTS_DISABLE 31
2668 #define VKI_PR_TASK_PERF_EVENTS_ENABLE 32
2669
2670 #define VKI_PR_MCE_KILL 33
2671 #define VKI_PR_MCE_KILL_GET 34
2672
2673 #define VKI_PR_SET_PTRACER 0x59616d61
2674
2675 #define VKI_PR_SET_CHILD_SUBREAPER 36
2676 #define VKI_PR_GET_CHILD_SUBREAPER 37
2677
2678 #define VKI_PR_SET_NO_NEW_PRIVS 38
2679 #define VKI_PR_GET_NO_NEW_PRIVS 39
2680
2681 #define VKI_PR_GET_TID_ADDRESS 40
2682
2683 #define VKI_PR_SET_THP_DISABLE 41
2684 #define VKI_PR_GET_THP_DISABLE 42
2685
2686 #define VKI_PR_MPX_ENABLE_MANAGEMENT 43
2687 #define VKI_PR_MPX_DISABLE_MANAGEMENT 44
2688
2689 #define VKI_PR_SET_FP_MODE 45
2690 #define VKI_PR_GET_FP_MODE 46
2691
2692 #define VKI_PR_CAP_AMBIENT 47
2693
2694 #define VKI_PR_SVE_SET_VL 50
2695 #define VKI_PR_SVE_GET_VL 51
2696 #define VKI_PR_GET_SPECULATION_CTRL 52
2697 #define VKI_PR_SET_SPECULATION_CTRL 53
2698 #define VKI_PR_PAC_RESET_KEYS 54
2699 #define VKI_PR_SET_TAGGED_ADDR_CTRL 55
2700 #define VKI_PR_GET_TAGGED_ADDR_CTRL 56
2701
2702
2703
2704
2705
2706 struct vki_usbdevfs_ctrltransfer {
2707 __vki_u8 bRequestType;
2708 __vki_u8 bRequest;
2709 __vki_u16 wValue;
2710 __vki_u16 wIndex;
2711 __vki_u16 wLength;
2712 __vki_u32 timeout;
2713 void __user *data;
2714 };
2715
2716 struct vki_usbdevfs_bulktransfer {
2717 unsigned int ep;
2718 unsigned int len;
2719 unsigned int timeout;
2720 void __user *data;
2721 };
2722
2723 #define VKI_USBDEVFS_MAXDRIVERNAME 255
2724
2725 struct vki_usbdevfs_getdriver {
2726 unsigned int interface;
2727 char driver[VKI_USBDEVFS_MAXDRIVERNAME + 1];
2728 };
2729
2730 struct vki_usbdevfs_connectinfo {
2731 unsigned int devnum;
2732 unsigned char slow;
2733 };
2734
2735 struct vki_usbdevfs_iso_packet_desc {
2736 unsigned int length;
2737 unsigned int actual_length;
2738 unsigned int status;
2739 };
2740
2741 struct vki_usbdevfs_urb {
2742 unsigned char type;
2743 unsigned char endpoint;
2744 int status;
2745 unsigned int flags;
2746 void __user *buffer;
2747 int buffer_length;
2748 int actual_length;
2749 int start_frame;
2750 int number_of_packets;
2751 int error_count;
2752 unsigned int signr;
2753 void *usercontext;
2754 struct vki_usbdevfs_iso_packet_desc iso_frame_desc[0];
2755 };
2756
2757 struct vki_usbdevfs_ioctl {
2758 int ifno;
2759 int ioctl_code;
2760
2761 void __user *data;
2762 };
2763
2764 #define VKI_USBDEVFS_CONTROL _VKI_IOWR('U', 0, struct vki_usbdevfs_ctrltransfer)
2765 #define VKI_USBDEVFS_BULK _VKI_IOWR('U', 2, struct vki_usbdevfs_bulktransfer)
2766 #define VKI_USBDEVFS_GETDRIVER _VKI_IOW('U', 8, struct vki_usbdevfs_getdriver)
2767 #define VKI_USBDEVFS_SUBMITURB _VKI_IOR('U', 10, struct vki_usbdevfs_urb)
2768 #define VKI_USBDEVFS_DISCARDURB _VKI_IO('U', 11)
2769 #define VKI_USBDEVFS_REAPURB _VKI_IOW('U', 12, void *)
2770 #define VKI_USBDEVFS_REAPURBNDELAY _VKI_IOW('U', 13, void *)
2771 #define VKI_USBDEVFS_CONNECTINFO _VKI_IOW('U', 17, struct vki_usbdevfs_connectinfo)
2772 #define VKI_USBDEVFS_IOCTL _VKI_IOWR('U', 18, struct vki_usbdevfs_ioctl)
2773 #define VKI_USBDEVFS_RESET _VKI_IO('U', 20)
2774
2775 #define VKI_USBDEVFS_URB_TYPE_ISO 0
2776 #define VKI_USBDEVFS_URB_TYPE_INTERRUPT 1
2777 #define VKI_USBDEVFS_URB_TYPE_CONTROL 2
2778 #define VKI_USBDEVFS_URB_TYPE_BULK 3
2779
2780
2781 struct vki_usbdevfs_setuppacket {
2782 __vki_u8 bRequestType;
2783 __vki_u8 bRequest;
2784 __vki_u16 wValue;
2785 __vki_u16 wIndex;
2786 __vki_u16 wLength;
2787 };
2788
2789
2790
2791
2792
2793 #define VKI_I2C_SMBUS_QUICK 0
2794 #define VKI_I2C_SMBUS_BYTE 1
2795 #define VKI_I2C_SMBUS_BYTE_DATA 2
2796 #define VKI_I2C_SMBUS_WORD_DATA 3
2797 #define VKI_I2C_SMBUS_PROC_CALL 4
2798 #define VKI_I2C_SMBUS_BLOCK_DATA 5
2799 #define VKI_I2C_SMBUS_I2C_BLOCK_BROKEN 6
2800 #define VKI_I2C_SMBUS_BLOCK_PROC_CALL 7
2801 #define VKI_I2C_SMBUS_I2C_BLOCK_DATA 8
2802
2803
2804 #define VKI_I2C_SMBUS_READ 1
2805 #define VKI_I2C_SMBUS_WRITE 0
2806
2807 #define VKI_I2C_SLAVE 0x0703
2808
2809 #define VKI_I2C_SLAVE_FORCE 0x0706
2810
2811
2812
2813 #define VKI_I2C_TENBIT 0x0704
2814 #define VKI_I2C_FUNCS 0x0705
2815 #define VKI_I2C_RDWR 0x0707
2816 #define VKI_I2C_PEC 0x0708
2817 #define VKI_I2C_SMBUS 0x0720
2818
2819 #define VKI_I2C_SMBUS_BLOCK_MAX 32
2820 union vki_i2c_smbus_data {
2821 __vki_u8 byte;
2822 __vki_u16 word;
2823 __vki_u8 block[VKI_I2C_SMBUS_BLOCK_MAX + 2];
2824
2825
2826 };
2827
2828
2829 struct vki_i2c_smbus_ioctl_data {
2830 __vki_u8 read_write;
2831 __vki_u8 command;
2832 __vki_u32 size;
2833 union vki_i2c_smbus_data __user *data;
2834 };
2835
2836 struct vki_i2c_msg {
2837 __vki_u16 addr;
2838 __vki_u16 flags;
2839 #define VKI_I2C_M_TEN 0x0010
2840 #define VKI_I2C_M_RD 0x0001
2841 #define VKI_I2C_M_NOSTART 0x4000
2842 #define VKI_I2C_M_REV_DIR_ADDR 0x2000
2843 #define VKI_I2C_M_IGNORE_NAK 0x1000
2844 #define VKI_I2C_M_NO_RD_ACK 0x0800
2845 #define VKI_I2C_M_RECV_LEN 0x0400
2846 __vki_u16 len;
2847 __vki_u8 *buf;
2848 };
2849
2850 struct vki_i2c_rdwr_ioctl_data {
2851 struct vki_i2c_msg *msgs;
2852 __vki_u32 nmsgs;
2853 };
2854
2855
2856
2857
2858
2859
2860 #define VKI_KEYCTL_GET_KEYRING_ID 0
2861 #define VKI_KEYCTL_JOIN_SESSION_KEYRING 1
2862 #define VKI_KEYCTL_UPDATE 2
2863 #define VKI_KEYCTL_REVOKE 3
2864 #define VKI_KEYCTL_CHOWN 4
2865 #define VKI_KEYCTL_SETPERM 5
2866 #define VKI_KEYCTL_DESCRIBE 6
2867 #define VKI_KEYCTL_CLEAR 7
2868 #define VKI_KEYCTL_LINK 8
2869 #define VKI_KEYCTL_UNLINK 9
2870 #define VKI_KEYCTL_SEARCH 10
2871 #define VKI_KEYCTL_READ 11
2872 #define VKI_KEYCTL_INSTANTIATE 12
2873 #define VKI_KEYCTL_NEGATE 13
2874 #define VKI_KEYCTL_SET_REQKEY_KEYRING 14
2875 #define VKI_KEYCTL_SET_TIMEOUT 15
2876 #define VKI_KEYCTL_ASSUME_AUTHORITY 16
2877
2878
2879
2880
2881
2882
2883 typedef vki_int32_t vki_key_serial_t;
2884
2885
2886 typedef vki_uint32_t vki_key_perm_t;
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898 #define VKI_SIOCSIWCOMMIT 0x8B00
2899 #define VKI_SIOCGIWNAME 0x8B01
2900
2901
2902 #define VKI_SIOCSIWNWID 0x8B02
2903 #define VKI_SIOCGIWNWID 0x8B03
2904 #define VKI_SIOCSIWFREQ 0x8B04
2905 #define VKI_SIOCGIWFREQ 0x8B05
2906 #define VKI_SIOCSIWMODE 0x8B06
2907 #define VKI_SIOCGIWMODE 0x8B07
2908 #define VKI_SIOCSIWSENS 0x8B08
2909 #define VKI_SIOCGIWSENS 0x8B09
2910
2911
2912 #define VKI_SIOCSIWRANGE 0x8B0A
2913 #define VKI_SIOCGIWRANGE 0x8B0B
2914 #define VKI_SIOCSIWPRIV 0x8B0C
2915 #define VKI_SIOCGIWPRIV 0x8B0D
2916 #define VKI_SIOCSIWSTATS 0x8B0E
2917 #define VKI_SIOCGIWSTATS 0x8B0F
2918
2919
2920 #define VKI_SIOCSIWSPY 0x8B10
2921 #define VKI_SIOCGIWSPY 0x8B11
2922 #define VKI_SIOCSIWTHRSPY 0x8B12
2923 #define VKI_SIOCGIWTHRSPY 0x8B13
2924
2925
2926 #define VKI_SIOCSIWAP 0x8B14
2927 #define VKI_SIOCGIWAP 0x8B15
2928 #define VKI_SIOCGIWAPLIST 0x8B17
2929 #define VKI_SIOCSIWSCAN 0x8B18
2930 #define VKI_SIOCGIWSCAN 0x8B19
2931
2932
2933 #define VKI_SIOCSIWESSID 0x8B1A
2934 #define VKI_SIOCGIWESSID 0x8B1B
2935 #define VKI_SIOCSIWNICKN 0x8B1C
2936 #define VKI_SIOCGIWNICKN 0x8B1D
2937
2938
2939 #define VKI_SIOCSIWRATE 0x8B20
2940 #define VKI_SIOCGIWRATE 0x8B21
2941 #define VKI_SIOCSIWRTS 0x8B22
2942 #define VKI_SIOCGIWRTS 0x8B23
2943 #define VKI_SIOCSIWFRAG 0x8B24
2944 #define VKI_SIOCGIWFRAG 0x8B25
2945 #define VKI_SIOCSIWTXPOW 0x8B26
2946 #define VKI_SIOCGIWTXPOW 0x8B27
2947 #define VKI_SIOCSIWRETRY 0x8B28
2948 #define VKI_SIOCGIWRETRY 0x8B29
2949
2950
2951 #define VKI_SIOCSIWENCODE 0x8B2A
2952 #define VKI_SIOCGIWENCODE 0x8B2B
2953
2954
2955 #define VKI_SIOCSIWPOWER 0x8B2C
2956 #define VKI_SIOCGIWPOWER 0x8B2D
2957
2958
2959 #define VKI_SIOCSIWGENIE 0x8B30
2960 #define VKI_SIOCGIWGENIE 0x8B31
2961
2962
2963 #define VKI_SIOCSIWMLME 0x8B16
2964
2965
2966 #define VKI_SIOCSIWAUTH 0x8B32
2967 #define VKI_SIOCGIWAUTH 0x8B33
2968
2969
2970 #define VKI_SIOCSIWENCODEEXT 0x8B34
2971 #define VKI_SIOCGIWENCODEEXT 0x8B35
2972
2973
2974 #define VKI_SIOCSIWPMKSA 0x8B36
2975
2976
2977
2978
2979
2980 struct vki_iw_param
2981 {
2982 __vki_s32 value;
2983 __vki_u8 fixed;
2984 __vki_u8 disabled;
2985 __vki_u16 flags;
2986 };
2987
2988 struct vki_iw_point
2989 {
2990 void __user *pointer;
2991 __vki_u16 length;
2992 __vki_u16 flags;
2993 };
2994
2995 struct vki_iw_freq
2996 {
2997 __vki_s32 m;
2998 __vki_s16 e;
2999 __vki_u8 i;
3000 __vki_u8 flags;
3001 };
3002
3003 struct vki_iw_quality
3004 {
3005 __vki_u8 qual;
3006
3007 __vki_u8 level;
3008 __vki_u8 noise;
3009 __vki_u8 updated;
3010 };
3011
3012 union vki_iwreq_data
3013 {
3014
3015 char name[VKI_IFNAMSIZ];
3016
3017
3018
3019 struct vki_iw_point essid;
3020 struct vki_iw_param nwid;
3021 struct vki_iw_freq freq;
3022
3023
3024
3025 struct vki_iw_param sens;
3026 struct vki_iw_param bitrate;
3027 struct vki_iw_param txpower;
3028 struct vki_iw_param rts;
3029 struct vki_iw_param frag;
3030 __vki_u32 mode;
3031 struct vki_iw_param retry;
3032
3033 struct vki_iw_point encoding;
3034 struct vki_iw_param power;
3035 struct vki_iw_quality qual;
3036
3037 struct vki_sockaddr ap_addr;
3038 struct vki_sockaddr addr;
3039
3040 struct vki_iw_param param;
3041 struct vki_iw_point data;
3042 };
3043
3044 struct vki_iwreq
3045 {
3046 union
3047 {
3048 char ifrn_name[VKI_IFNAMSIZ];
3049 } ifr_ifrn;
3050
3051
3052 union vki_iwreq_data u;
3053 };
3054
3055
3056
3057
3058
3059 struct vki_perf_event_attr {
3060
3061
3062
3063
3064 __vki_u32 type;
3065
3066
3067
3068
3069 __vki_u32 size;
3070
3071
3072
3073
3074 __vki_u64 config;
3075
3076 union {
3077 __vki_u64 sample_period;
3078 __vki_u64 sample_freq;
3079 };
3080
3081 __vki_u64 sample_type;
3082 __vki_u64 read_format;
3083
3084 __vki_u64 disabled : 1,
3085 inherit : 1,
3086 pinned : 1,
3087 exclusive : 1,
3088 exclude_user : 1,
3089 exclude_kernel : 1,
3090 exclude_hv : 1,
3091 exclude_idle : 1,
3092 mmap : 1,
3093 comm : 1,
3094 freq : 1,
3095 inherit_stat : 1,
3096 enable_on_exec : 1,
3097 task : 1,
3098 watermark : 1,
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109 precise_ip : 2,
3110 mmap_data : 1,
3111 sample_id_all : 1,
3112
3113 __reserved_1 : 45;
3114
3115 union {
3116 __vki_u32 wakeup_events;
3117 __vki_u32 wakeup_watermark;
3118 };
3119
3120 __vki_u32 bp_type;
3121 union {
3122 __vki_u64 bp_addr;
3123 __vki_u64 config1;
3124 };
3125 union {
3126 __vki_u64 bp_len;
3127 __vki_u64 config2;
3128 };
3129 };
3130
3131 #define VKI_PERF_EVENT_IOC_ENABLE _VKI_IO ('$', 0)
3132 #define VKI_PERF_EVENT_IOC_DISABLE _VKI_IO ('$', 1)
3133 #define VKI_PERF_EVENT_IOC_REFRESH _VKI_IO ('$', 2)
3134 #define VKI_PERF_EVENT_IOC_RESET _VKI_IO ('$', 3)
3135 #define VKI_PERF_EVENT_IOC_PERIOD _VKI_IOW('$', 4, __vki_u64)
3136 #define VKI_PERF_EVENT_IOC_SET_OUTPUT _VKI_IO ('$', 5)
3137 #define VKI_PERF_EVENT_IOC_SET_FILTER _VKI_IOW('$', 6, char *)
3138 #define VKI_PERF_EVENT_IOC_ID _VKI_IOR('$', 7, __vki_u64 *)
3139 #define VKI_PERF_EVENT_IOC_SET_BPF _VKI_IOW('$', 8, __vki_u32)
3140
3141
3142
3143
3144
3145 struct vki_getcpu_cache {
3146 unsigned long blob[128 / sizeof(long)];
3147 };
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157 #define VKI_EVIOCGNAME(len) _VKI_IOC(_VKI_IOC_READ, 'E', 0x06, len)
3158 #define VKI_EVIOCGPHYS(len) _VKI_IOC(_VKI_IOC_READ, 'E', 0x07, len)
3159 #define VKI_EVIOCGUNIQ(len) _VKI_IOC(_VKI_IOC_READ, 'E', 0x08, len)
3160
3161 #define VKI_EVIOCGKEY(len) _VKI_IOC(_VKI_IOC_READ, 'E', 0x18, len)
3162 #define VKI_EVIOCGLED(len) _VKI_IOC(_VKI_IOC_READ, 'E', 0x19, len)
3163 #define VKI_EVIOCGSND(len) _VKI_IOC(_VKI_IOC_READ, 'E', 0x1a, len)
3164 #define VKI_EVIOCGSW(len) _VKI_IOC(_VKI_IOC_READ, 'E', 0x1b, len)
3165
3166 #define VKI_EVIOCGBIT(ev,len) _VKI_IOC(_VKI_IOC_READ, 'E', 0x20 + ev, len)
3167
3168
3169
3170
3171
3172 #define VKI_EV_SYN 0x00
3173 #define VKI_EV_KEY 0x01
3174 #define VKI_EV_REL 0x02
3175 #define VKI_EV_ABS 0x03
3176 #define VKI_EV_MSC 0x04
3177 #define VKI_EV_SW 0x05
3178 #define VKI_EV_LED 0x11
3179 #define VKI_EV_SND 0x12
3180 #define VKI_EV_REP 0x14
3181 #define VKI_EV_FF 0x15
3182 #define VKI_EV_PWR 0x16
3183 #define VKI_EV_FF_STATUS 0x17
3184 #define VKI_EV_MAX 0x1f
3185 #define VKI_EV_CNT (VKI_EV_MAX+1)
3186
3187
3188
3189
3190
3191 #ifndef VKI_FIOQSIZE
3192 #define VKI_FIOQSIZE 0x5460
3193 #endif
3194
3195 #ifndef VKI_TIOCSIG
3196 #define VKI_TIOCSIG _VKI_IOW('T', 0x36, int)
3197 #endif
3198
3199
3200
3201
3202
3203 #if defined(VGPV_arm_linux_android) || defined(VGPV_x86_linux_android) \
3204 || defined(VGPV_mips32_linux_android) \
3205 || defined(VGPV_arm64_linux_android)
3206
3207 #define VKI_ASHMEM_NAME_LEN 256
3208
3209 #define VKI_ASHMEM_NAME_DEF "dev/ashmem"
3210
3211 #define VKI_ASHMEM_NOT_PURGED 0
3212 #define VKI_ASHMEM_WAS_PURGED 1
3213
3214 #define VKI_ASHMEM_IS_UNPINNED 0
3215 #define VKI_ASHMEM_IS_PINNED 1
3216
3217 struct vki_ashmem_pin {
3218 vki_uint32_t offset;
3219 vki_uint32_t len;
3220 };
3221
3222 #define __VKI_ASHMEMIOC 0x77
3223
3224 #define VKI_ASHMEM_SET_NAME _VKI_IOW(__VKI_ASHMEMIOC, 1, char[VKI_ASHMEM_NAME_LEN])
3225 #define VKI_ASHMEM_GET_NAME _VKI_IOR(__VKI_ASHMEMIOC, 2, char[VKI_ASHMEM_NAME_LEN])
3226 #define VKI_ASHMEM_SET_SIZE _VKI_IOW(__VKI_ASHMEMIOC, 3, vki_size_t)
3227 #define VKI_ASHMEM_GET_SIZE _VKI_IO(__VKI_ASHMEMIOC, 4)
3228 #define VKI_ASHMEM_SET_PROT_MASK _VKI_IOW(__VKI_ASHMEMIOC, 5, unsigned long)
3229 #define VKI_ASHMEM_GET_PROT_MASK _VKI_IO(__VKI_ASHMEMIOC, 6)
3230 #define VKI_ASHMEM_PIN _VKI_IOW(__VKI_ASHMEMIOC, 7, struct vki_ashmem_pin)
3231 #define VKI_ASHMEM_UNPIN _VKI_IOW(__VKI_ASHMEMIOC, 8, struct vki_ashmem_pin)
3232 #define VKI_ASHMEM_GET_PIN_STATUS _VKI_IO(__VKI_ASHMEMIOC, 9)
3233 #define VKI_ASHMEM_PURGE_ALL_CACHES _VKI_IO(__VKI_ASHMEMIOC, 10)
3234
3235
3236
3237
3238
3239 struct vki_binder_write_read {
3240 signed long write_size;
3241 signed long write_consumed;
3242 unsigned long write_buffer;
3243 signed long read_size;
3244 signed long read_consumed;
3245 unsigned long read_buffer;
3246 };
3247
3248 struct vki_binder_version {
3249 signed long protocol_version;
3250 };
3251
3252 #define VKI_BINDER_WRITE_READ _VKI_IOWR('b', 1, struct vki_binder_write_read)
3253 #define VKI_BINDER_SET_IDLE_TIMEOUT _VKI_IOW('b', 3, vki_int64_t)
3254 #define VKI_BINDER_SET_MAX_THREADS _VKI_IOW('b', 5, vki_size_t)
3255 #define VKI_BINDER_SET_IDLE_PRIORITY _VKI_IOW('b', 6, int)
3256 #define VKI_BINDER_SET_CONTEXT_MGR _VKI_IOW('b', 7, int)
3257 #define VKI_BINDER_THREAD_EXIT _VKI_IOW('b', 8, int)
3258 #define VKI_BINDER_VERSION _VKI_IOWR('b', 9, struct vki_binder_version)
3259
3260 #endif
3261
3262
3263
3264
3265
3266 typedef struct {
3267 __vki_u8 b[6];
3268 } __vki_packed vki_bdaddr_t;
3269
3270
3271
3272
3273
3274 #define VKI_HCIDEVUP _VKI_IOW('H', 201, int)
3275 #define VKI_HCIDEVDOWN _VKI_IOW('H', 202, int)
3276 #define VKI_HCIDEVRESET _VKI_IOW('H', 203, int)
3277 #define VKI_HCIDEVRESTAT _VKI_IOW('H', 204, int)
3278
3279 #define VKI_HCIGETDEVLIST _VKI_IOR('H', 210, int)
3280
3281 struct vki_hci_dev_req {
3282 __vki_u16 dev_id;
3283 __vki_u32 dev_opt;
3284 };
3285
3286 struct vki_hci_dev_list_req {
3287 __vki_u16 dev_num;
3288 struct vki_hci_dev_req dev_req[0];
3289 };
3290
3291 #define VKI_HCIGETDEVINFO _VKI_IOR('H', 211, int)
3292 #define VKI_HCIGETCONNLIST _VKI_IOR('H', 212, int)
3293 #define VKI_HCIGETCONNINFO _VKI_IOR('H', 213, int)
3294 #define VKI_HCIGETAUTHINFO _VKI_IOR('H', 215, int)
3295
3296 #define VKI_HCISETRAW _VKI_IOW('H', 220, int)
3297 #define VKI_HCISETSCAN _VKI_IOW('H', 221, int)
3298 #define VKI_HCISETAUTH _VKI_IOW('H', 222, int)
3299 #define VKI_HCISETENCRYPT _VKI_IOW('H', 223, int)
3300 #define VKI_HCISETPTYPE _VKI_IOW('H', 224, int)
3301 #define VKI_HCISETLINKPOL _VKI_IOW('H', 225, int)
3302 #define VKI_HCISETLINKMODE _VKI_IOW('H', 226, int)
3303 #define VKI_HCISETACLMTU _VKI_IOW('H', 227, int)
3304 #define VKI_HCISETSCOMTU _VKI_IOW('H', 228, int)
3305
3306 #define VKI_HCIBLOCKADDR _VKI_IOW('H', 230, int)
3307 #define VKI_HCIUNBLOCKADDR _VKI_IOW('H', 231, int)
3308
3309 #define VKI_HCIINQUIRY _VKI_IOR('H', 240, int)
3310
3311 struct vki_inquiry_info {
3312 vki_bdaddr_t bdaddr;
3313 __vki_u8 pscan_rep_mode;
3314 __vki_u8 pscan_period_mode;
3315 __vki_u8 pscan_mode;
3316 __vki_u8 dev_class[3];
3317 __vki_le16 clock_offset;
3318 } __vki_packed;
3319
3320 struct vki_hci_inquiry_req {
3321 __vki_u16 dev_id;
3322 __vki_u16 flags;
3323 __vki_u8 lap[3];
3324 __vki_u8 length;
3325 __vki_u8 num_rsp;
3326 };
3327
3328
3329
3330
3331
3332 struct vki_sockaddr_rc {
3333 vki_sa_family_t rc_family;
3334 vki_bdaddr_t rc_bdaddr;
3335 __vki_u8 rc_channel;
3336 };
3337
3338
3339
3340
3341 #define KVMIO 0xAE
3342
3343 #define VKI_KVM_GET_API_VERSION _VKI_IO(KVMIO, 0x00)
3344 #define VKI_KVM_CREATE_VM _VKI_IO(KVMIO, 0x01)
3345 #define VKI_KVM_CHECK_EXTENSION _VKI_IO(KVMIO, 0x03)
3346 #define VKI_KVM_GET_VCPU_MMAP_SIZE _VKI_IO(KVMIO, 0x04)
3347 #define VKI_KVM_S390_ENABLE_SIE _VKI_IO(KVMIO, 0x06)
3348 #define VKI_KVM_CREATE_VCPU _VKI_IO(KVMIO, 0x41)
3349 #define VKI_KVM_SET_NR_MMU_PAGES _VKI_IO(KVMIO, 0x44)
3350 #define VKI_KVM_GET_NR_MMU_PAGES _VKI_IO(KVMIO, 0x45)
3351 #define VKI_KVM_SET_TSS_ADDR _VKI_IO(KVMIO, 0x47)
3352 #define VKI_KVM_CREATE_IRQCHIP _VKI_IO(KVMIO, 0x60)
3353 #define VKI_KVM_CREATE_PIT _VKI_IO(KVMIO, 0x64)
3354 #define VKI_KVM_REINJECT_CONTROL _VKI_IO(KVMIO, 0x71)
3355 #define VKI_KVM_SET_BOOT_CPU_ID _VKI_IO(KVMIO, 0x78)
3356 #define VKI_KVM_SET_TSC_KHZ _VKI_IO(KVMIO, 0xa2)
3357 #define VKI_KVM_GET_TSC_KHZ _VKI_IO(KVMIO, 0xa3)
3358 #define VKI_KVM_RUN _VKI_IO(KVMIO, 0x80)
3359 #define VKI_KVM_S390_INITIAL_RESET _VKI_IO(KVMIO, 0x97)
3360 #define VKI_KVM_NMI _VKI_IO(KVMIO, 0x9a)
3361 #define VKI_KVM_KVMCLOCK_CTRL _VKI_IO(KVMIO, 0xad)
3362
3363 struct vki_kvm_s390_mem_op {
3364
3365 __vki_u64 gaddr;
3366 __vki_u64 flags;
3367 __vki_u32 size;
3368 __vki_u32 op;
3369 __vki_u64 buf;
3370 __vki_u8 ar;
3371 __vki_u8 reserved[31];
3372 };
3373
3374 #define VKI_KVM_S390_MEMOP_LOGICAL_READ 0
3375 #define VKI_KVM_S390_MEMOP_LOGICAL_WRITE 1
3376 #define VKI_KVM_S390_MEMOP_F_CHECK_ONLY (1ULL << 0)
3377 #define VKI_KVM_S390_MEMOP_F_INJECT_EXCEPTION (1ULL << 1)
3378
3379 #define VKI_KVM_S390_MEM_OP _VKI_IOW(KVMIO, 0xb1, struct vki_kvm_s390_mem_op)
3380
3381
3382
3383
3384
3385 struct vki_hwtstamp_config {
3386 int flags;
3387 int tx_type;
3388 int rx_filter;
3389 };
3390
3391
3392
3393
3394
3395 #define VKI_UINPUT_IOCTL_BASE 'U'
3396 #define VKI_UI_DEV_CREATE _VKI_IO(VKI_UINPUT_IOCTL_BASE, 1)
3397 #define VKI_UI_DEV_DESTROY _VKI_IO(VKI_UINPUT_IOCTL_BASE, 2)
3398
3399 #define VKI_UI_SET_EVBIT _VKI_IOW(VKI_UINPUT_IOCTL_BASE, 100, int)
3400 #define VKI_UI_SET_KEYBIT _VKI_IOW(VKI_UINPUT_IOCTL_BASE, 101, int)
3401 #define VKI_UI_SET_RELBIT _VKI_IOW(VKI_UINPUT_IOCTL_BASE, 102, int)
3402 #define VKI_UI_SET_ABSBIT _VKI_IOW(VKI_UINPUT_IOCTL_BASE, 103, int)
3403 #define VKI_UI_SET_MSCBIT _VKI_IOW(VKI_UINPUT_IOCTL_BASE, 104, int)
3404 #define VKI_UI_SET_LEDBIT _VKI_IOW(VKI_UINPUT_IOCTL_BASE, 105, int)
3405 #define VKI_UI_SET_SNDBIT _VKI_IOW(VKI_UINPUT_IOCTL_BASE, 106, int)
3406 #define VKI_UI_SET_FFBIT _VKI_IOW(VKI_UINPUT_IOCTL_BASE, 107, int)
3407 #define VKI_UI_SET_SWBIT _VKI_IOW(VKI_UINPUT_IOCTL_BASE, 109, int)
3408 #define VKI_UI_SET_PROPBIT _VKI_IOW(VKI_UINPUT_IOCTL_BASE, 110, int)
3409
3410
3411
3412
3413
3414 #define VKI_IB_IOCTL_MAGIC 0x1b
3415
3416 #define VKI_IB_USER_MAD_REGISTER_AGENT _VKI_IOWR(VKI_IB_IOCTL_MAGIC, 1, \
3417 struct ib_user_mad_reg_req)
3418
3419 #define VKI_IB_USER_MAD_UNREGISTER_AGENT _VKI_IOW(VKI_IB_IOCTL_MAGIC, 2, __u32)
3420
3421 #define VKI_IB_USER_MAD_ENABLE_PKEY _VKI_IO(VKI_IB_IOCTL_MAGIC, 3)
3422
3423
3424
3425
3426
3427 #define VKI_TUNSETNOCSUM _VKI_IOW('T', 200, int)
3428 #define VKI_TUNSETDEBUG _VKI_IOW('T', 201, int)
3429 #define VKI_TUNSETIFF _VKI_IOW('T', 202, int)
3430 #define VKI_TUNSETPERSIST _VKI_IOW('T', 203, int)
3431 #define VKI_TUNSETOWNER _VKI_IOW('T', 204, int)
3432 #define VKI_TUNSETLINK _VKI_IOW('T', 205, int)
3433 #define VKI_TUNSETGROUP _VKI_IOW('T', 206, int)
3434 #define VKI_TUNGETFEATURES _VKI_IOR('T', 207, unsigned int)
3435 #define VKI_TUNSETOFFLOAD _VKI_IOW('T', 208, unsigned int)
3436 #define VKI_TUNSETTXFILTER _VKI_IOW('T', 209, unsigned int)
3437 #define VKI_TUNGETIFF _VKI_IOR('T', 210, unsigned int)
3438 #define VKI_TUNGETSNDBUF _VKI_IOR('T', 211, int)
3439 #define VKI_TUNSETSNDBUF _VKI_IOW('T', 212, int)
3440
3441
3442 #define VKI_TUNGETVNETHDRSZ _VKI_IOR('T', 215, int)
3443 #define VKI_TUNSETVNETHDRSZ _VKI_IOW('T', 216, int)
3444 #define VKI_TUNSETQUEUE _VKI_IOW('T', 217, int)
3445 #define VKI_TUNSETIFINDEX _VKI_IOW('T', 218, unsigned int)
3446
3447
3448
3449
3450
3451
3452 #define VKI_VHOST_VIRTIO 0xAF
3453 #define VKI_VHOST_SET_OWNER _VKI_IO(VKI_VHOST_VIRTIO, 0x01)
3454 #define VKI_VHOST_RESET_OWNER _VKI_IO(VKI_VHOST_VIRTIO, 0x02)
3455
3456
3457
3458
3459
3460 typedef unsigned long __vki_xen_pfn_t;
3461
3462 struct vki_xen_privcmd_hypercall {
3463 __vki_u64 op;
3464 __vki_u64 arg[5];
3465 };
3466
3467 struct vki_xen_privcmd_mmap_entry {
3468 __vki_u64 va;
3469 __vki_u64 mfn;
3470 __vki_u64 npages;
3471 };
3472
3473 struct vki_xen_privcmd_mmap {
3474 int num;
3475 __vki_u16 dom;
3476 struct vki_xen_privcmd_mmap_entry *entry;
3477 };
3478
3479 struct vki_xen_privcmd_mmapbatch {
3480 int num;
3481 __vki_u16 dom;
3482 __vki_u64 addr;
3483 __vki_xen_pfn_t *arr;
3484 };
3485
3486 struct vki_xen_privcmd_mmapbatch_v2 {
3487 unsigned int num;
3488 __vki_u16 dom;
3489 __vki_u64 addr;
3490 const __vki_xen_pfn_t *arr;
3491 int __user *err;
3492 };
3493
3494 #define VKI_XEN_IOCTL_PRIVCMD_HYPERCALL _VKI_IOC(_VKI_IOC_NONE, 'P', 0, sizeof(struct vki_xen_privcmd_hypercall))
3495 #define VKI_XEN_IOCTL_PRIVCMD_MMAP _VKI_IOC(_VKI_IOC_NONE, 'P', 2, sizeof(struct vki_xen_privcmd_mmap))
3496
3497 #define VKI_XEN_IOCTL_PRIVCMD_MMAPBATCH _VKI_IOC(_VKI_IOC_NONE, 'P', 3, sizeof(struct vki_xen_privcmd_mmapbatch))
3498 #define VKI_XEN_IOCTL_PRIVCMD_MMAPBATCH_V2 _VKI_IOC(_VKI_IOC_NONE, 'P', 4, sizeof(struct vki_xen_privcmd_mmapbatch_v2))
3499
3500
3501
3502
3503
3504 #define VKI_XEN_IOCTL_EVTCHN_BIND_VIRQ \
3505 _VKI_IOC(_VKI_IOC_NONE, 'E', 0, sizeof(struct vki_xen_ioctl_evtchn_bind_virq))
3506 struct vki_xen_ioctl_evtchn_bind_virq {
3507 vki_uint32_t virq;
3508 };
3509
3510 #define VKI_XEN_IOCTL_EVTCHN_BIND_INTERDOMAIN \
3511 _VKI_IOC(_VKI_IOC_NONE, 'E', 1, sizeof(struct vki_xen_ioctl_evtchn_bind_interdomain))
3512 struct vki_xen_ioctl_evtchn_bind_interdomain {
3513 vki_uint32_t remote_domain;
3514 vki_uint32_t remote_port;
3515 };
3516
3517 #define VKI_XEN_IOCTL_EVTCHN_BIND_UNBOUND_PORT \
3518 _VKI_IOC(_VKI_IOC_NONE, 'E', 2, sizeof(struct vki_xen_ioctl_evtchn_bind_unbound_port))
3519 struct vki_xen_ioctl_evtchn_bind_unbound_port {
3520 vki_uint32_t remote_domain;
3521 };
3522
3523 #define VKI_XEN_IOCTL_EVTCHN_UNBIND \
3524 _VKI_IOC(_VKI_IOC_NONE, 'E', 3, sizeof(struct vki_xen_ioctl_evtchn_unbind))
3525 struct vki_xen_ioctl_evtchn_unbind {
3526 vki_uint32_t port;
3527 };
3528
3529 #define VKI_XEN_IOCTL_EVTCHN_NOTIFY \
3530 _VKI_IOC(_VKI_IOC_NONE, 'E', 4, sizeof(struct vki_xen_ioctl_evtchn_notify))
3531 struct vki_xen_ioctl_evtchn_notify {
3532 vki_uint32_t port;
3533 };
3534
3535 #define VKI_XEN_IOCTL_EVTCHN_RESET \
3536 _VKI_IOC(_VKI_IOC_NONE, 'E', 5, 0)
3537
3538
3539
3540
3541
3542
3543 struct vki_file_handle {
3544 __vki_u32 handle_bytes;
3545 int handle_type;
3546
3547 unsigned char f_handle[0];
3548 };
3549
3550
3551
3552
3553
3554 struct vki_sock_filter {
3555 __vki_u16 code;
3556 __vki_u8 jt;
3557 __vki_u8 jf;
3558 __vki_u32 k;
3559 };
3560
3561 struct vki_sock_fprog {
3562 __vki_u16 len;
3563 struct vki_sock_filter *filter;
3564 };
3565
3566
3567
3568
3569
3570 struct vki_ethtool_cmd {
3571 __vki_u32 cmd;
3572 __vki_u32 supported;
3573 __vki_u32 advertising;
3574 __vki_u16 speed;
3575 __vki_u8 duplex;
3576 __vki_u8 port;
3577 __vki_u8 phy_address;
3578 __vki_u8 transceiver;
3579 __vki_u8 autoneg;
3580 __vki_u8 mdio_support;
3581 __vki_u32 maxtxpkt;
3582 __vki_u32 maxrxpkt;
3583 __vki_u16 speed_hi;
3584 __vki_u8 eth_tp_mdix;
3585 __vki_u8 eth_tp_mdix_ctrl;
3586 __vki_u32 lp_advertising;
3587 __vki_u32 reserved[2];
3588 };
3589
3590 #define VKI_ETHTOOL_FWVERS_LEN 32
3591 #define VKI_ETHTOOL_BUSINFO_LEN 32
3592
3593 struct vki_ethtool_drvinfo {
3594 __vki_u32 cmd;
3595 char driver[32];
3596 char version[32];
3597 char fw_version[VKI_ETHTOOL_FWVERS_LEN];
3598 char bus_info[VKI_ETHTOOL_BUSINFO_LEN];
3599 char reserved1[32];
3600 char reserved2[12];
3601 __vki_u32 n_priv_flags;
3602 __vki_u32 n_stats;
3603 __vki_u32 testinfo_len;
3604 __vki_u32 eedump_len;
3605 __vki_u32 regdump_len;
3606 };
3607
3608 #define VKI_SOPASS_MAX 6
3609
3610 struct vki_ethtool_wolinfo {
3611 __vki_u32 cmd;
3612 __vki_u32 supported;
3613 __vki_u32 wolopts;
3614 __vki_u8 sopass[VKI_SOPASS_MAX];
3615 };
3616
3617 struct vki_ethtool_value {
3618 __vki_u32 cmd;
3619 __vki_u32 data;
3620 };
3621
3622 struct vki_ethtool_regs {
3623 __vki_u32 cmd;
3624 __vki_u32 version;
3625 __vki_u32 len;
3626 __vki_u8 data[0];
3627 };
3628
3629 struct vki_ethtool_ringparam {
3630 __vki_u32 cmd;
3631 __vki_u32 rx_max_pending;
3632 __vki_u32 rx_mini_max_pending;
3633 __vki_u32 rx_jumbo_max_pending;
3634 __vki_u32 tx_max_pending;
3635 __vki_u32 rx_pending;
3636 __vki_u32 rx_mini_pending;
3637 __vki_u32 rx_jumbo_pending;
3638 __vki_u32 tx_pending;
3639 };
3640
3641 struct vki_ethtool_channels {
3642 __vki_u32 cmd;
3643 __vki_u32 max_rx;
3644 __vki_u32 max_tx;
3645 __vki_u32 max_other;
3646 __vki_u32 max_combined;
3647 __vki_u32 rx_count;
3648 __vki_u32 tx_count;
3649 __vki_u32 other_count;
3650 __vki_u32 combined_count;
3651 };
3652
3653 struct vki_ethtool_sset_info {
3654 __vki_u32 cmd;
3655 __vki_u32 reserved;
3656 __vki_u64 sset_mask;
3657 __vki_u32 data[0];
3658 };
3659
3660 struct vki_ethtool_test {
3661 __vki_u32 cmd;
3662 __vki_u32 flags;
3663 __vki_u32 reserved;
3664 __vki_u32 len;
3665 __vki_u64 data[0];
3666 };
3667
3668 struct vki_ethtool_perm_addr {
3669 __vki_u32 cmd;
3670 __vki_u32 size;
3671 __vki_u8 data[0];
3672 };
3673
3674 struct vki_ethtool_get_features_block {
3675 __vki_u32 available;
3676 __vki_u32 requested;
3677 __vki_u32 active;
3678 __vki_u32 never_changed;
3679 };
3680
3681 struct vki_ethtool_gfeatures {
3682 __vki_u32 cmd;
3683 __vki_u32 size;
3684 struct vki_ethtool_get_features_block features[0];
3685 };
3686
3687 struct vki_ethtool_set_features_block {
3688 __vki_u32 valid;
3689 __vki_u32 requested;
3690 };
3691
3692 struct vki_ethtool_sfeatures {
3693 __vki_u32 cmd;
3694 __vki_u32 size;
3695 struct vki_ethtool_set_features_block features[0];
3696 };
3697
3698 struct vki_ethtool_ts_info {
3699 __vki_u32 cmd;
3700 __vki_u32 so_timestamping;
3701 __vki_s32 phc_index;
3702 __vki_u32 tx_types;
3703 __vki_u32 tx_reserved[3];
3704 __vki_u32 rx_filters;
3705 __vki_u32 rx_reserved[3];
3706 };
3707
3708 #define VKI_ETHTOOL_GSET 0x00000001
3709 #define VKI_ETHTOOL_SSET 0x00000002
3710 #define VKI_ETHTOOL_GDRVINFO 0x00000003
3711 #define VKI_ETHTOOL_GREGS 0x00000004
3712 #define VKI_ETHTOOL_GWOL 0x00000005
3713 #define VKI_ETHTOOL_SWOL 0x00000006
3714 #define VKI_ETHTOOL_GMSGLVL 0x00000007
3715 #define VKI_ETHTOOL_SMSGLVL 0x00000008
3716 #define VKI_ETHTOOL_NWAY_RST 0x00000009
3717 #define VKI_ETHTOOL_GLINK 0x0000000a
3718 #define VKI_ETHTOOL_GRINGPARAM 0x00000010
3719 #define VKI_ETHTOOL_SRINGPARAM 0x00000011
3720 #define VKI_ETHTOOL_GRXCSUM 0x00000014
3721 #define VKI_ETHTOOL_SRXCSUM 0x00000015
3722 #define VKI_ETHTOOL_GTXCSUM 0x00000016
3723 #define VKI_ETHTOOL_STXCSUM 0x00000017
3724 #define VKI_ETHTOOL_GSG 0x00000018
3725
3726 #define VKI_ETHTOOL_SSG 0x00000019
3727
3728 #define VKI_ETHTOOL_TEST 0x0000001a
3729 #define VKI_ETHTOOL_PHYS_ID 0x0000001c
3730 #define VKI_ETHTOOL_GTSO 0x0000001e
3731 #define VKI_ETHTOOL_STSO 0x0000001f
3732 #define VKI_ETHTOOL_GPERMADDR 0x00000020
3733 #define VKI_ETHTOOL_GUFO 0x00000021
3734 #define VKI_ETHTOOL_SUFO 0x00000022
3735 #define VKI_ETHTOOL_GGSO 0x00000023
3736 #define VKI_ETHTOOL_SGSO 0x00000024
3737 #define VKI_ETHTOOL_GFLAGS 0x00000025
3738 #define VKI_ETHTOOL_SFLAGS 0x00000026
3739 #define VKI_ETHTOOL_GGRO 0x0000002b
3740 #define VKI_ETHTOOL_SGRO 0x0000002c
3741 #define VKI_ETHTOOL_RESET 0x00000034
3742 #define VKI_ETHTOOL_GSSET_INFO 0x00000037
3743 #define VKI_ETHTOOL_GFEATURES 0x0000003a
3744 #define VKI_ETHTOOL_SFEATURES 0x0000003b
3745 #define VKI_ETHTOOL_GCHANNELS 0x0000003c
3746 #define VKI_ETHTOOL_SCHANNELS 0x0000003d
3747 #define VKI_ETHTOOL_GET_TS_INFO 0x00000041
3748
3749
3750
3751
3752
3753 typedef int vki_ion_user_handle_t;
3754
3755 struct vki_ion_allocation_data {
3756 vki_size_t len;
3757 vki_size_t align;
3758 unsigned int heap_id_mask;
3759 unsigned int flags;
3760 vki_ion_user_handle_t handle;
3761 };
3762
3763 struct vki_ion_fd_data {
3764 vki_ion_user_handle_t handle;
3765 int fd;
3766 };
3767
3768 struct vki_ion_handle_data {
3769 vki_ion_user_handle_t handle;
3770 };
3771
3772 struct vki_ion_custom_data {
3773 unsigned int cmd;
3774 unsigned long arg;
3775 };
3776
3777 #define VKI_ION_IOC_MAGIC 'I'
3778
3779 #define VKI_ION_IOC_ALLOC \
3780 _VKI_IOWR(VKI_ION_IOC_MAGIC, 0, struct vki_ion_allocation_data)
3781
3782 #define VKI_ION_IOC_FREE \
3783 _VKI_IOWR(VKI_ION_IOC_MAGIC, 1, struct vki_ion_handle_data)
3784
3785 #define VKI_ION_IOC_MAP \
3786 _VKI_IOWR(VKI_ION_IOC_MAGIC, 2, struct vki_ion_fd_data)
3787
3788 #define VKI_ION_IOC_SHARE \
3789 _VKI_IOWR(VKI_ION_IOC_MAGIC, 4, struct vki_ion_fd_data)
3790
3791 #define VKI_ION_IOC_IMPORT \
3792 _VKI_IOWR(VKI_ION_IOC_MAGIC, 5, struct vki_ion_fd_data)
3793
3794 #define VKI_ION_IOC_SYNC \
3795 _VKI_IOWR(VKI_ION_IOC_MAGIC, 7, struct vki_ion_fd_data)
3796
3797 #define VKI_ION_IOC_CUSTOM \
3798 _VKI_IOWR(VKI_ION_IOC_MAGIC, 6, struct vki_ion_custom_data)
3799
3800
3801
3802
3803
3804 struct vki_sync_merge_data {
3805 __vki_s32 fd2;
3806 char name[32];
3807 __vki_s32 fence;
3808 };
3809
3810 struct vki_sync_pt_info {
3811 __vki_u32 len;
3812 char obj_name[32];
3813 char driver_name[32];
3814 __vki_s32 status;
3815 __vki_u64 timestamp_ns;
3816 __vki_u8 driver_data[0];
3817 };
3818
3819 struct vki_sync_fence_info_data {
3820 __vki_u32 len;
3821 char name[32];
3822 __vki_s32 status;
3823 __vki_u8 pt_info[0];
3824 };
3825
3826 #define VKI_SYNC_IOC_MAGIC '>'
3827
3828 #define VKI_SYNC_IOC_WAIT \
3829 _VKI_IOW(VKI_SYNC_IOC_MAGIC, 0, __vki_s32)
3830
3831 #define VKI_SYNC_IOC_MERGE \
3832 _VKI_IOWR(VKI_SYNC_IOC_MAGIC, 1, struct vki_sync_merge_data)
3833
3834 #define VKI_SYNC_IOC_FENCE_INFO \
3835 _VKI_IOWR(VKI_SYNC_IOC_MAGIC, 2, struct vki_sync_fence_info_data)
3836
3837
3838
3839
3840
3841 struct vki_lu_fid {
3842 __vki_u64 f_seq;
3843 __vki_u32 f_oid;
3844 __vki_u32 f_ver;
3845 };
3846
3847
3848
3849
3850
3851 struct vki_getinfo_fid2path {
3852 struct vki_lu_fid gf_fid;
3853 __vki_u64 gf_recno;
3854 __vki_u32 gf_linkno;
3855 __vki_u32 gf_pathlen;
3856 char gf_path[0];
3857 } __attribute__((packed));
3858
3859
3860
3861
3862
3863 #define VKI_OBD_IOC_DATA_TYPE long
3864
3865
3866
3867
3868
3869 #define VKI_OBD_IOC_FID2PATH \
3870 _VKI_IOWR ('f', 150, VKI_OBD_IOC_DATA_TYPE)
3871 #define VKI_LL_IOC_PATH2FID \
3872 _VKI_IOR ('f', 173, long)
3873
3874
3875
3876
3877
3878 struct vki_getparent {
3879 struct vki_lu_fid gp_fid;
3880 __vki_u32 gp_linkno;
3881 __vki_u32 gp_name_size;
3882 char gp_name[0];
3883 } __attribute__((packed));
3884
3885
3886
3887
3888 #define VKI_LL_IOC_GROUP_LOCK \
3889 _VKI_IOW('f', 158, long)
3890 #define VKI_LL_IOC_GROUP_UNLOCK \
3891 _VKI_IOW('f', 159, long)
3892 #define VKI_LL_IOC_GETPARENT \
3893 _VKI_IOWR('f', 249, struct vki_getparent)
3894
3895
3896 struct vki_v4l2_rect {
3897 __vki_s32 left;
3898 __vki_s32 top;
3899 __vki_u32 width;
3900 __vki_u32 height;
3901 };
3902
3903 struct vki_v4l2_fract {
3904 __vki_u32 numerator;
3905 __vki_u32 denominator;
3906 };
3907
3908 struct vki_v4l2_capability {
3909 __vki_u8 driver[16];
3910 __vki_u8 card[32];
3911 __vki_u8 bus_info[32];
3912 __vki_u32 version;
3913 __vki_u32 capabilities;
3914 __vki_u32 device_caps;
3915 __vki_u32 reserved[3];
3916 };
3917
3918 struct vki_v4l2_pix_format {
3919 __vki_u32 width;
3920 __vki_u32 height;
3921 __vki_u32 pixelformat;
3922 __vki_u32 field;
3923 __vki_u32 bytesperline;
3924 __vki_u32 sizeimage;
3925 __vki_u32 colorspace;
3926 __vki_u32 priv;
3927 __vki_u32 flags;
3928 __vki_u32 ycbcr_enc;
3929 __vki_u32 quantization;
3930 };
3931
3932 struct vki_v4l2_fmtdesc {
3933 __vki_u32 index;
3934 __vki_u32 type;
3935 __vki_u32 flags;
3936 __vki_u8 description[32];
3937 __vki_u32 pixelformat;
3938 __vki_u32 reserved[4];
3939 };
3940
3941 struct vki_v4l2_frmsize_discrete {
3942 __vki_u32 width;
3943 __vki_u32 height;
3944 };
3945
3946 struct vki_v4l2_frmsize_stepwise {
3947 __vki_u32 min_width;
3948 __vki_u32 max_width;
3949 __vki_u32 step_width;
3950 __vki_u32 min_height;
3951 __vki_u32 max_height;
3952 __vki_u32 step_height;
3953 };
3954
3955 struct vki_v4l2_frmsizeenum {
3956 __vki_u32 index;
3957 __vki_u32 pixel_format;
3958 __vki_u32 type;
3959
3960 union {
3961 struct vki_v4l2_frmsize_discrete discrete;
3962 struct vki_v4l2_frmsize_stepwise stepwise;
3963 };
3964
3965 __vki_u32 reserved[2];
3966 };
3967
3968 struct vki_v4l2_frmival_stepwise {
3969 struct vki_v4l2_fract min;
3970 struct vki_v4l2_fract max;
3971 struct vki_v4l2_fract step;
3972 };
3973
3974 struct vki_v4l2_frmivalenum {
3975 __vki_u32 index;
3976 __vki_u32 pixel_format;
3977 __vki_u32 width;
3978 __vki_u32 height;
3979 __vki_u32 type;
3980
3981 union {
3982 struct vki_v4l2_fract discrete;
3983 struct vki_v4l2_frmival_stepwise stepwise;
3984 };
3985
3986 __vki_u32 reserved[2];
3987 };
3988
3989 struct vki_v4l2_timecode {
3990 __vki_u32 type;
3991 __vki_u32 flags;
3992 __vki_u8 frames;
3993 __vki_u8 seconds;
3994 __vki_u8 minutes;
3995 __vki_u8 hours;
3996 __vki_u8 userbits[4];
3997 };
3998
3999 struct vki_v4l2_jpegcompression {
4000 int quality;
4001 int APPn;
4002 int APP_len;
4003 char APP_data[60];
4004 int COM_len;
4005 char COM_data[60];
4006 __vki_u32 jpeg_markers;
4007 };
4008
4009 struct vki_v4l2_requestbuffers {
4010 __vki_u32 count;
4011 __vki_u32 type;
4012 __vki_u32 memory;
4013 __vki_u32 reserved[2];
4014 };
4015
4016 struct vki_v4l2_plane {
4017 __vki_u32 bytesused;
4018 __vki_u32 length;
4019 union {
4020 __vki_u32 mem_offset;
4021 unsigned long userptr;
4022 __vki_s32 fd;
4023 } m;
4024 __vki_u32 data_offset;
4025 __vki_u32 reserved[11];
4026 };
4027
4028 #define VKI_V4L2_MEMORY_MMAP 1
4029 #define VKI_V4L2_MEMORY_DMABUF 4
4030 #define VKI_V4L2_BUF_FLAG_TIMESTAMP_MASK 0x0000e000
4031 #define VKI_V4L2_BUF_FLAG_TIMESTAMP_COPY 0x00004000
4032 struct vki_v4l2_buffer {
4033 __vki_u32 index;
4034 __vki_u32 type;
4035 __vki_u32 bytesused;
4036 __vki_u32 flags;
4037 __vki_u32 field;
4038 struct vki_timeval timestamp;
4039 struct vki_v4l2_timecode timecode;
4040 __vki_u32 sequence;
4041
4042
4043 __vki_u32 memory;
4044 union {
4045 __vki_u32 offset;
4046 unsigned long userptr;
4047 struct vki_v4l2_plane *planes;
4048 __vki_s32 fd;
4049 } m;
4050 __vki_u32 length;
4051 __vki_u32 reserved2;
4052 __vki_u32 reserved;
4053 };
4054
4055 struct vki_v4l2_exportbuffer {
4056 __vki_u32 type;
4057 __vki_u32 index;
4058 __vki_u32 plane;
4059 __vki_u32 flags;
4060 __vki_s32 fd;
4061 __vki_u32 reserved[11];
4062 };
4063
4064 struct vki_v4l2_framebuffer {
4065 __vki_u32 capability;
4066 __vki_u32 flags;
4067 void *base;
4068 struct {
4069 __vki_u32 width;
4070 __vki_u32 height;
4071 __vki_u32 pixelformat;
4072 __vki_u32 field;
4073 __vki_u32 bytesperline;
4074 __vki_u32 sizeimage;
4075 __vki_u32 colorspace;
4076 __vki_u32 priv;
4077 } fmt;
4078 };
4079
4080 struct vki_v4l2_clip {
4081 struct vki_v4l2_rect c;
4082 struct vki_v4l2_clip __user *next;
4083 };
4084
4085 struct vki_v4l2_window {
4086 struct vki_v4l2_rect w;
4087 __vki_u32 field;
4088 __vki_u32 chromakey;
4089 struct vki_v4l2_clip __user *clips;
4090 __vki_u32 clipcount;
4091 void __user *bitmap;
4092 __vki_u8 global_alpha;
4093 };
4094
4095 struct vki_v4l2_captureparm {
4096 __vki_u32 capability;
4097 __vki_u32 capturemode;
4098 struct vki_v4l2_fract timeperframe;
4099 __vki_u32 extendedmode;
4100 __vki_u32 readbuffers;
4101 __vki_u32 reserved[4];
4102 };
4103
4104 struct vki_v4l2_outputparm {
4105 __vki_u32 capability;
4106 __vki_u32 outputmode;
4107 struct vki_v4l2_fract timeperframe;
4108 __vki_u32 extendedmode;
4109 __vki_u32 writebuffers;
4110 __vki_u32 reserved[4];
4111 };
4112
4113 struct vki_v4l2_cropcap {
4114 __vki_u32 type;
4115 struct vki_v4l2_rect bounds;
4116 struct vki_v4l2_rect defrect;
4117 struct vki_v4l2_fract pixelaspect;
4118 };
4119
4120 struct vki_v4l2_crop {
4121 __vki_u32 type;
4122 struct vki_v4l2_rect c;
4123 };
4124
4125 struct vki_v4l2_selection {
4126 __vki_u32 type;
4127 __vki_u32 target;
4128 __vki_u32 flags;
4129 struct vki_v4l2_rect r;
4130 __vki_u32 reserved[9];
4131 };
4132
4133 typedef __vki_u64 vki_v4l2_std_id;
4134
4135 struct vki_v4l2_standard {
4136 __vki_u32 index;
4137 vki_v4l2_std_id id;
4138 __vki_u8 name[24];
4139 struct vki_v4l2_fract frameperiod;
4140 __vki_u32 framelines;
4141 __vki_u32 reserved[4];
4142 };
4143
4144 struct vki_v4l2_bt_timings {
4145 __vki_u32 width;
4146 __vki_u32 height;
4147 __vki_u32 interlaced;
4148 __vki_u32 polarities;
4149 __vki_u64 pixelclock;
4150 __vki_u32 hfrontporch;
4151 __vki_u32 hsync;
4152 __vki_u32 hbackporch;
4153 __vki_u32 vfrontporch;
4154 __vki_u32 vsync;
4155 __vki_u32 vbackporch;
4156 __vki_u32 il_vfrontporch;
4157 __vki_u32 il_vsync;
4158 __vki_u32 il_vbackporch;
4159 __vki_u32 standards;
4160 __vki_u32 flags;
4161 __vki_u32 reserved[14];
4162 } __attribute__ ((packed));
4163
4164 struct vki_v4l2_dv_timings {
4165 __vki_u32 type;
4166 union {
4167 struct vki_v4l2_bt_timings bt;
4168 __vki_u32 reserved[32];
4169 };
4170 } __attribute__ ((packed));
4171
4172 struct vki_v4l2_enum_dv_timings {
4173 __vki_u32 index;
4174 __vki_u32 pad;
4175 __vki_u32 reserved[2];
4176 struct vki_v4l2_dv_timings timings;
4177 };
4178
4179 struct vki_v4l2_bt_timings_cap {
4180 __vki_u32 min_width;
4181 __vki_u32 max_width;
4182 __vki_u32 min_height;
4183 __vki_u32 max_height;
4184 __vki_u64 min_pixelclock;
4185 __vki_u64 max_pixelclock;
4186 __vki_u32 standards;
4187 __vki_u32 capabilities;
4188 __vki_u32 reserved[16];
4189 } __attribute__ ((packed));
4190
4191 struct vki_v4l2_dv_timings_cap {
4192 __vki_u32 type;
4193 __vki_u32 pad;
4194 __vki_u32 reserved[2];
4195 union {
4196 struct vki_v4l2_bt_timings_cap bt;
4197 __vki_u32 raw_data[32];
4198 };
4199 };
4200
4201 struct vki_v4l2_input {
4202 __vki_u32 index;
4203 __vki_u8 name[32];
4204 __vki_u32 type;
4205 __vki_u32 audioset;
4206 __vki_u32 tuner;
4207 vki_v4l2_std_id std;
4208 __vki_u32 status;
4209 __vki_u32 capabilities;
4210 __vki_u32 reserved[3];
4211 };
4212
4213 struct vki_v4l2_output {
4214 __vki_u32 index;
4215 __vki_u8 name[32];
4216 __vki_u32 type;
4217 __vki_u32 audioset;
4218 __vki_u32 modulator;
4219 vki_v4l2_std_id std;
4220 __vki_u32 capabilities;
4221 __vki_u32 reserved[3];
4222 };
4223
4224 struct vki_v4l2_control {
4225 __vki_u32 id;
4226 __vki_s32 value;
4227 };
4228
4229 struct vki_v4l2_ext_control {
4230 __vki_u32 id;
4231 __vki_u32 size;
4232 __vki_u32 reserved2[1];
4233 union {
4234 __vki_s32 value;
4235 __vki_s64 value64;
4236 char *string;
4237 __vki_u8 *p_u8;
4238 __vki_u16 *p_u16;
4239 __vki_u32 *p_u32;
4240 void *ptr;
4241 };
4242 } __attribute__ ((packed));
4243
4244 struct vki_v4l2_ext_controls {
4245 __vki_u32 ctrl_class;
4246 __vki_u32 count;
4247 __vki_u32 error_idx;
4248 __vki_u32 reserved[2];
4249 struct vki_v4l2_ext_control *controls;
4250 };
4251
4252 struct vki_v4l2_queryctrl {
4253 __vki_u32 id;
4254 __vki_u32 type;
4255 __vki_u8 name[32];
4256 __vki_s32 minimum;
4257 __vki_s32 maximum;
4258 __vki_s32 step;
4259 __vki_s32 default_value;
4260 __vki_u32 flags;
4261 __vki_u32 reserved[2];
4262 };
4263
4264 #define VKI_V4L2_CTRL_MAX_DIMS (4)
4265 struct vki_v4l2_query_ext_ctrl {
4266 __vki_u32 id;
4267 __vki_u32 type;
4268 char name[32];
4269 __vki_s64 minimum;
4270 __vki_s64 maximum;
4271 __vki_u64 step;
4272 __vki_s64 default_value;
4273 __vki_u32 flags;
4274 __vki_u32 elem_size;
4275 __vki_u32 elems;
4276 __vki_u32 nr_of_dims;
4277 __vki_u32 dims[VKI_V4L2_CTRL_MAX_DIMS];
4278 __vki_u32 reserved[32];
4279 };
4280
4281 struct vki_v4l2_querymenu {
4282 __vki_u32 id;
4283 __vki_u32 index;
4284 union {
4285 __vki_u8 name[32];
4286 __vki_s64 value;
4287 };
4288 __vki_u32 reserved;
4289 } __attribute__ ((packed));
4290
4291 struct vki_v4l2_tuner {
4292 __vki_u32 index;
4293 __vki_u8 name[32];
4294 __vki_u32 type;
4295 __vki_u32 capability;
4296 __vki_u32 rangelow;
4297 __vki_u32 rangehigh;
4298 __vki_u32 rxsubchans;
4299 __vki_u32 audmode;
4300 __vki_s32 signal;
4301 __vki_s32 afc;
4302 __vki_u32 reserved[4];
4303 };
4304
4305 struct vki_v4l2_modulator {
4306 __vki_u32 index;
4307 __vki_u8 name[32];
4308 __vki_u32 capability;
4309 __vki_u32 rangelow;
4310 __vki_u32 rangehigh;
4311 __vki_u32 txsubchans;
4312 __vki_u32 reserved[4];
4313 };
4314
4315 struct vki_v4l2_frequency {
4316 __vki_u32 tuner;
4317 __vki_u32 type;
4318 __vki_u32 frequency;
4319 __vki_u32 reserved[8];
4320 };
4321
4322 struct vki_v4l2_frequency_band {
4323 __vki_u32 tuner;
4324 __vki_u32 type;
4325 __vki_u32 index;
4326 __vki_u32 capability;
4327 __vki_u32 rangelow;
4328 __vki_u32 rangehigh;
4329 __vki_u32 modulation;
4330 __vki_u32 reserved[9];
4331 };
4332
4333 struct vki_v4l2_hw_freq_seek {
4334 __vki_u32 tuner;
4335 __vki_u32 type;
4336 __vki_u32 seek_upward;
4337 __vki_u32 wrap_around;
4338 __vki_u32 spacing;
4339 __vki_u32 rangelow;
4340 __vki_u32 rangehigh;
4341 __vki_u32 reserved[5];
4342 };
4343
4344 struct vki_v4l2_audio {
4345 __vki_u32 index;
4346 __vki_u8 name[32];
4347 __vki_u32 capability;
4348 __vki_u32 mode;
4349 __vki_u32 reserved[2];
4350 };
4351
4352 struct vki_v4l2_audioout {
4353 __vki_u32 index;
4354 __vki_u8 name[32];
4355 __vki_u32 capability;
4356 __vki_u32 mode;
4357 __vki_u32 reserved[2];
4358 };
4359
4360 struct vki_v4l2_enc_idx_entry {
4361 __vki_u64 offset;
4362 __vki_u64 pts;
4363 __vki_u32 length;
4364 __vki_u32 flags;
4365 __vki_u32 reserved[2];
4366 };
4367
4368 #define VKI_V4L2_ENC_IDX_ENTRIES (64)
4369 struct vki_v4l2_enc_idx {
4370 __vki_u32 entries;
4371 __vki_u32 entries_cap;
4372 __vki_u32 reserved[4];
4373 struct vki_v4l2_enc_idx_entry entry[VKI_V4L2_ENC_IDX_ENTRIES];
4374 };
4375
4376 struct vki_v4l2_encoder_cmd {
4377 __vki_u32 cmd;
4378 __vki_u32 flags;
4379 union {
4380 struct {
4381 __vki_u32 data[8];
4382 } raw;
4383 };
4384 };
4385
4386 struct vki_v4l2_decoder_cmd {
4387 __vki_u32 cmd;
4388 __vki_u32 flags;
4389 union {
4390 struct {
4391 __vki_u64 pts;
4392 } stop;
4393
4394 struct {
4395 __vki_s32 speed;
4396 __vki_u32 format;
4397 } start;
4398
4399 struct {
4400 __vki_u32 data[16];
4401 } raw;
4402 };
4403 };
4404
4405 struct vki_v4l2_vbi_format {
4406 __vki_u32 sampling_rate;
4407 __vki_u32 offset;
4408 __vki_u32 samples_per_line;
4409 __vki_u32 sample_format;
4410 __vki_s32 start[2];
4411 __vki_u32 count[2];
4412 __vki_u32 flags;
4413 __vki_u32 reserved[2];
4414 };
4415
4416 struct vki_v4l2_sliced_vbi_format {
4417 __vki_u16 service_set;
4418 __vki_u16 service_lines[2][24];
4419 __vki_u32 io_size;
4420 __vki_u32 reserved[2];
4421 };
4422
4423 struct vki_v4l2_sliced_vbi_cap {
4424 __vki_u16 service_set;
4425 __vki_u16 service_lines[2][24];
4426 __vki_u32 type;
4427 __vki_u32 reserved[3];
4428 };
4429
4430 struct vki_v4l2_sliced_vbi_data {
4431 __vki_u32 id;
4432 __vki_u32 field;
4433 __vki_u32 line;
4434 __vki_u32 reserved;
4435 __vki_u8 data[48];
4436 };
4437
4438 struct vki_v4l2_plane_pix_format {
4439 __vki_u32 sizeimage;
4440 __vki_u32 bytesperline;
4441 __vki_u16 reserved[6];
4442 } __attribute__ ((packed));
4443
4444 #define VKI_VIDEO_MAX_PLANES 8
4445
4446 struct vki_v4l2_pix_format_mplane {
4447 __vki_u32 width;
4448 __vki_u32 height;
4449 __vki_u32 pixelformat;
4450 __vki_u32 field;
4451 __vki_u32 colorspace;
4452
4453 struct vki_v4l2_plane_pix_format plane_fmt[VKI_VIDEO_MAX_PLANES];
4454 __vki_u8 num_planes;
4455 __vki_u8 flags;
4456 __vki_u8 ycbcr_enc;
4457 __vki_u8 quantization;
4458 __vki_u8 reserved[8];
4459 } __attribute__ ((packed));
4460
4461 struct vki_v4l2_sdr_format {
4462 __vki_u32 pixelformat;
4463 __vki_u32 buffersize;
4464 __vki_u8 reserved[24];
4465 } __attribute__ ((packed));
4466
4467 enum vki_v4l2_buf_type {
4468 VKI_V4L2_BUF_TYPE_VIDEO_CAPTURE = 1,
4469 VKI_V4L2_BUF_TYPE_VIDEO_OUTPUT = 2,
4470 VKI_V4L2_BUF_TYPE_VIDEO_OVERLAY = 3,
4471 VKI_V4L2_BUF_TYPE_VBI_CAPTURE = 4,
4472 VKI_V4L2_BUF_TYPE_VBI_OUTPUT = 5,
4473 VKI_V4L2_BUF_TYPE_SLICED_VBI_CAPTURE = 6,
4474 VKI_V4L2_BUF_TYPE_SLICED_VBI_OUTPUT = 7,
4475 VKI_V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY = 8,
4476 VKI_V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE = 9,
4477 VKI_V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE = 10,
4478 VKI_V4L2_BUF_TYPE_SDR_CAPTURE = 11,
4479 };
4480
4481 struct vki_v4l2_format {
4482 __vki_u32 type;
4483 union {
4484 struct vki_v4l2_pix_format pix;
4485 struct vki_v4l2_pix_format_mplane pix_mp;
4486 struct vki_v4l2_window win;
4487 struct vki_v4l2_vbi_format vbi;
4488 struct vki_v4l2_sliced_vbi_format sliced;
4489 struct vki_v4l2_sdr_format sdr;
4490 __vki_u8 raw_data[200];
4491 } fmt;
4492 };
4493
4494 struct vki_v4l2_streamparm {
4495 __vki_u32 type;
4496 union {
4497 struct vki_v4l2_captureparm capture;
4498 struct vki_v4l2_outputparm output;
4499 __vki_u8 raw_data[200];
4500 } parm;
4501 };
4502
4503 struct vki_v4l2_event_vsync {
4504 __vki_u8 field;
4505 } __attribute__ ((packed));
4506
4507 struct vki_v4l2_event_ctrl {
4508 __vki_u32 changes;
4509 __vki_u32 type;
4510 union {
4511 __vki_s32 value;
4512 __vki_s64 value64;
4513 };
4514 __vki_u32 flags;
4515 __vki_s32 minimum;
4516 __vki_s32 maximum;
4517 __vki_s32 step;
4518 __vki_s32 default_value;
4519 };
4520
4521 struct vki_v4l2_event_frame_sync {
4522 __vki_u32 frame_sequence;
4523 };
4524
4525 struct vki_v4l2_event_src_change {
4526 __vki_u32 changes;
4527 };
4528
4529 struct vki_v4l2_event_motion_det {
4530 __vki_u32 flags;
4531 __vki_u32 frame_sequence;
4532 __vki_u32 region_mask;
4533 };
4534
4535 struct vki_v4l2_event {
4536 __vki_u32 type;
4537 union {
4538 struct vki_v4l2_event_vsync vsync;
4539 struct vki_v4l2_event_ctrl ctrl;
4540 struct vki_v4l2_event_frame_sync frame_sync;
4541 struct vki_v4l2_event_src_change src_change;
4542 struct vki_v4l2_event_motion_det motion_det;
4543 __vki_u8 data[64];
4544 } u;
4545 __vki_u32 pending;
4546 __vki_u32 sequence;
4547 struct vki_timespec timestamp;
4548 __vki_u32 id;
4549 __vki_u32 reserved[8];
4550 };
4551
4552 struct vki_v4l2_event_subscription {
4553 __vki_u32 type;
4554 __vki_u32 id;
4555 __vki_u32 flags;
4556 __vki_u32 reserved[5];
4557 };
4558
4559 struct vki_v4l2_dbg_match {
4560 __vki_u32 type;
4561 union {
4562 __vki_u32 addr;
4563 char name[32];
4564 };
4565 } __attribute__ ((packed));
4566
4567 struct vki_v4l2_dbg_register {
4568 struct vki_v4l2_dbg_match match;
4569 __vki_u32 size;
4570 __vki_u64 reg;
4571 __vki_u64 val;
4572 } __attribute__ ((packed));
4573
4574 struct vki_v4l2_dbg_chip_info {
4575 struct vki_v4l2_dbg_match match;
4576 char name[32];
4577 __vki_u32 flags;
4578 __vki_u32 reserved[32];
4579 } __attribute__ ((packed));
4580
4581 struct vki_v4l2_create_buffers {
4582 __vki_u32 index;
4583 __vki_u32 count;
4584 __vki_u32 memory;
4585 struct vki_v4l2_format format;
4586 __vki_u32 reserved[8];
4587 };
4588
4589 struct vki_v4l2_edid {
4590 __vki_u32 pad;
4591 __vki_u32 start_block;
4592 __vki_u32 blocks;
4593 __vki_u32 reserved[5];
4594 __vki_u8 *edid;
4595 };
4596
4597 #define VKI_V4L2_QUERYCAP _VKI_IOR('V', 0, struct vki_v4l2_capability)
4598 #define VKI_V4L2_ENUM_FMT _VKI_IOWR('V', 2, struct vki_v4l2_fmtdesc)
4599 #define VKI_V4L2_G_FMT _VKI_IOWR('V', 4, struct vki_v4l2_format)
4600 #define VKI_V4L2_S_FMT _VKI_IOWR('V', 5, struct vki_v4l2_format)
4601 #define VKI_V4L2_REQBUFS _VKI_IOWR('V', 8, struct vki_v4l2_requestbuffers)
4602 #define VKI_V4L2_QUERYBUF _VKI_IOWR('V', 9, struct vki_v4l2_buffer)
4603 #define VKI_V4L2_G_FBUF _VKI_IOR('V', 10, struct vki_v4l2_framebuffer)
4604 #define VKI_V4L2_S_FBUF _VKI_IOW('V', 11, struct vki_v4l2_framebuffer)
4605 #define VKI_V4L2_OVERLAY _VKI_IOW('V', 14, int)
4606 #define VKI_V4L2_QBUF _VKI_IOWR('V', 15, struct vki_v4l2_buffer)
4607 #define VKI_V4L2_EXPBUF _VKI_IOWR('V', 16, struct vki_v4l2_exportbuffer)
4608 #define VKI_V4L2_DQBUF _VKI_IOWR('V', 17, struct vki_v4l2_buffer)
4609 #define VKI_V4L2_STREAMON _VKI_IOW('V', 18, int)
4610 #define VKI_V4L2_STREAMOFF _VKI_IOW('V', 19, int)
4611 #define VKI_V4L2_G_PARM _VKI_IOWR('V', 21, struct vki_v4l2_streamparm)
4612 #define VKI_V4L2_S_PARM _VKI_IOWR('V', 22, struct vki_v4l2_streamparm)
4613 #define VKI_V4L2_G_STD _VKI_IOR('V', 23, vki_v4l2_std_id)
4614 #define VKI_V4L2_S_STD _VKI_IOW('V', 24, vki_v4l2_std_id)
4615 #define VKI_V4L2_ENUMSTD _VKI_IOWR('V', 25, struct vki_v4l2_standard)
4616 #define VKI_V4L2_ENUMINPUT _VKI_IOWR('V', 26, struct vki_v4l2_input)
4617 #define VKI_V4L2_G_CTRL _VKI_IOWR('V', 27, struct vki_v4l2_control)
4618 #define VKI_V4L2_S_CTRL _VKI_IOWR('V', 28, struct vki_v4l2_control)
4619 #define VKI_V4L2_G_TUNER _VKI_IOWR('V', 29, struct vki_v4l2_tuner)
4620 #define VKI_V4L2_S_TUNER _VKI_IOW('V', 30, struct vki_v4l2_tuner)
4621 #define VKI_V4L2_G_AUDIO _VKI_IOR('V', 33, struct vki_v4l2_audio)
4622 #define VKI_V4L2_S_AUDIO _VKI_IOW('V', 34, struct vki_v4l2_audio)
4623 #define VKI_V4L2_QUERYCTRL _VKI_IOWR('V', 36, struct vki_v4l2_queryctrl)
4624 #define VKI_V4L2_QUERYMENU _VKI_IOWR('V', 37, struct vki_v4l2_querymenu)
4625 #define VKI_V4L2_G_INPUT _VKI_IOR('V', 38, int)
4626 #define VKI_V4L2_S_INPUT _VKI_IOWR('V', 39, int)
4627 #define VKI_V4L2_G_EDID _VKI_IOWR('V', 40, struct vki_v4l2_edid)
4628 #define VKI_V4L2_S_EDID _VKI_IOWR('V', 41, struct vki_v4l2_edid)
4629 #define VKI_V4L2_G_OUTPUT _VKI_IOR('V', 46, int)
4630 #define VKI_V4L2_S_OUTPUT _VKI_IOWR('V', 47, int)
4631 #define VKI_V4L2_ENUMOUTPUT _VKI_IOWR('V', 48, struct vki_v4l2_output)
4632 #define VKI_V4L2_G_AUDOUT _VKI_IOR('V', 49, struct vki_v4l2_audioout)
4633 #define VKI_V4L2_S_AUDOUT _VKI_IOW('V', 50, struct vki_v4l2_audioout)
4634 #define VKI_V4L2_G_MODULATOR _VKI_IOWR('V', 54, struct vki_v4l2_modulator)
4635 #define VKI_V4L2_S_MODULATOR _VKI_IOW('V', 55, struct vki_v4l2_modulator)
4636 #define VKI_V4L2_G_FREQUENCY _VKI_IOWR('V', 56, struct vki_v4l2_frequency)
4637 #define VKI_V4L2_S_FREQUENCY _VKI_IOW('V', 57, struct vki_v4l2_frequency)
4638 #define VKI_V4L2_CROPCAP _VKI_IOWR('V', 58, struct vki_v4l2_cropcap)
4639 #define VKI_V4L2_G_CROP _VKI_IOWR('V', 59, struct vki_v4l2_crop)
4640 #define VKI_V4L2_S_CROP _VKI_IOW('V', 60, struct vki_v4l2_crop)
4641 #define VKI_V4L2_G_JPEGCOMP _VKI_IOR('V', 61, struct vki_v4l2_jpegcompression)
4642 #define VKI_V4L2_S_JPEGCOMP _VKI_IOW('V', 62, struct vki_v4l2_jpegcompression)
4643 #define VKI_V4L2_QUERYSTD _VKI_IOR('V', 63, vki_v4l2_std_id)
4644 #define VKI_V4L2_TRY_FMT _VKI_IOWR('V', 64, struct vki_v4l2_format)
4645 #define VKI_V4L2_ENUMAUDIO _VKI_IOWR('V', 65, struct vki_v4l2_audio)
4646 #define VKI_V4L2_ENUMAUDOUT _VKI_IOWR('V', 66, struct vki_v4l2_audioout)
4647 #define VKI_V4L2_G_PRIORITY _VKI_IOR('V', 67, __vki_u32)
4648 #define VKI_V4L2_S_PRIORITY _VKI_IOW('V', 68, __vki_u32)
4649 #define VKI_V4L2_G_SLICED_VBI_CAP _VKI_IOWR('V', 69, struct vki_v4l2_sliced_vbi_cap)
4650 #define VKI_V4L2_LOG_STATUS _VKI_IO('V', 70)
4651 #define VKI_V4L2_G_EXT_CTRLS _VKI_IOWR('V', 71, struct vki_v4l2_ext_controls)
4652 #define VKI_V4L2_S_EXT_CTRLS _VKI_IOWR('V', 72, struct vki_v4l2_ext_controls)
4653 #define VKI_V4L2_TRY_EXT_CTRLS _VKI_IOWR('V', 73, struct vki_v4l2_ext_controls)
4654 #define VKI_V4L2_ENUM_FRAMESIZES _VKI_IOWR('V', 74, struct vki_v4l2_frmsizeenum)
4655 #define VKI_V4L2_ENUM_FRAMEINTERVALS _VKI_IOWR('V', 75, struct vki_v4l2_frmivalenum)
4656 #define VKI_V4L2_G_ENC_INDEX _VKI_IOR('V', 76, struct vki_v4l2_enc_idx)
4657 #define VKI_V4L2_ENCODER_CMD _VKI_IOWR('V', 77, struct vki_v4l2_encoder_cmd)
4658 #define VKI_V4L2_TRY_ENCODER_CMD _VKI_IOWR('V', 78, struct vki_v4l2_encoder_cmd)
4659 #define VKI_V4L2_DBG_S_REGISTER _VKI_IOW('V', 79, struct vki_v4l2_dbg_register)
4660 #define VKI_V4L2_DBG_G_REGISTER _VKI_IOWR('V', 80, struct vki_v4l2_dbg_register)
4661 #define VKI_V4L2_S_HW_FREQ_SEEK _VKI_IOW('V', 82, struct vki_v4l2_hw_freq_seek)
4662 #define VKI_V4L2_S_DV_TIMINGS _VKI_IOWR('V', 87, struct vki_v4l2_dv_timings)
4663 #define VKI_V4L2_G_DV_TIMINGS _VKI_IOWR('V', 88, struct vki_v4l2_dv_timings)
4664 #define VKI_V4L2_DQEVENT _VKI_IOR('V', 89, struct vki_v4l2_event)
4665 #define VKI_V4L2_SUBSCRIBE_EVENT _VKI_IOW('V', 90, struct vki_v4l2_event_subscription)
4666 #define VKI_V4L2_UNSUBSCRIBE_EVENT _VKI_IOW('V', 91, struct vki_v4l2_event_subscription)
4667 #define VKI_V4L2_CREATE_BUFS _VKI_IOWR('V', 92, struct vki_v4l2_create_buffers)
4668 #define VKI_V4L2_PREPARE_BUF _VKI_IOWR('V', 93, struct vki_v4l2_buffer)
4669 #define VKI_V4L2_G_SELECTION _VKI_IOWR('V', 94, struct vki_v4l2_selection)
4670 #define VKI_V4L2_S_SELECTION _VKI_IOWR('V', 95, struct vki_v4l2_selection)
4671 #define VKI_V4L2_DECODER_CMD _VKI_IOWR('V', 96, struct vki_v4l2_decoder_cmd)
4672 #define VKI_V4L2_TRY_DECODER_CMD _VKI_IOWR('V', 97, struct vki_v4l2_decoder_cmd)
4673 #define VKI_V4L2_ENUM_DV_TIMINGS _VKI_IOWR('V', 98, struct vki_v4l2_enum_dv_timings)
4674 #define VKI_V4L2_QUERY_DV_TIMINGS _VKI_IOR('V', 99, struct vki_v4l2_dv_timings)
4675 #define VKI_V4L2_DV_TIMINGS_CAP _VKI_IOWR('V', 100, struct vki_v4l2_dv_timings_cap)
4676 #define VKI_V4L2_ENUM_FREQ_BANDS _VKI_IOWR('V', 101, struct vki_v4l2_frequency_band)
4677 #define VKI_V4L2_DBG_G_CHIP_INFO _VKI_IOWR('V', 102, struct vki_v4l2_dbg_chip_info)
4678 #define VKI_V4L2_QUERY_EXT_CTRL _VKI_IOWR('V', 103, struct vki_v4l2_query_ext_ctrl)
4679
4680 struct vki_v4l2_mbus_framefmt {
4681 __vki_u32 width;
4682 __vki_u32 height;
4683 __vki_u32 code;
4684 __vki_u32 field;
4685 __vki_u32 colorspace;
4686 __vki_u16 ycbcr_enc;
4687 __vki_u16 quantization;
4688 __vki_u32 reserved[6];
4689 };
4690
4691 struct vki_v4l2_subdev_format {
4692 __vki_u32 which;
4693 __vki_u32 pad;
4694 struct vki_v4l2_mbus_framefmt format;
4695 __vki_u32 reserved[8];
4696 };
4697
4698 struct vki_v4l2_subdev_crop {
4699 __vki_u32 which;
4700 __vki_u32 pad;
4701 struct vki_v4l2_rect rect;
4702 __vki_u32 reserved[8];
4703 };
4704
4705 struct vki_v4l2_subdev_mbus_code_enum {
4706 __vki_u32 pad;
4707 __vki_u32 index;
4708 __vki_u32 code;
4709 __vki_u32 which;
4710 __vki_u32 reserved[8];
4711 };
4712
4713 struct vki_v4l2_subdev_frame_size_enum {
4714 __vki_u32 index;
4715 __vki_u32 pad;
4716 __vki_u32 code;
4717 __vki_u32 min_width;
4718 __vki_u32 max_width;
4719 __vki_u32 min_height;
4720 __vki_u32 max_height;
4721 __vki_u32 which;
4722 __vki_u32 reserved[8];
4723 };
4724
4725 struct vki_v4l2_subdev_frame_interval {
4726 __vki_u32 pad;
4727 struct vki_v4l2_fract interval;
4728 __vki_u32 reserved[9];
4729 };
4730
4731 struct vki_v4l2_subdev_frame_interval_enum {
4732 __vki_u32 index;
4733 __vki_u32 pad;
4734 __vki_u32 code;
4735 __vki_u32 width;
4736 __vki_u32 height;
4737 struct vki_v4l2_fract interval;
4738 __vki_u32 which;
4739 __vki_u32 reserved[8];
4740 };
4741
4742 struct vki_v4l2_subdev_selection {
4743 __vki_u32 which;
4744 __vki_u32 pad;
4745 __vki_u32 target;
4746 __vki_u32 flags;
4747 struct vki_v4l2_rect r;
4748 __vki_u32 reserved[8];
4749 };
4750
4751 #define VKI_V4L2_SUBDEV_G_FMT _VKI_IOWR('V', 4, struct vki_v4l2_subdev_format)
4752 #define VKI_V4L2_SUBDEV_S_FMT _VKI_IOWR('V', 5, struct vki_v4l2_subdev_format)
4753 #define VKI_V4L2_SUBDEV_G_FRAME_INTERVAL _VKI_IOWR('V', 21, struct vki_v4l2_subdev_frame_interval)
4754 #define VKI_V4L2_SUBDEV_S_FRAME_INTERVAL _VKI_IOWR('V', 22, struct vki_v4l2_subdev_frame_interval)
4755 #define VKI_V4L2_SUBDEV_ENUM_MBUS_CODE _VKI_IOWR('V', 2, struct vki_v4l2_subdev_mbus_code_enum)
4756 #define VKI_V4L2_SUBDEV_ENUM_FRAME_SIZE _VKI_IOWR('V', 74, struct vki_v4l2_subdev_frame_size_enum)
4757 #define VKI_V4L2_SUBDEV_ENUM_FRAME_INTERVAL _VKI_IOWR('V', 75, struct vki_v4l2_subdev_frame_interval_enum)
4758 #define VKI_V4L2_SUBDEV_G_CROP _VKI_IOWR('V', 59, struct vki_v4l2_subdev_crop)
4759 #define VKI_V4L2_SUBDEV_S_CROP _VKI_IOWR('V', 60, struct vki_v4l2_subdev_crop)
4760 #define VKI_V4L2_SUBDEV_G_SELECTION _VKI_IOWR('V', 61, struct vki_v4l2_subdev_selection)
4761 #define VKI_V4L2_SUBDEV_S_SELECTION _VKI_IOWR('V', 62, struct vki_v4l2_subdev_selection)
4762
4763 struct vki_media_device_info {
4764 char driver[16];
4765 char model[32];
4766 char serial[40];
4767 char bus_info[32];
4768 __vki_u32 media_version;
4769 __vki_u32 hw_revision;
4770 __vki_u32 driver_version;
4771 __vki_u32 reserved[31];
4772 };
4773
4774 struct vki_media_entity_desc {
4775 __vki_u32 id;
4776 char name[32];
4777 __vki_u32 type;
4778 __vki_u32 revision;
4779 __vki_u32 flags;
4780 __vki_u32 group_id;
4781 __vki_u16 pads;
4782 __vki_u16 links;
4783
4784 __vki_u32 reserved[4];
4785
4786 union {
4787
4788 struct {
4789 __vki_u32 major;
4790 __vki_u32 minor;
4791 } v4l;
4792 struct {
4793 __vki_u32 major;
4794 __vki_u32 minor;
4795 } fb;
4796 struct {
4797 __vki_u32 card;
4798 __vki_u32 device;
4799 __vki_u32 subdevice;
4800 } alsa;
4801 int dvb;
4802
4803
4804
4805 __vki_u8 raw[184];
4806 };
4807 };
4808
4809 struct vki_media_pad_desc {
4810 __vki_u32 entity;
4811 __vki_u16 index;
4812 __vki_u32 flags;
4813 __vki_u32 reserved[2];
4814 };
4815
4816 struct vki_media_link_desc {
4817 struct vki_media_pad_desc source;
4818 struct vki_media_pad_desc sink;
4819 __vki_u32 flags;
4820 __vki_u32 reserved[2];
4821 };
4822
4823 struct vki_media_links_enum {
4824 __vki_u32 entity;
4825 struct vki_media_pad_desc __user *pads;
4826 struct vki_media_link_desc __user *links;
4827 __vki_u32 reserved[4];
4828 };
4829
4830 #define VKI_MEDIA_IOC_DEVICE_INFO _VKI_IOWR('|', 0x00, struct vki_media_device_info)
4831 #define VKI_MEDIA_IOC_ENUM_ENTITIES _VKI_IOWR('|', 0x01, struct vki_media_entity_desc)
4832 #define VKI_MEDIA_IOC_ENUM_LINKS _VKI_IOWR('|', 0x02, struct vki_media_links_enum)
4833 #define VKI_MEDIA_IOC_SETUP_LINK _VKI_IOWR('|', 0x03, struct vki_media_link_desc)
4834
4835
4836 #define VKI_DMX_STOP _VKI_IO('o', 42)
4837
4838
4839 enum vki_kcmp_type {
4840 VKI_KCMP_FILE,
4841 VKI_KCMP_VM,
4842 VKI_KCMP_FILES,
4843 VKI_KCMP_FS,
4844 VKI_KCMP_SIGHAND,
4845 VKI_KCMP_IO,
4846 VKI_KCMP_SYSVSEM,
4847
4848 VKI_KCMP_TYPES
4849 };
4850
4851
4852
4853
4854
4855 #define VKI_SECCOMP_MODE_FILTER 2
4856
4857
4858
4859
4860 #define VKI_BINPRM_BUF_SIZE 128
4861
4862
4863
4864
4865
4866 struct vki_serial_struct {
4867 int type;
4868 int line;
4869 unsigned int port;
4870 int irq;
4871 int flags;
4872 int xmit_fifo_size;
4873 int custom_divisor;
4874 int baud_base;
4875 unsigned short close_delay;
4876 char io_type;
4877 char reserved_char[1];
4878 int hub6;
4879 unsigned short closing_wait;
4880 unsigned short closing_wait2;
4881 unsigned char *iomem_base;
4882 unsigned short iomem_reg_shift;
4883 unsigned int port_high;
4884 unsigned long iomap_base;
4885 };
4886
4887
4888
4889
4890
4891 #if !defined(VKI_INIT_ARCH_ELF_STATE)
4892
4893
4894
4895
4896
4897 struct vki_arch_elf_state {
4898 };
4899
4900 # define VKI_INIT_ARCH_ELF_STATE { }
4901
4902 #endif
4903
4904
4905
4906
4907
4908 #define VKI_PR_SET_FP_MODE 45
4909 #define VKI_PR_GET_FP_MODE 46
4910 # define VKI_PR_FP_MODE_FR (1 << 0)
4911 # define VKI_PR_FP_MODE_FRE (1 << 1)
4912
4913 #endif
4914
4915
4916
4917
4918
4919 struct vki_blk_zone {
4920 __vki_u64 start;
4921 __vki_u64 len;
4922 __vki_u64 wp;
4923 __vki_u8 type;
4924 __vki_u8 cond;
4925 __vki_u8 non_seq;
4926 __vki_u8 reset;
4927 __vki_u8 reserved[36];
4928 };
4929
4930 struct vki_blk_zone_report {
4931 __vki_u64 sector;
4932 __vki_u32 nr_zones;
4933 __vki_u8 reserved[4];
4934 struct vki_blk_zone zones[0];
4935 };
4936
4937 struct vki_blk_zone_range {
4938 __vki_u64 sector;
4939 __vki_u64 nr_sectors;
4940 };
4941
4942 #define VKI_BLKREPORTZONE _VKI_IOWR(0x12, 130, struct vki_blk_zone_report)
4943 #define VKI_BLKRESETZONE _VKI_IOW(0x12, 131, struct vki_blk_zone_range)
4944
4945
4946
4947
4948
4949 struct vki_bpf_insn {
4950 __vki_u8 code;
4951 __vki_u8 dst_reg:4;
4952 __vki_u8 src_reg:4;
4953 __vki_s16 off;
4954 __vki_s32 imm;
4955 };
4956
4957 enum vki_bpf_cmd {
4958 VKI_BPF_MAP_CREATE,
4959 VKI_BPF_MAP_LOOKUP_ELEM,
4960 VKI_BPF_MAP_UPDATE_ELEM,
4961 VKI_BPF_MAP_DELETE_ELEM,
4962 VKI_BPF_MAP_GET_NEXT_KEY,
4963 VKI_BPF_PROG_LOAD,
4964 VKI_BPF_OBJ_PIN,
4965 VKI_BPF_OBJ_GET,
4966 VKI_BPF_PROG_ATTACH,
4967 VKI_BPF_PROG_DETACH,
4968 VKI_BPF_PROG_TEST_RUN,
4969 VKI_BPF_PROG_GET_NEXT_ID,
4970 VKI_BPF_MAP_GET_NEXT_ID,
4971 VKI_BPF_PROG_GET_FD_BY_ID,
4972 VKI_BPF_MAP_GET_FD_BY_ID,
4973 VKI_BPF_OBJ_GET_INFO_BY_FD,
4974 VKI_BPF_PROG_QUERY,
4975 VKI_BPF_RAW_TRACEPOINT_OPEN,
4976 VKI_BPF_BTF_LOAD,
4977 VKI_BPF_BTF_GET_FD_BY_ID,
4978 VKI_BPF_TASK_FD_QUERY,
4979 VKI_BPF_MAP_LOOKUP_AND_DELETE_ELEM,
4980 VKI_BPF_MAP_FREEZE,
4981 };
4982
4983 enum vki_bpf_map_type {
4984 VKI_BPF_MAP_TYPE_UNSPEC,
4985 VKI_BPF_MAP_TYPE_HASH,
4986 VKI_BPF_MAP_TYPE_ARRAY,
4987 VKI_BPF_MAP_TYPE_PROG_ARRAY,
4988 VKI_BPF_MAP_TYPE_PERF_EVENT_ARRAY,
4989 VKI_BPF_MAP_TYPE_PERCPU_HASH,
4990 VKI_BPF_MAP_TYPE_PERCPU_ARRAY,
4991 VKI_BPF_MAP_TYPE_STACK_TRACE,
4992 VKI_BPF_MAP_TYPE_CGROUP_ARRAY,
4993 VKI_BPF_MAP_TYPE_LRU_HASH,
4994 VKI_BPF_MAP_TYPE_LRU_PERCPU_HASH,
4995 VKI_BPF_MAP_TYPE_LPM_TRIE,
4996 VKI_BPF_MAP_TYPE_ARRAY_OF_MAPS,
4997 VKI_BPF_MAP_TYPE_HASH_OF_MAPS,
4998 VKI_BPF_MAP_TYPE_DEVMAP,
4999 VKI_BPF_MAP_TYPE_SOCKMAP,
5000 VKI_BPF_MAP_TYPE_CPUMAP,
5001 VKI_BPF_MAP_TYPE_XSKMAP,
5002 VKI_BPF_MAP_TYPE_SOCKHASH,
5003 };
5004
5005 enum vki_bpf_prog_type {
5006 VKI_BPF_PROG_TYPE_UNSPEC,
5007 VKI_BPF_PROG_TYPE_SOCKET_FILTER,
5008 VKI_BPF_PROG_TYPE_KPROBE,
5009 VKI_BPF_PROG_TYPE_SCHED_CLS,
5010 VKI_BPF_PROG_TYPE_SCHED_ACT,
5011 VKI_BPF_PROG_TYPE_TRACEPOINT,
5012 VKI_BPF_PROG_TYPE_XDP,
5013 VKI_BPF_PROG_TYPE_PERF_EVENT,
5014 VKI_BPF_PROG_TYPE_CGROUP_SKB,
5015 VKI_BPF_PROG_TYPE_CGROUP_SOCK,
5016 VKI_BPF_PROG_TYPE_LWT_IN,
5017 VKI_BPF_PROG_TYPE_LWT_OUT,
5018 VKI_BPF_PROG_TYPE_LWT_XMIT,
5019 VKI_BPF_PROG_TYPE_SOCK_OPS,
5020 VKI_BPF_PROG_TYPE_SK_SKB,
5021 VKI_BPF_PROG_TYPE_CGROUP_DEVICE,
5022 VKI_BPF_PROG_TYPE_SK_MSG,
5023 VKI_BPF_PROG_TYPE_RAW_TRACEPOINT,
5024 VKI_BPF_PROG_TYPE_CGROUP_SOCK_ADDR,
5025 VKI_BPF_PROG_TYPE_LWT_SEG6LOCAL,
5026 VKI_BPF_PROG_TYPE_LIRC_MODE2,
5027 };
5028
5029 enum vki_bpf_attach_type {
5030 VKI_BPF_CGROUP_INET_INGRESS,
5031 VKI_BPF_CGROUP_INET_EGRESS,
5032 VKI_BPF_CGROUP_INET_SOCK_CREATE,
5033 VKI_BPF_CGROUP_SOCK_OPS,
5034 VKI_BPF_SK_SKB_STREAM_PARSER,
5035 VKI_BPF_SK_SKB_STREAM_VERDICT,
5036 VKI_BPF_CGROUP_DEVICE,
5037 VKI_BPF_SK_MSG_VERDICT,
5038 VKI_BPF_CGROUP_INET4_BIND,
5039 VKI_BPF_CGROUP_INET6_BIND,
5040 VKI_BPF_CGROUP_INET4_CONNECT,
5041 VKI_BPF_CGROUP_INET6_CONNECT,
5042 VKI_BPF_CGROUP_INET4_POST_BIND,
5043 VKI_BPF_CGROUP_INET6_POST_BIND,
5044 VKI_BPF_CGROUP_UDP4_SENDMSG,
5045 VKI_BPF_CGROUP_UDP6_SENDMSG,
5046 VKI_BPF_LIRC_MODE2,
5047 __VKI_MAX_BPF_ATTACH_TYPE
5048 };
5049
5050
5051 #define VKI_BPF_F_NUMA_NODE (1U << 2)
5052
5053 #define VKI_BPF_OBJ_NAME_LEN 16U
5054
5055 union vki_bpf_attr {
5056 struct {
5057 __vki_u32 map_type;
5058 __vki_u32 key_size;
5059 __vki_u32 value_size;
5060 __vki_u32 max_entries;
5061 __vki_u32 map_flags;
5062
5063
5064 __vki_u32 inner_map_fd;
5065 __vki_u32 numa_node;
5066
5067
5068 char map_name[VKI_BPF_OBJ_NAME_LEN];
5069 __vki_u32 map_ifindex;
5070 __vki_u32 btf_fd;
5071 __vki_u32 btf_key_type_id;
5072 __vki_u32 btf_value_type_id;
5073 };
5074
5075 struct {
5076 __vki_u32 map_fd;
5077 __vki_aligned_u64 key;
5078 union {
5079 __vki_aligned_u64 value;
5080 __vki_aligned_u64 next_key;
5081 };
5082 __vki_u64 flags;
5083 };
5084
5085 struct {
5086 __vki_u32 prog_type;
5087 __vki_u32 insn_cnt;
5088 __vki_aligned_u64 insns;
5089 __vki_aligned_u64 license;
5090 __vki_u32 log_level;
5091 __vki_u32 log_size;
5092 __vki_aligned_u64 log_buf;
5093 __vki_u32 kern_version;
5094 __vki_u32 prog_flags;
5095 char prog_name[VKI_BPF_OBJ_NAME_LEN];
5096 __vki_u32 prog_ifindex;
5097
5098
5099
5100
5101 __vki_u32 expected_attach_type;
5102 };
5103
5104 struct {
5105 __vki_aligned_u64 pathname;
5106 __vki_u32 bpf_fd;
5107 __vki_u32 file_flags;
5108 };
5109
5110 struct {
5111 __vki_u32 target_fd;
5112 __vki_u32 attach_bpf_fd;
5113 __vki_u32 attach_type;
5114 __vki_u32 attach_flags;
5115 };
5116
5117 struct {
5118 __vki_u32 prog_fd;
5119 __vki_u32 retval;
5120 __vki_u32 data_size_in;
5121 __vki_u32 data_size_out;
5122 __vki_aligned_u64 data_in;
5123 __vki_aligned_u64 data_out;
5124 __vki_u32 repeat;
5125 __vki_u32 duration;
5126 } test;
5127
5128 struct {
5129 union {
5130 __vki_u32 start_id;
5131 __vki_u32 prog_id;
5132 __vki_u32 map_id;
5133 __vki_u32 btf_id;
5134 };
5135 __vki_u32 next_id;
5136 __vki_u32 open_flags;
5137 };
5138
5139 struct {
5140 __vki_u32 bpf_fd;
5141 __vki_u32 info_len;
5142 __vki_aligned_u64 info;
5143 } info;
5144
5145 struct {
5146 __vki_u32 target_fd;
5147 __vki_u32 attach_type;
5148 __vki_u32 query_flags;
5149 __vki_u32 attach_flags;
5150 __vki_aligned_u64 prog_ids;
5151 __vki_u32 prog_cnt;
5152 } query;
5153
5154 struct {
5155 __vki_u64 name;
5156 __vki_u32 prog_fd;
5157 } raw_tracepoint;
5158
5159 struct {
5160 __vki_aligned_u64 btf;
5161 __vki_aligned_u64 btf_log_buf;
5162 __vki_u32 btf_size;
5163 __vki_u32 btf_log_size;
5164 __vki_u32 btf_log_level;
5165 };
5166
5167 struct {
5168 __vki_u32 pid;
5169 __vki_u32 fd;
5170 __vki_u32 flags;
5171 __vki_u32 buf_len;
5172 __vki_aligned_u64 buf;
5173
5174
5175
5176
5177 __vki_u32 prog_id;
5178 __vki_u32 fd_type;
5179 __vki_u64 probe_offset;
5180 __vki_u64 probe_addr;
5181 } task_fd_query;
5182 } __attribute__((aligned(8)));
5183
5184 #define VKI_XDP_PACKET_HEADROOM 256
5185
5186 #define VKI_BPF_TAG_SIZE 8
5187
5188 struct vki_bpf_prog_info {
5189 __vki_u32 type;
5190 __vki_u32 id;
5191 __vki_u8 tag[VKI_BPF_TAG_SIZE];
5192 __vki_u32 jited_prog_len;
5193 __vki_u32 xlated_prog_len;
5194 __vki_aligned_u64 jited_prog_insns;
5195 __vki_aligned_u64 xlated_prog_insns;
5196 __vki_u64 load_time;
5197 __vki_u32 created_by_uid;
5198 __vki_u32 nr_map_ids;
5199 __vki_aligned_u64 map_ids;
5200 char name[VKI_BPF_OBJ_NAME_LEN];
5201 __vki_u32 ifindex;
5202 __vki_u32 gpl_compatible:1;
5203 __vki_u64 netns_dev;
5204 __vki_u64 netns_ino;
5205 __vki_u32 nr_jited_ksyms;
5206 __vki_u32 nr_jited_func_lens;
5207 __vki_aligned_u64 jited_ksyms;
5208 __vki_aligned_u64 jited_func_lens;
5209 } __attribute__((aligned(8)));
5210
5211 struct vki_bpf_map_info {
5212 __vki_u32 type;
5213 __vki_u32 id;
5214 __vki_u32 key_size;
5215 __vki_u32 value_size;
5216 __vki_u32 max_entries;
5217 __vki_u32 map_flags;
5218 char name[VKI_BPF_OBJ_NAME_LEN];
5219 __vki_u32 ifindex;
5220 __vki_u32 :32;
5221 __vki_u64 netns_dev;
5222 __vki_u64 netns_ino;
5223 __vki_u32 btf_id;
5224 __vki_u32 btf_key_type_id;
5225 __vki_u32 btf_value_type_id;
5226 } __attribute__((aligned(8)));
5227
5228 struct vki_bpf_btf_info {
5229 __vki_aligned_u64 btf;
5230 __vki_u32 btf_size;
5231 __vki_u32 id;
5232 } __attribute__((aligned(8)));
5233
5234
5235
5236
5237
5238 struct vki_pps_ktime {
5239 __vki_s64 sec;
5240 __vki_s32 nsec;
5241 __vki_u32 flags;
5242 };
5243
5244 struct vki_pps_kinfo {
5245 __vki_u32 assert_sequence;
5246 __vki_u32 clear_sequence;
5247 struct vki_pps_ktime assert_tu;
5248 struct vki_pps_ktime clear_tu;
5249 int current_mode;
5250 };
5251
5252 struct vki_pps_kparams {
5253 int api_version;
5254 int mode;
5255 struct vki_pps_ktime assert_off_tu;
5256 struct vki_pps_ktime clear_off_tu;
5257 };
5258
5259 struct vki_pps_fdata {
5260 struct vki_pps_kinfo info;
5261 struct vki_pps_ktime timeout;
5262 };
5263
5264 struct vki_pps_bind_args {
5265 int tsformat;
5266 int edge;
5267 int consumer;
5268 };
5269
5270 #define VKI_PPS_GETPARAMS _VKI_IOR('p', 0xa1, struct vki_pps_kparams *)
5271 #define VKI_PPS_SETPARAMS _VKI_IOW('p', 0xa2, struct vki_pps_kparams *)
5272 #define VKI_PPS_GETCAP _VKI_IOR('p', 0xa3, int *)
5273 #define VKI_PPS_FETCH _VKI_IOWR('p', 0xa4, struct vki_pps_fdata *)
5274 #define VKI_PPS_KC_BIND _VKI_IOW('p', 0xa5, struct vki_pps_bind_args *)
5275
5276
5277
5278
5279
5280 struct vki_ptp_clock_time {
5281 __vki_s64 sec;
5282 __vki_u32 nsec;
5283 __vki_u32 reserved;
5284 };
5285
5286 struct vki_ptp_clock_caps {
5287 int max_adj;
5288 int n_alarm;
5289 int n_ext_ts;
5290 int n_per_out;
5291 int pps;
5292 int n_pins;
5293 int cross_timestamping;
5294 int rsv[13];
5295 };
5296
5297 struct vki_ptp_extts_request {
5298 unsigned int index;
5299 unsigned int flags;
5300 unsigned int rsv[2];
5301 };
5302
5303 struct vki_ptp_perout_request {
5304 struct vki_ptp_clock_time start;
5305 struct vki_ptp_clock_time period;
5306 unsigned int index;
5307 unsigned int flags;
5308 unsigned int rsv[4];
5309 };
5310
5311 #define VKI_PTP_MAX_SAMPLES 25
5312
5313 struct vki_ptp_sys_offset {
5314 unsigned int n_samples;
5315 unsigned int rsv[3];
5316 struct vki_ptp_clock_time ts[2 * VKI_PTP_MAX_SAMPLES + 1];
5317 };
5318
5319 struct vki_ptp_sys_offset_extended {
5320 unsigned int n_samples;
5321 unsigned int rsv[3];
5322 struct vki_ptp_clock_time ts[VKI_PTP_MAX_SAMPLES][3];
5323 };
5324
5325 struct vki_ptp_sys_offset_precise {
5326 struct vki_ptp_clock_time device;
5327 struct vki_ptp_clock_time sys_realtime;
5328 struct vki_ptp_clock_time sys_monoraw;
5329 unsigned int rsv[4];
5330 };
5331
5332 struct vki_ptp_pin_desc {
5333 char name[64];
5334 unsigned int index;
5335 unsigned int func;
5336 unsigned int chan;
5337 unsigned int rsv[5];
5338 };
5339
5340 #define VKI_PTP_CLOCK_GETCAPS _VKI_IOR('=', 1, struct vki_ptp_clock_caps)
5341 #define VKI_PTP_EXTTS_REQUEST _VKI_IOW('=', 2, struct vki_ptp_extts_request)
5342 #define VKI_PTP_PEROUT_REQUEST _VKI_IOW('=', 3, struct vki_ptp_perout_request)
5343 #define VKI_PTP_ENABLE_PPS _VKI_IOW('=', 4, int)
5344 #define VKI_PTP_SYS_OFFSET _VKI_IOW('=', 5, struct vki_ptp_sys_offset)
5345 #define VKI_PTP_PIN_GETFUNC _VKI_IOWR('=', 6, struct vki_ptp_pin_desc)
5346 #define VKI_PTP_PIN_SETFUNC _VKI_IOW('=', 7, struct vki_ptp_pin_desc)
5347 #define VKI_PTP_SYS_OFFSET_PRECISE \
5348 _VKI_IOWR('=', 8, struct vki_ptp_sys_offset_precise)
5349 #define VKI_PTP_SYS_OFFSET_EXTENDED \
5350 _VKI_IOWR('=', 9, struct vki_ptp_sys_offset_extended)
5351
5352
5353
5354 typedef vki_int64_t vki_time64_t;
5355
5356
5357
5358
5359
5360 struct vki_timespec64 {
5361 vki_time64_t tv_sec;
5362 #if defined(VKI_BIG_ENDIAN)
5363 vki_int32_t tv_pad;
5364 vki_int32_t tv_nsec;
5365 #elif defined(VKI_LITTLE_ENDIAN)
5366 vki_int32_t tv_nsec;
5367 vki_int32_t tv_pad;
5368 #else
5369 #error edit for your odd byteorder.
5370 #endif
5371 };
5372
5373 struct vki_itimerspec64 {
5374 struct vki_timespec it_interval;
5375 struct vki_timespec it_value;
5376 };
5377
5378 #ifndef VKI_RLIM_INFINITY
5379 #define VKI_RLIM_INFINITY (~0UL)
5380 #endif
5381
5382 #define VKI_RLIM64_INFINITY (~0ULL)
5383
5384 #define VKI_CLOSE_RANGE_UNSHARE (1U << 1)
5385 #define VKI_CLOSE_RANGE_CLOEXEC (1U << 2)
5386
5387
5388
5389