plan to cleanup the fd generation code
[trinity.git] / include / compat.h
blob1609782a13ce94cdbdf2ef0913fb2f5a69c0b92f
1 #pragma once
4 /* fcntl.h */
5 #ifndef AT_EMPTY_PATH
6 #define AT_EMPTY_PATH 0x1000
7 #endif
9 #ifndef O_PATH
10 #define O_PATH 010000000 /* Resolve pathname but do not open file. */
11 #endif
13 #ifndef O_CLOEXEC
14 #define O_CLOEXEC 02000000
15 #endif
17 #ifndef O_TMPFILE
18 #define O_TMPFILE 020000000
19 #endif
21 #ifndef AT_NO_AUTOMOUNT
22 #define AT_NO_AUTOMOUNT 0x800
23 #endif
25 #ifndef F_LINUX_SPECIFIC_BASE
26 #define F_LINUX_SPECIFIC_BASE 1024
27 #endif
29 #ifndef F_SETPIPE_SZ
30 #define F_SETPIPE_SZ (F_LINUX_SPECIFIC_BASE + 7)
31 #endif
33 #ifndef F_GETPIPE_SZ
34 #define F_GETPIPE_SZ (F_LINUX_SPECIFIC_BASE + 8)
35 #endif
37 #ifndef F_DUPFD_CLOEXEC
38 #define F_DUPFD_CLOEXEC (F_LINUX_SPECIFIC_BASE + 6)
39 #endif
41 #ifndef F_SETOWN_EX
42 #define F_SETOWN_EX 15
43 #endif
45 #ifndef F_GETOWN_EX
46 #define F_GETOWN_EX 16
47 #endif
49 #ifndef F_GETOWNER_UIDS
50 #define F_GETOWNER_UIDS 17
51 #endif
53 #ifndef F_GETLKP
54 #define F_GETLKP 36
55 #define F_SETLKP 37
56 #define F_SETLKPW 38
57 #endif
59 /* linux/hw_breakpoint.h */
60 enum {
61 HW_BREAKPOINT_LEN_1 = 1,
62 HW_BREAKPOINT_LEN_2 = 2,
63 HW_BREAKPOINT_LEN_4 = 4,
64 HW_BREAKPOINT_LEN_8 = 8,
67 enum {
68 HW_BREAKPOINT_EMPTY = 0,
69 HW_BREAKPOINT_R = 1,
70 HW_BREAKPOINT_W = 2,
71 HW_BREAKPOINT_RW = HW_BREAKPOINT_R | HW_BREAKPOINT_W,
72 HW_BREAKPOINT_X = 4,
73 HW_BREAKPOINT_INVALID = HW_BREAKPOINT_RW | HW_BREAKPOINT_X,
76 /* asm-generic/mman-common.h */
78 #ifndef MAP_UNINITIALIZED
79 #define MAP_UNINITIALIZED 0x4000000
80 #endif
81 #ifndef PROT_SEM
82 #define PROT_SEM 0x8
83 #endif
84 #ifndef MAP_HUGETLB
85 #define MAP_HUGETLB 0x40000
86 #endif
87 #ifndef MAP_STACK
88 #define MAP_STACK 0x20000
89 #endif
91 #ifndef MADV_MERGEABLE
92 #define MADV_MERGEABLE 12
93 #endif
94 #ifndef MADV_UNMERGEABLE
95 #define MADV_UNMERGEABLE 13
96 #endif
97 #ifndef MADV_HUGEPAGE
98 #define MADV_HUGEPAGE 14
99 #endif
100 #ifndef MADV_NOHUGEPAGE
101 #define MADV_NOHUGEPAGE 15
102 #endif
103 #ifndef MADV_DONTDUMP
104 #define MADV_DONTDUMP 16
105 #endif
106 #ifndef MADV_DODUMP
107 #define MADV_DODUMP 17
108 #endif
111 /* bits/socket.h */
112 #ifndef SOCK_CLOEXEC
113 #define SOCK_CLOEXEC 02000000
114 #endif
116 #ifndef SOCK_NONBLOCK
117 #define SOCK_NONBLOCK 04000
118 #endif
120 #ifndef PF_RDS
121 #define PF_RDS 21
122 #endif
123 #ifndef AF_RDS
124 #define AF_RDS PF_RDS
125 #endif
127 #ifndef PF_LLC
128 #define PF_LLC 26
129 #endif
130 #ifndef AF_LLC
131 #define AF_LLC PF_LLC
132 #endif
134 #ifndef AF_IB
135 #define AF_IB 27
136 #endif
137 #ifndef PF_IB
138 #define PF_IB AF_IB
139 #endif
141 #ifndef PF_CAN
142 #define PF_CAN 29
143 #endif
144 #ifndef AF_CAN
145 #define AF_CAN PF_CAN
146 #endif
148 #ifndef PF_TIPC
149 #define PF_TIPC 30
150 #endif
151 #ifndef AF_TIPC
152 #define AF_TIPC PF_TIPC
153 #endif
155 #ifndef PF_PHONET
156 #define PF_PHONET 35
157 #endif
158 #ifndef AF_PHONET
159 #define AF_PHONET PF_PHONET
160 #endif
162 #ifndef PF_CAIF
163 #define PF_CAIF 37
164 #endif
165 #ifndef AF_CAIF
166 #define AF_CAIF PF_CAIF
167 #endif
169 #ifndef PF_ALG
170 #define PF_ALG 38
171 #endif
172 #ifndef AF_ALG
173 #define AF_ALG PF_ALG
174 #endif
176 #ifndef PF_NFC
177 #define PF_NFC 39
178 #endif
179 #ifndef AF_NFC
180 #define AF_NFC PF_NFC
181 #endif
183 #ifndef PF_VSOCK
184 #define PF_VSOCK 40
185 #endif
186 #ifndef AF_VSOCK
187 #define AF_VSOCK PF_VSOCK
188 #endif
190 #ifndef NFC_SOCKPROTO_RAW
191 #define NFC_SOCKPROTO_RAW 0
192 #endif
193 #ifndef NFC_SOCKPROTO_LLCP
194 #define NFC_SOCKPROTO_LLCP 1
195 #endif
197 #ifndef MSG_WAITFORONE
198 #define MSG_WAITFORONE 0x10000
199 #endif
201 #ifndef MSG_CMSG_CLOEXEC
202 #define MSG_CMSG_CLOEXEC 0x40000000
203 #endif
205 /* linux/socket.h */
206 #ifndef MSG_PROBE
207 #define MSG_PROBE 0x10
208 #endif
209 #ifndef MSG_FASTOPEN
210 #define MSG_FASTOPEN 0x20000000
211 #endif
212 #ifndef MSG_CMSG_COMPAT
213 #define MSG_CMSG_COMPAT 0x80000000
214 #endif
216 /* linux/net.h */
217 #ifndef SYS_RECVMMSG
218 #define SYS_RECVMMSG 19
219 #endif
220 #ifndef SYS_SENDMMSG
221 #define SYS_SENDMMSG 20
222 #endif
224 /* linux/netlink.h */
225 #ifndef NETLINK_CRYPTO
226 #define NETLINK_CRYPTO 21
227 #endif
228 #ifndef NETLINK_RX_RING
229 #define NETLINK_RX_RING 6
230 #define NETLINK_TX_RING 7
231 #endif
233 /* linux/prctl.h */
234 #ifndef PR_MCE_KILL_GET
235 #define PR_MCE_KILL_GET 34
236 #endif
238 /* linux/rds.h */
239 #ifndef RDS_CANCEL_SENT_TO
240 #define RDS_CANCEL_SENT_TO 1
241 #define RDS_GET_MR 2
242 #define RDS_FREE_MR 3
243 /* deprecated: RDS_BARRIER 4 */
244 #define RDS_RECVERR 5
245 #define RDS_CONG_MONITOR 6
246 #define RDS_GET_MR_FOR_DEST 7
247 #endif
249 /* asm/ptrace-abi.h */
250 #ifndef PTRACE_SYSEMU
251 #define PTRACE_SYSEMU 31
252 #endif
253 #ifndef PTRACE_SYSEMU_SINGLESTEP
254 #define PTRACE_SYSEMU_SINGLESTEP 32
255 #endif
256 #ifndef PTRACE_GETSIGMASK
257 #define PTRACE_GETSIGMASK 0x420a
258 #define PTRACE_SETSIGMASK 0x420b
259 #endif
261 /* sys/timerfd.h */
262 #ifndef TFD_CLOEXEC
263 #define TFD_CLOEXEC 02000000
264 #endif
265 #ifndef TFD_NONBLOCK
266 #define TFD_NONBLOCK 04000
267 #endif
269 /* linux/keyctl.h */
270 #ifndef KEYCTL_GET_KEYRING_ID
271 #define KEYCTL_GET_KEYRING_ID 0 /* ask for a keyring's ID */
272 #define KEYCTL_JOIN_SESSION_KEYRING 1 /* join or start named session keyring */
273 #define KEYCTL_UPDATE 2 /* update a key */
274 #define KEYCTL_REVOKE 3 /* revoke a key */
275 #define KEYCTL_CHOWN 4 /* set ownership of a key */
276 #define KEYCTL_SETPERM 5 /* set perms on a key */
277 #define KEYCTL_DESCRIBE 6 /* describe a key */
278 #define KEYCTL_CLEAR 7 /* clear contents of a keyring */
279 #define KEYCTL_LINK 8 /* link a key into a keyring */
280 #define KEYCTL_UNLINK 9 /* unlink a key from a keyring */
281 #define KEYCTL_SEARCH 10 /* search for a key in a keyring */
282 #define KEYCTL_READ 11 /* read a key or keyring's contents */
283 #define KEYCTL_INSTANTIATE 12 /* instantiate a partially constructed key */
284 #define KEYCTL_NEGATE 13 /* negate a partially constructed key */
285 #define KEYCTL_SET_REQKEY_KEYRING 14 /* set default request-key keyring */
286 #define KEYCTL_SET_TIMEOUT 15 /* set key timeout */
287 #define KEYCTL_ASSUME_AUTHORITY 16 /* assume request_key() authorisation */
288 #define KEYCTL_GET_SECURITY 17 /* get key security label */
289 #define KEYCTL_SESSION_TO_PARENT 18 /* apply session keyring to parent process */
290 #endif
292 #ifndef KEYCTL_REJECT
293 #define KEYCTL_REJECT 19 /* reject a partially constructed key */
294 #endif
296 #ifndef KEYCTL_INSTANTIATE_IOV
297 #define KEYCTL_INSTANTIATE_IOV 20 /* instantiate a partially constructed key */
298 #endif
300 #ifndef KCMP_TYPES
301 enum kcmp_type {
302 KCMP_FILE,
303 KCMP_VM,
304 KCMP_FILES,
305 KCMP_FS,
306 KCMP_SIGHAND,
307 KCMP_IO,
308 KCMP_SYSVSEM,
310 KCMP_TYPES,
312 #endif
314 /* asm/socket.h */
315 #ifndef SO_BSDCOMPAT
316 #define SO_BSDCOMPAT 14
317 #endif
319 #ifndef SO_REUSEPORT
320 #define SO_REUSEPORT 15
321 #endif
323 #ifndef SO_RXQ_OVFL
324 #define SO_RXQ_OVFL 40
325 #endif
327 #ifndef SO_WIFI_STATUS
328 #define SO_WIFI_STATUS 41
329 #endif
331 #ifndef SO_PEEK_OFF
332 #define SO_PEEK_OFF 42
333 #endif
335 #ifndef SO_NOFCS
336 #define SO_NOFCS 43
337 #endif
339 #ifndef SO_LOCK_FILTER
340 #define SO_LOCK_FILTER 44
341 #endif
343 #ifndef SO_SELECT_ERR_QUEUE
344 #define SO_SELECT_ERR_QUEUE 45
345 #endif
347 #ifndef SO_BUSY_POLL
348 #define SO_BUSY_POLL 46
349 #endif
351 #ifndef SO_MAX_PACING_RATE
352 #define SO_MAX_PACING_RATE 47
353 #endif
355 #ifndef SO_BPF_EXTENSIONS
356 #define SO_BPF_EXTENSIONS 48
357 #endif
359 /* linux/tcp.h */
360 #ifndef TCP_COOKIE_TRANSACTIONS
361 #define TCP_COOKIE_TRANSACTIONS 15
362 #endif
364 #ifndef TCP_THIN_LINEAR_TIMEOUTS
365 #define TCP_THIN_LINEAR_TIMEOUTS 16
366 #endif
368 #ifndef TCP_THIN_DUPACK
369 #define TCP_THIN_DUPACK 17
370 #endif
372 #ifndef TCP_USER_TIMEOUT
373 #define TCP_USER_TIMEOUT 18
374 #endif
376 #ifndef TCP_REPAIR
377 #define TCP_REPAIR 19
378 #endif
380 #ifndef TCP_REPAIR_QUEUE
381 #define TCP_REPAIR_QUEUE 20
382 #endif
384 #ifndef TCP_QUEUE_SEQ
385 #define TCP_QUEUE_SEQ 21
386 #endif
388 #ifndef TCP_REPAIR_OPTIONS
389 #define TCP_REPAIR_OPTIONS 22
390 #endif
392 #ifndef TCP_FASTOPEN
393 #define TCP_FASTOPEN 23
394 #endif
396 /* linux/if_packet.h */
397 #ifndef PACKET_VNET_HDR
398 #define PACKET_VNET_HDR 15
399 #endif
401 #ifndef PACKET_TX_TIMESTAMP
402 #define PACKET_TX_TIMESTAMP 16
403 #endif
405 #ifndef PACKET_TIMESTAMP
406 #define PACKET_TIMESTAMP 17
407 #endif
409 #ifndef PACKET_FANOUT
410 #define PACKET_FANOUT 18
411 #endif
413 /* linux/dccp.h */
414 #ifndef DCCP_SOCKOPT_QPOLICY_ID
415 #define DCCP_SOCKOPT_QPOLICY_ID 16
416 #endif
418 #ifndef DCCP_SOCKOPT_QPOLICY_TXQLEN
419 #define DCCP_SOCKOPT_QPOLICY_TXQLEN 17
420 #endif
422 /* net/udplite.h */
423 #ifndef UDPLITE_SEND_CSCOV
424 #define UDPLITE_SEND_CSCOV 10 /* sender partial coverage (as sent) */
425 #endif
426 #ifndef UDPLITE_RECV_CSCOV
427 #define UDPLITE_RECV_CSCOV 11 /* receiver partial coverage (threshold ) */
428 #endif
430 /* linux/in.h */
431 #ifndef IP_MTU
432 #define IP_MTU 14
433 #endif
434 #ifndef IP_FREEBIND
435 #define IP_FREEBIND 15
436 #endif
437 #ifndef IP_IPSEC_POLICY
438 #define IP_IPSEC_POLICY 16
439 #endif
440 #ifndef IP_XFRM_POLICY
441 #define IP_XFRM_POLICY 17
442 #endif
443 #ifndef IP_PASSSEC
444 #define IP_PASSSEC 18
445 #endif
446 #ifndef IP_TRANSPARENT
447 #define IP_TRANSPARENT 19
448 #endif
449 #ifndef IP_MINTTL
450 #define IP_MINTTL 21
451 #endif
452 #ifndef IP_ORIGDSTADDR
453 #define IP_ORIGDSTADDR 20
454 #endif
455 #ifndef IP_RECVORIGDSTADDR
456 #define IP_RECVORIGDSTADDR IP_ORIGDSTADDR
457 #endif
458 #ifndef IP_NODEFRAG
459 #define IP_NODEFRAG 22
460 #endif
461 #ifndef IP_MULTICAST_ALL
462 #define IP_MULTICAST_ALL 49
463 #endif
464 #ifndef IP_UNICAST_IF
465 #define IP_UNICAST_IF 50
466 #endif
468 /* linux/in6.h */
469 #ifndef IPV6_FLOWINFO
470 #define IPV6_FLOWINFO 11
471 #endif
473 /* asm/resource.h */
474 #ifndef RLIMIT_RTTIME
475 #define RLIMIT_RTTIME 15
476 #endif
478 /* sctp/user.h */
479 #ifndef SCTP_RTOINFO
480 #define SCTP_RTOINFO 0
481 #define SCTP_ASSOCINFO 1
482 #define SCTP_INITMSG 2
483 #define SCTP_NODELAY 3 /* Get/set nodelay option. */
484 #define SCTP_AUTOCLOSE 4
485 #define SCTP_SET_PEER_PRIMARY_ADDR 5
486 #define SCTP_PRIMARY_ADDR 6
487 #define SCTP_ADAPTATION_LAYER 7
488 #define SCTP_DISABLE_FRAGMENTS 8
489 #define SCTP_PEER_ADDR_PARAMS 9
490 #define SCTP_DEFAULT_SEND_PARAM 10
491 #define SCTP_EVENTS 11
492 #define SCTP_I_WANT_MAPPED_V4_ADDR 12 /* Turn on/off mapped v4 addresses */
493 #define SCTP_MAXSEG 13 /* Get/set maximum fragment. */
494 #define SCTP_STATUS 14
495 #define SCTP_GET_PEER_ADDR_INFO 15
496 #define SCTP_DELAYED_ACK_TIME 16
497 #define SCTP_CONTEXT 17
498 #define SCTP_FRAGMENT_INTERLEAVE 18
499 #define SCTP_PARTIAL_DELIVERY_POINT 19 /* Set/Get partial delivery point */
500 #define SCTP_MAX_BURST 20 /* Set/Get max burst */
501 #define SCTP_AUTH_CHUNK 21 /* Set only: add a chunk type to authenticate */
502 #define SCTP_HMAC_IDENT 22
503 #define SCTP_AUTH_KEY 23
504 #define SCTP_AUTH_ACTIVE_KEY 24
505 #define SCTP_AUTH_DELETE_KEY 25
506 #define SCTP_PEER_AUTH_CHUNKS 26 /* Read only */
507 #define SCTP_LOCAL_AUTH_CHUNKS 27 /* Read only */
508 #define SCTP_GET_ASSOC_NUMBER 28 /* Read only */
509 #define SCTP_GET_ASSOC_ID_LIST 29 /* Read only */
510 #define SCTP_AUTO_ASCONF 30
511 #define SCTP_PEER_ADDR_THLDS 31
512 #endif
514 #ifndef SCTP_SOCKOPT_BINDX_ADD
515 #define SCTP_SOCKOPT_BINDX_ADD 100 /* BINDX requests for adding addrs */
516 #define SCTP_SOCKOPT_BINDX_REM 101 /* BINDX requests for removing addrs. */
517 #define SCTP_SOCKOPT_PEELOFF 102 /* peel off association. */
518 #define SCTP_SOCKOPT_CONNECTX_OLD 107 /* CONNECTX old requests. */
519 #define SCTP_GET_PEER_ADDRS 108 /* Get all peer address. */
520 #define SCTP_GET_LOCAL_ADDRS 109 /* Get all local address. */
521 #define SCTP_SOCKOPT_CONNECTX 110 /* CONNECTX requests. */
522 #define SCTP_SOCKOPT_CONNECTX3 111 /* CONNECTX requests (updated) */
523 #define SCTP_GET_ASSOC_STATS 112 /* Read only */
524 #endif
526 /* linux/rxrpc.h */
527 #ifndef RXRPC_USER_CALL_ID
528 #define RXRPC_USER_CALL_ID 1 /* user call ID specifier */
529 #define RXRPC_ABORT 2 /* abort request / notification [terminal] */
530 #define RXRPC_ACK 3 /* [Server] RPC op final ACK received [terminal] */
531 #define RXRPC_NET_ERROR 5 /* network error received [terminal] */
532 #define RXRPC_BUSY 6 /* server busy received [terminal] */
533 #define RXRPC_LOCAL_ERROR 7 /* local error generated [terminal] */
534 #define RXRPC_NEW_CALL 8 /* [Server] new incoming call notification */
535 #define RXRPC_ACCEPT 9 /* [Server] accept request */
536 #endif
538 /* net/bluetooth/bluetooth.h */
539 #ifndef BT_SECURITY
540 #define BT_SECURITY 4
541 #define BT_DEFER_SETUP 7
542 #define BT_FLUSHABLE 8
543 #define BT_POWER 9
544 #define BT_CHANNEL_POLICY 10
546 #define SOL_HCI 0
547 #define SOL_L2CAP 6
548 #define SOL_SCO 17
549 #define SOL_RFCOMM 18
550 #endif
552 /* net/bluetooth/hci.h */
553 #ifndef HCI_DATA_DIR
554 #define HCI_DATA_DIR 1
555 #define HCI_FILTER 2
556 #define HCI_TIME_STAMP 3
557 #endif
559 /* net/bluetooth/l2cap.h */
560 #ifndef L2CAP_OPTIONS
561 #define L2CAP_OPTIONS 0x01
562 #define L2CAP_LM 0x03
563 #endif
565 /* net/bluetooth/rfcomm.h */
566 #ifndef RFCOMM_LM
567 #define RFCOMM_LM 0x03
568 #endif
570 /* net/iucv/af_iucv.h */
571 #ifndef SO_IPRMDATA_MSG
572 #define SO_IPRMDATA_MSG 0x0080 /* send/recv IPRM_DATA msgs */
573 #define SO_MSGLIMIT 0x1000 /* get/set IUCV MSGLIMIT */
574 #define SO_MSGSIZE 0x0800 /* get maximum msgsize */
575 #endif
577 /* linux/nfc.h */
578 #ifndef sockaddr_nfc
579 #include <bits/sockaddr.h>
580 #include <linux/types.h>
582 struct sockaddr_nfc {
583 sa_family_t sa_family;
584 __u32 dev_idx;
585 __u32 target_idx;
586 __u32 nfc_protocol;
588 #endif
590 /* linux/inotify.h */
591 #ifndef IN_EXCL_UNLINK
592 #define IN_EXCL_UNLINK 0x04000000 /* exclude events on unlinked objects */
593 #endif
595 #ifndef MSG_COPY
596 #define MSG_COPY 040000
597 #endif
599 #ifndef MS_SNAP_STABLE
600 #define MS_SNAP_STABLE (1<<27)
601 #endif
603 #ifndef MS_NOSEC
604 #define MS_NOSEC (1<<28)
605 #endif
607 #ifndef MS_BORN
608 #define MS_BORN (1<<29)
609 #endif
611 /* linux/kvm.h */
612 #ifndef KVM_GET_REG_LIST
613 struct kvm_reg_list {
614 __u64 n; /* number of regs */
615 __u64 reg[0];
617 #define KVM_GET_REG_LIST _IOWR(KVMIO, 0xb0, struct kvm_reg_list)
618 #endif
620 #ifndef KVM_S390_UCAS_MAP
621 struct kvm_s390_ucas_mapping {
622 __u64 user_addr;
623 __u64 vcpu_addr;
624 __u64 length;
626 #define KVM_S390_UCAS_MAP _IOW(KVMIO, 0x50, struct kvm_s390_ucas_mapping)
627 #endif
629 #ifndef KVM_S390_UCAS_UNMAP
630 #define KVM_S390_UCAS_UNMAP _IOW(KVMIO, 0x51, struct kvm_s390_ucas_mapping)
631 #endif
633 #ifndef KVM_S390_VCPU_FAULT
634 #define KVM_S390_VCPU_FAULT _IOW(KVMIO, 0x52, unsigned long)
635 #endif
637 #ifndef KVM_XEN_HVM_CONFIG
638 struct kvm_xen_hvm_config {
639 __u32 flags;
640 __u32 msr;
641 __u64 blob_addr_32;
642 __u64 blob_addr_64;
643 __u8 blob_size_32;
644 __u8 blob_size_64;
645 __u8 pad2[30];
647 #define KVM_XEN_HVM_CONFIG _IOW(KVMIO, 0x7a, struct kvm_xen_hvm_config)
648 #endif
650 #ifndef KVM_PPC_GET_PVINFO
651 struct kvm_ppc_pvinfo {
652 /* out */
653 __u32 flags;
654 __u32 hcall[4];
655 __u8 pad[108];
657 #define KVM_PPC_GET_PVINFO _IOW(KVMIO, 0xa1, struct kvm_ppc_pvinfo)
658 #endif
660 #ifndef KVM_SET_TSC_KHZ
661 #define KVM_SET_TSC_KHZ _IO(KVMIO, 0xa2)
662 #endif
664 #ifndef KVM_GET_TSC_KHZ
665 #define KVM_GET_TSC_KHZ _IO(KVMIO, 0xa3)
666 #endif
668 #ifndef KVM_ASSIGN_SET_INTX_MASK
669 #define KVM_ASSIGN_SET_INTX_MASK _IOW(KVMIO, 0xa4, struct kvm_assigned_pci_dev)
670 #endif
672 #ifndef KVM_GET_DEBUGREGS
673 struct kvm_debugregs {
674 __u64 db[4];
675 __u64 dr6;
676 __u64 dr7;
677 __u64 flags;
678 __u64 reserved[9];
680 #define KVM_GET_DEBUGREGS _IOR(KVMIO, 0xa1, struct kvm_debugregs)
681 #define KVM_SET_DEBUGREGS _IOW(KVMIO, 0xa2, struct kvm_debugregs)
682 #endif
684 #ifndef KVM_ENABLE_CAP
685 struct kvm_enable_cap {
686 /* in */
687 __u32 cap;
688 __u32 flags;
689 __u64 args[4];
690 __u8 pad[64];
692 #define KVM_ENABLE_CAP _IOW(KVMIO, 0xa3, struct kvm_enable_cap)
693 #endif
695 #ifndef KVM_GET_XSAVE
696 struct kvm_xsave {
697 __u32 region[1024];
699 #define KVM_GET_XSAVE _IOR(KVMIO, 0xa4, struct kvm_xsave)
700 #define KVM_SET_XSAVE _IOW(KVMIO, 0xa5, struct kvm_xsave)
701 #endif
703 #ifndef KVM_GET_XCRS
704 #define KVM_MAX_XCRS 16
705 struct kvm_xcr {
706 __u32 xcr;
707 __u32 reserved;
708 __u64 value;
711 struct kvm_xcrs {
712 __u32 nr_xcrs;
713 __u32 flags;
714 struct kvm_xcr xcrs[KVM_MAX_XCRS];
715 __u64 padding[16];
717 #define KVM_GET_XCRS _IOR(KVMIO, 0xa6, struct kvm_xcrs)
718 #define KVM_SET_XCRS _IOW(KVMIO, 0xa7, struct kvm_xcrs)
719 #endif
721 #ifndef KVM_SIGNAL_MSI
722 struct kvm_msi {
723 __u32 address_lo;
724 __u32 address_hi;
725 __u32 data;
726 __u32 flags;
727 __u8 pad[16];
729 #define KVM_SIGNAL_MSI _IOW(KVMIO, 0xa5, struct kvm_msi)
730 #endif
732 #ifndef KVM_DIRTY_TLB
733 struct kvm_dirty_tlb {
734 __u64 bitmap;
735 __u32 num_dirty;
737 #define KVM_DIRTY_TLB _IOW(KVMIO, 0xaa, struct kvm_dirty_tlb)
738 #endif
740 #ifndef KVM_GET_ONE_REG
741 struct kvm_one_reg {
742 __u64 id;
743 __u64 addr;
745 #define KVM_GET_ONE_REG _IOW(KVMIO, 0xab, struct kvm_one_reg)
746 #endif
748 #ifndef KVM_SET_ONE_REG
749 #define KVM_SET_ONE_REG _IOW(KVMIO, 0xac, struct kvm_one_reg)
750 #endif
752 #ifndef KVM_KVMCLOCK_CTRL
753 #define KVM_KVMCLOCK_CTRL _IO(KVMIO, 0xad)
754 #endif
756 #ifndef KVM_PPC_GET_SMMU_INFO
757 #define KVM_PPC_PAGE_SIZES_MAX_SZ 8
759 struct kvm_ppc_one_page_size {
760 __u32 page_shift; /* Page shift (or 0) */
761 __u32 pte_enc; /* Encoding in the HPTE (>>12) */
764 struct kvm_ppc_one_seg_page_size {
765 __u32 page_shift; /* Base page shift of segment (or 0) */
766 __u32 slb_enc; /* SLB encoding for BookS */
767 struct kvm_ppc_one_page_size enc[KVM_PPC_PAGE_SIZES_MAX_SZ];
770 struct kvm_ppc_smmu_info {
771 __u64 flags;
772 __u32 slb_size;
773 __u32 pad;
774 struct kvm_ppc_one_seg_page_size sps[KVM_PPC_PAGE_SIZES_MAX_SZ];
776 #define KVM_PPC_GET_SMMU_INFO _IOR(KVMIO, 0xa6, struct kvm_ppc_smmu_info)
777 #endif
779 #ifndef KVM_PPC_ALLOCATE_HTAB
780 #define KVM_PPC_ALLOCATE_HTAB _IOWR(KVMIO, 0xa7, __u32)
781 #endif
783 #ifndef KVM_PPC_GET_HTAB_FD
784 struct kvm_get_htab_fd {
785 __u64 flags;
786 __u64 start_index;
787 __u64 reserved[2];
789 #define KVM_PPC_GET_HTAB_FD _IOW(KVMIO, 0xaa, struct kvm_get_htab_fd)
790 #endif
792 #ifndef EM_ARM
793 #define EM_ARM 40
794 #endif
796 /* linux/mroute.h */
797 #ifndef MRT_TABLE
798 #define MRT_TABLE (MRT_BASE+9)
799 #endif
800 #ifndef MRT_ADD_MFC_PROXY
801 #define MRT_ADD_MFC_PROXY (MRT_BASE+10)
802 #endif
803 #ifndef MRT_DEL_MFC_PROXY
804 #define MRT_DEL_MFC_PROXY (MRT_BASE+11)
805 #endif
807 /* sys/mount.h */
808 #ifndef MNT_DETACH
809 #define MNT_DETACH 2
810 #endif
812 #ifndef MNT_EXPIRE
813 #define MNT_EXPIRE 4
814 #endif
816 #ifndef UMOUNT_NOFOLLOW
817 #define UMOUNT_NOFOLLOW 8
818 #endif
820 /* if_ether.h */
821 #ifndef ETH_P_CANFD
822 #define ETH_P_CANFD 0x000D
823 #endif
824 #ifndef ETH_P_CAIF
825 #define ETH_P_CAIF 0x00F7
826 #endif
827 #ifndef ETH_P_802_3_MIN
828 #define ETH_P_802_3_MIN 0x0600
829 #endif
830 #ifndef ETH_P_BATMAN
831 #define ETH_P_BATMAN 0x4305
832 #endif
833 #ifndef ETH_P_LINK_CTL
834 #define ETH_P_LINK_CTL 0x886c
835 #endif
836 #ifndef ETH_P_8021AD
837 #define ETH_P_8021AD 0x88A8
838 #endif
839 #ifndef ETH_P_802_EX1
840 #define ETH_P_802_EX1 0x88B5
841 #endif
842 #ifndef ETH_P_8021AH
843 #define ETH_P_8021AH 0x88E7
844 #endif
845 #ifndef ETH_P_MVRP
846 #define ETH_P_MVRP 0x88F5
847 #endif
848 #ifndef ETH_P_PRP
849 #define ETH_P_PRP 0x88FB
850 #endif
851 #ifndef ETH_P_TDLS
852 #define ETH_P_TDLS 0x890D
853 #endif
854 #ifndef ETH_P_QINQ1
855 #define ETH_P_QINQ1 0x9100
856 #endif
857 #ifndef ETH_P_QINQ2
858 #define ETH_P_QINQ2 0x9200
859 #endif
860 #ifndef ETH_P_QINQ3
861 #define ETH_P_QINQ3 0x9300
862 #endif
863 #ifndef ETH_P_AF_IUCV
864 #define ETH_P_AF_IUCV 0xFBFB
865 #endif
867 /* sched.h */
868 #ifndef SCHED_DEADLINE
869 #define SCHED_DEADLINE 6
870 #endif
872 /* sys/swap.h */
873 #ifndef SWAP_FLAG_DISCARD
874 #define SWAP_FLAG_DISCARD 0x10000
875 #endif