1 /* 2 * This header was generated from the Linux kernel headers by update_headers.py, 3 * to provide necessary information from kernel to userspace, such as constants, 4 * structures, and macros, and thus, contains no copyrightable information. 5 */ 6 #ifndef __LINUX_PUBLIC_PRIVCMD_H__ 7 #define __LINUX_PUBLIC_PRIVCMD_H__ 8 #include <linux/types.h> 9 #include <linux/compiler.h> 10 #include <xen/interface/xen.h> 11 struct privcmd_hypercall { 12 __u64 op; 13 __u64 arg[5]; 14 }; 15 struct privcmd_mmap_entry { 16 __u64 va; 17 18 __u64 mfn; 19 __u64 npages; 20 }; 21 struct privcmd_mmap { 22 int num; 23 domid_t dom; 24 struct privcmd_mmap_entry __user *entry; 25 }; 26 struct privcmd_mmapbatch { 27 int num; 28 domid_t dom; 29 __u64 addr; 30 xen_pfn_t __user *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 __user *arr; 39 int __user *err; 40 }; 41 struct privcmd_dm_op_buf { 42 void __user *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 __user *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 IOCTL_PRIVCMD_HYPERCALL \ 59 _IOC(_IOC_NONE, 'P', 0, sizeof(struct privcmd_hypercall)) 60 #define IOCTL_PRIVCMD_MMAP \ 61 _IOC(_IOC_NONE, 'P', 2, sizeof(struct privcmd_mmap)) 62 #define IOCTL_PRIVCMD_MMAPBATCH \ 63 _IOC(_IOC_NONE, 'P', 3, sizeof(struct privcmd_mmapbatch)) 64 #define IOCTL_PRIVCMD_MMAPBATCH_V2 \ 65 _IOC(_IOC_NONE, 'P', 4, sizeof(struct privcmd_mmapbatch_v2)) 66 #define IOCTL_PRIVCMD_DM_OP \ 67 _IOC(_IOC_NONE, 'P', 5, sizeof(struct privcmd_dm_op)) 68 #define IOCTL_PRIVCMD_RESTRICT \ 69 _IOC(_IOC_NONE, 'P', 6, sizeof(domid_t)) 70 #define IOCTL_PRIVCMD_MMAP_RESOURCE \ 71 _IOC(_IOC_NONE, 'P', 7, sizeof(struct privcmd_mmap_resource)) 72 #endif 73