1 /*
2  * This file is auto-generated. Modifications will be lost.
3  *
4  * See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/
5  * for more information.
6  */
7 #ifndef __LINUX_PUBLIC_PRIVCMD_H__
8 #define __LINUX_PUBLIC_PRIVCMD_H__
9 #include <linux/types.h>
10 #include <linux/compiler.h>
11 #include <xen/interface/xen.h>
12 struct privcmd_hypercall {
13   __u64 op;
14   __u64 arg[5];
15 };
16 struct privcmd_mmap_entry {
17   __u64 va;
18   __u64 mfn;
19   __u64 npages;
20 };
21 struct privcmd_mmap {
22   int num;
23   domid_t dom;
24   struct privcmd_mmap_entry  * entry;
25 };
26 struct privcmd_mmapbatch {
27   int num;
28   domid_t dom;
29   __u64 addr;
30   xen_pfn_t  * arr;
31 };
32 #define PRIVCMD_MMAPBATCH_MFN_ERROR 0xf0000000U
33 #define PRIVCMD_MMAPBATCH_PAGED_ERROR 0x80000000U
34 struct privcmd_mmapbatch_v2 {
35   unsigned int num;
36   domid_t dom;
37   __u64 addr;
38   const xen_pfn_t  * arr;
39   int  * err;
40 };
41 struct privcmd_dm_op_buf {
42   void  * uptr;
43   size_t size;
44 };
45 struct privcmd_dm_op {
46   domid_t dom;
47   __u16 num;
48   const struct privcmd_dm_op_buf  * ubufs;
49 };
50 struct privcmd_mmap_resource {
51   domid_t dom;
52   __u32 type;
53   __u32 id;
54   __u32 idx;
55   __u64 num;
56   __u64 addr;
57 };
58 #define PRIVCMD_IRQFD_FLAG_DEASSIGN (1 << 0)
59 struct privcmd_irqfd {
60   __u64 dm_op;
61   __u32 size;
62   __u32 fd;
63   __u32 flags;
64   domid_t dom;
65   __u8 pad[2];
66 };
67 #define PRIVCMD_IOEVENTFD_FLAG_DEASSIGN (1 << 0)
68 struct privcmd_ioeventfd {
69   __u64 ioreq;
70   __u64 ports;
71   __u64 addr;
72   __u32 addr_len;
73   __u32 event_fd;
74   __u32 vcpus;
75   __u32 vq;
76   __u32 flags;
77   domid_t dom;
78   __u8 pad[2];
79 };
80 #define IOCTL_PRIVCMD_HYPERCALL _IOC(_IOC_NONE, 'P', 0, sizeof(struct privcmd_hypercall))
81 #define IOCTL_PRIVCMD_MMAP _IOC(_IOC_NONE, 'P', 2, sizeof(struct privcmd_mmap))
82 #define IOCTL_PRIVCMD_MMAPBATCH _IOC(_IOC_NONE, 'P', 3, sizeof(struct privcmd_mmapbatch))
83 #define IOCTL_PRIVCMD_MMAPBATCH_V2 _IOC(_IOC_NONE, 'P', 4, sizeof(struct privcmd_mmapbatch_v2))
84 #define IOCTL_PRIVCMD_DM_OP _IOC(_IOC_NONE, 'P', 5, sizeof(struct privcmd_dm_op))
85 #define IOCTL_PRIVCMD_RESTRICT _IOC(_IOC_NONE, 'P', 6, sizeof(domid_t))
86 #define IOCTL_PRIVCMD_MMAP_RESOURCE _IOC(_IOC_NONE, 'P', 7, sizeof(struct privcmd_mmap_resource))
87 #define IOCTL_PRIVCMD_IRQFD _IOW('P', 8, struct privcmd_irqfd)
88 #define IOCTL_PRIVCMD_IOEVENTFD _IOW('P', 9, struct privcmd_ioeventfd)
89 #endif
90