Elliott Hughes | 180edef | 2023-11-02 00:08:05 +0000 | [diff] [blame] | 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 | */ |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 7 | #ifndef __LINUX_PUBLIC_PRIVCMD_H__ |
| 8 | #define __LINUX_PUBLIC_PRIVCMD_H__ |
| 9 | #include <linux/types.h> |
| 10 | #include <linux/compiler.h> |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 11 | #include <xen/interface/xen.h> |
| 12 | struct privcmd_hypercall { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 13 | __u64 op; |
| 14 | __u64 arg[5]; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 15 | }; |
| 16 | struct privcmd_mmap_entry { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 17 | __u64 va; |
| 18 | __u64 mfn; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 19 | __u64 npages; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 20 | }; |
| 21 | struct privcmd_mmap { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 22 | int num; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 23 | domid_t dom; |
Elliott Hughes | 0f0c18f | 2023-03-29 15:53:31 -0700 | [diff] [blame] | 24 | struct privcmd_mmap_entry * entry; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 25 | }; |
| 26 | struct privcmd_mmapbatch { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 27 | int num; |
| 28 | domid_t dom; |
| 29 | __u64 addr; |
Elliott Hughes | 0f0c18f | 2023-03-29 15:53:31 -0700 | [diff] [blame] | 30 | xen_pfn_t * arr; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 31 | }; |
| 32 | #define PRIVCMD_MMAPBATCH_MFN_ERROR 0xf0000000U |
| 33 | #define PRIVCMD_MMAPBATCH_PAGED_ERROR 0x80000000U |
| 34 | struct privcmd_mmapbatch_v2 { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 35 | unsigned int num; |
| 36 | domid_t dom; |
| 37 | __u64 addr; |
Elliott Hughes | 0f0c18f | 2023-03-29 15:53:31 -0700 | [diff] [blame] | 38 | const xen_pfn_t * arr; |
| 39 | int * err; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 40 | }; |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 41 | struct privcmd_dm_op_buf { |
Elliott Hughes | 0f0c18f | 2023-03-29 15:53:31 -0700 | [diff] [blame] | 42 | void * uptr; |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 43 | size_t size; |
| 44 | }; |
| 45 | struct privcmd_dm_op { |
| 46 | domid_t dom; |
| 47 | __u16 num; |
Elliott Hughes | 0f0c18f | 2023-03-29 15:53:31 -0700 | [diff] [blame] | 48 | const struct privcmd_dm_op_buf * ubufs; |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 49 | }; |
Christopher Ferris | 9ce2884 | 2018-10-25 12:11:39 -0700 | [diff] [blame] | 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 | }; |
Christopher Ferris | 67d1e5e | 2023-10-31 13:36:37 -0700 | [diff] [blame] | 58 | #define PRIVCMD_IRQFD_FLAG_DEASSIGN (1 << 0) |
| 59 | struct privcmd_irqfd { |
Christopher Ferris | 0f79521 | 2024-01-17 14:17:28 -0800 | [diff] [blame] | 60 | __u64 dm_op; |
Christopher Ferris | 67d1e5e | 2023-10-31 13:36:37 -0700 | [diff] [blame] | 61 | __u32 size; |
| 62 | __u32 fd; |
| 63 | __u32 flags; |
| 64 | domid_t dom; |
| 65 | __u8 pad[2]; |
| 66 | }; |
Christopher Ferris | 0f79521 | 2024-01-17 14:17:28 -0800 | [diff] [blame] | 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 | }; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 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)) |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 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)) |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 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)) |
Christopher Ferris | 9ce2884 | 2018-10-25 12:11:39 -0700 | [diff] [blame] | 86 | #define IOCTL_PRIVCMD_MMAP_RESOURCE _IOC(_IOC_NONE, 'P', 7, sizeof(struct privcmd_mmap_resource)) |
Christopher Ferris | 0f79521 | 2024-01-17 14:17:28 -0800 | [diff] [blame] | 87 | #define IOCTL_PRIVCMD_IRQFD _IOW('P', 8, struct privcmd_irqfd) |
| 88 | #define IOCTL_PRIVCMD_IOEVENTFD _IOW('P', 9, struct privcmd_ioeventfd) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 89 | #endif |