• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /****************************************************************************
2  ****************************************************************************
3  ***
4  ***   This header was automatically generated from a Linux kernel header
5  ***   of the same name, to make information necessary for userspace to
6  ***   call into the kernel available to libc.  It contains only constants,
7  ***   structures, and macros generated from the original header, and thus,
8  ***   contains no copyrightable information.
9  ***
10  ***   To edit the content of this header, modify the corresponding
11  ***   source file (e.g. under external/kernel-headers/original/) then
12  ***   run bionic/libc/kernel/tools/update_all.py
13  ***
14  ***   Any manual change here will be lost the next time this script will
15  ***   be run. You've been warned!
16  ***
17  ****************************************************************************
18  ****************************************************************************/
19 #ifndef __LINUX_PUBLIC_GNTDEV_H__
20 #define __LINUX_PUBLIC_GNTDEV_H__
21 #include <linux/types.h>
22 struct ioctl_gntdev_grant_ref {
23   __u32 domid;
24   __u32 ref;
25 };
26 #define IOCTL_GNTDEV_MAP_GRANT_REF _IOC(_IOC_NONE, 'G', 0, sizeof(struct ioctl_gntdev_map_grant_ref))
27 struct ioctl_gntdev_map_grant_ref {
28   __u32 count;
29   __u32 pad;
30   __u64 index;
31   struct ioctl_gntdev_grant_ref refs[1];
32 };
33 #define IOCTL_GNTDEV_UNMAP_GRANT_REF _IOC(_IOC_NONE, 'G', 1, sizeof(struct ioctl_gntdev_unmap_grant_ref))
34 struct ioctl_gntdev_unmap_grant_ref {
35   __u64 index;
36   __u32 count;
37   __u32 pad;
38 };
39 #define IOCTL_GNTDEV_GET_OFFSET_FOR_VADDR _IOC(_IOC_NONE, 'G', 2, sizeof(struct ioctl_gntdev_get_offset_for_vaddr))
40 struct ioctl_gntdev_get_offset_for_vaddr {
41   __u64 vaddr;
42   __u64 offset;
43   __u32 count;
44   __u32 pad;
45 };
46 #define IOCTL_GNTDEV_SET_MAX_GRANTS _IOC(_IOC_NONE, 'G', 3, sizeof(struct ioctl_gntdev_set_max_grants))
47 struct ioctl_gntdev_set_max_grants {
48   __u32 count;
49 };
50 #define IOCTL_GNTDEV_SET_UNMAP_NOTIFY _IOC(_IOC_NONE, 'G', 7, sizeof(struct ioctl_gntdev_unmap_notify))
51 struct ioctl_gntdev_unmap_notify {
52   __u64 index;
53   __u32 action;
54   __u32 event_channel_port;
55 };
56 struct gntdev_grant_copy_segment {
57   union {
58     void __user * virt;
59     struct {
60       grant_ref_t ref;
61       __u16 offset;
62       domid_t domid;
63     } foreign;
64   } source, dest;
65   __u16 len;
66   __u16 flags;
67   __s16 status;
68 };
69 #define IOCTL_GNTDEV_GRANT_COPY _IOC(_IOC_NONE, 'G', 8, sizeof(struct ioctl_gntdev_grant_copy))
70 struct ioctl_gntdev_grant_copy {
71   unsigned int count;
72   struct gntdev_grant_copy_segment __user * segments;
73 };
74 #define UNMAP_NOTIFY_CLEAR_BYTE 0x1
75 #define UNMAP_NOTIFY_SEND_EVENT 0x2
76 #define GNTDEV_DMA_FLAG_WC (1 << 0)
77 #define GNTDEV_DMA_FLAG_COHERENT (1 << 1)
78 #define IOCTL_GNTDEV_DMABUF_EXP_FROM_REFS _IOC(_IOC_NONE, 'G', 9, sizeof(struct ioctl_gntdev_dmabuf_exp_from_refs))
79 struct ioctl_gntdev_dmabuf_exp_from_refs {
80   __u32 flags;
81   __u32 count;
82   __u32 fd;
83   __u32 domid;
84   __u32 refs[1];
85 };
86 #define IOCTL_GNTDEV_DMABUF_EXP_WAIT_RELEASED _IOC(_IOC_NONE, 'G', 10, sizeof(struct ioctl_gntdev_dmabuf_exp_wait_released))
87 struct ioctl_gntdev_dmabuf_exp_wait_released {
88   __u32 fd;
89   __u32 wait_to_ms;
90 };
91 #define IOCTL_GNTDEV_DMABUF_IMP_TO_REFS _IOC(_IOC_NONE, 'G', 11, sizeof(struct ioctl_gntdev_dmabuf_imp_to_refs))
92 struct ioctl_gntdev_dmabuf_imp_to_refs {
93   __u32 fd;
94   __u32 count;
95   __u32 domid;
96   __u32 reserved;
97   __u32 refs[1];
98 };
99 #define IOCTL_GNTDEV_DMABUF_IMP_RELEASE _IOC(_IOC_NONE, 'G', 12, sizeof(struct ioctl_gntdev_dmabuf_imp_release))
100 struct ioctl_gntdev_dmabuf_imp_release {
101   __u32 fd;
102   __u32 reserved;
103 };
104 #endif
105