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_GNTDEV_H__ 8 #define __LINUX_PUBLIC_GNTDEV_H__ 9 #include <linux/types.h> 10 struct ioctl_gntdev_grant_ref { 11 __u32 domid; 12 __u32 ref; 13 }; 14 #define IOCTL_GNTDEV_MAP_GRANT_REF _IOC(_IOC_NONE, 'G', 0, sizeof(struct ioctl_gntdev_map_grant_ref)) 15 struct ioctl_gntdev_map_grant_ref { 16 __u32 count; 17 __u32 pad; 18 __u64 index; 19 struct ioctl_gntdev_grant_ref refs[1]; 20 }; 21 #define IOCTL_GNTDEV_UNMAP_GRANT_REF _IOC(_IOC_NONE, 'G', 1, sizeof(struct ioctl_gntdev_unmap_grant_ref)) 22 struct ioctl_gntdev_unmap_grant_ref { 23 __u64 index; 24 __u32 count; 25 __u32 pad; 26 }; 27 #define IOCTL_GNTDEV_GET_OFFSET_FOR_VADDR _IOC(_IOC_NONE, 'G', 2, sizeof(struct ioctl_gntdev_get_offset_for_vaddr)) 28 struct ioctl_gntdev_get_offset_for_vaddr { 29 __u64 vaddr; 30 __u64 offset; 31 __u32 count; 32 __u32 pad; 33 }; 34 #define IOCTL_GNTDEV_SET_MAX_GRANTS _IOC(_IOC_NONE, 'G', 3, sizeof(struct ioctl_gntdev_set_max_grants)) 35 struct ioctl_gntdev_set_max_grants { 36 __u32 count; 37 }; 38 #define IOCTL_GNTDEV_SET_UNMAP_NOTIFY _IOC(_IOC_NONE, 'G', 7, sizeof(struct ioctl_gntdev_unmap_notify)) 39 struct ioctl_gntdev_unmap_notify { 40 __u64 index; 41 __u32 action; 42 __u32 event_channel_port; 43 }; 44 struct gntdev_grant_copy_segment { 45 union { 46 void * virt; 47 struct { 48 grant_ref_t ref; 49 __u16 offset; 50 domid_t domid; 51 } foreign; 52 } source, dest; 53 __u16 len; 54 __u16 flags; 55 __s16 status; 56 }; 57 #define IOCTL_GNTDEV_GRANT_COPY _IOC(_IOC_NONE, 'G', 8, sizeof(struct ioctl_gntdev_grant_copy)) 58 struct ioctl_gntdev_grant_copy { 59 unsigned int count; 60 struct gntdev_grant_copy_segment * segments; 61 }; 62 #define UNMAP_NOTIFY_CLEAR_BYTE 0x1 63 #define UNMAP_NOTIFY_SEND_EVENT 0x2 64 #define GNTDEV_DMA_FLAG_WC (1 << 0) 65 #define GNTDEV_DMA_FLAG_COHERENT (1 << 1) 66 #define IOCTL_GNTDEV_DMABUF_EXP_FROM_REFS _IOC(_IOC_NONE, 'G', 9, sizeof(struct ioctl_gntdev_dmabuf_exp_from_refs)) 67 struct ioctl_gntdev_dmabuf_exp_from_refs { 68 __u32 flags; 69 __u32 count; 70 __u32 fd; 71 __u32 domid; 72 __u32 refs[1]; 73 }; 74 #define IOCTL_GNTDEV_DMABUF_EXP_WAIT_RELEASED _IOC(_IOC_NONE, 'G', 10, sizeof(struct ioctl_gntdev_dmabuf_exp_wait_released)) 75 struct ioctl_gntdev_dmabuf_exp_wait_released { 76 __u32 fd; 77 __u32 wait_to_ms; 78 }; 79 #define IOCTL_GNTDEV_DMABUF_IMP_TO_REFS _IOC(_IOC_NONE, 'G', 11, sizeof(struct ioctl_gntdev_dmabuf_imp_to_refs)) 80 struct ioctl_gntdev_dmabuf_imp_to_refs { 81 __u32 fd; 82 __u32 count; 83 __u32 domid; 84 __u32 reserved; 85 __u32 refs[1]; 86 }; 87 #define IOCTL_GNTDEV_DMABUF_IMP_RELEASE _IOC(_IOC_NONE, 'G', 12, sizeof(struct ioctl_gntdev_dmabuf_imp_release)) 88 struct ioctl_gntdev_dmabuf_imp_release { 89 __u32 fd; 90 __u32 reserved; 91 }; 92 #endif 93